decocms 4.584.9 → 4.584.10

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 (430) hide show
  1. package/dist/client/assets/{AlertCircle-Di8a-UWV.js → AlertCircle-D-3RwTjD.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CCqrcx1b.js → AreaChart-C7txVua8.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-B2F854r0.js → ArrowLeft-2dNX3G7U.js} +1 -1
  4. package/dist/client/assets/{ArrowRight-Dj2pC8B7.js → ArrowRight-CyXALyAs.js} +1 -1
  5. package/dist/client/assets/{ArrowUp-Nhgapjwm.js → ArrowUp-DnwsrW8f.js} +1 -1
  6. package/dist/client/assets/{BookOpen01-CHggQBWj.js → BookOpen01-BUVRmrG3.js} +1 -1
  7. package/dist/client/assets/{CartesianChart-BFVggI3G.js → CartesianChart-Bsi3jZSz.js} +1 -1
  8. package/dist/client/assets/{CategoricalChart-BYLFXXdR.js → CategoricalChart-fhBJG9pQ.js} +1 -1
  9. package/dist/client/assets/{CheckCircle-UAsyLWI7.js → CheckCircle-DLJ2bpMW.js} +1 -1
  10. package/dist/client/assets/{ChevronDown-COkNoLwk.js → ChevronDown-Clw2gzwU.js} +1 -1
  11. package/dist/client/assets/{ChevronSelectorVertical-Buxlf1yx.js → ChevronSelectorVertical-CxqhRYoV.js} +1 -1
  12. package/dist/client/assets/{ChevronUp-C-YGqatN.js → ChevronUp-mwSMyirQ.js} +1 -1
  13. package/dist/client/assets/{CreditCard01-CRi7On3u.js → CreditCard01-8Pk5ghZq.js} +1 -1
  14. package/dist/client/assets/{Eye-C6rTinUa.js → Eye-DtAwTuAv.js} +1 -1
  15. package/dist/client/assets/{File02-CNdUOOeH.js → File02-B_azDZYk.js} +1 -1
  16. package/dist/client/assets/{Globe04-AW14Waq3.js → Globe04-B0wykTtt.js} +1 -1
  17. package/dist/client/assets/{Image01-xPHq6tUP.js → Image01-qySekihp.js} +1 -1
  18. package/dist/client/assets/{Key01-BMD-TEa8.js → Key01-C1ftF9tP.js} +1 -1
  19. package/dist/client/assets/{LayoutLeft-5PR-LA5J.js → LayoutLeft-CTZ6iAtK.js} +1 -1
  20. package/dist/client/assets/{LinkBroken01-Chn3Zw95.js → LinkBroken01-Ctxx3NC-.js} +1 -1
  21. package/dist/client/assets/{MessageCircle01-CeeL61Zn.js → MessageCircle01-BknThLW3.js} +1 -1
  22. package/dist/client/assets/{Minus-CxmZj9NQ.js → Minus-CQ5w-vye.js} +1 -1
  23. package/dist/client/assets/{Monitor01-BNRBENLp.js → Monitor01-CJoN_dTF.js} +1 -1
  24. package/dist/client/assets/{Play-DEfGDCy-.js → Play-Zazmy7hc.js} +1 -1
  25. package/dist/client/assets/{Plus-C2jbSKfe.js → Plus-B1jxL8_s.js} +1 -1
  26. package/dist/client/assets/{ReferenceLine-D9-8u9ny.js → ReferenceLine-_CvTPvLT.js} +1 -1
  27. package/dist/client/assets/{SearchMd-DIZIcq-T.js → SearchMd-YEpC8Fp5.js} +1 -1
  28. package/dist/client/assets/{ShoppingBag01-CVfO_hCG.js → ShoppingBag01-BaVCGN49.js} +1 -1
  29. package/dist/client/assets/{Sun-CPfe1reh.js → Sun-Cu-JeMSe.js} +1 -1
  30. package/dist/client/assets/{SwitchHorizontal01-CFbhgx88.js → SwitchHorizontal01-DIeoClfB.js} +1 -1
  31. package/dist/client/assets/{Tool01-BIyGNKrn.js → Tool01-BIdw-Y5R.js} +1 -1
  32. package/dist/client/assets/{Tooltip-MqN6JJnW.js → Tooltip-B8Tu8Gdi.js} +1 -1
  33. package/dist/client/assets/{Trash01-D20QdwlW.js → Trash01-7INJcjHE.js} +1 -1
  34. package/dist/client/assets/{TrendUp01-yJId_zlL.js → TrendUp01-CpNTpLYA.js} +1 -1
  35. package/dist/client/assets/{Upload01-C9Bt1TSM.js → Upload01-DZhveaEI.js} +1 -1
  36. package/dist/client/assets/{UserCheck01-BNqLXBfG.js → UserCheck01-C6Zy7aCJ.js} +1 -1
  37. package/dist/client/assets/{UserSquare-BJ8rQzrf.js → UserSquare-DCGr1IXl.js} +1 -1
  38. package/dist/client/assets/{Users01-BF_7Ge84.js → Users01-Dy9NXp21.js} +1 -1
  39. package/dist/client/assets/{XClose-BeMmbmRj.js → XClose-BkVqHDXm.js} +1 -1
  40. package/dist/client/assets/{Zap-DnTlLwWn.js → Zap-BVuJGlvS.js} +1 -1
  41. package/dist/client/assets/{access-gate-ys146buF.js → access-gate-CjOHgFHb.js} +1 -1
  42. package/dist/client/assets/{add-connection-dialog-BzuPzzcP.js → add-connection-dialog-Z3pG_1Mh.js} +1 -1
  43. package/dist/client/assets/agent-app-CHpC3X0n.js +1 -0
  44. package/dist/client/assets/{agent-assets-CriTGOWU.js → agent-assets-CkpRqt9u.js} +1 -1
  45. package/dist/client/assets/{agent-automation-CikOpkf1.js → agent-automation-Dpx8EZR1.js} +1 -1
  46. package/dist/client/assets/{agent-automations-Bgf1jQrh.js → agent-automations-DscC5NKA.js} +1 -1
  47. package/dist/client/assets/{agent-blog-F5KTJKh9.js → agent-blog-DWCgn8Te.js} +2 -2
  48. package/dist/client/assets/{agent-blog-post-OFgpigIS.js → agent-blog-post-BDhxMTbH.js} +2 -2
  49. package/dist/client/assets/{agent-calendar-Dj_CPqBD.js → agent-calendar-fLFsv6Q-.js} +1 -1
  50. package/dist/client/assets/{agent-capabilities-nLnawz8n.js → agent-capabilities-oZBKKPRQ.js} +1 -1
  51. package/dist/client/assets/{agent-connect-sources-GVrze9Tn.js → agent-connect-sources-BbZDa5Tt.js} +1 -1
  52. package/dist/client/assets/agent-deck-Bier-4vq.js +1 -0
  53. package/dist/client/assets/{agent-e2e-t_AgarMy.js → agent-e2e-D0XQrMZe.js} +1 -1
  54. package/dist/client/assets/agent-experiments-dTqvGtgM.js +1 -0
  55. package/dist/client/assets/agent-file-CcHjHf3e.js +1 -0
  56. package/dist/client/assets/{agent-hosting-DYqOSc12.js → agent-hosting-axq6L8AZ.js} +1 -1
  57. package/dist/client/assets/{agent-icon-Djmp3uF_.js → agent-icon-DZAggVJ3.js} +1 -1
  58. package/dist/client/assets/agent-library-D7rDSunJ.js +1 -0
  59. package/dist/client/assets/agent-library-file-BsAczfIF.js +1 -0
  60. package/dist/client/assets/agent-overview-C9JfXzFO.js +1 -0
  61. package/dist/client/assets/{agent-releases-CG7DBQNk.js → agent-releases-Cx42CNY9.js} +1 -1
  62. package/dist/client/assets/agent-settings-ByUpG39p.js +1 -0
  63. package/dist/client/assets/{agent-site-editor-bsAYI9Qx.js → agent-site-editor-BpmzKB9i.js} +1 -1
  64. package/dist/client/assets/agent-site-editor-code-DFlQR1PO.js +2 -0
  65. package/dist/client/assets/agent-site-editor-content-wjfzDvgV.js +1 -0
  66. package/dist/client/assets/agent-site-editor-preview-CoQBQcVT.js +1 -0
  67. package/dist/client/assets/agent-view-CN1p1Qzx.js +1 -0
  68. package/dist/client/assets/{agent-view-guard-BjTeUL0l.js → agent-view-guard-BbdHPmHb.js} +1 -1
  69. package/dist/client/assets/{ai-providers--9DxGzKr.js → ai-providers-pB5u0lhY.js} +1 -1
  70. package/dist/client/assets/{alert-DodlNZ2z.js → alert-e0HkVh8j.js} +1 -1
  71. package/dist/client/assets/{analytics-sections-BavM7p0J.js → analytics-sections-DTjcyWEs.js} +1 -1
  72. package/dist/client/assets/{api-keys-C9Ltg2HT.js → api-keys-CLdGxd3F.js} +1 -1
  73. package/dist/client/assets/api-keys-CP9hfgHo.js +1 -0
  74. package/dist/client/assets/{app-editor-oJJTX1pK.js → app-editor-D_sITjhT.js} +1 -1
  75. package/dist/client/assets/{asset-utils-B8xngYBo.js → asset-utils-bV62C4dc.js} +1 -1
  76. package/dist/client/assets/{auth-catchall-BIoLm5Ab.js → auth-catchall-AYnufKEb.js} +1 -1
  77. package/dist/client/assets/{auth-entry-C1XoF05E.js → auth-entry-B8S3rUrn.js} +1 -1
  78. package/dist/client/assets/{auth-split-layout-C01yLUAN.js → auth-split-layout-YKvYDpPy.js} +1 -1
  79. package/dist/client/assets/{auth-dN38N6ZJ.js → auth-xyPIezYQ.js} +1 -1
  80. package/dist/client/assets/{authenticate-and-persist-oauth-BLc3TfFn.js → authenticate-and-persist-oauth-D23cz1S_.js} +1 -1
  81. package/dist/client/assets/{automation-list-row-PbVUdzfB.js → automation-list-row-X7OzE5Qg.js} +1 -1
  82. package/dist/client/assets/{automation-runs-Ci5bOvQY.js → automation-runs-BV88soeg.js} +1 -1
  83. package/dist/client/assets/{automations-932xVZmd.js → automations-BnTXqYLi.js} +1 -1
  84. package/dist/client/assets/{badge-ooD-f3Xm.js → badge-DOMIFW--.js} +1 -1
  85. package/dist/client/assets/{block-document-B3emD8Py.js → block-document-CDMbquHv.js} +1 -1
  86. package/dist/client/assets/{blocks-preview-workspace-context-CPWJ7AAs.js → blocks-preview-workspace-context-au-Ny_oI.js} +1 -1
  87. package/dist/client/assets/{blocks-tab-states-BzneOCDW.js → blocks-tab-states-DH742uQK.js} +1 -1
  88. package/dist/client/assets/{blog-preview-url-BVoP3Psp.js → blog-preview-url-DSNU0Xdu.js} +1 -1
  89. package/dist/client/assets/{blog-schema-Pk7BbGun.js → blog-schema-DPUFZMP9.js} +1 -1
  90. package/dist/client/assets/{blog-source-gate-BpC4RIWC.js → blog-source-gate-CjzIlVut.js} +1 -1
  91. package/dist/client/assets/{blog-view-gate-CGKzU05m.js → blog-view-gate-BAISJR7D.js} +1 -1
  92. package/dist/client/assets/{buckets-Cvkckzfy.js → buckets-Bxp6Y84H.js} +1 -1
  93. package/dist/client/assets/{build-improve-prompt-doc-DRdwqMyb.js → build-improve-prompt-doc-DhcFeE7D.js} +1 -1
  94. package/dist/client/assets/{calendar-Dfc1FCTZ.js → calendar-BKeDmd2L.js} +1 -1
  95. package/dist/client/assets/{capability-load-error-D-MJtSCR.js → capability-load-error-O-_btDT9.js} +1 -1
  96. package/dist/client/assets/{category-editor-DqvQQTB6.js → category-editor-DZQVKvyd.js} +1 -1
  97. package/dist/client/assets/{category-tree-D011La9Z.js → category-tree-5mCXbrPm.js} +1 -1
  98. package/dist/client/assets/{chart-uUI_EY97.js → chart-BBlxOD-N.js} +1 -1
  99. package/dist/client/assets/{chat-context-Bb_Yeasx.js → chat-context-DAOuQBMp.js} +1 -1
  100. package/dist/client/assets/{chat-draft-C5b4ZZNT.js → chat-draft-B7eLpjsQ.js} +1 -1
  101. package/dist/client/assets/{checkbox-B0iej-k4.js → checkbox-CsVne2mP.js} +1 -1
  102. package/dist/client/assets/{choose-editor-BHGbYr9M.js → choose-editor-CBF2vzMC.js} +1 -1
  103. package/dist/client/assets/{cli-auth-success-BjK_2k36.js → cli-auth-success-BDtn-AFe.js} +1 -1
  104. package/dist/client/assets/{cms-settings-editor-DczcBgsg.js → cms-settings-editor-CsJZ2JWJ.js} +1 -1
  105. package/dist/client/assets/{cms-store-drafts-D65g6QDr.js → cms-store-drafts-CpUesISG.js} +1 -1
  106. package/dist/client/assets/{collapsible-bv19Lgop.js → collapsible-CFLPP7ik.js} +1 -1
  107. package/dist/client/assets/{collection-detail-CrdyPuxx.js → collection-detail-rce7XGTo.js} +1 -1
  108. package/dist/client/assets/{collection-display-button-bohOcAnJ.js → collection-display-button-wLEG6d2h.js} +1 -1
  109. package/dist/client/assets/{collection-search-CT3oHQLL.js → collection-search-D4mtl2lW.js} +1 -1
  110. package/dist/client/assets/{collection-table-wrapper-COcHlvPf.js → collection-table-wrapper-uKDi2yIW.js} +1 -1
  111. package/dist/client/assets/{collection-tabs-BbqMtY-J.js → collection-tabs-gk80gI7u.js} +1 -1
  112. package/dist/client/assets/{combobox-C7dFW3mg.js → combobox-BL-eQmFF.js} +1 -1
  113. package/dist/client/assets/{command-BUJZW101.js → command-DIWYmaS8.js} +1 -1
  114. package/dist/client/assets/{companion-mcps-section-OQv-05I3.js → companion-mcps-section-9quq_XQ6.js} +1 -1
  115. package/dist/client/assets/{config-BW2WE8-w.js → config-DhzGUcRP.js} +1 -1
  116. package/dist/client/assets/{connect-BM_qQLsb.js → connect-DKeVPOvy.js} +1 -1
  117. package/dist/client/assets/{connect-key-DaxTwfXl.js → connect-key-B0LVO5Ka.js} +1 -1
  118. package/dist/client/assets/{connect-layout-Dqk87DYY.js → connect-layout-COWUWqaV.js} +1 -1
  119. package/dist/client/assets/{connect-source-dialog-Bo2D6V9J.js → connect-source-dialog-DFNt5bXf.js} +1 -1
  120. package/dist/client/assets/{connection-card-B_Rm3jws.js → connection-card-C1ve-Ly9.js} +1 -1
  121. package/dist/client/assets/{connection-detail-Dya4wQXw.js → connection-detail-DD6UO7o5.js} +1 -1
  122. package/dist/client/assets/{connection-CrDLMjxz.js → connection-e4lDMxce.js} +1 -1
  123. package/dist/client/assets/{connection-form-helpers-BnupWMcv.js → connection-form-helpers-BFwfxdCv.js} +1 -1
  124. package/dist/client/assets/{connection-slug-Dsjc_7jc.js → connection-slug-CN3IP_X_.js} +1 -1
  125. package/dist/client/assets/{connections-CqzzCCFh.js → connections-CJ3MR9ae.js} +1 -1
  126. package/dist/client/assets/{content-tab-xOW2jmWD.js → content-tab-DgTHwQ7e.js} +3 -3
  127. package/dist/client/assets/{context-B52xcJP8.js → context-D1Qkw_8b.js} +1 -1
  128. package/dist/client/assets/{context-menu-C3vl1voD.js → context-menu-CFXK_Trb.js} +1 -1
  129. package/dist/client/assets/{context-shell-CLN1cZ8-.js → context-shell-BQPOJ_jV.js} +3 -3
  130. package/dist/client/assets/{create-organization-dialog-C8w69dn8.js → create-organization-dialog-DSlYVP1u.js} +1 -1
  131. package/dist/client/assets/{daily-pulse-BkhyNjIU.js → daily-pulse-HSiRu4pB.js} +1 -1
  132. package/dist/client/assets/{delete-copy-D7GWyg_y.js → delete-copy-CrF4mbW1.js} +1 -1
  133. package/dist/client/assets/{device-hint-BWoKmEkk.js → device-hint-CMQc3JiU.js} +1 -1
  134. package/dist/client/assets/{discover-ClyGoNdo.js → discover-CIMd8SA9.js} +1 -1
  135. package/dist/client/assets/{domain-settings-Bff7hkhZ.js → domain-settings-DNgt5qit.js} +1 -1
  136. package/dist/client/assets/{drawer-9dr-ukqt.js → drawer-BqGY5hR4.js} +1 -1
  137. package/dist/client/assets/{editor-OtYf9TpJ.js → editor-CaDL1Bs5.js} +1 -1
  138. package/dist/client/assets/{editor-classes-B015z8BR.js → editor-classes-zTHld4GP.js} +1 -1
  139. package/dist/client/assets/{empty-message-DLDkQwTf.js → empty-message-4JAQGaSD.js} +1 -1
  140. package/dist/client/assets/{empty-state-DgS_yB9S.js → empty-state-C87camAE.js} +1 -1
  141. package/dist/client/assets/{empty-state-DGvmXTTx.js → empty-state-Cu_UqeJw.js} +1 -1
  142. package/dist/client/assets/{experiments-tab-choice-C_eMr2Jc.js → experiments-tab-choice-FdBkNqzz.js} +1 -1
  143. package/dist/client/assets/{extract-connection-data-D5LnDq3n.js → extract-connection-data-hN4ABn7b.js} +1 -1
  144. package/dist/client/assets/{feature-gate-BwfJl_-J.js → feature-gate-Cb1_KePK.js} +1 -1
  145. package/dist/client/assets/{feature-paywall-CEAWGxEK.js → feature-paywall-DEMZzOvC.js} +1 -1
  146. package/dist/client/assets/{file-explorer-CsgK4soc.js → file-explorer-jsn2RM_b.js} +1 -1
  147. package/dist/client/assets/{file-preview-Dy_zYo8i.js → file-preview-BS_jZzSv.js} +1 -1
  148. package/dist/client/assets/{file-share-button-DwseFge1.js → file-share-button-DsjWHkH7.js} +1 -1
  149. package/dist/client/assets/{file-type-icon-BBC7AgSm.js → file-type-icon-QYtFdtTf.js} +1 -1
  150. package/dist/client/assets/{folder-icon-Cu3Aqv3z.js → folder-icon-itbm5Dvt.js} +1 -1
  151. package/dist/client/assets/{form-C_3nPlqc.js → form-BhPPsmSo.js} +1 -1
  152. package/dist/client/assets/{frame-navigation-DyI9DOPc.js → frame-navigation-hGBNR6wq.js} +1 -1
  153. package/dist/client/assets/{gateway-client-GUKS8Neg.js → gateway-client-CRRUx8Ce.js} +1 -1
  154. package/dist/client/assets/{general-Cdeh5VuD.js → general-B3UytVfF.js} +1 -1
  155. package/dist/client/assets/{github-icon-F-zWm9rJ.js → github-icon-F0_bvkr_.js} +1 -1
  156. package/dist/client/assets/{held-block-view-myNdCF-d.js → held-block-view-CfeVMOgT.js} +1 -1
  157. package/dist/client/assets/{home-CUGwCNOx.js → home-C6_HDY7T.js} +1 -1
  158. package/dist/client/assets/{home-overview-D0M6VmNP.js → home-overview-CYpa0KSY.js} +1 -1
  159. package/dist/client/assets/{hosted-reconcile-DbZes2_O.js → hosted-reconcile-De4gpWFM.js} +1 -1
  160. package/dist/client/assets/{icon-button-CO-b_Z7N.js → icon-button-BjbG0hRa.js} +1 -1
  161. package/dist/client/assets/{index-CaoQI4w-.js → index-B8K6hAP8.js} +1 -1
  162. package/dist/client/assets/{index-DbrfsNuM.js → index-BUaP43i6.js} +1 -1
  163. package/dist/client/assets/{index-B4Z8qm4O.js → index-Bd_NPBeo.js} +1 -1
  164. package/dist/client/assets/{index-D8oZjzwY.js → index-BeCPK3xm.js} +1 -1
  165. package/dist/client/assets/{index-CEeYBwYa.js → index-BesII7WT.js} +1 -1
  166. package/dist/client/assets/{index-CVv3Fivj.js → index-BwHaXdTj.js} +1 -1
  167. package/dist/client/assets/{index-BbyUQV-V.js → index-CVaM5ZeE.js} +3 -3
  168. package/dist/client/assets/{index-CZNM0ywV.js → index-C_5w1AHm.js} +1 -1
  169. package/dist/client/assets/{index-CUj2rPmp.js → index-ClEu38Yj.js} +1 -1
  170. package/dist/client/assets/{index-DdUaZwED.js → index-D0_6xQwJ.js} +1 -1
  171. package/dist/client/assets/{index-DeCbUCeI.js → index-DAEjmg7g.js} +1 -1
  172. package/dist/client/assets/{index-BWOFXtLm.js → index-DLeLAq8e.js} +1 -1
  173. package/dist/client/assets/{index-Mge-nIe_.js → index-DVH6X5Rn.js} +1 -1
  174. package/dist/client/assets/{index-Bu3usBwV.js → index-DmaFGaGi.js} +1 -1
  175. package/dist/client/assets/{index-C98zqBJi.js → index-DpIIT1S9.js} +1 -1
  176. package/dist/client/assets/{index-kCYHIAlq.js → index-NRdzlZZ7.js} +1 -1
  177. package/dist/client/assets/{index-redirect-CbcSCuPI.js → index-redirect-Clwg2jFo.js} +1 -1
  178. package/dist/client/assets/{index-Aa6DiPpP.js → index-xByX-6ni.js} +1 -1
  179. package/dist/client/assets/{infiniteQueryObserver-DqRBsy9_.js → infiniteQueryObserver-qLxMp_hZ.js} +1 -1
  180. package/dist/client/assets/{infra-billing-CWfj-Pw9.js → infra-billing-Dcs0xWeR.js} +1 -1
  181. package/dist/client/assets/{input-BK3kIY9G.js → input-CAsxTNbE.js} +3 -3
  182. package/dist/client/assets/{input-BG3wFK5M.js → input-dCp-TqpM.js} +1 -1
  183. package/dist/client/assets/{integration-icon-CqVW6T00.js → integration-icon-DhLRYXPe.js} +1 -1
  184. package/dist/client/assets/item-actions-WHVhXm7a.js +1 -0
  185. package/dist/client/assets/{jira-icon-BveDG26q.js → jira-icon-OcSUv3ky.js} +1 -1
  186. package/dist/client/assets/{label-BlFTNuxs.js → label-CXVS8kdg.js} +1 -1
  187. package/dist/client/assets/{layout-CJs8yxSP.js → layout-Dov8MPOD.js} +1 -1
  188. package/dist/client/assets/{legacy-admin-welcome-dialog-BeUx4hhs.js → legacy-admin-welcome-dialog-BRJGAOxb.js} +1 -1
  189. package/dist/client/assets/{legacy-agents-deep-D-0KzS7C.js → legacy-agents-deep-BFTvauud.js} +1 -1
  190. package/dist/client/assets/{legacy-main-redirect-BnbcsFdv.js → legacy-main-redirect-DHWspiCI.js} +1 -1
  191. package/dist/client/assets/library-bs_ixgbx.js +1 -0
  192. package/dist/client/assets/{library-tab-BsPi8uGe.js → library-tab-BiiU2b76.js} +1 -1
  193. package/dist/client/assets/{login-CvKqHfzS.js → login-Bf1xtw_a.js} +1 -1
  194. package/dist/client/assets/{markdown-BLD58IcZ.js → markdown-D1G_ApAH.js} +1 -1
  195. package/dist/client/assets/{mcp-app-renderer-C3N-ooKA.js → mcp-app-renderer-BWzxLu9o.js} +1 -1
  196. package/dist/client/assets/{mcp-oauth-BetyI4Sc.js → mcp-oauth-6A0IaaRT.js} +1 -1
  197. package/dist/client/assets/{mcp-oauth-BBRt-CKi.js → mcp-oauth-BoM6d60B.js} +1 -1
  198. package/dist/client/assets/{members-G2uEV1Et.js → members-BMmA1cFL.js} +1 -1
  199. package/dist/client/assets/{memory-BBzt-gTj.js → memory-B1d8wsQZ.js} +1 -1
  200. package/dist/client/assets/{mock-board-DzuhmO_q.js → mock-board-Bqrxgjfu.js} +3 -3
  201. package/dist/client/assets/{monaco-editor-BTeatlwM.js → monaco-editor-Br4BiDCR.js} +1 -1
  202. package/dist/client/assets/{monitoring-C9ty4kJN.js → monitoring-BDFG8mkP.js} +1 -1
  203. package/dist/client/assets/{monitoring-stats-row-Ca0svB-0.js → monitoring-stats-row-BCf9LmaP.js} +1 -1
  204. package/dist/client/assets/{multi-select-xFJ9DMUE.js → multi-select-BGqTkS9M.js} +1 -1
  205. package/dist/client/assets/{mustache-BB27WkZo.js → mustache-DTb533il.js} +1 -1
  206. package/dist/client/assets/{named-rule-step-DHcxNdON.js → named-rule-step-IErLKB4N.js} +1 -1
  207. package/dist/client/assets/{named-rule-view-Blk7EotW.js → named-rule-view-CSrG2faq.js} +1 -1
  208. package/dist/client/assets/{new-project-dialog-CwWe9JTm.js → new-project-dialog-DUs38Kod.js} +1 -1
  209. package/dist/client/assets/{new-project-store-DI-rcaGT.js → new-project-store-BlpbgUxg.js} +1 -1
  210. package/dist/client/assets/{oauth-callback-ai-provider-DNhExCAX.js → oauth-callback-ai-provider-Bz1S6gz6.js} +1 -1
  211. package/dist/client/assets/{oauth-callback-JurbFJad.js → oauth-callback-yg3ZsqkO.js} +1 -1
  212. package/dist/client/assets/{oauth-consent-Dv-Pk8HZ.js → oauth-consent-Do0vMuz5.js} +1 -1
  213. package/dist/client/assets/{onboarding-NnDc0_K6.js → onboarding-Ofi6UT1T.js} +1 -1
  214. package/dist/client/assets/{openai-conversation-C3QjsSfG.js → openai-conversation-BMIvDBrL.js} +1 -1
  215. package/dist/client/assets/{optimistic-project-sidebar-views-B7gNYHcx.js → optimistic-project-sidebar-views-JVBQmVag.js} +1 -1
  216. package/dist/client/assets/{order-monitor-day-DfBlxxW3.js → order-monitor-day-DC8N4VfM.js} +1 -1
  217. package/dist/client/assets/{organization-choice-CIf8awfg.js → organization-choice-lLJCWKiH.js} +1 -1
  218. package/dist/client/assets/{orgs-D2UEp59O.js → orgs-BitkUNFQ.js} +1 -1
  219. package/dist/client/assets/{own-accounts-section-9LGriAR-.js → own-accounts-section-a0xHyDTB.js} +1 -1
  220. package/dist/client/assets/{pair-Dg8_WzRx.js → pair-DhPLovo9.js} +1 -1
  221. package/dist/client/assets/{parse-sections-DFcHy6a1.js → parse-sections-CUD_BDPf.js} +2 -2
  222. package/dist/client/assets/{plan-DpsDK1nS.js → plan-DcIhFEDT.js} +1 -1
  223. package/dist/client/assets/{plan-ladder-i51kvc_6.js → plan-ladder-DqsaxS0v.js} +1 -1
  224. package/dist/client/assets/{plan-usage-card-Mo9p5apk.js → plan-usage-card-YlbOUHkE.js} +1 -1
  225. package/dist/client/assets/{popover-B2fZ96W0.js → popover-C7DIsR_D.js} +1 -1
  226. package/dist/client/assets/{post-calendar-BxpnvMqZ.js → post-calendar-DrWfwdt5.js} +1 -1
  227. package/dist/client/assets/{post-editor-DA_1qcnl.js → post-editor-CZOAJv6J.js} +1 -1
  228. package/dist/client/assets/{preview-content-D5RMjaD6.js → preview-content-DX4lhI-o.js} +1 -1
  229. package/dist/client/assets/{preview-dialog-C0sVKUR7.js → preview-dialog-B6nTGkO0.js} +1 -1
  230. package/dist/client/assets/{preview-panel-CInuQgv3.js → preview-panel-DBPnLkKg.js} +1 -1
  231. package/dist/client/assets/{preview-tab-D51UeUtA.js → preview-tab-C8023Y5d.js} +3 -3
  232. package/dist/client/assets/{product-picker-dialog-DSDf6Bwa.js → product-picker-dialog-DtdAnUNF.js} +1 -1
  233. package/dist/client/assets/{profile-BclswKhx.js → profile-BcYwIH2I.js} +1 -1
  234. package/dist/client/assets/{project-app-view-ke3ZuGxF.js → project-app-view-DgadcGQJ.js} +1 -1
  235. package/dist/client/assets/{project-apps-fbR4xDRx.js → project-apps-CYcaMcMp.js} +1 -1
  236. package/dist/client/assets/{project-icon-BbR0XGm1.js → project-icon-Dfd0VA-p.js} +1 -1
  237. package/dist/client/assets/{project-index-lWz60EWQ.js → project-index-xN92EcRd.js} +1 -1
  238. package/dist/client/assets/project-reports-CGW6eayA.js +1 -0
  239. package/dist/client/assets/project-tasks-C43FCGAy.js +1 -0
  240. package/dist/client/assets/{projects-BM5L61A_.js → projects-CXdx3Dl_.js} +1 -1
  241. package/dist/client/assets/{projects-empty-state-Vmw2nbR-.js → projects-empty-state-CzdvD24g.js} +1 -1
  242. package/dist/client/assets/{prompts-DEXjOdXC.js → prompts-CDQm3FLn.js} +1 -1
  243. package/dist/client/assets/record-editor-C3FdD5yp.js +1 -0
  244. package/dist/client/assets/{redirect-editor-_jG1X_eI.js → redirect-editor-sN6SrNHY.js} +1 -1
  245. package/dist/client/assets/reports-2Qz0K09m.js +1 -0
  246. package/dist/client/assets/{reports-_8k_JS7q.js → reports-BvcYDhJW.js} +1 -1
  247. package/dist/client/assets/{reports-onboarding-8vGx8eDL.js → reports-onboarding-D-jmFMWH.js} +1 -1
  248. package/dist/client/assets/{reports-tab-Caka1Haa.js → reports-tab-B09b1752.js} +2 -2
  249. package/dist/client/assets/repositories-B8VKLMj3.js +1 -0
  250. package/dist/client/assets/{repositories-B9q1-DTL.js → repositories-CKnksB8A.js} +1 -1
  251. package/dist/client/assets/{repository-binding-CYxPGVF9.js → repository-binding-SBp01hsF.js} +1 -1
  252. package/dist/client/assets/{repository-picker-BwLPliw3.js → repository-picker-Bb3eDhJh.js} +1 -1
  253. package/dist/client/assets/{require-capability-BdZtDVPs.js → require-capability-I0q9rV_W.js} +1 -1
  254. package/dist/client/assets/{required-auth-layout-CEv7xMbD.js → required-auth-layout-HeXAWStb.js} +1 -1
  255. package/dist/client/assets/{reset-password-DcjIR0v2.js → reset-password-Da63vXDd.js} +1 -1
  256. package/dist/client/assets/{resizable-CDz_Gn5D.js → resizable-Dal_SrMT.js} +1 -1
  257. package/dist/client/assets/{resolve-tab-icon-DSU20OFN.js → resolve-tab-icon-Nu8wTkGF.js} +1 -1
  258. package/dist/client/assets/{review-settings-4ZKA9iW7.js → review-settings-kXzwk6tL.js} +1 -1
  259. package/dist/client/assets/{role-color-CAtp2x5d.js → role-color-91o2jRUJ.js} +1 -1
  260. package/dist/client/assets/{roles-B7qeAHn4.js → roles-BNgOkRzM.js} +1 -1
  261. package/dist/client/assets/{route-CjIHbnSM.js → route-BwI14psC.js} +1 -1
  262. package/dist/client/assets/route-C881isst.js +1 -0
  263. package/dist/client/assets/route-dxs0ypyz.js +1 -0
  264. package/dist/client/assets/{route-page-header-BtRFuS1p.js → route-page-header-wdtwteSz.js} +1 -1
  265. package/dist/client/assets/{sandbox-git-api-a72xh_lB.js → sandbox-git-api-DskKv348.js} +1 -1
  266. package/dist/client/assets/{sandbox-lifecycle-context-BgQ_JLd0.js → sandbox-lifecycle-context-Dcv-YAeH.js} +1 -1
  267. package/dist/client/assets/{save-status-BXi_cq_U.js → save-status-DIjUL42_.js} +1 -1
  268. package/dist/client/assets/{schema-DvznvyNF.js → schema-CjMjt5K4.js} +1 -1
  269. package/dist/client/assets/{schema-BoCycph4.js → schema-j--PtY7_.js} +1 -1
  270. package/dist/client/assets/{scroll-area-BJzMdjhR.js → scroll-area-Dpz9D3v4.js} +1 -1
  271. package/dist/client/assets/{search-input-Dx1nMhkR.js → search-input-D_wdj4jI.js} +1 -1
  272. package/dist/client/assets/{search-toggle-CUowc2bs.js → search-toggle-BitqNf5p.js} +1 -1
  273. package/dist/client/assets/{secret-picker-CzcUm0AA.js → secret-picker-DTVngvlq.js} +1 -1
  274. package/dist/client/assets/{secrets-T6PONWpM.js → secrets-vR9oorkt.js} +1 -1
  275. package/dist/client/assets/{section-array-field-Dau5fGuc.js → section-array-field-BKLH6fnp.js} +1 -1
  276. package/dist/client/assets/{sections-B_pt0duw.js → sections-CBOwtnya.js} +1 -1
  277. package/dist/client/assets/{sections-editor-B1dRi1DP.js → sections-editor-DxAL6tAT.js} +1 -1
  278. package/dist/client/assets/{select-CaROtCr6.js → select-22fWDASj.js} +1 -1
  279. package/dist/client/assets/{select-model-B_uQ8JoM.js → select-model-Bi-mbfMF.js} +1 -1
  280. package/dist/client/assets/{seo-editor-CgBBfTmC.js → seo-editor-Cl4SCyq4.js} +1 -1
  281. package/dist/client/assets/{separator-DzpcrIme.js → separator-C4GYTHJM.js} +1 -1
  282. package/dist/client/assets/{session-runtime-B3M5aN-q.js → session-runtime-P5u-r0JQ.js} +1 -1
  283. package/dist/client/assets/settings-tab-CM7_h3Nz.js +1 -0
  284. package/dist/client/assets/{sheet-um4noh5c.js → sheet-Cl24m9Dt.js} +1 -1
  285. package/dist/client/assets/{shell-layout-49bNXIez.js → shell-layout-IodEaLm-.js} +1 -1
  286. package/dist/client/assets/{site-draft-actions-DK9guIkf.js → site-draft-actions-D2gT_6dZ.js} +1 -1
  287. package/dist/client/assets/{site-draft-view-WvygLXbI.js → site-draft-view-RlxcXN_a.js} +1 -1
  288. package/dist/client/assets/site-editor-BC1hRmjS.js +1 -0
  289. package/dist/client/assets/{site-editor-toast-CkErPR2A.js → site-editor-toast-wPURFHKm.js} +1 -1
  290. package/dist/client/assets/{skills-DOI-sQ-e.js → skills-DIRIAKZw.js} +1 -1
  291. package/dist/client/assets/{slider-BSl20SQg.js → slider-CNy9L88L.js} +1 -1
  292. package/dist/client/assets/{sortable.esm-CqIiSw1u.js → sortable.esm-oWRIjgQS.js} +1 -1
  293. package/dist/client/assets/{sso-BjUVysiz.js → sso-v22tIMoH.js} +1 -1
  294. package/dist/client/assets/{suggestion-Ddmtk3Nb.js → suggestion-Baw7Yzm0.js} +1 -1
  295. package/dist/client/assets/{super-agent-icon-DoovhGsp.js → super-agent-icon-ytwAD9wa.js} +1 -1
  296. package/dist/client/assets/{switch-BH2QiW4s.js → switch-CRzfqWoA.js} +1 -1
  297. package/dist/client/assets/{synced-repos-CWR0L5YE.js → synced-repos-Dy37ZZqV.js} +1 -1
  298. package/dist/client/assets/{tab-icon-glyph-DOr4PjkR.js → tab-icon-glyph-BrUkcXhP.js} +1 -1
  299. package/dist/client/assets/{table-C92UEJKy.js → table-BOE6OmXA.js} +1 -1
  300. package/dist/client/assets/{tabs-NIuu6bj4.js → tabs-C3fE6Psb.js} +1 -1
  301. package/dist/client/assets/{task-board-_DSzqPWi.js → task-board-CMA_Vl5R.js} +1 -1
  302. package/dist/client/assets/{task-key-CaAm1Jwf.js → task-key-B_pRAaeZ.js} +1 -1
  303. package/dist/client/assets/{task-route-DLJKfX0K.js → task-route-TsuAukRy.js} +1 -1
  304. package/dist/client/assets/{task-status-DA1DjG6p.js → task-status-D8EWioli.js} +1 -1
  305. package/dist/client/assets/{taskboard-analytics-Dh8Uts6G.js → taskboard-analytics-DtX9ncJb.js} +1 -1
  306. package/dist/client/assets/tasks-BJsiSsYA.js +1 -0
  307. package/dist/client/assets/{tasks-BbQQWzuJ.js → tasks-vBObg92w.js} +1 -1
  308. package/dist/client/assets/{textarea-Co6WXg3Y.js → textarea-DcoxxIUh.js} +1 -1
  309. package/dist/client/assets/{thread-analytics-DXYu0MbV.js → thread-analytics--NcCMu5e.js} +1 -1
  310. package/dist/client/assets/{thread-button-8Paou_ey.js → thread-button-Bniz01x0.js} +1 -1
  311. package/dist/client/assets/{thread-intent-BNjS3eKm.js → thread-intent-CoYehnqV.js} +1 -1
  312. package/dist/client/assets/{thread-route-B-vrKdst.js → thread-route-DO5G4fyj.js} +1 -1
  313. package/dist/client/assets/{thread-route-B-bmrR_e.js → thread-route-Z1Z5ssCY.js} +1 -1
  314. package/dist/client/assets/{thread-sheet-body-BruhHKIO.js → thread-sheet-body-BCH0xSuy.js} +1 -1
  315. package/dist/client/assets/{time-range-picker-DLzufi0f.js → time-range-picker-B0OK_lkw.js} +1 -1
  316. package/dist/client/assets/{toggle-group-D14vFqFg.js → toggle-group-B9BlXaiJ.js} +1 -1
  317. package/dist/client/assets/{tool-set-selector-EC4Q3po8.js → tool-set-selector-eEzFPJL5.js} +1 -1
  318. package/dist/client/assets/{toolbar-icon-button-CKwtmkGZ.js → toolbar-icon-button-DZ3stuJ7.js} +1 -1
  319. package/dist/client/assets/{tooltip-CINPZAUE.js → tooltip-BE7tm7Mf.js} +1 -1
  320. package/dist/client/assets/{tooltipContext-B7kIVm-_.js → tooltipContext-Be70_7Lj.js} +1 -1
  321. package/dist/client/assets/{track-B0303apM.js → track-oDMZHdN1.js} +1 -1
  322. package/dist/client/assets/{types-KLF33bAU.js → types-BHVRgT6Z.js} +1 -1
  323. package/dist/client/assets/{url-slug-BhLnqovl.js → url-slug-BQQMH5p3.js} +1 -1
  324. package/dist/client/assets/{usage-stats-DTw2_3QF.js → usage-stats-CKkwGKMs.js} +1 -1
  325. package/dist/client/assets/{use-ai-providers-BxpYBICM.js → use-ai-providers-W8m38fvZ.js} +1 -1
  326. package/dist/client/assets/{use-api-keys-DEL0nRO1.js → use-api-keys-Ws9ysWKk.js} +1 -1
  327. package/dist/client/assets/{use-apply-named-rule-CRVOk9Kn.js → use-apply-named-rule-B0O21RDl.js} +1 -1
  328. package/dist/client/assets/use-ask-in-chat-DRKLVwN6.js +1 -0
  329. package/dist/client/assets/{use-automations-Da6nezmh.js → use-automations-DJCEZdET.js} +1 -1
  330. package/dist/client/assets/{use-autosave-BHk7ZJHa.js → use-autosave-Kxt0sMEW.js} +1 -1
  331. package/dist/client/assets/use-blocks-v8-project-Fa0Yvrmb.js +1 -0
  332. package/dist/client/assets/use-blog-view-CVmli7Be.js +1 -0
  333. package/dist/client/assets/{use-chat-layout-state-BmTxsTjG.js → use-chat-layout-state-wRbJriRA.js} +1 -1
  334. package/dist/client/assets/{use-cms-publish-actions-wU3dtco2.js → use-cms-publish-actions-DeAZ6OUg.js} +1 -1
  335. package/dist/client/assets/{use-connect-companion-N3ywRKD4.js → use-connect-companion-DNCMpBe2.js} +1 -1
  336. package/dist/client/assets/{use-connection-Q1OVyR-K.js → use-connection-nJCVu3xN.js} +1 -1
  337. package/dist/client/assets/{use-content-sync-D1DcK5RP.js → use-content-sync-h66OBmKR.js} +1 -1
  338. package/dist/client/assets/{use-copy-CHLJB-eJ.js → use-copy-DDDkhesX.js} +1 -1
  339. package/dist/client/assets/{use-current-view-DWPEJKMo.js → use-current-view-C2_v6kaa.js} +1 -1
  340. package/dist/client/assets/{use-date-fns-locale-Ch-Feesx.js → use-date-fns-locale-CLS4J0hO.js} +1 -1
  341. package/dist/client/assets/{use-debounced-autosave-C330kFl7.js → use-debounced-autosave-D1ESiwfL.js} +1 -1
  342. package/dist/client/assets/{use-debounced-value-CDV_Hdj_.js → use-debounced-value-BP25cxWQ.js} +1 -1
  343. package/dist/client/assets/{use-deco-credits-BH9MKLeU.js → use-deco-credits-CI-cXKm_.js} +1 -1
  344. package/dist/client/assets/{use-decopilot-events-Bzy3gyOh.js → use-decopilot-events-zFsXNFOX.js} +1 -1
  345. package/dist/client/assets/{use-delete-block-Ds8KKf4b.js → use-delete-block-BdMBmq7W.js} +1 -1
  346. package/dist/client/assets/{use-delete-connection-CUYN49rH.js → use-delete-connection-DOj9KZFD.js} +1 -1
  347. package/dist/client/assets/{use-deployment-admin-44Nr2y3l.js → use-deployment-admin-lFvWnpXE.js} +1 -1
  348. package/dist/client/assets/{use-entitlements-D_bekXoy.js → use-entitlements-DG3qYqcL.js} +1 -1
  349. package/dist/client/assets/{use-fast-preview-draft-url-BJcuelFd.js → use-fast-preview-draft-url-etvVckD4.js} +1 -1
  350. package/dist/client/assets/{use-file-configs-Dv6Dn9-s.js → use-file-configs-BzR-Y9dE.js} +1 -1
  351. package/dist/client/assets/{use-id-selection-B5eFUC_T.js → use-id-selection-DRjxflT0.js} +1 -1
  352. package/dist/client/assets/{use-in-settings-DsvAK9xJ.js → use-in-settings-Bm0lPFu0.js} +1 -1
  353. package/dist/client/assets/{use-inbox-feed-DUOXuaWM.js → use-inbox-feed-DSxEsuWs.js} +1 -1
  354. package/dist/client/assets/{use-infinite-scroll-K5fXsA2s.js → use-infinite-scroll-BGiryDzj.js} +1 -1
  355. package/dist/client/assets/{use-join-requests-ne0-a4Uk.js → use-join-requests-VFTKLi4-.js} +1 -1
  356. package/dist/client/assets/{use-main-panel-tabs-ZUH2Q11R.js → use-main-panel-tabs-B28iAwv2.js} +1 -1
  357. package/dist/client/assets/{use-mcp-auth-status-BydVHpTh.js → use-mcp-auth-status-BO_9fsmA.js} +1 -1
  358. package/dist/client/assets/{use-mcp-client-KtY-iAqe.js → use-mcp-client-CfpXvRRg.js} +1 -1
  359. package/dist/client/assets/{use-mcp-prompts-hYH8zGss.js → use-mcp-prompts-sBVI4CUs.js} +1 -1
  360. package/dist/client/assets/{use-mcp-tools-Bkf2GErZ.js → use-mcp-tools-DiWmX9mb.js} +1 -1
  361. package/dist/client/assets/{use-mobile-BFnx6XU5.js → use-mobile--Tjrw6qZ.js} +1 -1
  362. package/dist/client/assets/{use-move-blocks-CTFo8anC.js → use-move-blocks-ZEcxPSUc.js} +1 -1
  363. package/dist/client/assets/{use-navigate-to-agent-DzfMLwHb.js → use-navigate-to-agent-n78PAis4.js} +1 -1
  364. package/dist/client/assets/{use-never-published-DvQ5FOx0.js → use-never-published-Dn9RsLj6.js} +1 -1
  365. package/dist/client/assets/{use-org-fs-BQXLoGp0.js → use-org-fs-C9Y2OqHu.js} +1 -1
  366. package/dist/client/assets/{use-org-notice-DiGO_5sP.js → use-org-notice-Vmhw8z6J.js} +1 -1
  367. package/dist/client/assets/{use-org-repo-syncs-DXQDNA2H.js → use-org-repo-syncs-D5tEPx6Y.js} +1 -1
  368. package/dist/client/assets/{use-org-sso-BqAhMDLF.js → use-org-sso-C9w0Ouri.js} +1 -1
  369. package/dist/client/assets/{use-organization-settings-C_xGXqYD.js → use-organization-settings-8NpeLuIb.js} +1 -1
  370. package/dist/client/assets/{use-panel-navigate-m_WUKcO1.js → use-panel-navigate-DOmD0cOr.js} +1 -1
  371. package/dist/client/assets/{use-project-native-view-presence-DoNrSMI0.js → use-project-native-view-presence-CsUxr9h1.js} +1 -1
  372. package/dist/client/assets/{use-project-scope-tAmzLFmo.js → use-project-scope-CK6HNuJk.js} +1 -1
  373. package/dist/client/assets/{use-recent-apps-D4SaJyU5.js → use-recent-apps-DtZ_oOXI.js} +1 -1
  374. package/dist/client/assets/{use-reports-diagnostic-CQf2IKUc.js → use-reports-diagnostic-BuGXSHL0.js} +1 -1
  375. package/dist/client/assets/{use-sandbox-events-Choa45Ad.js → use-sandbox-events-BUUNlKOB.js} +1 -1
  376. package/dist/client/assets/{use-secrets-B89UQslL.js → use-secrets-DeOcZ3D6.js} +1 -1
  377. package/dist/client/assets/{use-section-preview-base-oNURhBRp.js → use-section-preview-base-CRfx6Dcm.js} +1 -1
  378. package/dist/client/assets/{use-sidebar-collapsed-DonGXxtx.js → use-sidebar-collapsed-wY2Dm3dx.js} +1 -1
  379. package/dist/client/assets/{use-tags-DlbCsNcX.js → use-tags-C3PMggTA.js} +1 -1
  380. package/dist/client/assets/{use-task-board-analytics-CrP9Mh4i.js → use-task-board-analytics-CmH8lHS3.js} +1 -1
  381. package/dist/client/assets/{use-task-board-item-prs-DyqixuOS.js → use-task-board-item-prs-CDIVhegm.js} +1 -1
  382. package/dist/client/assets/{use-task-board-items-FrK4WjzX.js → use-task-board-items-DwaqQhP2.js} +1 -1
  383. package/dist/client/assets/{use-task-board-prompts-JQ5bYVQJ.js → use-task-board-prompts-Dx6c7nxc.js} +1 -1
  384. package/dist/client/assets/{use-task-metadata-D2mdWA_p.js → use-task-metadata-CBOHiJnt.js} +1 -1
  385. package/dist/client/assets/{use-thread-outputs-BYENDfew.js → use-thread-outputs-CM1LQ3uG.js} +1 -1
  386. package/dist/client/assets/{use-view-draft-kind-eAKU4tzG.js → use-view-draft-kind-CbWFzDck.js} +1 -1
  387. package/dist/client/assets/{use-voice-input-CFZw5CCV.js → use-voice-input-DkEbCj1p.js} +1 -1
  388. package/dist/client/assets/useInfiniteQuery-BjfOgabm.js +1 -0
  389. package/dist/client/assets/{useQueries-DFX8Ra2q.js → useQueries-CU2KVK5T.js} +1 -1
  390. package/dist/client/assets/useSuspenseInfiniteQuery-Bg1ld6SV.js +1 -0
  391. package/dist/client/assets/{users-CpjXg9O4.js → users-DEnH6Zg2.js} +1 -1
  392. package/dist/client/assets/{utils-C_wnF1Qr.js → utils-BxePB1pN.js} +1 -1
  393. package/dist/client/assets/{variant-calendar-CNAmWyjo.js → variant-calendar-Bg-y51f7.js} +1 -1
  394. package/dist/client/assets/{variant-matcher-override-Dq-o59Sr.js → variant-matcher-override-hWj7NeJW.js} +1 -1
  395. package/dist/client/assets/{view-header-DFmoKFz1.js → view-header-CiAGksug.js} +1 -1
  396. package/dist/client/assets/{virtual-mcp-BL-2RDhS.js → virtual-mcp-wO4oF6ov.js} +1 -1
  397. package/dist/client/assets/{watch-sse-pool-TBuzagYQ.js → watch-sse-pool-U2FTQA43.js} +1 -1
  398. package/dist/client/index.html +1 -1
  399. package/dist/server/server.js +1 -1
  400. package/package.json +1 -1
  401. package/dist/client/assets/agent-app-BplGduEL.js +0 -1
  402. package/dist/client/assets/agent-deck-DcBq-EFc.js +0 -1
  403. package/dist/client/assets/agent-experiments-Db41C8mK.js +0 -1
  404. package/dist/client/assets/agent-file-CCf39Rtq.js +0 -1
  405. package/dist/client/assets/agent-library-DPkauleQ.js +0 -1
  406. package/dist/client/assets/agent-library-file-DBFbWEdb.js +0 -1
  407. package/dist/client/assets/agent-overview-w61B53CG.js +0 -1
  408. package/dist/client/assets/agent-settings-DhAam1Kq.js +0 -1
  409. package/dist/client/assets/agent-site-editor-code-B7ydMNRc.js +0 -2
  410. package/dist/client/assets/agent-site-editor-content-DGHE_na5.js +0 -1
  411. package/dist/client/assets/agent-site-editor-preview-B2KHkUGc.js +0 -1
  412. package/dist/client/assets/agent-view-2ZyI-5m_.js +0 -1
  413. package/dist/client/assets/api-keys-QeNKM9--.js +0 -1
  414. package/dist/client/assets/item-actions-BR73Lbpo.js +0 -1
  415. package/dist/client/assets/library-D1GvJnHB.js +0 -1
  416. package/dist/client/assets/project-reports-B9Ihgtjs.js +0 -1
  417. package/dist/client/assets/project-tasks-BlyYNsZd.js +0 -1
  418. package/dist/client/assets/record-editor-5moRR35h.js +0 -1
  419. package/dist/client/assets/reports-BRR7RsFA.js +0 -1
  420. package/dist/client/assets/repositories-DJEaM14h.js +0 -1
  421. package/dist/client/assets/route-D1xX0HWw.js +0 -1
  422. package/dist/client/assets/route-DxBgurmK.js +0 -1
  423. package/dist/client/assets/settings-tab-dHZPtR7N.js +0 -1
  424. package/dist/client/assets/site-editor-CD68AWh1.js +0 -1
  425. package/dist/client/assets/tasks-CpE_irof.js +0 -1
  426. package/dist/client/assets/use-ask-in-chat-DbbisiOd.js +0 -1
  427. package/dist/client/assets/use-blocks-v8-project-CTDs5jlx.js +0 -1
  428. package/dist/client/assets/use-blog-view-B5vAwn2e.js +0 -1
  429. package/dist/client/assets/useInfiniteQuery-L4kwu3zj.js +0 -1
  430. package/dist/client/assets/useSuspenseInfiniteQuery-B00pnfIH.js +0 -1
