decocms 4.597.0 → 4.598.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (482) hide show
  1. package/dist/client/assets/{AlertCircle-BLw7QvfG.js → AlertCircle-jxvwS2PA.js} +1 -1
  2. package/dist/client/assets/{AreaChart-Cg0oUTGM.js → AreaChart-zoolaKB0.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-DH7F9HYx.js → ArrowLeft-Dlf39oKA.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-DZeVAIN7.js → ArrowRight-DCL3gp96.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-C_Mw0uky.js → ArrowUp-BbUoh0-h.js} +1 -1
  6. package/dist/client/assets/{BookOpen01-9fv3inuR.js → BookOpen01-C85UtDum.js} +1 -1
  7. package/dist/client/assets/{CartesianChart-B1PjlPEb.js → CartesianChart-Bl1HZv9F.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-CcMGdgiC.js → CategoricalChart-jjkJNbxp.js} +1 -1
  9. package/dist/client/assets/{CheckCircle--1SXoxG_.js → CheckCircle-KztuMvd5.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-DwO0ALfW.js → ChevronDown-c_BdXEOA.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-Bj17dUxw.js → ChevronSelectorVertical-DmpvIgAy.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-BaiO1bgX.js → ChevronUp-BSWVeXQq.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-D6jLDMwS.js → CreditCard01-C4dCRCdu.js} +1 -1
  14. package/dist/client/assets/{Eye-DvcGz393.js → Eye-BSRrcDT9.js} +1 -1
  15. package/dist/client/assets/{File02-Bes4ATvL.js → File02-KoBPCXEf.js} +1 -1
  16. package/dist/client/assets/{Fingerprint04-BpB7HSc7.js → Fingerprint04-B2N20uu4.js} +1 -1
  17. package/dist/client/assets/{Globe04-BBsqVmHb.js → Globe04-UMTQ82HG.js} +1 -1
  18. package/dist/client/assets/{Image01-D2QOi7x6.js → Image01-BGM1ArTz.js} +1 -1
  19. package/dist/client/assets/{Key01-CDcaZkCg.js → Key01-BMkzySkS.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-19qu82-A.js → LayoutLeft-DrOR8tOg.js} +1 -1
  21. package/dist/client/assets/{LinkBroken01-Z9hP4zTf.js → LinkBroken01-hoBFLv94.js} +1 -1
  22. package/dist/client/assets/{MessageCircle01-DjShhQqZ.js → MessageCircle01-CDpj4jpt.js} +1 -1
  23. package/dist/client/assets/{Minus-ChoEICrx.js → Minus-DdEPrbsD.js} +1 -1
  24. package/dist/client/assets/{Monitor01-DtssQiym.js → Monitor01-B4iHbF93.js} +1 -1
  25. package/dist/client/assets/{Play-DatgPxza.js → Play-Clz2e0s4.js} +1 -1
  26. package/dist/client/assets/{Plus-GSWEwEm-.js → Plus-CO40HUhB.js} +1 -1
  27. package/dist/client/assets/{ReferenceLine-Cl-8dOcW.js → ReferenceLine-CeSeSzH6.js} +1 -1
  28. package/dist/client/assets/{SearchMd-DhrJsmFj.js → SearchMd-FI2fcykP.js} +1 -1
  29. package/dist/client/assets/{ShoppingBag01-DQR5ci-Q.js → ShoppingBag01-BBDr_WSy.js} +1 -1
  30. package/dist/client/assets/{Sun-Dpzqhodu.js → Sun-D531tFmZ.js} +1 -1
  31. package/dist/client/assets/{SwitchHorizontal01-NAHL2C3Y.js → SwitchHorizontal01-B8iZqdiB.js} +1 -1
  32. package/dist/client/assets/{Tool01-DJqLAFcI.js → Tool01-CldemTEe.js} +1 -1
  33. package/dist/client/assets/{Tooltip-fSWtSvYM.js → Tooltip-B1dYEjVO.js} +1 -1
  34. package/dist/client/assets/{Trash01-Br_8Dd8k.js → Trash01-W_zwe5xo.js} +1 -1
  35. package/dist/client/assets/{Upload01-B1gnueEL.js → Upload01-DDGkOE5t.js} +1 -1
  36. package/dist/client/assets/{UserCheck01-CpLKejEQ.js → UserCheck01-VgBUlrC3.js} +1 -1
  37. package/dist/client/assets/{UserSquare-D1HQ9ju8.js → UserSquare-YQkID8bv.js} +1 -1
  38. package/dist/client/assets/{Users01-qnd_BT_N.js → Users01-CJ_YMgJe.js} +1 -1
  39. package/dist/client/assets/{XClose-BbVr5nc7.js → XClose-Dv4YALPV.js} +1 -1
  40. package/dist/client/assets/{Zap-B1JA6VL5.js → Zap-DFubAl8b.js} +1 -1
  41. package/dist/client/assets/{access-gate-m6QmHtAD.js → access-gate-C-gJXueM.js} +1 -1
  42. package/dist/client/assets/{add-connection-dialog-BIOFD97r.js → add-connection-dialog-DyPd4ss_.js} +1 -1
  43. package/dist/client/assets/agent-app-BxXBXF3L.js +1 -0
  44. package/dist/client/assets/agent-assets-CFkP_Dfu.js +1 -0
  45. package/dist/client/assets/{agent-automation-to9UMVoQ.js → agent-automation-BaYqgCX1.js} +2 -2
  46. package/dist/client/assets/agent-automations-DBsSsUGW.js +1 -0
  47. package/dist/client/assets/agent-blog-lx6Ts7x1.js +2 -0
  48. package/dist/client/assets/agent-blog-post-BeOLBeeI.js +2 -0
  49. package/dist/client/assets/agent-calendar-BnmK4XQ1.js +1 -0
  50. package/dist/client/assets/{agent-capabilities-B8dQ_ZB8.js → agent-capabilities-CTj-iH2e.js} +1 -1
  51. package/dist/client/assets/agent-connect-sources-CH4TSb8y.js +1 -0
  52. package/dist/client/assets/agent-deck-DCB6fHd3.js +1 -0
  53. package/dist/client/assets/agent-e2e-BTYjDJlF.js +1 -0
  54. package/dist/client/assets/agent-experiments-Cw9pv6Dn.js +1 -0
  55. package/dist/client/assets/agent-file-CTx06rQr.js +1 -0
  56. package/dist/client/assets/agent-hosting-B5D0b6SX.js +1 -0
  57. package/dist/client/assets/agent-icon-CF35JltL.js +1 -0
  58. package/dist/client/assets/agent-library-BwDYP2WG.js +1 -0
  59. package/dist/client/assets/agent-library-file-C81bvh62.js +1 -0
  60. package/dist/client/assets/agent-overview-K-iHxR1q.js +1 -0
  61. package/dist/client/assets/{agent-releases-DxZH4Aop.js → agent-releases-BwmxxOKG.js} +1 -1
  62. package/dist/client/assets/agent-settings-DSkSbN3M.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-BVDN7iAe.js → agent-site-editor-AlBg5D2V.js} +1 -1
  64. package/dist/client/assets/agent-site-editor-code-DKlbc-rv.js +2 -0
  65. package/dist/client/assets/agent-site-editor-content-D8oVt80T.js +1 -0
  66. package/dist/client/assets/agent-site-editor-preview-C7REepxK.js +1 -0
  67. package/dist/client/assets/agent-view-B_4cQTkH.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-DgSIx4Rz.js → agent-view-guard-ZsSVHdZf.js} +1 -1
  69. package/dist/client/assets/{ai-providers-BLNPddjm.js → ai-providers-hSqz3WwB.js} +1 -1
  70. package/dist/client/assets/{alert-B3inZFUT.js → alert-DvKjRxar.js} +1 -1
  71. package/dist/client/assets/{analytics-sections-CTzZQv_A.js → analytics-sections-VB2fGveD.js} +1 -1
  72. package/dist/client/assets/api-keys-1OldN0tT.js +1 -0
  73. package/dist/client/assets/{api-keys-D5yeJ96D.js → api-keys-5hVWR6f4.js} +1 -1
  74. package/dist/client/assets/app-editor-CKOA7wEE.js +1 -0
  75. package/dist/client/assets/{asset-utils-FQrgs53r.js → asset-utils-DRModSGS.js} +1 -1
  76. package/dist/client/assets/{auth-DlYbrS5R.js → auth-Ry9WrZV8.js} +1 -1
  77. package/dist/client/assets/{auth-catchall-DovAKkgg.js → auth-catchall-DJ81nN52.js} +1 -1
  78. package/dist/client/assets/{auth-entry-BeARMnxr.js → auth-entry-N3iwaDe6.js} +1 -1
  79. package/dist/client/assets/{auth-split-layout-CnJuCNmk.js → auth-split-layout-DRc17L6c.js} +1 -1
  80. package/dist/client/assets/{authenticate-and-persist-oauth-Da9zgsaC.js → authenticate-and-persist-oauth-ZYDIddXa.js} +1 -1
  81. package/dist/client/assets/{automation-list-row-Cfemy10y.js → automation-list-row-DW-hLflG.js} +1 -1
  82. package/dist/client/assets/{automation-runs-DhXlimIG.js → automation-runs-Cn3-xcc-.js} +1 -1
  83. package/dist/client/assets/automations-CVx7XBRT.js +1 -0
  84. package/dist/client/assets/{badge-CaU7DsCB.js → badge-CWKaTosK.js} +1 -1
  85. package/dist/client/assets/{block-document-D8KopzHb.js → block-document-DnIO3ig2.js} +1 -1
  86. package/dist/client/assets/{blocks-preview-workspace-context-Rebn6SsT.js → blocks-preview-workspace-context-05h1qBm4.js} +1 -1
  87. package/dist/client/assets/{blocks-tab-states-CrihrdT0.js → blocks-tab-states-DDvkpFWf.js} +1 -1
  88. package/dist/client/assets/{blog-preview-url-DM-lGGhF.js → blog-preview-url-BeobaMnK.js} +1 -1
  89. package/dist/client/assets/{blog-schema-0H53CE3k.js → blog-schema-BMIjJkjY.js} +1 -1
  90. package/dist/client/assets/{blog-source-gate-B_GOyP5p.js → blog-source-gate-CTlfDEgd.js} +1 -1
  91. package/dist/client/assets/{blog-view-gate-JzJtOYCL.js → blog-view-gate-BUKolpTm.js} +1 -1
  92. package/dist/client/assets/{buckets-CVXQhalH.js → buckets-Cojjk4Rx.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-DgQdPFxI.js → build-improve-prompt-doc-cVHB56V7.js} +1 -1
  94. package/dist/client/assets/{calendar-DZVkXGhA.js → calendar-D3_Is4BX.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-p87qKYlk.js → capability-load-error-l7VKbDu4.js} +1 -1
  96. package/dist/client/assets/category-editor-3t0p_Aia.js +1 -0
  97. package/dist/client/assets/{category-tree-DUNY9TG8.js → category-tree-rhKblFsZ.js} +1 -1
  98. package/dist/client/assets/{chart-D6tXreNC.js → chart-D0JID1mb.js} +1 -1
  99. package/dist/client/assets/{chat-context-DsLpz7ew.js → chat-context-D5EEwp_m.js} +1 -1
  100. package/dist/client/assets/{chat-draft-ODW7kZWh.js → chat-draft-CL1clhIN.js} +1 -1
  101. package/dist/client/assets/{checkbox-Bo6uhaqm.js → checkbox-DHBAzm3e.js} +1 -1
  102. package/dist/client/assets/choose-editor-CluRV_6I.js +1 -0
  103. package/dist/client/assets/{cli-auth-success-1ibs6VjG.js → cli-auth-success-D9loznd0.js} +1 -1
  104. package/dist/client/assets/cms-settings-editor-DY7QQNQD.js +1 -0
  105. package/dist/client/assets/{cms-store-drafts-Da9bgH02.js → cms-store-drafts-BocSU3zl.js} +1 -1
  106. package/dist/client/assets/{collapsible-Cug6Pp5N.js → collapsible-JCTHx5_U.js} +1 -1
  107. package/dist/client/assets/collection-detail-l7ntNzFm.js +1 -0
  108. package/dist/client/assets/{collection-display-button-BeCmwRLy.js → collection-display-button-C6AAIEpT.js} +1 -1
  109. package/dist/client/assets/{collection-search-EKEj7NYh.js → collection-search-Cez2fKoW.js} +1 -1
  110. package/dist/client/assets/{collection-table-wrapper-QVfey_uk.js → collection-table-wrapper-DkyJJZPl.js} +1 -1
  111. package/dist/client/assets/{collection-tabs-THb2ZDUR.js → collection-tabs-D0yQpVJM.js} +1 -1
  112. package/dist/client/assets/{combobox-CkvX9Of3.js → combobox-Dm0ZumLc.js} +1 -1
  113. package/dist/client/assets/{command-BA_BVypg.js → command-CALEDfdi.js} +1 -1
  114. package/dist/client/assets/{companion-mcps-section-mGMTO-21.js → companion-mcps-section-DyyItakB.js} +1 -1
  115. package/dist/client/assets/{config-DeP83Mjq.js → config-DpuCRGPS.js} +1 -1
  116. package/dist/client/assets/{connect-C-ernj3S.js → connect-DhDiKdM5.js} +3 -3
  117. package/dist/client/assets/{connect-key-B_1YtIEI.js → connect-key-BnZjV7h5.js} +1 -1
  118. package/dist/client/assets/{connect-layout-DhcQffyl.js → connect-layout-DPjmEUCP.js} +1 -1
  119. package/dist/client/assets/{connect-source-dialog-DXcG_Psx.js → connect-source-dialog-CPF3zqCW.js} +1 -1
  120. package/dist/client/assets/{connection-DUUZ34Ff.js → connection-ByE21sI5.js} +1 -1
  121. package/dist/client/assets/{connection-card-BbAx38kp.js → connection-card-v-6X4qws.js} +1 -1
  122. package/dist/client/assets/connection-detail-DOB5tzOq.js +1 -0
  123. package/dist/client/assets/{connection-form-helpers-DEnW0ORZ.js → connection-form-helpers-BZq0bQw7.js} +1 -1
  124. package/dist/client/assets/{connection-slug-Wiu7W5Ro.js → connection-slug-Cu8poN2f.js} +1 -1
  125. package/dist/client/assets/connections-BshSiFUh.js +1 -0
  126. package/dist/client/assets/content-changes-Yn1NpHw-.js +1 -0
  127. package/dist/client/assets/{content-tab-CJmgvKjP.js → content-tab-BOS9R4w0.js} +3 -3
  128. package/dist/client/assets/context-CSNMIE52.js +1 -0
  129. package/dist/client/assets/{context-menu-BvoelKnM.js → context-menu-DjuEbDwW.js} +1 -1
  130. package/dist/client/assets/{context-shell-BHDXVCRL.js → context-shell-BtuEIN_r.js} +4 -4
  131. package/dist/client/assets/{create-organization-dialog-dpA6uSHX.js → create-organization-dialog-BFbwswlq.js} +1 -1
  132. package/dist/client/assets/{daily-pulse-83GnvMF_.js → daily-pulse-Bg2uZfJ3.js} +1 -1
  133. package/dist/client/assets/{delete-copy-C8ERxzK8.js → delete-copy-CyOQI_UN.js} +1 -1
  134. package/dist/client/assets/{device-hint-5lkWUASQ.js → device-hint-1SWvGp3v.js} +1 -1
  135. package/dist/client/assets/{discover-C9WBot8k.js → discover-DRvYEfga.js} +1 -1
  136. package/dist/client/assets/{domain-settings-C7L5I-Ps.js → domain-settings-kxDrXeNT.js} +1 -1
  137. package/dist/client/assets/{drawer-Daptw1OQ.js → drawer-CLdqPUpZ.js} +1 -1
  138. package/dist/client/assets/{editor-classes-eVnt4vp_.js → editor-classes-C7cnK7Wp.js} +1 -1
  139. package/dist/client/assets/{editor-CGkWZSA7.js → editor-fCTeAQ3h.js} +1 -1
  140. package/dist/client/assets/{empty-state-Dfjwzagg.js → empty-state-BM_yXYSI.js} +1 -1
  141. package/dist/client/assets/{empty-state--1H9mx7y.js → empty-state-CHF2Jno9.js} +1 -1
  142. package/dist/client/assets/{experiments-tab-choice-BVYrDQR_.js → experiments-tab-choice-Bo36uaUs.js} +1 -1
  143. package/dist/client/assets/{extract-connection-data-Csm2LLbI.js → extract-connection-data-jy3JaUYJ.js} +1 -1
  144. package/dist/client/assets/{feature-gate-DP0JLkRq.js → feature-gate-CDxHWMHG.js} +1 -1
  145. package/dist/client/assets/{feature-paywall-CuECkoDT.js → feature-paywall-Cc43JNfz.js} +1 -1
  146. package/dist/client/assets/file-explorer-BmZFNSEt.js +2 -0
  147. package/dist/client/assets/{file-preview-J0KlNfCN.js → file-preview-DSlXa64u.js} +1 -1
  148. package/dist/client/assets/{file-share-button-1KUHqOgB.js → file-share-button-mLtJT0f8.js} +2 -2
  149. package/dist/client/assets/{file-type-icon-sxJ1fqoc.js → file-type-icon-CNUBpmBv.js} +1 -1
  150. package/dist/client/assets/{folder-icon-DfGo2fIA.js → folder-icon-Db1WLgp9.js} +1 -1
  151. package/dist/client/assets/{form-msT-Nxjd.js → form-CCzLKFB7.js} +1 -1
  152. package/dist/client/assets/{frame-navigation-COhxs0rP.js → frame-navigation-B4-_qfJ3.js} +1 -1
  153. package/dist/client/assets/{gateway-client-mrWD5tSx.js → gateway-client-Dsg5xVl5.js} +1 -1
  154. package/dist/client/assets/general-DRn37bfZ.js +1 -0
  155. package/dist/client/assets/{github-icon-DGEVXZ8I.js → github-icon-CizbgzyS.js} +1 -1
  156. package/dist/client/assets/{held-block-view-DUdsae86.js → held-block-view-CYXKzDkA.js} +1 -1
  157. package/dist/client/assets/home-BDEWRpho.js +1 -0
  158. package/dist/client/assets/{home-overview-CC9gx7Fg.js → home-overview-Cc5zUwKU.js} +1 -1
  159. package/dist/client/assets/{hosted-reconcile-DH-KyBYi.js → hosted-reconcile-BT71cbCZ.js} +1 -1
  160. package/dist/client/assets/{icon-button-am6dsn69.js → icon-button-BY-Dtplw.js} +1 -1
  161. package/dist/client/assets/{index-CDpTFqpR.js → index-BKZ2GYzY.js} +1 -1
  162. package/dist/client/assets/{index-DjWhIee5.js → index-Bf_p4D_6.js} +1 -1
  163. package/dist/client/assets/index-C3JbUkAn.js +1 -0
  164. package/dist/client/assets/{index-DgVQUrlP.js → index-C6V-s7Mj.js} +1 -1
  165. package/dist/client/assets/index-C9ybKZad.css +1 -0
  166. package/dist/client/assets/{index-B26uWbt_.js → index-D146A7MA.js} +1 -1
  167. package/dist/client/assets/{index-B2vvUsuK.js → index-D19iAD4s.js} +51 -39
  168. package/dist/client/assets/{index-DeLM7Rkt.js → index-D6VuEonE.js} +1 -1
  169. package/dist/client/assets/{index-4q-RLwEk.js → index-DAZyLaeQ.js} +1 -1
  170. package/dist/client/assets/{index-BYSU1KyF.js → index-DHiZoBJ3.js} +1 -1
  171. package/dist/client/assets/index-DP6ex8je.js +4 -0
  172. package/dist/client/assets/{index-C0WKaVxy.js → index-DS6kB3db.js} +1 -1
  173. package/dist/client/assets/{index-D0GEyG42.js → index-DWF5ASE_.js} +8 -8
  174. package/dist/client/assets/{index-CsQM0oHc.js → index-DX45d0VZ.js} +1 -1
  175. package/dist/client/assets/{index-0yoxovPZ.js → index-DeWoNfZE.js} +1 -1
  176. package/dist/client/assets/{index-D9zWR22g.js → index-DqGbUVIr.js} +2 -2
  177. package/dist/client/assets/{index-D8TuIm4d.js → index-i1TGxsLb.js} +1 -1
  178. package/dist/client/assets/{index-redirect-uY3IN3rF.js → index-redirect-1X0s58OF.js} +1 -1
  179. package/dist/client/assets/{index-C9UqnrNB.js → index-tfWzV95z.js} +1 -1
  180. package/dist/client/assets/{infiniteQueryObserver-B6MEVTvt.js → infiniteQueryObserver-B1MZYli5.js} +1 -1
  181. package/dist/client/assets/{infra-billing-4CjwqMVB.js → infra-billing-CEbGoBzj.js} +1 -1
  182. package/dist/client/assets/{input-Bzo1OCNz.js → input-DER1ofMN.js} +1 -1
  183. package/dist/client/assets/{input-DFHiqhmH.js → input-DUmEmIMD.js} +3 -3
  184. package/dist/client/assets/{integration-icon-DazsuPNm.js → integration-icon-LqaI_LSB.js} +1 -1
  185. package/dist/client/assets/{item-actions-Yc8vcOg0.js → item-actions-BQdANZXs.js} +1 -1
  186. package/dist/client/assets/{jira-icon-CsaUkukk.js → jira-icon-DNsDxAZ7.js} +1 -1
  187. package/dist/client/assets/{label-BLEP0nH0.js → label-B0UwCsXA.js} +1 -1
  188. package/dist/client/assets/{layout-c8-5uC_O.js → layout-CSIaEqJd.js} +1 -1
  189. package/dist/client/assets/{legacy-admin-welcome-dialog-DwTePCPF.js → legacy-admin-welcome-dialog-DgOZFBtI.js} +1 -1
  190. package/dist/client/assets/{legacy-agents-deep-DL8ddlj5.js → legacy-agents-deep-Cx1B7fLu.js} +1 -1
  191. package/dist/client/assets/{legacy-main-redirect-DjX7qNM7.js → legacy-main-redirect-CuOUB_B1.js} +1 -1
  192. package/dist/client/assets/library-B8otmHwX.js +1 -0
  193. package/dist/client/assets/{library-tab-DOE8AqM2.js → library-tab-BwU2UnDE.js} +1 -1
  194. package/dist/client/assets/{login--MYPwAKH.js → login-D7cd9YYg.js} +1 -1
  195. package/dist/client/assets/{markdown-COcXeIyG.js → markdown-BNFJrVwN.js} +1 -1
  196. package/dist/client/assets/{mcp-app-renderer-CDjvP8t9.js → mcp-app-renderer-ChxjPYfG.js} +1 -1
  197. package/dist/client/assets/{mcp-oauth-ciX7wK5f.js → mcp-oauth-BHqzrP9l.js} +1 -1
  198. package/dist/client/assets/{mcp-oauth-DESKCBIm.js → mcp-oauth-CIbadsEV.js} +1 -1
  199. package/dist/client/assets/{members-DKu_OhY9.js → members-CRNf5jdg.js} +1 -1
  200. package/dist/client/assets/{memory-BL_L-Q3R.js → memory-BtUUGfBH.js} +2 -2
  201. package/dist/client/assets/{mock-board--Ssgy-f6.js → mock-board-CX-WNxEi.js} +3 -3
  202. package/dist/client/assets/{monaco-editor-C0bUrX9K.js → monaco-editor-oNRDmlFg.js} +1 -1
  203. package/dist/client/assets/{monitoring-D8_3FcCV.js → monitoring-DnzPiQ3F.js} +1 -1
  204. package/dist/client/assets/{monitoring-stats-row-L0MR9OOK.js → monitoring-stats-row-eut48zN3.js} +1 -1
  205. package/dist/client/assets/{multi-select-VurXcITl.js → multi-select-CADtUZ9A.js} +1 -1
  206. package/dist/client/assets/{mustache-CSfql4oE.js → mustache-BM5hcjQo.js} +1 -1
  207. package/dist/client/assets/{named-rule-step-BfgtyNIr.js → named-rule-step-jeqaAuBi.js} +1 -1
  208. package/dist/client/assets/named-rule-view-0M7nk7ZR.js +1 -0
  209. package/dist/client/assets/{new-project-dialog-CsFe_Ifg.js → new-project-dialog-TULM28H3.js} +1 -1
  210. package/dist/client/assets/{new-project-store-D3tRl8ms.js → new-project-store-Dkp4wOSi.js} +1 -1
  211. package/dist/client/assets/{oauth-callback-hp7uk30l.js → oauth-callback-D2m0oHFc.js} +1 -1
  212. package/dist/client/assets/{oauth-callback-ai-provider-DYAZYkh4.js → oauth-callback-ai-provider-Cg2K-hUv.js} +1 -1
  213. package/dist/client/assets/{oauth-consent-Buw7iq_C.js → oauth-consent-Cey84Qly.js} +1 -1
  214. package/dist/client/assets/{onboarding-CPK6bWVC.js → onboarding-C5tGxSm3.js} +1 -1
  215. package/dist/client/assets/openai-conversation-Cin6CRLj.js +3 -0
  216. package/dist/client/assets/{optimistic-project-sidebar-views-DWktyZnu.js → optimistic-project-sidebar-views-BwI_h134.js} +1 -1
  217. package/dist/client/assets/{order-monitor-day-lcmZ_W6T.js → order-monitor-day-qB9QL9rR.js} +1 -1
  218. package/dist/client/assets/{organization-choice-5J7_8tx5.js → organization-choice-UcNwkZgV.js} +1 -1
  219. package/dist/client/assets/{orgs-CTAlA2gh.js → orgs-BNCJkrfd.js} +1 -1
  220. package/dist/client/assets/{own-accounts-section-CL-lWHC3.js → own-accounts-section-B_G3r2Ak.js} +1 -1
  221. package/dist/client/assets/{pair-IZ41S3dI.js → pair-DaLtpCvg.js} +8 -8
  222. package/dist/client/assets/{parse-sections-bc3ugIU6.js → parse-sections-BRYcF5X4.js} +3 -3
  223. package/dist/client/assets/plan-BkTiTYLU.js +1 -0
  224. package/dist/client/assets/{plan-ladder-CpzLELQm.js → plan-ladder-DZZeDiD-.js} +1 -1
  225. package/dist/client/assets/{plan-usage-card-Djn1n4Si.js → plan-usage-card-CUEZgkUc.js} +1 -1
  226. package/dist/client/assets/{popover-BN8yB-gL.js → popover-Bm-_ILu8.js} +1 -1
  227. package/dist/client/assets/post-calendar-Dx1uahJO.js +1 -0
  228. package/dist/client/assets/{post-editor-k1GseIfg.js → post-editor-DWqV-Y-J.js} +2 -2
  229. package/dist/client/assets/{preview-content-DrUsIXaL.js → preview-content-DiSiTI85.js} +1 -1
  230. package/dist/client/assets/{preview-dialog-Bl4nn6SJ.js → preview-dialog-BP-VZ8b7.js} +1 -1
  231. package/dist/client/assets/{preview-panel-CPnrD7jy.js → preview-panel-DO2qxYoE.js} +1 -1
  232. package/dist/client/assets/{preview-tab-DJCbL8xU.js → preview-tab-lvMZ2nQh.js} +3 -3
  233. package/dist/client/assets/{primitives-7GEzJciO.js → primitives-DlHl12Ki.js} +1 -1
  234. package/dist/client/assets/{product-picker-dialog-BsLtWfxx.js → product-picker-dialog-2Sh66sGp.js} +1 -1
  235. package/dist/client/assets/{profile-LVIi9kQl.js → profile-C-34uFVs.js} +1 -1
  236. package/dist/client/assets/project-app-view-B1Na7Y2f.js +1 -0
  237. package/dist/client/assets/project-apps-4x8kh2Th.js +1 -0
  238. package/dist/client/assets/{project-icon-NAtCd-2E.js → project-icon-BpBMspxb.js} +1 -1
  239. package/dist/client/assets/{project-index-BDBvdHSq.js → project-index-Dn8Lu82V.js} +1 -1
  240. package/dist/client/assets/project-reports-BKA5CwLs.js +1 -0
  241. package/dist/client/assets/project-tasks-DII3t9E-.js +1 -0
  242. package/dist/client/assets/projects-COEtC32s.js +1 -0
  243. package/dist/client/assets/{projects-empty-state-Bhe-Ul5b.js → projects-empty-state-BaKUbZwF.js} +1 -1
  244. package/dist/client/assets/{prompts-fURd1E3_.js → prompts-BEx4mqMN.js} +1 -1
  245. package/dist/client/assets/record-editor-B5MUcK8d.js +1 -0
  246. package/dist/client/assets/redirect-editor-v_D7tsUa.js +1 -0
  247. package/dist/client/assets/{reports-K6JrO8c3.js → reports-CY9b4q7t.js} +1 -1
  248. package/dist/client/assets/reports-Dc_GbY37.js +1 -0
  249. package/dist/client/assets/reports-onboarding-B78MfFt5.js +1 -0
  250. package/dist/client/assets/reports-tab-DgzPfqIC.js +2 -0
  251. package/dist/client/assets/{repositories-noe5N_6-.js → repositories-BFzOuUP8.js} +1 -1
  252. package/dist/client/assets/repositories-DfE1c4ns.js +1 -0
  253. package/dist/client/assets/{repository-binding-DC98qYdg.js → repository-binding-CP_PNLcQ.js} +1 -1
  254. package/dist/client/assets/{repository-picker-BLhEIBPT.js → repository-picker-DCip0P__.js} +1 -1
  255. package/dist/client/assets/{require-capability-r0eDYoNg.js → require-capability-uCkyxJfa.js} +1 -1
  256. package/dist/client/assets/{required-auth-layout-Dq6PcaGv.js → required-auth-layout-B7e3rkXx.js} +1 -1
  257. package/dist/client/assets/{reset-password-CeDXY3wu.js → reset-password-Bqbu7xzH.js} +1 -1
  258. package/dist/client/assets/{resizable-CDUVHUkS.js → resizable-D75nggzL.js} +1 -1
  259. package/dist/client/assets/resolve-tab-icon-BqdaZDC9.js +1 -0
  260. package/dist/client/assets/review-settings-BU42FIg-.js +1 -0
  261. package/dist/client/assets/{role-color-j5ZAxcKG.js → role-color-CUZgXceG.js} +1 -1
  262. package/dist/client/assets/roles-BhkeI1Tk.js +1 -0
  263. package/dist/client/assets/route-BdFxUFy-.js +1 -0
  264. package/dist/client/assets/route-C_hx8Usp.js +1 -0
  265. package/dist/client/assets/route-CvQ9iNjI.js +1 -0
  266. package/dist/client/assets/{route-page-header-B-0s5BiJ.js → route-page-header-B8C1ZRVD.js} +1 -1
  267. package/dist/client/assets/{sandbox-git-api-CJ3-CkeV.js → sandbox-git-api-B73fIbEU.js} +1 -1
  268. package/dist/client/assets/{sandbox-lifecycle-context-DJVkUHOC.js → sandbox-lifecycle-context-3zZM02yQ.js} +1 -1
  269. package/dist/client/assets/{save-status-5VC4rIi2.js → save-status-5VKYddaB.js} +1 -1
  270. package/dist/client/assets/{schema-B5pk7azZ.js → schema-Bbiw44C-.js} +1 -1
  271. package/dist/client/assets/schema-BmYiAOGn.js +1 -0
  272. package/dist/client/assets/{scroll-area-CXINzzvW.js → scroll-area-ZYmkOMr8.js} +1 -1
  273. package/dist/client/assets/{search-input-Dmx6N7Z7.js → search-input-Dfgi3Bm0.js} +1 -1
  274. package/dist/client/assets/{search-toggle-uhoeAt8V.js → search-toggle-Bt9uO9z1.js} +1 -1
  275. package/dist/client/assets/{secret-picker-CdBDBcEP.js → secret-picker-35tY3ayS.js} +1 -1
  276. package/dist/client/assets/{secrets-DdH9QnxK.js → secrets-CTezjK3j.js} +1 -1
  277. package/dist/client/assets/{section-array-field-RxYDyVUT.js → section-array-field-D3J7UHmj.js} +1 -1
  278. package/dist/client/assets/{sections-CvVT6jo9.js → sections-CsKHN4VK.js} +1 -1
  279. package/dist/client/assets/sections-editor-bf1W6507.js +1 -0
  280. package/dist/client/assets/{select-PhQ1dHUc.js → select-CKa1YoCw.js} +1 -1
  281. package/dist/client/assets/{select-model-DsYbAwnw.js → select-model-BzdKMpAz.js} +1 -1
  282. package/dist/client/assets/{seo-editor-DTf59Uvx.js → seo-editor-RhNyCqwO.js} +1 -1
  283. package/dist/client/assets/{separator-BspBySaE.js → separator-CmEbryS6.js} +1 -1
  284. package/dist/client/assets/{session-runtime-CWUXrNEM.js → session-runtime-DZiu3uM2.js} +1 -1
  285. package/dist/client/assets/settings-tab-DgRCBiDm.js +1 -0
  286. package/dist/client/assets/{sheet-DsBIaG5c.js → sheet-BDbcvRnu.js} +1 -1
  287. package/dist/client/assets/shell-layout-Lgn8VLZ9.js +1 -0
  288. package/dist/client/assets/{site-draft-actions-bEXIW2Ci.js → site-draft-actions-LxERm8rz.js} +5 -5
  289. package/dist/client/assets/{site-draft-view-DL1xS2bS.js → site-draft-view-Dzyq1aKZ.js} +1 -1
  290. package/dist/client/assets/site-editor-DVvyNYht.js +1 -0
  291. package/dist/client/assets/site-editor-toast-QCYxwt4C.js +1 -0
  292. package/dist/client/assets/skills-D2pt05Zp.js +1 -0
  293. package/dist/client/assets/{slider-DiJZup4s.js → slider-B257IOM8.js} +1 -1
  294. package/dist/client/assets/{sortable.esm-AH9TOEe6.js → sortable.esm-6QfVcWZZ.js} +1 -1
  295. package/dist/client/assets/{sso-DJUFzVd6.js → sso-QEHyu29Q.js} +1 -1
  296. package/dist/client/assets/{suggestion-BKU1aw0O.js → suggestion-DXAVxjkm.js} +1 -1
  297. package/dist/client/assets/{super-agent-icon-KeQzZLhO.js → super-agent-icon-Be9GDxp7.js} +1 -1
  298. package/dist/client/assets/{switch-CavZ0Td_.js → switch-DgvZdTyU.js} +1 -1
  299. package/dist/client/assets/{synced-repos-CpobCKuE.js → synced-repos-CsgMx0Ny.js} +1 -1
  300. package/dist/client/assets/{tab-icon-glyph-BQpSs905.js → tab-icon-glyph-UH4S7mUc.js} +1 -1
  301. package/dist/client/assets/{table-_0cphCuz.js → table-ChqekQnS.js} +1 -1
  302. package/dist/client/assets/{tabs-CB9wyI2L.js → tabs-DV8AQUwT.js} +1 -1
  303. package/dist/client/assets/{task-board-DAlkVSdn.js → task-board-DQX_apb8.js} +1 -1
  304. package/dist/client/assets/{task-key-D_de_YB4.js → task-key-rSXWMPFP.js} +1 -1
  305. package/dist/client/assets/{task-route-gaZIOP1Q.js → task-route-KYQNiD-8.js} +1 -1
  306. package/dist/client/assets/{task-status-Dm8lN6h7.js → task-status-CadzUBkc.js} +1 -1
  307. package/dist/client/assets/{taskboard-analytics-BRO72FRF.js → taskboard-analytics-B1Tn3vRG.js} +1 -1
  308. package/dist/client/assets/tasks-BBJAHV_M.js +1 -0
  309. package/dist/client/assets/{tasks-LD7DAdjg.js → tasks-D0Ct-0ZT.js} +1 -1
  310. package/dist/client/assets/{textarea-C5yT2rai.js → textarea-DCWhTUrR.js} +1 -1
  311. package/dist/client/assets/thread-analytics-BXz4d40L.js +1 -0
  312. package/dist/client/assets/{thread-button-jA6lXOHW.js → thread-button-CkP3AL0P.js} +1 -1
  313. package/dist/client/assets/{thread-intent-DC5UuPI5.js → thread-intent-BsMPgCKi.js} +1 -1
  314. package/dist/client/assets/{thread-route-NC2TJMv2.js → thread-route-El3oNOnD.js} +1 -1
  315. package/dist/client/assets/thread-route-wZnmBpi8.js +1 -0
  316. package/dist/client/assets/{thread-sheet-body-BATHVA9a.js → thread-sheet-body-By8H92hw.js} +1 -1
  317. package/dist/client/assets/{time-range-picker-BdF4LahQ.js → time-range-picker-svLFcXAw.js} +1 -1
  318. package/dist/client/assets/{toggle-group-B2L0Fh-A.js → toggle-group-fJYx0W9h.js} +1 -1
  319. package/dist/client/assets/{tool-set-selector-sYj6JiLu.js → tool-set-selector-7nHtwp8O.js} +1 -1
  320. package/dist/client/assets/{toolbar-icon-button-BleYd0k2.js → toolbar-icon-button-DIm3azB_.js} +1 -1
  321. package/dist/client/assets/{tooltip-C0XDZQqg.js → tooltip-B3-v7v0W.js} +1 -1
  322. package/dist/client/assets/{tooltipContext-B5tdv-rH.js → tooltipContext-oNzr-fXK.js} +1 -1
  323. package/dist/client/assets/{track-DkQvKF_r.js → track-C9EcyFLh.js} +1 -1
  324. package/dist/client/assets/{types-BmRTIjW9.js → types-6-Ps6AGR.js} +1 -1
  325. package/dist/client/assets/{url-slug-HTy1TIRr.js → url-slug-3v4BmBw0.js} +1 -1
  326. package/dist/client/assets/{usage-stats-BbuSELy1.js → usage-stats-njGMuDih.js} +1 -1
  327. package/dist/client/assets/{use-ai-providers-CGeOv9zD.js → use-ai-providers-DFv4_P6Z.js} +1 -1
  328. package/dist/client/assets/{use-api-keys-BBDeQmvb.js → use-api-keys-PZMcZPlt.js} +1 -1
  329. package/dist/client/assets/use-apply-named-rule-B8KW11JW.js +1 -0
  330. package/dist/client/assets/use-ask-in-chat-Dxj79lpz.js +1 -0
  331. package/dist/client/assets/{use-automations-UppgD9x4.js → use-automations-DD1lNWAq.js} +1 -1
  332. package/dist/client/assets/{use-autosave-DP-Xo78G.js → use-autosave-DBAueSyZ.js} +1 -1
  333. package/dist/client/assets/use-blocks-v8-project-DjyJGATt.js +1 -0
  334. package/dist/client/assets/use-blog-view-B9cmKJN3.js +1 -0
  335. package/dist/client/assets/{use-chat-layout-state-CYDJQho2.js → use-chat-layout-state-CAIrZGnL.js} +1 -1
  336. package/dist/client/assets/{use-cms-publish-actions-sZFllHA3.js → use-cms-publish-actions-Dq9NhEOB.js} +1 -1
  337. package/dist/client/assets/{use-connect-companion-DM6nloeD.js → use-connect-companion-CLP35iDK.js} +1 -1
  338. package/dist/client/assets/{use-connection-BlQSFvXZ.js → use-connection-CYsyXyy7.js} +1 -1
  339. package/dist/client/assets/{use-content-sync-CmcdSf-W.js → use-content-sync-DWcjd7N0.js} +1 -1
  340. package/dist/client/assets/{use-copy-_EjHpFlu.js → use-copy-BStTcLWM.js} +1 -1
  341. package/dist/client/assets/{use-current-view-DJmYWR9r.js → use-current-view-Cn9H-KAc.js} +1 -1
  342. package/dist/client/assets/{use-date-fns-locale-8kgkXGzy.js → use-date-fns-locale-CSKjWaLe.js} +1 -1
  343. package/dist/client/assets/{use-debounced-autosave-43RSVqCJ.js → use-debounced-autosave-BudnGn2r.js} +1 -1
  344. package/dist/client/assets/{use-debounced-value-CtUf9JOP.js → use-debounced-value-Dcq0NTAp.js} +1 -1
  345. package/dist/client/assets/{use-deco-credits-CrAjq5eE.js → use-deco-credits-D9t5Q-Ms.js} +1 -1
  346. package/dist/client/assets/{use-decopilot-events-CwyVZVbh.js → use-decopilot-events-DsEAOvda.js} +1 -1
  347. package/dist/client/assets/{use-delete-block-CziQYeFw.js → use-delete-block-BZCQAK3P.js} +1 -1
  348. package/dist/client/assets/{use-delete-connection-5KBJh_4H.js → use-delete-connection-CBkpbZja.js} +1 -1
  349. package/dist/client/assets/{use-deployment-admin-vod10AYl.js → use-deployment-admin-HoxFQgZ9.js} +1 -1
  350. package/dist/client/assets/{use-entitlements-D-BsJsBn.js → use-entitlements-BzKQLk_u.js} +1 -1
  351. package/dist/client/assets/{use-fast-preview-draft-url-CTybhvJ7.js → use-fast-preview-draft-url-tiq51pbg.js} +1 -1
  352. package/dist/client/assets/{use-file-configs-zM1_UDsD.js → use-file-configs-Caaj88sr.js} +1 -1
  353. package/dist/client/assets/{use-id-selection-B-V9WQKU.js → use-id-selection-D0jc_Dy0.js} +1 -1
  354. package/dist/client/assets/{use-in-settings-CKmb_d-Z.js → use-in-settings-D-n4dJvM.js} +1 -1
  355. package/dist/client/assets/{use-inbox-feed-BIRoBmxG.js → use-inbox-feed-7Rm2Mjtr.js} +1 -1
  356. package/dist/client/assets/{use-infinite-scroll-D0fDDIyn.js → use-infinite-scroll-f5g_Vpk-.js} +1 -1
  357. package/dist/client/assets/{use-join-requests-C7XAF7yu.js → use-join-requests-Cu6LZvjE.js} +1 -1
  358. package/dist/client/assets/{use-main-panel-tabs-CFBnVDX4.js → use-main-panel-tabs-Ch-_m9wA.js} +1 -1
  359. package/dist/client/assets/{use-mcp-auth-status-Cvpzf8bf.js → use-mcp-auth-status-CrggBiFo.js} +1 -1
  360. package/dist/client/assets/{use-mcp-client-C25DU1dz.js → use-mcp-client-CCT6q-zj.js} +1 -1
  361. package/dist/client/assets/{use-mcp-prompts-DFURxOZn.js → use-mcp-prompts-Bxssn6xT.js} +1 -1
  362. package/dist/client/assets/{use-mcp-tools-DU4EJz2s.js → use-mcp-tools-CdypNtPV.js} +1 -1
  363. package/dist/client/assets/{use-mobile-DFpIEPum.js → use-mobile-Dyvncftm.js} +1 -1
  364. package/dist/client/assets/{use-move-blocks-HLsANXZk.js → use-move-blocks-pw3TQRyc.js} +1 -1
  365. package/dist/client/assets/{use-navigate-to-agent-BGA3nmOF.js → use-navigate-to-agent-0M4hsJnf.js} +1 -1
  366. package/dist/client/assets/{use-never-published-BnWhN5r2.js → use-never-published-BsVhVpS1.js} +1 -1
  367. package/dist/client/assets/{use-org-fs-BrF60Lzy.js → use-org-fs-CyfRrBTl.js} +1 -1
  368. package/dist/client/assets/{use-org-notice-BmwTtllY.js → use-org-notice-BeUR_ZGA.js} +1 -1
  369. package/dist/client/assets/{use-org-repo-syncs-Bi8Ut_qX.js → use-org-repo-syncs-DvcdTgrS.js} +1 -1
  370. package/dist/client/assets/{use-org-sso-CpaEO6G5.js → use-org-sso-BOOKyOjL.js} +1 -1
  371. package/dist/client/assets/use-organization-settings-BEn5xJKT.js +1 -0
  372. package/dist/client/assets/{use-panel-navigate-BvdMbLN8.js → use-panel-navigate-DzpMtCDM.js} +1 -1
  373. package/dist/client/assets/{use-project-native-view-presence-Cj3jJM1f.js → use-project-native-view-presence-D4Mhq-72.js} +1 -1
  374. package/dist/client/assets/{use-project-scope-TiMALD5Y.js → use-project-scope-DdM0t1xa.js} +1 -1
  375. package/dist/client/assets/{use-recent-apps-CAx2Sj77.js → use-recent-apps-BclKHbIs.js} +1 -1
  376. package/dist/client/assets/{use-reports-diagnostic-BWUL8kSa.js → use-reports-diagnostic-BAbQPKnw.js} +1 -1
  377. package/dist/client/assets/use-sandbox-events-CdcsfdkO.js +2 -0
  378. package/dist/client/assets/{use-secrets-DYs_2mJJ.js → use-secrets-LrCR8jto.js} +1 -1
  379. package/dist/client/assets/{use-section-preview-base-bQf9hU5_.js → use-section-preview-base-CiQHlYOM.js} +1 -1
  380. package/dist/client/assets/{use-sidebar-collapsed-Cynyx51j.js → use-sidebar-collapsed-CiqzdmQp.js} +1 -1
  381. package/dist/client/assets/{use-tags-Ds4Jpuu1.js → use-tags-B6rjUKRX.js} +1 -1
  382. package/dist/client/assets/{use-task-board-analytics-5UJcKLaD.js → use-task-board-analytics-B5zThTLs.js} +1 -1
  383. package/dist/client/assets/{use-task-board-item-prs-C0gHPfb5.js → use-task-board-item-prs-QwsxzHpc.js} +1 -1
  384. package/dist/client/assets/{use-task-board-items-osFWr4F_.js → use-task-board-items-B0KeELtH.js} +1 -1
  385. package/dist/client/assets/{use-task-board-prompts-eYQIzP7F.js → use-task-board-prompts-DjkyWndN.js} +1 -1
  386. package/dist/client/assets/{use-task-metadata-DqYio8UA.js → use-task-metadata-DRyTcJBf.js} +1 -1
  387. package/dist/client/assets/{use-thread-outputs-DJQKtV2q.js → use-thread-outputs-U5yvy3ti.js} +1 -1
  388. package/dist/client/assets/{use-view-draft-kind-BYPtD8MA.js → use-view-draft-kind-C2cwPb-d.js} +1 -1
  389. package/dist/client/assets/{use-voice-input-wPU7RMRz.js → use-voice-input-D_lO17n9.js} +1 -1
  390. package/dist/client/assets/useInfiniteQuery-BIIkqC2p.js +1 -0
  391. package/dist/client/assets/{useQueries-DKbjoyEp.js → useQueries-C-94_zeU.js} +1 -1
  392. package/dist/client/assets/useSuspenseInfiniteQuery-B5PirUR6.js +1 -0
  393. package/dist/client/assets/{users-BaX74SiF.js → users-D4cUiO-M.js} +1 -1
  394. package/dist/client/assets/{utils-C8EWsG3o.js → utils-CWN91Q0R.js} +1 -1
  395. package/dist/client/assets/variant-calendar-DHFpb0p3.js +1 -0
  396. package/dist/client/assets/{variant-matcher-override-BsSZ5yFL.js → variant-matcher-override-GbUOkJxx.js} +1 -1
  397. package/dist/client/assets/{view-header-B-qrTWpm.js → view-header-BZNgPIdK.js} +1 -1
  398. package/dist/client/assets/{virtual-mcp-DeWQ4GR6.js → virtual-mcp-jT57t8xN.js} +1 -1
  399. package/dist/client/assets/{watch-sse-pool-DSisQksD.js → watch-sse-pool-CrHa0Ln_.js} +1 -1
  400. package/dist/client/index.html +2 -2
  401. package/dist/server/migrate.js +210 -210
  402. package/dist/server/server.js +693 -693
  403. package/package.json +1 -1
  404. package/dist/client/assets/TrendUp01-Dnr3ECEr.js +0 -1
  405. package/dist/client/assets/agent-app-gA5AyVqP.js +0 -1
  406. package/dist/client/assets/agent-assets-CHRKOS2u.js +0 -1
  407. package/dist/client/assets/agent-automations-VyCqK5Re.js +0 -1
  408. package/dist/client/assets/agent-blog-CZmmsFZV.js +0 -2
  409. package/dist/client/assets/agent-blog-post-CB4b_awk.js +0 -2
  410. package/dist/client/assets/agent-calendar-Cp5T7Qbr.js +0 -1
  411. package/dist/client/assets/agent-connect-sources-BoFtzsla.js +0 -1
  412. package/dist/client/assets/agent-deck-ClKs4ShI.js +0 -1
  413. package/dist/client/assets/agent-e2e-DYM6mhlb.js +0 -1
  414. package/dist/client/assets/agent-experiments-w6nqO2q9.js +0 -1
  415. package/dist/client/assets/agent-file-DrrOEB-e.js +0 -1
  416. package/dist/client/assets/agent-hosting-BSxiIsrn.js +0 -1
  417. package/dist/client/assets/agent-icon-ButaHLCM.js +0 -1
  418. package/dist/client/assets/agent-library-UPbdmbqv.js +0 -1
  419. package/dist/client/assets/agent-library-file-D6WFOASp.js +0 -1
  420. package/dist/client/assets/agent-overview-BYbm2jhI.js +0 -1
  421. package/dist/client/assets/agent-settings-BlXhuK2P.js +0 -1
  422. package/dist/client/assets/agent-site-editor-code-BzxDSxJp.js +0 -2
  423. package/dist/client/assets/agent-site-editor-content-r61QYhf7.js +0 -1
  424. package/dist/client/assets/agent-site-editor-preview-BwuXgbhX.js +0 -1
  425. package/dist/client/assets/agent-view-Ba6W0Fqn.js +0 -1
  426. package/dist/client/assets/api-keys-BxUV6FZ8.js +0 -1
  427. package/dist/client/assets/app-editor-2zianuY6.js +0 -1
  428. package/dist/client/assets/automations-BgwFiPYA.js +0 -1
  429. package/dist/client/assets/category-editor-BEomaUlT.js +0 -1
  430. package/dist/client/assets/choose-editor-CptxA-2o.js +0 -1
  431. package/dist/client/assets/cms-settings-editor-q2PD6d-f.js +0 -1
  432. package/dist/client/assets/collection-detail-BFFv8EBD.js +0 -1
  433. package/dist/client/assets/connection-detail-NnYjF1KC.js +0 -1
  434. package/dist/client/assets/connections-Bs7MQX46.js +0 -1
  435. package/dist/client/assets/context-NTAokEvz.js +0 -1
  436. package/dist/client/assets/file-explorer-_xEpPcaK.js +0 -2
  437. package/dist/client/assets/general-C0agZL75.js +0 -1
  438. package/dist/client/assets/home-b8Q92l_T.js +0 -1
  439. package/dist/client/assets/index-C4wvi2v7.css +0 -1
  440. package/dist/client/assets/index-DETAJcho.js +0 -4
  441. package/dist/client/assets/index-DOrEGYb6.js +0 -1
  442. package/dist/client/assets/library-BD-JkXMr.js +0 -1
  443. package/dist/client/assets/named-rule-view-D1pVQoPd.js +0 -1
  444. package/dist/client/assets/openai-conversation-naly2gFj.js +0 -3
  445. package/dist/client/assets/plan-C-tbQnGr.js +0 -1
  446. package/dist/client/assets/post-calendar-B4Ra6fFT.js +0 -1
  447. package/dist/client/assets/project-app-view-CfT_gJz2.js +0 -1
  448. package/dist/client/assets/project-apps-B5076YmV.js +0 -1
  449. package/dist/client/assets/project-reports-Cc5D1Wqe.js +0 -1
  450. package/dist/client/assets/project-tasks-BzeYrrtq.js +0 -1
  451. package/dist/client/assets/projects-0NQRxQMi.js +0 -1
  452. package/dist/client/assets/record-editor-BiyfqDBa.js +0 -1
  453. package/dist/client/assets/redirect-editor-CysPkosR.js +0 -1
  454. package/dist/client/assets/reports-CuT-F3LQ.js +0 -1
  455. package/dist/client/assets/reports-onboarding-COfLbzIl.js +0 -1
  456. package/dist/client/assets/reports-tab-BNdKCtPv.js +0 -2
  457. package/dist/client/assets/repositories-BcVuKWWr.js +0 -1
  458. package/dist/client/assets/resolve-tab-icon-CCnYS1It.js +0 -1
  459. package/dist/client/assets/review-settings-Cfg9u4wr.js +0 -1
  460. package/dist/client/assets/roles-DNr0gwrs.js +0 -1
  461. package/dist/client/assets/route-Bny9Lc4o.js +0 -1
  462. package/dist/client/assets/route-CpGHqQae.js +0 -1
  463. package/dist/client/assets/route-zFj6XsMD.js +0 -1
  464. package/dist/client/assets/schema-CAZOGJTH.js +0 -1
  465. package/dist/client/assets/sections-editor-FJjN0xqY.js +0 -1
  466. package/dist/client/assets/settings-tab-CoHHJ63I.js +0 -1
  467. package/dist/client/assets/shell-layout-DfpoOTvP.js +0 -1
  468. package/dist/client/assets/site-editor-OTjpPpEJ.js +0 -1
  469. package/dist/client/assets/site-editor-toast-DI5QMuI-.js +0 -1
  470. package/dist/client/assets/skills-sOnNG6z3.js +0 -1
  471. package/dist/client/assets/tasks-BjMbQPZT.js +0 -1
  472. package/dist/client/assets/thread-analytics-TKt2gIA9.js +0 -1
  473. package/dist/client/assets/thread-route-BmXDes0-.js +0 -1
  474. package/dist/client/assets/use-apply-named-rule-c0_gPvLu.js +0 -1
  475. package/dist/client/assets/use-ask-in-chat-DQt8TEjL.js +0 -1
  476. package/dist/client/assets/use-blocks-v8-project-BzyehgAq.js +0 -1
  477. package/dist/client/assets/use-blog-view-BPx89KE1.js +0 -1
  478. package/dist/client/assets/use-organization-settings-CeyizmcT.js +0 -1
  479. package/dist/client/assets/use-sandbox-events-CrjWSBYb.js +0 -2
  480. package/dist/client/assets/useInfiniteQuery-EaWUgCtN.js +0 -1
  481. package/dist/client/assets/useSuspenseInfiniteQuery-D-KEcWQs.js +0 -1
  482. package/dist/client/assets/variant-calendar-56I1fIKh.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-FJjN0xqY.js","assets/index-B2vvUsuK.js","assets/index-C4wvi2v7.css","assets/chat-context-DsLpz7ew.js","assets/use-panel-navigate-BvdMbLN8.js","assets/thread-route-NC2TJMv2.js","assets/use-project-scope-TiMALD5Y.js","assets/repository-binding-DC98qYdg.js","assets/use-mcp-client-C25DU1dz.js","assets/auth-DlYbrS5R.js","assets/use-view-draft-kind-BYPtD8MA.js","assets/use-blog-view-BPx89KE1.js","assets/use-organization-settings-CeyizmcT.js","assets/schema-CAZOGJTH.js","assets/task-board-DAlkVSdn.js","assets/thread-intent-DC5UuPI5.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-DSisQksD.js","assets/session-runtime-CWUXrNEM.js","assets/use-entitlements-D-BsJsBn.js","assets/use-ai-providers-CGeOv9zD.js","assets/use-current-view-DJmYWR9r.js","assets/use-in-settings-CKmb_d-Z.js","assets/use-decopilot-events-CwyVZVbh.js","assets/save-status-5VC4rIi2.js","assets/Image01-D2QOi7x6.js","assets/Trash01-Br_8Dd8k.js","assets/Upload01-B1gnueEL.js","assets/use-never-published-BnWhN5r2.js","assets/use-voice-input-wPU7RMRz.js","assets/popover-BN8yB-gL.js","assets/drawer-Daptw1OQ.js","assets/tooltip-C0XDZQqg.js","assets/index-BYSU1KyF.js","assets/use-mobile-DFpIEPum.js","assets/agent-icon-ButaHLCM.js","assets/AlertCircle-BLw7QvfG.js","assets/UserCheck01-CpLKejEQ.js","assets/Tool01-DJqLAFcI.js","assets/ArrowUp-C_Mw0uky.js","assets/ArrowLeft-DH7F9HYx.js","assets/ArrowRight-DZeVAIN7.js","assets/BookOpen01-9fv3inuR.js","assets/Globe04-BBsqVmHb.js","assets/CheckCircle--1SXoxG_.js","assets/TrendUp01-Dnr3ECEr.js","assets/ChevronDown-DwO0ALfW.js","assets/ChevronSelectorVertical-Bj17dUxw.js","assets/ChevronUp-BaiO1bgX.js","assets/UserSquare-D1HQ9ju8.js","assets/LinkBroken01-Z9hP4zTf.js","assets/CreditCard01-D6jLDMwS.js","assets/File02-Bes4ATvL.js","assets/MessageCircle01-DjShhQqZ.js","assets/SwitchHorizontal01-NAHL2C3Y.js","assets/Eye-DvcGz393.js","assets/Fingerprint04-BpB7HSc7.js","assets/Key01-CDcaZkCg.js","assets/LayoutLeft-19qu82-A.js","assets/Minus-ChoEICrx.js","assets/Monitor01-DtssQiym.js","assets/Sun-Dpzqhodu.js","assets/Play-DatgPxza.js","assets/Plus-GSWEwEm-.js","assets/SearchMd-DhrJsmFj.js","assets/ShoppingBag01-DQR5ci-Q.js","assets/Users01-qnd_BT_N.js","assets/XClose-BbVr5nc7.js","assets/Zap-B1JA6VL5.js","assets/index-CDpTFqpR.js","assets/checkbox-Bo6uhaqm.js","assets/select-PhQ1dHUc.js","assets/index-BdQq_4o_.js","assets/ai-providers-logos-DD3qZ33J.js","assets/openai-compatible-presets-BKGfVqEx.js","assets/site-editor-toast-DI5QMuI-.js","assets/use-sandbox-events-CrjWSBYb.js","assets/sandbox-url-D3mC8qhT.js","assets/use-blocks-v8-project-BzyehgAq.js","assets/utils-C8EWsG3o.js","assets/sandbox-git-api-CJ3-CkeV.js","assets/hosted-reconcile-DH-KyBYi.js","assets/blocks-tab-states-CrihrdT0.js","assets/empty-state--1H9mx7y.js","assets/search-input-Dmx6N7Z7.js","assets/tabs-CB9wyI2L.js","assets/active-indicator-CCMhAsc_.js","assets/use-debounced-value-CtUf9JOP.js","assets/use-file-configs-zM1_UDsD.js","assets/asset-utils-FQrgs53r.js","assets/useInfiniteQuery-EaWUgCtN.js","assets/infiniteQueryObserver-B6MEVTvt.js","assets/usage-stats-BbuSELy1.js","assets/utils-CVEq3hMx.js","assets/markdown-COcXeIyG.js","assets/use-copy-_EjHpFlu.js","assets/gateway-client-mrWD5tSx.js","assets/form-msT-Nxjd.js","assets/label-BLEP0nH0.js","assets/switch-CavZ0Td_.js","assets/toggle-group-B2L0Fh-A.js","assets/match-site-slug-config-B47_xZCi.js","assets/parse-sections-bc3ugIU6.js","assets/held-block-view-DUdsae86.js","assets/calendar-DZVkXGhA.js","assets/textarea-C5yT2rai.js","assets/editor-classes-eVnt4vp_.js","assets/task-key-D_de_YB4.js","assets/sortable.esm-AH9TOEe6.js","assets/category-tree-DUNY9TG8.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-IZ41S3dI.js","assets/collapsible-Cug6Pp5N.js","assets/use-task-board-items-osFWr4F_.js","assets/config-DeP83Mjq.js","assets/task-route-gaZIOP1Q.js","assets/project-index-BDBvdHSq.js","assets/shell-layout-DfpoOTvP.js","assets/use-deployment-admin-vod10AYl.js","assets/admin-fetch-BhTJlAsX.js","assets/use-org-notice-BmwTtllY.js","assets/command-BA_BVypg.js","assets/index-C0WKaVxy.js","assets/integration-icon-DazsuPNm.js","assets/project-icon-NAtCd-2E.js","assets/use-navigate-to-agent-BGA3nmOF.js","assets/new-project-dialog-CsFe_Ifg.js","assets/repository-picker-BLhEIBPT.js","assets/github-icon-DGEVXZ8I.js","assets/collection-search-EKEj7NYh.js","assets/new-project-store-D3tRl8ms.js","assets/legacy-admin-welcome-dialog-DwTePCPF.js","assets/required-auth-layout-Dq6PcaGv.js","assets/use-org-sso-CpaEO6G5.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-CDjvP8t9.js","assets/types-BmRTIjW9.js","assets/omit-server-managed-metadata-L5IhjRZB.js","assets/sheet-DsBIaG5c.js","assets/use-connection-BlQSFvXZ.js","assets/use-mcp-prompts-DFURxOZn.js","assets/use-thread-outputs-DJQKtV2q.js","assets/file-type-icon-sxJ1fqoc.js","assets/section-array-field-RxYDyVUT.js","assets/named-rule-step-BfgtyNIr.js","assets/slider-DiJZup4s.js","assets/index-0yoxovPZ.js","assets/tooltipContext-B5tdv-rH.js","assets/CategoricalChart-CcMGdgiC.js","assets/index-C9UqnrNB.js","assets/combobox-CkvX9Of3.js","assets/scroll-area-CXINzzvW.js","assets/monaco-editor-C0bUrX9K.js","assets/editor-CGkWZSA7.js","assets/use-delete-block-CziQYeFw.js","assets/use-section-preview-base-bQf9hU5_.js","assets/mustache-CSfql4oE.js","assets/seo-editor-DTf59Uvx.js","assets/use-apply-named-rule-c0_gPvLu.js","assets/use-move-blocks-HLsANXZk.js","assets/variant-matcher-override-BsSZ5yFL.js"])))=>i.map(i=>d[i]);
2
- import{c as le,j as r,r as R,m as Re,b as Se,B as _e,aH as ps,bk as gt,aI as De,bl as ko,bm as So,bn as Po,bo as jo,v as Zs,D as en,K as tn,w as sn,x as nn,e as Eo,h as it,I as Hs,y as No,b8 as Co,a6 as gs,b7 as To,b5 as Gr,bp as gr,i as Jr,at as Vs,av as Ws,a9 as Yr,P as qs,E as Ro,t as ms,b6 as Lo,q as Ao}from"./index-B2vvUsuK.js";import{u as rn,N as Oo}from"./save-status-5VC4rIi2.js";import{b as _o,c as lt,r as Qr,l as Xr,f as $o,g as Fo,w as Do}from"./chat-context-DsLpz7ew.js";import{t as Bo}from"./ChevronDown-DwO0ALfW.js";import{G as Mo,H as zo,B as an,I as Io,b as Uo,J as vr,K as Ko,L as Zr,M as Ho,N as ea}from"./agent-icon-ButaHLCM.js";import{s as Vo}from"./File02-Bes4ATvL.js";import{a as Wo,n as qo}from"./UserSquare-D1HQ9ju8.js";import{s as ta}from"./Plus-GSWEwEm-.js";import{a as sa,b as na,P as ra}from"./popover-BN8yB-gL.js";import{e as We,b as qe,c as on,f as ln,a as cn,C as dn}from"./command-BA_BVypg.js";import{a as Go,c as Jo,b as Yo}from"./repository-binding-DC98qYdg.js";import{a as bt}from"./sandbox-lifecycle-context-DJVkUHOC.js";import{a as Qo,n as Xo,u as Zo,f as xr,H as ei,P as ti}from"./frame-navigation-COhxs0rP.js";import{r as si}from"./session-runtime-CWUXrNEM.js";import{u as aa}from"./use-voice-input-wPU7RMRz.js";import{l as ni,m as ri,n as ai,o as oi,q as ii,t as li,u as Kt,j as vs,v as oa,i as tt,w as ci,x as un,y as ia,k as la,z as di,A as ui,B as ca,C as fi,c as da,b as ua,D as pi,h as Ve,E as mi,d as hi,g as gi,F as vi,G as xi,H as br,I as bi,J as yr,K as yi,L as wi,M as wr,N as kr,O as Sr,P as Pr,Q as jr,R as $s,S as ki,U as Si,V as Pi,W as ji,e as Ei}from"./site-editor-toast-DI5QMuI-.js";import{u as fa}from"./use-mobile-DFpIEPum.js";import{T as st,I as Er}from"./toolbar-icon-button-BleYd0k2.js";import{T as nt,a as rt,c as at}from"./tooltip-C0XDZQqg.js";import{w as os,i as Ni}from"./variant-matcher-override-BsSZ5yFL.js";import{s as xt,n as fn,a as pn,f as Be,e as Ci,v as pa,u as ma,h as Ti,i as Ri,B as Li,S as Ai,C as Oi,b as _i,c as $i,d as Fi,g as Di,N as Bi,j as Mi,r as zi,k as Ii,l as Nr,p as Ui}from"./blocks-tab-states-CrihrdT0.js";import{a as Ki}from"./use-fast-preview-draft-url-CTybhvJ7.js";import{g as Hi,c as Cr,B as Fs,P as Vi,r as Wi,R as qi,S as Gi,l as Ji,m as Yi,p as Qi}from"./parse-sections-bc3ugIU6.js";import{g as Xi}from"./section-array-field-RxYDyVUT.js";import{u as Zi}from"./shell-layout-DfpoOTvP.js";import{u as mn,b as el}from"./use-sandbox-events-CrjWSBYb.js";import{s as tl,p as sl,W as nl,n as rl,S as Ds}from"./category-tree-DUNY9TG8.js";import{u as Gs}from"./useQueries-DKbjoyEp.js";import{i as ha}from"./ArrowRight-DZeVAIN7.js";import{a as al,c as ol}from"./blog-preview-url-DM-lGGhF.js";import{u as il,b as ga}from"./use-never-published-BnWhN5r2.js";import{u as va}from"./blocks-preview-workspace-context-Rebn6SsT.js";import{u as ll,H as cl}from"./held-block-view-DUdsae86.js";import{MonacoCodeEditor as xa}from"./monaco-editor-C0bUrX9K.js";import{c as ba,u as ya}from"./hosted-reconcile-DH-KyBYi.js";import{d as wa}from"./utils-C8EWsG3o.js";import{R as Tr,a as is,b as Rr}from"./resizable-CDUVHUkS.js";import{g as ka}from"./use-org-notice-BmwTtllY.js";import{u as dl}from"./use-blocks-v8-project-BzyehgAq.js";import{s as ul,L as fl,R as Sa,D as Lr,w as Js}from"./device-hint-5lkWUASQ.js";import{s as pl}from"./UserCheck01-CpLKejEQ.js";import{L as ml}from"./label-BLEP0nH0.js";import{T as hl,a as Ar}from"./toggle-group-B2L0Fh-A.js";import{i as gl,l as vl,D as xl}from"./named-rule-step-BfgtyNIr.js";import{b as bl}from"./sandbox-url-D3mC8qhT.js";import{r as yl,R as wl}from"./virtual-mcp-DeWQ4GR6.js";import{d as kl}from"./delay-CnY5UFtP.js";import{s as Pa}from"./XClose-BbVr5nc7.js";import{o as Sl}from"./omit-server-managed-metadata-L5IhjRZB.js";import{a as Bs,b as Pl,w as jl,n as Or}from"./app-preview-url-9Od4s8Sz.js";import{a as El}from"./use-organization-settings-CeyizmcT.js";import{a as Ms}from"./agent-capabilities-B8dQ_ZB8.js";import{E as Nl}from"./empty-state--1H9mx7y.js";import{G as _r}from"./github-icon-DGEVXZ8I.js";import{R as Cl}from"./new-project-dialog-CsFe_Ifg.js";import{r as Tl}from"./preview-source-BsRLGWUP.js";import{A as Rl,a as Ll,b as Al}from"./alert-B3inZFUT.js";import{u as Ol}from"./use-task-metadata-DqYio8UA.js";function _l(t){const e=le.c(10),{waiting:s}=t,n=s?"true":"false";let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(Mo,{className:"size-5 sm:size-6"})}),e[0]=o):o=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 u;e[2]!==s?(u=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]=u):u=e[3];let i;e[4]!==u?(i=r.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[c,u]}),e[4]=u,e[5]=i):i=e[5];let a;e[6]===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(zo,{className:"size-5 sm:size-6"})}),e[6]=a):a=e[6];let l;return e[7]!==n||e[8]!==i?(l=r.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":n,className:"flex items-center gap-2",children:[o,i,a]}),e[7]=n,e[8]=i,e[9]=l):l=e[9],l}function $l(t){const e=le.c(22),{index:s,numbered:n,step:o,heading:c}=t,u=R.useId();let i;e[0]!==s||e[1]!==n?(i=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]=i):i=e[2];let a;e[3]!==c||e[4]!==u||e[5]!==o.title?(a=r.jsx(c,{id:u,className:"text-sm font-medium text-foreground",children:o.title}),e[3]=c,e[4]=u,e[5]=o.title,e[6]=a):a=e[6];let l;e[7]!==i||e[8]!==a?(l=r.jsxs("div",{className:"flex items-center gap-3",children:[i,a]}),e[7]=i,e[8]=a,e[9]=l):l=e[9];const g=n&&"sm:pl-9";let f;e[10]!==g?(f=Re("flex min-w-0 flex-col gap-3",g),e[10]=g,e[11]=f):f=e[11];let p;e[12]!==o.body?(p=o.body&&r.jsx("p",{className:"text-sm text-muted-foreground",children:o.body}),e[12]=o.body,e[13]=p):p=e[13];let m;e[14]!==o.after||e[15]!==f||e[16]!==p?(m=r.jsxs("div",{className:f,children:[p,o.after]}),e[14]=o.after,e[15]=f,e[16]=p,e[17]=m):m=e[17];let v;return e[18]!==u||e[19]!==l||e[20]!==m?(v=r.jsxs("li",{"aria-labelledby":u,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[l,m]}),e[18]=u,e[19]=l,e[20]=m,e[21]=v):v=e[21],v}const Fl=[];function hs(t){const e=le.c(20),{title:s,lead:n,waiting:o,alerts:c,steps:u,footer:i,headingLevel:a}=t,l=u===void 0?Fl:u,g=a===void 0?1:a,f=g===1?"h1":"h2",p=o&&l.length===0?"status":void 0;let m;e[0]!==o?(m=r.jsx(_l,{waiting:o}),e[0]=o,e[1]=m):m=e[1];let v;e[2]!==f||e[3]!==s?(v=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]=v):v=e[4];let y;e[5]!==n?(y=n&&r.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:n}),e[5]=n,e[6]=y):y=e[6];let h;e[7]!==p||e[8]!==m||e[9]!==v||e[10]!==y?(h=r.jsxs("header",{role:p,className:"flex flex-col items-center gap-3 text-center",children:[m,v,y]}),e[7]=p,e[8]=m,e[9]=v,e[10]=y,e[11]=h):h=e[11];let x;e[12]!==g||e[13]!==l?(x=l.length>0&&r.jsx("ol",{className:"flex flex-col gap-3",children:l.map((b,w)=>r.jsx($l,{index:w+1,numbered:l.length>1,step:b,heading:g===1?"h2":"h3"},b.title))}),e[12]=g,e[13]=l,e[14]=x):x=e[14];let C;return e[15]!==c||e[16]!==i||e[17]!==h||e[18]!==x?(C=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,x,i]})}),e[15]=c,e[16]=i,e[17]=h,e[18]=x,e[19]=C):C=e[19],C}function Dl(t){const e=le.c(43),{wait:s,hosts:n,invalidLink:o}=t,c=o===void 0?!1:o,u=Se();let i;e[0]!==c||e[1]!==u?(i=c&&r.jsx(Rl,{variant:"warning",children:r.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[r.jsx(Ll,{className:"line-clamp-none text-foreground",children:u("decoServe.link.invalidTitle")}),r.jsx(Al,{children:u("decoServe.link.invalidBody")})]})}),e[0]=c,e[1]=u,e[2]=i):i=e[2];const a=i;if(s.kind==="problem"){let w;e[3]!==u||e[4]!==s.host||e[5]!==s.problem?(w=ul(u,s.problem,s.host),e[3]=u,e[4]=s.host,e[5]=s.problem,e[6]=w):w=e[6];const{title:N,body:k}=w;let S;e[7]!==k?(S=r.jsx(Sa,{text:k}),e[7]=k,e[8]=S):S=e[8];let E;e[9]===Symbol.for("react.memo_cache_sentinel")?(E=r.jsx(Lr,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=E):E=e[9];let T;return e[10]!==a||e[11]!==S||e[12]!==N?(T=r.jsx(hs,{headingLevel:2,waiting:!1,title:N,lead:S,alerts:a,footer:E}),e[10]=a,e[11]=S,e[12]=N,e[13]=T):T=e[13],T}const l=s.kind==="looking",g=l&&!s.paused;let f;e[14]!==u?(f=u("decoServe.waiting.title"),e[14]=u,e[15]=f):f=e[15];let p;e[16]!==u?(p=u("decoServe.waiting.lead"),e[16]=u,e[17]=p):p=e[17];let m;e[18]!==a||e[19]!==s.kind?(m=(a||s.kind==="denied")&&r.jsxs(r.Fragment,{children:[a,s.kind==="denied"&&r.jsx(fl,{})]}),e[18]=a,e[19]=s.kind,e[20]=m):m=e[20];let v;e[21]!==u?(v=u("decoServe.waiting.connect.title"),e[21]=u,e[22]=v):v=e[22];let y;e[23]!==u?(y=u("decoServe.waiting.connect.body"),e[23]=u,e[24]=y):y=e[24];let h;e[25]!==n||e[26]!==l||e[27]!==u||e[28]!==s.kind||e[29]!==s.onStart||e[30]!==s.paused?(h=s.kind==="needs-gesture"?r.jsx(_e,{variant:"outline",className:"self-start",onClick:s.onStart,children:u("decoServe.guide.start")}):l&&r.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:s.paused?u("decoServe.guide.paused"):u("decoServe.guide.looking",{hosts:n})}),e[25]=n,e[26]=l,e[27]=u,e[28]=s.kind,e[29]=s.onStart,e[30]=s.paused,e[31]=h):h=e[31];let x;e[32]!==v||e[33]!==y||e[34]!==h?(x=[{title:v,body:y,after:h}],e[32]=v,e[33]=y,e[34]=h,e[35]=x):x=e[35];let C;e[36]===Symbol.for("react.memo_cache_sentinel")?(C=r.jsx(Lr,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[36]=C):C=e[36];let b;return e[37]!==x||e[38]!==g||e[39]!==f||e[40]!==p||e[41]!==m?(b=r.jsx(hs,{headingLevel:2,waiting:g,title:f,lead:p,alerts:m,steps:x,footer:C}),e[37]=x,e[38]=g,e[39]=f,e[40]=p,e[41]=m,e[42]=b):b=e[42],b}function Bl(t,e){switch(t.kind){case"needs-permission":return{kind:"denied"};case"problem":return{kind:"problem",problem:t.problem,host:e};default:return{kind:"looking"}}}const Ml=15e3,zl=3e3;function Il(t){const{candidates:e,probe:s,onFound:n,onChange:o,doc:c=document,setTimer:u=(w,N)=>setTimeout(w,N),clearTimer:i=w=>clearTimeout(w),timeoutMs:a=zl}=t;let l={status:"searching",firstRoundDone:!1,problem:null},g=!1,f=!1,p=0,m=null,v=null;const y=()=>c.visibilityState==="hidden",h=w=>{l={...l,...w},o(l)},x=async w=>{v=new AbortController;const N=v,k=u(()=>N.abort(),a);try{return await s(w,N.signal),!0}catch(S){if(g)return!1;const E=ri(S);return E.reason!=="not-answering"?h({problem:{...E,endpoint:w}}):l.problem?.endpoint===w&&h({problem:null}),!1}finally{i(k),v=null}},C=async()=>{if(m=null,!(g||f)){if(e.length===0){h({status:"stopped",firstRoundDone:!0});return}if(y()){h({status:"paused"});return}f=!0,l.status!=="searching"&&h({status:"searching"});for(const w of e){if(g)break;if(await x(w)){if(f=!1,g)return;g=!0,c.removeEventListener("visibilitychange",b),h({status:"found",firstRoundDone:!0}),n(w);return}}if(f=!1,!g){if(p+=1,l.firstRoundDone||h({firstRoundDone:!0}),y()){h({status:"paused"});return}m=u(()=>{C()},ni(p,Ml))}}};function b(){if(!g){if(y()){m!==null&&(i(m),m=null),f||h({status:"paused"});return}m!==null&&i(m),p=0,C()}}return c.addEventListener("visibilitychange",b),o(l),C(),()=>{g=!0,m!==null&&i(m),v?.abort(),c.removeEventListener("visibilitychange",b)}}function Ul(t,e){return oi(t,e)}const Kl=["loopback-network","local-network-access"];async function Hl(){if(ai(window.location.origin))return null;for(const t of Kl)try{return await navigator.permissions.query({name:t})}catch{}return null}let ja=null,$r=!1;const zs=new Set;function Vl(t){if(zs.add(t),!$r){$r=!0;const e=s=>{ja=s;for(const n of zs)n()};Hl().then(s=>{if(!s)return e("unsupported");e(s.state),s.addEventListener("change",()=>e(s.state))})}return()=>zs.delete(t)}const Wl={status:"stopped",firstRoundDone:!1,problem:null},Is=new Map;function ql(t){const e=Is.get(t);if(e)return e;let s={status:"searching",firstRoundDone:!1,problem:null};const n=new Set;let o=null;const c={onFound:()=>{},getSnapshot:()=>s,subscribe:u=>(n.add(u),o??=Il({candidates:t.split(" "),probe:Ul,onFound:i=>c.onFound(i),onChange:i=>{s=i;for(const a of n)a()}}),()=>{n.delete(u),!(n.size>0)&&(o?.(),o=null,Is.delete(t))})};return Is.set(t,c),c}function Ea(){return R.useSyncExternalStore(Vl,Dr,Dr)}const Gl=()=>()=>{},Fr=()=>Wl,Dr=()=>ja;function Sf(t){const e=le.c(9),{candidates:s,onFound:n}=t,[o,c]=R.useState(!1),u=Ea(),a=(u==="granted"||u==="unsupported"||u==="prompt"&&o)&&s.length>0;let l;e[0]!==a||e[1]!==s||e[2]!==n?(l=a?ql(s.join(" ")):null,l&&(l.onFound=n),e[0]=a,e[1]=s,e[2]=n,e[3]=l):l=e[3];const g=R.useSyncExternalStore(l?.subscribe??Gl,l?.getSnapshot??Fr,l?.getSnapshot??Fr),f=u==="prompt"&&!o;let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>c(!0),e[4]=p):p=e[4];let m;return e[5]!==u||e[6]!==g||e[7]!==f?(m={state:g,access:u,needsGesture:f,start:p},e[5]=u,e[6]=g,e[7]=f,e[8]=m):m=e[8],m}const Br={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Jl(t){const{previewState:e,progressStatus:s,fastPreviewActive:n=!1,fastPreviewReady:o=!1,codingSession:c=!1,hostedDraft:u=!1}=t,i=c?null:t.previewServerUrl;return t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Br:u&&t.hostedPointerPending&&!o?{...Br,showDecidingLoader:!0}:n&&o&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:n&&u&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:!n&&e.kind==="iframe"&&s!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Yl=1500,Ql=500;function Xl({iframe:t,reload:e,waitMs:s=Yl,confirmMs:n=Ql}){let o;const c=()=>{clearTimeout(u),o=setTimeout(e,n)};t.addEventListener("load",c,{once:!0});const u=setTimeout(()=>{t.removeEventListener("load",c),e()},s);return()=>{clearTimeout(u),clearTimeout(o),t.removeEventListener("load",c)}}const Zl=ps({tag:De(),id:De(),classes:De(),text:De(),html:De(),manifestKey:De().nullable(),componentName:De().nullable(),parents:De(),url:De(),path:De(),viewport:ps({width:gt(),height:gt()}),position:ps({x:gt(),y:gt()})}),ec=`(function() {
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/sections-editor-bf1W6507.js","assets/index-D19iAD4s.js","assets/index-C9ybKZad.css","assets/chat-context-D5EEwp_m.js","assets/use-panel-navigate-DzpMtCDM.js","assets/thread-route-El3oNOnD.js","assets/use-project-scope-DdM0t1xa.js","assets/repository-binding-CP_PNLcQ.js","assets/use-mcp-client-CCT6q-zj.js","assets/auth-Ry9WrZV8.js","assets/use-view-draft-kind-C2cwPb-d.js","assets/use-blog-view-B9cmKJN3.js","assets/use-organization-settings-BEn5xJKT.js","assets/schema-BmYiAOGn.js","assets/task-board-DQX_apb8.js","assets/thread-intent-BsMPgCKi.js","assets/delay-CnY5UFtP.js","assets/backoff-CrEUbyZT.js","assets/watch-sse-pool-CrHa0Ln_.js","assets/session-runtime-DZiu3uM2.js","assets/use-entitlements-BzKQLk_u.js","assets/use-ai-providers-DFv4_P6Z.js","assets/use-current-view-Cn9H-KAc.js","assets/use-in-settings-D-n4dJvM.js","assets/use-decopilot-events-DsEAOvda.js","assets/save-status-5VKYddaB.js","assets/Image01-BGM1ArTz.js","assets/Trash01-W_zwe5xo.js","assets/Upload01-DDGkOE5t.js","assets/use-never-published-BsVhVpS1.js","assets/use-voice-input-D_lO17n9.js","assets/popover-Bm-_ILu8.js","assets/drawer-CLdqPUpZ.js","assets/tooltip-B3-v7v0W.js","assets/index-DHiZoBJ3.js","assets/use-mobile-Dyvncftm.js","assets/agent-icon-CF35JltL.js","assets/AlertCircle-jxvwS2PA.js","assets/UserCheck01-VgBUlrC3.js","assets/Tool01-CldemTEe.js","assets/ArrowUp-BbUoh0-h.js","assets/ArrowLeft-Dlf39oKA.js","assets/ArrowRight-DCL3gp96.js","assets/BookOpen01-C85UtDum.js","assets/Globe04-UMTQ82HG.js","assets/CheckCircle-KztuMvd5.js","assets/ChevronDown-c_BdXEOA.js","assets/ChevronSelectorVertical-DmpvIgAy.js","assets/ChevronUp-BSWVeXQq.js","assets/UserSquare-YQkID8bv.js","assets/LinkBroken01-hoBFLv94.js","assets/CreditCard01-C4dCRCdu.js","assets/File02-KoBPCXEf.js","assets/MessageCircle01-CDpj4jpt.js","assets/SwitchHorizontal01-B8iZqdiB.js","assets/Eye-BSRrcDT9.js","assets/Fingerprint04-B2N20uu4.js","assets/Key01-BMkzySkS.js","assets/LayoutLeft-DrOR8tOg.js","assets/Minus-DdEPrbsD.js","assets/Monitor01-B4iHbF93.js","assets/Sun-D531tFmZ.js","assets/Play-Clz2e0s4.js","assets/Plus-CO40HUhB.js","assets/SearchMd-FI2fcykP.js","assets/ShoppingBag01-BBDr_WSy.js","assets/Users01-CJ_YMgJe.js","assets/XClose-Dv4YALPV.js","assets/Zap-DFubAl8b.js","assets/index-BKZ2GYzY.js","assets/checkbox-DHBAzm3e.js","assets/select-CKa1YoCw.js","assets/index-BdQq_4o_.js","assets/ai-providers-logos-DD3qZ33J.js","assets/openai-compatible-presets-BKGfVqEx.js","assets/site-editor-toast-QCYxwt4C.js","assets/content-changes-Yn1NpHw-.js","assets/sandbox-url-D3mC8qhT.js","assets/use-sandbox-events-CdcsfdkO.js","assets/use-blocks-v8-project-DjyJGATt.js","assets/utils-CWN91Q0R.js","assets/sandbox-git-api-B73fIbEU.js","assets/hosted-reconcile-BT71cbCZ.js","assets/blocks-tab-states-DDvkpFWf.js","assets/empty-state-CHF2Jno9.js","assets/search-input-Dfgi3Bm0.js","assets/tabs-DV8AQUwT.js","assets/active-indicator-CCMhAsc_.js","assets/use-debounced-value-Dcq0NTAp.js","assets/use-file-configs-Caaj88sr.js","assets/asset-utils-DRModSGS.js","assets/useInfiniteQuery-BIIkqC2p.js","assets/infiniteQueryObserver-B1MZYli5.js","assets/usage-stats-njGMuDih.js","assets/utils-CVEq3hMx.js","assets/markdown-BNFJrVwN.js","assets/use-copy-BStTcLWM.js","assets/gateway-client-Dsg5xVl5.js","assets/form-CCzLKFB7.js","assets/label-B0UwCsXA.js","assets/switch-DgvZdTyU.js","assets/toggle-group-fJYx0W9h.js","assets/match-site-slug-config-B47_xZCi.js","assets/parse-sections-BRYcF5X4.js","assets/held-block-view-CYXKzDkA.js","assets/calendar-D3_Is4BX.js","assets/textarea-DCWhTUrR.js","assets/editor-classes-C7cnK7Wp.js","assets/task-key-rSXWMPFP.js","assets/sortable.esm-6QfVcWZZ.js","assets/category-tree-rhKblFsZ.js","assets/sandbox-start-errors-BK_aDCyt.js","assets/pair-DaLtpCvg.js","assets/collapsible-JCTHx5_U.js","assets/use-task-board-items-B0KeELtH.js","assets/config-DpuCRGPS.js","assets/task-route-KYQNiD-8.js","assets/project-index-Dn8Lu82V.js","assets/shell-layout-Lgn8VLZ9.js","assets/use-deployment-admin-HoxFQgZ9.js","assets/admin-fetch-BhTJlAsX.js","assets/use-org-notice-BeUR_ZGA.js","assets/command-CALEDfdi.js","assets/index-DS6kB3db.js","assets/integration-icon-LqaI_LSB.js","assets/project-icon-BpBMspxb.js","assets/use-navigate-to-agent-0M4hsJnf.js","assets/new-project-dialog-TULM28H3.js","assets/repository-picker-DCip0P__.js","assets/github-icon-CizbgzyS.js","assets/collection-search-Cez2fKoW.js","assets/new-project-store-Dkp4wOSi.js","assets/legacy-admin-welcome-dialog-DgOZFBtI.js","assets/required-auth-layout-B7e3rkXx.js","assets/use-org-sso-BOOKyOjL.js","assets/shell-layout-CE2Eihra.css","assets/content-blocks-o63cs2vh.js","assets/mcp-app-renderer-ChxjPYfG.js","assets/types-6-Ps6AGR.js","assets/omit-server-managed-metadata-L5IhjRZB.js","assets/sheet-BDbcvRnu.js","assets/use-connection-CYsyXyy7.js","assets/use-mcp-prompts-Bxssn6xT.js","assets/use-thread-outputs-U5yvy3ti.js","assets/file-type-icon-CNUBpmBv.js","assets/section-array-field-D3J7UHmj.js","assets/named-rule-step-jeqaAuBi.js","assets/slider-B257IOM8.js","assets/index-DeWoNfZE.js","assets/tooltipContext-oNzr-fXK.js","assets/CategoricalChart-jjkJNbxp.js","assets/index-tfWzV95z.js","assets/combobox-Dm0ZumLc.js","assets/scroll-area-ZYmkOMr8.js","assets/monaco-editor-oNRDmlFg.js","assets/editor-fCTeAQ3h.js","assets/use-delete-block-BZCQAK3P.js","assets/use-section-preview-base-CiQHlYOM.js","assets/mustache-BM5hcjQo.js","assets/seo-editor-RhNyCqwO.js","assets/use-apply-named-rule-B8KW11JW.js","assets/use-move-blocks-pw3TQRyc.js","assets/variant-matcher-override-GbUOkJxx.js"])))=>i.map(i=>d[i]);
2
+ import{c as le,j as r,r as R,m as Re,b as Se,B as _e,aH as ps,bk as gt,aI as De,bl as ko,bm as So,bn as Po,bo as jo,v as Zs,D as en,K as tn,w as sn,x as nn,e as Eo,h as it,I as Hs,y as No,b8 as Co,a6 as gs,b7 as To,b5 as Gr,bp as gr,i as Jr,at as Vs,av as Ws,a9 as Yr,P as qs,E as Ro,t as ms,b6 as Lo,q as Ao}from"./index-D19iAD4s.js";import{u as rn,N as Oo}from"./save-status-5VKYddaB.js";import{b as _o,c as lt,r as Qr,l as Xr,f as $o,g as Fo,w as Do}from"./chat-context-D5EEwp_m.js";import{t as Bo}from"./ChevronDown-c_BdXEOA.js";import{H as Mo,I as zo,C as an,J as Io,b as Uo,K as vr,L as Ko,M as Zr,N as Ho,O as ea}from"./agent-icon-CF35JltL.js";import{s as Vo}from"./File02-KoBPCXEf.js";import{b as Wo,n as qo}from"./UserSquare-YQkID8bv.js";import{s as ta}from"./Plus-CO40HUhB.js";import{a as sa,b as na,P as ra}from"./popover-Bm-_ILu8.js";import{e as We,b as qe,c as on,f as ln,a as cn,C as dn}from"./command-CALEDfdi.js";import{a as Go,c as Jo,b as Yo}from"./repository-binding-CP_PNLcQ.js";import{a as bt}from"./sandbox-lifecycle-context-3zZM02yQ.js";import{a as Qo,n as Xo,u as Zo,f as xr,H as ei,P as ti}from"./frame-navigation-B4-_qfJ3.js";import{r as si}from"./session-runtime-DZiu3uM2.js";import{u as aa}from"./use-voice-input-D_lO17n9.js";import{l as ni,m as ri,n as ai,o as oi,q as ii,t as li,u as Kt,j as vs,v as oa,i as tt,w as ci,x as un,y as ia,k as la,z as di,A as ui,B as ca,C as fi,c as da,b as ua,D as pi,h as Ve,E as mi,d as hi,g as gi,F as vi,G as xi,H as br,I as bi,J as yr,K as yi,L as wi,M as wr,N as kr,O as Sr,P as Pr,Q as jr,R as $s,S as ki,U as Si,V as Pi,W as ji,e as Ei}from"./site-editor-toast-QCYxwt4C.js";import{u as fa}from"./use-mobile-Dyvncftm.js";import{T as st,I as Er}from"./toolbar-icon-button-DIm3azB_.js";import{T as nt,a as rt,c as at}from"./tooltip-B3-v7v0W.js";import{w as os,i as Ni}from"./variant-matcher-override-GbUOkJxx.js";import{s as xt,n as fn,a as pn,f as Be,e as Ci,v as pa,u as ma,h as Ti,i as Ri,B as Li,S as Ai,C as Oi,b as _i,c as $i,d as Fi,g as Di,N as Bi,j as Mi,r as zi,k as Ii,l as Nr,p as Ui}from"./blocks-tab-states-DDvkpFWf.js";import{a as Ki}from"./use-fast-preview-draft-url-tiq51pbg.js";import{g as Hi,c as Cr,B as Fs,P as Vi,r as Wi,R as qi,S as Gi,l as Ji,m as Yi,p as Qi}from"./parse-sections-BRYcF5X4.js";import{g as Xi}from"./section-array-field-D3J7UHmj.js";import{u as Zi}from"./shell-layout-Lgn8VLZ9.js";import{u as mn,b as el}from"./use-sandbox-events-CdcsfdkO.js";import{s as tl,p as sl,W as nl,n as rl,S as Ds}from"./category-tree-rhKblFsZ.js";import{u as Gs}from"./useQueries-C-94_zeU.js";import{i as ha}from"./ArrowRight-DCL3gp96.js";import{a as al,c as ol}from"./blog-preview-url-BeobaMnK.js";import{u as il,b as ga}from"./use-never-published-BsVhVpS1.js";import{u as va}from"./blocks-preview-workspace-context-05h1qBm4.js";import{u as ll,H as cl}from"./held-block-view-CYXKzDkA.js";import{MonacoCodeEditor as xa}from"./monaco-editor-oNRDmlFg.js";import{c as ba,u as ya}from"./hosted-reconcile-BT71cbCZ.js";import{d as wa}from"./utils-CWN91Q0R.js";import{R as Tr,a as is,b as Rr}from"./resizable-D75nggzL.js";import{g as ka}from"./use-org-notice-BeUR_ZGA.js";import{u as dl}from"./use-blocks-v8-project-DjyJGATt.js";import{s as ul,L as fl,R as Sa,D as Lr,w as Js}from"./device-hint-1SWvGp3v.js";import{s as pl}from"./UserCheck01-VgBUlrC3.js";import{L as ml}from"./label-B0UwCsXA.js";import{T as hl,a as Ar}from"./toggle-group-fJYx0W9h.js";import{i as gl,l as vl,D as xl}from"./named-rule-step-jeqaAuBi.js";import{b as bl}from"./sandbox-url-D3mC8qhT.js";import{r as yl,R as wl}from"./virtual-mcp-jT57t8xN.js";import{d as kl}from"./delay-CnY5UFtP.js";import{s as Pa}from"./XClose-Dv4YALPV.js";import{o as Sl}from"./omit-server-managed-metadata-L5IhjRZB.js";import{a as Bs,b as Pl,w as jl,n as Or}from"./app-preview-url-9Od4s8Sz.js";import{u as El}from"./use-organization-settings-BEn5xJKT.js";import{a as Ms}from"./agent-capabilities-CTj-iH2e.js";import{E as Nl}from"./empty-state-CHF2Jno9.js";import{G as _r}from"./github-icon-CizbgzyS.js";import{R as Cl}from"./new-project-dialog-TULM28H3.js";import{r as Tl}from"./preview-source-BsRLGWUP.js";import{A as Rl,a as Ll,b as Al}from"./alert-DvKjRxar.js";import{u as Ol}from"./use-task-metadata-DRyTcJBf.js";function _l(t){const e=le.c(10),{waiting:s}=t,n=s?"true":"false";let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=r.jsx("span",{className:"flex size-10 items-center justify-center rounded-xl bg-muted text-muted-foreground sm:size-12",children:r.jsx(Mo,{className:"size-5 sm:size-6"})}),e[0]=o):o=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 u;e[2]!==s?(u=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]=u):u=e[3];let i;e[4]!==u?(i=r.jsxs("span",{className:"relative flex h-2 w-16 items-center sm:w-20",children:[c,u]}),e[4]=u,e[5]=i):i=e[5];let a;e[6]===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(zo,{className:"size-5 sm:size-6"})}),e[6]=a):a=e[6];let l;return e[7]!==n||e[8]!==i?(l=r.jsxs("div",{"aria-hidden":"true","data-testid":"connection-wire","data-waiting":n,className:"flex items-center gap-2",children:[o,i,a]}),e[7]=n,e[8]=i,e[9]=l):l=e[9],l}function $l(t){const e=le.c(22),{index:s,numbered:n,step:o,heading:c}=t,u=R.useId();let i;e[0]!==s||e[1]!==n?(i=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]=i):i=e[2];let a;e[3]!==c||e[4]!==u||e[5]!==o.title?(a=r.jsx(c,{id:u,className:"text-sm font-medium text-foreground",children:o.title}),e[3]=c,e[4]=u,e[5]=o.title,e[6]=a):a=e[6];let l;e[7]!==i||e[8]!==a?(l=r.jsxs("div",{className:"flex items-center gap-3",children:[i,a]}),e[7]=i,e[8]=a,e[9]=l):l=e[9];const g=n&&"sm:pl-9";let f;e[10]!==g?(f=Re("flex min-w-0 flex-col gap-3",g),e[10]=g,e[11]=f):f=e[11];let p;e[12]!==o.body?(p=o.body&&r.jsx("p",{className:"text-sm text-muted-foreground",children:o.body}),e[12]=o.body,e[13]=p):p=e[13];let m;e[14]!==o.after||e[15]!==f||e[16]!==p?(m=r.jsxs("div",{className:f,children:[p,o.after]}),e[14]=o.after,e[15]=f,e[16]=p,e[17]=m):m=e[17];let v;return e[18]!==u||e[19]!==l||e[20]!==m?(v=r.jsxs("li",{"aria-labelledby":u,className:"surface flex flex-col gap-3 p-4 sm:p-5",children:[l,m]}),e[18]=u,e[19]=l,e[20]=m,e[21]=v):v=e[21],v}const Fl=[];function hs(t){const e=le.c(20),{title:s,lead:n,waiting:o,alerts:c,steps:u,footer:i,headingLevel:a}=t,l=u===void 0?Fl:u,g=a===void 0?1:a,f=g===1?"h1":"h2",p=o&&l.length===0?"status":void 0;let m;e[0]!==o?(m=r.jsx(_l,{waiting:o}),e[0]=o,e[1]=m):m=e[1];let v;e[2]!==f||e[3]!==s?(v=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]=v):v=e[4];let y;e[5]!==n?(y=n&&r.jsx("p",{className:"text-pretty text-sm text-muted-foreground",children:n}),e[5]=n,e[6]=y):y=e[6];let h;e[7]!==p||e[8]!==m||e[9]!==v||e[10]!==y?(h=r.jsxs("header",{role:p,className:"flex flex-col items-center gap-3 text-center",children:[m,v,y]}),e[7]=p,e[8]=m,e[9]=v,e[10]=y,e[11]=h):h=e[11];let x;e[12]!==g||e[13]!==l?(x=l.length>0&&r.jsx("ol",{className:"flex flex-col gap-3",children:l.map((b,w)=>r.jsx($l,{index:w+1,numbered:l.length>1,step:b,heading:g===1?"h2":"h3"},b.title))}),e[12]=g,e[13]=l,e[14]=x):x=e[14];let C;return e[15]!==c||e[16]!==i||e[17]!==h||e[18]!==x?(C=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,x,i]})}),e[15]=c,e[16]=i,e[17]=h,e[18]=x,e[19]=C):C=e[19],C}function Dl(t){const e=le.c(43),{wait:s,hosts:n,invalidLink:o}=t,c=o===void 0?!1:o,u=Se();let i;e[0]!==c||e[1]!==u?(i=c&&r.jsx(Rl,{variant:"warning",children:r.jsxs("div",{className:"flex min-w-0 flex-col gap-1",children:[r.jsx(Ll,{className:"line-clamp-none text-foreground",children:u("decoServe.link.invalidTitle")}),r.jsx(Al,{children:u("decoServe.link.invalidBody")})]})}),e[0]=c,e[1]=u,e[2]=i):i=e[2];const a=i;if(s.kind==="problem"){let w;e[3]!==u||e[4]!==s.host||e[5]!==s.problem?(w=ul(u,s.problem,s.host),e[3]=u,e[4]=s.host,e[5]=s.problem,e[6]=w):w=e[6];const{title:N,body:k}=w;let S;e[7]!==k?(S=r.jsx(Sa,{text:k}),e[7]=k,e[8]=S):S=e[8];let E;e[9]===Symbol.for("react.memo_cache_sentinel")?(E=r.jsx(Lr,{className:"border-t border-border pt-4",links:["troubleshooting","serve"]}),e[9]=E):E=e[9];let T;return e[10]!==a||e[11]!==S||e[12]!==N?(T=r.jsx(hs,{headingLevel:2,waiting:!1,title:N,lead:S,alerts:a,footer:E}),e[10]=a,e[11]=S,e[12]=N,e[13]=T):T=e[13],T}const l=s.kind==="looking",g=l&&!s.paused;let f;e[14]!==u?(f=u("decoServe.waiting.title"),e[14]=u,e[15]=f):f=e[15];let p;e[16]!==u?(p=u("decoServe.waiting.lead"),e[16]=u,e[17]=p):p=e[17];let m;e[18]!==a||e[19]!==s.kind?(m=(a||s.kind==="denied")&&r.jsxs(r.Fragment,{children:[a,s.kind==="denied"&&r.jsx(fl,{})]}),e[18]=a,e[19]=s.kind,e[20]=m):m=e[20];let v;e[21]!==u?(v=u("decoServe.waiting.connect.title"),e[21]=u,e[22]=v):v=e[22];let y;e[23]!==u?(y=u("decoServe.waiting.connect.body"),e[23]=u,e[24]=y):y=e[24];let h;e[25]!==n||e[26]!==l||e[27]!==u||e[28]!==s.kind||e[29]!==s.onStart||e[30]!==s.paused?(h=s.kind==="needs-gesture"?r.jsx(_e,{variant:"outline",className:"self-start",onClick:s.onStart,children:u("decoServe.guide.start")}):l&&r.jsx("p",{role:"status",className:"text-sm text-muted-foreground",children:s.paused?u("decoServe.guide.paused"):u("decoServe.guide.looking",{hosts:n})}),e[25]=n,e[26]=l,e[27]=u,e[28]=s.kind,e[29]=s.onStart,e[30]=s.paused,e[31]=h):h=e[31];let x;e[32]!==v||e[33]!==y||e[34]!==h?(x=[{title:v,body:y,after:h}],e[32]=v,e[33]=y,e[34]=h,e[35]=x):x=e[35];let C;e[36]===Symbol.for("react.memo_cache_sentinel")?(C=r.jsx(Lr,{className:"border-t border-border pt-4",links:["siteEditor","serve","troubleshooting"]}),e[36]=C):C=e[36];let b;return e[37]!==x||e[38]!==g||e[39]!==f||e[40]!==p||e[41]!==m?(b=r.jsx(hs,{headingLevel:2,waiting:g,title:f,lead:p,alerts:m,steps:x,footer:C}),e[37]=x,e[38]=g,e[39]=f,e[40]=p,e[41]=m,e[42]=b):b=e[42],b}function Bl(t,e){switch(t.kind){case"needs-permission":return{kind:"denied"};case"problem":return{kind:"problem",problem:t.problem,host:e};default:return{kind:"looking"}}}const Ml=15e3,zl=3e3;function Il(t){const{candidates:e,probe:s,onFound:n,onChange:o,doc:c=document,setTimer:u=(w,N)=>setTimeout(w,N),clearTimer:i=w=>clearTimeout(w),timeoutMs:a=zl}=t;let l={status:"searching",firstRoundDone:!1,problem:null},g=!1,f=!1,p=0,m=null,v=null;const y=()=>c.visibilityState==="hidden",h=w=>{l={...l,...w},o(l)},x=async w=>{v=new AbortController;const N=v,k=u(()=>N.abort(),a);try{return await s(w,N.signal),!0}catch(S){if(g)return!1;const E=ri(S);return E.reason!=="not-answering"?h({problem:{...E,endpoint:w}}):l.problem?.endpoint===w&&h({problem:null}),!1}finally{i(k),v=null}},C=async()=>{if(m=null,!(g||f)){if(e.length===0){h({status:"stopped",firstRoundDone:!0});return}if(y()){h({status:"paused"});return}f=!0,l.status!=="searching"&&h({status:"searching"});for(const w of e){if(g)break;if(await x(w)){if(f=!1,g)return;g=!0,c.removeEventListener("visibilitychange",b),h({status:"found",firstRoundDone:!0}),n(w);return}}if(f=!1,!g){if(p+=1,l.firstRoundDone||h({firstRoundDone:!0}),y()){h({status:"paused"});return}m=u(()=>{C()},ni(p,Ml))}}};function b(){if(!g){if(y()){m!==null&&(i(m),m=null),f||h({status:"paused"});return}m!==null&&i(m),p=0,C()}}return c.addEventListener("visibilitychange",b),o(l),C(),()=>{g=!0,m!==null&&i(m),v?.abort(),c.removeEventListener("visibilitychange",b)}}function Ul(t,e){return oi(t,e)}const Kl=["loopback-network","local-network-access"];async function Hl(){if(ai(window.location.origin))return null;for(const t of Kl)try{return await navigator.permissions.query({name:t})}catch{}return null}let ja=null,$r=!1;const zs=new Set;function Vl(t){if(zs.add(t),!$r){$r=!0;const e=s=>{ja=s;for(const n of zs)n()};Hl().then(s=>{if(!s)return e("unsupported");e(s.state),s.addEventListener("change",()=>e(s.state))})}return()=>zs.delete(t)}const Wl={status:"stopped",firstRoundDone:!1,problem:null},Is=new Map;function ql(t){const e=Is.get(t);if(e)return e;let s={status:"searching",firstRoundDone:!1,problem:null};const n=new Set;let o=null;const c={onFound:()=>{},getSnapshot:()=>s,subscribe:u=>(n.add(u),o??=Il({candidates:t.split(" "),probe:Ul,onFound:i=>c.onFound(i),onChange:i=>{s=i;for(const a of n)a()}}),()=>{n.delete(u),!(n.size>0)&&(o?.(),o=null,Is.delete(t))})};return Is.set(t,c),c}function Ea(){return R.useSyncExternalStore(Vl,Dr,Dr)}const Gl=()=>()=>{},Fr=()=>Wl,Dr=()=>ja;function Sf(t){const e=le.c(9),{candidates:s,onFound:n}=t,[o,c]=R.useState(!1),u=Ea(),a=(u==="granted"||u==="unsupported"||u==="prompt"&&o)&&s.length>0;let l;e[0]!==a||e[1]!==s||e[2]!==n?(l=a?ql(s.join(" ")):null,l&&(l.onFound=n),e[0]=a,e[1]=s,e[2]=n,e[3]=l):l=e[3];const g=R.useSyncExternalStore(l?.subscribe??Gl,l?.getSnapshot??Fr,l?.getSnapshot??Fr),f=u==="prompt"&&!o;let p;e[4]===Symbol.for("react.memo_cache_sentinel")?(p=()=>c(!0),e[4]=p):p=e[4];let m;return e[5]!==u||e[6]!==g||e[7]!==f?(m={state:g,access:u,needsGesture:f,start:p},e[5]=u,e[6]=g,e[7]=f,e[8]=m):m=e[8],m}const Br={mode:"none",iframeBase:null,showBlockingOverlay:!1,showWakingPill:!1};function Jl(t){const{previewState:e,progressStatus:s,fastPreviewActive:n=!1,fastPreviewReady:o=!1,codingSession:c=!1,hostedDraft:u=!1}=t,i=c?null:t.previewServerUrl;return t.localPreviewUrl?{mode:"sandbox",iframeBase:t.localPreviewUrl,showBlockingOverlay:!1,showWakingPill:!1}:e.kind==="suspended"||e.kind==="errored"?Br:u&&t.hostedPointerPending&&!o?{...Br,showDecidingLoader:!0}:n&&o&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:n&&u&&i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!1}:!n&&e.kind==="iframe"&&s!=="doing"?{mode:"sandbox",iframeBase:e.previewUrl,showBlockingOverlay:!1,showWakingPill:!1}:i?{mode:"production",iframeBase:i,showBlockingOverlay:!1,showWakingPill:!0}:{mode:"none",iframeBase:null,showBlockingOverlay:!0,showWakingPill:!1}}const Yl=1500,Ql=500;function Xl({iframe:t,reload:e,waitMs:s=Yl,confirmMs:n=Ql}){let o;const c=()=>{clearTimeout(u),o=setTimeout(e,n)};t.addEventListener("load",c,{once:!0});const u=setTimeout(()=>{t.removeEventListener("load",c),e()},s);return()=>{clearTimeout(u),clearTimeout(o),t.removeEventListener("load",c)}}const Zl=ps({tag:De(),id:De(),classes:De(),text:De(),html:De(),manifestKey:De().nullable(),componentName:De().nullable(),parents:De(),url:De(),path:De(),viewport:ps({width:gt(),height:gt()}),position:ps({x:gt(),y:gt()})}),ec=`(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 R,m as Re,b as Se,B as _e,aH as ps,bk as gt,aI as De,
554
554
  }
555
555
  });
556
556
  })();`,ls=Object.freeze({ready:"deco:ready",load:"deco:load",loaded:"deco:loaded",loadError:"deco:load-error"}),rc="v1",ac="/studio-modules",Us=["wireframe","html-swap"];function oc(t,e,s){const n=new URL(`${ac}/${rc}/${e}.js`,t);return s&&n.searchParams.set("build",s),n.href}const ic=2e3;class lc{constructor(e){this.options=e,this.urls=Object.fromEntries(Us.map(s=>[s,oc(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===ls.ready)return cc(e.origin)?(this.ready(e.origin),!0):!1;if(e.origin!==this.origin)return!1;const o=n;switch(o.type){case ls.loaded:{const c=this.nameOf(o.url);return c&&(this.loaded.add(c),this.options.onModulesChange?.(),c==="wireframe"&&this.options.onWireframeReady?.()),!0}case ls.loadError:{const c=this.nameOf(o.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?.(o),!0;case"html-swap:start":return this.pendingSwap?.id===o.id&&(this.pendingSwap.started=!0,this.clearStartTimer()),!0;case"html-swap:end":return this.pendingSwap?.id!==o.id||(this.pendingSwap=null,this.clearStartTimer(),this.options.onSwapEnd?.()),!0;case"html-swap:error":return this.pendingSwap?.id===o.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()},ic),!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 Us)s?.postMessage({type:ls.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 Us.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 cc(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 Ys(t,e,s=!1){let n=t,o=typeof n?.__resolveType=="string"?n.__resolveType:"";for(let c=0;o&&c<5;c++){const u=e[o];if(u&&typeof u=="object"&&"__resolveType"in u){const i=u.__resolveType;if(typeof i=="string"&&i&&i!==o){n=u,o=i;continue}}break}if(!o)return[];if(o.includes("flags/multivariate")||s&&ko(o,s)){const c=Array.isArray(n.variants)?n.variants:[];if(c.length===0||c.every(a=>{const l=a?.rule;return So(l?.__resolveType,s)}))return null;const i=[];for(const a of c){const l=Po(a,s);if(l&&typeof l=="object")for(const g of Ys(l,e,s)??[])i.includes(g)||i.push(g)}return i}if(jo(o)){const c=n.section&&typeof n.section=="object"?Ys(n.section,e,s):[];return c===null?null:c.length?[o,...c]:[o]}return[o]}function ht(t){return t.replace(/[`*_]/g,"\\$&")}function dc(t,e){const s=[`The user selected an element on the live preview and asked: **"${ht(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:** \`${ht(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="${ht(t.classes)}"`:""}>`;s.push(`**Clicked element:** \`${n}\``),t.parents&&s.push(`**DOM breadcrumb:** ${ht(t.parents)} > ${t.tag}`),t.text&&s.push(`**Text content:** "${ht(t.text)}"`),t.componentName&&s.push(`**Component name:** ${ht(t.componentName)}`);const o=t.html.replace(/```/g,"`` `");return s.push("","**HTML snippet:**","```html",o,"```"),s.push("","Please read the source file, locate the element, and apply the requested change."),s.join(`
557
- `)}function uc(t,e,s=320,n=44,o=12){const{x:c,y:u}=t,{width:i,height:a}=e,l=Math.max(o,Math.min(c-s/2,i-s-o)),f=u/a>.68?Math.max(o,u-n-18):Math.min(u+18,a-n-o);return{leftPct:l/i*100,topPct:f/a*100}}function fc(t){const e=le.c(45),{element:s,onDismiss:n}=t,[o,c]=R.useState(""),u=R.useRef(null),{sendMessage:i}=_o(),{openSidePanel:a}=Zi(),l=Se();let g;e[0]!==s||e[1]!==o||e[2]!==n||e[3]!==a||e[4]!==i?(g=()=>{if(!o.trim())return;const I=dc(s,o);a(),i({parts:[{type:"text",text:I}]}),n()},e[0]=s,e[1]=o,e[2]=n,e[3]=a,e[4]=i,e[5]=g):g=e[5];const f=g;let p;e[6]!==s.position||e[7]!==s.viewport?(p=uc(s.position,s.viewport),e[6]=s.position,e[7]=s.viewport,e[8]=p):p=e[8];const m=p,v=`${m.leftPct}%`,y=`${m.topPct}%`;let h;e[9]!==v||e[10]!==y?(h={left:v,top:y,width:"320px"},e[9]=v,e[10]=y,e[11]=h):h=e[11];let x;e[12]!==f?(x=I=>{I.preventDefault(),f()},e[12]=f,e[13]=x):x=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=I=>c(I.target.value),e[14]=C):C=e[14];let b;e[15]!==n?(b=I=>{I.key==="Escape"&&n()},e[15]=n,e[16]=b):b=e[16];let w;e[17]!==l?(w=l("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=l,e[18]=w):w=e[18];let N;e[19]!==o||e[20]!==b||e[21]!==w?(N=r.jsx("input",{ref:u,autoFocus:!0,type:"text",value:o,onChange:C,onKeyDown:b,placeholder:w,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=o,e[20]=b,e[21]=w,e[22]=N):N=e[22];let k;e[23]!==o?(k=o.trim(),e[23]=o,e[24]=k):k=e[24];const S=!k;let E;e[25]!==l?(E=l("sandbox.visualEditorPrompt.sendButton"),e[25]=l,e[26]=E):E=e[26];let T;e[27]!==l?(T=l("sandbox.visualEditorPrompt.sendButton"),e[27]=l,e[28]=T):T=e[28];let B;e[29]!==T?(B=r.jsx("title",{children:T}),e[29]=T,e[30]=B):B=e[30];let A;e[31]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=A):A=e[31];let L;e[32]!==B?(L=r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[B,A]}),e[32]=B,e[33]=L):L=e[33];let $;e[34]!==S||e[35]!==E||e[36]!==L?($=r.jsx("button",{type:"submit",disabled:S,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:E,children:L}),e[34]=S,e[35]=E,e[36]=L,e[37]=$):$=e[37];let _;e[38]!==N||e[39]!==$||e[40]!==x?(_=r.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:x,children:[N,$]}),e[38]=N,e[39]=$,e[40]=x,e[41]=_):_=e[41];let F;return e[42]!==_||e[43]!==h?(F=r.jsx("div",{className:"absolute z-30 pointer-events-none",style:h,children:_}),e[42]=_,e[43]=h,e[44]=F):F=e[44],F}const Mr="site-links",pc=/details?page|\bpdp\b/i,mc=/listingpage|\bplp\b/i;function hc(t,e,s){const n=new Set;for(const i of s)pc.test(i)&&n.add("product"),mc.test(i)&&n.add("category");const o=xt(fn(t)),c=o[o.length-1],u=o[o.length-2];return c?.type==="text"&&c.text==="/p"&&u?.type==="param"&&u.name===e&&n.add("product"),e==="*"&&o.some(i=>i.type==="param"&&i.name==="*")&&n.add("category"),n}const gc=["rosa","preto","pink","black"];function cs(t,e){const s=e.trim();return s?t(s):gc.flatMap(n=>t(n))}function vc(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 Na=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function hn(t){return t.split("/")[0]??""}function xc(t){const e=new Set;for(const s of t){const n=hn(s);Na.has(n)&&e.add(n)}return e}function bc(t,e){const s=hn(t);return!Na.has(s)||e.size===0?!0:e.has(s)}const yc=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>cs(s=>vc(t,s),e),optionsFromPayload:ds},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>cs(s=>[{resolveType:t,props:{props:{search:s,pageSize:10,currentPage:1}}}],e),optionsFromPayload:ds},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>cs(s=>[{resolveType:t,props:{term:s,hitsPerPage:10}}],e),optionsFromPayload:ds},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>cs(s=>[{resolveType:t,props:{query:s,term:s,count:10,hitsPerPage:10}}],e),optionsFromPayload:ds},{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:Nc}];function wc(t,e,s=new Set){const n=[...e],o=i=>{const a=[];for(const l of yc){if(l.kind!==i)continue;const g=n.find(f=>l.test(f)&&bc(f,s));g&&a.push({cand:l,resolveType:g})}return a.find(l=>s.has(hn(l.resolveType)))??a[0]},c=(i,a,l)=>({kind:i.kind,id:`${i.kind}:${a}`,resolveType:a,clientFilter:i.clientFilter,isFallback:l,buildRequests:g=>i.buildRequests(a,g),optionsFromPayload:i.optionsFromPayload}),u=[];for(const i of["product","category"]){if(!t.has(i))continue;const a=o(i);a&&u.push(c(a.cand,a.resolveType,!1))}return t.size>0&&u.push(kc(t.has("category")?"category":"product")),u}function kc(t){return{kind:t,id:Mr,resolveType:Mr,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,s)=>Ac(e,s)}}function ot(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Sc(t,e,s){const n=new Set,o=new Set,c=u=>{if(Array.isArray(u)){for(const l of u)c(l);return}const i=ot(u);if(!i)return;const a=i.__resolveType;if(typeof a=="string"){if(s(a))n.add(a);else if(a in e&&!o.has(a)){o.add(a);const l=ot(e[a])?.__resolveType;typeof l=="string"&&s(l)&&n.add(a),c(e[a])}}for(const l of Object.values(i))c(l)};return c(t),n}function Ca(t){const e=new Set,s=[];for(const n of t)for(const o of n)e.has(o.value)||(e.add(o.value),s.push(o));return s}function Ta(t){try{return decodeURIComponent(t)}catch{return t}}function Pc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jc(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 gn(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 o=xt(fn(e)),{pattern:c,order:u}=jc(o),i=u.indexOf(s);if(i===-1)return null;const a=n.match(c);if(!a)return null;const l=a[i+1]?.replace(/^\/+|\/+$/g,"");return l?Ta(l):null}function ds(t,e){const s=ot(t),n=Array.isArray(t)?t:Array.isArray(s?.products)?s.products:Array.isArray(s?.list)?s.list:[],o=[],c=new Set;for(const u of n){const i=ot(u);if(!i)continue;const a=gn(i.url,e.template,e.paramName);if(!a||c.has(a))continue;c.add(a);const l=ot(i.isVariantOf),g=typeof l?.name=="string"&&l.name||typeof i.name=="string"&&i.name||a,f=Array.isArray(i.image)?ot(i.image[0]):null,p=typeof f?.url=="string"?f.url:void 0;o.push({value:a,label:g,image:p})}return o}function Ec(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?Ta(s):null}function Nc(t){const e=[],s=new Set,n=(o,c)=>{const u=ot(o);if(!u)return;const i=typeof u.name=="string"&&u.name?u.name:"",a=i?[...c,i]:c,l=Ec(u.url);if(l&&!s.has(l)&&(s.add(l),e.push({value:l,label:a.join(" › ")||l})),Array.isArray(u.children))for(const g of u.children)n(g,a)};if(Array.isArray(t))for(const o of t)n(o,[]);return e}const Cc=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 Tc(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,s=>s.toUpperCase())}function Rc(t){if(typeof t!="string"||!t)return[];const e=[],s=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let n,o=0;for(;(n=s.exec(t))!==null&&o++<5e3;){const c=n[1]??"",u=(n[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:c,text:u})}return e}function Lc(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,o=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let c,u=0;for(;(c=n.exec(t))!==null&&u++<3e3;){const i=(c[1]??"").replace(/\\\//g,"/");if(!i||s.has(i))continue;s.add(i);const a=t.slice(c.index,c.index+900).match(o)?.[1]?.replace(/\\\//g,"/");e.push({url:i,name:c[2]??"",image:a||void 0})}return e}function Ac(t,e){const s=[],n=new Set,o=(c,u,i,a)=>{if(s.length>=200)return;const l=gn(c,e.template,e.paramName);!l||n.has(l)||e.paramName==="*"&&/(^|\/)p$/.test(l)||i==="category"&&Cc.has(l.split("/")[0]??"")||(n.add(l),s.push({value:l,label:u&&u.length<=80?u:Tc(l),kind:i,image:a}))};for(const{url:c,name:u,image:i}of Lc(t))o(c,u,"product",i);for(const{href:c,text:u}of Rc(t))c.startsWith("/")&&!c.startsWith("//")&&o(c,u,"category");return s}function zt(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 Ra=1e4;function Oc(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 _c(t,{resolveType:e,props:s}){const n=await fetch(ii(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...s}),signal:AbortSignal.timeout(Ra)});if(!n.ok)throw new Error(`Failed to fetch options: ${n.status}`);return n.json()}async function zr(t,e){const s=await fetch(li(t,e),{signal:AbortSignal.timeout(Ra)});if(!s.ok)throw new Error(`Failed to fetch page: ${s.status}`);return s.text()}async function $c(t,e,s){const n=e.optionsFromPayload(await zr(t,"/"),s),o=n.find(u=>u.kind==="category");if(!o)return n;const c=Be(s.template,{[s.paramName]:o.value});if(c==="/")return n;try{const u=e.optionsFromPayload(await zr(t,c),s).filter(i=>i.kind==="product");return Ca([n,u])}catch{return n}}function Fc(t,e,s){return tn.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":s}`)}async function Dc(t,e,s,n){if(e.homepageLinks)return $c(t,e,n);const o=e.buildRequests?.(s)??[];if(o.length===0)return[];const c=await Promise.allSettled(o.map(i=>_c(t,i))),u=c.filter(i=>i.status==="fulfilled").map(i=>i.value);if(u.length===0){const i=c.find(a=>a.status==="rejected");throw i?i.reason:new Error("Failed to fetch options")}return Ca(u.map(i=>e.optionsFromPayload(i,n)))}function Qs(t,e,s,n,o){return{queryKey:Fc(t,e,s),queryFn:()=>Dc(t,e,s,n),enabled:o,staleTime:6e4,retry:1}}function It(t){const e=le.c(16),{heading:s,iconKind:n,options:o,template:c,paramName:u,keyPrefix:i,onSelect:a}=t;if(o.length===0)return null;let l;if(e[0]!==n||e[1]!==i||e[2]!==a||e[3]!==o||e[4]!==u||e[5]!==c){let f;e[7]!==n||e[8]!==i||e[9]!==a||e[10]!==u||e[11]!==c?(f=p=>r.jsxs(qe,{value:`${i}:${p.value}`,className:"gap-3 py-2",onSelect:()=>a(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(an,{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:Be(c,{[u]:p.value})})]})]},`${i}:${p.value}`),e[7]=n,e[8]=i,e[9]=a,e[10]=u,e[11]=c,e[12]=f):f=e[12],l=o.map(f),e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=u,e[5]=c,e[6]=l}else l=e[6];let g;return e[13]!==s||e[14]!==l?(g=r.jsx(We,{heading:s,children:l}),e[13]=s,e[14]=l,e[15]=g):g=e[15],g}function Ir(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 Bc(t){const e=le.c(52),{sources:s,template:n,paramName:o,value:c,sandboxRef:u,onCommit:i}=t,a=Se(),[l,g]=R.useState(!1),[f,p]=R.useState(""),[m,v]=R.useState(""),y=R.useRef(null),h=o==="*"?a("sandbox.preview.catchAllParamLabel"):`:${o}`,x=Oc(a),b=[...new Set(s.map(re=>x[re.kind].noun))].join(" or ");let w;e[0]!==a||e[1]!==b?(w=a("sandbox.pathParamPickerChip.searchPlaceholder",{options:b}),e[0]=a,e[1]=b,e[2]=w):w=e[2];const N=w,k={template:n,paramName:o};let S;e[3]!==f?(S=(re,ue)=>({source:re,query:ue,options:re.clientFilter?zt(ue.data??[],f):ue.data??[]}),e[3]=f,e[4]=S):S=e[4];const E=S,T=s.filter(Wc),B=s.filter(Vc),A=Gs({queries:T.map(re=>Qs(u,re,m,k,l))});let L;e[5]!==A||e[6]!==E?(L=(re,ue)=>E(re,A[ue]),e[5]=A,e[6]=E,e[7]=L):L=e[7];const $=T.map(L),_=$.length===0||$.every(Hc),F=Gs({queries:B.map(re=>Qs(u,re,m,k,l&&_))});let I;e[8]!==F||e[9]!==E?(I=(re,ue)=>E(re,F[ue]),e[8]=F,e[9]=E,e[10]=I):I=e[10];const J=B.map(I),W=_?J:$,Y=W.length===1&&W[0]?.source.homepageLinks?W[0]:null,Q=Y&&!Y.query.isLoading&&!Y.query.isError?Y?.query.data??[]:[],H=zt(Q.filter(Kc),f),ee=zt(Q.filter(Uc),f),q=H.length>0&&ee.length>0,U=re=>{g(re),y.current&&clearTimeout(y.current),p(re?c:""),v(re?c:"")};let z;e[11]===Symbol.for("react.memo_cache_sentinel")?(z=re=>{p(re),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{v(re)},300)},e[11]=z):z=e[11];const j=z,O=re=>{i(re),U(!1)},D=pn(f),K=Be(n,{[o]:D}),Z=en,te=Zs,M="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",X=Ic;let se;e[12]!==h||e[13]!==a?(se=a("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:h}),e[12]=h,e[13]=a,e[14]=se):se=e[14];let ae;e[15]!==se?(ae=r.jsx(sn,{className:"sr-only",children:r.jsx(nn,{children:se})}),e[15]=se,e[16]=ae):ae=e[16];let me;e[17]===Symbol.for("react.memo_cache_sentinel")?(me=r.jsx(an,{size:16,className:"shrink-0 text-foreground"}),e[17]=me):me=e[17];let pe;e[18]!==a?(pe=a("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=a,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:[me,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=ln,Pe=!1,fe="min-h-0 flex-1";let de;e[25]!==N||e[26]!==f?(de=r.jsx(cn,{autoFocus:!0,placeholder:N,value:f,onValueChange:j}),e[25]=N,e[26]=f,e[27]=de):de=e[27];const Le=on,Ie="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Ue;e[28]!==a?(Ue=a("sandbox.pathParamPickerChip.noResults"),e[28]=a,e[29]=Ue):Ue=e[29];let Me;e[30]!==Ue?(Me=r.jsx(dn,{children:Ue}),e[30]=Ue,e[31]=Me):Me=e[31];const yt=D&&r.jsx(We,{className:"shrink-0",children:r.jsxs(qe,{value:`__raw__:${D}`,className:"gap-3 py-2",onSelect:()=>O(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(ha,{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:a("sandbox.pathParamPickerChip.useRawValue",{rawTerm:D,paramLabel:h})}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:K})]})]})}),he=q?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(It,{heading:x.category.heading,iconKind:"category",options:H,template:n,paramName:o,keyPrefix:`${Y?.source.id}:cat`,onSelect:O})}),r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r.jsx(It,{heading:x.product.heading,iconKind:"product",options:ee,template:n,paramName:o,keyPrefix:`${Y?.source.id}:prod`,onSelect:O})})]}):r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:W.map(re=>{const{source:ue,query:Ge,options:wt}=re,{noun:Je}=x[ue.kind];if(Ge.isLoading)return r.jsx(Ir,{text:a("sandbox.pathParamPickerChip.loading",{noun:Je})},ue.id);if(Ge.isError)return r.jsx(Ir,{text:a("sandbox.pathParamPickerChip.couldNotLoad")},ue.id);if(ue.homepageLinks){const Ht=Ge.data??[];return r.jsxs(R.Fragment,{children:[r.jsx(It,{heading:x.category.heading,iconKind:"category",options:zt(Ht.filter(zc),f),template:n,paramName:o,keyPrefix:`${ue.id}:cat`,onSelect:O}),r.jsx(It,{heading:x.product.heading,iconKind:"product",options:zt(Ht.filter(Mc),f),template:n,paramName:o,keyPrefix:`${ue.id}:prod`,onSelect:O})]},ue.id)}return r.jsx(It,{heading:W.length>1?x[ue.kind].heading:void 0,iconKind:ue.kind,options:wt,template:n,paramName:o,keyPrefix:ue.id,onSelect:O},ue.id)})});let $e;e[32]!==Le||e[33]!==Me||e[34]!==yt||e[35]!==he?($e=r.jsxs(Le,{className:Ie,children:[Me,yt,he]}),e[32]=Le,e[33]=Me,e[34]=yt,e[35]=he,e[36]=$e):$e=e[36];let xe;e[37]!==ve||e[38]!==de||e[39]!==$e?(xe=r.jsxs(ve,{shouldFilter:Pe,className:fe,children:[de,$e]}),e[37]=ve,e[38]=de,e[39]=$e,e[40]=xe):xe=e[40];let Ke;e[41]!==te||e[42]!==ae||e[43]!==ge||e[44]!==xe||e[45]!==X?(Ke=r.jsxs(te,{className:M,onClick:X,children:[ae,ge,xe]}),e[41]=te,e[42]=ae,e[43]=ge,e[44]=xe,e[45]=X,e[46]=Ke):Ke=e[46];let Ae;return e[47]!==Z||e[48]!==U||e[49]!==l||e[50]!==Ke?(Ae=r.jsx(Z,{open:l,onOpenChange:U,children:Ke}),e[47]=Z,e[48]=U,e[49]=l,e[50]=Ke,e[51]=Ae):Ae=e[51],r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",title:a("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:re=>{re.stopPropagation(),U(!0)},children:c||h}),Ae]})}function Mc(t){return t.kind==="product"}function zc(t){return t.kind!=="product"}function Ic(t){return t.stopPropagation()}function Uc(t){return t.kind==="product"}function Kc(t){return t.kind!=="product"}function Hc(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Vc(t){return t.isFallback}function Wc(t){return!t.isFallback}function qc(t){const e=le.c(8),{sources:s,template:n,paramName:o,sandboxRef:c,onFill:u}=t;let i,a;if(e[0]!==o||e[1]!==c||e[2]!==s||e[3]!==n){const m={template:n,paramName:o},v=s.filter(Gc);a=Gs,i=v.map(y=>Qs(c,y,"",m,!0)),e[0]=o,e[1]=c,e[2]=s,e[3]=n,e[4]=i,e[5]=a}else i=e[4],a=e[5];let l;e[6]!==i?(l={queries:i},e[6]=i,e[7]=l):l=e[7];const g=a(l),[f,p]=R.useState(!1);if(!f)for(const m of g){if(m.isLoading)break;const v=m.data?.[0];if(v){p(!0),queueMicrotask(()=>u(v.value));break}}return null}function Gc(t){return!t.isFallback}function Jc(t){const e=le.c(31),{name:s,value:n,onCommit:o}=t,c=Se(),[u,i]=R.useState(n),[a,l]=R.useState(!1),g=R.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,m=u||p;let v;e[3]!==m?(v=r.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:m}),e[3]=m,e[4]=v):v=e[4];let y;e[5]!==p||e[6]!==c?(y=c("sandbox.preview.valueForParam",{label:p}),e[5]=p,e[6]=c,e[7]=y):y=e[7];let h,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=E=>i(E.target.value),x=()=>l(!0),e[8]=h,e[9]=x):(h=e[8],x=e[9]);let C;e[10]!==n?(C=E=>{E.key==="Enter"&&E.currentTarget.blur(),E.key==="Escape"&&(g.current=!0,i(n),E.currentTarget.blur())},e[10]=n,e[11]=C):C=e[11];let b;e[12]!==u||e[13]!==o||e[14]!==n?(b=()=>{if(l(!1),g.current){g.current=!1;return}const E=pn(u);i(E),E!==n&&o(E)},e[12]=u,e[13]=o,e[14]=n,e[15]=b):b=e[15];let w;e[16]!==u||e[17]!==p||e[18]!==y||e[19]!==C||e[20]!==b?(w=r.jsx("input",{type:"text",value:u,placeholder:p,title:y,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:Yc,onChange:h,onFocus:x,onKeyDown:C,onBlur:b}),e[16]=u,e[17]=p,e[18]=y,e[19]=C,e[20]=b,e[21]=w):w=e[21];let N;e[22]!==v||e[23]!==w?(N=r.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[v,w]}),e[22]=v,e[23]=w,e[24]=N):N=e[24];let k;e[25]!==a||e[26]!==c?(k=a&&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(Io,{size:10}),c("sandbox.preview.enterToGo")]}),e[25]=a,e[26]=c,e[27]=k):k=e[27];let S;return e[28]!==k||e[29]!==N?(S=r.jsxs(r.Fragment,{children:[N,k]}),e[28]=k,e[29]=N,e[30]=S):S=e[30],S}function Yc(t){return t.stopPropagation()}const Qc=/^(?:autor|author|authorSlug)$/;function Ur(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}const us=t=>typeof t=="string"?t:"";function Xc(t,e,s,n=new Date().toISOString().slice(0,10)){const o=Ci(e),[c]=xt(e);if(o.length===0||o.includes("*")||c?.type!=="text"||c.text==="/")return[];const u=tl(t),i=m=>u[m].map(v=>({label:v.label,data:Ur(Ur(t[v.key])[nl[m]])})),a=[],l=i("posts").filter(({data:m})=>sl(m)==="published"&&us(m.date).slice(0,10)<=n).sort((m,v)=>us(v.data.date).localeCompare(us(m.data.date)));for(const{label:m,data:v}of l)a.push({label:m,path:al(t,v,s)});for(const{label:m,data:v}of i("categories"))a.push({label:m,path:ol(t,v,s)});const g=o.find(m=>Qc.test(m));if(g)for(const{label:m,data:v}of i("authors")){const y=us(v.slug);a.push({label:m,path:y?Be(e,{[g]:y}):null})}const f=[],p=new Set;for(const{label:m,path:v}of a){if(!v)continue;const y={};for(const x of o){const C=gn(v,e,x);if(!C)break;y[x]=C}if(Object.keys(y).length!==o.length)continue;const h=Be(e,y);p.has(h)||(p.add(h),f.push({label:m,values:y}))}return f}function Zc(t){const e=le.c(96),{paramName:s,template:n,value:o,options:c,onPick:u,onCommit:i}=t,a=Se(),[l,g]=R.useState(!1),[f,p]=R.useState(""),m=`:${s}`;let v;if(e[0]!==c||e[1]!==f){const U=f.trim().toLowerCase();v=U?c.filter(z=>z.label.toLowerCase().includes(U)||Object.values(z.values).some(j=>j.toLowerCase().includes(U))):c,e[0]=c,e[1]=f,e[2]=v}else v=e[2];const y=v;let h,x,C,b,w,N,k,S,E,T,B,A,L,$,_,F,I,J;if(e[3]!==i||e[4]!==l||e[5]!==m||e[6]!==f||e[7]!==a||e[8]!==o){const U=pn(f);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{g(!1),p("")},e[27]=z):z=e[27],w=z;let j;e[28]!==m||e[29]!==a?(j=a("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:m}),e[28]=m,e[29]=a,e[30]=j):j=e[30];let O;e[31]===Symbol.for("react.memo_cache_sentinel")?(O=ae=>{ae.stopPropagation(),g(!0)},e[31]=O):O=e[31];const D=o||m;e[32]!==j||e[33]!==D?(T=r.jsx("button",{type:"button",title:j,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:O,children:D}),e[32]=j,e[33]=D,e[34]=T):T=e[34],b=en,S=l,e[35]===Symbol.for("react.memo_cache_sentinel")?(E=ae=>ae?g(!0):w(),e[35]=E):E=e[35],C=Zs,I="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",J=ed;let K;e[36]!==m||e[37]!==a?(K=a("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:m}),e[36]=m,e[37]=a,e[38]=K):K=e[38],e[39]!==K?(N=r.jsx(sn,{className:"sr-only",children:r.jsx(nn,{children:K})}),e[39]=K,e[40]=N):N=e[40];let Z;e[41]===Symbol.for("react.memo_cache_sentinel")?(Z=r.jsx(an,{size:16,className:"shrink-0 text-foreground"}),e[41]=Z):Z=e[41];let te;e[42]!==a?(te=a("sandbox.pathParamPickerChip.pickValueHeading"),e[42]=a,e[43]=te):te=e[43];let M;e[44]!==m?(M=r.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:m}),e[44]=m,e[45]=M):M=e[45],e[46]!==te||e[47]!==M?(k=r.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[Z,r.jsxs("span",{className:"text-sm font-medium text-foreground",children:[te," ",M]})]}),e[46]=te,e[47]=M,e[48]=k):k=e[48],x=ln,$=!1,_="min-h-0 flex-1";let X;e[49]!==a?(X=a("sandbox.pathParamPickerChip.searchBlogPlaceholder"),e[49]=a,e[50]=X):X=e[50],e[51]!==f||e[52]!==X?(F=r.jsx(cn,{autoFocus:!0,placeholder:X,value:f,onValueChange:p}),e[51]=f,e[52]=X,e[53]=F):F=e[53],h=on,B="max-h-none min-h-0 flex-1 overflow-y-auto";let se;e[54]!==a?(se=a("sandbox.pathParamPickerChip.noResults"),e[54]=a,e[55]=se):se=e[55],e[56]!==se?(A=r.jsx(dn,{children:se}),e[56]=se,e[57]=A):A=e[57],L=U&&r.jsx(We,{children:r.jsxs(qe,{value:`__raw__:${U}`,className:"gap-3 py-2",onSelect:()=>{i(U),w()},children:[r.jsx(ha,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:a("sandbox.pathParamPickerChip.useRawValue",{rawTerm:U,paramLabel:m})})]})}),e[3]=i,e[4]=l,e[5]=m,e[6]=f,e[7]=a,e[8]=o,e[9]=h,e[10]=x,e[11]=C,e[12]=b,e[13]=w,e[14]=N,e[15]=k,e[16]=S,e[17]=E,e[18]=T,e[19]=B,e[20]=A,e[21]=L,e[22]=$,e[23]=_,e[24]=F,e[25]=I,e[26]=J}else h=e[9],x=e[10],C=e[11],b=e[12],w=e[13],N=e[14],k=e[15],S=e[16],E=e[17],T=e[18],B=e[19],A=e[20],L=e[21],$=e[22],_=e[23],F=e[24],I=e[25],J=e[26];let W;if(e[58]!==w||e[59]!==u||e[60]!==n||e[61]!==y){let U;e[63]!==w||e[64]!==u||e[65]!==n?(U=z=>{const j=Be(n,z.values);return r.jsx(qe,{value:j,className:"py-2",onSelect:()=>{u(z.values),w()},children:r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:z.label}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:j})]})},j)},e[63]=w,e[64]=u,e[65]=n,e[66]=U):U=e[66],W=y.map(U),e[58]=w,e[59]=u,e[60]=n,e[61]=y,e[62]=W}else W=e[62];let Y;e[67]!==W?(Y=r.jsx(We,{children:W}),e[67]=W,e[68]=Y):Y=e[68];let G;e[69]!==h||e[70]!==Y||e[71]!==B||e[72]!==A||e[73]!==L?(G=r.jsxs(h,{className:B,children:[A,L,Y]}),e[69]=h,e[70]=Y,e[71]=B,e[72]=A,e[73]=L,e[74]=G):G=e[74];let Q;e[75]!==x||e[76]!==G||e[77]!==$||e[78]!==_||e[79]!==F?(Q=r.jsxs(x,{shouldFilter:$,className:_,children:[F,G]}),e[75]=x,e[76]=G,e[77]=$,e[78]=_,e[79]=F,e[80]=Q):Q=e[80];let H;e[81]!==C||e[82]!==N||e[83]!==k||e[84]!==Q||e[85]!==I||e[86]!==J?(H=r.jsxs(C,{className:I,onClick:J,children:[N,k,Q]}),e[81]=C,e[82]=N,e[83]=k,e[84]=Q,e[85]=I,e[86]=J,e[87]=H):H=e[87];let ee;e[88]!==b||e[89]!==S||e[90]!==E||e[91]!==H?(ee=r.jsx(b,{open:S,onOpenChange:E,children:H}),e[88]=b,e[89]=S,e[90]=E,e[91]=H,e[92]=ee):ee=e[92];let q;return e[93]!==T||e[94]!==ee?(q=r.jsxs(r.Fragment,{children:[T,ee]}),e[93]=T,e[94]=ee,e[95]=q):q=e[95],q}function ed(t){return t.stopPropagation()}function td(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 sd(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function nd(t){return t.showPreviewToolbar&&(t.contentEditingEnabled||t.hasFrameworkRoutes)}function rd(t){return t.v8?null:t.production||t.localPreview?{type:"editor::inject",args:{script:t.script}}:{type:"visual-editor::activate",script:t.script}}function ad(t){return t.v8?null:{type:"visual-editor::activate",script:t.script}}class La extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function od(t,e){if(t)return t;const s=await e?.().catch(()=>null);if(!s)throw new La;return s}async function id(t,e,s){return s?Cr(t,e,await od(s.meta,s.loadMeta)):Cr(t,e)}function ld(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=il(s);let o;return e[2]!==t||e[3]!==n?(o={mutationFn:async c=>{const{name:u,path:i,template:a,schema:l}=c;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const g=Hi(u),f=a?{...a,name:u,path:i}:await id(u,i,l);return await n.mutateAsync({blockKey:g,data:f}),{key:g,name:u,path:i}}},e[2]=t,e[3]=n,e[4]=o):o=e[4],Eo(o)}function cd(t){const e=le.c(89),{open:s,onOpenChange:n,isPending:o,error:c,templates:u,onSubmit:i}=t,a=o===void 0?!1:o,l=Se();let g;e[0]!==l?(g=l("sectionsEditor.createPageModal.defaultPageName"),e[0]=l,e[1]=g):g=e[1];const[f,p]=R.useState(g);let m;e[2]!==l?(m=l("sectionsEditor.createPageModal.defaultPagePath"),e[2]=l,e[3]=m):m=e[3];const[v,y]=R.useState(m),[h,x]=R.useState(Fs),[C,b]=R.useState(null),[w,N]=R.useState(s);s!==w&&(N(s),s&&(p(l("sectionsEditor.createPageModal.defaultPageName")),y(l("sectionsEditor.createPageModal.defaultPagePath")),x(Fs),b(null)));const k=!!u?.length;let S;e[4]!==a||e[5]!==n?(S=pe=>{!pe&&!a&&(b(null),n(!1))},e[4]=a,e[5]=n,e[6]=S):S=e[6];const E=S;let T;e[7]!==a||e[8]!==f||e[9]!==i||e[10]!==v||e[11]!==k||e[12]!==h?(T=async pe=>{pe.preventDefault();const be=f.trim(),ge=v.trim();if(!be||!ge||a)return;const ve=pa(ge);if(ve){b(ve);return}b(null),await i({name:be,path:ge,templateKey:k&&h!==Fs?h:null})},e[7]=a,e[8]=f,e[9]=i,e[10]=v,e[11]=k,e[12]=h,e[13]=T):T=e[13];const B=T,A=C??c;let L;e[14]!==l?(L=l("sectionsEditor.createPageModal.title"),e[14]=l,e[15]=L):L=e[15];let $;e[16]!==L?($=r.jsx(sn,{children:r.jsx(nn,{children:L})}),e[16]=L,e[17]=$):$=e[17];let _;e[18]!==l?(_=l("sectionsEditor.createPageModal.nameLabel"),e[18]=l,e[19]=_):_=e[19];let F;e[20]!==_?(F=r.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:_}),e[20]=_,e[21]=F):F=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 J;e[23]!==l?(J=l("sectionsEditor.createPageModal.namePlaceholder"),e[23]=l,e[24]=J):J=e[24];let W;e[25]!==a||e[26]!==f||e[27]!==J?(W=r.jsx(Hs,{id:"new-page-name",value:f,onChange:I,placeholder:J,autoFocus:!0,disabled:a}),e[25]=a,e[26]=f,e[27]=J,e[28]=W):W=e[28];let Y;e[29]!==W||e[30]!==F?(Y=r.jsxs("div",{className:"space-y-1.5",children:[F,W]}),e[29]=W,e[30]=F,e[31]=Y):Y=e[31];let G;e[32]!==l?(G=l("sectionsEditor.createPageModal.pathLabel"),e[32]=l,e[33]=G):G=e[33];let Q;e[34]!==G?(Q=r.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:G}),e[34]=G,e[35]=Q):Q=e[35];let H;e[36]===Symbol.for("react.memo_cache_sentinel")?(H=pe=>y(pe.target.value),e[36]=H):H=e[36];let ee;e[37]!==l?(ee=l("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=l,e[38]=ee):ee=e[38];let q;e[39]!==a||e[40]!==v||e[41]!==ee?(q=r.jsx(Hs,{id:"new-page-path",value:v,onChange:H,placeholder:ee,disabled:a}),e[39]=a,e[40]=v,e[41]=ee,e[42]=q):q=e[42];let U;e[43]!==Q||e[44]!==q?(U=r.jsxs("div",{className:"space-y-1.5",children:[Q,q]}),e[43]=Q,e[44]=q,e[45]=U):U=e[45];let z;e[46]!==a||e[47]!==k||e[48]!==l||e[49]!==h||e[50]!==u?(z=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(Vi,{id:"new-page-template",value:h,onChange:x,templates:u??[],disabled:a})]}),e[46]=a,e[47]=k,e[48]=l,e[49]=h,e[50]=u,e[51]=z):z=e[51];let j;e[52]!==A?(j=A&&r.jsx("p",{className:"text-xs text-destructive",children:A}),e[52]=A,e[53]=j):j=e[53];let O;e[54]!==Y||e[55]!==U||e[56]!==z||e[57]!==j?(O=r.jsxs("div",{className:"space-y-4 py-4",children:[Y,U,z,j]}),e[54]=Y,e[55]=U,e[56]=z,e[57]=j,e[58]=O):O=e[58];let D;e[59]!==n?(D=()=>n(!1),e[59]=n,e[60]=D):D=e[60];let K;e[61]!==l?(K=l("sectionsEditor.createPageModal.cancelButton"),e[61]=l,e[62]=K):K=e[62];let Z;e[63]!==a||e[64]!==D||e[65]!==K?(Z=r.jsx(_e,{type:"button",variant:"outline",onClick:D,disabled:a,children:K}),e[63]=a,e[64]=D,e[65]=K,e[66]=Z):Z=e[66];let te;e[67]!==a||e[68]!==f||e[69]!==v?(te=!f.trim()||!v.trim()||a,e[67]=a,e[68]=f,e[69]=v,e[70]=te):te=e[70];let M;e[71]!==a||e[72]!==l?(M=a?r.jsxs(r.Fragment,{children:[r.jsx(it,{className:"size-3.5"}),l("sectionsEditor.createPageModal.creatingButton")]}):l("sectionsEditor.createPageModal.createButton"),e[71]=a,e[72]=l,e[73]=M):M=e[73];let X;e[74]!==te||e[75]!==M?(X=r.jsx(_e,{type:"submit",disabled:te,children:M}),e[74]=te,e[75]=M,e[76]=X):X=e[76];let se;e[77]!==Z||e[78]!==X?(se=r.jsxs(No,{children:[Z,X]}),e[77]=Z,e[78]=X,e[79]=se):se=e[79];let ae;e[80]!==B||e[81]!==O||e[82]!==se||e[83]!==$?(ae=r.jsx(Zs,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:B,children:[$,O,se]})}),e[80]=B,e[81]=O,e[82]=se,e[83]=$,e[84]=ae):ae=e[84];let me;return e[85]!==E||e[86]!==s||e[87]!==ae?(me=r.jsx(en,{open:s,onOpenChange:E,children:ae}),e[85]=E,e[86]=s,e[87]=ae,e[88]=me):me=e[88],me}function dd(t){const e=le.c(35),{orgSlug:s,virtualMcpId:n,branch:o,previewUrl:c,meta:u,decofile:i,blockKey:a}=t,l=Se();let g;e[0]!==o||e[1]!==s||e[2]!==n?(g={orgSlug:s,virtualMcpId:n,branch:o},e[0]=o,e[1]=s,e[2]=n,e[3]=g):g=e[3];const f=ll(g,i);let p;e[4]!==a||e[5]!==i?(p=Wi(i,a),e[4]=a,e[5]=i,e[6]=p):p=e[6];const{resolveType:m,props:v,title:y}=p;if(!m){let N;e[7]!==l?(N=l("sandbox.preview.loaderNoLongerExists"),e[7]=l,e[8]=N):N=e[8];let k;return e[9]!==N?(k=r.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:N}),e[9]=N,e[10]=k):k=e[10],k}const h=`loader:${a}`,x=`loader:${a}`;let C;e[11]!==a||e[12]!==m||e[13]!==y?(C={mode:"saved",blockKey:a,resolveType:m,title:y},e[11]=a,e[12]=m,e[13]=y,e[14]=C):C=e[14];let b;e[15]!==o||e[16]!==i||e[17]!==u||e[18]!==s||e[19]!==c||e[20]!==v||e[21]!==f.isPending||e[22]!==f.save||e[23]!==x||e[24]!==C||e[25]!==n?(b=r.jsx(qi,{orgSlug:s,virtualMcpId:n,branch:o,previewUrl:c,meta:u,decofile:i,kind:"loaders",target:C,initialValue:v,isCreating:f.isPending,onCreate:ud,onSaveReferencedBlock:f.save,showRun:!1},x),e[15]=o,e[16]=i,e[17]=u,e[18]=s,e[19]=c,e[20]=v,e[21]=f.isPending,e[22]=f.save,e[23]=x,e[24]=C,e[25]=n,e[26]=b):b=e[26];let w;return e[27]!==a||e[28]!==o||e[29]!==i||e[30]!==s||e[31]!==h||e[32]!==b||e[33]!==n?(w=r.jsx(cl,{listing:i,orgSlug:s,virtualMcpId:n,branch:o,blockKey:a,present:void 0,children:b},h),e[27]=a,e[28]=o,e[29]=i,e[30]=s,e[31]=h,e[32]=b,e[33]=n,e[34]=w):w=e[34],w}async function ud(){}function fd(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Kr(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:fd(t.error)}}function pd(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 md(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=pd(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(o=>o.status==="error"&&!o.hasData&&o.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 hd=R.lazy(()=>Co(()=>import("./sections-editor-FJjN0xqY.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,162])).then(t=>({default:t.SectionsEditor})));function Hr(t){const e=le.c(62),{virtualMcpId:s,externalSelection:n,onSectionPicked:o,onViewJsonFile:c}=t,u=n===void 0?null:n,{org:i}=gs(),{currentBranch:a,taskId:l}=lt(),g=mn(),f=bt(),p=va(),m=g.lifecycle.phase==="running",v=f.previewUrl;let y;e[0]!==a||e[1]!==i||e[2]!==v||e[3]!==l||e[4]!==s?(y=a?{orgSlug:i.slug,virtualMcpId:s,branch:a,threadId:l??null,previewUrl:v}:null,e[0]=a,e[1]=i,e[2]=v,e[3]=l,e[4]=s,e[5]=y):y=e[5];const h=y,x=Kt(s,a);let C;e[6]!==m?(C={fetchEnabled:m},e[6]=m,e[7]=C):C=e[7];const b=vs(h,C),w=oa(h);let N;e[8]!==m?(N={fetchEnabled:m},e[8]=m,e[9]=N):N=e[9];const k=ma(h,N),S=md({lifecyclePhase:g.lifecycle.phase,decofile:Kr(b),meta:Kr(k),hasEditableContent:Ti(b.data,k.data),fastPreviewActive:aa(s).runtime==="cms"||tt(x)}),E=rn()===void 0,T=gd;if(Ri(x)){let j;return e[10]===Symbol.for("react.memo_cache_sentinel")?(j=T(r.jsx(Ai,{})),e[10]=j):j=e[10],j}if(x.kind==="pending"&&x.retrying){let j;return e[11]!==x?(j=T(r.jsx(Oi,{backend:x})),e[11]=x,e[12]=j):j=e[12],j}if(S.kind==="loading"||E){let j;return e[13]===Symbol.for("react.memo_cache_sentinel")?(j=T(r.jsx(To,{})),e[13]=j):j=e[13],j}if(b.data&&ci(k.data)){const j=p.state.target,O=j?.kind==="page"||j?.kind==="section"?j.key:null,D=x.kind==="legacy"?O??"":`${w}:${O??""}`,K=a??"";let Z;return e[14]!==b.data||e[15]!==O||e[16]!==i.slug||e[17]!==D||e[18]!==K||e[19]!==s?(Z=T(r.jsx(Gi,{orgSlug:i.slug,virtualMcpId:s,branch:K,decofile:b.data,initialKey:O,compact:!0},D)),e[14]=b.data,e[15]=O,e[16]=i.slug,e[17]=D,e[18]=K,e[19]=s,e[20]=Z):Z=e[20],Z}if(S.kind==="empty"){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=T(r.jsx(_i,{})),e[21]=j):j=e[21],j}if(S.kind==="error"){let j;e[22]!==b||e[23]!==f||e[24]!==k||e[25]!==S.source?(j=()=>{if(S.source==="sandbox"){f.retry();return}Promise.all([b.refetch(),k.refetch()])},e[22]=b,e[23]=f,e[24]=k,e[25]=S.source,e[26]=j):j=e[26];const O=j;let D;return e[27]!==O||e[28]!==S.source?(D=T(r.jsx(Li,{source:S.source,onRetry:O})),e[27]=O,e[28]=S.source,e[29]=D):D=e[29],D}let B;e[30]===Symbol.for("react.memo_cache_sentinel")?(B=j=>T(r.jsx("div",{className:"h-full min-h-0",children:j})),e[30]=B):B=e[30];const A=B,L=p.state.target;if(L?.kind==="loader"&&b.data&&k.data){const j=x.kind==="legacy"?void 0:w,O=a??"",D=v??null;let K;return e[31]!==b.data||e[32]!==k.data||e[33]!==i.slug||e[34]!==j||e[35]!==O||e[36]!==D||e[37]!==L.key||e[38]!==s?(K=A(r.jsx(dd,{orgSlug:i.slug,virtualMcpId:s,branch:O,previewUrl:D,meta:k.data,decofile:b.data,blockKey:L.key},j)),e[31]=b.data,e[32]=k.data,e[33]=i.slug,e[34]=j,e[35]=O,e[36]=D,e[37]=L.key,e[38]=s,e[39]=K):K=e[39],K}let $;e[40]!==a||e[41]!==i.slug||e[42]!==L||e[43]!==s?($=L||!a?null:Qr(Xr(i.slug,s,a)),e[40]=a,e[41]=i.slug,e[42]=L,e[43]=s,e[44]=$):$=e[44];const _=$;let F="/",I=null,J=null;L?.kind==="page"?(F=L.path,I=L.key):L?.kind==="section"?J=L.key:_&&(F=_.path,I=_.pageKey);const W=I?`page:${I}`:J?`section:${J}`:`path:${F}`;let Y;e[45]===Symbol.for("react.memo_cache_sentinel")?(Y=r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}),e[45]=Y):Y=e[45];const G=x.kind==="legacy"?W:`${w}:${W}`,Q=a??"",H=v??void 0,ee=J?null:u,q=J?void 0:o,U=!!I&&p.state.editSeoPageKey===I;let z;return e[46]!==J||e[47]!==I||e[48]!==F||e[49]!==c||e[50]!==i.slug||e[51]!==H||e[52]!==ee||e[53]!==q||e[54]!==U||e[55]!==G||e[56]!==Q||e[57]!==s||e[58]!==p.consumeEditSeo||e[59]!==p.setFocusedBlock||e[60]!==p.setVariantOverride?(z=A(r.jsx(R.Suspense,{fallback:Y,children:r.jsx(hd,{orgSlug:i.slug,virtualMcpId:s,branch:Q,previewReady:!0,previewUrl:H,currentPath:F,activePageBlockKey:I,activeGlobalBlockKey:J,externalSelection:ee,onSectionPicked:q,initialEditSeo:U,onExitSeo:p.consumeEditSeo,onVariantPreviewOverride:p.setVariantOverride,onFocusedBlockChange:p.setFocusedBlock,onViewJsonFile:c},G)})),e[46]=J,e[47]=I,e[48]=F,e[49]=c,e[50]=i.slug,e[51]=H,e[52]=ee,e[53]=q,e[54]=U,e[55]=G,e[56]=Q,e[57]=s,e[58]=p.consumeEditSeo,e[59]=p.setFocusedBlock,e[60]=p.setVariantOverride,e[61]=z):z=e[61],z}function gd(t){return r.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function vd(t){const e=le.c(51),{virtualMcpId:s,pageKey:n,onClose:o,ref:c}=t,u=Se(),i=rn(),a=i===!0,l=un(s);let g;e[0]!==l||e[1]!==n?(g=ia(l,wa(n)),e[0]=l,e[1]=n,e[2]=g):g=e[2];const f=g,{org:p}=gs(),{currentBranch:m,taskId:v}=lt(),h=bt().previewUrl;let x;e[3]!==m||e[4]!==p.slug||e[5]!==h||e[6]!==v||e[7]!==s?(x=m?{orgSlug:p.slug,virtualMcpId:s,branch:m,threadId:v??null,previewUrl:h}:null,e[3]=m,e[4]=p.slug,e[5]=h,e[6]=v,e[7]=s,e[8]=x):x=e[8];const b=vs(x),w=m??"";let N;e[9]!==p.slug||e[10]!==w||e[11]!==s?(N={orgSlug:p.slug,virtualMcpId:s,branch:w},e[9]=p.slug,e[10]=w,e[11]=s,e[12]=N):N=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:E,hold:T}=ga(N,k),B=m??"";let A;e[14]!==p.slug||e[15]!==B||e[16]!==s?(A=ba({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=ya(A);let $;e[18]!==n||e[19]!==L?($=L(n),e[18]=n,e[19]=L,e[20]=$):$=e[20];const _=$;let F;e[21]!==_||e[22]!==n?(F={pageKey:n,copyEpoch:_},e[21]=_,e[22]=n,e[23]=F):F=e[23];const[I,J]=R.useState(F);(I.pageKey!==n||I.copyEpoch!==_)&&(J({pageKey:n,copyEpoch:_}),T(n));const W=b.data?.[n],Y=b.data===void 0&&b.isLoading||i===void 0,G=b.data!==void 0&&W===void 0,Q=!m||G||Y;let H;e[24]!==W?(H=W===void 0?"":JSON.stringify(W,null,2),e[24]=W,e[25]=H):H=e[25];const ee=H;let q;e[26]!==n||e[27]!==Q||e[28]!==S?(q=K=>{if(Q)return;let Z;try{Z=JSON.parse(K)}catch{return}Z===null||typeof Z!="object"||Array.isArray(Z)||S(n,Z)},e[26]=n,e[27]=Q,e[28]=S,e[29]=q):q=e[29];const U=q;let z;e[30]!==E?(z=()=>({flush:E}),e[30]=E,e[31]=z):z=e[31],R.useImperativeHandle(c,z);let j;e[32]!==f||e[33]!==a||e[34]!==o||e[35]!==u?(j=a?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:u("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(_e,{variant:"ghost",size:"icon-sm",onClick:o,"aria-label":u("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Gr,{size:14})})]}),e[32]=f,e[33]=a,e[34]=o,e[35]=u,e[36]=j):j=e[36];let O;e[37]!==_||e[38]!==b.data||e[39]!==E||e[40]!==ee||e[41]!==Y||e[42]!==G||e[43]!==n||e[44]!==Q||e[45]!==U||e[46]!==u?(O=Y?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}):G?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",u("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(xa,{code:ee,language:"json",readOnly:Q,height:"100%",onChange:K=>U(K??""),onSave:K=>{U(K),E()}},`${n}:${b.data===void 0?"loading":"ready"}:${_}`)}),e[37]=_,e[38]=b.data,e[39]=E,e[40]=ee,e[41]=Y,e[42]=G,e[43]=n,e[44]=Q,e[45]=U,e[46]=u,e[47]=O):O=e[47];let D;return e[48]!==j||e[49]!==O?(D=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[j,O]}),e[48]=j,e[49]=O,e[50]=D):D=e[50],D}function Vr(t){const e=le.c(3),{currentBranch:s}=lt(),n=Kt(t.virtualMcpId,s);let o;return e[0]!==n.kind||e[1]!==t?(o=n.kind==="legacy"?r.jsx(vd,{...t}):r.jsx(xd,{...t}),e[0]=n.kind,e[1]=t,e[2]=o):o=e[2],o}function xd(t){const e=le.c(61),{virtualMcpId:s,pageKey:n,onClose:o,ref:c}=t,u=Se(),i=rn(),a=i===!0,l=un(s);let g;e[0]!==l||e[1]!==n?(g=ia(l,wa(n)),e[0]=l,e[1]=n,e[2]=g):g=e[2];const f=g,{org:p}=gs(),{currentBranch:m,taskId:v}=lt(),h=bt().previewUrl;let x;e[3]!==m||e[4]!==p.slug||e[5]!==h||e[6]!==v||e[7]!==s?(x=m?{orgSlug:p.slug,virtualMcpId:s,branch:m,threadId:v??null,previewUrl:h}:null,e[3]=m,e[4]=p.slug,e[5]=h,e[6]=v,e[7]=s,e[8]=x):x=e[8];const C=x,b=vs(C);let w;e[9]!==n?(w=[n],e[9]=n,e[10]=w):w=e[10];let N;e[11]!==b.data?(N={listing:b.data},e[11]=b.data,e[12]=N):N=e[12];const k=la(C,w,N),S=m??"";let E;e[13]!==p.slug||e[14]!==S||e[15]!==s?(E={orgSlug:p.slug,virtualMcpId:s,branch:S},e[13]=p.slug,e[14]=S,e[15]=s,e[16]=E):E=e[16];let T;e[17]===Symbol.for("react.memo_cache_sentinel")?(T={holdsCopy:!0},e[17]=T):T=e[17];const{save:B,flush:A,hold:L}=ga(E,T),$=m??"";let _;e[18]!==p.slug||e[19]!==$||e[20]!==s?(_=ba({orgSlug:p.slug,virtualMcpId:s,branch:$}),e[18]=p.slug,e[19]=$,e[20]=s,e[21]=_):_=e[21];const F=ya(_);let I;e[22]!==n||e[23]!==F?(I=F(n),e[22]=n,e[23]=F,e[24]=I):I=e[24];const J=I,W=b.data?.[n];let Y;e[25]!==k.ready||e[26]!==b.data||e[27]!==W?(Y=k.ready&&b.data!==void 0&&(W===void 0||gr(W)),e[25]=k.ready,e[26]=b.data,e[27]=W,e[28]=Y):Y=e[28];const G=Y;let Q;e[29]!==J||e[30]!==n?(Q={pageKey:n,copyEpoch:J,opened:!1,code:""},e[29]=J,e[30]=n,e[31]=Q):Q=e[31];const[H,ee]=R.useState(Q);if(G&&(H.pageKey!==n||H.copyEpoch!==J||!H.opened)){let X;e[32]!==W?(X=W===void 0?"":JSON.stringify(W,null,2),e[32]=W,e[33]=X):X=e[33],ee({pageKey:n,copyEpoch:J,opened:!0,code:X}),gr(W)&&L(n)}const q=H.pageKey===n&&H.opened,U=i===void 0||!q&&!G,z=G&&W===void 0,j=!m||z||U;let O;e[34]!==n||e[35]!==j||e[36]!==B?(O=X=>{if(j)return;ee(ae=>({...ae,code:X}));let se;try{se=JSON.parse(X)}catch{return}se===null||typeof se!="object"||Array.isArray(se)||B(n,se)},e[34]=n,e[35]=j,e[36]=B,e[37]=O):O=e[37];const D=O;let K;e[38]!==A?(K=()=>({flush:A}),e[38]=A,e[39]=K):K=e[39],R.useImperativeHandle(c,K);let Z;e[40]!==f||e[41]!==a||e[42]!==o||e[43]!==u?(Z=a?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:u("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(_e,{variant:"ghost",size:"icon-sm",onClick:o,"aria-label":u("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Gr,{size:14})})]}),e[40]=f,e[41]=a,e[42]=o,e[43]=u,e[44]=Z):Z=e[44];let te;e[45]!==k.failed||e[46]!==k.retry||e[47]!==A||e[48]!==H.code||e[49]!==H.copyEpoch||e[50]!==H.pageKey||e[51]!==U||e[52]!==z||e[53]!==j||e[54]!==D||e[55]!==q||e[56]!==u?(te=!q&&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:u("sectionsEditor.hosted.blockLoadFailed")}),r.jsx(_e,{variant:"outline",size:"sm",onClick:k.retry,children:u("sectionsEditor.namedRules.tryAgain")})]}):U?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}):z?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",u("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(xa,{code:H.code,language:"json",readOnly:j,height:"100%",onChange:X=>D(X??""),onSave:X=>{D(X),A()}},`${H.pageKey}:${H.copyEpoch}`)}),e[45]=k.failed,e[46]=k.retry,e[47]=A,e[48]=H.code,e[49]=H.copyEpoch,e[50]=H.pageKey,e[51]=U,e[52]=z,e[53]=j,e[54]=D,e[55]=q,e[56]=u,e[57]=te):te=e[57];let M;return e[58]!==Z||e[59]!==te?(M=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[Z,te]}),e[58]=Z,e[59]=te,e[60]=M):M=e[60],M}function Aa(t){return t.contentEditingEnabled&&!t.isMobile}function bd(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function yd(t,e){return t==="blocks"?"preview":e?"blocks":t}function wd(t){return Aa({contentEditingEnabled:ka(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function kd(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function Sd(t){const e=di(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 o=ui(n,e);return{value:e,frame:o?Js(o,t.device):null,newTab:o}}function Pd(t){const e=le.c(94),{tests:s,load:n,onOpen:o,options:c,onChange:u,available:i}=t,a=Se();let l;e[0]!==c?(l=ca(c),e[0]=c,e[1]=l):l=e[1];const g=l;let f;e[2]!==c.tests?(f=c.tests??{},e[2]=c.tests,e[3]=f):f=e[3];const p=f;let m;e[4]!==u||e[5]!==c?(m=M=>{const X=M?vl(M):null,{at:se,...ae}=c;u(X?{...ae,at:X}:ae)},e[4]=u,e[5]=c,e[6]=m):m=e[6];const v=m;let y;e[7]!==p||e[8]!==u||e[9]!==c?(y=(M,X)=>{const se={...p};X==="on"?se[M]=!0:X==="off"?se[M]=!1:delete se[M];const{tests:ae,...me}=c;u(Object.keys(se).length>0?{...me,tests:se}:me)},e[7]=p,e[8]=u,e[9]=c,e[10]=y):y=e[10];const h=y;let x;e[11]!==o?(x=M=>{M&&o?.()},e[11]=o,e[12]=x):x=e[12];let C;e[13]!==a?(C=a("sandbox.previewAs.label"),e[13]=a,e[14]=C):C=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(pl,{size:16}),e[15]=b):b=e[15];let w;e[16]!==g||e[17]!==C?(w=r.jsx(nt,{asChild:!0,children:r.jsx(sa,{asChild:!0,children:r.jsx(st,{"aria-label":C,active:g,"data-testid":"preview-as-trigger",children:b})})}),e[16]=g,e[17]=C,e[18]=w):w=e[18];let N;e[19]!==a?(N=a("sandbox.previewAs.label"),e[19]=a,e[20]=N):N=e[20];let k;e[21]!==N?(k=r.jsx(rt,{children:N}),e[21]=N,e[22]=k):k=e[22];let S;e[23]!==k||e[24]!==w?(S=r.jsxs(at,{children:[w,k]}),e[23]=k,e[24]=w,e[25]=S):S=e[25];let E;e[26]!==a?(E=a("sandbox.previewAs.label"),e[26]=a,e[27]=E):E=e[27];let T;e[28]!==E?(T=r.jsx("h3",{className:"text-sm font-medium",children:E}),e[28]=E,e[29]=T):T=e[29];let B;e[30]!==i||e[31]!==a?(B=a(i?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[30]=i,e[31]=a,e[32]=B):B=e[32];let A;e[33]!==B?(A=r.jsx("p",{className:"text-xs text-muted-foreground",children:B}),e[33]=B,e[34]=A):A=e[34];let L;e[35]!==T||e[36]!==A?(L=r.jsxs("div",{className:"flex flex-col gap-1",children:[T,A]}),e[35]=T,e[36]=A,e[37]=L):L=e[37];let $;e[38]!==a?($=a("sandbox.previewAs.momentLabel"),e[38]=a,e[39]=$):$=e[39];let _;e[40]!==$?(_=r.jsx(ml,{htmlFor:"preview-as-moment",children:$}),e[40]=$,e[41]=_):_=e[41];let F;e[42]!==c.at?(F=gl(c.at),e[42]=c.at,e[43]=F):F=e[43];let I;e[44]!==v?(I=M=>v(M.target.value),e[44]=v,e[45]=I):I=e[45];let J;e[46]!==F||e[47]!==I?(J=r.jsx(Hs,{id:"preview-as-moment",type:"datetime-local",className:xl,value:F,onChange:I}),e[46]=F,e[47]=I,e[48]=J):J=e[48];const W=c.at===void 0;let Y;e[49]!==v?(Y=()=>v(""),e[49]=v,e[50]=Y):Y=e[50];let G;e[51]!==a?(G=a("sandbox.previewAs.now"),e[51]=a,e[52]=G):G=e[52];let Q;e[53]!==W||e[54]!==Y||e[55]!==G?(Q=r.jsx(_e,{type:"button",variant:"ghost",size:"sm",disabled:W,onClick:Y,children:G}),e[53]=W,e[54]=Y,e[55]=G,e[56]=Q):Q=e[56];let H;e[57]!==J||e[58]!==Q?(H=r.jsxs("div",{className:"flex items-center gap-2",children:[J,Q]}),e[57]=J,e[58]=Q,e[59]=H):H=e[59];let ee;e[60]!==a?(ee=a("sandbox.previewAs.momentHint"),e[60]=a,e[61]=ee):ee=e[61];let q;e[62]!==ee?(q=r.jsx("p",{className:"text-xs text-muted-foreground",children:ee}),e[62]=ee,e[63]=q):q=e[63];let U;e[64]!==_||e[65]!==H||e[66]!==q?(U=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[_,H,q]}),e[64]=_,e[65]=H,e[66]=q,e[67]=U):U=e[67];let z;e[68]!==a?(z=a("sandbox.previewAs.testsLabel"),e[68]=a,e[69]=z):z=e[69];let j;e[70]!==z?(j=r.jsx("span",{className:"text-sm font-medium",children:z}),e[70]=z,e[71]=j):j=e[71];let O;e[72]!==p||e[73]!==n||e[74]!==h||e[75]!==a||e[76]!==s?(O=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:a("sandbox.previewAs.testsLoadFailed")}),r.jsx(_e,{type:"button",variant:"outline",size:"sm",onClick:n.retry,children:a("sandbox.previewAs.tryAgain")})]}):r.jsx("div",{className:"flex justify-center py-2","data-testid":"preview-as-tests-loading",children:r.jsx(it,{className:"size-4 text-muted-foreground"})}):s.length===0?r.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.noTests")}):r.jsxs(r.Fragment,{children:[r.jsx("ul",{className:"flex flex-col gap-1.5",children:s.map(M=>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:M}),r.jsxs(hl,{type:"single",variant:"outline",size:"sm",value:p[M]===void 0?"":p[M]?"on":"off",onValueChange:X=>h(M,X),"aria-label":M,children:[r.jsx(Ar,{value:"off",children:a("sandbox.previewAs.off")}),r.jsx(Ar,{value:"on",children:a("sandbox.previewAs.on")})]})]},M))}),r.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.testsHint")})]}),e[72]=p,e[73]=n,e[74]=h,e[75]=a,e[76]=s,e[77]=O):O=e[77];let D;e[78]!==j||e[79]!==O?(D=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[j,O]}),e[78]=j,e[79]=O,e[80]=D):D=e[80];let K;e[81]!==g||e[82]!==u||e[83]!==a?(K=g&&r.jsx(_e,{type:"button",variant:"outline",size:"sm",onClick:()=>u({}),children:a("sandbox.previewAs.reset")}),e[81]=g,e[82]=u,e[83]=a,e[84]=K):K=e[84];let Z;e[85]!==L||e[86]!==U||e[87]!==D||e[88]!==K?(Z=r.jsxs(na,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[L,U,D,K]}),e[85]=L,e[86]=U,e[87]=D,e[88]=K,e[89]=Z):Z=e[89];let te;return e[90]!==S||e[91]!==Z||e[92]!==x?(te=r.jsxs(ra,{onOpenChange:x,children:[S,Z]}),e[90]=S,e[91]=Z,e[92]=x,e[93]=te):te=e[93],te}const jd=["next"],Ed=["@tanstack/react-router","@tanstack/react-start","@tanstack/solid-router","@tanstack/solid-start"],Oa=new Set(["tsx","ts","jsx","js","mdx"]),Nd=new Set(["tsx","jsx"]),Cd=new Set(["404","500"]);function Td(t){const e=new Set;if(!t||typeof t!="object")return e;const s=t;for(const n of["dependencies","devDependencies"]){const o=s[n];if(o&&typeof o=="object"&&!Array.isArray(o))for(const c of Object.keys(o))e.add(c)}return e}function Rd(t){const e=Td(t);return jd.some(s=>e.has(s))?"next":Ed.some(s=>e.has(s))?"tanstack":null}function _a(t,e){const s=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return s?`${s}/${e}`:e}function Ld(t,e){const s=n=>_a(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 vn(t){const e=t.lastIndexOf(".");return e<=0?null:[t.slice(0,e),t.slice(e+1)]}function Ad(t){const e=vn(t.at(-1)??"");if(!e||!Oa.has(e[1]))return null;const[s]=e;if(s.includes("."))return null;const n=[...t.slice(0,-1),s];return n[0]==="api"||n.length===1&&Cd.has(s)||n.some(o=>o.startsWith("_")||o.includes("["))?null:(n.at(-1)==="index"&&n.pop(),`/${n.join("/")}`)}function Od(t){const e=vn(t.at(-1)??"");if(!e||e[0]!=="page"||!Oa.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 _d(t){const e=[];let s="",n=!1;for(const o of t)o==="["?n=!0:o==="]"&&(n=!1),o==="."&&!n?(e.push(s),s=""):s+=o;return e.push(s),e}function $d(t){const e=vn(t.at(-1)??"");if(!e||!Nd.has(e[1]))return null;const s=[...t.slice(0,-1),..._d(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 o=[];for(const c of s){if(c.includes("$"))return null;if(c.startsWith("_")||c.startsWith("(")&&c.endsWith(")"))continue;const u=c.replace(/_$/,"").replace(/[[\]]/g,"");u&&o.push(u)}return`/${o.join("/")}`}function Fd(t,e){const s=e.split("/").filter(Boolean);if(s.length===0)return null;switch(t){case"next-pages":return Ad(s);case"next-app":return Od(s);case"tanstack":return $d(s);default:{const n=t;throw new Error(`Unknown router: ${String(n)}`)}}}function Dd(t){const e=new Set;for(const{root:s,files:n}of t){const o=`${s.dir}/`;for(const c of n){if(!c.startsWith(o))continue;const u=Fd(s.router,c.slice(o.length));u&&e.add(u)}}return[...e].sort((s,n)=>s==="/"?-1:n==="/"?1:s.localeCompare(n))}const Bd=5e3,Md=6e4;async function zd(t,e){const s=await fetch(bl(t,"glob"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pattern:e.pattern,path:e.dir,limit:Bd})});if(!s.ok)throw new Error(`Failed to list ${e.dir}: ${s.status}`);const n=await s.json();return Array.isArray(n.files)?n.files.filter(o=>typeof o=="string"):[]}async function Id(t,e){const s=await fi(t,_a(e,"package.json"));if(s.kind==="unavailable")throw new Error("package.json unavailable: sandbox not ready");const n=s.kind==="data"?Rd(s.data):null;if(!n)return[];const o=Ld(n,e),c=await Promise.all(o.map(async u=>({root:u,files:await zd(t,u)})));return Dd(c)}function Ud(t,e,s){const n=le.c(12);let o;n[0]!==e||n[1]!==t?(o=t?tn.frameworkRoutes(t.orgSlug,t.virtualMcpId,t.branch,t.threadId,e):["framework-routes","none"],n[0]=e,n[1]=t,n[2]=o):o=n[2];let c;n[3]!==e||n[4]!==t?(c=()=>t?Id(t,e):[],n[3]=e,n[4]=t,n[5]=c):c=n[5];const u=s&&!!t;let i;n[6]!==o||n[7]!==c||n[8]!==u?(i={queryKey:o,queryFn:c,enabled:u,staleTime:Md},n[6]=o,n[7]=c,n[8]=u,n[9]=i):i=n[9];const a=Jr(i);let l;return n[10]!==a.data?(l=a.data??[],n[10]=a.data,n[11]=l):l=n[11],l}const Kd=500,Hd={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},Wr=1,fs=["desktop","mobile","tablet"],Vd=["preview","visual","blocks"],Wd={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function qd(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 Ut(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Ks(t,e){try{return new URL(t,e).href}catch{return null}}function Gd(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 Jd(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Yd(t,e,s){const n=t.toLowerCase(),o=e.toLowerCase(),c=o.split("/").filter(Boolean),u=a=>{if(a===s)return 100;const l=a.indexOf(s);if(l===-1)return 0;let g=40;return l===0?g+=30:/[\s/-]/.test(a[l-1]??"")&&(g+=20),g+=Math.round(s.length/a.length*20),g};let i=Math.max(u(n),u(o));return c.at(-1)===s?i=Math.max(i,95):c.includes(s)&&(i=Math.max(i,90)),i}function Qd(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Xd({virtualMcpId:t}){const e=Se(),s=fa(),{currentBranch:n,taskId:o,virtualMcpId:c}=lt(),u=!!$o(),i=va(),a=Go(c===t?t:null),l=aa(t),g=yl(a?.metadata?.ui?.layout??null),f=ka(g),p=Aa({contentEditingEnabled:f,isMobile:s}),[m]=R.useState(()=>wd({cmsMode:g,isMobile:s})),[v,y]=Vs(Ws.previewEditingMode(t),d=>d&&Vd.includes(d)?d:null),h=v??m,[x,C]=Vs(Ws.previewDeviceSize(t),d=>d&&fs.includes(d)?d:"desktop"),[b,w]=R.useState(null),[N,k]=R.useState(null),S=R.useRef(null),E=R.useRef(null),[T,B]=R.useState(!1),A=R.useRef(null),L=()=>{A.current?.flush(),B(!1)},$=()=>B(d=>(d&&A.current?.flush(),!d)),[_,F]=R.useState({width:0,height:0}),[I,J]=R.useState(!1),[W,Y]=R.useState({}),[G,Q]=R.useState(""),H=R.useRef(null),[ee,q]=R.useState(!1),[U,z]=R.useState(),[j,O]=R.useState(null),[D,K]=R.useState(null),[Z,te]=R.useState(null),[M,X]=R.useState(()=>i.state.target?.kind==="page"?i.state.target.path:"/"),[se,ae]=R.useState(()=>i.state.target?.kind==="page"?i.state.target.key:null),[me,pe]=R.useState({}),[be,ge]=R.useState(!1),ve=R.useRef(null),Pe=()=>{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:de}=gs(),Le=mn(),Ie=bt(),Ue=Ie.vmEntry,Me=Le.lifecycle.phase,{url:yt}=da(t),he=Kt(t,n),{connection:$e}=ua(t),xe=dl(t),Ke=pi({hasServeConnection:!!$e,runtime:l.runtime}),Ae=!tt(he)&&he.kind!=="pending",re=Ve(he)??yt,ue=re??Ie.previewUrl,Ge=!!re||Me==="running",wt=a?.id===t?si(a.metadata):null,Je=!re&&a?.id===t&&l.runtime==="cms",Ht=l.projectDefault==="cms",kt=Ae?mi({sandboxUrl:ue,previewServerUrl:wt,fastPreviewActive:Je}):null,xn=t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n,threadId:o??null,previewUrl:ue}:null,bn=vs(xn,{fetchEnabled:Ge}),xs=ma(xn,{fetchEnabled:Ge}),ce=bn.data,we=xs.data,Ye=ce?$i(ce,we).sort((d,P)=>d.name.localeCompare(P.name)):[],Vt=t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n}:null,yn=ld(Vt),$a=hi(Vt),bs=ce&&we?Fi(ce,we):[],wn=Ae&&ce&&we?Ji(we,ce,"loaders"):[],Fa=G?(()=>{const d=G.toLowerCase();return Ye.map(P=>({page:P,score:Yd(P.name,P.path,d)})).filter(({score:P})=>P>0).sort((P,V)=>V.score-P.score||P.page.path.length-V.page.path.length).map(({page:P})=>P)})():Ye,Da=bs.filter(d=>{if(!G)return!0;const P=G.toLowerCase();return d.name.toLowerCase().includes(P)||d.key.toLowerCase().includes(P)||d.resolveType.toLowerCase().includes(P)}),kn=p?wn:[],Sn=kn.filter(d=>{if(!G)return!0;const P=G.toLowerCase();return d.title.toLowerCase().includes(P)||d.key.toLowerCase().includes(P)||d.resolveType.toLowerCase().includes(P)}),Wt=D?wn.find(d=>d.key===D)??null:null,Ne=fn,ys=j||D?null:Di(Ye,M,se),ie=ys?.key??null,ct=i.state.target?.kind==="section"?i.state.target.key:i.state.focusedBlockKey??ie,qt=ys?.path??null,ws={};if(Ae&&Ge&&ue&&we&&ce){const d=Yi(we,"loaders"),P=ie?ce[ie]:void 0,V=Sc(P,ce,Ee=>d.has(Ee)),oe=xc(V);for(const Ee of xt(M)){if(Ee.type!=="param")continue;const Ce=hc(M,Ee.name,V),mt=wc(Ce,d,oe);mt.length>0&&(ws[Ee.name]=mt)}}const Pn=d=>ce?Xc(ce,d,we):[],ks=ie?Pn(M):[],Qe=(ie?me[ie]:void 0)??ks[0]?.values??{},Te=Be(M,Qe),St=t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n,threadId:o??null}:null,jn=ce&&ie?Xi(ce,ie,0):[],En=tt(he),Nn=ce?Qi(jn,ce,En):[],Pt=Nn.map(d=>d.isSavedBlock?d.label:""),jt=Nn.map(d=>d.isSavedBlock?"global":d.isMultivariate?"variant":"normal"),Et=jn.map(d=>Ys(d,ce??{},En)),dt=R.useRef(null),Fe=R.useRef(null),Ba=Le.status.state==="paused",Ss=Le.phase,Cn=rl({claimPhase:Ss,lifecycle:Le.lifecycle}),Xe=Ie.previewState,Ma=Ie.userStopped,za=gi(de.slug,t??""),{url:He}=Ki(Je&&t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n,previewServerUrl:wt??null,path:Te}:null),Ia=Ht&&l.runtime==="sandbox",Oe=vi(he,Ke,xe),Tn=xi(Oe&&Je&&he.kind==="protocol"&&t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n}:null),Rn=Oe?Tn.pointer:null,ne=Jl({previewState:Xe,progressStatus:Cn.status,previewServerUrl:wt,fastPreviewActive:Je,fastPreviewReady:!!He,codingSession:Ia,localPreviewUrl:re,hostedDraft:Oe,hostedPointerPending:Oe&&(he.kind==="pending"||Tn.pending)}),Ln=ne.showWakingPill||Oe&&ne.mode==="production"&&!Rn,Nt=ne.mode!=="none",Ua=ne.mode==="production"&&ne.iframeBase?Ut(ne.iframeBase):null,ut=ne.mode==="production"?Ua:Ut(ue),Ka=a?.id===t&&a.metadata?.fastPreviewInPlace===!0,Ct=Ae?re?ne.mode==="sandbox"&&p&&h==="blocks":ne.mode==="production"&&Je&&Ka&&p&&h==="blocks":!1,An=R.useRef(null),{pin:Ha,effective:Va}=Gd(An.current,{inPlaceRenderActive:Ct,draftPreviewUrl:He,resolvedPath:Te});An.current=Ha;const On=i.state.variantOverride??[],Gt=Ae?On:[],Tt=Ae?[]:On,Jt=tt(he)&&Bi.some(d=>Mi(we,d)==="available"),ft=Jt?W:{},_n=ca(ft),Wa=Jt&&ce?Object.keys(zi(ce).experiments):[],[$n,qa]=R.useState(!1),Fn=la(Vt,Jt&&$n?Ii:[]),Ga={...Fn,ready:!(he.kind==="protocol"&&he.hosted)||$n&&Fn.ready},Ze=t?br(de.slug,t):null,Ja=bi(Ze),Yt=Oe?Sd({display:ne,path:Te,pointer:Rn,heldRevision:Ja,device:x,forcedVariants:Tt,previewOptions:ft}):null,Dn=JSON.stringify([Tt,ft]);R.useEffect(()=>{if(!Oe||!Ze)return;const[d,P]=JSON.parse(Dn);yr(Ze,{forcedVariants:d,previewOptions:P})},[Oe,Ze,Dn]),R.useEffect(()=>{if(!(!Oe||!Ze))return()=>yr(Ze,null)},[Oe,Ze]);const Ps=$e&&Ve(he)?yi($e.endpoint,Tt,_n):null,Ya=$e&&Ve(he)?Ps?wi(Ps,ft):wr:null,et=qd(ne.mode==="sandbox"?os(Js(kr(Z??Ks(Te,ne.iframeBase)??ne.iframeBase,Ya),x),Gt):ne.mode==="production"&&Yt?.frame?Yt.frame:ne.mode==="production"?os(Js(Sr(Pr(kr(Z??Va??Ks(Te,ne.iframeBase)??ne.iframeBase,Ln?wr:null),Tt),ft),x),Gt):null),Bn=He??(ne.iframeBase?Ks(Te,ne.iframeBase):null),Mn=ne.mode==="production"&&Yt?Yt.newTab:ne.mode==="production"?Bn?os(Sr(Pr(Bn,Tt),ft),Gt):null:et??ne.iframeBase,Qa=()=>{const d=Mn;d&&window.open(d,"_blank","noopener")},Rt=t&&n?Xr(de.slug,t,n):null,Lt=d=>{Rt&&Do(Rt,d)},ke=i.state.target;R.useEffect(()=>{if(!(!ke||!kt||!we))if(ke.kind==="page"){const d=me[ke.key]??{};Fe.current=Be(ke.path,d),O(null),K(null),te(null),ae(ke.key),X(ke.path),Lt({path:ke.path,pageKey:ke.key,params:d})}else if(ke.kind==="loader")Fe.current=null,O(null),K(ke.key),te(null);else{const d=bs.find(P=>P.key===ke.key);if(d){Fe.current=null;const P=Nr(we);K(null),O(d),te(jr(kt,P,d.key))}}},[ke,kt,we,me]),R.useEffect(()=>{!ie||qt===null||ke?.kind==="page"&&ke.key===ie&&ke.path===qt||i.selectTarget({kind:"page",key:ie,path:qt})},[ie,qt,ke]);const[zn,Xa]=R.useState(null);if(Xe.kind==="iframe"&&zn!==Xe.previewUrl){const d=zn!==null;Xa(Xe.previewUrl);const P=Rt?Qr(Rt):null;if(P){if(Fe.current=Be(P.path,P.params),X(P.path),ae(P.pageKey),te(null),O(null),K(null),P.pageKey&&Object.keys(P.params).length>0){const V=P.pageKey;pe(oe=>({...oe,[V]:P.params}))}}else d&&(Fe.current=null,X("/"),te(null),ae(null),O(null),K(null))}dt.current=et;const Za=ne.mode==="production"&&!!He&&!re,[Qt,js]=R.useState({src:et??void 0,loading:!1}),[eo,Es]=R.useState(!1),[to,so]=R.useState(),[In,Un]=R.useState(null),je=Qo(In,{base:ne.iframeBase??"",frameSrc:Qt.src,loadedSrc:to,wanted:et??void 0,canSwap:xe&&eo&&!Qt.loading});je!==In&&Un(je);const Xt=Xo(Qt,je?je.src:et??void 0,Za);Xt!==Qt&&js(Xt);const pt=Xt.src,Kn=Xt.loading,Hn=Zo({iframeRef:S,src:ne.mode==="sandbox"?et:null,active:ne.mode==="sandbox"}),Vn=R.useRef(null);R.useEffect(()=>{const d=Kn?setTimeout(()=>js(xr),ei):null,P=()=>{d&&clearTimeout(d)};if(!He||!pt||Vn.current===He)return P;Vn.current=He;const V=S.current;return V&&V.getAttribute("src")!==pt&&(Pe(),V.src=pt),P},[He,pt,Kn]);const Wn=()=>{const d=S.current?.contentWindow,P=ut;if(!d||!P||!ce||!ie)return;const V=ce[ie];if(!V||typeof V!="object")return;const oe=ji({previewBaseUrl:P,pageBlock:V,decofile:ce,path:Te,pathTemplate:M});if(!oe)return;const Ee=os(oe.src,Ni(Gt,ie));d.postMessage({type:"cms-editor::render",src:Ee,body:oe.body},P)},Ns=R.useRef(null);R.useEffect(()=>{if(!Ct||j||D||!ie||!ce){Ns.current=null;return}const d={nav:JSON.stringify({page:ie,path:Te,pathTemplate:M}),content:JSON.stringify(ce)},P=Jd(Ns.current,d);Ns.current=d,P&&Wn()},[ce,Ct,j,D,ie,Te,M]);const Cs=R.useRef(null);R.useEffect(()=>{if(!Ct||j||D||!ie||!ce){Cs.current=null;return}const d=JSON.stringify(i.state.variantOverride??null),P=Cs.current;Cs.current={page:ie,sig:d},!(!P||P.page!==ie||P.sig===d)&&Wn()},[i.state.variantOverride,Ct,j,D,ie]);const qn=!!t&&!!n&&!Le.notFound&&!Ma&&!Ba&&(Ss?.kind==="ready"||Me!=="idle"),Gn=!tt(he),no=un(t??void 0),ro=Ud(St,no,Gn&&qn),ao=new Set(f?Ye.map(d=>Ne(d.path)):[]),At=Gn?ro.filter(d=>!ao.has(Ne(d))):[],Jn=G?At.filter(d=>d.toLowerCase().includes(G.toLowerCase())):At,ye=kd({editingMode:h,sandboxDisplay:ne.mode==="sandbox",blocksEditingEnabled:p});R.useEffect(()=>{const d=ut;if(!d)return;const P=V=>{if(V.origin===d)if(V.data?.type==="visual-editor::element-clicked"){const oe=Zl.safeParse(V.data.payload);oe.success&&w(oe.data)}else if(V.data?.type==="cms-editor::section-clicked"){const oe=sc.safeParse(V.data.payload);oe.success&&k({index:oe.data.sectionIndex,seq:oe.data.clickSeq})}else V.data?.type==="cms-editor::render-start"?Pe():V.data?.type==="cms-editor::render-end"?(fe(),S.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:Pt,kinds:jt,keys:Et},d)):V.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",P),()=>window.removeEventListener("message",P)},[ut,Pt,jt,Et]);const Yn=()=>{const d=S.current?.contentWindow,P=Ut(ue),V=ad({v8:xe,script:ec});!d||!P||!V||d.postMessage(V,P)},oo=()=>{if(xe)return;const d=S.current?.contentWindow,P=Ut(ue);!d||!P||d.postMessage({type:"visual-editor::deactivate"},P)},Qn=()=>{const d=ze.current;d?.has("wireframe")&&(d.wireframe({type:"wireframe:sections",labels:Pt,kinds:jt,keys:Et}),d.wireframe({type:ye==="blocks"?"wireframe:activate":"wireframe:deactivate"}))},Ts=()=>{if(xe){Qn();return}const d=S.current?.contentWindow,P=ut,V=rd({v8:xe,production:ne.mode==="production",localPreview:!!re,script:nc});!d||!P||!V||(d.postMessage(V,P),d.postMessage({type:"cms-editor::set-labels",labels:Pt,kinds:jt,keys:Et},P))},io=()=>{if(xe){ze.current?.wireframe({type:"wireframe:deactivate"});return}const d=S.current?.contentWindow,P=ut;!d||!P||d.postMessage({type:"cms-editor::deactivate"},P)},Xn=d=>{ze.current?.wireframe({type:"wireframe:scroll-to",sectionIndex:d})},lo=()=>{if(ze.current?.wireframe({type:"wireframe:clear-hover"}),xe)return;const d=S.current?.contentWindow,P=ut;!d||!P||(d.postMessage({type:"cms-editor::clear-hover"},P),d.postMessage({type:"visual-editor::clear-hover"},P))},Zt=d=>{if(d==="blocks"&&!p)return;const P=h;!s&&d!==P&&(d==="blocks"?E.current?.resize("30%"):E.current?.collapse()),y(d),w(null),k(null),d!=="blocks"&&K(null),P==="visual"&&oo(),d==="visual"&&Yn(),P==="blocks"&&d!=="blocks"&&io(),d==="blocks"&&Ts()},co=()=>{Zt(bd(h,p))},uo=()=>{Zt(yd(h,p))},es=()=>{const d=S.current;if(!d)return;Pe();const P=document.activeElement,V=d.tabIndex;d.tabIndex=-1,d.style.pointerEvents="none",d.blur(),Qd(d,dt.current);let oe;const Ee=()=>{clearTimeout(oe),d.tabIndex=V,d.style.pointerEvents="";const Ce=document.activeElement;(!Ce||Ce===document.body||Ce===d)&&P?.focus(),d.removeEventListener("load",Ee)};d.addEventListener("load",Ee),oe=setTimeout(Ee,3e3)};el(es);const ze=R.useRef(null),Zn=R.useEffectEvent(Qn),fo=R.useEffectEvent((d,P)=>{k({index:d,seq:P})}),po=R.useEffectEvent(()=>{fe(),je&&(Rs.current=je.shown),_t&&$s(Ot)}),er=R.useEffectEvent(()=>{if(Es(!1),je&&Un(null),je&&je.src!==dt.current){Pe();return}es()});R.useEffect(()=>{if(!xe)return;const d=new lc({studioOrigin:window.location.origin,build:"4.597.0",frame:()=>S.current?.contentWindow??null,onWireframeReady:()=>Zn(),onWireframe:V=>{V.type==="wireframe:select"&&fo(V.sectionIndex,V.clickSeq)},onModulesChange:()=>Es(d.has("html-swap")),onSwapEnd:()=>po(),onSwapFailed:()=>er()});ze.current=d;const P=V=>{d.handle(V)};return window.addEventListener("message",P),()=>{window.removeEventListener("message",P),d.dispose(),Es(!1),ze.current===d&&(ze.current=null)}},[xe,ne.iframeBase]);const tr=xe?JSON.stringify([Pt,jt,Et,ye]):"";R.useEffect(()=>{tr&&Zn()},[tr]);const sr=R.useRef(null);R.useEffect(()=>{const d=sr.current;if(sr.current=je,je&&je!==d){ze.current?.refresh(je.shown)?Pe():er();return}!je&&d&&d.shown!==d.src&&d.src===dt.current&&es()},[je]);const nr=()=>{ze.current?.refresh()||es()},Ot=br(de.slug,t??""),_t=Oe&&Nt&&!!t,Rs=R.useRef(null);R.useEffect(()=>{if(_t)return ki(Ot)},[_t,Ot]);const{reload:$t}=Si(de.slug,t??""),rr=R.useRef($t.seq);R.useEffect(()=>{if(rr.current!==$t.seq&&(rr.current=$t.seq,!!_t&&Rs.current===dt.current)){if($t.navigates){$s(Ot);return}nr()}},[$t.seq]);const Ls=oa(Vt),Ft=Pi(Ve(he)?Ls:""),ar=R.useRef(Ft);R.useEffect(()=>{const d=ar.current;if(ar.current=Ft,!d||!Ft||d===Ft)return;const P=S.current;if(P)return Xl({iframe:P,reload:nr})},[Ft]);const or=()=>{const d=fs.indexOf(x);C(fs[(d+1)%fs.length])},ts=(d,P)=>ir({...Qe,[d]:P}),ir=d=>{if(!ie)return;const P=ie;Fe.current=Be(M,d),pe(V=>({...V,[P]:d})),Lt({path:M,pageKey:P,params:d})},mo=td({iframeBase:ne.iframeBase,resolvedPath:Te,activeGlobalSectionName:j?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),As=d=>{const P=me[d.key]??{},V=Be(d.path,me[d.key]??Pn(d.path)[0]?.values??{});(j||Ne(V)!==Ne(Te))&&Pe(),Fe.current=V,O(null),K(null),te(null),k(null),ae(d.key),X(d.path),Lt({path:d.path,pageKey:d.key,params:P}),i.selectTarget({kind:"page",key:d.key,path:d.path})},lr=d=>{(j||Ne(d)!==Ne(Te))&&Pe(),Fe.current=d,O(null),K(null),te(null),k(null),ae(null),X(d),Lt({path:d,pageKey:null,params:{}})};Fo(Rt,lr);const ho=d=>{if(tt(he)){const oe=ce?Ui(ce,d.key,we):null;oe?As(oe):ms.info(e("sandbox.preview.blockOnNoPage"));return}if(!kt||!we){ms.error(e("sandbox.preview.previewMetadataNotReady"));return}Pe(),Fe.current=null;const P=Nr(we),V=jr(kt,P,d.key);O(d),K(null),te(V),k(null),i.selectTarget({kind:"section",key:d.key})},go=d=>{p&&(O(null),K(d.key),te(null),Zt("blocks"),i.selectTarget({kind:"loader",key:d.key}))},vo=async({name:d,path:P,templateKey:V})=>{if(!t||!n)return;const oe=pa(P);if(oe){z(oe);return}const Ee=P.trim().startsWith("/")?P.trim():`/${P.trim()}`;if(Ye.some(Ce=>Ne(Ce.path)===Ne(Ee))){z(e("sandbox.preview.pageAlreadyExists",{path:Ee}));return}z(void 0);try{const Ce=V?await $a(ce,V):void 0;if(V&&!Ce){z(e("sandbox.preview.templateNoLongerExists"));return}const mt=await yn.mutateAsync({name:d,path:Ee,template:Ce,schema:tt(he)?{meta:we,loadMeta:async()=>(await xs.refetch()).data}:void 0});q(!1),ms.success(e("sandbox.preview.pageCreated",{name:d})),await kl(Kd),As({key:mt.key,name:mt.name,path:mt.path}),Zt("blocks")}catch(Ce){z(Ce instanceof La?e("sandbox.preview.pageSchemaNotReady"):Ce instanceof Error?Ce.message:e("sandbox.preview.failedToCreatePage"))}},Dt=sd({previewSurfaceActive:Nt,daemonReady:qn,production:ne.mode==="production",servePreviewUrl:Ve(he)}),cr=nd({showPreviewToolbar:Dt,contentEditingEnabled:f,hasFrameworkRoutes:At.length>0}),dr=f?Fa:[],ur=f?Da:[],Bt=()=>{J(!1),Q("")},Os=f?j?.name??Wt?.title??ys?.name:void 0,_s=f&&(bn.isPending||xs.isPending),ss=_s?Ut(ne.iframeBase):Os,Mt=j?`section:${j.key}`:D?`loader:${D}`:f&&ie?`page:${ie}`:At.includes(Ne(M))?`route:${Ne(M)}`:void 0,ns=e(Wd[x]),fr=x==="mobile"?r.jsx(Zr,{size:16}):x==="tablet"?r.jsx(Ho,{size:16}):r.jsx(ea,{size:16}),xo=Dt?cr?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(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx("button",{type:"button",onClick:or,"aria-label":ns,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",Er),children:fr})}),r.jsx(rt,{children:ns})]}),r.jsxs(ra,{open:I,onOpenChange:d=>{J(d),d||Q("")},children:[r.jsx(sa,{asChild:!0,children:r.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:_s?ss??void 0:j||Wt?Os:[Os,M].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",Er),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:[j&&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(Uo,{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(Vo,{size:11}),e("sandbox.preview.loaderBadge")]}),ss&&r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ss}),!_s&&!j&&!Wt&&r.jsx("span",{"data-testid":"preview-page-path",className:Re("min-w-0 truncate font-mono [direction:rtl]",ss?"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:M})}),r.jsx(Bo,{size:12,className:Re("shrink-0 transition-transform",I&&"rotate-180")})]})})}),r.jsxs(na,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[r.jsxs(ln,{shouldFilter:!1,defaultValue:Mt,children:[r.jsx(cn,{value:G,onValueChange:d=>{Q(d),H.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),r.jsxs(on,{ref:H,className:"max-h-80",children:[r.jsx(dn,{children:(!f||Ye.length===0)&&At.length===0&&(!f||bs.length===0)&&kn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),dr.length>0&&r.jsx(We,{children:dr.map(d=>r.jsxs(qe,{value:`page:${d.key}`,"aria-current":Mt===`page:${d.key}`||void 0,title:`${d.name} · ${d.path}`,onSelect:()=>{Bt(),As(d)},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:d.name}),r.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:d.path})]},d.key))}),Jn.length>0&&r.jsx(We,{heading:e("sandbox.preview.siteRoutes"),children:Jn.map(d=>r.jsx(qe,{value:`route:${d}`,"aria-current":Mt===`route:${d}`||void 0,title:d,onSelect:()=>{Bt(),lr(d)},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:d})},d))}),ur.length>0&&r.jsx(We,{heading:e("sandbox.preview.globalComponents"),children:ur.map(d=>r.jsx(qe,{value:`section:${d.key}`,"aria-current":Mt===`section:${d.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Bt(),ho(d)},children:r.jsx("span",{className:"truncate",children:d.name})},d.key))}),Sn.length>0&&r.jsx(We,{heading:e("sandbox.preview.globalLoaders"),children:Sn.map(d=>r.jsx(qe,{value:`loader:${d.key}`,"aria-current":Mt===`loader:${d.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Bt(),go(d)},children:r.jsx("span",{className:"truncate",children:d.title})},d.key))})]})]}),f&&!j&&!D&&xt(M).some(d=>d.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:xt(M).map((d,P)=>{if(d.type==="text")return r.jsx("span",{children:d.text},`text-${P}`);const V=ws[d.name];return!V&&ks.length>0?r.jsx(Zc,{paramName:d.name,template:M,value:Qe[d.name]??"",options:ks,onPick:ir,onCommit:oe=>ts(d.name,oe)},`${ie}:${d.name}`):V&&St?r.jsx(Bc,{sources:V,template:M,paramName:d.name,value:Qe[d.name]??"",sandboxRef:St,onCommit:oe=>ts(d.name,oe)},`${ie}:${d.name}`):r.jsx(Jc,{name:d.name,value:Qe[d.name]??"",onCommit:oe=>ts(d.name,oe)},`${ie}:${d.name}`)})}),f&&r.jsx("div",{className:"border-t p-1.5",children:r.jsxs(_e,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Bt(),z(void 0),q(!0)},children:[r.jsx(ta,{size:16}),e("sandbox.preview.createNewPage")]})})]})]})]}):r.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:mo}):null,pr=Dt||f?r.jsxs("div",{className:"flex min-w-0 max-w-[24rem] flex-1 items-center justify-center gap-1",children:[!(Dt&&cr)&&r.jsxs(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(st,{onClick:or,"aria-label":ns,children:fr})}),r.jsx(rt,{children:ns})]}),xo,r.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[Jt&&r.jsx(Pd,{tests:Wa,load:Ga,onOpen:()=>qa(!0),options:W,onChange:d=>{Y(d),i.previewAsChanged()},available:!!Ps||!Ln||!_n}),r.jsx(st,{onClick:Qa,disabled:Oe&&!Mn,"aria-label":e("sandbox.preview.openInNewTab"),children:r.jsx(Yr,{size:16})})]})]}):null,bo=(Ae||u)&&ne.mode==="sandbox",rs=Hd[x],as=x==="desktop"&&(_.width===0||_.width>=rs.width+2*Wr),mr=as?1:Math.min(_.width>0?_.width/(rs.width+2*Wr):1,1),yo=as?{width:"100%",height:"100%"}:{width:`${rs.width}px`,height:_.height>0?`${_.height/mr}px`:`${rs.height}px`,transform:`scale(${mr})`,transformOrigin:"top center"},hr=r.jsxs(r.Fragment,{children:[bo&&(Dt||f)&&r.jsx(st,{onClick:co,"aria-pressed":ye==="visual","aria-label":e("sandbox.preview.visualEditor"),active:ye==="visual",children:r.jsx(vr,{size:16})}),p&&r.jsxs(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(st,{onClick:uo,"aria-pressed":ye==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:ye==="blocks",children:r.jsx(Wo,{size:16})})}),r.jsx(rt,{children:e("sandbox.preview.blocksEditor")})]}),ct&&r.jsxs(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(st,{onClick:$,"aria-pressed":T,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:T,children:r.jsx(Ko,{size:16})})}),r.jsx(rt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),wo=!!D&&ye==="blocks";return r.jsxs("div",{className:"flex flex-col w-full h-full",children:[St&&Object.entries(ws).map(([d,P])=>(Qe[d]??"")===""?r.jsx(qc,{sources:P,template:M,paramName:d,sandboxRef:St,onFill:V=>ts(d,V)},`${ie}:${d}`):null),r.jsxs(r.Fragment,{children:[r.jsx(qs.Toolbar.Center.Portal,{fallback:r.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:pr}),children:pr}),r.jsx(qs.Toolbar.Right.Portal,{fallback:hr,children:hr})]}),r.jsx("div",{className:"flex-1 overflow-hidden relative",children:wo?r.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[r.jsx(Hr,{virtualMcpId:t,externalSelection:N,onSectionPicked:Xn,onViewJsonFile:$}),T&&ct&&r.jsx("div",{className:"absolute inset-0 z-10",children:r.jsx(Vr,{ref:A,virtualMcpId:t,pageKey:ct,onClose:L},he.kind==="legacy"?void 0:JSON.stringify([Ls,xe]))})]}):r.jsxs(Tr,{orientation:"horizontal",disabled:ye!=="blocks",className:"relative isolate",children:[r.jsx(is,{ref:E,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(Hr,{virtualMcpId:t,externalSelection:N,onSectionPicked:Xn,onViewJsonFile:$})}),ye==="blocks"&&r.jsx(Rr,{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(Tr,{orientation:"horizontal",disabled:!(T&&ct),children:[r.jsx(is,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:r.jsxs("div",{ref:d=>{if(!d)return;const P=()=>F(oe=>oe.width===d.clientWidth&&oe.height===d.clientHeight?oe:{width:d.clientWidth,height:d.clientHeight});P();const V=new ResizeObserver(P);return V.observe(d),()=>V.disconnect()},className:Re("h-full relative overflow-clip flex justify-center",Nt&&!as&&"bg-muted/30"),children:[(be||za)&&Nt&&r.jsx(ti,{}),ne.showDecidingLoader&&r.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}),ne.showBlockingOverlay&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ds,{kind:"starting",progress:Cn,claimPhase:Ss})}),!re&&Xe.kind==="suspended"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ds,{kind:"suspended",onResume:Ie.resume})}),!re&&Xe.kind==="errored"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ds,{kind:"errored",error:Xe.error,onRetry:Ie.retry,connectionsHref:`/${de.slug}/settings/connections`})}),ne.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(it,{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"&&!b&&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(vr,{size:12}),e("sandbox.preview.clickElementToAsk")]}),ye==="visual"&&b&&r.jsx(fc,{element:b,onDismiss:()=>w(null)}),Nt&&et&&r.jsx("div",{className:Re("shrink-0",!as&&"bg-background shadow-edge"),style:yo,onMouseLeave:lo,children:r.jsx("iframe",{ref:S,src:pt,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Hn.handleError,onLoad:()=>{if(js(xr),so(pt),Hn.handleLoad(),fe(),Rs.current=dt.current,_t&&$s(Ot),ne.mode!=="sandbox"||re){(ne.mode==="production"&&!ne.showWakingPill||re)&&ye==="blocks"&&Ts();return}if(Ro("vm_preview_loaded",{view_mode:ye,vm_id:Ue?.sandboxHandle??null}),!j)try{const d=S.current?.contentWindow?.location?.pathname;if(!d)return;const P=Fe.current;if(P!==null&&(Fe.current=null,Ne(d)!==Ne(P))||Ne(d)===Ne(Te))return;X(d),Lt({path:d,pageKey:se,params:Qe})}catch{}ye==="visual"&&Yn(),ye==="blocks"&&Ts()}},ne.iframeBase)})]})}),T&&ct&&r.jsxs(r.Fragment,{children:[r.jsx(Rr,{withHandle:!0}),r.jsx(is,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:r.jsx(Vr,{ref:A,virtualMcpId:t,pageKey:ct,onClose:L},he.kind==="legacy"?void 0:JSON.stringify([Ls,xe]))})]})]})})]})}),r.jsx(cd,{open:ee,onOpenChange:q,isPending:yn.isPending,error:U,templates:Ye,onSubmit:vo})]})}const Xs={app:null,split:!1};function Zd(t){const e=le.c(24),{project:s,maxApps:n,children:o}=t,c=Se();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={silent:!0},e[0]=u):u=e[0];const i=Jo(u),a=bt();let l;e[1]!==s.metadata.runtime?(l=s.metadata.runtime??{},e[1]=s.metadata.runtime,e[2]=l):l=e[2];const g=l;let f;e[3]!==g.apps?(f=g.apps??[],e[3]=g.apps,e[4]=f):f=e[4];const p=f;let m;e[5]!==i.update||e[6]!==a||e[7]!==s.id||e[8]!==s.metadata||e[9]!==g||e[10]!==c?(m=b=>i.update.mutate({id:s.id,data:{metadata:{...Sl(s.metadata),runtime:{...g,apps:b.length?b:null}}}},{onSuccess:()=>a.start(),onError:()=>ms.error(c("sandbox.appTabs.saveError"))}),e[5]=i.update,e[6]=a,e[7]=s.id,e[8]=s.metadata,e[9]=g,e[10]=c,e[11]=m):m=e[11];const v=m,y=g.path??null;let h,x;e[12]!==p||e[13]!==v?(h=b=>v([...p,{path:b}]),x=b=>v(p.filter(w=>w.path!==b)),e[12]=p,e[13]=v,e[14]=h,e[15]=x):(h=e[14],x=e[15]);let C;return e[16]!==p||e[17]!==o||e[18]!==n||e[19]!==s.id||e[20]!==y||e[21]!==h||e[22]!==x?(C=r.jsx(eu,{virtualMcpId:s.id,mainPath:y,apps:p,maxApps:n,onAddApp:h,onRemoveApp:x,children:o}),e[16]=p,e[17]=o,e[18]=n,e[19]=s.id,e[20]=y,e[21]=h,e[22]=x,e[23]=C):C=e[23],C}function eu(t){const e=le.c(102),{virtualMcpId:s,mainPath:n,apps:o,maxApps:c,onAddApp:u,onRemoveApp:i,children:a}=t,l=Se(),g=fa(),{currentBranch:f}=lt(),p=bt(),m=mn().lifecycle.phase,v=Kt(s,f),{url:y}=da(s);let h;e[0]!==v||e[1]!==y?(h=Ve(v)??y,e[0]=v,e[1]=y,e[2]=h):h=e[2];const x=h,C=x??p.previewUrl,b=!!x||m==="running",w=!b&&p.status==="errored";let N;e[3]!==p.vmEntry?.startedWith?.apps?(N=p.vmEntry?.startedWith?.apps??[],e[3]=p.vmEntry?.startedWith?.apps,e[4]=N):N=e[4];const k=N;let S;e[5]!==s?(S=Ws.previewAppLayout(s),e[5]=s,e[6]=S):S=e[6];const[E,T]=Vs(S,tu);let B;e[7]!==o||e[8]!==E?(B=o.some(fe=>fe.path===E.app)?E.app:null,e[7]=o,e[8]=E,e[9]=B):B=e[9];const A=B,L=A!==null&&E.split&&!g,$=A===null||L,_=A??o[0]?.path??null,[F,I]=R.useState(null),[J,W]=R.useState(!1);let Y;e[10]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>{I(null),W(!1)},e[10]=Y):Y=e[10];const G=Y;let Q;e[11]!==o||e[12]!==F||e[13]!==g||e[14]!==n||e[15]!==u||e[16]!==T?(Q=()=>{if(F===null)return;const fe=Or(F);if(!fe){G();return}if(fe===Or(n??"")||o.some(de=>de.path===fe)){W(!0);return}u(fe),T({app:fe,split:!g}),G()},e[11]=o,e[12]=F,e[13]=g,e[14]=n,e[15]=u,e[16]=T,e[17]=Q):Q=e[17];const H=Q;let ee;e[18]!==n||e[19]!==l?(ee=n?Bs(n):l("sandbox.appTabs.root"),e[18]=n,e[19]=l,e[20]=ee):ee=e[20];const q=ee;let U;e[21]!==L||e[22]!==l?(U=l(L?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=L,e[22]=l,e[23]=U):U=e[23];const z=U;let j;e[24]!==l?(j=l("sandbox.appTabs.label"),e[24]=l,e[25]=j):j=e[25];let O;e[26]!==l?(O=l("sandbox.appTabs.main"),e[26]=l,e[27]=O):O=e[27];let D;e[28]!==l?(D=l("sandbox.appTabs.mainHint"),e[28]=l,e[29]=D):D=e[29];let K;e[30]!==T?(K=()=>T(Xs),e[30]=T,e[31]=K):K=e[31];let Z;e[32]!==w||e[33]!==q||e[34]!==b||e[35]!==$||e[36]!==O||e[37]!==D||e[38]!==K?(Z=r.jsx(qr,{label:q,badge:O,hint:D,ready:b,failed:w,onScreen:$,onSelect:K}),e[32]=w,e[33]=q,e[34]=b,e[35]=$,e[36]=O,e[37]=D,e[38]=K,e[39]=Z):Z=e[39];let te;if(e[40]!==o||e[41]!==A||e[42]!==w||e[43]!==q||e[44]!==i||e[45]!==b||e[46]!==T||e[47]!==L||e[48]!==l){let fe;e[50]!==A||e[51]!==w||e[52]!==q||e[53]!==i||e[54]!==b||e[55]!==T||e[56]!==L||e[57]!==l?(fe=de=>{const Le=Bs(de.path);return r.jsx(qr,{label:Le,hint:l("sandbox.appTabs.extraHint",{app:q}),ready:b,failed:w,onScreen:de.path===A,onSelect:()=>T({app:de.path,split:L}),onRemove:()=>i(de.path),removeLabel:l("sandbox.appTabs.remove",{app:Le})},de.path)},e[50]=A,e[51]=w,e[52]=q,e[53]=i,e[54]=b,e[55]=T,e[56]=L,e[57]=l,e[58]=fe):fe=e[58],te=o.map(fe),e[40]=o,e[41]=A,e[42]=w,e[43]=q,e[44]=i,e[45]=b,e[46]=T,e[47]=L,e[48]=l,e[49]=te}else te=e[49];let M;e[59]!==Z||e[60]!==te||e[61]!==j?(M=r.jsxs("div",{role:"tablist","aria-label":j,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[Z,te]}),e[59]=Z,e[60]=te,e[61]=j,e[62]=M):M=e[62];let X;e[63]!==o.length||e[64]!==H||e[65]!==F||e[66]!==J||e[67]!==c||e[68]!==l?(X=F!==null?r.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),H()},children:r.jsx("input",{autoFocus:!0,value:F,placeholder:"apps/checkout","aria-label":l("sandbox.appTabs.pathLabel"),"aria-invalid":J,onChange:fe=>{I(fe.target.value),W(!1)},onBlur:G,onKeyDown:fe=>{fe.key==="Escape"&&G()},className:Re("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",J?"border-destructive":"border-border")})}):o.length<c&&r.jsx(vt,{label:l("sandbox.appTabs.add"),onClick:()=>I(""),children:r.jsx(ta,{})}),e[63]=o.length,e[64]=H,e[65]=F,e[66]=J,e[67]=c,e[68]=l,e[69]=X):X=e[69];let se;e[70]!==g||e[71]!==T||e[72]!==L||e[73]!==z||e[74]!==_?(se=!g&&_&&r.jsx(vt,{label:z,active:L,onClick:()=>T(L?Xs:{app:_,split:!0}),children:r.jsx(qo,{})}),e[70]=g,e[71]=T,e[72]=L,e[73]=z,e[74]=_,e[75]=se):se=e[75];let ae;e[76]!==M||e[77]!==X||e[78]!==se?(ae=r.jsxs(r.Fragment,{children:[M,X,se]}),e[76]=M,e[77]=X,e[78]=se,e[79]=ae):ae=e[79];const me=ae;let pe;e[80]!==me?(pe=r.jsx(qs.Topbar.Left.Portal,{fallback:r.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:me}),children:r.jsx("div",{className:"ml-1 flex min-w-0 items-center gap-1 border-l border-border/60 pl-2",children:me})}),e[80]=me,e[81]=pe):pe=e[81];let be;e[82]!==a||e[83]!==$?(be=$&&r.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:a}),e[82]=a,e[83]=$,e[84]=be):be=e[84];let ge;e[85]!==A||e[86]!==w||e[87]!==p.start||e[88]!==x||e[89]!==q||e[90]!==C||e[91]!==b||e[92]!==T||e[93]!==L||e[94]!==k?(ge=A!==null&&r.jsx(su,{name:Bs(A),mainName:q,appUrl:C?Pl(C,A):null,ready:b,failed:w,notStarted:!x&&!k.includes(A),onStart:p.start,className:Re(L&&"border-l border-border"),onClose:L?()=>T({app:A,split:!1}):void 0},A),e[85]=A,e[86]=w,e[87]=p.start,e[88]=x,e[89]=q,e[90]=C,e[91]=b,e[92]=T,e[93]=L,e[94]=k,e[95]=ge):ge=e[95];let ve;e[96]!==be||e[97]!==ge?(ve=r.jsxs("div",{className:"flex min-h-0 flex-1",children:[be,ge]}),e[96]=be,e[97]=ge,e[98]=ve):ve=e[98];let Pe;return e[99]!==pe||e[100]!==ve?(Pe=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]=Pe):Pe=e[101],Pe}function tu(t){return t??Xs}function qr(t){const e=le.c(28),{label:s,badge:n,hint:o,ready:c,failed:u,onScreen:i,onSelect:a,onRemove:l,removeLabel:g}=t,f=i?"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 m=c?"bg-success":u?"bg-destructive":"animate-pulse bg-warning";let v;e[2]!==m?(v=Re("size-1.5 rounded-full",m),e[2]=m,e[3]=v):v=e[3];let y;e[4]!==v?(y=r.jsx("span",{"aria-hidden":!0,className:v}),e[4]=v,e[5]=y):y=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 x;e[8]!==n?(x=n&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:n}),e[8]=n,e[9]=x):x=e[9];let C;e[10]!==i||e[11]!==a||e[12]!==y||e[13]!==h||e[14]!==x?(C=r.jsx(nt,{asChild:!0,children:r.jsxs("button",{type:"button",role:"tab","aria-selected":i,onClick:a,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[y,h,x]})}),e[10]=i,e[11]=a,e[12]=y,e[13]=h,e[14]=x,e[15]=C):C=e[15];let b;e[16]!==o?(b=r.jsx(rt,{className:"max-w-64",children:o}),e[16]=o,e[17]=b):b=e[17];let w;e[18]!==C||e[19]!==b?(w=r.jsxs(at,{children:[C,b]}),e[18]=C,e[19]=b,e[20]=w):w=e[20];let N;e[21]!==l||e[22]!==g?(N=l&&r.jsx("button",{type:"button","aria-label":g,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(Pa,{className:"size-3"})}),e[21]=l,e[22]=g,e[23]=N):N=e[23];let k;return e[24]!==w||e[25]!==N||e[26]!==p?(k=r.jsxs("div",{className:p,children:[w,N]}),e[24]=w,e[25]=N,e[26]=p,e[27]=k):k=e[27],k}function su(t){const e=le.c(71),{name:s,mainName:n,appUrl:o,ready:c,failed:u,notStarted:i,onStart:a,className:l,onClose:g}=t,f=Se(),[p,m]=R.useState("/"),[v,y]=R.useState("desktop"),[h,x]=R.useState(0),C=R.useRef(null);let b;e[0]!==o||e[1]!==p?(b=o?jl(o,p):null,e[0]=o,e[1]=p,e[2]=b):b=e[2];const w=b;let N;e[3]!==l?(N=Re("flex min-h-0 min-w-0 flex-1 flex-col",l),e[3]=l,e[4]=N):N=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=D=>{D.preventDefault(),m(C.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 E;e[9]!==p||e[10]!==S?(E=r.jsx("form",{className:"min-w-0 flex-1",onSubmit:k,children:r.jsx("input",{ref:C,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]=E):E=e[11];let T;e[12]!==v||e[13]!==f?(T=f(v==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=v,e[13]=f,e[14]=T):T=e[14];let B;e[15]===Symbol.for("react.memo_cache_sentinel")?(B=()=>y(ru),e[15]=B):B=e[15];let A;e[16]!==v?(A=v==="desktop"?r.jsx(ea,{}):r.jsx(Zr,{}),e[16]=v,e[17]=A):A=e[17];let L;e[18]!==T||e[19]!==A?(L=r.jsx(vt,{label:T,onClick:B,children:A}),e[18]=T,e[19]=A,e[20]=L):L=e[20];let $;e[21]!==s||e[22]!==f?($=f("sandbox.appPane.reload",{app:s}),e[21]=s,e[22]=f,e[23]=$):$=e[23];const _=!w||!c;let F,I;e[24]===Symbol.for("react.memo_cache_sentinel")?(F=()=>x(nu),I=r.jsx(Lo,{}),e[24]=F,e[25]=I):(F=e[24],I=e[25]);let J;e[26]!==$||e[27]!==_?(J=r.jsx(vt,{label:$,disabled:_,onClick:F,children:I}),e[26]=$,e[27]=_,e[28]=J):J=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 G;e[32]!==w?(G=()=>w&&window.open(w,"_blank","noopener"),e[32]=w,e[33]=G):G=e[33];let Q;e[34]===Symbol.for("react.memo_cache_sentinel")?(Q=r.jsx(Yr,{}),e[34]=Q):Q=e[34];let H;e[35]!==W||e[36]!==Y||e[37]!==G?(H=r.jsx(vt,{label:W,disabled:Y,onClick:G,children:Q}),e[35]=W,e[36]=Y,e[37]=G,e[38]=H):H=e[38];let ee;e[39]!==s||e[40]!==g||e[41]!==f?(ee=g&&r.jsx(vt,{label:f("sandbox.appPane.close",{app:s}),onClick:g,children:r.jsx(Pa,{})}),e[39]=s,e[40]=g,e[41]=f,e[42]=ee):ee=e[42];let q;e[43]!==J||e[44]!==H||e[45]!==ee||e[46]!==E||e[47]!==L?(q=r.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[E,L,J,H,ee]}),e[43]=J,e[44]=H,e[45]=ee,e[46]=E,e[47]=L,e[48]=q):q=e[48];let U;e[49]!==n||e[50]!==f?(U=f("sandbox.appPane.previewOnly",{app:n}),e[49]=n,e[50]=f,e[51]=U):U=e[51];let z;e[52]!==U?(z=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:U}),e[52]=U,e[53]=z):z=e[53];let j;e[54]!==v||e[55]!==u||e[56]!==n||e[57]!==s||e[58]!==i||e[59]!==a||e[60]!==c||e[61]!==h||e[62]!==w||e[63]!==f?(j=r.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:c&&i?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(_e,{size:"sm",variant:"outline",onClick:a,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"):u?f("sandbox.appPane.failed",{app:n}):f("sandbox.appPane.waiting")}):r.jsx("iframe",{src:w,title:s,className:Re("h-full bg-background",v==="mobile"?"w-[412px] max-w-full border-x border-border":"w-full")},`${w}#${h}`)}),e[54]=v,e[55]=u,e[56]=n,e[57]=s,e[58]=i,e[59]=a,e[60]=c,e[61]=h,e[62]=w,e[63]=f,e[64]=j):j=e[64];let O;return e[65]!==s||e[66]!==N||e[67]!==q||e[68]!==z||e[69]!==j?(O=r.jsxs("section",{"aria-label":s,className:N,children:[q,z,j]}),e[65]=s,e[66]=N,e[67]=q,e[68]=z,e[69]=j,e[70]=O):O=e[70],O}function nu(t){return t+1}function ru(t){return t==="desktop"?"mobile":"desktop"}function vt(t){const e=le.c(11),{label:s,children:n,active:o,disabled:c,onClick:u}=t;let i;e[0]!==o||e[1]!==n||e[2]!==c||e[3]!==s||e[4]!==u?(i=r.jsx(nt,{asChild:!0,children:r.jsx(st,{"aria-label":s,"aria-pressed":o,active:o,disabled:c,onClick:u,children:n})}),e[0]=o,e[1]=n,e[2]=c,e[3]=s,e[4]=u,e[5]=i):i=e[5];let a;e[6]!==s?(a=r.jsx(rt,{children:s}),e[6]=s,e[7]=a):a=e[7];let l;return e[8]!==i||e[9]!==a?(l=r.jsxs(at,{children:[i,a]}),e[8]=i,e[9]=a,e[10]=l):l=e[10],l}const au=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},ou=1e4,iu=1e4,lu=5e3,cu=2;function du(t,e){return t&&e===0?iu:Math.min(1e3*2**Math.max(0,e-1),lu)}function uu(t,e,s){return e?!0:t===!0&&s<cu}function fu(t,e){const s=le.c(11),n=au,o=Ao();let c;s[0]!==t?(c=tn.localAppReachable(t??""),s[0]=t,s[1]=c):c=s[1];const u=c;let i;s[2]!==n||s[3]!==o||s[4]!==u||s[5]!==t?(i=async f=>{const{signal:p}=f,m=new AbortController,v=()=>m.abort();p.addEventListener("abort",v);const y=setTimeout(v,ou),h=await n(t,m.signal).catch(mu);clearTimeout(y),p.removeEventListener("abort",v);const x=o.getQueryData(u),C=h?0:(x?.failures??0)+1;return{up:uu(x?.up??null,h,C),failures:C}},s[2]=n,s[3]=o,s[4]=u,s[5]=t,s[6]=i):i=s[6];const a=!!t;let l;s[7]!==u||s[8]!==i||s[9]!==a?(l={queryKey:u,queryFn:i,enabled:a,retry:!1,staleTime:0,gcTime:0,refetchInterval:pu},s[7]=u,s[8]=i,s[9]=a,s[10]=l):l=s[10];const{data:g}=Jr(l);return t?g?.up??null:null}function pu(t){return t.state.data?du(t.state.data.up,t.state.data.failures):!1}function mu(){return!1}function hu(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 Pf(t){const e=le.c(53),{virtualMcpId:s}=t,n=Se(),o=Yo(s),{connection:c}=ua(s),{activeTask:u,taskId:i,currentBranch:a}=lt(),l=Ol(i),[g,f]=R.useState(!1),p=Kt(s,a);let m;e[0]!==p||e[1]!==c?(m=c?Ve(p):null,e[0]=p,e[1]=c,e[2]=m):m=e[2];const v=m,y=fu(v),h=Ea(),x=El("multi_app_preview");if(Tl({threadId:i,sandboxBranch:u?.branch??a,agentHasRepo:Ms(o?.metadata),threadHasRepo:Ms(l)||Ms(u?.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(_r,{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 E;e[6]!==n?(E=n("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=n,e[7]=E):E=e[7];let T,B;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>f(!0),B=r.jsx(_r,{className:"size-4"}),e[8]=T,e[9]=B):(T=e[8],B=e[9]);let A;e[10]!==n?(A=n("mainPanelTabs.previewTab.connectGithub"),e[10]=n,e[11]=A):A=e[11];let L;e[12]!==A?(L=r.jsxs(_e,{onClick:T,children:[B,A]}),e[12]=A,e[13]=L):L=e[13];let $;e[14]!==S||e[15]!==E||e[16]!==L?($=r.jsx(Nl,{className:"h-full",image:k,title:S,description:E,actions:L}),e[14]=S,e[15]=E,e[16]=L,e[17]=$):$=e[17];let _;e[18]!==g?(_=r.jsx(Cl,{open:g,onOpenChange:f,mode:"agent"}),e[18]=g,e[19]=_):_=e[19];let F;return e[20]!==_||e[21]!==$?(F=r.jsxs(r.Fragment,{children:[$,_]}),e[20]=_,e[21]=$,e[22]=F):F=e[22],F}if(c&&o&&!Ve(p)){let k;e[23]!==h||e[24]!==p?(k=hu({backend:p,access:h}),e[23]=h,e[24]=p,e[25]=k):k=e[25];let S;e[26]!==c.endpoint?(S=Ei(c.endpoint),e[26]=c.endpoint,e[27]=S):S=e[27];let E;return e[28]!==k||e[29]!==S?(E=r.jsx(vu,{status:k,host:S}),e[28]=k,e[29]=S,e[30]=E):E=e[30],E}if(v&&y!==!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]!==v||e[34]!==n?(S=n("mainPanelTabs.previewTab.localAppWaiting.body",{host:gu(v)}),e[33]=v,e[34]=n,e[35]=S):S=e[35];let E;e[36]!==S?(E=r.jsx(Sa,{text:S}),e[36]=S,e[37]=E):E=e[37];let T;e[38]!==n?(T=n("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=n,e[39]=T):T=e[39];let B;e[40]!==T?(B=r.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:T}),e[40]=T,e[41]=B):B=e[41];let A;return e[42]!==k||e[43]!==E||e[44]!==B?(A=r.jsx(hs,{headingLevel:2,waiting:!0,title:k,lead:E,footer:B}),e[42]=k,e[43]=E,e[44]=B,e[45]=A):A=e[45],A}let b;e[46]!==s?(b=r.jsx(Xd,{virtualMcpId:s}),e[46]=s,e[47]=b):b=e[47];const w=b;let N;return e[48]!==o||e[49]!==x||e[50]!==w||e[51]!==c?(N=r.jsx(Oo,{children:x&&o&&!c?r.jsx(Zd,{project:o,maxApps:wl,children:w}):w}),e[48]=o,e[49]=x,e[50]=w,e[51]=c,e[52]=N):N=e[52],N}function gu(t){try{return new URL(t).host}catch{return t}}function vu(t){const e=le.c(13),{status:s,host:n}=t,o=Se();if(s.kind==="connected"){let i;e[0]!==o?(i=o("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==o?(a=o("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=o,e[3]=a):a=e[3];let l;return e[4]!==i||e[5]!==a?(l=r.jsx(hs,{headingLevel:2,waiting:!1,title:i,lead:a}),e[4]=i,e[5]=a,e[6]=l):l=e[6],l}let c;e[7]!==n||e[8]!==s?(c=Bl(s,n),e[7]=n,e[8]=s,e[9]=c):c=e[9];let u;return e[10]!==n||e[11]!==c?(u=r.jsx(Dl,{wait:c,hosts:n}),e[10]=n,e[11]=c,e[12]=u):u=e[12],u}export{Dl as L,Pf as P,hs as S,Sf as u};
557
+ `)}function uc(t,e,s=320,n=44,o=12){const{x:c,y:u}=t,{width:i,height:a}=e,l=Math.max(o,Math.min(c-s/2,i-s-o)),f=u/a>.68?Math.max(o,u-n-18):Math.min(u+18,a-n-o);return{leftPct:l/i*100,topPct:f/a*100}}function fc(t){const e=le.c(45),{element:s,onDismiss:n}=t,[o,c]=R.useState(""),u=R.useRef(null),{sendMessage:i}=_o(),{openSidePanel:a}=Zi(),l=Se();let g;e[0]!==s||e[1]!==o||e[2]!==n||e[3]!==a||e[4]!==i?(g=()=>{if(!o.trim())return;const I=dc(s,o);a(),i({parts:[{type:"text",text:I}]}),n()},e[0]=s,e[1]=o,e[2]=n,e[3]=a,e[4]=i,e[5]=g):g=e[5];const f=g;let p;e[6]!==s.position||e[7]!==s.viewport?(p=uc(s.position,s.viewport),e[6]=s.position,e[7]=s.viewport,e[8]=p):p=e[8];const m=p,v=`${m.leftPct}%`,y=`${m.topPct}%`;let h;e[9]!==v||e[10]!==y?(h={left:v,top:y,width:"320px"},e[9]=v,e[10]=y,e[11]=h):h=e[11];let x;e[12]!==f?(x=I=>{I.preventDefault(),f()},e[12]=f,e[13]=x):x=e[13];let C;e[14]===Symbol.for("react.memo_cache_sentinel")?(C=I=>c(I.target.value),e[14]=C):C=e[14];let b;e[15]!==n?(b=I=>{I.key==="Escape"&&n()},e[15]=n,e[16]=b):b=e[16];let w;e[17]!==l?(w=l("sandbox.visualEditorPrompt.inputPlaceholder"),e[17]=l,e[18]=w):w=e[18];let N;e[19]!==o||e[20]!==b||e[21]!==w?(N=r.jsx("input",{ref:u,autoFocus:!0,type:"text",value:o,onChange:C,onKeyDown:b,placeholder:w,className:"min-w-0 flex-1 bg-transparent text-sm outline-none placeholder:text-muted-foreground"}),e[19]=o,e[20]=b,e[21]=w,e[22]=N):N=e[22];let k;e[23]!==o?(k=o.trim(),e[23]=o,e[24]=k):k=e[24];const S=!k;let E;e[25]!==l?(E=l("sandbox.visualEditorPrompt.sendButton"),e[25]=l,e[26]=E):E=e[26];let T;e[27]!==l?(T=l("sandbox.visualEditorPrompt.sendButton"),e[27]=l,e[28]=T):T=e[28];let B;e[29]!==T?(B=r.jsx("title",{children:T}),e[29]=T,e[30]=B):B=e[30];let A;e[31]===Symbol.for("react.memo_cache_sentinel")?(A=r.jsx("path",{d:"M5 9V1M1 5l4-4 4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),e[31]=A):A=e[31];let L;e[32]!==B?(L=r.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:[B,A]}),e[32]=B,e[33]=L):L=e[33];let $;e[34]!==S||e[35]!==E||e[36]!==L?($=r.jsx("button",{type:"submit",disabled:S,className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-lg bg-foreground text-background transition-opacity disabled:opacity-30",title:E,children:L}),e[34]=S,e[35]=E,e[36]=L,e[37]=$):$=e[37];let _;e[38]!==N||e[39]!==$||e[40]!==x?(_=r.jsxs("form",{className:"pointer-events-auto flex w-full items-center gap-1.5 rounded-xl glass px-3 py-1.5",onSubmit:x,children:[N,$]}),e[38]=N,e[39]=$,e[40]=x,e[41]=_):_=e[41];let F;return e[42]!==_||e[43]!==h?(F=r.jsx("div",{className:"absolute z-30 pointer-events-none",style:h,children:_}),e[42]=_,e[43]=h,e[44]=F):F=e[44],F}const Mr="site-links",pc=/details?page|\bpdp\b/i,mc=/listingpage|\bplp\b/i;function hc(t,e,s){const n=new Set;for(const i of s)pc.test(i)&&n.add("product"),mc.test(i)&&n.add("category");const o=xt(fn(t)),c=o[o.length-1],u=o[o.length-2];return c?.type==="text"&&c.text==="/p"&&u?.type==="param"&&u.name===e&&n.add("product"),e==="*"&&o.some(i=>i.type==="param"&&i.name==="*")&&n.add("category"),n}const gc=["rosa","preto","pink","black"];function cs(t,e){const s=e.trim();return s?t(s):gc.flatMap(n=>t(n))}function vc(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 Na=new Set(["vtex","shopify","shopify-mcp","magento","wake","linx","linx-impulse","nuvemshop","vnda","wap","salesforce"]);function hn(t){return t.split("/")[0]??""}function xc(t){const e=new Set;for(const s of t){const n=hn(s);Na.has(n)&&e.add(n)}return e}function bc(t,e){const s=hn(t);return!Na.has(s)||e.size===0?!0:e.has(s)}const yc=[{kind:"product",test:t=>t==="vtex/loaders/intelligentSearch/productList.ts",clientFilter:!1,buildRequests:(t,e)=>cs(s=>vc(t,s),e),optionsFromPayload:ds},{kind:"product",test:t=>/magento\/.*products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>cs(s=>[{resolveType:t,props:{props:{search:s,pageSize:10,currentPage:1}}}],e),optionsFromPayload:ds},{kind:"product",test:t=>/algolia\/.*products?\/(list|suggestions)(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>cs(s=>[{resolveType:t,props:{term:s,hitsPerPage:10}}],e),optionsFromPayload:ds},{kind:"product",test:t=>/products?\/list(\.tsx?)?$/i.test(t),clientFilter:!1,buildRequests:(t,e)=>cs(s=>[{resolveType:t,props:{query:s,term:s,count:10,hitsPerPage:10}}],e),optionsFromPayload:ds},{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:Nc}];function wc(t,e,s=new Set){const n=[...e],o=i=>{const a=[];for(const l of yc){if(l.kind!==i)continue;const g=n.find(f=>l.test(f)&&bc(f,s));g&&a.push({cand:l,resolveType:g})}return a.find(l=>s.has(hn(l.resolveType)))??a[0]},c=(i,a,l)=>({kind:i.kind,id:`${i.kind}:${a}`,resolveType:a,clientFilter:i.clientFilter,isFallback:l,buildRequests:g=>i.buildRequests(a,g),optionsFromPayload:i.optionsFromPayload}),u=[];for(const i of["product","category"]){if(!t.has(i))continue;const a=o(i);a&&u.push(c(a.cand,a.resolveType,!1))}return t.size>0&&u.push(kc(t.has("category")?"category":"product")),u}function kc(t){return{kind:t,id:Mr,resolveType:Mr,clientFilter:!0,isFallback:!0,homepageLinks:!0,optionsFromPayload:(e,s)=>Ac(e,s)}}function ot(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:null}function Sc(t,e,s){const n=new Set,o=new Set,c=u=>{if(Array.isArray(u)){for(const l of u)c(l);return}const i=ot(u);if(!i)return;const a=i.__resolveType;if(typeof a=="string"){if(s(a))n.add(a);else if(a in e&&!o.has(a)){o.add(a);const l=ot(e[a])?.__resolveType;typeof l=="string"&&s(l)&&n.add(a),c(e[a])}}for(const l of Object.values(i))c(l)};return c(t),n}function Ca(t){const e=new Set,s=[];for(const n of t)for(const o of n)e.has(o.value)||(e.add(o.value),s.push(o));return s}function Ta(t){try{return decodeURIComponent(t)}catch{return t}}function Pc(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function jc(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 gn(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 o=xt(fn(e)),{pattern:c,order:u}=jc(o),i=u.indexOf(s);if(i===-1)return null;const a=n.match(c);if(!a)return null;const l=a[i+1]?.replace(/^\/+|\/+$/g,"");return l?Ta(l):null}function ds(t,e){const s=ot(t),n=Array.isArray(t)?t:Array.isArray(s?.products)?s.products:Array.isArray(s?.list)?s.list:[],o=[],c=new Set;for(const u of n){const i=ot(u);if(!i)continue;const a=gn(i.url,e.template,e.paramName);if(!a||c.has(a))continue;c.add(a);const l=ot(i.isVariantOf),g=typeof l?.name=="string"&&l.name||typeof i.name=="string"&&i.name||a,f=Array.isArray(i.image)?ot(i.image[0]):null,p=typeof f?.url=="string"?f.url:void 0;o.push({value:a,label:g,image:p})}return o}function Ec(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?Ta(s):null}function Nc(t){const e=[],s=new Set,n=(o,c)=>{const u=ot(o);if(!u)return;const i=typeof u.name=="string"&&u.name?u.name:"",a=i?[...c,i]:c,l=Ec(u.url);if(l&&!s.has(l)&&(s.add(l),e.push({value:l,label:a.join(" › ")||l})),Array.isArray(u.children))for(const g of u.children)n(g,a)};if(Array.isArray(t))for(const o of t)n(o,[]);return e}const Cc=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 Tc(t){return(t.split("/").filter(Boolean).pop()??t).replace(/[-_]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,s=>s.toUpperCase())}function Rc(t){if(typeof t!="string"||!t)return[];const e=[],s=/<a\b[^>]*?\bhref="([^"]+)"[^>]*>([\s\S]*?)<\/a>/gi;let n,o=0;for(;(n=s.exec(t))!==null&&o++<5e3;){const c=n[1]??"",u=(n[2]??"").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();e.push({href:c,text:u})}return e}function Lc(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,o=/(?:"image"|\bimage):\s*\[\s*\{[\s\S]{0,400}?(?:"url"|\burl):"([^"]+)"/;let c,u=0;for(;(c=n.exec(t))!==null&&u++<3e3;){const i=(c[1]??"").replace(/\\\//g,"/");if(!i||s.has(i))continue;s.add(i);const a=t.slice(c.index,c.index+900).match(o)?.[1]?.replace(/\\\//g,"/");e.push({url:i,name:c[2]??"",image:a||void 0})}return e}function Ac(t,e){const s=[],n=new Set,o=(c,u,i,a)=>{if(s.length>=200)return;const l=gn(c,e.template,e.paramName);!l||n.has(l)||e.paramName==="*"&&/(^|\/)p$/.test(l)||i==="category"&&Cc.has(l.split("/")[0]??"")||(n.add(l),s.push({value:l,label:u&&u.length<=80?u:Tc(l),kind:i,image:a}))};for(const{url:c,name:u,image:i}of Lc(t))o(c,u,"product",i);for(const{href:c,text:u}of Rc(t))c.startsWith("/")&&!c.startsWith("//")&&o(c,u,"category");return s}function zt(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 Ra=1e4;function Oc(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 _c(t,{resolveType:e,props:s}){const n=await fetch(ii(t),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({__resolveType:e,...s}),signal:AbortSignal.timeout(Ra)});if(!n.ok)throw new Error(`Failed to fetch options: ${n.status}`);return n.json()}async function zr(t,e){const s=await fetch(li(t,e),{signal:AbortSignal.timeout(Ra)});if(!s.ok)throw new Error(`Failed to fetch page: ${s.status}`);return s.text()}async function $c(t,e,s){const n=e.optionsFromPayload(await zr(t,"/"),s),o=n.find(u=>u.kind==="category");if(!o)return n;const c=Be(s.template,{[s.paramName]:o.value});if(c==="/")return n;try{const u=e.optionsFromPayload(await zr(t,c),s).filter(i=>i.kind==="product");return Ca([n,u])}catch{return n}}function Fc(t,e,s){return tn.sandboxInvoke(`${t.orgSlug}/${t.virtualMcpId}/${t.branch}`,`path-param-${e.id}:${e.clientFilter?"":s}`)}async function Dc(t,e,s,n){if(e.homepageLinks)return $c(t,e,n);const o=e.buildRequests?.(s)??[];if(o.length===0)return[];const c=await Promise.allSettled(o.map(i=>_c(t,i))),u=c.filter(i=>i.status==="fulfilled").map(i=>i.value);if(u.length===0){const i=c.find(a=>a.status==="rejected");throw i?i.reason:new Error("Failed to fetch options")}return Ca(u.map(i=>e.optionsFromPayload(i,n)))}function Qs(t,e,s,n,o){return{queryKey:Fc(t,e,s),queryFn:()=>Dc(t,e,s,n),enabled:o,staleTime:6e4,retry:1}}function It(t){const e=le.c(16),{heading:s,iconKind:n,options:o,template:c,paramName:u,keyPrefix:i,onSelect:a}=t;if(o.length===0)return null;let l;if(e[0]!==n||e[1]!==i||e[2]!==a||e[3]!==o||e[4]!==u||e[5]!==c){let f;e[7]!==n||e[8]!==i||e[9]!==a||e[10]!==u||e[11]!==c?(f=p=>r.jsxs(qe,{value:`${i}:${p.value}`,className:"gap-3 py-2",onSelect:()=>a(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(an,{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:Be(c,{[u]:p.value})})]})]},`${i}:${p.value}`),e[7]=n,e[8]=i,e[9]=a,e[10]=u,e[11]=c,e[12]=f):f=e[12],l=o.map(f),e[0]=n,e[1]=i,e[2]=a,e[3]=o,e[4]=u,e[5]=c,e[6]=l}else l=e[6];let g;return e[13]!==s||e[14]!==l?(g=r.jsx(We,{heading:s,children:l}),e[13]=s,e[14]=l,e[15]=g):g=e[15],g}function Ir(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 Bc(t){const e=le.c(52),{sources:s,template:n,paramName:o,value:c,sandboxRef:u,onCommit:i}=t,a=Se(),[l,g]=R.useState(!1),[f,p]=R.useState(""),[m,v]=R.useState(""),y=R.useRef(null),h=o==="*"?a("sandbox.preview.catchAllParamLabel"):`:${o}`,x=Oc(a),b=[...new Set(s.map(re=>x[re.kind].noun))].join(" or ");let w;e[0]!==a||e[1]!==b?(w=a("sandbox.pathParamPickerChip.searchPlaceholder",{options:b}),e[0]=a,e[1]=b,e[2]=w):w=e[2];const N=w,k={template:n,paramName:o};let S;e[3]!==f?(S=(re,ue)=>({source:re,query:ue,options:re.clientFilter?zt(ue.data??[],f):ue.data??[]}),e[3]=f,e[4]=S):S=e[4];const E=S,T=s.filter(Wc),B=s.filter(Vc),A=Gs({queries:T.map(re=>Qs(u,re,m,k,l))});let L;e[5]!==A||e[6]!==E?(L=(re,ue)=>E(re,A[ue]),e[5]=A,e[6]=E,e[7]=L):L=e[7];const $=T.map(L),_=$.length===0||$.every(Hc),F=Gs({queries:B.map(re=>Qs(u,re,m,k,l&&_))});let I;e[8]!==F||e[9]!==E?(I=(re,ue)=>E(re,F[ue]),e[8]=F,e[9]=E,e[10]=I):I=e[10];const J=B.map(I),W=_?J:$,Y=W.length===1&&W[0]?.source.homepageLinks?W[0]:null,Q=Y&&!Y.query.isLoading&&!Y.query.isError?Y?.query.data??[]:[],H=zt(Q.filter(Kc),f),ee=zt(Q.filter(Uc),f),q=H.length>0&&ee.length>0,U=re=>{g(re),y.current&&clearTimeout(y.current),p(re?c:""),v(re?c:"")};let z;e[11]===Symbol.for("react.memo_cache_sentinel")?(z=re=>{p(re),y.current&&clearTimeout(y.current),y.current=setTimeout(()=>{v(re)},300)},e[11]=z):z=e[11];const j=z,O=re=>{i(re),U(!1)},D=pn(f),K=Be(n,{[o]:D}),Z=en,te=Zs,M="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",X=Ic;let se;e[12]!==h||e[13]!==a?(se=a("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:h}),e[12]=h,e[13]=a,e[14]=se):se=e[14];let ae;e[15]!==se?(ae=r.jsx(sn,{className:"sr-only",children:r.jsx(nn,{children:se})}),e[15]=se,e[16]=ae):ae=e[16];let me;e[17]===Symbol.for("react.memo_cache_sentinel")?(me=r.jsx(an,{size:16,className:"shrink-0 text-foreground"}),e[17]=me):me=e[17];let pe;e[18]!==a?(pe=a("sandbox.pathParamPickerChip.pickValueHeading"),e[18]=a,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:[me,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=ln,Pe=!1,fe="min-h-0 flex-1";let de;e[25]!==N||e[26]!==f?(de=r.jsx(cn,{autoFocus:!0,placeholder:N,value:f,onValueChange:j}),e[25]=N,e[26]=f,e[27]=de):de=e[27];const Le=on,Ie="flex max-h-none min-h-0 flex-1 flex-col overflow-hidden";let Ue;e[28]!==a?(Ue=a("sandbox.pathParamPickerChip.noResults"),e[28]=a,e[29]=Ue):Ue=e[29];let Me;e[30]!==Ue?(Me=r.jsx(dn,{children:Ue}),e[30]=Ue,e[31]=Me):Me=e[31];const yt=D&&r.jsx(We,{className:"shrink-0",children:r.jsxs(qe,{value:`__raw__:${D}`,className:"gap-3 py-2",onSelect:()=>O(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(ha,{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:a("sandbox.pathParamPickerChip.useRawValue",{rawTerm:D,paramLabel:h})}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:K})]})]})}),he=q?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(It,{heading:x.category.heading,iconKind:"category",options:H,template:n,paramName:o,keyPrefix:`${Y?.source.id}:cat`,onSelect:O})}),r.jsx("div",{className:"min-w-0 flex-1 overflow-y-auto",children:r.jsx(It,{heading:x.product.heading,iconKind:"product",options:ee,template:n,paramName:o,keyPrefix:`${Y?.source.id}:prod`,onSelect:O})})]}):r.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto",children:W.map(re=>{const{source:ue,query:Ge,options:wt}=re,{noun:Je}=x[ue.kind];if(Ge.isLoading)return r.jsx(Ir,{text:a("sandbox.pathParamPickerChip.loading",{noun:Je})},ue.id);if(Ge.isError)return r.jsx(Ir,{text:a("sandbox.pathParamPickerChip.couldNotLoad")},ue.id);if(ue.homepageLinks){const Ht=Ge.data??[];return r.jsxs(R.Fragment,{children:[r.jsx(It,{heading:x.category.heading,iconKind:"category",options:zt(Ht.filter(zc),f),template:n,paramName:o,keyPrefix:`${ue.id}:cat`,onSelect:O}),r.jsx(It,{heading:x.product.heading,iconKind:"product",options:zt(Ht.filter(Mc),f),template:n,paramName:o,keyPrefix:`${ue.id}:prod`,onSelect:O})]},ue.id)}return r.jsx(It,{heading:W.length>1?x[ue.kind].heading:void 0,iconKind:ue.kind,options:wt,template:n,paramName:o,keyPrefix:ue.id,onSelect:O},ue.id)})});let $e;e[32]!==Le||e[33]!==Me||e[34]!==yt||e[35]!==he?($e=r.jsxs(Le,{className:Ie,children:[Me,yt,he]}),e[32]=Le,e[33]=Me,e[34]=yt,e[35]=he,e[36]=$e):$e=e[36];let xe;e[37]!==ve||e[38]!==de||e[39]!==$e?(xe=r.jsxs(ve,{shouldFilter:Pe,className:fe,children:[de,$e]}),e[37]=ve,e[38]=de,e[39]=$e,e[40]=xe):xe=e[40];let Ke;e[41]!==te||e[42]!==ae||e[43]!==ge||e[44]!==xe||e[45]!==X?(Ke=r.jsxs(te,{className:M,onClick:X,children:[ae,ge,xe]}),e[41]=te,e[42]=ae,e[43]=ge,e[44]=xe,e[45]=X,e[46]=Ke):Ke=e[46];let Ae;return e[47]!==Z||e[48]!==U||e[49]!==l||e[50]!==Ke?(Ae=r.jsx(Z,{open:l,onOpenChange:U,children:Ke}),e[47]=Z,e[48]=U,e[49]=l,e[50]=Ke,e[51]=Ae):Ae=e[51],r.jsxs(r.Fragment,{children:[r.jsx("button",{type:"button",title:a("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:re=>{re.stopPropagation(),U(!0)},children:c||h}),Ae]})}function Mc(t){return t.kind==="product"}function zc(t){return t.kind!=="product"}function Ic(t){return t.stopPropagation()}function Uc(t){return t.kind==="product"}function Kc(t){return t.kind!=="product"}function Hc(t){return!t.query.isLoading&&(t.query.isError||t.options.length===0)}function Vc(t){return t.isFallback}function Wc(t){return!t.isFallback}function qc(t){const e=le.c(8),{sources:s,template:n,paramName:o,sandboxRef:c,onFill:u}=t;let i,a;if(e[0]!==o||e[1]!==c||e[2]!==s||e[3]!==n){const m={template:n,paramName:o},v=s.filter(Gc);a=Gs,i=v.map(y=>Qs(c,y,"",m,!0)),e[0]=o,e[1]=c,e[2]=s,e[3]=n,e[4]=i,e[5]=a}else i=e[4],a=e[5];let l;e[6]!==i?(l={queries:i},e[6]=i,e[7]=l):l=e[7];const g=a(l),[f,p]=R.useState(!1);if(!f)for(const m of g){if(m.isLoading)break;const v=m.data?.[0];if(v){p(!0),queueMicrotask(()=>u(v.value));break}}return null}function Gc(t){return!t.isFallback}function Jc(t){const e=le.c(31),{name:s,value:n,onCommit:o}=t,c=Se(),[u,i]=R.useState(n),[a,l]=R.useState(!1),g=R.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,m=u||p;let v;e[3]!==m?(v=r.jsx("span",{"aria-hidden":!0,className:"invisible whitespace-pre px-1 py-0.5 text-xs",children:m}),e[3]=m,e[4]=v):v=e[4];let y;e[5]!==p||e[6]!==c?(y=c("sandbox.preview.valueForParam",{label:p}),e[5]=p,e[6]=c,e[7]=y):y=e[7];let h,x;e[8]===Symbol.for("react.memo_cache_sentinel")?(h=E=>i(E.target.value),x=()=>l(!0),e[8]=h,e[9]=x):(h=e[8],x=e[9]);let C;e[10]!==n?(C=E=>{E.key==="Enter"&&E.currentTarget.blur(),E.key==="Escape"&&(g.current=!0,i(n),E.currentTarget.blur())},e[10]=n,e[11]=C):C=e[11];let b;e[12]!==u||e[13]!==o||e[14]!==n?(b=()=>{if(l(!1),g.current){g.current=!1;return}const E=pn(u);i(E),E!==n&&o(E)},e[12]=u,e[13]=o,e[14]=n,e[15]=b):b=e[15];let w;e[16]!==u||e[17]!==p||e[18]!==y||e[19]!==C||e[20]!==b?(w=r.jsx("input",{type:"text",value:u,placeholder:p,title:y,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:Yc,onChange:h,onFocus:x,onKeyDown:C,onBlur:b}),e[16]=u,e[17]=p,e[18]=y,e[19]=C,e[20]=b,e[21]=w):w=e[21];let N;e[22]!==v||e[23]!==w?(N=r.jsxs("span",{className:"relative inline-flex max-w-64 shrink-0 items-center overflow-hidden",children:[v,w]}),e[22]=v,e[23]=w,e[24]=N):N=e[24];let k;e[25]!==a||e[26]!==c?(k=a&&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(Io,{size:10}),c("sandbox.preview.enterToGo")]}),e[25]=a,e[26]=c,e[27]=k):k=e[27];let S;return e[28]!==k||e[29]!==N?(S=r.jsxs(r.Fragment,{children:[N,k]}),e[28]=k,e[29]=N,e[30]=S):S=e[30],S}function Yc(t){return t.stopPropagation()}const Qc=/^(?:autor|author|authorSlug)$/;function Ur(t){return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}const us=t=>typeof t=="string"?t:"";function Xc(t,e,s,n=new Date().toISOString().slice(0,10)){const o=Ci(e),[c]=xt(e);if(o.length===0||o.includes("*")||c?.type!=="text"||c.text==="/")return[];const u=tl(t),i=m=>u[m].map(v=>({label:v.label,data:Ur(Ur(t[v.key])[nl[m]])})),a=[],l=i("posts").filter(({data:m})=>sl(m)==="published"&&us(m.date).slice(0,10)<=n).sort((m,v)=>us(v.data.date).localeCompare(us(m.data.date)));for(const{label:m,data:v}of l)a.push({label:m,path:al(t,v,s)});for(const{label:m,data:v}of i("categories"))a.push({label:m,path:ol(t,v,s)});const g=o.find(m=>Qc.test(m));if(g)for(const{label:m,data:v}of i("authors")){const y=us(v.slug);a.push({label:m,path:y?Be(e,{[g]:y}):null})}const f=[],p=new Set;for(const{label:m,path:v}of a){if(!v)continue;const y={};for(const x of o){const C=gn(v,e,x);if(!C)break;y[x]=C}if(Object.keys(y).length!==o.length)continue;const h=Be(e,y);p.has(h)||(p.add(h),f.push({label:m,values:y}))}return f}function Zc(t){const e=le.c(96),{paramName:s,template:n,value:o,options:c,onPick:u,onCommit:i}=t,a=Se(),[l,g]=R.useState(!1),[f,p]=R.useState(""),m=`:${s}`;let v;if(e[0]!==c||e[1]!==f){const U=f.trim().toLowerCase();v=U?c.filter(z=>z.label.toLowerCase().includes(U)||Object.values(z.values).some(j=>j.toLowerCase().includes(U))):c,e[0]=c,e[1]=f,e[2]=v}else v=e[2];const y=v;let h,x,C,b,w,N,k,S,E,T,B,A,L,$,_,F,I,J;if(e[3]!==i||e[4]!==l||e[5]!==m||e[6]!==f||e[7]!==a||e[8]!==o){const U=pn(f);let z;e[27]===Symbol.for("react.memo_cache_sentinel")?(z=()=>{g(!1),p("")},e[27]=z):z=e[27],w=z;let j;e[28]!==m||e[29]!==a?(j=a("sandbox.pathParamPickerChip.buttonTitle",{paramLabel:m}),e[28]=m,e[29]=a,e[30]=j):j=e[30];let O;e[31]===Symbol.for("react.memo_cache_sentinel")?(O=ae=>{ae.stopPropagation(),g(!0)},e[31]=O):O=e[31];const D=o||m;e[32]!==j||e[33]!==D?(T=r.jsx("button",{type:"button",title:j,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:O,children:D}),e[32]=j,e[33]=D,e[34]=T):T=e[34],b=en,S=l,e[35]===Symbol.for("react.memo_cache_sentinel")?(E=ae=>ae?g(!0):w(),e[35]=E):E=e[35],C=Zs,I="flex h-[85svh] flex-col gap-0 overflow-hidden p-0 sm:h-[520px] sm:max-w-[560px]",J=ed;let K;e[36]!==m||e[37]!==a?(K=a("sandbox.pathParamPickerChip.pickValueTitle",{paramLabel:m}),e[36]=m,e[37]=a,e[38]=K):K=e[38],e[39]!==K?(N=r.jsx(sn,{className:"sr-only",children:r.jsx(nn,{children:K})}),e[39]=K,e[40]=N):N=e[40];let Z;e[41]===Symbol.for("react.memo_cache_sentinel")?(Z=r.jsx(an,{size:16,className:"shrink-0 text-foreground"}),e[41]=Z):Z=e[41];let te;e[42]!==a?(te=a("sandbox.pathParamPickerChip.pickValueHeading"),e[42]=a,e[43]=te):te=e[43];let M;e[44]!==m?(M=r.jsx("span",{className:"rounded-sm bg-special/15 px-1 py-0.5 font-mono text-xs text-special",children:m}),e[44]=m,e[45]=M):M=e[45],e[46]!==te||e[47]!==M?(k=r.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-3 border-b border-border px-4",children:[Z,r.jsxs("span",{className:"text-sm font-medium text-foreground",children:[te," ",M]})]}),e[46]=te,e[47]=M,e[48]=k):k=e[48],x=ln,$=!1,_="min-h-0 flex-1";let X;e[49]!==a?(X=a("sandbox.pathParamPickerChip.searchBlogPlaceholder"),e[49]=a,e[50]=X):X=e[50],e[51]!==f||e[52]!==X?(F=r.jsx(cn,{autoFocus:!0,placeholder:X,value:f,onValueChange:p}),e[51]=f,e[52]=X,e[53]=F):F=e[53],h=on,B="max-h-none min-h-0 flex-1 overflow-y-auto";let se;e[54]!==a?(se=a("sandbox.pathParamPickerChip.noResults"),e[54]=a,e[55]=se):se=e[55],e[56]!==se?(A=r.jsx(dn,{children:se}),e[56]=se,e[57]=A):A=e[57],L=U&&r.jsx(We,{children:r.jsxs(qe,{value:`__raw__:${U}`,className:"gap-3 py-2",onSelect:()=>{i(U),w()},children:[r.jsx(ha,{size:14,className:"shrink-0 text-muted-foreground"}),r.jsx("span",{className:"min-w-0 flex-1 truncate text-sm",children:a("sandbox.pathParamPickerChip.useRawValue",{rawTerm:U,paramLabel:m})})]})}),e[3]=i,e[4]=l,e[5]=m,e[6]=f,e[7]=a,e[8]=o,e[9]=h,e[10]=x,e[11]=C,e[12]=b,e[13]=w,e[14]=N,e[15]=k,e[16]=S,e[17]=E,e[18]=T,e[19]=B,e[20]=A,e[21]=L,e[22]=$,e[23]=_,e[24]=F,e[25]=I,e[26]=J}else h=e[9],x=e[10],C=e[11],b=e[12],w=e[13],N=e[14],k=e[15],S=e[16],E=e[17],T=e[18],B=e[19],A=e[20],L=e[21],$=e[22],_=e[23],F=e[24],I=e[25],J=e[26];let W;if(e[58]!==w||e[59]!==u||e[60]!==n||e[61]!==y){let U;e[63]!==w||e[64]!==u||e[65]!==n?(U=z=>{const j=Be(n,z.values);return r.jsx(qe,{value:j,className:"py-2",onSelect:()=>{u(z.values),w()},children:r.jsxs("span",{className:"min-w-0 flex-1",children:[r.jsx("span",{className:"block truncate text-sm",children:z.label}),r.jsx("span",{className:"block truncate text-xs text-muted-foreground",children:j})]})},j)},e[63]=w,e[64]=u,e[65]=n,e[66]=U):U=e[66],W=y.map(U),e[58]=w,e[59]=u,e[60]=n,e[61]=y,e[62]=W}else W=e[62];let Y;e[67]!==W?(Y=r.jsx(We,{children:W}),e[67]=W,e[68]=Y):Y=e[68];let G;e[69]!==h||e[70]!==Y||e[71]!==B||e[72]!==A||e[73]!==L?(G=r.jsxs(h,{className:B,children:[A,L,Y]}),e[69]=h,e[70]=Y,e[71]=B,e[72]=A,e[73]=L,e[74]=G):G=e[74];let Q;e[75]!==x||e[76]!==G||e[77]!==$||e[78]!==_||e[79]!==F?(Q=r.jsxs(x,{shouldFilter:$,className:_,children:[F,G]}),e[75]=x,e[76]=G,e[77]=$,e[78]=_,e[79]=F,e[80]=Q):Q=e[80];let H;e[81]!==C||e[82]!==N||e[83]!==k||e[84]!==Q||e[85]!==I||e[86]!==J?(H=r.jsxs(C,{className:I,onClick:J,children:[N,k,Q]}),e[81]=C,e[82]=N,e[83]=k,e[84]=Q,e[85]=I,e[86]=J,e[87]=H):H=e[87];let ee;e[88]!==b||e[89]!==S||e[90]!==E||e[91]!==H?(ee=r.jsx(b,{open:S,onOpenChange:E,children:H}),e[88]=b,e[89]=S,e[90]=E,e[91]=H,e[92]=ee):ee=e[92];let q;return e[93]!==T||e[94]!==ee?(q=r.jsxs(r.Fragment,{children:[T,ee]}),e[93]=T,e[94]=ee,e[95]=q):q=e[95],q}function ed(t){return t.stopPropagation()}function td(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 sd(t){return t.previewSurfaceActive&&(t.daemonReady||t.production||!!t.servePreviewUrl)}function nd(t){return t.showPreviewToolbar&&(t.contentEditingEnabled||t.hasFrameworkRoutes)}function rd(t){return t.v8?null:t.production||t.localPreview?{type:"editor::inject",args:{script:t.script}}:{type:"visual-editor::activate",script:t.script}}function ad(t){return t.v8?null:{type:"visual-editor::activate",script:t.script}}class La extends Error{constructor(){super("The site's schema isn't loaded yet"),this.name="PageSchemaNotReadyError"}}async function od(t,e){if(t)return t;const s=await e?.().catch(()=>null);if(!s)throw new La;return s}async function id(t,e,s){return s?Cr(t,e,await od(s.meta,s.loadMeta)):Cr(t,e)}function ld(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=il(s);let o;return e[2]!==t||e[3]!==n?(o={mutationFn:async c=>{const{name:u,path:i,template:a,schema:l}=c;if(!t?.virtualMcpId||!t.branch)throw new Error("Sandbox not ready");const g=Hi(u),f=a?{...a,name:u,path:i}:await id(u,i,l);return await n.mutateAsync({blockKey:g,data:f}),{key:g,name:u,path:i}}},e[2]=t,e[3]=n,e[4]=o):o=e[4],Eo(o)}function cd(t){const e=le.c(89),{open:s,onOpenChange:n,isPending:o,error:c,templates:u,onSubmit:i}=t,a=o===void 0?!1:o,l=Se();let g;e[0]!==l?(g=l("sectionsEditor.createPageModal.defaultPageName"),e[0]=l,e[1]=g):g=e[1];const[f,p]=R.useState(g);let m;e[2]!==l?(m=l("sectionsEditor.createPageModal.defaultPagePath"),e[2]=l,e[3]=m):m=e[3];const[v,y]=R.useState(m),[h,x]=R.useState(Fs),[C,b]=R.useState(null),[w,N]=R.useState(s);s!==w&&(N(s),s&&(p(l("sectionsEditor.createPageModal.defaultPageName")),y(l("sectionsEditor.createPageModal.defaultPagePath")),x(Fs),b(null)));const k=!!u?.length;let S;e[4]!==a||e[5]!==n?(S=pe=>{!pe&&!a&&(b(null),n(!1))},e[4]=a,e[5]=n,e[6]=S):S=e[6];const E=S;let T;e[7]!==a||e[8]!==f||e[9]!==i||e[10]!==v||e[11]!==k||e[12]!==h?(T=async pe=>{pe.preventDefault();const be=f.trim(),ge=v.trim();if(!be||!ge||a)return;const ve=pa(ge);if(ve){b(ve);return}b(null),await i({name:be,path:ge,templateKey:k&&h!==Fs?h:null})},e[7]=a,e[8]=f,e[9]=i,e[10]=v,e[11]=k,e[12]=h,e[13]=T):T=e[13];const B=T,A=C??c;let L;e[14]!==l?(L=l("sectionsEditor.createPageModal.title"),e[14]=l,e[15]=L):L=e[15];let $;e[16]!==L?($=r.jsx(sn,{children:r.jsx(nn,{children:L})}),e[16]=L,e[17]=$):$=e[17];let _;e[18]!==l?(_=l("sectionsEditor.createPageModal.nameLabel"),e[18]=l,e[19]=_):_=e[19];let F;e[20]!==_?(F=r.jsx("label",{htmlFor:"new-page-name",className:"text-xs font-medium text-muted-foreground",children:_}),e[20]=_,e[21]=F):F=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 J;e[23]!==l?(J=l("sectionsEditor.createPageModal.namePlaceholder"),e[23]=l,e[24]=J):J=e[24];let W;e[25]!==a||e[26]!==f||e[27]!==J?(W=r.jsx(Hs,{id:"new-page-name",value:f,onChange:I,placeholder:J,autoFocus:!0,disabled:a}),e[25]=a,e[26]=f,e[27]=J,e[28]=W):W=e[28];let Y;e[29]!==W||e[30]!==F?(Y=r.jsxs("div",{className:"space-y-1.5",children:[F,W]}),e[29]=W,e[30]=F,e[31]=Y):Y=e[31];let G;e[32]!==l?(G=l("sectionsEditor.createPageModal.pathLabel"),e[32]=l,e[33]=G):G=e[33];let Q;e[34]!==G?(Q=r.jsx("label",{htmlFor:"new-page-path",className:"text-xs font-medium text-muted-foreground",children:G}),e[34]=G,e[35]=Q):Q=e[35];let H;e[36]===Symbol.for("react.memo_cache_sentinel")?(H=pe=>y(pe.target.value),e[36]=H):H=e[36];let ee;e[37]!==l?(ee=l("sectionsEditor.createPageModal.pathPlaceholder"),e[37]=l,e[38]=ee):ee=e[38];let q;e[39]!==a||e[40]!==v||e[41]!==ee?(q=r.jsx(Hs,{id:"new-page-path",value:v,onChange:H,placeholder:ee,disabled:a}),e[39]=a,e[40]=v,e[41]=ee,e[42]=q):q=e[42];let U;e[43]!==Q||e[44]!==q?(U=r.jsxs("div",{className:"space-y-1.5",children:[Q,q]}),e[43]=Q,e[44]=q,e[45]=U):U=e[45];let z;e[46]!==a||e[47]!==k||e[48]!==l||e[49]!==h||e[50]!==u?(z=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(Vi,{id:"new-page-template",value:h,onChange:x,templates:u??[],disabled:a})]}),e[46]=a,e[47]=k,e[48]=l,e[49]=h,e[50]=u,e[51]=z):z=e[51];let j;e[52]!==A?(j=A&&r.jsx("p",{className:"text-xs text-destructive",children:A}),e[52]=A,e[53]=j):j=e[53];let O;e[54]!==Y||e[55]!==U||e[56]!==z||e[57]!==j?(O=r.jsxs("div",{className:"space-y-4 py-4",children:[Y,U,z,j]}),e[54]=Y,e[55]=U,e[56]=z,e[57]=j,e[58]=O):O=e[58];let D;e[59]!==n?(D=()=>n(!1),e[59]=n,e[60]=D):D=e[60];let K;e[61]!==l?(K=l("sectionsEditor.createPageModal.cancelButton"),e[61]=l,e[62]=K):K=e[62];let Z;e[63]!==a||e[64]!==D||e[65]!==K?(Z=r.jsx(_e,{type:"button",variant:"outline",onClick:D,disabled:a,children:K}),e[63]=a,e[64]=D,e[65]=K,e[66]=Z):Z=e[66];let te;e[67]!==a||e[68]!==f||e[69]!==v?(te=!f.trim()||!v.trim()||a,e[67]=a,e[68]=f,e[69]=v,e[70]=te):te=e[70];let M;e[71]!==a||e[72]!==l?(M=a?r.jsxs(r.Fragment,{children:[r.jsx(it,{className:"size-3.5"}),l("sectionsEditor.createPageModal.creatingButton")]}):l("sectionsEditor.createPageModal.createButton"),e[71]=a,e[72]=l,e[73]=M):M=e[73];let X;e[74]!==te||e[75]!==M?(X=r.jsx(_e,{type:"submit",disabled:te,children:M}),e[74]=te,e[75]=M,e[76]=X):X=e[76];let se;e[77]!==Z||e[78]!==X?(se=r.jsxs(No,{children:[Z,X]}),e[77]=Z,e[78]=X,e[79]=se):se=e[79];let ae;e[80]!==B||e[81]!==O||e[82]!==se||e[83]!==$?(ae=r.jsx(Zs,{className:"sm:max-w-md",children:r.jsxs("form",{onSubmit:B,children:[$,O,se]})}),e[80]=B,e[81]=O,e[82]=se,e[83]=$,e[84]=ae):ae=e[84];let me;return e[85]!==E||e[86]!==s||e[87]!==ae?(me=r.jsx(en,{open:s,onOpenChange:E,children:ae}),e[85]=E,e[86]=s,e[87]=ae,e[88]=me):me=e[88],me}function dd(t){const e=le.c(35),{orgSlug:s,virtualMcpId:n,branch:o,previewUrl:c,meta:u,decofile:i,blockKey:a}=t,l=Se();let g;e[0]!==o||e[1]!==s||e[2]!==n?(g={orgSlug:s,virtualMcpId:n,branch:o},e[0]=o,e[1]=s,e[2]=n,e[3]=g):g=e[3];const f=ll(g,i);let p;e[4]!==a||e[5]!==i?(p=Wi(i,a),e[4]=a,e[5]=i,e[6]=p):p=e[6];const{resolveType:m,props:v,title:y}=p;if(!m){let N;e[7]!==l?(N=l("sandbox.preview.loaderNoLongerExists"),e[7]=l,e[8]=N):N=e[8];let k;return e[9]!==N?(k=r.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-sm text-muted-foreground",children:N}),e[9]=N,e[10]=k):k=e[10],k}const h=`loader:${a}`,x=`loader:${a}`;let C;e[11]!==a||e[12]!==m||e[13]!==y?(C={mode:"saved",blockKey:a,resolveType:m,title:y},e[11]=a,e[12]=m,e[13]=y,e[14]=C):C=e[14];let b;e[15]!==o||e[16]!==i||e[17]!==u||e[18]!==s||e[19]!==c||e[20]!==v||e[21]!==f.isPending||e[22]!==f.save||e[23]!==x||e[24]!==C||e[25]!==n?(b=r.jsx(qi,{orgSlug:s,virtualMcpId:n,branch:o,previewUrl:c,meta:u,decofile:i,kind:"loaders",target:C,initialValue:v,isCreating:f.isPending,onCreate:ud,onSaveReferencedBlock:f.save,showRun:!1},x),e[15]=o,e[16]=i,e[17]=u,e[18]=s,e[19]=c,e[20]=v,e[21]=f.isPending,e[22]=f.save,e[23]=x,e[24]=C,e[25]=n,e[26]=b):b=e[26];let w;return e[27]!==a||e[28]!==o||e[29]!==i||e[30]!==s||e[31]!==h||e[32]!==b||e[33]!==n?(w=r.jsx(cl,{listing:i,orgSlug:s,virtualMcpId:n,branch:o,blockKey:a,present:void 0,children:b},h),e[27]=a,e[28]=o,e[29]=i,e[30]=s,e[31]=h,e[32]=b,e[33]=n,e[34]=w):w=e[34],w}async function ud(){}function fd(t){if(t instanceof Error&&"status"in t&&typeof t.status=="number")return t.status}function Kr(t){return{status:t.status,hasData:t.data!==void 0,errorStatus:fd(t.error)}}function pd(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 md(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=pd(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(o=>o.status==="error"&&!o.hasData&&o.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 hd=R.lazy(()=>Co(()=>import("./sections-editor-bf1W6507.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,162])).then(t=>({default:t.SectionsEditor})));function Hr(t){const e=le.c(62),{virtualMcpId:s,externalSelection:n,onSectionPicked:o,onViewJsonFile:c}=t,u=n===void 0?null:n,{org:i}=gs(),{currentBranch:a,taskId:l}=lt(),g=mn(),f=bt(),p=va(),m=g.lifecycle.phase==="running",v=f.previewUrl;let y;e[0]!==a||e[1]!==i||e[2]!==v||e[3]!==l||e[4]!==s?(y=a?{orgSlug:i.slug,virtualMcpId:s,branch:a,threadId:l??null,previewUrl:v}:null,e[0]=a,e[1]=i,e[2]=v,e[3]=l,e[4]=s,e[5]=y):y=e[5];const h=y,x=Kt(s,a);let C;e[6]!==m?(C={fetchEnabled:m},e[6]=m,e[7]=C):C=e[7];const b=vs(h,C),w=oa(h);let N;e[8]!==m?(N={fetchEnabled:m},e[8]=m,e[9]=N):N=e[9];const k=ma(h,N),S=md({lifecyclePhase:g.lifecycle.phase,decofile:Kr(b),meta:Kr(k),hasEditableContent:Ti(b.data,k.data),fastPreviewActive:aa(s).runtime==="cms"||tt(x)}),E=rn()===void 0,T=gd;if(Ri(x)){let j;return e[10]===Symbol.for("react.memo_cache_sentinel")?(j=T(r.jsx(Ai,{})),e[10]=j):j=e[10],j}if(x.kind==="pending"&&x.retrying){let j;return e[11]!==x?(j=T(r.jsx(Oi,{backend:x})),e[11]=x,e[12]=j):j=e[12],j}if(S.kind==="loading"||E){let j;return e[13]===Symbol.for("react.memo_cache_sentinel")?(j=T(r.jsx(To,{})),e[13]=j):j=e[13],j}if(b.data&&ci(k.data)){const j=p.state.target,O=j?.kind==="page"||j?.kind==="section"?j.key:null,D=x.kind==="legacy"?O??"":`${w}:${O??""}`,K=a??"";let Z;return e[14]!==b.data||e[15]!==O||e[16]!==i.slug||e[17]!==D||e[18]!==K||e[19]!==s?(Z=T(r.jsx(Gi,{orgSlug:i.slug,virtualMcpId:s,branch:K,decofile:b.data,initialKey:O,compact:!0},D)),e[14]=b.data,e[15]=O,e[16]=i.slug,e[17]=D,e[18]=K,e[19]=s,e[20]=Z):Z=e[20],Z}if(S.kind==="empty"){let j;return e[21]===Symbol.for("react.memo_cache_sentinel")?(j=T(r.jsx(_i,{})),e[21]=j):j=e[21],j}if(S.kind==="error"){let j;e[22]!==b||e[23]!==f||e[24]!==k||e[25]!==S.source?(j=()=>{if(S.source==="sandbox"){f.retry();return}Promise.all([b.refetch(),k.refetch()])},e[22]=b,e[23]=f,e[24]=k,e[25]=S.source,e[26]=j):j=e[26];const O=j;let D;return e[27]!==O||e[28]!==S.source?(D=T(r.jsx(Li,{source:S.source,onRetry:O})),e[27]=O,e[28]=S.source,e[29]=D):D=e[29],D}let B;e[30]===Symbol.for("react.memo_cache_sentinel")?(B=j=>T(r.jsx("div",{className:"h-full min-h-0",children:j})),e[30]=B):B=e[30];const A=B,L=p.state.target;if(L?.kind==="loader"&&b.data&&k.data){const j=x.kind==="legacy"?void 0:w,O=a??"",D=v??null;let K;return e[31]!==b.data||e[32]!==k.data||e[33]!==i.slug||e[34]!==j||e[35]!==O||e[36]!==D||e[37]!==L.key||e[38]!==s?(K=A(r.jsx(dd,{orgSlug:i.slug,virtualMcpId:s,branch:O,previewUrl:D,meta:k.data,decofile:b.data,blockKey:L.key},j)),e[31]=b.data,e[32]=k.data,e[33]=i.slug,e[34]=j,e[35]=O,e[36]=D,e[37]=L.key,e[38]=s,e[39]=K):K=e[39],K}let $;e[40]!==a||e[41]!==i.slug||e[42]!==L||e[43]!==s?($=L||!a?null:Qr(Xr(i.slug,s,a)),e[40]=a,e[41]=i.slug,e[42]=L,e[43]=s,e[44]=$):$=e[44];const _=$;let F="/",I=null,J=null;L?.kind==="page"?(F=L.path,I=L.key):L?.kind==="section"?J=L.key:_&&(F=_.path,I=_.pageKey);const W=I?`page:${I}`:J?`section:${J}`:`path:${F}`;let Y;e[45]===Symbol.for("react.memo_cache_sentinel")?(Y=r.jsx("div",{className:"h-full flex items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}),e[45]=Y):Y=e[45];const G=x.kind==="legacy"?W:`${w}:${W}`,Q=a??"",H=v??void 0,ee=J?null:u,q=J?void 0:o,U=!!I&&p.state.editSeoPageKey===I;let z;return e[46]!==J||e[47]!==I||e[48]!==F||e[49]!==c||e[50]!==i.slug||e[51]!==H||e[52]!==ee||e[53]!==q||e[54]!==U||e[55]!==G||e[56]!==Q||e[57]!==s||e[58]!==p.consumeEditSeo||e[59]!==p.setFocusedBlock||e[60]!==p.setVariantOverride?(z=A(r.jsx(R.Suspense,{fallback:Y,children:r.jsx(hd,{orgSlug:i.slug,virtualMcpId:s,branch:Q,previewReady:!0,previewUrl:H,currentPath:F,activePageBlockKey:I,activeGlobalBlockKey:J,externalSelection:ee,onSectionPicked:q,initialEditSeo:U,onExitSeo:p.consumeEditSeo,onVariantPreviewOverride:p.setVariantOverride,onFocusedBlockChange:p.setFocusedBlock,onViewJsonFile:c},G)})),e[46]=J,e[47]=I,e[48]=F,e[49]=c,e[50]=i.slug,e[51]=H,e[52]=ee,e[53]=q,e[54]=U,e[55]=G,e[56]=Q,e[57]=s,e[58]=p.consumeEditSeo,e[59]=p.setFocusedBlock,e[60]=p.setVariantOverride,e[61]=z):z=e[61],z}function gd(t){return r.jsx("div",{"data-testid":"blocks-panel",className:"h-full min-h-0 overflow-hidden",children:t})}function vd(t){const e=le.c(51),{virtualMcpId:s,pageKey:n,onClose:o,ref:c}=t,u=Se(),i=rn(),a=i===!0,l=un(s);let g;e[0]!==l||e[1]!==n?(g=ia(l,wa(n)),e[0]=l,e[1]=n,e[2]=g):g=e[2];const f=g,{org:p}=gs(),{currentBranch:m,taskId:v}=lt(),h=bt().previewUrl;let x;e[3]!==m||e[4]!==p.slug||e[5]!==h||e[6]!==v||e[7]!==s?(x=m?{orgSlug:p.slug,virtualMcpId:s,branch:m,threadId:v??null,previewUrl:h}:null,e[3]=m,e[4]=p.slug,e[5]=h,e[6]=v,e[7]=s,e[8]=x):x=e[8];const b=vs(x),w=m??"";let N;e[9]!==p.slug||e[10]!==w||e[11]!==s?(N={orgSlug:p.slug,virtualMcpId:s,branch:w},e[9]=p.slug,e[10]=w,e[11]=s,e[12]=N):N=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:E,hold:T}=ga(N,k),B=m??"";let A;e[14]!==p.slug||e[15]!==B||e[16]!==s?(A=ba({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=ya(A);let $;e[18]!==n||e[19]!==L?($=L(n),e[18]=n,e[19]=L,e[20]=$):$=e[20];const _=$;let F;e[21]!==_||e[22]!==n?(F={pageKey:n,copyEpoch:_},e[21]=_,e[22]=n,e[23]=F):F=e[23];const[I,J]=R.useState(F);(I.pageKey!==n||I.copyEpoch!==_)&&(J({pageKey:n,copyEpoch:_}),T(n));const W=b.data?.[n],Y=b.data===void 0&&b.isLoading||i===void 0,G=b.data!==void 0&&W===void 0,Q=!m||G||Y;let H;e[24]!==W?(H=W===void 0?"":JSON.stringify(W,null,2),e[24]=W,e[25]=H):H=e[25];const ee=H;let q;e[26]!==n||e[27]!==Q||e[28]!==S?(q=K=>{if(Q)return;let Z;try{Z=JSON.parse(K)}catch{return}Z===null||typeof Z!="object"||Array.isArray(Z)||S(n,Z)},e[26]=n,e[27]=Q,e[28]=S,e[29]=q):q=e[29];const U=q;let z;e[30]!==E?(z=()=>({flush:E}),e[30]=E,e[31]=z):z=e[31],R.useImperativeHandle(c,z);let j;e[32]!==f||e[33]!==a||e[34]!==o||e[35]!==u?(j=a?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:u("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(_e,{variant:"ghost",size:"icon-sm",onClick:o,"aria-label":u("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Gr,{size:14})})]}),e[32]=f,e[33]=a,e[34]=o,e[35]=u,e[36]=j):j=e[36];let O;e[37]!==_||e[38]!==b.data||e[39]!==E||e[40]!==ee||e[41]!==Y||e[42]!==G||e[43]!==n||e[44]!==Q||e[45]!==U||e[46]!==u?(O=Y?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}):G?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",u("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(xa,{code:ee,language:"json",readOnly:Q,height:"100%",onChange:K=>U(K??""),onSave:K=>{U(K),E()}},`${n}:${b.data===void 0?"loading":"ready"}:${_}`)}),e[37]=_,e[38]=b.data,e[39]=E,e[40]=ee,e[41]=Y,e[42]=G,e[43]=n,e[44]=Q,e[45]=U,e[46]=u,e[47]=O):O=e[47];let D;return e[48]!==j||e[49]!==O?(D=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[j,O]}),e[48]=j,e[49]=O,e[50]=D):D=e[50],D}function Vr(t){const e=le.c(3),{currentBranch:s}=lt(),n=Kt(t.virtualMcpId,s);let o;return e[0]!==n.kind||e[1]!==t?(o=n.kind==="legacy"?r.jsx(vd,{...t}):r.jsx(xd,{...t}),e[0]=n.kind,e[1]=t,e[2]=o):o=e[2],o}function xd(t){const e=le.c(61),{virtualMcpId:s,pageKey:n,onClose:o,ref:c}=t,u=Se(),i=rn(),a=i===!0,l=un(s);let g;e[0]!==l||e[1]!==n?(g=ia(l,wa(n)),e[0]=l,e[1]=n,e[2]=g):g=e[2];const f=g,{org:p}=gs(),{currentBranch:m,taskId:v}=lt(),h=bt().previewUrl;let x;e[3]!==m||e[4]!==p.slug||e[5]!==h||e[6]!==v||e[7]!==s?(x=m?{orgSlug:p.slug,virtualMcpId:s,branch:m,threadId:v??null,previewUrl:h}:null,e[3]=m,e[4]=p.slug,e[5]=h,e[6]=v,e[7]=s,e[8]=x):x=e[8];const C=x,b=vs(C);let w;e[9]!==n?(w=[n],e[9]=n,e[10]=w):w=e[10];let N;e[11]!==b.data?(N={listing:b.data},e[11]=b.data,e[12]=N):N=e[12];const k=la(C,w,N),S=m??"";let E;e[13]!==p.slug||e[14]!==S||e[15]!==s?(E={orgSlug:p.slug,virtualMcpId:s,branch:S},e[13]=p.slug,e[14]=S,e[15]=s,e[16]=E):E=e[16];let T;e[17]===Symbol.for("react.memo_cache_sentinel")?(T={holdsCopy:!0},e[17]=T):T=e[17];const{save:B,flush:A,hold:L}=ga(E,T),$=m??"";let _;e[18]!==p.slug||e[19]!==$||e[20]!==s?(_=ba({orgSlug:p.slug,virtualMcpId:s,branch:$}),e[18]=p.slug,e[19]=$,e[20]=s,e[21]=_):_=e[21];const F=ya(_);let I;e[22]!==n||e[23]!==F?(I=F(n),e[22]=n,e[23]=F,e[24]=I):I=e[24];const J=I,W=b.data?.[n];let Y;e[25]!==k.ready||e[26]!==b.data||e[27]!==W?(Y=k.ready&&b.data!==void 0&&(W===void 0||gr(W)),e[25]=k.ready,e[26]=b.data,e[27]=W,e[28]=Y):Y=e[28];const G=Y;let Q;e[29]!==J||e[30]!==n?(Q={pageKey:n,copyEpoch:J,opened:!1,code:""},e[29]=J,e[30]=n,e[31]=Q):Q=e[31];const[H,ee]=R.useState(Q);if(G&&(H.pageKey!==n||H.copyEpoch!==J||!H.opened)){let X;e[32]!==W?(X=W===void 0?"":JSON.stringify(W,null,2),e[32]=W,e[33]=X):X=e[33],ee({pageKey:n,copyEpoch:J,opened:!0,code:X}),gr(W)&&L(n)}const q=H.pageKey===n&&H.opened,U=i===void 0||!q&&!G,z=G&&W===void 0,j=!m||z||U;let O;e[34]!==n||e[35]!==j||e[36]!==B?(O=X=>{if(j)return;ee(ae=>({...ae,code:X}));let se;try{se=JSON.parse(X)}catch{return}se===null||typeof se!="object"||Array.isArray(se)||B(n,se)},e[34]=n,e[35]=j,e[36]=B,e[37]=O):O=e[37];const D=O;let K;e[38]!==A?(K=()=>({flush:A}),e[38]=A,e[39]=K):K=e[39],R.useImperativeHandle(c,K);let Z;e[40]!==f||e[41]!==a||e[42]!==o||e[43]!==u?(Z=a?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:u("sectionsEditor.pageJsonDialog.titleShort")}),r.jsx(_e,{variant:"ghost",size:"icon-sm",onClick:o,"aria-label":u("sectionsEditor.pageJsonDialog.close"),className:"shrink-0",children:r.jsx(Gr,{size:14})})]}),e[40]=f,e[41]=a,e[42]=o,e[43]=u,e[44]=Z):Z=e[44];let te;e[45]!==k.failed||e[46]!==k.retry||e[47]!==A||e[48]!==H.code||e[49]!==H.copyEpoch||e[50]!==H.pageKey||e[51]!==U||e[52]!==z||e[53]!==j||e[54]!==D||e[55]!==q||e[56]!==u?(te=!q&&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:u("sectionsEditor.hosted.blockLoadFailed")}),r.jsx(_e,{variant:"outline",size:"sm",onClick:k.retry,children:u("sectionsEditor.namedRules.tryAgain")})]}):U?r.jsx("div",{className:"flex flex-1 items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}):z?r.jsxs("div",{className:"p-4 text-xs font-mono text-foreground/60",children:["// ",u("sectionsEditor.pageJsonDialog.pageNotFound")]}):r.jsx("div",{className:"min-h-0 flex-1",children:r.jsx(xa,{code:H.code,language:"json",readOnly:j,height:"100%",onChange:X=>D(X??""),onSave:X=>{D(X),A()}},`${H.pageKey}:${H.copyEpoch}`)}),e[45]=k.failed,e[46]=k.retry,e[47]=A,e[48]=H.code,e[49]=H.copyEpoch,e[50]=H.pageKey,e[51]=U,e[52]=z,e[53]=j,e[54]=D,e[55]=q,e[56]=u,e[57]=te):te=e[57];let M;return e[58]!==Z||e[59]!==te?(M=r.jsxs("div",{className:"flex h-full min-h-0 flex-col overflow-hidden bg-background",children:[Z,te]}),e[58]=Z,e[59]=te,e[60]=M):M=e[60],M}function Aa(t){return t.contentEditingEnabled&&!t.isMobile}function bd(t,e){return t!=="visual"?"visual":e?"blocks":"preview"}function yd(t,e){return t==="blocks"?"preview":e?"blocks":t}function wd(t){return Aa({contentEditingEnabled:ka(t.cmsMode),isMobile:t.isMobile})?"blocks":"preview"}function kd(t){return t.editingMode==="blocks"&&!t.blocksEditingEnabled||t.editingMode==="visual"&&!t.sandboxDisplay?"preview":t.editingMode}function Sd(t){const e=di(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 o=ui(n,e);return{value:e,frame:o?Js(o,t.device):null,newTab:o}}function Pd(t){const e=le.c(94),{tests:s,load:n,onOpen:o,options:c,onChange:u,available:i}=t,a=Se();let l;e[0]!==c?(l=ca(c),e[0]=c,e[1]=l):l=e[1];const g=l;let f;e[2]!==c.tests?(f=c.tests??{},e[2]=c.tests,e[3]=f):f=e[3];const p=f;let m;e[4]!==u||e[5]!==c?(m=M=>{const X=M?vl(M):null,{at:se,...ae}=c;u(X?{...ae,at:X}:ae)},e[4]=u,e[5]=c,e[6]=m):m=e[6];const v=m;let y;e[7]!==p||e[8]!==u||e[9]!==c?(y=(M,X)=>{const se={...p};X==="on"?se[M]=!0:X==="off"?se[M]=!1:delete se[M];const{tests:ae,...me}=c;u(Object.keys(se).length>0?{...me,tests:se}:me)},e[7]=p,e[8]=u,e[9]=c,e[10]=y):y=e[10];const h=y;let x;e[11]!==o?(x=M=>{M&&o?.()},e[11]=o,e[12]=x):x=e[12];let C;e[13]!==a?(C=a("sandbox.previewAs.label"),e[13]=a,e[14]=C):C=e[14];let b;e[15]===Symbol.for("react.memo_cache_sentinel")?(b=r.jsx(pl,{size:16}),e[15]=b):b=e[15];let w;e[16]!==g||e[17]!==C?(w=r.jsx(nt,{asChild:!0,children:r.jsx(sa,{asChild:!0,children:r.jsx(st,{"aria-label":C,active:g,"data-testid":"preview-as-trigger",children:b})})}),e[16]=g,e[17]=C,e[18]=w):w=e[18];let N;e[19]!==a?(N=a("sandbox.previewAs.label"),e[19]=a,e[20]=N):N=e[20];let k;e[21]!==N?(k=r.jsx(rt,{children:N}),e[21]=N,e[22]=k):k=e[22];let S;e[23]!==k||e[24]!==w?(S=r.jsxs(at,{children:[w,k]}),e[23]=k,e[24]=w,e[25]=S):S=e[25];let E;e[26]!==a?(E=a("sandbox.previewAs.label"),e[26]=a,e[27]=E):E=e[27];let T;e[28]!==E?(T=r.jsx("h3",{className:"text-sm font-medium",children:E}),e[28]=E,e[29]=T):T=e[29];let B;e[30]!==i||e[31]!==a?(B=a(i?"sandbox.previewAs.intro":"sandbox.previewAs.unavailable"),e[30]=i,e[31]=a,e[32]=B):B=e[32];let A;e[33]!==B?(A=r.jsx("p",{className:"text-xs text-muted-foreground",children:B}),e[33]=B,e[34]=A):A=e[34];let L;e[35]!==T||e[36]!==A?(L=r.jsxs("div",{className:"flex flex-col gap-1",children:[T,A]}),e[35]=T,e[36]=A,e[37]=L):L=e[37];let $;e[38]!==a?($=a("sandbox.previewAs.momentLabel"),e[38]=a,e[39]=$):$=e[39];let _;e[40]!==$?(_=r.jsx(ml,{htmlFor:"preview-as-moment",children:$}),e[40]=$,e[41]=_):_=e[41];let F;e[42]!==c.at?(F=gl(c.at),e[42]=c.at,e[43]=F):F=e[43];let I;e[44]!==v?(I=M=>v(M.target.value),e[44]=v,e[45]=I):I=e[45];let J;e[46]!==F||e[47]!==I?(J=r.jsx(Hs,{id:"preview-as-moment",type:"datetime-local",className:xl,value:F,onChange:I}),e[46]=F,e[47]=I,e[48]=J):J=e[48];const W=c.at===void 0;let Y;e[49]!==v?(Y=()=>v(""),e[49]=v,e[50]=Y):Y=e[50];let G;e[51]!==a?(G=a("sandbox.previewAs.now"),e[51]=a,e[52]=G):G=e[52];let Q;e[53]!==W||e[54]!==Y||e[55]!==G?(Q=r.jsx(_e,{type:"button",variant:"ghost",size:"sm",disabled:W,onClick:Y,children:G}),e[53]=W,e[54]=Y,e[55]=G,e[56]=Q):Q=e[56];let H;e[57]!==J||e[58]!==Q?(H=r.jsxs("div",{className:"flex items-center gap-2",children:[J,Q]}),e[57]=J,e[58]=Q,e[59]=H):H=e[59];let ee;e[60]!==a?(ee=a("sandbox.previewAs.momentHint"),e[60]=a,e[61]=ee):ee=e[61];let q;e[62]!==ee?(q=r.jsx("p",{className:"text-xs text-muted-foreground",children:ee}),e[62]=ee,e[63]=q):q=e[63];let U;e[64]!==_||e[65]!==H||e[66]!==q?(U=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[_,H,q]}),e[64]=_,e[65]=H,e[66]=q,e[67]=U):U=e[67];let z;e[68]!==a?(z=a("sandbox.previewAs.testsLabel"),e[68]=a,e[69]=z):z=e[69];let j;e[70]!==z?(j=r.jsx("span",{className:"text-sm font-medium",children:z}),e[70]=z,e[71]=j):j=e[71];let O;e[72]!==p||e[73]!==n||e[74]!==h||e[75]!==a||e[76]!==s?(O=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:a("sandbox.previewAs.testsLoadFailed")}),r.jsx(_e,{type:"button",variant:"outline",size:"sm",onClick:n.retry,children:a("sandbox.previewAs.tryAgain")})]}):r.jsx("div",{className:"flex justify-center py-2","data-testid":"preview-as-tests-loading",children:r.jsx(it,{className:"size-4 text-muted-foreground"})}):s.length===0?r.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.noTests")}):r.jsxs(r.Fragment,{children:[r.jsx("ul",{className:"flex flex-col gap-1.5",children:s.map(M=>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:M}),r.jsxs(hl,{type:"single",variant:"outline",size:"sm",value:p[M]===void 0?"":p[M]?"on":"off",onValueChange:X=>h(M,X),"aria-label":M,children:[r.jsx(Ar,{value:"off",children:a("sandbox.previewAs.off")}),r.jsx(Ar,{value:"on",children:a("sandbox.previewAs.on")})]})]},M))}),r.jsx("p",{className:"text-xs text-muted-foreground",children:a("sandbox.previewAs.testsHint")})]}),e[72]=p,e[73]=n,e[74]=h,e[75]=a,e[76]=s,e[77]=O):O=e[77];let D;e[78]!==j||e[79]!==O?(D=r.jsxs("div",{className:"flex flex-col gap-1.5",children:[j,O]}),e[78]=j,e[79]=O,e[80]=D):D=e[80];let K;e[81]!==g||e[82]!==u||e[83]!==a?(K=g&&r.jsx(_e,{type:"button",variant:"outline",size:"sm",onClick:()=>u({}),children:a("sandbox.previewAs.reset")}),e[81]=g,e[82]=u,e[83]=a,e[84]=K):K=e[84];let Z;e[85]!==L||e[86]!==U||e[87]!==D||e[88]!==K?(Z=r.jsxs(na,{className:"flex w-80 flex-col gap-4 p-4",align:"center",sideOffset:8,"data-testid":"preview-as",children:[L,U,D,K]}),e[85]=L,e[86]=U,e[87]=D,e[88]=K,e[89]=Z):Z=e[89];let te;return e[90]!==S||e[91]!==Z||e[92]!==x?(te=r.jsxs(ra,{onOpenChange:x,children:[S,Z]}),e[90]=S,e[91]=Z,e[92]=x,e[93]=te):te=e[93],te}const jd=["next"],Ed=["@tanstack/react-router","@tanstack/react-start","@tanstack/solid-router","@tanstack/solid-start"],Oa=new Set(["tsx","ts","jsx","js","mdx"]),Nd=new Set(["tsx","jsx"]),Cd=new Set(["404","500"]);function Td(t){const e=new Set;if(!t||typeof t!="object")return e;const s=t;for(const n of["dependencies","devDependencies"]){const o=s[n];if(o&&typeof o=="object"&&!Array.isArray(o))for(const c of Object.keys(o))e.add(c)}return e}function Rd(t){const e=Td(t);return jd.some(s=>e.has(s))?"next":Ed.some(s=>e.has(s))?"tanstack":null}function _a(t,e){const s=(t??"").trim().replace(/^[/\\]+|[/\\]+$/g,"");return s?`${s}/${e}`:e}function Ld(t,e){const s=n=>_a(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 vn(t){const e=t.lastIndexOf(".");return e<=0?null:[t.slice(0,e),t.slice(e+1)]}function Ad(t){const e=vn(t.at(-1)??"");if(!e||!Oa.has(e[1]))return null;const[s]=e;if(s.includes("."))return null;const n=[...t.slice(0,-1),s];return n[0]==="api"||n.length===1&&Cd.has(s)||n.some(o=>o.startsWith("_")||o.includes("["))?null:(n.at(-1)==="index"&&n.pop(),`/${n.join("/")}`)}function Od(t){const e=vn(t.at(-1)??"");if(!e||e[0]!=="page"||!Oa.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 _d(t){const e=[];let s="",n=!1;for(const o of t)o==="["?n=!0:o==="]"&&(n=!1),o==="."&&!n?(e.push(s),s=""):s+=o;return e.push(s),e}function $d(t){const e=vn(t.at(-1)??"");if(!e||!Nd.has(e[1]))return null;const s=[...t.slice(0,-1),..._d(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 o=[];for(const c of s){if(c.includes("$"))return null;if(c.startsWith("_")||c.startsWith("(")&&c.endsWith(")"))continue;const u=c.replace(/_$/,"").replace(/[[\]]/g,"");u&&o.push(u)}return`/${o.join("/")}`}function Fd(t,e){const s=e.split("/").filter(Boolean);if(s.length===0)return null;switch(t){case"next-pages":return Ad(s);case"next-app":return Od(s);case"tanstack":return $d(s);default:{const n=t;throw new Error(`Unknown router: ${String(n)}`)}}}function Dd(t){const e=new Set;for(const{root:s,files:n}of t){const o=`${s.dir}/`;for(const c of n){if(!c.startsWith(o))continue;const u=Fd(s.router,c.slice(o.length));u&&e.add(u)}}return[...e].sort((s,n)=>s==="/"?-1:n==="/"?1:s.localeCompare(n))}const Bd=5e3,Md=6e4;async function zd(t,e){const s=await fetch(bl(t,"glob"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({pattern:e.pattern,path:e.dir,limit:Bd})});if(!s.ok)throw new Error(`Failed to list ${e.dir}: ${s.status}`);const n=await s.json();return Array.isArray(n.files)?n.files.filter(o=>typeof o=="string"):[]}async function Id(t,e){const s=await fi(t,_a(e,"package.json"));if(s.kind==="unavailable")throw new Error("package.json unavailable: sandbox not ready");const n=s.kind==="data"?Rd(s.data):null;if(!n)return[];const o=Ld(n,e),c=await Promise.all(o.map(async u=>({root:u,files:await zd(t,u)})));return Dd(c)}function Ud(t,e,s){const n=le.c(12);let o;n[0]!==e||n[1]!==t?(o=t?tn.frameworkRoutes(t.orgSlug,t.virtualMcpId,t.branch,t.threadId,e):["framework-routes","none"],n[0]=e,n[1]=t,n[2]=o):o=n[2];let c;n[3]!==e||n[4]!==t?(c=()=>t?Id(t,e):[],n[3]=e,n[4]=t,n[5]=c):c=n[5];const u=s&&!!t;let i;n[6]!==o||n[7]!==c||n[8]!==u?(i={queryKey:o,queryFn:c,enabled:u,staleTime:Md},n[6]=o,n[7]=c,n[8]=u,n[9]=i):i=n[9];const a=Jr(i);let l;return n[10]!==a.data?(l=a.data??[],n[10]=a.data,n[11]=l):l=n[11],l}const Kd=500,Hd={mobile:{width:412,height:823},tablet:{width:1024,height:1366},desktop:{width:1280,height:800}},Wr=1,fs=["desktop","mobile","tablet"],Vd=["preview","visual","blocks"],Wd={mobile:"sandbox.preview.deviceMobile",tablet:"sandbox.preview.deviceTablet",desktop:"sandbox.preview.deviceDesktop"};function qd(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 Ut(t){if(!t)return null;try{return new URL(t,window.location.href).origin}catch{return null}}function Ks(t,e){try{return new URL(t,e).href}catch{return null}}function Gd(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 Jd(t,e){return!t||t.nav!==e.nav?!1:t.content!==e.content}function Yd(t,e,s){const n=t.toLowerCase(),o=e.toLowerCase(),c=o.split("/").filter(Boolean),u=a=>{if(a===s)return 100;const l=a.indexOf(s);if(l===-1)return 0;let g=40;return l===0?g+=30:/[\s/-]/.test(a[l-1]??"")&&(g+=20),g+=Math.round(s.length/a.length*20),g};let i=Math.max(u(n),u(o));return c.at(-1)===s?i=Math.max(i,95):c.includes(s)&&(i=Math.max(i,90)),i}function Qd(t,e){try{t.contentWindow?.location.reload()}catch{e&&(t.src=e)}}function Xd({virtualMcpId:t}){const e=Se(),s=fa(),{currentBranch:n,taskId:o,virtualMcpId:c}=lt(),u=!!$o(),i=va(),a=Go(c===t?t:null),l=aa(t),g=yl(a?.metadata?.ui?.layout??null),f=ka(g),p=Aa({contentEditingEnabled:f,isMobile:s}),[m]=R.useState(()=>wd({cmsMode:g,isMobile:s})),[v,y]=Vs(Ws.previewEditingMode(t),d=>d&&Vd.includes(d)?d:null),h=v??m,[x,C]=Vs(Ws.previewDeviceSize(t),d=>d&&fs.includes(d)?d:"desktop"),[b,w]=R.useState(null),[N,k]=R.useState(null),S=R.useRef(null),E=R.useRef(null),[T,B]=R.useState(!1),A=R.useRef(null),L=()=>{A.current?.flush(),B(!1)},$=()=>B(d=>(d&&A.current?.flush(),!d)),[_,F]=R.useState({width:0,height:0}),[I,J]=R.useState(!1),[W,Y]=R.useState({}),[G,Q]=R.useState(""),H=R.useRef(null),[ee,q]=R.useState(!1),[U,z]=R.useState(),[j,O]=R.useState(null),[D,K]=R.useState(null),[Z,te]=R.useState(null),[M,X]=R.useState(()=>i.state.target?.kind==="page"?i.state.target.path:"/"),[se,ae]=R.useState(()=>i.state.target?.kind==="page"?i.state.target.key:null),[me,pe]=R.useState({}),[be,ge]=R.useState(!1),ve=R.useRef(null),Pe=()=>{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:de}=gs(),Le=mn(),Ie=bt(),Ue=Ie.vmEntry,Me=Le.lifecycle.phase,{url:yt}=da(t),he=Kt(t,n),{connection:$e}=ua(t),xe=dl(t),Ke=pi({hasServeConnection:!!$e,runtime:l.runtime}),Ae=!tt(he)&&he.kind!=="pending",re=Ve(he)??yt,ue=re??Ie.previewUrl,Ge=!!re||Me==="running",wt=a?.id===t?si(a.metadata):null,Je=!re&&a?.id===t&&l.runtime==="cms",Ht=l.projectDefault==="cms",kt=Ae?mi({sandboxUrl:ue,previewServerUrl:wt,fastPreviewActive:Je}):null,xn=t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n,threadId:o??null,previewUrl:ue}:null,bn=vs(xn,{fetchEnabled:Ge}),xs=ma(xn,{fetchEnabled:Ge}),ce=bn.data,we=xs.data,Ye=ce?$i(ce,we).sort((d,P)=>d.name.localeCompare(P.name)):[],Vt=t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n}:null,yn=ld(Vt),$a=hi(Vt),bs=ce&&we?Fi(ce,we):[],wn=Ae&&ce&&we?Ji(we,ce,"loaders"):[],Fa=G?(()=>{const d=G.toLowerCase();return Ye.map(P=>({page:P,score:Yd(P.name,P.path,d)})).filter(({score:P})=>P>0).sort((P,V)=>V.score-P.score||P.page.path.length-V.page.path.length).map(({page:P})=>P)})():Ye,Da=bs.filter(d=>{if(!G)return!0;const P=G.toLowerCase();return d.name.toLowerCase().includes(P)||d.key.toLowerCase().includes(P)||d.resolveType.toLowerCase().includes(P)}),kn=p?wn:[],Sn=kn.filter(d=>{if(!G)return!0;const P=G.toLowerCase();return d.title.toLowerCase().includes(P)||d.key.toLowerCase().includes(P)||d.resolveType.toLowerCase().includes(P)}),Wt=D?wn.find(d=>d.key===D)??null:null,Ne=fn,ys=j||D?null:Di(Ye,M,se),ie=ys?.key??null,ct=i.state.target?.kind==="section"?i.state.target.key:i.state.focusedBlockKey??ie,qt=ys?.path??null,ws={};if(Ae&&Ge&&ue&&we&&ce){const d=Yi(we,"loaders"),P=ie?ce[ie]:void 0,V=Sc(P,ce,Ee=>d.has(Ee)),oe=xc(V);for(const Ee of xt(M)){if(Ee.type!=="param")continue;const Ce=hc(M,Ee.name,V),mt=wc(Ce,d,oe);mt.length>0&&(ws[Ee.name]=mt)}}const Pn=d=>ce?Xc(ce,d,we):[],ks=ie?Pn(M):[],Qe=(ie?me[ie]:void 0)??ks[0]?.values??{},Te=Be(M,Qe),St=t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n,threadId:o??null}:null,jn=ce&&ie?Xi(ce,ie,0):[],En=tt(he),Nn=ce?Qi(jn,ce,En):[],Pt=Nn.map(d=>d.isSavedBlock?d.label:""),jt=Nn.map(d=>d.isSavedBlock?"global":d.isMultivariate?"variant":"normal"),Et=jn.map(d=>Ys(d,ce??{},En)),dt=R.useRef(null),Fe=R.useRef(null),Ba=Le.status.state==="paused",Ss=Le.phase,Cn=rl({claimPhase:Ss,lifecycle:Le.lifecycle}),Xe=Ie.previewState,Ma=Ie.userStopped,za=gi(de.slug,t??""),{url:He}=Ki(Je&&t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n,previewServerUrl:wt??null,path:Te}:null),Ia=Ht&&l.runtime==="sandbox",Oe=vi(he,Ke,xe),Tn=xi(Oe&&Je&&he.kind==="protocol"&&t&&n?{orgSlug:de.slug,virtualMcpId:t,branch:n}:null),Rn=Oe?Tn.pointer:null,ne=Jl({previewState:Xe,progressStatus:Cn.status,previewServerUrl:wt,fastPreviewActive:Je,fastPreviewReady:!!He,codingSession:Ia,localPreviewUrl:re,hostedDraft:Oe,hostedPointerPending:Oe&&(he.kind==="pending"||Tn.pending)}),Ln=ne.showWakingPill||Oe&&ne.mode==="production"&&!Rn,Nt=ne.mode!=="none",Ua=ne.mode==="production"&&ne.iframeBase?Ut(ne.iframeBase):null,ut=ne.mode==="production"?Ua:Ut(ue),Ka=a?.id===t&&a.metadata?.fastPreviewInPlace===!0,Ct=Ae?re?ne.mode==="sandbox"&&p&&h==="blocks":ne.mode==="production"&&Je&&Ka&&p&&h==="blocks":!1,An=R.useRef(null),{pin:Ha,effective:Va}=Gd(An.current,{inPlaceRenderActive:Ct,draftPreviewUrl:He,resolvedPath:Te});An.current=Ha;const On=i.state.variantOverride??[],Gt=Ae?On:[],Tt=Ae?[]:On,Jt=tt(he)&&Bi.some(d=>Mi(we,d)==="available"),ft=Jt?W:{},_n=ca(ft),Wa=Jt&&ce?Object.keys(zi(ce).experiments):[],[$n,qa]=R.useState(!1),Fn=la(Vt,Jt&&$n?Ii:[]),Ga={...Fn,ready:!(he.kind==="protocol"&&he.hosted)||$n&&Fn.ready},Ze=t?br(de.slug,t):null,Ja=bi(Ze),Yt=Oe?Sd({display:ne,path:Te,pointer:Rn,heldRevision:Ja,device:x,forcedVariants:Tt,previewOptions:ft}):null,Dn=JSON.stringify([Tt,ft]);R.useEffect(()=>{if(!Oe||!Ze)return;const[d,P]=JSON.parse(Dn);yr(Ze,{forcedVariants:d,previewOptions:P})},[Oe,Ze,Dn]),R.useEffect(()=>{if(!(!Oe||!Ze))return()=>yr(Ze,null)},[Oe,Ze]);const Ps=$e&&Ve(he)?yi($e.endpoint,Tt,_n):null,Ya=$e&&Ve(he)?Ps?wi(Ps,ft):wr:null,et=qd(ne.mode==="sandbox"?os(Js(kr(Z??Ks(Te,ne.iframeBase)??ne.iframeBase,Ya),x),Gt):ne.mode==="production"&&Yt?.frame?Yt.frame:ne.mode==="production"?os(Js(Sr(Pr(kr(Z??Va??Ks(Te,ne.iframeBase)??ne.iframeBase,Ln?wr:null),Tt),ft),x),Gt):null),Bn=He??(ne.iframeBase?Ks(Te,ne.iframeBase):null),Mn=ne.mode==="production"&&Yt?Yt.newTab:ne.mode==="production"?Bn?os(Sr(Pr(Bn,Tt),ft),Gt):null:et??ne.iframeBase,Qa=()=>{const d=Mn;d&&window.open(d,"_blank","noopener")},Rt=t&&n?Xr(de.slug,t,n):null,Lt=d=>{Rt&&Do(Rt,d)},ke=i.state.target;R.useEffect(()=>{if(!(!ke||!kt||!we))if(ke.kind==="page"){const d=me[ke.key]??{};Fe.current=Be(ke.path,d),O(null),K(null),te(null),ae(ke.key),X(ke.path),Lt({path:ke.path,pageKey:ke.key,params:d})}else if(ke.kind==="loader")Fe.current=null,O(null),K(ke.key),te(null);else{const d=bs.find(P=>P.key===ke.key);if(d){Fe.current=null;const P=Nr(we);K(null),O(d),te(jr(kt,P,d.key))}}},[ke,kt,we,me]),R.useEffect(()=>{!ie||qt===null||ke?.kind==="page"&&ke.key===ie&&ke.path===qt||i.selectTarget({kind:"page",key:ie,path:qt})},[ie,qt,ke]);const[zn,Xa]=R.useState(null);if(Xe.kind==="iframe"&&zn!==Xe.previewUrl){const d=zn!==null;Xa(Xe.previewUrl);const P=Rt?Qr(Rt):null;if(P){if(Fe.current=Be(P.path,P.params),X(P.path),ae(P.pageKey),te(null),O(null),K(null),P.pageKey&&Object.keys(P.params).length>0){const V=P.pageKey;pe(oe=>({...oe,[V]:P.params}))}}else d&&(Fe.current=null,X("/"),te(null),ae(null),O(null),K(null))}dt.current=et;const Za=ne.mode==="production"&&!!He&&!re,[Qt,js]=R.useState({src:et??void 0,loading:!1}),[eo,Es]=R.useState(!1),[to,so]=R.useState(),[In,Un]=R.useState(null),je=Qo(In,{base:ne.iframeBase??"",frameSrc:Qt.src,loadedSrc:to,wanted:et??void 0,canSwap:xe&&eo&&!Qt.loading});je!==In&&Un(je);const Xt=Xo(Qt,je?je.src:et??void 0,Za);Xt!==Qt&&js(Xt);const pt=Xt.src,Kn=Xt.loading,Hn=Zo({iframeRef:S,src:ne.mode==="sandbox"?et:null,active:ne.mode==="sandbox"}),Vn=R.useRef(null);R.useEffect(()=>{const d=Kn?setTimeout(()=>js(xr),ei):null,P=()=>{d&&clearTimeout(d)};if(!He||!pt||Vn.current===He)return P;Vn.current=He;const V=S.current;return V&&V.getAttribute("src")!==pt&&(Pe(),V.src=pt),P},[He,pt,Kn]);const Wn=()=>{const d=S.current?.contentWindow,P=ut;if(!d||!P||!ce||!ie)return;const V=ce[ie];if(!V||typeof V!="object")return;const oe=ji({previewBaseUrl:P,pageBlock:V,decofile:ce,path:Te,pathTemplate:M});if(!oe)return;const Ee=os(oe.src,Ni(Gt,ie));d.postMessage({type:"cms-editor::render",src:Ee,body:oe.body},P)},Ns=R.useRef(null);R.useEffect(()=>{if(!Ct||j||D||!ie||!ce){Ns.current=null;return}const d={nav:JSON.stringify({page:ie,path:Te,pathTemplate:M}),content:JSON.stringify(ce)},P=Jd(Ns.current,d);Ns.current=d,P&&Wn()},[ce,Ct,j,D,ie,Te,M]);const Cs=R.useRef(null);R.useEffect(()=>{if(!Ct||j||D||!ie||!ce){Cs.current=null;return}const d=JSON.stringify(i.state.variantOverride??null),P=Cs.current;Cs.current={page:ie,sig:d},!(!P||P.page!==ie||P.sig===d)&&Wn()},[i.state.variantOverride,Ct,j,D,ie]);const qn=!!t&&!!n&&!Le.notFound&&!Ma&&!Ba&&(Ss?.kind==="ready"||Me!=="idle"),Gn=!tt(he),no=un(t??void 0),ro=Ud(St,no,Gn&&qn),ao=new Set(f?Ye.map(d=>Ne(d.path)):[]),At=Gn?ro.filter(d=>!ao.has(Ne(d))):[],Jn=G?At.filter(d=>d.toLowerCase().includes(G.toLowerCase())):At,ye=kd({editingMode:h,sandboxDisplay:ne.mode==="sandbox",blocksEditingEnabled:p});R.useEffect(()=>{const d=ut;if(!d)return;const P=V=>{if(V.origin===d)if(V.data?.type==="visual-editor::element-clicked"){const oe=Zl.safeParse(V.data.payload);oe.success&&w(oe.data)}else if(V.data?.type==="cms-editor::section-clicked"){const oe=sc.safeParse(V.data.payload);oe.success&&k({index:oe.data.sectionIndex,seq:oe.data.clickSeq})}else V.data?.type==="cms-editor::render-start"?Pe():V.data?.type==="cms-editor::render-end"?(fe(),S.current?.contentWindow?.postMessage({type:"cms-editor::set-labels",labels:Pt,kinds:jt,keys:Et},d)):V.data?.type==="cms-editor::render-error"&&fe()};return window.addEventListener("message",P),()=>window.removeEventListener("message",P)},[ut,Pt,jt,Et]);const Yn=()=>{const d=S.current?.contentWindow,P=Ut(ue),V=ad({v8:xe,script:ec});!d||!P||!V||d.postMessage(V,P)},oo=()=>{if(xe)return;const d=S.current?.contentWindow,P=Ut(ue);!d||!P||d.postMessage({type:"visual-editor::deactivate"},P)},Qn=()=>{const d=ze.current;d?.has("wireframe")&&(d.wireframe({type:"wireframe:sections",labels:Pt,kinds:jt,keys:Et}),d.wireframe({type:ye==="blocks"?"wireframe:activate":"wireframe:deactivate"}))},Ts=()=>{if(xe){Qn();return}const d=S.current?.contentWindow,P=ut,V=rd({v8:xe,production:ne.mode==="production",localPreview:!!re,script:nc});!d||!P||!V||(d.postMessage(V,P),d.postMessage({type:"cms-editor::set-labels",labels:Pt,kinds:jt,keys:Et},P))},io=()=>{if(xe){ze.current?.wireframe({type:"wireframe:deactivate"});return}const d=S.current?.contentWindow,P=ut;!d||!P||d.postMessage({type:"cms-editor::deactivate"},P)},Xn=d=>{ze.current?.wireframe({type:"wireframe:scroll-to",sectionIndex:d})},lo=()=>{if(ze.current?.wireframe({type:"wireframe:clear-hover"}),xe)return;const d=S.current?.contentWindow,P=ut;!d||!P||(d.postMessage({type:"cms-editor::clear-hover"},P),d.postMessage({type:"visual-editor::clear-hover"},P))},Zt=d=>{if(d==="blocks"&&!p)return;const P=h;!s&&d!==P&&(d==="blocks"?E.current?.resize("30%"):E.current?.collapse()),y(d),w(null),k(null),d!=="blocks"&&K(null),P==="visual"&&oo(),d==="visual"&&Yn(),P==="blocks"&&d!=="blocks"&&io(),d==="blocks"&&Ts()},co=()=>{Zt(bd(h,p))},uo=()=>{Zt(yd(h,p))},es=()=>{const d=S.current;if(!d)return;Pe();const P=document.activeElement,V=d.tabIndex;d.tabIndex=-1,d.style.pointerEvents="none",d.blur(),Qd(d,dt.current);let oe;const Ee=()=>{clearTimeout(oe),d.tabIndex=V,d.style.pointerEvents="";const Ce=document.activeElement;(!Ce||Ce===document.body||Ce===d)&&P?.focus(),d.removeEventListener("load",Ee)};d.addEventListener("load",Ee),oe=setTimeout(Ee,3e3)};el(es);const ze=R.useRef(null),Zn=R.useEffectEvent(Qn),fo=R.useEffectEvent((d,P)=>{k({index:d,seq:P})}),po=R.useEffectEvent(()=>{fe(),je&&(Rs.current=je.shown),_t&&$s(Ot)}),er=R.useEffectEvent(()=>{if(Es(!1),je&&Un(null),je&&je.src!==dt.current){Pe();return}es()});R.useEffect(()=>{if(!xe)return;const d=new lc({studioOrigin:window.location.origin,build:"4.598.0",frame:()=>S.current?.contentWindow??null,onWireframeReady:()=>Zn(),onWireframe:V=>{V.type==="wireframe:select"&&fo(V.sectionIndex,V.clickSeq)},onModulesChange:()=>Es(d.has("html-swap")),onSwapEnd:()=>po(),onSwapFailed:()=>er()});ze.current=d;const P=V=>{d.handle(V)};return window.addEventListener("message",P),()=>{window.removeEventListener("message",P),d.dispose(),Es(!1),ze.current===d&&(ze.current=null)}},[xe,ne.iframeBase]);const tr=xe?JSON.stringify([Pt,jt,Et,ye]):"";R.useEffect(()=>{tr&&Zn()},[tr]);const sr=R.useRef(null);R.useEffect(()=>{const d=sr.current;if(sr.current=je,je&&je!==d){ze.current?.refresh(je.shown)?Pe():er();return}!je&&d&&d.shown!==d.src&&d.src===dt.current&&es()},[je]);const nr=()=>{ze.current?.refresh()||es()},Ot=br(de.slug,t??""),_t=Oe&&Nt&&!!t,Rs=R.useRef(null);R.useEffect(()=>{if(_t)return ki(Ot)},[_t,Ot]);const{reload:$t}=Si(de.slug,t??""),rr=R.useRef($t.seq);R.useEffect(()=>{if(rr.current!==$t.seq&&(rr.current=$t.seq,!!_t&&Rs.current===dt.current)){if($t.navigates){$s(Ot);return}nr()}},[$t.seq]);const Ls=oa(Vt),Ft=Pi(Ve(he)?Ls:""),ar=R.useRef(Ft);R.useEffect(()=>{const d=ar.current;if(ar.current=Ft,!d||!Ft||d===Ft)return;const P=S.current;if(P)return Xl({iframe:P,reload:nr})},[Ft]);const or=()=>{const d=fs.indexOf(x);C(fs[(d+1)%fs.length])},ts=(d,P)=>ir({...Qe,[d]:P}),ir=d=>{if(!ie)return;const P=ie;Fe.current=Be(M,d),pe(V=>({...V,[P]:d})),Lt({path:M,pageKey:P,params:d})},mo=td({iframeBase:ne.iframeBase,resolvedPath:Te,activeGlobalSectionName:j?.name??null,noServerLabel:e("sandbox.preview.noServerRunning")}),As=d=>{const P=me[d.key]??{},V=Be(d.path,me[d.key]??Pn(d.path)[0]?.values??{});(j||Ne(V)!==Ne(Te))&&Pe(),Fe.current=V,O(null),K(null),te(null),k(null),ae(d.key),X(d.path),Lt({path:d.path,pageKey:d.key,params:P}),i.selectTarget({kind:"page",key:d.key,path:d.path})},lr=d=>{(j||Ne(d)!==Ne(Te))&&Pe(),Fe.current=d,O(null),K(null),te(null),k(null),ae(null),X(d),Lt({path:d,pageKey:null,params:{}})};Fo(Rt,lr);const ho=d=>{if(tt(he)){const oe=ce?Ui(ce,d.key,we):null;oe?As(oe):ms.info(e("sandbox.preview.blockOnNoPage"));return}if(!kt||!we){ms.error(e("sandbox.preview.previewMetadataNotReady"));return}Pe(),Fe.current=null;const P=Nr(we),V=jr(kt,P,d.key);O(d),K(null),te(V),k(null),i.selectTarget({kind:"section",key:d.key})},go=d=>{p&&(O(null),K(d.key),te(null),Zt("blocks"),i.selectTarget({kind:"loader",key:d.key}))},vo=async({name:d,path:P,templateKey:V})=>{if(!t||!n)return;const oe=pa(P);if(oe){z(oe);return}const Ee=P.trim().startsWith("/")?P.trim():`/${P.trim()}`;if(Ye.some(Ce=>Ne(Ce.path)===Ne(Ee))){z(e("sandbox.preview.pageAlreadyExists",{path:Ee}));return}z(void 0);try{const Ce=V?await $a(ce,V):void 0;if(V&&!Ce){z(e("sandbox.preview.templateNoLongerExists"));return}const mt=await yn.mutateAsync({name:d,path:Ee,template:Ce,schema:tt(he)?{meta:we,loadMeta:async()=>(await xs.refetch()).data}:void 0});q(!1),ms.success(e("sandbox.preview.pageCreated",{name:d})),await kl(Kd),As({key:mt.key,name:mt.name,path:mt.path}),Zt("blocks")}catch(Ce){z(Ce instanceof La?e("sandbox.preview.pageSchemaNotReady"):Ce instanceof Error?Ce.message:e("sandbox.preview.failedToCreatePage"))}},Dt=sd({previewSurfaceActive:Nt,daemonReady:qn,production:ne.mode==="production",servePreviewUrl:Ve(he)}),cr=nd({showPreviewToolbar:Dt,contentEditingEnabled:f,hasFrameworkRoutes:At.length>0}),dr=f?Fa:[],ur=f?Da:[],Bt=()=>{J(!1),Q("")},Os=f?j?.name??Wt?.title??ys?.name:void 0,_s=f&&(bn.isPending||xs.isPending),ss=_s?Ut(ne.iframeBase):Os,Mt=j?`section:${j.key}`:D?`loader:${D}`:f&&ie?`page:${ie}`:At.includes(Ne(M))?`route:${Ne(M)}`:void 0,ns=e(Wd[x]),fr=x==="mobile"?r.jsx(Zr,{size:16}):x==="tablet"?r.jsx(Ho,{size:16}):r.jsx(ea,{size:16}),xo=Dt?cr?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(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx("button",{type:"button",onClick:or,"aria-label":ns,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",Er),children:fr})}),r.jsx(rt,{children:ns})]}),r.jsxs(ra,{open:I,onOpenChange:d=>{J(d),d||Q("")},children:[r.jsx(sa,{asChild:!0,children:r.jsx("button",{type:"button","aria-label":e("sandbox.preview.choosePage"),"data-testid":"preview-page-picker",title:_s?ss??void 0:j||Wt?Os:[Os,M].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",Er),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:[j&&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(Uo,{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(Vo,{size:11}),e("sandbox.preview.loaderBadge")]}),ss&&r.jsx("span",{className:"min-w-0 flex-1 truncate font-medium text-foreground",children:ss}),!_s&&!j&&!Wt&&r.jsx("span",{"data-testid":"preview-page-path",className:Re("min-w-0 truncate font-mono [direction:rtl]",ss?"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:M})}),r.jsx(Bo,{size:12,className:Re("shrink-0 transition-transform",I&&"rotate-180")})]})})}),r.jsxs(na,{className:"w-112 max-w-[calc(100vw-2rem)] p-0",align:"center",sideOffset:8,children:[r.jsxs(ln,{shouldFilter:!1,defaultValue:Mt,children:[r.jsx(cn,{value:G,onValueChange:d=>{Q(d),H.current?.scrollTo({top:0})},placeholder:e("sandbox.preview.searchPagesAndComponents")}),r.jsxs(on,{ref:H,className:"max-h-80",children:[r.jsx(dn,{children:(!f||Ye.length===0)&&At.length===0&&(!f||bs.length===0)&&kn.length===0?e("sandbox.preview.noPagesFound"):e("sandbox.preview.noSearchResults")}),dr.length>0&&r.jsx(We,{children:dr.map(d=>r.jsxs(qe,{value:`page:${d.key}`,"aria-current":Mt===`page:${d.key}`||void 0,title:`${d.name} · ${d.path}`,onSelect:()=>{Bt(),As(d)},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:d.name}),r.jsx("span",{className:"min-w-0 max-w-1/2 truncate text-right font-mono text-xs text-muted-foreground",children:d.path})]},d.key))}),Jn.length>0&&r.jsx(We,{heading:e("sandbox.preview.siteRoutes"),children:Jn.map(d=>r.jsx(qe,{value:`route:${d}`,"aria-current":Mt===`route:${d}`||void 0,title:d,onSelect:()=>{Bt(),lr(d)},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:d})},d))}),ur.length>0&&r.jsx(We,{heading:e("sandbox.preview.globalComponents"),children:ur.map(d=>r.jsx(qe,{value:`section:${d.key}`,"aria-current":Mt===`section:${d.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Bt(),ho(d)},children:r.jsx("span",{className:"truncate",children:d.name})},d.key))}),Sn.length>0&&r.jsx(We,{heading:e("sandbox.preview.globalLoaders"),children:Sn.map(d=>r.jsx(qe,{value:`loader:${d.key}`,"aria-current":Mt===`loader:${d.key}`||void 0,className:"aria-[current=true]:bg-accent aria-[current=true]:text-accent-foreground",onSelect:()=>{Bt(),go(d)},children:r.jsx("span",{className:"truncate",children:d.title})},d.key))})]})]}),f&&!j&&!D&&xt(M).some(d=>d.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:xt(M).map((d,P)=>{if(d.type==="text")return r.jsx("span",{children:d.text},`text-${P}`);const V=ws[d.name];return!V&&ks.length>0?r.jsx(Zc,{paramName:d.name,template:M,value:Qe[d.name]??"",options:ks,onPick:ir,onCommit:oe=>ts(d.name,oe)},`${ie}:${d.name}`):V&&St?r.jsx(Bc,{sources:V,template:M,paramName:d.name,value:Qe[d.name]??"",sandboxRef:St,onCommit:oe=>ts(d.name,oe)},`${ie}:${d.name}`):r.jsx(Jc,{name:d.name,value:Qe[d.name]??"",onCommit:oe=>ts(d.name,oe)},`${ie}:${d.name}`)})}),f&&r.jsx("div",{className:"border-t p-1.5",children:r.jsxs(_e,{variant:"ghost",className:"w-full justify-start",onClick:()=>{Bt(),z(void 0),q(!0)},children:[r.jsx(ta,{size:16}),e("sandbox.preview.createNewPage")]})})]})]})]}):r.jsx("span",{className:"min-w-0 truncate text-xs text-muted-foreground",children:mo}):null,pr=Dt||f?r.jsxs("div",{className:"flex min-w-0 max-w-[24rem] flex-1 items-center justify-center gap-1",children:[!(Dt&&cr)&&r.jsxs(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(st,{onClick:or,"aria-label":ns,children:fr})}),r.jsx(rt,{children:ns})]}),xo,r.jsxs("div",{className:"flex shrink-0 items-center gap-1",children:[Jt&&r.jsx(Pd,{tests:Wa,load:Ga,onOpen:()=>qa(!0),options:W,onChange:d=>{Y(d),i.previewAsChanged()},available:!!Ps||!Ln||!_n}),r.jsx(st,{onClick:Qa,disabled:Oe&&!Mn,"aria-label":e("sandbox.preview.openInNewTab"),children:r.jsx(Yr,{size:16})})]})]}):null,bo=(Ae||u)&&ne.mode==="sandbox",rs=Hd[x],as=x==="desktop"&&(_.width===0||_.width>=rs.width+2*Wr),mr=as?1:Math.min(_.width>0?_.width/(rs.width+2*Wr):1,1),yo=as?{width:"100%",height:"100%"}:{width:`${rs.width}px`,height:_.height>0?`${_.height/mr}px`:`${rs.height}px`,transform:`scale(${mr})`,transformOrigin:"top center"},hr=r.jsxs(r.Fragment,{children:[bo&&(Dt||f)&&r.jsx(st,{onClick:co,"aria-pressed":ye==="visual","aria-label":e("sandbox.preview.visualEditor"),active:ye==="visual",children:r.jsx(vr,{size:16})}),p&&r.jsxs(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(st,{onClick:uo,"aria-pressed":ye==="blocks","aria-label":e("sandbox.preview.blocksEditor"),active:ye==="blocks",children:r.jsx(Wo,{size:16})})}),r.jsx(rt,{children:e("sandbox.preview.blocksEditor")})]}),ct&&r.jsxs(at,{children:[r.jsx(nt,{asChild:!0,children:r.jsx(st,{onClick:$,"aria-pressed":T,"aria-label":e("sectionsEditor.sectionsEditor.viewJson"),active:T,children:r.jsx(Ko,{size:16})})}),r.jsx(rt,{children:e("sectionsEditor.sectionsEditor.viewJson")})]})]}),wo=!!D&&ye==="blocks";return r.jsxs("div",{className:"flex flex-col w-full h-full",children:[St&&Object.entries(ws).map(([d,P])=>(Qe[d]??"")===""?r.jsx(qc,{sources:P,template:M,paramName:d,sandboxRef:St,onFill:V=>ts(d,V)},`${ie}:${d}`):null),r.jsxs(r.Fragment,{children:[r.jsx(qs.Toolbar.Center.Portal,{fallback:r.jsx("div",{className:"flex min-w-0 items-center justify-center border-b p-2",children:pr}),children:pr}),r.jsx(qs.Toolbar.Right.Portal,{fallback:hr,children:hr})]}),r.jsx("div",{className:"flex-1 overflow-hidden relative",children:wo?r.jsxs("div",{className:"relative h-full min-h-0 overflow-hidden",children:[r.jsx(Hr,{virtualMcpId:t,externalSelection:N,onSectionPicked:Xn,onViewJsonFile:$}),T&&ct&&r.jsx("div",{className:"absolute inset-0 z-10",children:r.jsx(Vr,{ref:A,virtualMcpId:t,pageKey:ct,onClose:L},he.kind==="legacy"?void 0:JSON.stringify([Ls,xe]))})]}):r.jsxs(Tr,{orientation:"horizontal",disabled:ye!=="blocks",className:"relative isolate",children:[r.jsx(is,{ref:E,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(Hr,{virtualMcpId:t,externalSelection:N,onSectionPicked:Xn,onViewJsonFile:$})}),ye==="blocks"&&r.jsx(Rr,{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(Tr,{orientation:"horizontal",disabled:!(T&&ct),children:[r.jsx(is,{id:"preview-canvas-inner",minSize:"30%",className:"min-w-0 overflow-hidden",children:r.jsxs("div",{ref:d=>{if(!d)return;const P=()=>F(oe=>oe.width===d.clientWidth&&oe.height===d.clientHeight?oe:{width:d.clientWidth,height:d.clientHeight});P();const V=new ResizeObserver(P);return V.observe(d),()=>V.disconnect()},className:Re("h-full relative overflow-clip flex justify-center",Nt&&!as&&"bg-muted/30"),children:[(be||za)&&Nt&&r.jsx(ti,{}),ne.showDecidingLoader&&r.jsx("div",{"data-testid":"preview-deciding",className:"absolute inset-0 z-30 flex items-center justify-center",children:r.jsx(it,{className:"size-5 text-muted-foreground"})}),ne.showBlockingOverlay&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ds,{kind:"starting",progress:Cn,claimPhase:Ss})}),!re&&Xe.kind==="suspended"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ds,{kind:"suspended",onResume:Ie.resume})}),!re&&Xe.kind==="errored"&&r.jsx("div",{className:"absolute inset-0 z-30",children:r.jsx(Ds,{kind:"errored",error:Xe.error,onRetry:Ie.retry,connectionsHref:`/${de.slug}/settings/connections`})}),ne.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(it,{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"&&!b&&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(vr,{size:12}),e("sandbox.preview.clickElementToAsk")]}),ye==="visual"&&b&&r.jsx(fc,{element:b,onDismiss:()=>w(null)}),Nt&&et&&r.jsx("div",{className:Re("shrink-0",!as&&"bg-background shadow-edge"),style:yo,onMouseLeave:lo,children:r.jsx("iframe",{ref:S,src:pt,className:"w-full h-full border-0",title:e("sandbox.preview.devServerPreviewTitle"),onError:Hn.handleError,onLoad:()=>{if(js(xr),so(pt),Hn.handleLoad(),fe(),Rs.current=dt.current,_t&&$s(Ot),ne.mode!=="sandbox"||re){(ne.mode==="production"&&!ne.showWakingPill||re)&&ye==="blocks"&&Ts();return}if(Ro("vm_preview_loaded",{view_mode:ye,vm_id:Ue?.sandboxHandle??null}),!j)try{const d=S.current?.contentWindow?.location?.pathname;if(!d)return;const P=Fe.current;if(P!==null&&(Fe.current=null,Ne(d)!==Ne(P))||Ne(d)===Ne(Te))return;X(d),Lt({path:d,pageKey:se,params:Qe})}catch{}ye==="visual"&&Yn(),ye==="blocks"&&Ts()}},ne.iframeBase)})]})}),T&&ct&&r.jsxs(r.Fragment,{children:[r.jsx(Rr,{withHandle:!0}),r.jsx(is,{id:"preview-json-editor",defaultSize:"43%",minSize:"20%",className:"min-w-0 overflow-hidden",children:r.jsx(Vr,{ref:A,virtualMcpId:t,pageKey:ct,onClose:L},he.kind==="legacy"?void 0:JSON.stringify([Ls,xe]))})]})]})})]})}),r.jsx(cd,{open:ee,onOpenChange:q,isPending:yn.isPending,error:U,templates:Ye,onSubmit:vo})]})}const Xs={app:null,split:!1};function Zd(t){const e=le.c(24),{project:s,maxApps:n,children:o}=t,c=Se();let u;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={silent:!0},e[0]=u):u=e[0];const i=Jo(u),a=bt();let l;e[1]!==s.metadata.runtime?(l=s.metadata.runtime??{},e[1]=s.metadata.runtime,e[2]=l):l=e[2];const g=l;let f;e[3]!==g.apps?(f=g.apps??[],e[3]=g.apps,e[4]=f):f=e[4];const p=f;let m;e[5]!==i.update||e[6]!==a||e[7]!==s.id||e[8]!==s.metadata||e[9]!==g||e[10]!==c?(m=b=>i.update.mutate({id:s.id,data:{metadata:{...Sl(s.metadata),runtime:{...g,apps:b.length?b:null}}}},{onSuccess:()=>a.start(),onError:()=>ms.error(c("sandbox.appTabs.saveError"))}),e[5]=i.update,e[6]=a,e[7]=s.id,e[8]=s.metadata,e[9]=g,e[10]=c,e[11]=m):m=e[11];const v=m,y=g.path??null;let h,x;e[12]!==p||e[13]!==v?(h=b=>v([...p,{path:b}]),x=b=>v(p.filter(w=>w.path!==b)),e[12]=p,e[13]=v,e[14]=h,e[15]=x):(h=e[14],x=e[15]);let C;return e[16]!==p||e[17]!==o||e[18]!==n||e[19]!==s.id||e[20]!==y||e[21]!==h||e[22]!==x?(C=r.jsx(eu,{virtualMcpId:s.id,mainPath:y,apps:p,maxApps:n,onAddApp:h,onRemoveApp:x,children:o}),e[16]=p,e[17]=o,e[18]=n,e[19]=s.id,e[20]=y,e[21]=h,e[22]=x,e[23]=C):C=e[23],C}function eu(t){const e=le.c(102),{virtualMcpId:s,mainPath:n,apps:o,maxApps:c,onAddApp:u,onRemoveApp:i,children:a}=t,l=Se(),g=fa(),{currentBranch:f}=lt(),p=bt(),m=mn().lifecycle.phase,v=Kt(s,f),{url:y}=da(s);let h;e[0]!==v||e[1]!==y?(h=Ve(v)??y,e[0]=v,e[1]=y,e[2]=h):h=e[2];const x=h,C=x??p.previewUrl,b=!!x||m==="running",w=!b&&p.status==="errored";let N;e[3]!==p.vmEntry?.startedWith?.apps?(N=p.vmEntry?.startedWith?.apps??[],e[3]=p.vmEntry?.startedWith?.apps,e[4]=N):N=e[4];const k=N;let S;e[5]!==s?(S=Ws.previewAppLayout(s),e[5]=s,e[6]=S):S=e[6];const[E,T]=Vs(S,tu);let B;e[7]!==o||e[8]!==E?(B=o.some(fe=>fe.path===E.app)?E.app:null,e[7]=o,e[8]=E,e[9]=B):B=e[9];const A=B,L=A!==null&&E.split&&!g,$=A===null||L,_=A??o[0]?.path??null,[F,I]=R.useState(null),[J,W]=R.useState(!1);let Y;e[10]===Symbol.for("react.memo_cache_sentinel")?(Y=()=>{I(null),W(!1)},e[10]=Y):Y=e[10];const G=Y;let Q;e[11]!==o||e[12]!==F||e[13]!==g||e[14]!==n||e[15]!==u||e[16]!==T?(Q=()=>{if(F===null)return;const fe=Or(F);if(!fe){G();return}if(fe===Or(n??"")||o.some(de=>de.path===fe)){W(!0);return}u(fe),T({app:fe,split:!g}),G()},e[11]=o,e[12]=F,e[13]=g,e[14]=n,e[15]=u,e[16]=T,e[17]=Q):Q=e[17];const H=Q;let ee;e[18]!==n||e[19]!==l?(ee=n?Bs(n):l("sandbox.appTabs.root"),e[18]=n,e[19]=l,e[20]=ee):ee=e[20];const q=ee;let U;e[21]!==L||e[22]!==l?(U=l(L?"sandbox.appTabs.single":"sandbox.appTabs.split"),e[21]=L,e[22]=l,e[23]=U):U=e[23];const z=U;let j;e[24]!==l?(j=l("sandbox.appTabs.label"),e[24]=l,e[25]=j):j=e[25];let O;e[26]!==l?(O=l("sandbox.appTabs.main"),e[26]=l,e[27]=O):O=e[27];let D;e[28]!==l?(D=l("sandbox.appTabs.mainHint"),e[28]=l,e[29]=D):D=e[29];let K;e[30]!==T?(K=()=>T(Xs),e[30]=T,e[31]=K):K=e[31];let Z;e[32]!==w||e[33]!==q||e[34]!==b||e[35]!==$||e[36]!==O||e[37]!==D||e[38]!==K?(Z=r.jsx(qr,{label:q,badge:O,hint:D,ready:b,failed:w,onScreen:$,onSelect:K}),e[32]=w,e[33]=q,e[34]=b,e[35]=$,e[36]=O,e[37]=D,e[38]=K,e[39]=Z):Z=e[39];let te;if(e[40]!==o||e[41]!==A||e[42]!==w||e[43]!==q||e[44]!==i||e[45]!==b||e[46]!==T||e[47]!==L||e[48]!==l){let fe;e[50]!==A||e[51]!==w||e[52]!==q||e[53]!==i||e[54]!==b||e[55]!==T||e[56]!==L||e[57]!==l?(fe=de=>{const Le=Bs(de.path);return r.jsx(qr,{label:Le,hint:l("sandbox.appTabs.extraHint",{app:q}),ready:b,failed:w,onScreen:de.path===A,onSelect:()=>T({app:de.path,split:L}),onRemove:()=>i(de.path),removeLabel:l("sandbox.appTabs.remove",{app:Le})},de.path)},e[50]=A,e[51]=w,e[52]=q,e[53]=i,e[54]=b,e[55]=T,e[56]=L,e[57]=l,e[58]=fe):fe=e[58],te=o.map(fe),e[40]=o,e[41]=A,e[42]=w,e[43]=q,e[44]=i,e[45]=b,e[46]=T,e[47]=L,e[48]=l,e[49]=te}else te=e[49];let M;e[59]!==Z||e[60]!==te||e[61]!==j?(M=r.jsxs("div",{role:"tablist","aria-label":j,className:"flex min-w-0 items-center gap-1 overflow-x-auto",children:[Z,te]}),e[59]=Z,e[60]=te,e[61]=j,e[62]=M):M=e[62];let X;e[63]!==o.length||e[64]!==H||e[65]!==F||e[66]!==J||e[67]!==c||e[68]!==l?(X=F!==null?r.jsx("form",{className:"w-40 shrink-0",onSubmit:fe=>{fe.preventDefault(),H()},children:r.jsx("input",{autoFocus:!0,value:F,placeholder:"apps/checkout","aria-label":l("sandbox.appTabs.pathLabel"),"aria-invalid":J,onChange:fe=>{I(fe.target.value),W(!1)},onBlur:G,onKeyDown:fe=>{fe.key==="Escape"&&G()},className:Re("h-7 w-full rounded-md border bg-background px-2 font-mono text-xs outline-none",J?"border-destructive":"border-border")})}):o.length<c&&r.jsx(vt,{label:l("sandbox.appTabs.add"),onClick:()=>I(""),children:r.jsx(ta,{})}),e[63]=o.length,e[64]=H,e[65]=F,e[66]=J,e[67]=c,e[68]=l,e[69]=X):X=e[69];let se;e[70]!==g||e[71]!==T||e[72]!==L||e[73]!==z||e[74]!==_?(se=!g&&_&&r.jsx(vt,{label:z,active:L,onClick:()=>T(L?Xs:{app:_,split:!0}),children:r.jsx(qo,{})}),e[70]=g,e[71]=T,e[72]=L,e[73]=z,e[74]=_,e[75]=se):se=e[75];let ae;e[76]!==M||e[77]!==X||e[78]!==se?(ae=r.jsxs(r.Fragment,{children:[M,X,se]}),e[76]=M,e[77]=X,e[78]=se,e[79]=ae):ae=e[79];const me=ae;let pe;e[80]!==me?(pe=r.jsx(qs.Topbar.Left.Portal,{fallback:r.jsx("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:me}),children:r.jsx("div",{className:"ml-1 flex min-w-0 items-center gap-1 border-l border-border/60 pl-2",children:me})}),e[80]=me,e[81]=pe):pe=e[81];let be;e[82]!==a||e[83]!==$?(be=$&&r.jsx("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:a}),e[82]=a,e[83]=$,e[84]=be):be=e[84];let ge;e[85]!==A||e[86]!==w||e[87]!==p.start||e[88]!==x||e[89]!==q||e[90]!==C||e[91]!==b||e[92]!==T||e[93]!==L||e[94]!==k?(ge=A!==null&&r.jsx(su,{name:Bs(A),mainName:q,appUrl:C?Pl(C,A):null,ready:b,failed:w,notStarted:!x&&!k.includes(A),onStart:p.start,className:Re(L&&"border-l border-border"),onClose:L?()=>T({app:A,split:!1}):void 0},A),e[85]=A,e[86]=w,e[87]=p.start,e[88]=x,e[89]=q,e[90]=C,e[91]=b,e[92]=T,e[93]=L,e[94]=k,e[95]=ge):ge=e[95];let ve;e[96]!==be||e[97]!==ge?(ve=r.jsxs("div",{className:"flex min-h-0 flex-1",children:[be,ge]}),e[96]=be,e[97]=ge,e[98]=ve):ve=e[98];let Pe;return e[99]!==pe||e[100]!==ve?(Pe=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]=Pe):Pe=e[101],Pe}function tu(t){return t??Xs}function qr(t){const e=le.c(28),{label:s,badge:n,hint:o,ready:c,failed:u,onScreen:i,onSelect:a,onRemove:l,removeLabel:g}=t,f=i?"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 m=c?"bg-success":u?"bg-destructive":"animate-pulse bg-warning";let v;e[2]!==m?(v=Re("size-1.5 rounded-full",m),e[2]=m,e[3]=v):v=e[3];let y;e[4]!==v?(y=r.jsx("span",{"aria-hidden":!0,className:v}),e[4]=v,e[5]=y):y=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 x;e[8]!==n?(x=n&&r.jsx("span",{className:"text-[10px] text-muted-foreground",children:n}),e[8]=n,e[9]=x):x=e[9];let C;e[10]!==i||e[11]!==a||e[12]!==y||e[13]!==h||e[14]!==x?(C=r.jsx(nt,{asChild:!0,children:r.jsxs("button",{type:"button",role:"tab","aria-selected":i,onClick:a,className:"flex h-full items-center gap-1.5 rounded-md px-2.5 focus-ring",children:[y,h,x]})}),e[10]=i,e[11]=a,e[12]=y,e[13]=h,e[14]=x,e[15]=C):C=e[15];let b;e[16]!==o?(b=r.jsx(rt,{className:"max-w-64",children:o}),e[16]=o,e[17]=b):b=e[17];let w;e[18]!==C||e[19]!==b?(w=r.jsxs(at,{children:[C,b]}),e[18]=C,e[19]=b,e[20]=w):w=e[20];let N;e[21]!==l||e[22]!==g?(N=l&&r.jsx("button",{type:"button","aria-label":g,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(Pa,{className:"size-3"})}),e[21]=l,e[22]=g,e[23]=N):N=e[23];let k;return e[24]!==w||e[25]!==N||e[26]!==p?(k=r.jsxs("div",{className:p,children:[w,N]}),e[24]=w,e[25]=N,e[26]=p,e[27]=k):k=e[27],k}function su(t){const e=le.c(71),{name:s,mainName:n,appUrl:o,ready:c,failed:u,notStarted:i,onStart:a,className:l,onClose:g}=t,f=Se(),[p,m]=R.useState("/"),[v,y]=R.useState("desktop"),[h,x]=R.useState(0),C=R.useRef(null);let b;e[0]!==o||e[1]!==p?(b=o?jl(o,p):null,e[0]=o,e[1]=p,e[2]=b):b=e[2];const w=b;let N;e[3]!==l?(N=Re("flex min-h-0 min-w-0 flex-1 flex-col",l),e[3]=l,e[4]=N):N=e[4];let k;e[5]===Symbol.for("react.memo_cache_sentinel")?(k=D=>{D.preventDefault(),m(C.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 E;e[9]!==p||e[10]!==S?(E=r.jsx("form",{className:"min-w-0 flex-1",onSubmit:k,children:r.jsx("input",{ref:C,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]=E):E=e[11];let T;e[12]!==v||e[13]!==f?(T=f(v==="desktop"?"sandbox.preview.deviceMobile":"sandbox.preview.deviceDesktop"),e[12]=v,e[13]=f,e[14]=T):T=e[14];let B;e[15]===Symbol.for("react.memo_cache_sentinel")?(B=()=>y(ru),e[15]=B):B=e[15];let A;e[16]!==v?(A=v==="desktop"?r.jsx(ea,{}):r.jsx(Zr,{}),e[16]=v,e[17]=A):A=e[17];let L;e[18]!==T||e[19]!==A?(L=r.jsx(vt,{label:T,onClick:B,children:A}),e[18]=T,e[19]=A,e[20]=L):L=e[20];let $;e[21]!==s||e[22]!==f?($=f("sandbox.appPane.reload",{app:s}),e[21]=s,e[22]=f,e[23]=$):$=e[23];const _=!w||!c;let F,I;e[24]===Symbol.for("react.memo_cache_sentinel")?(F=()=>x(nu),I=r.jsx(Lo,{}),e[24]=F,e[25]=I):(F=e[24],I=e[25]);let J;e[26]!==$||e[27]!==_?(J=r.jsx(vt,{label:$,disabled:_,onClick:F,children:I}),e[26]=$,e[27]=_,e[28]=J):J=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 G;e[32]!==w?(G=()=>w&&window.open(w,"_blank","noopener"),e[32]=w,e[33]=G):G=e[33];let Q;e[34]===Symbol.for("react.memo_cache_sentinel")?(Q=r.jsx(Yr,{}),e[34]=Q):Q=e[34];let H;e[35]!==W||e[36]!==Y||e[37]!==G?(H=r.jsx(vt,{label:W,disabled:Y,onClick:G,children:Q}),e[35]=W,e[36]=Y,e[37]=G,e[38]=H):H=e[38];let ee;e[39]!==s||e[40]!==g||e[41]!==f?(ee=g&&r.jsx(vt,{label:f("sandbox.appPane.close",{app:s}),onClick:g,children:r.jsx(Pa,{})}),e[39]=s,e[40]=g,e[41]=f,e[42]=ee):ee=e[42];let q;e[43]!==J||e[44]!==H||e[45]!==ee||e[46]!==E||e[47]!==L?(q=r.jsxs("div",{className:"flex h-10 shrink-0 items-center gap-1 border-b border-border px-2",children:[E,L,J,H,ee]}),e[43]=J,e[44]=H,e[45]=ee,e[46]=E,e[47]=L,e[48]=q):q=e[48];let U;e[49]!==n||e[50]!==f?(U=f("sandbox.appPane.previewOnly",{app:n}),e[49]=n,e[50]=f,e[51]=U):U=e[51];let z;e[52]!==U?(z=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:U}),e[52]=U,e[53]=z):z=e[53];let j;e[54]!==v||e[55]!==u||e[56]!==n||e[57]!==s||e[58]!==i||e[59]!==a||e[60]!==c||e[61]!==h||e[62]!==w||e[63]!==f?(j=r.jsx("div",{className:"flex min-h-0 flex-1 justify-center overflow-auto bg-muted/40",children:c&&i?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(_e,{size:"sm",variant:"outline",onClick:a,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"):u?f("sandbox.appPane.failed",{app:n}):f("sandbox.appPane.waiting")}):r.jsx("iframe",{src:w,title:s,className:Re("h-full bg-background",v==="mobile"?"w-[412px] max-w-full border-x border-border":"w-full")},`${w}#${h}`)}),e[54]=v,e[55]=u,e[56]=n,e[57]=s,e[58]=i,e[59]=a,e[60]=c,e[61]=h,e[62]=w,e[63]=f,e[64]=j):j=e[64];let O;return e[65]!==s||e[66]!==N||e[67]!==q||e[68]!==z||e[69]!==j?(O=r.jsxs("section",{"aria-label":s,className:N,children:[q,z,j]}),e[65]=s,e[66]=N,e[67]=q,e[68]=z,e[69]=j,e[70]=O):O=e[70],O}function nu(t){return t+1}function ru(t){return t==="desktop"?"mobile":"desktop"}function vt(t){const e=le.c(11),{label:s,children:n,active:o,disabled:c,onClick:u}=t;let i;e[0]!==o||e[1]!==n||e[2]!==c||e[3]!==s||e[4]!==u?(i=r.jsx(nt,{asChild:!0,children:r.jsx(st,{"aria-label":s,"aria-pressed":o,active:o,disabled:c,onClick:u,children:n})}),e[0]=o,e[1]=n,e[2]=c,e[3]=s,e[4]=u,e[5]=i):i=e[5];let a;e[6]!==s?(a=r.jsx(rt,{children:s}),e[6]=s,e[7]=a):a=e[7];let l;return e[8]!==i||e[9]!==a?(l=r.jsxs(at,{children:[i,a]}),e[8]=i,e[9]=a,e[10]=l):l=e[10],l}const au=async(t,e)=>{try{return await fetch(t,{method:"HEAD",mode:"no-cors",cache:"no-store",credentials:"omit",signal:e}),!0}catch{return!1}},ou=1e4,iu=1e4,lu=5e3,cu=2;function du(t,e){return t&&e===0?iu:Math.min(1e3*2**Math.max(0,e-1),lu)}function uu(t,e,s){return e?!0:t===!0&&s<cu}function fu(t,e){const s=le.c(11),n=au,o=Ao();let c;s[0]!==t?(c=tn.localAppReachable(t??""),s[0]=t,s[1]=c):c=s[1];const u=c;let i;s[2]!==n||s[3]!==o||s[4]!==u||s[5]!==t?(i=async f=>{const{signal:p}=f,m=new AbortController,v=()=>m.abort();p.addEventListener("abort",v);const y=setTimeout(v,ou),h=await n(t,m.signal).catch(mu);clearTimeout(y),p.removeEventListener("abort",v);const x=o.getQueryData(u),C=h?0:(x?.failures??0)+1;return{up:uu(x?.up??null,h,C),failures:C}},s[2]=n,s[3]=o,s[4]=u,s[5]=t,s[6]=i):i=s[6];const a=!!t;let l;s[7]!==u||s[8]!==i||s[9]!==a?(l={queryKey:u,queryFn:i,enabled:a,retry:!1,staleTime:0,gcTime:0,refetchInterval:pu},s[7]=u,s[8]=i,s[9]=a,s[10]=l):l=s[10];const{data:g}=Jr(l);return t?g?.up??null:null}function pu(t){return t.state.data?du(t.state.data.up,t.state.data.failures):!1}function mu(){return!1}function hu(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 Pf(t){const e=le.c(53),{virtualMcpId:s}=t,n=Se(),o=Yo(s),{connection:c}=ua(s),{activeTask:u,taskId:i,currentBranch:a}=lt(),l=Ol(i),[g,f]=R.useState(!1),p=Kt(s,a);let m;e[0]!==p||e[1]!==c?(m=c?Ve(p):null,e[0]=p,e[1]=c,e[2]=m):m=e[2];const v=m,y=fu(v),h=Ea(),x=El("multi_app_preview");if(Tl({threadId:i,sandboxBranch:u?.branch??a,agentHasRepo:Ms(o?.metadata),threadHasRepo:Ms(l)||Ms(u?.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(_r,{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 E;e[6]!==n?(E=n("mainPanelTabs.previewTab.connectGithubDescription"),e[6]=n,e[7]=E):E=e[7];let T,B;e[8]===Symbol.for("react.memo_cache_sentinel")?(T=()=>f(!0),B=r.jsx(_r,{className:"size-4"}),e[8]=T,e[9]=B):(T=e[8],B=e[9]);let A;e[10]!==n?(A=n("mainPanelTabs.previewTab.connectGithub"),e[10]=n,e[11]=A):A=e[11];let L;e[12]!==A?(L=r.jsxs(_e,{onClick:T,children:[B,A]}),e[12]=A,e[13]=L):L=e[13];let $;e[14]!==S||e[15]!==E||e[16]!==L?($=r.jsx(Nl,{className:"h-full",image:k,title:S,description:E,actions:L}),e[14]=S,e[15]=E,e[16]=L,e[17]=$):$=e[17];let _;e[18]!==g?(_=r.jsx(Cl,{open:g,onOpenChange:f,mode:"agent"}),e[18]=g,e[19]=_):_=e[19];let F;return e[20]!==_||e[21]!==$?(F=r.jsxs(r.Fragment,{children:[$,_]}),e[20]=_,e[21]=$,e[22]=F):F=e[22],F}if(c&&o&&!Ve(p)){let k;e[23]!==h||e[24]!==p?(k=hu({backend:p,access:h}),e[23]=h,e[24]=p,e[25]=k):k=e[25];let S;e[26]!==c.endpoint?(S=Ei(c.endpoint),e[26]=c.endpoint,e[27]=S):S=e[27];let E;return e[28]!==k||e[29]!==S?(E=r.jsx(vu,{status:k,host:S}),e[28]=k,e[29]=S,e[30]=E):E=e[30],E}if(v&&y!==!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]!==v||e[34]!==n?(S=n("mainPanelTabs.previewTab.localAppWaiting.body",{host:gu(v)}),e[33]=v,e[34]=n,e[35]=S):S=e[35];let E;e[36]!==S?(E=r.jsx(Sa,{text:S}),e[36]=S,e[37]=E):E=e[37];let T;e[38]!==n?(T=n("mainPanelTabs.previewTab.localAppWaiting.hint"),e[38]=n,e[39]=T):T=e[39];let B;e[40]!==T?(B=r.jsx("p",{role:"status",className:"text-center text-sm text-muted-foreground",children:T}),e[40]=T,e[41]=B):B=e[41];let A;return e[42]!==k||e[43]!==E||e[44]!==B?(A=r.jsx(hs,{headingLevel:2,waiting:!0,title:k,lead:E,footer:B}),e[42]=k,e[43]=E,e[44]=B,e[45]=A):A=e[45],A}let b;e[46]!==s?(b=r.jsx(Xd,{virtualMcpId:s}),e[46]=s,e[47]=b):b=e[47];const w=b;let N;return e[48]!==o||e[49]!==x||e[50]!==w||e[51]!==c?(N=r.jsx(Oo,{children:x&&o&&!c?r.jsx(Zd,{project:o,maxApps:wl,children:w}):w}),e[48]=o,e[49]=x,e[50]=w,e[51]=c,e[52]=N):N=e[52],N}function gu(t){try{return new URL(t).host}catch{return t}}function vu(t){const e=le.c(13),{status:s,host:n}=t,o=Se();if(s.kind==="connected"){let i;e[0]!==o?(i=o("mainPanelTabs.previewTab.localhostNoPreview.title"),e[0]=o,e[1]=i):i=e[1];let a;e[2]!==o?(a=o("mainPanelTabs.previewTab.localhostNoPreview.body"),e[2]=o,e[3]=a):a=e[3];let l;return e[4]!==i||e[5]!==a?(l=r.jsx(hs,{headingLevel:2,waiting:!1,title:i,lead:a}),e[4]=i,e[5]=a,e[6]=l):l=e[6],l}let c;e[7]!==n||e[8]!==s?(c=Bl(s,n),e[7]=n,e[8]=s,e[9]=c):c=e[9];let u;return e[10]!==n||e[11]!==c?(u=r.jsx(Dl,{wait:c,hosts:n}),e[10]=n,e[11]=c,e[12]=u):u=e[12],u}export{Dl as L,Pf as P,hs as S,Sf as u};