decocms 4.237.0 → 4.238.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/dist/client/assets/{AlertCircle-CjFbPbXR.js → AlertCircle-NIgamkG1.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CF11UEYw.js → AreaChart-CRpc3cm7.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-Dkou2oyv.js → ArrowLeft-vl2nEIkm.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-BLV5slUU.js → ArrowUp-DPZSwvHJ.js} +1 -1
  5. package/dist/client/assets/{ArrowUpRight-BP30hDff.js → ArrowUpRight-EJcVnEQQ.js} +1 -1
  6. package/dist/client/assets/{Check-BSC6j_AW.js → Check-BjlTRmvp.js} +1 -1
  7. package/dist/client/assets/{CheckCircle-BJO_ypFA.js → CheckCircle-DJReLGxy.js} +1 -1
  8. package/dist/client/assets/{ChevronDown-CVKkscg7.js → ChevronDown-BansJwMw.js} +1 -1
  9. package/dist/client/assets/{ChevronRight-BnJ4c2IL.js → ChevronRight-8cwrWc6Q.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-CVzJYnye.js → ChevronUp-CBwQlhRH.js} +1 -1
  11. package/dist/client/assets/{Copy01-BGs_9rA1.js → Copy01-DbAHd-uW.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-BgStC_qv.js → CreditCard01-CYifPwC3.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-D-83qNJa.js → DotsVertical-DB5B45Uo.js} +1 -1
  14. package/dist/client/assets/{Eye-NTHABHlz.js → Eye-Bh6RageV.js} +1 -1
  15. package/dist/client/assets/{FilterLines-Bu45YNI1.js → FilterLines-C7Wg9yVb.js} +1 -1
  16. package/dist/client/assets/{Globe01-DarbWSch.js → Globe01-D0Oxc1LP.js} +1 -1
  17. package/dist/client/assets/{Globe04-BBpMsdiG.js → Globe04-BkQE9r8Q.js} +1 -1
  18. package/dist/client/assets/{HardDrive-DCp-WUl5.js → HardDrive-BHaqV6HV.js} +1 -1
  19. package/dist/client/assets/{Key01-CNX_ptat.js → Key01-BwSFgo4R.js} +1 -1
  20. package/dist/client/assets/{LayoutLeft-D5nGLk_M.js → LayoutLeft-BSvhSrEB.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-BZfOUq-Q.js → LinkExternal01-CyubGI-F.js} +1 -1
  22. package/dist/client/assets/{LogOut01-j4YaKBaR.js → LogOut01-BxGW4Z42.js} +1 -1
  23. package/dist/client/assets/{Monitor01-C38MaP2T.js → Monitor01-DQW548Gm.js} +1 -1
  24. package/dist/client/assets/{Palette-Borxdy0n.js → Palette-CwprQ-n3.js} +1 -1
  25. package/dist/client/assets/{Play-DtbV3l2x.js → Play-B9I77UtI.js} +1 -1
  26. package/dist/client/assets/{Plus-B75q72-Y.js → Plus-BeKip_ti.js} +1 -1
  27. package/dist/client/assets/{SearchLg-C01PHEsZ.js → SearchLg-CF3SVn_9.js} +1 -1
  28. package/dist/client/assets/{SearchMd-sYSLCAfX.js → SearchMd-B0Qlr1Gl.js} +1 -1
  29. package/dist/client/assets/{Settings02-DcwyvSXX.js → Settings02-ghlI4JM4.js} +1 -1
  30. package/dist/client/assets/{Share07-B2hvI558.js → Share07-Ccl5KX8-.js} +1 -1
  31. package/dist/client/assets/{Shield01-DQ1xPJLH.js → Shield01-BRqhsyWc.js} +1 -1
  32. package/dist/client/assets/{Stars01-DqNq041Y.js → Stars01-D2FUcwqw.js} +1 -1
  33. package/dist/client/assets/Stars02-IIISJrG5.js +1 -0
  34. package/dist/client/assets/{Sun-yZz6cey6.js → Sun-qDVj9t4s.js} +1 -1
  35. package/dist/client/assets/{SwitchHorizontal01-6N0f6IEs.js → SwitchHorizontal01-BxCgeiYE.js} +1 -1
  36. package/dist/client/assets/{Tool01-CRPVUEI-.js → Tool01-DsnpIm7u.js} +1 -1
  37. package/dist/client/assets/{Tool02-BLLppoSv.js → Tool02-DK48uSLw.js} +1 -1
  38. package/dist/client/assets/{Trash01-DUcC_MrI.js → Trash01-BAawLpcp.js} +1 -1
  39. package/dist/client/assets/{TrendUp01-Bxf23nqY.js → TrendUp01-C6Z_wcrx.js} +1 -1
  40. package/dist/client/assets/{Upload01-lDNoA7DY.js → Upload01-CpAD4hxw.js} +1 -1
  41. package/dist/client/assets/{User01-D_PtC3-l.js → User01-Ce4Fl6PE.js} +1 -1
  42. package/dist/client/assets/{Users01-RLx4pV7z.js → Users01-C5hyD2dw.js} +1 -1
  43. package/dist/client/assets/{Users03-CttOOkYC.js → Users03-CPZVCPK9.js} +1 -1
  44. package/dist/client/assets/{X-0jWoG5jx.js → X-lCHRulQP.js} +1 -1
  45. package/dist/client/assets/{XCircle-CMWuzD62.js → XCircle-BCbY6TY1.js} +1 -1
  46. package/dist/client/assets/{XClose-DiX97P-p.js → XClose-DjKz-D2Z.js} +1 -1
  47. package/dist/client/assets/{YAxis-Ddx55nav.js → YAxis-BgtuEn7S.js} +5 -5
  48. package/dist/client/assets/{Zap-CkkvDzJg.js → Zap-wuOCIL0m.js} +1 -1
  49. package/dist/client/assets/ZapSquare-CS3jzdYe.js +1 -0
  50. package/dist/client/assets/{access-gate-Yhz0WTWU.js → access-gate-CTxljPxC.js} +1 -1
  51. package/dist/client/assets/agent-icon-B14THc_Q.js +1 -0
  52. package/dist/client/assets/agents-list-69g8rJEQ.js +1 -0
  53. package/dist/client/assets/ai-providers-CH91MQGS.js +1 -0
  54. package/dist/client/assets/{alert-CWGupSwA.js → alert-DFcpZ-oA.js} +1 -1
  55. package/dist/client/assets/{alert-dialog-C3fO6FiW.js → alert-dialog-D7IFH3T6.js} +1 -1
  56. package/dist/client/assets/api-keys-CrFPjis3.js +1 -0
  57. package/dist/client/assets/app-editor-CrEu8w54.js +1 -0
  58. package/dist/client/assets/{auth-BUKUv3gh.js → auth-aQ-S9sH7.js} +1 -1
  59. package/dist/client/assets/{auth-catchall-J4YZ4zxa.js → auth-catchall-D-f5_sUZ.js} +1 -1
  60. package/dist/client/assets/{auth-entry-CT1QE6om.js → auth-entry-BV0I_ZJc.js} +1 -1
  61. package/dist/client/assets/{auth-split-layout-CnaGL49E.js → auth-split-layout-BMNFHPoj.js} +1 -1
  62. package/dist/client/assets/{authenticate-and-persist-oauth-BL5kxXPR.js → authenticate-and-persist-oauth-Bf96RUCL.js} +1 -1
  63. package/dist/client/assets/{automation-list-row-BZ2cPPd8.js → automation-list-row-GgPsGmLt.js} +1 -1
  64. package/dist/client/assets/{automation-runs-0zCTJHHe.js → automation-runs-BpvoOdRs.js} +15 -15
  65. package/dist/client/assets/automations-DrdpSq1s.js +1 -0
  66. package/dist/client/assets/{avatar-CoBdq5SX.js → avatar-CZVTnS3q.js} +1 -1
  67. package/dist/client/assets/{badge-BKlfRcKL.js → badge-Largeyp5.js} +1 -1
  68. package/dist/client/assets/billing-QSWxDvoo.js +6 -0
  69. package/dist/client/assets/{block-document-DxFvrhcf.js → block-document-BH_hCXmL.js} +1 -1
  70. package/dist/client/assets/{buckets-B1PmZgk3.js → buckets-DoVdPe7_.js} +1 -1
  71. package/dist/client/assets/bulk-category-panel-D4Kjb2t5.js +1 -0
  72. package/dist/client/assets/{capability-load-error-b09S7e_1.js → capability-load-error-By5RHmfh.js} +1 -1
  73. package/dist/client/assets/{card-Zz2koMwO.js → card-Y4Td6_qp.js} +1 -1
  74. package/dist/client/assets/{cards-DZhyxsHe.js → cards-v-ZQq690.js} +1 -1
  75. package/dist/client/assets/category-editor-CpamqiDH.js +1 -0
  76. package/dist/client/assets/{chart-Bnk_UfBL.js → chart-BQq8t5ba.js} +1 -1
  77. package/dist/client/assets/{chat-context-BWORVgD7.js → chat-context-D3_WI76a.js} +1 -1
  78. package/dist/client/assets/{checkbox-DpwUgoY2.js → checkbox-T7P3CSDd.js} +1 -1
  79. package/dist/client/assets/{cli-auth-success-BtBqcEC0.js → cli-auth-success-CUbHl1Z7.js} +1 -1
  80. package/dist/client/assets/collection-detail-eXDRP9Q8.js +1 -0
  81. package/dist/client/assets/{collection-display-button-CLPFB3_A.js → collection-display-button-BIyaULpN.js} +1 -1
  82. package/dist/client/assets/{collection-search-_zFY8-Cf.js → collection-search-mKgfv-P5.js} +1 -1
  83. package/dist/client/assets/{collection-table-wrapper-DPorXhXn.js → collection-table-wrapper-BiIkdzxw.js} +1 -1
  84. package/dist/client/assets/{collection-tabs-Tu083PIR.js → collection-tabs-Ibp0SPgD.js} +1 -1
  85. package/dist/client/assets/{command-DI3FhUnx.js → command-CPY4g0vY.js} +1 -1
  86. package/dist/client/assets/commerce-onboarding-DSweCkSf.js +1 -0
  87. package/dist/client/assets/connect-Cr5eEYHn.js +8 -0
  88. package/dist/client/assets/{connection-CXwlAZgv.js → connection-B265IAJQ.js} +1 -1
  89. package/dist/client/assets/{connection-card-BHS6Mbjr.js → connection-card-C8ol51ZW.js} +1 -1
  90. package/dist/client/assets/connection-detail-ZyykQc7g.js +1 -0
  91. package/dist/client/assets/{connection-form-helpers-DsdyG005.js → connection-form-helpers-C7wyCDlb.js} +1 -1
  92. package/dist/client/assets/connections-BBbAjJre.js +1 -0
  93. package/dist/client/assets/{decopilot-sse-pool-DLZWceLm.js → decopilot-sse-pool-MiFwCFec.js} +1 -1
  94. package/dist/client/assets/{dialog-C0_VZPHC.js → dialog-XZdfEVkH.js} +1 -1
  95. package/dist/client/assets/{domain-settings-NyZzR6hV.js → domain-settings-B9j2Tomm.js} +1 -1
  96. package/dist/client/assets/{drawer-2KdGcrE6.js → drawer-CZRmN4Rl.js} +1 -1
  97. package/dist/client/assets/{dropdown-menu-CMTPZ7Ir.js → dropdown-menu-DVYqDP-D.js} +1 -1
  98. package/dist/client/assets/{empty-state-CQKPJKx2.js → empty-state-1FVnySPh.js} +1 -1
  99. package/dist/client/assets/{extract-connection-data-DVi4pwNP.js → extract-connection-data-BpVTWK-J.js} +1 -1
  100. package/dist/client/assets/file-explorer-B8m_Ud7I.js +2 -0
  101. package/dist/client/assets/{file-type-icon-BaDll1C-.js → file-type-icon-C0Iwwc71.js} +1 -1
  102. package/dist/client/assets/{form-DApAFFn0.js → form-Dxx4h0K2.js} +1 -1
  103. package/dist/client/assets/general-4Cwh9qXG.js +1 -0
  104. package/dist/client/assets/{github-repo-picker-qhvXBKMo.js → github-repo-picker-BntApwLN.js} +1 -1
  105. package/dist/client/assets/{hooks-B7N1YIMG.js → hooks-D1ngLxRd.js} +1 -1
  106. package/dist/client/assets/{index-OxFtCYT-.js → index-ANK2LJtV.js} +1 -1
  107. package/dist/client/assets/index-B6at7pHi.js +1 -0
  108. package/dist/client/assets/{index-CuujNnv4.js → index-BW8Kh131.js} +1 -1
  109. package/dist/client/assets/index-BayJ_hOk.js +1 -0
  110. package/dist/client/assets/{index-DeD3quSS.js → index-CUMFdB46.js} +1 -1
  111. package/dist/client/assets/{index-BmKat3q_.js → index-CjHBTwzP.js} +1 -1
  112. package/dist/client/assets/{index-lbvtcVET.js → index-CtD8kCVB.js} +2 -2
  113. package/dist/client/assets/{index-DMDxsX36.js → index-DyK-1LHf.js} +1 -1
  114. package/dist/client/assets/{index-h0GcRHM1.js → index-P-GX8FW_.js} +21 -21
  115. package/dist/client/assets/{index-Gptoc_-0.js → index-dh0u4IqP.js} +47 -47
  116. package/dist/client/assets/index-iwXkDaR-.css +1 -0
  117. package/dist/client/assets/{index-redirect-kqqz9Pdm.js → index-redirect-Bs49GSOc.js} +1 -1
  118. package/dist/client/assets/infra-billing-DaFLqOb1.js +1 -0
  119. package/dist/client/assets/{input-BzvzuDaQ.js → input-CjE2QrUF.js} +1 -1
  120. package/dist/client/assets/{integration-icon-BtDBTwbu.js → integration-icon-DD2uGTto.js} +1 -1
  121. package/dist/client/assets/{invite-member-dialog-D6at4Byp.js → invite-member-dialog-3RD7lTgh.js} +1 -1
  122. package/dist/client/assets/{label-DtVKw0n-.js → label-BYk5h4ou.js} +1 -1
  123. package/dist/client/assets/{layout-iYq7K1In.js → layout-CzV2Jg4F.js} +1 -1
  124. package/dist/client/assets/{login-DPnQy0ky.js → login-kOxWh4FL.js} +1 -1
  125. package/dist/client/assets/{mcp-oauth-DmlNibJW.js → mcp-oauth-YnIysQTC.js} +1 -1
  126. package/dist/client/assets/members-BWZup3yY.js +1 -0
  127. package/dist/client/assets/{monaco-editor-Bx-WJoCd.js → monaco-editor-CEqNg3BQ.js} +1 -1
  128. package/dist/client/assets/{monitoring-stats-row-DB1vTT_4.js → monitoring-stats-row-DO9FS6PN.js} +1 -1
  129. package/dist/client/assets/{multi-select-DRJAdNWW.js → multi-select-BheAE_Ti.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-BQzVHUp7.js → oauth-callback-Bxh-hXdQ.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-ai-provider-CvGIMomW.js → oauth-callback-ai-provider-3iVGzc8O.js} +1 -1
  132. package/dist/client/assets/{onboarding-CzCEX6lz.js → onboarding-EKkdot5C.js} +1 -1
  133. package/dist/client/assets/{org-layout-DFn4LDXk.js → org-layout-BxTmoEir.js} +1 -1
  134. package/dist/client/assets/{organization-choice-DHMqg0E7.js → organization-choice-Ci26Yd7s.js} +1 -1
  135. package/dist/client/assets/{orgs-DtNQhw-_.js → orgs-CQAUGc_3.js} +1 -1
  136. package/dist/client/assets/{page-seo-form-DeB6ysXI.js → page-seo-form-rWml4KZv.js} +1 -1
  137. package/dist/client/assets/{popover-vEPjwNUl.js → popover-DH4sJ-hx.js} +1 -1
  138. package/dist/client/assets/post-editor-BX_oDQpj.js +1 -0
  139. package/dist/client/assets/{primitives-CWdeZIPO.js → primitives-DgKwbqlI.js} +1 -1
  140. package/dist/client/assets/{profile-DKOvg4Ys.js → profile-Drr6RyML.js} +1 -1
  141. package/dist/client/assets/project-app-view-C4uK-Ykh.js +1 -0
  142. package/dist/client/assets/record-editor-CNBghvNW.js +1 -0
  143. package/dist/client/assets/redirect-editor-DWVkIY5G.js +1 -0
  144. package/dist/client/assets/{registry-layout-DVU67Hav.js → registry-layout-Bu1cLH4_.js} +1 -1
  145. package/dist/client/assets/registry-yIvFz9E8.js +2 -0
  146. package/dist/client/assets/{reports-B5K5drg3.js → reports-5TYDahoh.js} +1 -1
  147. package/dist/client/assets/{require-capability-CbJhxJIS.js → require-capability-k_aaNrmG.js} +1 -1
  148. package/dist/client/assets/{required-auth-layout-DF3apjeH.js → required-auth-layout-Dn81p7H8.js} +1 -1
  149. package/dist/client/assets/{reset-password-FnBbdloF.js → reset-password-DwRMgnq7.js} +1 -1
  150. package/dist/client/assets/roles-BvfzqM4Y.js +1 -0
  151. package/dist/client/assets/{search-input-DyFy1iK0.js → search-input-CAfA70t6.js} +1 -1
  152. package/dist/client/assets/{secrets-BVhh5Z-m.js → secrets-DQyg5IaG.js} +1 -1
  153. package/dist/client/assets/{sections-editor-afUyMuSx.js → sections-editor-1wvlg_V9.js} +2 -2
  154. package/dist/client/assets/{select-Tei14Zu4.js → select-KBOQqb5b.js} +1 -1
  155. package/dist/client/assets/{select-model-DotYsAqj.js → select-model-D2hJNEZf.js} +1 -1
  156. package/dist/client/assets/{self-tool-result-C9rWuUA9.js → self-tool-result-red_JJVZ.js} +1 -1
  157. package/dist/client/assets/seo-editor-DNfycddR.js +1 -0
  158. package/dist/client/assets/settings-layout-DH-EViOe.js +1 -0
  159. package/dist/client/assets/{settings-section-DhCcFHe0.js → settings-section-uyvyi36n.js} +1 -1
  160. package/dist/client/assets/settings-subnav-DfcYXylW.js +1 -0
  161. package/dist/client/assets/{shell-controls-Cnb_Nzjz.js → shell-controls-i0HidCqY.js} +1 -1
  162. package/dist/client/assets/shell-layout-Czubm3xQ.js +1 -0
  163. package/dist/client/assets/{sidebar-fE9arcNR.js → sidebar-DYOHjP73.js} +1 -1
  164. package/dist/client/assets/{skeleton-WByIIjEz.js → skeleton-BwaQyECl.js} +1 -1
  165. package/dist/client/assets/{spinner-C3SNk2G5.js → spinner-D7MklTbP.js} +1 -1
  166. package/dist/client/assets/{sso-CxdzdiLc.js → sso-Dg3_woQC.js} +1 -1
  167. package/dist/client/assets/{store-DtJopL5o.js → store-CTLRFju2.js} +1 -1
  168. package/dist/client/assets/store-registry-DFdXvC9d.js +2 -0
  169. package/dist/client/assets/{studio-tools-DaHRmNBg.js → studio-tools-rxH0R7lt.js} +1 -1
  170. package/dist/client/assets/{switch-HDj1d-W_.js → switch-B5ZbhCe0.js} +1 -1
  171. package/dist/client/assets/synced-repos-x16ha39u.js +1 -0
  172. package/dist/client/assets/{tab-id-DqxFWWKz.js → tab-id-CTjObiZn.js} +1 -1
  173. package/dist/client/assets/{table-BqUdzLQw.js → table-D-J833Vt.js} +1 -1
  174. package/dist/client/assets/{tabs-C2pF4tHl.js → tabs-BMNmvzpQ.js} +1 -1
  175. package/dist/client/assets/{textarea-kmGQrCWT.js → textarea-kMyew1mY.js} +1 -1
  176. package/dist/client/assets/{toggle-group-GAcLozzv.js → toggle-group-DRlvHVKj.js} +1 -1
  177. package/dist/client/assets/{toolbar-CPIussBe.js → toolbar-R-lbOcDk.js} +1 -1
  178. package/dist/client/assets/{tooltip-CAY4Un9y.js → tooltip-CCAgnlkx.js} +1 -1
  179. package/dist/client/assets/{track-poPKLD9c.js → track-BEQo3sFg.js} +1 -1
  180. package/dist/client/assets/{types-Ctr4Pq-Y.js → types-BAfCrx4S.js} +1 -1
  181. package/dist/client/assets/{use-ai-providers-Dw-i46pJ.js → use-ai-providers-BD3OpOyt.js} +1 -1
  182. package/dist/client/assets/{use-api-keys-Mb8ED3cS.js → use-api-keys-DNGO5UEj.js} +1 -1
  183. package/dist/client/assets/{use-automations-l3Ox7fHF.js → use-automations-5visjbRc.js} +1 -1
  184. package/dist/client/assets/{use-autosave-DajgHu_u.js → use-autosave-Chfu4jlL.js} +1 -1
  185. package/dist/client/assets/{use-capability-Bq8QIaAm.js → use-capability-BG5qAt9K.js} +1 -1
  186. package/dist/client/assets/{use-clock-tick-DQJlJSeJ.js → use-clock-tick-qO3IUhYy.js} +1 -1
  187. package/dist/client/assets/use-commerce-diagnostic-p8AlgPkx.js +1 -0
  188. package/dist/client/assets/{use-connection-CHvN0FBa.js → use-connection-DoE4VVnG.js} +1 -1
  189. package/dist/client/assets/{use-copy-BKbIPHzw.js → use-copy-DwKcHskz.js} +1 -1
  190. package/dist/client/assets/{use-create-virtual-mcp-BiKtnPDO.js → use-create-virtual-mcp-CDZV5SRZ.js} +1 -1
  191. package/dist/client/assets/{use-debounced-autosave-C2C9GPgR.js → use-debounced-autosave-Bn---yMo.js} +1 -1
  192. package/dist/client/assets/{use-debounced-value-CGQ1MygG.js → use-debounced-value-CDap9oX0.js} +1 -1
  193. package/dist/client/assets/{use-decopilot-events-6yGSgNoz.js → use-decopilot-events-BqPh4BCN.js} +1 -1
  194. package/dist/client/assets/{use-delete-connection-CkqqL8Gd.js → use-delete-connection-CoZnx8cA.js} +1 -1
  195. package/dist/client/assets/{use-deployment-admin-HTXfV5V9.js → use-deployment-admin-3ODrcPns.js} +1 -1
  196. package/dist/client/assets/{use-file-configs-BeAzNpwF.js → use-file-configs-BTGiD983.js} +1 -1
  197. package/dist/client/assets/{use-infinite-scroll-N2WGSfb_.js → use-infinite-scroll-DV4nhJU-.js} +1 -1
  198. package/dist/client/assets/{use-join-requests-D2gK9tyz.js → use-join-requests-B8mo2OR6.js} +1 -1
  199. package/dist/client/assets/{use-mcp-client-CCJCYDxN.js → use-mcp-client-DMHWuHBR.js} +2 -2
  200. package/dist/client/assets/{use-mcp-tools-CGdKn1Fw.js → use-mcp-tools-Zd5Wb_Ox.js} +1 -1
  201. package/dist/client/assets/{use-members-BEOwJloH.js → use-members-fvuAoyah.js} +1 -1
  202. package/dist/client/assets/{use-mobile-uWMSI329.js → use-mobile-iNxeOMfx.js} +1 -1
  203. package/dist/client/assets/{use-navigate-to-agent-zvAVYd41.js → use-navigate-to-agent-BgN8_rbc.js} +1 -1
  204. package/dist/client/assets/{use-open-billing-url-ptr76Hlr.js → use-open-billing-url-DhGvCL22.js} +1 -1
  205. package/dist/client/assets/{use-org-auth-client-BmiUk9g-.js → use-org-auth-client-Cag_S-a4.js} +1 -1
  206. package/dist/client/assets/{use-org-sso-DoxFiQxq.js → use-org-sso-U6MQkVfh.js} +1 -1
  207. package/dist/client/assets/{use-organization-roles-BpQOPqCr.js → use-organization-roles-C3ByCKmB.js} +1 -1
  208. package/dist/client/assets/{use-organization-settings-BPPkEz7K.js → use-organization-settings-CXQEv0_d.js} +1 -1
  209. package/dist/client/assets/{use-registry-connections-CDunPWB9.js → use-registry-connections-DjSot7EF.js} +1 -1
  210. package/dist/client/assets/{use-secrets-Bb1WW8u5.js → use-secrets-Ct36JmLs.js} +1 -1
  211. package/dist/client/assets/{use-section-preview-base-DKdei54Z.js → use-section-preview-base-BijudAg1.js} +1 -1
  212. package/dist/client/assets/use-settings-tabs-DTQ00oCY.js +1 -0
  213. package/dist/client/assets/{use-status-sounds-BmimvYmS.js → use-status-sounds-9UZfO_tZ.js} +1 -1
  214. package/dist/client/assets/{use-tags-C0yWU0xy.js → use-tags-D4Bd-NDo.js} +1 -1
  215. package/dist/client/assets/{use-view-mode-CxVmDEL4.js → use-view-mode-DxkV0rAO.js} +1 -1
  216. package/dist/client/assets/use-virtual-mcp-DdZEMtY_.js +1 -0
  217. package/dist/client/assets/useInfiniteQuery-DTN5TRDI.js +1 -0
  218. package/dist/client/assets/useRouterState-WnRAdRHN.js +1 -0
  219. package/dist/client/assets/useSuspenseInfiniteQuery-QQYAakG4.js +1 -0
  220. package/dist/client/assets/{users-ClXzWwqs.js → users-CoIsMtRi.js} +1 -1
  221. package/dist/client/assets/variant-calendar-Cz-Z7Tjl.js +1 -0
  222. package/dist/client/assets/{view-mode-toggle-BKtHCADs.js → view-mode-toggle-D6PsJXd2.js} +1 -1
  223. package/dist/client/index.html +2 -2
  224. package/dist/server/cli.js +1 -1
  225. package/dist/server/server.js +1 -1
  226. package/package.json +1 -1
  227. package/dist/client/assets/CpuChip01-CWKZNd3u.js +0 -1
  228. package/dist/client/assets/Star01-CBnujI48.js +0 -1
  229. package/dist/client/assets/Stars02-OU17b3lp.js +0 -1
  230. package/dist/client/assets/ZapSquare-CGho5JH5.js +0 -1
  231. package/dist/client/assets/agent-icon-DpJzA7B2.js +0 -1
  232. package/dist/client/assets/agents-list-CoTSpffk.js +0 -1
  233. package/dist/client/assets/ai-providers-Bo0u0UsB.js +0 -1
  234. package/dist/client/assets/api-keys-Bk8viiTm.js +0 -1
  235. package/dist/client/assets/app-editor-DyWBYoo6.js +0 -1
  236. package/dist/client/assets/automations-BfZGOXE9.js +0 -1
  237. package/dist/client/assets/billing-Bpfymb_n.js +0 -6
  238. package/dist/client/assets/brand-context-Bibex5y6.js +0 -1
  239. package/dist/client/assets/bulk-category-panel-DvkBfAH7.js +0 -1
  240. package/dist/client/assets/category-editor-CU4nNr3w.js +0 -1
  241. package/dist/client/assets/collection-detail-BpdKLLyB.js +0 -1
  242. package/dist/client/assets/commerce-onboarding-DFnpw-BJ.js +0 -1
  243. package/dist/client/assets/connect-Bt8SyJ_D.js +0 -8
  244. package/dist/client/assets/connection-detail-D39SrwAZ.js +0 -1
  245. package/dist/client/assets/connections-Co_IqyZ-.js +0 -1
  246. package/dist/client/assets/file-explorer-Cb9zzD4a.js +0 -2
  247. package/dist/client/assets/general-BvDD0-Ck.js +0 -1
  248. package/dist/client/assets/index-BCveq62k.js +0 -1
  249. package/dist/client/assets/index-BX7x5P5r.css +0 -1
  250. package/dist/client/assets/index-Dd6uaRi9.js +0 -1
  251. package/dist/client/assets/infra-billing-CKP5HEPI.js +0 -1
  252. package/dist/client/assets/members-Dxp3M4JV.js +0 -1
  253. package/dist/client/assets/post-editor-CKk8bZhp.js +0 -1
  254. package/dist/client/assets/project-app-view-q7h-4L-m.js +0 -1
  255. package/dist/client/assets/record-editor-r-UV1jn9.js +0 -1
  256. package/dist/client/assets/redirect-editor-BQ9vpGwi.js +0 -1
  257. package/dist/client/assets/registry-BtYiGQ6_.js +0 -2
  258. package/dist/client/assets/roles-BjDS_mAv.js +0 -1
  259. package/dist/client/assets/seo-editor-BFI6VVV1.js +0 -1
  260. package/dist/client/assets/settings-layout-CLExdr_b.js +0 -1
  261. package/dist/client/assets/shell-layout-DKP_M-mD.js +0 -1
  262. package/dist/client/assets/store-registry-DAqmEdVe.js +0 -2
  263. package/dist/client/assets/synced-repos-Cbba0xP7.js +0 -1
  264. package/dist/client/assets/use-commerce-diagnostic-BVElM2RV.js +0 -1
  265. package/dist/client/assets/use-infra-billing-CRWMAvoz.js +0 -1
  266. package/dist/client/assets/use-virtual-mcp-bKqEnT_v.js +0 -1
  267. package/dist/client/assets/useInfiniteQuery-BcVwIHfG.js +0 -1
  268. package/dist/client/assets/useRouterState-faIY6mBF.js +0 -1
  269. package/dist/client/assets/useSuspenseInfiniteQuery-B_UTR4fd.js +0 -1
  270. package/dist/client/assets/variant-calendar-C0DMqVdE.js +0 -1