@@ -1 +1 @@
1
- import{c as x,ax as d,b as j,j as i}from"./index-BbyUQV-V.js";import{t as E}from"./Users01-BF_7Ge84.js";const R=/^[A-Za-z0-9_.-]+$/;function b(f){const e=x.c(15),{field:p,secretById:t}=f,s=j(),n=p.value||"";if(!n)return null;let l;e[0]!==n||e[1]!==t?(l=t.get(n),e[0]=n,e[1]=t,e[2]=l):l=e[2];const c=l;if(!c){let a;e[3]!==n||e[4]!==s?(a=s("sandbox.envVarsField.missingSecret",{id:n}),e[3]=n,e[4]=s,e[5]=a):a=e[5];let u;return e[6]!==a?(u=i.jsx("span",{className:"text-destructive",children:a}),e[6]=a,e[7]=u):u=e[7],u}let o;e[8]!==c.scope?(o=i.jsx(N,{scope:c.scope}),e[8]=c.scope,e[9]=o):o=e[9];let r;e[10]!==c.name?(r=i.jsx("span",{className:"truncate font-mono",children:c.name}),e[10]=c.name,e[11]=r):r=e[11];let m;return e[12]!==o||e[13]!==r?(m=i.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate",children:[o,r]}),e[12]=o,e[13]=r,e[14]=m):m=e[14],m}function N(f){const e=x.c(2),{scope:p}=f,t=p==="user"?d:E;let s;return e[0]!==t?(s=i.jsx(t,{className:"size-3 text-muted-foreground"}),e[0]=t,e[1]=s):s=e[1],s}export{b as S,R as a,N as b};
1
+ import{c as x,ax as d,b as j,j as i}from"./index-CVaM5ZeE.js";import{t as E}from"./Users01-Dy9NXp21.js";const R=/^[A-Za-z0-9_.-]+$/;function b(f){const e=x.c(15),{field:p,secretById:t}=f,s=j(),n=p.value||"";if(!n)return null;let l;e[0]!==n||e[1]!==t?(l=t.get(n),e[0]=n,e[1]=t,e[2]=l):l=e[2];const c=l;if(!c){let a;e[3]!==n||e[4]!==s?(a=s("sandbox.envVarsField.missingSecret",{id:n}),e[3]=n,e[4]=s,e[5]=a):a=e[5];let u;return e[6]!==a?(u=i.jsx("span",{className:"text-destructive",children:a}),e[6]=a,e[7]=u):u=e[7],u}let o;e[8]!==c.scope?(o=i.jsx(N,{scope:c.scope}),e[8]=c.scope,e[9]=o):o=e[9];let r;e[10]!==c.name?(r=i.jsx("span",{className:"truncate font-mono",children:c.name}),e[10]=c.name,e[11]=r):r=e[11];let m;return e[12]!==o||e[13]!==r?(m=i.jsxs("span",{className:"inline-flex items-center gap-1.5 truncate",children:[o,r]}),e[12]=o,e[13]=r,e[14]=m):m=e[14],m}function N(f){const e=x.c(2),{scope:p}=f,t=p==="user"?d:E;let s;return e[0]!==t?(s=i.jsx(t,{className:"size-3 text-muted-foreground"}),e[0]=t,e[1]=s):s=e[1],s}export{b as S,R as a,N as b};
@@ -1 +1 @@
1
- import{c as j,b as N,j as s,n as C,hq as F,R as k,r as y,d_ as L,B as _,ax as O,af as T,D as B,v as R,w as A,x as q,aS as I,I as D,y as V,t as z,gf as H}from"./index-BbyUQV-V.js";import{i as G}from"./AlertCircle-Di8a-UWV.js";import{s as J}from"./Plus-C2jbSKfe.js";import{t as K}from"./Users01-BF_7Ge84.js";import{E as M}from"./empty-state-DgS_yB9S.js";import{L as w}from"./label-BlFTNuxs.js";import{S as Q,b as U,a as W,d as X,c as P}from"./select-CaROtCr6.js";import{T as Y}from"./textarea-Co6WXg3Y.js";import{u as Z,a as ee}from"./use-secrets-B89UQslL.js";import{R as te}from"./require-capability-BdZtDVPs.js";import"./index-BdQq_4o_.js";import"./index-kCYHIAlq.js";import"./ChevronDown-COkNoLwk.js";import"./ChevronUp-C-YGqatN.js";import"./access-gate-ys146buF.js";import"./capability-load-error-D-MJtSCR.js";function se(t){const e=j.c(6),{error:r}=t,i=N();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(G,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==n?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=l):l=e[5],l}function re(t){const e=j.c(8),{scope:r}=t,i=N(),c=r==="user"?O:K;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const l=n;let a;e[3]!==c?(a=s.jsx(c,{size:12}),e[3]=c,e[4]=a):a=e[4];let m;return e[5]!==l||e[6]!==a?(m=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[a,l]}),e[5]=l,e[6]=a,e[7]=m):m=e[7],m}function $(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(T,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(re,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let l;e[5]!==c||e[6]!==n?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=l):l=e[7];let a;e[8]!==r.description?(a=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=a):a=e[9];let m;e[10]!==l||e[11]!==a?(m=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[l,a]})]}),e[10]=l,e[11]=a,e[12]=m):m=e[12];let d;e[13]!==r.createdAt?(d=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=d):d=e[14];let u;e[15]!==d?(u=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:d}),e[15]=d,e[16]=u):u=e[16];let x;return e[17]!==m||e[18]!==u?(x=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,u]}),e[17]=m,e[18]=u,e[19]=x):x=e[19],x}function ne(t){const e=j.c(9),{action:r}=t,i=N();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(T,{}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==i?(l=i("settings.secrets.emptyDescription"),e[3]=i,e[4]=l):l=e[4];let a;return e[5]!==r||e[6]!==n||e[7]!==l?(a=s.jsx(H,{children:s.jsx(M,{size:"inline",icon:c,title:n,description:l,children:r})}),e[5]=r,e[6]=n,e[7]=l,e[8]=a):a=e[8],a}function E({open:t,onOpenChange:e}){const r=N(),[i,c]=y.useState("organization"),[n,l]=y.useState(""),[a,m]=y.useState(""),[d,u]=y.useState(""),x=ee();function g(){c("organization"),l(""),m(""),u("")}function p(){g(),e(!1)}async function S(o){if(o.preventDefault(),!(!n.trim()||!a))try{await x.mutateAsync({scope:i,name:n.trim(),value:a,description:d.trim()||void 0}),z.success(r("settings.secrets.secretCreated",{name:n.trim()})),p()}catch(f){z.error(f instanceof Error?f.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(B,{open:t,onOpenChange:o=>{o?e(o):p()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(q,{children:r("settings.secrets.newSecretTitle")}),s.jsx(I,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:S,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(Q,{value:i,onValueChange:o=>c(o),children:[s.jsx(U,{id:"secret-scope",children:s.jsx(W,{})}),s.jsxs(X,{children:[s.jsx(P,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(P,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(D,{id:"secret-name",value:n,onChange:o=>l(o.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(D,{id:"secret-value",type:"password",value:a,onChange:o=>m(o.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Y,{id:"secret-description",value:d,onChange:o=>u(o.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:p,disabled:x.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:x.isPending||!n.trim()||!a,children:x.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function ie(){const t=j.c(34),e=N(),r=Z(),[i,c]=y.useState(!1);let n,l;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>c(!0),l=s.jsx(J,{size:14}),t[0]=n,t[1]=l):(n=t[0],l=t[1]);let a;t[2]!==e?(a=e("settings.secrets.newSecret"),t[2]=e,t[3]=a):a=t[3];let m;t[4]!==a?(m=s.jsx(C.Actions,{children:s.jsxs(_,{size:"sm",onClick:n,children:[l,a]})}),t[4]=a,t[5]=m):m=t[5];const d=m;if(r.length===0){let o;t[6]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ne,{action:!1}),t[6]=o):o=t[6];let f;t[7]!==i?(f=s.jsx(E,{open:i,onOpenChange:c}),t[7]=i,t[8]=f):f=t[8];let h;return t[9]!==d||t[10]!==f?(h=s.jsxs(s.Fragment,{children:[d,o,f]}),t[9]=d,t[10]=f,t[11]=h):h=t[11],h}let u,x,g;if(t[12]!==d||t[13]!==r||t[14]!==e){const o=r.filter(oe),f=r.filter(ae),h=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let b;t[18]!==r.length||t[19]!==e||t[20]!==h?(b=e(h,{count:r.length}),t[18]=r.length,t[19]=e,t[20]=h,t[21]=b):b=t[21];let v;t[22]!==b?(v=s.jsx("p",{className:"text-sm text-muted-foreground",children:b}),t[22]=b,t[23]=v):v=t[23],t[24]!==d||t[25]!==v?(u=s.jsxs("div",{className:"flex items-center justify-between",children:[v,d]}),t[24]=d,t[25]=v,t[26]=u):u=t[26],x=o.length>0?s.jsxs("section",{className:"surface p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:o.map(le)})]}):null,g=f.length>0?s.jsxs("section",{className:"surface p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:f.map(ce)})]}):null,t[12]=d,t[13]=r,t[14]=e,t[15]=u,t[16]=x,t[17]=g}else u=t[15],x=t[16],g=t[17];let p;t[27]!==i?(p=s.jsx(E,{open:i,onOpenChange:c}),t[27]=i,t[28]=p):p=t[28];let S;return t[29]!==u||t[30]!==x||t[31]!==g||t[32]!==p?(S=s.jsxs(s.Fragment,{children:[u,x,g,p]}),t[29]=u,t[30]=x,t[31]=g,t[32]=p,t[33]=S):S=t[33],S}function ce(t){return s.jsx($,{secret:t},t.id)}function le(t){return s.jsx($,{secret:t},t.id)}function ae(t){return t.scope==="user"}function oe(t){return t.scope==="organization"}function me(){const t=j.c(7),e=N();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(k,{fallback:de,children:s.jsx(y.Suspense,{fallback:s.jsx(L,{className:"h-32 w-full"}),children:s.jsx(ie,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Container,{children:s.jsxs(F,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function de(t){const{error:e}=t;return s.jsx(se,{error:e??new Error("Failed to load secrets")})}function ze(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{capability:"secrets:manage",area:"secrets",children:s.jsx(me,{})}),t[0]=e):e=t[0],e}export{ze as default};
1
+ import{c as j,b as N,j as s,n as C,hq as F,R as k,r as y,d_ as L,B as _,ax as O,af as T,D as B,v as R,w as A,x as q,aS as I,I as D,y as V,t as z,gf as H}from"./index-CVaM5ZeE.js";import{i as G}from"./AlertCircle-D-3RwTjD.js";import{s as J}from"./Plus-B1jxL8_s.js";import{t as K}from"./Users01-Dy9NXp21.js";import{E as M}from"./empty-state-C87camAE.js";import{L as w}from"./label-CXVS8kdg.js";import{S as Q,b as U,a as W,d as X,c as P}from"./select-22fWDASj.js";import{T as Y}from"./textarea-DcoxxIUh.js";import{u as Z,a as ee}from"./use-secrets-DeOcZ3D6.js";import{R as te}from"./require-capability-I0q9rV_W.js";import"./index-BdQq_4o_.js";import"./index-NRdzlZZ7.js";import"./ChevronDown-Clw2gzwU.js";import"./ChevronUp-mwSMyirQ.js";import"./access-gate-CjOHgFHb.js";import"./capability-load-error-O-_btDT9.js";function se(t){const e=j.c(6),{error:r}=t,i=N();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(G,{size:16}),e[0]=c):c=e[0];let n;e[1]!==r.message||e[2]!==i?(n=i("settings.secrets.failedToLoadError",{error:r.message}),e[1]=r.message,e[2]=i,e[3]=n):n=e[3];let l;return e[4]!==n?(l=s.jsxs("div",{className:"p-4 rounded-md bg-destructive/10 text-destructive flex items-center gap-2",children:[c,s.jsx("span",{className:"text-sm font-medium",children:n})]}),e[4]=n,e[5]=l):l=e[5],l}function re(t){const e=j.c(8),{scope:r}=t,i=N(),c=r==="user"?O:K;let n;e[0]!==r||e[1]!==i?(n=i(r==="user"?"settings.secrets.scopePrivate":"settings.secrets.scopeOrganization"),e[0]=r,e[1]=i,e[2]=n):n=e[2];const l=n;let a;e[3]!==c?(a=s.jsx(c,{size:12}),e[3]=c,e[4]=a):a=e[4];let m;return e[5]!==l||e[6]!==a?(m=s.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-muted text-muted-foreground text-xs",children:[a,l]}),e[5]=l,e[6]=a,e[7]=m):m=e[7],m}function $(t){const e=j.c(20),{secret:r}=t;let i;e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"size-9 rounded-md bg-muted flex items-center justify-center shrink-0",children:s.jsx(T,{size:16,className:"text-muted-foreground"})}),e[0]=i):i=e[0];let c;e[1]!==r.name?(c=s.jsx("span",{className:"font-medium text-sm truncate",children:r.name}),e[1]=r.name,e[2]=c):c=e[2];let n;e[3]!==r.scope?(n=s.jsx(re,{scope:r.scope}),e[3]=r.scope,e[4]=n):n=e[4];let l;e[5]!==c||e[6]!==n?(l=s.jsxs("div",{className:"flex items-center gap-2",children:[c,n]}),e[5]=c,e[6]=n,e[7]=l):l=e[7];let a;e[8]!==r.description?(a=r.description?s.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:r.description}):null,e[8]=r.description,e[9]=a):a=e[9];let m;e[10]!==l||e[11]!==a?(m=s.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[i,s.jsxs("div",{className:"min-w-0",children:[l,a]})]}),e[10]=l,e[11]=a,e[12]=m):m=e[12];let d;e[13]!==r.createdAt?(d=new Date(r.createdAt).toLocaleDateString(),e[13]=r.createdAt,e[14]=d):d=e[14];let u;e[15]!==d?(u=s.jsx("div",{className:"text-xs text-muted-foreground shrink-0",children:d}),e[15]=d,e[16]=u):u=e[16];let x;return e[17]!==m||e[18]!==u?(x=s.jsxs("div",{className:"flex items-start justify-between gap-4 py-3 border-b border-border/60 last:border-b-0",children:[m,u]}),e[17]=m,e[18]=u,e[19]=x):x=e[19],x}function ne(t){const e=j.c(9),{action:r}=t,i=N();let c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(T,{}),e[0]=c):c=e[0];let n;e[1]!==i?(n=i("settings.secrets.emptyTitle"),e[1]=i,e[2]=n):n=e[2];let l;e[3]!==i?(l=i("settings.secrets.emptyDescription"),e[3]=i,e[4]=l):l=e[4];let a;return e[5]!==r||e[6]!==n||e[7]!==l?(a=s.jsx(H,{children:s.jsx(M,{size:"inline",icon:c,title:n,description:l,children:r})}),e[5]=r,e[6]=n,e[7]=l,e[8]=a):a=e[8],a}function E({open:t,onOpenChange:e}){const r=N(),[i,c]=y.useState("organization"),[n,l]=y.useState(""),[a,m]=y.useState(""),[d,u]=y.useState(""),x=ee();function g(){c("organization"),l(""),m(""),u("")}function p(){g(),e(!1)}async function S(o){if(o.preventDefault(),!(!n.trim()||!a))try{await x.mutateAsync({scope:i,name:n.trim(),value:a,description:d.trim()||void 0}),z.success(r("settings.secrets.secretCreated",{name:n.trim()})),p()}catch(f){z.error(f instanceof Error?f.message:r("settings.secrets.failedToCreateSecret"))}}return s.jsx(B,{open:t,onOpenChange:o=>{o?e(o):p()},children:s.jsxs(R,{className:"sm:max-w-lg",children:[s.jsxs(A,{children:[s.jsx(q,{children:r("settings.secrets.newSecretTitle")}),s.jsx(I,{children:r("settings.secrets.newSecretDescription")})]}),s.jsxs("form",{onSubmit:S,className:"space-y-4",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-scope",children:r("settings.secrets.scopeLabel")}),s.jsxs(Q,{value:i,onValueChange:o=>c(o),children:[s.jsx(U,{id:"secret-scope",children:s.jsx(W,{})}),s.jsxs(X,{children:[s.jsx(P,{value:"organization",children:r("settings.secrets.scopeOrganizationDescription")}),s.jsx(P,{value:"user",children:r("settings.secrets.scopePrivateDescription")})]})]})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-name",children:r("settings.secrets.nameLabel")}),s.jsx(D,{id:"secret-name",value:n,onChange:o=>l(o.target.value),placeholder:r("settings.secrets.namePlaceholder"),autoComplete:"off",required:!0}),s.jsx("p",{className:"text-xs text-muted-foreground",children:r("settings.secrets.nameHelp")})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-value",children:r("settings.secrets.valueLabel")}),s.jsx(D,{id:"secret-value",type:"password",value:a,onChange:o=>m(o.target.value),autoComplete:"new-password",required:!0})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(w,{htmlFor:"secret-description",children:r("settings.secrets.descriptionLabel")}),s.jsx(Y,{id:"secret-description",value:d,onChange:o=>u(o.target.value),rows:2,placeholder:r("settings.secrets.descriptionPlaceholder")})]}),s.jsxs(V,{children:[s.jsx(_,{type:"button",variant:"outline",onClick:p,disabled:x.isPending,children:r("settings.secrets.cancelButton")}),s.jsx(_,{type:"submit",disabled:x.isPending||!n.trim()||!a,children:x.isPending?r("settings.secrets.creatingButton"):r("settings.secrets.createButton")})]})]})]})})}function ie(){const t=j.c(34),e=N(),r=Z(),[i,c]=y.useState(!1);let n,l;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=()=>c(!0),l=s.jsx(J,{size:14}),t[0]=n,t[1]=l):(n=t[0],l=t[1]);let a;t[2]!==e?(a=e("settings.secrets.newSecret"),t[2]=e,t[3]=a):a=t[3];let m;t[4]!==a?(m=s.jsx(C.Actions,{children:s.jsxs(_,{size:"sm",onClick:n,children:[l,a]})}),t[4]=a,t[5]=m):m=t[5];const d=m;if(r.length===0){let o;t[6]===Symbol.for("react.memo_cache_sentinel")?(o=s.jsx(ne,{action:!1}),t[6]=o):o=t[6];let f;t[7]!==i?(f=s.jsx(E,{open:i,onOpenChange:c}),t[7]=i,t[8]=f):f=t[8];let h;return t[9]!==d||t[10]!==f?(h=s.jsxs(s.Fragment,{children:[d,o,f]}),t[9]=d,t[10]=f,t[11]=h):h=t[11],h}let u,x,g;if(t[12]!==d||t[13]!==r||t[14]!==e){const o=r.filter(oe),f=r.filter(ae),h=r.length===1?"settings.secrets.secretsCountSingular":"settings.secrets.secretsCountPlural";let b;t[18]!==r.length||t[19]!==e||t[20]!==h?(b=e(h,{count:r.length}),t[18]=r.length,t[19]=e,t[20]=h,t[21]=b):b=t[21];let v;t[22]!==b?(v=s.jsx("p",{className:"text-sm text-muted-foreground",children:b}),t[22]=b,t[23]=v):v=t[23],t[24]!==d||t[25]!==v?(u=s.jsxs("div",{className:"flex items-center justify-between",children:[v,d]}),t[24]=d,t[25]=v,t[26]=u):u=t[26],x=o.length>0?s.jsxs("section",{className:"surface p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionOrganization")}),s.jsx("div",{children:o.map(le)})]}):null,g=f.length>0?s.jsxs("section",{className:"surface p-5",children:[s.jsx("h3",{className:"text-xs font-medium text-muted-foreground mb-2",children:e("settings.secrets.sectionPrivate")}),s.jsx("div",{children:f.map(ce)})]}):null,t[12]=d,t[13]=r,t[14]=e,t[15]=u,t[16]=x,t[17]=g}else u=t[15],x=t[16],g=t[17];let p;t[27]!==i?(p=s.jsx(E,{open:i,onOpenChange:c}),t[27]=i,t[28]=p):p=t[28];let S;return t[29]!==u||t[30]!==x||t[31]!==g||t[32]!==p?(S=s.jsxs(s.Fragment,{children:[u,x,g,p]}),t[29]=u,t[30]=x,t[31]=g,t[32]=p,t[33]=S):S=t[33],S}function ce(t){return s.jsx($,{secret:t},t.id)}function le(t){return s.jsx($,{secret:t},t.id)}function ae(t){return t.scope==="user"}function oe(t){return t.scope==="organization"}function me(){const t=j.c(7),e=N();let r;t[0]!==e?(r=e("settings.nav.secrets"),t[0]=e,t[1]=r):r=t[1];let i;t[2]!==r?(i=s.jsx(C.Title,{children:r}),t[2]=r,t[3]=i):i=t[3];let c;t[4]===Symbol.for("react.memo_cache_sentinel")?(c=s.jsx(k,{fallback:de,children:s.jsx(y.Suspense,{fallback:s.jsx(L,{className:"h-32 w-full"}),children:s.jsx(ie,{})})}),t[4]=c):c=t[4];let n;return t[5]!==i?(n=s.jsx(C,{children:s.jsx(C.Content,{children:s.jsx(C.Container,{children:s.jsxs(F,{children:[i,c]})})})}),t[5]=i,t[6]=n):n=t[6],n}function de(t){const{error:e}=t;return s.jsx(se,{error:e??new Error("Failed to load secrets")})}function ze(){const t=j.c(1);let e;return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=s.jsx(te,{capability:"secrets:manage",area:"secrets",children:s.jsx(me,{})}),t[0]=e):e=t[0],e}export{ze as default};
@@ -1 +1 @@
1
- import{bz as g,by as E,f7 as w,eO as L,f8 as A,f9 as y,fa as P,eJ as d,fb as j,fc as T,fd as k,fe as D,ff as x,fg as R,bl as B,fh as C,fi as K}from"./index-BbyUQV-V.js";import{z as I,r as F,y as U,a0 as W,aa as $}from"./blocks-tab-states-BzneOCDW.js";const l="https://docs.decocms.com/storefront/blocks",ne={quickstart:`${l}/next/quickstart`,siteEditor:`${l}/next/site-editor#edit-on-your-machine`,serve:`${l}/next/cli#deco-serve`,schema:`${l}/next/cli#deco-schema-and-deco-content`,troubleshooting:`${l}/next/troubleshooting#site-editor`},ae="https://github.com/decocms/blocks/tree/main/.agents/skills/deco-site-workflow";function z(e){return e.includes("matchers")||e.includes("Match")}function m(e,r){const t=e.__resolveType;return typeof t!="string"||!t||W(t,r)?!1:r?w(r,t):z(t)}function oe(e,r){const t=[];for(const[n,a]of Object.entries(r)){if(n.includes("/")||!g(n,e)||E(n)||!a||typeof a!="object"||Array.isArray(a))continue;const o=a;m(o,e)&&t.push({blockKey:n,matcherResolveType:o.__resolveType??"",name:typeof o.name=="string"?o.name:void 0})}return t.sort((n,a)=>(n.name??n.blockKey).localeCompare(a.name??a.blockKey))}function p(e,r,t){if(!e)return!1;const n=e.__resolveType;if(typeof n!="string"||!g(n,t)||!Object.hasOwn(r,n))return!1;const a=r[n];return!a||typeof a!="object"||Array.isArray(a)?!1:m(a,t)}function se(e,r,t){return p(e,r,t)?e?.__resolveType??null:null}function S(e,r,t){if(!e)return null;const n=e.__resolveType??"";if(!n)return null;if(p(e,r,t)){const s=r[n]??{},i=s.__resolveType??n,{__resolveType:c,name:u,...v}=s;return{resolveType:i,data:v,blockKey:n}}const{__resolveType:a,...o}=e;return{resolveType:n,data:o}}function Y(e,r,t){const n=S(e,r,t);return n?{__resolveType:n.resolveType,...n.data}:{__resolveType:""}}function ie(e,r,t){if(e)return p(e,r,t)?Y(e,r,t):e}function q(e,r,t,n){if(!e)return"Default";if(p(e,r,n)){const a=e.__resolveType??"",o=r[a];return I(a,o)}return t(e,F(r))}function ce(e,r,t){return{__resolveType:e,...r,name:t}}function ue(e){return{__resolveType:e}}function le(e,r,t){const n=S(e,r,t);return n?{resolveType:n.resolveType,formValue:n.data}:{resolveType:"",formValue:{}}}function fe(e,r){const t={__resolveType:e};if(!e||!r)return t;const n=U(e,r),a=n?.type==="inline-union"?n.inlineUnionBranches?.[0]?.discriminators:void 0;return a?{...t,...a}:t}function V(e){const r=[];for(let t=e;t?.key!=null;t=t.parent)r.push(t.key);return r.reverse()}function G(e){return{blockKey:e.blockKey,path:V(e)}}function N(e,r,t){const n=[];for(const[o,s]of Object.entries(e))o!==r&&n.push({node:s,blockKey:o,parent:null,key:null});const a=new Set;for(;n.length>0;){const o=n.pop(),{node:s}=o;if(!(!s||typeof s!="object")&&!a.has(s)){if(a.add(s),Array.isArray(s)){s.forEach((i,c)=>{n.push({node:i,blockKey:o.blockKey,parent:o,key:c})});continue}t(s,o);for(const[i,c]of Object.entries(s))n.push({node:c,blockKey:o.blockKey,parent:o,key:i})}}}function H(e,r,t){if(!r)return[];const n=[];return N(e,r,(a,o)=>{if(a.__resolveType!==r||!p(a,e,t))return;const s=J(o);n.push({...G(o),...s?{variant:s}:{}})}),n}function J(e){for(let r=e;r;r=r.parent){const t=r.parent,n=t?.parent,a=n?.parent;if(!t||!n||!a)return;if(r.key==="rule"&&typeof t.key=="number"&&n.key==="variants"&&$(a.node)&&L(a.node.__resolveType)){const o=a.node.experiment;return{containerPath:V(a),containerType:a.node.__resolveType,index:t.key,...typeof o=="string"?{experiment:o}:{}}}}}function Q(e){for(const r of e.anyOfRefs??[]){if(r.resolveType!==A&&r.resolveType!==y)continue;const t=r.schema?.properties?.variants?.items?.properties?.value,n=t?.lazy?t.properties?.value:t;if(n?.type==="array")return n}}function X(e){return Q(e)!==void 0}function ye(e,r){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return Array.isArray(t.variants)?t.__resolveType===R?!0:r&&t.__resolveType===y&&!M(t.variants):!1}function M(e){return e.some(r=>Array.isArray(d(r)))}function O(e,r){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return t.__resolveType===A?!0:r&&t.__resolveType===y&&Array.isArray(t.variants)&&M(t.variants)}function pe(e,r){if(!O(e,r))return null;const t=e.variants;if(!Array.isArray(t))return null;const n=B(t[0],r);return Array.isArray(n)?n:null}function ve(e,r,t,n){if(!O(e,n))return r;const a=structuredClone(e),o=[...a.variants??[]];return o.length===0?o.push({rule:k(t),value:T(a.__resolveType,r)}):o[0]=C(a.__resolveType,o[0],r),{...a,variants:o}}function de(e,r){const n=e[r]?.sections;if(!n||Array.isArray(n))return 1;const a=n;return Array.isArray(a.variants)?a.variants.length:1}function _e(e,r,t){const a=e[r]?.sections;if(Array.isArray(a))return t===0?a:[];if(a&&typeof a=="object"){const o=a.variants;if(Array.isArray(o)){const s=d(o[t]);return Array.isArray(s)?s:[]}}return[]}function he(e,r,t){if(Array.isArray(e))return[{label:"Default",sections:e}];if(e&&typeof e=="object"){const n=e;if(Array.isArray(n.variants)){const a=n.variants,o=P(a.map(s=>q(s.rule,r,t)));return a.map((s,i)=>{const c=o[i],u=d(s);return{label:c||`Variant ${i+1}`,sections:Array.isArray(u)?u:[],rule:s.rule}})}}return[]}function _(e,r,t){return{rule:k(r),value:T(t,e)}}function h(e,r){return e?e.__resolveType===y?y:A:D(r)}function f(e,r,t){return{...r,__resolveType:h(r,t),variants:e}}function be(e,r,t,n=!1){const a=structuredClone(r);if(e&&typeof e=="object"&&!Array.isArray(e)){const c=e;if(!Array.isArray(c.variants))return null;const u=[...c.variants],v=j(u,n);return u.splice(v,0,_(a,t,h(c))),{sections:f(u,c),newVariantIndex:v}}const o=h(void 0,t),s=_(Array.isArray(e)?e:[],t,o),i=_(a,t,o);return{sections:f(n?[i,s]:[s,i],void 0,t),newVariantIndex:n?0:1}}function Ae(e,r,t=!1){const n=e[r];if(!n)return null;const a=[...e];return a.splice(K(e,r,t),0,structuredClone(n)),a}function ge(e,r){if(r.length===0)return f([],e);if(r.length===1){const t=r[0],n=t?.rule;if(!x(n))return f(r,e);const a=d(t);if(Array.isArray(a))return a}return f(r,e)}function Z(e,r,t){return H(e,r,t).length}function Te(e,r,t,n){return n?!1:Z(e,r,t)===0}const ke={claiming:{long:"Reserving sandbox",short:"Reserving sandbox"},"waiting-for-capacity":{long:"Waiting for cluster capacity",short:"Waiting for capacity"},"pulling-image":{long:"Downloading sandbox image",short:"Downloading image"},"starting-container":{long:"Starting your sandbox",short:"Starting container"},"warming-daemon":{long:"Connecting to your sandbox",short:"Connecting to sandbox"}};function b(e){return e.includes("/sections/")||e.includes("multivariate/section")||e===R}function ee(e){if(e.anyOfRefs?.length)return e.anyOfRefs.some(t=>b(t.resolveType));const r=e.properties?.__resolveType;return r?.type==="block-ref"&&r.anyOfRefs?.length?r.anyOfRefs.some(t=>b(t.resolveType)):!1}function Re(e){return e.type!=="block-ref"||!e.anyOfRefs?.length?!1:e.anyOfRefs.some(r=>b(r.resolveType))}function me(e,r){if(r==="global"||r==="sections"||X(e))return!0;const t=e.type==="array"?e.items:void 0;return t?ee(t):!1}export{Te as A,Ae as B,ke as C,ae as D,de as a,be as b,ne as c,X as d,me as e,Y as f,_e as g,ue as h,b as i,Re as j,q as k,oe as l,se as m,le as n,p as o,he as p,ce as q,ie as r,fe as s,ye as t,O as u,pe as v,ve as w,Q as x,S as y,ge as z};
1
+ import{bz as g,by as E,f7 as w,eO as L,f8 as A,f9 as y,fa as P,eJ as d,fb as j,fc as T,fd as k,fe as D,ff as x,fg as R,bl as B,fh as C,fi as K}from"./index-CVaM5ZeE.js";import{z as I,r as F,y as U,a0 as W,aa as $}from"./blocks-tab-states-DH742uQK.js";const l="https://docs.decocms.com/storefront/blocks",ne={quickstart:`${l}/next/quickstart`,siteEditor:`${l}/next/site-editor#edit-on-your-machine`,serve:`${l}/next/cli#deco-serve`,schema:`${l}/next/cli#deco-schema-and-deco-content`,troubleshooting:`${l}/next/troubleshooting#site-editor`},ae="https://github.com/decocms/blocks/tree/main/.agents/skills/deco-site-workflow";function z(e){return e.includes("matchers")||e.includes("Match")}function m(e,r){const t=e.__resolveType;return typeof t!="string"||!t||W(t,r)?!1:r?w(r,t):z(t)}function oe(e,r){const t=[];for(const[n,a]of Object.entries(r)){if(n.includes("/")||!g(n,e)||E(n)||!a||typeof a!="object"||Array.isArray(a))continue;const o=a;m(o,e)&&t.push({blockKey:n,matcherResolveType:o.__resolveType??"",name:typeof o.name=="string"?o.name:void 0})}return t.sort((n,a)=>(n.name??n.blockKey).localeCompare(a.name??a.blockKey))}function p(e,r,t){if(!e)return!1;const n=e.__resolveType;if(typeof n!="string"||!g(n,t)||!Object.hasOwn(r,n))return!1;const a=r[n];return!a||typeof a!="object"||Array.isArray(a)?!1:m(a,t)}function se(e,r,t){return p(e,r,t)?e?.__resolveType??null:null}function S(e,r,t){if(!e)return null;const n=e.__resolveType??"";if(!n)return null;if(p(e,r,t)){const s=r[n]??{},i=s.__resolveType??n,{__resolveType:c,name:u,...v}=s;return{resolveType:i,data:v,blockKey:n}}const{__resolveType:a,...o}=e;return{resolveType:n,data:o}}function Y(e,r,t){const n=S(e,r,t);return n?{__resolveType:n.resolveType,...n.data}:{__resolveType:""}}function ie(e,r,t){if(e)return p(e,r,t)?Y(e,r,t):e}function q(e,r,t,n){if(!e)return"Default";if(p(e,r,n)){const a=e.__resolveType??"",o=r[a];return I(a,o)}return t(e,F(r))}function ce(e,r,t){return{__resolveType:e,...r,name:t}}function ue(e){return{__resolveType:e}}function le(e,r,t){const n=S(e,r,t);return n?{resolveType:n.resolveType,formValue:n.data}:{resolveType:"",formValue:{}}}function fe(e,r){const t={__resolveType:e};if(!e||!r)return t;const n=U(e,r),a=n?.type==="inline-union"?n.inlineUnionBranches?.[0]?.discriminators:void 0;return a?{...t,...a}:t}function V(e){const r=[];for(let t=e;t?.key!=null;t=t.parent)r.push(t.key);return r.reverse()}function G(e){return{blockKey:e.blockKey,path:V(e)}}function N(e,r,t){const n=[];for(const[o,s]of Object.entries(e))o!==r&&n.push({node:s,blockKey:o,parent:null,key:null});const a=new Set;for(;n.length>0;){const o=n.pop(),{node:s}=o;if(!(!s||typeof s!="object")&&!a.has(s)){if(a.add(s),Array.isArray(s)){s.forEach((i,c)=>{n.push({node:i,blockKey:o.blockKey,parent:o,key:c})});continue}t(s,o);for(const[i,c]of Object.entries(s))n.push({node:c,blockKey:o.blockKey,parent:o,key:i})}}}function H(e,r,t){if(!r)return[];const n=[];return N(e,r,(a,o)=>{if(a.__resolveType!==r||!p(a,e,t))return;const s=J(o);n.push({...G(o),...s?{variant:s}:{}})}),n}function J(e){for(let r=e;r;r=r.parent){const t=r.parent,n=t?.parent,a=n?.parent;if(!t||!n||!a)return;if(r.key==="rule"&&typeof t.key=="number"&&n.key==="variants"&&$(a.node)&&L(a.node.__resolveType)){const o=a.node.experiment;return{containerPath:V(a),containerType:a.node.__resolveType,index:t.key,...typeof o=="string"?{experiment:o}:{}}}}}function Q(e){for(const r of e.anyOfRefs??[]){if(r.resolveType!==A&&r.resolveType!==y)continue;const t=r.schema?.properties?.variants?.items?.properties?.value,n=t?.lazy?t.properties?.value:t;if(n?.type==="array")return n}}function X(e){return Q(e)!==void 0}function ye(e,r){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return Array.isArray(t.variants)?t.__resolveType===R?!0:r&&t.__resolveType===y&&!M(t.variants):!1}function M(e){return e.some(r=>Array.isArray(d(r)))}function O(e,r){if(!e||typeof e!="object"||Array.isArray(e))return!1;const t=e;return t.__resolveType===A?!0:r&&t.__resolveType===y&&Array.isArray(t.variants)&&M(t.variants)}function pe(e,r){if(!O(e,r))return null;const t=e.variants;if(!Array.isArray(t))return null;const n=B(t[0],r);return Array.isArray(n)?n:null}function ve(e,r,t,n){if(!O(e,n))return r;const a=structuredClone(e),o=[...a.variants??[]];return o.length===0?o.push({rule:k(t),value:T(a.__resolveType,r)}):o[0]=C(a.__resolveType,o[0],r),{...a,variants:o}}function de(e,r){const n=e[r]?.sections;if(!n||Array.isArray(n))return 1;const a=n;return Array.isArray(a.variants)?a.variants.length:1}function _e(e,r,t){const a=e[r]?.sections;if(Array.isArray(a))return t===0?a:[];if(a&&typeof a=="object"){const o=a.variants;if(Array.isArray(o)){const s=d(o[t]);return Array.isArray(s)?s:[]}}return[]}function he(e,r,t){if(Array.isArray(e))return[{label:"Default",sections:e}];if(e&&typeof e=="object"){const n=e;if(Array.isArray(n.variants)){const a=n.variants,o=P(a.map(s=>q(s.rule,r,t)));return a.map((s,i)=>{const c=o[i],u=d(s);return{label:c||`Variant ${i+1}`,sections:Array.isArray(u)?u:[],rule:s.rule}})}}return[]}function _(e,r,t){return{rule:k(r),value:T(t,e)}}function h(e,r){return e?e.__resolveType===y?y:A:D(r)}function f(e,r,t){return{...r,__resolveType:h(r,t),variants:e}}function be(e,r,t,n=!1){const a=structuredClone(r);if(e&&typeof e=="object"&&!Array.isArray(e)){const c=e;if(!Array.isArray(c.variants))return null;const u=[...c.variants],v=j(u,n);return u.splice(v,0,_(a,t,h(c))),{sections:f(u,c),newVariantIndex:v}}const o=h(void 0,t),s=_(Array.isArray(e)?e:[],t,o),i=_(a,t,o);return{sections:f(n?[i,s]:[s,i],void 0,t),newVariantIndex:n?0:1}}function Ae(e,r,t=!1){const n=e[r];if(!n)return null;const a=[...e];return a.splice(K(e,r,t),0,structuredClone(n)),a}function ge(e,r){if(r.length===0)return f([],e);if(r.length===1){const t=r[0],n=t?.rule;if(!x(n))return f(r,e);const a=d(t);if(Array.isArray(a))return a}return f(r,e)}function Z(e,r,t){return H(e,r,t).length}function Te(e,r,t,n){return n?!1:Z(e,r,t)===0}const ke={claiming:{long:"Reserving sandbox",short:"Reserving sandbox"},"waiting-for-capacity":{long:"Waiting for cluster capacity",short:"Waiting for capacity"},"pulling-image":{long:"Downloading sandbox image",short:"Downloading image"},"starting-container":{long:"Starting your sandbox",short:"Starting container"},"warming-daemon":{long:"Connecting to your sandbox",short:"Connecting to sandbox"}};function b(e){return e.includes("/sections/")||e.includes("multivariate/section")||e===R}function ee(e){if(e.anyOfRefs?.length)return e.anyOfRefs.some(t=>b(t.resolveType));const r=e.properties?.__resolveType;return r?.type==="block-ref"&&r.anyOfRefs?.length?r.anyOfRefs.some(t=>b(t.resolveType)):!1}function Re(e){return e.type!=="block-ref"||!e.anyOfRefs?.length?!1:e.anyOfRefs.some(r=>b(r.resolveType))}function me(e,r){if(r==="global"||r==="sections"||X(e))return!0;const t=e.type==="array"?e.items:void 0;return t?ee(t):!1}export{Te as A,Ae as B,ke as C,ae as D,de as a,be as b,ne as c,X as d,me as e,Y as f,_e as g,ue as h,b as i,Re as j,q as k,oe as l,se as m,le as n,p as o,he as p,ce as q,ie as r,fe as s,ye as t,O as u,pe as v,ve as w,Q as x,S as y,ge as z};
@@ -1 +1 @@
1
- import{s as i}from"./File02-CNdUOOeH.js";import{dM as e}from"./index-BbyUQV-V.js";import{a as s}from"./UserSquare-BJ8rQzrf.js";import{aF as n}from"./agent-icon-Djmp3uF_.js";import{a as o}from"./UserCheck01-BNqLXBfG.js";const r=["general","views","connections","repository","site"],y={general:{icon:o,titleKey:"virtualMcp.settings.general.title",descriptionKey:"virtualMcp.settings.general.description"},views:{icon:s,titleKey:"virtualMcp.settings.views.title",descriptionKey:"virtualMcp.settings.views.description"},connections:{icon:n,titleKey:"virtualMcp.settings.connections.title",descriptionKey:"virtualMcp.settings.connections.description"},repository:{icon:e,titleKey:"virtualMcp.settings.repository.title",descriptionKey:"virtualMcp.settings.repository.description"},site:{icon:i,titleKey:"virtualMcp.settings.site.title",descriptionKey:"virtualMcp.settings.site.description"}};function v(t){return!!t&&r.includes(t)}export{y as P,r as a,v as i};
1
+ import{s as i}from"./File02-B_azDZYk.js";import{dM as e}from"./index-CVaM5ZeE.js";import{a as s}from"./UserSquare-DCGr1IXl.js";import{aF as n}from"./agent-icon-DZAggVJ3.js";import{a as o}from"./UserCheck01-C6Zy7aCJ.js";const r=["general","views","connections","repository","site"],y={general:{icon:o,titleKey:"virtualMcp.settings.general.title",descriptionKey:"virtualMcp.settings.general.description"},views:{icon:s,titleKey:"virtualMcp.settings.views.title",descriptionKey:"virtualMcp.settings.views.description"},connections:{icon:n,titleKey:"virtualMcp.settings.connections.title",descriptionKey:"virtualMcp.settings.connections.description"},repository:{icon:e,titleKey:"virtualMcp.settings.repository.title",descriptionKey:"virtualMcp.settings.repository.description"},site:{icon:i,titleKey:"virtualMcp.settings.site.title",descriptionKey:"virtualMcp.settings.site.description"}};function v(t){return!!t&&r.includes(t)}export{y as P,r as a,v as i};
@@ -1 +1 @@
1
- import{i8 as ei,bp as ti,c as wn,b as jn,r as b,m as le,j as r,c8 as ni,bm as Cs,i9 as Do,B as It,Y as on,au as si,_ as ri,bo as oi,Z as ai,q as ii,hF as li,ia as ci,ib as ui,h as di,bq as wt,ic as Jr,id as bs,ie as fi,ig as pt,ih as Qr,ii as mi,fQ as pi,ij as hi,ik as Yr,il as gi,t as H,fu as Zr,im as vi,io as Bt,ip as yi,iq as Si,ir as bi,fi as Xr,is as xs,it as xi,iu as _i,iv as ki,ff as wi,fR as ji,iw as Ri,ix as Ei,ft as Vi,K as Ti,iy as eo,eN as Ai,fJ as Hn,fO as to,iz as no,iA as Ni,iB as Ci,iC as Pi,iD as _s,iE as Bi,iF as Ki,iG as Di,iH as so,iI as Mi,iJ as Fi,fh as ro,iK as Ii,iL as Li,fL as oo,iM as Oi,fd as zi}from"./index-BbyUQV-V.js";import{u as $i}from"./chat-context-Bb_Yeasx.js";import{a as Xn,M as ao}from"./save-status-BXi_cq_U.js";import{p as kn,f as Wi,n as Hi}from"./parse-sections-DFcHy6a1.js";import{a as qi}from"./repository-binding-CYxPGVF9.js";import{t as Gi}from"./ChevronDown-COkNoLwk.js";import{d as Mo,b as Ui}from"./UserCheck01-BNqLXBfG.js";import{n as Ji}from"./ChevronUp-C-YGqatN.js";import{b as Zn,e as Qi,P as io,K as lo}from"./agent-icon-Djmp3uF_.js";import{S as an}from"./scroll-area-BJzMdjhR.js";import{c as jt,T as Rt,a as Et}from"./tooltip-CINPZAUE.js";import{h as Yi,i as Zi,j as Xi,E as el,k as tl,V as nl,l as sl,m as rl,G as ol,s as Jn,v as Qn,p as Fo,n as al,o as il,a as co,q as ll,u as cl,A as qn,P as uo,w as fo,x as mo,y as ks,z as ul,B as dl,D as po,F as fl,J as ho,K as go,L as vo,M as ml,Q as yo,c as pl,T as ln,U as hl,W as gl}from"./held-block-view-myNdCF-d.js";import{j as vl,u as yl,i as Sl,v as bl,aD as xl,U as _l,k as So,aU as bo,a9 as Kt,aa as Dt,aq as kl,aV as wl,aW as jl,aO as xo,at as Rl,aA as El}from"./site-editor-toast-CkErPR2A.js";import{u as Vl,ao as _o,e as ko,j as Tl,z as Al,y as Gn,ad as Nl,ae as Cl,aj as Pl}from"./blocks-tab-states-BzneOCDW.js";import{u as Bl}from"./use-delete-block-Ds8KKf4b.js";import{b as Kl,u as Dl,k as Un,e as xn}from"./use-never-published-DvQ5FOx0.js";import{a as Es,e as Io}from"./UserSquare-BJ8rQzrf.js";import{b as Ml}from"./MessageCircle01-CeeL61Zn.js";import{i as wo}from"./Tool01-BIyGNKrn.js";import{s as jo}from"./Eye-C6rTinUa.js";import{s as Fl}from"./Plus-C2jbSKfe.js";import{s as Il}from"./Trash01-D20QdwlW.js";import{i as Vs}from"./Zap-DnTlLwWn.js";import{u as Ll,a as Ro,n as Ol,P as zl,o as $l,C as Wl,D as Hl,c as ql}from"./task-key-CaAm1Jwf.js";import{u as Gl,s as Ul,a as Yn,S as Jl,v as Ql}from"./sortable.esm-CqIiSw1u.js";import{s as Yl,g as Zl,u as Xl,A as ec}from"./use-section-preview-base-oNURhBRp.js";import{m as tc,P as nc}from"./mustache-BB27WkZo.js";import{r as Eo,u as sc,a as rc,i as oc,f as ac,B as ic}from"./empty-message-DLDkQwTf.js";import{u as lc,a as cc,P as Vo,w as uc,b as dc}from"./seo-editor-CgBBfTmC.js";import{v as fc,k as ws,x as To,j as mc,y as pc}from"./named-rule-step-DHcxNdON.js";import{u as hc}from"./use-apply-named-rule-CRVOk9Kn.js";import{o as Jt,f as Ts,y as As,q as Ft,h as cn,u as gc,n as Ut,r as js,m as Mt,k as _n,b as vc,s as Ao,z as yc,A as Sc,B as bc}from"./section-array-field-Dau5fGuc.js";import{b as No,a as xc}from"./variant-matcher-override-Dq-o59Sr.js";import"./use-panel-navigate-m_WUKcO1.js";import"./thread-route-B-vrKdst.js";import"./use-project-scope-tAmzLFmo.js";import"./use-view-draft-kind-eAKU4tzG.js";import"./use-blog-view-B5vAwn2e.js";import"./use-organization-settings-C_xGXqYD.js";import"./schema-DvznvyNF.js";import"./task-board-_DSzqPWi.js";import"./thread-intent-BNjS3eKm.js";import"./use-mcp-client-KtY-iAqe.js";import"./auth-dN38N6ZJ.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-TBuzagYQ.js";import"./session-runtime-B3M5aN-q.js";import"./use-entitlements-D_bekXoy.js";import"./use-ai-providers-BxpYBICM.js";import"./use-current-view-DWPEJKMo.js";import"./use-in-settings-DsvAK9xJ.js";import"./use-decopilot-events-Bzy3gyOh.js";import"./Image01-xPHq6tUP.js";import"./Upload01-C9Bt1TSM.js";import"./label-BlFTNuxs.js";import"./SwitchHorizontal01-CFbhgx88.js";import"./popover-B2fZ96W0.js";import"./switch-BH2QiW4s.js";import"./toggle-group-D14vFqFg.js";import"./active-indicator-CCMhAsc_.js";import"./match-site-slug-config-B47_xZCi.js";import"./use-file-configs-Dv6Dn9-s.js";import"./asset-utils-B8xngYBo.js";import"./useInfiniteQuery-L4kwu3zj.js";import"./infiniteQueryObserver-DqRBsy9_.js";import"./AlertCircle-Di8a-UWV.js";import"./hosted-reconcile-DbZes2_O.js";import"./SearchMd-DIZIcq-T.js";import"./textarea-Co6WXg3Y.js";import"./use-copy-CHLJB-eJ.js";import"./ChevronSelectorVertical-Buxlf1yx.js";import"./command-BUJZW101.js";import"./index-Bu3usBwV.js";import"./Play-DEfGDCy-.js";import"./monaco-editor-BTeatlwM.js";import"./editor-OtYf9TpJ.js";import"./ArrowUp-Nhgapjwm.js";import"./ArrowLeft-B2F854r0.js";import"./ArrowRight-Dj2pC8B7.js";import"./BookOpen01-CHggQBWj.js";import"./Globe04-AW14Waq3.js";import"./CheckCircle-UAsyLWI7.js";import"./TrendUp01-yJId_zlL.js";import"./LinkBroken01-Chn3Zw95.js";import"./CreditCard01-CRi7On3u.js";import"./File02-CNdUOOeH.js";import"./Key01-BMD-TEa8.js";import"./LayoutLeft-5PR-LA5J.js";import"./Minus-CxmZj9NQ.js";import"./Monitor01-BNRBENLp.js";import"./Sun-CPfe1reh.js";import"./ShoppingBag01-CVfO_hCG.js";import"./Users01-BF_7Ge84.js";import"./XClose-BeMmbmRj.js";import"./index-BdQq_4o_.js";import"./index-kCYHIAlq.js";import"./utils-C_wnF1Qr.js";import"./calendar-Dfc1FCTZ.js";import"./usage-stats-DTw2_3QF.js";import"./utils-CVEq3hMx.js";import"./markdown-BLD58IcZ.js";import"./use-mobile-BFnx6XU5.js";import"./gateway-client-GUKS8Neg.js";import"./form-C_3nPlqc.js";import"./select-CaROtCr6.js";import"./editor-classes-B015z8BR.js";import"./combobox-C7dFW3mg.js";import"./use-sandbox-events-Choa45Ad.js";import"./sandbox-url-D3mC8qhT.js";import"./use-blocks-v8-project-CTDs5jlx.js";import"./use-voice-input-CFZw5CCV.js";import"./drawer-9dr-ukqt.js";import"./index-B4Z8qm4O.js";import"./checkbox-B0iej-k4.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./sandbox-git-api-a72xh_lB.js";import"./empty-state-DGvmXTTx.js";import"./search-input-Dx1nMhkR.js";import"./tabs-NIuu6bj4.js";import"./use-debounced-value-CDV_Hdj_.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-Dg8_WzRx.js";import"./collapsible-bv19Lgop.js";import"./use-task-board-items-FrK4WjzX.js";import"./config-BW2WE8-w.js";import"./task-route-DLJKfX0K.js";import"./project-index-lWz60EWQ.js";import"./shell-layout-49bNXIez.js";import"./use-deployment-admin-44Nr2y3l.js";import"./admin-fetch-BhTJlAsX.js";import"./use-org-notice-DiGO_5sP.js";import"./integration-icon-CqVW6T00.js";import"./project-icon-BbR0XGm1.js";import"./use-navigate-to-agent-DzfMLwHb.js";import"./new-project-dialog-CwWe9JTm.js";import"./repository-picker-BwLPliw3.js";import"./github-icon-F-zWm9rJ.js";import"./collection-search-CT3oHQLL.js";import"./new-project-store-DI-rcaGT.js";import"./legacy-admin-welcome-dialog-BeUx4hhs.js";import"./required-auth-layout-CEv7xMbD.js";import"./use-org-sso-BqAhMDLF.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-C3N-ooKA.js";import"./types-KLF33bAU.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./sheet-um4noh5c.js";import"./use-connection-Q1OVyR-K.js";import"./use-mcp-prompts-hYH8zGss.js";import"./use-thread-outputs-BYENDfew.js";import"./file-type-icon-BBC7AgSm.js";import"./slider-BSl20SQg.js";import"./index-C98zqBJi.js";import"./tooltipContext-B7kIVm-_.js";import"./CategoricalChart-BYLFXXdR.js";import"./index-CZNM0ywV.js";import"./use-move-blocks-CTFo8anC.js";const _c={escape:Yi};function kc(v,e){for(const p of Yl(v,e)){const S=typeof p.title=="string"?p.title:void 0;if(S?.includes("{{"))return S}}function wc(v,e){if(!e)return;const p=ei(v,ti(e));if(p)try{const S=kc(p.resolveType,e);return S&&tc.render(S,p.data,{},_c).trim()||void 0}catch{return}}function jc(v){const e=wn.c(13),{icon:p,label:S,className:x}=v;let V;e[0]!==x?(V=le("size-3.5",x),e[0]=x,e[1]=V):V=e[1];let C;e[2]!==p||e[3]!==V?(C=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=C):C=e[4];let _;e[5]!==S||e[6]!==C?(_=r.jsx(Rt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":S,className:"shrink-0 cursor-help",children:C})}),e[5]=S,e[6]=C,e[7]=_):_=e[7];let P;e[8]!==S?(P=r.jsx(Et,{className:"max-w-56",children:S}),e[8]=S,e[9]=P):P=e[9];let k;return e[10]!==_||e[11]!==P?(k=r.jsxs(jt,{children:[_,P]}),e[10]=_,e[11]=P,e[12]=k):k=e[12],k}const Rc="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Co(v){return Array.from({length:v},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Lo(v){return v.map((e,p)=>({...e,index:p}))}function Ec(v,e){if(e===v.length)return v;if(e<v.length)return Lo(v.slice(0,e));const p=Array.from({length:e-v.length},(S,x)=>({id:crypto.randomUUID(),index:v.length+x}));return[...v,...p]}function Oo(v){const e=wn.c(44),{section:p,raw:S,meta:x,decofile:V}=v,C=jn(),_=Xn(),P=p.isSavedBlock===!0,k=p.isMultivariate===!0;let Z;e[0]!==x||e[1]!==S?(Z=S&&x?Zl(S,x):void 0,e[0]=x,e[1]=S,e[2]=Z):Z=e[2];const ge=Z;let Ue;e[3]!==x||e[4]!==k||e[5]!==S||e[6]!==P?(Ue=S&&x&&!P&&!k?wc(S,x):void 0,e[3]=x,e[4]=k,e[5]=S,e[6]=P,e[7]=Ue):Ue=e[7];const Le=Ue;let Ce;e[8]!==V||e[9]!==x||e[10]!==S||e[11]!==p?(Ce=sl(S,p,V,x),e[8]=V,e[9]=x,e[10]=S,e[11]=p,e[12]=Ce):Ce=e[12];const Je=Ce;let w;e[13]!==k||e[14]!==S?.__resolveType?(w=!k&&Cs(S?.__resolveType??""),e[13]=k,e[14]=S?.__resolveType,e[15]=w):w=e[15];const c=w,xe=P?Zn:k?Mo:Io;let G;e[16]!==k||e[17]!==P?(G=P?{color:oi}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=P,e[18]=G):G=e[18];const _e=G;let I;e[19]!==xe||e[20]!==_?(I=_?r.jsxs("span",{className:"relative size-4 shrink-0",children:[r.jsx(xe,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),r.jsx(ol,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):r.jsx(Ml,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=_,e[21]=I):I=e[21];let ke;e[22]!==ge?(ke=ge&&r.jsx("img",{src:ge,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=ge,e[23]=ke):ke=e[23];let d;e[24]!==_||e[25]!==_e?(d=!_&&r.jsx(Es,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=_,e[25]=_e,e[26]=d):d=e[26];const Oe=_?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Ee;e[27]!==u||e[28]!==Oe?(Ee=le("min-w-0 truncate text-sm font-medium",Oe,u),e[27]=u,e[28]=Oe,e[29]=Ee):Ee=e[29];const X=Le??p.label;let ze;e[30]!==Ee||e[31]!==X?(ze=r.jsx("span",{className:Ee,children:X}),e[30]=Ee,e[31]=X,e[32]=ze):ze=e[32];let nt;e[33]!==c||e[34]!==_||e[35]!==Je||e[36]!==C?(nt=_?r.jsxs(r.Fragment,{children:[c&&r.jsx(jc,{icon:Vs,label:C("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),Je&&r.jsx(ao,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):Je&&r.jsx(ao,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=_,e[35]=Je,e[36]=C,e[37]=nt):nt=e[37];let Pe;return e[38]!==ze||e[39]!==nt||e[40]!==I||e[41]!==ke||e[42]!==d?(Pe=r.jsxs(r.Fragment,{children:[I,ke,d,ze,nt]}),e[38]=ze,e[39]=nt,e[40]=I,e[41]=ke,e[42]=d,e[43]=Pe):Pe=e[43],Pe}const Vc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Tc="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function zo(v,e,p){if(p)return rl({selected:e});const S=v.isSavedBlock===!0,x=v.isMultivariate===!0;return le("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":S?Vc:x?Tc:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Rs(v,e){return le("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":v?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function Ac(v){const e=wn.c(90),{section:p,raw:S,meta:x,decofile:V,sortableId:C,selected:_,onSelect:P,onDelete:k,onDuplicate:Z,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Le,onAddVariant:Ce,onDetach:Je}=v,w=jn(),c=Xn(),xe=S?Cs(S.__resolveType??""):!1,G=p.isHidden===!0,_e=xe||G;let I;e[0]!==p?(I=Do(p),e[0]=p,e[1]=I):I=e[1];const ke=I,d=!!Le&&!p.isMultivariate;let Oe;e[2]!==C?(Oe={id:C,animateLayoutChanges:Pc},e[2]=C,e[3]=Oe):Oe=e[3];const{attributes:u,listeners:Ee,setNodeRef:X,transform:ze,isDragging:nt}=Gl(Oe);let Pe;e[4]!==ze?(Pe=Wl.Transform.toString(ze?{...ze,x:0}:null),e[4]=ze,e[5]=Pe):Pe=e[5];const st=nt?0:void 0;let de;e[6]!==Pe||e[7]!==st?(de={transform:Pe,opacity:st},e[6]=Pe,e[7]=st,e[8]=de):de=e[8];const g=de;let we;e[9]!==p?(we=Xi(p),e[9]=p,e[10]=we):we=e[10];const rt=we,ot="button",m=0;let L;e[11]!==P?(L=F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),P())},e[11]=P,e[12]=L):L=e[12];const Xe=nt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==_||e[16]!==Xe?(A=le("touch-none transition-colors",Xe,zo(p,_,c)),e[13]=c,e[14]=p,e[15]=_,e[16]=Xe,e[17]=A):A=e[17];let Qe;e[18]!==V||e[19]!==x||e[20]!==S||e[21]!==p?(Qe=r.jsx(Oo,{section:p,raw:S,meta:x,decofile:V}),e[18]=V,e[19]=x,e[20]=S,e[21]=p,e[22]=Qe):Qe=e[22];const W=!c&&d&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:le(Rs(_e,xe)),onClick:F=>{F.stopPropagation(),Le?.()},onPointerDown:Cc,children:r.jsx(Vs,{className:le("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Et,{side:"bottom",children:w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),at=c?r.jsx(el,{label:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:G,onToggle:Ue,children:G?r.jsx(wo,{className:"h-3.5 w-3.5"}):r.jsx(jo,{className:"h-3.5 w-3.5"})}):r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:le(Rs(_e,G)),onClick:F=>{F.stopPropagation(),Ue()},onPointerDown:Nc,children:G?r.jsx(wo,{className:"h-3.5 w-3.5"}):r.jsx(jo,{className:"h-3.5 w-3.5"})})}),r.jsx(Et,{side:"bottom",children:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),fe=ri,Ye=tl;let ve;e[23]!==w?(ve=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ve):ve=e[24];const it=le(Rs(_e,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let $e;e[25]!==Ye||e[26]!==ve||e[27]!==it?($e=r.jsx(Ye,{label:ve,classicClassName:it}),e[25]=Ye,e[26]=ve,e[27]=it,e[28]=$e):$e=e[28];let Be;e[29]!==c||e[30]!==d||e[31]!==xe||e[32]!==Le||e[33]!==w?(Be=c&&d&&r.jsxs(r.Fragment,{children:[r.jsxs(on,{onClick:F=>{F.stopPropagation(),Le?.()},children:[r.jsx(Vs,{className:"h-4 w-4"}),w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(si,{})]}),e[29]=c,e[30]=d,e[31]=xe,e[32]=Le,e[33]=w,e[34]=Be):Be=e[34];let Ke;e[35]!==Z?(Ke=F=>{F.stopPropagation(),Z()},e[35]=Z,e[36]=Ke):Ke=e[36];let se;e[37]===Symbol.for("react.memo_cache_sentinel")?(se=r.jsx(Qi,{className:"h-4 w-4"}),e[37]=se):se=e[37];let Y;e[38]!==w?(Y=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Y):Y=e[39];let ee;e[40]!==Ke||e[41]!==Y?(ee=r.jsxs(on,{onClick:Ke,children:[se,Y]}),e[40]=Ke,e[41]=Y,e[42]=ee):ee=e[42];let M;e[43]!==c||e[44]!==ke||e[45]!==Ce||e[46]!==w?(M=ke&&r.jsxs(on,{className:le(!c&&nl),onClick:F=>{F.stopPropagation(),Ce()},children:[r.jsx(Mo,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ce,e[46]=w,e[47]=M):M=e[47];let T;e[48]!==c||e[49]!==rt||e[50]!==ge||e[51]!==w?(T=rt&&r.jsxs(on,{className:le(!c&&Rc),onClick:F=>{F.stopPropagation(),ge()},children:[c?r.jsx(Zn,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=rt,e[50]=ge,e[51]=w,e[52]=T):T=e[52];let me;e[53]!==c||e[54]!==Je||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==w?(me=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(on,{onClick:F=>{F.stopPropagation(),Je()},children:[c?r.jsx(Io,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=Je,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=w,e[58]=me):me=e[58];let We;e[59]!==k?(We=F=>{F.stopPropagation(),k()},e[59]=k,e[60]=We):We=e[60];let et;e[61]===Symbol.for("react.memo_cache_sentinel")?(et=r.jsx(Il,{className:"h-4 w-4"}),e[61]=et):et=e[61];let De;e[62]!==w?(De=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=De):De=e[63];let $;e[64]!==We||e[65]!==De?($=r.jsxs(on,{variant:"destructive",onClick:We,children:[et,De]}),e[64]=We,e[65]=De,e[66]=$):$=e[66];let ie;e[67]!==Be||e[68]!==ee||e[69]!==M||e[70]!==T||e[71]!==me||e[72]!==$?(ie=r.jsxs(ai,{align:"end",className:"w-44",children:[Be,ee,M,T,me,$]}),e[67]=Be,e[68]=ee,e[69]=M,e[70]=T,e[71]=me,e[72]=$,e[73]=ie):ie=e[73];let Ve;e[74]!==fe||e[75]!==$e||e[76]!==ie?(Ve=r.jsxs(fe,{children:[$e,ie]}),e[74]=fe,e[75]=$e,e[76]=ie,e[77]=Ve):Ve=e[77];let Te;return e[78]!==u||e[79]!==Ee||e[80]!==P||e[81]!==X||e[82]!==g||e[83]!==A||e[84]!==Qe||e[85]!==W||e[86]!==at||e[87]!==Ve||e[88]!==L?(Te=r.jsxs("div",{ref:X,style:g,...u,...Ee,role:ot,tabIndex:m,onClick:P,onKeyDown:L,className:A,children:[Qe,W,at,Ve]}),e[78]=u,e[79]=Ee,e[80]=P,e[81]=X,e[82]=g,e[83]=A,e[84]=Qe,e[85]=W,e[86]=at,e[87]=Ve,e[88]=L,e[89]=Te):Te=e[89],Te}function Nc(v){return v.stopPropagation()}function Cc(v){return v.stopPropagation()}function Pc(){return!1}function Ns(v){const e=wn.c(11),{canAddSection:p,onAddSection:S,className:x,size:V}=v,C=jn();let _;e[0]!==x?(_=le("w-full",x),e[0]=x,e[1]=_):_=e[1];const P=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Fl,{size:14}),e[2]=k):k=e[2];let Z;e[3]!==C?(Z=C("sectionsEditor.sectionList.addSectionButton"),e[3]=C,e[4]=Z):Z=e[4];let ge;return e[5]!==S||e[6]!==V||e[7]!==_||e[8]!==P||e[9]!==Z?(ge=r.jsxs(It,{type:"button",variant:"outline",size:V,className:_,disabled:P,onClick:S,children:[k,Z]}),e[5]=S,e[6]=V,e[7]=_,e[8]=P,e[9]=Z,e[10]=ge):ge=e[10],ge}function Bc(v){const e=wn.c(101),{listKey:p,rawSections:S,sections:x,meta:V,decofile:C,selectedIndex:_,onSelect:P,onReorder:k,onDelete:Z,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Le,onToggleLazy:Ce,onAddVariant:Je,onDetach:w,onAddSection:c,canAddSection:xe}=v,G=xe===void 0?!0:xe,_e=jn(),I=Xn();let ke;e[0]!==x.length?(ke=()=>Co(x.length),e[0]=x.length,e[1]=ke):ke=e[1];const[d,Oe]=b.useState(ke),[u,Ee]=b.useState(null),[X,ze]=b.useState(p),[nt,Pe]=b.useState(x.length),st=b.useRef(!1);X!==p?(ze(p),Pe(x.length),Oe(Co(x.length))):nt!==x.length&&(Pe(x.length),Oe(tt=>Ec(tt,x.length)));let de;e[2]===Symbol.for("react.memo_cache_sentinel")?(de={activationConstraint:{distance:8}},e[2]=de):de=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g={coordinateGetter:Ul},e[3]=g):g=e[3];const we=Ll(Ro(zl,de),Ro(Ol,g));let rt;e[4]!==d?(rt=d.map(Kc),e[4]=d,e[5]=rt):rt=e[5];const ot=rt;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=tt=>{Ee(String(tt.active.id))},e[6]=m):m=e[6];const L=m;let Xe;e[7]!==ot||e[8]!==k?(Xe=tt=>{Ee(null);const{active:O,over:Ae}=tt;if(!Ae||O.id===Ae.id)return;const He=ot.indexOf(String(O.id)),ht=ot.indexOf(String(Ae.id));He===-1||ht===-1||(Oe(bt=>Lo(Yn([...bt],He,ht))),st.current=!0,requestAnimationFrame(()=>{st.current=!1}),k?.(He,ht))},e[7]=ot,e[8]=k,e[9]=Xe):Xe=e[9];const A=Xe;let Qe;e[10]===Symbol.for("react.memo_cache_sentinel")?(Qe=()=>{Ee(null)},e[10]=Qe):Qe=e[10];const W=Qe;let at,fe,Ye,ve,it,$e,Be,Ke,se,Y,ee,M,T,me,We;if(e[11]!==u||e[12]!==G||e[13]!==I||e[14]!==C||e[15]!==d||e[16]!==ot||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==Je||e[21]!==Z||e[22]!==w||e[23]!==ge||e[24]!==Ue||e[25]!==P||e[26]!==Le||e[27]!==Ce||e[28]!==S||e[29]!==x||e[30]!==_||e[31]!==we||e[32]!==_e){me=Symbol.for("react.early_return_sentinel");e:{const tt=O=>{st.current||P(O)};if(e[48]!==u||e[49]!==G||e[50]!==I||e[51]!==d||e[52]!==c||e[53]!==S||e[54]!==x||e[55]!==_e){const O=u?d.find(Ae=>Ae.id===u):null;if(ve=O!=null?x[O.index]:null,Ye=O!=null?S[O.index]:void 0,d.length===0){let Ae;e[59]!==_e?(Ae=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=Ae):Ae=e[60];let He;e[61]!==Ae?(He=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ae}),e[61]=Ae,e[62]=He):He=e[62];const ht=He;let bt;e[63]!==G||e[64]!==I||e[65]!==ht||e[66]!==c?(bt=I?ht:r.jsxs("div",{className:"space-y-2",children:[ht,r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm"})]}),e[63]=G,e[64]=I,e[65]=ht,e[66]=c,e[67]=bt):bt=e[67],me=bt;break e}T=le(O&&"cursor-grabbing"),e[48]=u,e[49]=G,e[50]=I,e[51]=d,e[52]=c,e[53]=S,e[54]=x,e[55]=_e,e[56]=Ye,e[57]=ve,e[58]=T}else Ye=e[56],ve=e[57],T=e[58];fe=Hl,Ke=we,se=ql,Y=L,ee=A,M=W,at=Jl,$e=ot,Be=Ql,We="space-y-1",it=d.map(O=>{const Ae=x[O.index];return Ae?r.jsx(Ac,{sortableId:O.id,section:Ae,raw:S[O.index],meta:V,decofile:C,selected:_===O.index,onSelect:()=>tt(O.index),onDelete:()=>Z(O.index),onDuplicate:()=>ge(O.index),onMakeReusable:()=>Ue(O.index),onToggleHidden:()=>Le(O.index),onToggleLazy:Ce?()=>Ce(O.index):void 0,onAddVariant:()=>Je(O.index),onDetach:()=>w(O.index)},O.id):null})}e[11]=u,e[12]=G,e[13]=I,e[14]=C,e[15]=d,e[16]=ot,e[17]=A,e[18]=V,e[19]=c,e[20]=Je,e[21]=Z,e[22]=w,e[23]=ge,e[24]=Ue,e[25]=P,e[26]=Le,e[27]=Ce,e[28]=S,e[29]=x,e[30]=_,e[31]=we,e[32]=_e,e[33]=at,e[34]=fe,e[35]=Ye,e[36]=ve,e[37]=it,e[38]=$e,e[39]=Be,e[40]=Ke,e[41]=se,e[42]=Y,e[43]=ee,e[44]=M,e[45]=T,e[46]=me,e[47]=We}else at=e[33],fe=e[34],Ye=e[35],ve=e[36],it=e[37],$e=e[38],Be=e[39],Ke=e[40],se=e[41],Y=e[42],ee=e[43],M=e[44],T=e[45],me=e[46],We=e[47];if(me!==Symbol.for("react.early_return_sentinel"))return me;let et;e[68]!==it||e[69]!==We?(et=r.jsx("div",{className:We,children:it}),e[68]=it,e[69]=We,e[70]=et):et=e[70];let De;e[71]!==at||e[72]!==$e||e[73]!==Be||e[74]!==et?(De=r.jsx(at,{items:$e,strategy:Be,children:et}),e[71]=at,e[72]=$e,e[73]=Be,e[74]=et,e[75]=De):De=e[75];let $;e[76]!==Ye||e[77]!==ve||e[78]!==I||e[79]!==C||e[80]!==V?($=ve?r.jsx("div",{className:le("cursor-grabbing shadow-lift",zo(ve,!1,I)),children:r.jsx(Oo,{section:ve,raw:Ye,meta:V,decofile:C})}):null,e[76]=Ye,e[77]=ve,e[78]=I,e[79]=C,e[80]=V,e[81]=$):$=e[81];let ie;e[82]!==$?(ie=ni.createPortal(r.jsx($l,{dropAnimation:Zi,children:$}),document.body),e[82]=$,e[83]=ie):ie=e[83];let Ve;e[84]!==fe||e[85]!==Ke||e[86]!==se||e[87]!==Y||e[88]!==ee||e[89]!==M||e[90]!==De||e[91]!==ie?(Ve=r.jsxs(fe,{sensors:Ke,collisionDetection:se,onDragStart:Y,onDragEnd:ee,onDragCancel:M,children:[De,ie]}),e[84]=fe,e[85]=Ke,e[86]=se,e[87]=Y,e[88]=ee,e[89]=M,e[90]=De,e[91]=ie,e[92]=Ve):Ve=e[92];let Te;e[93]!==G||e[94]!==I||e[95]!==c?(Te=!I&&r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=G,e[94]=I,e[95]=c,e[96]=Te):Te=e[96];let F;return e[97]!==T||e[98]!==Ve||e[99]!==Te?(F=r.jsxs("div",{className:T,children:[Ve,Te]}),e[97]=T,e[98]=Ve,e[99]=Te,e[100]=F):F=e[100],F}function Kc(v){return v.id}function Dc(v,e,p,S){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const x=e.trim();if(!x)return Jt(v,p,S)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:Ts(v,p,S)}:{kind:"noop"};const V=As(v,p,S);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Ft(V.resolveType,V.data,x)};const C=Jn(x),_=Qn(C,p);return _?{kind:"error",reason:"invalid-block-id",message:_}:{kind:"createBlock",blockId:C,blockData:Ft(V.resolveType,V.data,x),reference:cn(C)}}const Po="section-form-stale-save",Mc=3;function Bo(v,e,p){const S=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Fo(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),x=Math.max(0,Math.min(e.pageVariantIndex,S.length-1)),V=S[x]?.sections??[];return{pageVariants:S,variantIndex:x,rawSections:V,parsedSections:kn(V,v,p)}}const Ko=new WeakMap;let Fc=0;function Ic(v){let e=Ko.get(v);return e===void 0&&(e=++Fc,Ko.set(v,e)),e}function Of({orgSlug:v,virtualMcpId:e,branch:p,previewReady:S=!0,previewUrl:x,currentPath:V,activePageBlockKey:C=null,activeGlobalBlockKey:_=null,externalSelection:P,onSaved:k,initialEditSeo:Z=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Le,onFocusedBlockChange:Ce,onSectionPicked:Je,onVariantPreviewOverride:w}){const c=jn(),xe=$i(),G=xe?.taskId??null,_e=S?{orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:x}:null,[I,ke]=b.useState([]),{data:d,isLoading:Oe}=vl(_e,{pollWhile:I.length>0}),{data:u,isLoading:Ee}=Vl(_e),X=Xn(),ze=xe?.virtualMcpId,Pe=qi(ze===e?e:null)?.metadata?.siteSlug??null,st=Xl({virtualMcpId:e,branch:p,sandboxUrl:x}),de=yl(e,p),g=Sl(de),we=Vi(g),rt=!g,ot=!!st||g,[m,L]=b.useState(null),[Xe,A]=b.useState(null),[Qe,W]=b.useState(null),[at,fe]=b.useState(0),[Ye,ve]=b.useState(void 0),[it,$e]=b.useState(null),Be={index:it,remember:$e},[Ke,se]=b.useState(null),[Y,ee]=b.useState(null),[M,T]=b.useState([]),me=b.useRef(null),[We,et]=b.useState(M.length);We!==M.length&&(et(M.length),requestAnimationFrame(()=>{me.current&&(me.current.scrollTop=0)}));const[De,$]=b.useState(0),[ie,Ve]=b.useState(null),[Te,F]=b.useState(null),[tt,O]=b.useState(null),[Ae,He]=b.useState(!1),[ht,bt]=b.useState(!1),Rn=b.useRef(null),[En,$o]=b.useState(!0),[Qt,Vn]=b.useState(!1),[Lt,Tn]=b.useState(!1),[je,un]=b.useState(Z),[Ps,Bs]=b.useState(Z);Z&&!Ps&&(Bs(!0),un(!0),L(null),A(null),W(null),T([])),!Z&&Ps&&Bs(!1);const[Wo,dn]=b.useState(null),[Ks,An]=b.useState(void 0),[Ds,Ot]=b.useState([]),[Ms,Yt]=b.useState(0),[Me,lt]=b.useState(0),[Ho,Fe]=b.useState(null),[Zt,qe]=b.useState(null),[Fs,Is]=b.useState(null),Nn=ii(),Cn=bl({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),fn=Kl({orgSlug:v,virtualMcpId:e,branch:p}),[qo,Go]=b.useState(V),[Uo,Jo]=b.useState(C),[Qo,Yo]=b.useState(_);(qo!==V||Uo!==C||Qo!==_)&&(queueMicrotask(()=>fn.flush()),Go(V),Jo(C),Yo(_),L(null),A(null),W(null),fe(0),se(null),ee(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1),un(!1),dn(null),An(void 0),Ot([]),Yt(t=>t+1));const B=Dl({orgSlug:v,virtualMcpId:e,branch:p}),mn=pl(t=>{B.mutate(t,{onSuccess:()=>k?.(),onError:B.reportError})},d??{},B.v8),Pn=Bl({orgSlug:v,virtualMcpId:e,branch:p}),Ls=hc({orgSlug:v,virtualMcpId:e,branch:p}),[Xt,en]=b.useState(!1),N=b.useRef(null),_t=b.useRef(null),gt=b.useRef(null),vt=b.useRef(null),Bn=b.useRef({}),zt=b.useRef(null),pn=b.useRef(!1),hn=b.useRef(!1),ye=b.useRef(new Map),tn=b.useRef(!1),ct=b.useRef([]),es=b.useRef(new WeakSet);xl(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:o,selectedSectionIndex:a}=re.current,i=new Set;n&&i.add(n);for(const l of[_t.current?.sectionIndex,a]){const f=l==null?void 0:s[l],R=l==null?void 0:o[l],h=f&&R?.isSavedBlock?_s(f,R):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[N,gt,vt])l.current&&clearTimeout(l.current),l.current=null;_t.current=null,ye.current.clear(),n&&t.has(n)&&(Bn.current={})}});const re=b.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Os,zs]=b.useState(0),[Zo,Xo]=b.useState(0),$s=li(de,{orgSlug:v,virtualMcpId:e,branch:p}),Ws=ci($s,I[0]?.blockKey??null,ui(d,I[0]?.blockKey??null)),[ea,ta]=b.useState(null),ts=_l(v,e).epoch,[na,sa]=b.useState(ts);lc(je?{orgSlug:v,virtualMcpId:e,branch:p}:null,d??void 0,u??void 0);const Hs=_??(d&&u?_o(ko(d,u),V,C)?.key??null:null),ns=So({orgSlug:v,virtualMcpId:e,branch:p},Hs?[Hs]:[],{withRefs:!0}),[qs,ra]=b.useState(!1),ss=So({orgSlug:v,virtualMcpId:e,branch:p},qs?Tl:[]),Gs={ready:!(de.kind==="protocol"&&de.hosted)||qs&&ss.ready,failed:ss.failed,retry:ss.retry,request:()=>ra(!0)};if(ns.failed)return r.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground",children:[r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailed")}),r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailedHint")}),r.jsx(It,{variant:"outline",size:"sm",onClick:ns.retry,children:c("sectionsEditor.namedRules.tryAgain")})]});if(!S||Oe||Ee||!ns.ready)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(di,{className:"size-5 text-muted-foreground"})});if(!d||!u)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const oa=ko(d,u),q=!!_,oe=q?null:_o(oa,V,C),y=q?_:oe?.key??null,rs=q&&_?d[_]:void 0,Us=q&&_&&rs?Al(_,rs):q&&_?_:"",nn=!q&&y&&d[y]?d[y]:null,os=je&&d&&u&&y&&oe?Eo(d,{kind:"page",pageKey:y,pageName:String(oe.name??""),path:String(oe.path??"")},u):null,aa=je?nn?.seo:void 0,Kn=Ks!==void 0?Ks:aa,ia=je?sc(Kn):void 0,Js=os?.seoTypeOptions??[],Qs=je&&u?rc(u):"",as=Wo??ia??{},Dn=je&&os?cc(as,os):null,Ys=je&&Dn&&oc(Kn)?Gn(Dn,u):null,Zs=je?ac(d,u)?.seoData:void 0,pe=q?[{label:"Default",sections:[{__resolveType:_}]}]:Fo(nn?.sections,d??{},g),yt=pe.length>1,te=Math.min(at,pe.length-1),Se=pe[te],K=Se?.sections??[],ce=kn(K,d,g),Mn=!q&&gc(nn?.sections,g);if(q&&_&&Fs!==_){Is(_);const t=K[0],n=ce[0];if(t&&n){L(0),lt(0),T([]);const s=wt(t,n,d,g);s&&(A(s.data),W(s.resolveType),qe(null),Fe(null))}}!q&&Fs!==null&&Is(null),re.current={rawSections:K,parsedSections:ce,decofile:d??{},activePageKey:y,pageVariants:pe,variantIndex:te,sectionVariantIndex:Me,selectedSectionIndex:m};const la=()=>({multivariate:Mn,index:te,variants:pe.map(t=>({rule:t.rule})),lazyValues:g&&Mn&&Ai(nn?.sections?.variants?.[te]?.value)}),is=(t,n)=>{if(!w)return;if(!y||!Mn||t.length<=1){w(null);return}const s={multivariate:!0,index:n,variants:t},o=g?bo(y,s):No(y,s,d,u);w(o.length>0?o:null)},ls=w&&y&&Mn&&yt&&!Oe&&!Ee?y:null;if(ls!==ea&&(ta(ls),ls)){const t=pe.map(s=>({rule:s.rule})),n=te;queueMicrotask(()=>is(t,n))}const $t=(t,n,s)=>{if(!w)return;if(!y){w(null);return}const o=la(),a=g?bo(y,o):No(y,o,d,u);if(!t||n<0){w(a.length>0?a:null);return}const i={pageKey:y,page:o,sectionIndex:n,sectionLazy:ce[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=g?wl(i):xc({...i,decofile:d,meta:u}),f=g?jl(a,l):[...a,...l];w(f.length>0?f:null)},xt=(t,n,s,o=m??-1,a=!1)=>{const i=pt(t,n);if(!i){A(null),W(null),qe(null),Fe(null),a&&$t(null,o,s);return}const f=Qr(i,we)[s];if(!f){A(null),W(null),qe(null),Fe(null),a&&$t(null,o,s);return}const R=hi(f.value,d);A(R?.data??null),W(R?.resolveType??null);const{resolveType:h,formValue:j}=Ut(f.rule,d,u??void 0);qe(h),Fe(j),a&&$t(i,o,s)},cs=t=>{F(null),fe(t),L(null),A(null),W(null),T([]);const n=pe[t]?.rule,{resolveType:s,formValue:o}=Ut(n,d??{},u??void 0);ee(s),se(o),is(pe.map(a=>({rule:a.rule})),t)},ca=(t,n)=>{const s=K[t],o=ce[t];if(!s||!o)return!1;const a=o.isMultivariate?pt(s,o)?.variants?.length??0:0,i=n<a?n:0;if(L(t),lt(i),T([]),$(l=>l+1),o.isMultivariate)xt(s,o,i,t);else{const l=wt(s,o,d,g);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),qe(null),Fe(null)}return!0},Xs=P?.index;if(P!==void 0&&(P?.seq??null)!==Ye&&(ve(P?.seq??null),typeof Xs=="number"&&ca(Xs,0)),ts!==na){sa(ts);const t=N.current!==null||ye.current.size>0||vt.current!==null||gt.current!==null||B.isPending||fn.isPending||I.length>0,n=m!==null&&Jr(me.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=K[m],o=ce[m];if(T([]),$(a=>a+1),!s||!o)L(null),A(null),W(null);else if(o.isMultivariate)xt(s,o,Me,m);else{const a=wt(s,o,d,g);A(a?.data??null),W(a?.resolveType??null)}}!t&&je&&(dn(null),An(void 0),Yt(s=>s+1))}if(Os!==Zo){Xo(Os);const t=m!==null?K[m]:null,n=m!==null?ce[m]:null;if(t&&n&&m!==null)if(T([]),$(s=>s+1),n.isMultivariate)xt(t,n,Me,m);else{const s=wt(t,n,d,g);A(s?.data??null),W(s?.resolveType??null)}}const ut=I[0];if(ut){const{formBase:t,target:n}=ut,s=Bo(d,n,g),o=t.sectionIndex,a=s.rawSections.length===t.sectionCount?bs(s.rawSections[o],s.parsedSections[o],n.sectionVariantIndex,d,g):null,i=fi(ut,a,l=>Yr(t,l));if(i){const f=[{...ut,...i,changedAgain:!0},...I.slice(1)];ct.current=f,ke(f)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:g?void 0:x??void 0,siteSlug:Pe},Fn=Qe&&u?Gn(Qe,u):null,dt=(t,n)=>{if(!y)return;N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=ln(d,y,t,te,pe);B.mutate({blockKey:y,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:o=>{n?.onError?.(),B.reportError(o)}})},Wt=()=>{Ce?.(null),L(null),Tn(!1),A(null),W(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1)},er=()=>Jr(me.current,document.activeElement),us=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),_t.current=null,H.error(t,{id:Po}),er()){tn.current=!0;return}zs(n=>n+1)},tr=()=>{!tn.current||er()||ct.current.length>0||N.current!==null||pn.current||hn.current||ye.current.size>0||(tn.current=!1,zs(t=>t+1))},nr=()=>{tn.current&&setTimeout(tr,0)},sr=de.kind==="protocol"&&de.source==="github",rr=t=>El(Nn,Cn,t,de.kind==="protocol"?de:null),or=t=>{ye.current.size!==0&&setTimeout(()=>{if(pn.current||hn.current)return;const n=[...ye.current.values()];ye.current.clear();for(const s of n)s()},t)},ua=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:o}=re.current,a=zt.current;return{formBase:a?.sectionIndex===t&&a.variantIndex===o?a:null,pageKey:n,global:q,pageVariantIndex:s,sectionVariantIndex:o,schema:Fn}},vn=t=>{ct.current=t,ke(t)},da=t=>{const n=ct.current,s=n.findIndex(i=>i.formBase===t.formBase),o=s>=0?n[s]:void 0,a=o?n.with(s,{...t,choices:no(o.plan,o.choices,t.plan),fresh:Ii(o.plan,t.plan,o.fresh),changedAgain:o.changedAgain||Hn(o.plan.theirs)!==Hn(t.plan.theirs)}):[...n,{...t,changedAgain:es.current.has(t.formBase)}];vn(a)},ar=(t,n)=>{const s=ct.current,o=s.findIndex(l=>l.formBase===t),a=s[o];if(!a)return!1;if(Hn(a.plan.mine)===Hn(n))return!0;const i=to({...a.plan,mine:n});if(i.pointers.length===0){const l=s.filter(f=>f!==a);return vn(l),!1}return vn(s.with(o,{...a,plan:i,choices:no(a.plan,a.choices,i)})),!0},fa=t=>{const n=re.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},ma=()=>{const t=ct.current[0];if(!t)return null;const{formBase:n,target:s}=t;N.current&&_t.current?.sectionIndex===n.sectionIndex&&_t.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(N.current),N.current=null,_t.current=null),ye.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const o=n.emitted;return o&&typeof o=="object"&&!ar(n,o)&&yn(o,n.sectionIndex,0,s),ct.current[0]??null},pa=()=>{const t=ct.current[0],n=ma();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=ji(n.plan,n.choices);de.kind==="protocol"&&de.source==="github"&&Ri(n.plan,n.choices)&&kl(c,!1),vn(ct.current.slice(1));const{formBase:o,target:a}=n;o.base=n.plan.theirs,o.version=void 0,o.emitted=s,es.current.add(o),(zt.current===o||fa(n))&&(zt.current=o,A(s),$(i=>i+1)),yn(s,o.sectionIndex,0,a)},ha=t=>{const[n,...s]=ct.current;n&&vn([{...n,choices:t},...s])},yn=(t,n,s=0,o,a=!1)=>{const i=o??ua(n),l=i.sectionVariantIndex,f=i.formBase,R=a||eo(ct.current,f,i,n,g).runNow,h=_t.current;N.current&&(clearTimeout(N.current),N.current=null,h&&(h.sectionIndex!==n||h.sectionVariantIndex!==l)&&h.write());const j=`${i.pageKey}:${n}:${l}`,E=()=>{if(pn.current||hn.current){ye.current.set(j,E);return}const D=typeof t=="function"?t():t,z=eo(ct.current,f,i,n,g).base;if(z&&ar(z,D))return;const ne=re.current.decofile,{rawSections:J,parsedSections:Ne,pageVariants:Q,variantIndex:be}=Bo(ne,i,g),Ie=i.pageKey,he=J[n];if(!he)return;const ue=Ne[n];if(!ue)return;const Ge=f?.base,Ze=bs(he,ue,l,ne,g),Nt=!!Ge&&!!Ze&&Ni(Ge,Ze)&&!(f&&Yr(f,Ze));if(Nt&&Ge&&Ze){if(Ci(Ge,Ze)){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const U=ue.isSavedBlock?"here":Pi(Ge,J.map((ae,mt)=>bs(ae,Ne[mt],l,ne,g)),n,f?.sectionCount??J.length);if(U==="unknown"){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof U=="number"&&f){f.sectionCount=J.length,f.sectionIndex=U,zt.current===f&&L(U),yn(D,U,s,i);return}}const Ct=Nt&&Ge&&Ze?to({ancestor:Ge,mine:D,theirs:Ze}):null;if(Ct&&Ct.pointers.length>0&&f){f.sectionCount=J.length,da({plan:Ct,formBase:f,target:i,sectionIndex:n,choices:Bi(Ct),changedAgain:!1,blockKey:ue.isSavedBlock?_s(he,ue):Ie,fresh:{}});return}const Pt=Ct?Ct.merged:null,rn=Pt??D,qr=Ki({merged:!!Pt,tracked:f,current:zt.current,saved:D});Pt&&H.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Po}),qr&&f&&(f.emitted=Pt,A(Pt));const Ss=qr||!Pt?rn:D;f&&(f.base=Ss,f.sectionCount=J.length,Di(f,Ss));const Gr={onSuccess:()=>{f&&es.current.delete(f),k?.()},onError:U=>{if(f?.base===Ss&&Ge&&(f.base=Ge),U instanceof Rl){if(f&&(f.version=void 0),s<Mc){ye.current.delete(j),hn.current=!0;const ae=Li(s,U.carriedStored);setTimeout(()=>{hn.current=!1,yn(()=>{const mt=f?.emitted;return mt&&typeof mt=="object"?mt:D},n,s+1,i,ae.immediate),ye.current.delete(j),or(xn(g))},ae.delay)}else us();return}B.reportError(U)}},Ur=U=>{pn.current=!0;let ae=!1;B.mutateAsync(U).then(()=>Gr.onSuccess(),mt=>{ae=!0,Gr.onError(mt)}).finally(()=>{pn.current=!1,or(ae?xn(g):0),tr()})};if(ue.isSavedBlock){const U=_s(he,ue);if(!U)return;Ur({blockKey:U,data:rn,...Ge?{base:{value:Mi({startedFrom:Ge,stored:Ze,rebased:!!Pt,refused:s>0})}}:{},rebaseOnConflict:!1,guard:so({formBase:f,rebased:!!Pt,versionOf:rr,productionVersionOf:ae=>oo(Nn,Cn,ae),...sr?{copy:{value:ne[U]}}:{}})});return}if(!Ie)return;const Wn={...ne[Ie]},Gt=[...J];if(ue.isMultivariate){const U=pt(he,ue);if(!U||!Ie)return;const ae=Fi(U,l,rn);Gt[n]=Bt(he,ue,ae)}else if(ue.isHidden){const U=Cs(he.__resolveType),ae=U?{...he.section}:{...he},mt=Array.isArray(ae.variants)?[...ae.variants]:[];mt[0]&&(mt[0]=ro(ae.__resolveType,mt[0],rn)),ae.variants=mt,U?Gt[n]={...he,section:ae}:Gt[n]=ae}else ue.isLazy?Gt[n]={...he,section:rn}:Gt[n]=rn;if(Q.length>1){const U=Wn.sections,ae=[...U?.variants??[]];ae[be]&&(ae[be]=ro(U?.__resolveType,ae[be],Gt)),Wn.sections={...U,variants:ae}}else Wn.sections=Gt;Ur({blockKey:Ie,data:Wn,rebaseOnConflict:!1,guard:so({formBase:null,rebased:!1,versionOf:rr,productionVersionOf:U=>oo(Nn,Cn,U),...sr?{copy:{value:ne[Ie]}}:{}})})};if(_t.current={sectionIndex:n,sectionVariantIndex:l,write:E},R){_t.current=null,E();return}N.current=setTimeout(()=>{N.current=null,E()},xn(g))},ga=t=>{tn.current=!1,L(t),lt(0),T([]),$(a=>a+1);const n=K[t],s=ce[t];if(Ce?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){xt(n,s,0,t);return}const o=wt(n,s,d,g);if(!o){A(null),W(null),qe(null),Fe(null),$t(null,t,0);return}A(o.data),W(o.resolveType),qe(null),Fe(null),$t(null,t,0)},ir=t=>{const n=t;m!==null&&(zt.current=Ei(zt.current,{sectionIndex:m,variantIndex:re.current.sectionVariantIndex,shown:Xe,next:n,sectionCount:re.current.rawSections.length})),A(n),m!==null&&yn(n,m)},ds=t=>{if(!y||!d||!u||!oe)return;const n={kind:"page",pageKey:y,pageName:String(oe.name??""),path:String(oe.path??"")},s=Eo(d,n,u);s&&fn.save(y,()=>{const o=Nn.getQueryData(Ti.decofile(Cn))?.[y];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const a={...o,...Bn.current};return Bn.current={},t?.raw!==void 0?uc(a,t.raw,u):t?.inner!==void 0?dc(n,s,a,t.inner):a})},lr=(t,n)=>{y&&(Bn.current[t]=n,ds())},va=(t,n)=>{if(!y)return;const s=Yn([...K],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),dt(s)},ya=t=>{if(!y)return;const n=K.filter((s,o)=>o!==t);m===t?Wt():m!==null&&m>t&&L(m-1),dt(n)},Sa=t=>{if(!y)return;const n=K[t];if(!n)return;const s=[...K];s.splice(t+1,0,hl(n)),m!==null&&m>t&&L(m+1),dt(s)},ba=t=>{if(!y)return;const n=K[t],s=ce[t];if(!n||!s)return;const o=s.isHidden?_i(n,g):ki(n,u);if(!o)return;const a=[...K];a[t]=o,m===t&&Wt(),dt(a)},xa=t=>{if(!y)return;const n=K[t],s=ce[t];if(!n||!s||s.isMultivariate)return;const o=xi(n);if(!o)return;const a=[...K];a[t]=o,m===t&&Wt(),dt(a)},_a=t=>{if(!y)return;const n=K[t],s=ce[t];if(!n||!s?.isSavedBlock)return;const o=wt(n,s,d,g);if(!o?.data)return;const{name:a,...i}=o.data,l=[...K];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&Wt(),dt(l)},ka=t=>{if(!y)return;const n=Hi(ce),s=[...K.slice(0,n),{__resolveType:t.resolveType},...K.slice(n)];dt(s,{onError:()=>{re.current.selectedSectionIndex===n&&Wt()}}),He(!1),L(n),lt(0),T([]),$(l=>l+1);const o=s[n],a=kn(s,d,g)[n];if(!o||!a)return;if(a.isMultivariate){xt(o,a,0);return}const i=wt(o,a,d,g);if(!i){A(null),W(null),qe(null),Fe(null);return}A(i.data),W(i.resolveType),qe(null),Fe(null)},cr=t=>{Rn.current=t.append,He(!0)},wa=t=>{const n=Rn.current;if(!n){ka(t);return}n({__resolveType:t.resolveType}),He(!1),Rn.current=null},ur=t=>{if(m===null)return;const n=K[m],s=ce[m];!n||!s?.isMultivariate||(lt(t),T([]),$(o=>o+1),xt(n,s,t,m,!0))},ja=t=>{if(m===null||!y)return;const n=K[m],s=ce[m];if(!n||!s?.isMultivariate)return;const o=pt(n,s);if(!o)return;const a=Si(o,t);if(!a){H.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...K];i[m]=Bt(n,s,a);const l=a.variants;let f=Me;t===Me?f=Math.min(t,l.length-1):t<Me&&(f=Me-1),lt(f),T([]),$(R=>R+1),xt(i[m],s,f),dt(i)},Ra=t=>{if(m===null||!y)return;const n=K[m],s=ce[m];if(!n||!s?.isMultivariate)return;const o=pt(n,s);if(!o)return;const a=bi(o,t,g),i=[...K];i[m]=Bt(n,s,a);const l=Xr(o.variants??[],t,g);lt(l),T([]),$(f=>f+1),xt(i[m],s,l,m,g),dt(i)},Ea=(t,n)=>{if(m===null||!y||t===n)return;const s=K[m],o=ce[m];if(!s||!o?.isMultivariate)return;const a=pt(s,o);if(!a)return;const i=vi(a,t,n),l=[...K];l[m]=Bt(s,o,i);let f=Me;Me===t?f=n:t<Me&&n>=Me?f=Me-1:t>Me&&n<=Me&&(f=Me+1),lt(f),xt(l[m],o,f,m,g),dt(l)},Sn=t=>{const n=t??m;if(n===null||!y)return;const s=K[n],o=ce[n];if(!s||!o)return;const a=gi(s,o,void 0,u,g);if(!a){H.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...K];i[n]=a.section;const l=kn(i,d,g)[n];if(!l?.isMultivariate){H.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),lt(a.newVariantIndex),T([]),$(f=>f+1),xt(a.section,l,a.newVariantIndex,n,g),dt(i)},dr=()=>{if(m===null||!y)return;const t=K[m],n=ce[m];if(!t||!n?.isMultivariate)return;const s=pt(t,n);if(!s)return;const o=yi(t,n,s);if(!o){H.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const a=[...K];a[m]=o;const i=kn(a,d,g)[m];if(!i)return;lt(0),qe(null),Fe(null),T([]),$(f=>f+1);const l=wt(o,i,d,g);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),$t(null,m,0),dt(a)},Va=async t=>{if(ie===null||!y)return;const n=Qn(t,d,u);if(n){H.error(n);return}const s=K[ie],o=ce[ie];if(!s||!o)return;const a=wt(s,o,d,g);if(!a){H.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...a.data,name:t};try{const l=await B.mutateAsync({blockKey:t,data:i,create:!0}),f=[...K];f[ie]={__resolveType:t},await B.mutateAsync({blockKey:y,data:ln(d,y,f,te,pe)}),m===ie&&Wt(),Ve(null),Un(l)||H.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){H.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Kt(c,Dt(l))})}},fr=Se?.rule;if(yt&&m===null&&Y===null&&fr){const{resolveType:t,formValue:n}=Ut(fr,d??{},u??void 0);ee(t),se(n)}const sn=u?al(u):[],fs=u&&d?il(u,d):[],Ht=g&&u&&d?fc(u,d):[],ms=(t,n)=>{if(Ht.length===0)return;const s=Nl(t);return{kinds:Ht,selected:s,campaignPrefill:mc(t),onPick:n,load:Gs}},mr=!q&&!!(ot&&u&&d),pr=Y&&u?Gn(Y,u):null,St=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},qt=async(t,n)=>{if(Sc(n,t,u,g))try{await Pn.mutateAsync({blockKey:t})}catch(s){H.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Kt(c,Dt(s))})}},hr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a={...s[n]},i={...a.sections},l=[...i.variants??[]],f=l[o],R=f?.rule;if(Jt(R,s,u)){const h=R?.__resolveType??"",j=s[h],E=typeof j?.name=="string"?j.name:h,{__resolveType:D,...z}=t;B.mutate({blockKey:h,data:Ft(D??"",z,E)},{onSuccess:()=>k?.(),onError:B.reportError});return}f&&(l[o]={...f,rule:t}),a.sections={...i,variants:l},B.mutate({blockKey:n,data:a},{onSuccess:()=>k?.(),onError:B.reportError})},xn(g))},gr=t=>{ee(t);const n=t?Ao(t,u):{__resolveType:Zr(u)};se(t?n:{}),hr(n)},vr=t=>{const n=t;se(n);const s=Y?{__resolveType:Y,...n}:{...n};hr(s)},In=async(t,n,s)=>{const o=pc(n,t);if(!o.ok)return o.reason==="conflict"&&H.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),xo),null;const a={};if(s){const i=s(o.rule);if(!i)return null;a[i.blockKey]=i.data}return o.blockWrite&&(a[o.blockWrite.blockKey]=o.blockWrite.block),Object.keys(a).length>0&&!(await Ls.apply({writes:a})).ok?null:(o.blockWrite&&H.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...xo,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:o.rule,projected:{...n,...a}})},yr=Ht.length>0?{kinds:Ht,load:Gs,prepare:async t=>(await In(t,re.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Cl(re.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Ls.apply({writes:{[Pl(t).blockKey]:n.block}})).ok}}:null,Sr=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a=await In(t,s,f=>{const R=s[n],h=R?.sections;if(!h||typeof h!="object"||Array.isArray(h))return null;const j=h;if(!Array.isArray(j.variants))return null;const E=[...j.variants],D=E[o];return D?(E[o]={...D,rule:f},{blockKey:n,data:{...R,sections:{...j,variants:E}}}):null});if(!a)return;const{resolveType:i,formValue:l}=Ut(a.rule,a.projected,u??void 0);ee(i),se(l),k?.()},br=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a=s[n],i=a?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],R=f[o];if(!R)return;const h=Mt(R.rule,s,u),j=cn(t);f[o]={...R,rule:j};const E={...s,[n]:{...a,sections:{...l,variants:f}}},{resolveType:D,formValue:z}=Ut(j,E,u??void 0);ee(D),se(z);try{await B.mutateAsync({blockKey:n,data:E[n]}),h&&h!==t&&await qt(h,E),k?.()}catch(ne){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(ne))})}},xr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=re.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(!l)return;const h=o[n],j=a[n];if(!h||!j?.isMultivariate)return;const E=pt(h,j);if(!E)return;const z=(E.variants??[])[s]?.rule;if(Jt(z,i,u)){const Q=z?.__resolveType??"",be=i[Q],Ie=typeof be?.name=="string"?be.name:Q,{__resolveType:he,...ue}=t;B.mutate({blockKey:Q,data:Ft(he??"",ue,Ie)},{onSuccess:()=>k?.(),onError:B.reportError});return}const ne=xs(E,s,t),J=[...o];J[n]=Bt(h,j,ne);const Ne=ln(i,l,J,R,f);B.mutate({blockKey:l,data:Ne},{onSuccess:()=>k?.(),onError:B.reportError})},xn(g)))},Ta=t=>{qe(t);const n=t?Ao(t,u):{__resolveType:Zr(u)};Fe(t?n:{}),xr(n)},Aa=t=>{const n=t;Fe(n);const s=Zt?{__resolveType:Zt,...n}:{...n};xr(s)},Na=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(n===null||!l)return;const h=await In(t,i,D=>{const z=o[n],ne=a[n];if(!z||!ne?.isMultivariate)return null;const J=pt(z,ne);if(!J)return null;const Ne=[...o];return Ne[n]=Bt(z,ne,xs(J,s,D)),{blockKey:l,data:ln(i,l,Ne,R,f)}});if(!h)return;const{resolveType:j,formValue:E}=Ut(h.rule,h.projected,u??void 0);qe(j),Fe(E),k?.()},Ca=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(n===null||!l)return;const h=o[n],j=a[n];if(!h||!j?.isMultivariate)return;const E=pt(h,j);if(!E)return;const D=E.variants??[],z=Mt(D[s]?.rule,i,u),ne=cn(t),J=xs(E,s,ne),Ne=[...o];Ne[n]=Bt(h,j,J);const Q=ln(i,l,Ne,R,f),be={...i,[l]:Q},{resolveType:Ie,formValue:he}=Ut(ne,be,u??void 0);qe(Ie),Fe(he);try{await B.mutateAsync({blockKey:l,data:Q}),z&&z!==t&&await qt(z,be),k?.()}catch(ue){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(ue))})}};if(!q&&!oe)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:V})});if(q&&!rs)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const Re=m!==null?ce[m]??null:null,_r=m!==null?K[m]:null,kr=_r&&Re?.isMultivariate?pt(_r,Re):null,Vt=kr?Qr(kr,we,g):[],Ln=Math.min(Me,Math.max(Vt.length-1,0)),kt=Vt[Ln]??null,Tt=Re?.isMultivariate===!0,ps=m!==null&&Re!==null,At=ps&&(Tt||!!(Fn&&Xe)),Pa=At&&!q&&Re?.isSavedBlock===!0,ft=q||Pa,wr=q?Us:Re?.label??"",Ba=Zt&&u?Gn(Zt,u):null,jr=(t,n)=>n&&X?`${t} · ${n}`:t,Rr=Re?Re.variantOf??Re.label:"",Ka=(()=>{const t=Tt&&kt?kt.label:null;return t?X?[jr(Rr,t)]:[Re.label,t]:[Re?.label??""]})(),hs=jr(oe?.name??"",yt?Se?.label:null),On=At&&(!q||M.length>0)?q?[Us,...M]:[hs,...Ka,...M]:[],Er=je&&oe?[oe.name,"SEO",...Ds]:[],Vr=c("sectionsEditor.pageVariantTabs.variantsLabel"),Tr=Qt&&oe?[oe.name,Vr]:Lt&&oe&&Re?[hs,Rr,Vr]:[],zn=Tr.length>0?Tr:Er.length>0?Er:ft?On.length>0?On:[wr]:On.length>0?On:[hs],Ar=ps&&!Tt&&!Re?.isHidden&&!!y,Da=ft||!q&&yt&&!!Se||Ar,Ma=ps&&!Tt&&!q&&M.length===0&&!!Re&&Do(Re)&&!!y,Fa=X&&At&&!Lt&&Tt&&M.length===0&&!!kt,Nr=X&&M.length>0?co(M[M.length-1]):null,Ia=M.length>1?co(M[M.length-2]):null,Cr=ft?wr:At?Re?.label??"":oe?.name??"",La=Qt||Lt?c("sectionsEditor.pageVariantTabs.variantsLabel"):je?c("sectionsEditor.panelSections.seo"):Nr??Cr,Pr=Lt?Re?.variantOf??Re?.label??"":Qt||je?oe?.name??"":Nr?Ia??Cr:ft?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):At?oe?.name??"":oe?.path??"",gs=!Qt&&!Lt&&!je&&!At&&!ft,Oa=!X&&!je&&!q&&Tt&&M.length===0,bn=()=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const t=d[y],n=vc(t.sections,K,u,g);if(!n)return;const{sections:s,newVariantIndex:o}=n;B.mutate({blockKey:y,data:{...t,sections:s}},{onSuccess:()=>{fe(o),L(null),A(null),W(null),T([]),se(null),ee(null)},onError:B.reportError})},$n=(t,n,s)=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const o=d[y],a=o.sections;if(!a||typeof a!="object"||Array.isArray(a))return;const i=a;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const f=yc(i,l),R={...d,[y]:{...o,sections:f}};B.mutate({blockKey:y,data:R[y]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const j of h)await qt(j,R)})()},onError:B.reportError})},Br=(t,n)=>{if(t===n)return;let s=te;te===t?s=n:t<te&&n>=te?s=te-1:t>te&&n<=te&&(s=te+1),fe(s);const o=Yn(pe.map(a=>({rule:a.rule})),t,n);is(o,s),$n(a=>Yn(a,t,n))},Kr=t=>{const n=pe[t]?.rule,s=Mt(n,d??{},u??void 0);$n(o=>o.length<=1?null:(o.splice(t,1),o),()=>{pe.length-1===1?fe(0):t<te?fe(te-1):t===te&&fe(Math.max(0,t-1)),L(null),A(null),W(null),T([]),se(null),ee(null)},s)},za=()=>{const t=pe.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!wi(n.rule)).map(({variant:n})=>Mt(n.rule,d??{},u??void 0)).filter(n=>!!n);$n(n=>{const s=Oi({variants:n}),o=n[s];return o?[{...o,rule:zi(u)}]:null},()=>{fe(0),L(null),A(null),W(null),T([]),se(null),ee(null),Vn(!1)},t)},Dr=t=>{let n=t+1;$n(s=>(n=Xr(s,t,g),bc(s,t,g)),()=>{fe(n),L(null),A(null),W(null),T([]),se(null),ee(null)})},$a=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const s=re.current.activePageKey,o=re.current.decofile;if(!s)return;const a=o[s],i=a.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],R=f[t];if(!R?.rule||typeof R.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=R.rule,j=n.trim();en(!0);try{if(!j){if(!Jt(h,o,u)){F(null);return}const Q=h.__resolveType??"";f[t]={...R,rule:Ts(h,o,u)};const be={...o,[s]:{...a,sections:{...l,variants:f}}};await B.mutateAsync({blockKey:s,data:be[s]}),await qt(Q,be),F(null),k?.();return}const E=As(h,o,u);if(!E){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(E.blockKey){await B.mutateAsync({blockKey:E.blockKey,data:Ft(E.resolveType,E.data,j)}),F(null),k?.();return}const D=Jn(j),z=Qn(D,o,u);if(z){H.error(z);return}const ne=Ft(E.resolveType,E.data,j);let J=null,Ne=!1;try{const Q=await B.mutateAsync({blockKey:D,data:ne,create:!0});Ne=Un(Q),J=Ne?null:D,f[t]={...R,rule:cn(D)},await B.mutateAsync({blockKey:s,data:{...a,sections:{...l,variants:f}}}),J=null}catch(Q){throw J&&await Pn.mutateAsync({blockKey:J}).catch(()=>{}),Q}F(null),Ne||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:j})),k?.()}catch(E){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(E))})}finally{en(!1)}},Wa=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{selectedSectionIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(s===null||!l)return;const h=o[s],j=a[s];if(!h||!j?.isMultivariate)return;const E=pt(h,j);if(!E)return;const D=E.variants??[],z=D[t];if(!z?.rule||typeof z.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ne=z.rule,J=n.trim();en(!0);const Ne=async Q=>{const be={...E,variants:Q},Ie=[...o];Ie[s]=Bt(h,j,be);const he=ln(i,l,Ie,R,f);return await B.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!J){if(!Jt(ne,i,u)){O(null);return}const Ze=ne.__resolveType??"",Nt=[...D];Nt[t]={...z,rule:Ts(ne,i,u)};const Ct=await Ne(Nt);await qt(Ze,Ct),O(null),k?.();return}const Q=As(ne,i,u);if(!Q){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Q.blockKey){await B.mutateAsync({blockKey:Q.blockKey,data:Ft(Q.resolveType,Q.data,J)}),O(null),k?.();return}const be=Jn(J),Ie=Qn(be,i,u);if(Ie){H.error(Ie);return}const he=Ft(Q.resolveType,Q.data,J);let ue=null,Ge=!1;try{const Ze=await B.mutateAsync({blockKey:be,data:he,create:!0});Ge=Un(Ze),ue=Ge?null:be;const Nt=[...D];Nt[t]={...z,rule:cn(be)},await Ne(Nt),ue=null}catch(Ze){throw ue&&await Pn.mutateAsync({blockKey:ue}).catch(()=>{}),Ze}O(null),Ge||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:J})),k?.()}catch(Q){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(Q))})}finally{en(!1)}},Mr=async(t,n,s)=>{A(s);try{await B.mutateAsync({blockKey:t,data:s})}catch(o){throw A(a=>a===s?n:a),o}},Ha={rename:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],f=l?.rule&&typeof l.rule=="object"?l.rule:void 0,R=async j=>{const E={...t,variants:j};return await Mr(o,t,E),{...a,[o]:E}},h=Dc(f,s,a,u);if(h.kind!=="noop"){if(h.kind==="error"){H.error(h.reason==="no-matcher-rule"?c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):h.reason==="unreadable-rule"?c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):h.message??c("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}en(!0);try{if(h.kind==="inline"){const D=[...i];D[n]={...l,rule:h.inlinedRule};const z=await R(D);await qt(h.blockKey,z),k?.();return}if(h.kind==="updateBlock"){await B.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let j=null,E=!1;try{const D=await B.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});E=Un(D),j=E?null:h.blockId;const z=[...i];z[n]={...l,rule:h.reference},await R(z),j=null}catch(D){throw j&&await Pn.mutateAsync({blockKey:j}).catch(()=>{}),D}E||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(j){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(j))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const f=Mt(l.rule,a,u);i[n]={...l,rule:cn(s)};const R={...t,variants:i},h={...a,[o]:R};try{await Mr(o,t,R),f&&f!==s&&await qt(f,h),k?.()}catch(j){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(j))})}},selectNamedRule:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;let i=null;!await In(s,a,f=>{const R=Array.isArray(t.variants)?[...t.variants]:[],h=R[n];return h?(R[n]={...h,rule:f},i={...t,variants:R},{blockKey:o,data:i}):null})||!i||(A(i),k?.())}},Fr=()=>{Wt(),g&&$t(null,-1,0)},Ir=t=>{dn(t),ds({inner:t})},Lr=t=>{An(t),ds({raw:t})},Or=()=>{dn(null),Ot([])},zr=()=>Yt(t=>t+1),$r=()=>{fn.flush(),un(!1),dn(null),An(void 0),Ot([]),Yt(t=>t+1),ge?.()},qa=()=>{Vn(!1),Tn(!1),L(null),un(!0)},Ga=()=>{je&&$r(),L(null),Vn(!0)},Ua=()=>Tn(!0),vs=t=>{if(Qt&&t===0){Vn(!1);return}if(Lt&&t<2){Tn(!1),t===0&&L(null);return}if(je){if(t===0){$r();return}if(t===1){Ot([]),Yt(s=>s+1);return}Ot(Ds.slice(0,t-1)),Yt(s=>s+1);return}if(q){T(M.slice(0,t)),$(s=>s+1);return}if(t===0){Fr();return}if(t===1){T([]),$(s=>s+1);return}const n=!X&&Tt&&kt?1:0;if(n===1&&t===2){T([]),$(s=>s+1);return}T(M.slice(0,t-1-n))},ys=zn.length>1?r.jsx("button",{type:"button",onClick:()=>vs(gl(zn.length,{isMultivariateSectionTop:Oa})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:le("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ft?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(Ui,{className:"size-4"})}):null,Ja=ft||At||je?Da&&r.jsxs("div",{className:le("border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!q&&yt&&Se&&r.jsxs("button",{type:"button",onClick:Fr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:Se.label}),className:le("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",cl),children:[r.jsx(ll,{rule:js(Se.rule,d??{},u??void 0),matchers:sn}),r.jsx("span",{className:"max-w-[160px] truncate",children:Se.label})]}),r.jsx("div",{className:"flex-1"}),ft&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Zn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Ar&&r.jsx(qn,{onClick:()=>Sn()})]}),ft&&r.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):r.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(uo,{pageKey:y,initialName:oe.name,initialPath:oe.path,onFieldChange:lr,variant:"header"})}),r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>un(!0),children:r.jsx(io,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Le&&y?Le():bt(!0),children:r.jsx(lo,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(qn,{onClick:bn})]}),Qa=r.jsxs(r.Fragment,{children:[yt&&y&&r.jsx(fo,{listKey:y,variants:pe,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Br,onRename:F,onDuplicate:Dr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsx(mo,{className:"mt-3",children:r.jsx("div",{className:le("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:gr,onSelectGlobal:br,named:ms(Se?.rule,Sr),namedRow:ws(Se?.rule,Ht),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})})]}),Wr=r.jsxs(r.Fragment,{children:[r.jsx(ul,{listKey:`${y??""}:${m??""}`,variants:Vt.map((t,n)=>({index:n,label:t.label})),selectedIndex:Ln,onSelect:ur,onRename:O,onDuplicate:Ra,onDelete:ja,onRemoveAll:dr,onReorder:Ea,onAdd:()=>Sn()}),r.jsx(mo,{children:r.jsx(ks,{currentRt:Zt??"",currentLabel:_n(kt?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(kt?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:Ta,onSelectGlobal:Ca,named:ms(kt?.rule,Na),namedRow:ws(kt?.rule,Ht),rule:kt?.rule,schema:Ba,formValue:Ho,onChange:Aa,formKey:`${m??"none"}:${Ln}:${Zt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Hr=r.jsx("div",{className:le(X?"px-2":"p-2 pt-3"),children:r.jsx(Bc,{listKey:`${y??""}-${te}`,rawSections:K,sections:ce,meta:u,decofile:d,selectedIndex:m,onSelect:t=>{ga(t),Je?.(t)},onReorder:va,onDelete:ya,onDuplicate:Sa,onMakeReusable:Ve,onToggleHidden:ba,onToggleLazy:rt?xa:void 0,onAddVariant:Sn,onDetach:_a,onAddSection:()=>He(!0),canAddSection:mr})}),Ya=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[y&&oe&&r.jsx(uo,{pageKey:y,initialName:oe.name,initialPath:oe.path,onFieldChange:lr}),nn&&y?r.jsx(Vo,{rawSeo:Kn,innerSeo:as,defaultResolveType:Qs,seoTypesLoading:g&&!u,seoSchema:Ys,activeResolveType:Dn,seoTypeOptions:Js,formResetKey:Ms,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Za=r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:r.jsx("div",{className:"mx-auto max-w-2xl",children:nn&&y?r.jsx(Vo,{rawSeo:Kn,innerSeo:as,defaultResolveType:Qs,seoTypesLoading:g&&!u,seoSchema:Ys,activeResolveType:Dn,seoTypeOptions:Js,formResetKey:Ms,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Xa=r.jsxs(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[yt&&y&&r.jsx(fo,{listKey:y,variants:pe,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Br,onRename:F,onDuplicate:Dr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsxs("div",{className:le("px-3 border-b",En?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>$o(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-accent","aria-expanded":En,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),En?r.jsx(Ji,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(Gi,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),En&&r.jsx("div",{className:le("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:gr,onSelectGlobal:br,named:ms(Se?.rule,Sr),namedRow:ws(Se?.rule,Ht),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Hr]},"editor-section-list");return r.jsx(ic,{value:g,children:r.jsx(dl,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!X&&ys&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ys}),(X||zn.length>1)&&r.jsx(Wi,{crumbs:zn,onSelect:vs,onSelectRoot:()=>{fn.flush(),Ue?Ue():vs(0)}}),r.jsx("div",{className:"shrink-0",children:X?r.jsxs("div",{className:le("flex items-center gap-2 border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[X&&ys,ft&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Zn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r.jsx("span",{className:"truncate text-sm font-semibold",children:La}),Pr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Pr})]}),gs&&yt&&Se&&r.jsx(po,{variants:pe,activeIndex:te,onSelect:cs,onManage:Ga,onRemoveAll:za}),Fa&&r.jsx(po,{variants:Vt,activeIndex:Ln,onSelect:ur,onManage:Ua,onRemoveAll:dr}),gs&&!yt&&r.jsx(qn,{onClick:bn}),Ma&&r.jsx(qn,{onClick:()=>Sn()}),r.jsx(fl,{}),gs&&r.jsxs(r.Fragment,{children:[r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:qa,children:r.jsx(io,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Le&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>bt(!0),children:r.jsx(lo,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Ja}),ut&&r.jsx(mi,{open:!0,fields:pi(ut.plan,ut.target.schema),choices:ut.choices,changedAgain:ut.changedAgain,author:Ws??null,authorPending:Ws===void 0,fieldsAsLabeled:$s!==null,fresh:ut.fresh,keepTyping:g,onChoose:(t,n)=>ha({...ut.choices,[t]:n}),onApply:pa},Ic(ut.formBase)),Lt?r.jsx(ho,{onAdd:()=>Sn(),children:Wr},"editor-section-variants"):At?r.jsxs(an,{viewportRef:me,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!X&&Tt&&Vt.length>0&&M.length===0&&Wr,r.jsx(To,{value:yr,children:r.jsx(go,{value:q&&g?Be:null,children:r.jsx(vo,{activeSchema:Fn,formValue:Xe,formResetKey:De,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:M,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr,onVariantMatcherOp:q?Ha:void 0})})})]},"editor-section-form"):q?r.jsx(an,{viewportRef:me,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(To,{value:yr,children:r.jsx(go,{value:q&&g?Be:null,children:r.jsx(vo,{activeSchema:Fn,formValue:Xe,formResetKey:De,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:M,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr})})})},"editor-global-block"):je?X?r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Ya})},"editor-seo"):Za:Qt?r.jsx(ho,{onAdd:bn,children:Qa},"editor-variants"):X?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:Hr})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Ns,{canAddSection:mr,onAddSection:()=>He(!0)})})]},"editor-section-list"):Xa,r.jsx(ml,{open:ie!==null,onOpenChange:t=>{t||Ve(null)},defaultBlockId:ie!==null?Jn(ce[ie]?.label??""):"",isPending:B.isPending,onSubmit:Va}),ot&&r.jsx(ec,{open:Ae,onOpenChange:t=>{He(t),t||(Rn.current=null)},meta:u,decofile:d,previewBaseUrl:st,onSelect:wa}),ht&&y&&d&&r.jsx(nc,{open:ht,onOpenChange:bt,pageKey:y,decofile:d}),Te!==null&&r.jsx(yo,{open:!0,initialName:Jt(pe[Te]?.rule,d??{},u??void 0)?_n(pe[Te]?.rule,d??{},we,u??void 0):"",autoLabel:we(js(pe[Te]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await $a(Te,t)},onOpenChange:t=>{!t&&!Xt&&F(null)}}),tt!==null&&r.jsx(yo,{open:!0,initialName:Jt(Vt[tt]?.rule,d??{},u??void 0)?_n(Vt[tt]?.rule,d??{},we,u??void 0):"",autoLabel:we(js(Vt[tt]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await Wa(tt,t)},onOpenChange:t=>{!t&&!Xt&&O(null)}})]})})})}export{Of as SectionsEditor};
1
+ import{i8 as ei,bp as ti,c as wn,b as jn,r as b,m as le,j as r,c8 as ni,bm as Cs,i9 as Do,B as It,Y as on,au as si,_ as ri,bo as oi,Z as ai,q as ii,hF as li,ia as ci,ib as ui,h as di,bq as wt,ic as Jr,id as bs,ie as fi,ig as pt,ih as Qr,ii as mi,fQ as pi,ij as hi,ik as Yr,il as gi,t as H,fu as Zr,im as vi,io as Bt,ip as yi,iq as Si,ir as bi,fi as Xr,is as xs,it as xi,iu as _i,iv as ki,ff as wi,fR as ji,iw as Ri,ix as Ei,ft as Vi,K as Ti,iy as eo,eN as Ai,fJ as Hn,fO as to,iz as no,iA as Ni,iB as Ci,iC as Pi,iD as _s,iE as Bi,iF as Ki,iG as Di,iH as so,iI as Mi,iJ as Fi,fh as ro,iK as Ii,iL as Li,fL as oo,iM as Oi,fd as zi}from"./index-CVaM5ZeE.js";import{u as $i}from"./chat-context-DAOuQBMp.js";import{a as Xn,M as ao}from"./save-status-DIjUL42_.js";import{p as kn,f as Wi,n as Hi}from"./parse-sections-CUD_BDPf.js";import{a as qi}from"./repository-binding-SBp01hsF.js";import{t as Gi}from"./ChevronDown-Clw2gzwU.js";import{d as Mo,b as Ui}from"./UserCheck01-C6Zy7aCJ.js";import{n as Ji}from"./ChevronUp-mwSMyirQ.js";import{b as Zn,e as Qi,P as io,K as lo}from"./agent-icon-DZAggVJ3.js";import{S as an}from"./scroll-area-Dpz9D3v4.js";import{c as jt,T as Rt,a as Et}from"./tooltip-BE7tm7Mf.js";import{h as Yi,i as Zi,j as Xi,E as el,k as tl,V as nl,l as sl,m as rl,G as ol,s as Jn,v as Qn,p as Fo,n as al,o as il,a as co,q as ll,u as cl,A as qn,P as uo,w as fo,x as mo,y as ks,z as ul,B as dl,D as po,F as fl,J as ho,K as go,L as vo,M as ml,Q as yo,c as pl,T as ln,U as hl,W as gl}from"./held-block-view-CfeVMOgT.js";import{j as vl,u as yl,i as Sl,v as bl,aD as xl,U as _l,k as So,aU as bo,a9 as Kt,aa as Dt,aq as kl,aV as wl,aW as jl,aO as xo,at as Rl,aA as El}from"./site-editor-toast-wPURFHKm.js";import{u as Vl,ao as _o,e as ko,j as Tl,z as Al,y as Gn,ad as Nl,ae as Cl,aj as Pl}from"./blocks-tab-states-DH742uQK.js";import{u as Bl}from"./use-delete-block-BdMBmq7W.js";import{b as Kl,u as Dl,k as Un,e as xn}from"./use-never-published-Dn9RsLj6.js";import{a as Es,e as Io}from"./UserSquare-DCGr1IXl.js";import{b as Ml}from"./MessageCircle01-BknThLW3.js";import{i as wo}from"./Tool01-BIdw-Y5R.js";import{s as jo}from"./Eye-DtAwTuAv.js";import{s as Fl}from"./Plus-B1jxL8_s.js";import{s as Il}from"./Trash01-7INJcjHE.js";import{i as Vs}from"./Zap-BVuJGlvS.js";import{u as Ll,a as Ro,n as Ol,P as zl,o as $l,C as Wl,D as Hl,c as ql}from"./task-key-B_pRAaeZ.js";import{u as Gl,s as Ul,a as Yn,S as Jl,v as Ql}from"./sortable.esm-oWRIjgQS.js";import{s as Yl,g as Zl,u as Xl,A as ec}from"./use-section-preview-base-CRfx6Dcm.js";import{m as tc,P as nc}from"./mustache-DTb533il.js";import{r as Eo,u as sc,a as rc,i as oc,f as ac,B as ic}from"./empty-message-4JAQGaSD.js";import{u as lc,a as cc,P as Vo,w as uc,b as dc}from"./seo-editor-Cl4SCyq4.js";import{v as fc,k as ws,x as To,j as mc,y as pc}from"./named-rule-step-IErLKB4N.js";import{u as hc}from"./use-apply-named-rule-B0O21RDl.js";import{o as Jt,f as Ts,y as As,q as Ft,h as cn,u as gc,n as Ut,r as js,m as Mt,k as _n,b as vc,s as Ao,z as yc,A as Sc,B as bc}from"./section-array-field-BKLH6fnp.js";import{b as No,a as xc}from"./variant-matcher-override-hWj7NeJW.js";import"./use-panel-navigate-DOmD0cOr.js";import"./thread-route-DO5G4fyj.js";import"./use-project-scope-CK6HNuJk.js";import"./use-view-draft-kind-CbWFzDck.js";import"./use-blog-view-CVmli7Be.js";import"./use-organization-settings-8NpeLuIb.js";import"./schema-CjMjt5K4.js";import"./task-board-CMA_Vl5R.js";import"./thread-intent-CoYehnqV.js";import"./use-mcp-client-CfpXvRRg.js";import"./auth-xyPIezYQ.js";import"./delay-CnY5UFtP.js";import"./backoff-CrEUbyZT.js";import"./watch-sse-pool-U2FTQA43.js";import"./session-runtime-P5u-r0JQ.js";import"./use-entitlements-DG3qYqcL.js";import"./use-ai-providers-W8m38fvZ.js";import"./use-current-view-C2_v6kaa.js";import"./use-in-settings-Bm0lPFu0.js";import"./use-decopilot-events-zFsXNFOX.js";import"./Image01-qySekihp.js";import"./Upload01-DZhveaEI.js";import"./label-CXVS8kdg.js";import"./SwitchHorizontal01-DIeoClfB.js";import"./popover-C7DIsR_D.js";import"./switch-CRzfqWoA.js";import"./toggle-group-B9BlXaiJ.js";import"./active-indicator-CCMhAsc_.js";import"./match-site-slug-config-B47_xZCi.js";import"./use-file-configs-BzR-Y9dE.js";import"./asset-utils-bV62C4dc.js";import"./useInfiniteQuery-BjfOgabm.js";import"./infiniteQueryObserver-qLxMp_hZ.js";import"./AlertCircle-D-3RwTjD.js";import"./hosted-reconcile-De4gpWFM.js";import"./SearchMd-YEpC8Fp5.js";import"./textarea-DcoxxIUh.js";import"./use-copy-DDDkhesX.js";import"./ChevronSelectorVertical-CxqhRYoV.js";import"./command-DIWYmaS8.js";import"./index-DmaFGaGi.js";import"./Play-Zazmy7hc.js";import"./monaco-editor-Br4BiDCR.js";import"./editor-CaDL1Bs5.js";import"./ArrowUp-DnwsrW8f.js";import"./ArrowLeft-2dNX3G7U.js";import"./ArrowRight-CyXALyAs.js";import"./BookOpen01-BUVRmrG3.js";import"./Globe04-B0wykTtt.js";import"./CheckCircle-DLJ2bpMW.js";import"./TrendUp01-CpNTpLYA.js";import"./LinkBroken01-Ctxx3NC-.js";import"./CreditCard01-8Pk5ghZq.js";import"./File02-B_azDZYk.js";import"./Key01-C1ftF9tP.js";import"./LayoutLeft-CTZ6iAtK.js";import"./Minus-CQ5w-vye.js";import"./Monitor01-CJoN_dTF.js";import"./Sun-Cu-JeMSe.js";import"./ShoppingBag01-BaVCGN49.js";import"./Users01-Dy9NXp21.js";import"./XClose-BkVqHDXm.js";import"./index-BdQq_4o_.js";import"./index-NRdzlZZ7.js";import"./utils-BxePB1pN.js";import"./calendar-BKeDmd2L.js";import"./usage-stats-CKkwGKMs.js";import"./utils-CVEq3hMx.js";import"./markdown-D1G_ApAH.js";import"./use-mobile--Tjrw6qZ.js";import"./gateway-client-CRRUx8Ce.js";import"./form-BhPPsmSo.js";import"./select-22fWDASj.js";import"./editor-classes-zTHld4GP.js";import"./combobox-BL-eQmFF.js";import"./use-sandbox-events-BUUNlKOB.js";import"./sandbox-url-D3mC8qhT.js";import"./use-blocks-v8-project-Fa0Yvrmb.js";import"./use-voice-input-DkEbCj1p.js";import"./drawer-BqGY5hR4.js";import"./index-Bd_NPBeo.js";import"./checkbox-CsVne2mP.js";import"./ai-providers-logos-DD3qZ33J.js";import"./openai-compatible-presets-BKGfVqEx.js";import"./sandbox-git-api-DskKv348.js";import"./empty-state-Cu_UqeJw.js";import"./search-input-D_wdj4jI.js";import"./tabs-C3fE6Psb.js";import"./use-debounced-value-BP25cxWQ.js";import"./sandbox-start-errors-BK_aDCyt.js";import"./pair-DhPLovo9.js";import"./collapsible-CFLPP7ik.js";import"./use-task-board-items-DwaqQhP2.js";import"./config-DhzGUcRP.js";import"./task-route-TsuAukRy.js";import"./project-index-xN92EcRd.js";import"./shell-layout-IodEaLm-.js";import"./use-deployment-admin-lFvWnpXE.js";import"./admin-fetch-BhTJlAsX.js";import"./use-org-notice-Vmhw8z6J.js";import"./integration-icon-DhLRYXPe.js";import"./project-icon-Dfd0VA-p.js";import"./use-navigate-to-agent-n78PAis4.js";import"./new-project-dialog-DUs38Kod.js";import"./repository-picker-Bb3eDhJh.js";import"./github-icon-F0_bvkr_.js";import"./collection-search-D4mtl2lW.js";import"./new-project-store-BlpbgUxg.js";import"./legacy-admin-welcome-dialog-BRJGAOxb.js";import"./required-auth-layout-HeXAWStb.js";import"./use-org-sso-C9w0Ouri.js";import"./content-blocks-o63cs2vh.js";import"./mcp-app-renderer-BWzxLu9o.js";import"./types-BHVRgT6Z.js";import"./omit-server-managed-metadata-L5IhjRZB.js";import"./sheet-Cl24m9Dt.js";import"./use-connection-nJCVu3xN.js";import"./use-mcp-prompts-sBVI4CUs.js";import"./use-thread-outputs-CM1LQ3uG.js";import"./file-type-icon-QYtFdtTf.js";import"./slider-CNy9L88L.js";import"./index-DpIIT1S9.js";import"./tooltipContext-Be70_7Lj.js";import"./CategoricalChart-fhBJG9pQ.js";import"./index-C_5w1AHm.js";import"./use-move-blocks-ZEcxPSUc.js";const _c={escape:Yi};function kc(v,e){for(const p of Yl(v,e)){const S=typeof p.title=="string"?p.title:void 0;if(S?.includes("{{"))return S}}function wc(v,e){if(!e)return;const p=ei(v,ti(e));if(p)try{const S=kc(p.resolveType,e);return S&&tc.render(S,p.data,{},_c).trim()||void 0}catch{return}}function jc(v){const e=wn.c(13),{icon:p,label:S,className:x}=v;let V;e[0]!==x?(V=le("size-3.5",x),e[0]=x,e[1]=V):V=e[1];let C;e[2]!==p||e[3]!==V?(C=r.jsx(p,{className:V}),e[2]=p,e[3]=V,e[4]=C):C=e[4];let _;e[5]!==S||e[6]!==C?(_=r.jsx(Rt,{asChild:!0,children:r.jsx("span",{role:"img","aria-label":S,className:"shrink-0 cursor-help",children:C})}),e[5]=S,e[6]=C,e[7]=_):_=e[7];let P;e[8]!==S?(P=r.jsx(Et,{className:"max-w-56",children:S}),e[8]=S,e[9]=P):P=e[9];let k;return e[10]!==_||e[11]!==P?(k=r.jsxs(jt,{children:[_,P]}),e[10]=_,e[11]=P,e[12]=k):k=e[12],k}const Rc="text-global-section-fg focus:bg-global-section/12 focus:text-global-section-fg dark:text-global-section-fg-dark dark:focus:bg-global-section/15 dark:focus:text-global-section-fg-dark [&_svg]:!text-global-section";function Co(v){return Array.from({length:v},(e,p)=>({id:crypto.randomUUID(),index:p}))}function Lo(v){return v.map((e,p)=>({...e,index:p}))}function Ec(v,e){if(e===v.length)return v;if(e<v.length)return Lo(v.slice(0,e));const p=Array.from({length:e-v.length},(S,x)=>({id:crypto.randomUUID(),index:v.length+x}));return[...v,...p]}function Oo(v){const e=wn.c(44),{section:p,raw:S,meta:x,decofile:V}=v,C=jn(),_=Xn(),P=p.isSavedBlock===!0,k=p.isMultivariate===!0;let Z;e[0]!==x||e[1]!==S?(Z=S&&x?Zl(S,x):void 0,e[0]=x,e[1]=S,e[2]=Z):Z=e[2];const ge=Z;let Ue;e[3]!==x||e[4]!==k||e[5]!==S||e[6]!==P?(Ue=S&&x&&!P&&!k?wc(S,x):void 0,e[3]=x,e[4]=k,e[5]=S,e[6]=P,e[7]=Ue):Ue=e[7];const Le=Ue;let Ce;e[8]!==V||e[9]!==x||e[10]!==S||e[11]!==p?(Ce=sl(S,p,V,x),e[8]=V,e[9]=x,e[10]=S,e[11]=p,e[12]=Ce):Ce=e[12];const Je=Ce;let w;e[13]!==k||e[14]!==S?.__resolveType?(w=!k&&Cs(S?.__resolveType??""),e[13]=k,e[14]=S?.__resolveType,e[15]=w):w=e[15];const c=w,xe=P?Zn:k?Mo:Io;let G;e[16]!==k||e[17]!==P?(G=P?{color:oi}:k?{color:"oklch(0.65 0.15 160)"}:void 0,e[16]=k,e[17]=P,e[18]=G):G=e[18];const _e=G;let I;e[19]!==xe||e[20]!==_?(I=_?r.jsxs("span",{className:"relative size-4 shrink-0",children:[r.jsx(xe,{className:"absolute inset-0 size-4 text-muted-foreground transition-opacity group-hover:opacity-0 group-has-[:focus-visible]:opacity-0"}),r.jsx(ol,{"aria-hidden":!0,className:"absolute inset-0 size-4 opacity-0 transition-opacity group-hover:opacity-100 group-has-[:focus-visible]:opacity-100"})]}):r.jsx(Ml,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[19]=xe,e[20]=_,e[21]=I):I=e[21];let ke;e[22]!==ge?(ke=ge&&r.jsx("img",{src:ge,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded-[var(--studio-control-radius,var(--radius))] object-cover"}),e[22]=ge,e[23]=ke):ke=e[23];let d;e[24]!==_||e[25]!==_e?(d=!_&&r.jsx(Es,{className:"h-4 w-4 shrink-0",style:_e}),e[24]=_,e[25]=_e,e[26]=d):d=e[26];const Oe=_?"shrink":"flex-1",u=p.isHidden&&"line-through opacity-50";let Ee;e[27]!==u||e[28]!==Oe?(Ee=le("min-w-0 truncate text-sm font-medium",Oe,u),e[27]=u,e[28]=Oe,e[29]=Ee):Ee=e[29];const X=Le??p.label;let ze;e[30]!==Ee||e[31]!==X?(ze=r.jsx("span",{className:Ee,children:X}),e[30]=Ee,e[31]=X,e[32]=ze):ze=e[32];let nt;e[33]!==c||e[34]!==_||e[35]!==Je||e[36]!==C?(nt=_?r.jsxs(r.Fragment,{children:[c&&r.jsx(jc,{icon:Vs,label:C("sectionsEditor.sectionList.asyncBadge"),className:"text-muted-foreground"}),Je&&r.jsx(ao,{}),r.jsx("span",{className:"min-w-0 flex-1"})]}):Je&&r.jsx(ao,{className:"absolute -right-0.5 -top-0.5"}),e[33]=c,e[34]=_,e[35]=Je,e[36]=C,e[37]=nt):nt=e[37];let Pe;return e[38]!==ze||e[39]!==nt||e[40]!==I||e[41]!==ke||e[42]!==d?(Pe=r.jsxs(r.Fragment,{children:[I,ke,d,ze,nt]}),e[38]=ze,e[39]=nt,e[40]=I,e[41]=ke,e[42]=d,e[43]=Pe):Pe=e[43],Pe}const Vc="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",Tc="text-[oklch(0.45_0.15_160)] hover:bg-[oklch(0.65_0.15_160/0.12)] dark:text-[oklch(0.78_0.15_160)] dark:hover:bg-[oklch(0.65_0.15_160/0.15)]";function zo(v,e,p){if(p)return rl({selected:e});const S=v.isSavedBlock===!0,x=v.isMultivariate===!0;return le("group relative flex select-none items-center gap-2 rounded-[var(--studio-control-radius,var(--radius-md))] px-2 py-2.5",e?"bg-accent text-accent-foreground":S?Vc:x?Tc:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Rs(v,e){return le("h-7 shrink-0 overflow-hidden",e?"w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]":v?"w-7 ml-0 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:opacity-100 group-has-[:focus-visible]:opacity-100":"w-0 -ml-2 opacity-0 [transition:opacity_150ms_ease-out,width_0ms_150ms,margin-left_0ms_150ms] group-hover:ml-0 group-hover:w-7 group-hover:opacity-100 group-hover:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms] group-has-[:focus-visible]:ml-0 group-has-[:focus-visible]:w-7 group-has-[:focus-visible]:opacity-100 group-has-[:focus-visible]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]")}function Ac(v){const e=wn.c(90),{section:p,raw:S,meta:x,decofile:V,sortableId:C,selected:_,onSelect:P,onDelete:k,onDuplicate:Z,onMakeReusable:ge,onToggleHidden:Ue,onToggleLazy:Le,onAddVariant:Ce,onDetach:Je}=v,w=jn(),c=Xn(),xe=S?Cs(S.__resolveType??""):!1,G=p.isHidden===!0,_e=xe||G;let I;e[0]!==p?(I=Do(p),e[0]=p,e[1]=I):I=e[1];const ke=I,d=!!Le&&!p.isMultivariate;let Oe;e[2]!==C?(Oe={id:C,animateLayoutChanges:Pc},e[2]=C,e[3]=Oe):Oe=e[3];const{attributes:u,listeners:Ee,setNodeRef:X,transform:ze,isDragging:nt}=Gl(Oe);let Pe;e[4]!==ze?(Pe=Wl.Transform.toString(ze?{...ze,x:0}:null),e[4]=ze,e[5]=Pe):Pe=e[5];const st=nt?0:void 0;let de;e[6]!==Pe||e[7]!==st?(de={transform:Pe,opacity:st},e[6]=Pe,e[7]=st,e[8]=de):de=e[8];const g=de;let we;e[9]!==p?(we=Xi(p),e[9]=p,e[10]=we):we=e[10];const rt=we,ot="button",m=0;let L;e[11]!==P?(L=F=>{(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),P())},e[11]=P,e[12]=L):L=e[12];const Xe=nt?"cursor-grabbing":"cursor-pointer";let A;e[13]!==c||e[14]!==p||e[15]!==_||e[16]!==Xe?(A=le("touch-none transition-colors",Xe,zo(p,_,c)),e[13]=c,e[14]=p,e[15]=_,e[16]=Xe,e[17]=A):A=e[17];let Qe;e[18]!==V||e[19]!==x||e[20]!==S||e[21]!==p?(Qe=r.jsx(Oo,{section:p,raw:S,meta:x,decofile:V}),e[18]=V,e[19]=x,e[20]=S,e[21]=p,e[22]=Qe):Qe=e[22];const W=!c&&d&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:le(Rs(_e,xe)),onClick:F=>{F.stopPropagation(),Le?.()},onPointerDown:Cc,children:r.jsx(Vs,{className:le("h-3.5 w-3.5",xe&&"text-warning")})})}),r.jsx(Et,{side:"bottom",children:w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),at=c?r.jsx(el,{label:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),active:G,onToggle:Ue,children:G?r.jsx(wo,{className:"h-3.5 w-3.5"}):r.jsx(jo,{className:"h-3.5 w-3.5"})}):r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon","aria-label":w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:le(Rs(_e,G)),onClick:F=>{F.stopPropagation(),Ue()},onPointerDown:Nc,children:G?r.jsx(wo,{className:"h-3.5 w-3.5"}):r.jsx(jo,{className:"h-3.5 w-3.5"})})}),r.jsx(Et,{side:"bottom",children:w(G?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),fe=ri,Ye=tl;let ve;e[23]!==w?(ve=w("sectionsEditor.sectionList.sectionActionsMenu"),e[23]=w,e[24]=ve):ve=e[24];const it=le(Rs(_e,!1),"data-[state=open]:ml-0 data-[state=open]:w-7 data-[state=open]:opacity-100 data-[state=open]:[transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]");let $e;e[25]!==Ye||e[26]!==ve||e[27]!==it?($e=r.jsx(Ye,{label:ve,classicClassName:it}),e[25]=Ye,e[26]=ve,e[27]=it,e[28]=$e):$e=e[28];let Be;e[29]!==c||e[30]!==d||e[31]!==xe||e[32]!==Le||e[33]!==w?(Be=c&&d&&r.jsxs(r.Fragment,{children:[r.jsxs(on,{onClick:F=>{F.stopPropagation(),Le?.()},children:[r.jsx(Vs,{className:"h-4 w-4"}),w(xe?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")]}),r.jsx(si,{})]}),e[29]=c,e[30]=d,e[31]=xe,e[32]=Le,e[33]=w,e[34]=Be):Be=e[34];let Ke;e[35]!==Z?(Ke=F=>{F.stopPropagation(),Z()},e[35]=Z,e[36]=Ke):Ke=e[36];let se;e[37]===Symbol.for("react.memo_cache_sentinel")?(se=r.jsx(Qi,{className:"h-4 w-4"}),e[37]=se):se=e[37];let Y;e[38]!==w?(Y=w("sectionsEditor.sectionList.duplicateMenuItem"),e[38]=w,e[39]=Y):Y=e[39];let ee;e[40]!==Ke||e[41]!==Y?(ee=r.jsxs(on,{onClick:Ke,children:[se,Y]}),e[40]=Ke,e[41]=Y,e[42]=ee):ee=e[42];let M;e[43]!==c||e[44]!==ke||e[45]!==Ce||e[46]!==w?(M=ke&&r.jsxs(on,{className:le(!c&&nl),onClick:F=>{F.stopPropagation(),Ce()},children:[r.jsx(Mo,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.addVariantMenuItem")]}),e[43]=c,e[44]=ke,e[45]=Ce,e[46]=w,e[47]=M):M=e[47];let T;e[48]!==c||e[49]!==rt||e[50]!==ge||e[51]!==w?(T=rt&&r.jsxs(on,{className:le(!c&&Rc),onClick:F=>{F.stopPropagation(),ge()},children:[c?r.jsx(Zn,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[48]=c,e[49]=rt,e[50]=ge,e[51]=w,e[52]=T):T=e[52];let me;e[53]!==c||e[54]!==Je||e[55]!==p.isMultivariate||e[56]!==p.isSavedBlock||e[57]!==w?(me=p.isSavedBlock===!0&&!p.isMultivariate&&r.jsxs(on,{onClick:F=>{F.stopPropagation(),Je()},children:[c?r.jsx(Io,{className:"h-4 w-4"}):r.jsx(Es,{className:"h-4 w-4"}),w("sectionsEditor.sectionList.detachMenuItem")]}),e[53]=c,e[54]=Je,e[55]=p.isMultivariate,e[56]=p.isSavedBlock,e[57]=w,e[58]=me):me=e[58];let We;e[59]!==k?(We=F=>{F.stopPropagation(),k()},e[59]=k,e[60]=We):We=e[60];let et;e[61]===Symbol.for("react.memo_cache_sentinel")?(et=r.jsx(Il,{className:"h-4 w-4"}),e[61]=et):et=e[61];let De;e[62]!==w?(De=w("sectionsEditor.sectionList.deleteMenuItem"),e[62]=w,e[63]=De):De=e[63];let $;e[64]!==We||e[65]!==De?($=r.jsxs(on,{variant:"destructive",onClick:We,children:[et,De]}),e[64]=We,e[65]=De,e[66]=$):$=e[66];let ie;e[67]!==Be||e[68]!==ee||e[69]!==M||e[70]!==T||e[71]!==me||e[72]!==$?(ie=r.jsxs(ai,{align:"end",className:"w-44",children:[Be,ee,M,T,me,$]}),e[67]=Be,e[68]=ee,e[69]=M,e[70]=T,e[71]=me,e[72]=$,e[73]=ie):ie=e[73];let Ve;e[74]!==fe||e[75]!==$e||e[76]!==ie?(Ve=r.jsxs(fe,{children:[$e,ie]}),e[74]=fe,e[75]=$e,e[76]=ie,e[77]=Ve):Ve=e[77];let Te;return e[78]!==u||e[79]!==Ee||e[80]!==P||e[81]!==X||e[82]!==g||e[83]!==A||e[84]!==Qe||e[85]!==W||e[86]!==at||e[87]!==Ve||e[88]!==L?(Te=r.jsxs("div",{ref:X,style:g,...u,...Ee,role:ot,tabIndex:m,onClick:P,onKeyDown:L,className:A,children:[Qe,W,at,Ve]}),e[78]=u,e[79]=Ee,e[80]=P,e[81]=X,e[82]=g,e[83]=A,e[84]=Qe,e[85]=W,e[86]=at,e[87]=Ve,e[88]=L,e[89]=Te):Te=e[89],Te}function Nc(v){return v.stopPropagation()}function Cc(v){return v.stopPropagation()}function Pc(){return!1}function Ns(v){const e=wn.c(11),{canAddSection:p,onAddSection:S,className:x,size:V}=v,C=jn();let _;e[0]!==x?(_=le("w-full",x),e[0]=x,e[1]=_):_=e[1];const P=!p;let k;e[2]===Symbol.for("react.memo_cache_sentinel")?(k=r.jsx(Fl,{size:14}),e[2]=k):k=e[2];let Z;e[3]!==C?(Z=C("sectionsEditor.sectionList.addSectionButton"),e[3]=C,e[4]=Z):Z=e[4];let ge;return e[5]!==S||e[6]!==V||e[7]!==_||e[8]!==P||e[9]!==Z?(ge=r.jsxs(It,{type:"button",variant:"outline",size:V,className:_,disabled:P,onClick:S,children:[k,Z]}),e[5]=S,e[6]=V,e[7]=_,e[8]=P,e[9]=Z,e[10]=ge):ge=e[10],ge}function Bc(v){const e=wn.c(101),{listKey:p,rawSections:S,sections:x,meta:V,decofile:C,selectedIndex:_,onSelect:P,onReorder:k,onDelete:Z,onDuplicate:ge,onMakeReusable:Ue,onToggleHidden:Le,onToggleLazy:Ce,onAddVariant:Je,onDetach:w,onAddSection:c,canAddSection:xe}=v,G=xe===void 0?!0:xe,_e=jn(),I=Xn();let ke;e[0]!==x.length?(ke=()=>Co(x.length),e[0]=x.length,e[1]=ke):ke=e[1];const[d,Oe]=b.useState(ke),[u,Ee]=b.useState(null),[X,ze]=b.useState(p),[nt,Pe]=b.useState(x.length),st=b.useRef(!1);X!==p?(ze(p),Pe(x.length),Oe(Co(x.length))):nt!==x.length&&(Pe(x.length),Oe(tt=>Ec(tt,x.length)));let de;e[2]===Symbol.for("react.memo_cache_sentinel")?(de={activationConstraint:{distance:8}},e[2]=de):de=e[2];let g;e[3]===Symbol.for("react.memo_cache_sentinel")?(g={coordinateGetter:Ul},e[3]=g):g=e[3];const we=Ll(Ro(zl,de),Ro(Ol,g));let rt;e[4]!==d?(rt=d.map(Kc),e[4]=d,e[5]=rt):rt=e[5];const ot=rt;let m;e[6]===Symbol.for("react.memo_cache_sentinel")?(m=tt=>{Ee(String(tt.active.id))},e[6]=m):m=e[6];const L=m;let Xe;e[7]!==ot||e[8]!==k?(Xe=tt=>{Ee(null);const{active:O,over:Ae}=tt;if(!Ae||O.id===Ae.id)return;const He=ot.indexOf(String(O.id)),ht=ot.indexOf(String(Ae.id));He===-1||ht===-1||(Oe(bt=>Lo(Yn([...bt],He,ht))),st.current=!0,requestAnimationFrame(()=>{st.current=!1}),k?.(He,ht))},e[7]=ot,e[8]=k,e[9]=Xe):Xe=e[9];const A=Xe;let Qe;e[10]===Symbol.for("react.memo_cache_sentinel")?(Qe=()=>{Ee(null)},e[10]=Qe):Qe=e[10];const W=Qe;let at,fe,Ye,ve,it,$e,Be,Ke,se,Y,ee,M,T,me,We;if(e[11]!==u||e[12]!==G||e[13]!==I||e[14]!==C||e[15]!==d||e[16]!==ot||e[17]!==A||e[18]!==V||e[19]!==c||e[20]!==Je||e[21]!==Z||e[22]!==w||e[23]!==ge||e[24]!==Ue||e[25]!==P||e[26]!==Le||e[27]!==Ce||e[28]!==S||e[29]!==x||e[30]!==_||e[31]!==we||e[32]!==_e){me=Symbol.for("react.early_return_sentinel");e:{const tt=O=>{st.current||P(O)};if(e[48]!==u||e[49]!==G||e[50]!==I||e[51]!==d||e[52]!==c||e[53]!==S||e[54]!==x||e[55]!==_e){const O=u?d.find(Ae=>Ae.id===u):null;if(ve=O!=null?x[O.index]:null,Ye=O!=null?S[O.index]:void 0,d.length===0){let Ae;e[59]!==_e?(Ae=_e("sectionsEditor.sectionList.noSections"),e[59]=_e,e[60]=Ae):Ae=e[60];let He;e[61]!==Ae?(He=r.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:Ae}),e[61]=Ae,e[62]=He):He=e[62];const ht=He;let bt;e[63]!==G||e[64]!==I||e[65]!==ht||e[66]!==c?(bt=I?ht:r.jsxs("div",{className:"space-y-2",children:[ht,r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm"})]}),e[63]=G,e[64]=I,e[65]=ht,e[66]=c,e[67]=bt):bt=e[67],me=bt;break e}T=le(O&&"cursor-grabbing"),e[48]=u,e[49]=G,e[50]=I,e[51]=d,e[52]=c,e[53]=S,e[54]=x,e[55]=_e,e[56]=Ye,e[57]=ve,e[58]=T}else Ye=e[56],ve=e[57],T=e[58];fe=Hl,Ke=we,se=ql,Y=L,ee=A,M=W,at=Jl,$e=ot,Be=Ql,We="space-y-1",it=d.map(O=>{const Ae=x[O.index];return Ae?r.jsx(Ac,{sortableId:O.id,section:Ae,raw:S[O.index],meta:V,decofile:C,selected:_===O.index,onSelect:()=>tt(O.index),onDelete:()=>Z(O.index),onDuplicate:()=>ge(O.index),onMakeReusable:()=>Ue(O.index),onToggleHidden:()=>Le(O.index),onToggleLazy:Ce?()=>Ce(O.index):void 0,onAddVariant:()=>Je(O.index),onDetach:()=>w(O.index)},O.id):null})}e[11]=u,e[12]=G,e[13]=I,e[14]=C,e[15]=d,e[16]=ot,e[17]=A,e[18]=V,e[19]=c,e[20]=Je,e[21]=Z,e[22]=w,e[23]=ge,e[24]=Ue,e[25]=P,e[26]=Le,e[27]=Ce,e[28]=S,e[29]=x,e[30]=_,e[31]=we,e[32]=_e,e[33]=at,e[34]=fe,e[35]=Ye,e[36]=ve,e[37]=it,e[38]=$e,e[39]=Be,e[40]=Ke,e[41]=se,e[42]=Y,e[43]=ee,e[44]=M,e[45]=T,e[46]=me,e[47]=We}else at=e[33],fe=e[34],Ye=e[35],ve=e[36],it=e[37],$e=e[38],Be=e[39],Ke=e[40],se=e[41],Y=e[42],ee=e[43],M=e[44],T=e[45],me=e[46],We=e[47];if(me!==Symbol.for("react.early_return_sentinel"))return me;let et;e[68]!==it||e[69]!==We?(et=r.jsx("div",{className:We,children:it}),e[68]=it,e[69]=We,e[70]=et):et=e[70];let De;e[71]!==at||e[72]!==$e||e[73]!==Be||e[74]!==et?(De=r.jsx(at,{items:$e,strategy:Be,children:et}),e[71]=at,e[72]=$e,e[73]=Be,e[74]=et,e[75]=De):De=e[75];let $;e[76]!==Ye||e[77]!==ve||e[78]!==I||e[79]!==C||e[80]!==V?($=ve?r.jsx("div",{className:le("cursor-grabbing shadow-lift",zo(ve,!1,I)),children:r.jsx(Oo,{section:ve,raw:Ye,meta:V,decofile:C})}):null,e[76]=Ye,e[77]=ve,e[78]=I,e[79]=C,e[80]=V,e[81]=$):$=e[81];let ie;e[82]!==$?(ie=ni.createPortal(r.jsx($l,{dropAnimation:Zi,children:$}),document.body),e[82]=$,e[83]=ie):ie=e[83];let Ve;e[84]!==fe||e[85]!==Ke||e[86]!==se||e[87]!==Y||e[88]!==ee||e[89]!==M||e[90]!==De||e[91]!==ie?(Ve=r.jsxs(fe,{sensors:Ke,collisionDetection:se,onDragStart:Y,onDragEnd:ee,onDragCancel:M,children:[De,ie]}),e[84]=fe,e[85]=Ke,e[86]=se,e[87]=Y,e[88]=ee,e[89]=M,e[90]=De,e[91]=ie,e[92]=Ve):Ve=e[92];let Te;e[93]!==G||e[94]!==I||e[95]!==c?(Te=!I&&r.jsx(Ns,{canAddSection:G,onAddSection:c,size:"sm",className:"mt-2"}),e[93]=G,e[94]=I,e[95]=c,e[96]=Te):Te=e[96];let F;return e[97]!==T||e[98]!==Ve||e[99]!==Te?(F=r.jsxs("div",{className:T,children:[Ve,Te]}),e[97]=T,e[98]=Ve,e[99]=Te,e[100]=F):F=e[100],F}function Kc(v){return v.id}function Dc(v,e,p,S){if(!v||typeof v!="object")return{kind:"error",reason:"no-matcher-rule"};const x=e.trim();if(!x)return Jt(v,p,S)?{kind:"inline",blockKey:v.__resolveType??"",inlinedRule:Ts(v,p,S)}:{kind:"noop"};const V=As(v,p,S);if(!V)return{kind:"error",reason:"unreadable-rule"};if(V.blockKey)return{kind:"updateBlock",blockKey:V.blockKey,blockData:Ft(V.resolveType,V.data,x)};const C=Jn(x),_=Qn(C,p);return _?{kind:"error",reason:"invalid-block-id",message:_}:{kind:"createBlock",blockId:C,blockData:Ft(V.resolveType,V.data,x),reference:cn(C)}}const Po="section-form-stale-save",Mc=3;function Bo(v,e,p){const S=e.global&&e.pageKey?[{label:"Default",sections:[{__resolveType:e.pageKey}]}]:Fo(e.pageKey?v[e.pageKey]?.sections:void 0,v,p),x=Math.max(0,Math.min(e.pageVariantIndex,S.length-1)),V=S[x]?.sections??[];return{pageVariants:S,variantIndex:x,rawSections:V,parsedSections:kn(V,v,p)}}const Ko=new WeakMap;let Fc=0;function Ic(v){let e=Ko.get(v);return e===void 0&&(e=++Fc,Ko.set(v,e)),e}function Of({orgSlug:v,virtualMcpId:e,branch:p,previewReady:S=!0,previewUrl:x,currentPath:V,activePageBlockKey:C=null,activeGlobalBlockKey:_=null,externalSelection:P,onSaved:k,initialEditSeo:Z=!1,onExitSeo:ge,onSelectRoot:Ue,onViewJsonFile:Le,onFocusedBlockChange:Ce,onSectionPicked:Je,onVariantPreviewOverride:w}){const c=jn(),xe=$i(),G=xe?.taskId??null,_e=S?{orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:x}:null,[I,ke]=b.useState([]),{data:d,isLoading:Oe}=vl(_e,{pollWhile:I.length>0}),{data:u,isLoading:Ee}=Vl(_e),X=Xn(),ze=xe?.virtualMcpId,Pe=qi(ze===e?e:null)?.metadata?.siteSlug??null,st=Xl({virtualMcpId:e,branch:p,sandboxUrl:x}),de=yl(e,p),g=Sl(de),we=Vi(g),rt=!g,ot=!!st||g,[m,L]=b.useState(null),[Xe,A]=b.useState(null),[Qe,W]=b.useState(null),[at,fe]=b.useState(0),[Ye,ve]=b.useState(void 0),[it,$e]=b.useState(null),Be={index:it,remember:$e},[Ke,se]=b.useState(null),[Y,ee]=b.useState(null),[M,T]=b.useState([]),me=b.useRef(null),[We,et]=b.useState(M.length);We!==M.length&&(et(M.length),requestAnimationFrame(()=>{me.current&&(me.current.scrollTop=0)}));const[De,$]=b.useState(0),[ie,Ve]=b.useState(null),[Te,F]=b.useState(null),[tt,O]=b.useState(null),[Ae,He]=b.useState(!1),[ht,bt]=b.useState(!1),Rn=b.useRef(null),[En,$o]=b.useState(!0),[Qt,Vn]=b.useState(!1),[Lt,Tn]=b.useState(!1),[je,un]=b.useState(Z),[Ps,Bs]=b.useState(Z);Z&&!Ps&&(Bs(!0),un(!0),L(null),A(null),W(null),T([])),!Z&&Ps&&Bs(!1);const[Wo,dn]=b.useState(null),[Ks,An]=b.useState(void 0),[Ds,Ot]=b.useState([]),[Ms,Yt]=b.useState(0),[Me,lt]=b.useState(0),[Ho,Fe]=b.useState(null),[Zt,qe]=b.useState(null),[Fs,Is]=b.useState(null),Nn=ii(),Cn=bl({orgSlug:v,virtualMcpId:e,branch:p},{tunnel:!1}),fn=Kl({orgSlug:v,virtualMcpId:e,branch:p}),[qo,Go]=b.useState(V),[Uo,Jo]=b.useState(C),[Qo,Yo]=b.useState(_);(qo!==V||Uo!==C||Qo!==_)&&(queueMicrotask(()=>fn.flush()),Go(V),Jo(C),Yo(_),L(null),A(null),W(null),fe(0),se(null),ee(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1),un(!1),dn(null),An(void 0),Ot([]),Yt(t=>t+1));const B=Dl({orgSlug:v,virtualMcpId:e,branch:p}),mn=pl(t=>{B.mutate(t,{onSuccess:()=>k?.(),onError:B.reportError})},d??{},B.v8),Pn=Bl({orgSlug:v,virtualMcpId:e,branch:p}),Ls=hc({orgSlug:v,virtualMcpId:e,branch:p}),[Xt,en]=b.useState(!1),N=b.useRef(null),_t=b.useRef(null),gt=b.useRef(null),vt=b.useRef(null),Bn=b.useRef({}),zt=b.useRef(null),pn=b.useRef(!1),hn=b.useRef(!1),ye=b.useRef(new Map),tn=b.useRef(!1),ct=b.useRef([]),es=b.useRef(new WeakSet);xl(v,e,t=>{const{activePageKey:n,rawSections:s,parsedSections:o,selectedSectionIndex:a}=re.current,i=new Set;n&&i.add(n);for(const l of[_t.current?.sectionIndex,a]){const f=l==null?void 0:s[l],R=l==null?void 0:o[l],h=f&&R?.isSavedBlock?_s(f,R):null;h&&i.add(h)}if([...i].some(l=>t.has(l))){for(const l of[N,gt,vt])l.current&&clearTimeout(l.current),l.current=null;_t.current=null,ye.current.clear(),n&&t.has(n)&&(Bn.current={})}});const re=b.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null}),[Os,zs]=b.useState(0),[Zo,Xo]=b.useState(0),$s=li(de,{orgSlug:v,virtualMcpId:e,branch:p}),Ws=ci($s,I[0]?.blockKey??null,ui(d,I[0]?.blockKey??null)),[ea,ta]=b.useState(null),ts=_l(v,e).epoch,[na,sa]=b.useState(ts);lc(je?{orgSlug:v,virtualMcpId:e,branch:p}:null,d??void 0,u??void 0);const Hs=_??(d&&u?_o(ko(d,u),V,C)?.key??null:null),ns=So({orgSlug:v,virtualMcpId:e,branch:p},Hs?[Hs]:[],{withRefs:!0}),[qs,ra]=b.useState(!1),ss=So({orgSlug:v,virtualMcpId:e,branch:p},qs?Tl:[]),Gs={ready:!(de.kind==="protocol"&&de.hosted)||qs&&ss.ready,failed:ss.failed,retry:ss.retry,request:()=>ra(!0)};if(ns.failed)return r.jsxs("div",{className:"h-full w-full flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground",children:[r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailed")}),r.jsx("p",{children:c("sectionsEditor.hosted.blockLoadFailedHint")}),r.jsx(It,{variant:"outline",size:"sm",onClick:ns.retry,children:c("sectionsEditor.namedRules.tryAgain")})]});if(!S||Oe||Ee||!ns.ready)return r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(di,{className:"size-5 text-muted-foreground"})});if(!d||!u)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const oa=ko(d,u),q=!!_,oe=q?null:_o(oa,V,C),y=q?_:oe?.key??null,rs=q&&_?d[_]:void 0,Us=q&&_&&rs?Al(_,rs):q&&_?_:"",nn=!q&&y&&d[y]?d[y]:null,os=je&&d&&u&&y&&oe?Eo(d,{kind:"page",pageKey:y,pageName:String(oe.name??""),path:String(oe.path??"")},u):null,aa=je?nn?.seo:void 0,Kn=Ks!==void 0?Ks:aa,ia=je?sc(Kn):void 0,Js=os?.seoTypeOptions??[],Qs=je&&u?rc(u):"",as=Wo??ia??{},Dn=je&&os?cc(as,os):null,Ys=je&&Dn&&oc(Kn)?Gn(Dn,u):null,Zs=je?ac(d,u)?.seoData:void 0,pe=q?[{label:"Default",sections:[{__resolveType:_}]}]:Fo(nn?.sections,d??{},g),yt=pe.length>1,te=Math.min(at,pe.length-1),Se=pe[te],K=Se?.sections??[],ce=kn(K,d,g),Mn=!q&&gc(nn?.sections,g);if(q&&_&&Fs!==_){Is(_);const t=K[0],n=ce[0];if(t&&n){L(0),lt(0),T([]);const s=wt(t,n,d,g);s&&(A(s.data),W(s.resolveType),qe(null),Fe(null))}}!q&&Fs!==null&&Is(null),re.current={rawSections:K,parsedSections:ce,decofile:d??{},activePageKey:y,pageVariants:pe,variantIndex:te,sectionVariantIndex:Me,selectedSectionIndex:m};const la=()=>({multivariate:Mn,index:te,variants:pe.map(t=>({rule:t.rule})),lazyValues:g&&Mn&&Ai(nn?.sections?.variants?.[te]?.value)}),is=(t,n)=>{if(!w)return;if(!y||!Mn||t.length<=1){w(null);return}const s={multivariate:!0,index:n,variants:t},o=g?bo(y,s):No(y,s,d,u);w(o.length>0?o:null)},ls=w&&y&&Mn&&yt&&!Oe&&!Ee?y:null;if(ls!==ea&&(ta(ls),ls)){const t=pe.map(s=>({rule:s.rule})),n=te;queueMicrotask(()=>is(t,n))}const $t=(t,n,s)=>{if(!w)return;if(!y){w(null);return}const o=la(),a=g?bo(y,o):No(y,o,d,u);if(!t||n<0){w(a.length>0?a:null);return}const i={pageKey:y,page:o,sectionIndex:n,sectionLazy:ce[n]?.isLazy??!1,mvObj:t,selectedVariantIndex:s},l=g?wl(i):xc({...i,decofile:d,meta:u}),f=g?jl(a,l):[...a,...l];w(f.length>0?f:null)},xt=(t,n,s,o=m??-1,a=!1)=>{const i=pt(t,n);if(!i){A(null),W(null),qe(null),Fe(null),a&&$t(null,o,s);return}const f=Qr(i,we)[s];if(!f){A(null),W(null),qe(null),Fe(null),a&&$t(null,o,s);return}const R=hi(f.value,d);A(R?.data??null),W(R?.resolveType??null);const{resolveType:h,formValue:j}=Ut(f.rule,d,u??void 0);qe(h),Fe(j),a&&$t(i,o,s)},cs=t=>{F(null),fe(t),L(null),A(null),W(null),T([]);const n=pe[t]?.rule,{resolveType:s,formValue:o}=Ut(n,d??{},u??void 0);ee(s),se(o),is(pe.map(a=>({rule:a.rule})),t)},ca=(t,n)=>{const s=K[t],o=ce[t];if(!s||!o)return!1;const a=o.isMultivariate?pt(s,o)?.variants?.length??0:0,i=n<a?n:0;if(L(t),lt(i),T([]),$(l=>l+1),o.isMultivariate)xt(s,o,i,t);else{const l=wt(s,o,d,g);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),qe(null),Fe(null)}return!0},Xs=P?.index;if(P!==void 0&&(P?.seq??null)!==Ye&&(ve(P?.seq??null),typeof Xs=="number"&&ca(Xs,0)),ts!==na){sa(ts);const t=N.current!==null||ye.current.size>0||vt.current!==null||gt.current!==null||B.isPending||fn.isPending||I.length>0,n=m!==null&&Jr(me.current,document.activeElement);if(!t&&n&&(tn.current=!0),!t&&!n&&m!==null){const s=K[m],o=ce[m];if(T([]),$(a=>a+1),!s||!o)L(null),A(null),W(null);else if(o.isMultivariate)xt(s,o,Me,m);else{const a=wt(s,o,d,g);A(a?.data??null),W(a?.resolveType??null)}}!t&&je&&(dn(null),An(void 0),Yt(s=>s+1))}if(Os!==Zo){Xo(Os);const t=m!==null?K[m]:null,n=m!==null?ce[m]:null;if(t&&n&&m!==null)if(T([]),$(s=>s+1),n.isMultivariate)xt(t,n,Me,m);else{const s=wt(t,n,d,g);A(s?.data??null),W(s?.resolveType??null)}}const ut=I[0];if(ut){const{formBase:t,target:n}=ut,s=Bo(d,n,g),o=t.sectionIndex,a=s.rawSections.length===t.sectionCount?bs(s.rawSections[o],s.parsedSections[o],n.sectionVariantIndex,d,g):null,i=fi(ut,a,l=>Yr(t,l));if(i){const f=[{...ut,...i,changedAgain:!0},...I.slice(1)];ct.current=f,ke(f)}}const gn={orgSlug:v,virtualMcpId:e,branch:p,threadId:G,previewUrl:g?void 0:x??void 0,siteSlug:Pe},Fn=Qe&&u?Gn(Qe,u):null,dt=(t,n)=>{if(!y)return;N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),vt.current&&(clearTimeout(vt.current),vt.current=null),gt.current&&(clearTimeout(gt.current),gt.current=null);const s=ln(d,y,t,te,pe);B.mutate({blockKey:y,data:s},{onSuccess:()=>n?.onSuccess?.()??k?.(),onError:o=>{n?.onError?.(),B.reportError(o)}})},Wt=()=>{Ce?.(null),L(null),Tn(!1),A(null),W(null),lt(0),Fe(null),qe(null),T([]),$(t=>t+1)},er=()=>Jr(me.current,document.activeElement),us=(t=c("sectionsEditor.sectionsEditor.blockChangedElsewhere"))=>{if(N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear(),_t.current=null,H.error(t,{id:Po}),er()){tn.current=!0;return}zs(n=>n+1)},tr=()=>{!tn.current||er()||ct.current.length>0||N.current!==null||pn.current||hn.current||ye.current.size>0||(tn.current=!1,zs(t=>t+1))},nr=()=>{tn.current&&setTimeout(tr,0)},sr=de.kind==="protocol"&&de.source==="github",rr=t=>El(Nn,Cn,t,de.kind==="protocol"?de:null),or=t=>{ye.current.size!==0&&setTimeout(()=>{if(pn.current||hn.current)return;const n=[...ye.current.values()];ye.current.clear();for(const s of n)s()},t)},ua=t=>{const{activePageKey:n,variantIndex:s,sectionVariantIndex:o}=re.current,a=zt.current;return{formBase:a?.sectionIndex===t&&a.variantIndex===o?a:null,pageKey:n,global:q,pageVariantIndex:s,sectionVariantIndex:o,schema:Fn}},vn=t=>{ct.current=t,ke(t)},da=t=>{const n=ct.current,s=n.findIndex(i=>i.formBase===t.formBase),o=s>=0?n[s]:void 0,a=o?n.with(s,{...t,choices:no(o.plan,o.choices,t.plan),fresh:Ii(o.plan,t.plan,o.fresh),changedAgain:o.changedAgain||Hn(o.plan.theirs)!==Hn(t.plan.theirs)}):[...n,{...t,changedAgain:es.current.has(t.formBase)}];vn(a)},ar=(t,n)=>{const s=ct.current,o=s.findIndex(l=>l.formBase===t),a=s[o];if(!a)return!1;if(Hn(a.plan.mine)===Hn(n))return!0;const i=to({...a.plan,mine:n});if(i.pointers.length===0){const l=s.filter(f=>f!==a);return vn(l),!1}return vn(s.with(o,{...a,plan:i,choices:no(a.plan,a.choices,i)})),!0},fa=t=>{const n=re.current;return n.selectedSectionIndex===t.formBase.sectionIndex&&n.activePageKey===t.target.pageKey&&n.variantIndex===t.target.pageVariantIndex&&n.sectionVariantIndex===t.target.sectionVariantIndex},ma=()=>{const t=ct.current[0];if(!t)return null;const{formBase:n,target:s}=t;N.current&&_t.current?.sectionIndex===n.sectionIndex&&_t.current.sectionVariantIndex===s.sectionVariantIndex&&(clearTimeout(N.current),N.current=null,_t.current=null),ye.current.delete(`${s.pageKey}:${n.sectionIndex}:${s.sectionVariantIndex}`);const o=n.emitted;return o&&typeof o=="object"&&!ar(n,o)&&yn(o,n.sectionIndex,0,s),ct.current[0]??null},pa=()=>{const t=ct.current[0],n=ma();if(!n||!t||n.formBase!==t.formBase||n.plan.pointers.some(i=>!t.plan.pointers.includes(i)))return;const s=ji(n.plan,n.choices);de.kind==="protocol"&&de.source==="github"&&Ri(n.plan,n.choices)&&kl(c,!1),vn(ct.current.slice(1));const{formBase:o,target:a}=n;o.base=n.plan.theirs,o.version=void 0,o.emitted=s,es.current.add(o),(zt.current===o||fa(n))&&(zt.current=o,A(s),$(i=>i+1)),yn(s,o.sectionIndex,0,a)},ha=t=>{const[n,...s]=ct.current;n&&vn([{...n,choices:t},...s])},yn=(t,n,s=0,o,a=!1)=>{const i=o??ua(n),l=i.sectionVariantIndex,f=i.formBase,R=a||eo(ct.current,f,i,n,g).runNow,h=_t.current;N.current&&(clearTimeout(N.current),N.current=null,h&&(h.sectionIndex!==n||h.sectionVariantIndex!==l)&&h.write());const j=`${i.pageKey}:${n}:${l}`,E=()=>{if(pn.current||hn.current){ye.current.set(j,E);return}const D=typeof t=="function"?t():t,z=eo(ct.current,f,i,n,g).base;if(z&&ar(z,D))return;const ne=re.current.decofile,{rawSections:J,parsedSections:Ne,pageVariants:Q,variantIndex:be}=Bo(ne,i,g),Ie=i.pageKey,he=J[n];if(!he)return;const ue=Ne[n];if(!ue)return;const Ge=f?.base,Ze=bs(he,ue,l,ne,g),Nt=!!Ge&&!!Ze&&Ni(Ge,Ze)&&!(f&&Yr(f,Ze));if(Nt&&Ge&&Ze){if(Ci(Ge,Ze)){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}const U=ue.isSavedBlock?"here":Pi(Ge,J.map((ae,mt)=>bs(ae,Ne[mt],l,ne,g)),n,f?.sectionCount??J.length);if(U==="unknown"){us(c("sectionsEditor.sectionsEditor.sectionReplacedElsewhere"));return}if(typeof U=="number"&&f){f.sectionCount=J.length,f.sectionIndex=U,zt.current===f&&L(U),yn(D,U,s,i);return}}const Ct=Nt&&Ge&&Ze?to({ancestor:Ge,mine:D,theirs:Ze}):null;if(Ct&&Ct.pointers.length>0&&f){f.sectionCount=J.length,da({plan:Ct,formBase:f,target:i,sectionIndex:n,choices:Bi(Ct),changedAgain:!1,blockKey:ue.isSavedBlock?_s(he,ue):Ie,fresh:{}});return}const Pt=Ct?Ct.merged:null,rn=Pt??D,qr=Ki({merged:!!Pt,tracked:f,current:zt.current,saved:D});Pt&&H.info(c("sectionsEditor.sectionsEditor.blockMergedWithOthers"),{id:Po}),qr&&f&&(f.emitted=Pt,A(Pt));const Ss=qr||!Pt?rn:D;f&&(f.base=Ss,f.sectionCount=J.length,Di(f,Ss));const Gr={onSuccess:()=>{f&&es.current.delete(f),k?.()},onError:U=>{if(f?.base===Ss&&Ge&&(f.base=Ge),U instanceof Rl){if(f&&(f.version=void 0),s<Mc){ye.current.delete(j),hn.current=!0;const ae=Li(s,U.carriedStored);setTimeout(()=>{hn.current=!1,yn(()=>{const mt=f?.emitted;return mt&&typeof mt=="object"?mt:D},n,s+1,i,ae.immediate),ye.current.delete(j),or(xn(g))},ae.delay)}else us();return}B.reportError(U)}},Ur=U=>{pn.current=!0;let ae=!1;B.mutateAsync(U).then(()=>Gr.onSuccess(),mt=>{ae=!0,Gr.onError(mt)}).finally(()=>{pn.current=!1,or(ae?xn(g):0),tr()})};if(ue.isSavedBlock){const U=_s(he,ue);if(!U)return;Ur({blockKey:U,data:rn,...Ge?{base:{value:Mi({startedFrom:Ge,stored:Ze,rebased:!!Pt,refused:s>0})}}:{},rebaseOnConflict:!1,guard:so({formBase:f,rebased:!!Pt,versionOf:rr,productionVersionOf:ae=>oo(Nn,Cn,ae),...sr?{copy:{value:ne[U]}}:{}})});return}if(!Ie)return;const Wn={...ne[Ie]},Gt=[...J];if(ue.isMultivariate){const U=pt(he,ue);if(!U||!Ie)return;const ae=Fi(U,l,rn);Gt[n]=Bt(he,ue,ae)}else if(ue.isHidden){const U=Cs(he.__resolveType),ae=U?{...he.section}:{...he},mt=Array.isArray(ae.variants)?[...ae.variants]:[];mt[0]&&(mt[0]=ro(ae.__resolveType,mt[0],rn)),ae.variants=mt,U?Gt[n]={...he,section:ae}:Gt[n]=ae}else ue.isLazy?Gt[n]={...he,section:rn}:Gt[n]=rn;if(Q.length>1){const U=Wn.sections,ae=[...U?.variants??[]];ae[be]&&(ae[be]=ro(U?.__resolveType,ae[be],Gt)),Wn.sections={...U,variants:ae}}else Wn.sections=Gt;Ur({blockKey:Ie,data:Wn,rebaseOnConflict:!1,guard:so({formBase:null,rebased:!1,versionOf:rr,productionVersionOf:U=>oo(Nn,Cn,U),...sr?{copy:{value:ne[Ie]}}:{}})})};if(_t.current={sectionIndex:n,sectionVariantIndex:l,write:E},R){_t.current=null,E();return}N.current=setTimeout(()=>{N.current=null,E()},xn(g))},ga=t=>{tn.current=!1,L(t),lt(0),T([]),$(a=>a+1);const n=K[t],s=ce[t];if(Ce?.(s?.isSavedBlock?s.resolveType??null:null),!n||!s)return;if(s.isMultivariate){xt(n,s,0,t);return}const o=wt(n,s,d,g);if(!o){A(null),W(null),qe(null),Fe(null),$t(null,t,0);return}A(o.data),W(o.resolveType),qe(null),Fe(null),$t(null,t,0)},ir=t=>{const n=t;m!==null&&(zt.current=Ei(zt.current,{sectionIndex:m,variantIndex:re.current.sectionVariantIndex,shown:Xe,next:n,sectionCount:re.current.rawSections.length})),A(n),m!==null&&yn(n,m)},ds=t=>{if(!y||!d||!u||!oe)return;const n={kind:"page",pageKey:y,pageName:String(oe.name??""),path:String(oe.path??"")},s=Eo(d,n,u);s&&fn.save(y,()=>{const o=Nn.getQueryData(Ti.decofile(Cn))?.[y];if(!o||typeof o!="object"||o===null||Array.isArray(o))return null;const a={...o,...Bn.current};return Bn.current={},t?.raw!==void 0?uc(a,t.raw,u):t?.inner!==void 0?dc(n,s,a,t.inner):a})},lr=(t,n)=>{y&&(Bn.current[t]=n,ds())},va=(t,n)=>{if(!y)return;const s=Yn([...K],t,n);m!==null&&(m===t?L(n):t<m&&n>=m?L(m-1):t>m&&n<=m&&L(m+1)),dt(s)},ya=t=>{if(!y)return;const n=K.filter((s,o)=>o!==t);m===t?Wt():m!==null&&m>t&&L(m-1),dt(n)},Sa=t=>{if(!y)return;const n=K[t];if(!n)return;const s=[...K];s.splice(t+1,0,hl(n)),m!==null&&m>t&&L(m+1),dt(s)},ba=t=>{if(!y)return;const n=K[t],s=ce[t];if(!n||!s)return;const o=s.isHidden?_i(n,g):ki(n,u);if(!o)return;const a=[...K];a[t]=o,m===t&&Wt(),dt(a)},xa=t=>{if(!y)return;const n=K[t],s=ce[t];if(!n||!s||s.isMultivariate)return;const o=xi(n);if(!o)return;const a=[...K];a[t]=o,m===t&&Wt(),dt(a)},_a=t=>{if(!y)return;const n=K[t],s=ce[t];if(!n||!s?.isSavedBlock)return;const o=wt(n,s,d,g);if(!o?.data)return;const{name:a,...i}=o.data,l=[...K];s.isLazy?l[t]={...n,section:i}:l[t]=i,m===t&&Wt(),dt(l)},ka=t=>{if(!y)return;const n=Hi(ce),s=[...K.slice(0,n),{__resolveType:t.resolveType},...K.slice(n)];dt(s,{onError:()=>{re.current.selectedSectionIndex===n&&Wt()}}),He(!1),L(n),lt(0),T([]),$(l=>l+1);const o=s[n],a=kn(s,d,g)[n];if(!o||!a)return;if(a.isMultivariate){xt(o,a,0);return}const i=wt(o,a,d,g);if(!i){A(null),W(null),qe(null),Fe(null);return}A(i.data),W(i.resolveType),qe(null),Fe(null)},cr=t=>{Rn.current=t.append,He(!0)},wa=t=>{const n=Rn.current;if(!n){ka(t);return}n({__resolveType:t.resolveType}),He(!1),Rn.current=null},ur=t=>{if(m===null)return;const n=K[m],s=ce[m];!n||!s?.isMultivariate||(lt(t),T([]),$(o=>o+1),xt(n,s,t,m,!0))},ja=t=>{if(m===null||!y)return;const n=K[m],s=ce[m];if(!n||!s?.isMultivariate)return;const o=pt(n,s);if(!o)return;const a=Si(o,t);if(!a){H.error(c("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const i=[...K];i[m]=Bt(n,s,a);const l=a.variants;let f=Me;t===Me?f=Math.min(t,l.length-1):t<Me&&(f=Me-1),lt(f),T([]),$(R=>R+1),xt(i[m],s,f),dt(i)},Ra=t=>{if(m===null||!y)return;const n=K[m],s=ce[m];if(!n||!s?.isMultivariate)return;const o=pt(n,s);if(!o)return;const a=bi(o,t,g),i=[...K];i[m]=Bt(n,s,a);const l=Xr(o.variants??[],t,g);lt(l),T([]),$(f=>f+1),xt(i[m],s,l,m,g),dt(i)},Ea=(t,n)=>{if(m===null||!y||t===n)return;const s=K[m],o=ce[m];if(!s||!o?.isMultivariate)return;const a=pt(s,o);if(!a)return;const i=vi(a,t,n),l=[...K];l[m]=Bt(s,o,i);let f=Me;Me===t?f=n:t<Me&&n>=Me?f=Me-1:t>Me&&n<=Me&&(f=Me+1),lt(f),xt(l[m],o,f,m,g),dt(l)},Sn=t=>{const n=t??m;if(n===null||!y)return;const s=K[n],o=ce[n];if(!s||!o)return;const a=gi(s,o,void 0,u,g);if(!a){H.error(c("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const i=[...K];i[n]=a.section;const l=kn(i,d,g)[n];if(!l?.isMultivariate){H.error(c("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(n),lt(a.newVariantIndex),T([]),$(f=>f+1),xt(a.section,l,a.newVariantIndex,n,g),dt(i)},dr=()=>{if(m===null||!y)return;const t=K[m],n=ce[m];if(!t||!n?.isMultivariate)return;const s=pt(t,n);if(!s)return;const o=yi(t,n,s);if(!o){H.error(c("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const a=[...K];a[m]=o;const i=kn(a,d,g)[m];if(!i)return;lt(0),qe(null),Fe(null),T([]),$(f=>f+1);const l=wt(o,i,d,g);l?(A(l.data),W(l.resolveType)):(A(null),W(null)),$t(null,m,0),dt(a)},Va=async t=>{if(ie===null||!y)return;const n=Qn(t,d,u);if(n){H.error(n);return}const s=K[ie],o=ce[ie];if(!s||!o)return;const a=wt(s,o,d,g);if(!a){H.error(c("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const i={...a.data,name:t};try{const l=await B.mutateAsync({blockKey:t,data:i,create:!0}),f=[...K];f[ie]={__resolveType:t},await B.mutateAsync({blockKey:y,data:ln(d,y,f,te,pe)}),m===ie&&Wt(),Ve(null),Un(l)||H.success(c("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),k?.()}catch(l){H.error(c("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"),{description:Kt(c,Dt(l))})}},fr=Se?.rule;if(yt&&m===null&&Y===null&&fr){const{resolveType:t,formValue:n}=Ut(fr,d??{},u??void 0);ee(t),se(n)}const sn=u?al(u):[],fs=u&&d?il(u,d):[],Ht=g&&u&&d?fc(u,d):[],ms=(t,n)=>{if(Ht.length===0)return;const s=Nl(t);return{kinds:Ht,selected:s,campaignPrefill:mc(t),onPick:n,load:Gs}},mr=!q&&!!(ot&&u&&d),pr=Y&&u?Gn(Y,u):null,St=()=>{gt.current&&(clearTimeout(gt.current),gt.current=null),vt.current&&(clearTimeout(vt.current),vt.current=null)},qt=async(t,n)=>{if(Sc(n,t,u,g))try{await Pn.mutateAsync({blockKey:t})}catch(s){H.error(c("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"),{description:Kt(c,Dt(s))})}},hr=t=>{gt.current&&clearTimeout(gt.current),gt.current=setTimeout(()=>{const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a={...s[n]},i={...a.sections},l=[...i.variants??[]],f=l[o],R=f?.rule;if(Jt(R,s,u)){const h=R?.__resolveType??"",j=s[h],E=typeof j?.name=="string"?j.name:h,{__resolveType:D,...z}=t;B.mutate({blockKey:h,data:Ft(D??"",z,E)},{onSuccess:()=>k?.(),onError:B.reportError});return}f&&(l[o]={...f,rule:t}),a.sections={...i,variants:l},B.mutate({blockKey:n,data:a},{onSuccess:()=>k?.(),onError:B.reportError})},xn(g))},gr=t=>{ee(t);const n=t?Ao(t,u):{__resolveType:Zr(u)};se(t?n:{}),hr(n)},vr=t=>{const n=t;se(n);const s=Y?{__resolveType:Y,...n}:{...n};hr(s)},In=async(t,n,s)=>{const o=pc(n,t);if(!o.ok)return o.reason==="conflict"&&H.info(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.conflictTests"):c("sectionsEditor.namedRulePicker.conflictCampaigns"),xo),null;const a={};if(s){const i=s(o.rule);if(!i)return null;a[i.blockKey]=i.data}return o.blockWrite&&(a[o.blockWrite.blockKey]=o.blockWrite.block),Object.keys(a).length>0&&!(await Ls.apply({writes:a})).ok?null:(o.blockWrite&&H.success(t.kind==="experiments"?c("sectionsEditor.namedRulePicker.createdTest",{name:t.name.trim()}):c("sectionsEditor.namedRulePicker.createdCampaign",{name:t.name.trim()}),{...xo,description:c("sectionsEditor.namedRulePicker.createdHint")}),{rule:o.rule,projected:{...n,...a}})},yr=Ht.length>0?{kinds:Ht,load:Gs,prepare:async t=>(await In(t,re.current.decofile,void 0))?.rule??null,ensureBlock:async t=>{const n=Cl(re.current.decofile,t);return n.kind==="saved"?!0:n.kind==="conflict"?!1:(await Ls.apply({writes:{[Pl(t).blockKey]:n.block}})).ok}}:null,Sr=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a=await In(t,s,f=>{const R=s[n],h=R?.sections;if(!h||typeof h!="object"||Array.isArray(h))return null;const j=h;if(!Array.isArray(j.variants))return null;const E=[...j.variants],D=E[o];return D?(E[o]={...D,rule:f},{blockKey:n,data:{...R,sections:{...j,variants:E}}}):null});if(!a)return;const{resolveType:i,formValue:l}=Ut(a.rule,a.projected,u??void 0);ee(i),se(l),k?.()},br=async t=>{St();const{activePageKey:n,decofile:s,variantIndex:o}=re.current;if(!n)return;const a=s[n],i=a?.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],R=f[o];if(!R)return;const h=Mt(R.rule,s,u),j=cn(t);f[o]={...R,rule:j};const E={...s,[n]:{...a,sections:{...l,variants:f}}},{resolveType:D,formValue:z}=Ut(j,E,u??void 0);ee(D),se(z);try{await B.mutateAsync({blockKey:n,data:E[n]}),h&&h!==t&&await qt(h,E),k?.()}catch(ne){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(ne))})}},xr=t=>{vt.current&&clearTimeout(vt.current);const{selectedSectionIndex:n,sectionVariantIndex:s}=re.current;n!==null&&(vt.current=setTimeout(()=>{const{rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(!l)return;const h=o[n],j=a[n];if(!h||!j?.isMultivariate)return;const E=pt(h,j);if(!E)return;const z=(E.variants??[])[s]?.rule;if(Jt(z,i,u)){const Q=z?.__resolveType??"",be=i[Q],Ie=typeof be?.name=="string"?be.name:Q,{__resolveType:he,...ue}=t;B.mutate({blockKey:Q,data:Ft(he??"",ue,Ie)},{onSuccess:()=>k?.(),onError:B.reportError});return}const ne=xs(E,s,t),J=[...o];J[n]=Bt(h,j,ne);const Ne=ln(i,l,J,R,f);B.mutate({blockKey:l,data:Ne},{onSuccess:()=>k?.(),onError:B.reportError})},xn(g)))},Ta=t=>{qe(t);const n=t?Ao(t,u):{__resolveType:Zr(u)};Fe(t?n:{}),xr(n)},Aa=t=>{const n=t;Fe(n);const s=Zt?{__resolveType:Zt,...n}:{...n};xr(s)},Na=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(n===null||!l)return;const h=await In(t,i,D=>{const z=o[n],ne=a[n];if(!z||!ne?.isMultivariate)return null;const J=pt(z,ne);if(!J)return null;const Ne=[...o];return Ne[n]=Bt(z,ne,xs(J,s,D)),{blockKey:l,data:ln(i,l,Ne,R,f)}});if(!h)return;const{resolveType:j,formValue:E}=Ut(h.rule,h.projected,u??void 0);qe(j),Fe(E),k?.()},Ca=async t=>{St();const{selectedSectionIndex:n,sectionVariantIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(n===null||!l)return;const h=o[n],j=a[n];if(!h||!j?.isMultivariate)return;const E=pt(h,j);if(!E)return;const D=E.variants??[],z=Mt(D[s]?.rule,i,u),ne=cn(t),J=xs(E,s,ne),Ne=[...o];Ne[n]=Bt(h,j,J);const Q=ln(i,l,Ne,R,f),be={...i,[l]:Q},{resolveType:Ie,formValue:he}=Ut(ne,be,u??void 0);qe(Ie),Fe(he);try{await B.mutateAsync({blockKey:l,data:Q}),z&&z!==t&&await qt(z,be),k?.()}catch(ue){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(ue))})}};if(!q&&!oe)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.noPageFound",{currentPath:V})});if(q&&!rs)return r.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:c("sectionsEditor.sectionsEditor.globalBlockNotFound")});const Re=m!==null?ce[m]??null:null,_r=m!==null?K[m]:null,kr=_r&&Re?.isMultivariate?pt(_r,Re):null,Vt=kr?Qr(kr,we,g):[],Ln=Math.min(Me,Math.max(Vt.length-1,0)),kt=Vt[Ln]??null,Tt=Re?.isMultivariate===!0,ps=m!==null&&Re!==null,At=ps&&(Tt||!!(Fn&&Xe)),Pa=At&&!q&&Re?.isSavedBlock===!0,ft=q||Pa,wr=q?Us:Re?.label??"",Ba=Zt&&u?Gn(Zt,u):null,jr=(t,n)=>n&&X?`${t} · ${n}`:t,Rr=Re?Re.variantOf??Re.label:"",Ka=(()=>{const t=Tt&&kt?kt.label:null;return t?X?[jr(Rr,t)]:[Re.label,t]:[Re?.label??""]})(),hs=jr(oe?.name??"",yt?Se?.label:null),On=At&&(!q||M.length>0)?q?[Us,...M]:[hs,...Ka,...M]:[],Er=je&&oe?[oe.name,"SEO",...Ds]:[],Vr=c("sectionsEditor.pageVariantTabs.variantsLabel"),Tr=Qt&&oe?[oe.name,Vr]:Lt&&oe&&Re?[hs,Rr,Vr]:[],zn=Tr.length>0?Tr:Er.length>0?Er:ft?On.length>0?On:[wr]:On.length>0?On:[hs],Ar=ps&&!Tt&&!Re?.isHidden&&!!y,Da=ft||!q&&yt&&!!Se||Ar,Ma=ps&&!Tt&&!q&&M.length===0&&!!Re&&Do(Re)&&!!y,Fa=X&&At&&!Lt&&Tt&&M.length===0&&!!kt,Nr=X&&M.length>0?co(M[M.length-1]):null,Ia=M.length>1?co(M[M.length-2]):null,Cr=ft?wr:At?Re?.label??"":oe?.name??"",La=Qt||Lt?c("sectionsEditor.pageVariantTabs.variantsLabel"):je?c("sectionsEditor.panelSections.seo"):Nr??Cr,Pr=Lt?Re?.variantOf??Re?.label??"":Qt||je?oe?.name??"":Nr?Ia??Cr:ft?c("sectionsEditor.sectionsEditor.globalSectionSubtitle"):At?oe?.name??"":oe?.path??"",gs=!Qt&&!Lt&&!je&&!At&&!ft,Oa=!X&&!je&&!q&&Tt&&M.length===0,bn=()=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const t=d[y],n=vc(t.sections,K,u,g);if(!n)return;const{sections:s,newVariantIndex:o}=n;B.mutate({blockKey:y,data:{...t,sections:s}},{onSuccess:()=>{fe(o),L(null),A(null),W(null),T([]),se(null),ee(null)},onError:B.reportError})},$n=(t,n,s)=>{if(!y)return;St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const o=d[y],a=o.sections;if(!a||typeof a!="object"||Array.isArray(a))return;const i=a;if(!Array.isArray(i.variants))return;const l=t([...i.variants]);if(!l)return;const f=yc(i,l),R={...d,[y]:{...o,sections:f}};B.mutate({blockKey:y,data:R[y]},{onSuccess:()=>{n?.();const h=typeof s=="string"?[s]:s??[];(async()=>{for(const j of h)await qt(j,R)})()},onError:B.reportError})},Br=(t,n)=>{if(t===n)return;let s=te;te===t?s=n:t<te&&n>=te?s=te-1:t>te&&n<=te&&(s=te+1),fe(s);const o=Yn(pe.map(a=>({rule:a.rule})),t,n);is(o,s),$n(a=>Yn(a,t,n))},Kr=t=>{const n=pe[t]?.rule,s=Mt(n,d??{},u??void 0);$n(o=>o.length<=1?null:(o.splice(t,1),o),()=>{pe.length-1===1?fe(0):t<te?fe(te-1):t===te&&fe(Math.max(0,t-1)),L(null),A(null),W(null),T([]),se(null),ee(null)},s)},za=()=>{const t=pe.map((n,s)=>({variant:n,index:s})).filter(({variant:n})=>!wi(n.rule)).map(({variant:n})=>Mt(n.rule,d??{},u??void 0)).filter(n=>!!n);$n(n=>{const s=Oi({variants:n}),o=n[s];return o?[{...o,rule:zi(u)}]:null},()=>{fe(0),L(null),A(null),W(null),T([]),se(null),ee(null),Vn(!1)},t)},Dr=t=>{let n=t+1;$n(s=>(n=Xr(s,t,g),bc(s,t,g)),()=>{fe(n),L(null),A(null),W(null),T([]),se(null),ee(null)})},$a=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const s=re.current.activePageKey,o=re.current.decofile;if(!s)return;const a=o[s],i=a.sections;if(!i||typeof i!="object"||Array.isArray(i))return;const l=i;if(!Array.isArray(l.variants))return;const f=[...l.variants],R=f[t];if(!R?.rule||typeof R.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const h=R.rule,j=n.trim();en(!0);try{if(!j){if(!Jt(h,o,u)){F(null);return}const Q=h.__resolveType??"";f[t]={...R,rule:Ts(h,o,u)};const be={...o,[s]:{...a,sections:{...l,variants:f}}};await B.mutateAsync({blockKey:s,data:be[s]}),await qt(Q,be),F(null),k?.();return}const E=As(h,o,u);if(!E){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(E.blockKey){await B.mutateAsync({blockKey:E.blockKey,data:Ft(E.resolveType,E.data,j)}),F(null),k?.();return}const D=Jn(j),z=Qn(D,o,u);if(z){H.error(z);return}const ne=Ft(E.resolveType,E.data,j);let J=null,Ne=!1;try{const Q=await B.mutateAsync({blockKey:D,data:ne,create:!0});Ne=Un(Q),J=Ne?null:D,f[t]={...R,rule:cn(D)},await B.mutateAsync({blockKey:s,data:{...a,sections:{...l,variants:f}}}),J=null}catch(Q){throw J&&await Pn.mutateAsync({blockKey:J}).catch(()=>{}),Q}F(null),Ne||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:j})),k?.()}catch(E){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(E))})}finally{en(!1)}},Wa=async(t,n)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{selectedSectionIndex:s,rawSections:o,parsedSections:a,decofile:i,activePageKey:l,pageVariants:f,variantIndex:R}=re.current;if(s===null||!l)return;const h=o[s],j=a[s];if(!h||!j?.isMultivariate)return;const E=pt(h,j);if(!E)return;const D=E.variants??[],z=D[t];if(!z?.rule||typeof z.rule!="object"){H.error(c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const ne=z.rule,J=n.trim();en(!0);const Ne=async Q=>{const be={...E,variants:Q},Ie=[...o];Ie[s]=Bt(h,j,be);const he=ln(i,l,Ie,R,f);return await B.mutateAsync({blockKey:l,data:he}),{...i,[l]:he}};try{if(!J){if(!Jt(ne,i,u)){O(null);return}const Ze=ne.__resolveType??"",Nt=[...D];Nt[t]={...z,rule:Ts(ne,i,u)};const Ct=await Ne(Nt);await qt(Ze,Ct),O(null),k?.();return}const Q=As(ne,i,u);if(!Q){H.error(c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Q.blockKey){await B.mutateAsync({blockKey:Q.blockKey,data:Ft(Q.resolveType,Q.data,J)}),O(null),k?.();return}const be=Jn(J),Ie=Qn(be,i,u);if(Ie){H.error(Ie);return}const he=Ft(Q.resolveType,Q.data,J);let ue=null,Ge=!1;try{const Ze=await B.mutateAsync({blockKey:be,data:he,create:!0});Ge=Un(Ze),ue=Ge?null:be;const Nt=[...D];Nt[t]={...z,rule:cn(be)},await Ne(Nt),ue=null}catch(Ze){throw ue&&await Pn.mutateAsync({blockKey:ue}).catch(()=>{}),Ze}O(null),Ge||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:J})),k?.()}catch(Q){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(Q))})}finally{en(!1)}},Mr=async(t,n,s)=>{A(s);try{await B.mutateAsync({blockKey:t,data:s})}catch(o){throw A(a=>a===s?n:a),o}},Ha={rename:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n],f=l?.rule&&typeof l.rule=="object"?l.rule:void 0,R=async j=>{const E={...t,variants:j};return await Mr(o,t,E),{...a,[o]:E}},h=Dc(f,s,a,u);if(h.kind!=="noop"){if(h.kind==="error"){H.error(h.reason==="no-matcher-rule"?c("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"):h.reason==="unreadable-rule"?c("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"):h.message??c("sectionsEditor.sectionsEditor.failedToRenameVariant"));return}en(!0);try{if(h.kind==="inline"){const D=[...i];D[n]={...l,rule:h.inlinedRule};const z=await R(D);await qt(h.blockKey,z),k?.();return}if(h.kind==="updateBlock"){await B.mutateAsync({blockKey:h.blockKey,data:h.blockData}),k?.();return}let j=null,E=!1;try{const D=await B.mutateAsync({blockKey:h.blockId,data:h.blockData,create:!0});E=Un(D),j=E?null:h.blockId;const z=[...i];z[n]={...l,rule:h.reference},await R(z),j=null}catch(D){throw j&&await Pn.mutateAsync({blockKey:j}).catch(()=>{}),D}E||H.success(c("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:s.trim()})),k?.()}catch(j){H.error(c("sectionsEditor.sectionsEditor.failedToRenameVariant"),{description:Kt(c,Dt(j))})}finally{en(!1)}}},selectGlobal:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;const i=Array.isArray(t.variants)?[...t.variants]:[],l=i[n];if(!l)return;const f=Mt(l.rule,a,u);i[n]={...l,rule:cn(s)};const R={...t,variants:i},h={...a,[o]:R};try{await Mr(o,t,R),f&&f!==s&&await qt(f,h),k?.()}catch(j){H.error(c("sectionsEditor.sectionsEditor.couldNotApplySavedRule"),{description:Kt(c,Dt(j))})}},selectNamedRule:async(t,n,s)=>{St(),N.current&&(clearTimeout(N.current),N.current=null),ye.current.clear();const{activePageKey:o,decofile:a}=re.current;if(!o)return;let i=null;!await In(s,a,f=>{const R=Array.isArray(t.variants)?[...t.variants]:[],h=R[n];return h?(R[n]={...h,rule:f},i={...t,variants:R},{blockKey:o,data:i}):null})||!i||(A(i),k?.())}},Fr=()=>{Wt(),g&&$t(null,-1,0)},Ir=t=>{dn(t),ds({inner:t})},Lr=t=>{An(t),ds({raw:t})},Or=()=>{dn(null),Ot([])},zr=()=>Yt(t=>t+1),$r=()=>{fn.flush(),un(!1),dn(null),An(void 0),Ot([]),Yt(t=>t+1),ge?.()},qa=()=>{Vn(!1),Tn(!1),L(null),un(!0)},Ga=()=>{je&&$r(),L(null),Vn(!0)},Ua=()=>Tn(!0),vs=t=>{if(Qt&&t===0){Vn(!1);return}if(Lt&&t<2){Tn(!1),t===0&&L(null);return}if(je){if(t===0){$r();return}if(t===1){Ot([]),Yt(s=>s+1);return}Ot(Ds.slice(0,t-1)),Yt(s=>s+1);return}if(q){T(M.slice(0,t)),$(s=>s+1);return}if(t===0){Fr();return}if(t===1){T([]),$(s=>s+1);return}const n=!X&&Tt&&kt?1:0;if(n===1&&t===2){T([]),$(s=>s+1);return}T(M.slice(0,t-1-n))},ys=zn.length>1?r.jsx("button",{type:"button",onClick:()=>vs(gl(zn.length,{isMultivariateSectionTop:Oa})),title:c("sectionsEditor.sectionsEditor.back"),"aria-label":c("sectionsEditor.sectionsEditor.back"),className:le("shrink-0 inline-flex size-6 items-center justify-center rounded-[var(--studio-control-radius,var(--radius-md))] transition-colors",ft?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:r.jsx(Ui,{className:"size-4"})}):null,Ja=ft||At||je?Da&&r.jsxs("div",{className:le("border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[r.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[!q&&yt&&Se&&r.jsxs("button",{type:"button",onClick:Fr,title:c("sectionsEditor.sectionsEditor.editingInVariant",{variant:Se.label}),className:le("shrink-0 inline-flex items-center gap-1 rounded-lg h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",cl),children:[r.jsx(ll,{rule:js(Se.rule,d??{},u??void 0),matchers:sn}),r.jsx("span",{className:"max-w-[160px] truncate",children:Se.label})]}),r.jsx("div",{className:"flex-1"}),ft&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Zn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Ar&&r.jsx(qn,{onClick:()=>Sn()})]}),ft&&r.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:c("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):r.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[r.jsx("div",{className:"flex-1 min-w-0",children:r.jsx(uo,{pageKey:y,initialName:oe.name,initialPath:oe.path,onFieldChange:lr,variant:"header"})}),r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:()=>un(!0),children:r.jsx(io,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"ghost",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>Le&&y?Le():bt(!0),children:r.jsx(lo,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]}),r.jsx(qn,{onClick:bn})]}),Qa=r.jsxs(r.Fragment,{children:[yt&&y&&r.jsx(fo,{listKey:y,variants:pe,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Br,onRename:F,onDuplicate:Dr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsx(mo,{className:"mt-3",children:r.jsx("div",{className:le("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:gr,onSelectGlobal:br,named:ms(Se?.rule,Sr),namedRow:ws(Se?.rule,Ht),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})})]}),Wr=r.jsxs(r.Fragment,{children:[r.jsx(ul,{listKey:`${y??""}:${m??""}`,variants:Vt.map((t,n)=>({index:n,label:t.label})),selectedIndex:Ln,onSelect:ur,onRename:O,onDuplicate:Ra,onDelete:ja,onRemoveAll:dr,onReorder:Ea,onAdd:()=>Sn()}),r.jsx(mo,{children:r.jsx(ks,{currentRt:Zt??"",currentLabel:_n(kt?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(kt?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:Ta,onSelectGlobal:Ca,named:ms(kt?.rule,Na),namedRow:ws(kt?.rule,Ht),rule:kt?.rule,schema:Ba,formValue:Ho,onChange:Aa,formKey:`${m??"none"}:${Ln}:${Zt??""}`,formWrapperClassName:"pt-1",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Hr=r.jsx("div",{className:le(X?"px-2":"p-2 pt-3"),children:r.jsx(Bc,{listKey:`${y??""}-${te}`,rawSections:K,sections:ce,meta:u,decofile:d,selectedIndex:m,onSelect:t=>{ga(t),Je?.(t)},onReorder:va,onDelete:ya,onDuplicate:Sa,onMakeReusable:Ve,onToggleHidden:ba,onToggleLazy:rt?xa:void 0,onAddVariant:Sn,onDetach:_a,onAddSection:()=>He(!0),canAddSection:mr})}),Ya=r.jsxs("div",{className:"min-w-0 max-w-full space-y-4 overflow-x-hidden px-3",children:[y&&oe&&r.jsx(uo,{pageKey:y,initialName:oe.name,initialPath:oe.path,onFieldChange:lr}),nn&&y?r.jsx(Vo,{rawSeo:Kn,innerSeo:as,defaultResolveType:Qs,seoTypesLoading:g&&!u,seoSchema:Ys,activeResolveType:Dn,seoTypeOptions:Js,formResetKey:Ms,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})]}),Za=r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:r.jsx("div",{className:"mx-auto max-w-2xl",children:nn&&y?r.jsx(Vo,{rawSeo:Kn,innerSeo:as,defaultResolveType:Qs,seoTypesLoading:g&&!u,seoSchema:Ys,activeResolveType:Dn,seoTypeOptions:Js,formResetKey:Ms,siteDefaultSeo:Zs,onBreadcrumbChange:Ot,onPersistRaw:Lr,onInnerChange:Ir,onClearForm:Or,onBumpFormKey:zr,asyncRenderAvailable:rt}):r.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:c("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"),Xa=r.jsxs(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[yt&&y&&r.jsx(fo,{listKey:y,variants:pe,activeIndex:te,decofile:d??{},meta:u,matchers:sn,onSelect:cs,onReorder:Br,onRename:F,onDuplicate:Dr,onDelete:Kr,onAdd:bn}),yt&&Y!==null&&r.jsxs("div",{className:le("px-3 border-b",En?"pt-3 pb-5 space-y-3":"py-2"),children:[r.jsxs("button",{type:"button",onClick:()=>$o(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-[var(--studio-control-radius,var(--radius-sm))] py-0.5 hover:bg-accent","aria-expanded":En,children:[r.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:c("sectionsEditor.sectionsEditor.variantRule")}),En?r.jsx(Ji,{className:"size-3.5 shrink-0 text-muted-foreground"}):r.jsx(Gi,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),En&&r.jsx("div",{className:le("space-y-3",Xt&&"pointer-events-none opacity-50"),children:r.jsx(ks,{currentRt:Y,currentLabel:_n(Se?.rule,d??{},we,u??void 0),currentGlobalKey:Mt(Se?.rule,d??{},u??void 0)??void 0,matchers:sn,globals:fs,onSelect:gr,onSelectGlobal:br,named:ms(Se?.rule,Sr),namedRow:ws(Se?.rule,Ht),rule:Se?.rule,schema:pr,formValue:Ke,onChange:vr,formKey:`${te}:${Y??""}`,formWrapperClassName:"space-y-3",meta:u??void 0,decofile:d,onSaveReferencedBlock:mn,sandbox:gn})})]}),Hr]},"editor-section-list");return r.jsx(ic,{value:g,children:r.jsx(dl,{children:r.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[!X&&ys&&r.jsx("div",{className:"flex min-w-0 shrink-0 items-center gap-2 px-3 py-2",children:ys}),(X||zn.length>1)&&r.jsx(Wi,{crumbs:zn,onSelect:vs,onSelectRoot:()=>{fn.flush(),Ue?Ue():vs(0)}}),r.jsx("div",{className:"shrink-0",children:X?r.jsxs("div",{className:le("flex items-center gap-2 border-b px-3 py-2.5",ft&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[X&&ys,ft&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx("span",{className:"shrink-0 cursor-help",children:r.jsx(Zn,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),r.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:c("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),r.jsxs("div",{className:"flex min-w-0 flex-1 flex-col leading-tight",children:[r.jsx("span",{className:"truncate text-sm font-semibold",children:La}),Pr&&r.jsx("span",{className:"truncate text-xs text-muted-foreground",children:Pr})]}),gs&&yt&&Se&&r.jsx(po,{variants:pe,activeIndex:te,onSelect:cs,onManage:Ga,onRemoveAll:za}),Fa&&r.jsx(po,{variants:Vt,activeIndex:Ln,onSelect:ur,onManage:Ua,onRemoveAll:dr}),gs&&!yt&&r.jsx(qn,{onClick:bn}),Ma&&r.jsx(qn,{onClick:()=>Sn()}),r.jsx(fl,{}),gs&&r.jsxs(r.Fragment,{children:[r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.editSeo"),className:"shrink-0",onClick:qa,children:r.jsx(io,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.editSeo")})]}),!Le&&r.jsxs(jt,{children:[r.jsx(Rt,{asChild:!0,children:r.jsx(It,{type:"button",variant:"outline",size:"icon-sm","aria-label":c("sectionsEditor.sectionsEditor.viewJson"),className:"shrink-0",onClick:()=>bt(!0),children:r.jsx(lo,{size:14})})}),r.jsx(Et,{side:"bottom",children:c("sectionsEditor.sectionsEditor.viewJson")})]})]})]}):Ja}),ut&&r.jsx(mi,{open:!0,fields:pi(ut.plan,ut.target.schema),choices:ut.choices,changedAgain:ut.changedAgain,author:Ws??null,authorPending:Ws===void 0,fieldsAsLabeled:$s!==null,fresh:ut.fresh,keepTyping:g,onChoose:(t,n)=>ha({...ut.choices,[t]:n}),onApply:pa},Ic(ut.formBase)),Lt?r.jsx(ho,{onAdd:()=>Sn(),children:Wr},"editor-section-variants"):At?r.jsxs(an,{viewportRef:me,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[!X&&Tt&&Vt.length>0&&M.length===0&&Wr,r.jsx(To,{value:yr,children:r.jsx(go,{value:q&&g?Be:null,children:r.jsx(vo,{activeSchema:Fn,formValue:Xe,formResetKey:De,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:M,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr,onVariantMatcherOp:q?Ha:void 0})})})]},"editor-section-form"):q?r.jsx(an,{viewportRef:me,onBlur:nr,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx(To,{value:yr,children:r.jsx(go,{value:q&&g?Be:null,children:r.jsx(vo,{activeSchema:Fn,formValue:Xe,formResetKey:De,onFormChange:ir,onBreadcrumbChange:T,breadcrumbPath:M,emptyMessage:c("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:u,decofile:d,onSaveReferencedBlock:mn,sandbox:gn,previewBaseUrl:st,onRequestAddSection:cr})})})},"editor-global-block"):je?X?r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"p-3",children:Ya})},"editor-seo"):Za:Qt?r.jsx(ho,{onAdd:bn,children:Qa},"editor-variants"):X?r.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[r.jsx(an,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:r.jsx("div",{className:"py-2",children:Hr})}),r.jsx("div",{className:"shrink-0 border-t p-2",children:r.jsx(Ns,{canAddSection:mr,onAddSection:()=>He(!0)})})]},"editor-section-list"):Xa,r.jsx(ml,{open:ie!==null,onOpenChange:t=>{t||Ve(null)},defaultBlockId:ie!==null?Jn(ce[ie]?.label??""):"",isPending:B.isPending,onSubmit:Va}),ot&&r.jsx(ec,{open:Ae,onOpenChange:t=>{He(t),t||(Rn.current=null)},meta:u,decofile:d,previewBaseUrl:st,onSelect:wa}),ht&&y&&d&&r.jsx(nc,{open:ht,onOpenChange:bt,pageKey:y,decofile:d}),Te!==null&&r.jsx(yo,{open:!0,initialName:Jt(pe[Te]?.rule,d??{},u??void 0)?_n(pe[Te]?.rule,d??{},we,u??void 0):"",autoLabel:we(js(pe[Te]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await $a(Te,t)},onOpenChange:t=>{!t&&!Xt&&F(null)}}),tt!==null&&r.jsx(yo,{open:!0,initialName:Jt(Vt[tt]?.rule,d??{},u??void 0)?_n(Vt[tt]?.rule,d??{},we,u??void 0):"",autoLabel:we(js(Vt[tt]?.rule,d??{},u??void 0)),isPending:Xt,onSubmit:async t=>{await Wa(tt,t)},onOpenChange:t=>{!t&&!Xt&&O(null)}})]})})})}export{Of as SectionsEditor};