decocms 4.584.5 → 4.584.6

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 (472) hide show
  1. package/dist/client/assets/{AlertCircle-mj0sz0gj.js → AlertCircle-CPiOwWun.js} +1 -1
  2. package/dist/client/assets/{AreaChart-DSUaBnyJ.js → AreaChart-DviRRHwS.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft--TSM2Ux3.js → ArrowLeft-BmNyLgKT.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-BVFSrvKf.js → ArrowRight-eaR9pEFa.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-D2bbOB2w.js → ArrowUp-jEyjY7ti.js} +1 -1
  6. package/dist/client/assets/{BookOpen01-CTUEdBiB.js → BookOpen01-anezSoTd.js} +1 -1
  7. package/dist/client/assets/{CartesianChart-DynFqoj3.js → CartesianChart-CCoStszf.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-_BlSk5IS.js → CategoricalChart-D4s5JRnh.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-BsBF4S8u.js → CheckCircle-Cyt1BwLE.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-CNlehUMA.js → ChevronDown-DHu3fSw0.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-BdBrg7yc.js → ChevronSelectorVertical-CADaAEiD.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-BIaMfxq-.js → ChevronUp-XsNgN3o9.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-gHUc2u28.js → CreditCard01-Cu1-B7H4.js} +1 -1
  14. package/dist/client/assets/{Eye-Xo5rS9iJ.js → Eye-w_JiO-fJ.js} +1 -1
  15. package/dist/client/assets/{File02-uZRQiPOp.js → File02-CG-VTATo.js} +1 -1
  16. package/dist/client/assets/{Globe04-DhsnPBDD.js → Globe04-OpdFYH01.js} +1 -1
  17. package/dist/client/assets/{Image01-C5Xqhwp5.js → Image01-Y2lD5lzL.js} +1 -1
  18. package/dist/client/assets/{Key01-h9Y3uaT_.js → Key01-BzZWEKIv.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-CPMSR00X.js → LayoutLeft-BRKXPCjt.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-CxV1rDqL.js → LinkBroken01-oT9QqlUI.js} +1 -1
  21. package/dist/client/assets/MessageCircle01-Ccsb6qrK.js +1 -0
  22. package/dist/client/assets/{Minus-D55MDhYc.js → Minus-CqZyDWGo.js} +1 -1
  23. package/dist/client/assets/{Monitor01-CBUOgSaC.js → Monitor01-BwGctKTP.js} +1 -1
  24. package/dist/client/assets/{Play-zsnTCnBK.js → Play-CBJR-IvJ.js} +1 -1
  25. package/dist/client/assets/{Plus-DAYIm6ow.js → Plus-INbg-jHc.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-Ccilwreq.js → ReferenceLine-xYjCzhRl.js} +1 -1
  27. package/dist/client/assets/{SearchMd-CTSUPag9.js → SearchMd-zyGFO7cc.js} +1 -1
  28. package/dist/client/assets/{ShoppingBag01-CF4EYiC_.js → ShoppingBag01-DM_RSubP.js} +1 -1
  29. package/dist/client/assets/{Sun-B-xu6eHR.js → Sun-DjNmeFt2.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-qTGCOGX6.js → SwitchHorizontal01-Cfysn-sK.js} +1 -1
  31. package/dist/client/assets/{Tool01-Bscrvuft.js → Tool01-BR1SF2OD.js} +1 -1
  32. package/dist/client/assets/{Tooltip-EHWPdrLL.js → Tooltip-A8NJxZe2.js} +1 -1
  33. package/dist/client/assets/{Trash01-CevYpZEM.js → Trash01-thCRPjRX.js} +1 -1
  34. package/dist/client/assets/{TrendUp01-DMf7H3tv.js → TrendUp01-PuhB09lM.js} +1 -1
  35. package/dist/client/assets/{Upload01-C_8HEOMT.js → Upload01-phZoBZ05.js} +1 -1
  36. package/dist/client/assets/{UserCheck01-4mEtfdkD.js → UserCheck01-D6gLgI3l.js} +1 -1
  37. package/dist/client/assets/{UserSquare-oo1b4ulW.js → UserSquare-BHfTOZb7.js} +1 -1
  38. package/dist/client/assets/{Users01-av_p4B03.js → Users01-DVJrVMQW.js} +1 -1
  39. package/dist/client/assets/{XClose-WYCPZpkD.js → XClose-_lsllZaX.js} +1 -1
  40. package/dist/client/assets/{Zap-C-VVHO-P.js → Zap-B4USkjaG.js} +1 -1
  41. package/dist/client/assets/{access-gate-CBj6VxJ7.js → access-gate-BNdHKm1_.js} +1 -1
  42. package/dist/client/assets/{add-connection-dialog-CVC64Gmd.js → add-connection-dialog-6UuPoub8.js} +1 -1
  43. package/dist/client/assets/agent-app-lmDlBMa5.js +1 -0
  44. package/dist/client/assets/agent-assets-BN7WhmKl.js +1 -0
  45. package/dist/client/assets/{agent-automation-e9KFVJPg.js → agent-automation-v65X1xNt.js} +1 -1
  46. package/dist/client/assets/agent-automations-BeeN_BVh.js +1 -0
  47. package/dist/client/assets/agent-blog-BFEHxit4.js +2 -0
  48. package/dist/client/assets/agent-blog-post-B1rvGpYz.js +2 -0
  49. package/dist/client/assets/agent-calendar-DBKIf8Hf.js +1 -0
  50. package/dist/client/assets/{agent-capabilities-DEMFK1PG.js → agent-capabilities-BTvAxwai.js} +1 -1
  51. package/dist/client/assets/agent-connect-sources-DaR7U6rn.js +1 -0
  52. package/dist/client/assets/agent-deck-CIU6uWE2.js +1 -0
  53. package/dist/client/assets/agent-e2e-110pSWXT.js +1 -0
  54. package/dist/client/assets/agent-experiments-DJt8HpNL.js +1 -0
  55. package/dist/client/assets/agent-file-DhEq-PgR.js +1 -0
  56. package/dist/client/assets/agent-hosting-De3hAgD0.js +1 -0
  57. package/dist/client/assets/agent-icon-BHVUedtV.js +1 -0
  58. package/dist/client/assets/agent-library-Br8v5MtW.js +1 -0
  59. package/dist/client/assets/agent-library-file-B0DaymPI.js +1 -0
  60. package/dist/client/assets/agent-overview-CSM2fYNF.js +1 -0
  61. package/dist/client/assets/{agent-releases-D4ESN3iT.js → agent-releases-DughmMr9.js} +1 -1
  62. package/dist/client/assets/agent-settings-B-H1WO5c.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-DBCTlamd.js → agent-site-editor-CkKxXUCS.js} +1 -1
  64. package/dist/client/assets/agent-site-editor-code-gGn1LR2B.js +2 -0
  65. package/dist/client/assets/agent-site-editor-content-N_B-mw4A.js +1 -0
  66. package/dist/client/assets/agent-site-editor-preview-DLVtRjzS.js +1 -0
  67. package/dist/client/assets/agent-view-CrGDO6Mp.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-BZTSZPH3.js → agent-view-guard-_mDgSmkI.js} +1 -1
  69. package/dist/client/assets/{ai-providers-Bd027SSh.js → ai-providers-Cxi9FSbe.js} +1 -1
  70. package/dist/client/assets/{alert-fpttYoSQ.js → alert-DxQDfLz2.js} +1 -1
  71. package/dist/client/assets/{analytics-sections-BqryzJvo.js → analytics-sections-Dh2b8_pn.js} +1 -1
  72. package/dist/client/assets/api-keys-B2pOUk_Z.js +1 -0
  73. package/dist/client/assets/{api-keys-DLlJejJF.js → api-keys-Be2yLPsn.js} +1 -1
  74. package/dist/client/assets/app-editor-QhVYHGub.js +1 -0
  75. package/dist/client/assets/{asset-utils-C_CFQkKi.js → asset-utils-D9WZTXXH.js} +1 -1
  76. package/dist/client/assets/{auth-BOZ5swZI.js → auth-Bl-k7r97.js} +1 -1
  77. package/dist/client/assets/{auth-catchall-DXChUDcZ.js → auth-catchall-ByvekoyT.js} +1 -1
  78. package/dist/client/assets/{auth-entry-DMbaj7KI.js → auth-entry-BPxiAcBl.js} +1 -1
  79. package/dist/client/assets/{auth-split-layout-DNd6b-pH.js → auth-split-layout-DgG0w0d3.js} +1 -1
  80. package/dist/client/assets/{authenticate-and-persist-oauth-Cj46Ik0_.js → authenticate-and-persist-oauth-C1fZAYJ2.js} +1 -1
  81. package/dist/client/assets/{automation-list-row-Cpitkm-C.js → automation-list-row-B3jZpRQS.js} +1 -1
  82. package/dist/client/assets/{automation-runs-BxBjhLC7.js → automation-runs-TDsSFV6_.js} +1 -1
  83. package/dist/client/assets/automations-DFpmHeuU.js +1 -0
  84. package/dist/client/assets/{badge-CEYLDtOG.js → badge-D21Nz4Kd.js} +1 -1
  85. package/dist/client/assets/{block-document-DJdZyw2U.js → block-document-DPaNpm7b.js} +1 -1
  86. package/dist/client/assets/{blocks-preview-workspace-context-LI4fVaaR.js → blocks-preview-workspace-context-C1jP5wlw.js} +1 -1
  87. package/dist/client/assets/{blocks-tab-states-Bx0tgd5u.js → blocks-tab-states-CRdiUDZv.js} +1 -1
  88. package/dist/client/assets/{blog-preview-url-6gNfi5Cv.js → blog-preview-url-DuOaesBL.js} +1 -1
  89. package/dist/client/assets/{blog-schema-BKDvfgHw.js → blog-schema-DejZvpsz.js} +1 -1
  90. package/dist/client/assets/{blog-source-gate-BClmYTyo.js → blog-source-gate-BE11jy2O.js} +1 -1
  91. package/dist/client/assets/{blog-view-gate-eJ0uCj97.js → blog-view-gate-CbTFiiJR.js} +1 -1
  92. package/dist/client/assets/{buckets-DWNc5IQi.js → buckets-BoV3lkvR.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-CncoFUT6.js → build-improve-prompt-doc-B4DjxnO3.js} +1 -1
  94. package/dist/client/assets/{calendar-B0VrIuVV.js → calendar-DBDouA4h.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-D7_TKHDu.js → capability-load-error-Bn6ne_sq.js} +1 -1
  96. package/dist/client/assets/category-editor-Ckuu4IrY.js +1 -0
  97. package/dist/client/assets/{category-tree-T_JTuIiu.js → category-tree-DA278Cug.js} +1 -1
  98. package/dist/client/assets/{chart-Ef5OJL7Y.js → chart-B0Dqhb4y.js} +1 -1
  99. package/dist/client/assets/{chat-context-BUMEnIPW.js → chat-context-CN0ge7G_.js} +1 -1
  100. package/dist/client/assets/{chat-draft-B7hvjq7e.js → chat-draft-2YOnJD42.js} +1 -1
  101. package/dist/client/assets/{checkbox-BUvWR-iD.js → checkbox-B1iPgrjx.js} +1 -1
  102. package/dist/client/assets/choose-editor-Di3gRusv.js +1 -0
  103. package/dist/client/assets/{cli-auth-success-CIy6cPVO.js → cli-auth-success-CgfmAJWB.js} +1 -1
  104. package/dist/client/assets/cms-settings-editor-D1TcT96z.js +1 -0
  105. package/dist/client/assets/{cms-store-drafts-BNAdDXxB.js → cms-store-drafts-u7ki7lCC.js} +1 -1
  106. package/dist/client/assets/{collapsible-DYCInqz3.js → collapsible-Cw6OK2nn.js} +1 -1
  107. package/dist/client/assets/collection-detail-B-bIqzEz.js +1 -0
  108. package/dist/client/assets/{collection-display-button-C3xi0T_X.js → collection-display-button-CuVi5neC.js} +1 -1
  109. package/dist/client/assets/{collection-search-CMlKHTQ0.js → collection-search-Z4PinuXc.js} +1 -1
  110. package/dist/client/assets/{collection-table-wrapper-DbIa5pBT.js → collection-table-wrapper-8J2sfJZU.js} +1 -1
  111. package/dist/client/assets/{collection-tabs-ZW6Qb_Ul.js → collection-tabs-attgS7fY.js} +1 -1
  112. package/dist/client/assets/{combobox-CMR7JQ5s.js → combobox-DEB0BlzS.js} +1 -1
  113. package/dist/client/assets/{command-DAachgGl.js → command-_zJuKDCi.js} +1 -1
  114. package/dist/client/assets/{companion-mcps-section-DFAviA9V.js → companion-mcps-section-DGVC3-Wp.js} +1 -1
  115. package/dist/client/assets/{config-CVrGKu1z.js → config-BATJRdlj.js} +1 -1
  116. package/dist/client/assets/{connect-Dv780Ao_.js → connect-Dmfr5UlW.js} +3 -3
  117. package/dist/client/assets/{connect-key-BcTw1Dit.js → connect-key-68KXBKIV.js} +1 -1
  118. package/dist/client/assets/{connect-layout-DVKIDoAk.js → connect-layout-B8CasJUP.js} +1 -1
  119. package/dist/client/assets/{connect-source-dialog-DmvQjMo_.js → connect-source-dialog-Czz2ct9m.js} +1 -1
  120. package/dist/client/assets/{connection-CqG6Tj46.js → connection-DbiyGcIj.js} +1 -1
  121. package/dist/client/assets/{connection-card-CMRGPAUW.js → connection-card-Cm_8ZjFM.js} +1 -1
  122. package/dist/client/assets/connection-detail-B2CQl_iE.js +1 -0
  123. package/dist/client/assets/{connection-form-helpers-BliOgdtt.js → connection-form-helpers-Bf8srwIN.js} +1 -1
  124. package/dist/client/assets/{connection-slug-BMyTAhb7.js → connection-slug-BFmtX8Pj.js} +1 -1
  125. package/dist/client/assets/connections-DVLBrRQx.js +1 -0
  126. package/dist/client/assets/{content-tab-B1BKIfBg.js → content-tab-B2Ay_G8-.js} +3 -3
  127. package/dist/client/assets/context-a4VYLopJ.js +1 -0
  128. package/dist/client/assets/{context-menu-dPQDOknl.js → context-menu-DkzmRTYN.js} +1 -1
  129. package/dist/client/assets/{context-shell-CU-clPo7.js → context-shell-C0Osmy2y.js} +4 -4
  130. package/dist/client/assets/{create-organization-dialog-BMVp8RKI.js → create-organization-dialog-sc0Ji-Lm.js} +1 -1
  131. package/dist/client/assets/{daily-pulse-BIfjhIvm.js → daily-pulse-Cug1zKXO.js} +1 -1
  132. package/dist/client/assets/{delete-copy-Dyr7i9lK.js → delete-copy-oEZ7hmoE.js} +1 -1
  133. package/dist/client/assets/{device-hint-DBfDHhL1.js → device-hint-0Up2oNr2.js} +1 -1
  134. package/dist/client/assets/discover-BbnMDogo.js +1 -0
  135. package/dist/client/assets/{domain-settings-l_JDVQfq.js → domain-settings-A82VOj7n.js} +1 -1
  136. package/dist/client/assets/{drawer-BtNmmbgW.js → drawer-GUKur5v4.js} +1 -1
  137. package/dist/client/assets/{editor-DJNkhCaU.js → editor-DFpyUa_U.js} +1 -1
  138. package/dist/client/assets/{editor-classes-D6VscvFm.js → editor-classes-BrZH4rK_.js} +1 -1
  139. package/dist/client/assets/{empty-message-BFHsH7_h.js → empty-message-pNIo6swu.js} +1 -1
  140. package/dist/client/assets/{empty-state-Y9RPHES1.js → empty-state-BO8_YMfm.js} +1 -1
  141. package/dist/client/assets/{empty-state-FI4NppsL.js → empty-state-BlGH7QIy.js} +1 -1
  142. package/dist/client/assets/{experiments-tab-choice-Bp3jeDLT.js → experiments-tab-choice-N83ua-pV.js} +1 -1
  143. package/dist/client/assets/{extract-connection-data-jaNfclWY.js → extract-connection-data-CZ3WadBx.js} +1 -1
  144. package/dist/client/assets/{feature-gate-32y7GiUu.js → feature-gate-CmVeJQy1.js} +1 -1
  145. package/dist/client/assets/{feature-paywall-nyy14OlO.js → feature-paywall-CxB3q7CQ.js} +1 -1
  146. package/dist/client/assets/file-explorer-DEJ_qRIq.js +2 -0
  147. package/dist/client/assets/{file-preview-DOlPWZsT.js → file-preview-D0PiXMMr.js} +1 -1
  148. package/dist/client/assets/{file-share-button-fnsd2V0Q.js → file-share-button-CTn6vuhs.js} +2 -2
  149. package/dist/client/assets/{file-type-icon-Bw6tHUJI.js → file-type-icon-BoZOJHAX.js} +1 -1
  150. package/dist/client/assets/{folder-icon-A6dxvF3y.js → folder-icon-Db4s-PbL.js} +1 -1
  151. package/dist/client/assets/{form-CE_i7Gc_.js → form-CAsgx2CK.js} +1 -1
  152. package/dist/client/assets/{frame-navigation-D0o7MHwc.js → frame-navigation-BzE9s8s7.js} +1 -1
  153. package/dist/client/assets/{gateway-client-CuVQGtSK.js → gateway-client-zNeoWGKO.js} +1 -1
  154. package/dist/client/assets/{general-CF4LBOhX.js → general-DmuSgNby.js} +1 -1
  155. package/dist/client/assets/{github-icon-BBtraw32.js → github-icon-CIUXCHYd.js} +1 -1
  156. package/dist/client/assets/{held-block-view-BCDffeao.js → held-block-view-Ce7FjzFo.js} +1 -1
  157. package/dist/client/assets/home-DfvWLWjX.js +1 -0
  158. package/dist/client/assets/{home-overview-CvjbBnOC.js → home-overview-DrTiQovk.js} +1 -1
  159. package/dist/client/assets/{hosted-reconcile-BV7FtBoJ.js → hosted-reconcile-OWVjsnRk.js} +1 -1
  160. package/dist/client/assets/{icon-button-vJpGdaXv.js → icon-button-B2FYU_Bm.js} +1 -1
  161. package/dist/client/assets/{index-BDN2Il8W.js → index-6N05u2FT.js} +1 -1
  162. package/dist/client/assets/{index-Bq8aKp2l.js → index-8HE48uEz.js} +1 -1
  163. package/dist/client/assets/{index-BO5G51Y2.js → index-BUiCUWOI.js} +1 -1
  164. package/dist/client/assets/{index-C-SbeINf.js → index-BYMPhxVC.js} +1 -1
  165. package/dist/client/assets/{index-CJvXv5nj.js → index-C8tbN8yc.js} +1 -1
  166. package/dist/client/assets/{index-DqFWx3BB.js → index-CDCs_KiA.js} +1 -1
  167. package/dist/client/assets/{index-FE1RDBz7.js → index-Cd1d2KVB.js} +1 -1
  168. package/dist/client/assets/{index-CvQo8gKP.js → index-CexiDE6J.js} +1 -1
  169. package/dist/client/assets/{index-DvdlZugw.js → index-Cz7ziqq8.js} +1 -1
  170. package/dist/client/assets/{index-DN6wMhlh.js → index-D-GlxhqC.js} +1 -1
  171. package/dist/client/assets/{index-BBKDsc5X.js → index-DFgV3_JA.js} +1 -1
  172. package/dist/client/assets/index-DIG6wtlF.js +4 -0
  173. package/dist/client/assets/index-DbzQIfNo.js +1 -0
  174. package/dist/client/assets/{index-BfWp2Wnw.js → index-FR7-LkFs.js} +3 -3
  175. package/dist/client/assets/{index-C_tC1dxx.js → index-GXFk32Bw.js} +1 -1
  176. package/dist/client/assets/{index-BFZAeRbT.js → index-HW6xhQCR.js} +1 -1
  177. package/dist/client/assets/{index-redirect-Bl5G9WWk.js → index-redirect-CYieSEon.js} +1 -1
  178. package/dist/client/assets/{index-CcEK8GbM.js → index-y09j8GJz.js} +1 -1
  179. package/dist/client/assets/{infiniteQueryObserver-1nr0P0K0.js → infiniteQueryObserver-Bo9y-Vk0.js} +1 -1
  180. package/dist/client/assets/{infra-billing-ho67U0rR.js → infra-billing-D3tyPPPr.js} +1 -1
  181. package/dist/client/assets/{input-BJ5cUSYm.js → input-PMXl5ojy.js} +4 -4
  182. package/dist/client/assets/{input-BNlFS4tL.js → input-oqagqAas.js} +1 -1
  183. package/dist/client/assets/{integration-icon-C4zzzxaS.js → integration-icon-D_iw-M-g.js} +1 -1
  184. package/dist/client/assets/{item-actions-B-wWhBMR.js → item-actions-WlA-gUNT.js} +1 -1
  185. package/dist/client/assets/{jira-icon-geKtCB2v.js → jira-icon-hVbN0Tf4.js} +1 -1
  186. package/dist/client/assets/{label-CWaQ3ANC.js → label-BrDhuinX.js} +1 -1
  187. package/dist/client/assets/{layout-D8a54-AV.js → layout-CldmtRbE.js} +1 -1
  188. package/dist/client/assets/{legacy-admin-welcome-dialog-BnEG9TvC.js → legacy-admin-welcome-dialog-CCTtGdld.js} +1 -1
  189. package/dist/client/assets/{legacy-agents-deep-D40bR2el.js → legacy-agents-deep-CS8Mx6L7.js} +1 -1
  190. package/dist/client/assets/{legacy-main-redirect-Fa4p1NoA.js → legacy-main-redirect-DjyGSD7M.js} +1 -1
  191. package/dist/client/assets/library-BeqMbeTr.js +1 -0
  192. package/dist/client/assets/{library-tab-Bxyd3n6f.js → library-tab-B6NZkMbf.js} +1 -1
  193. package/dist/client/assets/{login-Cdi7iEkU.js → login-YS1-2Nue.js} +1 -1
  194. package/dist/client/assets/{markdown-NetMLX1B.js → markdown-CV0DScZs.js} +1 -1
  195. package/dist/client/assets/{mcp-app-renderer-OOnse3pT.js → mcp-app-renderer-BD-0mBhr.js} +1 -1
  196. package/dist/client/assets/{mcp-oauth-C138KPCE.js → mcp-oauth-ByqxUWfx.js} +1 -1
  197. package/dist/client/assets/{mcp-oauth-DOaDVyhA.js → mcp-oauth-DjAD5Pae.js} +1 -1
  198. package/dist/client/assets/{members-r0zAY-Qq.js → members-BzSWZ_o7.js} +1 -1
  199. package/dist/client/assets/{memory-aLB_WhbI.js → memory-D4hrI4rc.js} +1 -1
  200. package/dist/client/assets/{mock-board-Dl0qBjh7.js → mock-board-BbC-KPvo.js} +3 -3
  201. package/dist/client/assets/{monaco-editor-BJmxWrxj.js → monaco-editor-BrHCIY9F.js} +1 -1
  202. package/dist/client/assets/{monitoring-Cd-32_wp.js → monitoring-BaOt4SvI.js} +1 -1
  203. package/dist/client/assets/{monitoring-stats-row-C4l9QgAZ.js → monitoring-stats-row-BoT5RyWa.js} +1 -1
  204. package/dist/client/assets/{multi-select-B_L-qOo_.js → multi-select-CkLH9zDR.js} +1 -1
  205. package/dist/client/assets/{mustache-DsBc8nE5.js → mustache-DbskuLzt.js} +1 -1
  206. package/dist/client/assets/{named-rule-step-C6gSKxIZ.js → named-rule-step-CrkqnZE0.js} +1 -1
  207. package/dist/client/assets/{named-rule-view-D6a00Kd0.js → named-rule-view-pW8NYIwe.js} +1 -1
  208. package/dist/client/assets/{new-project-dialog-B6Lwo0Gj.js → new-project-dialog-BZf8-lvn.js} +1 -1
  209. package/dist/client/assets/{new-project-store-DQsI7Up8.js → new-project-store-D6y4lbf2.js} +1 -1
  210. package/dist/client/assets/{oauth-callback-ZiXhFHTL.js → oauth-callback-BAwQm-0A.js} +1 -1
  211. package/dist/client/assets/{oauth-callback-ai-provider-G3iL8oeJ.js → oauth-callback-ai-provider-DjnR_ws7.js} +1 -1
  212. package/dist/client/assets/{oauth-consent-BXyh0gna.js → oauth-consent-BgXPtZDW.js} +1 -1
  213. package/dist/client/assets/{onboarding-DAsPAll8.js → onboarding-C7bUxdmN.js} +1 -1
  214. package/dist/client/assets/openai-conversation-CaTme7tS.js +3 -0
  215. package/dist/client/assets/{optimistic-project-sidebar-views-DFcCZ-o3.js → optimistic-project-sidebar-views-BiUQva9l.js} +1 -1
  216. package/dist/client/assets/{order-monitor-day-C70gELqf.js → order-monitor-day-BkApoxgW.js} +1 -1
  217. package/dist/client/assets/{organization-choice-DU0Iu2sl.js → organization-choice-D4iDv_H1.js} +1 -1
  218. package/dist/client/assets/{orgs-BX0lk0zT.js → orgs-DTRrUWgx.js} +1 -1
  219. package/dist/client/assets/{own-accounts-section-F5Hyapdn.js → own-accounts-section-xDHmjKlb.js} +1 -1
  220. package/dist/client/assets/{pair-B9IOPXjq.js → pair-UrNHmvwT.js} +6 -6
  221. package/dist/client/assets/{parse-sections--l6s_VwH.js → parse-sections-l0PaukKn.js} +4 -4
  222. package/dist/client/assets/plan-Bj7w0fs-.js +1 -0
  223. package/dist/client/assets/{plan-ladder-NC686t6f.js → plan-ladder-CypWDEbr.js} +1 -1
  224. package/dist/client/assets/{plan-usage-card-WBfanqrN.js → plan-usage-card-Cj8t_uV_.js} +1 -1
  225. package/dist/client/assets/{popover-oFcDtUvN.js → popover-7x26sV4l.js} +1 -1
  226. package/dist/client/assets/post-calendar-DVbpAHSG.js +1 -0
  227. package/dist/client/assets/{post-editor-CcQmW5GV.js → post-editor-BgQsbRBJ.js} +2 -2
  228. package/dist/client/assets/preview-content-5lf6CQ1G.js +1 -0
  229. package/dist/client/assets/{preview-dialog-Cded3kAU.js → preview-dialog-a9oPKORm.js} +1 -1
  230. package/dist/client/assets/{preview-panel-rChZiu-N.js → preview-panel-B-fYqCTc.js} +1 -1
  231. package/dist/client/assets/{preview-tab-zxzhDMiQ.js → preview-tab-CbOIy4cw.js} +3 -3
  232. package/dist/client/assets/{product-picker-dialog-CX9KvtZh.js → product-picker-dialog-BBOB74pM.js} +1 -1
  233. package/dist/client/assets/{profile-NWB9QWdA.js → profile-Dpdofwex.js} +1 -1
  234. package/dist/client/assets/project-app-view-B-IV2rxA.js +1 -0
  235. package/dist/client/assets/{project-apps-D28U2fPi.js → project-apps-FcEysJSf.js} +1 -1
  236. package/dist/client/assets/{project-icon-WyFXKdgN.js → project-icon-BakFKgaM.js} +1 -1
  237. package/dist/client/assets/{project-index-COi5kduS.js → project-index-CH5Eesm9.js} +1 -1
  238. package/dist/client/assets/project-reports-BMkuATss.js +1 -0
  239. package/dist/client/assets/project-tasks-CgegKZFV.js +1 -0
  240. package/dist/client/assets/projects-DCEjx7vT.js +1 -0
  241. package/dist/client/assets/{projects-empty-state-Dvqp2Zzy.js → projects-empty-state-BwEHnw3B.js} +1 -1
  242. package/dist/client/assets/{prompts-DhLlttmt.js → prompts-BekDCd-q.js} +1 -1
  243. package/dist/client/assets/record-editor-BhOWKOqq.js +1 -0
  244. package/dist/client/assets/redirect-editor-DsJ26zj5.js +1 -0
  245. package/dist/client/assets/{reports-CREVrO7v.js → reports-BbFa4xYC.js} +1 -1
  246. package/dist/client/assets/reports-ezYUNDvN.js +1 -0
  247. package/dist/client/assets/reports-onboarding-BDB7TzgU.js +1 -0
  248. package/dist/client/assets/{reports-tab-C197xYdE.js → reports-tab-Q20Na5hW.js} +2 -2
  249. package/dist/client/assets/{repositories-CWMzkWDA.js → repositories-BdnVmM98.js} +1 -1
  250. package/dist/client/assets/repositories-DRNmonrv.js +1 -0
  251. package/dist/client/assets/{repository-binding-BDu0tU0n.js → repository-binding-DdJXPhL-.js} +1 -1
  252. package/dist/client/assets/{repository-picker-DKoD0HVQ.js → repository-picker-DcD51j3V.js} +1 -1
  253. package/dist/client/assets/{require-capability-DXiZ0OON.js → require-capability-Bw_S94S7.js} +1 -1
  254. package/dist/client/assets/{required-auth-layout-ZTLOobSH.js → required-auth-layout-81VJBEp9.js} +1 -1
  255. package/dist/client/assets/{reset-password-DiEnHrUJ.js → reset-password-DHH7NYOb.js} +1 -1
  256. package/dist/client/assets/resizable-BrnNepSm.js +1 -0
  257. package/dist/client/assets/{resolve-tab-icon-C99S9oDL.js → resolve-tab-icon-BAO1NHl-.js} +1 -1
  258. package/dist/client/assets/{review-settings-Brit3pLv.js → review-settings-vBNXtecT.js} +1 -1
  259. package/dist/client/assets/{role-color-Ddqyp0w6.js → role-color-BaWVUb4j.js} +1 -1
  260. package/dist/client/assets/roles-CSUXrIEf.js +1 -0
  261. package/dist/client/assets/route-BUh0V4ZY.js +1 -0
  262. package/dist/client/assets/route-BuT3rimp.js +1 -0
  263. package/dist/client/assets/route-DXSlTAFB.js +1 -0
  264. package/dist/client/assets/{route-page-header-BeG7kyQP.js → route-page-header-Bjz66AQK.js} +1 -1
  265. package/dist/client/assets/{sandbox-git-api-Bwhb8cKq.js → sandbox-git-api-B4kiB_OO.js} +1 -1
  266. package/dist/client/assets/{sandbox-lifecycle-context-Dq2ETPAf.js → sandbox-lifecycle-context-DIPvnGzU.js} +1 -1
  267. package/dist/client/assets/{save-status-BXxefOdA.js → save-status-DUnwCvL6.js} +1 -1
  268. package/dist/client/assets/{schema-CI1Jg9rW.js → schema-CpgLVA1f.js} +1 -1
  269. package/dist/client/assets/{schema-BJIhJXy6.js → schema-Do1srOed.js} +1 -1
  270. package/dist/client/assets/{scroll-area-Dt-NcLdT.js → scroll-area-Cg0VHNwx.js} +1 -1
  271. package/dist/client/assets/{search-input-BjRiuWL9.js → search-input-DLh0nlr5.js} +1 -1
  272. package/dist/client/assets/{search-toggle-BOD5VZ7W.js → search-toggle-n3MSbxdh.js} +1 -1
  273. package/dist/client/assets/{secret-picker-CHt8ZrjG.js → secret-picker-CA4076-F.js} +1 -1
  274. package/dist/client/assets/{secrets-DGZeS_5r.js → secrets-Nc9lZJ4O.js} +1 -1
  275. package/dist/client/assets/{section-array-field-CYFq6Yfv.js → section-array-field-CVPQhOEL.js} +1 -1
  276. package/dist/client/assets/{sections-DBJ1YFK4.js → sections-Cq-1B8bG.js} +1 -1
  277. package/dist/client/assets/sections-editor-DC8FnTKc.js +1 -0
  278. package/dist/client/assets/{select-BXZoshA8.js → select-DO5UmbiK.js} +1 -1
  279. package/dist/client/assets/{select-model-Corsllp1.js → select-model-BxYeGUNe.js} +1 -1
  280. package/dist/client/assets/{seo-editor-CG0nowoP.js → seo-editor-Cb_-6pbC.js} +1 -1
  281. package/dist/client/assets/{separator-Jij0j-j1.js → separator-ClPt1qls.js} +1 -1
  282. package/dist/client/assets/{session-runtime-DFmRKpVg.js → session-runtime-ByRl2V_-.js} +1 -1
  283. package/dist/client/assets/settings-tab-BB4vDZAN.js +1 -0
  284. package/dist/client/assets/{sheet-DT44IVE2.js → sheet-Ba_kC1AK.js} +1 -1
  285. package/dist/client/assets/shell-layout-hxOVAb6r.js +1 -0
  286. package/dist/client/assets/{site-draft-actions-ChPsoqte.js → site-draft-actions-DS6SP7w_.js} +1 -1
  287. package/dist/client/assets/{site-draft-view-CIc7HrWU.js → site-draft-view-DoBMGNxF.js} +1 -1
  288. package/dist/client/assets/site-editor-BzkmccDr.js +1 -0
  289. package/dist/client/assets/{site-editor-toast-D2nHZREM.js → site-editor-toast-CksZ_DBd.js} +1 -1
  290. package/dist/client/assets/skills-CgFC9u75.js +1 -0
  291. package/dist/client/assets/{slider-DCaB9Ine.js → slider-BNKhoqMv.js} +1 -1
  292. package/dist/client/assets/{sortable.esm-CfU7eu9S.js → sortable.esm-DW0wRpPm.js} +1 -1
  293. package/dist/client/assets/{sso-BEMT6JJw.js → sso-BrpFyhwL.js} +1 -1
  294. package/dist/client/assets/{suggestion-BO6GNdWk.js → suggestion-DNn_oFJd.js} +1 -1
  295. package/dist/client/assets/{super-agent-icon-Cu5ZQ2qC.js → super-agent-icon-Cvg_K_iL.js} +1 -1
  296. package/dist/client/assets/{switch-CfCCzQdg.js → switch-BHmi6NG_.js} +1 -1
  297. package/dist/client/assets/{synced-repos-gHf8sPwV.js → synced-repos-DRSlgzhQ.js} +1 -1
  298. package/dist/client/assets/{tab-icon-glyph-hPo-Gg9t.js → tab-icon-glyph-C0mr7ZyN.js} +1 -1
  299. package/dist/client/assets/{table-BG-lRGNn.js → table-Vs3bc_5a.js} +1 -1
  300. package/dist/client/assets/{tabs-DQRKyhjY.js → tabs-DD53shfE.js} +1 -1
  301. package/dist/client/assets/{task-board-B-hxKp5U.js → task-board-WdgeTNaU.js} +1 -1
  302. package/dist/client/assets/{task-key-DjK7Kw8s.js → task-key-BOhf6PeF.js} +1 -1
  303. package/dist/client/assets/{task-route-BwC6Um2K.js → task-route-CKQNtOSa.js} +1 -1
  304. package/dist/client/assets/{task-status-BiZeTmx1.js → task-status-DDLp4MtP.js} +1 -1
  305. package/dist/client/assets/taskboard-analytics-D59d7L_v.js +1 -0
  306. package/dist/client/assets/{tasks-Dac_YLSj.js → tasks-BJ9tMJk-.js} +1 -1
  307. package/dist/client/assets/tasks-Ch925UQU.js +1 -0
  308. package/dist/client/assets/{textarea-DAZ3avm9.js → textarea-HB4U7ZGE.js} +1 -1
  309. package/dist/client/assets/thread-analytics-_YhjJKsQ.js +1 -0
  310. package/dist/client/assets/thread-button-Qhfu18qZ.js +1 -0
  311. package/dist/client/assets/{thread-intent-BtcwbxTJ.js → thread-intent-DDQe6PKd.js} +1 -1
  312. package/dist/client/assets/{thread-route-Ds6Wombz.js → thread-route-H2DC02zF.js} +1 -1
  313. package/dist/client/assets/thread-route-nxXeVQI9.js +1 -0
  314. package/dist/client/assets/{thread-sheet-body-Kjk5YJ_A.js → thread-sheet-body-B63iYWkR.js} +1 -1
  315. package/dist/client/assets/{time-range-picker-y-R1DMgB.js → time-range-picker-D62EphZs.js} +1 -1
  316. package/dist/client/assets/{toggle-group-BgBCZLaa.js → toggle-group-DsHNAW_o.js} +1 -1
  317. package/dist/client/assets/{tool-set-selector-tZKV1bCv.js → tool-set-selector-q7g0t0TT.js} +1 -1
  318. package/dist/client/assets/{toolbar-icon-button-CaY1wsmY.js → toolbar-icon-button-D2GZy3ji.js} +1 -1
  319. package/dist/client/assets/{tooltip-CqV-qcYU.js → tooltip-zEsMTxPP.js} +1 -1
  320. package/dist/client/assets/{tooltipContext-5-7GWaNH.js → tooltipContext-DnSCkdE2.js} +1 -1
  321. package/dist/client/assets/{track-qijzY7O9.js → track-CUdkdM9q.js} +1 -1
  322. package/dist/client/assets/{types-DRaoZ_4I.js → types-DMMPR8qW.js} +1 -1
  323. package/dist/client/assets/{url-slug-CTOX8lQF.js → url-slug-DDGhX66k.js} +1 -1
  324. package/dist/client/assets/{usage-stats-BXxRbW0f.js → usage-stats-DV0A8cEM.js} +1 -1
  325. package/dist/client/assets/{use-ai-providers-DgsrHLV3.js → use-ai-providers-CTFkZoGo.js} +1 -1
  326. package/dist/client/assets/{use-api-keys-1S0yfr-w.js → use-api-keys-hOWMp9oQ.js} +1 -1
  327. package/dist/client/assets/{use-apply-named-rule-DK9k5f8X.js → use-apply-named-rule-CTLfcvn0.js} +1 -1
  328. package/dist/client/assets/use-ask-in-chat-BSMZ4qaC.js +1 -0
  329. package/dist/client/assets/{use-automations-lWDVj-CU.js → use-automations-DCTTlEcO.js} +1 -1
  330. package/dist/client/assets/{use-autosave-CQIToQsM.js → use-autosave-Rfdg2I1F.js} +1 -1
  331. package/dist/client/assets/use-blocks-v8-project-ou9QCF6v.js +1 -0
  332. package/dist/client/assets/use-blog-view-Ba0QG6QU.js +1 -0
  333. package/dist/client/assets/{use-chat-layout-state-CS1wv5hl.js → use-chat-layout-state-vbFKmjxB.js} +1 -1
  334. package/dist/client/assets/{use-cms-publish-actions-BoXieLUR.js → use-cms-publish-actions-BHXk9tUC.js} +1 -1
  335. package/dist/client/assets/{use-connect-companion-C2Xf2qzV.js → use-connect-companion-BnUK_glG.js} +1 -1
  336. package/dist/client/assets/{use-connection-Df8_gpBB.js → use-connection-BHM3BFUr.js} +1 -1
  337. package/dist/client/assets/{use-content-sync-DzzCDnXY.js → use-content-sync-BApKNkG6.js} +1 -1
  338. package/dist/client/assets/{use-copy-CCrC_M79.js → use-copy-d7u6BVsA.js} +1 -1
  339. package/dist/client/assets/{use-current-view-B5rf1h54.js → use-current-view-D_ifkjui.js} +1 -1
  340. package/dist/client/assets/{use-date-fns-locale-Csnyj6_G.js → use-date-fns-locale-BfEJ9DKB.js} +1 -1
  341. package/dist/client/assets/{use-debounced-autosave-BNJwBoKC.js → use-debounced-autosave-C8qW25SA.js} +1 -1
  342. package/dist/client/assets/{use-debounced-value-DFWDa0qH.js → use-debounced-value-COFfhICA.js} +1 -1
  343. package/dist/client/assets/{use-deco-credits-CuB-vVK3.js → use-deco-credits-BcE9Lgca.js} +1 -1
  344. package/dist/client/assets/{use-decopilot-events-B7ke0MhO.js → use-decopilot-events-DY8bcy2g.js} +1 -1
  345. package/dist/client/assets/{use-delete-block-ZPB3I9Ns.js → use-delete-block-CGqlkyBO.js} +1 -1
  346. package/dist/client/assets/{use-delete-connection-Zvzh2eht.js → use-delete-connection-D1aTQQJm.js} +1 -1
  347. package/dist/client/assets/{use-deployment-admin-B4GqO2uv.js → use-deployment-admin-DgU-c4bG.js} +1 -1
  348. package/dist/client/assets/{use-entitlements-CQZj5lkl.js → use-entitlements-b0vun-2_.js} +1 -1
  349. package/dist/client/assets/{use-fast-preview-draft-url-DYyM21UT.js → use-fast-preview-draft-url-DncEMB04.js} +1 -1
  350. package/dist/client/assets/{use-file-configs-CyAC1Jn2.js → use-file-configs-CwMKmvEP.js} +1 -1
  351. package/dist/client/assets/{use-id-selection-CE2G3E6f.js → use-id-selection-DCKB_8sF.js} +1 -1
  352. package/dist/client/assets/{use-in-settings-CRUM5hPE.js → use-in-settings-CK5SsWhS.js} +1 -1
  353. package/dist/client/assets/{use-inbox-feed-uWC2MWJH.js → use-inbox-feed-CHFMf-DP.js} +1 -1
  354. package/dist/client/assets/{use-infinite-scroll-Cz_t92ww.js → use-infinite-scroll-BhP62VAS.js} +1 -1
  355. package/dist/client/assets/{use-join-requests-CS1fqgjk.js → use-join-requests-DeocFvqW.js} +1 -1
  356. package/dist/client/assets/{use-main-panel-tabs-DwCoiX2k.js → use-main-panel-tabs-Du7tjex6.js} +1 -1
  357. package/dist/client/assets/{use-mcp-auth-status-CyjIfVIk.js → use-mcp-auth-status-BQeDa9px.js} +1 -1
  358. package/dist/client/assets/{use-mcp-client-HASDr5yn.js → use-mcp-client-B9e5PyU5.js} +1 -1
  359. package/dist/client/assets/{use-mcp-prompts-CEtDj9VE.js → use-mcp-prompts-DgapPQcC.js} +1 -1
  360. package/dist/client/assets/{use-mcp-tools-CLfN0BYV.js → use-mcp-tools-CxV8OmMI.js} +1 -1
  361. package/dist/client/assets/{use-mobile-UoyYEGbQ.js → use-mobile-Dcp3TiKi.js} +1 -1
  362. package/dist/client/assets/{use-move-blocks-CFb10aGP.js → use-move-blocks-B_Oh4K4K.js} +1 -1
  363. package/dist/client/assets/{use-navigate-to-agent-C4y9eC4A.js → use-navigate-to-agent-8EROExiH.js} +1 -1
  364. package/dist/client/assets/{use-never-published-D71BtZNY.js → use-never-published-Ct3dv44f.js} +1 -1
  365. package/dist/client/assets/{use-org-fs-BAgR3Jkh.js → use-org-fs-CaJ4jOuW.js} +1 -1
  366. package/dist/client/assets/{use-org-notice-DQ7N3XWA.js → use-org-notice-CsHPv0ZT.js} +1 -1
  367. package/dist/client/assets/{use-org-repo-syncs-C556S9To.js → use-org-repo-syncs-ClD66yFB.js} +1 -1
  368. package/dist/client/assets/{use-org-sso-DrDj5K7f.js → use-org-sso-ClZgaz67.js} +1 -1
  369. package/dist/client/assets/{use-organization-settings-BliP9B1t.js → use-organization-settings-D9Z_MLl2.js} +1 -1
  370. package/dist/client/assets/{use-panel-navigate-db4k7dl4.js → use-panel-navigate-ajPZ-O4i.js} +1 -1
  371. package/dist/client/assets/{use-project-native-view-presence-DPg5UqE1.js → use-project-native-view-presence-DhvS9eeS.js} +1 -1
  372. package/dist/client/assets/{use-project-scope-CFftAYVY.js → use-project-scope-DbG1jNVV.js} +1 -1
  373. package/dist/client/assets/{use-recent-apps-CS-hhWwQ.js → use-recent-apps-DaKCzULH.js} +1 -1
  374. package/dist/client/assets/{use-reports-diagnostic-CYymDS51.js → use-reports-diagnostic-BiwUdSSa.js} +1 -1
  375. package/dist/client/assets/{use-sandbox-events-rgvK0R-0.js → use-sandbox-events-DYuy4eXR.js} +1 -1
  376. package/dist/client/assets/{use-secrets-Y_pjIaUL.js → use-secrets-BDnSckIs.js} +1 -1
  377. package/dist/client/assets/{use-section-preview-base-Bkq2jdsn.js → use-section-preview-base-BA-kLqNd.js} +1 -1
  378. package/dist/client/assets/{use-sidebar-collapsed-BtrwP1AE.js → use-sidebar-collapsed-BnOq_oEM.js} +1 -1
  379. package/dist/client/assets/{use-tags-CFlTqeDj.js → use-tags-C6EDrEBG.js} +1 -1
  380. package/dist/client/assets/{use-task-board-analytics-Bm2Eiqvn.js → use-task-board-analytics-DeDE1IEl.js} +1 -1
  381. package/dist/client/assets/{use-task-board-item-prs-BCP6vVwh.js → use-task-board-item-prs-C9H7e6IC.js} +1 -1
  382. package/dist/client/assets/{use-task-board-items-CQPrgy8Z.js → use-task-board-items-C2I9m2B-.js} +1 -1
  383. package/dist/client/assets/{use-task-board-prompts-CywAfsLX.js → use-task-board-prompts-D6cb0B6a.js} +1 -1
  384. package/dist/client/assets/{use-task-metadata-BIpPNwtn.js → use-task-metadata-CQcB7BzK.js} +1 -1
  385. package/dist/client/assets/{use-thread-outputs-BMHx59-u.js → use-thread-outputs-KaWkhSGH.js} +1 -1
  386. package/dist/client/assets/{use-view-draft-kind-DkapSxnZ.js → use-view-draft-kind-CBmzgnXH.js} +1 -1
  387. package/dist/client/assets/{use-voice-input-DyQL3diM.js → use-voice-input-CChbkXIH.js} +1 -1
  388. package/dist/client/assets/useInfiniteQuery-f2vaHavl.js +1 -0
  389. package/dist/client/assets/{useQueries-Bay3GQsV.js → useQueries-DUm4FupI.js} +1 -1
  390. package/dist/client/assets/useSuspenseInfiniteQuery-CSNG6COy.js +1 -0
  391. package/dist/client/assets/{users-DTrW9ZIm.js → users-B87pV5ii.js} +1 -1
  392. package/dist/client/assets/{utils-D1ABa-c2.js → utils-O_zWQ9Z7.js} +1 -1
  393. package/dist/client/assets/variant-calendar-Bh22mlda.js +1 -0
  394. package/dist/client/assets/{variant-matcher-override-y-sjVy0V.js → variant-matcher-override-BLYg6qNr.js} +1 -1
  395. package/dist/client/assets/{view-header-CJ8vxIod.js → view-header-CDvRMzUc.js} +1 -1
  396. package/dist/client/assets/{virtual-mcp-m1o-7tiO.js → virtual-mcp-9Ocfu-kl.js} +1 -1
  397. package/dist/client/assets/{watch-sse-pool-gEMXX-QL.js → watch-sse-pool-DvEr2HwM.js} +1 -1
  398. package/dist/client/index.html +1 -1
  399. package/dist/server/server.js +1 -1
  400. package/package.json +1 -1
  401. package/dist/client/assets/Minimize01-BIynG3Ze.js +0 -1
  402. package/dist/client/assets/agent-app-Ba7JDwY6.js +0 -1
  403. package/dist/client/assets/agent-assets-DlGJDJr0.js +0 -1
  404. package/dist/client/assets/agent-automations-DHP9-Rvp.js +0 -1
  405. package/dist/client/assets/agent-blog-MchyO8b5.js +0 -2
  406. package/dist/client/assets/agent-blog-post-DUN7iPWt.js +0 -2
  407. package/dist/client/assets/agent-calendar-De-Im46e.js +0 -1
  408. package/dist/client/assets/agent-connect-sources-DkfqQk5b.js +0 -1
  409. package/dist/client/assets/agent-deck-Cx2e4txV.js +0 -1
  410. package/dist/client/assets/agent-e2e-cuAg7vvT.js +0 -1
  411. package/dist/client/assets/agent-experiments-CKleoVAf.js +0 -1
  412. package/dist/client/assets/agent-file-BrkmoibI.js +0 -1
  413. package/dist/client/assets/agent-hosting-D__8hPs9.js +0 -1
  414. package/dist/client/assets/agent-icon-Bq_Z7esB.js +0 -1
  415. package/dist/client/assets/agent-library-BfblIp1v.js +0 -1
  416. package/dist/client/assets/agent-library-file-C7p2ZAks.js +0 -1
  417. package/dist/client/assets/agent-overview-NZBYrRRV.js +0 -1
  418. package/dist/client/assets/agent-settings-iY554avh.js +0 -1
  419. package/dist/client/assets/agent-site-editor-code-CaQ191md.js +0 -2
  420. package/dist/client/assets/agent-site-editor-content-4-gXvHBG.js +0 -1
  421. package/dist/client/assets/agent-site-editor-preview-BE075svj.js +0 -1
  422. package/dist/client/assets/agent-view-D12VaGvy.js +0 -1
  423. package/dist/client/assets/api-keys-CQkJKCWp.js +0 -1
  424. package/dist/client/assets/app-editor-CPq25Dfa.js +0 -1
  425. package/dist/client/assets/automations-DhtUKYcW.js +0 -1
  426. package/dist/client/assets/category-editor-Jfh1FEbD.js +0 -1
  427. package/dist/client/assets/choose-editor-C_rrZDqX.js +0 -1
  428. package/dist/client/assets/cms-settings-editor-agl-pdfk.js +0 -1
  429. package/dist/client/assets/collection-detail-BX7pAFmI.js +0 -1
  430. package/dist/client/assets/connection-detail-B2bDZqoS.js +0 -1
  431. package/dist/client/assets/connections-osURCVgm.js +0 -1
  432. package/dist/client/assets/context-SebnQ-fG.js +0 -1
  433. package/dist/client/assets/discover-4UiUWkTa.js +0 -1
  434. package/dist/client/assets/file-explorer-Berv-DjA.js +0 -2
  435. package/dist/client/assets/home-D5e51VDk.js +0 -1
  436. package/dist/client/assets/index-Cu5PtngA.js +0 -4
  437. package/dist/client/assets/index-DVC5Xh86.js +0 -1
  438. package/dist/client/assets/library-OBxcrPA6.js +0 -1
  439. package/dist/client/assets/openai-conversation-BAjqwRPV.js +0 -3
  440. package/dist/client/assets/plan-vHZHG0_E.js +0 -1
  441. package/dist/client/assets/post-calendar-DzBDM3b2.js +0 -1
  442. package/dist/client/assets/preview-content-MbQf8RGA.js +0 -1
  443. package/dist/client/assets/project-app-view-gJDZKZ8F.js +0 -1
  444. package/dist/client/assets/project-reports-DFICoZ3P.js +0 -1
  445. package/dist/client/assets/project-tasks-DHsoMFaC.js +0 -1
  446. package/dist/client/assets/projects-Cm9td8_E.js +0 -1
  447. package/dist/client/assets/record-editor-BaN-J3uT.js +0 -1
  448. package/dist/client/assets/redirect-editor-Dk4GjAcP.js +0 -1
  449. package/dist/client/assets/reports-BjhUDxT0.js +0 -1
  450. package/dist/client/assets/reports-onboarding-DlCteX2-.js +0 -1
  451. package/dist/client/assets/repositories-CpGjSRVu.js +0 -1
  452. package/dist/client/assets/resizable-BArMfXUk.js +0 -1
  453. package/dist/client/assets/roles-C9wYF2gv.js +0 -1
  454. package/dist/client/assets/route-Bhee4AVm.js +0 -1
  455. package/dist/client/assets/route-C0X_ekZH.js +0 -1
  456. package/dist/client/assets/route-cMh_8Xc3.js +0 -1
  457. package/dist/client/assets/sections-editor--Z8msN1o.js +0 -1
  458. package/dist/client/assets/settings-tab-PpyKi5jL.js +0 -1
  459. package/dist/client/assets/shell-layout-CQs-sSUy.js +0 -1
  460. package/dist/client/assets/site-editor-89VkH7GW.js +0 -1
  461. package/dist/client/assets/skills-CgUWJjrb.js +0 -1
  462. package/dist/client/assets/taskboard-analytics-C1hsIKyF.js +0 -1
  463. package/dist/client/assets/tasks-Cvrxb3RD.js +0 -1
  464. package/dist/client/assets/thread-analytics-DGVyUEMu.js +0 -1
  465. package/dist/client/assets/thread-button-Dy4pRky4.js +0 -1
  466. package/dist/client/assets/thread-route-BKnIUDl3.js +0 -1
  467. package/dist/client/assets/use-ask-in-chat-CC9ew9W1.js +0 -1
  468. package/dist/client/assets/use-blocks-v8-project-DwTQhXO1.js +0 -1
  469. package/dist/client/assets/use-blog-view-9w6CHFwT.js +0 -1
  470. package/dist/client/assets/useInfiniteQuery-D5Avp4ip.js +0 -1
  471. package/dist/client/assets/useSuspenseInfiniteQuery-BlIdZ7Pt.js +0 -1
  472. package/dist/client/assets/variant-calendar-CK1882s5.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor--Z8msN1o.js","assets/index-BfWp2Wnw.js","assets/index-pbgcO64n.css","assets/chat-context-BUMEnIPW.js","assets/use-panel-navigate-db4k7dl4.js","assets/thread-route-Ds6Wombz.js","assets/use-project-scope-CFftAYVY.js","assets/repository-binding-BDu0tU0n.js","assets/use-mcp-client-HASDr5yn.js","assets/auth-BOZ5swZI.js","assets/use-view-draft-kind-DkapSxnZ.js","assets/use-blog-view-9w6CHFwT.js","assets/use-organization-settings-BliP9B1t.js","assets/schema-BJIhJXy6.js","assets/task-board-B-hxKp5U.js","assets/thread-intent-BtcwbxTJ.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-gEMXX-QL.js","assets/session-runtime-DFmRKpVg.js","assets/use-entitlements-CQZj5lkl.js","assets/use-ai-providers-DgsrHLV3.js","assets/use-current-view-B5rf1h54.js","assets/use-in-settings-CRUM5hPE.js","assets/use-decopilot-events-B7ke0MhO.js","assets/save-status-BXxefOdA.js","assets/Image01-C5Xqhwp5.js","assets/Trash01-CevYpZEM.js","assets/Upload01-C_8HEOMT.js","assets/use-never-published-D71BtZNY.js","assets/use-voice-input-DyQL3diM.js","assets/popover-oFcDtUvN.js","assets/drawer-BtNmmbgW.js","assets/tooltip-CqV-qcYU.js","assets/index-CvQo8gKP.js","assets/use-mobile-UoyYEGbQ.js","assets/agent-icon-Bq_Z7esB.js","assets/AlertCircle-mj0sz0gj.js","assets/UserCheck01-4mEtfdkD.js","assets/Tool01-Bscrvuft.js","assets/ArrowUp-D2bbOB2w.js","assets/ArrowLeft--TSM2Ux3.js","assets/ArrowRight-BVFSrvKf.js","assets/BookOpen01-CTUEdBiB.js","assets/Globe04-DhsnPBDD.js","assets/CheckCircle-BsBF4S8u.js","assets/TrendUp01-DMf7H3tv.js","assets/ChevronDown-CNlehUMA.js","assets/ChevronSelectorVertical-BdBrg7yc.js","assets/ChevronUp-BIaMfxq-.js","assets/UserSquare-oo1b4ulW.js","assets/LinkBroken01-CxV1rDqL.js","assets/CreditCard01-gHUc2u28.js","assets/File02-uZRQiPOp.js","assets/Minimize01-BIynG3Ze.js","assets/SwitchHorizontal01-qTGCOGX6.js","assets/Eye-Xo5rS9iJ.js","assets/Key01-h9Y3uaT_.js","assets/LayoutLeft-CPMSR00X.js","assets/Minus-D55MDhYc.js","assets/Monitor01-CBUOgSaC.js","assets/Sun-B-xu6eHR.js","assets/Play-zsnTCnBK.js","assets/Plus-DAYIm6ow.js","assets/SearchMd-CTSUPag9.js","assets/ShoppingBag01-CF4EYiC_.js","assets/Users01-av_p4B03.js","assets/XClose-WYCPZpkD.js","assets/Zap-C-VVHO-P.js","assets/index-BFZAeRbT.js","assets/checkbox-BUvWR-iD.js","assets/select-BXZoshA8.js","assets/index-BdQq_4o_.js","assets/ai-providers-logos-DD3qZ33J.js","assets/openai-compatible-presets-BKGfVqEx.js","assets/site-editor-toast-D2nHZREM.js","assets/use-sandbox-events-rgvK0R-0.js","assets/sandbox-url-D3mC8qhT.js","assets/use-blocks-v8-project-DwTQhXO1.js","assets/utils-D1ABa-c2.js","assets/sandbox-git-api-Bwhb8cKq.js","assets/hosted-reconcile-BV7FtBoJ.js","assets/blocks-tab-states-Bx0tgd5u.js","assets/empty-state-Y9RPHES1.js","assets/search-input-BjRiuWL9.js","assets/tabs-DQRKyhjY.js","assets/active-indicator-CCMhAsc_.js","assets/use-debounced-value-DFWDa0qH.js","assets/use-file-configs-CyAC1Jn2.js","assets/asset-utils-C_CFQkKi.js","assets/useInfiniteQuery-D5Avp4ip.js","assets/infiniteQueryObserver-1nr0P0K0.js","assets/usage-stats-BXxRbW0f.js","assets/utils-CVEq3hMx.js","assets/markdown-NetMLX1B.js","assets/use-copy-CCrC_M79.js","assets/gateway-client-CuVQGtSK.js","assets/form-CE_i7Gc_.js","assets/label-CWaQ3ANC.js","assets/switch-CfCCzQdg.js","assets/toggle-group-BgBCZLaa.js","assets/match-site-slug-config-B47_xZCi.js","assets/parse-sections--l6s_VwH.js","assets/held-block-view-BCDffeao.js","assets/calendar-B0VrIuVV.js","assets/textarea-DAZ3avm9.js","assets/editor-classes-D6VscvFm.js","assets/task-key-DjK7Kw8s.js","assets/sortable.esm-CfU7eu9S.js","assets/empty-message-BFHsH7_h.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-B9IOPXjq.js","assets/collapsible-DYCInqz3.js","assets/use-task-board-items-CQPrgy8Z.js","assets/config-CVrGKu1z.js","assets/task-route-BwC6Um2K.js","assets/project-index-COi5kduS.js","assets/shell-layout-CQs-sSUy.js","assets/use-deployment-admin-B4GqO2uv.js","assets/admin-fetch-BhTJlAsX.js","assets/use-org-notice-DQ7N3XWA.js","assets/command-DAachgGl.js","assets/index-C_tC1dxx.js","assets/integration-icon-C4zzzxaS.js","assets/project-icon-WyFXKdgN.js","assets/use-navigate-to-agent-C4y9eC4A.js","assets/new-project-dialog-B6Lwo0Gj.js","assets/repository-picker-DKoD0HVQ.js","assets/github-icon-BBtraw32.js","assets/collection-search-CMlKHTQ0.js","assets/new-project-store-DQsI7Up8.js","assets/legacy-admin-welcome-dialog-BnEG9TvC.js","assets/required-auth-layout-ZTLOobSH.js","assets/use-org-sso-DrDj5K7f.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-OOnse3pT.js","assets/types-DRaoZ_4I.js","assets/omit-server-managed-metadata-L5IhjRZB.js","assets/sheet-DT44IVE2.js","assets/use-connection-Df8_gpBB.js","assets/use-mcp-prompts-CEtDj9VE.js","assets/use-thread-outputs-BMHx59-u.js","assets/file-type-icon-Bw6tHUJI.js","assets/section-array-field-CYFq6Yfv.js","assets/named-rule-step-C6gSKxIZ.js","assets/slider-DCaB9Ine.js","assets/index-DvdlZugw.js","assets/tooltipContext-5-7GWaNH.js","assets/CategoricalChart-_BlSk5IS.js","assets/index-BBKDsc5X.js","assets/combobox-CMR7JQ5s.js","assets/scroll-area-Dt-NcLdT.js","assets/monaco-editor-BJmxWrxj.js","assets/editor-DJNkhCaU.js","assets/use-delete-block-ZPB3I9Ns.js","assets/use-section-preview-base-Bkq2jdsn.js","assets/mustache-DsBc8nE5.js","assets/seo-editor-CG0nowoP.js","assets/use-apply-named-rule-DK9k5f8X.js","assets/use-move-blocks-CFb10aGP.js","assets/variant-matcher-override-y-sjVy0V.js"])))=>i.map(i=>d[i]);
2
- import{c as le,j as r,r as N,m as Re,b as Ee,B as Oe,aF as us,bi as mt,aG as $e,bj as gi,bk as vi,bl as xi,bm as bi,v as Ar,D as _r,K as Qs,w as Or,x as Fr,e as yi,h as rt,I as Us,y as wi,b6 as ki,a4 as ms,b5 as Si,b3 as Dr,bn as tr,i as $r,ar as Ks,at as Hs,a7 as Br,P as Vs,E as Pi,t as fs,b4 as ji,q as Ei}from"./index-BfWp2Wnw.js";import{u as Xs,N as Ni}from"./save-status-BXxefOdA.js";import{b as Ci,c as at,r as Mr,l as zr,f as Ti,g as Ri,w as Li}from"./chat-context-BUMEnIPW.js";import{t as Ai}from"./ChevronDown-CNlehUMA.js";import{G as _i,H as Oi,B as Ir,I as Fi,b as Di,J as sr,K as $i,L as Ur,M as Bi,N as Kr}from"./agent-icon-Bq_Z7esB.js";import{s as Mi}from"./File02-uZRQiPOp.js";import{a as zi,n as Ii}from"./UserSquare-oo1b4ulW.js";import{s as Hr}from"./Plus-DAYIm6ow.js";import{a as Vr,b as Wr,P as qr}from"./popover-oFcDtUvN.js";import{e as ht,b as gt,c as Gr,f as Jr,a as Yr,C as Qr}from"./command-DAachgGl.js";import{a as Ui,c as Ki,b as Hi}from"./repository-binding-BDu0tU0n.js";import{a as xt}from"./sandbox-lifecycle-context-Dq2ETPAf.js";import{a as Vi,n as Wi,u as qi,f as nr,H as Gi,P as Ji}from"./frame-navigation-D0o7MHwc.js";import{r as Yi}from"./session-runtime-DFmRKpVg.js";import{u as Xr}from"./use-voice-input-DyQL3diM.js";import{l as Qi,m as Xi,n as Zi,o as eo,q as to,t as so,u as Kt,j as hs,v as Zr,i as Xe,w as no,x as Zs,y as ea,k as ta,z as ro,A as ao,B as sa,C as io,c as na,b as ra,D as oo,h as He,E as lo,d as co,g as uo,F as fo,G as po,H as rr,I as mo,J as ar,K as ho,L as go,M as ir,N as or,O as lr,P as cr,Q as dr,R as _s,S as vo,U as xo,V as bo,W as yo,e as wo}from"./site-editor-toast-D2nHZREM.js";import{u as aa}from"./use-mobile-UoyYEGbQ.js";import{T as Ze,I as ur}from"./toolbar-icon-button-CaY1wsmY.js";import{T as et,a as tt,c as st}from"./tooltip-CqV-qcYU.js";import{w as as,i as ko}from"./variant-matcher-override-y-sjVy0V.js";import{s as Ut,n as en,a as ia,f as Ve,v as oa,u as la,h as So,i as Po,B as jo,S as Eo,C as No,b as Co,e as To,c as Ro,d as Lo,N as Ao,g as _o,r as Oo,j as Fo,k as fr,p as Do}from"./blocks-tab-states-Bx0tgd5u.js";import{a as $o}from"./use-fast-preview-draft-url-DYyM21UT.js";import{g as Bo,c as pr,B as Os,P as Mo,r as zo,R as Io,S as Uo,l as Ko,m as Ho,p as Vo}from"./parse-sections--l6s_VwH.js";import{g as Wo}from"./section-array-field-CYFq6Yfv.js";import{u as qo}from"./shell-layout-CQs-sSUy.js";import{u as tn,b as Go}from"./use-sandbox-events-rgvK0R-0.js";import{d as Jo,S as Fs}from"./empty-message-BFHsH7_h.js";import{u as Ws}from"./useQueries-Bay3GQsV.js";import{i as Yo}from"./ArrowRight-BVFSrvKf.js";import{u as ca,b as da}from"./use-never-published-D71BtZNY.js";import{u as ua}from"./blocks-preview-workspace-context-LI4fVaaR.js";import{c as Qo,H as Xo}from"./held-block-view-BCDffeao.js";import{MonacoCodeEditor as fa}from"./monaco-editor-BJmxWrxj.js";import{c as pa,u as ma}from"./hosted-reconcile-BV7FtBoJ.js";import{d as ha}from"./utils-D1ABa-c2.js";import{R as mr,a as is,b as hr}from"./resizable-BArMfXUk.js";import{g as ga}from"./use-org-notice-DQ7N3XWA.js";import{u as Zo}from"./use-blocks-v8-project-DwTQhXO1.js";import{s as el,L as tl,R as va,D as gr,w as qs}from"./device-hint-DBfDHhL1.js";import{s as sl}from"./UserCheck01-4mEtfdkD.js";import{L as nl}from"./label-CWaQ3ANC.js";import{T as rl,a as vr}from"./toggle-group-BgBCZLaa.js";import{i as al,l as il,D as ol}from"./named-rule-step-C6gSKxIZ.js";import{b as ll}from"./sandbox-url-D3mC8qhT.js";import{r as cl,R as dl}from"./virtual-mcp-m1o-7tiO.js";import{d as ul}from"./delay-CnY5UFtP.js";import{s as xa}from"./XClose-WYCPZpkD.js";import{o as fl}from"./omit-server-managed-metadata-L5IhjRZB.js";import{a as Ds,b as pl,w as ml,n as xr}from"./app-preview-url-9Od4s8Sz.js";import{a as hl}from"./use-organization-settings-BliP9B1t.js";import{a as $s}from"./agent-capabilities-DEMFK1PG.js";import{E as gl}from"./empty-state-Y9RPHES1.js";import{G as br}from"./github-icon-BBtraw32.js";import{R as vl}from"./new-project-dialog-B6Lwo0Gj.js";import{r as xl}from"./preview-source-BsRLGWUP.js";import{A as bl,a as yl,b as wl}from"./alert-fpttYoSQ.js";import{u as kl}from"./use-task-metadata-BIpPNwtn.js";function Sl(t){const e=le.c(10),{waiting:s}=t,n=s?"true":"false";let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(_i,{className:"size-5 sm:size-6"})}),e[0]=a):a=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=c):c=e[1];let d;e[2]!==s?(d=s&&r.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=s,e[3]=d):d=e[3];let o;e[4]!==d?(o=r.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[c,d]}),e[4]=d,e[5]=o):o=e[5];let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(Oi,{className:"size-5 sm:size-6"})}),e[6]=i):i=e[6];let l;return e[7]!==n||e[8]!==o?(l=r.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":n,className:"flex items-center gap-2",children:[a,o,i]}),e[7]=n,e[8]=o,e[9]=l):l=e[9],l}function Pl(t){const e=le.c(22),{index:s,numbered:n,step:a,heading:c}=t,d=N.useId();let o;e[0]!==s||e[1]!==n?(o=n&&r.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:s}),e[0]=s,e[1]=n,e[2]=o):o=e[2];let i;e[3]!==c||e[4]!==d||e[5]!==a.title?(i=r.jsx(c,{id:d,className:"text-sm font-medium text-foreground",children:a.title}),e[3]=c,e[4]=d,e[5]=a.title,e[6]=i):i=e[6];let l;e[7]!==o||e[8]!==i?(l=r.jsxs("div",{className:"flex items-center gap-3",children:[o,i]}),e[7]=o,e[8]=i,e[9]=l):l=e[9];const m=n&&"sm:pl-9";let f;e[10]!==m?(f=Re("flex min-w-0 flex-col gap-3",m),e[10]=m,e[11]=f):f=e[11];let p;e[12]!==a.body?(p=a.body&&r.jsx("p",{className:"text-sm text-muted-foreground",children:a.body}),e[12]=a.body,e[13]=p):p=e[13];let y;e[14]!==a.after||e[15]!==f||e[16]!==p?(y=r.jsxs("div",{className:f,children:[p,a.after]}),e[14]=a.after,e[15]=f,e[16]=p,e[17]=y):y=e[17];let x;return e[18]!==d||e[19]!==l||e[20]!==y?(x=r.jsxs("li",{"aria-labelledby":d,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[l,y]}),e[18]=d,e[19]=l,e[20]=y,e[21]=x):x=e[21],x}const jl=[];function ps(t){const e=le.c(20),{title:s,lead:n,waiting:a,alerts:c,steps:d,footer:o,headingLevel:i}=t,l=d===void 0?jl:d,m=i===void 0?1:i,f=m===1?"h1":"h2",p=a&&l.length===0?"status":void 0;let y;e[0]!==a?(y=r.jsx(Sl,{waiting:a}),e[0]=a,e[1]=y):y=e[1];let x;e[2]!==f||e[3]!==s?(x=r.jsx(f,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:s}),e[2]=f,e[3]=s,e[4]=x):x=e[4];let b;e[5]!==n?(b=n&&r.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:n}),e[5]=n,e[6]=b):b=e[6];let h;e[7]!==p||e[8]!==y||e[9]!==x||e[10]!==b?(h=r.jsxs("header",{role:p,className:"flex flex-col items-center gap-3 text-center",children:[y,x,b]}),e[7]=p,e[8]=y,e[9]=x,e[10]=b,e[11]=h):h=e[11];let g;e[12]!==m||e[13]!==l?(g=l.length>0&&r.jsx("ol",{className:"flex flex-col gap-3",children:l.map((v,w)=>r.jsx(Pl,{index:w+1,numbered:l.length>1,step:v,heading:m===1?"h2":"h3"},v.title))}),e[12]=m,e[13]=l,e[14]=g):g=e[14];let R;return e[15]!==c||e[16]!==o||e[17]!==h||e[18]!==g?(R=r.jsx("div",{className:"h-full w-full overflow-y-auto",children:r.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-xl flex-col justify-center gap-6 px-4 py-8 sm:py-12",children:[h,c,g,o]})}),e[15]=c,e[16]=o,e[17]=h,e[18]=g,e[19]=R):R=e[19],R}function El(t){const e=le.c(43),{wait:s,hosts:n,invalidLink:a}=t,c=a===void 0?!1:a,d=Ee();let o;e[0]!==c||e[1]!==d?(o=c&&r.jsx(bl,{variant:"warning",children:r.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[r.jsx(yl,{className:"line-clamp-none text-foreground",children:d("decoServe.link.invalidTitle")}),r.jsx(wl,{children:d("decoServe.link.invalidBody")})]})}),e[0]=c,e[1]=d,e[2]=o):o=e[2];const i=o;if(s.kind==="problem"){let w;e[3]!==d||e[4]!==s.host||e[5]!==s.problem?(w=el(d,s.problem,s.host),e[3]=d,e[4]=s.host,e[5]=s.problem,e[6]=w):w=e[6];const{title:T,body:k}=w;let S;e[7]!==k?(S=r.jsx(va,{text:k}),e[7]=k,e[8]=S):S=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=r.jsx(gr,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=j):j=e[9];let C;return e[10]!==i||e[11]!==S||e[12]!==T?(C=r.jsx(ps,{headingLevel:2,waiting:!1,title:T,lead:S,alerts:i,footer:j}),e[10]=i,e[11]=S,e[12]=T,e[13]=C):C=e[13],C}const l=s.kind==="looking",m=l&&!s.paused;let f;e[14]!==d?(f=d("decoServe.waiting.title"),e[14]=d,e[15]=f):f=e[15];let p;e[16]!==d?(p=d("decoServe.waiting.lead"),e[16]=d,e[17]=p):p=e[17];let y;e[18]!==i||e[19]!==s.kind?(y=(i||s.kind==="denied")&&r.jsxs(r.Fragment,{children:[i,s.kind==="denied"&&r.jsx(tl,{})]}),e[18]=i,e[19]=s.kind,e[20]=y):y=e[20];let x;e[21]!==d?(x=d("decoServe.waiting.connect.title"),e[21]=d,e[22]=x):x=e[22];let b;e[23]!==d?(b=d("decoServe.waiting.connect.body"),e[23]=d,e[24]=b):b=e[24];let h;e[25]!==n||e[26]!==l||e[27]!==d||e[28]!==s.kind||e[29]!==s.onStart||e[30]!==s.paused?(h=s.kind==="needs-gesture"?r.jsx(Oe,{variant:"outline",className:"self-start",onClick:s.onStart,children:d("decoServe.guide.start")}):l&&r.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:s.paused?d("decoServe.guide.paused"):d("decoServe.guide.looking",{hosts:n})}),e[25]=n,e[26]=l,e[27]=d,e[28]=s.kind,e[29]=s.onStart,e[30]=s.paused,e[31]=h):h=e[31];let g;e[32]!==x||e[33]!==b||e[34]!==h?(g=[{title:x,body:b,after:h}],e[32]=x,e[33]=b,e[34]=h,e[35]=g):g=e[35];let R;e[36]===Symbol.for("react.memo_cache_sentinel")?(R=r.jsx(gr,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[36]=R):R=e[36];let v;return e[37]!==g||e[38]!==m||e[39]!==f||e[40]!==p||e[41]!==y?(v=r.jsx(ps,{headingLevel:2,waiting:m,title:f,lead:p,alerts:y,steps:g,footer:R}),e[37]=g,e[38]=m,e[39]=f,e[40]=p,e[41]=y,e[42]=v):v=e[42],v}function Nl(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 Cl=15e3,Tl=3e3;function Rl(t){const{candidates:e,probe:s,onFound:n,onChange:a,doc:c=document,setTimer:d=(w,T)=>setTimeout(w,T),clearTimer:o=w=>clearTimeout(w),timeoutMs:i=Tl}=t;let l={status:"searching",firstRoundDone:!1,problem:null},m=!1,f=!1,p=0,y=null,x=null;const b=()=>c.visibilityState==="hidden",h=w=>{l={...l,...w},a(l)},g=async w=>{x=new AbortController;const T=x,k=d(()=>T.abort(),i);try{return await s(w,T.signal),!0}catch(S){if(m)return!1;const j=Xi(S);return j.reason!=="not-answering"?h({problem:{...j,endpoint:w}}):l.problem?.endpoint===w&&h({problem:null}),!1}finally{o(k),x=null}},R=async()=>{if(y=null,!(m||f)){if(e.length===0){h({status:"stopped",firstRoundDone:!0});return}if(b()){h({status:"paused"});return}f=!0,l.status!=="searching"&&h({status:"searching"});for(const w of e){if(m)break;if(await g(w)){if(f=!1,m)return;m=!0,c.removeEventListener("visibilitychange",v),h({status:"found",firstRoundDone:!0}),n(w);return}}if(f=!1,!m){if(p+=1,l.firstRoundDone||h({firstRoundDone:!0}),b()){h({status:"paused"});return}y=d(()=>{R()},Qi(p,Cl))}}};function v(){if(!m){if(b()){y!==null&&(o(y),y=null),f||h({status:"paused"});return}y!==null&&o(y),p=0,R()}}return c.addEventListener("visibilitychange",v),a(l),R(),()=>{m=!0,y!==null&&o(y),x?.abort(),c.removeEventListener("visibilitychange",v)}}function Ll(t,e){return eo(t,e)}const Al=["loopback-network","local-network-access"];async function _l(){if(Zi(window.location.origin))return null;for(const t of Al)try{return await navigator.permissions.query({name:t})}catch{}return null}let ba=null,yr=!1;const Bs=new Set;function Ol(t){if(Bs.add(t),!yr){yr=!0;const e=s=>{ba=s;for(const n of Bs)n()};_l().then(s=>{if(!s)return e("unsupported");e(s.state),s.addEventListener("change",()=>e(s.state))})}return()=>Bs.delete(t)}const Fl={status:"stopped",firstRoundDone:!1,problem:null},Ms=new Map;function Dl(t){const e=Ms.get(t);if(e)return e;let s={status:"searching",firstRoundDone:!1,problem:null};const n=new Set;let a=null;const c={onFound:()=>{},getSnapshot:()=>s,subscribe:d=>(n.add(d),a??=Rl({candidates:t.split(" "),probe:Ll,onFound:o=>c.onFound(o),onChange:o=>{s=o;for(const i of n)i()}}),()=>{n.delete(d),!(n.size>0)&&(a?.(),a=null,Ms.delete(t))})};return Ms.set(t,c),c}function ya(){return N.useSyncExternalStore(Ol,kr,kr)}const $l=()=>()=>{},wr=()=>Fl,kr=()=>ba;function of(t){const e=le.c(9),{candidates:s,onFound:n}=t,[a,c]=N.useState(!1),d=ya(),i=(d==="granted"||d==="unsupported"||d==="prompt"&&a)&&s.length>0;let l;e[0]!==i||e[1]!==s||e[2]!==n?(l=i?Dl(s.join(" ")):null,l&&(l.onFound=n),e[0]=i,e[1]=s,e[2]=n,e[3]=l):l=e[3];const m=N.useSyncExternalStore(l?.subscribe??$l,l?.getSnapshot??wr,l?.getSnapshot??wr),f=d==="prompt"&&!a;let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>c(!0),e[4]=p):p=e[4];let y;return e[5]!==d||e[6]!==m||e[7]!==f?(y={state:m,access:d,needsGesture:f,start:p},e[5]=d,e[6]=m,e[7]=f,e[8]=y):y=e[8],y}const Sr={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Bl(t){const{previewState:e,progressStatus:s,fastPreviewActive:n=!1,fastPreviewReady:a=!1,codingSession:c=!1,hostedDraft:d=!1}=t,o=c?null:t.previewServerUrl;return t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Sr:d&&t.hostedPointerPending&&!a?{...Sr,showDecidingLoader:!0}:n&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:n&&d&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!n&&e.kind==="iframe"&&s!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Ml=1500,zl=500;function Il({iframe:t,reload:e,waitMs:s=Ml,confirmMs:n=zl}){let a;const c=()=>{clearTimeout(d),a=setTimeout(e,n)};t.addEventListener("load",c,{once:!0});const d=setTimeout(()=>{t.removeEventListener("load",c),e()},s);return()=>{clearTimeout(d),clearTimeout(a),t.removeEventListener("load",c)}}const Ul=us({tag:$e(),id:$e(),classes:$e(),text:$e(),html:$e(),manifestKey:$e().nullable(),componentName:$e().nullable(),parents:$e(),url:$e(),path:$e(),viewport:us({width:mt(),height:mt()}),position:us({x:mt(),y:mt()})}),Kl=`(function() {
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-DC8FnTKc.js","assets/index-FR7-LkFs.js","assets/index-pbgcO64n.css","assets/chat-context-CN0ge7G_.js","assets/use-panel-navigate-ajPZ-O4i.js","assets/thread-route-H2DC02zF.js","assets/use-project-scope-DbG1jNVV.js","assets/repository-binding-DdJXPhL-.js","assets/use-mcp-client-B9e5PyU5.js","assets/auth-Bl-k7r97.js","assets/use-view-draft-kind-CBmzgnXH.js","assets/use-blog-view-Ba0QG6QU.js","assets/use-organization-settings-D9Z_MLl2.js","assets/schema-Do1srOed.js","assets/task-board-WdgeTNaU.js","assets/thread-intent-DDQe6PKd.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-DvEr2HwM.js","assets/session-runtime-ByRl2V_-.js","assets/use-entitlements-b0vun-2_.js","assets/use-ai-providers-CTFkZoGo.js","assets/use-current-view-D_ifkjui.js","assets/use-in-settings-CK5SsWhS.js","assets/use-decopilot-events-DY8bcy2g.js","assets/save-status-DUnwCvL6.js","assets/Image01-Y2lD5lzL.js","assets/Trash01-thCRPjRX.js","assets/Upload01-phZoBZ05.js","assets/use-never-published-Ct3dv44f.js","assets/use-voice-input-CChbkXIH.js","assets/popover-7x26sV4l.js","assets/drawer-GUKur5v4.js","assets/tooltip-zEsMTxPP.js","assets/index-CexiDE6J.js","assets/use-mobile-Dcp3TiKi.js","assets/agent-icon-BHVUedtV.js","assets/AlertCircle-CPiOwWun.js","assets/UserCheck01-D6gLgI3l.js","assets/Tool01-BR1SF2OD.js","assets/ArrowUp-jEyjY7ti.js","assets/ArrowLeft-BmNyLgKT.js","assets/ArrowRight-eaR9pEFa.js","assets/BookOpen01-anezSoTd.js","assets/Globe04-OpdFYH01.js","assets/CheckCircle-Cyt1BwLE.js","assets/TrendUp01-PuhB09lM.js","assets/ChevronDown-DHu3fSw0.js","assets/ChevronSelectorVertical-CADaAEiD.js","assets/ChevronUp-XsNgN3o9.js","assets/UserSquare-BHfTOZb7.js","assets/LinkBroken01-oT9QqlUI.js","assets/CreditCard01-Cu1-B7H4.js","assets/File02-CG-VTATo.js","assets/MessageCircle01-Ccsb6qrK.js","assets/SwitchHorizontal01-Cfysn-sK.js","assets/Eye-w_JiO-fJ.js","assets/Key01-BzZWEKIv.js","assets/LayoutLeft-BRKXPCjt.js","assets/Minus-CqZyDWGo.js","assets/Monitor01-BwGctKTP.js","assets/Sun-DjNmeFt2.js","assets/Play-CBJR-IvJ.js","assets/Plus-INbg-jHc.js","assets/SearchMd-zyGFO7cc.js","assets/ShoppingBag01-DM_RSubP.js","assets/Users01-DVJrVMQW.js","assets/XClose-_lsllZaX.js","assets/Zap-B4USkjaG.js","assets/index-HW6xhQCR.js","assets/checkbox-B1iPgrjx.js","assets/select-DO5UmbiK.js","assets/index-BdQq_4o_.js","assets/ai-providers-logos-DD3qZ33J.js","assets/openai-compatible-presets-BKGfVqEx.js","assets/site-editor-toast-CksZ_DBd.js","assets/use-sandbox-events-DYuy4eXR.js","assets/sandbox-url-D3mC8qhT.js","assets/use-blocks-v8-project-ou9QCF6v.js","assets/utils-O_zWQ9Z7.js","assets/sandbox-git-api-B4kiB_OO.js","assets/hosted-reconcile-OWVjsnRk.js","assets/blocks-tab-states-CRdiUDZv.js","assets/empty-state-BO8_YMfm.js","assets/search-input-DLh0nlr5.js","assets/tabs-DD53shfE.js","assets/active-indicator-CCMhAsc_.js","assets/use-debounced-value-COFfhICA.js","assets/use-file-configs-CwMKmvEP.js","assets/asset-utils-D9WZTXXH.js","assets/useInfiniteQuery-f2vaHavl.js","assets/infiniteQueryObserver-Bo9y-Vk0.js","assets/usage-stats-DV0A8cEM.js","assets/utils-CVEq3hMx.js","assets/markdown-CV0DScZs.js","assets/use-copy-d7u6BVsA.js","assets/gateway-client-zNeoWGKO.js","assets/form-CAsgx2CK.js","assets/label-BrDhuinX.js","assets/switch-BHmi6NG_.js","assets/toggle-group-DsHNAW_o.js","assets/match-site-slug-config-B47_xZCi.js","assets/parse-sections-l0PaukKn.js","assets/held-block-view-Ce7FjzFo.js","assets/calendar-DBDouA4h.js","assets/textarea-HB4U7ZGE.js","assets/editor-classes-BrZH4rK_.js","assets/task-key-BOhf6PeF.js","assets/sortable.esm-DW0wRpPm.js","assets/empty-message-pNIo6swu.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-UrNHmvwT.js","assets/collapsible-Cw6OK2nn.js","assets/use-task-board-items-C2I9m2B-.js","assets/config-BATJRdlj.js","assets/task-route-CKQNtOSa.js","assets/project-index-CH5Eesm9.js","assets/shell-layout-hxOVAb6r.js","assets/use-deployment-admin-DgU-c4bG.js","assets/admin-fetch-BhTJlAsX.js","assets/use-org-notice-CsHPv0ZT.js","assets/command-_zJuKDCi.js","assets/index-GXFk32Bw.js","assets/integration-icon-D_iw-M-g.js","assets/project-icon-BakFKgaM.js","assets/use-navigate-to-agent-8EROExiH.js","assets/new-project-dialog-BZf8-lvn.js","assets/repository-picker-DcD51j3V.js","assets/github-icon-CIUXCHYd.js","assets/collection-search-Z4PinuXc.js","assets/new-project-store-D6y4lbf2.js","assets/legacy-admin-welcome-dialog-CCTtGdld.js","assets/required-auth-layout-81VJBEp9.js","assets/use-org-sso-ClZgaz67.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-BD-0mBhr.js","assets/types-DMMPR8qW.js","assets/omit-server-managed-metadata-L5IhjRZB.js","assets/sheet-Ba_kC1AK.js","assets/use-connection-BHM3BFUr.js","assets/use-mcp-prompts-DgapPQcC.js","assets/use-thread-outputs-KaWkhSGH.js","assets/file-type-icon-BoZOJHAX.js","assets/section-array-field-CVPQhOEL.js","assets/named-rule-step-CrkqnZE0.js","assets/slider-BNKhoqMv.js","assets/index-Cz7ziqq8.js","assets/tooltipContext-DnSCkdE2.js","assets/CategoricalChart-D4s5JRnh.js","assets/index-DFgV3_JA.js","assets/combobox-DEB0BlzS.js","assets/scroll-area-Cg0VHNwx.js","assets/monaco-editor-BrHCIY9F.js","assets/editor-DFpyUa_U.js","assets/use-delete-block-CGqlkyBO.js","assets/use-section-preview-base-BA-kLqNd.js","assets/mustache-DbskuLzt.js","assets/seo-editor-Cb_-6pbC.js","assets/use-apply-named-rule-CTLfcvn0.js","assets/use-move-blocks-B_Oh4K4K.js","assets/variant-matcher-override-BLYg6qNr.js"])))=>i.map(i=>d[i]);
2
+ import{c as le,j as r,r as N,m as Re,b as Ee,B as Oe,aF as us,bi as mt,aG as $e,bj as gi,bk as vi,bl as xi,bm as bi,v as Ar,D as _r,K as Qs,w as Or,x as Fr,e as yi,h as rt,I as Us,y as wi,b6 as ki,a4 as ms,b5 as Si,b3 as Dr,bn as tr,i as $r,ar as Ks,at as Hs,a7 as Br,P as Vs,E as Pi,t as fs,b4 as ji,q as Ei}from"./index-FR7-LkFs.js";import{u as Xs,N as Ni}from"./save-status-DUnwCvL6.js";import{b as Ci,c as at,r as Mr,l as zr,f as Ti,g as Ri,w as Li}from"./chat-context-CN0ge7G_.js";import{t as Ai}from"./ChevronDown-DHu3fSw0.js";import{G as _i,H as Oi,B as Ir,I as Fi,b as Di,J as sr,K as $i,L as Ur,M as Bi,N as Kr}from"./agent-icon-BHVUedtV.js";import{s as Mi}from"./File02-CG-VTATo.js";import{a as zi,n as Ii}from"./UserSquare-BHfTOZb7.js";import{s as Hr}from"./Plus-INbg-jHc.js";import{a as Vr,b as Wr,P as qr}from"./popover-7x26sV4l.js";import{e as ht,b as gt,c as Gr,f as Jr,a as Yr,C as Qr}from"./command-_zJuKDCi.js";import{a as Ui,c as Ki,b as Hi}from"./repository-binding-DdJXPhL-.js";import{a as xt}from"./sandbox-lifecycle-context-DIPvnGzU.js";import{a as Vi,n as Wi,u as qi,f as nr,H as Gi,P as Ji}from"./frame-navigation-BzE9s8s7.js";import{r as Yi}from"./session-runtime-ByRl2V_-.js";import{u as Xr}from"./use-voice-input-CChbkXIH.js";import{l as Qi,m as Xi,n as Zi,o as eo,q as to,t as so,u as Kt,j as hs,v as Zr,i as Xe,w as no,x as Zs,y as ea,k as ta,z as ro,A as ao,B as sa,C as io,c as na,b as ra,D as oo,h as He,E as lo,d as co,g as uo,F as fo,G as po,H as rr,I as mo,J as ar,K as ho,L as go,M as ir,N as or,O as lr,P as cr,Q as dr,R as _s,S as vo,U as xo,V as bo,W as yo,e as wo}from"./site-editor-toast-CksZ_DBd.js";import{u as aa}from"./use-mobile-Dcp3TiKi.js";import{T as Ze,I as ur}from"./toolbar-icon-button-D2GZy3ji.js";import{T as et,a as tt,c as st}from"./tooltip-zEsMTxPP.js";import{w as as,i as ko}from"./variant-matcher-override-BLYg6qNr.js";import{s as Ut,n as en,a as ia,f as Ve,v as oa,u as la,h as So,i as Po,B as jo,S as Eo,C as No,b as Co,e as To,c as Ro,d as Lo,N as Ao,g as _o,r as Oo,j as Fo,k as fr,p as Do}from"./blocks-tab-states-CRdiUDZv.js";import{a as $o}from"./use-fast-preview-draft-url-DncEMB04.js";import{g as Bo,c as pr,B as Os,P as Mo,r as zo,R as Io,S as Uo,l as Ko,m as Ho,p as Vo}from"./parse-sections-l0PaukKn.js";import{g as Wo}from"./section-array-field-CVPQhOEL.js";import{u as qo}from"./shell-layout-hxOVAb6r.js";import{u as tn,b as Go}from"./use-sandbox-events-DYuy4eXR.js";import{d as Jo,S as Fs}from"./empty-message-pNIo6swu.js";import{u as Ws}from"./useQueries-DUm4FupI.js";import{i as Yo}from"./ArrowRight-eaR9pEFa.js";import{u as ca,b as da}from"./use-never-published-Ct3dv44f.js";import{u as ua}from"./blocks-preview-workspace-context-C1jP5wlw.js";import{c as Qo,H as Xo}from"./held-block-view-Ce7FjzFo.js";import{MonacoCodeEditor as fa}from"./monaco-editor-BrHCIY9F.js";import{c as pa,u as ma}from"./hosted-reconcile-OWVjsnRk.js";import{d as ha}from"./utils-O_zWQ9Z7.js";import{R as mr,a as is,b as hr}from"./resizable-BrnNepSm.js";import{g as ga}from"./use-org-notice-CsHPv0ZT.js";import{u as Zo}from"./use-blocks-v8-project-ou9QCF6v.js";import{s as el,L as tl,R as va,D as gr,w as qs}from"./device-hint-0Up2oNr2.js";import{s as sl}from"./UserCheck01-D6gLgI3l.js";import{L as nl}from"./label-BrDhuinX.js";import{T as rl,a as vr}from"./toggle-group-DsHNAW_o.js";import{i as al,l as il,D as ol}from"./named-rule-step-CrkqnZE0.js";import{b as ll}from"./sandbox-url-D3mC8qhT.js";import{r as cl,R as dl}from"./virtual-mcp-9Ocfu-kl.js";import{d as ul}from"./delay-CnY5UFtP.js";import{s as xa}from"./XClose-_lsllZaX.js";import{o as fl}from"./omit-server-managed-metadata-L5IhjRZB.js";import{a as Ds,b as pl,w as ml,n as xr}from"./app-preview-url-9Od4s8Sz.js";import{a as hl}from"./use-organization-settings-D9Z_MLl2.js";import{a as $s}from"./agent-capabilities-BTvAxwai.js";import{E as gl}from"./empty-state-BO8_YMfm.js";import{G as br}from"./github-icon-CIUXCHYd.js";import{R as vl}from"./new-project-dialog-BZf8-lvn.js";import{r as xl}from"./preview-source-BsRLGWUP.js";import{A as bl,a as yl,b as wl}from"./alert-DxQDfLz2.js";import{u as kl}from"./use-task-metadata-CQcB7BzK.js";function Sl(t){const e=le.c(10),{waiting:s}=t,n=s?"true":"false";let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(_i,{className:"size-5 sm:size-6"})}),e[0]=a):a=e[0];let c;e[1]===Symbol.for("react.memo_cache_sentinel")?(c=r.jsx("span",{className:"h-px w-full border-t border-dashed border-muted-foreground/40"}),e[1]=c):c=e[1];let d;e[2]!==s?(d=s&&r.jsx("span",{"data-testid":"connection-dot",className:"absolute top-0 size-2 animate-[connection-shuttle_1.8s_var(--ease-in-out-cubic)_infinite_alternate] rounded-full bg-foreground"}),e[2]=s,e[3]=d):d=e[3];let o;e[4]!==d?(o=r.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[c,d]}),e[4]=d,e[5]=o):o=e[5];let i;e[6]===Symbol.for("react.memo_cache_sentinel")?(i=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(Oi,{className:"size-5 sm:size-6"})}),e[6]=i):i=e[6];let l;return e[7]!==n||e[8]!==o?(l=r.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":n,className:"flex items-center gap-2",children:[a,o,i]}),e[7]=n,e[8]=o,e[9]=l):l=e[9],l}function Pl(t){const e=le.c(22),{index:s,numbered:n,step:a,heading:c}=t,d=N.useId();let o;e[0]!==s||e[1]!==n?(o=n&&r.jsx("span",{"aria-hidden":"true",className:"flex size-6 shrink-0 items-center justify-center rounded-full bg-muted text-xs font-medium tabular-nums text-foreground",children:s}),e[0]=s,e[1]=n,e[2]=o):o=e[2];let i;e[3]!==c||e[4]!==d||e[5]!==a.title?(i=r.jsx(c,{id:d,className:"text-sm font-medium text-foreground",children:a.title}),e[3]=c,e[4]=d,e[5]=a.title,e[6]=i):i=e[6];let l;e[7]!==o||e[8]!==i?(l=r.jsxs("div",{className:"flex items-center gap-3",children:[o,i]}),e[7]=o,e[8]=i,e[9]=l):l=e[9];const m=n&&"sm:pl-9";let f;e[10]!==m?(f=Re("flex min-w-0 flex-col gap-3",m),e[10]=m,e[11]=f):f=e[11];let p;e[12]!==a.body?(p=a.body&&r.jsx("p",{className:"text-sm text-muted-foreground",children:a.body}),e[12]=a.body,e[13]=p):p=e[13];let y;e[14]!==a.after||e[15]!==f||e[16]!==p?(y=r.jsxs("div",{className:f,children:[p,a.after]}),e[14]=a.after,e[15]=f,e[16]=p,e[17]=y):y=e[17];let x;return e[18]!==d||e[19]!==l||e[20]!==y?(x=r.jsxs("li",{"aria-labelledby":d,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[l,y]}),e[18]=d,e[19]=l,e[20]=y,e[21]=x):x=e[21],x}const jl=[];function ps(t){const e=le.c(20),{title:s,lead:n,waiting:a,alerts:c,steps:d,footer:o,headingLevel:i}=t,l=d===void 0?jl:d,m=i===void 0?1:i,f=m===1?"h1":"h2",p=a&&l.length===0?"status":void 0;let y;e[0]!==a?(y=r.jsx(Sl,{waiting:a}),e[0]=a,e[1]=y):y=e[1];let x;e[2]!==f||e[3]!==s?(x=r.jsx(f,{tabIndex:-1,className:"text-balance text-lg font-medium text-foreground outline-none sm:text-xl",children:s}),e[2]=f,e[3]=s,e[4]=x):x=e[4];let b;e[5]!==n?(b=n&&r.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:n}),e[5]=n,e[6]=b):b=e[6];let h;e[7]!==p||e[8]!==y||e[9]!==x||e[10]!==b?(h=r.jsxs("header",{role:p,className:"flex flex-col items-center gap-3 text-center",children:[y,x,b]}),e[7]=p,e[8]=y,e[9]=x,e[10]=b,e[11]=h):h=e[11];let g;e[12]!==m||e[13]!==l?(g=l.length>0&&r.jsx("ol",{className:"flex flex-col gap-3",children:l.map((v,w)=>r.jsx(Pl,{index:w+1,numbered:l.length>1,step:v,heading:m===1?"h2":"h3"},v.title))}),e[12]=m,e[13]=l,e[14]=g):g=e[14];let R;return e[15]!==c||e[16]!==o||e[17]!==h||e[18]!==g?(R=r.jsx("div",{className:"h-full w-full overflow-y-auto",children:r.jsxs("div",{className:"mx-auto flex min-h-full w-full max-w-xl flex-col justify-center gap-6 px-4 py-8 sm:py-12",children:[h,c,g,o]})}),e[15]=c,e[16]=o,e[17]=h,e[18]=g,e[19]=R):R=e[19],R}function El(t){const e=le.c(43),{wait:s,hosts:n,invalidLink:a}=t,c=a===void 0?!1:a,d=Ee();let o;e[0]!==c||e[1]!==d?(o=c&&r.jsx(bl,{variant:"warning",children:r.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[r.jsx(yl,{className:"line-clamp-none text-foreground",children:d("decoServe.link.invalidTitle")}),r.jsx(wl,{children:d("decoServe.link.invalidBody")})]})}),e[0]=c,e[1]=d,e[2]=o):o=e[2];const i=o;if(s.kind==="problem"){let w;e[3]!==d||e[4]!==s.host||e[5]!==s.problem?(w=el(d,s.problem,s.host),e[3]=d,e[4]=s.host,e[5]=s.problem,e[6]=w):w=e[6];const{title:T,body:k}=w;let S;e[7]!==k?(S=r.jsx(va,{text:k}),e[7]=k,e[8]=S):S=e[8];let j;e[9]===Symbol.for("react.memo_cache_sentinel")?(j=r.jsx(gr,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=j):j=e[9];let C;return e[10]!==i||e[11]!==S||e[12]!==T?(C=r.jsx(ps,{headingLevel:2,waiting:!1,title:T,lead:S,alerts:i,footer:j}),e[10]=i,e[11]=S,e[12]=T,e[13]=C):C=e[13],C}const l=s.kind==="looking",m=l&&!s.paused;let f;e[14]!==d?(f=d("decoServe.waiting.title"),e[14]=d,e[15]=f):f=e[15];let p;e[16]!==d?(p=d("decoServe.waiting.lead"),e[16]=d,e[17]=p):p=e[17];let y;e[18]!==i||e[19]!==s.kind?(y=(i||s.kind==="denied")&&r.jsxs(r.Fragment,{children:[i,s.kind==="denied"&&r.jsx(tl,{})]}),e[18]=i,e[19]=s.kind,e[20]=y):y=e[20];let x;e[21]!==d?(x=d("decoServe.waiting.connect.title"),e[21]=d,e[22]=x):x=e[22];let b;e[23]!==d?(b=d("decoServe.waiting.connect.body"),e[23]=d,e[24]=b):b=e[24];let h;e[25]!==n||e[26]!==l||e[27]!==d||e[28]!==s.kind||e[29]!==s.onStart||e[30]!==s.paused?(h=s.kind==="needs-gesture"?r.jsx(Oe,{variant:"outline",className:"self-start",onClick:s.onStart,children:d("decoServe.guide.start")}):l&&r.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:s.paused?d("decoServe.guide.paused"):d("decoServe.guide.looking",{hosts:n})}),e[25]=n,e[26]=l,e[27]=d,e[28]=s.kind,e[29]=s.onStart,e[30]=s.paused,e[31]=h):h=e[31];let g;e[32]!==x||e[33]!==b||e[34]!==h?(g=[{title:x,body:b,after:h}],e[32]=x,e[33]=b,e[34]=h,e[35]=g):g=e[35];let R;e[36]===Symbol.for("react.memo_cache_sentinel")?(R=r.jsx(gr,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[36]=R):R=e[36];let v;return e[37]!==g||e[38]!==m||e[39]!==f||e[40]!==p||e[41]!==y?(v=r.jsx(ps,{headingLevel:2,waiting:m,title:f,lead:p,alerts:y,steps:g,footer:R}),e[37]=g,e[38]=m,e[39]=f,e[40]=p,e[41]=y,e[42]=v):v=e[42],v}function Nl(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 Cl=15e3,Tl=3e3;function Rl(t){const{candidates:e,probe:s,onFound:n,onChange:a,doc:c=document,setTimer:d=(w,T)=>setTimeout(w,T),clearTimer:o=w=>clearTimeout(w),timeoutMs:i=Tl}=t;let l={status:"searching",firstRoundDone:!1,problem:null},m=!1,f=!1,p=0,y=null,x=null;const b=()=>c.visibilityState==="hidden",h=w=>{l={...l,...w},a(l)},g=async w=>{x=new AbortController;const T=x,k=d(()=>T.abort(),i);try{return await s(w,T.signal),!0}catch(S){if(m)return!1;const j=Xi(S);return j.reason!=="not-answering"?h({problem:{...j,endpoint:w}}):l.problem?.endpoint===w&&h({problem:null}),!1}finally{o(k),x=null}},R=async()=>{if(y=null,!(m||f)){if(e.length===0){h({status:"stopped",firstRoundDone:!0});return}if(b()){h({status:"paused"});return}f=!0,l.status!=="searching"&&h({status:"searching"});for(const w of e){if(m)break;if(await g(w)){if(f=!1,m)return;m=!0,c.removeEventListener("visibilitychange",v),h({status:"found",firstRoundDone:!0}),n(w);return}}if(f=!1,!m){if(p+=1,l.firstRoundDone||h({firstRoundDone:!0}),b()){h({status:"paused"});return}y=d(()=>{R()},Qi(p,Cl))}}};function v(){if(!m){if(b()){y!==null&&(o(y),y=null),f||h({status:"paused"});return}y!==null&&o(y),p=0,R()}}return c.addEventListener("visibilitychange",v),a(l),R(),()=>{m=!0,y!==null&&o(y),x?.abort(),c.removeEventListener("visibilitychange",v)}}function Ll(t,e){return eo(t,e)}const Al=["loopback-network","local-network-access"];async function _l(){if(Zi(window.location.origin))return null;for(const t of Al)try{return await navigator.permissions.query({name:t})}catch{}return null}let ba=null,yr=!1;const Bs=new Set;function Ol(t){if(Bs.add(t),!yr){yr=!0;const e=s=>{ba=s;for(const n of Bs)n()};_l().then(s=>{if(!s)return e("unsupported");e(s.state),s.addEventListener("change",()=>e(s.state))})}return()=>Bs.delete(t)}const Fl={status:"stopped",firstRoundDone:!1,problem:null},Ms=new Map;function Dl(t){const e=Ms.get(t);if(e)return e;let s={status:"searching",firstRoundDone:!1,problem:null};const n=new Set;let a=null;const c={onFound:()=>{},getSnapshot:()=>s,subscribe:d=>(n.add(d),a??=Rl({candidates:t.split(" "),probe:Ll,onFound:o=>c.onFound(o),onChange:o=>{s=o;for(const i of n)i()}}),()=>{n.delete(d),!(n.size>0)&&(a?.(),a=null,Ms.delete(t))})};return Ms.set(t,c),c}function ya(){return N.useSyncExternalStore(Ol,kr,kr)}const $l=()=>()=>{},wr=()=>Fl,kr=()=>ba;function of(t){const e=le.c(9),{candidates:s,onFound:n}=t,[a,c]=N.useState(!1),d=ya(),i=(d==="granted"||d==="unsupported"||d==="prompt"&&a)&&s.length>0;let l;e[0]!==i||e[1]!==s||e[2]!==n?(l=i?Dl(s.join(" ")):null,l&&(l.onFound=n),e[0]=i,e[1]=s,e[2]=n,e[3]=l):l=e[3];const m=N.useSyncExternalStore(l?.subscribe??$l,l?.getSnapshot??wr,l?.getSnapshot??wr),f=d==="prompt"&&!a;let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>c(!0),e[4]=p):p=e[4];let y;return e[5]!==d||e[6]!==m||e[7]!==f?(y={state:m,access:d,needsGesture:f,start:p},e[5]=d,e[6]=m,e[7]=f,e[8]=y):y=e[8],y}const Sr={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Bl(t){const{previewState:e,progressStatus:s,fastPreviewActive:n=!1,fastPreviewReady:a=!1,codingSession:c=!1,hostedDraft:d=!1}=t,o=c?null:t.previewServerUrl;return t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Sr:d&&t.hostedPointerPending&&!a?{...Sr,showDecidingLoader:!0}:n&&a&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:n&&d&&o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!1}:!n&&e.kind==="iframe"&&s!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:o?{mode:"production",iframeBase:o,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Ml=1500,zl=500;function Il({iframe:t,reload:e,waitMs:s=Ml,confirmMs:n=zl}){let a;const c=()=>{clearTimeout(d),a=setTimeout(e,n)};t.addEventListener("load",c,{once:!0});const d=setTimeout(()=>{t.removeEventListener("load",c),e()},s);return()=>{clearTimeout(d),clearTimeout(a),t.removeEventListener("load",c)}}const Ul=us({tag:$e(),id:$e(),classes:$e(),text:$e(),html:$e(),manifestKey:$e().nullable(),componentName:$e().nullable(),parents:$e(),url:$e(),path:$e(),viewport:us({width:mt(),height:mt()}),position:us({x:mt(),y:mt()})}),Kl=`(function() {
3
3
  if (window.__visualEditorActive) return;
4
4
  window.__visualEditorActive = true;
5
5
 
@@ -554,4 +554,4 @@ import{c as le,j as r,r as N,m as Re,b as Ee,B as Oe,aF as us,bi as mt,aG as $e,
554
554
  }
555
555
  });
556
556
  })();`,os=Object.freeze({ready:"deco:ready",load:"deco:load",loaded:"deco:loaded",loadError:"deco:load-error"}),ql="v1",Gl="/studio-modules",zs=["wireframe","html-swap"];function Jl(t,e,s){const n=new URL(`${Gl}/${ql}/${e}.js`,t);return s&&n.searchParams.set("build",s),n.href}const Yl=2e3;class Ql{constructor(e){this.options=e,this.urls=Object.fromEntries(zs.map(s=>[s,Jl(e.studioOrigin,s,e.build)]))}options;origin=null;urls;loaded=new Set;swapId=0;pendingSwap=null;startTimer=null;has(e){return this.loaded.has(e)}handle(e){const s=this.options.frame();if(!s||e.source!==s)return!1;const n=e.data;if(!n||typeof n.type!="string")return!1;if(n.type===os.ready)return Xl(e.origin)?(this.ready(e.origin),!0):!1;if(e.origin!==this.origin)return!1;const a=n;switch(a.type){case os.loaded:{const c=this.nameOf(a.url);return c&&(this.loaded.add(c),this.options.onModulesChange?.(),c==="wireframe"&&this.options.onWireframeReady?.()),!0}case os.loadError:{const c=this.nameOf(a.url);return c&&this.loaded.delete(c)&&this.options.onModulesChange?.(),c==="html-swap"&&this.failSwap(),!0}case"wireframe:hover":case"wireframe:select":return this.options.onWireframe?.(a),!0;case"html-swap:start":return this.pendingSwap?.id===a.id&&(this.pendingSwap.started=!0,this.clearStartTimer()),!0;case"html-swap:end":return this.pendingSwap?.id!==a.id||(this.pendingSwap=null,this.clearStartTimer(),this.options.onSwapEnd?.()),!0;case"html-swap:error":return this.pendingSwap?.id===a.id&&this.failSwap(),!0;default:return!1}}wireframe(e){return this.post("wireframe",e)}refresh(e){if(e!==void 0&&!this.isFrameOrigin(e))return!1;const s=++this.swapId,n=e?{type:"html-swap:refresh",id:s,url:e}:{type:"html-swap:refresh",id:s};return this.post("html-swap",n)?(this.pendingSwap={id:s,started:!1},this.clearStartTimer(),this.startTimer=setTimeout(()=>{this.startTimer=null,this.pendingSwap?.id===s&&!this.pendingSwap.started&&this.failSwap()},Yl),!0):!1}dispose(){this.clearStartTimer(),this.pendingSwap=null,this.loaded.clear(),this.origin=null}ready(e){this.origin=e,this.loaded.size&&(this.loaded.clear(),this.options.onModulesChange?.()),this.pendingSwap&&(this.pendingSwap=null,this.clearStartTimer(),this.options.onSwapEnd?.());const s=this.options.frame();for(const n of zs)s?.postMessage({type:os.load,url:this.urls[n]},e)}post(e,s){const n=this.options.frame();return!n||!this.origin||!this.loaded.has(e)?!1:(n.postMessage(s,this.origin),!0)}isFrameOrigin(e){try{return new URL(e).origin===this.origin}catch{return!1}}nameOf(e){return zs.find(s=>this.urls[s]===e)??null}failSwap(){this.clearStartTimer(),this.pendingSwap&&(this.pendingSwap=null,this.options.onSwapFailed?.())}clearStartTimer(){this.startTimer&&clearTimeout(this.startTimer),this.startTimer=null}}function Xl(t){if(typeof t!="string"||t==="null")return!1;try{const e=new URL(t).origin;return e!=="null"&&e===t}catch{return!1}}function Gs(t,e,s=!1){let n=t,a=typeof n?.__resolveType=="string"?n.__resolveType:"";for(let c=0;a&&c<5;c++){const d=e[a];if(d&&typeof d=="object"&&"__resolveType"in d){const o=d.__resolveType;if(typeof o=="string"&&o&&o!==a){n=d,a=o;continue}}break}if(!a)return[];if(a.includes("flags/multivariate")||s&&gi(a,s)){const c=Array.isArray(n.variants)?n.variants:[];if(c.length===0||c.every(i=>{const l=i?.rule;return vi(l?.__resolveType,s)}))return null;const o=[];for(const i of c){const l=xi(i,s);if(l&&typeof l=="object")for(const m of Gs(l,e,s)??[])o.includes(m)||o.push(m)}return o}if(bi(a)){const c=n.section&&typeof n.section=="object"?Gs(n.section,e,s):[];return c===null?null:c.length?[a,...c]:[a]}return[a]}function pt(t){return t.replace(/[`*_]/g,"\\$&")}function Zl(t,e){const s=[`The user selected an element on the live preview and asked: **"${pt(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:** \`${pt(t.manifestKey)}\``,"","This is a Deco resolveType, not a literal file path. The leading segment is the app name, not a directory — the actual source file lives under a sections directory whose root varies by site (commonly `sections/`, `src/sections/`, or `site/sections/`). Locate the file by searching for the trailing path (e.g. the component filename), don't assume the resolveType is a valid path on disk.","");const n=`<${t.tag}${t.classes?` class="${pt(t.classes)}"`:""}>`;s.push(`**Clicked element:** \`${n}\``),t.parents&&s.push(`**DOM breadcrumb:** ${pt(t.parents)} > ${t.tag}`),t.text&&s.push(`**Text content:** "${pt(t.text)}"`),t.componentName&&s.push(`**Component name:** ${pt(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(`
557
- `)}function ec(t,e,s=320,n=44,a=12){const{x:c,y:d}=t,{width:o,height:i}=e,l=Math.max(a,Math.min(c-s/2,o-s-a)),f=d/i>.68?Math.max(a,d-n-18):Math.min(d+18,i-n-a);return{leftPct:l/o*100,topPct:f/i*100}}function tc(t){const e=le.c(45),{element:s,onDismiss:n}=t,[a,c]=N.useState(""),d=N.useRef(null),{sendMessage:o}=Ci(),{openSidePanel:i}=qo(),l=Ee();let m;e[0]!==s||e[1]!==a||e[2]!==n||e[3]!==i||e[4]!==o?(m=()=>{if(!a.trim())return;const I=Zl(s,a);i(),o({parts:[{type:"text",text:I}]}),n()},e[0]=s,e[1]=a,e[2]=n,e[3]=i,e[4]=o,e[5]=m):m=e[5];const f=m;let p;e[6]!==s.position||e[7]!==s.viewport?(p=ec(s.position,s.viewport),e[6]=s.position,e[7]=s.viewport,e[8]=p):p=e[8];const y=p,x=`${y.leftPct}%`,b=`${y.topPct}%`;let h;e[9]!==x||e[10]!==b?(h={left:x,top:b,width:"320px"},e[9]=x,e[10]=b,e[11]=h):h=e[11];let g;e[12]!==f?(g=I=>{I.preventDefault(),f()},e[12]=f,e[13]=g):g=e[13];let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=I=>c(I.target.value),e[14]=R):R=e[14];let v;e[15]!==n?(v=I=>{I.key==="Escape"&&n()},e[15]=n,e[16]=v):v=e[16];let w;e[17]!==l?(w=l("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=l,e[18]=w):w=e[18];let T;e[19]!==a||e[20]!==v||e[21]!==w?(T=r.jsx("input",{ref:d,autoFocus:!0,type:"text",value:a,onChange:R,onKeyDown:v,placeholder:w,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=a,e[20]=v,e[21]=w,e[22]=T):T=e[22];let k;e[23]!==a?(k=a.trim(),e[23]=a,e[24]=k):k=e[24];const S=!k;let j;e[25]!==l?(j=l("sandbox.visualEditorPrompt.sendButton"),e[25]=l,e[26]=j):j=e[26];let C;e[27]!==l?(C=l("sandbox.visualEditorPrompt.sendButton"),e[27]=l,e[28]=C):C=e[28];let B;e[29]!==C?(B=r.jsx("title",{children:C}),e[29]=C,e[30]=B):B=e[30];let A;e[31]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=A):A=e[31];let L;e[32]!==B?(L=r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[B,A]}),e[32]=B,e[33]=L):L=e[33];let F;e[34]!==S||e[35]!==j||e[36]!==L?(F=r.jsx("button",{type:"submit",disabled:S,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:j,children:L}),e[34]=S,e[35]=j,e[36]=L,e[37]=F):F=e[37];let O;e[38]!==T||e[39]!==F||e[40]!==g?(O=r.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:g,children:[T,F]}),e[38]=T,e[39]=F,e[40]=g,e[41]=O):O=e[41];let $;return e[42]!==O||e[43]!==h?($=r.jsx("div",{className:"absolute z-30 pointer-events-none",style:h,children:O}),e[42]=O,e[43]=h,e[44]=$):$=e[44],$}const Pr="site-links",sc=/details?page|\bpdp\b/i,nc=/listingpage|\bplp\b/i;function rc(t,e,s){const n=new Set;for(const o of s)sc.test(o)&&n.add("product"),nc.test(o)&&n.add("category");const a=Ut(en(t)),c=a[a.length-1],d=a[a.length-2];return c?.type==="text"&&c.text==="/p"&&d?.type==="param"&&d.name===e&&n.add("product"),e==="*"&&a.some(o=>o.type==="param"&&o.name==="*")&&n.add("category"),n}const ac=["rosa","preto","pink","black"];function ls(t,e){const s=e.trim();return s?t(s):ac.flatMap(n=>t(n))}function ic(t,e){const s=e.trim(),n=[];/^\d+$/.test(s)&&n.push({resolveType:t,props:{ids:[s]}});const c=s.includes("-")&&!/\s/.test(s)?s.replace(/-+/g," "):s;return n.push({resolveType:t,props:{query:c,count:10}}),n}const wa=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function sn(t){return t.split("/")[0]??""}function oc(t){const e=new Set;for(const s of t){const n=sn(s);wa.has(n)&&e.add(n)}return e}function lc(t,e){const s=sn(t);return!wa.has(s)||e.size===0?!0:e.has(s)}const cc=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>ls(s=>ic(t,s),e),optionsFromPayload:cs},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>ls(s=>[{resolveType:t,props:{props:{search:s,pageSize:10,currentPage:1}}}],e),optionsFromPayload:cs},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>ls(s=>[{resolveType:t,props:{term:s,hitsPerPage:10}}],e),optionsFromPayload:cs},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>ls(s=>[{resolveType:t,props:{query:s,term:s,count:10,hitsPerPage:10}}],e),optionsFromPayload:cs},{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:gc}];function dc(t,e,s=new Set){const n=[...e],a=o=>{const i=[];for(const l of cc){if(l.kind!==o)continue;const m=n.find(f=>l.test(f)&&lc(f,s));m&&i.push({cand:l,resolveType:m})}return i.find(l=>s.has(sn(l.resolveType)))??i[0]},c=(o,i,l)=>({kind:o.kind,id:`${o.kind}:${i}`,resolveType:i,clientFilter:o.clientFilter,isFallback:l,buildRequests:m=>o.buildRequests(i,m),optionsFromPayload:o.optionsFromPayload}),d=[];for(const o of["product","category"]){if(!t.has(o))continue;const i=a(o);i&&d.push(c(i.cand,i.resolveType,!1))}return t.size>0&&d.push(uc(t.has("category")?"category":"product")),d}function uc(t){return{kind:t,id:Pr,resolveType:Pr,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,s)=>wc(e,s)}}function nt(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function fc(t,e,s){const n=new Set,a=new Set,c=d=>{if(Array.isArray(d)){for(const l of d)c(l);return}const o=nt(d);if(!o)return;const i=o.__resolveType;if(typeof i=="string"){if(s(i))n.add(i);else if(i in e&&!a.has(i)){a.add(i);const l=nt(e[i])?.__resolveType;typeof l=="string"&&s(l)&&n.add(i),c(e[i])}}for(const l of Object.values(o))c(l)};return c(t),n}function ka(t){const e=new Set,s=[];for(const n of t)for(const a of n)e.has(a.value)||(e.add(a.value),s.push(a));return s}function Sa(t){try{return decodeURIComponent(t)}catch{return t}}function pc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function mc(t){const e=[];let s="^";for(const n of t)n.type==="text"?s+=pc(n.text):(e.push(n.name),s+=n.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${s}$`),order:e}}function Pa(t,e,s){if(typeof t!="string"||!t)return null;let n;try{n=new URL(t,"https://placeholder.invalid").pathname}catch{return null}n=n.replace(/\/+$/,"");const a=Ut(en(e)),{pattern:c,order:d}=mc(a),o=d.indexOf(s);if(o===-1)return null;const i=n.match(c);if(!i)return null;const l=i[o+1]?.replace(/^\/+|\/+$/g,"");return l?Sa(l):null}function cs(t,e){const s=nt(t),n=Array.isArray(t)?t:Array.isArray(s?.products)?s.products:Array.isArray(s?.list)?s.list:[],a=[],c=new Set;for(const d of n){const o=nt(d);if(!o)continue;const i=Pa(o.url,e.template,e.paramName);if(!i||c.has(i))continue;c.add(i);const l=nt(o.isVariantOf),m=typeof l?.name=="string"&&l.name||typeof o.name=="string"&&o.name||i,f=Array.isArray(o.image)?nt(o.image[0]):null,p=typeof f?.url=="string"?f.url:void 0;a.push({value:i,label:m,image:p})}return a}function hc(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?Sa(s):null}function gc(t){const e=[],s=new Set,n=(a,c)=>{const d=nt(a);if(!d)return;const o=typeof d.name=="string"&&d.name?d.name:"",i=o?[...c,o]:c,l=hc(d.url);if(l&&!s.has(l)&&(s.add(l),e.push({value:l,label:i.join(" › ")||l})),Array.isArray(d.children))for(const m of d.children)n(m,i)};if(Array.isArray(t))for(const a of t)n(a,[]);return e}const vc=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 xc(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,s=>s.toUpperCase())}function bc(t){if(typeof t!="string"||!t)return[];const e=[],s=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let n,a=0;for(;(n=s.exec(t))!==null&&a++<5e3;){const c=n[1]??"",d=(n[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:c,text:d})}return e}function yc(t){if(typeof t!="string"||!t)return[];const e=[],s=new Set,n=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,a=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let c,d=0;for(;(c=n.exec(t))!==null&&d++<3e3;){const o=(c[1]??"").replace(/\\\//g,"/");if(!o||s.has(o))continue;s.add(o);const i=t.slice(c.index,c.index+900).match(a)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:c[2]??"",image:i||void 0})}return e}function wc(t,e){const s=[],n=new Set,a=(c,d,o,i)=>{if(s.length>=200)return;const l=Pa(c,e.template,e.paramName);!l||n.has(l)||e.paramName==="*"&&/(^|\/)p$/.test(l)||o==="category"&&vc.has(l.split("/")[0]??"")||(n.add(l),s.push({value:l,label:d&&d.length<=80?d:xc(l),kind:o,image:i}))};for(const{url:c,name:d,image:o}of yc(t))a(c,d,"product",o);for(const{href:c,text:d}of bc(t))c.startsWith("/")&&!c.startsWith("//")&&a(c,d,"category");return s}function Mt(t,e,s=50){const n=e.trim().toLowerCase();return(n?t.filter(c=>c.label.toLowerCase().includes(n)||c.value.toLowerCase().includes(n)):t).slice(0,s)}const ja=1e4;function kc(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 Sc(t,{resolveType:e,props:s}){const n=await fetch(to(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...s}),signal:AbortSignal.timeout(ja)});if(!n.ok)throw new Error(`Failed to fetch options: ${n.status}`);return n.json()}async function jr(t,e){const s=await fetch(so(t,e),{signal:AbortSignal.timeout(ja)});if(!s.ok)throw new Error(`Failed to fetch page: ${s.status}`);return s.text()}async function Pc(t,e,s){const n=e.optionsFromPayload(await jr(t,"/"),s),a=n.find(d=>d.kind==="category");if(!a)return n;const c=Ve(s.template,{[s.paramName]:a.value});if(c==="/")return n;try{const d=e.optionsFromPayload(await jr(t,c),s).filter(o=>o.kind==="product");return ka([n,d])}catch{return n}}function jc(t,e,s){return Qs.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":s}`)}async function Ec(t,e,s,n){if(e.homepageLinks)return Pc(t,e,n);const a=e.buildRequests?.(s)??[];if(a.length===0)return[];const c=await Promise.allSettled(a.map(o=>Sc(t,o))),d=c.filter(o=>o.status==="fulfilled").map(o=>o.value);if(d.length===0){const o=c.find(i=>i.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return ka(d.map(o=>e.optionsFromPayload(o,n)))}function Js(t,e,s,n,a){return{queryKey:jc(t,e,s),queryFn:()=>Ec(t,e,s,n),enabled:a,staleTime:6e4,retry:1}}function zt(t){const e=le.c(16),{heading:s,iconKind:n,options:a,template:c,paramName:d,keyPrefix:o,onSelect:i}=t;if(a.length===0)return null;let l;if(e[0]!==n||e[1]!==o||e[2]!==i||e[3]!==a||e[4]!==d||e[5]!==c){let f;e[7]!==n||e[8]!==o||e[9]!==i||e[10]!==d||e[11]!==c?(f=p=>r.jsxs(gt,{value:`${o}:${p.value}`,className:"gap-3 py-2",onSelect:()=>i(p.value),children:[n==="product"&&r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:p.image?r.jsx("img",{src:p.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):r.jsx(Ir,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:p.label}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ve(c,{[d]:p.value})})]})]},`${o}:${p.value}`),e[7]=n,e[8]=o,e[9]=i,e[10]=d,e[11]=c,e[12]=f):f=e[12],l=a.map(f),e[0]=n,e[1]=o,e[2]=i,e[3]=a,e[4]=d,e[5]=c,e[6]=l}else l=e[6];let m;return e[13]!==s||e[14]!==l?(m=r.jsx(ht,{heading:s,children:l}),e[13]=s,e[14]=l,e[15]=m):m=e[15],m}function Er(t){const e=le.c(2),{text:s}=t;let n;return e[0]!==s?(n=r.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1],n}function Nc(t){const e=le.c(52),{sources:s,template:n,paramName:a,value:c,sandboxRef:d,onCommit:o}=t,i=Ee(),[l,m]=N.useState(!1),[f,p]=N.useState(""),[y,x]=N.useState(""),b=N.useRef(null),h=a==="*"?i("sandbox.preview.catchAllParamLabel"):`:${a}`,g=kc(i),v=[...new Set(s.map(ne=>g[ne.kind].noun))].join(" or ");let w;e[0]!==i||e[1]!==v?(w=i("sandbox.pathParamPickerChip.searchPlaceholder",{options:v}),e[0]=i,e[1]=v,e[2]=w):w=e[2];const T=w,k={template:n,paramName:a};let S;e[3]!==f?(S=(ne,de)=>({source:ne,query:de,options:ne.clientFilter?Mt(de.data??[],f):de.data??[]}),e[3]=f,e[4]=S):S=e[4];const j=S,C=s.filter(Fc),B=s.filter(Oc),A=Ws({queries:C.map(ne=>Js(d,ne,y,k,l))});let L;e[5]!==A||e[6]!==j?(L=(ne,de)=>j(ne,A[de]),e[5]=A,e[6]=j,e[7]=L):L=e[7];const F=C.map(L),O=F.length===0||F.every(_c),$=Ws({queries:B.map(ne=>Js(d,ne,y,k,l&&O))});let I;e[8]!==$||e[9]!==j?(I=(ne,de)=>j(ne,$[de]),e[8]=$,e[9]=j,e[10]=I):I=e[10];const G=B.map(I),W=O?G:F,Y=W.length===1&&W[0]?.source.homepageLinks?W[0]:null,Q=Y&&!Y.query.isLoading&&!Y.query.isError?Y?.query.data??[]:[],K=Mt(Q.filter(Ac),f),ee=Mt(Q.filter(Lc),f),H=K.length>0&&ee.length>0,J=ne=>{m(ne),b.current&&clearTimeout(b.current),p(ne?c:""),x(ne?c:"")};let V;e[11]===Symbol.for("react.memo_cache_sentinel")?(V=ne=>{p(ne),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{x(ne)},300)},e[11]=V):V=e[11];const E=V,_=ne=>{o(ne),J(!1)},D=ia(f),U=Ve(n,{[a]:D}),X=_r,se=Ar,z="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",Z=Rc;let re;e[12]!==h||e[13]!==i?(re=i("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:h}),e[12]=h,e[13]=i,e[14]=re):re=e[14];let ie;e[15]!==re?(ie=r.jsx(Or,{className:"sr-only",children:r.jsx(Fr,{children:re})}),e[15]=re,e[16]=ie):ie=e[16];let he;e[17]===Symbol.for("react.memo_cache_sentinel")?(he=r.jsx(Ir,{size:16,className:"shrink-0 text-foreground"}),e[17]=he):he=e[17];let pe;e[18]!==i?(pe=i("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=i,e[19]=pe):pe=e[19];let be;e[20]!==h?(be=r.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:h}),e[20]=h,e[21]=be):be=e[21];let ge;e[22]!==pe||e[23]!==be?(ge=r.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[he,r.jsxs("span",{className:"text-sm font-medium text-foreground",children:[pe," ",be]})]}),e[22]=pe,e[23]=be,e[24]=ge):ge=e[24];const ve=Jr,Se=!1,fe="min-h-0 flex-1";let ce;e[25]!==T||e[26]!==f?(ce=r.jsx(Yr,{autoFocus:!0,placeholder:T,value:f,onValueChange:E}),e[25]=T,e[26]=f,e[27]=ce):ce=e[27];const Le=Gr,ze="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Ie;e[28]!==i?(Ie=i("sandbox.pathParamPickerChip.noResults"),e[28]=i,e[29]=Ie):Ie=e[29];let Be;e[30]!==Ie?(Be=r.jsx(Qr,{children:Ie}),e[30]=Ie,e[31]=Be):Be=e[31];const bt=D&&r.jsx(ht,{className:"shrink-0",children:r.jsxs(gt,{value:`__raw__:${D}`,className:"gap-3 py-2",onSelect:()=>_(D),children:[r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:r.jsx(Yo,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:i("sandbox.pathParamPickerChip.useRawValue",{rawTerm:D,paramLabel:h})}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:U})]})]})}),me=H?r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:r.jsx(zt,{heading:g.category.heading,iconKind:"category",options:K,template:n,paramName:a,keyPrefix:`${Y?.source.id}:cat`,onSelect:_})}),r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r.jsx(zt,{heading:g.product.heading,iconKind:"product",options:ee,template:n,paramName:a,keyPrefix:`${Y?.source.id}:prod`,onSelect:_})})]}):r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:W.map(ne=>{const{source:de,query:We,options:yt}=ne,{noun:qe}=g[de.kind];if(We.isLoading)return r.jsx(Er,{text:i("sandbox.pathParamPickerChip.loading",{noun:qe})},de.id);if(We.isError)return r.jsx(Er,{text:i("sandbox.pathParamPickerChip.couldNotLoad")},de.id);if(de.homepageLinks){const Ht=We.data??[];return r.jsxs(N.Fragment,{children:[r.jsx(zt,{heading:g.category.heading,iconKind:"category",options:Mt(Ht.filter(Tc),f),template:n,paramName:a,keyPrefix:`${de.id}:cat`,onSelect:_}),r.jsx(zt,{heading:g.product.heading,iconKind:"product",options:Mt(Ht.filter(Cc),f),template:n,paramName:a,keyPrefix:`${de.id}:prod`,onSelect:_})]},de.id)}return r.jsx(zt,{heading:W.length>1?g[de.kind].heading:void 0,iconKind:de.kind,options:yt,template:n,paramName:a,keyPrefix:de.id,onSelect:_},de.id)})});let Fe;e[32]!==Le||e[33]!==Be||e[34]!==bt||e[35]!==me?(Fe=r.jsxs(Le,{className:ze,children:[Be,bt,me]}),e[32]=Le,e[33]=Be,e[34]=bt,e[35]=me,e[36]=Fe):Fe=e[36];let xe;e[37]!==ve||e[38]!==ce||e[39]!==Fe?(xe=r.jsxs(ve,{shouldFilter:Se,className:fe,children:[ce,Fe]}),e[37]=ve,e[38]=ce,e[39]=Fe,e[40]=xe):xe=e[40];let Ue;e[41]!==se||e[42]!==ie||e[43]!==ge||e[44]!==xe||e[45]!==Z?(Ue=r.jsxs(se,{className:z,onClick:Z,children:[ie,ge,xe]}),e[41]=se,e[42]=ie,e[43]=ge,e[44]=xe,e[45]=Z,e[46]=Ue):Ue=e[46];let Ae;return e[47]!==X||e[48]!==J||e[49]!==l||e[50]!==Ue?(Ae=r.jsx(X,{open:l,onOpenChange:J,children:Ue}),e[47]=X,e[48]=J,e[49]=l,e[50]=Ue,e[51]=Ae):Ae=e[51],r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",title:i("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:h}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-xs text-special hover:bg-special/25",onClick:ne=>{ne.stopPropagation(),J(!0)},children:c||h}),Ae]})}function Cc(t){return t.kind==="product"}function Tc(t){return t.kind!=="product"}function Rc(t){return t.stopPropagation()}function Lc(t){return t.kind==="product"}function Ac(t){return t.kind!=="product"}function _c(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Oc(t){return t.isFallback}function Fc(t){return!t.isFallback}function Dc(t){const e=le.c(8),{sources:s,template:n,paramName:a,sandboxRef:c,onFill:d}=t;let o,i;if(e[0]!==a||e[1]!==c||e[2]!==s||e[3]!==n){const y={template:n,paramName:a},x=s.filter($c);i=Ws,o=x.map(b=>Js(c,b,"",y,!0)),e[0]=a,e[1]=c,e[2]=s,e[3]=n,e[4]=o,e[5]=i}else o=e[4],i=e[5];let l;e[6]!==o?(l={queries:o},e[6]=o,e[7]=l):l=e[7];const m=i(l),[f,p]=N.useState(!1);if(!f)for(const y of m){if(y.isLoading)break;const x=y.data?.[0];if(x){p(!0),queueMicrotask(()=>d(x.value));break}}return null}function $c(t){return!t.isFallback}function Bc(t){const e=le.c(31),{name:s,value:n,onCommit:a}=t,c=Ee(),[d,o]=N.useState(n),[i,l]=N.useState(!1),m=N.useRef(!1);let f;e[0]!==s||e[1]!==c?(f=s==="*"?c("sandbox.preview.catchAllParamLabel"):`:${s}`,e[0]=s,e[1]=c,e[2]=f):f=e[2];const p=f,y=d||p;let x;e[3]!==y?(x=r.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:y}),e[3]=y,e[4]=x):x=e[4];let b;e[5]!==p||e[6]!==c?(b=c("sandbox.preview.valueForParam",{label:p}),e[5]=p,e[6]=c,e[7]=b):b=e[7];let h,g;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=j=>o(j.target.value),g=()=>l(!0),e[8]=h,e[9]=g):(h=e[8],g=e[9]);let R;e[10]!==n?(R=j=>{j.key==="Enter"&&j.currentTarget.blur(),j.key==="Escape"&&(m.current=!0,o(n),j.currentTarget.blur())},e[10]=n,e[11]=R):R=e[11];let v;e[12]!==d||e[13]!==a||e[14]!==n?(v=()=>{if(l(!1),m.current){m.current=!1;return}const j=ia(d);o(j),j!==n&&a(j)},e[12]=d,e[13]=a,e[14]=n,e[15]=v):v=e[15];let w;e[16]!==d||e[17]!==p||e[18]!==b||e[19]!==R||e[20]!==v?(w=r.jsx("input",{type:"text",value:d,placeholder:p,title:b,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-xs text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:Mc,onChange:h,onFocus:g,onKeyDown:R,onBlur:v}),e[16]=d,e[17]=p,e[18]=b,e[19]=R,e[20]=v,e[21]=w):w=e[21];let T;e[22]!==x||e[23]!==w?(T=r.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[x,w]}),e[22]=x,e[23]=w,e[24]=T):T=e[24];let k;e[25]!==i||e[26]!==c?(k=i&&r.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-2xs text-muted-foreground",children:[r.jsx(Fi,{size:10}),c("sandbox.preview.enterToGo")]}),e[25]=i,e[26]=c,e[27]=k):k=e[27];let S;return e[28]!==k||e[29]!==T?(S=r.jsxs(r.Fragment,{children:[T,k]}),e[28]=k,e[29]=T,e[30]=S):S=e[30],S}function Mc(t){return t.stopPropagation()}function zc(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const s=new URL(e),n=t.resolvedPath==="/"?"":t.resolvedPath;return`${s.host}${n}`}catch{return e}}function Ic(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Uc(t){return t.showPreviewToolbar&&(t.contentEditingEnabled||t.hasFrameworkRoutes)}function Kc(t){return t.v8?null:t.production||t.localPreview?{type:"editor::inject",args:{script:t.script}}:{type:"visual-editor::activate",script:t.script}}function Hc(t){return t.v8?null:{type:"visual-editor::activate",script:t.script}}class Ea extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function Vc(t,e){if(t)return t;const s=await e?.().catch(()=>null);if(!s)throw new Ea;return s}async function Wc(t,e,s){return s?pr(t,e,await Vc(s.meta,s.loadMeta)):pr(t,e)}function qc(t){const e=le.c(5);let s;e[0]!==t?(s=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=s):s=e[1];const n=ca(s);let a;return e[2]!==t||e[3]!==n?(a={mutationFn:async c=>{const{name:d,path:o,template:i,schema:l}=c;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const m=Bo(d),f=i?{...i,name:d,path:o}:await Wc(d,o,l);return await n.mutateAsync({blockKey:m,data:f}),{key:m,name:d,path:o}}},e[2]=t,e[3]=n,e[4]=a):a=e[4],yi(a)}function Gc(t){const e=le.c(89),{open:s,onOpenChange:n,isPending:a,error:c,templates:d,onSubmit:o}=t,i=a===void 0?!1:a,l=Ee();let m;e[0]!==l?(m=l("sectionsEditor.createPageModal.defaultPageName"),e[0]=l,e[1]=m):m=e[1];const[f,p]=N.useState(m);let y;e[2]!==l?(y=l("sectionsEditor.createPageModal.defaultPagePath"),e[2]=l,e[3]=y):y=e[3];const[x,b]=N.useState(y),[h,g]=N.useState(Os),[R,v]=N.useState(null),[w,T]=N.useState(s);s!==w&&(T(s),s&&(p(l("sectionsEditor.createPageModal.defaultPageName")),b(l("sectionsEditor.createPageModal.defaultPagePath")),g(Os),v(null)));const k=!!d?.length;let S;e[4]!==i||e[5]!==n?(S=pe=>{!pe&&!i&&(v(null),n(!1))},e[4]=i,e[5]=n,e[6]=S):S=e[6];const j=S;let C;e[7]!==i||e[8]!==f||e[9]!==o||e[10]!==x||e[11]!==k||e[12]!==h?(C=async pe=>{pe.preventDefault();const be=f.trim(),ge=x.trim();if(!be||!ge||i)return;const ve=oa(ge);if(ve){v(ve);return}v(null),await o({name:be,path:ge,templateKey:k&&h!==Os?h:null})},e[7]=i,e[8]=f,e[9]=o,e[10]=x,e[11]=k,e[12]=h,e[13]=C):C=e[13];const B=C,A=R??c;let L;e[14]!==l?(L=l("sectionsEditor.createPageModal.title"),e[14]=l,e[15]=L):L=e[15];let F;e[16]!==L?(F=r.jsx(Or,{children:r.jsx(Fr,{children:L})}),e[16]=L,e[17]=F):F=e[17];let O;e[18]!==l?(O=l("sectionsEditor.createPageModal.nameLabel"),e[18]=l,e[19]=O):O=e[19];let $;e[20]!==O?($=r.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:O}),e[20]=O,e[21]=$):$=e[21];let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I=pe=>p(pe.target.value),e[22]=I):I=e[22];let G;e[23]!==l?(G=l("sectionsEditor.createPageModal.namePlaceholder"),e[23]=l,e[24]=G):G=e[24];let W;e[25]!==i||e[26]!==f||e[27]!==G?(W=r.jsx(Us,{id:"new-page-name",value:f,onChange:I,placeholder:G,autoFocus:!0,disabled:i}),e[25]=i,e[26]=f,e[27]=G,e[28]=W):W=e[28];let Y;e[29]!==W||e[30]!==$?(Y=r.jsxs("div",{className:"space-y-1.5",children:[$,W]}),e[29]=W,e[30]=$,e[31]=Y):Y=e[31];let q;e[32]!==l?(q=l("sectionsEditor.createPageModal.pathLabel"),e[32]=l,e[33]=q):q=e[33];let Q;e[34]!==q?(Q=r.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:q}),e[34]=q,e[35]=Q):Q=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=pe=>b(pe.target.value),e[36]=K):K=e[36];let ee;e[37]!==l?(ee=l("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=l,e[38]=ee):ee=e[38];let H;e[39]!==i||e[40]!==x||e[41]!==ee?(H=r.jsx(Us,{id:"new-page-path",value:x,onChange:K,placeholder:ee,disabled:i}),e[39]=i,e[40]=x,e[41]=ee,e[42]=H):H=e[42];let J;e[43]!==Q||e[44]!==H?(J=r.jsxs("div",{className:"space-y-1.5",children:[Q,H]}),e[43]=Q,e[44]=H,e[45]=J):J=e[45];let V;e[46]!==i||e[47]!==k||e[48]!==l||e[49]!==h||e[50]!==d?(V=k&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.createPageModal.templateLabel")}),r.jsx(Mo,{id:"new-page-template",value:h,onChange:g,templates:d??[],disabled:i})]}),e[46]=i,e[47]=k,e[48]=l,e[49]=h,e[50]=d,e[51]=V):V=e[51];let E;e[52]!==A?(E=A&&r.jsx("p",{className:"text-xs text-destructive",children:A}),e[52]=A,e[53]=E):E=e[53];let _;e[54]!==Y||e[55]!==J||e[56]!==V||e[57]!==E?(_=r.jsxs("div",{className:"space-y-4 py-4",children:[Y,J,V,E]}),e[54]=Y,e[55]=J,e[56]=V,e[57]=E,e[58]=_):_=e[58];let D;e[59]!==n?(D=()=>n(!1),e[59]=n,e[60]=D):D=e[60];let U;e[61]!==l?(U=l("sectionsEditor.createPageModal.cancelButton"),e[61]=l,e[62]=U):U=e[62];let X;e[63]!==i||e[64]!==D||e[65]!==U?(X=r.jsx(Oe,{type:"button",variant:"outline",onClick:D,disabled:i,children:U}),e[63]=i,e[64]=D,e[65]=U,e[66]=X):X=e[66];let se;e[67]!==i||e[68]!==f||e[69]!==x?(se=!f.trim()||!x.trim()||i,e[67]=i,e[68]=f,e[69]=x,e[70]=se):se=e[70];let z;e[71]!==i||e[72]!==l?(z=i?r.jsxs(r.Fragment,{children:[r.jsx(rt,{className:"size-3.5"}),l("sectionsEditor.createPageModal.creatingButton")]}):l("sectionsEditor.createPageModal.createButton"),e[71]=i,e[72]=l,e[73]=z):z=e[73];let Z;e[74]!==se||e[75]!==z?(Z=r.jsx(Oe,{type:"submit",disabled:se,children:z}),e[74]=se,e[75]=z,e[76]=Z):Z=e[76];let re;e[77]!==X||e[78]!==Z?(re=r.jsxs(wi,{children:[X,Z]}),e[77]=X,e[78]=Z,e[79]=re):re=e[79];let ie;e[80]!==B||e[81]!==_||e[82]!==re||e[83]!==F?(ie=r.jsx(Ar,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:B,children:[F,_,re]})}),e[80]=B,e[81]=_,e[82]=re,e[83]=F,e[84]=ie):ie=e[84];let he;return e[85]!==j||e[86]!==s||e[87]!==ie?(he=r.jsx(_r,{open:s,onOpenChange:j,children:ie}),e[85]=j,e[86]=s,e[87]=ie,e[88]=he):he=e[88],he}function Jc(t){const e=le.c(41),{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:c,meta:d,decofile:o,blockKey:i}=t,l=Ee();let m;e[0]!==a||e[1]!==s||e[2]!==n?(m={orgSlug:s,virtualMcpId:n,branch:a},e[0]=a,e[1]=s,e[2]=n,e[3]=m):m=e[3];const f=ca(m);let p;e[4]!==f?(p=j=>f.mutate(j),e[4]=f,e[5]=p):p=e[5];let y;e[6]!==o||e[7]!==f.v8||e[8]!==p?(y=Qo(p,o,f.v8),e[6]=o,e[7]=f.v8,e[8]=p,e[9]=y):y=e[9];const x=y;let b;e[10]!==i||e[11]!==o?(b=zo(o,i),e[10]=i,e[11]=o,e[12]=b):b=e[12];const{resolveType:h,props:g,title:R}=b;if(!h){let j;e[13]!==l?(j=l("sandbox.preview.loaderNoLongerExists"),e[13]=l,e[14]=j):j=e[14];let C;return e[15]!==j?(C=r.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:j}),e[15]=j,e[16]=C):C=e[16],C}const v=`loader:${i}`,w=`loader:${i}`;let T;e[17]!==i||e[18]!==h||e[19]!==R?(T={mode:"saved",blockKey:i,resolveType:h,title:R},e[17]=i,e[18]=h,e[19]=R,e[20]=T):T=e[20];let k;e[21]!==a||e[22]!==o||e[23]!==d||e[24]!==s||e[25]!==c||e[26]!==g||e[27]!==f.isPending||e[28]!==x||e[29]!==w||e[30]!==T||e[31]!==n?(k=r.jsx(Io,{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:c,meta:d,decofile:o,kind:"loaders",target:T,initialValue:g,isCreating:f.isPending,onCreate:Yc,onSaveReferencedBlock:x,showRun:!1},w),e[21]=a,e[22]=o,e[23]=d,e[24]=s,e[25]=c,e[26]=g,e[27]=f.isPending,e[28]=x,e[29]=w,e[30]=T,e[31]=n,e[32]=k):k=e[32];let S;return e[33]!==i||e[34]!==a||e[35]!==o||e[36]!==s||e[37]!==v||e[38]!==k||e[39]!==n?(S=r.jsx(Xo,{listing:o,orgSlug:s,virtualMcpId:n,branch:a,blockKey:i,present:void 0,children:k},v),e[33]=i,e[34]=a,e[35]=o,e[36]=s,e[37]=v,e[38]=k,e[39]=n,e[40]=S):S=e[40],S}async function Yc(){}function Qc(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Nr(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:Qc(t.error)}}function Xc(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 Zc(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=Xc(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 ed=N.lazy(()=>ki(()=>import("./sections-editor--Z8msN1o.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161])).then(t=>({default:t.SectionsEditor})));function Cr(t){const e=le.c(62),{virtualMcpId:s,externalSelection:n,onSectionPicked:a,onViewJsonFile:c}=t,d=n===void 0?null:n,{org:o}=ms(),{currentBranch:i,taskId:l}=at(),m=tn(),f=xt(),p=ua(),y=m.lifecycle.phase==="running",x=f.previewUrl;let b;e[0]!==i||e[1]!==o||e[2]!==x||e[3]!==l||e[4]!==s?(b=i?{orgSlug:o.slug,virtualMcpId:s,branch:i,threadId:l??null,previewUrl:x}:null,e[0]=i,e[1]=o,e[2]=x,e[3]=l,e[4]=s,e[5]=b):b=e[5];const h=b,g=Kt(s,i);let R;e[6]!==y?(R={fetchEnabled:y},e[6]=y,e[7]=R):R=e[7];const v=hs(h,R),w=Zr(h);let T;e[8]!==y?(T={fetchEnabled:y},e[8]=y,e[9]=T):T=e[9];const k=la(h,T),S=Zc({lifecyclePhase:m.lifecycle.phase,decofile:Nr(v),meta:Nr(k),hasEditableContent:So(v.data,k.data),fastPreviewActive:Xr(s).runtime==="cms"||Xe(g)}),j=Xs()===void 0,C=td;if(Po(g)){let E;return e[10]===Symbol.for("react.memo_cache_sentinel")?(E=C(r.jsx(Eo,{})),e[10]=E):E=e[10],E}if(g.kind==="pending"&&g.retrying){let E;return e[11]!==g?(E=C(r.jsx(No,{backend:g})),e[11]=g,e[12]=E):E=e[12],E}if(S.kind==="loading"||j){let E;return e[13]===Symbol.for("react.memo_cache_sentinel")?(E=C(r.jsx(Si,{})),e[13]=E):E=e[13],E}if(v.data&&no(k.data)){const E=p.state.target,_=E?.kind==="page"||E?.kind==="section"?E.key:null,D=g.kind==="legacy"?_??"":`${w}:${_??""}`,U=i??"";let X;return e[14]!==v.data||e[15]!==_||e[16]!==o.slug||e[17]!==D||e[18]!==U||e[19]!==s?(X=C(r.jsx(Uo,{orgSlug:o.slug,virtualMcpId:s,branch:U,decofile:v.data,initialKey:_,compact:!0},D)),e[14]=v.data,e[15]=_,e[16]=o.slug,e[17]=D,e[18]=U,e[19]=s,e[20]=X):X=e[20],X}if(S.kind==="empty"){let E;return e[21]===Symbol.for("react.memo_cache_sentinel")?(E=C(r.jsx(Co,{})),e[21]=E):E=e[21],E}if(S.kind==="error"){let E;e[22]!==v||e[23]!==f||e[24]!==k||e[25]!==S.source?(E=()=>{if(S.source==="sandbox"){f.retry();return}Promise.all([v.refetch(),k.refetch()])},e[22]=v,e[23]=f,e[24]=k,e[25]=S.source,e[26]=E):E=e[26];const _=E;let D;return e[27]!==_||e[28]!==S.source?(D=C(r.jsx(jo,{source:S.source,onRetry:_})),e[27]=_,e[28]=S.source,e[29]=D):D=e[29],D}let B;e[30]===Symbol.for("react.memo_cache_sentinel")?(B=E=>C(r.jsx("div",{className:"h-full min-h-0",children:E})),e[30]=B):B=e[30];const A=B,L=p.state.target;if(L?.kind==="loader"&&v.data&&k.data){const E=g.kind==="legacy"?void 0:w,_=i??"",D=x??null;let U;return e[31]!==v.data||e[32]!==k.data||e[33]!==o.slug||e[34]!==E||e[35]!==_||e[36]!==D||e[37]!==L.key||e[38]!==s?(U=A(r.jsx(Jc,{orgSlug:o.slug,virtualMcpId:s,branch:_,previewUrl:D,meta:k.data,decofile:v.data,blockKey:L.key},E)),e[31]=v.data,e[32]=k.data,e[33]=o.slug,e[34]=E,e[35]=_,e[36]=D,e[37]=L.key,e[38]=s,e[39]=U):U=e[39],U}let F;e[40]!==i||e[41]!==o.slug||e[42]!==L||e[43]!==s?(F=L||!i?null:Mr(zr(o.slug,s,i)),e[40]=i,e[41]=o.slug,e[42]=L,e[43]=s,e[44]=F):F=e[44];const O=F;let $="/",I=null,G=null;L?.kind==="page"?($=L.path,I=L.key):L?.kind==="section"?G=L.key:O&&($=O.path,I=O.pageKey);const W=I?`page:${I}`:G?`section:${G}`:`path:${$}`;let Y;e[45]===Symbol.for("react.memo_cache_sentinel")?(Y=r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(rt,{className:"size-5 text-muted-foreground"})}),e[45]=Y):Y=e[45];const q=g.kind==="legacy"?W:`${w}:${W}`,Q=i??"",K=x??void 0,ee=G?null:d,H=G?void 0:a,J=!!I&&p.state.editSeoPageKey===I;let V;return e[46]!==G||e[47]!==I||e[48]!==$||e[49]!==c||e[50]!==o.slug||e[51]!==K||e[52]!==ee||e[53]!==H||e[54]!==J||e[55]!==q||e[56]!==Q||e[57]!==s||e[58]!==p.consumeEditSeo||e[59]!==p.setFocusedBlock||e[60]!==p.setVariantOverride?(V=A(r.jsx(N.Suspense,{fallback:Y,children:r.jsx(ed,{orgSlug:o.slug,virtualMcpId:s,branch:Q,previewReady:!0,previewUrl:K,currentPath:$,activePageBlockKey:I,activeGlobalBlockKey:G,externalSelection:ee,onSectionPicked:H,initialEditSeo:J,onExitSeo:p.consumeEditSeo,onVariantPreviewOverride:p.setVariantOverride,onFocusedBlockChange:p.setFocusedBlock,onViewJsonFile:c},q)})),e[46]=G,e[47]=I,e[48]=$,e[49]=c,e[50]=o.slug,e[51]=K,e[52]=ee,e[53]=H,e[54]=J,e[55]=q,e[56]=Q,e[57]=s,e[58]=p.consumeEditSeo,e[59]=p.setFocusedBlock,e[60]=p.setVariantOverride,e[61]=V):V=e[61],V}function td(t){return r.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function sd(t){const e=le.c(51),{virtualMcpId:s,pageKey:n,onClose:a,ref:c}=t,d=Ee(),o=Xs(),i=o===!0,l=Zs(s);let m;e[0]!==l||e[1]!==n?(m=ea(l,ha(n)),e[0]=l,e[1]=n,e[2]=m):m=e[2];const f=m,{org:p}=ms(),{currentBranch:y,taskId:x}=at(),h=xt().previewUrl;let g;e[3]!==y||e[4]!==p.slug||e[5]!==h||e[6]!==x||e[7]!==s?(g=y?{orgSlug:p.slug,virtualMcpId:s,branch:y,threadId:x??null,previewUrl:h}:null,e[3]=y,e[4]=p.slug,e[5]=h,e[6]=x,e[7]=s,e[8]=g):g=e[8];const v=hs(g),w=y??"";let T;e[9]!==p.slug||e[10]!==w||e[11]!==s?(T={orgSlug:p.slug,virtualMcpId:s,branch:w},e[9]=p.slug,e[10]=w,e[11]=s,e[12]=T):T=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k={holdsCopy:!0},e[13]=k):k=e[13];const{save:S,flush:j,hold:C}=da(T,k),B=y??"";let A;e[14]!==p.slug||e[15]!==B||e[16]!==s?(A=pa({orgSlug:p.slug,virtualMcpId:s,branch:B}),e[14]=p.slug,e[15]=B,e[16]=s,e[17]=A):A=e[17];const L=ma(A);let F;e[18]!==n||e[19]!==L?(F=L(n),e[18]=n,e[19]=L,e[20]=F):F=e[20];const O=F;let $;e[21]!==O||e[22]!==n?($={pageKey:n,copyEpoch:O},e[21]=O,e[22]=n,e[23]=$):$=e[23];const[I,G]=N.useState($);(I.pageKey!==n||I.copyEpoch!==O)&&(G({pageKey:n,copyEpoch:O}),C(n));const W=v.data?.[n],Y=v.data===void 0&&v.isLoading||o===void 0,q=v.data!==void 0&&W===void 0,Q=!y||q||Y;let K;e[24]!==W?(K=W===void 0?"":JSON.stringify(W,null,2),e[24]=W,e[25]=K):K=e[25];const ee=K;let H;e[26]!==n||e[27]!==Q||e[28]!==S?(H=U=>{if(Q)return;let X;try{X=JSON.parse(U)}catch{return}X===null||typeof X!="object"||Array.isArray(X)||S(n,X)},e[26]=n,e[27]=Q,e[28]=S,e[29]=H):H=e[29];const J=H;let V;e[30]!==j?(V=()=>({flush:j}),e[30]=j,e[31]=V):V=e[31],N.useImperativeHandle(c,V);let E;e[32]!==f||e[33]!==i||e[34]!==a||e[35]!==d?(E=i?r.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:r.jsx("span",{title:f,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f})}):r.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:d("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(Oe,{variant:"ghost",size:"icon-sm",onClick:a,"aria-label":d("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Dr,{size:14})})]}),e[32]=f,e[33]=i,e[34]=a,e[35]=d,e[36]=E):E=e[36];let _;e[37]!==O||e[38]!==v.data||e[39]!==j||e[40]!==ee||e[41]!==Y||e[42]!==q||e[43]!==n||e[44]!==Q||e[45]!==J||e[46]!==d?(_=Y?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(rt,{className:"size-5 text-muted-foreground"})}):q?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",d("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(fa,{code:ee,language:"json",readOnly:Q,height:"100%",onChange:U=>J(U??""),onSave:U=>{J(U),j()}},`${n}:${v.data===void 0?"loading":"ready"}:${O}`)}),e[37]=O,e[38]=v.data,e[39]=j,e[40]=ee,e[41]=Y,e[42]=q,e[43]=n,e[44]=Q,e[45]=J,e[46]=d,e[47]=_):_=e[47];let D;return e[48]!==E||e[49]!==_?(D=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[E,_]}),e[48]=E,e[49]=_,e[50]=D):D=e[50],D}function Tr(t){const e=le.c(3),{currentBranch:s}=at(),n=Kt(t.virtualMcpId,s);let a;return e[0]!==n.kind||e[1]!==t?(a=n.kind==="legacy"?r.jsx(sd,{...t}):r.jsx(nd,{...t}),e[0]=n.kind,e[1]=t,e[2]=a):a=e[2],a}function nd(t){const e=le.c(61),{virtualMcpId:s,pageKey:n,onClose:a,ref:c}=t,d=Ee(),o=Xs(),i=o===!0,l=Zs(s);let m;e[0]!==l||e[1]!==n?(m=ea(l,ha(n)),e[0]=l,e[1]=n,e[2]=m):m=e[2];const f=m,{org:p}=ms(),{currentBranch:y,taskId:x}=at(),h=xt().previewUrl;let g;e[3]!==y||e[4]!==p.slug||e[5]!==h||e[6]!==x||e[7]!==s?(g=y?{orgSlug:p.slug,virtualMcpId:s,branch:y,threadId:x??null,previewUrl:h}:null,e[3]=y,e[4]=p.slug,e[5]=h,e[6]=x,e[7]=s,e[8]=g):g=e[8];const R=g,v=hs(R);let w;e[9]!==n?(w=[n],e[9]=n,e[10]=w):w=e[10];let T;e[11]!==v.data?(T={listing:v.data},e[11]=v.data,e[12]=T):T=e[12];const k=ta(R,w,T),S=y??"";let j;e[13]!==p.slug||e[14]!==S||e[15]!==s?(j={orgSlug:p.slug,virtualMcpId:s,branch:S},e[13]=p.slug,e[14]=S,e[15]=s,e[16]=j):j=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C={holdsCopy:!0},e[17]=C):C=e[17];const{save:B,flush:A,hold:L}=da(j,C),F=y??"";let O;e[18]!==p.slug||e[19]!==F||e[20]!==s?(O=pa({orgSlug:p.slug,virtualMcpId:s,branch:F}),e[18]=p.slug,e[19]=F,e[20]=s,e[21]=O):O=e[21];const $=ma(O);let I;e[22]!==n||e[23]!==$?(I=$(n),e[22]=n,e[23]=$,e[24]=I):I=e[24];const G=I,W=v.data?.[n];let Y;e[25]!==k.ready||e[26]!==v.data||e[27]!==W?(Y=k.ready&&v.data!==void 0&&(W===void 0||tr(W)),e[25]=k.ready,e[26]=v.data,e[27]=W,e[28]=Y):Y=e[28];const q=Y;let Q;e[29]!==G||e[30]!==n?(Q={pageKey:n,copyEpoch:G,opened:!1,code:""},e[29]=G,e[30]=n,e[31]=Q):Q=e[31];const[K,ee]=N.useState(Q);if(q&&(K.pageKey!==n||K.copyEpoch!==G||!K.opened)){let Z;e[32]!==W?(Z=W===void 0?"":JSON.stringify(W,null,2),e[32]=W,e[33]=Z):Z=e[33],ee({pageKey:n,copyEpoch:G,opened:!0,code:Z}),tr(W)&&L(n)}const H=K.pageKey===n&&K.opened,J=o===void 0||!H&&!q,V=q&&W===void 0,E=!y||V||J;let _;e[34]!==n||e[35]!==E||e[36]!==B?(_=Z=>{if(E)return;ee(ie=>({...ie,code:Z}));let re;try{re=JSON.parse(Z)}catch{return}re===null||typeof re!="object"||Array.isArray(re)||B(n,re)},e[34]=n,e[35]=E,e[36]=B,e[37]=_):_=e[37];const D=_;let U;e[38]!==A?(U=()=>({flush:A}),e[38]=A,e[39]=U):U=e[39],N.useImperativeHandle(c,U);let X;e[40]!==f||e[41]!==i||e[42]!==a||e[43]!==d?(X=i?r.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:r.jsx("span",{title:f,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f})}):r.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:d("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(Oe,{variant:"ghost",size:"icon-sm",onClick:a,"aria-label":d("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Dr,{size:14})})]}),e[40]=f,e[41]=i,e[42]=a,e[43]=d,e[44]=X):X=e[44];let se;e[45]!==k.failed||e[46]!==k.retry||e[47]!==A||e[48]!==K.code||e[49]!==K.copyEpoch||e[50]!==K.pageKey||e[51]!==J||e[52]!==V||e[53]!==E||e[54]!==D||e[55]!==H||e[56]!==d?(se=!H&&k.failed?r.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-4",children:[r.jsx("p",{className:"text-sm",children:d("sectionsEditor.hosted.blockLoadFailed")}),r.jsx(Oe,{variant:"outline",size:"sm",onClick:k.retry,children:d("sectionsEditor.namedRules.tryAgain")})]}):J?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(rt,{className:"size-5 text-muted-foreground"})}):V?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",d("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(fa,{code:K.code,language:"json",readOnly:E,height:"100%",onChange:Z=>D(Z??""),onSave:Z=>{D(Z),A()}},`${K.pageKey}:${K.copyEpoch}`)}),e[45]=k.failed,e[46]=k.retry,e[47]=A,e[48]=K.code,e[49]=K.copyEpoch,e[50]=K.pageKey,e[51]=J,e[52]=V,e[53]=E,e[54]=D,e[55]=H,e[56]=d,e[57]=se):se=e[57];let z;return e[58]!==X||e[59]!==se?(z=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[X,se]}),e[58]=X,e[59]=se,e[60]=z):z=e[60],z}function Na(t){return t.contentEditingEnabled&&!t.isMobile}function rd(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function ad(t,e){return t==="blocks"?"preview":e?"blocks":t}function id(t){return Na({contentEditingEnabled:ga(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function od(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function ld(t){const e=ro(t),{display:s}=t;let n=null;if(s.mode==="production"&&s.iframeBase)try{n=new URL(t.path,s.iframeBase).href}catch{n=null}const a=ao(n,e);return{value:e,frame:a?qs(a,t.device):null,newTab:a}}function cd(t){const e=le.c(94),{tests:s,load:n,onOpen:a,options:c,onChange:d,available:o}=t,i=Ee();let l;e[0]!==c?(l=sa(c),e[0]=c,e[1]=l):l=e[1];const m=l;let f;e[2]!==c.tests?(f=c.tests??{},e[2]=c.tests,e[3]=f):f=e[3];const p=f;let y;e[4]!==d||e[5]!==c?(y=z=>{const Z=z?il(z):null,{at:re,...ie}=c;d(Z?{...ie,at:Z}:ie)},e[4]=d,e[5]=c,e[6]=y):y=e[6];const x=y;let b;e[7]!==p||e[8]!==d||e[9]!==c?(b=(z,Z)=>{const re={...p};Z==="on"?re[z]=!0:Z==="off"?re[z]=!1:delete re[z];const{tests:ie,...he}=c;d(Object.keys(re).length>0?{...he,tests:re}:he)},e[7]=p,e[8]=d,e[9]=c,e[10]=b):b=e[10];const h=b;let g;e[11]!==a?(g=z=>{z&&a?.()},e[11]=a,e[12]=g):g=e[12];let R;e[13]!==i?(R=i("sandbox.previewAs.label"),e[13]=i,e[14]=R):R=e[14];let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx(sl,{size:16}),e[15]=v):v=e[15];let w;e[16]!==m||e[17]!==R?(w=r.jsx(et,{asChild:!0,children:r.jsx(Vr,{asChild:!0,children:r.jsx(Ze,{"aria-label":R,active:m,"data-testid":"preview-as-trigger",children:v})})}),e[16]=m,e[17]=R,e[18]=w):w=e[18];let T;e[19]!==i?(T=i("sandbox.previewAs.label"),e[19]=i,e[20]=T):T=e[20];let k;e[21]!==T?(k=r.jsx(tt,{children:T}),e[21]=T,e[22]=k):k=e[22];let S;e[23]!==k||e[24]!==w?(S=r.jsxs(st,{children:[w,k]}),e[23]=k,e[24]=w,e[25]=S):S=e[25];let j;e[26]!==i?(j=i("sandbox.previewAs.label"),e[26]=i,e[27]=j):j=e[27];let C;e[28]!==j?(C=r.jsx("h3",{className:"text-sm font-medium",children:j}),e[28]=j,e[29]=C):C=e[29];let B;e[30]!==o||e[31]!==i?(B=i(o?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[30]=o,e[31]=i,e[32]=B):B=e[32];let A;e[33]!==B?(A=r.jsx("p",{className:"text-xs text-muted-foreground",children:B}),e[33]=B,e[34]=A):A=e[34];let L;e[35]!==C||e[36]!==A?(L=r.jsxs("div",{className:"flex flex-col gap-1",children:[C,A]}),e[35]=C,e[36]=A,e[37]=L):L=e[37];let F;e[38]!==i?(F=i("sandbox.previewAs.momentLabel"),e[38]=i,e[39]=F):F=e[39];let O;e[40]!==F?(O=r.jsx(nl,{htmlFor:"preview-as-moment",children:F}),e[40]=F,e[41]=O):O=e[41];let $;e[42]!==c.at?($=al(c.at),e[42]=c.at,e[43]=$):$=e[43];let I;e[44]!==x?(I=z=>x(z.target.value),e[44]=x,e[45]=I):I=e[45];let G;e[46]!==$||e[47]!==I?(G=r.jsx(Us,{id:"preview-as-moment",type:"datetime-local",className:ol,value:$,onChange:I}),e[46]=$,e[47]=I,e[48]=G):G=e[48];const W=c.at===void 0;let Y;e[49]!==x?(Y=()=>x(""),e[49]=x,e[50]=Y):Y=e[50];let q;e[51]!==i?(q=i("sandbox.previewAs.now"),e[51]=i,e[52]=q):q=e[52];let Q;e[53]!==W||e[54]!==Y||e[55]!==q?(Q=r.jsx(Oe,{type:"button",variant:"ghost",size:"sm",disabled:W,onClick:Y,children:q}),e[53]=W,e[54]=Y,e[55]=q,e[56]=Q):Q=e[56];let K;e[57]!==G||e[58]!==Q?(K=r.jsxs("div",{className:"flex items-center gap-2",children:[G,Q]}),e[57]=G,e[58]=Q,e[59]=K):K=e[59];let ee;e[60]!==i?(ee=i("sandbox.previewAs.momentHint"),e[60]=i,e[61]=ee):ee=e[61];let H;e[62]!==ee?(H=r.jsx("p",{className:"text-xs text-muted-foreground",children:ee}),e[62]=ee,e[63]=H):H=e[63];let J;e[64]!==O||e[65]!==K||e[66]!==H?(J=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,K,H]}),e[64]=O,e[65]=K,e[66]=H,e[67]=J):J=e[67];let V;e[68]!==i?(V=i("sandbox.previewAs.testsLabel"),e[68]=i,e[69]=V):V=e[69];let E;e[70]!==V?(E=r.jsx("span",{className:"text-sm font-medium",children:V}),e[70]=V,e[71]=E):E=e[71];let _;e[72]!==p||e[73]!==n||e[74]!==h||e[75]!==i||e[76]!==s?(_=n&&!n.ready?n.failed?r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.testsLoadFailed")}),r.jsx(Oe,{type:"button",variant:"outline",size:"sm",onClick:n.retry,children:i("sandbox.previewAs.tryAgain")})]}):r.jsx("div",{className:"flex justify-center py-2","data-testid":"preview-as-tests-loading",children:r.jsx(rt,{className:"size-4 text-muted-foreground"})}):s.length===0?r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.noTests")}):r.jsxs(r.Fragment,{children:[r.jsx("ul",{className:"flex flex-col gap-1.5",children:s.map(z=>r.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[r.jsx("span",{className:"min-w-0 truncate text-sm",children:z}),r.jsxs(rl,{type:"single",variant:"outline",size:"sm",value:p[z]===void 0?"":p[z]?"on":"off",onValueChange:Z=>h(z,Z),"aria-label":z,children:[r.jsx(vr,{value:"off",children:i("sandbox.previewAs.off")}),r.jsx(vr,{value:"on",children:i("sandbox.previewAs.on")})]})]},z))}),r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.testsHint")})]}),e[72]=p,e[73]=n,e[74]=h,e[75]=i,e[76]=s,e[77]=_):_=e[77];let D;e[78]!==E||e[79]!==_?(D=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[E,_]}),e[78]=E,e[79]=_,e[80]=D):D=e[80];let U;e[81]!==m||e[82]!==d||e[83]!==i?(U=m&&r.jsx(Oe,{type:"button",variant:"outline",size:"sm",onClick:()=>d({}),children:i("sandbox.previewAs.reset")}),e[81]=m,e[82]=d,e[83]=i,e[84]=U):U=e[84];let X;e[85]!==L||e[86]!==J||e[87]!==D||e[88]!==U?(X=r.jsxs(Wr,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[L,J,D,U]}),e[85]=L,e[86]=J,e[87]=D,e[88]=U,e[89]=X):X=e[89];let se;return e[90]!==S||e[91]!==X||e[92]!==g?(se=r.jsxs(qr,{onOpenChange:g,children:[S,X]}),e[90]=S,e[91]=X,e[92]=g,e[93]=se):se=e[93],se}const dd=["next"],ud=["@tanstack/react-router","@tanstack/react-start","@tanstack/solid-router","@tanstack/solid-start"],Ca=new Set(["tsx","ts","jsx","js","mdx"]),fd=new Set(["tsx","jsx"]),pd=new Set(["404","500"]);function md(t){const e=new Set;if(!t||typeof t!="object")return e;const s=t;for(const n of["dependencies","devDependencies"]){const a=s[n];if(a&&typeof a=="object"&&!Array.isArray(a))for(const c of Object.keys(a))e.add(c)}return e}function hd(t){const e=md(t);return dd.some(s=>e.has(s))?"next":ud.some(s=>e.has(s))?"tanstack":null}function Ta(t,e){const s=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return s?`${s}/${e}`:e}function gd(t,e){const s=n=>Ta(e,n);switch(t){case"next":return[{router:"next-pages",dir:s("pages"),pattern:"**/*"},{router:"next-pages",dir:s("src/pages"),pattern:"**/*"},{router:"next-app",dir:s("app"),pattern:"**/page.*"},{router:"next-app",dir:s("src/app"),pattern:"**/page.*"}];case"tanstack":return[{router:"tanstack",dir:s("src/routes"),pattern:"**/*"}];default:{const n=t;throw new Error(`Unknown framework: ${String(n)}`)}}}function nn(t){const e=t.lastIndexOf(".");return e<=0?null:[t.slice(0,e),t.slice(e+1)]}function vd(t){const e=nn(t.at(-1)??"");if(!e||!Ca.has(e[1]))return null;const[s]=e;if(s.includes("."))return null;const n=[...t.slice(0,-1),s];return n[0]==="api"||n.length===1&&pd.has(s)||n.some(a=>a.startsWith("_")||a.includes("["))?null:(n.at(-1)==="index"&&n.pop(),`/${n.join("/")}`)}function xd(t){const e=nn(t.at(-1)??"");if(!e||e[0]!=="page"||!Ca.has(e[1]))return null;const s=[];for(const n of t.slice(0,-1)){if(n.startsWith("_")||n.startsWith("@")||/^\(\.{1,3}\)/.test(n)||n.includes("["))return null;n.startsWith("(")&&n.endsWith(")")||s.push(n)}return`/${s.join("/")}`}function bd(t){const e=[];let s="",n=!1;for(const a of t)a==="["?n=!0:a==="]"&&(n=!1),a==="."&&!n?(e.push(s),s=""):s+=a;return e.push(s),e}function yd(t){const e=nn(t.at(-1)??"");if(!e||!fd.has(e[1]))return null;const s=[...t.slice(0,-1),...bd(e[0])].filter(Boolean);s.at(-1)==="lazy"&&s.pop();const n=s.at(-1);if(!n||n==="__root"||s.some(c=>c.startsWith("-"))||n.startsWith("_"))return null;(n==="index"||n==="route")&&s.pop();const a=[];for(const c of s){if(c.includes("$"))return null;if(c.startsWith("_")||c.startsWith("(")&&c.endsWith(")"))continue;const d=c.replace(/_$/,"").replace(/[[\]]/g,"");d&&a.push(d)}return`/${a.join("/")}`}function wd(t,e){const s=e.split("/").filter(Boolean);if(s.length===0)return null;switch(t){case"next-pages":return vd(s);case"next-app":return xd(s);case"tanstack":return yd(s);default:{const n=t;throw new Error(`Unknown router: ${String(n)}`)}}}function kd(t){const e=new Set;for(const{root:s,files:n}of t){const a=`${s.dir}/`;for(const c of n){if(!c.startsWith(a))continue;const d=wd(s.router,c.slice(a.length));d&&e.add(d)}}return[...e].sort((s,n)=>s==="/"?-1:n==="/"?1:s.localeCompare(n))}const Sd=5e3,Pd=6e4;async function jd(t,e){const s=await fetch(ll(t,"glob"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pattern:e.pattern,path:e.dir,limit:Sd})});if(!s.ok)throw new Error(`Failed to list ${e.dir}: ${s.status}`);const n=await s.json();return Array.isArray(n.files)?n.files.filter(a=>typeof a=="string"):[]}async function Ed(t,e){const s=await io(t,Ta(e,"package.json"));if(s.kind==="unavailable")throw new Error("package.json unavailable: sandbox not ready");const n=s.kind==="data"?hd(s.data):null;if(!n)return[];const a=gd(n,e),c=await Promise.all(a.map(async d=>({root:d,files:await jd(t,d)})));return kd(c)}function Nd(t,e,s){const n=le.c(12);let a;n[0]!==e||n[1]!==t?(a=t?Qs.frameworkRoutes(t.orgSlug,t.virtualMcpId,t.branch,t.threadId,e):["framework-routes","none"],n[0]=e,n[1]=t,n[2]=a):a=n[2];let c;n[3]!==e||n[4]!==t?(c=()=>t?Ed(t,e):[],n[3]=e,n[4]=t,n[5]=c):c=n[5];const d=s&&!!t;let o;n[6]!==a||n[7]!==c||n[8]!==d?(o={queryKey:a,queryFn:c,enabled:d,staleTime:Pd},n[6]=a,n[7]=c,n[8]=d,n[9]=o):o=n[9];const i=$r(o);let l;return n[10]!==i.data?(l=i.data??[],n[10]=i.data,n[11]=l):l=n[11],l}const Cd=500,Td={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},Rr=1,ds=["desktop","mobile","tablet"],Rd=["preview","visual","blocks"],Ld={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function Ad(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 It(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Is(t,e){try{return new URL(t,e).href}catch{return null}}function _d(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 Od(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Fd(t,e,s){const n=t.toLowerCase(),a=e.toLowerCase(),c=a.split("/").filter(Boolean),d=i=>{if(i===s)return 100;const l=i.indexOf(s);if(l===-1)return 0;let m=40;return l===0?m+=30:/[\s/-]/.test(i[l-1]??"")&&(m+=20),m+=Math.round(s.length/i.length*20),m};let o=Math.max(d(n),d(a));return c.at(-1)===s?o=Math.max(o,95):c.includes(s)&&(o=Math.max(o,90)),o}function Dd(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function $d({virtualMcpId:t}){const e=Ee(),s=aa(),{currentBranch:n,taskId:a,virtualMcpId:c}=at(),d=!!Ti(),o=ua(),i=Ui(c===t?t:null),l=Xr(t),m=cl(i?.metadata?.ui?.layout??null),f=ga(m),p=Na({contentEditingEnabled:f,isMobile:s}),[y]=N.useState(()=>id({cmsMode:m,isMobile:s})),[x,b]=Ks(Hs.previewEditingMode(t),u=>u&&Rd.includes(u)?u:null),h=x??y,[g,R]=Ks(Hs.previewDeviceSize(t),u=>u&&ds.includes(u)?u:"desktop"),[v,w]=N.useState(null),[T,k]=N.useState(null),S=N.useRef(null),j=N.useRef(null),[C,B]=N.useState(!1),A=N.useRef(null),L=()=>{A.current?.flush(),B(!1)},F=()=>B(u=>(u&&A.current?.flush(),!u)),[O,$]=N.useState({width:0,height:0}),[I,G]=N.useState(!1),[W,Y]=N.useState({}),[q,Q]=N.useState(""),K=N.useRef(null),[ee,H]=N.useState(!1),[J,V]=N.useState(),[E,_]=N.useState(null),[D,U]=N.useState(null),[X,se]=N.useState(null),[z,Z]=N.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[re,ie]=N.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[he,pe]=N.useState({}),[be,ge]=N.useState(!1),ve=N.useRef(null),Se=()=>{ge(!0),ve.current&&clearTimeout(ve.current),ve.current=setTimeout(()=>ge(!1),15e3)},fe=()=>{ve.current&&(clearTimeout(ve.current),ve.current=null),ge(!1)},{org:ce}=ms(),Le=tn(),ze=xt(),Ie=ze.vmEntry,Be=Le.lifecycle.phase,{url:bt}=na(t),me=Kt(t,n),{connection:Fe}=ra(t),xe=Zo(t),Ue=oo({hasServeConnection:!!Fe,runtime:l.runtime}),Ae=!Xe(me)&&me.kind!=="pending",ne=He(me)??bt,de=ne??ze.previewUrl,We=!!ne||Be==="running",yt=i?.id===t?Yi(i.metadata):null,qe=!ne&&i?.id===t&&l.runtime==="cms",Ht=l.projectDefault==="cms",wt=Ae?lo({sandboxUrl:de,previewServerUrl:yt,fastPreviewActive:qe}):null,rn=t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n,threadId:a??null,previewUrl:de}:null,an=hs(rn,{fetchEnabled:We}),gs=la(rn,{fetchEnabled:We}),ue=an.data,Pe=gs.data,Ge=ue?To(ue,Pe).sort((u,P)=>u.name.localeCompare(P.name)):[],Vt=t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n}:null,on=qc(Vt),Ra=co(Vt),vs=ue&&Pe?Ro(ue,Pe):[],ln=Ae&&ue&&Pe?Ko(Pe,ue,"loaders"):[],La=q?(()=>{const u=q.toLowerCase();return Ge.map(P=>({page:P,score:Fd(P.name,P.path,u)})).filter(({score:P})=>P>0).sort((P,M)=>M.score-P.score||P.page.path.length-M.page.path.length).map(({page:P})=>P)})():Ge,Aa=vs.filter(u=>{if(!q)return!0;const P=q.toLowerCase();return u.name.toLowerCase().includes(P)||u.key.toLowerCase().includes(P)||u.resolveType.toLowerCase().includes(P)}),cn=p?ln:[],dn=cn.filter(u=>{if(!q)return!0;const P=q.toLowerCase();return u.title.toLowerCase().includes(P)||u.key.toLowerCase().includes(P)||u.resolveType.toLowerCase().includes(P)}),Wt=D?ln.find(u=>u.key===D)??null:null,Ne=en,xs=E||D?null:Lo(Ge,z,re),oe=xs?.key??null,it=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??oe,qt=xs?.path??null,ot=(oe?he[oe]:void 0)??{},Te=Ve(z,ot),bs={};if(Ae&&We&&de&&Pe&&ue){const u=Ho(Pe,"loaders"),P=oe?ue[oe]:void 0,M=fc(P,ue,we=>u.has(we)),ae=oc(M);for(const we of Ut(z)){if(we.type!=="param")continue;const Ce=rc(z,we.name,M),ft=dc(Ce,u,ae);ft.length>0&&(bs[we.name]=ft)}}const kt=t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n,threadId:a??null}:null,un=ue&&oe?Wo(ue,oe,0):[],fn=Xe(me),pn=ue?Vo(un,ue,fn):[],St=pn.map(u=>u.isSavedBlock?u.label:""),Pt=pn.map(u=>u.isSavedBlock?"global":u.isMultivariate?"variant":"normal"),jt=un.map(u=>Gs(u,ue??{},fn)),lt=N.useRef(null),De=N.useRef(null),_a=Le.status.state==="paused",ys=Le.phase,mn=Jo({claimPhase:ys,lifecycle:Le.lifecycle}),Je=ze.previewState,Oa=ze.userStopped,Fa=uo(ce.slug,t??""),{url:Ke}=$o(qe&&t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n,previewServerUrl:yt??null,path:Te}:null),Da=Ht&&l.runtime==="sandbox",_e=fo(me,Ue,xe),hn=po(_e&&qe&&me.kind==="protocol"&&t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n}:null),gn=_e?hn.pointer:null,te=Bl({previewState:Je,progressStatus:mn.status,previewServerUrl:yt,fastPreviewActive:qe,fastPreviewReady:!!Ke,codingSession:Da,localPreviewUrl:ne,hostedDraft:_e,hostedPointerPending:_e&&(me.kind==="pending"||hn.pending)}),vn=te.showWakingPill||_e&&te.mode==="production"&&!gn,Et=te.mode!=="none",$a=te.mode==="production"&&te.iframeBase?It(te.iframeBase):null,ct=te.mode==="production"?$a:It(de),Ba=i?.id===t&&i.metadata?.fastPreviewInPlace===!0,Nt=Ae?ne?te.mode==="sandbox"&&p&&h==="blocks":te.mode==="production"&&qe&&Ba&&p&&h==="blocks":!1,xn=N.useRef(null),{pin:Ma,effective:za}=_d(xn.current,{inPlaceRenderActive:Nt,draftPreviewUrl:Ke,resolvedPath:Te});xn.current=Ma;const bn=o.state.variantOverride??[],Gt=Ae?bn:[],Ct=Ae?[]:bn,Jt=Xe(me)&&Ao.some(u=>_o(Pe,u)==="available"),dt=Jt?W:{},yn=sa(dt),Ia=Jt&&ue?Object.keys(Oo(ue).experiments):[],[wn,Ua]=N.useState(!1),kn=ta(Vt,Jt&&wn?Fo:[]),Ka={...kn,ready:!(me.kind==="protocol"&&me.hosted)||wn&&kn.ready},Ye=t?rr(ce.slug,t):null,Ha=mo(Ye),Yt=_e?ld({display:te,path:Te,pointer:gn,heldRevision:Ha,device:g,forcedVariants:Ct,previewOptions:dt}):null,Sn=JSON.stringify([Ct,dt]);N.useEffect(()=>{if(!_e||!Ye)return;const[u,P]=JSON.parse(Sn);ar(Ye,{forcedVariants:u,previewOptions:P})},[_e,Ye,Sn]),N.useEffect(()=>{if(!(!_e||!Ye))return()=>ar(Ye,null)},[_e,Ye]);const ws=Fe&&He(me)?ho(Fe.endpoint,Ct,yn):null,Va=Fe&&He(me)?ws?go(ws,dt):ir:null,Qe=Ad(te.mode==="sandbox"?as(qs(or(X??Is(Te,te.iframeBase)??te.iframeBase,Va),g),Gt):te.mode==="production"&&Yt?.frame?Yt.frame:te.mode==="production"?as(qs(lr(cr(or(X??za??Is(Te,te.iframeBase)??te.iframeBase,vn?ir:null),Ct),dt),g),Gt):null),Pn=Ke??(te.iframeBase?Is(Te,te.iframeBase):null),jn=te.mode==="production"&&Yt?Yt.newTab:te.mode==="production"?Pn?as(lr(cr(Pn,Ct),dt),Gt):null:Qe??te.iframeBase,Wa=()=>{const u=jn;u&&window.open(u,"_blank","noopener")},Tt=t&&n?zr(ce.slug,t,n):null,Rt=u=>{Tt&&Li(Tt,u)},ke=o.state.target;N.useEffect(()=>{if(!(!ke||!wt||!Pe))if(ke.kind==="page"){const u=he[ke.key]??{};De.current=Ve(ke.path,u),_(null),U(null),se(null),ie(ke.key),Z(ke.path),Rt({path:ke.path,pageKey:ke.key,params:u})}else if(ke.kind==="loader")De.current=null,_(null),U(ke.key),se(null);else{const u=vs.find(P=>P.key===ke.key);if(u){De.current=null;const P=fr(Pe);U(null),_(u),se(dr(wt,P,u.key))}}},[ke,wt,Pe,he]),N.useEffect(()=>{!oe||qt===null||ke?.kind==="page"&&ke.key===oe&&ke.path===qt||o.selectTarget({kind:"page",key:oe,path:qt})},[oe,qt,ke]);const[En,qa]=N.useState(null);if(Je.kind==="iframe"&&En!==Je.previewUrl){const u=En!==null;qa(Je.previewUrl);const P=Tt?Mr(Tt):null;if(P){if(De.current=Ve(P.path,P.params),Z(P.path),ie(P.pageKey),se(null),_(null),U(null),P.pageKey&&Object.keys(P.params).length>0){const M=P.pageKey;pe(ae=>({...ae,[M]:P.params}))}}else u&&(De.current=null,Z("/"),se(null),ie(null),_(null),U(null))}lt.current=Qe;const Ga=te.mode==="production"&&!!Ke&&!ne,[Qt,ks]=N.useState({src:Qe??void 0,loading:!1}),[Ja,Ss]=N.useState(!1),[Ya,Qa]=N.useState(),[Nn,Cn]=N.useState(null),je=Vi(Nn,{base:te.iframeBase??"",frameSrc:Qt.src,loadedSrc:Ya,wanted:Qe??void 0,canSwap:xe&&Ja&&!Qt.loading});je!==Nn&&Cn(je);const Xt=Wi(Qt,je?je.src:Qe??void 0,Ga);Xt!==Qt&&ks(Xt);const ut=Xt.src,Tn=Xt.loading,Rn=qi({iframeRef:S,src:te.mode==="sandbox"?Qe:null,active:te.mode==="sandbox"}),Ln=N.useRef(null);N.useEffect(()=>{const u=Tn?setTimeout(()=>ks(nr),Gi):null,P=()=>{u&&clearTimeout(u)};if(!Ke||!ut||Ln.current===Ke)return P;Ln.current=Ke;const M=S.current;return M&&M.getAttribute("src")!==ut&&(Se(),M.src=ut),P},[Ke,ut,Tn]);const An=()=>{const u=S.current?.contentWindow,P=ct;if(!u||!P||!ue||!oe)return;const M=ue[oe];if(!M||typeof M!="object")return;const ae=yo({previewBaseUrl:P,pageBlock:M,decofile:ue,path:Te,pathTemplate:z});if(!ae)return;const we=as(ae.src,ko(Gt,oe));u.postMessage({type:"cms-editor::render",src:we,body:ae.body},P)},Ps=N.useRef(null);N.useEffect(()=>{if(!Nt||E||D||!oe||!ue){Ps.current=null;return}const u={nav:JSON.stringify({page:oe,path:Te,pathTemplate:z}),content:JSON.stringify(ue)},P=Od(Ps.current,u);Ps.current=u,P&&An()},[ue,Nt,E,D,oe,Te,z]);const js=N.useRef(null);N.useEffect(()=>{if(!Nt||E||D||!oe||!ue){js.current=null;return}const u=JSON.stringify(o.state.variantOverride??null),P=js.current;js.current={page:oe,sig:u},!(!P||P.page!==oe||P.sig===u)&&An()},[o.state.variantOverride,Nt,E,D,oe]);const _n=!!t&&!!n&&!Le.notFound&&!Oa&&!_a&&(ys?.kind==="ready"||Be!=="idle"),On=!Xe(me),Xa=Zs(t??void 0),Za=Nd(kt,Xa,On&&_n),ei=new Set(f?Ge.map(u=>Ne(u.path)):[]),Lt=On?Za.filter(u=>!ei.has(Ne(u))):[],Fn=q?Lt.filter(u=>u.toLowerCase().includes(q.toLowerCase())):Lt,ye=od({editingMode:h,sandboxDisplay:te.mode==="sandbox",blocksEditingEnabled:p});N.useEffect(()=>{const u=ct;if(!u)return;const P=M=>{if(M.origin===u)if(M.data?.type==="visual-editor::element-clicked"){const ae=Ul.safeParse(M.data.payload);ae.success&&w(ae.data)}else if(M.data?.type==="cms-editor::section-clicked"){const ae=Vl.safeParse(M.data.payload);ae.success&&k({index:ae.data.sectionIndex,seq:ae.data.clickSeq})}else M.data?.type==="cms-editor::render-start"?Se():M.data?.type==="cms-editor::render-end"?(fe(),S.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:St,kinds:Pt,keys:jt},u)):M.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",P),()=>window.removeEventListener("message",P)},[ct,St,Pt,jt]);const Dn=()=>{const u=S.current?.contentWindow,P=It(de),M=Hc({v8:xe,script:Kl});!u||!P||!M||u.postMessage(M,P)},ti=()=>{if(xe)return;const u=S.current?.contentWindow,P=It(de);!u||!P||u.postMessage({type:"visual-editor::deactivate"},P)},$n=()=>{const u=Me.current;u?.has("wireframe")&&(u.wireframe({type:"wireframe:sections",labels:St,kinds:Pt,keys:jt}),u.wireframe({type:ye==="blocks"?"wireframe:activate":"wireframe:deactivate"}))},Es=()=>{if(xe){$n();return}const u=S.current?.contentWindow,P=ct,M=Kc({v8:xe,production:te.mode==="production",localPreview:!!ne,script:Wl});!u||!P||!M||(u.postMessage(M,P),u.postMessage({type:"cms-editor::set-labels",labels:St,kinds:Pt,keys:jt},P))},si=()=>{if(xe){Me.current?.wireframe({type:"wireframe:deactivate"});return}const u=S.current?.contentWindow,P=ct;!u||!P||u.postMessage({type:"cms-editor::deactivate"},P)},Bn=u=>{Me.current?.wireframe({type:"wireframe:scroll-to",sectionIndex:u})},ni=()=>{if(Me.current?.wireframe({type:"wireframe:clear-hover"}),xe)return;const u=S.current?.contentWindow,P=ct;!u||!P||(u.postMessage({type:"cms-editor::clear-hover"},P),u.postMessage({type:"visual-editor::clear-hover"},P))},Zt=u=>{if(u==="blocks"&&!p)return;const P=h;!s&&u!==P&&(u==="blocks"?j.current?.resize("30%"):j.current?.collapse()),b(u),w(null),k(null),u!=="blocks"&&U(null),P==="visual"&&ti(),u==="visual"&&Dn(),P==="blocks"&&u!=="blocks"&&si(),u==="blocks"&&Es()},ri=()=>{Zt(rd(h,p))},ai=()=>{Zt(ad(h,p))},es=()=>{const u=S.current;if(!u)return;Se();const P=document.activeElement,M=u.tabIndex;u.tabIndex=-1,u.style.pointerEvents="none",u.blur(),Dd(u,lt.current);let ae;const we=()=>{clearTimeout(ae),u.tabIndex=M,u.style.pointerEvents="";const Ce=document.activeElement;(!Ce||Ce===document.body||Ce===u)&&P?.focus(),u.removeEventListener("load",we)};u.addEventListener("load",we),ae=setTimeout(we,3e3)};Go(es);const Me=N.useRef(null),Mn=N.useEffectEvent($n),ii=N.useEffectEvent((u,P)=>{k({index:u,seq:P})}),oi=N.useEffectEvent(()=>{fe(),je&&(Ns.current=je.shown),_t&&_s(At)}),zn=N.useEffectEvent(()=>{if(Ss(!1),je&&Cn(null),je&&je.src!==lt.current){Se();return}es()});N.useEffect(()=>{if(!xe)return;const u=new Ql({studioOrigin:window.location.origin,build:"4.584.5",frame:()=>S.current?.contentWindow??null,onWireframeReady:()=>Mn(),onWireframe:M=>{M.type==="wireframe:select"&&ii(M.sectionIndex,M.clickSeq)},onModulesChange:()=>Ss(u.has("html-swap")),onSwapEnd:()=>oi(),onSwapFailed:()=>zn()});Me.current=u;const P=M=>{u.handle(M)};return window.addEventListener("message",P),()=>{window.removeEventListener("message",P),u.dispose(),Ss(!1),Me.current===u&&(Me.current=null)}},[xe,te.iframeBase]);const In=xe?JSON.stringify([St,Pt,jt,ye]):"";N.useEffect(()=>{In&&Mn()},[In]);const Un=N.useRef(null);N.useEffect(()=>{const u=Un.current;if(Un.current=je,je&&je!==u){Me.current?.refresh(je.shown)?Se():zn();return}!je&&u&&u.shown!==u.src&&u.src===lt.current&&es()},[je]);const Kn=()=>{Me.current?.refresh()||es()},At=rr(ce.slug,t??""),_t=_e&&Et&&!!t,Ns=N.useRef(null);N.useEffect(()=>{if(_t)return vo(At)},[_t,At]);const{reload:Ot}=xo(ce.slug,t??""),Hn=N.useRef(Ot.seq);N.useEffect(()=>{if(Hn.current!==Ot.seq&&(Hn.current=Ot.seq,!!_t&&Ns.current===lt.current)){if(Ot.navigates){_s(At);return}Kn()}},[Ot.seq]);const Cs=Zr(Vt),Ft=bo(He(me)?Cs:""),Vn=N.useRef(Ft);N.useEffect(()=>{const u=Vn.current;if(Vn.current=Ft,!u||!Ft||u===Ft)return;const P=S.current;if(P)return Il({iframe:P,reload:Kn})},[Ft]);const Wn=()=>{const u=ds.indexOf(g);R(ds[(u+1)%ds.length])},Ts=(u,P)=>{if(!oe)return;const M=oe,ae={...ot,[u]:P};De.current=Ve(z,ae),pe(we=>({...we,[M]:ae})),Rt({path:z,pageKey:M,params:ae})},li=zc({iframeBase:te.iframeBase,resolvedPath:Te,activeGlobalSectionName:E?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),Rs=u=>{const P=he[u.key]??{},M=Ve(u.path,P);(E||Ne(M)!==Ne(Te))&&Se(),De.current=M,_(null),U(null),se(null),k(null),ie(u.key),Z(u.path),Rt({path:u.path,pageKey:u.key,params:P}),o.selectTarget({kind:"page",key:u.key,path:u.path})},qn=u=>{(E||Ne(u)!==Ne(Te))&&Se(),De.current=u,_(null),U(null),se(null),k(null),ie(null),Z(u),Rt({path:u,pageKey:null,params:{}})};Ri(Tt,qn);const ci=u=>{if(Xe(me)){const ae=ue?Do(ue,u.key,Pe):null;ae?Rs(ae):fs.info(e("sandbox.preview.blockOnNoPage"));return}if(!wt||!Pe){fs.error(e("sandbox.preview.previewMetadataNotReady"));return}Se(),De.current=null;const P=fr(Pe),M=dr(wt,P,u.key);_(u),U(null),se(M),k(null),o.selectTarget({kind:"section",key:u.key})},di=u=>{p&&(_(null),U(u.key),se(null),Zt("blocks"),o.selectTarget({kind:"loader",key:u.key}))},ui=async({name:u,path:P,templateKey:M})=>{if(!t||!n)return;const ae=oa(P);if(ae){V(ae);return}const we=P.trim().startsWith("/")?P.trim():`/${P.trim()}`;if(Ge.some(Ce=>Ne(Ce.path)===Ne(we))){V(e("sandbox.preview.pageAlreadyExists",{path:we}));return}V(void 0);try{const Ce=M?await Ra(ue,M):void 0;if(M&&!Ce){V(e("sandbox.preview.templateNoLongerExists"));return}const ft=await on.mutateAsync({name:u,path:we,template:Ce,schema:Xe(me)?{meta:Pe,loadMeta:async()=>(await gs.refetch()).data}:void 0});H(!1),fs.success(e("sandbox.preview.pageCreated",{name:u})),await ul(Cd),Rs({key:ft.key,name:ft.name,path:ft.path}),Zt("blocks")}catch(Ce){V(Ce instanceof Ea?e("sandbox.preview.pageSchemaNotReady"):Ce instanceof Error?Ce.message:e("sandbox.preview.failedToCreatePage"))}},Dt=Ic({previewSurfaceActive:Et,daemonReady:_n,production:te.mode==="production",servePreviewUrl:He(me)}),Gn=Uc({showPreviewToolbar:Dt,contentEditingEnabled:f,hasFrameworkRoutes:Lt.length>0}),Jn=f?La:[],Yn=f?Aa:[],$t=()=>{G(!1),Q("")},Ls=f?E?.name??Wt?.title??xs?.name:void 0,As=f&&(an.isPending||gs.isPending),ts=As?It(te.iframeBase):Ls,Bt=E?`section:${E.key}`:D?`loader:${D}`:f&&oe?`page:${oe}`:Lt.includes(Ne(z))?`route:${Ne(z)}`:void 0,ss=e(Ld[g]),Qn=g==="mobile"?r.jsx(Ur,{size:16}):g==="tablet"?r.jsx(Bi,{size:16}):r.jsx(Kr,{size:16}),fi=Dt?Gn?r.jsxs("div",{className:"flex h-7 min-w-36 flex-1 items-stretch overflow-hidden rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background transition-colors hover:border-border",children:[r.jsxs(st,{children:[r.jsx(et,{asChild:!0,children:r.jsx("button",{type:"button",onClick:Wn,"aria-label":ss,className:Re("flex w-7 shrink-0 items-center justify-center border-r border-border/60 text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",ur),children:Qn})}),r.jsx(tt,{children:ss})]}),r.jsxs(qr,{open:I,onOpenChange:u=>{G(u),u||Q("")},children:[r.jsx(Vr,{asChild:!0,children:r.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:As?ts??void 0:E||Wt?Ls:[Ls,z].filter(Boolean).join(" · "),className:Re("group/page-picker flex min-w-0 flex-1 items-stretch whitespace-nowrap text-left text-xs text-muted-foreground",ur),children:r.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[E&&r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-2xs font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[r.jsx(Di,{size:11}),e("sandbox.preview.globalBadge")]}),Wt&&r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:[r.jsx(Mi,{size:11}),e("sandbox.preview.loaderBadge")]}),ts&&r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ts}),!As&&!E&&!Wt&&r.jsx("span",{"data-testid":"preview-page-path",className:Re("min-w-0 truncate font-mono [direction:rtl]",ts?"ml-auto shrink-[2] text-right text-muted-foreground md:@max-[40rem]/panel-toolbar:hidden":"flex-1 text-left text-foreground"),children:r.jsx("bdi",{dir:"ltr",children:z})}),r.jsx(Ai,{size:12,className:Re("shrink-0 transition-transform",I&&"rotate-180")})]})})}),r.jsxs(Wr,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[r.jsxs(Jr,{shouldFilter:!1,defaultValue:Bt,children:[r.jsx(Yr,{value:q,onValueChange:u=>{Q(u),K.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),r.jsxs(Gr,{ref:K,className:"max-h-80",children:[r.jsx(Qr,{children:(!f||Ge.length===0)&&Lt.length===0&&(!f||vs.length===0)&&cn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Jn.length>0&&r.jsx(ht,{children:Jn.map(u=>r.jsxs(gt,{value:`page:${u.key}`,"aria-current":Bt===`page:${u.key}`||void 0,title:`${u.name} · ${u.path}`,onSelect:()=>{$t(),Rs(u)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:u.name}),r.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:u.path})]},u.key))}),Fn.length>0&&r.jsx(ht,{heading:e("sandbox.preview.siteRoutes"),children:Fn.map(u=>r.jsx(gt,{value:`route:${u}`,"aria-current":Bt===`route:${u}`||void 0,title:u,onSelect:()=>{$t(),qn(u)},className:"px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:r.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:u})},u))}),Yn.length>0&&r.jsx(ht,{heading:e("sandbox.preview.globalComponents"),children:Yn.map(u=>r.jsx(gt,{value:`section:${u.key}`,"aria-current":Bt===`section:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{$t(),ci(u)},children:r.jsx("span",{className:"truncate",children:u.name})},u.key))}),dn.length>0&&r.jsx(ht,{heading:e("sandbox.preview.globalLoaders"),children:dn.map(u=>r.jsx(gt,{value:`loader:${u.key}`,"aria-current":Bt===`loader:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{$t(),di(u)},children:r.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),f&&!E&&!D&&Ut(z).some(u=>u.type!=="text")&&r.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:Ut(z).map((u,P)=>{if(u.type==="text")return r.jsx("span",{children:u.text},`text-${P}`);const M=bs[u.name];return M&&kt?r.jsx(Nc,{sources:M,template:z,paramName:u.name,value:ot[u.name]??"",sandboxRef:kt,onCommit:ae=>Ts(u.name,ae)},`${oe}:${u.name}`):r.jsx(Bc,{name:u.name,value:ot[u.name]??"",onCommit:ae=>Ts(u.name,ae)},`${oe}:${u.name}`)})}),f&&r.jsx("div",{className:"border-t p-1.5",children:r.jsxs(Oe,{variant:"ghost",className:"w-full justify-start",onClick:()=>{$t(),V(void 0),H(!0)},children:[r.jsx(Hr,{size:16}),e("sandbox.preview.createNewPage")]})})]})]})]}):r.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:li}):null,Xn=Dt||f?r.jsxs("div",{className:"flex min-w-0 max-w-[24rem] flex-1 items-center justify-center gap-1",children:[!(Dt&&Gn)&&r.jsxs(st,{children:[r.jsx(et,{asChild:!0,children:r.jsx(Ze,{onClick:Wn,"aria-label":ss,children:Qn})}),r.jsx(tt,{children:ss})]}),fi,r.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[Jt&&r.jsx(cd,{tests:Ia,load:Ka,onOpen:()=>Ua(!0),options:W,onChange:u=>{Y(u),o.previewAsChanged()},available:!!ws||!vn||!yn}),r.jsx(Ze,{onClick:Wa,disabled:_e&&!jn,"aria-label":e("sandbox.preview.openInNewTab"),children:r.jsx(Br,{size:16})})]})]}):null,pi=(Ae||d)&&te.mode==="sandbox",ns=Td[g],rs=g==="desktop"&&(O.width===0||O.width>=ns.width+2*Rr),Zn=rs?1:Math.min(O.width>0?O.width/(ns.width+2*Rr):1,1),mi=rs?{width:"100%",height:"100%"}:{width:`${ns.width}px`,height:O.height>0?`${O.height/Zn}px`:`${ns.height}px`,transform:`scale(${Zn})`,transformOrigin:"top center"},er=r.jsxs(r.Fragment,{children:[pi&&(Dt||f)&&r.jsx(Ze,{onClick:ri,"aria-pressed":ye==="visual","aria-label":e("sandbox.preview.visualEditor"),active:ye==="visual",children:r.jsx(sr,{size:16})}),p&&r.jsxs(st,{children:[r.jsx(et,{asChild:!0,children:r.jsx(Ze,{onClick:ai,"aria-pressed":ye==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:ye==="blocks",children:r.jsx(zi,{size:16})})}),r.jsx(tt,{children:e("sandbox.preview.blocksEditor")})]}),it&&r.jsxs(st,{children:[r.jsx(et,{asChild:!0,children:r.jsx(Ze,{onClick:F,"aria-pressed":C,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:C,children:r.jsx($i,{size:16})})}),r.jsx(tt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),hi=!!D&&ye==="blocks";return r.jsxs("div",{className:"flex flex-col w-full h-full",children:[kt&&Object.entries(bs).map(([u,P])=>(ot[u]??"")===""?r.jsx(Dc,{sources:P,template:z,paramName:u,sandboxRef:kt,onFill:M=>Ts(u,M)},`${oe}:${u}`):null),r.jsxs(r.Fragment,{children:[r.jsx(Vs.Toolbar.Center.Portal,{fallback:r.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:Xn}),children:Xn}),r.jsx(Vs.Toolbar.Right.Portal,{fallback:er,children:er})]}),r.jsx("div",{className:"flex-1 overflow-hidden relative",children:hi?r.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[r.jsx(Cr,{virtualMcpId:t,externalSelection:T,onSectionPicked:Bn,onViewJsonFile:F}),C&&it&&r.jsx("div",{className:"absolute inset-0 z-10",children:r.jsx(Tr,{ref:A,virtualMcpId:t,pageKey:it,onClose:L},me.kind==="legacy"?void 0:JSON.stringify([Cs,xe]))})]}):r.jsxs(mr,{orientation:"horizontal",disabled:ye!=="blocks",className:"relative isolate",children:[r.jsx(is,{ref:j,id:"preview-blocks-editor",defaultSize:ye==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:ye==="blocks"&&r.jsx(Cr,{virtualMcpId:t,externalSelection:T,onSectionPicked:Bn,onViewJsonFile:F})}),ye==="blocks"&&r.jsx(hr,{withHandle:!0}),r.jsx(is,{id:"preview-canvas",defaultSize:ye==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:r.jsxs(mr,{orientation:"horizontal",disabled:!(C&&it),children:[r.jsx(is,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:r.jsxs("div",{ref:u=>{if(!u)return;const P=()=>$(ae=>ae.width===u.clientWidth&&ae.height===u.clientHeight?ae:{width:u.clientWidth,height:u.clientHeight});P();const M=new ResizeObserver(P);return M.observe(u),()=>M.disconnect()},className:Re("h-full relative overflow-clip flex justify-center",Et&&!rs&&"bg-muted/30"),children:[(be||Fa)&&Et&&r.jsx(Ji,{}),te.showDecidingLoader&&r.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:r.jsx(rt,{className:"size-5 text-muted-foreground"})}),te.showBlockingOverlay&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Fs,{kind:"starting",progress:mn,claimPhase:ys})}),!ne&&Je.kind==="suspended"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Fs,{kind:"suspended",onResume:ze.resume})}),!ne&&Je.kind==="errored"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Fs,{kind:"errored",error:Je.error,onRetry:ze.retry,connectionsHref:`/${ce.slug}/settings/connections`})}),te.showWakingPill&&r.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl bg-muted px-4 py-3 shadow-soft pointer-events-none select-none",children:[r.jsx(rt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),r.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),ye==="visual"&&!v&&r.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-special/40 bg-special/90 px-3 py-1 text-xs font-medium text-special-foreground shadow-soft backdrop-blur-sm pointer-events-none select-none",children:[r.jsx(sr,{size:12}),e("sandbox.preview.clickElementToAsk")]}),ye==="visual"&&v&&r.jsx(tc,{element:v,onDismiss:()=>w(null)}),Et&&Qe&&r.jsx("div",{className:Re("shrink-0",!rs&&"bg-background shadow-edge"),style:mi,onMouseLeave:ni,children:r.jsx("iframe",{ref:S,src:ut,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Rn.handleError,onLoad:()=>{if(ks(nr),Qa(ut),Rn.handleLoad(),fe(),Ns.current=lt.current,_t&&_s(At),te.mode!=="sandbox"||ne){(te.mode==="production"&&!te.showWakingPill||ne)&&ye==="blocks"&&Es();return}if(Pi("vm_preview_loaded",{view_mode:ye,vm_id:Ie?.sandboxHandle??null}),!E)try{const u=S.current?.contentWindow?.location?.pathname;if(!u)return;const P=De.current;if(P!==null&&(De.current=null,Ne(u)!==Ne(P))||Ne(u)===Ne(Te))return;Z(u),Rt({path:u,pageKey:re,params:ot})}catch{}ye==="visual"&&Dn(),ye==="blocks"&&Es()}},te.iframeBase)})]})}),C&&it&&r.jsxs(r.Fragment,{children:[r.jsx(hr,{withHandle:!0}),r.jsx(is,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:r.jsx(Tr,{ref:A,virtualMcpId:t,pageKey:it,onClose:L},me.kind==="legacy"?void 0:JSON.stringify([Cs,xe]))})]})]})})]})}),r.jsx(Gc,{open:ee,onOpenChange:H,isPending:on.isPending,error:J,templates:Ge,onSubmit:ui})]})}const Ys={app:null,split:!1};function Bd(t){const e=le.c(24),{project:s,maxApps:n,children:a}=t,c=Ee();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={silent:!0},e[0]=d):d=e[0];const o=Ki(d),i=xt();let l;e[1]!==s.metadata.runtime?(l=s.metadata.runtime??{},e[1]=s.metadata.runtime,e[2]=l):l=e[2];const m=l;let f;e[3]!==m.apps?(f=m.apps??[],e[3]=m.apps,e[4]=f):f=e[4];const p=f;let y;e[5]!==o.update||e[6]!==i||e[7]!==s.id||e[8]!==s.metadata||e[9]!==m||e[10]!==c?(y=v=>o.update.mutate({id:s.id,data:{metadata:{...fl(s.metadata),runtime:{...m,apps:v.length?v:null}}}},{onSuccess:()=>i.start(),onError:()=>fs.error(c("sandbox.appTabs.saveError"))}),e[5]=o.update,e[6]=i,e[7]=s.id,e[8]=s.metadata,e[9]=m,e[10]=c,e[11]=y):y=e[11];const x=y,b=m.path??null;let h,g;e[12]!==p||e[13]!==x?(h=v=>x([...p,{path:v}]),g=v=>x(p.filter(w=>w.path!==v)),e[12]=p,e[13]=x,e[14]=h,e[15]=g):(h=e[14],g=e[15]);let R;return e[16]!==p||e[17]!==a||e[18]!==n||e[19]!==s.id||e[20]!==b||e[21]!==h||e[22]!==g?(R=r.jsx(Md,{virtualMcpId:s.id,mainPath:b,apps:p,maxApps:n,onAddApp:h,onRemoveApp:g,children:a}),e[16]=p,e[17]=a,e[18]=n,e[19]=s.id,e[20]=b,e[21]=h,e[22]=g,e[23]=R):R=e[23],R}function Md(t){const e=le.c(102),{virtualMcpId:s,mainPath:n,apps:a,maxApps:c,onAddApp:d,onRemoveApp:o,children:i}=t,l=Ee(),m=aa(),{currentBranch:f}=at(),p=xt(),y=tn().lifecycle.phase,x=Kt(s,f),{url:b}=na(s);let h;e[0]!==x||e[1]!==b?(h=He(x)??b,e[0]=x,e[1]=b,e[2]=h):h=e[2];const g=h,R=g??p.previewUrl,v=!!g||y==="running",w=!v&&p.status==="errored";let T;e[3]!==p.vmEntry?.startedWith?.apps?(T=p.vmEntry?.startedWith?.apps??[],e[3]=p.vmEntry?.startedWith?.apps,e[4]=T):T=e[4];const k=T;let S;e[5]!==s?(S=Hs.previewAppLayout(s),e[5]=s,e[6]=S):S=e[6];const[j,C]=Ks(S,zd);let B;e[7]!==a||e[8]!==j?(B=a.some(fe=>fe.path===j.app)?j.app:null,e[7]=a,e[8]=j,e[9]=B):B=e[9];const A=B,L=A!==null&&j.split&&!m,F=A===null||L,O=A??a[0]?.path??null,[$,I]=N.useState(null),[G,W]=N.useState(!1);let Y;e[10]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>{I(null),W(!1)},e[10]=Y):Y=e[10];const q=Y;let Q;e[11]!==a||e[12]!==$||e[13]!==m||e[14]!==n||e[15]!==d||e[16]!==C?(Q=()=>{if($===null)return;const fe=xr($);if(!fe){q();return}if(fe===xr(n??"")||a.some(ce=>ce.path===fe)){W(!0);return}d(fe),C({app:fe,split:!m}),q()},e[11]=a,e[12]=$,e[13]=m,e[14]=n,e[15]=d,e[16]=C,e[17]=Q):Q=e[17];const K=Q;let ee;e[18]!==n||e[19]!==l?(ee=n?Ds(n):l("sandbox.appTabs.root"),e[18]=n,e[19]=l,e[20]=ee):ee=e[20];const H=ee;let J;e[21]!==L||e[22]!==l?(J=l(L?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=L,e[22]=l,e[23]=J):J=e[23];const V=J;let E;e[24]!==l?(E=l("sandbox.appTabs.label"),e[24]=l,e[25]=E):E=e[25];let _;e[26]!==l?(_=l("sandbox.appTabs.main"),e[26]=l,e[27]=_):_=e[27];let D;e[28]!==l?(D=l("sandbox.appTabs.mainHint"),e[28]=l,e[29]=D):D=e[29];let U;e[30]!==C?(U=()=>C(Ys),e[30]=C,e[31]=U):U=e[31];let X;e[32]!==w||e[33]!==H||e[34]!==v||e[35]!==F||e[36]!==_||e[37]!==D||e[38]!==U?(X=r.jsx(Lr,{label:H,badge:_,hint:D,ready:v,failed:w,onScreen:F,onSelect:U}),e[32]=w,e[33]=H,e[34]=v,e[35]=F,e[36]=_,e[37]=D,e[38]=U,e[39]=X):X=e[39];let se;if(e[40]!==a||e[41]!==A||e[42]!==w||e[43]!==H||e[44]!==o||e[45]!==v||e[46]!==C||e[47]!==L||e[48]!==l){let fe;e[50]!==A||e[51]!==w||e[52]!==H||e[53]!==o||e[54]!==v||e[55]!==C||e[56]!==L||e[57]!==l?(fe=ce=>{const Le=Ds(ce.path);return r.jsx(Lr,{label:Le,hint:l("sandbox.appTabs.extraHint",{app:H}),ready:v,failed:w,onScreen:ce.path===A,onSelect:()=>C({app:ce.path,split:L}),onRemove:()=>o(ce.path),removeLabel:l("sandbox.appTabs.remove",{app:Le})},ce.path)},e[50]=A,e[51]=w,e[52]=H,e[53]=o,e[54]=v,e[55]=C,e[56]=L,e[57]=l,e[58]=fe):fe=e[58],se=a.map(fe),e[40]=a,e[41]=A,e[42]=w,e[43]=H,e[44]=o,e[45]=v,e[46]=C,e[47]=L,e[48]=l,e[49]=se}else se=e[49];let z;e[59]!==X||e[60]!==se||e[61]!==E?(z=r.jsxs("div",{role:"tablist","aria-label":E,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[X,se]}),e[59]=X,e[60]=se,e[61]=E,e[62]=z):z=e[62];let Z;e[63]!==a.length||e[64]!==K||e[65]!==$||e[66]!==G||e[67]!==c||e[68]!==l?(Z=$!==null?r.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),K()},children:r.jsx("input",{autoFocus:!0,value:$,placeholder:"apps/checkout","aria-label":l("sandbox.appTabs.pathLabel"),"aria-invalid":G,onChange:fe=>{I(fe.target.value),W(!1)},onBlur:q,onKeyDown:fe=>{fe.key==="Escape"&&q()},className:Re("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",G?"border-destructive":"border-border")})}):a.length<c&&r.jsx(vt,{label:l("sandbox.appTabs.add"),onClick:()=>I(""),children:r.jsx(Hr,{})}),e[63]=a.length,e[64]=K,e[65]=$,e[66]=G,e[67]=c,e[68]=l,e[69]=Z):Z=e[69];let re;e[70]!==m||e[71]!==C||e[72]!==L||e[73]!==V||e[74]!==O?(re=!m&&O&&r.jsx(vt,{label:V,active:L,onClick:()=>C(L?Ys:{app:O,split:!0}),children:r.jsx(Ii,{})}),e[70]=m,e[71]=C,e[72]=L,e[73]=V,e[74]=O,e[75]=re):re=e[75];let ie;e[76]!==z||e[77]!==Z||e[78]!==re?(ie=r.jsxs(r.Fragment,{children:[z,Z,re]}),e[76]=z,e[77]=Z,e[78]=re,e[79]=ie):ie=e[79];const he=ie;let pe;e[80]!==he?(pe=r.jsx(Vs.Topbar.Left.Portal,{fallback:r.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:he}),children:r.jsx("div",{className:"ml-1 flex min-w-0 items-center gap-1 border-l border-border/60 pl-2",children:he})}),e[80]=he,e[81]=pe):pe=e[81];let be;e[82]!==i||e[83]!==F?(be=F&&r.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:i}),e[82]=i,e[83]=F,e[84]=be):be=e[84];let ge;e[85]!==A||e[86]!==w||e[87]!==p.start||e[88]!==g||e[89]!==H||e[90]!==R||e[91]!==v||e[92]!==C||e[93]!==L||e[94]!==k?(ge=A!==null&&r.jsx(Id,{name:Ds(A),mainName:H,appUrl:R?pl(R,A):null,ready:v,failed:w,notStarted:!g&&!k.includes(A),onStart:p.start,className:Re(L&&"border-l border-border"),onClose:L?()=>C({app:A,split:!1}):void 0},A),e[85]=A,e[86]=w,e[87]=p.start,e[88]=g,e[89]=H,e[90]=R,e[91]=v,e[92]=C,e[93]=L,e[94]=k,e[95]=ge):ge=e[95];let ve;e[96]!==be||e[97]!==ge?(ve=r.jsxs("div",{className:"flex min-h-0 flex-1",children:[be,ge]}),e[96]=be,e[97]=ge,e[98]=ve):ve=e[98];let Se;return e[99]!==pe||e[100]!==ve?(Se=r.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[pe,ve]}),e[99]=pe,e[100]=ve,e[101]=Se):Se=e[101],Se}function zd(t){return t??Ys}function Lr(t){const e=le.c(28),{label:s,badge:n,hint:a,ready:c,failed:d,onScreen:o,onSelect:i,onRemove:l,removeLabel:m}=t,f=o?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground";let p;e[0]!==f?(p=Re("group/app-tab flex h-7 shrink-0 items-center rounded-md text-xs transition-colors",f),e[0]=f,e[1]=p):p=e[1];const y=c?"bg-success":d?"bg-destructive":"animate-pulse bg-warning";let x;e[2]!==y?(x=Re("size-1.5 rounded-full",y),e[2]=y,e[3]=x):x=e[3];let b;e[4]!==x?(b=r.jsx("span",{"aria-hidden":!0,className:x}),e[4]=x,e[5]=b):b=e[5];let h;e[6]!==s?(h=r.jsx("span",{className:"max-w-40 truncate",children:s}),e[6]=s,e[7]=h):h=e[7];let g;e[8]!==n?(g=n&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:n}),e[8]=n,e[9]=g):g=e[9];let R;e[10]!==o||e[11]!==i||e[12]!==b||e[13]!==h||e[14]!==g?(R=r.jsx(et,{asChild:!0,children:r.jsxs("button",{type:"button",role:"tab","aria-selected":o,onClick:i,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[b,h,g]})}),e[10]=o,e[11]=i,e[12]=b,e[13]=h,e[14]=g,e[15]=R):R=e[15];let v;e[16]!==a?(v=r.jsx(tt,{className:"max-w-64",children:a}),e[16]=a,e[17]=v):v=e[17];let w;e[18]!==R||e[19]!==v?(w=r.jsxs(st,{children:[R,v]}),e[18]=R,e[19]=v,e[20]=w):w=e[20];let T;e[21]!==l||e[22]!==m?(T=l&&r.jsx("button",{type:"button","aria-label":m,onClick:l,className:"-ml-1 mr-1 flex size-5 items-center justify-center rounded opacity-0 hover:bg-sidebar-accent focus-ring focus-visible:opacity-100 group-hover/app-tab:opacity-100",children:r.jsx(xa,{className:"size-3"})}),e[21]=l,e[22]=m,e[23]=T):T=e[23];let k;return e[24]!==w||e[25]!==T||e[26]!==p?(k=r.jsxs("div",{className:p,children:[w,T]}),e[24]=w,e[25]=T,e[26]=p,e[27]=k):k=e[27],k}function Id(t){const e=le.c(71),{name:s,mainName:n,appUrl:a,ready:c,failed:d,notStarted:o,onStart:i,className:l,onClose:m}=t,f=Ee(),[p,y]=N.useState("/"),[x,b]=N.useState("desktop"),[h,g]=N.useState(0),R=N.useRef(null);let v;e[0]!==a||e[1]!==p?(v=a?ml(a,p):null,e[0]=a,e[1]=p,e[2]=v):v=e[2];const w=v;let T;e[3]!==l?(T=Re("flex min-h-0 min-w-0 flex-1 flex-col",l),e[3]=l,e[4]=T):T=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=D=>{D.preventDefault(),y(R.current?.value||"/")},e[5]=k):k=e[5];let S;e[6]!==s||e[7]!==f?(S=f("sandbox.appPane.path",{app:s}),e[6]=s,e[7]=f,e[8]=S):S=e[8];let j;e[9]!==p||e[10]!==S?(j=r.jsx("form",{className:"min-w-0 flex-1",onSubmit:k,children:r.jsx("input",{ref:R,defaultValue:p,"aria-label":S,className:"h-7 w-full rounded-md border border-border/60 bg-background px-2 font-mono text-xs text-muted-foreground outline-none hover:border-border focus:border-border focus:text-foreground"})}),e[9]=p,e[10]=S,e[11]=j):j=e[11];let C;e[12]!==x||e[13]!==f?(C=f(x==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=x,e[13]=f,e[14]=C):C=e[14];let B;e[15]===Symbol.for("react.memo_cache_sentinel")?(B=()=>b(Kd),e[15]=B):B=e[15];let A;e[16]!==x?(A=x==="desktop"?r.jsx(Kr,{}):r.jsx(Ur,{}),e[16]=x,e[17]=A):A=e[17];let L;e[18]!==C||e[19]!==A?(L=r.jsx(vt,{label:C,onClick:B,children:A}),e[18]=C,e[19]=A,e[20]=L):L=e[20];let F;e[21]!==s||e[22]!==f?(F=f("sandbox.appPane.reload",{app:s}),e[21]=s,e[22]=f,e[23]=F):F=e[23];const O=!w||!c;let $,I;e[24]===Symbol.for("react.memo_cache_sentinel")?($=()=>g(Ud),I=r.jsx(ji,{}),e[24]=$,e[25]=I):($=e[24],I=e[25]);let G;e[26]!==F||e[27]!==O?(G=r.jsx(vt,{label:F,disabled:O,onClick:$,children:I}),e[26]=F,e[27]=O,e[28]=G):G=e[28];let W;e[29]!==s||e[30]!==f?(W=f("sandbox.appPane.openInNewTab",{app:s}),e[29]=s,e[30]=f,e[31]=W):W=e[31];const Y=!w||!c;let q;e[32]!==w?(q=()=>w&&window.open(w,"_blank","noopener"),e[32]=w,e[33]=q):q=e[33];let Q;e[34]===Symbol.for("react.memo_cache_sentinel")?(Q=r.jsx(Br,{}),e[34]=Q):Q=e[34];let K;e[35]!==W||e[36]!==Y||e[37]!==q?(K=r.jsx(vt,{label:W,disabled:Y,onClick:q,children:Q}),e[35]=W,e[36]=Y,e[37]=q,e[38]=K):K=e[38];let ee;e[39]!==s||e[40]!==m||e[41]!==f?(ee=m&&r.jsx(vt,{label:f("sandbox.appPane.close",{app:s}),onClick:m,children:r.jsx(xa,{})}),e[39]=s,e[40]=m,e[41]=f,e[42]=ee):ee=e[42];let H;e[43]!==G||e[44]!==K||e[45]!==ee||e[46]!==j||e[47]!==L?(H=r.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[j,L,G,K,ee]}),e[43]=G,e[44]=K,e[45]=ee,e[46]=j,e[47]=L,e[48]=H):H=e[48];let J;e[49]!==n||e[50]!==f?(J=f("sandbox.appPane.previewOnly",{app:n}),e[49]=n,e[50]=f,e[51]=J):J=e[51];let V;e[52]!==J?(V=r.jsx("p",{className:"shrink-0 truncate border-b border-border bg-muted/40 px-3 py-1.5 text-xs text-muted-foreground",children:J}),e[52]=J,e[53]=V):V=e[53];let E;e[54]!==x||e[55]!==d||e[56]!==n||e[57]!==s||e[58]!==o||e[59]!==i||e[60]!==c||e[61]!==h||e[62]!==w||e[63]!==f?(E=r.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:c&&o?r.jsxs("div",{className:"flex flex-col items-center gap-3 self-center px-6 text-center",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:f("sandbox.appPane.notStarted",{app:s})}),r.jsx(Oe,{size:"sm",variant:"outline",onClick:i,children:f("sandbox.appPane.start",{app:s})})]}):!c||!w?r.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:c?f("sandbox.appPane.noUrl"):d?f("sandbox.appPane.failed",{app:n}):f("sandbox.appPane.waiting")}):r.jsx("iframe",{src:w,title:s,className:Re("h-full bg-background",x==="mobile"?"w-[412px] max-w-full border-x border-border":"w-full")},`${w}#${h}`)}),e[54]=x,e[55]=d,e[56]=n,e[57]=s,e[58]=o,e[59]=i,e[60]=c,e[61]=h,e[62]=w,e[63]=f,e[64]=E):E=e[64];let _;return e[65]!==s||e[66]!==T||e[67]!==H||e[68]!==V||e[69]!==E?(_=r.jsxs("section",{"aria-label":s,className:T,children:[H,V,E]}),e[65]=s,e[66]=T,e[67]=H,e[68]=V,e[69]=E,e[70]=_):_=e[70],_}function Ud(t){return t+1}function Kd(t){return t==="desktop"?"mobile":"desktop"}function vt(t){const e=le.c(11),{label:s,children:n,active:a,disabled:c,onClick:d}=t;let o;e[0]!==a||e[1]!==n||e[2]!==c||e[3]!==s||e[4]!==d?(o=r.jsx(et,{asChild:!0,children:r.jsx(Ze,{"aria-label":s,"aria-pressed":a,active:a,disabled:c,onClick:d,children:n})}),e[0]=a,e[1]=n,e[2]=c,e[3]=s,e[4]=d,e[5]=o):o=e[5];let i;e[6]!==s?(i=r.jsx(tt,{children:s}),e[6]=s,e[7]=i):i=e[7];let l;return e[8]!==o||e[9]!==i?(l=r.jsxs(st,{children:[o,i]}),e[8]=o,e[9]=i,e[10]=l):l=e[10],l}const Hd=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},Vd=1e4,Wd=1e4,qd=5e3,Gd=2;function Jd(t,e){return t&&e===0?Wd:Math.min(1e3*2**Math.max(0,e-1),qd)}function Yd(t,e,s){return e?!0:t===!0&&s<Gd}function Qd(t,e){const s=le.c(11),n=Hd,a=Ei();let c;s[0]!==t?(c=Qs.localAppReachable(t??""),s[0]=t,s[1]=c):c=s[1];const d=c;let o;s[2]!==n||s[3]!==a||s[4]!==d||s[5]!==t?(o=async f=>{const{signal:p}=f,y=new AbortController,x=()=>y.abort();p.addEventListener("abort",x);const b=setTimeout(x,Vd),h=await n(t,y.signal).catch(Zd);clearTimeout(b),p.removeEventListener("abort",x);const g=a.getQueryData(d),R=h?0:(g?.failures??0)+1;return{up:Yd(g?.up??null,h,R),failures:R}},s[2]=n,s[3]=a,s[4]=d,s[5]=t,s[6]=o):o=s[6];const i=!!t;let l;s[7]!==d||s[8]!==o||s[9]!==i?(l={queryKey:d,queryFn:o,enabled:i,retry:!1,staleTime:0,gcTime:0,refetchInterval:Xd},s[7]=d,s[8]=o,s[9]=i,s[10]=l):l=s[10];const{data:m}=$r(l);return t?m?.up??null:null}function Xd(t){return t.state.data?Jd(t.state.data.up,t.state.data.failures):!1}function Zd(){return!1}function eu(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 lf(t){const e=le.c(53),{virtualMcpId:s}=t,n=Ee(),a=Hi(s),{connection:c}=ra(s),{activeTask:d,taskId:o,currentBranch:i}=at(),l=kl(o),[m,f]=N.useState(!1),p=Kt(s,i);let y;e[0]!==p||e[1]!==c?(y=c?He(p):null,e[0]=p,e[1]=c,e[2]=y):y=e[2];const x=y,b=Qd(x),h=ya(),g=hl("multi_app_preview");if(xl({threadId:o,sandboxBranch:d?.branch??i,agentHasRepo:$s(a?.metadata),threadHasRepo:$s(l)||$s(d?.metadata)})==="none"&&!c){let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:r.jsx(br,{className:"size-7 text-foreground"})}),e[3]=k):k=e[3];let S;e[4]!==n?(S=n("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=n,e[5]=S):S=e[5];let j;e[6]!==n?(j=n("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=n,e[7]=j):j=e[7];let C,B;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=()=>f(!0),B=r.jsx(br,{className:"size-4"}),e[8]=C,e[9]=B):(C=e[8],B=e[9]);let A;e[10]!==n?(A=n("mainPanelTabs.previewTab.connectGithub"),e[10]=n,e[11]=A):A=e[11];let L;e[12]!==A?(L=r.jsxs(Oe,{onClick:C,children:[B,A]}),e[12]=A,e[13]=L):L=e[13];let F;e[14]!==S||e[15]!==j||e[16]!==L?(F=r.jsx(gl,{className:"h-full",image:k,title:S,description:j,actions:L}),e[14]=S,e[15]=j,e[16]=L,e[17]=F):F=e[17];let O;e[18]!==m?(O=r.jsx(vl,{open:m,onOpenChange:f,mode:"agent"}),e[18]=m,e[19]=O):O=e[19];let $;return e[20]!==O||e[21]!==F?($=r.jsxs(r.Fragment,{children:[F,O]}),e[20]=O,e[21]=F,e[22]=$):$=e[22],$}if(c&&a&&!He(p)){let k;e[23]!==h||e[24]!==p?(k=eu({backend:p,access:h}),e[23]=h,e[24]=p,e[25]=k):k=e[25];let S;e[26]!==c.endpoint?(S=wo(c.endpoint),e[26]=c.endpoint,e[27]=S):S=e[27];let j;return e[28]!==k||e[29]!==S?(j=r.jsx(su,{status:k,host:S}),e[28]=k,e[29]=S,e[30]=j):j=e[30],j}if(x&&b!==!0){let k;e[31]!==n?(k=n("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=n,e[32]=k):k=e[32];let S;e[33]!==x||e[34]!==n?(S=n("mainPanelTabs.previewTab.localAppWaiting.body",{host:tu(x)}),e[33]=x,e[34]=n,e[35]=S):S=e[35];let j;e[36]!==S?(j=r.jsx(va,{text:S}),e[36]=S,e[37]=j):j=e[37];let C;e[38]!==n?(C=n("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=n,e[39]=C):C=e[39];let B;e[40]!==C?(B=r.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:C}),e[40]=C,e[41]=B):B=e[41];let A;return e[42]!==k||e[43]!==j||e[44]!==B?(A=r.jsx(ps,{headingLevel:2,waiting:!0,title:k,lead:j,footer:B}),e[42]=k,e[43]=j,e[44]=B,e[45]=A):A=e[45],A}let v;e[46]!==s?(v=r.jsx($d,{virtualMcpId:s}),e[46]=s,e[47]=v):v=e[47];const w=v;let T;return e[48]!==a||e[49]!==g||e[50]!==w||e[51]!==c?(T=r.jsx(Ni,{children:g&&a&&!c?r.jsx(Bd,{project:a,maxApps:dl,children:w}):w}),e[48]=a,e[49]=g,e[50]=w,e[51]=c,e[52]=T):T=e[52],T}function tu(t){try{return new URL(t).host}catch{return t}}function su(t){const e=le.c(13),{status:s,host:n}=t,a=Ee();if(s.kind==="connected"){let o;e[0]!==a?(o=a("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=a,e[1]=o):o=e[1];let i;e[2]!==a?(i=a("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=a,e[3]=i):i=e[3];let l;return e[4]!==o||e[5]!==i?(l=r.jsx(ps,{headingLevel:2,waiting:!1,title:o,lead:i}),e[4]=o,e[5]=i,e[6]=l):l=e[6],l}let c;e[7]!==n||e[8]!==s?(c=Nl(s,n),e[7]=n,e[8]=s,e[9]=c):c=e[9];let d;return e[10]!==n||e[11]!==c?(d=r.jsx(El,{wait:c,hosts:n}),e[10]=n,e[11]=c,e[12]=d):d=e[12],d}export{El as L,lf as P,ps as S,of as u};
557
+ `)}function ec(t,e,s=320,n=44,a=12){const{x:c,y:d}=t,{width:o,height:i}=e,l=Math.max(a,Math.min(c-s/2,o-s-a)),f=d/i>.68?Math.max(a,d-n-18):Math.min(d+18,i-n-a);return{leftPct:l/o*100,topPct:f/i*100}}function tc(t){const e=le.c(45),{element:s,onDismiss:n}=t,[a,c]=N.useState(""),d=N.useRef(null),{sendMessage:o}=Ci(),{openSidePanel:i}=qo(),l=Ee();let m;e[0]!==s||e[1]!==a||e[2]!==n||e[3]!==i||e[4]!==o?(m=()=>{if(!a.trim())return;const I=Zl(s,a);i(),o({parts:[{type:"text",text:I}]}),n()},e[0]=s,e[1]=a,e[2]=n,e[3]=i,e[4]=o,e[5]=m):m=e[5];const f=m;let p;e[6]!==s.position||e[7]!==s.viewport?(p=ec(s.position,s.viewport),e[6]=s.position,e[7]=s.viewport,e[8]=p):p=e[8];const y=p,x=`${y.leftPct}%`,b=`${y.topPct}%`;let h;e[9]!==x||e[10]!==b?(h={left:x,top:b,width:"320px"},e[9]=x,e[10]=b,e[11]=h):h=e[11];let g;e[12]!==f?(g=I=>{I.preventDefault(),f()},e[12]=f,e[13]=g):g=e[13];let R;e[14]===Symbol.for("react.memo_cache_sentinel")?(R=I=>c(I.target.value),e[14]=R):R=e[14];let v;e[15]!==n?(v=I=>{I.key==="Escape"&&n()},e[15]=n,e[16]=v):v=e[16];let w;e[17]!==l?(w=l("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=l,e[18]=w):w=e[18];let T;e[19]!==a||e[20]!==v||e[21]!==w?(T=r.jsx("input",{ref:d,autoFocus:!0,type:"text",value:a,onChange:R,onKeyDown:v,placeholder:w,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=a,e[20]=v,e[21]=w,e[22]=T):T=e[22];let k;e[23]!==a?(k=a.trim(),e[23]=a,e[24]=k):k=e[24];const S=!k;let j;e[25]!==l?(j=l("sandbox.visualEditorPrompt.sendButton"),e[25]=l,e[26]=j):j=e[26];let C;e[27]!==l?(C=l("sandbox.visualEditorPrompt.sendButton"),e[27]=l,e[28]=C):C=e[28];let B;e[29]!==C?(B=r.jsx("title",{children:C}),e[29]=C,e[30]=B):B=e[30];let A;e[31]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=A):A=e[31];let L;e[32]!==B?(L=r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[B,A]}),e[32]=B,e[33]=L):L=e[33];let F;e[34]!==S||e[35]!==j||e[36]!==L?(F=r.jsx("button",{type:"submit",disabled:S,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:j,children:L}),e[34]=S,e[35]=j,e[36]=L,e[37]=F):F=e[37];let O;e[38]!==T||e[39]!==F||e[40]!==g?(O=r.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:g,children:[T,F]}),e[38]=T,e[39]=F,e[40]=g,e[41]=O):O=e[41];let $;return e[42]!==O||e[43]!==h?($=r.jsx("div",{className:"absolute z-30 pointer-events-none",style:h,children:O}),e[42]=O,e[43]=h,e[44]=$):$=e[44],$}const Pr="site-links",sc=/details?page|\bpdp\b/i,nc=/listingpage|\bplp\b/i;function rc(t,e,s){const n=new Set;for(const o of s)sc.test(o)&&n.add("product"),nc.test(o)&&n.add("category");const a=Ut(en(t)),c=a[a.length-1],d=a[a.length-2];return c?.type==="text"&&c.text==="/p"&&d?.type==="param"&&d.name===e&&n.add("product"),e==="*"&&a.some(o=>o.type==="param"&&o.name==="*")&&n.add("category"),n}const ac=["rosa","preto","pink","black"];function ls(t,e){const s=e.trim();return s?t(s):ac.flatMap(n=>t(n))}function ic(t,e){const s=e.trim(),n=[];/^\d+$/.test(s)&&n.push({resolveType:t,props:{ids:[s]}});const c=s.includes("-")&&!/\s/.test(s)?s.replace(/-+/g," "):s;return n.push({resolveType:t,props:{query:c,count:10}}),n}const wa=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function sn(t){return t.split("/")[0]??""}function oc(t){const e=new Set;for(const s of t){const n=sn(s);wa.has(n)&&e.add(n)}return e}function lc(t,e){const s=sn(t);return!wa.has(s)||e.size===0?!0:e.has(s)}const cc=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>ls(s=>ic(t,s),e),optionsFromPayload:cs},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>ls(s=>[{resolveType:t,props:{props:{search:s,pageSize:10,currentPage:1}}}],e),optionsFromPayload:cs},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>ls(s=>[{resolveType:t,props:{term:s,hitsPerPage:10}}],e),optionsFromPayload:cs},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>ls(s=>[{resolveType:t,props:{query:s,term:s,count:10,hitsPerPage:10}}],e),optionsFromPayload:cs},{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:gc}];function dc(t,e,s=new Set){const n=[...e],a=o=>{const i=[];for(const l of cc){if(l.kind!==o)continue;const m=n.find(f=>l.test(f)&&lc(f,s));m&&i.push({cand:l,resolveType:m})}return i.find(l=>s.has(sn(l.resolveType)))??i[0]},c=(o,i,l)=>({kind:o.kind,id:`${o.kind}:${i}`,resolveType:i,clientFilter:o.clientFilter,isFallback:l,buildRequests:m=>o.buildRequests(i,m),optionsFromPayload:o.optionsFromPayload}),d=[];for(const o of["product","category"]){if(!t.has(o))continue;const i=a(o);i&&d.push(c(i.cand,i.resolveType,!1))}return t.size>0&&d.push(uc(t.has("category")?"category":"product")),d}function uc(t){return{kind:t,id:Pr,resolveType:Pr,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,s)=>wc(e,s)}}function nt(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function fc(t,e,s){const n=new Set,a=new Set,c=d=>{if(Array.isArray(d)){for(const l of d)c(l);return}const o=nt(d);if(!o)return;const i=o.__resolveType;if(typeof i=="string"){if(s(i))n.add(i);else if(i in e&&!a.has(i)){a.add(i);const l=nt(e[i])?.__resolveType;typeof l=="string"&&s(l)&&n.add(i),c(e[i])}}for(const l of Object.values(o))c(l)};return c(t),n}function ka(t){const e=new Set,s=[];for(const n of t)for(const a of n)e.has(a.value)||(e.add(a.value),s.push(a));return s}function Sa(t){try{return decodeURIComponent(t)}catch{return t}}function pc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function mc(t){const e=[];let s="^";for(const n of t)n.type==="text"?s+=pc(n.text):(e.push(n.name),s+=n.name==="*"?"(.+)":"([^/]+)");return{pattern:new RegExp(`${s}$`),order:e}}function Pa(t,e,s){if(typeof t!="string"||!t)return null;let n;try{n=new URL(t,"https://placeholder.invalid").pathname}catch{return null}n=n.replace(/\/+$/,"");const a=Ut(en(e)),{pattern:c,order:d}=mc(a),o=d.indexOf(s);if(o===-1)return null;const i=n.match(c);if(!i)return null;const l=i[o+1]?.replace(/^\/+|\/+$/g,"");return l?Sa(l):null}function cs(t,e){const s=nt(t),n=Array.isArray(t)?t:Array.isArray(s?.products)?s.products:Array.isArray(s?.list)?s.list:[],a=[],c=new Set;for(const d of n){const o=nt(d);if(!o)continue;const i=Pa(o.url,e.template,e.paramName);if(!i||c.has(i))continue;c.add(i);const l=nt(o.isVariantOf),m=typeof l?.name=="string"&&l.name||typeof o.name=="string"&&o.name||i,f=Array.isArray(o.image)?nt(o.image[0]):null,p=typeof f?.url=="string"?f.url:void 0;a.push({value:i,label:m,image:p})}return a}function hc(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?Sa(s):null}function gc(t){const e=[],s=new Set,n=(a,c)=>{const d=nt(a);if(!d)return;const o=typeof d.name=="string"&&d.name?d.name:"",i=o?[...c,o]:c,l=hc(d.url);if(l&&!s.has(l)&&(s.add(l),e.push({value:l,label:i.join(" › ")||l})),Array.isArray(d.children))for(const m of d.children)n(m,i)};if(Array.isArray(t))for(const a of t)n(a,[]);return e}const vc=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 xc(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,s=>s.toUpperCase())}function bc(t){if(typeof t!="string"||!t)return[];const e=[],s=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let n,a=0;for(;(n=s.exec(t))!==null&&a++<5e3;){const c=n[1]??"",d=(n[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:c,text:d})}return e}function yc(t){if(typeof t!="string"||!t)return[];const e=[],s=new Set,n=/"@type":"Product"[\s\S]{0,600}?(?:"url"|\burl):"([^"]+)"[\s\S]{0,300}?(?:"name"|\bname):"([^"]+)"/g,a=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let c,d=0;for(;(c=n.exec(t))!==null&&d++<3e3;){const o=(c[1]??"").replace(/\\\//g,"/");if(!o||s.has(o))continue;s.add(o);const i=t.slice(c.index,c.index+900).match(a)?.[1]?.replace(/\\\//g,"/");e.push({url:o,name:c[2]??"",image:i||void 0})}return e}function wc(t,e){const s=[],n=new Set,a=(c,d,o,i)=>{if(s.length>=200)return;const l=Pa(c,e.template,e.paramName);!l||n.has(l)||e.paramName==="*"&&/(^|\/)p$/.test(l)||o==="category"&&vc.has(l.split("/")[0]??"")||(n.add(l),s.push({value:l,label:d&&d.length<=80?d:xc(l),kind:o,image:i}))};for(const{url:c,name:d,image:o}of yc(t))a(c,d,"product",o);for(const{href:c,text:d}of bc(t))c.startsWith("/")&&!c.startsWith("//")&&a(c,d,"category");return s}function Mt(t,e,s=50){const n=e.trim().toLowerCase();return(n?t.filter(c=>c.label.toLowerCase().includes(n)||c.value.toLowerCase().includes(n)):t).slice(0,s)}const ja=1e4;function kc(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 Sc(t,{resolveType:e,props:s}){const n=await fetch(to(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...s}),signal:AbortSignal.timeout(ja)});if(!n.ok)throw new Error(`Failed to fetch options: ${n.status}`);return n.json()}async function jr(t,e){const s=await fetch(so(t,e),{signal:AbortSignal.timeout(ja)});if(!s.ok)throw new Error(`Failed to fetch page: ${s.status}`);return s.text()}async function Pc(t,e,s){const n=e.optionsFromPayload(await jr(t,"/"),s),a=n.find(d=>d.kind==="category");if(!a)return n;const c=Ve(s.template,{[s.paramName]:a.value});if(c==="/")return n;try{const d=e.optionsFromPayload(await jr(t,c),s).filter(o=>o.kind==="product");return ka([n,d])}catch{return n}}function jc(t,e,s){return Qs.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":s}`)}async function Ec(t,e,s,n){if(e.homepageLinks)return Pc(t,e,n);const a=e.buildRequests?.(s)??[];if(a.length===0)return[];const c=await Promise.allSettled(a.map(o=>Sc(t,o))),d=c.filter(o=>o.status==="fulfilled").map(o=>o.value);if(d.length===0){const o=c.find(i=>i.status==="rejected");throw o?o.reason:new Error("Failed to fetch options")}return ka(d.map(o=>e.optionsFromPayload(o,n)))}function Js(t,e,s,n,a){return{queryKey:jc(t,e,s),queryFn:()=>Ec(t,e,s,n),enabled:a,staleTime:6e4,retry:1}}function zt(t){const e=le.c(16),{heading:s,iconKind:n,options:a,template:c,paramName:d,keyPrefix:o,onSelect:i}=t;if(a.length===0)return null;let l;if(e[0]!==n||e[1]!==o||e[2]!==i||e[3]!==a||e[4]!==d||e[5]!==c){let f;e[7]!==n||e[8]!==o||e[9]!==i||e[10]!==d||e[11]!==c?(f=p=>r.jsxs(gt,{value:`${o}:${p.value}`,className:"gap-3 py-2",onSelect:()=>i(p.value),children:[n==="product"&&r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center overflow-hidden rounded-md border border-border bg-muted",children:p.image?r.jsx("img",{src:p.image,alt:"",referrerPolicy:"no-referrer",className:"h-full w-full object-cover"}):r.jsx(Ir,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:p.label}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:Ve(c,{[d]:p.value})})]})]},`${o}:${p.value}`),e[7]=n,e[8]=o,e[9]=i,e[10]=d,e[11]=c,e[12]=f):f=e[12],l=a.map(f),e[0]=n,e[1]=o,e[2]=i,e[3]=a,e[4]=d,e[5]=c,e[6]=l}else l=e[6];let m;return e[13]!==s||e[14]!==l?(m=r.jsx(ht,{heading:s,children:l}),e[13]=s,e[14]=l,e[15]=m):m=e[15],m}function Er(t){const e=le.c(2),{text:s}=t;let n;return e[0]!==s?(n=r.jsx("div",{className:"px-2 py-2 text-xs text-muted-foreground",children:s}),e[0]=s,e[1]=n):n=e[1],n}function Nc(t){const e=le.c(52),{sources:s,template:n,paramName:a,value:c,sandboxRef:d,onCommit:o}=t,i=Ee(),[l,m]=N.useState(!1),[f,p]=N.useState(""),[y,x]=N.useState(""),b=N.useRef(null),h=a==="*"?i("sandbox.preview.catchAllParamLabel"):`:${a}`,g=kc(i),v=[...new Set(s.map(ne=>g[ne.kind].noun))].join(" or ");let w;e[0]!==i||e[1]!==v?(w=i("sandbox.pathParamPickerChip.searchPlaceholder",{options:v}),e[0]=i,e[1]=v,e[2]=w):w=e[2];const T=w,k={template:n,paramName:a};let S;e[3]!==f?(S=(ne,de)=>({source:ne,query:de,options:ne.clientFilter?Mt(de.data??[],f):de.data??[]}),e[3]=f,e[4]=S):S=e[4];const j=S,C=s.filter(Fc),B=s.filter(Oc),A=Ws({queries:C.map(ne=>Js(d,ne,y,k,l))});let L;e[5]!==A||e[6]!==j?(L=(ne,de)=>j(ne,A[de]),e[5]=A,e[6]=j,e[7]=L):L=e[7];const F=C.map(L),O=F.length===0||F.every(_c),$=Ws({queries:B.map(ne=>Js(d,ne,y,k,l&&O))});let I;e[8]!==$||e[9]!==j?(I=(ne,de)=>j(ne,$[de]),e[8]=$,e[9]=j,e[10]=I):I=e[10];const G=B.map(I),W=O?G:F,Y=W.length===1&&W[0]?.source.homepageLinks?W[0]:null,Q=Y&&!Y.query.isLoading&&!Y.query.isError?Y?.query.data??[]:[],K=Mt(Q.filter(Ac),f),ee=Mt(Q.filter(Lc),f),H=K.length>0&&ee.length>0,J=ne=>{m(ne),b.current&&clearTimeout(b.current),p(ne?c:""),x(ne?c:"")};let V;e[11]===Symbol.for("react.memo_cache_sentinel")?(V=ne=>{p(ne),b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{x(ne)},300)},e[11]=V):V=e[11];const E=V,_=ne=>{o(ne),J(!1)},D=ia(f),U=Ve(n,{[a]:D}),X=_r,se=Ar,z="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",Z=Rc;let re;e[12]!==h||e[13]!==i?(re=i("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:h}),e[12]=h,e[13]=i,e[14]=re):re=e[14];let ie;e[15]!==re?(ie=r.jsx(Or,{className:"sr-only",children:r.jsx(Fr,{children:re})}),e[15]=re,e[16]=ie):ie=e[16];let he;e[17]===Symbol.for("react.memo_cache_sentinel")?(he=r.jsx(Ir,{size:16,className:"shrink-0 text-foreground"}),e[17]=he):he=e[17];let pe;e[18]!==i?(pe=i("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=i,e[19]=pe):pe=e[19];let be;e[20]!==h?(be=r.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:h}),e[20]=h,e[21]=be):be=e[21];let ge;e[22]!==pe||e[23]!==be?(ge=r.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[he,r.jsxs("span",{className:"text-sm font-medium text-foreground",children:[pe," ",be]})]}),e[22]=pe,e[23]=be,e[24]=ge):ge=e[24];const ve=Jr,Se=!1,fe="min-h-0 flex-1";let ce;e[25]!==T||e[26]!==f?(ce=r.jsx(Yr,{autoFocus:!0,placeholder:T,value:f,onValueChange:E}),e[25]=T,e[26]=f,e[27]=ce):ce=e[27];const Le=Gr,ze="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Ie;e[28]!==i?(Ie=i("sandbox.pathParamPickerChip.noResults"),e[28]=i,e[29]=Ie):Ie=e[29];let Be;e[30]!==Ie?(Be=r.jsx(Qr,{children:Ie}),e[30]=Ie,e[31]=Be):Be=e[31];const bt=D&&r.jsx(ht,{className:"shrink-0",children:r.jsxs(gt,{value:`__raw__:${D}`,className:"gap-3 py-2",onSelect:()=>_(D),children:[r.jsx("span",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md border border-dashed border-border bg-muted",children:r.jsx(Yo,{size:14,className:"text-muted-foreground"})}),r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:i("sandbox.pathParamPickerChip.useRawValue",{rawTerm:D,paramLabel:h})}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:U})]})]})}),me=H?r.jsxs("div",{className:"flex min-h-0 flex-1",children:[r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto border-r border-border",children:r.jsx(zt,{heading:g.category.heading,iconKind:"category",options:K,template:n,paramName:a,keyPrefix:`${Y?.source.id}:cat`,onSelect:_})}),r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r.jsx(zt,{heading:g.product.heading,iconKind:"product",options:ee,template:n,paramName:a,keyPrefix:`${Y?.source.id}:prod`,onSelect:_})})]}):r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:W.map(ne=>{const{source:de,query:We,options:yt}=ne,{noun:qe}=g[de.kind];if(We.isLoading)return r.jsx(Er,{text:i("sandbox.pathParamPickerChip.loading",{noun:qe})},de.id);if(We.isError)return r.jsx(Er,{text:i("sandbox.pathParamPickerChip.couldNotLoad")},de.id);if(de.homepageLinks){const Ht=We.data??[];return r.jsxs(N.Fragment,{children:[r.jsx(zt,{heading:g.category.heading,iconKind:"category",options:Mt(Ht.filter(Tc),f),template:n,paramName:a,keyPrefix:`${de.id}:cat`,onSelect:_}),r.jsx(zt,{heading:g.product.heading,iconKind:"product",options:Mt(Ht.filter(Cc),f),template:n,paramName:a,keyPrefix:`${de.id}:prod`,onSelect:_})]},de.id)}return r.jsx(zt,{heading:W.length>1?g[de.kind].heading:void 0,iconKind:de.kind,options:yt,template:n,paramName:a,keyPrefix:de.id,onSelect:_},de.id)})});let Fe;e[32]!==Le||e[33]!==Be||e[34]!==bt||e[35]!==me?(Fe=r.jsxs(Le,{className:ze,children:[Be,bt,me]}),e[32]=Le,e[33]=Be,e[34]=bt,e[35]=me,e[36]=Fe):Fe=e[36];let xe;e[37]!==ve||e[38]!==ce||e[39]!==Fe?(xe=r.jsxs(ve,{shouldFilter:Se,className:fe,children:[ce,Fe]}),e[37]=ve,e[38]=ce,e[39]=Fe,e[40]=xe):xe=e[40];let Ue;e[41]!==se||e[42]!==ie||e[43]!==ge||e[44]!==xe||e[45]!==Z?(Ue=r.jsxs(se,{className:z,onClick:Z,children:[ie,ge,xe]}),e[41]=se,e[42]=ie,e[43]=ge,e[44]=xe,e[45]=Z,e[46]=Ue):Ue=e[46];let Ae;return e[47]!==X||e[48]!==J||e[49]!==l||e[50]!==Ue?(Ae=r.jsx(X,{open:l,onOpenChange:J,children:Ue}),e[47]=X,e[48]=J,e[49]=l,e[50]=Ue,e[51]=Ae):Ae=e[51],r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",title:i("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:h}),className:"max-w-64 shrink-0 cursor-pointer truncate rounded-lg bg-special/15 px-1 py-0.5 text-xs text-special hover:bg-special/25",onClick:ne=>{ne.stopPropagation(),J(!0)},children:c||h}),Ae]})}function Cc(t){return t.kind==="product"}function Tc(t){return t.kind!=="product"}function Rc(t){return t.stopPropagation()}function Lc(t){return t.kind==="product"}function Ac(t){return t.kind!=="product"}function _c(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Oc(t){return t.isFallback}function Fc(t){return!t.isFallback}function Dc(t){const e=le.c(8),{sources:s,template:n,paramName:a,sandboxRef:c,onFill:d}=t;let o,i;if(e[0]!==a||e[1]!==c||e[2]!==s||e[3]!==n){const y={template:n,paramName:a},x=s.filter($c);i=Ws,o=x.map(b=>Js(c,b,"",y,!0)),e[0]=a,e[1]=c,e[2]=s,e[3]=n,e[4]=o,e[5]=i}else o=e[4],i=e[5];let l;e[6]!==o?(l={queries:o},e[6]=o,e[7]=l):l=e[7];const m=i(l),[f,p]=N.useState(!1);if(!f)for(const y of m){if(y.isLoading)break;const x=y.data?.[0];if(x){p(!0),queueMicrotask(()=>d(x.value));break}}return null}function $c(t){return!t.isFallback}function Bc(t){const e=le.c(31),{name:s,value:n,onCommit:a}=t,c=Ee(),[d,o]=N.useState(n),[i,l]=N.useState(!1),m=N.useRef(!1);let f;e[0]!==s||e[1]!==c?(f=s==="*"?c("sandbox.preview.catchAllParamLabel"):`:${s}`,e[0]=s,e[1]=c,e[2]=f):f=e[2];const p=f,y=d||p;let x;e[3]!==y?(x=r.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:y}),e[3]=y,e[4]=x):x=e[4];let b;e[5]!==p||e[6]!==c?(b=c("sandbox.preview.valueForParam",{label:p}),e[5]=p,e[6]=c,e[7]=b):b=e[7];let h,g;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=j=>o(j.target.value),g=()=>l(!0),e[8]=h,e[9]=g):(h=e[8],g=e[9]);let R;e[10]!==n?(R=j=>{j.key==="Enter"&&j.currentTarget.blur(),j.key==="Escape"&&(m.current=!0,o(n),j.currentTarget.blur())},e[10]=n,e[11]=R):R=e[11];let v;e[12]!==d||e[13]!==a||e[14]!==n?(v=()=>{if(l(!1),m.current){m.current=!1;return}const j=ia(d);o(j),j!==n&&a(j)},e[12]=d,e[13]=a,e[14]=n,e[15]=v):v=e[15];let w;e[16]!==d||e[17]!==p||e[18]!==b||e[19]!==R||e[20]!==v?(w=r.jsx("input",{type:"text",value:d,placeholder:p,title:b,spellCheck:!1,className:"absolute inset-0 rounded-sm bg-special/15 px-1 text-xs text-special outline-none placeholder:text-special/60 focus:bg-special/25",onClick:Mc,onChange:h,onFocus:g,onKeyDown:R,onBlur:v}),e[16]=d,e[17]=p,e[18]=b,e[19]=R,e[20]=v,e[21]=w):w=e[21];let T;e[22]!==x||e[23]!==w?(T=r.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[x,w]}),e[22]=x,e[23]=w,e[24]=T):T=e[24];let k;e[25]!==i||e[26]!==c?(k=i&&r.jsxs("span",{className:"pointer-events-none ml-1.5 flex shrink-0 items-center gap-1 whitespace-nowrap rounded-sm border border-border bg-muted px-1 py-0.5 text-2xs text-muted-foreground",children:[r.jsx(Fi,{size:10}),c("sandbox.preview.enterToGo")]}),e[25]=i,e[26]=c,e[27]=k):k=e[27];let S;return e[28]!==k||e[29]!==T?(S=r.jsxs(r.Fragment,{children:[T,k]}),e[28]=k,e[29]=T,e[30]=S):S=e[30],S}function Mc(t){return t.stopPropagation()}function zc(t){if(t.activeGlobalSectionName)return t.activeGlobalSectionName;const e=t.iframeBase;if(!e)return t.noServerLabel;try{const s=new URL(e),n=t.resolvedPath==="/"?"":t.resolvedPath;return`${s.host}${n}`}catch{return e}}function Ic(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function Uc(t){return t.showPreviewToolbar&&(t.contentEditingEnabled||t.hasFrameworkRoutes)}function Kc(t){return t.v8?null:t.production||t.localPreview?{type:"editor::inject",args:{script:t.script}}:{type:"visual-editor::activate",script:t.script}}function Hc(t){return t.v8?null:{type:"visual-editor::activate",script:t.script}}class Ea extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function Vc(t,e){if(t)return t;const s=await e?.().catch(()=>null);if(!s)throw new Ea;return s}async function Wc(t,e,s){return s?pr(t,e,await Vc(s.meta,s.loadMeta)):pr(t,e)}function qc(t){const e=le.c(5);let s;e[0]!==t?(s=t??{orgSlug:"",virtualMcpId:"",branch:""},e[0]=t,e[1]=s):s=e[1];const n=ca(s);let a;return e[2]!==t||e[3]!==n?(a={mutationFn:async c=>{const{name:d,path:o,template:i,schema:l}=c;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const m=Bo(d),f=i?{...i,name:d,path:o}:await Wc(d,o,l);return await n.mutateAsync({blockKey:m,data:f}),{key:m,name:d,path:o}}},e[2]=t,e[3]=n,e[4]=a):a=e[4],yi(a)}function Gc(t){const e=le.c(89),{open:s,onOpenChange:n,isPending:a,error:c,templates:d,onSubmit:o}=t,i=a===void 0?!1:a,l=Ee();let m;e[0]!==l?(m=l("sectionsEditor.createPageModal.defaultPageName"),e[0]=l,e[1]=m):m=e[1];const[f,p]=N.useState(m);let y;e[2]!==l?(y=l("sectionsEditor.createPageModal.defaultPagePath"),e[2]=l,e[3]=y):y=e[3];const[x,b]=N.useState(y),[h,g]=N.useState(Os),[R,v]=N.useState(null),[w,T]=N.useState(s);s!==w&&(T(s),s&&(p(l("sectionsEditor.createPageModal.defaultPageName")),b(l("sectionsEditor.createPageModal.defaultPagePath")),g(Os),v(null)));const k=!!d?.length;let S;e[4]!==i||e[5]!==n?(S=pe=>{!pe&&!i&&(v(null),n(!1))},e[4]=i,e[5]=n,e[6]=S):S=e[6];const j=S;let C;e[7]!==i||e[8]!==f||e[9]!==o||e[10]!==x||e[11]!==k||e[12]!==h?(C=async pe=>{pe.preventDefault();const be=f.trim(),ge=x.trim();if(!be||!ge||i)return;const ve=oa(ge);if(ve){v(ve);return}v(null),await o({name:be,path:ge,templateKey:k&&h!==Os?h:null})},e[7]=i,e[8]=f,e[9]=o,e[10]=x,e[11]=k,e[12]=h,e[13]=C):C=e[13];const B=C,A=R??c;let L;e[14]!==l?(L=l("sectionsEditor.createPageModal.title"),e[14]=l,e[15]=L):L=e[15];let F;e[16]!==L?(F=r.jsx(Or,{children:r.jsx(Fr,{children:L})}),e[16]=L,e[17]=F):F=e[17];let O;e[18]!==l?(O=l("sectionsEditor.createPageModal.nameLabel"),e[18]=l,e[19]=O):O=e[19];let $;e[20]!==O?($=r.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:O}),e[20]=O,e[21]=$):$=e[21];let I;e[22]===Symbol.for("react.memo_cache_sentinel")?(I=pe=>p(pe.target.value),e[22]=I):I=e[22];let G;e[23]!==l?(G=l("sectionsEditor.createPageModal.namePlaceholder"),e[23]=l,e[24]=G):G=e[24];let W;e[25]!==i||e[26]!==f||e[27]!==G?(W=r.jsx(Us,{id:"new-page-name",value:f,onChange:I,placeholder:G,autoFocus:!0,disabled:i}),e[25]=i,e[26]=f,e[27]=G,e[28]=W):W=e[28];let Y;e[29]!==W||e[30]!==$?(Y=r.jsxs("div",{className:"space-y-1.5",children:[$,W]}),e[29]=W,e[30]=$,e[31]=Y):Y=e[31];let q;e[32]!==l?(q=l("sectionsEditor.createPageModal.pathLabel"),e[32]=l,e[33]=q):q=e[33];let Q;e[34]!==q?(Q=r.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:q}),e[34]=q,e[35]=Q):Q=e[35];let K;e[36]===Symbol.for("react.memo_cache_sentinel")?(K=pe=>b(pe.target.value),e[36]=K):K=e[36];let ee;e[37]!==l?(ee=l("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=l,e[38]=ee):ee=e[38];let H;e[39]!==i||e[40]!==x||e[41]!==ee?(H=r.jsx(Us,{id:"new-page-path",value:x,onChange:K,placeholder:ee,disabled:i}),e[39]=i,e[40]=x,e[41]=ee,e[42]=H):H=e[42];let J;e[43]!==Q||e[44]!==H?(J=r.jsxs("div",{className:"space-y-1.5",children:[Q,H]}),e[43]=Q,e[44]=H,e[45]=J):J=e[45];let V;e[46]!==i||e[47]!==k||e[48]!==l||e[49]!==h||e[50]!==d?(V=k&&r.jsxs("div",{className:"space-y-1.5",children:[r.jsx("label",{htmlFor:"new-page-template",className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.createPageModal.templateLabel")}),r.jsx(Mo,{id:"new-page-template",value:h,onChange:g,templates:d??[],disabled:i})]}),e[46]=i,e[47]=k,e[48]=l,e[49]=h,e[50]=d,e[51]=V):V=e[51];let E;e[52]!==A?(E=A&&r.jsx("p",{className:"text-xs text-destructive",children:A}),e[52]=A,e[53]=E):E=e[53];let _;e[54]!==Y||e[55]!==J||e[56]!==V||e[57]!==E?(_=r.jsxs("div",{className:"space-y-4 py-4",children:[Y,J,V,E]}),e[54]=Y,e[55]=J,e[56]=V,e[57]=E,e[58]=_):_=e[58];let D;e[59]!==n?(D=()=>n(!1),e[59]=n,e[60]=D):D=e[60];let U;e[61]!==l?(U=l("sectionsEditor.createPageModal.cancelButton"),e[61]=l,e[62]=U):U=e[62];let X;e[63]!==i||e[64]!==D||e[65]!==U?(X=r.jsx(Oe,{type:"button",variant:"outline",onClick:D,disabled:i,children:U}),e[63]=i,e[64]=D,e[65]=U,e[66]=X):X=e[66];let se;e[67]!==i||e[68]!==f||e[69]!==x?(se=!f.trim()||!x.trim()||i,e[67]=i,e[68]=f,e[69]=x,e[70]=se):se=e[70];let z;e[71]!==i||e[72]!==l?(z=i?r.jsxs(r.Fragment,{children:[r.jsx(rt,{className:"size-3.5"}),l("sectionsEditor.createPageModal.creatingButton")]}):l("sectionsEditor.createPageModal.createButton"),e[71]=i,e[72]=l,e[73]=z):z=e[73];let Z;e[74]!==se||e[75]!==z?(Z=r.jsx(Oe,{type:"submit",disabled:se,children:z}),e[74]=se,e[75]=z,e[76]=Z):Z=e[76];let re;e[77]!==X||e[78]!==Z?(re=r.jsxs(wi,{children:[X,Z]}),e[77]=X,e[78]=Z,e[79]=re):re=e[79];let ie;e[80]!==B||e[81]!==_||e[82]!==re||e[83]!==F?(ie=r.jsx(Ar,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:B,children:[F,_,re]})}),e[80]=B,e[81]=_,e[82]=re,e[83]=F,e[84]=ie):ie=e[84];let he;return e[85]!==j||e[86]!==s||e[87]!==ie?(he=r.jsx(_r,{open:s,onOpenChange:j,children:ie}),e[85]=j,e[86]=s,e[87]=ie,e[88]=he):he=e[88],he}function Jc(t){const e=le.c(41),{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:c,meta:d,decofile:o,blockKey:i}=t,l=Ee();let m;e[0]!==a||e[1]!==s||e[2]!==n?(m={orgSlug:s,virtualMcpId:n,branch:a},e[0]=a,e[1]=s,e[2]=n,e[3]=m):m=e[3];const f=ca(m);let p;e[4]!==f?(p=j=>f.mutate(j),e[4]=f,e[5]=p):p=e[5];let y;e[6]!==o||e[7]!==f.v8||e[8]!==p?(y=Qo(p,o,f.v8),e[6]=o,e[7]=f.v8,e[8]=p,e[9]=y):y=e[9];const x=y;let b;e[10]!==i||e[11]!==o?(b=zo(o,i),e[10]=i,e[11]=o,e[12]=b):b=e[12];const{resolveType:h,props:g,title:R}=b;if(!h){let j;e[13]!==l?(j=l("sandbox.preview.loaderNoLongerExists"),e[13]=l,e[14]=j):j=e[14];let C;return e[15]!==j?(C=r.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:j}),e[15]=j,e[16]=C):C=e[16],C}const v=`loader:${i}`,w=`loader:${i}`;let T;e[17]!==i||e[18]!==h||e[19]!==R?(T={mode:"saved",blockKey:i,resolveType:h,title:R},e[17]=i,e[18]=h,e[19]=R,e[20]=T):T=e[20];let k;e[21]!==a||e[22]!==o||e[23]!==d||e[24]!==s||e[25]!==c||e[26]!==g||e[27]!==f.isPending||e[28]!==x||e[29]!==w||e[30]!==T||e[31]!==n?(k=r.jsx(Io,{orgSlug:s,virtualMcpId:n,branch:a,previewUrl:c,meta:d,decofile:o,kind:"loaders",target:T,initialValue:g,isCreating:f.isPending,onCreate:Yc,onSaveReferencedBlock:x,showRun:!1},w),e[21]=a,e[22]=o,e[23]=d,e[24]=s,e[25]=c,e[26]=g,e[27]=f.isPending,e[28]=x,e[29]=w,e[30]=T,e[31]=n,e[32]=k):k=e[32];let S;return e[33]!==i||e[34]!==a||e[35]!==o||e[36]!==s||e[37]!==v||e[38]!==k||e[39]!==n?(S=r.jsx(Xo,{listing:o,orgSlug:s,virtualMcpId:n,branch:a,blockKey:i,present:void 0,children:k},v),e[33]=i,e[34]=a,e[35]=o,e[36]=s,e[37]=v,e[38]=k,e[39]=n,e[40]=S):S=e[40],S}async function Yc(){}function Qc(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Nr(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:Qc(t.error)}}function Xc(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 Zc(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=Xc(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 ed=N.lazy(()=>ki(()=>import("./sections-editor-DC8FnTKc.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161])).then(t=>({default:t.SectionsEditor})));function Cr(t){const e=le.c(62),{virtualMcpId:s,externalSelection:n,onSectionPicked:a,onViewJsonFile:c}=t,d=n===void 0?null:n,{org:o}=ms(),{currentBranch:i,taskId:l}=at(),m=tn(),f=xt(),p=ua(),y=m.lifecycle.phase==="running",x=f.previewUrl;let b;e[0]!==i||e[1]!==o||e[2]!==x||e[3]!==l||e[4]!==s?(b=i?{orgSlug:o.slug,virtualMcpId:s,branch:i,threadId:l??null,previewUrl:x}:null,e[0]=i,e[1]=o,e[2]=x,e[3]=l,e[4]=s,e[5]=b):b=e[5];const h=b,g=Kt(s,i);let R;e[6]!==y?(R={fetchEnabled:y},e[6]=y,e[7]=R):R=e[7];const v=hs(h,R),w=Zr(h);let T;e[8]!==y?(T={fetchEnabled:y},e[8]=y,e[9]=T):T=e[9];const k=la(h,T),S=Zc({lifecyclePhase:m.lifecycle.phase,decofile:Nr(v),meta:Nr(k),hasEditableContent:So(v.data,k.data),fastPreviewActive:Xr(s).runtime==="cms"||Xe(g)}),j=Xs()===void 0,C=td;if(Po(g)){let E;return e[10]===Symbol.for("react.memo_cache_sentinel")?(E=C(r.jsx(Eo,{})),e[10]=E):E=e[10],E}if(g.kind==="pending"&&g.retrying){let E;return e[11]!==g?(E=C(r.jsx(No,{backend:g})),e[11]=g,e[12]=E):E=e[12],E}if(S.kind==="loading"||j){let E;return e[13]===Symbol.for("react.memo_cache_sentinel")?(E=C(r.jsx(Si,{})),e[13]=E):E=e[13],E}if(v.data&&no(k.data)){const E=p.state.target,_=E?.kind==="page"||E?.kind==="section"?E.key:null,D=g.kind==="legacy"?_??"":`${w}:${_??""}`,U=i??"";let X;return e[14]!==v.data||e[15]!==_||e[16]!==o.slug||e[17]!==D||e[18]!==U||e[19]!==s?(X=C(r.jsx(Uo,{orgSlug:o.slug,virtualMcpId:s,branch:U,decofile:v.data,initialKey:_,compact:!0},D)),e[14]=v.data,e[15]=_,e[16]=o.slug,e[17]=D,e[18]=U,e[19]=s,e[20]=X):X=e[20],X}if(S.kind==="empty"){let E;return e[21]===Symbol.for("react.memo_cache_sentinel")?(E=C(r.jsx(Co,{})),e[21]=E):E=e[21],E}if(S.kind==="error"){let E;e[22]!==v||e[23]!==f||e[24]!==k||e[25]!==S.source?(E=()=>{if(S.source==="sandbox"){f.retry();return}Promise.all([v.refetch(),k.refetch()])},e[22]=v,e[23]=f,e[24]=k,e[25]=S.source,e[26]=E):E=e[26];const _=E;let D;return e[27]!==_||e[28]!==S.source?(D=C(r.jsx(jo,{source:S.source,onRetry:_})),e[27]=_,e[28]=S.source,e[29]=D):D=e[29],D}let B;e[30]===Symbol.for("react.memo_cache_sentinel")?(B=E=>C(r.jsx("div",{className:"h-full min-h-0",children:E})),e[30]=B):B=e[30];const A=B,L=p.state.target;if(L?.kind==="loader"&&v.data&&k.data){const E=g.kind==="legacy"?void 0:w,_=i??"",D=x??null;let U;return e[31]!==v.data||e[32]!==k.data||e[33]!==o.slug||e[34]!==E||e[35]!==_||e[36]!==D||e[37]!==L.key||e[38]!==s?(U=A(r.jsx(Jc,{orgSlug:o.slug,virtualMcpId:s,branch:_,previewUrl:D,meta:k.data,decofile:v.data,blockKey:L.key},E)),e[31]=v.data,e[32]=k.data,e[33]=o.slug,e[34]=E,e[35]=_,e[36]=D,e[37]=L.key,e[38]=s,e[39]=U):U=e[39],U}let F;e[40]!==i||e[41]!==o.slug||e[42]!==L||e[43]!==s?(F=L||!i?null:Mr(zr(o.slug,s,i)),e[40]=i,e[41]=o.slug,e[42]=L,e[43]=s,e[44]=F):F=e[44];const O=F;let $="/",I=null,G=null;L?.kind==="page"?($=L.path,I=L.key):L?.kind==="section"?G=L.key:O&&($=O.path,I=O.pageKey);const W=I?`page:${I}`:G?`section:${G}`:`path:${$}`;let Y;e[45]===Symbol.for("react.memo_cache_sentinel")?(Y=r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(rt,{className:"size-5 text-muted-foreground"})}),e[45]=Y):Y=e[45];const q=g.kind==="legacy"?W:`${w}:${W}`,Q=i??"",K=x??void 0,ee=G?null:d,H=G?void 0:a,J=!!I&&p.state.editSeoPageKey===I;let V;return e[46]!==G||e[47]!==I||e[48]!==$||e[49]!==c||e[50]!==o.slug||e[51]!==K||e[52]!==ee||e[53]!==H||e[54]!==J||e[55]!==q||e[56]!==Q||e[57]!==s||e[58]!==p.consumeEditSeo||e[59]!==p.setFocusedBlock||e[60]!==p.setVariantOverride?(V=A(r.jsx(N.Suspense,{fallback:Y,children:r.jsx(ed,{orgSlug:o.slug,virtualMcpId:s,branch:Q,previewReady:!0,previewUrl:K,currentPath:$,activePageBlockKey:I,activeGlobalBlockKey:G,externalSelection:ee,onSectionPicked:H,initialEditSeo:J,onExitSeo:p.consumeEditSeo,onVariantPreviewOverride:p.setVariantOverride,onFocusedBlockChange:p.setFocusedBlock,onViewJsonFile:c},q)})),e[46]=G,e[47]=I,e[48]=$,e[49]=c,e[50]=o.slug,e[51]=K,e[52]=ee,e[53]=H,e[54]=J,e[55]=q,e[56]=Q,e[57]=s,e[58]=p.consumeEditSeo,e[59]=p.setFocusedBlock,e[60]=p.setVariantOverride,e[61]=V):V=e[61],V}function td(t){return r.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function sd(t){const e=le.c(51),{virtualMcpId:s,pageKey:n,onClose:a,ref:c}=t,d=Ee(),o=Xs(),i=o===!0,l=Zs(s);let m;e[0]!==l||e[1]!==n?(m=ea(l,ha(n)),e[0]=l,e[1]=n,e[2]=m):m=e[2];const f=m,{org:p}=ms(),{currentBranch:y,taskId:x}=at(),h=xt().previewUrl;let g;e[3]!==y||e[4]!==p.slug||e[5]!==h||e[6]!==x||e[7]!==s?(g=y?{orgSlug:p.slug,virtualMcpId:s,branch:y,threadId:x??null,previewUrl:h}:null,e[3]=y,e[4]=p.slug,e[5]=h,e[6]=x,e[7]=s,e[8]=g):g=e[8];const v=hs(g),w=y??"";let T;e[9]!==p.slug||e[10]!==w||e[11]!==s?(T={orgSlug:p.slug,virtualMcpId:s,branch:w},e[9]=p.slug,e[10]=w,e[11]=s,e[12]=T):T=e[12];let k;e[13]===Symbol.for("react.memo_cache_sentinel")?(k={holdsCopy:!0},e[13]=k):k=e[13];const{save:S,flush:j,hold:C}=da(T,k),B=y??"";let A;e[14]!==p.slug||e[15]!==B||e[16]!==s?(A=pa({orgSlug:p.slug,virtualMcpId:s,branch:B}),e[14]=p.slug,e[15]=B,e[16]=s,e[17]=A):A=e[17];const L=ma(A);let F;e[18]!==n||e[19]!==L?(F=L(n),e[18]=n,e[19]=L,e[20]=F):F=e[20];const O=F;let $;e[21]!==O||e[22]!==n?($={pageKey:n,copyEpoch:O},e[21]=O,e[22]=n,e[23]=$):$=e[23];const[I,G]=N.useState($);(I.pageKey!==n||I.copyEpoch!==O)&&(G({pageKey:n,copyEpoch:O}),C(n));const W=v.data?.[n],Y=v.data===void 0&&v.isLoading||o===void 0,q=v.data!==void 0&&W===void 0,Q=!y||q||Y;let K;e[24]!==W?(K=W===void 0?"":JSON.stringify(W,null,2),e[24]=W,e[25]=K):K=e[25];const ee=K;let H;e[26]!==n||e[27]!==Q||e[28]!==S?(H=U=>{if(Q)return;let X;try{X=JSON.parse(U)}catch{return}X===null||typeof X!="object"||Array.isArray(X)||S(n,X)},e[26]=n,e[27]=Q,e[28]=S,e[29]=H):H=e[29];const J=H;let V;e[30]!==j?(V=()=>({flush:j}),e[30]=j,e[31]=V):V=e[31],N.useImperativeHandle(c,V);let E;e[32]!==f||e[33]!==i||e[34]!==a||e[35]!==d?(E=i?r.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:r.jsx("span",{title:f,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f})}):r.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:d("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(Oe,{variant:"ghost",size:"icon-sm",onClick:a,"aria-label":d("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Dr,{size:14})})]}),e[32]=f,e[33]=i,e[34]=a,e[35]=d,e[36]=E):E=e[36];let _;e[37]!==O||e[38]!==v.data||e[39]!==j||e[40]!==ee||e[41]!==Y||e[42]!==q||e[43]!==n||e[44]!==Q||e[45]!==J||e[46]!==d?(_=Y?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(rt,{className:"size-5 text-muted-foreground"})}):q?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",d("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(fa,{code:ee,language:"json",readOnly:Q,height:"100%",onChange:U=>J(U??""),onSave:U=>{J(U),j()}},`${n}:${v.data===void 0?"loading":"ready"}:${O}`)}),e[37]=O,e[38]=v.data,e[39]=j,e[40]=ee,e[41]=Y,e[42]=q,e[43]=n,e[44]=Q,e[45]=J,e[46]=d,e[47]=_):_=e[47];let D;return e[48]!==E||e[49]!==_?(D=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[E,_]}),e[48]=E,e[49]=_,e[50]=D):D=e[50],D}function Tr(t){const e=le.c(3),{currentBranch:s}=at(),n=Kt(t.virtualMcpId,s);let a;return e[0]!==n.kind||e[1]!==t?(a=n.kind==="legacy"?r.jsx(sd,{...t}):r.jsx(nd,{...t}),e[0]=n.kind,e[1]=t,e[2]=a):a=e[2],a}function nd(t){const e=le.c(61),{virtualMcpId:s,pageKey:n,onClose:a,ref:c}=t,d=Ee(),o=Xs(),i=o===!0,l=Zs(s);let m;e[0]!==l||e[1]!==n?(m=ea(l,ha(n)),e[0]=l,e[1]=n,e[2]=m):m=e[2];const f=m,{org:p}=ms(),{currentBranch:y,taskId:x}=at(),h=xt().previewUrl;let g;e[3]!==y||e[4]!==p.slug||e[5]!==h||e[6]!==x||e[7]!==s?(g=y?{orgSlug:p.slug,virtualMcpId:s,branch:y,threadId:x??null,previewUrl:h}:null,e[3]=y,e[4]=p.slug,e[5]=h,e[6]=x,e[7]=s,e[8]=g):g=e[8];const R=g,v=hs(R);let w;e[9]!==n?(w=[n],e[9]=n,e[10]=w):w=e[10];let T;e[11]!==v.data?(T={listing:v.data},e[11]=v.data,e[12]=T):T=e[12];const k=ta(R,w,T),S=y??"";let j;e[13]!==p.slug||e[14]!==S||e[15]!==s?(j={orgSlug:p.slug,virtualMcpId:s,branch:S},e[13]=p.slug,e[14]=S,e[15]=s,e[16]=j):j=e[16];let C;e[17]===Symbol.for("react.memo_cache_sentinel")?(C={holdsCopy:!0},e[17]=C):C=e[17];const{save:B,flush:A,hold:L}=da(j,C),F=y??"";let O;e[18]!==p.slug||e[19]!==F||e[20]!==s?(O=pa({orgSlug:p.slug,virtualMcpId:s,branch:F}),e[18]=p.slug,e[19]=F,e[20]=s,e[21]=O):O=e[21];const $=ma(O);let I;e[22]!==n||e[23]!==$?(I=$(n),e[22]=n,e[23]=$,e[24]=I):I=e[24];const G=I,W=v.data?.[n];let Y;e[25]!==k.ready||e[26]!==v.data||e[27]!==W?(Y=k.ready&&v.data!==void 0&&(W===void 0||tr(W)),e[25]=k.ready,e[26]=v.data,e[27]=W,e[28]=Y):Y=e[28];const q=Y;let Q;e[29]!==G||e[30]!==n?(Q={pageKey:n,copyEpoch:G,opened:!1,code:""},e[29]=G,e[30]=n,e[31]=Q):Q=e[31];const[K,ee]=N.useState(Q);if(q&&(K.pageKey!==n||K.copyEpoch!==G||!K.opened)){let Z;e[32]!==W?(Z=W===void 0?"":JSON.stringify(W,null,2),e[32]=W,e[33]=Z):Z=e[33],ee({pageKey:n,copyEpoch:G,opened:!0,code:Z}),tr(W)&&L(n)}const H=K.pageKey===n&&K.opened,J=o===void 0||!H&&!q,V=q&&W===void 0,E=!y||V||J;let _;e[34]!==n||e[35]!==E||e[36]!==B?(_=Z=>{if(E)return;ee(ie=>({...ie,code:Z}));let re;try{re=JSON.parse(Z)}catch{return}re===null||typeof re!="object"||Array.isArray(re)||B(n,re)},e[34]=n,e[35]=E,e[36]=B,e[37]=_):_=e[37];const D=_;let U;e[38]!==A?(U=()=>({flush:A}),e[38]=A,e[39]=U):U=e[39],N.useImperativeHandle(c,U);let X;e[40]!==f||e[41]!==i||e[42]!==a||e[43]!==d?(X=i?r.jsx("div",{className:"flex shrink-0 items-center border-b px-3 py-2.5",children:r.jsx("span",{title:f,className:"min-w-0 flex-1 truncate font-mono text-xs text-muted-foreground",children:f})}):r.jsxs("div",{className:"flex shrink-0 items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"min-w-0 flex-1 truncate text-sm font-semibold",children:d("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(Oe,{variant:"ghost",size:"icon-sm",onClick:a,"aria-label":d("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Dr,{size:14})})]}),e[40]=f,e[41]=i,e[42]=a,e[43]=d,e[44]=X):X=e[44];let se;e[45]!==k.failed||e[46]!==k.retry||e[47]!==A||e[48]!==K.code||e[49]!==K.copyEpoch||e[50]!==K.pageKey||e[51]!==J||e[52]!==V||e[53]!==E||e[54]!==D||e[55]!==H||e[56]!==d?(se=!H&&k.failed?r.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 p-4",children:[r.jsx("p",{className:"text-sm",children:d("sectionsEditor.hosted.blockLoadFailed")}),r.jsx(Oe,{variant:"outline",size:"sm",onClick:k.retry,children:d("sectionsEditor.namedRules.tryAgain")})]}):J?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(rt,{className:"size-5 text-muted-foreground"})}):V?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",d("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(fa,{code:K.code,language:"json",readOnly:E,height:"100%",onChange:Z=>D(Z??""),onSave:Z=>{D(Z),A()}},`${K.pageKey}:${K.copyEpoch}`)}),e[45]=k.failed,e[46]=k.retry,e[47]=A,e[48]=K.code,e[49]=K.copyEpoch,e[50]=K.pageKey,e[51]=J,e[52]=V,e[53]=E,e[54]=D,e[55]=H,e[56]=d,e[57]=se):se=e[57];let z;return e[58]!==X||e[59]!==se?(z=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[X,se]}),e[58]=X,e[59]=se,e[60]=z):z=e[60],z}function Na(t){return t.contentEditingEnabled&&!t.isMobile}function rd(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function ad(t,e){return t==="blocks"?"preview":e?"blocks":t}function id(t){return Na({contentEditingEnabled:ga(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function od(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function ld(t){const e=ro(t),{display:s}=t;let n=null;if(s.mode==="production"&&s.iframeBase)try{n=new URL(t.path,s.iframeBase).href}catch{n=null}const a=ao(n,e);return{value:e,frame:a?qs(a,t.device):null,newTab:a}}function cd(t){const e=le.c(94),{tests:s,load:n,onOpen:a,options:c,onChange:d,available:o}=t,i=Ee();let l;e[0]!==c?(l=sa(c),e[0]=c,e[1]=l):l=e[1];const m=l;let f;e[2]!==c.tests?(f=c.tests??{},e[2]=c.tests,e[3]=f):f=e[3];const p=f;let y;e[4]!==d||e[5]!==c?(y=z=>{const Z=z?il(z):null,{at:re,...ie}=c;d(Z?{...ie,at:Z}:ie)},e[4]=d,e[5]=c,e[6]=y):y=e[6];const x=y;let b;e[7]!==p||e[8]!==d||e[9]!==c?(b=(z,Z)=>{const re={...p};Z==="on"?re[z]=!0:Z==="off"?re[z]=!1:delete re[z];const{tests:ie,...he}=c;d(Object.keys(re).length>0?{...he,tests:re}:he)},e[7]=p,e[8]=d,e[9]=c,e[10]=b):b=e[10];const h=b;let g;e[11]!==a?(g=z=>{z&&a?.()},e[11]=a,e[12]=g):g=e[12];let R;e[13]!==i?(R=i("sandbox.previewAs.label"),e[13]=i,e[14]=R):R=e[14];let v;e[15]===Symbol.for("react.memo_cache_sentinel")?(v=r.jsx(sl,{size:16}),e[15]=v):v=e[15];let w;e[16]!==m||e[17]!==R?(w=r.jsx(et,{asChild:!0,children:r.jsx(Vr,{asChild:!0,children:r.jsx(Ze,{"aria-label":R,active:m,"data-testid":"preview-as-trigger",children:v})})}),e[16]=m,e[17]=R,e[18]=w):w=e[18];let T;e[19]!==i?(T=i("sandbox.previewAs.label"),e[19]=i,e[20]=T):T=e[20];let k;e[21]!==T?(k=r.jsx(tt,{children:T}),e[21]=T,e[22]=k):k=e[22];let S;e[23]!==k||e[24]!==w?(S=r.jsxs(st,{children:[w,k]}),e[23]=k,e[24]=w,e[25]=S):S=e[25];let j;e[26]!==i?(j=i("sandbox.previewAs.label"),e[26]=i,e[27]=j):j=e[27];let C;e[28]!==j?(C=r.jsx("h3",{className:"text-sm font-medium",children:j}),e[28]=j,e[29]=C):C=e[29];let B;e[30]!==o||e[31]!==i?(B=i(o?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[30]=o,e[31]=i,e[32]=B):B=e[32];let A;e[33]!==B?(A=r.jsx("p",{className:"text-xs text-muted-foreground",children:B}),e[33]=B,e[34]=A):A=e[34];let L;e[35]!==C||e[36]!==A?(L=r.jsxs("div",{className:"flex flex-col gap-1",children:[C,A]}),e[35]=C,e[36]=A,e[37]=L):L=e[37];let F;e[38]!==i?(F=i("sandbox.previewAs.momentLabel"),e[38]=i,e[39]=F):F=e[39];let O;e[40]!==F?(O=r.jsx(nl,{htmlFor:"preview-as-moment",children:F}),e[40]=F,e[41]=O):O=e[41];let $;e[42]!==c.at?($=al(c.at),e[42]=c.at,e[43]=$):$=e[43];let I;e[44]!==x?(I=z=>x(z.target.value),e[44]=x,e[45]=I):I=e[45];let G;e[46]!==$||e[47]!==I?(G=r.jsx(Us,{id:"preview-as-moment",type:"datetime-local",className:ol,value:$,onChange:I}),e[46]=$,e[47]=I,e[48]=G):G=e[48];const W=c.at===void 0;let Y;e[49]!==x?(Y=()=>x(""),e[49]=x,e[50]=Y):Y=e[50];let q;e[51]!==i?(q=i("sandbox.previewAs.now"),e[51]=i,e[52]=q):q=e[52];let Q;e[53]!==W||e[54]!==Y||e[55]!==q?(Q=r.jsx(Oe,{type:"button",variant:"ghost",size:"sm",disabled:W,onClick:Y,children:q}),e[53]=W,e[54]=Y,e[55]=q,e[56]=Q):Q=e[56];let K;e[57]!==G||e[58]!==Q?(K=r.jsxs("div",{className:"flex items-center gap-2",children:[G,Q]}),e[57]=G,e[58]=Q,e[59]=K):K=e[59];let ee;e[60]!==i?(ee=i("sandbox.previewAs.momentHint"),e[60]=i,e[61]=ee):ee=e[61];let H;e[62]!==ee?(H=r.jsx("p",{className:"text-xs text-muted-foreground",children:ee}),e[62]=ee,e[63]=H):H=e[63];let J;e[64]!==O||e[65]!==K||e[66]!==H?(J=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[O,K,H]}),e[64]=O,e[65]=K,e[66]=H,e[67]=J):J=e[67];let V;e[68]!==i?(V=i("sandbox.previewAs.testsLabel"),e[68]=i,e[69]=V):V=e[69];let E;e[70]!==V?(E=r.jsx("span",{className:"text-sm font-medium",children:V}),e[70]=V,e[71]=E):E=e[71];let _;e[72]!==p||e[73]!==n||e[74]!==h||e[75]!==i||e[76]!==s?(_=n&&!n.ready?n.failed?r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.testsLoadFailed")}),r.jsx(Oe,{type:"button",variant:"outline",size:"sm",onClick:n.retry,children:i("sandbox.previewAs.tryAgain")})]}):r.jsx("div",{className:"flex justify-center py-2","data-testid":"preview-as-tests-loading",children:r.jsx(rt,{className:"size-4 text-muted-foreground"})}):s.length===0?r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.noTests")}):r.jsxs(r.Fragment,{children:[r.jsx("ul",{className:"flex flex-col gap-1.5",children:s.map(z=>r.jsxs("li",{className:"flex items-center justify-between gap-2","data-testid":"preview-as-test",children:[r.jsx("span",{className:"min-w-0 truncate text-sm",children:z}),r.jsxs(rl,{type:"single",variant:"outline",size:"sm",value:p[z]===void 0?"":p[z]?"on":"off",onValueChange:Z=>h(z,Z),"aria-label":z,children:[r.jsx(vr,{value:"off",children:i("sandbox.previewAs.off")}),r.jsx(vr,{value:"on",children:i("sandbox.previewAs.on")})]})]},z))}),r.jsx("p",{className:"text-xs text-muted-foreground",children:i("sandbox.previewAs.testsHint")})]}),e[72]=p,e[73]=n,e[74]=h,e[75]=i,e[76]=s,e[77]=_):_=e[77];let D;e[78]!==E||e[79]!==_?(D=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[E,_]}),e[78]=E,e[79]=_,e[80]=D):D=e[80];let U;e[81]!==m||e[82]!==d||e[83]!==i?(U=m&&r.jsx(Oe,{type:"button",variant:"outline",size:"sm",onClick:()=>d({}),children:i("sandbox.previewAs.reset")}),e[81]=m,e[82]=d,e[83]=i,e[84]=U):U=e[84];let X;e[85]!==L||e[86]!==J||e[87]!==D||e[88]!==U?(X=r.jsxs(Wr,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[L,J,D,U]}),e[85]=L,e[86]=J,e[87]=D,e[88]=U,e[89]=X):X=e[89];let se;return e[90]!==S||e[91]!==X||e[92]!==g?(se=r.jsxs(qr,{onOpenChange:g,children:[S,X]}),e[90]=S,e[91]=X,e[92]=g,e[93]=se):se=e[93],se}const dd=["next"],ud=["@tanstack/react-router","@tanstack/react-start","@tanstack/solid-router","@tanstack/solid-start"],Ca=new Set(["tsx","ts","jsx","js","mdx"]),fd=new Set(["tsx","jsx"]),pd=new Set(["404","500"]);function md(t){const e=new Set;if(!t||typeof t!="object")return e;const s=t;for(const n of["dependencies","devDependencies"]){const a=s[n];if(a&&typeof a=="object"&&!Array.isArray(a))for(const c of Object.keys(a))e.add(c)}return e}function hd(t){const e=md(t);return dd.some(s=>e.has(s))?"next":ud.some(s=>e.has(s))?"tanstack":null}function Ta(t,e){const s=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return s?`${s}/${e}`:e}function gd(t,e){const s=n=>Ta(e,n);switch(t){case"next":return[{router:"next-pages",dir:s("pages"),pattern:"**/*"},{router:"next-pages",dir:s("src/pages"),pattern:"**/*"},{router:"next-app",dir:s("app"),pattern:"**/page.*"},{router:"next-app",dir:s("src/app"),pattern:"**/page.*"}];case"tanstack":return[{router:"tanstack",dir:s("src/routes"),pattern:"**/*"}];default:{const n=t;throw new Error(`Unknown framework: ${String(n)}`)}}}function nn(t){const e=t.lastIndexOf(".");return e<=0?null:[t.slice(0,e),t.slice(e+1)]}function vd(t){const e=nn(t.at(-1)??"");if(!e||!Ca.has(e[1]))return null;const[s]=e;if(s.includes("."))return null;const n=[...t.slice(0,-1),s];return n[0]==="api"||n.length===1&&pd.has(s)||n.some(a=>a.startsWith("_")||a.includes("["))?null:(n.at(-1)==="index"&&n.pop(),`/${n.join("/")}`)}function xd(t){const e=nn(t.at(-1)??"");if(!e||e[0]!=="page"||!Ca.has(e[1]))return null;const s=[];for(const n of t.slice(0,-1)){if(n.startsWith("_")||n.startsWith("@")||/^\(\.{1,3}\)/.test(n)||n.includes("["))return null;n.startsWith("(")&&n.endsWith(")")||s.push(n)}return`/${s.join("/")}`}function bd(t){const e=[];let s="",n=!1;for(const a of t)a==="["?n=!0:a==="]"&&(n=!1),a==="."&&!n?(e.push(s),s=""):s+=a;return e.push(s),e}function yd(t){const e=nn(t.at(-1)??"");if(!e||!fd.has(e[1]))return null;const s=[...t.slice(0,-1),...bd(e[0])].filter(Boolean);s.at(-1)==="lazy"&&s.pop();const n=s.at(-1);if(!n||n==="__root"||s.some(c=>c.startsWith("-"))||n.startsWith("_"))return null;(n==="index"||n==="route")&&s.pop();const a=[];for(const c of s){if(c.includes("$"))return null;if(c.startsWith("_")||c.startsWith("(")&&c.endsWith(")"))continue;const d=c.replace(/_$/,"").replace(/[[\]]/g,"");d&&a.push(d)}return`/${a.join("/")}`}function wd(t,e){const s=e.split("/").filter(Boolean);if(s.length===0)return null;switch(t){case"next-pages":return vd(s);case"next-app":return xd(s);case"tanstack":return yd(s);default:{const n=t;throw new Error(`Unknown router: ${String(n)}`)}}}function kd(t){const e=new Set;for(const{root:s,files:n}of t){const a=`${s.dir}/`;for(const c of n){if(!c.startsWith(a))continue;const d=wd(s.router,c.slice(a.length));d&&e.add(d)}}return[...e].sort((s,n)=>s==="/"?-1:n==="/"?1:s.localeCompare(n))}const Sd=5e3,Pd=6e4;async function jd(t,e){const s=await fetch(ll(t,"glob"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pattern:e.pattern,path:e.dir,limit:Sd})});if(!s.ok)throw new Error(`Failed to list ${e.dir}: ${s.status}`);const n=await s.json();return Array.isArray(n.files)?n.files.filter(a=>typeof a=="string"):[]}async function Ed(t,e){const s=await io(t,Ta(e,"package.json"));if(s.kind==="unavailable")throw new Error("package.json unavailable: sandbox not ready");const n=s.kind==="data"?hd(s.data):null;if(!n)return[];const a=gd(n,e),c=await Promise.all(a.map(async d=>({root:d,files:await jd(t,d)})));return kd(c)}function Nd(t,e,s){const n=le.c(12);let a;n[0]!==e||n[1]!==t?(a=t?Qs.frameworkRoutes(t.orgSlug,t.virtualMcpId,t.branch,t.threadId,e):["framework-routes","none"],n[0]=e,n[1]=t,n[2]=a):a=n[2];let c;n[3]!==e||n[4]!==t?(c=()=>t?Ed(t,e):[],n[3]=e,n[4]=t,n[5]=c):c=n[5];const d=s&&!!t;let o;n[6]!==a||n[7]!==c||n[8]!==d?(o={queryKey:a,queryFn:c,enabled:d,staleTime:Pd},n[6]=a,n[7]=c,n[8]=d,n[9]=o):o=n[9];const i=$r(o);let l;return n[10]!==i.data?(l=i.data??[],n[10]=i.data,n[11]=l):l=n[11],l}const Cd=500,Td={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},Rr=1,ds=["desktop","mobile","tablet"],Rd=["preview","visual","blocks"],Ld={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function Ad(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 It(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Is(t,e){try{return new URL(t,e).href}catch{return null}}function _d(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 Od(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Fd(t,e,s){const n=t.toLowerCase(),a=e.toLowerCase(),c=a.split("/").filter(Boolean),d=i=>{if(i===s)return 100;const l=i.indexOf(s);if(l===-1)return 0;let m=40;return l===0?m+=30:/[\s/-]/.test(i[l-1]??"")&&(m+=20),m+=Math.round(s.length/i.length*20),m};let o=Math.max(d(n),d(a));return c.at(-1)===s?o=Math.max(o,95):c.includes(s)&&(o=Math.max(o,90)),o}function Dd(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function $d({virtualMcpId:t}){const e=Ee(),s=aa(),{currentBranch:n,taskId:a,virtualMcpId:c}=at(),d=!!Ti(),o=ua(),i=Ui(c===t?t:null),l=Xr(t),m=cl(i?.metadata?.ui?.layout??null),f=ga(m),p=Na({contentEditingEnabled:f,isMobile:s}),[y]=N.useState(()=>id({cmsMode:m,isMobile:s})),[x,b]=Ks(Hs.previewEditingMode(t),u=>u&&Rd.includes(u)?u:null),h=x??y,[g,R]=Ks(Hs.previewDeviceSize(t),u=>u&&ds.includes(u)?u:"desktop"),[v,w]=N.useState(null),[T,k]=N.useState(null),S=N.useRef(null),j=N.useRef(null),[C,B]=N.useState(!1),A=N.useRef(null),L=()=>{A.current?.flush(),B(!1)},F=()=>B(u=>(u&&A.current?.flush(),!u)),[O,$]=N.useState({width:0,height:0}),[I,G]=N.useState(!1),[W,Y]=N.useState({}),[q,Q]=N.useState(""),K=N.useRef(null),[ee,H]=N.useState(!1),[J,V]=N.useState(),[E,_]=N.useState(null),[D,U]=N.useState(null),[X,se]=N.useState(null),[z,Z]=N.useState(()=>o.state.target?.kind==="page"?o.state.target.path:"/"),[re,ie]=N.useState(()=>o.state.target?.kind==="page"?o.state.target.key:null),[he,pe]=N.useState({}),[be,ge]=N.useState(!1),ve=N.useRef(null),Se=()=>{ge(!0),ve.current&&clearTimeout(ve.current),ve.current=setTimeout(()=>ge(!1),15e3)},fe=()=>{ve.current&&(clearTimeout(ve.current),ve.current=null),ge(!1)},{org:ce}=ms(),Le=tn(),ze=xt(),Ie=ze.vmEntry,Be=Le.lifecycle.phase,{url:bt}=na(t),me=Kt(t,n),{connection:Fe}=ra(t),xe=Zo(t),Ue=oo({hasServeConnection:!!Fe,runtime:l.runtime}),Ae=!Xe(me)&&me.kind!=="pending",ne=He(me)??bt,de=ne??ze.previewUrl,We=!!ne||Be==="running",yt=i?.id===t?Yi(i.metadata):null,qe=!ne&&i?.id===t&&l.runtime==="cms",Ht=l.projectDefault==="cms",wt=Ae?lo({sandboxUrl:de,previewServerUrl:yt,fastPreviewActive:qe}):null,rn=t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n,threadId:a??null,previewUrl:de}:null,an=hs(rn,{fetchEnabled:We}),gs=la(rn,{fetchEnabled:We}),ue=an.data,Pe=gs.data,Ge=ue?To(ue,Pe).sort((u,P)=>u.name.localeCompare(P.name)):[],Vt=t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n}:null,on=qc(Vt),Ra=co(Vt),vs=ue&&Pe?Ro(ue,Pe):[],ln=Ae&&ue&&Pe?Ko(Pe,ue,"loaders"):[],La=q?(()=>{const u=q.toLowerCase();return Ge.map(P=>({page:P,score:Fd(P.name,P.path,u)})).filter(({score:P})=>P>0).sort((P,M)=>M.score-P.score||P.page.path.length-M.page.path.length).map(({page:P})=>P)})():Ge,Aa=vs.filter(u=>{if(!q)return!0;const P=q.toLowerCase();return u.name.toLowerCase().includes(P)||u.key.toLowerCase().includes(P)||u.resolveType.toLowerCase().includes(P)}),cn=p?ln:[],dn=cn.filter(u=>{if(!q)return!0;const P=q.toLowerCase();return u.title.toLowerCase().includes(P)||u.key.toLowerCase().includes(P)||u.resolveType.toLowerCase().includes(P)}),Wt=D?ln.find(u=>u.key===D)??null:null,Ne=en,xs=E||D?null:Lo(Ge,z,re),oe=xs?.key??null,it=o.state.target?.kind==="section"?o.state.target.key:o.state.focusedBlockKey??oe,qt=xs?.path??null,ot=(oe?he[oe]:void 0)??{},Te=Ve(z,ot),bs={};if(Ae&&We&&de&&Pe&&ue){const u=Ho(Pe,"loaders"),P=oe?ue[oe]:void 0,M=fc(P,ue,we=>u.has(we)),ae=oc(M);for(const we of Ut(z)){if(we.type!=="param")continue;const Ce=rc(z,we.name,M),ft=dc(Ce,u,ae);ft.length>0&&(bs[we.name]=ft)}}const kt=t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n,threadId:a??null}:null,un=ue&&oe?Wo(ue,oe,0):[],fn=Xe(me),pn=ue?Vo(un,ue,fn):[],St=pn.map(u=>u.isSavedBlock?u.label:""),Pt=pn.map(u=>u.isSavedBlock?"global":u.isMultivariate?"variant":"normal"),jt=un.map(u=>Gs(u,ue??{},fn)),lt=N.useRef(null),De=N.useRef(null),_a=Le.status.state==="paused",ys=Le.phase,mn=Jo({claimPhase:ys,lifecycle:Le.lifecycle}),Je=ze.previewState,Oa=ze.userStopped,Fa=uo(ce.slug,t??""),{url:Ke}=$o(qe&&t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n,previewServerUrl:yt??null,path:Te}:null),Da=Ht&&l.runtime==="sandbox",_e=fo(me,Ue,xe),hn=po(_e&&qe&&me.kind==="protocol"&&t&&n?{orgSlug:ce.slug,virtualMcpId:t,branch:n}:null),gn=_e?hn.pointer:null,te=Bl({previewState:Je,progressStatus:mn.status,previewServerUrl:yt,fastPreviewActive:qe,fastPreviewReady:!!Ke,codingSession:Da,localPreviewUrl:ne,hostedDraft:_e,hostedPointerPending:_e&&(me.kind==="pending"||hn.pending)}),vn=te.showWakingPill||_e&&te.mode==="production"&&!gn,Et=te.mode!=="none",$a=te.mode==="production"&&te.iframeBase?It(te.iframeBase):null,ct=te.mode==="production"?$a:It(de),Ba=i?.id===t&&i.metadata?.fastPreviewInPlace===!0,Nt=Ae?ne?te.mode==="sandbox"&&p&&h==="blocks":te.mode==="production"&&qe&&Ba&&p&&h==="blocks":!1,xn=N.useRef(null),{pin:Ma,effective:za}=_d(xn.current,{inPlaceRenderActive:Nt,draftPreviewUrl:Ke,resolvedPath:Te});xn.current=Ma;const bn=o.state.variantOverride??[],Gt=Ae?bn:[],Ct=Ae?[]:bn,Jt=Xe(me)&&Ao.some(u=>_o(Pe,u)==="available"),dt=Jt?W:{},yn=sa(dt),Ia=Jt&&ue?Object.keys(Oo(ue).experiments):[],[wn,Ua]=N.useState(!1),kn=ta(Vt,Jt&&wn?Fo:[]),Ka={...kn,ready:!(me.kind==="protocol"&&me.hosted)||wn&&kn.ready},Ye=t?rr(ce.slug,t):null,Ha=mo(Ye),Yt=_e?ld({display:te,path:Te,pointer:gn,heldRevision:Ha,device:g,forcedVariants:Ct,previewOptions:dt}):null,Sn=JSON.stringify([Ct,dt]);N.useEffect(()=>{if(!_e||!Ye)return;const[u,P]=JSON.parse(Sn);ar(Ye,{forcedVariants:u,previewOptions:P})},[_e,Ye,Sn]),N.useEffect(()=>{if(!(!_e||!Ye))return()=>ar(Ye,null)},[_e,Ye]);const ws=Fe&&He(me)?ho(Fe.endpoint,Ct,yn):null,Va=Fe&&He(me)?ws?go(ws,dt):ir:null,Qe=Ad(te.mode==="sandbox"?as(qs(or(X??Is(Te,te.iframeBase)??te.iframeBase,Va),g),Gt):te.mode==="production"&&Yt?.frame?Yt.frame:te.mode==="production"?as(qs(lr(cr(or(X??za??Is(Te,te.iframeBase)??te.iframeBase,vn?ir:null),Ct),dt),g),Gt):null),Pn=Ke??(te.iframeBase?Is(Te,te.iframeBase):null),jn=te.mode==="production"&&Yt?Yt.newTab:te.mode==="production"?Pn?as(lr(cr(Pn,Ct),dt),Gt):null:Qe??te.iframeBase,Wa=()=>{const u=jn;u&&window.open(u,"_blank","noopener")},Tt=t&&n?zr(ce.slug,t,n):null,Rt=u=>{Tt&&Li(Tt,u)},ke=o.state.target;N.useEffect(()=>{if(!(!ke||!wt||!Pe))if(ke.kind==="page"){const u=he[ke.key]??{};De.current=Ve(ke.path,u),_(null),U(null),se(null),ie(ke.key),Z(ke.path),Rt({path:ke.path,pageKey:ke.key,params:u})}else if(ke.kind==="loader")De.current=null,_(null),U(ke.key),se(null);else{const u=vs.find(P=>P.key===ke.key);if(u){De.current=null;const P=fr(Pe);U(null),_(u),se(dr(wt,P,u.key))}}},[ke,wt,Pe,he]),N.useEffect(()=>{!oe||qt===null||ke?.kind==="page"&&ke.key===oe&&ke.path===qt||o.selectTarget({kind:"page",key:oe,path:qt})},[oe,qt,ke]);const[En,qa]=N.useState(null);if(Je.kind==="iframe"&&En!==Je.previewUrl){const u=En!==null;qa(Je.previewUrl);const P=Tt?Mr(Tt):null;if(P){if(De.current=Ve(P.path,P.params),Z(P.path),ie(P.pageKey),se(null),_(null),U(null),P.pageKey&&Object.keys(P.params).length>0){const M=P.pageKey;pe(ae=>({...ae,[M]:P.params}))}}else u&&(De.current=null,Z("/"),se(null),ie(null),_(null),U(null))}lt.current=Qe;const Ga=te.mode==="production"&&!!Ke&&!ne,[Qt,ks]=N.useState({src:Qe??void 0,loading:!1}),[Ja,Ss]=N.useState(!1),[Ya,Qa]=N.useState(),[Nn,Cn]=N.useState(null),je=Vi(Nn,{base:te.iframeBase??"",frameSrc:Qt.src,loadedSrc:Ya,wanted:Qe??void 0,canSwap:xe&&Ja&&!Qt.loading});je!==Nn&&Cn(je);const Xt=Wi(Qt,je?je.src:Qe??void 0,Ga);Xt!==Qt&&ks(Xt);const ut=Xt.src,Tn=Xt.loading,Rn=qi({iframeRef:S,src:te.mode==="sandbox"?Qe:null,active:te.mode==="sandbox"}),Ln=N.useRef(null);N.useEffect(()=>{const u=Tn?setTimeout(()=>ks(nr),Gi):null,P=()=>{u&&clearTimeout(u)};if(!Ke||!ut||Ln.current===Ke)return P;Ln.current=Ke;const M=S.current;return M&&M.getAttribute("src")!==ut&&(Se(),M.src=ut),P},[Ke,ut,Tn]);const An=()=>{const u=S.current?.contentWindow,P=ct;if(!u||!P||!ue||!oe)return;const M=ue[oe];if(!M||typeof M!="object")return;const ae=yo({previewBaseUrl:P,pageBlock:M,decofile:ue,path:Te,pathTemplate:z});if(!ae)return;const we=as(ae.src,ko(Gt,oe));u.postMessage({type:"cms-editor::render",src:we,body:ae.body},P)},Ps=N.useRef(null);N.useEffect(()=>{if(!Nt||E||D||!oe||!ue){Ps.current=null;return}const u={nav:JSON.stringify({page:oe,path:Te,pathTemplate:z}),content:JSON.stringify(ue)},P=Od(Ps.current,u);Ps.current=u,P&&An()},[ue,Nt,E,D,oe,Te,z]);const js=N.useRef(null);N.useEffect(()=>{if(!Nt||E||D||!oe||!ue){js.current=null;return}const u=JSON.stringify(o.state.variantOverride??null),P=js.current;js.current={page:oe,sig:u},!(!P||P.page!==oe||P.sig===u)&&An()},[o.state.variantOverride,Nt,E,D,oe]);const _n=!!t&&!!n&&!Le.notFound&&!Oa&&!_a&&(ys?.kind==="ready"||Be!=="idle"),On=!Xe(me),Xa=Zs(t??void 0),Za=Nd(kt,Xa,On&&_n),ei=new Set(f?Ge.map(u=>Ne(u.path)):[]),Lt=On?Za.filter(u=>!ei.has(Ne(u))):[],Fn=q?Lt.filter(u=>u.toLowerCase().includes(q.toLowerCase())):Lt,ye=od({editingMode:h,sandboxDisplay:te.mode==="sandbox",blocksEditingEnabled:p});N.useEffect(()=>{const u=ct;if(!u)return;const P=M=>{if(M.origin===u)if(M.data?.type==="visual-editor::element-clicked"){const ae=Ul.safeParse(M.data.payload);ae.success&&w(ae.data)}else if(M.data?.type==="cms-editor::section-clicked"){const ae=Vl.safeParse(M.data.payload);ae.success&&k({index:ae.data.sectionIndex,seq:ae.data.clickSeq})}else M.data?.type==="cms-editor::render-start"?Se():M.data?.type==="cms-editor::render-end"?(fe(),S.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:St,kinds:Pt,keys:jt},u)):M.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",P),()=>window.removeEventListener("message",P)},[ct,St,Pt,jt]);const Dn=()=>{const u=S.current?.contentWindow,P=It(de),M=Hc({v8:xe,script:Kl});!u||!P||!M||u.postMessage(M,P)},ti=()=>{if(xe)return;const u=S.current?.contentWindow,P=It(de);!u||!P||u.postMessage({type:"visual-editor::deactivate"},P)},$n=()=>{const u=Me.current;u?.has("wireframe")&&(u.wireframe({type:"wireframe:sections",labels:St,kinds:Pt,keys:jt}),u.wireframe({type:ye==="blocks"?"wireframe:activate":"wireframe:deactivate"}))},Es=()=>{if(xe){$n();return}const u=S.current?.contentWindow,P=ct,M=Kc({v8:xe,production:te.mode==="production",localPreview:!!ne,script:Wl});!u||!P||!M||(u.postMessage(M,P),u.postMessage({type:"cms-editor::set-labels",labels:St,kinds:Pt,keys:jt},P))},si=()=>{if(xe){Me.current?.wireframe({type:"wireframe:deactivate"});return}const u=S.current?.contentWindow,P=ct;!u||!P||u.postMessage({type:"cms-editor::deactivate"},P)},Bn=u=>{Me.current?.wireframe({type:"wireframe:scroll-to",sectionIndex:u})},ni=()=>{if(Me.current?.wireframe({type:"wireframe:clear-hover"}),xe)return;const u=S.current?.contentWindow,P=ct;!u||!P||(u.postMessage({type:"cms-editor::clear-hover"},P),u.postMessage({type:"visual-editor::clear-hover"},P))},Zt=u=>{if(u==="blocks"&&!p)return;const P=h;!s&&u!==P&&(u==="blocks"?j.current?.resize("30%"):j.current?.collapse()),b(u),w(null),k(null),u!=="blocks"&&U(null),P==="visual"&&ti(),u==="visual"&&Dn(),P==="blocks"&&u!=="blocks"&&si(),u==="blocks"&&Es()},ri=()=>{Zt(rd(h,p))},ai=()=>{Zt(ad(h,p))},es=()=>{const u=S.current;if(!u)return;Se();const P=document.activeElement,M=u.tabIndex;u.tabIndex=-1,u.style.pointerEvents="none",u.blur(),Dd(u,lt.current);let ae;const we=()=>{clearTimeout(ae),u.tabIndex=M,u.style.pointerEvents="";const Ce=document.activeElement;(!Ce||Ce===document.body||Ce===u)&&P?.focus(),u.removeEventListener("load",we)};u.addEventListener("load",we),ae=setTimeout(we,3e3)};Go(es);const Me=N.useRef(null),Mn=N.useEffectEvent($n),ii=N.useEffectEvent((u,P)=>{k({index:u,seq:P})}),oi=N.useEffectEvent(()=>{fe(),je&&(Ns.current=je.shown),_t&&_s(At)}),zn=N.useEffectEvent(()=>{if(Ss(!1),je&&Cn(null),je&&je.src!==lt.current){Se();return}es()});N.useEffect(()=>{if(!xe)return;const u=new Ql({studioOrigin:window.location.origin,build:"4.584.6",frame:()=>S.current?.contentWindow??null,onWireframeReady:()=>Mn(),onWireframe:M=>{M.type==="wireframe:select"&&ii(M.sectionIndex,M.clickSeq)},onModulesChange:()=>Ss(u.has("html-swap")),onSwapEnd:()=>oi(),onSwapFailed:()=>zn()});Me.current=u;const P=M=>{u.handle(M)};return window.addEventListener("message",P),()=>{window.removeEventListener("message",P),u.dispose(),Ss(!1),Me.current===u&&(Me.current=null)}},[xe,te.iframeBase]);const In=xe?JSON.stringify([St,Pt,jt,ye]):"";N.useEffect(()=>{In&&Mn()},[In]);const Un=N.useRef(null);N.useEffect(()=>{const u=Un.current;if(Un.current=je,je&&je!==u){Me.current?.refresh(je.shown)?Se():zn();return}!je&&u&&u.shown!==u.src&&u.src===lt.current&&es()},[je]);const Kn=()=>{Me.current?.refresh()||es()},At=rr(ce.slug,t??""),_t=_e&&Et&&!!t,Ns=N.useRef(null);N.useEffect(()=>{if(_t)return vo(At)},[_t,At]);const{reload:Ot}=xo(ce.slug,t??""),Hn=N.useRef(Ot.seq);N.useEffect(()=>{if(Hn.current!==Ot.seq&&(Hn.current=Ot.seq,!!_t&&Ns.current===lt.current)){if(Ot.navigates){_s(At);return}Kn()}},[Ot.seq]);const Cs=Zr(Vt),Ft=bo(He(me)?Cs:""),Vn=N.useRef(Ft);N.useEffect(()=>{const u=Vn.current;if(Vn.current=Ft,!u||!Ft||u===Ft)return;const P=S.current;if(P)return Il({iframe:P,reload:Kn})},[Ft]);const Wn=()=>{const u=ds.indexOf(g);R(ds[(u+1)%ds.length])},Ts=(u,P)=>{if(!oe)return;const M=oe,ae={...ot,[u]:P};De.current=Ve(z,ae),pe(we=>({...we,[M]:ae})),Rt({path:z,pageKey:M,params:ae})},li=zc({iframeBase:te.iframeBase,resolvedPath:Te,activeGlobalSectionName:E?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),Rs=u=>{const P=he[u.key]??{},M=Ve(u.path,P);(E||Ne(M)!==Ne(Te))&&Se(),De.current=M,_(null),U(null),se(null),k(null),ie(u.key),Z(u.path),Rt({path:u.path,pageKey:u.key,params:P}),o.selectTarget({kind:"page",key:u.key,path:u.path})},qn=u=>{(E||Ne(u)!==Ne(Te))&&Se(),De.current=u,_(null),U(null),se(null),k(null),ie(null),Z(u),Rt({path:u,pageKey:null,params:{}})};Ri(Tt,qn);const ci=u=>{if(Xe(me)){const ae=ue?Do(ue,u.key,Pe):null;ae?Rs(ae):fs.info(e("sandbox.preview.blockOnNoPage"));return}if(!wt||!Pe){fs.error(e("sandbox.preview.previewMetadataNotReady"));return}Se(),De.current=null;const P=fr(Pe),M=dr(wt,P,u.key);_(u),U(null),se(M),k(null),o.selectTarget({kind:"section",key:u.key})},di=u=>{p&&(_(null),U(u.key),se(null),Zt("blocks"),o.selectTarget({kind:"loader",key:u.key}))},ui=async({name:u,path:P,templateKey:M})=>{if(!t||!n)return;const ae=oa(P);if(ae){V(ae);return}const we=P.trim().startsWith("/")?P.trim():`/${P.trim()}`;if(Ge.some(Ce=>Ne(Ce.path)===Ne(we))){V(e("sandbox.preview.pageAlreadyExists",{path:we}));return}V(void 0);try{const Ce=M?await Ra(ue,M):void 0;if(M&&!Ce){V(e("sandbox.preview.templateNoLongerExists"));return}const ft=await on.mutateAsync({name:u,path:we,template:Ce,schema:Xe(me)?{meta:Pe,loadMeta:async()=>(await gs.refetch()).data}:void 0});H(!1),fs.success(e("sandbox.preview.pageCreated",{name:u})),await ul(Cd),Rs({key:ft.key,name:ft.name,path:ft.path}),Zt("blocks")}catch(Ce){V(Ce instanceof Ea?e("sandbox.preview.pageSchemaNotReady"):Ce instanceof Error?Ce.message:e("sandbox.preview.failedToCreatePage"))}},Dt=Ic({previewSurfaceActive:Et,daemonReady:_n,production:te.mode==="production",servePreviewUrl:He(me)}),Gn=Uc({showPreviewToolbar:Dt,contentEditingEnabled:f,hasFrameworkRoutes:Lt.length>0}),Jn=f?La:[],Yn=f?Aa:[],$t=()=>{G(!1),Q("")},Ls=f?E?.name??Wt?.title??xs?.name:void 0,As=f&&(an.isPending||gs.isPending),ts=As?It(te.iframeBase):Ls,Bt=E?`section:${E.key}`:D?`loader:${D}`:f&&oe?`page:${oe}`:Lt.includes(Ne(z))?`route:${Ne(z)}`:void 0,ss=e(Ld[g]),Qn=g==="mobile"?r.jsx(Ur,{size:16}):g==="tablet"?r.jsx(Bi,{size:16}):r.jsx(Kr,{size:16}),fi=Dt?Gn?r.jsxs("div",{className:"flex h-7 min-w-36 flex-1 items-stretch overflow-hidden rounded-[var(--studio-button-radius,calc(var(--radius)*1.333))] border border-border/60 bg-background transition-colors hover:border-border",children:[r.jsxs(st,{children:[r.jsx(et,{asChild:!0,children:r.jsx("button",{type:"button",onClick:Wn,"aria-label":ss,className:Re("flex w-7 shrink-0 items-center justify-center border-r border-border/60 text-muted-foreground transition-colors hover:bg-accent/50 hover:text-foreground",ur),children:Qn})}),r.jsx(tt,{children:ss})]}),r.jsxs(qr,{open:I,onOpenChange:u=>{G(u),u||Q("")},children:[r.jsx(Vr,{asChild:!0,children:r.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:As?ts??void 0:E||Wt?Ls:[Ls,z].filter(Boolean).join(" · "),className:Re("group/page-picker flex min-w-0 flex-1 items-stretch whitespace-nowrap text-left text-xs text-muted-foreground",ur),children:r.jsxs("span",{className:"flex min-w-0 flex-1 items-center gap-1.5 px-2 transition-colors group-hover/page-picker:bg-accent/50 group-data-[state=open]/page-picker:bg-accent/50",children:[E&&r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-global-section/14 px-1.5 py-0.5 text-2xs font-medium text-global-section-fg dark:text-global-section-fg-dark",children:[r.jsx(Di,{size:11}),e("sandbox.preview.globalBadge")]}),Wt&&r.jsxs("span",{className:"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-2xs font-medium text-muted-foreground",children:[r.jsx(Mi,{size:11}),e("sandbox.preview.loaderBadge")]}),ts&&r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ts}),!As&&!E&&!Wt&&r.jsx("span",{"data-testid":"preview-page-path",className:Re("min-w-0 truncate font-mono [direction:rtl]",ts?"ml-auto shrink-[2] text-right text-muted-foreground md:@max-[40rem]/panel-toolbar:hidden":"flex-1 text-left text-foreground"),children:r.jsx("bdi",{dir:"ltr",children:z})}),r.jsx(Ai,{size:12,className:Re("shrink-0 transition-transform",I&&"rotate-180")})]})})}),r.jsxs(Wr,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[r.jsxs(Jr,{shouldFilter:!1,defaultValue:Bt,children:[r.jsx(Yr,{value:q,onValueChange:u=>{Q(u),K.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),r.jsxs(Gr,{ref:K,className:"max-h-80",children:[r.jsx(Qr,{children:(!f||Ge.length===0)&&Lt.length===0&&(!f||vs.length===0)&&cn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),Jn.length>0&&r.jsx(ht,{children:Jn.map(u=>r.jsxs(gt,{value:`page:${u.key}`,"aria-current":Bt===`page:${u.key}`||void 0,title:`${u.name} · ${u.path}`,onSelect:()=>{$t(),Rs(u)},className:"gap-3 px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:[r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:u.name}),r.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:u.path})]},u.key))}),Fn.length>0&&r.jsx(ht,{heading:e("sandbox.preview.siteRoutes"),children:Fn.map(u=>r.jsx(gt,{value:`route:${u}`,"aria-current":Bt===`route:${u}`||void 0,title:u,onSelect:()=>{$t(),qn(u)},className:"px-3 py-2.5 aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",children:r.jsx("span",{className:"min-w-0 flex-1 truncate font-mono text-xs",children:u})},u))}),Yn.length>0&&r.jsx(ht,{heading:e("sandbox.preview.globalComponents"),children:Yn.map(u=>r.jsx(gt,{value:`section:${u.key}`,"aria-current":Bt===`section:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{$t(),ci(u)},children:r.jsx("span",{className:"truncate",children:u.name})},u.key))}),dn.length>0&&r.jsx(ht,{heading:e("sandbox.preview.globalLoaders"),children:dn.map(u=>r.jsx(gt,{value:`loader:${u.key}`,"aria-current":Bt===`loader:${u.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{$t(),di(u)},children:r.jsx("span",{className:"truncate",children:u.title})},u.key))})]})]}),f&&!E&&!D&&Ut(z).some(u=>u.type!=="text")&&r.jsx("div",{className:"flex flex-wrap items-center gap-1 border-t px-3 py-3 text-xs text-muted-foreground",children:Ut(z).map((u,P)=>{if(u.type==="text")return r.jsx("span",{children:u.text},`text-${P}`);const M=bs[u.name];return M&&kt?r.jsx(Nc,{sources:M,template:z,paramName:u.name,value:ot[u.name]??"",sandboxRef:kt,onCommit:ae=>Ts(u.name,ae)},`${oe}:${u.name}`):r.jsx(Bc,{name:u.name,value:ot[u.name]??"",onCommit:ae=>Ts(u.name,ae)},`${oe}:${u.name}`)})}),f&&r.jsx("div",{className:"border-t p-1.5",children:r.jsxs(Oe,{variant:"ghost",className:"w-full justify-start",onClick:()=>{$t(),V(void 0),H(!0)},children:[r.jsx(Hr,{size:16}),e("sandbox.preview.createNewPage")]})})]})]})]}):r.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:li}):null,Xn=Dt||f?r.jsxs("div",{className:"flex min-w-0 max-w-[24rem] flex-1 items-center justify-center gap-1",children:[!(Dt&&Gn)&&r.jsxs(st,{children:[r.jsx(et,{asChild:!0,children:r.jsx(Ze,{onClick:Wn,"aria-label":ss,children:Qn})}),r.jsx(tt,{children:ss})]}),fi,r.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[Jt&&r.jsx(cd,{tests:Ia,load:Ka,onOpen:()=>Ua(!0),options:W,onChange:u=>{Y(u),o.previewAsChanged()},available:!!ws||!vn||!yn}),r.jsx(Ze,{onClick:Wa,disabled:_e&&!jn,"aria-label":e("sandbox.preview.openInNewTab"),children:r.jsx(Br,{size:16})})]})]}):null,pi=(Ae||d)&&te.mode==="sandbox",ns=Td[g],rs=g==="desktop"&&(O.width===0||O.width>=ns.width+2*Rr),Zn=rs?1:Math.min(O.width>0?O.width/(ns.width+2*Rr):1,1),mi=rs?{width:"100%",height:"100%"}:{width:`${ns.width}px`,height:O.height>0?`${O.height/Zn}px`:`${ns.height}px`,transform:`scale(${Zn})`,transformOrigin:"top center"},er=r.jsxs(r.Fragment,{children:[pi&&(Dt||f)&&r.jsx(Ze,{onClick:ri,"aria-pressed":ye==="visual","aria-label":e("sandbox.preview.visualEditor"),active:ye==="visual",children:r.jsx(sr,{size:16})}),p&&r.jsxs(st,{children:[r.jsx(et,{asChild:!0,children:r.jsx(Ze,{onClick:ai,"aria-pressed":ye==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:ye==="blocks",children:r.jsx(zi,{size:16})})}),r.jsx(tt,{children:e("sandbox.preview.blocksEditor")})]}),it&&r.jsxs(st,{children:[r.jsx(et,{asChild:!0,children:r.jsx(Ze,{onClick:F,"aria-pressed":C,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:C,children:r.jsx($i,{size:16})})}),r.jsx(tt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),hi=!!D&&ye==="blocks";return r.jsxs("div",{className:"flex flex-col w-full h-full",children:[kt&&Object.entries(bs).map(([u,P])=>(ot[u]??"")===""?r.jsx(Dc,{sources:P,template:z,paramName:u,sandboxRef:kt,onFill:M=>Ts(u,M)},`${oe}:${u}`):null),r.jsxs(r.Fragment,{children:[r.jsx(Vs.Toolbar.Center.Portal,{fallback:r.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:Xn}),children:Xn}),r.jsx(Vs.Toolbar.Right.Portal,{fallback:er,children:er})]}),r.jsx("div",{className:"flex-1 overflow-hidden relative",children:hi?r.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[r.jsx(Cr,{virtualMcpId:t,externalSelection:T,onSectionPicked:Bn,onViewJsonFile:F}),C&&it&&r.jsx("div",{className:"absolute inset-0 z-10",children:r.jsx(Tr,{ref:A,virtualMcpId:t,pageKey:it,onClose:L},me.kind==="legacy"?void 0:JSON.stringify([Cs,xe]))})]}):r.jsxs(mr,{orientation:"horizontal",disabled:ye!=="blocks",className:"relative isolate",children:[r.jsx(is,{ref:j,id:"preview-blocks-editor",defaultSize:ye==="blocks"?"30%":"0%",minSize:"20%",collapsible:!0,collapsedSize:"0%",className:"min-w-0 overflow-hidden",children:ye==="blocks"&&r.jsx(Cr,{virtualMcpId:t,externalSelection:T,onSectionPicked:Bn,onViewJsonFile:F})}),ye==="blocks"&&r.jsx(hr,{withHandle:!0}),r.jsx(is,{id:"preview-canvas",defaultSize:ye==="blocks"?"70%":"100%",minSize:"35%",className:"min-w-0 overflow-hidden relative z-0",children:r.jsxs(mr,{orientation:"horizontal",disabled:!(C&&it),children:[r.jsx(is,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:r.jsxs("div",{ref:u=>{if(!u)return;const P=()=>$(ae=>ae.width===u.clientWidth&&ae.height===u.clientHeight?ae:{width:u.clientWidth,height:u.clientHeight});P();const M=new ResizeObserver(P);return M.observe(u),()=>M.disconnect()},className:Re("h-full relative overflow-clip flex justify-center",Et&&!rs&&"bg-muted/30"),children:[(be||Fa)&&Et&&r.jsx(Ji,{}),te.showDecidingLoader&&r.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:r.jsx(rt,{className:"size-5 text-muted-foreground"})}),te.showBlockingOverlay&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Fs,{kind:"starting",progress:mn,claimPhase:ys})}),!ne&&Je.kind==="suspended"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Fs,{kind:"suspended",onResume:ze.resume})}),!ne&&Je.kind==="errored"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Fs,{kind:"errored",error:Je.error,onRetry:ze.retry,connectionsHref:`/${ce.slug}/settings/connections`})}),te.showWakingPill&&r.jsxs("div",{className:"absolute top-4 left-1/2 z-20 flex max-w-md -translate-x-1/2 items-start gap-3 rounded-xl bg-muted px-4 py-3 shadow-soft pointer-events-none select-none",children:[r.jsx(rt,{className:"size-4.5 mt-0.5 shrink-0 text-muted-foreground"}),r.jsxs("div",{className:"flex flex-col gap-0.5",children:[r.jsx("span",{className:"text-sm font-medium text-foreground",children:e("sandbox.preview.startingPreview")}),r.jsx("span",{className:"text-xs text-muted-foreground",children:e("sandbox.preview.startingPreviewHint")})]})]}),ye==="visual"&&!v&&r.jsxs("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full border border-special/40 bg-special/90 px-3 py-1 text-xs font-medium text-special-foreground shadow-soft backdrop-blur-sm pointer-events-none select-none",children:[r.jsx(sr,{size:12}),e("sandbox.preview.clickElementToAsk")]}),ye==="visual"&&v&&r.jsx(tc,{element:v,onDismiss:()=>w(null)}),Et&&Qe&&r.jsx("div",{className:Re("shrink-0",!rs&&"bg-background shadow-edge"),style:mi,onMouseLeave:ni,children:r.jsx("iframe",{ref:S,src:ut,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Rn.handleError,onLoad:()=>{if(ks(nr),Qa(ut),Rn.handleLoad(),fe(),Ns.current=lt.current,_t&&_s(At),te.mode!=="sandbox"||ne){(te.mode==="production"&&!te.showWakingPill||ne)&&ye==="blocks"&&Es();return}if(Pi("vm_preview_loaded",{view_mode:ye,vm_id:Ie?.sandboxHandle??null}),!E)try{const u=S.current?.contentWindow?.location?.pathname;if(!u)return;const P=De.current;if(P!==null&&(De.current=null,Ne(u)!==Ne(P))||Ne(u)===Ne(Te))return;Z(u),Rt({path:u,pageKey:re,params:ot})}catch{}ye==="visual"&&Dn(),ye==="blocks"&&Es()}},te.iframeBase)})]})}),C&&it&&r.jsxs(r.Fragment,{children:[r.jsx(hr,{withHandle:!0}),r.jsx(is,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:r.jsx(Tr,{ref:A,virtualMcpId:t,pageKey:it,onClose:L},me.kind==="legacy"?void 0:JSON.stringify([Cs,xe]))})]})]})})]})}),r.jsx(Gc,{open:ee,onOpenChange:H,isPending:on.isPending,error:J,templates:Ge,onSubmit:ui})]})}const Ys={app:null,split:!1};function Bd(t){const e=le.c(24),{project:s,maxApps:n,children:a}=t,c=Ee();let d;e[0]===Symbol.for("react.memo_cache_sentinel")?(d={silent:!0},e[0]=d):d=e[0];const o=Ki(d),i=xt();let l;e[1]!==s.metadata.runtime?(l=s.metadata.runtime??{},e[1]=s.metadata.runtime,e[2]=l):l=e[2];const m=l;let f;e[3]!==m.apps?(f=m.apps??[],e[3]=m.apps,e[4]=f):f=e[4];const p=f;let y;e[5]!==o.update||e[6]!==i||e[7]!==s.id||e[8]!==s.metadata||e[9]!==m||e[10]!==c?(y=v=>o.update.mutate({id:s.id,data:{metadata:{...fl(s.metadata),runtime:{...m,apps:v.length?v:null}}}},{onSuccess:()=>i.start(),onError:()=>fs.error(c("sandbox.appTabs.saveError"))}),e[5]=o.update,e[6]=i,e[7]=s.id,e[8]=s.metadata,e[9]=m,e[10]=c,e[11]=y):y=e[11];const x=y,b=m.path??null;let h,g;e[12]!==p||e[13]!==x?(h=v=>x([...p,{path:v}]),g=v=>x(p.filter(w=>w.path!==v)),e[12]=p,e[13]=x,e[14]=h,e[15]=g):(h=e[14],g=e[15]);let R;return e[16]!==p||e[17]!==a||e[18]!==n||e[19]!==s.id||e[20]!==b||e[21]!==h||e[22]!==g?(R=r.jsx(Md,{virtualMcpId:s.id,mainPath:b,apps:p,maxApps:n,onAddApp:h,onRemoveApp:g,children:a}),e[16]=p,e[17]=a,e[18]=n,e[19]=s.id,e[20]=b,e[21]=h,e[22]=g,e[23]=R):R=e[23],R}function Md(t){const e=le.c(102),{virtualMcpId:s,mainPath:n,apps:a,maxApps:c,onAddApp:d,onRemoveApp:o,children:i}=t,l=Ee(),m=aa(),{currentBranch:f}=at(),p=xt(),y=tn().lifecycle.phase,x=Kt(s,f),{url:b}=na(s);let h;e[0]!==x||e[1]!==b?(h=He(x)??b,e[0]=x,e[1]=b,e[2]=h):h=e[2];const g=h,R=g??p.previewUrl,v=!!g||y==="running",w=!v&&p.status==="errored";let T;e[3]!==p.vmEntry?.startedWith?.apps?(T=p.vmEntry?.startedWith?.apps??[],e[3]=p.vmEntry?.startedWith?.apps,e[4]=T):T=e[4];const k=T;let S;e[5]!==s?(S=Hs.previewAppLayout(s),e[5]=s,e[6]=S):S=e[6];const[j,C]=Ks(S,zd);let B;e[7]!==a||e[8]!==j?(B=a.some(fe=>fe.path===j.app)?j.app:null,e[7]=a,e[8]=j,e[9]=B):B=e[9];const A=B,L=A!==null&&j.split&&!m,F=A===null||L,O=A??a[0]?.path??null,[$,I]=N.useState(null),[G,W]=N.useState(!1);let Y;e[10]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>{I(null),W(!1)},e[10]=Y):Y=e[10];const q=Y;let Q;e[11]!==a||e[12]!==$||e[13]!==m||e[14]!==n||e[15]!==d||e[16]!==C?(Q=()=>{if($===null)return;const fe=xr($);if(!fe){q();return}if(fe===xr(n??"")||a.some(ce=>ce.path===fe)){W(!0);return}d(fe),C({app:fe,split:!m}),q()},e[11]=a,e[12]=$,e[13]=m,e[14]=n,e[15]=d,e[16]=C,e[17]=Q):Q=e[17];const K=Q;let ee;e[18]!==n||e[19]!==l?(ee=n?Ds(n):l("sandbox.appTabs.root"),e[18]=n,e[19]=l,e[20]=ee):ee=e[20];const H=ee;let J;e[21]!==L||e[22]!==l?(J=l(L?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=L,e[22]=l,e[23]=J):J=e[23];const V=J;let E;e[24]!==l?(E=l("sandbox.appTabs.label"),e[24]=l,e[25]=E):E=e[25];let _;e[26]!==l?(_=l("sandbox.appTabs.main"),e[26]=l,e[27]=_):_=e[27];let D;e[28]!==l?(D=l("sandbox.appTabs.mainHint"),e[28]=l,e[29]=D):D=e[29];let U;e[30]!==C?(U=()=>C(Ys),e[30]=C,e[31]=U):U=e[31];let X;e[32]!==w||e[33]!==H||e[34]!==v||e[35]!==F||e[36]!==_||e[37]!==D||e[38]!==U?(X=r.jsx(Lr,{label:H,badge:_,hint:D,ready:v,failed:w,onScreen:F,onSelect:U}),e[32]=w,e[33]=H,e[34]=v,e[35]=F,e[36]=_,e[37]=D,e[38]=U,e[39]=X):X=e[39];let se;if(e[40]!==a||e[41]!==A||e[42]!==w||e[43]!==H||e[44]!==o||e[45]!==v||e[46]!==C||e[47]!==L||e[48]!==l){let fe;e[50]!==A||e[51]!==w||e[52]!==H||e[53]!==o||e[54]!==v||e[55]!==C||e[56]!==L||e[57]!==l?(fe=ce=>{const Le=Ds(ce.path);return r.jsx(Lr,{label:Le,hint:l("sandbox.appTabs.extraHint",{app:H}),ready:v,failed:w,onScreen:ce.path===A,onSelect:()=>C({app:ce.path,split:L}),onRemove:()=>o(ce.path),removeLabel:l("sandbox.appTabs.remove",{app:Le})},ce.path)},e[50]=A,e[51]=w,e[52]=H,e[53]=o,e[54]=v,e[55]=C,e[56]=L,e[57]=l,e[58]=fe):fe=e[58],se=a.map(fe),e[40]=a,e[41]=A,e[42]=w,e[43]=H,e[44]=o,e[45]=v,e[46]=C,e[47]=L,e[48]=l,e[49]=se}else se=e[49];let z;e[59]!==X||e[60]!==se||e[61]!==E?(z=r.jsxs("div",{role:"tablist","aria-label":E,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[X,se]}),e[59]=X,e[60]=se,e[61]=E,e[62]=z):z=e[62];let Z;e[63]!==a.length||e[64]!==K||e[65]!==$||e[66]!==G||e[67]!==c||e[68]!==l?(Z=$!==null?r.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),K()},children:r.jsx("input",{autoFocus:!0,value:$,placeholder:"apps/checkout","aria-label":l("sandbox.appTabs.pathLabel"),"aria-invalid":G,onChange:fe=>{I(fe.target.value),W(!1)},onBlur:q,onKeyDown:fe=>{fe.key==="Escape"&&q()},className:Re("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",G?"border-destructive":"border-border")})}):a.length<c&&r.jsx(vt,{label:l("sandbox.appTabs.add"),onClick:()=>I(""),children:r.jsx(Hr,{})}),e[63]=a.length,e[64]=K,e[65]=$,e[66]=G,e[67]=c,e[68]=l,e[69]=Z):Z=e[69];let re;e[70]!==m||e[71]!==C||e[72]!==L||e[73]!==V||e[74]!==O?(re=!m&&O&&r.jsx(vt,{label:V,active:L,onClick:()=>C(L?Ys:{app:O,split:!0}),children:r.jsx(Ii,{})}),e[70]=m,e[71]=C,e[72]=L,e[73]=V,e[74]=O,e[75]=re):re=e[75];let ie;e[76]!==z||e[77]!==Z||e[78]!==re?(ie=r.jsxs(r.Fragment,{children:[z,Z,re]}),e[76]=z,e[77]=Z,e[78]=re,e[79]=ie):ie=e[79];const he=ie;let pe;e[80]!==he?(pe=r.jsx(Vs.Topbar.Left.Portal,{fallback:r.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:he}),children:r.jsx("div",{className:"ml-1 flex min-w-0 items-center gap-1 border-l border-border/60 pl-2",children:he})}),e[80]=he,e[81]=pe):pe=e[81];let be;e[82]!==i||e[83]!==F?(be=F&&r.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:i}),e[82]=i,e[83]=F,e[84]=be):be=e[84];let ge;e[85]!==A||e[86]!==w||e[87]!==p.start||e[88]!==g||e[89]!==H||e[90]!==R||e[91]!==v||e[92]!==C||e[93]!==L||e[94]!==k?(ge=A!==null&&r.jsx(Id,{name:Ds(A),mainName:H,appUrl:R?pl(R,A):null,ready:v,failed:w,notStarted:!g&&!k.includes(A),onStart:p.start,className:Re(L&&"border-l border-border"),onClose:L?()=>C({app:A,split:!1}):void 0},A),e[85]=A,e[86]=w,e[87]=p.start,e[88]=g,e[89]=H,e[90]=R,e[91]=v,e[92]=C,e[93]=L,e[94]=k,e[95]=ge):ge=e[95];let ve;e[96]!==be||e[97]!==ge?(ve=r.jsxs("div",{className:"flex min-h-0 flex-1",children:[be,ge]}),e[96]=be,e[97]=ge,e[98]=ve):ve=e[98];let Se;return e[99]!==pe||e[100]!==ve?(Se=r.jsxs("div",{className:"flex h-full w-full min-h-0 flex-col",children:[pe,ve]}),e[99]=pe,e[100]=ve,e[101]=Se):Se=e[101],Se}function zd(t){return t??Ys}function Lr(t){const e=le.c(28),{label:s,badge:n,hint:a,ready:c,failed:d,onScreen:o,onSelect:i,onRemove:l,removeLabel:m}=t,f=o?"bg-sidebar-accent text-foreground":"text-muted-foreground hover:bg-sidebar-accent/60 hover:text-foreground";let p;e[0]!==f?(p=Re("group/app-tab flex h-7 shrink-0 items-center rounded-md text-xs transition-colors",f),e[0]=f,e[1]=p):p=e[1];const y=c?"bg-success":d?"bg-destructive":"animate-pulse bg-warning";let x;e[2]!==y?(x=Re("size-1.5 rounded-full",y),e[2]=y,e[3]=x):x=e[3];let b;e[4]!==x?(b=r.jsx("span",{"aria-hidden":!0,className:x}),e[4]=x,e[5]=b):b=e[5];let h;e[6]!==s?(h=r.jsx("span",{className:"max-w-40 truncate",children:s}),e[6]=s,e[7]=h):h=e[7];let g;e[8]!==n?(g=n&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:n}),e[8]=n,e[9]=g):g=e[9];let R;e[10]!==o||e[11]!==i||e[12]!==b||e[13]!==h||e[14]!==g?(R=r.jsx(et,{asChild:!0,children:r.jsxs("button",{type:"button",role:"tab","aria-selected":o,onClick:i,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[b,h,g]})}),e[10]=o,e[11]=i,e[12]=b,e[13]=h,e[14]=g,e[15]=R):R=e[15];let v;e[16]!==a?(v=r.jsx(tt,{className:"max-w-64",children:a}),e[16]=a,e[17]=v):v=e[17];let w;e[18]!==R||e[19]!==v?(w=r.jsxs(st,{children:[R,v]}),e[18]=R,e[19]=v,e[20]=w):w=e[20];let T;e[21]!==l||e[22]!==m?(T=l&&r.jsx("button",{type:"button","aria-label":m,onClick:l,className:"-ml-1 mr-1 flex size-5 items-center justify-center rounded opacity-0 hover:bg-sidebar-accent focus-ring focus-visible:opacity-100 group-hover/app-tab:opacity-100",children:r.jsx(xa,{className:"size-3"})}),e[21]=l,e[22]=m,e[23]=T):T=e[23];let k;return e[24]!==w||e[25]!==T||e[26]!==p?(k=r.jsxs("div",{className:p,children:[w,T]}),e[24]=w,e[25]=T,e[26]=p,e[27]=k):k=e[27],k}function Id(t){const e=le.c(71),{name:s,mainName:n,appUrl:a,ready:c,failed:d,notStarted:o,onStart:i,className:l,onClose:m}=t,f=Ee(),[p,y]=N.useState("/"),[x,b]=N.useState("desktop"),[h,g]=N.useState(0),R=N.useRef(null);let v;e[0]!==a||e[1]!==p?(v=a?ml(a,p):null,e[0]=a,e[1]=p,e[2]=v):v=e[2];const w=v;let T;e[3]!==l?(T=Re("flex min-h-0 min-w-0 flex-1 flex-col",l),e[3]=l,e[4]=T):T=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=D=>{D.preventDefault(),y(R.current?.value||"/")},e[5]=k):k=e[5];let S;e[6]!==s||e[7]!==f?(S=f("sandbox.appPane.path",{app:s}),e[6]=s,e[7]=f,e[8]=S):S=e[8];let j;e[9]!==p||e[10]!==S?(j=r.jsx("form",{className:"min-w-0 flex-1",onSubmit:k,children:r.jsx("input",{ref:R,defaultValue:p,"aria-label":S,className:"h-7 w-full rounded-md border border-border/60 bg-background px-2 font-mono text-xs text-muted-foreground outline-none hover:border-border focus:border-border focus:text-foreground"})}),e[9]=p,e[10]=S,e[11]=j):j=e[11];let C;e[12]!==x||e[13]!==f?(C=f(x==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=x,e[13]=f,e[14]=C):C=e[14];let B;e[15]===Symbol.for("react.memo_cache_sentinel")?(B=()=>b(Kd),e[15]=B):B=e[15];let A;e[16]!==x?(A=x==="desktop"?r.jsx(Kr,{}):r.jsx(Ur,{}),e[16]=x,e[17]=A):A=e[17];let L;e[18]!==C||e[19]!==A?(L=r.jsx(vt,{label:C,onClick:B,children:A}),e[18]=C,e[19]=A,e[20]=L):L=e[20];let F;e[21]!==s||e[22]!==f?(F=f("sandbox.appPane.reload",{app:s}),e[21]=s,e[22]=f,e[23]=F):F=e[23];const O=!w||!c;let $,I;e[24]===Symbol.for("react.memo_cache_sentinel")?($=()=>g(Ud),I=r.jsx(ji,{}),e[24]=$,e[25]=I):($=e[24],I=e[25]);let G;e[26]!==F||e[27]!==O?(G=r.jsx(vt,{label:F,disabled:O,onClick:$,children:I}),e[26]=F,e[27]=O,e[28]=G):G=e[28];let W;e[29]!==s||e[30]!==f?(W=f("sandbox.appPane.openInNewTab",{app:s}),e[29]=s,e[30]=f,e[31]=W):W=e[31];const Y=!w||!c;let q;e[32]!==w?(q=()=>w&&window.open(w,"_blank","noopener"),e[32]=w,e[33]=q):q=e[33];let Q;e[34]===Symbol.for("react.memo_cache_sentinel")?(Q=r.jsx(Br,{}),e[34]=Q):Q=e[34];let K;e[35]!==W||e[36]!==Y||e[37]!==q?(K=r.jsx(vt,{label:W,disabled:Y,onClick:q,children:Q}),e[35]=W,e[36]=Y,e[37]=q,e[38]=K):K=e[38];let ee;e[39]!==s||e[40]!==m||e[41]!==f?(ee=m&&r.jsx(vt,{label:f("sandbox.appPane.close",{app:s}),onClick:m,children:r.jsx(xa,{})}),e[39]=s,e[40]=m,e[41]=f,e[42]=ee):ee=e[42];let H;e[43]!==G||e[44]!==K||e[45]!==ee||e[46]!==j||e[47]!==L?(H=r.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[j,L,G,K,ee]}),e[43]=G,e[44]=K,e[45]=ee,e[46]=j,e[47]=L,e[48]=H):H=e[48];let J;e[49]!==n||e[50]!==f?(J=f("sandbox.appPane.previewOnly",{app:n}),e[49]=n,e[50]=f,e[51]=J):J=e[51];let V;e[52]!==J?(V=r.jsx("p",{className:"shrink-0 truncate border-b border-border bg-muted/40 px-3 py-1.5 text-xs text-muted-foreground",children:J}),e[52]=J,e[53]=V):V=e[53];let E;e[54]!==x||e[55]!==d||e[56]!==n||e[57]!==s||e[58]!==o||e[59]!==i||e[60]!==c||e[61]!==h||e[62]!==w||e[63]!==f?(E=r.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:c&&o?r.jsxs("div",{className:"flex flex-col items-center gap-3 self-center px-6 text-center",children:[r.jsx("p",{className:"text-sm text-muted-foreground",children:f("sandbox.appPane.notStarted",{app:s})}),r.jsx(Oe,{size:"sm",variant:"outline",onClick:i,children:f("sandbox.appPane.start",{app:s})})]}):!c||!w?r.jsx("p",{className:"self-center px-6 text-center text-sm text-muted-foreground",children:c?f("sandbox.appPane.noUrl"):d?f("sandbox.appPane.failed",{app:n}):f("sandbox.appPane.waiting")}):r.jsx("iframe",{src:w,title:s,className:Re("h-full bg-background",x==="mobile"?"w-[412px] max-w-full border-x border-border":"w-full")},`${w}#${h}`)}),e[54]=x,e[55]=d,e[56]=n,e[57]=s,e[58]=o,e[59]=i,e[60]=c,e[61]=h,e[62]=w,e[63]=f,e[64]=E):E=e[64];let _;return e[65]!==s||e[66]!==T||e[67]!==H||e[68]!==V||e[69]!==E?(_=r.jsxs("section",{"aria-label":s,className:T,children:[H,V,E]}),e[65]=s,e[66]=T,e[67]=H,e[68]=V,e[69]=E,e[70]=_):_=e[70],_}function Ud(t){return t+1}function Kd(t){return t==="desktop"?"mobile":"desktop"}function vt(t){const e=le.c(11),{label:s,children:n,active:a,disabled:c,onClick:d}=t;let o;e[0]!==a||e[1]!==n||e[2]!==c||e[3]!==s||e[4]!==d?(o=r.jsx(et,{asChild:!0,children:r.jsx(Ze,{"aria-label":s,"aria-pressed":a,active:a,disabled:c,onClick:d,children:n})}),e[0]=a,e[1]=n,e[2]=c,e[3]=s,e[4]=d,e[5]=o):o=e[5];let i;e[6]!==s?(i=r.jsx(tt,{children:s}),e[6]=s,e[7]=i):i=e[7];let l;return e[8]!==o||e[9]!==i?(l=r.jsxs(st,{children:[o,i]}),e[8]=o,e[9]=i,e[10]=l):l=e[10],l}const Hd=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},Vd=1e4,Wd=1e4,qd=5e3,Gd=2;function Jd(t,e){return t&&e===0?Wd:Math.min(1e3*2**Math.max(0,e-1),qd)}function Yd(t,e,s){return e?!0:t===!0&&s<Gd}function Qd(t,e){const s=le.c(11),n=Hd,a=Ei();let c;s[0]!==t?(c=Qs.localAppReachable(t??""),s[0]=t,s[1]=c):c=s[1];const d=c;let o;s[2]!==n||s[3]!==a||s[4]!==d||s[5]!==t?(o=async f=>{const{signal:p}=f,y=new AbortController,x=()=>y.abort();p.addEventListener("abort",x);const b=setTimeout(x,Vd),h=await n(t,y.signal).catch(Zd);clearTimeout(b),p.removeEventListener("abort",x);const g=a.getQueryData(d),R=h?0:(g?.failures??0)+1;return{up:Yd(g?.up??null,h,R),failures:R}},s[2]=n,s[3]=a,s[4]=d,s[5]=t,s[6]=o):o=s[6];const i=!!t;let l;s[7]!==d||s[8]!==o||s[9]!==i?(l={queryKey:d,queryFn:o,enabled:i,retry:!1,staleTime:0,gcTime:0,refetchInterval:Xd},s[7]=d,s[8]=o,s[9]=i,s[10]=l):l=s[10];const{data:m}=$r(l);return t?m?.up??null:null}function Xd(t){return t.state.data?Jd(t.state.data.up,t.state.data.failures):!1}function Zd(){return!1}function eu(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 lf(t){const e=le.c(53),{virtualMcpId:s}=t,n=Ee(),a=Hi(s),{connection:c}=ra(s),{activeTask:d,taskId:o,currentBranch:i}=at(),l=kl(o),[m,f]=N.useState(!1),p=Kt(s,i);let y;e[0]!==p||e[1]!==c?(y=c?He(p):null,e[0]=p,e[1]=c,e[2]=y):y=e[2];const x=y,b=Qd(x),h=ya(),g=hl("multi_app_preview");if(xl({threadId:o,sandboxBranch:d?.branch??i,agentHasRepo:$s(a?.metadata),threadHasRepo:$s(l)||$s(d?.metadata)})==="none"&&!c){let k;e[3]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx("div",{className:"flex size-14 items-center justify-center rounded-full bg-muted",children:r.jsx(br,{className:"size-7 text-foreground"})}),e[3]=k):k=e[3];let S;e[4]!==n?(S=n("mainPanelTabs.previewTab.noSourceToPreview"),e[4]=n,e[5]=S):S=e[5];let j;e[6]!==n?(j=n("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=n,e[7]=j):j=e[7];let C,B;e[8]===Symbol.for("react.memo_cache_sentinel")?(C=()=>f(!0),B=r.jsx(br,{className:"size-4"}),e[8]=C,e[9]=B):(C=e[8],B=e[9]);let A;e[10]!==n?(A=n("mainPanelTabs.previewTab.connectGithub"),e[10]=n,e[11]=A):A=e[11];let L;e[12]!==A?(L=r.jsxs(Oe,{onClick:C,children:[B,A]}),e[12]=A,e[13]=L):L=e[13];let F;e[14]!==S||e[15]!==j||e[16]!==L?(F=r.jsx(gl,{className:"h-full",image:k,title:S,description:j,actions:L}),e[14]=S,e[15]=j,e[16]=L,e[17]=F):F=e[17];let O;e[18]!==m?(O=r.jsx(vl,{open:m,onOpenChange:f,mode:"agent"}),e[18]=m,e[19]=O):O=e[19];let $;return e[20]!==O||e[21]!==F?($=r.jsxs(r.Fragment,{children:[F,O]}),e[20]=O,e[21]=F,e[22]=$):$=e[22],$}if(c&&a&&!He(p)){let k;e[23]!==h||e[24]!==p?(k=eu({backend:p,access:h}),e[23]=h,e[24]=p,e[25]=k):k=e[25];let S;e[26]!==c.endpoint?(S=wo(c.endpoint),e[26]=c.endpoint,e[27]=S):S=e[27];let j;return e[28]!==k||e[29]!==S?(j=r.jsx(su,{status:k,host:S}),e[28]=k,e[29]=S,e[30]=j):j=e[30],j}if(x&&b!==!0){let k;e[31]!==n?(k=n("mainPanelTabs.previewTab.localAppWaiting.title"),e[31]=n,e[32]=k):k=e[32];let S;e[33]!==x||e[34]!==n?(S=n("mainPanelTabs.previewTab.localAppWaiting.body",{host:tu(x)}),e[33]=x,e[34]=n,e[35]=S):S=e[35];let j;e[36]!==S?(j=r.jsx(va,{text:S}),e[36]=S,e[37]=j):j=e[37];let C;e[38]!==n?(C=n("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=n,e[39]=C):C=e[39];let B;e[40]!==C?(B=r.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:C}),e[40]=C,e[41]=B):B=e[41];let A;return e[42]!==k||e[43]!==j||e[44]!==B?(A=r.jsx(ps,{headingLevel:2,waiting:!0,title:k,lead:j,footer:B}),e[42]=k,e[43]=j,e[44]=B,e[45]=A):A=e[45],A}let v;e[46]!==s?(v=r.jsx($d,{virtualMcpId:s}),e[46]=s,e[47]=v):v=e[47];const w=v;let T;return e[48]!==a||e[49]!==g||e[50]!==w||e[51]!==c?(T=r.jsx(Ni,{children:g&&a&&!c?r.jsx(Bd,{project:a,maxApps:dl,children:w}):w}),e[48]=a,e[49]=g,e[50]=w,e[51]=c,e[52]=T):T=e[52],T}function tu(t){try{return new URL(t).host}catch{return t}}function su(t){const e=le.c(13),{status:s,host:n}=t,a=Ee();if(s.kind==="connected"){let o;e[0]!==a?(o=a("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=a,e[1]=o):o=e[1];let i;e[2]!==a?(i=a("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=a,e[3]=i):i=e[3];let l;return e[4]!==o||e[5]!==i?(l=r.jsx(ps,{headingLevel:2,waiting:!1,title:o,lead:i}),e[4]=o,e[5]=i,e[6]=l):l=e[6],l}let c;e[7]!==n||e[8]!==s?(c=Nl(s,n),e[7]=n,e[8]=s,e[9]=c):c=e[9];let d;return e[10]!==n||e[11]!==c?(d=r.jsx(El,{wait:c,hosts:n}),e[10]=n,e[11]=c,e[12]=d):d=e[12],d}export{El as L,lf as P,ps as S,of as u};