@@ -1,2 +1,2 @@
1
- import{c as Ge,b as ct,r as w,m as $e,j as n,ac as Xn,B as Xe,k as Zn,o as Lo,t as J,K as Ko}from"./index-Gptoc_-0.js";import{aq as es,ar as Fo,as as Io,at as Oo,au as $o,a5 as ts,a6 as Qt,av as ns,aw as ss,a7 as os,a8 as as,ax as rs,ay as zo,af as is,ag as ls,az as Ho,aA as Uo,aB as cs,O as qo,a9 as us,aa as Mt,ad as ds,ae as ms,ab as fs,al as ps,aC as Go,aD as Bt,aE as gs,aF as Wo,S as hs,aG as lt,G as vs,aH as Yo,aI as Jo,aJ as Qo,aK as Xo,D as Zo,F as ea,aL as ta,aM as na,aN as sa,aO as oa,aj as qt,aP as Gt,aQ as aa,aR as St,aS as Pt,aT as ra,aU as ia,aV as tt,aW as Ln,aX as la,aY as Ct,aZ as Wt,a_ as ca,a$ as mn,b0 as ua,b1 as kt,b2 as da,b3 as ma,b4 as fa,b5 as pa,b6 as ga,b7 as xt,b8 as ha,b9 as va,ba,I as Sa,bb as Kn,bc as At,bd as Fn,be as In,bf as xa,bg as ya,bh as _a,bi as ja,bj as fn,bk as On,bl as $n,bm as Tt,bn as Yt,bo as zn,bp as Ea,bq as pn,br as Ra,bs as wa,bt as ka,bu as Ta,bv as Na}from"./index-h0GcRHM1.js";import{t as Va}from"./ChevronDown-CVKkscg7.js";import{af as hn,x as Da,U as bs,F as Pa,w as Ss,am as Ca,s as Aa}from"./agent-icon-DpJzA7B2.js";import{i as xs}from"./ChevronRight-BnJ4c2IL.js";import{n as Ma}from"./ChevronUp-CVzJYnye.js";import{i as Ba}from"./Globe01-DarbWSch.js";import{B as Jt}from"./automation-runs-0zCTJHHe.js";import{c as yt,T as _t,a as jt}from"./tooltip-CAY4Un9y.js";import{b as La,h as Ka,a as Fa,c as Ia,d as Oa,e as $a}from"./dialog-C0_VZPHC.js";import{I as za}from"./input-BzvzuDaQ.js";import{a as ys}from"./Copy01-BGs_9rA1.js";import{i as Ha}from"./Settings02-DcwyvSXX.js";import{s as Ua}from"./Eye-NTHABHlz.js";import{s as _s}from"./TrendUp01-Bxf23nqY.js";import{s as vn}from"./Plus-B75q72-Y.js";import{s as js}from"./Trash01-DUcC_MrI.js";import{i as qa}from"./Zap-CkkvDzJg.js";import{D as Es,a as vt,c as Rs,b as ws,i as Ga}from"./dropdown-menu-CMTPZ7Ir.js";import{S as Wa,r as Hn,u as Ya,d as Ja,a as Qa,i as Xa,f as Za,P as er,b as tr}from"./page-seo-form-DeB6ysXI.js";import{c as nr}from"./Tool01-CRPVUEI-.js";import{u as sr,A as or}from"./use-section-preview-base-DKdei54Z.js";import"./ArrowUp-BLV5slUU.js";import"./chat-context-BWORVgD7.js";import"./tab-id-DqxFWWKz.js";import"./Check-BSC6j_AW.js";import"./hooks-B7N1YIMG.js";import"./use-mcp-client-CCJCYDxN.js";import"./auth-BUKUv3gh.js";import"./decopilot-sse-pool-DLZWceLm.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-bKqEnT_v.js";import"./use-ai-providers-Dw-i46pJ.js";import"./studio-tools-DaHRmNBg.js";import"./use-decopilot-events-6yGSgNoz.js";import"./use-organization-settings-BPPkEz7K.js";import"./spinner-C3SNk2G5.js";import"./drawer-2KdGcrE6.js";import"./collection-search-_zFY8-Cf.js";import"./SearchMd-sYSLCAfX.js";import"./use-mobile-uWMSI329.js";import"./chart-Bnk_UfBL.js";import"./index-OxFtCYT-.js";import"./X-0jWoG5jx.js";import"./shell-layout-DKP_M-mD.js";import"./avatar-CoBdq5SX.js";import"./User01-D_PtC3-l.js";import"./Users03-CttOOkYC.js";import"./SearchLg-C01PHEsZ.js";import"./Stars02-OU17b3lp.js";import"./XClose-DiX97P-p.js";import"./CheckCircle-BJO_ypFA.js";import"./CpuChip01-CWKZNd3u.js";import"./FilterLines-Bu45YNI1.js";import"./Monitor01-C38MaP2T.js";import"./required-auth-layout-DF3apjeH.js";import"./use-org-sso-DoxFiQxq.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./XCircle-CMWuzD62.js";import"./ZapSquare-CGho5JH5.js";import"./Star01-CBnujI48.js";import"./Upload01-lDNoA7DY.js";import"./AlertCircle-CjFbPbXR.js";import"./form-DApAFFn0.js";import"./label-DtVKw0n-.js";import"./select-Tei14Zu4.js";import"./ArrowLeft-Dkou2oyv.js";import"./tabs-C2pF4tHl.js";import"./Tool02-BLLppoSv.js";import"./toggle-group-GAcLozzv.js";import"./use-commerce-diagnostic-BVElM2RV.js";import"./sidebar-fE9arcNR.js";import"./LayoutLeft-D5nGLk_M.js";import"./popover-vEPjwNUl.js";import"./self-tool-result-C9rWuUA9.js";import"./alert-dialog-C3fO6FiW.js";import"./integration-icon-BtDBTwbu.js";import"./extract-connection-data-DVi4pwNP.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./use-debounced-value-CGQ1MygG.js";import"./LinkExternal01-BZfOUq-Q.js";import"./authenticate-and-persist-oauth-BL5kxXPR.js";import"./mcp-oauth-DmlNibJW.js";import"./track-poPKLD9c.js";import"./toolbar-CPIussBe.js";import"./skeleton-WByIIjEz.js";import"./github-repo-picker-qhvXBKMo.js";import"./use-connection-CHvN0FBa.js";import"./Share07-B2hvI558.js";import"./use-mcp-tools-CGdKn1Fw.js";import"./use-navigate-to-agent-zvAVYd41.js";import"./reusable-new-chat-CouMjkYR.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-BHS6Mbjr.js";import"./use-registry-connections-CDunPWB9.js";import"./useInfiniteQuery-BcVwIHfG.js";import"./use-infinite-scroll-N2WGSfb_.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-Zz2koMwO.js";import"./textarea-kmGQrCWT.js";import"./connection-form-helpers-DsdyG005.js";import"./collection-tabs-Tu083PIR.js";import"./badge-BKlfRcKL.js";import"./useSuspenseInfiniteQuery-B_UTR4fd.js";import"./command-DI3FhUnx.js";import"./index-CuujNnv4.js";import"./use-clock-tick-DQJlJSeJ.js";import"./DotsVertical-D-83qNJa.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-open-billing-url-ptr76Hlr.js";import"./select-model-DotYsAqj.js";import"./checkbox-DpwUgoY2.js";import"./Key01-CNX_ptat.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-DhCcFHe0.js";import"./ArrowUpRight-BP30hDff.js";import"./Stars01-DqNq041Y.js";import"./cards-DZhyxsHe.js";import"./Palette-Borxdy0n.js";import"./file-type-icon-BaDll1C-.js";import"./question-004-sINsf4GQ.js";import"./use-members-BEOwJloH.js";import"./use-org-auth-client-BmiUk9g-.js";import"./use-status-sounds-BmimvYmS.js";import"./empty-state-CQKPJKx2.js";import"./types-Ctr4Pq-Y.js";import"./use-capability-Bq8QIaAm.js";import"./use-file-configs-BeAzNpwF.js";import"./monaco-editor-Bx-WJoCd.js";import"./pt-BR-CLy76QW2.js";import"./switch-HDj1d-W_.js";import"./Play-DtbV3l2x.js";import"./use-debounced-autosave-C2C9GPgR.js";import"./index-DeD3quSS.js";import"./search-input-DyFy1iK0.js";import"./index-BCveq62k.js";import"./Users01-RLx4pV7z.js";import"./use-secrets-Bb1WW8u5.js";import"./AreaChart-CF11UEYw.js";import"./use-copy-BKbIPHzw.js";import"./SwitchHorizontal01-6N0f6IEs.js";import"./use-tags-C0yWU0xy.js";import"./get-initials-D-f_fDFw.js";import"./use-automations-l3Ox7fHF.js";import"./automation-list-row-BZ2cPPd8.js";import"./CreditCard01-BgStC_qv.js";import"./Globe04-BBpMsdiG.js";import"./HardDrive-DCp-WUl5.js";import"./LogOut01-j4YaKBaR.js";import"./Sun-yZz6cey6.js";import"./Shield01-DQ1xPJLH.js";import"./table-BqUdzLQw.js";function ar(m){return m.schema?.definitions??m.schema?.$defs??{}}function ks(m,e){const a=ar(e),c=a[btoa(m)];if(!c)return[];const d=[c];if(Array.isArray(c.allOf)){const h=c.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof h=="string"){const b=a[h.replace("#/definitions/","")];b&&d.push(b)}}return d}function rr(m,e){for(const a of ks(m,e)){const c=typeof a.image=="string"?a.image:void 0;if(c?.includes("{{{"))return c}}function ir(m,e){if(!e)return;const a=es(m);if(!a)return;const c=rr(a.resolveType,e);if(!c)return;const d=Fo(c,a.data);if(d)return Io(d)}const lr={escape:$o};function cr(m,e){for(const a of ks(m,e)){const c=typeof a.title=="string"?a.title:void 0;if(c?.includes("{{"))return c}}function ur(m,e){if(!e)return;const a=es(m);if(a)try{const c=cr(a.resolveType,e);return c&&Oo.render(c,a.data,{},lr).trim()||void 0}catch{return}}const dr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",mr="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 Un(m){return Array.from({length:m},(e,a)=>({id:crypto.randomUUID(),index:a}))}function Ts(m){return m.map((e,a)=>({...e,index:a}))}function fr(m,e){if(e===m.length)return m;if(e<m.length)return Ts(m.slice(0,e));const a=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...a]}function Ns(m){const e=Ge.c(25),{section:a,raw:c,meta:d}=m,h=a.isSavedBlock===!0,b=a.isMultivariate===!0;let g;e[0]!==d||e[1]!==c?(g=c&&d?ir(c,d):void 0,e[0]=d,e[1]=c,e[2]=g):g=e[2];const v=g;let f;e[3]!==d||e[4]!==b||e[5]!==c||e[6]!==h?(f=c&&d&&!h&&!b?ur(c,d):void 0,e[3]=d,e[4]=b,e[5]=c,e[6]=h,e[7]=f):f=e[7];const E=f;let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Da,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=N):N=e[8];let V;e[9]!==v?(V=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=v,e[10]=V):V=e[10];let j;e[11]!==b||e[12]!==h?(j=h?{color:qo}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=b,e[12]=h,e[13]=j):j=e[13];let l;e[14]!==j?(l=n.jsx(hn,{className:"h-4 w-4 shrink-0",style:j}),e[14]=j,e[15]=l):l=e[15];const x=a.isHidden&&"line-through opacity-50";let r;e[16]!==x?(r=$e("min-w-0 flex-1 truncate text-sm font-medium",x),e[16]=x,e[17]=r):r=e[17];const D=E??a.label;let i;e[18]!==r||e[19]!==D?(i=n.jsx("span",{className:r,children:D}),e[18]=r,e[19]=D,e[20]=i):i=e[20];let R;return e[21]!==i||e[22]!==V||e[23]!==l?(R=n.jsxs(n.Fragment,{children:[N,V,l,i]}),e[21]=i,e[22]=V,e[23]=l,e[24]=R):R=e[24],R}const pr="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",gr="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]",hr="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";function gn(m,e){return $e("h-7 shrink-0 overflow-hidden",e?pr:m?hr:gr)}function Vs(m,e){const a=m.isSavedBlock===!0,c=m.isMultivariate===!0;return $e("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":a?dr:c?cs:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function vr(m){const e=Ge.c(82),{section:a,raw:c,meta:d,sortableId:h,selected:b,onSelect:g,onDelete:v,onDuplicate:f,onMakeReusable:E,onToggleHidden:N,onToggleLazy:V,onAddVariant:j,onDetach:l}=m,x=ct(),r=c?rs(c.__resolveType??""):!1,D=a.isHidden===!0,i=r||D;let R;e[0]!==a?(R=zo(a),e[0]=a,e[1]=R):R=e[1];const M=R;let I;e[2]!==h?(I={id:h,animateLayoutChanges:_r},e[2]=h,e[3]=I):I=e[3];const{attributes:H,listeners:p,setNodeRef:B,transform:pe,isDragging:L}=is(I);let le;e[4]!==pe?(le=ls.Transform.toString(pe?{...pe,x:0}:null),e[4]=pe,e[5]=le):le=e[5];const P=L?0:void 0;let te;e[6]!==le||e[7]!==P?(te={transform:le,opacity:P},e[6]=le,e[7]=P,e[8]=te):te=e[8];const O=te;let oe;e[9]!==a?(oe=Ho(a),e[9]=a,e[10]=oe):oe=e[10];const De=oe,xe="button",Q=0;let X;e[11]!==g?(X=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),g())},e[11]=g,e[12]=X):X=e[12];const ge=L?"cursor-grabbing":"cursor-pointer";let ne;e[13]!==a||e[14]!==b||e[15]!==ge?(ne=$e("touch-none transition-colors",ge,Vs(a,b)),e[13]=a,e[14]=b,e[15]=ge,e[16]=ne):ne=e[16];let K;e[17]!==d||e[18]!==c||e[19]!==a?(K=n.jsx(Ns,{section:a,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=a,e[20]=K):K=e[20];const ze=!a.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":x(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:$e(gn(i,r)),onClick:T=>{T.stopPropagation(),V()},onPointerDown:yr,children:n.jsx(qa,{className:$e("h-3.5 w-3.5",r&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:x(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),nt=!a.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":x(D?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:$e(gn(i,D)),onClick:T=>{T.stopPropagation(),N()},onPointerDown:xr,children:D?n.jsx(Ha,{className:"h-3.5 w-3.5"}):n.jsx(Ua,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:x(D?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),Ke=Rs,Me=Es,W=!0,Z=Xe,Fe="button",Pe="ghost",ye="icon";let ce;e[21]!==x?(ce=x("sectionsEditor.sectionList.sectionActionsMenu"),e[21]=x,e[22]=ce):ce=e[22];const he=$e(gn(i,!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[23]===Symbol.for("react.memo_cache_sentinel")?(_e=n.jsx(bs,{className:"h-3.5 w-3.5"}),e[23]=_e):_e=e[23];let we;e[24]!==Z||e[25]!==ce||e[26]!==he?(we=n.jsx(Z,{type:Fe,variant:Pe,size:ye,"aria-label":ce,className:he,onClick:Sr,onPointerDown:br,children:_e}),e[24]=Z,e[25]=ce,e[26]=he,e[27]=we):we=e[27];let ve;e[28]!==Me||e[29]!==we?(ve=n.jsx(Me,{asChild:W,children:we}),e[28]=Me,e[29]=we,e[30]=ve):ve=e[30];let ae;e[31]!==f?(ae=T=>{T.stopPropagation(),f()},e[31]=f,e[32]=ae):ae=e[32];let Ce;e[33]===Symbol.for("react.memo_cache_sentinel")?(Ce=n.jsx(ys,{className:"h-4 w-4"}),e[33]=Ce):Ce=e[33];let je;e[34]!==x?(je=x("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=x,e[35]=je):je=e[35];let me;e[36]!==ae||e[37]!==je?(me=n.jsxs(vt,{onClick:ae,children:[Ce,je]}),e[36]=ae,e[37]=je,e[38]=me):me=e[38];let $;e[39]!==M||e[40]!==j||e[41]!==x?($=M&&n.jsxs(vt,{className:Uo,onClick:T=>{T.stopPropagation(),j()},children:[n.jsx(_s,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=M,e[40]=j,e[41]=x,e[42]=$):$=e[42];let fe;e[43]!==De||e[44]!==E||e[45]!==x?(fe=De&&n.jsxs(vt,{className:mr,onClick:T=>{T.stopPropagation(),E()},children:[n.jsx(hn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=De,e[44]=E,e[45]=x,e[46]=fe):fe=e[46];let Ae;e[47]!==l||e[48]!==a.isMultivariate||e[49]!==a.isSavedBlock||e[50]!==x?(Ae=a.isSavedBlock===!0&&!a.isMultivariate&&n.jsxs(vt,{onClick:T=>{T.stopPropagation(),l()},children:[n.jsx(hn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=l,e[48]=a.isMultivariate,e[49]=a.isSavedBlock,e[50]=x,e[51]=Ae):Ae=e[51];let be;e[52]!==v?(be=T=>{T.stopPropagation(),v()},e[52]=v,e[53]=be):be=e[53];let ke;e[54]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(js,{className:"h-4 w-4"}),e[54]=ke):ke=e[54];let se;e[55]!==x?(se=x("sectionsEditor.sectionList.deleteMenuItem"),e[55]=x,e[56]=se):se=e[56];let ie;e[57]!==be||e[58]!==se?(ie=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:be,children:[ke,se]}),e[57]=be,e[58]=se,e[59]=ie):ie=e[59];let ue;e[60]!==me||e[61]!==$||e[62]!==fe||e[63]!==Ae||e[64]!==ie?(ue=n.jsxs(ws,{align:"end",className:"w-44",children:[me,$,fe,Ae,ie]}),e[60]=me,e[61]=$,e[62]=fe,e[63]=Ae,e[64]=ie,e[65]=ue):ue=e[65];let Ee;e[66]!==Ke||e[67]!==ve||e[68]!==ue?(Ee=n.jsxs(Ke,{children:[ve,ue]}),e[66]=Ke,e[67]=ve,e[68]=ue,e[69]=Ee):Ee=e[69];let de;return e[70]!==H||e[71]!==p||e[72]!==g||e[73]!==B||e[74]!==O||e[75]!==ne||e[76]!==K||e[77]!==ze||e[78]!==nt||e[79]!==Ee||e[80]!==X?(de=n.jsxs("div",{ref:B,style:O,...H,...p,role:xe,tabIndex:Q,onClick:g,onKeyDown:X,className:ne,children:[K,ze,nt,Ee]}),e[70]=H,e[71]=p,e[72]=g,e[73]=B,e[74]=O,e[75]=ne,e[76]=K,e[77]=ze,e[78]=nt,e[79]=Ee,e[80]=X,e[81]=de):de=e[81],de}function br(m){return m.stopPropagation()}function Sr(m){return m.stopPropagation()}function xr(m){return m.stopPropagation()}function yr(m){return m.stopPropagation()}function _r(){return!1}function jr(m){const e=Ge.c(104),{listKey:a,rawSections:c,sections:d,meta:h,selectedIndex:b,onSelect:g,onReorder:v,onDelete:f,onDuplicate:E,onMakeReusable:N,onToggleHidden:V,onToggleLazy:j,onAddVariant:l,onDetach:x,onAddSection:r,canAddSection:D}=m,i=D===void 0?!0:D,R=ct();let M;e[0]!==d.length?(M=()=>Un(d.length),e[0]=d.length,e[1]=M):M=e[1];const[I,H]=w.useState(M),[p,B]=w.useState(null),[pe,L]=w.useState(a),[le,P]=w.useState(d.length),te=w.useRef(!1);pe!==a?(L(a),P(d.length),H(Un(d.length))):le!==d.length&&(P(d.length),H(de=>fr(de,d.length)));let O;e[2]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},e[2]=O):O=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:us},e[3]=oe):oe=e[3];const De=ts(Qt(as,O),Qt(os,oe));let xe;e[4]!==I?(xe=I.map(Er),e[4]=I,e[5]=xe):xe=e[5];const Q=xe;let X;e[6]===Symbol.for("react.memo_cache_sentinel")?(X=de=>{B(String(de.active.id))},e[6]=X):X=e[6];const ge=X;let ne;e[7]!==Q||e[8]!==v?(ne=de=>{B(null);const{active:T,over:re}=de;if(!re||T.id===re.id)return;const F=Q.indexOf(String(T.id)),Be=Q.indexOf(String(re.id));F===-1||Be===-1||(H(ut=>Ts(Mt([...ut],F,Be))),te.current=!0,requestAnimationFrame(()=>{te.current=!1}),v?.(F,Be))},e[7]=Q,e[8]=v,e[9]=ne):ne=e[9];const K=ne;let ze;e[10]===Symbol.for("react.memo_cache_sentinel")?(ze=()=>{B(null)},e[10]=ze):ze=e[10];const nt=ze;let Ke,Me,W,Z,Fe,Pe,ye,ce,he,_e,we,ve,ae,Ce,je;if(e[11]!==p||e[12]!==i||e[13]!==I||e[14]!==Q||e[15]!==K||e[16]!==h||e[17]!==r||e[18]!==l||e[19]!==f||e[20]!==x||e[21]!==E||e[22]!==N||e[23]!==g||e[24]!==V||e[25]!==j||e[26]!==c||e[27]!==d||e[28]!==b||e[29]!==De||e[30]!==R){Ce=Symbol.for("react.early_return_sentinel");e:{const de=T=>{te.current||g(T)};if(e[46]!==p||e[47]!==i||e[48]!==I||e[49]!==r||e[50]!==c||e[51]!==d||e[52]!==R){const T=p?I.find(re=>re.id===p):null;if(Z=T!=null?d[T.index]:null,W=T!=null?c[T.index]:void 0,I.length===0){let re;e[56]!==R?(re=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=re):re=e[57];let F;e[58]!==re?(F=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:re}),e[58]=re,e[59]=F):F=e[59];const Be=!i;let ut;e[60]===Symbol.for("react.memo_cache_sentinel")?(ut=n.jsx(vn,{size:14}),e[60]=ut):ut=e[60];let Te;e[61]!==R?(Te=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=Te):Te=e[62];let We;e[63]!==r||e[64]!==Be||e[65]!==Te?(We=n.jsxs(Xe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Be,onClick:r,children:[ut,Te]}),e[63]=r,e[64]=Be,e[65]=Te,e[66]=We):We=e[66];let Ie;e[67]!==F||e[68]!==We?(Ie=n.jsxs("div",{className:"space-y-2",children:[F,We]}),e[67]=F,e[68]=We,e[69]=Ie):Ie=e[69],Ce=Ie;break e}ae=$e(T&&"cursor-grabbing"),e[46]=p,e[47]=i,e[48]=I,e[49]=r,e[50]=c,e[51]=d,e[52]=R,e[53]=W,e[54]=Z,e[55]=ae}else W=e[53],Z=e[54],ae=e[55];Me=ds,ce=De,he=ms,_e=ge,we=K,ve=nt,Ke=fs,Pe=Q,ye=ps,je="space-y-1",Fe=I.map(T=>{const re=d[T.index];return re?n.jsx(vr,{sortableId:T.id,section:re,raw:c[T.index],meta:h,selected:b===T.index,onSelect:()=>de(T.index),onDelete:()=>f(T.index),onDuplicate:()=>E(T.index),onMakeReusable:()=>N(T.index),onToggleHidden:()=>V(T.index),onToggleLazy:()=>j(T.index),onAddVariant:()=>l(T.index),onDetach:()=>x(T.index)},T.id):null})}e[11]=p,e[12]=i,e[13]=I,e[14]=Q,e[15]=K,e[16]=h,e[17]=r,e[18]=l,e[19]=f,e[20]=x,e[21]=E,e[22]=N,e[23]=g,e[24]=V,e[25]=j,e[26]=c,e[27]=d,e[28]=b,e[29]=De,e[30]=R,e[31]=Ke,e[32]=Me,e[33]=W,e[34]=Z,e[35]=Fe,e[36]=Pe,e[37]=ye,e[38]=ce,e[39]=he,e[40]=_e,e[41]=we,e[42]=ve,e[43]=ae,e[44]=Ce,e[45]=je}else Ke=e[31],Me=e[32],W=e[33],Z=e[34],Fe=e[35],Pe=e[36],ye=e[37],ce=e[38],he=e[39],_e=e[40],we=e[41],ve=e[42],ae=e[43],Ce=e[44],je=e[45];if(Ce!==Symbol.for("react.early_return_sentinel"))return Ce;let me;e[70]!==Fe||e[71]!==je?(me=n.jsx("div",{className:je,children:Fe}),e[70]=Fe,e[71]=je,e[72]=me):me=e[72];let $;e[73]!==Ke||e[74]!==Pe||e[75]!==ye||e[76]!==me?($=n.jsx(Ke,{items:Pe,strategy:ye,children:me}),e[73]=Ke,e[74]=Pe,e[75]=ye,e[76]=me,e[77]=$):$=e[77];let fe;e[78]!==W||e[79]!==Z||e[80]!==h?(fe=Z?n.jsx("div",{className:$e("cursor-grabbing shadow-lg ring-1 ring-border/60",Vs(Z,!1)),children:n.jsx(Ns,{section:Z,raw:W,meta:h})}):null,e[78]=W,e[79]=Z,e[80]=h,e[81]=fe):fe=e[81];let Ae;e[82]!==fe?(Ae=Xn.createPortal(n.jsx(ns,{dropAnimation:ss,children:fe}),document.body),e[82]=fe,e[83]=Ae):Ae=e[83];let be;e[84]!==Me||e[85]!==ce||e[86]!==he||e[87]!==_e||e[88]!==we||e[89]!==ve||e[90]!==$||e[91]!==Ae?(be=n.jsxs(Me,{sensors:ce,collisionDetection:he,onDragStart:_e,onDragEnd:we,onDragCancel:ve,children:[$,Ae]}),e[84]=Me,e[85]=ce,e[86]=he,e[87]=_e,e[88]=we,e[89]=ve,e[90]=$,e[91]=Ae,e[92]=be):be=e[92];const ke=!i;let se;e[93]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(vn,{size:14}),e[93]=se):se=e[93];let ie;e[94]!==R?(ie=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=ie):ie=e[95];let ue;e[96]!==r||e[97]!==ke||e[98]!==ie?(ue=n.jsxs(Xe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:ke,onClick:r,children:[se,ie]}),e[96]=r,e[97]=ke,e[98]=ie,e[99]=ue):ue=e[99];let Ee;return e[100]!==ae||e[101]!==be||e[102]!==ue?(Ee=n.jsxs("div",{className:ae,children:[be,ue]}),e[100]=ae,e[101]=be,e[102]=ue,e[103]=Ee):Ee=e[103],Ee}function Er(m){return m.id}function qn(m){const e=Ge.c(57),{open:a,initialName:c,autoLabel:d,isPending:h,onSubmit:b,onOpenChange:g}=m,v=h===void 0?!1:h,f=ct(),[E,N]=w.useState(c),[V,j]=w.useState(a);a!==V&&(j(a),a&&N(c));let l;e[0]!==v||e[1]!==g?(l=ge=>{!ge&&!v&&g(!1)},e[0]=v,e[1]=g,e[2]=l):l=e[2];const x=l;let r;e[3]!==v||e[4]!==E||e[5]!==b?(r=async ge=>{ge.preventDefault(),!v&&await b(E.trim())},e[3]=v,e[4]=E,e[5]=b,e[6]=r):r=e[6];const D=r;let i;e[7]!==f?(i=f("sectionsEditor.variantRenameDialog.title"),e[7]=f,e[8]=i):i=e[8];let R;e[9]!==i?(R=n.jsx(La,{children:i}),e[9]=i,e[10]=R):R=e[10];let M;e[11]!==d||e[12]!==f?(M=f("sectionsEditor.variantRenameDialog.description",{fallback:d||f("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=d,e[12]=f,e[13]=M):M=e[13];let I;e[14]!==M?(I=n.jsx(Ka,{children:M}),e[14]=M,e[15]=I):I=e[15];let H;e[16]!==R||e[17]!==I?(H=n.jsxs(Fa,{children:[R,I]}),e[16]=R,e[17]=I,e[18]=H):H=e[18];let p;e[19]!==f?(p=f("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=f,e[20]=p):p=e[20];let B;e[21]!==p?(B=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:p}),e[21]=p,e[22]=B):B=e[22];let pe;e[23]===Symbol.for("react.memo_cache_sentinel")?(pe=ge=>N(ge.target.value),e[23]=pe):pe=e[23];let L;e[24]!==d||e[25]!==v||e[26]!==E?(L=n.jsx(za,{id:"variant-rename-name",value:E,onChange:pe,placeholder:d,autoFocus:!0,disabled:v}),e[24]=d,e[25]=v,e[26]=E,e[27]=L):L=e[27];let le;e[28]!==B||e[29]!==L?(le=n.jsxs("div",{className:"space-y-1.5 py-4",children:[B,L]}),e[28]=B,e[29]=L,e[30]=le):le=e[30];let P;e[31]!==g?(P=()=>g(!1),e[31]=g,e[32]=P):P=e[32];let te;e[33]!==f?(te=f("sectionsEditor.variantRenameDialog.cancel"),e[33]=f,e[34]=te):te=e[34];let O;e[35]!==v||e[36]!==P||e[37]!==te?(O=n.jsx(Xe,{type:"button",variant:"outline",onClick:P,disabled:v,children:te}),e[35]=v,e[36]=P,e[37]=te,e[38]=O):O=e[38];let oe;e[39]!==v||e[40]!==f?(oe=v?n.jsxs(n.Fragment,{children:[n.jsx(Zn,{size:14,className:"animate-spin"}),f("sectionsEditor.variantRenameDialog.saving")]}):f("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=f,e[41]=oe):oe=e[41];let De;e[42]!==v||e[43]!==oe?(De=n.jsx(Xe,{type:"submit",disabled:v,children:oe}),e[42]=v,e[43]=oe,e[44]=De):De=e[44];let xe;e[45]!==O||e[46]!==De?(xe=n.jsxs(Ia,{children:[O,De]}),e[45]=O,e[46]=De,e[47]=xe):xe=e[47];let Q;e[48]!==D||e[49]!==le||e[50]!==xe||e[51]!==H?(Q=n.jsx(Oa,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:D,children:[H,le,xe]})}),e[48]=D,e[49]=le,e[50]=xe,e[51]=H,e[52]=Q):Q=e[52];let X;return e[53]!==x||e[54]!==a||e[55]!==Q?(X=n.jsx($a,{open:a,onOpenChange:x,children:Q}),e[53]=x,e[54]=a,e[55]=Q,e[56]=X):X=e[56],X}function Ds(m){const e=Ge.c(5),{rule:a,matchers:c}=m,d=a?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const f=c.find(E=>E.resolveType===d)?.iconName??Go(d);h=Pa(f),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const b=h;if(!b)return null;let g;return e[3]!==b?(g=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=g):g=e[4],g}function Gn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
- `)}function Wn(m){return m.map((e,a)=>({id:crypto.randomUUID(),index:a,variant:e}))}function Rr(m,e){const a=new Map;for(const c of m){const d=a.get(c.variant.label);d?d.push(c):a.set(c.variant.label,[c])}return e.map((c,d)=>({id:a.get(c.label)?.shift()?.id??crypto.randomUUID(),index:d,variant:c}))}function wr(m){return m.map((e,a)=>({...e,index:a}))}function Ps(m){const e=Ge.c(17),{label:a,effectiveRule:c,matchers:d,canDelete:h,dragging:b,onRename:g,onDuplicate:v,onDelete:f}=m,E=ct();let N;e[0]!==c||e[1]!==d?(N=n.jsx(Ds,{rule:c,matchers:d}),e[0]=c,e[1]=d,e[2]=N):N=e[2];let V;e[3]!==a?(V=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:a}),e[3]=a,e[4]=V):V=e[4];let j;e[5]!==h||e[6]!==b||e[7]!==a||e[8]!==f||e[9]!==v||e[10]!==g||e[11]!==E?(j=!b&&n.jsxs(Rs,{children:[n.jsx(Es,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":E("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:a}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Tr,onPointerDown:kr,children:n.jsx(bs,{size:14})})}),n.jsxs(ws,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:x=>{x.stopPropagation(),g?.()},children:[n.jsx(nr,{size:14}),E("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:x=>{x.stopPropagation(),v?.()},children:[n.jsx(ys,{size:14}),E("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Ga,{}),n.jsxs(vt,{variant:"destructive",disabled:!h,onClick:x=>{x.stopPropagation(),f?.()},children:[n.jsx(js,{size:14}),E("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=h,e[6]=b,e[7]=a,e[8]=f,e[9]=v,e[10]=g,e[11]=E,e[12]=j):j=e[12];let l;return e[13]!==N||e[14]!==V||e[15]!==j?(l=n.jsxs(n.Fragment,{children:[N,V,j]}),e[13]=N,e[14]=V,e[15]=j,e[16]=l):l=e[16],l}function kr(m){return m.stopPropagation()}function Tr(m){return m.stopPropagation()}function Nr(m){const e=Ge.c(33),{entry:a,isActive:c,canDelete:d,decofile:h,meta:b,matchers:g,onSelect:v,onRename:f,onDuplicate:E,onDelete:N}=m;let V;e[0]!==a.id?(V={id:a.id,animateLayoutChanges:Vr},e[0]=a.id,e[1]=V):V=e[1];const{attributes:j,listeners:l,setNodeRef:x,transform:r,isDragging:D}=is(V);let i;e[2]!==r?(i=ls.Transform.toString(r?{...r,x:0}:null),e[2]=r,e[3]=i):i=e[3];const R=D?0:void 0;let M;e[4]!==i||e[5]!==R?(M={transform:i,opacity:R},e[4]=i,e[5]=R,e[6]=M):M=e[6];const I=M,H=b??void 0;let p;e[7]!==h||e[8]!==a.variant.rule||e[9]!==H?(p=Bt(a.variant.rule,h,H),e[7]=h,e[8]=a.variant.rule,e[9]=H,e[10]=p):p=e[10];const B=p;let pe;e[11]!==v?(pe=oe=>{oe.target===oe.currentTarget&&(oe.key==="Enter"||oe.key===" ")&&(oe.preventDefault(),v())},e[11]=v,e[12]=pe):pe=e[12];const L=D?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",le=c?gs:cs;let P;e[13]!==L||e[14]!==le?(P=$e("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",L,le),e[13]=L,e[14]=le,e[15]=P):P=e[15];let te;e[16]!==d||e[17]!==B||e[18]!==a.variant.label||e[19]!==g||e[20]!==N||e[21]!==E||e[22]!==f?(te=n.jsx(Ps,{label:a.variant.label,effectiveRule:B,matchers:g,canDelete:d,onRename:f,onDuplicate:E,onDelete:N}),e[16]=d,e[17]=B,e[18]=a.variant.label,e[19]=g,e[20]=N,e[21]=E,e[22]=f,e[23]=te):te=e[23];let O;return e[24]!==j||e[25]!==l||e[26]!==v||e[27]!==x||e[28]!==I||e[29]!==P||e[30]!==te||e[31]!==pe?(O=n.jsx("div",{ref:x,style:I,...j,...l,onClick:v,onKeyDown:pe,className:P,children:te}),e[24]=j,e[25]=l,e[26]=v,e[27]=x,e[28]=I,e[29]=P,e[30]=te,e[31]=pe,e[32]=O):O=e[32],O}function Vr(){return!1}function Dr(m){const e=Ge.c(9),{variant:a,decofile:c,meta:d,matchers:h}=m,b=d??void 0;let g;e[0]!==c||e[1]!==b||e[2]!==a.rule?(g=Bt(a.rule,c,b),e[0]=c,e[1]=b,e[2]=a.rule,e[3]=g):g=e[3];const v=g;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=$e("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",gs),e[4]=f):f=e[4];let E;return e[5]!==v||e[6]!==h||e[7]!==a.label?(E=n.jsx("div",{className:f,children:n.jsx(Ps,{label:a.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=a.label,e[8]=E):E=e[8],E}function Pr(m){const e=Ge.c(91),{listKey:a,variants:c,activeIndex:d,decofile:h,meta:b,matchers:g,onSelect:v,onReorder:f,onRename:E,onDuplicate:N,onDelete:V,onAdd:j}=m,l=ct();let x;e[0]!==c?(x=()=>Wn(c),e[0]=c,e[1]=x):x=e[1];const[r,D]=w.useState(x),[i,R]=w.useState(null),[M,I]=w.useState(a),[H,p]=w.useState(c.length);let B;e[2]!==c?(B=()=>Gn(c),e[2]=c,e[3]=B):B=e[3];const[pe,L]=w.useState(B),le=w.useRef(!1),P=Gn(c);M!==a?(I(a),p(c.length),L(P),D(Wn(c))):(H!==c.length||pe!==P)&&(p(c.length),L(P),D(be=>Rr(be,c)));let te;e[4]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[4]=te):te=e[4];let O;e[5]===Symbol.for("react.memo_cache_sentinel")?(O={coordinateGetter:us},e[5]=O):O=e[5];const oe=ts(Qt(as,te),Qt(os,O));let De;e[6]!==r?(De=r.map(Cr),e[6]=r,e[7]=De):De=e[7];const xe=De,Q=c.length>1;let X;e[8]!==r?(X=be=>{const ke=String(be.active.id);R(r.find(se=>se.id===ke)??null)},e[8]=r,e[9]=X):X=e[9];const ge=X;let ne;e[10]!==xe||e[11]!==f?(ne=be=>{R(null);const{active:ke,over:se}=be;if(!se||ke.id===se.id)return;const ie=xe.indexOf(String(ke.id)),ue=xe.indexOf(String(se.id));ie===-1||ue===-1||(D(Ee=>wr(Mt([...Ee],ie,ue))),le.current=!0,requestAnimationFrame(()=>{le.current=!1}),f(ie,ue))},e[10]=xe,e[11]=f,e[12]=ne):ne=e[12];const K=ne;let ze;e[13]===Symbol.for("react.memo_cache_sentinel")?(ze=()=>{R(null)},e[13]=ze):ze=e[13];const nt=ze;let Ke,Me,W,Z,Fe,Pe,ye,ce,he,_e,we,ve,ae;if(e[14]!==d||e[15]!==Q||e[16]!==h||e[17]!==r||e[18]!==xe||e[19]!==K||e[20]!==ge||e[21]!==g||e[22]!==b||e[23]!==j||e[24]!==V||e[25]!==N||e[26]!==E||e[27]!==v||e[28]!==oe||e[29]!==l){const be=F=>{le.current||v(F)};we="space-y-1 border-b p-2";let ke;e[43]!==l?(ke=l("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=l,e[44]=ke):ke=e[44];let se;e[45]!==ke?(se=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:ke}),e[45]=ke,e[46]=se):se=e[46];let ie;e[47]!==l?(ie=l("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=l,e[48]=ie):ie=e[48];let ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(vn,{size:14}),e[49]=ue):ue=e[49];let Ee;e[50]!==j||e[51]!==ie?(Ee=n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":ie,className:"size-6",onClick:j,children:ue})}),e[50]=j,e[51]=ie,e[52]=Ee):Ee=e[52];let de;e[53]!==l?(de=l("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=l,e[54]=de):de=e[54];let T;e[55]!==de?(T=n.jsx(jt,{children:de}),e[55]=de,e[56]=T):T=e[56];let re;e[57]!==Ee||e[58]!==T?(re=n.jsxs(yt,{children:[Ee,T]}),e[57]=Ee,e[58]=T,e[59]=re):re=e[59],e[60]!==se||e[61]!==re?(ve=n.jsxs("div",{className:"flex items-center justify-between",children:[se,re]}),e[60]=se,e[61]=re,e[62]=ve):ve=e[62],Me=ds,Pe=oe,ye=ms,ce=ge,he=K,_e=nt,Ke=fs,Z=xe,Fe=ps,ae="space-y-0.5",W=r.map(F=>n.jsx(Nr,{entry:F,isActive:F.index===d,canDelete:Q,decofile:h,meta:b,matchers:g,onSelect:()=>be(F.index),onRename:()=>E(F.index),onDuplicate:()=>N(F.index),onDelete:()=>V(F.index)},F.id)),e[14]=d,e[15]=Q,e[16]=h,e[17]=r,e[18]=xe,e[19]=K,e[20]=ge,e[21]=g,e[22]=b,e[23]=j,e[24]=V,e[25]=N,e[26]=E,e[27]=v,e[28]=oe,e[29]=l,e[30]=Ke,e[31]=Me,e[32]=W,e[33]=Z,e[34]=Fe,e[35]=Pe,e[36]=ye,e[37]=ce,e[38]=he,e[39]=_e,e[40]=we,e[41]=ve,e[42]=ae}else Ke=e[30],Me=e[31],W=e[32],Z=e[33],Fe=e[34],Pe=e[35],ye=e[36],ce=e[37],he=e[38],_e=e[39],we=e[40],ve=e[41],ae=e[42];let Ce;e[63]!==W||e[64]!==ae?(Ce=n.jsx("div",{className:ae,children:W}),e[63]=W,e[64]=ae,e[65]=Ce):Ce=e[65];let je;e[66]!==Ke||e[67]!==Z||e[68]!==Fe||e[69]!==Ce?(je=n.jsx(Ke,{items:Z,strategy:Fe,children:Ce}),e[66]=Ke,e[67]=Z,e[68]=Fe,e[69]=Ce,e[70]=je):je=e[70];let me;e[71]!==i||e[72]!==h||e[73]!==g||e[74]!==b?(me=i?n.jsx(Dr,{variant:i.variant,decofile:h,meta:b,matchers:g}):null,e[71]=i,e[72]=h,e[73]=g,e[74]=b,e[75]=me):me=e[75];let $;e[76]!==me?($=Xn.createPortal(n.jsx(ns,{dropAnimation:ss,children:me}),document.body),e[76]=me,e[77]=$):$=e[77];let fe;e[78]!==Me||e[79]!==Pe||e[80]!==ye||e[81]!==ce||e[82]!==he||e[83]!==_e||e[84]!==je||e[85]!==$?(fe=n.jsxs(Me,{sensors:Pe,collisionDetection:ye,onDragStart:ce,onDragEnd:he,onDragCancel:_e,children:[je,$]}),e[78]=Me,e[79]=Pe,e[80]=ye,e[81]=ce,e[82]=he,e[83]=_e,e[84]=je,e[85]=$,e[86]=fe):fe=e[86];let Ae;return e[87]!==we||e[88]!==ve||e[89]!==fe?(Ae=n.jsxs("div",{className:we,children:[ve,fe]}),e[87]=we,e[88]=ve,e[89]=fe,e[90]=Ae):Ae=e[90],Ae}function Cr(m){return m.id}function Ar(m){const e=Ge.c(16),{schema:a,value:c,onChange:d,meta:h,decofile:b,onSaveReferencedBlock:g,sandbox:v}=m,f=ct();let E;e[0]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[0]=E):E=e[0];const[N,V]=w.useState(E);let j;e[1]!==N||e[2]!==f?(j=N.length>0&&n.jsxs("nav",{"aria-label":f("sectionsEditor.sectionsEditorPanels.variantRuleBreadcrumb"),className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>V([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:f("sectionsEditor.sectionsEditorPanels.backToRule"),children:n.jsx(Ss,{className:"size-3.5"})}),N.map((r,D)=>{const i=D===N.length-1,R=vs(r);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[D>0&&n.jsx(xs,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>V(N.slice(0,D+1)),title:R,className:$e("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",i?"font-medium text-foreground":"text-muted-foreground"),children:R})]},`${R}-${D}`)})]}),e[1]=N,e[2]=f,e[3]=j):j=e[3];let l;e[4]!==N||e[5]!==b||e[6]!==h||e[7]!==d||e[8]!==g||e[9]!==v||e[10]!==a||e[11]!==c?(l=n.jsx(hs,{schema:a,value:c,onChange:d,basePath:"",breadcrumbPath:N,onBreadcrumbChange:V,meta:h,decofile:b,onSaveReferencedBlock:g,sandbox:v}),e[4]=N,e[5]=b,e[6]=h,e[7]=d,e[8]=g,e[9]=v,e[10]=a,e[11]=c,e[12]=l):l=e[12];let x;return e[13]!==j||e[14]!==l?(x=n.jsxs("div",{className:"space-y-2",children:[j,l]}),e[13]=j,e[14]=l,e[15]=x):x=e[15],x}function Yn(m){const e=Ge.c(23),{activeSchema:a,formValue:c,formResetKey:d,onFormChange:h,onBreadcrumbChange:b,breadcrumbPath:g,emptyMessage:v,beforeForm:f,seoResolveType:E,siteDefaultSeo:N,meta:V,decofile:j,onSaveReferencedBlock:l,sandbox:x,previewBaseUrl:r,onRequestAddSection:D}=m;let i;e[0]!==g?(i=g===void 0?[]:g,e[0]=g,e[1]=i):i=e[1];const R=i;let M;e[2]!==a||e[3]!==R||e[4]!==j||e[5]!==d||e[6]!==c||e[7]!==V||e[8]!==b||e[9]!==h||e[10]!==D||e[11]!==l||e[12]!==r||e[13]!==x||e[14]!==E||e[15]!==N?(M=a&&c?E?n.jsx(Wa,{schema:a,resolveType:E,value:c,formResetKey:d,onChange:h,onBreadcrumbChange:b,siteDefaultSeo:N}):n.jsx(hs,{schema:a,value:c,onChange:h,basePath:"",breadcrumbPath:R,onBreadcrumbChange:b,meta:V,decofile:j,onSaveReferencedBlock:l,sandbox:x,previewBaseUrl:r,onRequestAddSection:D},d):null,e[2]=a,e[3]=R,e[4]=j,e[5]=d,e[6]=c,e[7]=V,e[8]=b,e[9]=h,e[10]=D,e[11]=l,e[12]=r,e[13]=x,e[14]=E,e[15]=N,e[16]=M):M=e[16];const I=M;let H;e[17]!==v||e[18]!==I?(H=I??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[17]=v,e[18]=I,e[19]=H):H=e[19];let p;return e[20]!==f||e[21]!==H?(p=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[f,H]})}),e[20]=f,e[21]=H,e[22]=p):p=e[22],p}const Mr="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function Br(m,e){return Wo(m,e,lt)}function Lr(m){const e=Ge.c(19),{pageKey:a,initialName:c,initialPath:d,onFieldChange:h}=m,b=ct(),[g,v]=w.useState(c),[f,E]=w.useState(d),[N,V]=w.useState(a);N!==a&&(V(a),v(c),E(d));let j;e[0]!==h?(j=M=>{v(M.target.value),h("name",M.target.value)},e[0]=h,e[1]=j):j=e[1];let l;e[2]!==b?(l=b("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=b,e[3]=l):l=e[3];let x;e[4]!==g||e[5]!==j||e[6]!==l?(x=n.jsx("input",{type:"text",value:g,onChange:j,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:l}),e[4]=g,e[5]=j,e[6]=l,e[7]=x):x=e[7];let r;e[8]!==h?(r=M=>{E(M.target.value),h("path",M.target.value)},e[8]=h,e[9]=r):r=e[9];let D;e[10]!==b?(D=b("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=b,e[11]=D):D=e[11];let i;e[12]!==f||e[13]!==r||e[14]!==D?(i=n.jsx("input",{type:"text",value:f,onChange:r,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:D}),e[12]=f,e[13]=r,e[14]=D,e[15]=i):i=e[15];let R;return e[16]!==x||e[17]!==i?(R=n.jsxs("div",{className:"space-y-1",children:[x,i]}),e[16]=x,e[17]=i,e[18]=R):R=e[18],R}function Jn(m){const e=Ge.c(13),{onClick:a}=m,c=ct();let d;e[0]!==c?(d=c("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=c,e[1]=d):d=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(_s,{size:14}),e[2]=h):h=e[2];let b;e[3]!==a||e[4]!==d?(b=n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":d,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:a,children:h})}),e[3]=a,e[4]=d,e[5]=b):b=e[5];let g;e[6]!==c?(g=c("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=c,e[7]=g):g=e[7];let v;e[8]!==g?(v=n.jsx(jt,{side:"bottom",children:g}),e[8]=g,e[9]=v):v=e[9];let f;return e[10]!==b||e[11]!==v?(f=n.jsxs(yt,{children:[b,v]}),e[10]=b,e[11]=v,e[12]=f):f=e[12],f}function Qn(m){const e=Ge.c(21),{currentRt:a,currentLabel:c,currentGlobalKey:d,matchers:h,globals:b,onSelect:g,onSelectGlobal:v,schema:f,formValue:E,onChange:N,formKey:V,formWrapperClassName:j,meta:l,decofile:x,onSaveReferencedBlock:r,sandbox:D}=m;let i;e[0]!==d||e[1]!==c||e[2]!==a||e[3]!==b||e[4]!==h||e[5]!==g||e[6]!==v?(i=n.jsx(Yo,{currentRt:a,currentLabel:c,currentGlobalKey:d,matchers:h,globals:b,onSelect:g,onSelectGlobal:v}),e[0]=d,e[1]=c,e[2]=a,e[3]=b,e[4]=h,e[5]=g,e[6]=v,e[7]=i):i=e[7];let R;e[8]!==x||e[9]!==V||e[10]!==E||e[11]!==j||e[12]!==l||e[13]!==N||e[14]!==r||e[15]!==D||e[16]!==f?(R=f&&E&&n.jsx("div",{className:j,children:n.jsx(Ar,{schema:f,value:E,onChange:N,meta:l,decofile:x,onSaveReferencedBlock:r,sandbox:D},V)}),e[8]=x,e[9]=V,e[10]=E,e[11]=j,e[12]=l,e[13]=N,e[14]=r,e[15]=D,e[16]=f,e[17]=R):R=e[17];let M;return e[18]!==i||e[19]!==R?(M=n.jsxs(n.Fragment,{children:[i,R]}),e[18]=i,e[19]=R,e[20]=M):M=e[20],M}function Cc({orgSlug:m,virtualMcpId:e,branch:a,previewReady:c=!0,previewUrl:d,currentPath:h,activePageBlockKey:b=null,activeGlobalBlockKey:g=null,externalSelection:v,onSaved:f,initialEditSeo:E=!1,onExitSeo:N,onViewJsonFile:V,onVariantPreviewOverride:j}){const l=ct(),x=c?{orgSlug:m,virtualMcpId:e,branch:a,previewUrl:d}:null,{data:r,isLoading:D}=Jo(x),{data:i,isLoading:R}=Qo(x),M=Xo(),I=M?.entity?.id===e?M.entity.metadata?.siteSlug??null:null,H=sr({virtualMcpId:e,sandboxUrl:d}),[p,B]=w.useState(null),[pe,L]=w.useState(null),[le,P]=w.useState(null),[te,O]=w.useState(0),[oe,De]=w.useState(void 0),[xe,Q]=w.useState(null),[X,ge]=w.useState(null),[ne,K]=w.useState([]),ze=w.useRef(null),[nt,Ke]=w.useState(ne.length);nt!==ne.length&&(Ke(ne.length),requestAnimationFrame(()=>{ze.current&&(ze.current.scrollTop=0)}));const[Me,W]=w.useState(0),[Z,Fe]=w.useState(null),[Pe,ye]=w.useState(null),[ce,he]=w.useState(null),[_e,we]=w.useState(!0),[ve,ae]=w.useState(!1),[Ce,je]=w.useState(!1),me=w.useRef(null),[$,fe]=w.useState(E),[Ae,be]=w.useState(E);E&&!Ae&&(be(!0),fe(!0),B(null),L(null),P(null),K([])),!E&&Ae&&be(!1);const[ke,se]=w.useState(null),[ie,ue]=w.useState(void 0),[Ee,de]=w.useState([]),[T,re]=w.useState(0),[F,Be]=w.useState(0),[ut,Te]=w.useState(null),[We,Ie]=w.useState(null),[bn,Sn]=w.useState(null),Cs=Lo(),As=`${m}/${e}/${a}`,Xt=Zo({orgSlug:m,virtualMcpId:e,branch:a}),[Ms,Bs]=w.useState(h),[Ls,Ks]=w.useState(b),[Fs,Is]=w.useState(g);(Ms!==h||Ls!==b||Fs!==g)&&(queueMicrotask(()=>Xt.flush()),Bs(h),Ks(b),Is(g),B(null),L(null),P(null),O(0),Q(null),ge(null),Be(0),Te(null),Ie(null),K([]),W(t=>t+1),fe(!1),se(null),ue(void 0),de([]),re(t=>t+1));const Ne=ea({orgSlug:m,virtualMcpId:e,branch:a}),Lt=Sa((t,s)=>{Ne.mutate({blockKey:t,data:s},{onSuccess:()=>f?.(),onError:o=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})}),Zt=ta({orgSlug:m,virtualMcpId:e,branch:a}),[Nt,Kt]=w.useState(!1),He=w.useRef(null),st=w.useRef(null),ot=w.useRef(null),en=w.useRef({}),Ze=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||D||R)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Zn,{size:20,className:"animate-spin text-muted-foreground"})});if(!r||!i)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:l("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Os=na(r),Ve=!!g,Ye=Ve?null:sa(Os,h,b),k=Ve?g:Ye?.key??null,tn=Ve&&g?r[g]:void 0,xn=Ve&&g&&tn?oa(g,tn):Ve&&g?g:"",Ft=!Ve&&k&&r[k]?r[k]:null,nn=$&&r&&i&&k&&Ye?Hn(r,{kind:"page",pageKey:k,pageName:String(Ye.name??""),path:String(Ye.path??"")},i):null,$s=$?Ft?.seo:void 0,sn=ie!==void 0?ie:$s,zs=$?Ya(sn):void 0,Hs=nn?.seoTypeOptions??[],Us=$&&i?Ja(i):"",yn=ke??zs??{},on=$&&nn?Qa(yn,nn):null,qs=$&&on&&Xa(sn)?qt(on,i):null,Gs=$?Za(r,i)?.seoData:void 0,qe=Ve?[{label:"Default",sections:[{__resolveType:g}]}]:Br(Ft?.sections,r??{}),It=qe.length>1,Oe=Math.min(te,qe.length-1),dt=qe[Oe],q=dt?.sections??[],Ue=Gt(q,r),_n=!Ve&&aa(Ft?.sections);if(Ve&&g&&bn!==g){Sn(g);const t=q[0],s=Ue[0];if(t&&s){B(0),Be(0),K([]);const o=St(t,s,r);o&&(L(o.data),P(o.resolveType),Ie(null),Te(null))}}!Ve&&bn!==null&&Sn(null),Ze.current={rawSections:q,parsedSections:Ue,decofile:r??{},activePageKey:k,pageVariants:qe,variantIndex:Oe,sectionVariantIndex:F,selectedSectionIndex:p};const Ws=()=>({multivariate:_n,index:Oe,variants:qe.map(t=>({rule:t.rule}))}),jn=(t,s)=>{if(!j)return;if(!k||!_n||t.length<=1){j(null);return}const o=zn(k,{multivariate:!0,index:s,variants:t},r,i);j(o.length>0?o:null)},Et=(t,s,o)=>{if(!j)return;if(!k){j(null);return}const u=Ws(),S=zn(k,u,r,i);if(!t||s<0){j(S.length>0?S:null);return}const _=Ea({pageKey:k,page:u,sectionIndex:s,sectionLazy:Ue[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:o,decofile:r,meta:i}),y=[...S,..._];j(y.length>0?y:null)},mt=(t,s,o,u=p??-1,S=!1)=>{const _=tt(t,s);if(!_){L(null),P(null),Ie(null),Te(null),S&&Et(null,u,o);return}const C=Ln(_,lt)[o];if(!C){L(null),P(null),Ie(null),Te(null),S&&Et(null,u,o);return}const ee=da(C.value,r);L(ee?.data??null),P(ee?.resolveType??null);const{resolveType:A,formValue:z}=Pt(C.rule,r,i??void 0);Ie(A),Te(z),S&&Et(_,u,o)},Vt=v?.index;if(v!==void 0&&(v?.seq??null)!==oe&&(De(v?.seq??null),typeof Vt=="number")){const t=q[Vt],s=Ue[Vt];if(t&&s)if(B(Vt),Be(0),K([]),W(o=>o+1),s.isMultivariate)mt(t,s,0,Vt);else{const o=St(t,s,r);o?(L(o.data),P(o.resolveType)):(L(null),P(null)),Ie(null),Te(null)}}const Ot={orgSlug:m,virtualMcpId:e,branch:a,previewUrl:d??void 0,siteSlug:I},an=le&&i?qt(le,i):null,Je=(t,s)=>{if(!k)return;He.current&&(clearTimeout(He.current),He.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),st.current&&(clearTimeout(st.current),st.current=null);const o=At(r,k,t,Oe,qe);Ne.mutate({blockKey:k,data:o},{onSuccess:()=>s?.onSuccess?.()??f?.(),onError:u=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:u.message}))})},Rt=()=>{B(null),L(null),P(null),Be(0),Te(null),Ie(null),K([]),W(t=>t+1)},Ys=(t,s)=>{He.current&&clearTimeout(He.current);const o=Ze.current.sectionVariantIndex;He.current=setTimeout(()=>{const{rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:C,variantIndex:ee}=Ze.current,A=u[s];if(!A)return;const z=S[s];if(!z)return;if(z.isSavedBlock){const G=z.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;Ne.mutate({blockKey:G,data:t},{onSuccess:()=>f?.(),onError:Y=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}if(!y)return;const U={..._[y]},Re=[...u];if(z.isMultivariate){const G=tt(A,z);if(!G||!y)return;const Y=wa(G,o,t);Re[s]=xt(A,z,Y)}else if(z.isHidden){const G=rs(A.__resolveType),Y=G?{...A.section}:{...A},Le=Array.isArray(Y.variants)?[...Y.variants]:[];Le[0]&&(Le[0]={...Le[0],value:t}),Y.variants=Le,G?Re[s]={...A,section:Y}:Re[s]=Y}else z.isLazy?Re[s]={...A,section:t}:Re[s]=t;if(C.length>1){const G=U.sections,Y=[...G?.variants??[]];Y[ee]&&(Y[ee]={...Y[ee],value:Re}),U.sections={...G,variants:Y}}else U.sections=Re;Ne.mutate({blockKey:y,data:U},{onSuccess:()=>f?.(),onError:G=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))})},pn)},Js=t=>{B(t),Be(0),K([]),W(S=>S+1);const s=q[t],o=Ue[t];if(!s||!o)return;if(o.isMultivariate){mt(s,o,0,t);return}const u=St(s,o,r);if(!u){L(null),P(null),Ie(null),Te(null),Et(null,t,0);return}L(u.data),P(u.resolveType),Ie(null),Te(null),Et(null,t,0)},En=t=>{const s=t;L(s),p!==null&&Ys(s,p)},rn=t=>{if(!k||!r||!i||!Ye)return;const s={kind:"page",pageKey:k,pageName:String(Ye.name??""),path:String(Ye.path??"")},o=Hn(r,s,i);o&&Xt.save(k,()=>{const u=Cs.getQueryData(Ko.decofile(As))?.[k];if(!u||typeof u!="object"||u===null||Array.isArray(u))return null;const S={...u,...en.current};return en.current={},t?.raw!==void 0?{...S,seo:t.raw}:t?.inner!==void 0?tr(s,o,S,t.inner):S})},Qs=(t,s)=>{k&&(en.current[t]=s,rn())},Xs=(t,s)=>{if(!k)return;const o=Mt([...q],t,s);p!==null&&(p===t?B(s):t<p&&s>=p?B(p-1):t>p&&s<=p&&B(p+1)),Je(o)},Zs=t=>{if(!k)return;const s=q.filter((o,u)=>u!==t);p===t?Rt():p!==null&&p>t&&B(p-1),Je(s)},eo=t=>{if(!k)return;const s=q[t];if(!s)return;const o=[...q];o.splice(t+1,0,ja(s)),p!==null&&p>t&&B(p+1),Je(o)},to=t=>{if(!k)return;const s=q[t],o=Ue[t];if(!s||!o||o.isMultivariate)return;const u=o.isHidden?ya(s):_a(s);if(!u)return;const S=[...q];S[t]=u,p===t&&Rt(),Je(S)},no=t=>{if(!k)return;const s=q[t],o=Ue[t];if(!s||!o||o.isMultivariate)return;const u=xa(s);if(!u)return;const S=[...q];S[t]=u,p===t&&Rt(),Je(S)},so=t=>{if(!k)return;const s=q[t],o=Ue[t];if(!s||!o?.isSavedBlock)return;const u=St(s,o,r);if(!u?.data)return;const{name:S,..._}=u.data,y=[...q];o.isLazy?y[t]={...s,section:_}:y[t]=_,p===t&&Rt(),Je(y)},oo=t=>{if(!k)return;const s=[...q,{__resolveType:t.resolveType}],o=s.length-1;Je(s,{onSuccess:()=>{ae(!1),B(o),Be(0),K([]),W(y=>y+1);const u=s[o],S=Gt(s,r)[o];if(!u||!S)return;if(S.isMultivariate){mt(u,S,0);return}const _=St(u,S,r);if(!_){L(null),P(null),Ie(null),Te(null);return}L(_.data),P(_.resolveType),Ie(null),Te(null)}})},Rn=t=>{me.current=t.append,ae(!0)},ao=t=>{const s=me.current;if(!s){oo(t);return}s({__resolveType:t.resolveType}),ae(!1),me.current=null},ro=t=>{if(p===null)return;const s=q[p],o=Ue[p];!s||!o?.isMultivariate||(Be(t),K([]),W(u=>u+1),mt(s,o,t,p,!0))},io=t=>{if(p===null||!k)return;const s=q[p],o=Ue[p];if(!s||!o?.isMultivariate)return;const u=tt(s,o);if(!u)return;const S=va(u,t);if(!S){J.error(l("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const _=[...q];_[p]=xt(s,o,S);const y=S.variants;let C=F;t===F?C=Math.min(t,y.length-1):t<F&&(C=F-1),Be(C),K([]),W(ee=>ee+1),mt(_[p],o,C),Je(_)},lo=t=>{if(p===null||!k)return;const s=q[p],o=Ue[p];if(!s||!o?.isMultivariate)return;const u=tt(s,o);if(!u)return;const S=ba(u,t),_=[...q];_[p]=xt(s,o,S);const y=t+1;Be(y),K([]),W(C=>C+1),mt(_[p],o,y),Je(_)},co=(t,s)=>{if(p===null||!k||t===s)return;const o=q[p],u=Ue[p];if(!o||!u?.isMultivariate)return;const S=tt(o,u);if(!S)return;const _=ga(S,t,s),y=[...q];y[p]=xt(o,u,_);let C=F;F===t?C=s:t<F&&s>=F?C=F-1:t>F&&s<=F&&(C=F+1),Be(C),mt(y[p],u,C),Je(y)},ln=t=>{const s=t??p;if(s===null||!k)return;const o=q[s],u=Ue[s];if(!o||!u)return;const S=ma(o,u);if(!S){J.error(l("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const _=[...q];_[s]=S.section;const y=Gt(_,r)[s];if(!y?.isMultivariate){J.error(l("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}B(s),Be(S.newVariantIndex),K([]),W(C=>C+1),mt(S.section,y,S.newVariantIndex,s),Je(_)},uo=()=>{if(p===null||!k)return;const t=q[p],s=Ue[p];if(!t||!s?.isMultivariate)return;const o=tt(t,s);if(!o)return;const u=ha(t,s,o);if(!u){J.error(l("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const S=[...q];S[p]=u;const _=Gt(S,r)[p];if(!_)return;Be(0),Ie(null),Te(null),K([]),W(C=>C+1);const y=St(u,_,r);y?(L(y.data),P(y.resolveType)):(L(null),P(null)),Et(null,p,0),Je(S)},mo=async t=>{if(Z===null||!k)return;const s=fn(t,r);if(s){J.error(s);return}const o=q[Z],u=Ue[Z];if(!o||!u)return;const S=St(o,u,r);if(!S){J.error(l("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const _={...S.data,name:t};try{await Ne.mutateAsync({blockKey:t,data:_});const y=[...q];y[Z]={__resolveType:t},await Ne.mutateAsync({blockKey:k,data:At(r,k,y,Oe,qe)}),p===Z&&Rt(),Fe(null),J.success(l("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),f?.()}catch(y){J.error(y instanceof Error?y.message:l("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},wn=dt?.rule;if(It&&p===null&&X===null&&wn){const{resolveType:t,formValue:s}=Pt(wn,r??{},i??void 0);ge(t),Q(s)}const $t=i?ra(i):[],kn=i&&r?ia(i,r):[],fo=!Ve&&!!(H&&i&&r),po=X&&i?qt(X,i):null,wt=()=>{st.current&&(clearTimeout(st.current),st.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Dt=async(t,s)=>{if(!(Ra(s,t,i)>0))try{await Zt.mutateAsync({blockKey:t})}catch(o){J.error(o instanceof Error?o.message:l("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Tn=t=>{st.current&&clearTimeout(st.current),st.current=setTimeout(()=>{const{activePageKey:s,decofile:o,variantIndex:u}=Ze.current;if(!s)return;const S={...o[s]},_={...S.sections},y=[..._.variants??[]],C=y[u],ee=C?.rule;if(kt(ee,o,i)){const A=ee?.__resolveType??"",z=o[A],U=typeof z?.name=="string"?z.name:A,{__resolveType:Re,...G}=t;Ne.mutate({blockKey:A,data:Tt(Re??"",G,U)},{onSuccess:()=>f?.(),onError:Y=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}C&&(y[u]={...C,rule:t}),S.sections={..._,variants:y},Ne.mutate({blockKey:s,data:S},{onSuccess:()=>f?.(),onError:A=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:A.message}))})},pn)},go=t=>{ge(t);const s=t?Fn(t,i):{__resolveType:In};Q(t?s:{}),Tn(s)},ho=t=>{const s=t;Q(s);const o=X?{__resolveType:X,...s}:{...s};Tn(o)},vo=async t=>{wt();const{activePageKey:s,decofile:o,variantIndex:u}=Ze.current;if(!s)return;const S=o[s],_=S?.sections;if(!_||typeof _!="object"||Array.isArray(_))return;const y=_;if(!Array.isArray(y.variants))return;const C=[...y.variants],ee=C[u];if(!ee)return;const A=Ct(ee.rule,o,i),z=Yt(t);C[u]={...ee,rule:z};const U={...o,[s]:{...S,sections:{...y,variants:C}}},{resolveType:Re,formValue:G}=Pt(z,U,i??void 0);ge(Re),Q(G);try{await Ne.mutateAsync({blockKey:s,data:U[s]}),A&&A!==t&&await Dt(A,U),f?.()}catch(Y){J.error(Y instanceof Error?Y.message:l("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Nn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:o}=Ze.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:C,variantIndex:ee}=Ze.current;if(!y)return;const A=u[s],z=S[s];if(!A||!z?.isMultivariate)return;const U=tt(A,z);if(!U)return;const G=(U.variants??[])[o]?.rule;if(kt(G,_,i)){const Se=G?.__resolveType??"",Qe=_[Se],rt=typeof Qe?.name=="string"?Qe.name:Se,{__resolveType:gt,...it}=t;Ne.mutate({blockKey:Se,data:Tt(gt??"",it,rt)},{onSuccess:()=>f?.(),onError:ht=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:ht.message}))});return}const Y=Kn(U,o,t),Le=[...u];Le[s]=xt(A,z,Y);const et=At(_,y,Le,ee,C);Ne.mutate({blockKey:y,data:et},{onSuccess:()=>f?.(),onError:Se=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:Se.message}))})},pn))},bo=t=>{Ie(t);const s=t?Fn(t,i):{__resolveType:In};Te(t?s:{}),Nn(s)},So=t=>{const s=t;Te(s);const o=We?{__resolveType:We,...s}:{...s};Nn(o)},xo=async t=>{wt();const{selectedSectionIndex:s,sectionVariantIndex:o,rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:C,variantIndex:ee}=Ze.current;if(s===null||!y)return;const A=u[s],z=S[s];if(!A||!z?.isMultivariate)return;const U=tt(A,z);if(!U)return;const Re=U.variants??[],G=Ct(Re[o]?.rule,_,i),Y=Yt(t),Le=Kn(U,o,Y),et=[...u];et[s]=xt(A,z,Le);const Se=At(_,y,et,ee,C),Qe={..._,[y]:Se},{resolveType:rt,formValue:gt}=Pt(Y,Qe,i??void 0);Ie(rt),Te(gt);try{await Ne.mutateAsync({blockKey:y,data:Se}),G&&G!==t&&await Dt(G,Qe),f?.()}catch(it){J.error(it instanceof Error?it.message:l("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ve&&!Ye)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:l("sectionsEditor.sectionsEditor.noPageFound",{currentPath:h})});if(Ve&&!tn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:l("sectionsEditor.sectionsEditor.globalBlockNotFound")});const ft=p!==null?Ue[p]??null:null,Vn=p!==null?q[p]:null,Dn=Vn&&ft?.isMultivariate?tt(Vn,ft):null,bt=Dn?Ln(Dn,lt):[],cn=Math.min(F,Math.max(bt.length-1,0)),zt=bt[cn]??null,pt=ft?.isMultivariate===!0,Pn=p!==null&&ft!==null,Ht=Pn&&(pt||!!(an&&pe)),yo=Ht&&!Ve&&ft?.isSavedBlock===!0,at=Ve||yo,_o=Ve?xn:ft?.label??"",jo=We&&i?qt(We,i):null,un=Ht&&(!Ve||ne.length>0)?Ve?[xn,...ne]:[Ye.name,ft.label,...pt&&zt?[zt.label]:[],...ne]:[],Eo=$&&Ye?[Ye.name,"SEO",...Ee]:[],Ut=$?Eo:at?un.length>0?un:[_o]:un,Ro=!$&&!Ve&&pt&&ne.length===0,Cn=()=>{if(!k)return;wt(),He.current&&(clearTimeout(He.current),He.current=null);const t=r[k],s=fa(t.sections,q);if(!s)return;const o=pa(s);Ne.mutate({blockKey:k,data:{...t,sections:s}},{onSuccess:()=>{O(o),B(null),L(null),P(null),K([]),Q(null),ge(null)},onError:u=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:u.message}))})},dn=(t,s,o)=>{if(!k)return;wt(),He.current&&(clearTimeout(He.current),He.current=null);const u=r[k],S=u.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const _=S;if(!Array.isArray(_.variants))return;const y=t([..._.variants]);if(!y)return;const C=ka(_,y),ee={...r,[k]:{...u,sections:C}};Ne.mutate({blockKey:k,data:ee[k]},{onSuccess:()=>{s?.(),o&&Dt(o,ee)},onError:A=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:A.message}))})},wo=t=>{ye(null),O(t),B(null),L(null),P(null),K([]);const s=qe[t]?.rule,{resolveType:o,formValue:u}=Pt(s,r??{},i??void 0);ge(o),Q(u),jn(qe.map(S=>({rule:S.rule})),t)},ko=(t,s)=>{if(t===s)return;let o=Oe;Oe===t?o=s:t<Oe&&s>=Oe?o=Oe-1:t>Oe&&s<=Oe&&(o=Oe+1),O(o);const u=Mt(qe.map(S=>({rule:S.rule})),t,s);jn(u,o),dn(S=>Mt(S,t,s))},To=t=>{const s=qe[t]?.rule,o=Ct(s,r??{},i??void 0);dn(u=>u.length<=1?null:(u.splice(t,1),u),()=>{qe.length-1===1?O(0):t<Oe?O(Oe-1):t===Oe&&O(Math.max(0,t-1)),B(null),L(null),P(null),K([]),Q(null),ge(null)},o)},No=t=>{dn(s=>Ta(s,t),()=>{O(t+1),B(null),L(null),P(null),K([]),Q(null),ge(null)})},Vo=async(t,s)=>{wt(),He.current&&(clearTimeout(He.current),He.current=null);const o=Ze.current.activePageKey,u=Ze.current.decofile;if(!o)return;const S=u[o],_=S.sections;if(!_||typeof _!="object"||Array.isArray(_))return;const y=_;if(!Array.isArray(y.variants))return;const C=[...y.variants],ee=C[t];if(!ee?.rule||typeof ee.rule!="object"){J.error(l("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const A=ee.rule,z=s.trim();Kt(!0);try{if(!z){if(!kt(A,u,i)){ye(null);return}const et=A.__resolveType??"";C[t]={...ee,rule:On(A,u,i)};const Se={...u,[o]:{...S,sections:{...y,variants:C}}};await Ne.mutateAsync({blockKey:o,data:Se[o]}),await Dt(et,Se),ye(null),f?.();return}const U=$n(A,u,i);if(!U){J.error(l("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(U.blockKey){await Ne.mutateAsync({blockKey:U.blockKey,data:Tt(U.resolveType,U.data,z)}),ye(null),f?.();return}const Re=mn(z),G=fn(Re,u);if(G){J.error(G);return}const Y=Tt(U.resolveType,U.data,z);let Le=null;try{await Ne.mutateAsync({blockKey:Re,data:Y}),Le=Re,C[t]={...ee,rule:Yt(Re)},await Ne.mutateAsync({blockKey:o,data:{...S,sections:{...y,variants:C}}}),Le=null}catch(et){throw Le&&await Zt.mutateAsync({blockKey:Le}).catch(()=>{}),et}ye(null),J.success(l("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:z})),f?.()}catch(U){J.error(U instanceof Error?U.message:l("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}},Do=async(t,s)=>{wt(),He.current&&(clearTimeout(He.current),He.current=null);const{selectedSectionIndex:o,rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:C,variantIndex:ee}=Ze.current;if(o===null||!y)return;const A=u[o],z=S[o];if(!A||!z?.isMultivariate)return;const U=tt(A,z);if(!U)return;const Re=U.variants??[],G=Re[t];if(!G?.rule||typeof G.rule!="object"){J.error(l("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Y=G.rule,Le=s.trim();Kt(!0);const et=async Se=>{const Qe={...U,variants:Se},rt=[...u];rt[o]=xt(A,z,Qe);const gt=At(_,y,rt,ee,C);return await Ne.mutateAsync({blockKey:y,data:gt}),{..._,[y]:gt}};try{if(!Le){if(!kt(Y,_,i)){he(null);return}const ht=Y.__resolveType??"",Bn=[...Re];Bn[t]={...G,rule:On(Y,_,i)};const Bo=await et(Bn);await Dt(ht,Bo),he(null),f?.();return}const Se=$n(Y,_,i);if(!Se){J.error(l("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Se.blockKey){await Ne.mutateAsync({blockKey:Se.blockKey,data:Tt(Se.resolveType,Se.data,Le)}),he(null),f?.();return}const Qe=mn(Le),rt=fn(Qe,_);if(rt){J.error(rt);return}const gt=Tt(Se.resolveType,Se.data,Le);let it=null;try{await Ne.mutateAsync({blockKey:Qe,data:gt}),it=Qe;const ht=[...Re];ht[t]={...G,rule:Yt(Qe)},await et(ht),it=null}catch(ht){throw it&&await Zt.mutateAsync({blockKey:it}).catch(()=>{}),ht}he(null),J.success(l("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Le})),f?.()}catch(Se){J.error(Se instanceof Error?Se.message:l("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}},An=()=>{Rt()},Po=t=>{se(t),rn({inner:t})},Co=t=>{ue(t),rn({raw:t})},Ao=()=>{se(null),de([])},Mo=()=>re(t=>t+1),Mn=t=>{if($){if(t===0){Xt.flush(),fe(!1),se(null),ue(void 0),de([]),re(o=>o+1),N?.();return}if(t===1){de([]),re(o=>o+1);return}de(Ee.slice(0,t-1)),re(o=>o+1);return}if(Ve){K(ne.slice(0,t)),W(o=>o+1);return}if(t===0){An();return}if(t===1){K([]),W(o=>o+1);return}if(pt&&t===2){K([]),W(o=>o+1);return}const s=pt?2:1;K(ne.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:at||Ht||$?n.jsxs("div",{className:$e("border-b px-3 py-2.5",at&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[Ut.length>1&&n.jsx("button",{type:"button",onClick:()=>Mn(Na(Ut.length,{isMultivariateSectionTop:Ro})),title:l("sectionsEditor.sectionsEditor.back"),"aria-label":l("sectionsEditor.sectionsEditor.back"),className:$e("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",at?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(Ss,{className:"size-4"})}),!Ve&&It&&dt&&n.jsxs("button",{type:"button",onClick:An,title:l("sectionsEditor.sectionsEditor.editingInVariant",{variant:dt.label}),className:$e("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Mr),children:[n.jsx(Ds,{rule:Bt(dt.rule,r??{},i??void 0),matchers:$t}),n.jsx("span",{className:"max-w-[160px] truncate",children:dt.label})]}),n.jsx("nav",{"aria-label":l("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Ut.map((t,s)=>{const o=s===Ut.length-1,u=vs(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(xs,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Mn(s),title:u,className:$e("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",o?at?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":at?"text-foreground/80":"text-muted-foreground",at?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:u})]},`${u}-${s}`)})}),at&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Ba,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(jt,{side:"bottom",className:"max-w-[260px]",children:l("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Pn&&!pt&&!ft?.isHidden&&k&&n.jsx(Jn,{onClick:()=>ln()})]}),at&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:l("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(Lr,{pageKey:k,initialName:Ye.name,initialPath:Ye.path,onFieldChange:Qs})}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":l("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>fe(!0),children:n.jsx(Ca,{size:14})})}),n.jsx(jt,{side:"bottom",children:l("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":l("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>V&&k?V(k):je(!0),children:n.jsx(Aa,{size:14})})}),n.jsx(jt,{side:"bottom",children:l("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Jn,{onClick:Cn})]})}),$?n.jsx(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ft&&k?n.jsx(er,{rawSeo:sn,innerSeo:yn,defaultResolveType:Us,seoSchema:qs,activeResolveType:on,seoTypeOptions:Hs,formResetKey:T,siteDefaultSeo:Gs,onBreadcrumbChange:de,onPersistRaw:Co,onInnerChange:Po,onClearForm:Ao,onBumpFormKey:Mo}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Ht?n.jsxs(Jt,{viewportRef:ze,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[pt&&bt.length>0&&ne.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(la,{listKey:`${k??""}:${p??""}`,variants:bt.map((t,s)=>({index:s,label:t.label})),selectedIndex:cn,onSelect:ro,onRename:he,onDuplicate:lo,onDelete:io,onRemoveAll:uo,onReorder:co,onAdd:()=>ln()}),pt&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Qn,{currentRt:We??"",currentLabel:Wt(zt?.rule,r??{},lt,i??void 0),currentGlobalKey:Ct(zt?.rule,r??{},i??void 0)??void 0,matchers:$t,globals:kn,onSelect:bo,onSelectGlobal:xo,schema:jo,formValue:ut,onChange:So,formKey:`${p??"none"}:${cn}:${We??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:r,onSaveReferencedBlock:Lt,sandbox:Ot})]})]}),n.jsx(Yn,{activeSchema:an,formValue:pe,formResetKey:Me,onFormChange:En,onBreadcrumbChange:K,breadcrumbPath:ne,emptyMessage:l("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:i,decofile:r,onSaveReferencedBlock:Lt,sandbox:Ot,previewBaseUrl:H,onRequestAddSection:Rn})]},"editor-section-form"):Ve?n.jsx(Jt,{viewportRef:ze,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Yn,{activeSchema:an,formValue:pe,formResetKey:Me,onFormChange:En,onBreadcrumbChange:K,breadcrumbPath:ne,emptyMessage:l("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:i,decofile:r,onSaveReferencedBlock:Lt,sandbox:Ot,previewBaseUrl:H,onRequestAddSection:Rn})},"editor-global-block"):n.jsxs(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[It&&k&&n.jsx(Pr,{listKey:k,variants:qe,activeIndex:Oe,decofile:r??{},meta:i,matchers:$t,onSelect:wo,onReorder:ko,onRename:ye,onDuplicate:No,onDelete:To,onAdd:Cn}),It&&X!==null&&n.jsxs("div",{className:$e("px-3 border-b",_e?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>we(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":_e,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.sectionsEditor.variantRule")}),_e?n.jsx(Ma,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Va,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),_e&&n.jsx("div",{className:$e("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(Qn,{currentRt:X,currentLabel:Wt(dt?.rule,r??{},lt,i??void 0),currentGlobalKey:Ct(dt?.rule,r??{},i??void 0)??void 0,matchers:$t,globals:kn,onSelect:go,onSelectGlobal:vo,schema:po,formValue:xe,onChange:ho,formKey:`${Oe}:${X??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:r,onSaveReferencedBlock:Lt,sandbox:Ot})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(jr,{listKey:`${k??""}-${Oe}`,rawSections:q,sections:Ue,meta:i,selectedIndex:p,onSelect:Js,onReorder:Xs,onDelete:Zs,onDuplicate:eo,onMakeReusable:Fe,onToggleHidden:to,onToggleLazy:no,onAddVariant:ln,onDetach:so,onAddSection:()=>ae(!0),canAddSection:fo})})]},"editor-section-list"),n.jsx(ca,{open:Z!==null,onOpenChange:t=>{t||Fe(null)},defaultBlockId:Z!==null?mn(Ue[Z]?.label??""):"",isPending:Ne.isPending,onSubmit:mo}),H&&n.jsx(or,{open:ve,onOpenChange:t=>{ae(t),t||(me.current=null)},meta:i,decofile:r,previewBaseUrl:H,onSelect:ao}),Ce&&k&&r&&n.jsx(ua,{open:Ce,onOpenChange:je,pageKey:k,decofile:r}),Pe!==null&&n.jsx(qn,{open:!0,initialName:kt(qe[Pe]?.rule,r??{},i??void 0)?Wt(qe[Pe]?.rule,r??{},lt,i??void 0):"",autoLabel:lt(Bt(qe[Pe]?.rule,r??{},i??void 0)),isPending:Nt,onSubmit:async t=>{await Vo(Pe,t)},onOpenChange:t=>{!t&&!Nt&&ye(null)}}),ce!==null&&n.jsx(qn,{open:!0,initialName:kt(bt[ce]?.rule,r??{},i??void 0)?Wt(bt[ce]?.rule,r??{},lt,i??void 0):"",autoLabel:lt(Bt(bt[ce]?.rule,r??{},i??void 0)),isPending:Nt,onSubmit:async t=>{await Do(ce,t)},onOpenChange:t=>{!t&&!Nt&&he(null)}})]})}export{Cc as SectionsEditor};
1
+ import{c as Ge,b as ct,r as w,m as $e,j as n,ac as Xn,B as Xe,k as Zn,o as Lo,t as J,K as Ko}from"./index-dh0u4IqP.js";import{aq as es,ar as Fo,as as Io,at as Oo,au as $o,a5 as ts,a6 as Qt,av as ns,aw as ss,a7 as os,a8 as as,ax as rs,ay as zo,af as is,ag as ls,az as Ho,aA as Uo,aB as cs,O as qo,a9 as us,aa as Mt,ad as ds,ae as ms,ab as fs,al as ps,aC as Go,aD as Bt,aE as gs,aF as Wo,S as hs,aG as lt,G as vs,aH as Yo,aI as Jo,aJ as Qo,aK as Xo,D as Zo,F as ea,aL as ta,aM as na,aN as sa,aO as oa,aj as qt,aP as Gt,aQ as aa,aR as St,aS as Pt,aT as ra,aU as ia,aV as tt,aW as Ln,aX as la,aY as Ct,aZ as Wt,a_ as ca,a$ as mn,b0 as ua,b1 as kt,b2 as da,b3 as ma,b4 as fa,b5 as pa,b6 as ga,b7 as xt,b8 as ha,b9 as va,ba,I as Sa,bb as Kn,bc as At,bd as Fn,be as In,bf as xa,bg as ya,bh as _a,bi as ja,bj as fn,bk as On,bl as $n,bm as Tt,bn as Yt,bo as zn,bp as Ea,bq as pn,br as Ra,bs as wa,bt as ka,bu as Ta,bv as Na}from"./index-P-GX8FW_.js";import{t as Va}from"./ChevronDown-BansJwMw.js";import{ai as hn,z as Da,X as bs,I as Pa,y as Ss,ap as Ca,v as Aa}from"./agent-icon-B14THc_Q.js";import{i as xs}from"./ChevronRight-8cwrWc6Q.js";import{n as Ma}from"./ChevronUp-CBwQlhRH.js";import{i as Ba}from"./Globe01-D0Oxc1LP.js";import{B as Jt}from"./automation-runs-BpvoOdRs.js";import{c as yt,T as _t,a as jt}from"./tooltip-CCAgnlkx.js";import{b as La,h as Ka,a as Fa,c as Ia,d as Oa,e as $a}from"./dialog-XZdfEVkH.js";import{I as za}from"./input-CjE2QrUF.js";import{a as ys}from"./Copy01-DbAHd-uW.js";import{i as Ha}from"./Settings02-ghlI4JM4.js";import{s as Ua}from"./Eye-Bh6RageV.js";import{s as _s}from"./TrendUp01-C6Z_wcrx.js";import{s as vn}from"./Plus-BeKip_ti.js";import{s as js}from"./Trash01-BAawLpcp.js";import{i as qa}from"./Zap-wuOCIL0m.js";import{D as Es,a as vt,c as Rs,b as ws,i as Ga}from"./dropdown-menu-DVYqDP-D.js";import{S as Wa,r as Hn,u as Ya,d as Ja,a as Qa,i as Xa,f as Za,P as er,b as tr}from"./page-seo-form-rWml4KZv.js";import{c as nr}from"./Tool01-DsnpIm7u.js";import{u as sr,A as or}from"./use-section-preview-base-BijudAg1.js";import"./ArrowUp-DPZSwvHJ.js";import"./chat-context-D3_WI76a.js";import"./tab-id-CTjObiZn.js";import"./Check-BjlTRmvp.js";import"./hooks-D1ngLxRd.js";import"./use-mcp-client-DMHWuHBR.js";import"./auth-aQ-S9sH7.js";import"./decopilot-sse-pool-MiFwCFec.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-DdZEMtY_.js";import"./use-ai-providers-BD3OpOyt.js";import"./studio-tools-rxH0R7lt.js";import"./use-decopilot-events-BqPh4BCN.js";import"./use-organization-settings-CXQEv0_d.js";import"./spinner-D7MklTbP.js";import"./drawer-CZRmN4Rl.js";import"./collection-search-mKgfv-P5.js";import"./SearchMd-B0Qlr1Gl.js";import"./use-mobile-iNxeOMfx.js";import"./chart-BQq8t5ba.js";import"./index-ANK2LJtV.js";import"./X-lCHRulQP.js";import"./shell-layout-Czubm3xQ.js";import"./avatar-CZVTnS3q.js";import"./User01-Ce4Fl6PE.js";import"./Users03-CPZVCPK9.js";import"./SearchLg-CF3SVn_9.js";import"./Stars02-IIISJrG5.js";import"./XClose-DjKz-D2Z.js";import"./CheckCircle-DJReLGxy.js";import"./FilterLines-C7Wg9yVb.js";import"./Monitor01-DQW548Gm.js";import"./required-auth-layout-Dn81p7H8.js";import"./use-org-sso-U6MQkVfh.js";import"./deco-site-production-url-BjY4ZYd-.js";import"./XCircle-BCbY6TY1.js";import"./Upload01-CpAD4hxw.js";import"./AlertCircle-NIgamkG1.js";import"./form-Dxx4h0K2.js";import"./label-BYk5h4ou.js";import"./select-KBOQqb5b.js";import"./ArrowLeft-vl2nEIkm.js";import"./tabs-BMNmvzpQ.js";import"./Tool02-DK48uSLw.js";import"./toggle-group-DRlvHVKj.js";import"./use-commerce-diagnostic-p8AlgPkx.js";import"./sidebar-DYOHjP73.js";import"./LayoutLeft-BSvhSrEB.js";import"./popover-DH4sJ-hx.js";import"./self-tool-result-red_JJVZ.js";import"./alert-dialog-D7IFH3T6.js";import"./integration-icon-DD2uGTto.js";import"./extract-connection-data-BpVTWK-J.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-C2HwF4Ce.js";import"./use-debounced-value-CDap9oX0.js";import"./LinkExternal01-CyubGI-F.js";import"./authenticate-and-persist-oauth-Bf96RUCL.js";import"./mcp-oauth-YnIysQTC.js";import"./track-BEQo3sFg.js";import"./toolbar-R-lbOcDk.js";import"./skeleton-BwaQyECl.js";import"./github-repo-picker-BntApwLN.js";import"./use-connection-DoE4VVnG.js";import"./Share07-Ccl5KX8-.js";import"./use-mcp-tools-Zd5Wb_Ox.js";import"./use-navigate-to-agent-BgN8_rbc.js";import"./reusable-new-chat-CouMjkYR.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-C8ol51ZW.js";import"./use-registry-connections-DjSot7EF.js";import"./useInfiniteQuery-DTN5TRDI.js";import"./use-infinite-scroll-DV4nhJU-.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./card-Y4Td6_qp.js";import"./textarea-kMyew1mY.js";import"./connection-form-helpers-C7wyCDlb.js";import"./collection-tabs-Ibp0SPgD.js";import"./badge-Largeyp5.js";import"./useSuspenseInfiniteQuery-QQYAakG4.js";import"./command-CPY4g0vY.js";import"./index-BW8Kh131.js";import"./use-clock-tick-qO3IUhYy.js";import"./DotsVertical-DB5B45Uo.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./use-open-billing-url-DhGvCL22.js";import"./select-model-D2hJNEZf.js";import"./checkbox-T7P3CSDd.js";import"./Key01-BwSFgo4R.js";import"./ai-providers-logos-DD3qZ33J.js";import"./settings-section-uyvyi36n.js";import"./ArrowUpRight-EJcVnEQQ.js";import"./Stars01-D2FUcwqw.js";import"./cards-v-ZQq690.js";import"./Palette-CwprQ-n3.js";import"./file-type-icon-C0Iwwc71.js";import"./question-004-sINsf4GQ.js";import"./use-members-fvuAoyah.js";import"./use-org-auth-client-Cag_S-a4.js";import"./use-status-sounds-9UZfO_tZ.js";import"./empty-state-1FVnySPh.js";import"./types-BAfCrx4S.js";import"./use-capability-BG5qAt9K.js";import"./use-file-configs-BTGiD983.js";import"./monaco-editor-CEqNg3BQ.js";import"./pt-BR-CLy76QW2.js";import"./switch-B5ZbhCe0.js";import"./Play-B9I77UtI.js";import"./use-debounced-autosave-Bn---yMo.js";import"./index-CUMFdB46.js";import"./search-input-CAfA70t6.js";import"./index-B6at7pHi.js";import"./Users01-C5hyD2dw.js";import"./use-secrets-Ct36JmLs.js";import"./ZapSquare-CS3jzdYe.js";import"./AreaChart-CRpc3cm7.js";import"./use-copy-DwKcHskz.js";import"./SwitchHorizontal01-BxCgeiYE.js";import"./use-tags-D4Bd-NDo.js";import"./get-initials-D-f_fDFw.js";import"./use-automations-5visjbRc.js";import"./automation-list-row-GgPsGmLt.js";import"./CreditCard01-CYifPwC3.js";import"./Globe04-BkQE9r8Q.js";import"./HardDrive-BHaqV6HV.js";import"./LogOut01-BxGW4Z42.js";import"./Sun-qDVj9t4s.js";import"./Shield01-BRqhsyWc.js";import"./table-D-J833Vt.js";function ar(m){return m.schema?.definitions??m.schema?.$defs??{}}function ks(m,e){const a=ar(e),c=a[btoa(m)];if(!c)return[];const d=[c];if(Array.isArray(c.allOf)){const h=c.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof h=="string"){const b=a[h.replace("#/definitions/","")];b&&d.push(b)}}return d}function rr(m,e){for(const a of ks(m,e)){const c=typeof a.image=="string"?a.image:void 0;if(c?.includes("{{{"))return c}}function ir(m,e){if(!e)return;const a=es(m);if(!a)return;const c=rr(a.resolveType,e);if(!c)return;const d=Fo(c,a.data);if(d)return Io(d)}const lr={escape:$o};function cr(m,e){for(const a of ks(m,e)){const c=typeof a.title=="string"?a.title:void 0;if(c?.includes("{{"))return c}}function ur(m,e){if(!e)return;const a=es(m);if(a)try{const c=cr(a.resolveType,e);return c&&Oo.render(c,a.data,{},lr).trim()||void 0}catch{return}}const dr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",mr="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 Un(m){return Array.from({length:m},(e,a)=>({id:crypto.randomUUID(),index:a}))}function Ts(m){return m.map((e,a)=>({...e,index:a}))}function fr(m,e){if(e===m.length)return m;if(e<m.length)return Ts(m.slice(0,e));const a=Array.from({length:e-m.length},(c,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...a]}function Ns(m){const e=Ge.c(25),{section:a,raw:c,meta:d}=m,h=a.isSavedBlock===!0,b=a.isMultivariate===!0;let g;e[0]!==d||e[1]!==c?(g=c&&d?ir(c,d):void 0,e[0]=d,e[1]=c,e[2]=g):g=e[2];const v=g;let f;e[3]!==d||e[4]!==b||e[5]!==c||e[6]!==h?(f=c&&d&&!h&&!b?ur(c,d):void 0,e[3]=d,e[4]=b,e[5]=c,e[6]=h,e[7]=f):f=e[7];const E=f;let N;e[8]===Symbol.for("react.memo_cache_sentinel")?(N=n.jsx(Da,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=N):N=e[8];let V;e[9]!==v?(V=v&&n.jsx("img",{src:v,alt:"",referrerPolicy:"no-referrer",className:"h-12 max-w-[100px] shrink-0 rounded object-cover"}),e[9]=v,e[10]=V):V=e[10];let j;e[11]!==b||e[12]!==h?(j=h?{color:qo}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=b,e[12]=h,e[13]=j):j=e[13];let l;e[14]!==j?(l=n.jsx(hn,{className:"h-4 w-4 shrink-0",style:j}),e[14]=j,e[15]=l):l=e[15];const x=a.isHidden&&"line-through opacity-50";let r;e[16]!==x?(r=$e("min-w-0 flex-1 truncate text-sm font-medium",x),e[16]=x,e[17]=r):r=e[17];const D=E??a.label;let i;e[18]!==r||e[19]!==D?(i=n.jsx("span",{className:r,children:D}),e[18]=r,e[19]=D,e[20]=i):i=e[20];let R;return e[21]!==i||e[22]!==V||e[23]!==l?(R=n.jsxs(n.Fragment,{children:[N,V,l,i]}),e[21]=i,e[22]=V,e[23]=l,e[24]=R):R=e[24],R}const pr="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",gr="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]",hr="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";function gn(m,e){return $e("h-7 shrink-0 overflow-hidden",e?pr:m?hr:gr)}function Vs(m,e){const a=m.isSavedBlock===!0,c=m.isMultivariate===!0;return $e("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":a?dr:c?cs:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function vr(m){const e=Ge.c(82),{section:a,raw:c,meta:d,sortableId:h,selected:b,onSelect:g,onDelete:v,onDuplicate:f,onMakeReusable:E,onToggleHidden:N,onToggleLazy:V,onAddVariant:j,onDetach:l}=m,x=ct(),r=c?rs(c.__resolveType??""):!1,D=a.isHidden===!0,i=r||D;let R;e[0]!==a?(R=zo(a),e[0]=a,e[1]=R):R=e[1];const M=R;let I;e[2]!==h?(I={id:h,animateLayoutChanges:_r},e[2]=h,e[3]=I):I=e[3];const{attributes:H,listeners:p,setNodeRef:B,transform:pe,isDragging:L}=is(I);let le;e[4]!==pe?(le=ls.Transform.toString(pe?{...pe,x:0}:null),e[4]=pe,e[5]=le):le=e[5];const P=L?0:void 0;let te;e[6]!==le||e[7]!==P?(te={transform:le,opacity:P},e[6]=le,e[7]=P,e[8]=te):te=e[8];const O=te;let oe;e[9]!==a?(oe=Ho(a),e[9]=a,e[10]=oe):oe=e[10];const De=oe,xe="button",Q=0;let X;e[11]!==g?(X=T=>{(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),g())},e[11]=g,e[12]=X):X=e[12];const ge=L?"cursor-grabbing":"cursor-pointer";let ne;e[13]!==a||e[14]!==b||e[15]!==ge?(ne=$e("touch-none transition-colors",ge,Vs(a,b)),e[13]=a,e[14]=b,e[15]=ge,e[16]=ne):ne=e[16];let K;e[17]!==d||e[18]!==c||e[19]!==a?(K=n.jsx(Ns,{section:a,raw:c,meta:d}),e[17]=d,e[18]=c,e[19]=a,e[20]=K):K=e[20];const ze=!a.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":x(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:$e(gn(i,r)),onClick:T=>{T.stopPropagation(),V()},onPointerDown:yr,children:n.jsx(qa,{className:$e("h-3.5 w-3.5",r&&"text-yellow-500")})})}),n.jsx(jt,{side:"bottom",children:x(r?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),nt=!a.isMultivariate&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":x(D?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:$e(gn(i,D)),onClick:T=>{T.stopPropagation(),N()},onPointerDown:xr,children:D?n.jsx(Ha,{className:"h-3.5 w-3.5"}):n.jsx(Ua,{className:"h-3.5 w-3.5"})})}),n.jsx(jt,{side:"bottom",children:x(D?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),Ke=Rs,Me=Es,W=!0,Z=Xe,Fe="button",Pe="ghost",ye="icon";let ce;e[21]!==x?(ce=x("sectionsEditor.sectionList.sectionActionsMenu"),e[21]=x,e[22]=ce):ce=e[22];const he=$e(gn(i,!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[23]===Symbol.for("react.memo_cache_sentinel")?(_e=n.jsx(bs,{className:"h-3.5 w-3.5"}),e[23]=_e):_e=e[23];let we;e[24]!==Z||e[25]!==ce||e[26]!==he?(we=n.jsx(Z,{type:Fe,variant:Pe,size:ye,"aria-label":ce,className:he,onClick:Sr,onPointerDown:br,children:_e}),e[24]=Z,e[25]=ce,e[26]=he,e[27]=we):we=e[27];let ve;e[28]!==Me||e[29]!==we?(ve=n.jsx(Me,{asChild:W,children:we}),e[28]=Me,e[29]=we,e[30]=ve):ve=e[30];let ae;e[31]!==f?(ae=T=>{T.stopPropagation(),f()},e[31]=f,e[32]=ae):ae=e[32];let Ce;e[33]===Symbol.for("react.memo_cache_sentinel")?(Ce=n.jsx(ys,{className:"h-4 w-4"}),e[33]=Ce):Ce=e[33];let je;e[34]!==x?(je=x("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=x,e[35]=je):je=e[35];let me;e[36]!==ae||e[37]!==je?(me=n.jsxs(vt,{onClick:ae,children:[Ce,je]}),e[36]=ae,e[37]=je,e[38]=me):me=e[38];let $;e[39]!==M||e[40]!==j||e[41]!==x?($=M&&n.jsxs(vt,{className:Uo,onClick:T=>{T.stopPropagation(),j()},children:[n.jsx(_s,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=M,e[40]=j,e[41]=x,e[42]=$):$=e[42];let fe;e[43]!==De||e[44]!==E||e[45]!==x?(fe=De&&n.jsxs(vt,{className:mr,onClick:T=>{T.stopPropagation(),E()},children:[n.jsx(hn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=De,e[44]=E,e[45]=x,e[46]=fe):fe=e[46];let Ae;e[47]!==l||e[48]!==a.isMultivariate||e[49]!==a.isSavedBlock||e[50]!==x?(Ae=a.isSavedBlock===!0&&!a.isMultivariate&&n.jsxs(vt,{onClick:T=>{T.stopPropagation(),l()},children:[n.jsx(hn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=l,e[48]=a.isMultivariate,e[49]=a.isSavedBlock,e[50]=x,e[51]=Ae):Ae=e[51];let be;e[52]!==v?(be=T=>{T.stopPropagation(),v()},e[52]=v,e[53]=be):be=e[53];let ke;e[54]===Symbol.for("react.memo_cache_sentinel")?(ke=n.jsx(js,{className:"h-4 w-4"}),e[54]=ke):ke=e[54];let se;e[55]!==x?(se=x("sectionsEditor.sectionList.deleteMenuItem"),e[55]=x,e[56]=se):se=e[56];let ie;e[57]!==be||e[58]!==se?(ie=n.jsxs(vt,{className:"text-destructive focus:text-destructive",onClick:be,children:[ke,se]}),e[57]=be,e[58]=se,e[59]=ie):ie=e[59];let ue;e[60]!==me||e[61]!==$||e[62]!==fe||e[63]!==Ae||e[64]!==ie?(ue=n.jsxs(ws,{align:"end",className:"w-44",children:[me,$,fe,Ae,ie]}),e[60]=me,e[61]=$,e[62]=fe,e[63]=Ae,e[64]=ie,e[65]=ue):ue=e[65];let Ee;e[66]!==Ke||e[67]!==ve||e[68]!==ue?(Ee=n.jsxs(Ke,{children:[ve,ue]}),e[66]=Ke,e[67]=ve,e[68]=ue,e[69]=Ee):Ee=e[69];let de;return e[70]!==H||e[71]!==p||e[72]!==g||e[73]!==B||e[74]!==O||e[75]!==ne||e[76]!==K||e[77]!==ze||e[78]!==nt||e[79]!==Ee||e[80]!==X?(de=n.jsxs("div",{ref:B,style:O,...H,...p,role:xe,tabIndex:Q,onClick:g,onKeyDown:X,className:ne,children:[K,ze,nt,Ee]}),e[70]=H,e[71]=p,e[72]=g,e[73]=B,e[74]=O,e[75]=ne,e[76]=K,e[77]=ze,e[78]=nt,e[79]=Ee,e[80]=X,e[81]=de):de=e[81],de}function br(m){return m.stopPropagation()}function Sr(m){return m.stopPropagation()}function xr(m){return m.stopPropagation()}function yr(m){return m.stopPropagation()}function _r(){return!1}function jr(m){const e=Ge.c(104),{listKey:a,rawSections:c,sections:d,meta:h,selectedIndex:b,onSelect:g,onReorder:v,onDelete:f,onDuplicate:E,onMakeReusable:N,onToggleHidden:V,onToggleLazy:j,onAddVariant:l,onDetach:x,onAddSection:r,canAddSection:D}=m,i=D===void 0?!0:D,R=ct();let M;e[0]!==d.length?(M=()=>Un(d.length),e[0]=d.length,e[1]=M):M=e[1];const[I,H]=w.useState(M),[p,B]=w.useState(null),[pe,L]=w.useState(a),[le,P]=w.useState(d.length),te=w.useRef(!1);pe!==a?(L(a),P(d.length),H(Un(d.length))):le!==d.length&&(P(d.length),H(de=>fr(de,d.length)));let O;e[2]===Symbol.for("react.memo_cache_sentinel")?(O={activationConstraint:{distance:8}},e[2]=O):O=e[2];let oe;e[3]===Symbol.for("react.memo_cache_sentinel")?(oe={coordinateGetter:us},e[3]=oe):oe=e[3];const De=ts(Qt(as,O),Qt(os,oe));let xe;e[4]!==I?(xe=I.map(Er),e[4]=I,e[5]=xe):xe=e[5];const Q=xe;let X;e[6]===Symbol.for("react.memo_cache_sentinel")?(X=de=>{B(String(de.active.id))},e[6]=X):X=e[6];const ge=X;let ne;e[7]!==Q||e[8]!==v?(ne=de=>{B(null);const{active:T,over:re}=de;if(!re||T.id===re.id)return;const F=Q.indexOf(String(T.id)),Be=Q.indexOf(String(re.id));F===-1||Be===-1||(H(ut=>Ts(Mt([...ut],F,Be))),te.current=!0,requestAnimationFrame(()=>{te.current=!1}),v?.(F,Be))},e[7]=Q,e[8]=v,e[9]=ne):ne=e[9];const K=ne;let ze;e[10]===Symbol.for("react.memo_cache_sentinel")?(ze=()=>{B(null)},e[10]=ze):ze=e[10];const nt=ze;let Ke,Me,W,Z,Fe,Pe,ye,ce,he,_e,we,ve,ae,Ce,je;if(e[11]!==p||e[12]!==i||e[13]!==I||e[14]!==Q||e[15]!==K||e[16]!==h||e[17]!==r||e[18]!==l||e[19]!==f||e[20]!==x||e[21]!==E||e[22]!==N||e[23]!==g||e[24]!==V||e[25]!==j||e[26]!==c||e[27]!==d||e[28]!==b||e[29]!==De||e[30]!==R){Ce=Symbol.for("react.early_return_sentinel");e:{const de=T=>{te.current||g(T)};if(e[46]!==p||e[47]!==i||e[48]!==I||e[49]!==r||e[50]!==c||e[51]!==d||e[52]!==R){const T=p?I.find(re=>re.id===p):null;if(Z=T!=null?d[T.index]:null,W=T!=null?c[T.index]:void 0,I.length===0){let re;e[56]!==R?(re=R("sectionsEditor.sectionList.noSections"),e[56]=R,e[57]=re):re=e[57];let F;e[58]!==re?(F=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:re}),e[58]=re,e[59]=F):F=e[59];const Be=!i;let ut;e[60]===Symbol.for("react.memo_cache_sentinel")?(ut=n.jsx(vn,{size:14}),e[60]=ut):ut=e[60];let Te;e[61]!==R?(Te=R("sectionsEditor.sectionList.addSectionButton"),e[61]=R,e[62]=Te):Te=e[62];let We;e[63]!==r||e[64]!==Be||e[65]!==Te?(We=n.jsxs(Xe,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Be,onClick:r,children:[ut,Te]}),e[63]=r,e[64]=Be,e[65]=Te,e[66]=We):We=e[66];let Ie;e[67]!==F||e[68]!==We?(Ie=n.jsxs("div",{className:"space-y-2",children:[F,We]}),e[67]=F,e[68]=We,e[69]=Ie):Ie=e[69],Ce=Ie;break e}ae=$e(T&&"cursor-grabbing"),e[46]=p,e[47]=i,e[48]=I,e[49]=r,e[50]=c,e[51]=d,e[52]=R,e[53]=W,e[54]=Z,e[55]=ae}else W=e[53],Z=e[54],ae=e[55];Me=ds,ce=De,he=ms,_e=ge,we=K,ve=nt,Ke=fs,Pe=Q,ye=ps,je="space-y-1",Fe=I.map(T=>{const re=d[T.index];return re?n.jsx(vr,{sortableId:T.id,section:re,raw:c[T.index],meta:h,selected:b===T.index,onSelect:()=>de(T.index),onDelete:()=>f(T.index),onDuplicate:()=>E(T.index),onMakeReusable:()=>N(T.index),onToggleHidden:()=>V(T.index),onToggleLazy:()=>j(T.index),onAddVariant:()=>l(T.index),onDetach:()=>x(T.index)},T.id):null})}e[11]=p,e[12]=i,e[13]=I,e[14]=Q,e[15]=K,e[16]=h,e[17]=r,e[18]=l,e[19]=f,e[20]=x,e[21]=E,e[22]=N,e[23]=g,e[24]=V,e[25]=j,e[26]=c,e[27]=d,e[28]=b,e[29]=De,e[30]=R,e[31]=Ke,e[32]=Me,e[33]=W,e[34]=Z,e[35]=Fe,e[36]=Pe,e[37]=ye,e[38]=ce,e[39]=he,e[40]=_e,e[41]=we,e[42]=ve,e[43]=ae,e[44]=Ce,e[45]=je}else Ke=e[31],Me=e[32],W=e[33],Z=e[34],Fe=e[35],Pe=e[36],ye=e[37],ce=e[38],he=e[39],_e=e[40],we=e[41],ve=e[42],ae=e[43],Ce=e[44],je=e[45];if(Ce!==Symbol.for("react.early_return_sentinel"))return Ce;let me;e[70]!==Fe||e[71]!==je?(me=n.jsx("div",{className:je,children:Fe}),e[70]=Fe,e[71]=je,e[72]=me):me=e[72];let $;e[73]!==Ke||e[74]!==Pe||e[75]!==ye||e[76]!==me?($=n.jsx(Ke,{items:Pe,strategy:ye,children:me}),e[73]=Ke,e[74]=Pe,e[75]=ye,e[76]=me,e[77]=$):$=e[77];let fe;e[78]!==W||e[79]!==Z||e[80]!==h?(fe=Z?n.jsx("div",{className:$e("cursor-grabbing shadow-lg ring-1 ring-border/60",Vs(Z,!1)),children:n.jsx(Ns,{section:Z,raw:W,meta:h})}):null,e[78]=W,e[79]=Z,e[80]=h,e[81]=fe):fe=e[81];let Ae;e[82]!==fe?(Ae=Xn.createPortal(n.jsx(ns,{dropAnimation:ss,children:fe}),document.body),e[82]=fe,e[83]=Ae):Ae=e[83];let be;e[84]!==Me||e[85]!==ce||e[86]!==he||e[87]!==_e||e[88]!==we||e[89]!==ve||e[90]!==$||e[91]!==Ae?(be=n.jsxs(Me,{sensors:ce,collisionDetection:he,onDragStart:_e,onDragEnd:we,onDragCancel:ve,children:[$,Ae]}),e[84]=Me,e[85]=ce,e[86]=he,e[87]=_e,e[88]=we,e[89]=ve,e[90]=$,e[91]=Ae,e[92]=be):be=e[92];const ke=!i;let se;e[93]===Symbol.for("react.memo_cache_sentinel")?(se=n.jsx(vn,{size:14}),e[93]=se):se=e[93];let ie;e[94]!==R?(ie=R("sectionsEditor.sectionList.addSectionButton"),e[94]=R,e[95]=ie):ie=e[95];let ue;e[96]!==r||e[97]!==ke||e[98]!==ie?(ue=n.jsxs(Xe,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:ke,onClick:r,children:[se,ie]}),e[96]=r,e[97]=ke,e[98]=ie,e[99]=ue):ue=e[99];let Ee;return e[100]!==ae||e[101]!==be||e[102]!==ue?(Ee=n.jsxs("div",{className:ae,children:[be,ue]}),e[100]=ae,e[101]=be,e[102]=ue,e[103]=Ee):Ee=e[103],Ee}function Er(m){return m.id}function qn(m){const e=Ge.c(57),{open:a,initialName:c,autoLabel:d,isPending:h,onSubmit:b,onOpenChange:g}=m,v=h===void 0?!1:h,f=ct(),[E,N]=w.useState(c),[V,j]=w.useState(a);a!==V&&(j(a),a&&N(c));let l;e[0]!==v||e[1]!==g?(l=ge=>{!ge&&!v&&g(!1)},e[0]=v,e[1]=g,e[2]=l):l=e[2];const x=l;let r;e[3]!==v||e[4]!==E||e[5]!==b?(r=async ge=>{ge.preventDefault(),!v&&await b(E.trim())},e[3]=v,e[4]=E,e[5]=b,e[6]=r):r=e[6];const D=r;let i;e[7]!==f?(i=f("sectionsEditor.variantRenameDialog.title"),e[7]=f,e[8]=i):i=e[8];let R;e[9]!==i?(R=n.jsx(La,{children:i}),e[9]=i,e[10]=R):R=e[10];let M;e[11]!==d||e[12]!==f?(M=f("sectionsEditor.variantRenameDialog.description",{fallback:d||f("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=d,e[12]=f,e[13]=M):M=e[13];let I;e[14]!==M?(I=n.jsx(Ka,{children:M}),e[14]=M,e[15]=I):I=e[15];let H;e[16]!==R||e[17]!==I?(H=n.jsxs(Fa,{children:[R,I]}),e[16]=R,e[17]=I,e[18]=H):H=e[18];let p;e[19]!==f?(p=f("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=f,e[20]=p):p=e[20];let B;e[21]!==p?(B=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:p}),e[21]=p,e[22]=B):B=e[22];let pe;e[23]===Symbol.for("react.memo_cache_sentinel")?(pe=ge=>N(ge.target.value),e[23]=pe):pe=e[23];let L;e[24]!==d||e[25]!==v||e[26]!==E?(L=n.jsx(za,{id:"variant-rename-name",value:E,onChange:pe,placeholder:d,autoFocus:!0,disabled:v}),e[24]=d,e[25]=v,e[26]=E,e[27]=L):L=e[27];let le;e[28]!==B||e[29]!==L?(le=n.jsxs("div",{className:"space-y-1.5 py-4",children:[B,L]}),e[28]=B,e[29]=L,e[30]=le):le=e[30];let P;e[31]!==g?(P=()=>g(!1),e[31]=g,e[32]=P):P=e[32];let te;e[33]!==f?(te=f("sectionsEditor.variantRenameDialog.cancel"),e[33]=f,e[34]=te):te=e[34];let O;e[35]!==v||e[36]!==P||e[37]!==te?(O=n.jsx(Xe,{type:"button",variant:"outline",onClick:P,disabled:v,children:te}),e[35]=v,e[36]=P,e[37]=te,e[38]=O):O=e[38];let oe;e[39]!==v||e[40]!==f?(oe=v?n.jsxs(n.Fragment,{children:[n.jsx(Zn,{size:14,className:"animate-spin"}),f("sectionsEditor.variantRenameDialog.saving")]}):f("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=f,e[41]=oe):oe=e[41];let De;e[42]!==v||e[43]!==oe?(De=n.jsx(Xe,{type:"submit",disabled:v,children:oe}),e[42]=v,e[43]=oe,e[44]=De):De=e[44];let xe;e[45]!==O||e[46]!==De?(xe=n.jsxs(Ia,{children:[O,De]}),e[45]=O,e[46]=De,e[47]=xe):xe=e[47];let Q;e[48]!==D||e[49]!==le||e[50]!==xe||e[51]!==H?(Q=n.jsx(Oa,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:D,children:[H,le,xe]})}),e[48]=D,e[49]=le,e[50]=xe,e[51]=H,e[52]=Q):Q=e[52];let X;return e[53]!==x||e[54]!==a||e[55]!==Q?(X=n.jsx($a,{open:a,onOpenChange:x,children:Q}),e[53]=x,e[54]=a,e[55]=Q,e[56]=X):X=e[56],X}function Ds(m){const e=Ge.c(5),{rule:a,matchers:c}=m,d=a?.__resolveType??"";let h;if(e[0]!==c||e[1]!==d){const f=c.find(E=>E.resolveType===d)?.iconName??Go(d);h=Pa(f),e[0]=c,e[1]=d,e[2]=h}else h=e[2];const b=h;if(!b)return null;let g;return e[3]!==b?(g=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=g):g=e[4],g}function Gn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
+ `)}function Wn(m){return m.map((e,a)=>({id:crypto.randomUUID(),index:a,variant:e}))}function Rr(m,e){const a=new Map;for(const c of m){const d=a.get(c.variant.label);d?d.push(c):a.set(c.variant.label,[c])}return e.map((c,d)=>({id:a.get(c.label)?.shift()?.id??crypto.randomUUID(),index:d,variant:c}))}function wr(m){return m.map((e,a)=>({...e,index:a}))}function Ps(m){const e=Ge.c(17),{label:a,effectiveRule:c,matchers:d,canDelete:h,dragging:b,onRename:g,onDuplicate:v,onDelete:f}=m,E=ct();let N;e[0]!==c||e[1]!==d?(N=n.jsx(Ds,{rule:c,matchers:d}),e[0]=c,e[1]=d,e[2]=N):N=e[2];let V;e[3]!==a?(V=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:a}),e[3]=a,e[4]=V):V=e[4];let j;e[5]!==h||e[6]!==b||e[7]!==a||e[8]!==f||e[9]!==v||e[10]!==g||e[11]!==E?(j=!b&&n.jsxs(Rs,{children:[n.jsx(Es,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":E("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:a}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Tr,onPointerDown:kr,children:n.jsx(bs,{size:14})})}),n.jsxs(ws,{align:"end",className:"w-36",children:[n.jsxs(vt,{onClick:x=>{x.stopPropagation(),g?.()},children:[n.jsx(nr,{size:14}),E("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(vt,{onClick:x=>{x.stopPropagation(),v?.()},children:[n.jsx(ys,{size:14}),E("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Ga,{}),n.jsxs(vt,{variant:"destructive",disabled:!h,onClick:x=>{x.stopPropagation(),f?.()},children:[n.jsx(js,{size:14}),E("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=h,e[6]=b,e[7]=a,e[8]=f,e[9]=v,e[10]=g,e[11]=E,e[12]=j):j=e[12];let l;return e[13]!==N||e[14]!==V||e[15]!==j?(l=n.jsxs(n.Fragment,{children:[N,V,j]}),e[13]=N,e[14]=V,e[15]=j,e[16]=l):l=e[16],l}function kr(m){return m.stopPropagation()}function Tr(m){return m.stopPropagation()}function Nr(m){const e=Ge.c(33),{entry:a,isActive:c,canDelete:d,decofile:h,meta:b,matchers:g,onSelect:v,onRename:f,onDuplicate:E,onDelete:N}=m;let V;e[0]!==a.id?(V={id:a.id,animateLayoutChanges:Vr},e[0]=a.id,e[1]=V):V=e[1];const{attributes:j,listeners:l,setNodeRef:x,transform:r,isDragging:D}=is(V);let i;e[2]!==r?(i=ls.Transform.toString(r?{...r,x:0}:null),e[2]=r,e[3]=i):i=e[3];const R=D?0:void 0;let M;e[4]!==i||e[5]!==R?(M={transform:i,opacity:R},e[4]=i,e[5]=R,e[6]=M):M=e[6];const I=M,H=b??void 0;let p;e[7]!==h||e[8]!==a.variant.rule||e[9]!==H?(p=Bt(a.variant.rule,h,H),e[7]=h,e[8]=a.variant.rule,e[9]=H,e[10]=p):p=e[10];const B=p;let pe;e[11]!==v?(pe=oe=>{oe.target===oe.currentTarget&&(oe.key==="Enter"||oe.key===" ")&&(oe.preventDefault(),v())},e[11]=v,e[12]=pe):pe=e[12];const L=D?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",le=c?gs:cs;let P;e[13]!==L||e[14]!==le?(P=$e("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",L,le),e[13]=L,e[14]=le,e[15]=P):P=e[15];let te;e[16]!==d||e[17]!==B||e[18]!==a.variant.label||e[19]!==g||e[20]!==N||e[21]!==E||e[22]!==f?(te=n.jsx(Ps,{label:a.variant.label,effectiveRule:B,matchers:g,canDelete:d,onRename:f,onDuplicate:E,onDelete:N}),e[16]=d,e[17]=B,e[18]=a.variant.label,e[19]=g,e[20]=N,e[21]=E,e[22]=f,e[23]=te):te=e[23];let O;return e[24]!==j||e[25]!==l||e[26]!==v||e[27]!==x||e[28]!==I||e[29]!==P||e[30]!==te||e[31]!==pe?(O=n.jsx("div",{ref:x,style:I,...j,...l,onClick:v,onKeyDown:pe,className:P,children:te}),e[24]=j,e[25]=l,e[26]=v,e[27]=x,e[28]=I,e[29]=P,e[30]=te,e[31]=pe,e[32]=O):O=e[32],O}function Vr(){return!1}function Dr(m){const e=Ge.c(9),{variant:a,decofile:c,meta:d,matchers:h}=m,b=d??void 0;let g;e[0]!==c||e[1]!==b||e[2]!==a.rule?(g=Bt(a.rule,c,b),e[0]=c,e[1]=b,e[2]=a.rule,e[3]=g):g=e[3];const v=g;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=$e("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",gs),e[4]=f):f=e[4];let E;return e[5]!==v||e[6]!==h||e[7]!==a.label?(E=n.jsx("div",{className:f,children:n.jsx(Ps,{label:a.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=a.label,e[8]=E):E=e[8],E}function Pr(m){const e=Ge.c(91),{listKey:a,variants:c,activeIndex:d,decofile:h,meta:b,matchers:g,onSelect:v,onReorder:f,onRename:E,onDuplicate:N,onDelete:V,onAdd:j}=m,l=ct();let x;e[0]!==c?(x=()=>Wn(c),e[0]=c,e[1]=x):x=e[1];const[r,D]=w.useState(x),[i,R]=w.useState(null),[M,I]=w.useState(a),[H,p]=w.useState(c.length);let B;e[2]!==c?(B=()=>Gn(c),e[2]=c,e[3]=B):B=e[3];const[pe,L]=w.useState(B),le=w.useRef(!1),P=Gn(c);M!==a?(I(a),p(c.length),L(P),D(Wn(c))):(H!==c.length||pe!==P)&&(p(c.length),L(P),D(be=>Rr(be,c)));let te;e[4]===Symbol.for("react.memo_cache_sentinel")?(te={activationConstraint:{distance:8}},e[4]=te):te=e[4];let O;e[5]===Symbol.for("react.memo_cache_sentinel")?(O={coordinateGetter:us},e[5]=O):O=e[5];const oe=ts(Qt(as,te),Qt(os,O));let De;e[6]!==r?(De=r.map(Cr),e[6]=r,e[7]=De):De=e[7];const xe=De,Q=c.length>1;let X;e[8]!==r?(X=be=>{const ke=String(be.active.id);R(r.find(se=>se.id===ke)??null)},e[8]=r,e[9]=X):X=e[9];const ge=X;let ne;e[10]!==xe||e[11]!==f?(ne=be=>{R(null);const{active:ke,over:se}=be;if(!se||ke.id===se.id)return;const ie=xe.indexOf(String(ke.id)),ue=xe.indexOf(String(se.id));ie===-1||ue===-1||(D(Ee=>wr(Mt([...Ee],ie,ue))),le.current=!0,requestAnimationFrame(()=>{le.current=!1}),f(ie,ue))},e[10]=xe,e[11]=f,e[12]=ne):ne=e[12];const K=ne;let ze;e[13]===Symbol.for("react.memo_cache_sentinel")?(ze=()=>{R(null)},e[13]=ze):ze=e[13];const nt=ze;let Ke,Me,W,Z,Fe,Pe,ye,ce,he,_e,we,ve,ae;if(e[14]!==d||e[15]!==Q||e[16]!==h||e[17]!==r||e[18]!==xe||e[19]!==K||e[20]!==ge||e[21]!==g||e[22]!==b||e[23]!==j||e[24]!==V||e[25]!==N||e[26]!==E||e[27]!==v||e[28]!==oe||e[29]!==l){const be=F=>{le.current||v(F)};we="space-y-1 border-b p-2";let ke;e[43]!==l?(ke=l("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=l,e[44]=ke):ke=e[44];let se;e[45]!==ke?(se=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:ke}),e[45]=ke,e[46]=se):se=e[46];let ie;e[47]!==l?(ie=l("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=l,e[48]=ie):ie=e[48];let ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(vn,{size:14}),e[49]=ue):ue=e[49];let Ee;e[50]!==j||e[51]!==ie?(Ee=n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":ie,className:"size-6",onClick:j,children:ue})}),e[50]=j,e[51]=ie,e[52]=Ee):Ee=e[52];let de;e[53]!==l?(de=l("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=l,e[54]=de):de=e[54];let T;e[55]!==de?(T=n.jsx(jt,{children:de}),e[55]=de,e[56]=T):T=e[56];let re;e[57]!==Ee||e[58]!==T?(re=n.jsxs(yt,{children:[Ee,T]}),e[57]=Ee,e[58]=T,e[59]=re):re=e[59],e[60]!==se||e[61]!==re?(ve=n.jsxs("div",{className:"flex items-center justify-between",children:[se,re]}),e[60]=se,e[61]=re,e[62]=ve):ve=e[62],Me=ds,Pe=oe,ye=ms,ce=ge,he=K,_e=nt,Ke=fs,Z=xe,Fe=ps,ae="space-y-0.5",W=r.map(F=>n.jsx(Nr,{entry:F,isActive:F.index===d,canDelete:Q,decofile:h,meta:b,matchers:g,onSelect:()=>be(F.index),onRename:()=>E(F.index),onDuplicate:()=>N(F.index),onDelete:()=>V(F.index)},F.id)),e[14]=d,e[15]=Q,e[16]=h,e[17]=r,e[18]=xe,e[19]=K,e[20]=ge,e[21]=g,e[22]=b,e[23]=j,e[24]=V,e[25]=N,e[26]=E,e[27]=v,e[28]=oe,e[29]=l,e[30]=Ke,e[31]=Me,e[32]=W,e[33]=Z,e[34]=Fe,e[35]=Pe,e[36]=ye,e[37]=ce,e[38]=he,e[39]=_e,e[40]=we,e[41]=ve,e[42]=ae}else Ke=e[30],Me=e[31],W=e[32],Z=e[33],Fe=e[34],Pe=e[35],ye=e[36],ce=e[37],he=e[38],_e=e[39],we=e[40],ve=e[41],ae=e[42];let Ce;e[63]!==W||e[64]!==ae?(Ce=n.jsx("div",{className:ae,children:W}),e[63]=W,e[64]=ae,e[65]=Ce):Ce=e[65];let je;e[66]!==Ke||e[67]!==Z||e[68]!==Fe||e[69]!==Ce?(je=n.jsx(Ke,{items:Z,strategy:Fe,children:Ce}),e[66]=Ke,e[67]=Z,e[68]=Fe,e[69]=Ce,e[70]=je):je=e[70];let me;e[71]!==i||e[72]!==h||e[73]!==g||e[74]!==b?(me=i?n.jsx(Dr,{variant:i.variant,decofile:h,meta:b,matchers:g}):null,e[71]=i,e[72]=h,e[73]=g,e[74]=b,e[75]=me):me=e[75];let $;e[76]!==me?($=Xn.createPortal(n.jsx(ns,{dropAnimation:ss,children:me}),document.body),e[76]=me,e[77]=$):$=e[77];let fe;e[78]!==Me||e[79]!==Pe||e[80]!==ye||e[81]!==ce||e[82]!==he||e[83]!==_e||e[84]!==je||e[85]!==$?(fe=n.jsxs(Me,{sensors:Pe,collisionDetection:ye,onDragStart:ce,onDragEnd:he,onDragCancel:_e,children:[je,$]}),e[78]=Me,e[79]=Pe,e[80]=ye,e[81]=ce,e[82]=he,e[83]=_e,e[84]=je,e[85]=$,e[86]=fe):fe=e[86];let Ae;return e[87]!==we||e[88]!==ve||e[89]!==fe?(Ae=n.jsxs("div",{className:we,children:[ve,fe]}),e[87]=we,e[88]=ve,e[89]=fe,e[90]=Ae):Ae=e[90],Ae}function Cr(m){return m.id}function Ar(m){const e=Ge.c(16),{schema:a,value:c,onChange:d,meta:h,decofile:b,onSaveReferencedBlock:g,sandbox:v}=m,f=ct();let E;e[0]===Symbol.for("react.memo_cache_sentinel")?(E=[],e[0]=E):E=e[0];const[N,V]=w.useState(E);let j;e[1]!==N||e[2]!==f?(j=N.length>0&&n.jsxs("nav",{"aria-label":f("sectionsEditor.sectionsEditorPanels.variantRuleBreadcrumb"),className:"flex min-w-0 items-center gap-1 overflow-hidden text-xs",children:[n.jsx("button",{type:"button",onClick:()=>V([]),className:"flex shrink-0 items-center gap-0.5 rounded-md px-1 py-0.5 text-muted-foreground transition-colors hover:bg-accent hover:text-accent-foreground",title:f("sectionsEditor.sectionsEditorPanels.backToRule"),children:n.jsx(Ss,{className:"size-3.5"})}),N.map((r,D)=>{const i=D===N.length-1,R=vs(r);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[D>0&&n.jsx(xs,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>V(N.slice(0,D+1)),title:R,className:$e("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",i?"font-medium text-foreground":"text-muted-foreground"),children:R})]},`${R}-${D}`)})]}),e[1]=N,e[2]=f,e[3]=j):j=e[3];let l;e[4]!==N||e[5]!==b||e[6]!==h||e[7]!==d||e[8]!==g||e[9]!==v||e[10]!==a||e[11]!==c?(l=n.jsx(hs,{schema:a,value:c,onChange:d,basePath:"",breadcrumbPath:N,onBreadcrumbChange:V,meta:h,decofile:b,onSaveReferencedBlock:g,sandbox:v}),e[4]=N,e[5]=b,e[6]=h,e[7]=d,e[8]=g,e[9]=v,e[10]=a,e[11]=c,e[12]=l):l=e[12];let x;return e[13]!==j||e[14]!==l?(x=n.jsxs("div",{className:"space-y-2",children:[j,l]}),e[13]=j,e[14]=l,e[15]=x):x=e[15],x}function Yn(m){const e=Ge.c(23),{activeSchema:a,formValue:c,formResetKey:d,onFormChange:h,onBreadcrumbChange:b,breadcrumbPath:g,emptyMessage:v,beforeForm:f,seoResolveType:E,siteDefaultSeo:N,meta:V,decofile:j,onSaveReferencedBlock:l,sandbox:x,previewBaseUrl:r,onRequestAddSection:D}=m;let i;e[0]!==g?(i=g===void 0?[]:g,e[0]=g,e[1]=i):i=e[1];const R=i;let M;e[2]!==a||e[3]!==R||e[4]!==j||e[5]!==d||e[6]!==c||e[7]!==V||e[8]!==b||e[9]!==h||e[10]!==D||e[11]!==l||e[12]!==r||e[13]!==x||e[14]!==E||e[15]!==N?(M=a&&c?E?n.jsx(Wa,{schema:a,resolveType:E,value:c,formResetKey:d,onChange:h,onBreadcrumbChange:b,siteDefaultSeo:N}):n.jsx(hs,{schema:a,value:c,onChange:h,basePath:"",breadcrumbPath:R,onBreadcrumbChange:b,meta:V,decofile:j,onSaveReferencedBlock:l,sandbox:x,previewBaseUrl:r,onRequestAddSection:D},d):null,e[2]=a,e[3]=R,e[4]=j,e[5]=d,e[6]=c,e[7]=V,e[8]=b,e[9]=h,e[10]=D,e[11]=l,e[12]=r,e[13]=x,e[14]=E,e[15]=N,e[16]=M):M=e[16];const I=M;let H;e[17]!==v||e[18]!==I?(H=I??n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:v}),e[17]=v,e[18]=I,e[19]=H):H=e[19];let p;return e[20]!==f||e[21]!==H?(p=n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsxs("div",{className:"mx-auto max-w-2xl",children:[f,H]})}),e[20]=f,e[21]=H,e[22]=p):p=e[22],p}const Mr="text-[oklch(0.45_0.15_160)] bg-[oklch(0.65_0.15_160/0.18)] dark:text-[oklch(0.78_0.15_160)] dark:bg-[oklch(0.65_0.15_160/0.22)]";function Br(m,e){return Wo(m,e,lt)}function Lr(m){const e=Ge.c(19),{pageKey:a,initialName:c,initialPath:d,onFieldChange:h}=m,b=ct(),[g,v]=w.useState(c),[f,E]=w.useState(d),[N,V]=w.useState(a);N!==a&&(V(a),v(c),E(d));let j;e[0]!==h?(j=M=>{v(M.target.value),h("name",M.target.value)},e[0]=h,e[1]=j):j=e[1];let l;e[2]!==b?(l=b("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=b,e[3]=l):l=e[3];let x;e[4]!==g||e[5]!==j||e[6]!==l?(x=n.jsx("input",{type:"text",value:g,onChange:j,className:"w-full bg-transparent text-sm font-semibold truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:l}),e[4]=g,e[5]=j,e[6]=l,e[7]=x):x=e[7];let r;e[8]!==h?(r=M=>{E(M.target.value),h("path",M.target.value)},e[8]=h,e[9]=r):r=e[9];let D;e[10]!==b?(D=b("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=b,e[11]=D):D=e[11];let i;e[12]!==f||e[13]!==r||e[14]!==D?(i=n.jsx("input",{type:"text",value:f,onChange:r,className:"w-full bg-transparent text-xs text-muted-foreground truncate outline-none border-none p-0 focus:ring-0 placeholder:text-muted-foreground",placeholder:D}),e[12]=f,e[13]=r,e[14]=D,e[15]=i):i=e[15];let R;return e[16]!==x||e[17]!==i?(R=n.jsxs("div",{className:"space-y-1",children:[x,i]}),e[16]=x,e[17]=i,e[18]=R):R=e[18],R}function Jn(m){const e=Ge.c(13),{onClick:a}=m,c=ct();let d;e[0]!==c?(d=c("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=c,e[1]=d):d=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(_s,{size:14}),e[2]=h):h=e[2];let b;e[3]!==a||e[4]!==d?(b=n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":d,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:a,children:h})}),e[3]=a,e[4]=d,e[5]=b):b=e[5];let g;e[6]!==c?(g=c("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=c,e[7]=g):g=e[7];let v;e[8]!==g?(v=n.jsx(jt,{side:"bottom",children:g}),e[8]=g,e[9]=v):v=e[9];let f;return e[10]!==b||e[11]!==v?(f=n.jsxs(yt,{children:[b,v]}),e[10]=b,e[11]=v,e[12]=f):f=e[12],f}function Qn(m){const e=Ge.c(21),{currentRt:a,currentLabel:c,currentGlobalKey:d,matchers:h,globals:b,onSelect:g,onSelectGlobal:v,schema:f,formValue:E,onChange:N,formKey:V,formWrapperClassName:j,meta:l,decofile:x,onSaveReferencedBlock:r,sandbox:D}=m;let i;e[0]!==d||e[1]!==c||e[2]!==a||e[3]!==b||e[4]!==h||e[5]!==g||e[6]!==v?(i=n.jsx(Yo,{currentRt:a,currentLabel:c,currentGlobalKey:d,matchers:h,globals:b,onSelect:g,onSelectGlobal:v}),e[0]=d,e[1]=c,e[2]=a,e[3]=b,e[4]=h,e[5]=g,e[6]=v,e[7]=i):i=e[7];let R;e[8]!==x||e[9]!==V||e[10]!==E||e[11]!==j||e[12]!==l||e[13]!==N||e[14]!==r||e[15]!==D||e[16]!==f?(R=f&&E&&n.jsx("div",{className:j,children:n.jsx(Ar,{schema:f,value:E,onChange:N,meta:l,decofile:x,onSaveReferencedBlock:r,sandbox:D},V)}),e[8]=x,e[9]=V,e[10]=E,e[11]=j,e[12]=l,e[13]=N,e[14]=r,e[15]=D,e[16]=f,e[17]=R):R=e[17];let M;return e[18]!==i||e[19]!==R?(M=n.jsxs(n.Fragment,{children:[i,R]}),e[18]=i,e[19]=R,e[20]=M):M=e[20],M}function Dc({orgSlug:m,virtualMcpId:e,branch:a,previewReady:c=!0,previewUrl:d,currentPath:h,activePageBlockKey:b=null,activeGlobalBlockKey:g=null,externalSelection:v,onSaved:f,initialEditSeo:E=!1,onExitSeo:N,onViewJsonFile:V,onVariantPreviewOverride:j}){const l=ct(),x=c?{orgSlug:m,virtualMcpId:e,branch:a,previewUrl:d}:null,{data:r,isLoading:D}=Jo(x),{data:i,isLoading:R}=Qo(x),M=Xo(),I=M?.entity?.id===e?M.entity.metadata?.siteSlug??null:null,H=sr({virtualMcpId:e,sandboxUrl:d}),[p,B]=w.useState(null),[pe,L]=w.useState(null),[le,P]=w.useState(null),[te,O]=w.useState(0),[oe,De]=w.useState(void 0),[xe,Q]=w.useState(null),[X,ge]=w.useState(null),[ne,K]=w.useState([]),ze=w.useRef(null),[nt,Ke]=w.useState(ne.length);nt!==ne.length&&(Ke(ne.length),requestAnimationFrame(()=>{ze.current&&(ze.current.scrollTop=0)}));const[Me,W]=w.useState(0),[Z,Fe]=w.useState(null),[Pe,ye]=w.useState(null),[ce,he]=w.useState(null),[_e,we]=w.useState(!0),[ve,ae]=w.useState(!1),[Ce,je]=w.useState(!1),me=w.useRef(null),[$,fe]=w.useState(E),[Ae,be]=w.useState(E);E&&!Ae&&(be(!0),fe(!0),B(null),L(null),P(null),K([])),!E&&Ae&&be(!1);const[ke,se]=w.useState(null),[ie,ue]=w.useState(void 0),[Ee,de]=w.useState([]),[T,re]=w.useState(0),[F,Be]=w.useState(0),[ut,Te]=w.useState(null),[We,Ie]=w.useState(null),[bn,Sn]=w.useState(null),Cs=Lo(),As=`${m}/${e}/${a}`,Xt=Zo({orgSlug:m,virtualMcpId:e,branch:a}),[Ms,Bs]=w.useState(h),[Ls,Ks]=w.useState(b),[Fs,Is]=w.useState(g);(Ms!==h||Ls!==b||Fs!==g)&&(queueMicrotask(()=>Xt.flush()),Bs(h),Ks(b),Is(g),B(null),L(null),P(null),O(0),Q(null),ge(null),Be(0),Te(null),Ie(null),K([]),W(t=>t+1),fe(!1),se(null),ue(void 0),de([]),re(t=>t+1));const Ne=ea({orgSlug:m,virtualMcpId:e,branch:a}),Lt=Sa((t,s)=>{Ne.mutate({blockKey:t,data:s},{onSuccess:()=>f?.(),onError:o=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})}),Zt=ta({orgSlug:m,virtualMcpId:e,branch:a}),[Nt,Kt]=w.useState(!1),He=w.useRef(null),st=w.useRef(null),ot=w.useRef(null),en=w.useRef({}),Ze=w.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!c||D||R)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(Zn,{size:20,className:"animate-spin text-muted-foreground"})});if(!r||!i)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:l("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const Os=na(r),Ve=!!g,Ye=Ve?null:sa(Os,h,b),k=Ve?g:Ye?.key??null,tn=Ve&&g?r[g]:void 0,xn=Ve&&g&&tn?oa(g,tn):Ve&&g?g:"",Ft=!Ve&&k&&r[k]?r[k]:null,nn=$&&r&&i&&k&&Ye?Hn(r,{kind:"page",pageKey:k,pageName:String(Ye.name??""),path:String(Ye.path??"")},i):null,$s=$?Ft?.seo:void 0,sn=ie!==void 0?ie:$s,zs=$?Ya(sn):void 0,Hs=nn?.seoTypeOptions??[],Us=$&&i?Ja(i):"",yn=ke??zs??{},on=$&&nn?Qa(yn,nn):null,qs=$&&on&&Xa(sn)?qt(on,i):null,Gs=$?Za(r,i)?.seoData:void 0,qe=Ve?[{label:"Default",sections:[{__resolveType:g}]}]:Br(Ft?.sections,r??{}),It=qe.length>1,Oe=Math.min(te,qe.length-1),dt=qe[Oe],q=dt?.sections??[],Ue=Gt(q,r),_n=!Ve&&aa(Ft?.sections);if(Ve&&g&&bn!==g){Sn(g);const t=q[0],s=Ue[0];if(t&&s){B(0),Be(0),K([]);const o=St(t,s,r);o&&(L(o.data),P(o.resolveType),Ie(null),Te(null))}}!Ve&&bn!==null&&Sn(null),Ze.current={rawSections:q,parsedSections:Ue,decofile:r??{},activePageKey:k,pageVariants:qe,variantIndex:Oe,sectionVariantIndex:F,selectedSectionIndex:p};const Ws=()=>({multivariate:_n,index:Oe,variants:qe.map(t=>({rule:t.rule}))}),jn=(t,s)=>{if(!j)return;if(!k||!_n||t.length<=1){j(null);return}const o=zn(k,{multivariate:!0,index:s,variants:t},r,i);j(o.length>0?o:null)},Et=(t,s,o)=>{if(!j)return;if(!k){j(null);return}const u=Ws(),S=zn(k,u,r,i);if(!t||s<0){j(S.length>0?S:null);return}const _=Ea({pageKey:k,page:u,sectionIndex:s,sectionLazy:Ue[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:o,decofile:r,meta:i}),y=[...S,..._];j(y.length>0?y:null)},mt=(t,s,o,u=p??-1,S=!1)=>{const _=tt(t,s);if(!_){L(null),P(null),Ie(null),Te(null),S&&Et(null,u,o);return}const C=Ln(_,lt)[o];if(!C){L(null),P(null),Ie(null),Te(null),S&&Et(null,u,o);return}const ee=da(C.value,r);L(ee?.data??null),P(ee?.resolveType??null);const{resolveType:A,formValue:z}=Pt(C.rule,r,i??void 0);Ie(A),Te(z),S&&Et(_,u,o)},Vt=v?.index;if(v!==void 0&&(v?.seq??null)!==oe&&(De(v?.seq??null),typeof Vt=="number")){const t=q[Vt],s=Ue[Vt];if(t&&s)if(B(Vt),Be(0),K([]),W(o=>o+1),s.isMultivariate)mt(t,s,0,Vt);else{const o=St(t,s,r);o?(L(o.data),P(o.resolveType)):(L(null),P(null)),Ie(null),Te(null)}}const Ot={orgSlug:m,virtualMcpId:e,branch:a,previewUrl:d??void 0,siteSlug:I},an=le&&i?qt(le,i):null,Je=(t,s)=>{if(!k)return;He.current&&(clearTimeout(He.current),He.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),st.current&&(clearTimeout(st.current),st.current=null);const o=At(r,k,t,Oe,qe);Ne.mutate({blockKey:k,data:o},{onSuccess:()=>s?.onSuccess?.()??f?.(),onError:u=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:u.message}))})},Rt=()=>{B(null),L(null),P(null),Be(0),Te(null),Ie(null),K([]),W(t=>t+1)},Ys=(t,s)=>{He.current&&clearTimeout(He.current);const o=Ze.current.sectionVariantIndex;He.current=setTimeout(()=>{const{rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:C,variantIndex:ee}=Ze.current,A=u[s];if(!A)return;const z=S[s];if(!z)return;if(z.isSavedBlock){const G=z.isLazy?A.section?.__resolveType??A.__resolveType:A.__resolveType;Ne.mutate({blockKey:G,data:t},{onSuccess:()=>f?.(),onError:Y=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}if(!y)return;const U={..._[y]},Re=[...u];if(z.isMultivariate){const G=tt(A,z);if(!G||!y)return;const Y=wa(G,o,t);Re[s]=xt(A,z,Y)}else if(z.isHidden){const G=rs(A.__resolveType),Y=G?{...A.section}:{...A},Le=Array.isArray(Y.variants)?[...Y.variants]:[];Le[0]&&(Le[0]={...Le[0],value:t}),Y.variants=Le,G?Re[s]={...A,section:Y}:Re[s]=Y}else z.isLazy?Re[s]={...A,section:t}:Re[s]=t;if(C.length>1){const G=U.sections,Y=[...G?.variants??[]];Y[ee]&&(Y[ee]={...Y[ee],value:Re}),U.sections={...G,variants:Y}}else U.sections=Re;Ne.mutate({blockKey:y,data:U},{onSuccess:()=>f?.(),onError:G=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:G.message}))})},pn)},Js=t=>{B(t),Be(0),K([]),W(S=>S+1);const s=q[t],o=Ue[t];if(!s||!o)return;if(o.isMultivariate){mt(s,o,0,t);return}const u=St(s,o,r);if(!u){L(null),P(null),Ie(null),Te(null),Et(null,t,0);return}L(u.data),P(u.resolveType),Ie(null),Te(null),Et(null,t,0)},En=t=>{const s=t;L(s),p!==null&&Ys(s,p)},rn=t=>{if(!k||!r||!i||!Ye)return;const s={kind:"page",pageKey:k,pageName:String(Ye.name??""),path:String(Ye.path??"")},o=Hn(r,s,i);o&&Xt.save(k,()=>{const u=Cs.getQueryData(Ko.decofile(As))?.[k];if(!u||typeof u!="object"||u===null||Array.isArray(u))return null;const S={...u,...en.current};return en.current={},t?.raw!==void 0?{...S,seo:t.raw}:t?.inner!==void 0?tr(s,o,S,t.inner):S})},Qs=(t,s)=>{k&&(en.current[t]=s,rn())},Xs=(t,s)=>{if(!k)return;const o=Mt([...q],t,s);p!==null&&(p===t?B(s):t<p&&s>=p?B(p-1):t>p&&s<=p&&B(p+1)),Je(o)},Zs=t=>{if(!k)return;const s=q.filter((o,u)=>u!==t);p===t?Rt():p!==null&&p>t&&B(p-1),Je(s)},eo=t=>{if(!k)return;const s=q[t];if(!s)return;const o=[...q];o.splice(t+1,0,ja(s)),p!==null&&p>t&&B(p+1),Je(o)},to=t=>{if(!k)return;const s=q[t],o=Ue[t];if(!s||!o||o.isMultivariate)return;const u=o.isHidden?ya(s):_a(s);if(!u)return;const S=[...q];S[t]=u,p===t&&Rt(),Je(S)},no=t=>{if(!k)return;const s=q[t],o=Ue[t];if(!s||!o||o.isMultivariate)return;const u=xa(s);if(!u)return;const S=[...q];S[t]=u,p===t&&Rt(),Je(S)},so=t=>{if(!k)return;const s=q[t],o=Ue[t];if(!s||!o?.isSavedBlock)return;const u=St(s,o,r);if(!u?.data)return;const{name:S,..._}=u.data,y=[...q];o.isLazy?y[t]={...s,section:_}:y[t]=_,p===t&&Rt(),Je(y)},oo=t=>{if(!k)return;const s=[...q,{__resolveType:t.resolveType}],o=s.length-1;Je(s,{onSuccess:()=>{ae(!1),B(o),Be(0),K([]),W(y=>y+1);const u=s[o],S=Gt(s,r)[o];if(!u||!S)return;if(S.isMultivariate){mt(u,S,0);return}const _=St(u,S,r);if(!_){L(null),P(null),Ie(null),Te(null);return}L(_.data),P(_.resolveType),Ie(null),Te(null)}})},Rn=t=>{me.current=t.append,ae(!0)},ao=t=>{const s=me.current;if(!s){oo(t);return}s({__resolveType:t.resolveType}),ae(!1),me.current=null},ro=t=>{if(p===null)return;const s=q[p],o=Ue[p];!s||!o?.isMultivariate||(Be(t),K([]),W(u=>u+1),mt(s,o,t,p,!0))},io=t=>{if(p===null||!k)return;const s=q[p],o=Ue[p];if(!s||!o?.isMultivariate)return;const u=tt(s,o);if(!u)return;const S=va(u,t);if(!S){J.error(l("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const _=[...q];_[p]=xt(s,o,S);const y=S.variants;let C=F;t===F?C=Math.min(t,y.length-1):t<F&&(C=F-1),Be(C),K([]),W(ee=>ee+1),mt(_[p],o,C),Je(_)},lo=t=>{if(p===null||!k)return;const s=q[p],o=Ue[p];if(!s||!o?.isMultivariate)return;const u=tt(s,o);if(!u)return;const S=ba(u,t),_=[...q];_[p]=xt(s,o,S);const y=t+1;Be(y),K([]),W(C=>C+1),mt(_[p],o,y),Je(_)},co=(t,s)=>{if(p===null||!k||t===s)return;const o=q[p],u=Ue[p];if(!o||!u?.isMultivariate)return;const S=tt(o,u);if(!S)return;const _=ga(S,t,s),y=[...q];y[p]=xt(o,u,_);let C=F;F===t?C=s:t<F&&s>=F?C=F-1:t>F&&s<=F&&(C=F+1),Be(C),mt(y[p],u,C),Je(y)},ln=t=>{const s=t??p;if(s===null||!k)return;const o=q[s],u=Ue[s];if(!o||!u)return;const S=ma(o,u);if(!S){J.error(l("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const _=[...q];_[s]=S.section;const y=Gt(_,r)[s];if(!y?.isMultivariate){J.error(l("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}B(s),Be(S.newVariantIndex),K([]),W(C=>C+1),mt(S.section,y,S.newVariantIndex,s),Je(_)},uo=()=>{if(p===null||!k)return;const t=q[p],s=Ue[p];if(!t||!s?.isMultivariate)return;const o=tt(t,s);if(!o)return;const u=ha(t,s,o);if(!u){J.error(l("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const S=[...q];S[p]=u;const _=Gt(S,r)[p];if(!_)return;Be(0),Ie(null),Te(null),K([]),W(C=>C+1);const y=St(u,_,r);y?(L(y.data),P(y.resolveType)):(L(null),P(null)),Et(null,p,0),Je(S)},mo=async t=>{if(Z===null||!k)return;const s=fn(t,r);if(s){J.error(s);return}const o=q[Z],u=Ue[Z];if(!o||!u)return;const S=St(o,u,r);if(!S){J.error(l("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const _={...S.data,name:t};try{await Ne.mutateAsync({blockKey:t,data:_});const y=[...q];y[Z]={__resolveType:t},await Ne.mutateAsync({blockKey:k,data:At(r,k,y,Oe,qe)}),p===Z&&Rt(),Fe(null),J.success(l("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),f?.()}catch(y){J.error(y instanceof Error?y.message:l("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},wn=dt?.rule;if(It&&p===null&&X===null&&wn){const{resolveType:t,formValue:s}=Pt(wn,r??{},i??void 0);ge(t),Q(s)}const $t=i?ra(i):[],kn=i&&r?ia(i,r):[],fo=!Ve&&!!(H&&i&&r),po=X&&i?qt(X,i):null,wt=()=>{st.current&&(clearTimeout(st.current),st.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Dt=async(t,s)=>{if(!(Ra(s,t,i)>0))try{await Zt.mutateAsync({blockKey:t})}catch(o){J.error(o instanceof Error?o.message:l("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Tn=t=>{st.current&&clearTimeout(st.current),st.current=setTimeout(()=>{const{activePageKey:s,decofile:o,variantIndex:u}=Ze.current;if(!s)return;const S={...o[s]},_={...S.sections},y=[..._.variants??[]],C=y[u],ee=C?.rule;if(kt(ee,o,i)){const A=ee?.__resolveType??"",z=o[A],U=typeof z?.name=="string"?z.name:A,{__resolveType:Re,...G}=t;Ne.mutate({blockKey:A,data:Tt(Re??"",G,U)},{onSuccess:()=>f?.(),onError:Y=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:Y.message}))});return}C&&(y[u]={...C,rule:t}),S.sections={..._,variants:y},Ne.mutate({blockKey:s,data:S},{onSuccess:()=>f?.(),onError:A=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:A.message}))})},pn)},go=t=>{ge(t);const s=t?Fn(t,i):{__resolveType:In};Q(t?s:{}),Tn(s)},ho=t=>{const s=t;Q(s);const o=X?{__resolveType:X,...s}:{...s};Tn(o)},vo=async t=>{wt();const{activePageKey:s,decofile:o,variantIndex:u}=Ze.current;if(!s)return;const S=o[s],_=S?.sections;if(!_||typeof _!="object"||Array.isArray(_))return;const y=_;if(!Array.isArray(y.variants))return;const C=[...y.variants],ee=C[u];if(!ee)return;const A=Ct(ee.rule,o,i),z=Yt(t);C[u]={...ee,rule:z};const U={...o,[s]:{...S,sections:{...y,variants:C}}},{resolveType:Re,formValue:G}=Pt(z,U,i??void 0);ge(Re),Q(G);try{await Ne.mutateAsync({blockKey:s,data:U[s]}),A&&A!==t&&await Dt(A,U),f?.()}catch(Y){J.error(Y instanceof Error?Y.message:l("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Nn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:o}=Ze.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:C,variantIndex:ee}=Ze.current;if(!y)return;const A=u[s],z=S[s];if(!A||!z?.isMultivariate)return;const U=tt(A,z);if(!U)return;const G=(U.variants??[])[o]?.rule;if(kt(G,_,i)){const Se=G?.__resolveType??"",Qe=_[Se],rt=typeof Qe?.name=="string"?Qe.name:Se,{__resolveType:gt,...it}=t;Ne.mutate({blockKey:Se,data:Tt(gt??"",it,rt)},{onSuccess:()=>f?.(),onError:ht=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:ht.message}))});return}const Y=Kn(U,o,t),Le=[...u];Le[s]=xt(A,z,Y);const et=At(_,y,Le,ee,C);Ne.mutate({blockKey:y,data:et},{onSuccess:()=>f?.(),onError:Se=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:Se.message}))})},pn))},bo=t=>{Ie(t);const s=t?Fn(t,i):{__resolveType:In};Te(t?s:{}),Nn(s)},So=t=>{const s=t;Te(s);const o=We?{__resolveType:We,...s}:{...s};Nn(o)},xo=async t=>{wt();const{selectedSectionIndex:s,sectionVariantIndex:o,rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:C,variantIndex:ee}=Ze.current;if(s===null||!y)return;const A=u[s],z=S[s];if(!A||!z?.isMultivariate)return;const U=tt(A,z);if(!U)return;const Re=U.variants??[],G=Ct(Re[o]?.rule,_,i),Y=Yt(t),Le=Kn(U,o,Y),et=[...u];et[s]=xt(A,z,Le);const Se=At(_,y,et,ee,C),Qe={..._,[y]:Se},{resolveType:rt,formValue:gt}=Pt(Y,Qe,i??void 0);Ie(rt),Te(gt);try{await Ne.mutateAsync({blockKey:y,data:Se}),G&&G!==t&&await Dt(G,Qe),f?.()}catch(it){J.error(it instanceof Error?it.message:l("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ve&&!Ye)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:l("sectionsEditor.sectionsEditor.noPageFound",{currentPath:h})});if(Ve&&!tn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:l("sectionsEditor.sectionsEditor.globalBlockNotFound")});const ft=p!==null?Ue[p]??null:null,Vn=p!==null?q[p]:null,Dn=Vn&&ft?.isMultivariate?tt(Vn,ft):null,bt=Dn?Ln(Dn,lt):[],cn=Math.min(F,Math.max(bt.length-1,0)),zt=bt[cn]??null,pt=ft?.isMultivariate===!0,Pn=p!==null&&ft!==null,Ht=Pn&&(pt||!!(an&&pe)),yo=Ht&&!Ve&&ft?.isSavedBlock===!0,at=Ve||yo,_o=Ve?xn:ft?.label??"",jo=We&&i?qt(We,i):null,un=Ht&&(!Ve||ne.length>0)?Ve?[xn,...ne]:[Ye.name,ft.label,...pt&&zt?[zt.label]:[],...ne]:[],Eo=$&&Ye?[Ye.name,"SEO",...Ee]:[],Ut=$?Eo:at?un.length>0?un:[_o]:un,Ro=!$&&!Ve&&pt&&ne.length===0,Cn=()=>{if(!k)return;wt(),He.current&&(clearTimeout(He.current),He.current=null);const t=r[k],s=fa(t.sections,q);if(!s)return;const o=pa(s);Ne.mutate({blockKey:k,data:{...t,sections:s}},{onSuccess:()=>{O(o),B(null),L(null),P(null),K([]),Q(null),ge(null)},onError:u=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:u.message}))})},dn=(t,s,o)=>{if(!k)return;wt(),He.current&&(clearTimeout(He.current),He.current=null);const u=r[k],S=u.sections;if(!S||typeof S!="object"||Array.isArray(S))return;const _=S;if(!Array.isArray(_.variants))return;const y=t([..._.variants]);if(!y)return;const C=ka(_,y),ee={...r,[k]:{...u,sections:C}};Ne.mutate({blockKey:k,data:ee[k]},{onSuccess:()=>{s?.(),o&&Dt(o,ee)},onError:A=>J.error(l("sectionsEditor.sectionsEditor.saveFailed",{error:A.message}))})},wo=t=>{ye(null),O(t),B(null),L(null),P(null),K([]);const s=qe[t]?.rule,{resolveType:o,formValue:u}=Pt(s,r??{},i??void 0);ge(o),Q(u),jn(qe.map(S=>({rule:S.rule})),t)},ko=(t,s)=>{if(t===s)return;let o=Oe;Oe===t?o=s:t<Oe&&s>=Oe?o=Oe-1:t>Oe&&s<=Oe&&(o=Oe+1),O(o);const u=Mt(qe.map(S=>({rule:S.rule})),t,s);jn(u,o),dn(S=>Mt(S,t,s))},To=t=>{const s=qe[t]?.rule,o=Ct(s,r??{},i??void 0);dn(u=>u.length<=1?null:(u.splice(t,1),u),()=>{qe.length-1===1?O(0):t<Oe?O(Oe-1):t===Oe&&O(Math.max(0,t-1)),B(null),L(null),P(null),K([]),Q(null),ge(null)},o)},No=t=>{dn(s=>Ta(s,t),()=>{O(t+1),B(null),L(null),P(null),K([]),Q(null),ge(null)})},Vo=async(t,s)=>{wt(),He.current&&(clearTimeout(He.current),He.current=null);const o=Ze.current.activePageKey,u=Ze.current.decofile;if(!o)return;const S=u[o],_=S.sections;if(!_||typeof _!="object"||Array.isArray(_))return;const y=_;if(!Array.isArray(y.variants))return;const C=[...y.variants],ee=C[t];if(!ee?.rule||typeof ee.rule!="object"){J.error(l("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const A=ee.rule,z=s.trim();Kt(!0);try{if(!z){if(!kt(A,u,i)){ye(null);return}const et=A.__resolveType??"";C[t]={...ee,rule:On(A,u,i)};const Se={...u,[o]:{...S,sections:{...y,variants:C}}};await Ne.mutateAsync({blockKey:o,data:Se[o]}),await Dt(et,Se),ye(null),f?.();return}const U=$n(A,u,i);if(!U){J.error(l("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(U.blockKey){await Ne.mutateAsync({blockKey:U.blockKey,data:Tt(U.resolveType,U.data,z)}),ye(null),f?.();return}const Re=mn(z),G=fn(Re,u);if(G){J.error(G);return}const Y=Tt(U.resolveType,U.data,z);let Le=null;try{await Ne.mutateAsync({blockKey:Re,data:Y}),Le=Re,C[t]={...ee,rule:Yt(Re)},await Ne.mutateAsync({blockKey:o,data:{...S,sections:{...y,variants:C}}}),Le=null}catch(et){throw Le&&await Zt.mutateAsync({blockKey:Le}).catch(()=>{}),et}ye(null),J.success(l("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:z})),f?.()}catch(U){J.error(U instanceof Error?U.message:l("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}},Do=async(t,s)=>{wt(),He.current&&(clearTimeout(He.current),He.current=null);const{selectedSectionIndex:o,rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:C,variantIndex:ee}=Ze.current;if(o===null||!y)return;const A=u[o],z=S[o];if(!A||!z?.isMultivariate)return;const U=tt(A,z);if(!U)return;const Re=U.variants??[],G=Re[t];if(!G?.rule||typeof G.rule!="object"){J.error(l("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const Y=G.rule,Le=s.trim();Kt(!0);const et=async Se=>{const Qe={...U,variants:Se},rt=[...u];rt[o]=xt(A,z,Qe);const gt=At(_,y,rt,ee,C);return await Ne.mutateAsync({blockKey:y,data:gt}),{..._,[y]:gt}};try{if(!Le){if(!kt(Y,_,i)){he(null);return}const ht=Y.__resolveType??"",Bn=[...Re];Bn[t]={...G,rule:On(Y,_,i)};const Bo=await et(Bn);await Dt(ht,Bo),he(null),f?.();return}const Se=$n(Y,_,i);if(!Se){J.error(l("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Se.blockKey){await Ne.mutateAsync({blockKey:Se.blockKey,data:Tt(Se.resolveType,Se.data,Le)}),he(null),f?.();return}const Qe=mn(Le),rt=fn(Qe,_);if(rt){J.error(rt);return}const gt=Tt(Se.resolveType,Se.data,Le);let it=null;try{await Ne.mutateAsync({blockKey:Qe,data:gt}),it=Qe;const ht=[...Re];ht[t]={...G,rule:Yt(Qe)},await et(ht),it=null}catch(ht){throw it&&await Zt.mutateAsync({blockKey:it}).catch(()=>{}),ht}he(null),J.success(l("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Le})),f?.()}catch(Se){J.error(Se instanceof Error?Se.message:l("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Kt(!1)}},An=()=>{Rt()},Po=t=>{se(t),rn({inner:t})},Co=t=>{ue(t),rn({raw:t})},Ao=()=>{se(null),de([])},Mo=()=>re(t=>t+1),Mn=t=>{if($){if(t===0){Xt.flush(),fe(!1),se(null),ue(void 0),de([]),re(o=>o+1),N?.();return}if(t===1){de([]),re(o=>o+1);return}de(Ee.slice(0,t-1)),re(o=>o+1);return}if(Ve){K(ne.slice(0,t)),W(o=>o+1);return}if(t===0){An();return}if(t===1){K([]),W(o=>o+1);return}if(pt&&t===2){K([]),W(o=>o+1);return}const s=pt?2:1;K(ne.slice(0,t-s))};return n.jsxs("div",{className:"flex h-full min-w-0 w-full flex-col",children:[n.jsx("div",{className:"shrink-0",children:at||Ht||$?n.jsxs("div",{className:$e("border-b px-3 py-2.5",at&&"border-global-section/22 bg-global-section/12 dark:bg-global-section/16"),children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-2 overflow-hidden",children:[Ut.length>1&&n.jsx("button",{type:"button",onClick:()=>Mn(Na(Ut.length,{isMultivariateSectionTop:Ro})),title:l("sectionsEditor.sectionsEditor.back"),"aria-label":l("sectionsEditor.sectionsEditor.back"),className:$e("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",at?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(Ss,{className:"size-4"})}),!Ve&&It&&dt&&n.jsxs("button",{type:"button",onClick:An,title:l("sectionsEditor.sectionsEditor.editingInVariant",{variant:dt.label}),className:$e("shrink-0 inline-flex items-center gap-1 rounded-md h-6 px-1.5 text-xs font-medium cursor-pointer transition-opacity hover:opacity-80",Mr),children:[n.jsx(Ds,{rule:Bt(dt.rule,r??{},i??void 0),matchers:$t}),n.jsx("span",{className:"max-w-[160px] truncate",children:dt.label})]}),n.jsx("nav",{"aria-label":l("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Ut.map((t,s)=>{const o=s===Ut.length-1,u=vs(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(xs,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Mn(s),title:u,className:$e("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",o?at?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":at?"text-foreground/80":"text-muted-foreground",at?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:u})]},`${u}-${s}`)})}),at&&n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Ba,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(jt,{side:"bottom",className:"max-w-[260px]",children:l("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Pn&&!pt&&!ft?.isHidden&&k&&n.jsx(Jn,{onClick:()=>ln()})]}),at&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:l("sectionsEditor.sectionsEditor.globalSectionBanner")})]}):n.jsxs("div",{className:"flex items-center gap-2 border-b px-3 py-2.5",children:[n.jsx("div",{className:"flex-1 min-w-0",children:n.jsx(Lr,{pageKey:k,initialName:Ye.name,initialPath:Ye.path,onFieldChange:Qs})}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":l("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>fe(!0),children:n.jsx(Ca,{size:14})})}),n.jsx(jt,{side:"bottom",children:l("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(yt,{children:[n.jsx(_t,{asChild:!0,children:n.jsx(Xe,{type:"button",variant:"ghost",size:"icon","aria-label":l("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>V&&k?V(k):je(!0),children:n.jsx(Aa,{size:14})})}),n.jsx(jt,{side:"bottom",children:l("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Jn,{onClick:Cn})]})}),$?n.jsx(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx("div",{className:"min-w-0 max-w-full overflow-x-hidden px-6 py-4",children:n.jsx("div",{className:"mx-auto max-w-2xl",children:Ft&&k?n.jsx(er,{rawSeo:sn,innerSeo:yn,defaultResolveType:Us,seoSchema:qs,activeResolveType:on,seoTypeOptions:Hs,formResetKey:T,siteDefaultSeo:Gs,onBreadcrumbChange:de,onPersistRaw:Co,onInnerChange:Po,onClearForm:Ao,onBumpFormKey:Mo}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:l("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Ht?n.jsxs(Jt,{viewportRef:ze,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[pt&&bt.length>0&&ne.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(la,{listKey:`${k??""}:${p??""}`,variants:bt.map((t,s)=>({index:s,label:t.label})),selectedIndex:cn,onSelect:ro,onRename:he,onDuplicate:lo,onDelete:io,onRemoveAll:uo,onReorder:co,onAdd:()=>ln()}),pt&&n.jsxs("div",{className:"px-3 py-3 border-b space-y-2",children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Qn,{currentRt:We??"",currentLabel:Wt(zt?.rule,r??{},lt,i??void 0),currentGlobalKey:Ct(zt?.rule,r??{},i??void 0)??void 0,matchers:$t,globals:kn,onSelect:bo,onSelectGlobal:xo,schema:jo,formValue:ut,onChange:So,formKey:`${p??"none"}:${cn}:${We??""}`,formWrapperClassName:"pt-1",meta:i??void 0,decofile:r,onSaveReferencedBlock:Lt,sandbox:Ot})]})]}),n.jsx(Yn,{activeSchema:an,formValue:pe,formResetKey:Me,onFormChange:En,onBreadcrumbChange:K,breadcrumbPath:ne,emptyMessage:l("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:i,decofile:r,onSaveReferencedBlock:Lt,sandbox:Ot,previewBaseUrl:H,onRequestAddSection:Rn})]},"editor-section-form"):Ve?n.jsx(Jt,{viewportRef:ze,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Yn,{activeSchema:an,formValue:pe,formResetKey:Me,onFormChange:En,onBreadcrumbChange:K,breadcrumbPath:ne,emptyMessage:l("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:i,decofile:r,onSaveReferencedBlock:Lt,sandbox:Ot,previewBaseUrl:H,onRequestAddSection:Rn})},"editor-global-block"):n.jsxs(Jt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[It&&k&&n.jsx(Pr,{listKey:k,variants:qe,activeIndex:Oe,decofile:r??{},meta:i,matchers:$t,onSelect:wo,onReorder:ko,onRename:ye,onDuplicate:No,onDelete:To,onAdd:Cn}),It&&X!==null&&n.jsxs("div",{className:$e("px-3 border-b",_e?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>we(t=>!t),className:"flex w-full items-center justify-between gap-2 text-left cursor-pointer rounded-sm py-0.5 hover:bg-muted/40","aria-expanded":_e,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:l("sectionsEditor.sectionsEditor.variantRule")}),_e?n.jsx(Ma,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Va,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),_e&&n.jsx("div",{className:$e("space-y-3",Nt&&"pointer-events-none opacity-50"),children:n.jsx(Qn,{currentRt:X,currentLabel:Wt(dt?.rule,r??{},lt,i??void 0),currentGlobalKey:Ct(dt?.rule,r??{},i??void 0)??void 0,matchers:$t,globals:kn,onSelect:go,onSelectGlobal:vo,schema:po,formValue:xe,onChange:ho,formKey:`${Oe}:${X??""}`,formWrapperClassName:"space-y-3",meta:i??void 0,decofile:r,onSaveReferencedBlock:Lt,sandbox:Ot})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(jr,{listKey:`${k??""}-${Oe}`,rawSections:q,sections:Ue,meta:i,selectedIndex:p,onSelect:Js,onReorder:Xs,onDelete:Zs,onDuplicate:eo,onMakeReusable:Fe,onToggleHidden:to,onToggleLazy:no,onAddVariant:ln,onDetach:so,onAddSection:()=>ae(!0),canAddSection:fo})})]},"editor-section-list"),n.jsx(ca,{open:Z!==null,onOpenChange:t=>{t||Fe(null)},defaultBlockId:Z!==null?mn(Ue[Z]?.label??""):"",isPending:Ne.isPending,onSubmit:mo}),H&&n.jsx(or,{open:ve,onOpenChange:t=>{ae(t),t||(me.current=null)},meta:i,decofile:r,previewBaseUrl:H,onSelect:ao}),Ce&&k&&r&&n.jsx(ua,{open:Ce,onOpenChange:je,pageKey:k,decofile:r}),Pe!==null&&n.jsx(qn,{open:!0,initialName:kt(qe[Pe]?.rule,r??{},i??void 0)?Wt(qe[Pe]?.rule,r??{},lt,i??void 0):"",autoLabel:lt(Bt(qe[Pe]?.rule,r??{},i??void 0)),isPending:Nt,onSubmit:async t=>{await Vo(Pe,t)},onOpenChange:t=>{!t&&!Nt&&ye(null)}}),ce!==null&&n.jsx(qn,{open:!0,initialName:kt(bt[ce]?.rule,r??{},i??void 0)?Wt(bt[ce]?.rule,r??{},lt,i??void 0):"",autoLabel:lt(Bt(bt[ce]?.rule,r??{},i??void 0)),isPending:Nt,onSubmit:async t=>{await Do(ce,t)},onOpenChange:t=>{!t&&!Nt&&he(null)}})]})}export{Dc as SectionsEditor};
@@ -1 +1 @@
1
- import{r as i,aL as nt,aJ as Ne,j as d,c_ as rt,aN as be,aK as k,c$ as st,aG as j,aM as P,bS as $,d0 as lt,ac as _e,d1 as Ee,aH as at,bJ as ct,bU as it,d7 as dt,d8 as ut,d9 as pt,da as ft,d2 as mt,aI as ht,db as vt,d3 as gt,d5 as xt,c as ee,m as oe}from"./index-Gptoc_-0.js";import{V as St}from"./tooltip-CAY4Un9y.js";import{i as wt}from"./Check-BSC6j_AW.js";import{t as Re}from"./ChevronDown-CVKkscg7.js";import{n as Ct}from"./ChevronUp-CVzJYnye.js";function Pe(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=ht(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Nt,Pt]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:c,caller:J}),[F,q]=Ne({prop:s,defaultProp:l,onChange:a,caller:J}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:be(),value:F,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Nt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:F,onChange:E=>q(E.target.value),disabled:b,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:P(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var _t="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var Q="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?_e.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(Q,t),[x,U]=i.useState(null),[M,re]=i.useState(null),_=k(e,f=>U(f)),[O,F]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===y&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(F(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=y.indexOf(I);y=y.slice(N+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(Q,t),s=Y(Q,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,_=>h(_)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const _=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,N=F.left-I,X=_.left-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-F.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[U,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:U},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Ue=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Ue.displayName=we;var Fe="SelectGroup",[Dt,kt]=ne(Fe),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Fe;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:P(s.onFocus,()=>w(!0)),onBlur:P(s.onBlur,()=>w(!1)),onClick:P(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:P(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:P(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:P(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:P(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Pt(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Je=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ut.displayName=Ie;var Ft="SelectBubbleInput",Qe=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Qe.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Ue,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",translate:"no",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,Pe as e};
1
+ import{r as i,aL as nt,aJ as Ne,j as d,c_ as rt,aN as be,aK as k,c$ as st,aG as j,aM as P,bQ as $,d0 as lt,ac as _e,d1 as Ee,aH as at,bH as ct,bS as it,d7 as dt,d8 as ut,d9 as pt,da as ft,d2 as mt,aI as ht,db as vt,d3 as gt,d5 as xt,c as ee,m as oe}from"./index-dh0u4IqP.js";import{V as St}from"./tooltip-CCAgnlkx.js";import{i as wt}from"./Check-BjlTRmvp.js";import{t as Re}from"./ChevronDown-BansJwMw.js";import{n as Ct}from"./ChevronUp-CBwQlhRH.js";function Pe(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],It=[" ","Enter"],J="Select",[de,ue,bt]=at(J),[ne]=ht(J,[bt,Ee]),pe=Ee(),[Tt,G]=ne(J),[Nt,Pt]=ne(J),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:g,disabled:b,required:w,form:S}=r,p=pe(e),[v,C]=i.useState(null),[m,x]=i.useState(null),[F,M]=i.useState(!1),re=nt(u),[_,O]=Ne({prop:o,defaultProp:n??!1,onChange:c,caller:J}),[U,q]=Ne({prop:s,defaultProp:l,onChange:a,caller:J}),L=i.useRef(null),B=v?S||!!v.closest("form"):!0,[W,V]=i.useState(new Set),H=Array.from(W).map(E=>E.props.value).join(";");return d.jsx(rt,{...p,children:d.jsxs(Tt,{required:w,scope:e,trigger:v,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:F,onValueNodeHasChildrenChange:M,contentId:be(),value:U,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:b,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Nt,{scope:r.__scopeSelect,onNativeOptionAdd:i.useCallback(E=>{V(D=>new Set(D).add(E))},[]),onNativeOptionRemove:i.useCallback(E=>{V(D=>{const z=new Set(D);return z.delete(E),z})},[]),children:t})}),B?d.jsxs(Qe,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:g,value:U,onChange:E=>q(E.target.value),disabled:b,form:S,children:[U===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=J;var Me="SelectTrigger",Ae=i.forwardRef((r,e)=>{const{__scopeSelect:t,disabled:o=!1,...n}=r,c=pe(t),s=G(Me,t),l=s.disabled||o,a=k(e,s.onTriggerChange),u=ue(t),h=i.useRef("touch"),[g,b,w]=tt(p=>{const v=u().filter(x=>!x.disabled),C=v.find(x=>x.value===s.value),m=ot(v,p,C);m!==void 0&&s.onValueChange(m.value)}),S=p=>{l||(s.onOpenChange(!0),w()),p&&(s.triggerPointerDownPosRef.current={x:Math.round(p.pageX),y:Math.round(p.pageY)})};return d.jsx(st,{asChild:!0,...c,children:d.jsx(j.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":et(s.value)?"":void 0,...n,ref:a,onClick:P(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:P(n.onPointerDown,p=>{h.current=p.pointerType;const v=p.target;v.hasPointerCapture(p.pointerId)&&v.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:P(n.onKeyDown,p=>{const v=g.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&b(p.key),!(v&&p.key===" ")&&yt.includes(p.key)&&(S(),p.preventDefault())})})})});Ae.displayName=Me;var Oe="SelectValue",De=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,children:c,placeholder:s="",...l}=r,a=G(Oe,t),{onValueNodeHasChildrenChange:u}=a,h=c!==void 0,g=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:g,style:{pointerEvents:"none"},children:et(a.value)?d.jsx(d.Fragment,{children:s}):c})});De.displayName=Oe;var _t="SelectIcon",ke=i.forwardRef((r,e)=>{const{__scopeSelect:t,children:o,...n}=r;return d.jsx(j.span,{"aria-hidden":!0,...n,ref:e,children:o||"▼"})});ke.displayName=_t;var Et="SelectPortal",Le=r=>d.jsx(lt,{asChild:!0,...r});Le.displayName=Et;var Q="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(Q,r.__scopeSelect),[o,n]=i.useState();if($(()=>{n(new DocumentFragment)},[]),!t.open){const c=o;return c?_e.createPortal(d.jsx(Ve,{scope:r.__scopeSelect,children:d.jsx(de.Slot,{scope:r.__scopeSelect,children:d.jsx("div",{children:r.children})})}),c):null}return d.jsx(He,{...r,ref:e})});Be.displayName=Q;var A=10,[Ve,Y]=ne(Q),Rt="SelectContentImpl",jt=vt("SelectContent.RemoveScroll"),He=i.forwardRef((r,e)=>{const{__scopeSelect:t,position:o="item-aligned",onCloseAutoFocus:n,onEscapeKeyDown:c,onPointerDownOutside:s,side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v,...C}=r,m=G(Q,t),[x,F]=i.useState(null),[M,re]=i.useState(null),_=k(e,f=>F(f)),[O,U]=i.useState(null),[q,L]=i.useState(null),B=ue(t),[W,V]=i.useState(!1),H=i.useRef(!1);i.useEffect(()=>{if(x)return dt(x)},[x]),ut();const E=i.useCallback(f=>{const[T,...R]=B().map(N=>N.ref.current),[y]=R.slice(-1),I=document.activeElement;for(const N of f)if(N===I||(N?.scrollIntoView({block:"nearest"}),N===T&&M&&(M.scrollTop=0),N===y&&M&&(M.scrollTop=M.scrollHeight),N?.focus(),document.activeElement!==I))return},[B,M]),D=i.useCallback(()=>E([O,x]),[E,O,x]);i.useEffect(()=>{W&&D()},[W,D]);const{onOpenChange:z,triggerPointerDownPosRef:K}=m;i.useEffect(()=>{if(x){let f={x:0,y:0};const T=y=>{f={x:Math.abs(Math.round(y.pageX)-(K.current?.x??0)),y:Math.abs(Math.round(y.pageY)-(K.current?.y??0))}},R=y=>{f.x<=10&&f.y<=10?y.preventDefault():x.contains(y.target)||z(!1),document.removeEventListener("pointermove",T),K.current=null};return K.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",R,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",R,{capture:!0})}}},[x,z,K]),i.useEffect(()=>{const f=()=>z(!1);return window.addEventListener("blur",f),window.addEventListener("resize",f),()=>{window.removeEventListener("blur",f),window.removeEventListener("resize",f)}},[z]);const[fe,ae]=tt(f=>{const T=B().filter(I=>!I.disabled),R=T.find(I=>I.ref.current===document.activeElement),y=ot(T,f,R);y&&setTimeout(()=>y.ref.current.focus())}),me=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&(U(f),y&&(H.current=!0))},[m.value]),he=i.useCallback(()=>x?.focus(),[x]),te=i.useCallback((f,T,R)=>{const y=!H.current&&!R;(m.value!==void 0&&m.value===T||y)&&L(f)},[m.value]),ce=o==="popper"?Se:ze,se=ce===Se?{side:l,sideOffset:a,align:u,alignOffset:h,arrowPadding:g,collisionBoundary:b,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:v}:{};return d.jsx(Ve,{scope:t,content:x,viewport:M,onViewportChange:re,itemRefCallback:me,selectedItem:O,onItemLeave:he,itemTextRefCallback:te,focusSelectedItem:D,selectedItemText:q,position:o,isPositioned:W,searchRef:fe,children:d.jsx(pt,{as:jt,allowPinchZoom:!0,children:d.jsx(ft,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:P(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(mt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:s,onFocusOutside:f=>f.preventDefault(),onDismiss:()=>m.onOpenChange(!1),children:d.jsx(ce,{role:"listbox",id:m.contentId,"data-state":m.open?"open":"closed",dir:m.dir,onContextMenu:f=>f.preventDefault(),...C,...se,onPlaced:()=>V(!0),ref:_,style:{display:"flex",flexDirection:"column",outline:"none",...C.style},onKeyDown:P(C.onKeyDown,f=>{const T=f.ctrlKey||f.altKey||f.metaKey;if(f.key==="Tab"&&f.preventDefault(),!T&&f.key.length===1&&ae(f.key),["ArrowUp","ArrowDown","Home","End"].includes(f.key)){let y=B().filter(I=>!I.disabled).map(I=>I.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const I=f.target,N=y.indexOf(I);y=y.slice(N+1)}setTimeout(()=>E(y)),f.preventDefault()}})})})})})})});He.displayName=Rt;var Mt="SelectItemAlignedPosition",ze=i.forwardRef((r,e)=>{const{__scopeSelect:t,onPlaced:o,...n}=r,c=G(Q,t),s=Y(Q,t),[l,a]=i.useState(null),[u,h]=i.useState(null),g=k(e,_=>h(_)),b=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:v,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&v&&C){const _=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),U=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const I=q.left-O.left,N=U.left-I,X=_.left-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const I=O.right-q.right,N=window.innerWidth-U.right-I,X=window.innerWidth-_.right-N,Z=_.width+X,ve=Math.max(Z,O.width),ge=window.innerWidth-A,xe=Pe(N,[A,Math.max(A,ge-ve)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=b(),B=window.innerHeight-A*2,W=p.scrollHeight,V=window.getComputedStyle(u),H=parseInt(V.borderTopWidth,10),E=parseInt(V.paddingTop,10),D=parseInt(V.borderBottomWidth,10),z=parseInt(V.paddingBottom,10),K=H+E+W+z+D,fe=Math.min(v.offsetHeight*5,K),ae=window.getComputedStyle(p),me=parseInt(ae.paddingTop,10),he=parseInt(ae.paddingBottom,10),te=_.top+_.height/2-A,ce=B-te,se=v.offsetHeight/2,f=v.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const I=L.length>0&&v===L[L.length-1].ref.current;l.style.bottom="0px";const N=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(I?he:0)+N+D),Z=T+X;l.style.height=Z+"px"}else{const I=L.length>0&&v===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(I?me:0)+se)+R;l.style.height=X+"px",p.scrollTop=T-te+p.offsetTop}l.style.margin=`${A}px 0`,l.style.minHeight=fe+"px",l.style.maxHeight=B+"px",o?.(),requestAnimationFrame(()=>w.current=!0)}},[b,c.trigger,c.valueNode,l,u,p,v,C,c.dir,o]);$(()=>x(),[x]);const[F,M]=i.useState();$(()=>{u&&M(window.getComputedStyle(u).zIndex)},[u]);const re=i.useCallback(_=>{_&&S.current===!0&&(x(),m?.(),S.current=!1)},[x,m]);return d.jsx(Ot,{scope:t,contentWrapper:l,shouldExpandOnScrollRef:w,onScrollButtonChange:re,children:d.jsx("div",{ref:a,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:F},children:d.jsx(j.div,{...n,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...n.style}})})})});ze.displayName=Mt;var At="SelectPopperPosition",Se=i.forwardRef((r,e)=>{const{__scopeSelect:t,align:o="start",collisionPadding:n=A,...c}=r,s=pe(t);return d.jsx(gt,{...s,...c,ref:e,align:o,collisionPadding:n,style:{boxSizing:"border-box",...c.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Se.displayName=At;var[Ot,Te]=ne(Q,{}),we="SelectViewport",Fe=i.forwardRef((r,e)=>{const{__scopeSelect:t,nonce:o,...n}=r,c=Y(we,t),s=Te(we,t),l=k(e,c.onViewportChange),a=i.useRef(0);return d.jsxs(d.Fragment,{children:[d.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),d.jsx(de.Slot,{scope:t,children:d.jsx(j.div,{"data-radix-select-viewport":"",role:"presentation",...n,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...n.style},onScroll:P(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:b}=s;if(b?.current&&g){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(g.style.minHeight),v=parseFloat(g.style.height),C=Math.max(p,v);if(C<S){const m=C+w,x=Math.min(S,m),F=m-x;g.style.height=x+"px",g.style.bottom==="0px"&&(h.scrollTop=F>0?F:0,g.style.justifyContent="flex-end")}}}a.current=h.scrollTop})})})]})});Fe.displayName=we;var Ue="SelectGroup",[Dt,kt]=ne(Ue),Lt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=be();return d.jsx(Dt,{scope:t,id:n,children:d.jsx(j.div,{role:"group","aria-labelledby":n,...o,ref:e})})});Lt.displayName=Ue;var We="SelectLabel",Bt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=kt(We,t);return d.jsx(j.div,{id:n.id,...o,ref:e})});Bt.displayName=We;var ie="SelectItem",[Vt,Ke]=ne(ie),$e=i.forwardRef((r,e)=>{const{__scopeSelect:t,value:o,disabled:n=!1,textValue:c,...s}=r,l=G(ie,t),a=Y(ie,t),u=l.value===o,[h,g]=i.useState(c??""),[b,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=be(),v=i.useRef("touch"),C=()=>{n||(l.onValueChange(o),l.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return d.jsx(Vt,{scope:t,value:o,disabled:n,textId:p,isSelected:u,onItemTextChange:i.useCallback(m=>{g(x=>x||(m?.textContent??"").trim())},[]),children:d.jsx(de.ItemSlot,{scope:t,value:o,disabled:n,textValue:h,children:d.jsx(j.div,{role:"option","aria-labelledby":p,"data-highlighted":b?"":void 0,"aria-selected":u&&b,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:P(s.onFocus,()=>w(!0)),onBlur:P(s.onBlur,()=>w(!1)),onClick:P(s.onClick,()=>{v.current!=="mouse"&&C()}),onPointerUp:P(s.onPointerUp,()=>{v.current==="mouse"&&C()}),onPointerDown:P(s.onPointerDown,m=>{v.current=m.pointerType}),onPointerMove:P(s.onPointerMove,m=>{v.current=m.pointerType,n?a.onItemLeave?.():v.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:P(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:P(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(It.includes(m.key)&&C(),m.key===" "&&m.preventDefault())})})})})});$e.displayName=ie;var le="SelectItemText",Ge=i.forwardRef((r,e)=>{const{__scopeSelect:t,className:o,style:n,...c}=r,s=G(le,t),l=Y(le,t),a=Ke(le,t),u=Pt(le,t),[h,g]=i.useState(null),b=k(e,C=>g(C),a.onItemTextChange,C=>l.itemTextRefCallback?.(C,a.value,a.disabled)),w=h?.textContent,S=i.useMemo(()=>d.jsx("option",{value:a.value,disabled:a.disabled,children:w},a.value),[a.disabled,a.value,w]),{onNativeOptionAdd:p,onNativeOptionRemove:v}=u;return $(()=>(p(S),()=>v(S)),[p,v,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:b}),a.isSelected&&s.valueNode&&!s.valueNodeHasChildren?_e.createPortal(c.children,s.valueNode):null]})});Ge.displayName=le;var Ye="SelectItemIndicator",qe=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return Ke(Ye,t).isSelected?d.jsx(j.span,{"aria-hidden":!0,...o,ref:e}):null});qe.displayName=Ye;var Ce="SelectScrollUpButton",Xe=i.forwardRef((r,e)=>{const t=Y(Ce,r.__scopeSelect),o=Te(Ce,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollTop>0;c(u)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop-a.offsetHeight)}}):null});Xe.displayName=Ce;var ye="SelectScrollDownButton",Ze=i.forwardRef((r,e)=>{const t=Y(ye,r.__scopeSelect),o=Te(ye,r.__scopeSelect),[n,c]=i.useState(!1),s=k(e,o.onScrollButtonChange);return $(()=>{if(t.viewport&&t.isPositioned){let l=function(){const u=a.scrollHeight-a.clientHeight,h=Math.ceil(a.scrollTop)<u;c(h)};const a=t.viewport;return l(),a.addEventListener("scroll",l),()=>a.removeEventListener("scroll",l)}},[t.viewport,t.isPositioned]),n?d.jsx(Je,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Je=i.forwardRef((r,e)=>{const{__scopeSelect:t,onAutoScroll:o,...n}=r,c=Y("SelectScrollButton",t),s=i.useRef(null),l=ue(t),a=i.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return i.useEffect(()=>()=>a(),[a]),$(()=>{l().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[l]),d.jsx(j.div,{"aria-hidden":!0,...n,ref:e,style:{flexShrink:0,...n.style},onPointerDown:P(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:P(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:P(n.onPointerLeave,()=>{a()})})}),Ht="SelectSeparator",zt=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r;return d.jsx(j.div,{"aria-hidden":!0,...o,ref:e})});zt.displayName=Ht;var Ie="SelectArrow",Ft=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(Ie,t),s=Y(Ie,t);return c.open&&s.position==="popper"?d.jsx(xt,{...n,...o,ref:e}):null});Ft.displayName=Ie;var Ut="SelectBubbleInput",Qe=i.forwardRef(({__scopeSelect:r,value:e,...t},o)=>{const n=i.useRef(null),c=k(o,n),s=ct(e);return i.useEffect(()=>{const l=n.current;if(!l)return;const a=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(a,"value").set;if(s!==e&&h){const g=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(g)}},[s,e]),d.jsx(j.select,{...t,style:{...St,...t.style},ref:c,defaultValue:e})});Qe.displayName=Ut;function et(r){return r===""||r===void 0}function tt(r){const e=it(r),t=i.useRef(""),o=i.useRef(0),n=i.useCallback(s=>{const l=t.current+s;e(l),(function a(u){t.current=u,window.clearTimeout(o.current),u!==""&&(o.current=window.setTimeout(()=>a(""),1e3))})(l)},[e]),c=i.useCallback(()=>{t.current="",window.clearTimeout(o.current)},[]);return i.useEffect(()=>()=>window.clearTimeout(o.current),[]),[t,n,c]}function ot(r,e,t){const n=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,c=t?r.indexOf(t):-1;let s=Wt(r,Math.max(c,0));n.length===1&&(s=s.filter(u=>u!==t));const a=s.find(u=>u.textValue.toLowerCase().startsWith(n.toLowerCase()));return a!==t?a:void 0}function Wt(r,e){return r.map((t,o)=>r[(e+o)%r.length])}var Kt=je,$t=Ae,Gt=De,Yt=ke,qt=Le,Xt=Be,Zt=Fe,Jt=$e,Qt=Ge,eo=qe,to=Xe,oo=Ze;function uo(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Kt,{"data-slot":"select",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(r){const e=ee.c(4);let t;e[0]!==r?({...t}=r,e[0]=r,e[1]=t):t=e[1];let o;return e[2]!==t?(o=d.jsx(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function fo(r){const e=ee.c(13);let t,o,n,c;e[0]!==r?({className:o,size:c,children:t,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?"default":c;let l;e[5]!==o?(l=oe("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 hover:bg-accent hover:text-accent-foreground dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-lg bg-background px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:ring-[2px] card-shadow disabled:opacity-50 data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=xs]:h-6 data-[size=xs]:px-2.5 data-[size=xs]:py-1.5 data-[size=xs]:rounded-lg *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]===Symbol.for("react.memo_cache_sentinel")?(a=d.jsx(Yt,{asChild:!0,children:d.jsx(Re,{className:"size-4 opacity-50"})}),e[7]=a):a=e[7];let u;return e[8]!==t||e[9]!==n||e[10]!==s||e[11]!==l?(u=d.jsxs($t,{"data-slot":"select-trigger","data-size":s,className:l,...n,children:[t,a]}),e[8]=t,e[9]=n,e[10]=s,e[11]=l,e[12]=u):u=e[12],u}function mo(r){const e=ee.c(25);let t,o,n,c,s;e[0]!==r?({className:o,children:t,position:c,hideScrollButtons:s,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c,e[5]=s):(t=e[1],o=e[2],n=e[3],c=e[4],s=e[5]);const l=c===void 0?"popper":c,a=s===void 0?!1:s,u=l==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1";let h;e[6]!==o||e[7]!==u?(h=oe("notranslate bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border shadow-md",u,o),e[6]=o,e[7]=u,e[8]=h):h=e[8];let g;e[9]!==a?(g=!a&&d.jsx(no,{}),e[9]=a,e[10]=g):g=e[10];const b=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==b?(w=oe("p-1",b),e[11]=b,e[12]=w):w=e[12];let S;e[13]!==t||e[14]!==w?(S=d.jsx(Zt,{className:w,children:t}),e[13]=t,e[14]=w,e[15]=S):S=e[15];let p;e[16]!==a?(p=!a&&d.jsx(ro,{}),e[16]=a,e[17]=p):p=e[17];let v;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==g||e[22]!==S||e[23]!==p?(v=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",translate:"no",className:h,position:l,...n,children:[g,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=g,e[22]=S,e[23]=p,e[24]=v):v=e[24],v}function ho(r){const e=ee.c(16);let t,o,n,c;e[0]!==r?({className:o,children:t,hideCheck:c,...n}=r,e[0]=r,e[1]=t,e[2]=o,e[3]=n,e[4]=c):(t=e[1],o=e[2],n=e[3],c=e[4]);const s=c===void 0?!1:c;let l;e[5]!==o?(l=oe("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",o),e[5]=o,e[6]=l):l=e[6];let a;e[7]!==s?(a=!s&&d.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:d.jsx(eo,{children:d.jsx(wt,{className:"size-4"})})}),e[7]=s,e[8]=a):a=e[8];let u;e[9]!==t?(u=d.jsx(Qt,{children:t}),e[9]=t,e[10]=u):u=e[10];let h;return e[11]!==n||e[12]!==l||e[13]!==a||e[14]!==u?(h=d.jsxs(Jt,{"data-slot":"select-item",className:l,...n,children:[a,u]}),e[11]=n,e[12]=l,e[13]=a,e[14]=u,e[15]=h):h=e[15],h}function no(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Ct,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(to,{"data-slot":"select-scroll-up-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}function ro(r){const e=ee.c(9);let t,o;e[0]!==r?({className:t,...o}=r,e[0]=r,e[1]=t,e[2]=o):(t=e[1],o=e[2]);let n;e[3]!==t?(n=oe("flex cursor-default items-center justify-center py-1",t),e[3]=t,e[4]=n):n=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c=d.jsx(Re,{className:"size-4"}),e[5]=c):c=e[5];let s;return e[6]!==o||e[7]!==n?(s=d.jsx(oo,{"data-slot":"select-scroll-down-button",className:n,...o,children:c}),e[6]=o,e[7]=n,e[8]=s):s=e[8],s}export{uo as S,fo as a,po as b,mo as c,ho as d,Pe as e};