decocms 4.255.4 → 4.256.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 (230) hide show
  1. package/dist/client/assets/{AlertCircle-rzbi7fmi.js → AlertCircle-DjH3xyxR.js} +1 -1
  2. package/dist/client/assets/{AreaChart-CuKqt6_P.js → AreaChart-DCXmgZor.js} +1 -1
  3. package/dist/client/assets/{ArrowLeft-D-nEST6C.js → ArrowLeft-CziJuoiK.js} +1 -1
  4. package/dist/client/assets/{ArrowUp-BfWB8MD1.js → ArrowUp-DGCVmSXN.js} +1 -1
  5. package/dist/client/assets/{Check-DPWJue1l.js → Check-DOZ1j5aP.js} +1 -1
  6. package/dist/client/assets/{CheckCircle-CzbHy_NQ.js → CheckCircle-DlOtm9Ya.js} +1 -1
  7. package/dist/client/assets/{ChevronDown-Bchtg7Ey.js → ChevronDown-CfTwRjpu.js} +1 -1
  8. package/dist/client/assets/{ChevronRight-ywp7R8fi.js → ChevronRight-CcZYXLnk.js} +1 -1
  9. package/dist/client/assets/{ChevronSelectorVertical-fzOl_PXo.js → ChevronSelectorVertical-BfQxyKLG.js} +1 -1
  10. package/dist/client/assets/{ChevronUp-CJaWrIn8.js → ChevronUp-DY84NWjt.js} +1 -1
  11. package/dist/client/assets/{Copy01-C1V4JSjm.js → Copy01-DZeibaPx.js} +1 -1
  12. package/dist/client/assets/{CreditCard01-BgWLt525.js → CreditCard01-CUs2cJ7L.js} +1 -1
  13. package/dist/client/assets/{DotsVertical-CtCazyXg.js → DotsVertical-Dx1RUx8-.js} +1 -1
  14. package/dist/client/assets/{Download01-B8eccotb.js → Download01-j6HzmTHn.js} +1 -1
  15. package/dist/client/assets/{Eye-CVdFbQPq.js → Eye-CFyW3JW2.js} +1 -1
  16. package/dist/client/assets/{FilterLines-CHSA0Ovv.js → FilterLines-CxzK-qgs.js} +1 -1
  17. package/dist/client/assets/{Globe01-C4uOnzpB.js → Globe01-CeczlHYX.js} +1 -1
  18. package/dist/client/assets/{Globe04-4ZySY2dL.js → Globe04-CkwPSY_6.js} +1 -1
  19. package/dist/client/assets/{HardDrive-BpDqLmKr.js → HardDrive-BvarQXTY.js} +1 -1
  20. package/dist/client/assets/{Key01-CIlMRmOa.js → Key01-Cjud0Kdq.js} +1 -1
  21. package/dist/client/assets/{LinkExternal01-BnF74p76.js → LinkExternal01-Cqt6eGQK.js} +1 -1
  22. package/dist/client/assets/{LockUnlocked01-CFo18Geo.js → LockUnlocked01-CzcG9NTf.js} +1 -1
  23. package/dist/client/assets/{LogOut01-mY61xNf_.js → LogOut01-B4zaIeTL.js} +1 -1
  24. package/dist/client/assets/{Monitor01-DRcJh9rJ.js → Monitor01-CMLvYrbC.js} +1 -1
  25. package/dist/client/assets/{Palette-Dyv90Vji.js → Palette-DTRR7mtd.js} +1 -1
  26. package/dist/client/assets/{Play-DHTGlq1Y.js → Play-iwBwEV5N.js} +1 -1
  27. package/dist/client/assets/{Plus-BBG-uYzF.js → Plus-B9dgrF--.js} +1 -1
  28. package/dist/client/assets/{SearchLg-3Irji4Em.js → SearchLg-CY0Zjox7.js} +1 -1
  29. package/dist/client/assets/{SearchMd-BiEg7og4.js → SearchMd-D0B5ipxb.js} +1 -1
  30. package/dist/client/assets/{Settings02-DdRb7E0Q.js → Settings02-BXdaEYOk.js} +1 -1
  31. package/dist/client/assets/{Share07-Cx9rW-3h.js → Share07-CGfdFKWg.js} +1 -1
  32. package/dist/client/assets/{Shield01-Dj1i5rRJ.js → Shield01-BmPhKNd6.js} +1 -1
  33. package/dist/client/assets/{Stars01-DsEuNQa4.js → Stars01-C11eqixJ.js} +1 -1
  34. package/dist/client/assets/{Stars02-CQidlt1A.js → Stars02-CpxAP5Pb.js} +1 -1
  35. package/dist/client/assets/{Sun-CedAoEhV.js → Sun-Cl27J9U3.js} +1 -1
  36. package/dist/client/assets/{SwitchHorizontal01-BBS3aq1G.js → SwitchHorizontal01-BxN6tEz7.js} +1 -1
  37. package/dist/client/assets/{Tool01-DYiLYfEf.js → Tool01-CkxUn0iW.js} +1 -1
  38. package/dist/client/assets/{Tool02-53gDBxa-.js → Tool02-DxTCQ0L-.js} +1 -1
  39. package/dist/client/assets/{Trash01-hrM9uQgS.js → Trash01-BvQnygca.js} +1 -1
  40. package/dist/client/assets/{TrendUp01-CHalSWAC.js → TrendUp01-Bw1Pok-m.js} +1 -1
  41. package/dist/client/assets/{Upload01-DgdhEYC-.js → Upload01-BB6Rmyxr.js} +1 -1
  42. package/dist/client/assets/{User01-9rQwsqCE.js → User01-BMq0jB1V.js} +1 -1
  43. package/dist/client/assets/{UserSquare-BK8-agqd.js → UserSquare-DfgVTJvP.js} +1 -1
  44. package/dist/client/assets/{Users01-CBrs1-WF.js → Users01-BdSUgolZ.js} +1 -1
  45. package/dist/client/assets/{Users03-Ckv8dpNK.js → Users03-CHcjaWYR.js} +1 -1
  46. package/dist/client/assets/{XCircle-VjO5lI8H.js → XCircle-DDtIWV0E.js} +1 -1
  47. package/dist/client/assets/{XClose-BivECxO7.js → XClose-C6KRE0bv.js} +1 -1
  48. package/dist/client/assets/{YAxis-BUFR5b9Q.js → YAxis-Cq6K7bZw.js} +1 -1
  49. package/dist/client/assets/{Zap-Cnsys2Wq.js → Zap-BDHGOkVa.js} +1 -1
  50. package/dist/client/assets/{ZapSquare-CSYRxph5.js → ZapSquare-BnYLgre0.js} +1 -1
  51. package/dist/client/assets/{access-gate-C37vr7HM.js → access-gate-EtqXElxp.js} +1 -1
  52. package/dist/client/assets/{agent-icon-BUsh3oGt.js → agent-icon-DVUH-8t0.js} +1 -1
  53. package/dist/client/assets/{agents-list-BSXmKvPI.js → agents-list-CgfHkH3x.js} +1 -1
  54. package/dist/client/assets/{ai-providers-ByCNS5tk.js → ai-providers-CNtLA1r8.js} +1 -1
  55. package/dist/client/assets/{alert-BqDinRfy.js → alert--LSYTiNk.js} +1 -1
  56. package/dist/client/assets/{alert-dialog-hhGN1kzx.js → alert-dialog-DRqYR-1I.js} +1 -1
  57. package/dist/client/assets/{api-keys-DHBiaV_r.js → api-keys-BK6IA4u-.js} +1 -1
  58. package/dist/client/assets/{app-editor-C0hCGxtl.js → app-editor-bRAPrIgI.js} +1 -1
  59. package/dist/client/assets/{auth-BbVa1hsz.js → auth-CAPmNKdk.js} +1 -1
  60. package/dist/client/assets/{auth-catchall-CFKvepKy.js → auth-catchall-VesZxJ_i.js} +1 -1
  61. package/dist/client/assets/{auth-entry-BXkmPqvH.js → auth-entry-q5VeEZ7J.js} +1 -1
  62. package/dist/client/assets/{auth-split-layout-CQECvTjT.js → auth-split-layout-dpudzhOk.js} +1 -1
  63. package/dist/client/assets/{authenticate-and-persist-oauth-BW7lPmR8.js → authenticate-and-persist-oauth-J_cn2ztF.js} +1 -1
  64. package/dist/client/assets/{automation-list-row-6SRFf-_b.js → automation-list-row-BPLY-7BK.js} +1 -1
  65. package/dist/client/assets/{automation-runs-BQ0Iu53B.js → automation-runs-BScmV1SD.js} +1 -1
  66. package/dist/client/assets/{automations-DXRcT17e.js → automations-BVW4HAON.js} +1 -1
  67. package/dist/client/assets/{avatar-CffKfcxD.js → avatar--qZZWxNU.js} +1 -1
  68. package/dist/client/assets/{badge-DdvBiEJO.js → badge-D0zX1eM-.js} +1 -1
  69. package/dist/client/assets/{block-document-Dp95KQeN.js → block-document-DxhIV_Ff.js} +1 -1
  70. package/dist/client/assets/{buckets-C-YB4kjm.js → buckets-gO7WaJ97.js} +1 -1
  71. package/dist/client/assets/{bulk-category-panel-xdEU6TlG.js → bulk-category-panel-CrKag3H4.js} +1 -1
  72. package/dist/client/assets/{capability-load-error-DifEo2uP.js → capability-load-error-c-shWty6.js} +1 -1
  73. package/dist/client/assets/{cards-BImfAb5p.js → cards-CdLHnXN_.js} +1 -1
  74. package/dist/client/assets/category-editor-A-8GgMDm.js +1 -0
  75. package/dist/client/assets/{chart-CQDerfwb.js → chart-81L9BaQL.js} +1 -1
  76. package/dist/client/assets/{chat-context-BSlnS4lO.js → chat-context-DKWpBi6a.js} +1 -1
  77. package/dist/client/assets/{checkbox-DvnU-G5n.js → checkbox-Cqcbv288.js} +1 -1
  78. package/dist/client/assets/{choose-editor-DDZWpEEU.js → choose-editor-RLNtEZ-p.js} +1 -1
  79. package/dist/client/assets/{cli-auth-success-BKkBveK7.js → cli-auth-success-akJyZ8fO.js} +1 -1
  80. package/dist/client/assets/{collection-detail-i2uJ3G4p.js → collection-detail-Bqy1vUme.js} +1 -1
  81. package/dist/client/assets/{collection-display-button-DUWiE5Mh.js → collection-display-button-BA2Ptsp-.js} +1 -1
  82. package/dist/client/assets/{collection-search-D5bU0Mny.js → collection-search-CH69fupc.js} +1 -1
  83. package/dist/client/assets/{collection-table-wrapper-6LuinD6M.js → collection-table-wrapper-cFpInRxw.js} +1 -1
  84. package/dist/client/assets/{collection-tabs-DSNouQYO.js → collection-tabs-D68YVO29.js} +1 -1
  85. package/dist/client/assets/{command-DO658f9K.js → command-DASwAiw_.js} +1 -1
  86. package/dist/client/assets/{commerce-onboarding-DTgTL1Sa.js → commerce-onboarding-OcbvgI0U.js} +1 -1
  87. package/dist/client/assets/{connect-Bo1Gdnm2.js → connect-CDR58mLA.js} +1 -1
  88. package/dist/client/assets/{connection-BMZxDUto.js → connection-bqsOaagt.js} +1 -1
  89. package/dist/client/assets/{connection-card-BxOv_0Pb.js → connection-card-BudTMzOk.js} +1 -1
  90. package/dist/client/assets/{connection-detail-Ceqi_UkX.js → connection-detail-BGT9MTfC.js} +1 -1
  91. package/dist/client/assets/{connection-form-helpers-DwrLlCes.js → connection-form-helpers-ojGyy-IO.js} +1 -1
  92. package/dist/client/assets/{connections-sw9Pef3f.js → connections-Ch25tjdR.js} +1 -1
  93. package/dist/client/assets/{decopilot-sse-pool-CnQZuU8U.js → decopilot-sse-pool-zGwptasN.js} +1 -1
  94. package/dist/client/assets/{dialog-CRgUvUGD.js → dialog-DxKkTLbq.js} +1 -1
  95. package/dist/client/assets/{domain-settings-BHqc8jTd.js → domain-settings-CnNxAAa_.js} +1 -1
  96. package/dist/client/assets/{drawer-B5fFyIgX.js → drawer-D5TQ4QVU.js} +1 -1
  97. package/dist/client/assets/{dropdown-menu-C0p1X71u.js → dropdown-menu-3KGTt1z3.js} +1 -1
  98. package/dist/client/assets/{empty-state-nAEi4fmW.js → empty-state-UI9Z1qLy.js} +1 -1
  99. package/dist/client/assets/{extract-connection-data-D3s8EYsm.js → extract-connection-data-DZTXwtVS.js} +1 -1
  100. package/dist/client/assets/{file-explorer-C3wPz2g1.js → file-explorer-Bo7tUQrp.js} +1 -1
  101. package/dist/client/assets/{file-type-icon-BxCMRXC7.js → file-type-icon-DulzLg6u.js} +1 -1
  102. package/dist/client/assets/{form-CkF9Gll6.js → form-CiwKi0eV.js} +1 -1
  103. package/dist/client/assets/{general-Bvd3m1q-.js → general-D1udCWrh.js} +1 -1
  104. package/dist/client/assets/{github-repo-picker-uCh44L_P.js → github-repo-picker-BScZw3f5.js} +1 -1
  105. package/dist/client/assets/{hooks-BMvgJI-g.js → hooks-DvLJppZz.js} +1 -1
  106. package/dist/client/assets/{index-DGbNQLI2.js → index-6TUUAs0P.js} +1 -1
  107. package/dist/client/assets/index-B4zhLaf0.js +743 -0
  108. package/dist/client/assets/{index-C7yUTQLC.js → index-BCewMvAz.js} +1 -1
  109. package/dist/client/assets/index-BUxq6Quv.css +1 -0
  110. package/dist/client/assets/{index-CRX5z-Jb.js → index-C77SbC4v.js} +1 -1
  111. package/dist/client/assets/{index-dzFuJh3g.js → index-CD1kCBvU.js} +1 -1
  112. package/dist/client/assets/{index-CWPBMaeR.js → index-CuBLEvj-.js} +1 -1
  113. package/dist/client/assets/{index-BxFod4ty.js → index-Dg3zOF_b.js} +1 -1
  114. package/dist/client/assets/{index-eMuSvnay.js → index-KDqP1Gsm.js} +5 -5
  115. package/dist/client/assets/{index-CxD2n68d.js → index-lN3Kk5pV.js} +1 -1
  116. package/dist/client/assets/{index-D5JaHC8m.js → index-m5nFFJNc.js} +1 -1
  117. package/dist/client/assets/{index-redirect-CSQT7dVz.js → index-redirect-C0J_kUJk.js} +1 -1
  118. package/dist/client/assets/{infra-billing-D1_-S4Iu.js → infra-billing-DI2Y4vVB.js} +1 -1
  119. package/dist/client/assets/{input-CzXHUUzJ.js → input-DquBu4q_.js} +1 -1
  120. package/dist/client/assets/{integration-icon-UAHcQu3Y.js → integration-icon-BrtysDGX.js} +1 -1
  121. package/dist/client/assets/{invite-member-dialog-a03LtCNI.js → invite-member-dialog-DzwU7umf.js} +1 -1
  122. package/dist/client/assets/{label-C-f36Ery.js → label-ZOErmdFJ.js} +1 -1
  123. package/dist/client/assets/{layout-ExdNCowx.js → layout-Cy5bQEl4.js} +1 -1
  124. package/dist/client/assets/{login-BoUiAbPR.js → login-VLjZXeGw.js} +1 -1
  125. package/dist/client/assets/{mcp-oauth-EpOxhfnN.js → mcp-oauth-DszQiwE1.js} +1 -1
  126. package/dist/client/assets/{members-DRacrCiw.js → members-C8lxBlfP.js} +1 -1
  127. package/dist/client/assets/{monaco-editor-DXWGpYdI.js → monaco-editor-C5-L9oYo.js} +1 -1
  128. package/dist/client/assets/{monitoring-stats-row-CStChSPF.js → monitoring-stats-row-CMTirhA_.js} +1 -1
  129. package/dist/client/assets/{multi-select-V9DJTmBZ.js → multi-select-n4bAr9Zp.js} +1 -1
  130. package/dist/client/assets/{oauth-callback-CvsRTDAl.js → oauth-callback-DBMmKlsN.js} +1 -1
  131. package/dist/client/assets/{oauth-callback-ai-provider-BTZRnTS3.js → oauth-callback-ai-provider-CdqiywFX.js} +1 -1
  132. package/dist/client/assets/{onboarding-og3I_xVV.js → onboarding-OdSEPimz.js} +1 -1
  133. package/dist/client/assets/{org-layout-QWnp58dZ.js → org-layout-C5IU65OM.js} +1 -1
  134. package/dist/client/assets/{organization-choice-DurkooFh.js → organization-choice-DnsM9pNG.js} +1 -1
  135. package/dist/client/assets/{orgs-jsXpwgtJ.js → orgs-CbnZ7h-Q.js} +1 -1
  136. package/dist/client/assets/{page-seo-form-CKaXssEk.js → page-seo-form-BzP0n8PA.js} +1 -1
  137. package/dist/client/assets/{popover-OOnmalBV.js → popover-Cc7-lSFL.js} +1 -1
  138. package/dist/client/assets/post-calendar-BqIT2hFq.js +1 -0
  139. package/dist/client/assets/post-editor-C853HFd9.js +1 -0
  140. package/dist/client/assets/{primitives-BhZ-HVLG.js → primitives--7giJHoI.js} +1 -1
  141. package/dist/client/assets/{profile-BRSzqaGC.js → profile-b1xOiRIb.js} +1 -1
  142. package/dist/client/assets/{project-app-view-C5juFf3y.js → project-app-view-BPx3lXP-.js} +1 -1
  143. package/dist/client/assets/record-editor-Ci8FkTL8.js +1 -0
  144. package/dist/client/assets/redirect-editor-MpI9qFcI.js +1 -0
  145. package/dist/client/assets/registry-DDqV90kI.js +2 -0
  146. package/dist/client/assets/{registry-layout-CaPQ8D3m.js → registry-layout-Dje9_Pw7.js} +1 -1
  147. package/dist/client/assets/{reports-CZRAYZND.js → reports-CvESZ09I.js} +1 -1
  148. package/dist/client/assets/{require-capability-CDs1Pl6o.js → require-capability-CD8g4GZw.js} +1 -1
  149. package/dist/client/assets/{required-auth-layout-D7eBvpct.js → required-auth-layout-7VMDmYlx.js} +1 -1
  150. package/dist/client/assets/{reset-password-DDPC0WP5.js → reset-password-DYOEssGg.js} +1 -1
  151. package/dist/client/assets/{roles-qcaRRwf8.js → roles-CkpQFPzG.js} +1 -1
  152. package/dist/client/assets/{search-input-Dv3_1Uvp.js → search-input-CNOVPBHV.js} +1 -1
  153. package/dist/client/assets/{secrets-DcwYYhlg.js → secrets-B-_4tsjR.js} +1 -1
  154. package/dist/client/assets/{sections-editor-DNihJe6v.js → sections-editor-BYrBcZni.js} +2 -2
  155. package/dist/client/assets/{select-Cf3o4e13.js → select-eugfdpxm.js} +1 -1
  156. package/dist/client/assets/{select-model-B7Rf8Feb.js → select-model-DOqZtA1i.js} +1 -1
  157. package/dist/client/assets/{self-tool-result-BawREriG.js → self-tool-result-Dd4smcIO.js} +1 -1
  158. package/dist/client/assets/{seo-editor-D_IRi8v_.js → seo-editor-DEpZxhOl.js} +1 -1
  159. package/dist/client/assets/{settings-layout-BgcGIDRi.js → settings-layout-DQXzr0Sh.js} +1 -1
  160. package/dist/client/assets/{shell-controls-BkJPCi4L.js → shell-controls-CWZB_FpS.js} +1 -1
  161. package/dist/client/assets/{shell-layout-DPDTGLA3.js → shell-layout-CE5eExEo.js} +1 -1
  162. package/dist/client/assets/{spinner-CeAynGXW.js → spinner-Imce-mLB.js} +1 -1
  163. package/dist/client/assets/{sso-BlKU6Kgb.js → sso-Cifiek4Y.js} +1 -1
  164. package/dist/client/assets/{store-BYS_aOKm.js → store-CK7mosa-.js} +1 -1
  165. package/dist/client/assets/store-registry-Cpoe8XIH.js +2 -0
  166. package/dist/client/assets/{switch-EyKGbAqJ.js → switch-C5Rry-Me.js} +1 -1
  167. package/dist/client/assets/{synced-repos-BUf8qMc_.js → synced-repos-DOPExdrQ.js} +1 -1
  168. package/dist/client/assets/{tab-id-BupMUSAp.js → tab-id-DinXx1o5.js} +1 -1
  169. package/dist/client/assets/{table-ByGDNySe.js → table-Dbx9Pc-x.js} +1 -1
  170. package/dist/client/assets/{tabs-YXze6Pex.js → tabs-CuiSn5Mm.js} +1 -1
  171. package/dist/client/assets/{task-key-D6-3eaXs.js → task-key-DoaQpMwZ.js} +1 -1
  172. package/dist/client/assets/{tasks-CjQzsFHS.js → tasks-u6QngN4K.js} +1 -1
  173. package/dist/client/assets/{textarea-BUU8Uzj2.js → textarea-174bDQE7.js} +1 -1
  174. package/dist/client/assets/{toggle-group-5udoaIQ7.js → toggle-group-BQziHXLf.js} +1 -1
  175. package/dist/client/assets/{toolbar-jStDQiC9.js → toolbar-Pc89mgDQ.js} +1 -1
  176. package/dist/client/assets/{track-x1Ue_gqj.js → track-xoJwVMpw.js} +1 -1
  177. package/dist/client/assets/{types-CWfqP-B-.js → types-CtwCSU1x.js} +1 -1
  178. package/dist/client/assets/{use-ai-providers-BJFNFBW8.js → use-ai-providers-CndNGdcW.js} +1 -1
  179. package/dist/client/assets/{use-api-keys-zvnJANCI.js → use-api-keys-1danG7pi.js} +1 -1
  180. package/dist/client/assets/{use-automations-CJu_L57g.js → use-automations-BKt_nFW6.js} +1 -1
  181. package/dist/client/assets/{use-autosave-xiJNpL3o.js → use-autosave-CuDCa7fL.js} +1 -1
  182. package/dist/client/assets/{use-clock-tick-BY6Y0vZc.js → use-clock-tick-B7i0loC3.js} +1 -1
  183. package/dist/client/assets/{use-commerce-diagnostic-DogDSREs.js → use-commerce-diagnostic-CCcvJLvQ.js} +1 -1
  184. package/dist/client/assets/{use-connection-CrWZq_Ri.js → use-connection-CP1FWxHa.js} +1 -1
  185. package/dist/client/assets/{use-copy-X4stx05l.js → use-copy-4jxScS2N.js} +1 -1
  186. package/dist/client/assets/{use-create-virtual-mcp-DnKX51Fm.js → use-create-virtual-mcp-CBGyaN-e.js} +1 -1
  187. package/dist/client/assets/{use-debounced-autosave-C2GBWe-g.js → use-debounced-autosave-C9BDQzJT.js} +1 -1
  188. package/dist/client/assets/{use-debounced-value-pQUbNH4F.js → use-debounced-value-DvFQNrA4.js} +1 -1
  189. package/dist/client/assets/{use-decopilot-events-DS-28zR1.js → use-decopilot-events-BOeKlCK5.js} +1 -1
  190. package/dist/client/assets/{use-delete-connection-B9dJVi18.js → use-delete-connection-BDe9IWNL.js} +1 -1
  191. package/dist/client/assets/{use-deployment-admin-CzS4BgDQ.js → use-deployment-admin-DpVuqwb3.js} +1 -1
  192. package/dist/client/assets/{use-file-configs-bqn0DQl-.js → use-file-configs-CjiPcdqh.js} +1 -1
  193. package/dist/client/assets/{use-infinite-scroll-DING_ypo.js → use-infinite-scroll-DPdm26Ur.js} +1 -1
  194. package/dist/client/assets/{use-join-requests-COAIroPq.js → use-join-requests-BY-M3-Wr.js} +1 -1
  195. package/dist/client/assets/{use-mcp-client-DMgRONuR.js → use-mcp-client-Ccglhaff.js} +1 -1
  196. package/dist/client/assets/{use-mcp-tools-CrszPH3e.js → use-mcp-tools-x79FIbn7.js} +1 -1
  197. package/dist/client/assets/{use-members-D74i7CK7.js → use-members-CSBEydJ8.js} +1 -1
  198. package/dist/client/assets/{use-navigate-to-agent-D-PAXyxX.js → use-navigate-to-agent-B8BcWQ50.js} +1 -1
  199. package/dist/client/assets/{use-org-auth-client-DGlgRRC_.js → use-org-auth-client-BXAWQl35.js} +1 -1
  200. package/dist/client/assets/{use-org-repo-syncs-L_Q9jn6Z.js → use-org-repo-syncs-1h1QSKDP.js} +1 -1
  201. package/dist/client/assets/{use-org-sso-DIKj2vIX.js → use-org-sso-D7W8pK7z.js} +1 -1
  202. package/dist/client/assets/{use-organization-roles-CW54FQjL.js → use-organization-roles-C5lDHfhe.js} +1 -1
  203. package/dist/client/assets/{use-organization-settings-KBGKqIJR.js → use-organization-settings-BDurak7I.js} +1 -1
  204. package/dist/client/assets/{use-registry-connections-B0WaaMcP.js → use-registry-connections-CgEt8cpb.js} +1 -1
  205. package/dist/client/assets/{use-secrets-Cv3PcVUL.js → use-secrets-CDdfMi4k.js} +1 -1
  206. package/dist/client/assets/{use-section-preview-base-BItk4_Sy.js → use-section-preview-base-DrHgFpHq.js} +1 -1
  207. package/dist/client/assets/{use-status-sounds-CTsRBUIT.js → use-status-sounds-NumgFytv.js} +1 -1
  208. package/dist/client/assets/{use-tags-DB9UyYAF.js → use-tags-BExTG9Q4.js} +1 -1
  209. package/dist/client/assets/{use-view-mode-jGpQ2LaX.js → use-view-mode-8n7hEdfy.js} +1 -1
  210. package/dist/client/assets/{use-virtual-mcp-M6mi7VuQ.js → use-virtual-mcp-C5AQ8t-k.js} +1 -1
  211. package/dist/client/assets/useInfiniteQuery-DZxkhGF0.js +1 -0
  212. package/dist/client/assets/useSuspenseInfiniteQuery-DRpl4v3w.js +1 -0
  213. package/dist/client/assets/{users-Csrapr9p.js → users-DxjgaH-D.js} +1 -1
  214. package/dist/client/assets/variant-calendar-mqt1rWPe.js +1 -0
  215. package/dist/client/assets/{view-mode-toggle-CemYbpmR.js → view-mode-toggle-Cb6KUXWi.js} +1 -1
  216. package/dist/client/index.html +2 -2
  217. package/dist/server/cli.js +1 -1
  218. package/dist/server/server.js +1 -1
  219. package/package.json +1 -1
  220. package/dist/client/assets/category-editor-BTtM_Oym.js +0 -1
  221. package/dist/client/assets/index-CxZcM7iI.js +0 -743
  222. package/dist/client/assets/index-DZ9B9lIh.css +0 -1
  223. package/dist/client/assets/post-editor-CFCYmhEe.js +0 -1
  224. package/dist/client/assets/record-editor-BGJ3Uxr9.js +0 -1
  225. package/dist/client/assets/redirect-editor-BgmzxDxm.js +0 -1
  226. package/dist/client/assets/registry-Us39sPL5.js +0 -2
  227. package/dist/client/assets/store-registry-BPg2BhqF.js +0 -2
  228. package/dist/client/assets/useInfiniteQuery-BUqQM02C.js +0 -1
  229. package/dist/client/assets/useSuspenseInfiniteQuery-DtiiRZ-l.js +0 -1
  230. package/dist/client/assets/variant-calendar-BEGxTpND.js +0 -1
@@ -1,2 +1,2 @@
1
- import{c as We,b as ut,r as T,n as ze,j as n,aC as Zn,ab as _t,a8 as jt,B as Ze,a9 as Et,k as es,p as La,t as Y,K as Ka}from"./index-eMuSvnay.js";import{b as Fa}from"./chat-context-BSlnS4lO.js";import{as as ts,at as Ia,au as Oa,av as $a,aw as za,a7 as ns,a8 as Xt,ax as ss,ay as as,a9 as os,aa as rs,az as is,aA as Ha,ah as ls,ai as cs,aB as Ua,aC as Ga,aD as us,P as qa,ab as ds,ac as Bt,af as ms,ag as fs,ad as ps,an as gs,aE as Wa,aF as Lt,aG as hs,aH as Ja,S as vs,aI as ct,H as bs,aJ as Ya,aK as Qa,aL as Xa,aM as Za,F as eo,G as to,aN as no,aO as so,aP as ao,aQ as oo,al as qt,aR as Wt,aS as ro,aT as xt,aU as Ct,aV as io,aW as lo,aX as st,aY as Kn,aZ as co,a_ as At,a$ as Jt,b0 as uo,b1 as fn,b2 as mo,b3 as Tt,b4 as fo,b5 as po,b6 as go,b7 as ho,b8 as vo,b9 as yt,ba as bo,bb as So,bc as xo,J as yo,bd as Fn,be as Mt,bf as In,bg as On,bh as _o,bi as jo,bj as Eo,bk as Ro,bl as pn,bm as $n,bn as zn,bo as Nt,bp as Yt,bq as Hn,br as wo,bs as gn,bt as ko,bu as To,bv as No,bw as Vo,bx as Do}from"./index-CxZcM7iI.js";import{t as Po}from"./ChevronDown-Bchtg7Ey.js";import{ah as vn,x as Co,V as Ss,G as Ao,w as xs,ao as Mo,r as Bo}from"./agent-icon-BUsh3oGt.js";import{i as ys}from"./ChevronRight-ywp7R8fi.js";import{n as Lo}from"./ChevronUp-CJaWrIn8.js";import{i as Ko}from"./Globe01-C4uOnzpB.js";import{B as Qt}from"./automation-runs-BQ0Iu53B.js";import{b as Fo,h as Io,a as Oo,c as $o,d as zo,e as Ho}from"./dialog-CRgUvUGD.js";import{I as Uo}from"./input-CzXHUUzJ.js";import{a as _s}from"./Copy01-C1V4JSjm.js";import{i as Go}from"./Settings02-DdRb7E0Q.js";import{s as qo}from"./Eye-CVdFbQPq.js";import{s as js}from"./TrendUp01-CHalSWAC.js";import{s as bn}from"./Plus-BBG-uYzF.js";import{s as Es}from"./Trash01-hrM9uQgS.js";import{i as Wo}from"./Zap-Cnsys2Wq.js";import{D as Rs,a as bt,c as ws,b as ks,i as Jo}from"./dropdown-menu-C0p1X71u.js";import{S as Yo,r as Un,u as Qo,d as Xo,a as Zo,i as er,f as tr,P as nr,b as sr}from"./page-seo-form-CKaXssEk.js";import{b as ar}from"./Tool01-DYiLYfEf.js";import{u as or,A as rr}from"./use-section-preview-base-BItk4_Sy.js";import"./tab-id-BupMUSAp.js";import"./Check-DPWJue1l.js";import"./Download01-B8eccotb.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-BMvgJI-g.js";import"./use-mcp-client-DMgRONuR.js";import"./constants-_08zpzmT.js";import"./auth-BbVa1hsz.js";import"./decopilot-sse-pool-CnQZuU8U.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-M6mi7VuQ.js";import"./use-ai-providers-BJFNFBW8.js";import"./use-decopilot-events-DS-28zR1.js";import"./use-organization-settings-KBGKqIJR.js";import"./ArrowUp-BfWB8MD1.js";import"./spinner-CeAynGXW.js";import"./drawer-B5fFyIgX.js";import"./collection-search-D5bU0Mny.js";import"./SearchMd-BiEg7og4.js";import"./chart-CQDerfwb.js";import"./index-CRX5z-Jb.js";import"./shell-layout-DPDTGLA3.js";import"./avatar-CffKfcxD.js";import"./User01-9rQwsqCE.js";import"./Users03-Ckv8dpNK.js";import"./SearchLg-3Irji4Em.js";import"./Stars02-CQidlt1A.js";import"./XClose-BivECxO7.js";import"./CheckCircle-CzbHy_NQ.js";import"./FilterLines-CHSA0Ovv.js";import"./Monitor01-DRcJh9rJ.js";import"./required-auth-layout-D7eBvpct.js";import"./use-org-sso-DIKj2vIX.js";import"./XCircle-VjO5lI8H.js";import"./Upload01-DgdhEYC-.js";import"./AlertCircle-rzbi7fmi.js";import"./form-CkF9Gll6.js";import"./label-C-f36Ery.js";import"./select-Cf3o4e13.js";import"./UserSquare-BK8-agqd.js";import"./ArrowLeft-D-nEST6C.js";import"./tabs-YXze6Pex.js";import"./Tool02-53gDBxa-.js";import"./toggle-group-5udoaIQ7.js";import"./use-commerce-diagnostic-DogDSREs.js";import"./popover-OOnmalBV.js";import"./self-tool-result-BawREriG.js";import"./alert-dialog-hhGN1kzx.js";import"./integration-icon-UAHcQu3Y.js";import"./extract-connection-data-D3s8EYsm.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-pQUbNH4F.js";import"./LinkExternal01-BnF74p76.js";import"./authenticate-and-persist-oauth-BW7lPmR8.js";import"./mcp-oauth-EpOxhfnN.js";import"./track-x1Ue_gqj.js";import"./toolbar-jStDQiC9.js";import"./github-repo-picker-uCh44L_P.js";import"./use-connection-CrWZq_Ri.js";import"./LockUnlocked01-CFo18Geo.js";import"./use-mcp-tools-CrszPH3e.js";import"./use-navigate-to-agent-D-PAXyxX.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-BxOv_0Pb.js";import"./use-registry-connections-B0WaaMcP.js";import"./useInfiniteQuery-BUqQM02C.js";import"./use-infinite-scroll-DING_ypo.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-BUU8Uzj2.js";import"./connection-form-helpers-DwrLlCes.js";import"./collection-tabs-DSNouQYO.js";import"./badge-DdvBiEJO.js";import"./useSuspenseInfiniteQuery-DtiiRZ-l.js";import"./command-DO658f9K.js";import"./index-DGbNQLI2.js";import"./use-clock-tick-BY6Y0vZc.js";import"./DotsVertical-CtCazyXg.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./select-model-B7Rf8Feb.js";import"./checkbox-DvnU-G5n.js";import"./ChevronSelectorVertical-fzOl_PXo.js";import"./Key01-CIlMRmOa.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Stars01-DsEuNQa4.js";import"./cards-BImfAb5p.js";import"./Share07-Cx9rW-3h.js";import"./Palette-Dyv90Vji.js";import"./file-type-icon-BxCMRXC7.js";import"./question-004-sINsf4GQ.js";import"./use-members-D74i7CK7.js";import"./use-org-auth-client-DGlgRRC_.js";import"./use-status-sounds-CTsRBUIT.js";import"./empty-state-nAEi4fmW.js";import"./ZapSquare-CSYRxph5.js";import"./types-CWfqP-B-.js";import"./use-file-configs-bqn0DQl-.js";import"./monaco-editor-DXWGpYdI.js";import"./pt-BR-CLy76QW2.js";import"./switch-EyKGbAqJ.js";import"./Play-DHTGlq1Y.js";import"./use-debounced-autosave-C2GBWe-g.js";import"./search-input-Dv3_1Uvp.js";import"./index-C7yUTQLC.js";import"./Users01-CBrs1-WF.js";import"./use-secrets-Cv3PcVUL.js";import"./AreaChart-CuKqt6_P.js";import"./task-key-D6-3eaXs.js";import"./use-copy-X4stx05l.js";import"./SwitchHorizontal01-BBS3aq1G.js";import"./use-tags-DB9UyYAF.js";import"./get-initials-D-f_fDFw.js";import"./use-automations-CJu_L57g.js";import"./automation-list-row-6SRFf-_b.js";import"./use-org-repo-syncs-L_Q9jn6Z.js";import"./CreditCard01-BgWLt525.js";import"./Globe04-4ZySY2dL.js";import"./HardDrive-BpDqLmKr.js";import"./LogOut01-mY61xNf_.js";import"./Sun-CedAoEhV.js";import"./Shield01-Dj1i5rRJ.js";import"./table-ByGDNySe.js";function ir(m){return m.schema?.definitions??m.schema?.$defs??{}}function Ts(m,e){const o=ir(e),l=o[btoa(m)];if(!l)return[];const d=[l];if(Array.isArray(l.allOf)){const h=l.allOf.find(b=>typeof b.$ref=="string")?.$ref;if(typeof h=="string"){const b=o[h.replace("#/definitions/","")];b&&d.push(b)}}return d}function lr(m,e){for(const o of Ts(m,e)){const l=typeof o.image=="string"?o.image:void 0;if(l?.includes("{{{"))return l}}function cr(m,e){if(!e)return;const o=ts(m);if(!o)return;const l=lr(o.resolveType,e);if(!l)return;const d=Ia(l,o.data);if(d)return Oa(d)}const ur={escape:za};function dr(m,e){for(const o of Ts(m,e)){const l=typeof o.title=="string"?o.title:void 0;if(l?.includes("{{"))return l}}function mr(m,e){if(!e)return;const o=ts(m);if(o)try{const l=dr(o.resolveType,e);return l&&$a.render(l,o.data,{},ur).trim()||void 0}catch{return}}const fr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",pr="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 Gn(m){return Array.from({length:m},(e,o)=>({id:crypto.randomUUID(),index:o}))}function Ns(m){return m.map((e,o)=>({...e,index:o}))}function gr(m,e){if(e===m.length)return m;if(e<m.length)return Ns(m.slice(0,e));const o=Array.from({length:e-m.length},(l,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...o]}function Vs(m){const e=We.c(25),{section:o,raw:l,meta:d}=m,h=o.isSavedBlock===!0,b=o.isMultivariate===!0;let p;e[0]!==d||e[1]!==l?(p=l&&d?cr(l,d):void 0,e[0]=d,e[1]=l,e[2]=p):p=e[2];const v=p;let f;e[3]!==d||e[4]!==b||e[5]!==l||e[6]!==h?(f=l&&d&&!h&&!b?mr(l,d):void 0,e[3]=d,e[4]=b,e[5]=l,e[6]=h,e[7]=f):f=e[7];const R=f;let V;e[8]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(Co,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=V):V=e[8];let D;e[9]!==v?(D=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]=D):D=e[10];let j;e[11]!==b||e[12]!==h?(j=h?{color:qa}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=b,e[12]=h,e[13]=j):j=e[13];let i;e[14]!==j?(i=n.jsx(vn,{className:"h-4 w-4 shrink-0",style:j}),e[14]=j,e[15]=i):i=e[15];const x=o.isHidden&&"line-through opacity-50";let E;e[16]!==x?(E=ze("min-w-0 flex-1 truncate text-sm font-medium",x),e[16]=x,e[17]=E):E=e[17];const c=R??o.label;let w;e[18]!==E||e[19]!==c?(w=n.jsx("span",{className:E,children:c}),e[18]=E,e[19]=c,e[20]=w):w=e[20];let r;return e[21]!==w||e[22]!==D||e[23]!==i?(r=n.jsxs(n.Fragment,{children:[V,D,i,w]}),e[21]=w,e[22]=D,e[23]=i,e[24]=r):r=e[24],r}const hr="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",vr="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]",br="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 hn(m,e){return ze("h-7 shrink-0 overflow-hidden",e?hr:m?br:vr)}function Ds(m,e){const o=m.isSavedBlock===!0,l=m.isMultivariate===!0;return ze("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":o?fr:l?us:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Sr(m){const e=We.c(82),{section:o,raw:l,meta:d,sortableId:h,selected:b,onSelect:p,onDelete:v,onDuplicate:f,onMakeReusable:R,onToggleHidden:V,onToggleLazy:D,onAddVariant:j,onDetach:i}=m,x=ut(),E=l?is(l.__resolveType??""):!1,c=o.isHidden===!0,w=E||c;let r;e[0]!==o?(r=Ha(o),e[0]=o,e[1]=r):r=e[1];const B=r;let I;e[2]!==h?(I={id:h,animateLayoutChanges:Er},e[2]=h,e[3]=I):I=e[3];const{attributes:X,listeners:K,setNodeRef:g,transform:L,isDragging:ke}=ls(I);let C;e[4]!==L?(C=cs.Transform.toString(L?{...L,x:0}:null),e[4]=L,e[5]=C):C=e[5];const te=ke?0:void 0;let P;e[6]!==C||e[7]!==te?(P={transform:C,opacity:te},e[6]=C,e[7]=te,e[8]=P):P=e[8];const ne=P;let O;e[9]!==o?(O=Ua(o),e[9]=o,e[10]=O):O=e[10];const Ae=O,xe="button",Te=0;let W;e[11]!==p?(W=k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),p())},e[11]=p,e[12]=W):W=e[12];const de=ke?"cursor-grabbing":"cursor-pointer";let re;e[13]!==o||e[14]!==b||e[15]!==de?(re=ze("touch-none transition-colors",de,Ds(o,b)),e[13]=o,e[14]=b,e[15]=de,e[16]=re):re=e[16];let se;e[17]!==d||e[18]!==l||e[19]!==o?(se=n.jsx(Vs,{section:o,raw:l,meta:d}),e[17]=d,e[18]=l,e[19]=o,e[20]=se):se=e[20];const F=!o.isMultivariate&&n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":x(E?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ze(hn(w,E)),onClick:k=>{k.stopPropagation(),D()},onPointerDown:jr,children:n.jsx(Wo,{className:ze("h-3.5 w-3.5",E&&"text-yellow-500")})})}),n.jsx(Et,{side:"bottom",children:x(E?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ye=!o.isMultivariate&&n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":x(c?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ze(hn(w,c)),onClick:k=>{k.stopPropagation(),V()},onPointerDown:_r,children:c?n.jsx(Go,{className:"h-3.5 w-3.5"}):n.jsx(qo,{className:"h-3.5 w-3.5"})})}),n.jsx(Et,{side:"bottom",children:x(c?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),Ke=ws,Fe=Rs,Be=!0,$=Ze,me="button",Ie="ghost",Me="icon";let ee;e[21]!==x?(ee=x("sectionsEditor.sectionList.sectionActionsMenu"),e[21]=x,e[22]=ee):ee=e[22];const ye=ze(hn(w,!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 ie;e[23]===Symbol.for("react.memo_cache_sentinel")?(ie=n.jsx(Ss,{className:"h-3.5 w-3.5"}),e[23]=ie):ie=e[23];let le;e[24]!==$||e[25]!==ee||e[26]!==ye?(le=n.jsx($,{type:me,variant:Ie,size:Me,"aria-label":ee,className:ye,onClick:yr,onPointerDown:xr,children:ie}),e[24]=$,e[25]=ee,e[26]=ye,e[27]=le):le=e[27];let fe;e[28]!==Fe||e[29]!==le?(fe=n.jsx(Fe,{asChild:Be,children:le}),e[28]=Fe,e[29]=le,e[30]=fe):fe=e[30];let pe;e[31]!==f?(pe=k=>{k.stopPropagation(),f()},e[31]=f,e[32]=pe):pe=e[32];let ge;e[33]===Symbol.for("react.memo_cache_sentinel")?(ge=n.jsx(_s,{className:"h-4 w-4"}),e[33]=ge):ge=e[33];let _e;e[34]!==x?(_e=x("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=x,e[35]=_e):_e=e[35];let je;e[36]!==pe||e[37]!==_e?(je=n.jsxs(bt,{onClick:pe,children:[ge,_e]}),e[36]=pe,e[37]=_e,e[38]=je):je=e[38];let ce;e[39]!==B||e[40]!==j||e[41]!==x?(ce=B&&n.jsxs(bt,{className:Ga,onClick:k=>{k.stopPropagation(),j()},children:[n.jsx(js,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=B,e[40]=j,e[41]=x,e[42]=ce):ce=e[42];let z;e[43]!==Ae||e[44]!==R||e[45]!==x?(z=Ae&&n.jsxs(bt,{className:pr,onClick:k=>{k.stopPropagation(),R()},children:[n.jsx(vn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=Ae,e[44]=R,e[45]=x,e[46]=z):z=e[46];let Ee;e[47]!==i||e[48]!==o.isMultivariate||e[49]!==o.isSavedBlock||e[50]!==x?(Ee=o.isSavedBlock===!0&&!o.isMultivariate&&n.jsxs(bt,{onClick:k=>{k.stopPropagation(),i()},children:[n.jsx(vn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=o.isMultivariate,e[49]=o.isSavedBlock,e[50]=x,e[51]=Ee):Ee=e[51];let he;e[52]!==v?(he=k=>{k.stopPropagation(),v()},e[52]=v,e[53]=he):he=e[53];let Re;e[54]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(Es,{className:"h-4 w-4"}),e[54]=Re):Re=e[54];let ae;e[55]!==x?(ae=x("sectionsEditor.sectionList.deleteMenuItem"),e[55]=x,e[56]=ae):ae=e[56];let Z;e[57]!==he||e[58]!==ae?(Z=n.jsxs(bt,{className:"text-destructive focus:text-destructive",onClick:he,children:[Re,ae]}),e[57]=he,e[58]=ae,e[59]=Z):Z=e[59];let ue;e[60]!==je||e[61]!==ce||e[62]!==z||e[63]!==Ee||e[64]!==Z?(ue=n.jsxs(ks,{align:"end",className:"w-44",children:[je,ce,z,Ee,Z]}),e[60]=je,e[61]=ce,e[62]=z,e[63]=Ee,e[64]=Z,e[65]=ue):ue=e[65];let ve;e[66]!==Ke||e[67]!==fe||e[68]!==ue?(ve=n.jsxs(Ke,{children:[fe,ue]}),e[66]=Ke,e[67]=fe,e[68]=ue,e[69]=ve):ve=e[69];let Ne;return e[70]!==X||e[71]!==K||e[72]!==p||e[73]!==g||e[74]!==ne||e[75]!==re||e[76]!==se||e[77]!==F||e[78]!==Ye||e[79]!==ve||e[80]!==W?(Ne=n.jsxs("div",{ref:g,style:ne,...X,...K,role:xe,tabIndex:Te,onClick:p,onKeyDown:W,className:re,children:[se,F,Ye,ve]}),e[70]=X,e[71]=K,e[72]=p,e[73]=g,e[74]=ne,e[75]=re,e[76]=se,e[77]=F,e[78]=Ye,e[79]=ve,e[80]=W,e[81]=Ne):Ne=e[81],Ne}function xr(m){return m.stopPropagation()}function yr(m){return m.stopPropagation()}function _r(m){return m.stopPropagation()}function jr(m){return m.stopPropagation()}function Er(){return!1}function Rr(m){const e=We.c(104),{listKey:o,rawSections:l,sections:d,meta:h,selectedIndex:b,onSelect:p,onReorder:v,onDelete:f,onDuplicate:R,onMakeReusable:V,onToggleHidden:D,onToggleLazy:j,onAddVariant:i,onDetach:x,onAddSection:E,canAddSection:c}=m,w=c===void 0?!0:c,r=ut();let B;e[0]!==d.length?(B=()=>Gn(d.length),e[0]=d.length,e[1]=B):B=e[1];const[I,X]=T.useState(B),[K,g]=T.useState(null),[L,ke]=T.useState(o),[C,te]=T.useState(d.length),P=T.useRef(!1);L!==o?(ke(o),te(d.length),X(Gn(d.length))):C!==d.length&&(te(d.length),X(Ne=>gr(Ne,d.length)));let ne;e[2]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[2]=ne):ne=e[2];let O;e[3]===Symbol.for("react.memo_cache_sentinel")?(O={coordinateGetter:ds},e[3]=O):O=e[3];const Ae=ns(Xt(rs,ne),Xt(os,O));let xe;e[4]!==I?(xe=I.map(wr),e[4]=I,e[5]=xe):xe=e[5];const Te=xe;let W;e[6]===Symbol.for("react.memo_cache_sentinel")?(W=Ne=>{g(String(Ne.active.id))},e[6]=W):W=e[6];const de=W;let re;e[7]!==Te||e[8]!==v?(re=Ne=>{g(null);const{active:k,over:be}=Ne;if(!be||k.id===be.id)return;const oe=Te.indexOf(String(k.id)),Ve=Te.indexOf(String(be.id));oe===-1||Ve===-1||(X(Oe=>Ns(Bt([...Oe],oe,Ve))),P.current=!0,requestAnimationFrame(()=>{P.current=!1}),v?.(oe,Ve))},e[7]=Te,e[8]=v,e[9]=re):re=e[9];const se=re;let F;e[10]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{g(null)},e[10]=F):F=e[10];const Ye=F;let Ke,Fe,Be,$,me,Ie,Me,ee,ye,ie,le,fe,pe,ge,_e;if(e[11]!==K||e[12]!==w||e[13]!==I||e[14]!==Te||e[15]!==se||e[16]!==h||e[17]!==E||e[18]!==i||e[19]!==f||e[20]!==x||e[21]!==R||e[22]!==V||e[23]!==p||e[24]!==D||e[25]!==j||e[26]!==l||e[27]!==d||e[28]!==b||e[29]!==Ae||e[30]!==r){ge=Symbol.for("react.early_return_sentinel");e:{const Ne=k=>{P.current||p(k)};if(e[46]!==K||e[47]!==w||e[48]!==I||e[49]!==E||e[50]!==l||e[51]!==d||e[52]!==r){const k=K?I.find(be=>be.id===K):null;if($=k!=null?d[k.index]:null,Be=k!=null?l[k.index]:void 0,I.length===0){let be;e[56]!==r?(be=r("sectionsEditor.sectionList.noSections"),e[56]=r,e[57]=be):be=e[57];let oe;e[58]!==be?(oe=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:be}),e[58]=be,e[59]=oe):oe=e[59];const Ve=!w;let Oe;e[60]===Symbol.for("react.memo_cache_sentinel")?(Oe=n.jsx(bn,{size:14}),e[60]=Oe):Oe=e[60];let dt;e[61]!==r?(dt=r("sectionsEditor.sectionList.addSectionButton"),e[61]=r,e[62]=dt):dt=e[62];let De;e[63]!==E||e[64]!==Ve||e[65]!==dt?(De=n.jsxs(Ze,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ve,onClick:E,children:[Oe,dt]}),e[63]=E,e[64]=Ve,e[65]=dt,e[66]=De):De=e[66];let et;e[67]!==oe||e[68]!==De?(et=n.jsxs("div",{className:"space-y-2",children:[oe,De]}),e[67]=oe,e[68]=De,e[69]=et):et=e[69],ge=et;break e}pe=ze(k&&"cursor-grabbing"),e[46]=K,e[47]=w,e[48]=I,e[49]=E,e[50]=l,e[51]=d,e[52]=r,e[53]=Be,e[54]=$,e[55]=pe}else Be=e[53],$=e[54],pe=e[55];Fe=ms,ee=Ae,ye=fs,ie=de,le=se,fe=Ye,Ke=ps,Ie=Te,Me=gs,_e="space-y-1",me=I.map(k=>{const be=d[k.index];return be?n.jsx(Sr,{sortableId:k.id,section:be,raw:l[k.index],meta:h,selected:b===k.index,onSelect:()=>Ne(k.index),onDelete:()=>f(k.index),onDuplicate:()=>R(k.index),onMakeReusable:()=>V(k.index),onToggleHidden:()=>D(k.index),onToggleLazy:()=>j(k.index),onAddVariant:()=>i(k.index),onDetach:()=>x(k.index)},k.id):null})}e[11]=K,e[12]=w,e[13]=I,e[14]=Te,e[15]=se,e[16]=h,e[17]=E,e[18]=i,e[19]=f,e[20]=x,e[21]=R,e[22]=V,e[23]=p,e[24]=D,e[25]=j,e[26]=l,e[27]=d,e[28]=b,e[29]=Ae,e[30]=r,e[31]=Ke,e[32]=Fe,e[33]=Be,e[34]=$,e[35]=me,e[36]=Ie,e[37]=Me,e[38]=ee,e[39]=ye,e[40]=ie,e[41]=le,e[42]=fe,e[43]=pe,e[44]=ge,e[45]=_e}else Ke=e[31],Fe=e[32],Be=e[33],$=e[34],me=e[35],Ie=e[36],Me=e[37],ee=e[38],ye=e[39],ie=e[40],le=e[41],fe=e[42],pe=e[43],ge=e[44],_e=e[45];if(ge!==Symbol.for("react.early_return_sentinel"))return ge;let je;e[70]!==me||e[71]!==_e?(je=n.jsx("div",{className:_e,children:me}),e[70]=me,e[71]=_e,e[72]=je):je=e[72];let ce;e[73]!==Ke||e[74]!==Ie||e[75]!==Me||e[76]!==je?(ce=n.jsx(Ke,{items:Ie,strategy:Me,children:je}),e[73]=Ke,e[74]=Ie,e[75]=Me,e[76]=je,e[77]=ce):ce=e[77];let z;e[78]!==Be||e[79]!==$||e[80]!==h?(z=$?n.jsx("div",{className:ze("cursor-grabbing shadow-lg ring-1 ring-border/60",Ds($,!1)),children:n.jsx(Vs,{section:$,raw:Be,meta:h})}):null,e[78]=Be,e[79]=$,e[80]=h,e[81]=z):z=e[81];let Ee;e[82]!==z?(Ee=Zn.createPortal(n.jsx(ss,{dropAnimation:as,children:z}),document.body),e[82]=z,e[83]=Ee):Ee=e[83];let he;e[84]!==Fe||e[85]!==ee||e[86]!==ye||e[87]!==ie||e[88]!==le||e[89]!==fe||e[90]!==ce||e[91]!==Ee?(he=n.jsxs(Fe,{sensors:ee,collisionDetection:ye,onDragStart:ie,onDragEnd:le,onDragCancel:fe,children:[ce,Ee]}),e[84]=Fe,e[85]=ee,e[86]=ye,e[87]=ie,e[88]=le,e[89]=fe,e[90]=ce,e[91]=Ee,e[92]=he):he=e[92];const Re=!w;let ae;e[93]===Symbol.for("react.memo_cache_sentinel")?(ae=n.jsx(bn,{size:14}),e[93]=ae):ae=e[93];let Z;e[94]!==r?(Z=r("sectionsEditor.sectionList.addSectionButton"),e[94]=r,e[95]=Z):Z=e[95];let ue;e[96]!==E||e[97]!==Re||e[98]!==Z?(ue=n.jsxs(Ze,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Re,onClick:E,children:[ae,Z]}),e[96]=E,e[97]=Re,e[98]=Z,e[99]=ue):ue=e[99];let ve;return e[100]!==pe||e[101]!==he||e[102]!==ue?(ve=n.jsxs("div",{className:pe,children:[he,ue]}),e[100]=pe,e[101]=he,e[102]=ue,e[103]=ve):ve=e[103],ve}function wr(m){return m.id}function qn(m){const e=We.c(57),{open:o,initialName:l,autoLabel:d,isPending:h,onSubmit:b,onOpenChange:p}=m,v=h===void 0?!1:h,f=ut(),[R,V]=T.useState(l),[D,j]=T.useState(o);o!==D&&(j(o),o&&V(l));let i;e[0]!==v||e[1]!==p?(i=de=>{!de&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=i):i=e[2];const x=i;let E;e[3]!==v||e[4]!==R||e[5]!==b?(E=async de=>{de.preventDefault(),!v&&await b(R.trim())},e[3]=v,e[4]=R,e[5]=b,e[6]=E):E=e[6];const c=E;let w;e[7]!==f?(w=f("sectionsEditor.variantRenameDialog.title"),e[7]=f,e[8]=w):w=e[8];let r;e[9]!==w?(r=n.jsx(Fo,{children:w}),e[9]=w,e[10]=r):r=e[10];let B;e[11]!==d||e[12]!==f?(B=f("sectionsEditor.variantRenameDialog.description",{fallback:d||f("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=d,e[12]=f,e[13]=B):B=e[13];let I;e[14]!==B?(I=n.jsx(Io,{children:B}),e[14]=B,e[15]=I):I=e[15];let X;e[16]!==r||e[17]!==I?(X=n.jsxs(Oo,{children:[r,I]}),e[16]=r,e[17]=I,e[18]=X):X=e[18];let K;e[19]!==f?(K=f("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=f,e[20]=K):K=e[20];let g;e[21]!==K?(g=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:K}),e[21]=K,e[22]=g):g=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=de=>V(de.target.value),e[23]=L):L=e[23];let ke;e[24]!==d||e[25]!==v||e[26]!==R?(ke=n.jsx(Uo,{id:"variant-rename-name",value:R,onChange:L,placeholder:d,autoFocus:!0,disabled:v}),e[24]=d,e[25]=v,e[26]=R,e[27]=ke):ke=e[27];let C;e[28]!==g||e[29]!==ke?(C=n.jsxs("div",{className:"space-y-1.5 py-4",children:[g,ke]}),e[28]=g,e[29]=ke,e[30]=C):C=e[30];let te;e[31]!==p?(te=()=>p(!1),e[31]=p,e[32]=te):te=e[32];let P;e[33]!==f?(P=f("sectionsEditor.variantRenameDialog.cancel"),e[33]=f,e[34]=P):P=e[34];let ne;e[35]!==v||e[36]!==te||e[37]!==P?(ne=n.jsx(Ze,{type:"button",variant:"outline",onClick:te,disabled:v,children:P}),e[35]=v,e[36]=te,e[37]=P,e[38]=ne):ne=e[38];let O;e[39]!==v||e[40]!==f?(O=v?n.jsxs(n.Fragment,{children:[n.jsx(es,{size:14,className:"animate-spin"}),f("sectionsEditor.variantRenameDialog.saving")]}):f("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=f,e[41]=O):O=e[41];let Ae;e[42]!==v||e[43]!==O?(Ae=n.jsx(Ze,{type:"submit",disabled:v,children:O}),e[42]=v,e[43]=O,e[44]=Ae):Ae=e[44];let xe;e[45]!==ne||e[46]!==Ae?(xe=n.jsxs($o,{children:[ne,Ae]}),e[45]=ne,e[46]=Ae,e[47]=xe):xe=e[47];let Te;e[48]!==c||e[49]!==C||e[50]!==xe||e[51]!==X?(Te=n.jsx(zo,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:c,children:[X,C,xe]})}),e[48]=c,e[49]=C,e[50]=xe,e[51]=X,e[52]=Te):Te=e[52];let W;return e[53]!==x||e[54]!==o||e[55]!==Te?(W=n.jsx(Ho,{open:o,onOpenChange:x,children:Te}),e[53]=x,e[54]=o,e[55]=Te,e[56]=W):W=e[56],W}function Ps(m){const e=We.c(5),{rule:o,matchers:l}=m,d=o?.__resolveType??"";let h;if(e[0]!==l||e[1]!==d){const f=l.find(R=>R.resolveType===d)?.iconName??Wa(d);h=Ao(f),e[0]=l,e[1]=d,e[2]=h}else h=e[2];const b=h;if(!b)return null;let p;return e[3]!==b?(p=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=p):p=e[4],p}function Wn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
- `)}function Jn(m){return m.map((e,o)=>({id:crypto.randomUUID(),index:o,variant:e}))}function kr(m,e){const o=new Map;for(const l of m){const d=o.get(l.variant.label);d?d.push(l):o.set(l.variant.label,[l])}return e.map((l,d)=>({id:o.get(l.label)?.shift()?.id??crypto.randomUUID(),index:d,variant:l}))}function Tr(m){return m.map((e,o)=>({...e,index:o}))}function Cs(m){const e=We.c(17),{label:o,effectiveRule:l,matchers:d,canDelete:h,dragging:b,onRename:p,onDuplicate:v,onDelete:f}=m,R=ut();let V;e[0]!==l||e[1]!==d?(V=n.jsx(Ps,{rule:l,matchers:d}),e[0]=l,e[1]=d,e[2]=V):V=e[2];let D;e[3]!==o?(D=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:o}),e[3]=o,e[4]=D):D=e[4];let j;e[5]!==h||e[6]!==b||e[7]!==o||e[8]!==f||e[9]!==v||e[10]!==p||e[11]!==R?(j=!b&&n.jsxs(ws,{children:[n.jsx(Rs,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":R("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:o}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Vr,onPointerDown:Nr,children:n.jsx(Ss,{size:14})})}),n.jsxs(ks,{align:"end",className:"w-36",children:[n.jsxs(bt,{onClick:x=>{x.stopPropagation(),p?.()},children:[n.jsx(ar,{size:14}),R("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(bt,{onClick:x=>{x.stopPropagation(),v?.()},children:[n.jsx(_s,{size:14}),R("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Jo,{}),n.jsxs(bt,{variant:"destructive",disabled:!h,onClick:x=>{x.stopPropagation(),f?.()},children:[n.jsx(Es,{size:14}),R("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=h,e[6]=b,e[7]=o,e[8]=f,e[9]=v,e[10]=p,e[11]=R,e[12]=j):j=e[12];let i;return e[13]!==V||e[14]!==D||e[15]!==j?(i=n.jsxs(n.Fragment,{children:[V,D,j]}),e[13]=V,e[14]=D,e[15]=j,e[16]=i):i=e[16],i}function Nr(m){return m.stopPropagation()}function Vr(m){return m.stopPropagation()}function Dr(m){const e=We.c(33),{entry:o,isActive:l,canDelete:d,decofile:h,meta:b,matchers:p,onSelect:v,onRename:f,onDuplicate:R,onDelete:V}=m;let D;e[0]!==o.id?(D={id:o.id,animateLayoutChanges:Pr},e[0]=o.id,e[1]=D):D=e[1];const{attributes:j,listeners:i,setNodeRef:x,transform:E,isDragging:c}=ls(D);let w;e[2]!==E?(w=cs.Transform.toString(E?{...E,x:0}:null),e[2]=E,e[3]=w):w=e[3];const r=c?0:void 0;let B;e[4]!==w||e[5]!==r?(B={transform:w,opacity:r},e[4]=w,e[5]=r,e[6]=B):B=e[6];const I=B,X=b??void 0;let K;e[7]!==h||e[8]!==o.variant.rule||e[9]!==X?(K=Lt(o.variant.rule,h,X),e[7]=h,e[8]=o.variant.rule,e[9]=X,e[10]=K):K=e[10];const g=K;let L;e[11]!==v?(L=O=>{O.target===O.currentTarget&&(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),v())},e[11]=v,e[12]=L):L=e[12];const ke=c?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",C=l?hs:us;let te;e[13]!==ke||e[14]!==C?(te=ze("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ke,C),e[13]=ke,e[14]=C,e[15]=te):te=e[15];let P;e[16]!==d||e[17]!==g||e[18]!==o.variant.label||e[19]!==p||e[20]!==V||e[21]!==R||e[22]!==f?(P=n.jsx(Cs,{label:o.variant.label,effectiveRule:g,matchers:p,canDelete:d,onRename:f,onDuplicate:R,onDelete:V}),e[16]=d,e[17]=g,e[18]=o.variant.label,e[19]=p,e[20]=V,e[21]=R,e[22]=f,e[23]=P):P=e[23];let ne;return e[24]!==j||e[25]!==i||e[26]!==v||e[27]!==x||e[28]!==I||e[29]!==te||e[30]!==P||e[31]!==L?(ne=n.jsx("div",{ref:x,style:I,...j,...i,onClick:v,onKeyDown:L,className:te,children:P}),e[24]=j,e[25]=i,e[26]=v,e[27]=x,e[28]=I,e[29]=te,e[30]=P,e[31]=L,e[32]=ne):ne=e[32],ne}function Pr(){return!1}function Cr(m){const e=We.c(9),{variant:o,decofile:l,meta:d,matchers:h}=m,b=d??void 0;let p;e[0]!==l||e[1]!==b||e[2]!==o.rule?(p=Lt(o.rule,l,b),e[0]=l,e[1]=b,e[2]=o.rule,e[3]=p):p=e[3];const v=p;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=ze("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",hs),e[4]=f):f=e[4];let R;return e[5]!==v||e[6]!==h||e[7]!==o.label?(R=n.jsx("div",{className:f,children:n.jsx(Cs,{label:o.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=o.label,e[8]=R):R=e[8],R}function Ar(m){const e=We.c(91),{listKey:o,variants:l,activeIndex:d,decofile:h,meta:b,matchers:p,onSelect:v,onReorder:f,onRename:R,onDuplicate:V,onDelete:D,onAdd:j}=m,i=ut();let x;e[0]!==l?(x=()=>Jn(l),e[0]=l,e[1]=x):x=e[1];const[E,c]=T.useState(x),[w,r]=T.useState(null),[B,I]=T.useState(o),[X,K]=T.useState(l.length);let g;e[2]!==l?(g=()=>Wn(l),e[2]=l,e[3]=g):g=e[3];const[L,ke]=T.useState(g),C=T.useRef(!1),te=Wn(l);B!==o?(I(o),K(l.length),ke(te),c(Jn(l))):(X!==l.length||L!==te)&&(K(l.length),ke(te),c(he=>kr(he,l)));let P;e[4]===Symbol.for("react.memo_cache_sentinel")?(P={activationConstraint:{distance:8}},e[4]=P):P=e[4];let ne;e[5]===Symbol.for("react.memo_cache_sentinel")?(ne={coordinateGetter:ds},e[5]=ne):ne=e[5];const O=ns(Xt(rs,P),Xt(os,ne));let Ae;e[6]!==E?(Ae=E.map(Mr),e[6]=E,e[7]=Ae):Ae=e[7];const xe=Ae,Te=l.length>1;let W;e[8]!==E?(W=he=>{const Re=String(he.active.id);r(E.find(ae=>ae.id===Re)??null)},e[8]=E,e[9]=W):W=e[9];const de=W;let re;e[10]!==xe||e[11]!==f?(re=he=>{r(null);const{active:Re,over:ae}=he;if(!ae||Re.id===ae.id)return;const Z=xe.indexOf(String(Re.id)),ue=xe.indexOf(String(ae.id));Z===-1||ue===-1||(c(ve=>Tr(Bt([...ve],Z,ue))),C.current=!0,requestAnimationFrame(()=>{C.current=!1}),f(Z,ue))},e[10]=xe,e[11]=f,e[12]=re):re=e[12];const se=re;let F;e[13]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{r(null)},e[13]=F):F=e[13];const Ye=F;let Ke,Fe,Be,$,me,Ie,Me,ee,ye,ie,le,fe,pe;if(e[14]!==d||e[15]!==Te||e[16]!==h||e[17]!==E||e[18]!==xe||e[19]!==se||e[20]!==de||e[21]!==p||e[22]!==b||e[23]!==j||e[24]!==D||e[25]!==V||e[26]!==R||e[27]!==v||e[28]!==O||e[29]!==i){const he=oe=>{C.current||v(oe)};le="space-y-1 border-b p-2";let Re;e[43]!==i?(Re=i("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=i,e[44]=Re):Re=e[44];let ae;e[45]!==Re?(ae=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Re}),e[45]=Re,e[46]=ae):ae=e[46];let Z;e[47]!==i?(Z=i("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=i,e[48]=Z):Z=e[48];let ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(bn,{size:14}),e[49]=ue):ue=e[49];let ve;e[50]!==j||e[51]!==Z?(ve=n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":Z,className:"size-6",onClick:j,children:ue})}),e[50]=j,e[51]=Z,e[52]=ve):ve=e[52];let Ne;e[53]!==i?(Ne=i("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=i,e[54]=Ne):Ne=e[54];let k;e[55]!==Ne?(k=n.jsx(Et,{children:Ne}),e[55]=Ne,e[56]=k):k=e[56];let be;e[57]!==ve||e[58]!==k?(be=n.jsxs(_t,{children:[ve,k]}),e[57]=ve,e[58]=k,e[59]=be):be=e[59],e[60]!==ae||e[61]!==be?(fe=n.jsxs("div",{className:"flex items-center justify-between",children:[ae,be]}),e[60]=ae,e[61]=be,e[62]=fe):fe=e[62],Fe=ms,Ie=O,Me=fs,ee=de,ye=se,ie=Ye,Ke=ps,$=xe,me=gs,pe="space-y-0.5",Be=E.map(oe=>n.jsx(Dr,{entry:oe,isActive:oe.index===d,canDelete:Te,decofile:h,meta:b,matchers:p,onSelect:()=>he(oe.index),onRename:()=>R(oe.index),onDuplicate:()=>V(oe.index),onDelete:()=>D(oe.index)},oe.id)),e[14]=d,e[15]=Te,e[16]=h,e[17]=E,e[18]=xe,e[19]=se,e[20]=de,e[21]=p,e[22]=b,e[23]=j,e[24]=D,e[25]=V,e[26]=R,e[27]=v,e[28]=O,e[29]=i,e[30]=Ke,e[31]=Fe,e[32]=Be,e[33]=$,e[34]=me,e[35]=Ie,e[36]=Me,e[37]=ee,e[38]=ye,e[39]=ie,e[40]=le,e[41]=fe,e[42]=pe}else Ke=e[30],Fe=e[31],Be=e[32],$=e[33],me=e[34],Ie=e[35],Me=e[36],ee=e[37],ye=e[38],ie=e[39],le=e[40],fe=e[41],pe=e[42];let ge;e[63]!==Be||e[64]!==pe?(ge=n.jsx("div",{className:pe,children:Be}),e[63]=Be,e[64]=pe,e[65]=ge):ge=e[65];let _e;e[66]!==Ke||e[67]!==$||e[68]!==me||e[69]!==ge?(_e=n.jsx(Ke,{items:$,strategy:me,children:ge}),e[66]=Ke,e[67]=$,e[68]=me,e[69]=ge,e[70]=_e):_e=e[70];let je;e[71]!==w||e[72]!==h||e[73]!==p||e[74]!==b?(je=w?n.jsx(Cr,{variant:w.variant,decofile:h,meta:b,matchers:p}):null,e[71]=w,e[72]=h,e[73]=p,e[74]=b,e[75]=je):je=e[75];let ce;e[76]!==je?(ce=Zn.createPortal(n.jsx(ss,{dropAnimation:as,children:je}),document.body),e[76]=je,e[77]=ce):ce=e[77];let z;e[78]!==Fe||e[79]!==Ie||e[80]!==Me||e[81]!==ee||e[82]!==ye||e[83]!==ie||e[84]!==_e||e[85]!==ce?(z=n.jsxs(Fe,{sensors:Ie,collisionDetection:Me,onDragStart:ee,onDragEnd:ye,onDragCancel:ie,children:[_e,ce]}),e[78]=Fe,e[79]=Ie,e[80]=Me,e[81]=ee,e[82]=ye,e[83]=ie,e[84]=_e,e[85]=ce,e[86]=z):z=e[86];let Ee;return e[87]!==le||e[88]!==fe||e[89]!==z?(Ee=n.jsxs("div",{className:le,children:[fe,z]}),e[87]=le,e[88]=fe,e[89]=z,e[90]=Ee):Ee=e[90],Ee}function Mr(m){return m.id}function Br(m){const e=We.c(16),{schema:o,value:l,onChange:d,meta:h,decofile:b,onSaveReferencedBlock:p,sandbox:v}=m,f=ut();let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R=[],e[0]=R):R=e[0];const[V,D]=T.useState(R);let j;e[1]!==V||e[2]!==f?(j=V.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:()=>D([]),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(xs,{className:"size-3.5"})}),V.map((E,c)=>{const w=c===V.length-1,r=bs(E);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[c>0&&n.jsx(ys,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(V.slice(0,c+1)),title:r,className:ze("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",w?"font-medium text-foreground":"text-muted-foreground"),children:r})]},`${r}-${c}`)})]}),e[1]=V,e[2]=f,e[3]=j):j=e[3];let i;e[4]!==V||e[5]!==b||e[6]!==h||e[7]!==d||e[8]!==p||e[9]!==v||e[10]!==o||e[11]!==l?(i=n.jsx(vs,{schema:o,value:l,onChange:d,basePath:"",breadcrumbPath:V,onBreadcrumbChange:D,meta:h,decofile:b,onSaveReferencedBlock:p,sandbox:v}),e[4]=V,e[5]=b,e[6]=h,e[7]=d,e[8]=p,e[9]=v,e[10]=o,e[11]=l,e[12]=i):i=e[12];let x;return e[13]!==j||e[14]!==i?(x=n.jsxs("div",{className:"space-y-2",children:[j,i]}),e[13]=j,e[14]=i,e[15]=x):x=e[15],x}function Yn(m){const e=We.c(23),{activeSchema:o,formValue:l,formResetKey:d,onFormChange:h,onBreadcrumbChange:b,breadcrumbPath:p,emptyMessage:v,beforeForm:f,seoResolveType:R,siteDefaultSeo:V,meta:D,decofile:j,onSaveReferencedBlock:i,sandbox:x,previewBaseUrl:E,onRequestAddSection:c}=m;let w;e[0]!==p?(w=p===void 0?[]:p,e[0]=p,e[1]=w):w=e[1];const r=w;let B;e[2]!==o||e[3]!==r||e[4]!==j||e[5]!==d||e[6]!==l||e[7]!==D||e[8]!==b||e[9]!==h||e[10]!==c||e[11]!==i||e[12]!==E||e[13]!==x||e[14]!==R||e[15]!==V?(B=o&&l?R?n.jsx(Yo,{schema:o,resolveType:R,value:l,formResetKey:d,onChange:h,onBreadcrumbChange:b,siteDefaultSeo:V}):n.jsx(vs,{schema:o,value:l,onChange:h,basePath:"",breadcrumbPath:r,onBreadcrumbChange:b,meta:D,decofile:j,onSaveReferencedBlock:i,sandbox:x,previewBaseUrl:E,onRequestAddSection:c},d):null,e[2]=o,e[3]=r,e[4]=j,e[5]=d,e[6]=l,e[7]=D,e[8]=b,e[9]=h,e[10]=c,e[11]=i,e[12]=E,e[13]=x,e[14]=R,e[15]=V,e[16]=B):B=e[16];const I=B;let X;e[17]!==v||e[18]!==I?(X=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]=X):X=e[19];let K;return e[20]!==f||e[21]!==X?(K=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,X]})}),e[20]=f,e[21]=X,e[22]=K):K=e[22],K}const Lr="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 Kr(m,e){return Ja(m,e,ct)}function Fr(m){const e=We.c(19),{pageKey:o,initialName:l,initialPath:d,onFieldChange:h}=m,b=ut(),[p,v]=T.useState(l),[f,R]=T.useState(d),[V,D]=T.useState(o);V!==o&&(D(o),v(l),R(d));let j;e[0]!==h?(j=B=>{v(B.target.value),h("name",B.target.value)},e[0]=h,e[1]=j):j=e[1];let i;e[2]!==b?(i=b("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=b,e[3]=i):i=e[3];let x;e[4]!==p||e[5]!==j||e[6]!==i?(x=n.jsx("input",{type:"text",value:p,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:i}),e[4]=p,e[5]=j,e[6]=i,e[7]=x):x=e[7];let E;e[8]!==h?(E=B=>{R(B.target.value),h("path",B.target.value)},e[8]=h,e[9]=E):E=e[9];let c;e[10]!==b?(c=b("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=b,e[11]=c):c=e[11];let w;e[12]!==f||e[13]!==E||e[14]!==c?(w=n.jsx("input",{type:"text",value:f,onChange:E,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:c}),e[12]=f,e[13]=E,e[14]=c,e[15]=w):w=e[15];let r;return e[16]!==x||e[17]!==w?(r=n.jsxs("div",{className:"space-y-1",children:[x,w]}),e[16]=x,e[17]=w,e[18]=r):r=e[18],r}function Qn(m){const e=We.c(13),{onClick:o}=m,l=ut();let d;e[0]!==l?(d=l("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=l,e[1]=d):d=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(js,{size:14}),e[2]=h):h=e[2];let b;e[3]!==o||e[4]!==d?(b=n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":d,className:"size-7 shrink-0 text-[oklch(0.65_0.15_160)]",onClick:o,children:h})}),e[3]=o,e[4]=d,e[5]=b):b=e[5];let p;e[6]!==l?(p=l("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=l,e[7]=p):p=e[7];let v;e[8]!==p?(v=n.jsx(Et,{side:"bottom",children:p}),e[8]=p,e[9]=v):v=e[9];let f;return e[10]!==b||e[11]!==v?(f=n.jsxs(_t,{children:[b,v]}),e[10]=b,e[11]=v,e[12]=f):f=e[12],f}function Xn(m){const e=We.c(21),{currentRt:o,currentLabel:l,currentGlobalKey:d,matchers:h,globals:b,onSelect:p,onSelectGlobal:v,schema:f,formValue:R,onChange:V,formKey:D,formWrapperClassName:j,meta:i,decofile:x,onSaveReferencedBlock:E,sandbox:c}=m;let w;e[0]!==d||e[1]!==l||e[2]!==o||e[3]!==b||e[4]!==h||e[5]!==p||e[6]!==v?(w=n.jsx(Ya,{currentRt:o,currentLabel:l,currentGlobalKey:d,matchers:h,globals:b,onSelect:p,onSelectGlobal:v}),e[0]=d,e[1]=l,e[2]=o,e[3]=b,e[4]=h,e[5]=p,e[6]=v,e[7]=w):w=e[7];let r;e[8]!==x||e[9]!==D||e[10]!==R||e[11]!==j||e[12]!==i||e[13]!==V||e[14]!==E||e[15]!==c||e[16]!==f?(r=f&&R&&n.jsx("div",{className:j,children:n.jsx(Br,{schema:f,value:R,onChange:V,meta:i,decofile:x,onSaveReferencedBlock:E,sandbox:c},D)}),e[8]=x,e[9]=D,e[10]=R,e[11]=j,e[12]=i,e[13]=V,e[14]=E,e[15]=c,e[16]=f,e[17]=r):r=e[17];let B;return e[18]!==w||e[19]!==r?(B=n.jsxs(n.Fragment,{children:[w,r]}),e[18]=w,e[19]=r,e[20]=B):B=e[20],B}function kc({orgSlug:m,virtualMcpId:e,branch:o,previewReady:l=!0,previewUrl:d,currentPath:h,activePageBlockKey:b=null,activeGlobalBlockKey:p=null,externalSelection:v,onSaved:f,initialEditSeo:R=!1,onExitSeo:V,onViewJsonFile:D,onVariantPreviewOverride:j}){const i=ut(),x=Fa()?.taskId??null,E=l?{orgSlug:m,virtualMcpId:e,branch:o,threadId:x,previewUrl:d}:null,{data:c,isLoading:w}=Qa(E),{data:r,isLoading:B}=Xa(E),I=Za(),X=I?.entity?.id===e?I.entity.metadata?.siteSlug??null:null,K=or({virtualMcpId:e,sandboxUrl:d}),[g,L]=T.useState(null),[ke,C]=T.useState(null),[te,P]=T.useState(null),[ne,O]=T.useState(0),[Ae,xe]=T.useState(void 0),[Te,W]=T.useState(null),[de,re]=T.useState(null),[se,F]=T.useState([]),Ye=T.useRef(null),[Ke,Fe]=T.useState(se.length);Ke!==se.length&&(Fe(se.length),requestAnimationFrame(()=>{Ye.current&&(Ye.current.scrollTop=0)}));const[Be,$]=T.useState(0),[me,Ie]=T.useState(null),[Me,ee]=T.useState(null),[ye,ie]=T.useState(null),[le,fe]=T.useState(!0),[pe,ge]=T.useState(!1),[_e,je]=T.useState(!1),ce=T.useRef(null),[z,Ee]=T.useState(R),[he,Re]=T.useState(R);R&&!he&&(Re(!0),Ee(!0),L(null),C(null),P(null),F([])),!R&&he&&Re(!1);const[ae,Z]=T.useState(null),[ue,ve]=T.useState(void 0),[Ne,k]=T.useState([]),[be,oe]=T.useState(0),[Ve,Oe]=T.useState(0),[dt,De]=T.useState(null),[et,qe]=T.useState(null),[Sn,xn]=T.useState(null),As=La(),Ms=`${m}/${e}/${o}`,Zt=eo({orgSlug:m,virtualMcpId:e,branch:o}),[Bs,Ls]=T.useState(h),[Ks,Fs]=T.useState(b),[Is,Os]=T.useState(p);(Bs!==h||Ks!==b||Is!==p)&&(queueMicrotask(()=>Zt.flush()),Ls(h),Fs(b),Os(p),L(null),C(null),P(null),O(0),W(null),re(null),Oe(0),De(null),qe(null),F([]),$(t=>t+1),Ee(!1),Z(null),ve(void 0),k([]),oe(t=>t+1));const Pe=to({orgSlug:m,virtualMcpId:e,branch:o}),Kt=yo((t,s)=>{Pe.mutate({blockKey:t,data:s},{onSuccess:()=>f?.(),onError:a=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:a.message}))})}),en=no({orgSlug:m,virtualMcpId:e,branch:o}),[Vt,Ft]=T.useState(!1),He=T.useRef(null),at=T.useRef(null),ot=T.useRef(null),tn=T.useRef({}),tt=T.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!l||w||B)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(es,{size:20,className:"animate-spin text-muted-foreground"})});if(!c||!r)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const $s=so(c),Ce=!!p,Je=Ce?null:ao($s,h,b),N=Ce?p:Je?.key??null,nn=Ce&&p?c[p]:void 0,yn=Ce&&p&&nn?oo(p,nn):Ce&&p?p:"",It=!Ce&&N&&c[N]?c[N]:null,sn=z&&c&&r&&N&&Je?Un(c,{kind:"page",pageKey:N,pageName:String(Je.name??""),path:String(Je.path??"")},r):null,zs=z?It?.seo:void 0,an=ue!==void 0?ue:zs,Hs=z?Qo(an):void 0,Us=sn?.seoTypeOptions??[],Gs=z&&r?Xo(r):"",_n=ae??Hs??{},on=z&&sn?Zo(_n,sn):null,qs=z&&on&&er(an)?qt(on,r):null,Ws=z?tr(c,r)?.seoData:void 0,Ge=Ce?[{label:"Default",sections:[{__resolveType:p}]}]:Kr(It?.sections,c??{}),Ot=Ge.length>1,$e=Math.min(ne,Ge.length-1),mt=Ge[$e],G=mt?.sections??[],Ue=Wt(G,c),jn=!Ce&&ro(It?.sections);if(Ce&&p&&Sn!==p){xn(p);const t=G[0],s=Ue[0];if(t&&s){L(0),Oe(0),F([]);const a=xt(t,s,c);a&&(C(a.data),P(a.resolveType),qe(null),De(null))}}!Ce&&Sn!==null&&xn(null),tt.current={rawSections:G,parsedSections:Ue,decofile:c??{},activePageKey:N,pageVariants:Ge,variantIndex:$e,sectionVariantIndex:Ve,selectedSectionIndex:g};const Js=()=>({multivariate:jn,index:$e,variants:Ge.map(t=>({rule:t.rule}))}),En=(t,s)=>{if(!j)return;if(!N||!jn||t.length<=1){j(null);return}const a=Hn(N,{multivariate:!0,index:s,variants:t},c,r);j(a.length>0?a:null)},Rt=(t,s,a)=>{if(!j)return;if(!N){j(null);return}const u=Js(),S=Hn(N,u,c,r);if(!t||s<0){j(S.length>0?S:null);return}const _=wo({pageKey:N,page:u,sectionIndex:s,sectionLazy:Ue[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:a,decofile:c,meta:r}),y=[...S,..._];j(y.length>0?y:null)},ft=(t,s,a,u=g??-1,S=!1)=>{const _=st(t,s);if(!_){C(null),P(null),qe(null),De(null),S&&Rt(null,u,a);return}const A=Kn(_,ct)[a];if(!A){C(null),P(null),qe(null),De(null),S&&Rt(null,u,a);return}const Q=fo(A.value,c);C(Q?.data??null),P(Q?.resolveType??null);const{resolveType:M,formValue:H}=Ct(A.rule,c,r??void 0);qe(M),De(H),S&&Rt(_,u,a)},Dt=v?.index;if(v!==void 0&&(v?.seq??null)!==Ae&&(xe(v?.seq??null),typeof Dt=="number")){const t=G[Dt],s=Ue[Dt];if(t&&s)if(L(Dt),Oe(0),F([]),$(a=>a+1),s.isMultivariate)ft(t,s,0,Dt);else{const a=xt(t,s,c);a?(C(a.data),P(a.resolveType)):(C(null),P(null)),qe(null),De(null)}}const $t={orgSlug:m,virtualMcpId:e,branch:o,threadId:x,previewUrl:d??void 0,siteSlug:X},rn=te&&r?qt(te,r):null,Qe=(t,s)=>{if(!N)return;He.current&&(clearTimeout(He.current),He.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null);const a=Mt(c,N,t,$e,Ge);Pe.mutate({blockKey:N,data:a},{onSuccess:()=>s?.onSuccess?.()??f?.(),onError:u=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:u.message}))})},wt=()=>{L(null),C(null),P(null),Oe(0),De(null),qe(null),F([]),$(t=>t+1)},Ys=(t,s)=>{He.current&&clearTimeout(He.current);const a=tt.current.sectionVariantIndex;He.current=setTimeout(()=>{const{rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:A,variantIndex:Q}=tt.current,M=u[s];if(!M)return;const H=S[s];if(!H)return;if(H.isSavedBlock){const q=H.isLazy?M.section?.__resolveType??M.__resolveType:M.__resolveType;Pe.mutate({blockKey:q,data:t},{onSuccess:()=>f?.(),onError:J=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:J.message}))});return}if(!y)return;const U={..._[y]},we=[...u];if(H.isMultivariate){const q=st(M,H);if(!q||!y)return;const J=To(q,a,t);we[s]=yt(M,H,J)}else if(H.isHidden){const q=is(M.__resolveType),J=q?{...M.section}:{...M},Le=Array.isArray(J.variants)?[...J.variants]:[];Le[0]&&(Le[0]={...Le[0],value:t}),J.variants=Le,q?we[s]={...M,section:J}:we[s]=J}else H.isLazy?we[s]={...M,section:t}:we[s]=t;if(A.length>1){const q=U.sections,J=[...q?.variants??[]];J[Q]&&(J[Q]={...J[Q],value:we}),U.sections={...q,variants:J}}else U.sections=we;Pe.mutate({blockKey:y,data:U},{onSuccess:()=>f?.(),onError:q=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:q.message}))})},gn)},Qs=t=>{L(t),Oe(0),F([]),$(S=>S+1);const s=G[t],a=Ue[t];if(!s||!a)return;if(a.isMultivariate){ft(s,a,0,t);return}const u=xt(s,a,c);if(!u){C(null),P(null),qe(null),De(null),Rt(null,t,0);return}C(u.data),P(u.resolveType),qe(null),De(null),Rt(null,t,0)},Rn=t=>{const s=t;C(s),g!==null&&Ys(s,g)},ln=t=>{if(!N||!c||!r||!Je)return;const s={kind:"page",pageKey:N,pageName:String(Je.name??""),path:String(Je.path??"")},a=Un(c,s,r);a&&Zt.save(N,()=>{const u=As.getQueryData(Ka.decofile(Ms))?.[N];if(!u||typeof u!="object"||u===null||Array.isArray(u))return null;const S={...u,...tn.current};return tn.current={},t?.raw!==void 0?{...S,seo:t.raw}:t?.inner!==void 0?sr(s,a,S,t.inner):S})},Xs=(t,s)=>{N&&(tn.current[t]=s,ln())},Zs=(t,s)=>{if(!N)return;const a=Bt([...G],t,s);g!==null&&(g===t?L(s):t<g&&s>=g?L(g-1):t>g&&s<=g&&L(g+1)),Qe(a)},ea=t=>{if(!N)return;const s=G.filter((a,u)=>u!==t);g===t?wt():g!==null&&g>t&&L(g-1),Qe(s)},ta=t=>{if(!N)return;const s=G[t];if(!s)return;const a=[...G];a.splice(t+1,0,Ro(s)),g!==null&&g>t&&L(g+1),Qe(a)},na=t=>{if(!N)return;const s=G[t],a=Ue[t];if(!s||!a||a.isMultivariate)return;const u=a.isHidden?jo(s):Eo(s);if(!u)return;const S=[...G];S[t]=u,g===t&&wt(),Qe(S)},sa=t=>{if(!N)return;const s=G[t],a=Ue[t];if(!s||!a||a.isMultivariate)return;const u=_o(s);if(!u)return;const S=[...G];S[t]=u,g===t&&wt(),Qe(S)},aa=t=>{if(!N)return;const s=G[t],a=Ue[t];if(!s||!a?.isSavedBlock)return;const u=xt(s,a,c);if(!u?.data)return;const{name:S,..._}=u.data,y=[...G];a.isLazy?y[t]={...s,section:_}:y[t]=_,g===t&&wt(),Qe(y)},oa=t=>{if(!N)return;const s=[...G,{__resolveType:t.resolveType}],a=s.length-1;Qe(s,{onSuccess:()=>{ge(!1),L(a),Oe(0),F([]),$(y=>y+1);const u=s[a],S=Wt(s,c)[a];if(!u||!S)return;if(S.isMultivariate){ft(u,S,0);return}const _=xt(u,S,c);if(!_){C(null),P(null),qe(null),De(null);return}C(_.data),P(_.resolveType),qe(null),De(null)}})},wn=t=>{ce.current=t.append,ge(!0)},ra=t=>{const s=ce.current;if(!s){oa(t);return}s({__resolveType:t.resolveType}),ge(!1),ce.current=null},ia=t=>{if(g===null)return;const s=G[g],a=Ue[g];!s||!a?.isMultivariate||(Oe(t),F([]),$(u=>u+1),ft(s,a,t,g,!0))},la=t=>{if(g===null||!N)return;const s=G[g],a=Ue[g];if(!s||!a?.isMultivariate)return;const u=st(s,a);if(!u)return;const S=So(u,t);if(!S){Y.error(i("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const _=[...G];_[g]=yt(s,a,S);const y=S.variants;let A=Ve;t===Ve?A=Math.min(t,y.length-1):t<Ve&&(A=Ve-1),Oe(A),F([]),$(Q=>Q+1),ft(_[g],a,A),Qe(_)},ca=t=>{if(g===null||!N)return;const s=G[g],a=Ue[g];if(!s||!a?.isMultivariate)return;const u=st(s,a);if(!u)return;const S=xo(u,t),_=[...G];_[g]=yt(s,a,S);const y=t+1;Oe(y),F([]),$(A=>A+1),ft(_[g],a,y),Qe(_)},ua=(t,s)=>{if(g===null||!N||t===s)return;const a=G[g],u=Ue[g];if(!a||!u?.isMultivariate)return;const S=st(a,u);if(!S)return;const _=vo(S,t,s),y=[...G];y[g]=yt(a,u,_);let A=Ve;Ve===t?A=s:t<Ve&&s>=Ve?A=Ve-1:t>Ve&&s<=Ve&&(A=Ve+1),Oe(A),ft(y[g],u,A),Qe(y)},cn=t=>{const s=t??g;if(s===null||!N)return;const a=G[s],u=Ue[s];if(!a||!u)return;const S=po(a,u);if(!S){Y.error(i("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const _=[...G];_[s]=S.section;const y=Wt(_,c)[s];if(!y?.isMultivariate){Y.error(i("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(s),Oe(S.newVariantIndex),F([]),$(A=>A+1),ft(S.section,y,S.newVariantIndex,s),Qe(_)},da=()=>{if(g===null||!N)return;const t=G[g],s=Ue[g];if(!t||!s?.isMultivariate)return;const a=st(t,s);if(!a)return;const u=bo(t,s,a);if(!u){Y.error(i("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const S=[...G];S[g]=u;const _=Wt(S,c)[g];if(!_)return;Oe(0),qe(null),De(null),F([]),$(A=>A+1);const y=xt(u,_,c);y?(C(y.data),P(y.resolveType)):(C(null),P(null)),Rt(null,g,0),Qe(S)},ma=async t=>{if(me===null||!N)return;const s=pn(t,c);if(s){Y.error(s);return}const a=G[me],u=Ue[me];if(!a||!u)return;const S=xt(a,u,c);if(!S){Y.error(i("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const _={...S.data,name:t};try{await Pe.mutateAsync({blockKey:t,data:_});const y=[...G];y[me]={__resolveType:t},await Pe.mutateAsync({blockKey:N,data:Mt(c,N,y,$e,Ge)}),g===me&&wt(),Ie(null),Y.success(i("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),f?.()}catch(y){Y.error(y instanceof Error?y.message:i("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},kn=mt?.rule;if(Ot&&g===null&&de===null&&kn){const{resolveType:t,formValue:s}=Ct(kn,c??{},r??void 0);re(t),W(s)}const zt=r?io(r):[],Tn=r&&c?lo(r,c):[],fa=!Ce&&!!(K&&r&&c),pa=de&&r?qt(de,r):null,kt=()=>{at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null)},Pt=async(t,s)=>{if(!(ko(s,t,r)>0))try{await en.mutateAsync({blockKey:t})}catch(a){Y.error(a instanceof Error?a.message:i("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Nn=t=>{at.current&&clearTimeout(at.current),at.current=setTimeout(()=>{const{activePageKey:s,decofile:a,variantIndex:u}=tt.current;if(!s)return;const S={...a[s]},_={...S.sections},y=[..._.variants??[]],A=y[u],Q=A?.rule;if(Tt(Q,a,r)){const M=Q?.__resolveType??"",H=a[M],U=typeof H?.name=="string"?H.name:M,{__resolveType:we,...q}=t;Pe.mutate({blockKey:M,data:Nt(we??"",q,U)},{onSuccess:()=>f?.(),onError:J=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:J.message}))});return}A&&(y[u]={...A,rule:t}),S.sections={..._,variants:y},Pe.mutate({blockKey:s,data:S},{onSuccess:()=>f?.(),onError:M=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},gn)},ga=t=>{re(t);const s=t?In(t,r):{__resolveType:On};W(t?s:{}),Nn(s)},ha=t=>{const s=t;W(s);const a=de?{__resolveType:de,...s}:{...s};Nn(a)},va=async t=>{kt();const{activePageKey:s,decofile:a,variantIndex:u}=tt.current;if(!s)return;const S=a[s],_=S?.sections;if(!_||typeof _!="object"||Array.isArray(_))return;const y=_;if(!Array.isArray(y.variants))return;const A=[...y.variants],Q=A[u];if(!Q)return;const M=At(Q.rule,a,r),H=Yt(t);A[u]={...Q,rule:H};const U={...a,[s]:{...S,sections:{...y,variants:A}}},{resolveType:we,formValue:q}=Ct(H,U,r??void 0);re(we),W(q);try{await Pe.mutateAsync({blockKey:s,data:U[s]}),M&&M!==t&&await Pt(M,U),f?.()}catch(J){Y.error(J instanceof Error?J.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Vn=t=>{ot.current&&clearTimeout(ot.current);const{selectedSectionIndex:s,sectionVariantIndex:a}=tt.current;s!==null&&(ot.current=setTimeout(()=>{const{rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:A,variantIndex:Q}=tt.current;if(!y)return;const M=u[s],H=S[s];if(!M||!H?.isMultivariate)return;const U=st(M,H);if(!U)return;const q=(U.variants??[])[a]?.rule;if(Tt(q,_,r)){const Se=q?.__resolveType??"",Xe=_[Se],it=typeof Xe?.name=="string"?Xe.name:Se,{__resolveType:ht,...lt}=t;Pe.mutate({blockKey:Se,data:Nt(ht??"",lt,it)},{onSuccess:()=>f?.(),onError:vt=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:vt.message}))});return}const J=Fn(U,a,t),Le=[...u];Le[s]=yt(M,H,J);const nt=Mt(_,y,Le,Q,A);Pe.mutate({blockKey:y,data:nt},{onSuccess:()=>f?.(),onError:Se=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Se.message}))})},gn))},ba=t=>{qe(t);const s=t?In(t,r):{__resolveType:On};De(t?s:{}),Vn(s)},Sa=t=>{const s=t;De(s);const a=et?{__resolveType:et,...s}:{...s};Vn(a)},xa=async t=>{kt();const{selectedSectionIndex:s,sectionVariantIndex:a,rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:A,variantIndex:Q}=tt.current;if(s===null||!y)return;const M=u[s],H=S[s];if(!M||!H?.isMultivariate)return;const U=st(M,H);if(!U)return;const we=U.variants??[],q=At(we[a]?.rule,_,r),J=Yt(t),Le=Fn(U,a,J),nt=[...u];nt[s]=yt(M,H,Le);const Se=Mt(_,y,nt,Q,A),Xe={..._,[y]:Se},{resolveType:it,formValue:ht}=Ct(J,Xe,r??void 0);qe(it),De(ht);try{await Pe.mutateAsync({blockKey:y,data:Se}),q&&q!==t&&await Pt(q,Xe),f?.()}catch(lt){Y.error(lt instanceof Error?lt.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ce&&!Je)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.noPageFound",{currentPath:h})});if(Ce&&!nn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.globalBlockNotFound")});const pt=g!==null?Ue[g]??null:null,Dn=g!==null?G[g]:null,Pn=Dn&&pt?.isMultivariate?st(Dn,pt):null,St=Pn?Kn(Pn,ct):[],un=Math.min(Ve,Math.max(St.length-1,0)),Ht=St[un]??null,gt=pt?.isMultivariate===!0,Cn=g!==null&&pt!==null,Ut=Cn&&(gt||!!(rn&&ke)),ya=Ut&&!Ce&&pt?.isSavedBlock===!0,rt=Ce||ya,_a=Ce?yn:pt?.label??"",ja=et&&r?qt(et,r):null,dn=Ut&&(!Ce||se.length>0)?Ce?[yn,...se]:[Je.name,pt.label,...gt&&Ht?[Ht.label]:[],...se]:[],Ea=z&&Je?[Je.name,"SEO",...Ne]:[],Gt=z?Ea:rt?dn.length>0?dn:[_a]:dn,Ra=!z&&!Ce&&gt&&se.length===0,An=()=>{if(!N)return;kt(),He.current&&(clearTimeout(He.current),He.current=null);const t=c[N],s=go(t.sections,G);if(!s)return;const a=ho(s);Pe.mutate({blockKey:N,data:{...t,sections:s}},{onSuccess:()=>{O(a),L(null),C(null),P(null),F([]),W(null),re(null)},onError:u=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:u.message}))})},mn=(t,s,a)=>{if(!N)return;kt(),He.current&&(clearTimeout(He.current),He.current=null);const u=c[N],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 A=No(_,y),Q={...c,[N]:{...u,sections:A}};Pe.mutate({blockKey:N,data:Q[N]},{onSuccess:()=>{s?.(),a&&Pt(a,Q)},onError:M=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},wa=t=>{ee(null),O(t),L(null),C(null),P(null),F([]);const s=Ge[t]?.rule,{resolveType:a,formValue:u}=Ct(s,c??{},r??void 0);re(a),W(u),En(Ge.map(S=>({rule:S.rule})),t)},ka=(t,s)=>{if(t===s)return;let a=$e;$e===t?a=s:t<$e&&s>=$e?a=$e-1:t>$e&&s<=$e&&(a=$e+1),O(a);const u=Bt(Ge.map(S=>({rule:S.rule})),t,s);En(u,a),mn(S=>Bt(S,t,s))},Ta=t=>{const s=Ge[t]?.rule,a=At(s,c??{},r??void 0);mn(u=>u.length<=1?null:(u.splice(t,1),u),()=>{Ge.length-1===1?O(0):t<$e?O($e-1):t===$e&&O(Math.max(0,t-1)),L(null),C(null),P(null),F([]),W(null),re(null)},a)},Na=t=>{mn(s=>Vo(s,t),()=>{O(t+1),L(null),C(null),P(null),F([]),W(null),re(null)})},Va=async(t,s)=>{kt(),He.current&&(clearTimeout(He.current),He.current=null);const a=tt.current.activePageKey,u=tt.current.decofile;if(!a)return;const S=u[a],_=S.sections;if(!_||typeof _!="object"||Array.isArray(_))return;const y=_;if(!Array.isArray(y.variants))return;const A=[...y.variants],Q=A[t];if(!Q?.rule||typeof Q.rule!="object"){Y.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const M=Q.rule,H=s.trim();Ft(!0);try{if(!H){if(!Tt(M,u,r)){ee(null);return}const nt=M.__resolveType??"";A[t]={...Q,rule:$n(M,u,r)};const Se={...u,[a]:{...S,sections:{...y,variants:A}}};await Pe.mutateAsync({blockKey:a,data:Se[a]}),await Pt(nt,Se),ee(null),f?.();return}const U=zn(M,u,r);if(!U){Y.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(U.blockKey){await Pe.mutateAsync({blockKey:U.blockKey,data:Nt(U.resolveType,U.data,H)}),ee(null),f?.();return}const we=fn(H),q=pn(we,u);if(q){Y.error(q);return}const J=Nt(U.resolveType,U.data,H);let Le=null;try{await Pe.mutateAsync({blockKey:we,data:J}),Le=we,A[t]={...Q,rule:Yt(we)},await Pe.mutateAsync({blockKey:a,data:{...S,sections:{...y,variants:A}}}),Le=null}catch(nt){throw Le&&await en.mutateAsync({blockKey:Le}).catch(()=>{}),nt}ee(null),Y.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:H})),f?.()}catch(U){Y.error(U instanceof Error?U.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Ft(!1)}},Da=async(t,s)=>{kt(),He.current&&(clearTimeout(He.current),He.current=null);const{selectedSectionIndex:a,rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:A,variantIndex:Q}=tt.current;if(a===null||!y)return;const M=u[a],H=S[a];if(!M||!H?.isMultivariate)return;const U=st(M,H);if(!U)return;const we=U.variants??[],q=we[t];if(!q?.rule||typeof q.rule!="object"){Y.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const J=q.rule,Le=s.trim();Ft(!0);const nt=async Se=>{const Xe={...U,variants:Se},it=[...u];it[a]=yt(M,H,Xe);const ht=Mt(_,y,it,Q,A);return await Pe.mutateAsync({blockKey:y,data:ht}),{..._,[y]:ht}};try{if(!Le){if(!Tt(J,_,r)){ie(null);return}const vt=J.__resolveType??"",Ln=[...we];Ln[t]={...q,rule:$n(J,_,r)};const Ba=await nt(Ln);await Pt(vt,Ba),ie(null),f?.();return}const Se=zn(J,_,r);if(!Se){Y.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Se.blockKey){await Pe.mutateAsync({blockKey:Se.blockKey,data:Nt(Se.resolveType,Se.data,Le)}),ie(null),f?.();return}const Xe=fn(Le),it=pn(Xe,_);if(it){Y.error(it);return}const ht=Nt(Se.resolveType,Se.data,Le);let lt=null;try{await Pe.mutateAsync({blockKey:Xe,data:ht}),lt=Xe;const vt=[...we];vt[t]={...q,rule:Yt(Xe)},await nt(vt),lt=null}catch(vt){throw lt&&await en.mutateAsync({blockKey:lt}).catch(()=>{}),vt}ie(null),Y.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Le})),f?.()}catch(Se){Y.error(Se instanceof Error?Se.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Ft(!1)}},Mn=()=>{wt()},Pa=t=>{Z(t),ln({inner:t})},Ca=t=>{ve(t),ln({raw:t})},Aa=()=>{Z(null),k([])},Ma=()=>oe(t=>t+1),Bn=t=>{if(z){if(t===0){Zt.flush(),Ee(!1),Z(null),ve(void 0),k([]),oe(a=>a+1),V?.();return}if(t===1){k([]),oe(a=>a+1);return}k(Ne.slice(0,t-1)),oe(a=>a+1);return}if(Ce){F(se.slice(0,t)),$(a=>a+1);return}if(t===0){Mn();return}if(t===1){F([]),$(a=>a+1);return}if(gt&&t===2){F([]),$(a=>a+1);return}const s=gt?2:1;F(se.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:rt||Ut||z?n.jsxs("div",{className:ze("border-b px-3 py-2.5",rt&&"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:[Gt.length>1&&n.jsx("button",{type:"button",onClick:()=>Bn(Do(Gt.length,{isMultivariateSectionTop:Ra})),title:i("sectionsEditor.sectionsEditor.back"),"aria-label":i("sectionsEditor.sectionsEditor.back"),className:ze("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",rt?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(xs,{className:"size-4"})}),!Ce&&Ot&&mt&&n.jsxs("button",{type:"button",onClick:Mn,title:i("sectionsEditor.sectionsEditor.editingInVariant",{variant:mt.label}),className:ze("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",Lr),children:[n.jsx(Ps,{rule:Lt(mt.rule,c??{},r??void 0),matchers:zt}),n.jsx("span",{className:"max-w-[160px] truncate",children:mt.label})]}),n.jsx("nav",{"aria-label":i("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Gt.map((t,s)=>{const a=s===Gt.length-1,u=bs(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(ys,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Bn(s),title:u,className:ze("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",a?rt?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":rt?"text-foreground/80":"text-muted-foreground",rt?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:u})]},`${u}-${s}`)})}),rt&&n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Ko,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:i("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cn&&!gt&&!pt?.isHidden&&N&&n.jsx(Qn,{onClick:()=>cn()})]}),rt&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:i("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(Fr,{pageKey:N,initialName:Je.name,initialPath:Je.path,onFieldChange:Xs})}),n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Mo,{size:14})})}),n.jsx(Et,{side:"bottom",children:i("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>D&&N?D(N):je(!0),children:n.jsx(Bo,{size:14})})}),n.jsx(Et,{side:"bottom",children:i("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Qn,{onClick:An})]})}),z?n.jsx(Qt,{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:It&&N?n.jsx(nr,{rawSeo:an,innerSeo:_n,defaultResolveType:Gs,seoSchema:qs,activeResolveType:on,seoTypeOptions:Us,formResetKey:be,siteDefaultSeo:Ws,onBreadcrumbChange:k,onPersistRaw:Ca,onInnerChange:Pa,onClearForm:Aa,onBumpFormKey:Ma}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Ut?n.jsxs(Qt,{viewportRef:Ye,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[gt&&St.length>0&&se.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(co,{listKey:`${N??""}:${g??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:un,onSelect:ia,onRename:ie,onDuplicate:ca,onDelete:la,onRemoveAll:da,onReorder:ua,onAdd:()=>cn()}),gt&&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:i("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Xn,{currentRt:et??"",currentLabel:Jt(Ht?.rule,c??{},ct,r??void 0),currentGlobalKey:At(Ht?.rule,c??{},r??void 0)??void 0,matchers:zt,globals:Tn,onSelect:ba,onSelectGlobal:xa,schema:ja,formValue:dt,onChange:Sa,formKey:`${g??"none"}:${un}:${et??""}`,formWrapperClassName:"pt-1",meta:r??void 0,decofile:c,onSaveReferencedBlock:Kt,sandbox:$t})]})]}),n.jsx(Yn,{activeSchema:rn,formValue:ke,formResetKey:Be,onFormChange:Rn,onBreadcrumbChange:F,breadcrumbPath:se,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:r,decofile:c,onSaveReferencedBlock:Kt,sandbox:$t,previewBaseUrl:K,onRequestAddSection:wn})]},"editor-section-form"):Ce?n.jsx(Qt,{viewportRef:Ye,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Yn,{activeSchema:rn,formValue:ke,formResetKey:Be,onFormChange:Rn,onBreadcrumbChange:F,breadcrumbPath:se,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:r,decofile:c,onSaveReferencedBlock:Kt,sandbox:$t,previewBaseUrl:K,onRequestAddSection:wn})},"editor-global-block"):n.jsxs(Qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ot&&N&&n.jsx(Ar,{listKey:N,variants:Ge,activeIndex:$e,decofile:c??{},meta:r,matchers:zt,onSelect:wa,onReorder:ka,onRename:ee,onDuplicate:Na,onDelete:Ta,onAdd:An}),Ot&&de!==null&&n.jsxs("div",{className:ze("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>fe(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":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),le?n.jsx(Lo,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Po,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsx("div",{className:ze("space-y-3",Vt&&"pointer-events-none opacity-50"),children:n.jsx(Xn,{currentRt:de,currentLabel:Jt(mt?.rule,c??{},ct,r??void 0),currentGlobalKey:At(mt?.rule,c??{},r??void 0)??void 0,matchers:zt,globals:Tn,onSelect:ga,onSelectGlobal:va,schema:pa,formValue:Te,onChange:ha,formKey:`${$e}:${de??""}`,formWrapperClassName:"space-y-3",meta:r??void 0,decofile:c,onSaveReferencedBlock:Kt,sandbox:$t})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(Rr,{listKey:`${N??""}-${$e}`,rawSections:G,sections:Ue,meta:r,selectedIndex:g,onSelect:Qs,onReorder:Zs,onDelete:ea,onDuplicate:ta,onMakeReusable:Ie,onToggleHidden:na,onToggleLazy:sa,onAddVariant:cn,onDetach:aa,onAddSection:()=>ge(!0),canAddSection:fa})})]},"editor-section-list"),n.jsx(uo,{open:me!==null,onOpenChange:t=>{t||Ie(null)},defaultBlockId:me!==null?fn(Ue[me]?.label??""):"",isPending:Pe.isPending,onSubmit:ma}),K&&n.jsx(rr,{open:pe,onOpenChange:t=>{ge(t),t||(ce.current=null)},meta:r,decofile:c,previewBaseUrl:K,onSelect:ra}),_e&&N&&c&&n.jsx(mo,{open:_e,onOpenChange:je,pageKey:N,decofile:c}),Me!==null&&n.jsx(qn,{open:!0,initialName:Tt(Ge[Me]?.rule,c??{},r??void 0)?Jt(Ge[Me]?.rule,c??{},ct,r??void 0):"",autoLabel:ct(Lt(Ge[Me]?.rule,c??{},r??void 0)),isPending:Vt,onSubmit:async t=>{await Va(Me,t)},onOpenChange:t=>{!t&&!Vt&&ee(null)}}),ye!==null&&n.jsx(qn,{open:!0,initialName:Tt(St[ye]?.rule,c??{},r??void 0)?Jt(St[ye]?.rule,c??{},ct,r??void 0):"",autoLabel:ct(Lt(St[ye]?.rule,c??{},r??void 0)),isPending:Vt,onSubmit:async t=>{await Da(ye,t)},onOpenChange:t=>{!t&&!Vt&&ie(null)}})]})}export{kc as SectionsEditor};
1
+ import{c as We,b as ut,r as T,n as ze,j as n,aC as Zn,ab as _t,a8 as jt,B as Ze,a9 as Et,k as es,p as Ko,t as Y,K as Fo}from"./index-KDqP1Gsm.js";import{b as Io}from"./chat-context-DKWpBi6a.js";import{aw as ts,ax as Oo,ay as $o,az as zo,aA as Ho,ab as ns,ac as Xt,aB as ss,aC as os,ad as as,ae as rs,aD as is,aE as Uo,al as ls,am as cs,aF as Go,aG as qo,aH as us,P as Wo,af as ds,ag as Bt,aj as ms,ak as fs,ah as ps,ar as gs,aI as Jo,aJ as Lt,aK as hs,aL as Yo,S as vs,aM as ct,H as bs,aN as Qo,aO as Xo,aP as Zo,aQ as ea,F as ta,G as na,aR as sa,aS as oa,aT as aa,aU as ra,ap as qt,aV as Wt,aW as ia,aX as xt,aY as Ct,aZ as la,a_ as ca,a$ as st,b0 as Kn,b1 as ua,b2 as At,b3 as Jt,b4 as da,b5 as fn,b6 as ma,b7 as Tt,b8 as fa,b9 as pa,ba as ga,bb as ha,bc as va,bd as yt,be as ba,bf as Sa,bg as xa,J as ya,bh as Fn,bi as Mt,bj as In,bk as On,bl as _a,bm as ja,bn as Ea,bo as Ra,bp as pn,bq as $n,br as zn,bs as Nt,bt as Yt,bu as Hn,bv as wa,bw as gn,bx as ka,by as Ta,bz as Na,bA as Va,bB as Da}from"./index-B4zhLaf0.js";import{t as Pa}from"./ChevronDown-CfTwRjpu.js";import{ah as vn,x as Ca,V as Ss,G as Aa,w as xs,ao as Ma,r as Ba}from"./agent-icon-DVUH-8t0.js";import{i as ys}from"./ChevronRight-CcZYXLnk.js";import{n as La}from"./ChevronUp-DY84NWjt.js";import{i as Ka}from"./Globe01-CeczlHYX.js";import{B as Qt}from"./automation-runs-BScmV1SD.js";import{b as Fa,h as Ia,a as Oa,c as $a,d as za,e as Ha}from"./dialog-DxKkTLbq.js";import{I as Ua}from"./input-DquBu4q_.js";import{a as _s}from"./Copy01-DZeibaPx.js";import{i as Ga}from"./Settings02-BXdaEYOk.js";import{s as qa}from"./Eye-CFyW3JW2.js";import{s as js}from"./TrendUp01-Bw1Pok-m.js";import{s as bn}from"./Plus-B9dgrF--.js";import{s as Es}from"./Trash01-BvQnygca.js";import{i as Wa}from"./Zap-BDHGOkVa.js";import{D as Rs,a as bt,c as ws,b as ks,i as Ja}from"./dropdown-menu-3KGTt1z3.js";import{S as Ya,r as Un,u as Qa,d as Xa,a as Za,i as er,f as tr,P as nr,b as sr}from"./page-seo-form-BzP0n8PA.js";import{b as or}from"./Tool01-CkxUn0iW.js";import{u as ar,A as rr}from"./use-section-preview-base-DrHgFpHq.js";import"./tab-id-DinXx1o5.js";import"./Check-DOZ1j5aP.js";import"./Download01-j6HzmTHn.js";import"./session-runtime-wVXsCwcJ.js";import"./hooks-DvLJppZz.js";import"./use-mcp-client-Ccglhaff.js";import"./constants-_08zpzmT.js";import"./auth-CAPmNKdk.js";import"./decopilot-sse-pool-zGwptasN.js";import"./backoff-CrEUbyZT.js";import"./delay-CnY5UFtP.js";import"./use-is-desktop-app-BNujXJc_.js";import"./use-virtual-mcp-C5AQ8t-k.js";import"./use-ai-providers-CndNGdcW.js";import"./use-decopilot-events-BOeKlCK5.js";import"./use-organization-settings-BDurak7I.js";import"./ArrowUp-DGCVmSXN.js";import"./spinner-Imce-mLB.js";import"./drawer-D5TQ4QVU.js";import"./collection-search-CH69fupc.js";import"./SearchMd-D0B5ipxb.js";import"./chart-81L9BaQL.js";import"./index-C77SbC4v.js";import"./shell-layout-CE5eExEo.js";import"./avatar--qZZWxNU.js";import"./User01-BMq0jB1V.js";import"./Users03-CHcjaWYR.js";import"./SearchLg-CY0Zjox7.js";import"./Stars02-CpxAP5Pb.js";import"./XClose-C6KRE0bv.js";import"./CheckCircle-DlOtm9Ya.js";import"./FilterLines-CxzK-qgs.js";import"./Monitor01-CMLvYrbC.js";import"./required-auth-layout-7VMDmYlx.js";import"./use-org-sso-D7W8pK7z.js";import"./XCircle-DDtIWV0E.js";import"./Upload01-BB6Rmyxr.js";import"./AlertCircle-DjH3xyxR.js";import"./form-CiwKi0eV.js";import"./label-ZOErmdFJ.js";import"./select-eugfdpxm.js";import"./UserSquare-DfgVTJvP.js";import"./ArrowLeft-CziJuoiK.js";import"./tabs-CuiSn5Mm.js";import"./Tool02-DxTCQ0L-.js";import"./toggle-group-BQziHXLf.js";import"./use-commerce-diagnostic-CCcvJLvQ.js";import"./popover-Cc7-lSFL.js";import"./self-tool-result-Dd4smcIO.js";import"./alert-dialog-DRqYR-1I.js";import"./integration-icon-BrtysDGX.js";import"./extract-connection-data-DZTXwtVS.js";import"./metadata-dUsYcpuu.js";import"./provision-repo-scoped-github-connection-CMPWtdMv.js";import"./use-debounced-value-DvFQNrA4.js";import"./LinkExternal01-Cqt6eGQK.js";import"./authenticate-and-persist-oauth-J_cn2ztF.js";import"./mcp-oauth-DszQiwE1.js";import"./track-xoJwVMpw.js";import"./toolbar-Pc89mgDQ.js";import"./github-repo-picker-BScZw3f5.js";import"./use-connection-CP1FWxHa.js";import"./LockUnlocked01-CzcG9NTf.js";import"./use-mcp-tools-x79FIbn7.js";import"./use-navigate-to-agent-B8BcWQ50.js";import"./reusable-new-chat-CzvRy4Pe.js";import"./agent-capabilities-C4tLW0Za.js";import"./connection-card-BudTMzOk.js";import"./use-registry-connections-CgEt8cpb.js";import"./useInfiniteQuery-DZxkhGF0.js";import"./use-infinite-scroll-DPdm26Ur.js";import"./retry-CErkP7V6.js";import"./connection-slug-eyAPH6o3.js";import"./textarea-174bDQE7.js";import"./connection-form-helpers-ojGyy-IO.js";import"./collection-tabs-D68YVO29.js";import"./badge-D0zX1eM-.js";import"./useSuspenseInfiniteQuery-DRpl4v3w.js";import"./command-DASwAiw_.js";import"./index-6TUUAs0P.js";import"./use-clock-tick-B7i0loC3.js";import"./DotsVertical-Dx1RUx8-.js";import"./format-time-BnbuEtat.js";import"./differenceInSeconds-NQ4PDo0z.js";import"./select-model-DOqZtA1i.js";import"./checkbox-Cqcbv288.js";import"./ChevronSelectorVertical-BfQxyKLG.js";import"./Key01-Cjud0Kdq.js";import"./ai-providers-logos-DD3qZ33J.js";import"./Stars01-C11eqixJ.js";import"./cards-CdLHnXN_.js";import"./Share07-CGfdFKWg.js";import"./Palette-DTRR7mtd.js";import"./file-type-icon-DulzLg6u.js";import"./question-004-sINsf4GQ.js";import"./use-members-CSBEydJ8.js";import"./use-org-auth-client-BXAWQl35.js";import"./use-status-sounds-NumgFytv.js";import"./empty-state-UI9Z1qLy.js";import"./ZapSquare-BnYLgre0.js";import"./types-CtwCSU1x.js";import"./use-file-configs-CjiPcdqh.js";import"./monaco-editor-C5-L9oYo.js";import"./pt-BR-CLy76QW2.js";import"./switch-C5Rry-Me.js";import"./Play-iwBwEV5N.js";import"./use-debounced-autosave-C9BDQzJT.js";import"./search-input-CNOVPBHV.js";import"./index-BCewMvAz.js";import"./Users01-BdSUgolZ.js";import"./use-secrets-CDdfMi4k.js";import"./AreaChart-DCXmgZor.js";import"./task-key-DoaQpMwZ.js";import"./use-copy-4jxScS2N.js";import"./SwitchHorizontal01-BxN6tEz7.js";import"./use-tags-BExTG9Q4.js";import"./get-initials-D-f_fDFw.js";import"./use-automations-BKt_nFW6.js";import"./automation-list-row-BPLY-7BK.js";import"./use-org-repo-syncs-1h1QSKDP.js";import"./CreditCard01-CUs2cJ7L.js";import"./Globe04-CkwPSY_6.js";import"./HardDrive-BvarQXTY.js";import"./LogOut01-B4zaIeTL.js";import"./Sun-Cl27J9U3.js";import"./Shield01-BmPhKNd6.js";import"./table-Dbx9Pc-x.js";function ir(m){return m.schema?.definitions??m.schema?.$defs??{}}function Ts(m,e){const a=ir(e),l=a[btoa(m)];if(!l)return[];const d=[l];if(Array.isArray(l.allOf)){const h=l.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 lr(m,e){for(const a of Ts(m,e)){const l=typeof a.image=="string"?a.image:void 0;if(l?.includes("{{{"))return l}}function cr(m,e){if(!e)return;const a=ts(m);if(!a)return;const l=lr(a.resolveType,e);if(!l)return;const d=Oo(l,a.data);if(d)return $o(d)}const ur={escape:Ho};function dr(m,e){for(const a of Ts(m,e)){const l=typeof a.title=="string"?a.title:void 0;if(l?.includes("{{"))return l}}function mr(m,e){if(!e)return;const a=ts(m);if(a)try{const l=dr(a.resolveType,e);return l&&zo.render(l,a.data,{},ur).trim()||void 0}catch{return}}const fr="text-global-section-fg hover:bg-global-section/12 dark:text-global-section-fg-dark dark:hover:bg-global-section/15",pr="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 Gn(m){return Array.from({length:m},(e,a)=>({id:crypto.randomUUID(),index:a}))}function Ns(m){return m.map((e,a)=>({...e,index:a}))}function gr(m,e){if(e===m.length)return m;if(e<m.length)return Ns(m.slice(0,e));const a=Array.from({length:e-m.length},(l,d)=>({id:crypto.randomUUID(),index:m.length+d}));return[...m,...a]}function Vs(m){const e=We.c(25),{section:a,raw:l,meta:d}=m,h=a.isSavedBlock===!0,b=a.isMultivariate===!0;let p;e[0]!==d||e[1]!==l?(p=l&&d?cr(l,d):void 0,e[0]=d,e[1]=l,e[2]=p):p=e[2];const v=p;let f;e[3]!==d||e[4]!==b||e[5]!==l||e[6]!==h?(f=l&&d&&!h&&!b?mr(l,d):void 0,e[3]=d,e[4]=b,e[5]=l,e[6]=h,e[7]=f):f=e[7];const R=f;let V;e[8]===Symbol.for("react.memo_cache_sentinel")?(V=n.jsx(Ca,{className:"h-4 w-4 shrink-0 text-muted-foreground/40"}),e[8]=V):V=e[8];let D;e[9]!==v?(D=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]=D):D=e[10];let j;e[11]!==b||e[12]!==h?(j=h?{color:Wo}:b?{color:"oklch(0.65 0.15 160)"}:void 0,e[11]=b,e[12]=h,e[13]=j):j=e[13];let i;e[14]!==j?(i=n.jsx(vn,{className:"h-4 w-4 shrink-0",style:j}),e[14]=j,e[15]=i):i=e[15];const x=a.isHidden&&"line-through opacity-50";let E;e[16]!==x?(E=ze("min-w-0 flex-1 truncate text-sm font-medium",x),e[16]=x,e[17]=E):E=e[17];const c=R??a.label;let w;e[18]!==E||e[19]!==c?(w=n.jsx("span",{className:E,children:c}),e[18]=E,e[19]=c,e[20]=w):w=e[20];let r;return e[21]!==w||e[22]!==D||e[23]!==i?(r=n.jsxs(n.Fragment,{children:[V,D,i,w]}),e[21]=w,e[22]=D,e[23]=i,e[24]=r):r=e[24],r}const hr="w-7 ml-0 opacity-100 [transition:opacity_150ms_ease-out,width_0ms,margin-left_0ms]",vr="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]",br="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 hn(m,e){return ze("h-7 shrink-0 overflow-hidden",e?hr:m?br:vr)}function Ds(m,e){const a=m.isSavedBlock===!0,l=m.isMultivariate===!0;return ze("group flex select-none items-center gap-2 rounded-md px-2 py-2.5",e?"bg-accent text-accent-foreground":a?fr:l?us:"text-foreground/80 hover:bg-accent hover:text-accent-foreground")}function Sr(m){const e=We.c(82),{section:a,raw:l,meta:d,sortableId:h,selected:b,onSelect:p,onDelete:v,onDuplicate:f,onMakeReusable:R,onToggleHidden:V,onToggleLazy:D,onAddVariant:j,onDetach:i}=m,x=ut(),E=l?is(l.__resolveType??""):!1,c=a.isHidden===!0,w=E||c;let r;e[0]!==a?(r=Uo(a),e[0]=a,e[1]=r):r=e[1];const B=r;let I;e[2]!==h?(I={id:h,animateLayoutChanges:Er},e[2]=h,e[3]=I):I=e[3];const{attributes:X,listeners:K,setNodeRef:g,transform:L,isDragging:ke}=ls(I);let C;e[4]!==L?(C=cs.Transform.toString(L?{...L,x:0}:null),e[4]=L,e[5]=C):C=e[5];const te=ke?0:void 0;let P;e[6]!==C||e[7]!==te?(P={transform:C,opacity:te},e[6]=C,e[7]=te,e[8]=P):P=e[8];const ne=P;let O;e[9]!==a?(O=Go(a),e[9]=a,e[10]=O):O=e[10];const Ae=O,xe="button",Te=0;let W;e[11]!==p?(W=k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),p())},e[11]=p,e[12]=W):W=e[12];const de=ke?"cursor-grabbing":"cursor-pointer";let re;e[13]!==a||e[14]!==b||e[15]!==de?(re=ze("touch-none transition-colors",de,Ds(a,b)),e[13]=a,e[14]=b,e[15]=de,e[16]=re):re=e[16];let se;e[17]!==d||e[18]!==l||e[19]!==a?(se=n.jsx(Vs,{section:a,raw:l,meta:d}),e[17]=d,e[18]=l,e[19]=a,e[20]=se):se=e[20];const F=!a.isMultivariate&&n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":x(E?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender"),className:ze(hn(w,E)),onClick:k=>{k.stopPropagation(),D()},onPointerDown:jr,children:n.jsx(Wa,{className:ze("h-3.5 w-3.5",E&&"text-yellow-500")})})}),n.jsx(Et,{side:"bottom",children:x(E?"sectionsEditor.sectionList.disableAsyncRender":"sectionsEditor.sectionList.enableAsyncRender")})]}),Ye=!a.isMultivariate&&n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":x(c?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection"),className:ze(hn(w,c)),onClick:k=>{k.stopPropagation(),V()},onPointerDown:_r,children:c?n.jsx(Ga,{className:"h-3.5 w-3.5"}):n.jsx(qa,{className:"h-3.5 w-3.5"})})}),n.jsx(Et,{side:"bottom",children:x(c?"sectionsEditor.sectionList.showSection":"sectionsEditor.sectionList.hideSection")})]}),Ke=ws,Fe=Rs,Be=!0,$=Ze,me="button",Ie="ghost",Me="icon";let ee;e[21]!==x?(ee=x("sectionsEditor.sectionList.sectionActionsMenu"),e[21]=x,e[22]=ee):ee=e[22];const ye=ze(hn(w,!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 ie;e[23]===Symbol.for("react.memo_cache_sentinel")?(ie=n.jsx(Ss,{className:"h-3.5 w-3.5"}),e[23]=ie):ie=e[23];let le;e[24]!==$||e[25]!==ee||e[26]!==ye?(le=n.jsx($,{type:me,variant:Ie,size:Me,"aria-label":ee,className:ye,onClick:yr,onPointerDown:xr,children:ie}),e[24]=$,e[25]=ee,e[26]=ye,e[27]=le):le=e[27];let fe;e[28]!==Fe||e[29]!==le?(fe=n.jsx(Fe,{asChild:Be,children:le}),e[28]=Fe,e[29]=le,e[30]=fe):fe=e[30];let pe;e[31]!==f?(pe=k=>{k.stopPropagation(),f()},e[31]=f,e[32]=pe):pe=e[32];let ge;e[33]===Symbol.for("react.memo_cache_sentinel")?(ge=n.jsx(_s,{className:"h-4 w-4"}),e[33]=ge):ge=e[33];let _e;e[34]!==x?(_e=x("sectionsEditor.sectionList.duplicateMenuItem"),e[34]=x,e[35]=_e):_e=e[35];let je;e[36]!==pe||e[37]!==_e?(je=n.jsxs(bt,{onClick:pe,children:[ge,_e]}),e[36]=pe,e[37]=_e,e[38]=je):je=e[38];let ce;e[39]!==B||e[40]!==j||e[41]!==x?(ce=B&&n.jsxs(bt,{className:qo,onClick:k=>{k.stopPropagation(),j()},children:[n.jsx(js,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.addVariantMenuItem")]}),e[39]=B,e[40]=j,e[41]=x,e[42]=ce):ce=e[42];let z;e[43]!==Ae||e[44]!==R||e[45]!==x?(z=Ae&&n.jsxs(bt,{className:pr,onClick:k=>{k.stopPropagation(),R()},children:[n.jsx(vn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.makeReusableMenuItem")]}),e[43]=Ae,e[44]=R,e[45]=x,e[46]=z):z=e[46];let Ee;e[47]!==i||e[48]!==a.isMultivariate||e[49]!==a.isSavedBlock||e[50]!==x?(Ee=a.isSavedBlock===!0&&!a.isMultivariate&&n.jsxs(bt,{onClick:k=>{k.stopPropagation(),i()},children:[n.jsx(vn,{className:"h-4 w-4"}),x("sectionsEditor.sectionList.detachMenuItem")]}),e[47]=i,e[48]=a.isMultivariate,e[49]=a.isSavedBlock,e[50]=x,e[51]=Ee):Ee=e[51];let he;e[52]!==v?(he=k=>{k.stopPropagation(),v()},e[52]=v,e[53]=he):he=e[53];let Re;e[54]===Symbol.for("react.memo_cache_sentinel")?(Re=n.jsx(Es,{className:"h-4 w-4"}),e[54]=Re):Re=e[54];let oe;e[55]!==x?(oe=x("sectionsEditor.sectionList.deleteMenuItem"),e[55]=x,e[56]=oe):oe=e[56];let Z;e[57]!==he||e[58]!==oe?(Z=n.jsxs(bt,{className:"text-destructive focus:text-destructive",onClick:he,children:[Re,oe]}),e[57]=he,e[58]=oe,e[59]=Z):Z=e[59];let ue;e[60]!==je||e[61]!==ce||e[62]!==z||e[63]!==Ee||e[64]!==Z?(ue=n.jsxs(ks,{align:"end",className:"w-44",children:[je,ce,z,Ee,Z]}),e[60]=je,e[61]=ce,e[62]=z,e[63]=Ee,e[64]=Z,e[65]=ue):ue=e[65];let ve;e[66]!==Ke||e[67]!==fe||e[68]!==ue?(ve=n.jsxs(Ke,{children:[fe,ue]}),e[66]=Ke,e[67]=fe,e[68]=ue,e[69]=ve):ve=e[69];let Ne;return e[70]!==X||e[71]!==K||e[72]!==p||e[73]!==g||e[74]!==ne||e[75]!==re||e[76]!==se||e[77]!==F||e[78]!==Ye||e[79]!==ve||e[80]!==W?(Ne=n.jsxs("div",{ref:g,style:ne,...X,...K,role:xe,tabIndex:Te,onClick:p,onKeyDown:W,className:re,children:[se,F,Ye,ve]}),e[70]=X,e[71]=K,e[72]=p,e[73]=g,e[74]=ne,e[75]=re,e[76]=se,e[77]=F,e[78]=Ye,e[79]=ve,e[80]=W,e[81]=Ne):Ne=e[81],Ne}function xr(m){return m.stopPropagation()}function yr(m){return m.stopPropagation()}function _r(m){return m.stopPropagation()}function jr(m){return m.stopPropagation()}function Er(){return!1}function Rr(m){const e=We.c(104),{listKey:a,rawSections:l,sections:d,meta:h,selectedIndex:b,onSelect:p,onReorder:v,onDelete:f,onDuplicate:R,onMakeReusable:V,onToggleHidden:D,onToggleLazy:j,onAddVariant:i,onDetach:x,onAddSection:E,canAddSection:c}=m,w=c===void 0?!0:c,r=ut();let B;e[0]!==d.length?(B=()=>Gn(d.length),e[0]=d.length,e[1]=B):B=e[1];const[I,X]=T.useState(B),[K,g]=T.useState(null),[L,ke]=T.useState(a),[C,te]=T.useState(d.length),P=T.useRef(!1);L!==a?(ke(a),te(d.length),X(Gn(d.length))):C!==d.length&&(te(d.length),X(Ne=>gr(Ne,d.length)));let ne;e[2]===Symbol.for("react.memo_cache_sentinel")?(ne={activationConstraint:{distance:8}},e[2]=ne):ne=e[2];let O;e[3]===Symbol.for("react.memo_cache_sentinel")?(O={coordinateGetter:ds},e[3]=O):O=e[3];const Ae=ns(Xt(rs,ne),Xt(as,O));let xe;e[4]!==I?(xe=I.map(wr),e[4]=I,e[5]=xe):xe=e[5];const Te=xe;let W;e[6]===Symbol.for("react.memo_cache_sentinel")?(W=Ne=>{g(String(Ne.active.id))},e[6]=W):W=e[6];const de=W;let re;e[7]!==Te||e[8]!==v?(re=Ne=>{g(null);const{active:k,over:be}=Ne;if(!be||k.id===be.id)return;const ae=Te.indexOf(String(k.id)),Ve=Te.indexOf(String(be.id));ae===-1||Ve===-1||(X(Oe=>Ns(Bt([...Oe],ae,Ve))),P.current=!0,requestAnimationFrame(()=>{P.current=!1}),v?.(ae,Ve))},e[7]=Te,e[8]=v,e[9]=re):re=e[9];const se=re;let F;e[10]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{g(null)},e[10]=F):F=e[10];const Ye=F;let Ke,Fe,Be,$,me,Ie,Me,ee,ye,ie,le,fe,pe,ge,_e;if(e[11]!==K||e[12]!==w||e[13]!==I||e[14]!==Te||e[15]!==se||e[16]!==h||e[17]!==E||e[18]!==i||e[19]!==f||e[20]!==x||e[21]!==R||e[22]!==V||e[23]!==p||e[24]!==D||e[25]!==j||e[26]!==l||e[27]!==d||e[28]!==b||e[29]!==Ae||e[30]!==r){ge=Symbol.for("react.early_return_sentinel");e:{const Ne=k=>{P.current||p(k)};if(e[46]!==K||e[47]!==w||e[48]!==I||e[49]!==E||e[50]!==l||e[51]!==d||e[52]!==r){const k=K?I.find(be=>be.id===K):null;if($=k!=null?d[k.index]:null,Be=k!=null?l[k.index]:void 0,I.length===0){let be;e[56]!==r?(be=r("sectionsEditor.sectionList.noSections"),e[56]=r,e[57]=be):be=e[57];let ae;e[58]!==be?(ae=n.jsx("p",{className:"px-2 py-3 text-xs text-muted-foreground",children:be}),e[58]=be,e[59]=ae):ae=e[59];const Ve=!w;let Oe;e[60]===Symbol.for("react.memo_cache_sentinel")?(Oe=n.jsx(bn,{size:14}),e[60]=Oe):Oe=e[60];let dt;e[61]!==r?(dt=r("sectionsEditor.sectionList.addSectionButton"),e[61]=r,e[62]=dt):dt=e[62];let De;e[63]!==E||e[64]!==Ve||e[65]!==dt?(De=n.jsxs(Ze,{type:"button",variant:"outline",size:"sm",className:"w-full",disabled:Ve,onClick:E,children:[Oe,dt]}),e[63]=E,e[64]=Ve,e[65]=dt,e[66]=De):De=e[66];let et;e[67]!==ae||e[68]!==De?(et=n.jsxs("div",{className:"space-y-2",children:[ae,De]}),e[67]=ae,e[68]=De,e[69]=et):et=e[69],ge=et;break e}pe=ze(k&&"cursor-grabbing"),e[46]=K,e[47]=w,e[48]=I,e[49]=E,e[50]=l,e[51]=d,e[52]=r,e[53]=Be,e[54]=$,e[55]=pe}else Be=e[53],$=e[54],pe=e[55];Fe=ms,ee=Ae,ye=fs,ie=de,le=se,fe=Ye,Ke=ps,Ie=Te,Me=gs,_e="space-y-1",me=I.map(k=>{const be=d[k.index];return be?n.jsx(Sr,{sortableId:k.id,section:be,raw:l[k.index],meta:h,selected:b===k.index,onSelect:()=>Ne(k.index),onDelete:()=>f(k.index),onDuplicate:()=>R(k.index),onMakeReusable:()=>V(k.index),onToggleHidden:()=>D(k.index),onToggleLazy:()=>j(k.index),onAddVariant:()=>i(k.index),onDetach:()=>x(k.index)},k.id):null})}e[11]=K,e[12]=w,e[13]=I,e[14]=Te,e[15]=se,e[16]=h,e[17]=E,e[18]=i,e[19]=f,e[20]=x,e[21]=R,e[22]=V,e[23]=p,e[24]=D,e[25]=j,e[26]=l,e[27]=d,e[28]=b,e[29]=Ae,e[30]=r,e[31]=Ke,e[32]=Fe,e[33]=Be,e[34]=$,e[35]=me,e[36]=Ie,e[37]=Me,e[38]=ee,e[39]=ye,e[40]=ie,e[41]=le,e[42]=fe,e[43]=pe,e[44]=ge,e[45]=_e}else Ke=e[31],Fe=e[32],Be=e[33],$=e[34],me=e[35],Ie=e[36],Me=e[37],ee=e[38],ye=e[39],ie=e[40],le=e[41],fe=e[42],pe=e[43],ge=e[44],_e=e[45];if(ge!==Symbol.for("react.early_return_sentinel"))return ge;let je;e[70]!==me||e[71]!==_e?(je=n.jsx("div",{className:_e,children:me}),e[70]=me,e[71]=_e,e[72]=je):je=e[72];let ce;e[73]!==Ke||e[74]!==Ie||e[75]!==Me||e[76]!==je?(ce=n.jsx(Ke,{items:Ie,strategy:Me,children:je}),e[73]=Ke,e[74]=Ie,e[75]=Me,e[76]=je,e[77]=ce):ce=e[77];let z;e[78]!==Be||e[79]!==$||e[80]!==h?(z=$?n.jsx("div",{className:ze("cursor-grabbing shadow-lg ring-1 ring-border/60",Ds($,!1)),children:n.jsx(Vs,{section:$,raw:Be,meta:h})}):null,e[78]=Be,e[79]=$,e[80]=h,e[81]=z):z=e[81];let Ee;e[82]!==z?(Ee=Zn.createPortal(n.jsx(ss,{dropAnimation:os,children:z}),document.body),e[82]=z,e[83]=Ee):Ee=e[83];let he;e[84]!==Fe||e[85]!==ee||e[86]!==ye||e[87]!==ie||e[88]!==le||e[89]!==fe||e[90]!==ce||e[91]!==Ee?(he=n.jsxs(Fe,{sensors:ee,collisionDetection:ye,onDragStart:ie,onDragEnd:le,onDragCancel:fe,children:[ce,Ee]}),e[84]=Fe,e[85]=ee,e[86]=ye,e[87]=ie,e[88]=le,e[89]=fe,e[90]=ce,e[91]=Ee,e[92]=he):he=e[92];const Re=!w;let oe;e[93]===Symbol.for("react.memo_cache_sentinel")?(oe=n.jsx(bn,{size:14}),e[93]=oe):oe=e[93];let Z;e[94]!==r?(Z=r("sectionsEditor.sectionList.addSectionButton"),e[94]=r,e[95]=Z):Z=e[95];let ue;e[96]!==E||e[97]!==Re||e[98]!==Z?(ue=n.jsxs(Ze,{type:"button",variant:"outline",size:"sm",className:"mt-2 w-full",disabled:Re,onClick:E,children:[oe,Z]}),e[96]=E,e[97]=Re,e[98]=Z,e[99]=ue):ue=e[99];let ve;return e[100]!==pe||e[101]!==he||e[102]!==ue?(ve=n.jsxs("div",{className:pe,children:[he,ue]}),e[100]=pe,e[101]=he,e[102]=ue,e[103]=ve):ve=e[103],ve}function wr(m){return m.id}function qn(m){const e=We.c(57),{open:a,initialName:l,autoLabel:d,isPending:h,onSubmit:b,onOpenChange:p}=m,v=h===void 0?!1:h,f=ut(),[R,V]=T.useState(l),[D,j]=T.useState(a);a!==D&&(j(a),a&&V(l));let i;e[0]!==v||e[1]!==p?(i=de=>{!de&&!v&&p(!1)},e[0]=v,e[1]=p,e[2]=i):i=e[2];const x=i;let E;e[3]!==v||e[4]!==R||e[5]!==b?(E=async de=>{de.preventDefault(),!v&&await b(R.trim())},e[3]=v,e[4]=R,e[5]=b,e[6]=E):E=e[6];const c=E;let w;e[7]!==f?(w=f("sectionsEditor.variantRenameDialog.title"),e[7]=f,e[8]=w):w=e[8];let r;e[9]!==w?(r=n.jsx(Fa,{children:w}),e[9]=w,e[10]=r):r=e[10];let B;e[11]!==d||e[12]!==f?(B=f("sectionsEditor.variantRenameDialog.description",{fallback:d||f("sectionsEditor.variantRenameDialog.defaultFallback")}),e[11]=d,e[12]=f,e[13]=B):B=e[13];let I;e[14]!==B?(I=n.jsx(Ia,{children:B}),e[14]=B,e[15]=I):I=e[15];let X;e[16]!==r||e[17]!==I?(X=n.jsxs(Oa,{children:[r,I]}),e[16]=r,e[17]=I,e[18]=X):X=e[18];let K;e[19]!==f?(K=f("sectionsEditor.variantRenameDialog.nameLabel"),e[19]=f,e[20]=K):K=e[20];let g;e[21]!==K?(g=n.jsx("label",{htmlFor:"variant-rename-name",className:"text-xs font-medium text-muted-foreground",children:K}),e[21]=K,e[22]=g):g=e[22];let L;e[23]===Symbol.for("react.memo_cache_sentinel")?(L=de=>V(de.target.value),e[23]=L):L=e[23];let ke;e[24]!==d||e[25]!==v||e[26]!==R?(ke=n.jsx(Ua,{id:"variant-rename-name",value:R,onChange:L,placeholder:d,autoFocus:!0,disabled:v}),e[24]=d,e[25]=v,e[26]=R,e[27]=ke):ke=e[27];let C;e[28]!==g||e[29]!==ke?(C=n.jsxs("div",{className:"space-y-1.5 py-4",children:[g,ke]}),e[28]=g,e[29]=ke,e[30]=C):C=e[30];let te;e[31]!==p?(te=()=>p(!1),e[31]=p,e[32]=te):te=e[32];let P;e[33]!==f?(P=f("sectionsEditor.variantRenameDialog.cancel"),e[33]=f,e[34]=P):P=e[34];let ne;e[35]!==v||e[36]!==te||e[37]!==P?(ne=n.jsx(Ze,{type:"button",variant:"outline",onClick:te,disabled:v,children:P}),e[35]=v,e[36]=te,e[37]=P,e[38]=ne):ne=e[38];let O;e[39]!==v||e[40]!==f?(O=v?n.jsxs(n.Fragment,{children:[n.jsx(es,{size:14,className:"animate-spin"}),f("sectionsEditor.variantRenameDialog.saving")]}):f("sectionsEditor.variantRenameDialog.save"),e[39]=v,e[40]=f,e[41]=O):O=e[41];let Ae;e[42]!==v||e[43]!==O?(Ae=n.jsx(Ze,{type:"submit",disabled:v,children:O}),e[42]=v,e[43]=O,e[44]=Ae):Ae=e[44];let xe;e[45]!==ne||e[46]!==Ae?(xe=n.jsxs($a,{children:[ne,Ae]}),e[45]=ne,e[46]=Ae,e[47]=xe):xe=e[47];let Te;e[48]!==c||e[49]!==C||e[50]!==xe||e[51]!==X?(Te=n.jsx(za,{className:"sm:max-w-md",children:n.jsxs("form",{onSubmit:c,children:[X,C,xe]})}),e[48]=c,e[49]=C,e[50]=xe,e[51]=X,e[52]=Te):Te=e[52];let W;return e[53]!==x||e[54]!==a||e[55]!==Te?(W=n.jsx(Ha,{open:a,onOpenChange:x,children:Te}),e[53]=x,e[54]=a,e[55]=Te,e[56]=W):W=e[56],W}function Ps(m){const e=We.c(5),{rule:a,matchers:l}=m,d=a?.__resolveType??"";let h;if(e[0]!==l||e[1]!==d){const f=l.find(R=>R.resolveType===d)?.iconName??Jo(d);h=Aa(f),e[0]=l,e[1]=d,e[2]=h}else h=e[2];const b=h;if(!b)return null;let p;return e[3]!==b?(p=n.jsx(b,{size:14,className:"shrink-0"}),e[3]=b,e[4]=p):p=e[4],p}function Wn(m){return m.map(e=>`${e.label}|${e.rule?.__resolveType??""}`).join(`
2
+ `)}function Jn(m){return m.map((e,a)=>({id:crypto.randomUUID(),index:a,variant:e}))}function kr(m,e){const a=new Map;for(const l of m){const d=a.get(l.variant.label);d?d.push(l):a.set(l.variant.label,[l])}return e.map((l,d)=>({id:a.get(l.label)?.shift()?.id??crypto.randomUUID(),index:d,variant:l}))}function Tr(m){return m.map((e,a)=>({...e,index:a}))}function Cs(m){const e=We.c(17),{label:a,effectiveRule:l,matchers:d,canDelete:h,dragging:b,onRename:p,onDuplicate:v,onDelete:f}=m,R=ut();let V;e[0]!==l||e[1]!==d?(V=n.jsx(Ps,{rule:l,matchers:d}),e[0]=l,e[1]=d,e[2]=V):V=e[2];let D;e[3]!==a?(D=n.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-medium",children:a}),e[3]=a,e[4]=D):D=e[4];let j;e[5]!==h||e[6]!==b||e[7]!==a||e[8]!==f||e[9]!==v||e[10]!==p||e[11]!==R?(j=!b&&n.jsxs(ws,{children:[n.jsx(Rs,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":R("sectionsEditor.pageVariantTabs.actionsAriaLabel",{label:a}),className:"size-6 shrink-0 opacity-0 transition-opacity group-hover:opacity-100 data-[state=open]:opacity-100",onClick:Vr,onPointerDown:Nr,children:n.jsx(Ss,{size:14})})}),n.jsxs(ks,{align:"end",className:"w-36",children:[n.jsxs(bt,{onClick:x=>{x.stopPropagation(),p?.()},children:[n.jsx(or,{size:14}),R("sectionsEditor.pageVariantTabs.renameAction")]}),n.jsxs(bt,{onClick:x=>{x.stopPropagation(),v?.()},children:[n.jsx(_s,{size:14}),R("sectionsEditor.pageVariantTabs.duplicateAction")]}),n.jsx(Ja,{}),n.jsxs(bt,{variant:"destructive",disabled:!h,onClick:x=>{x.stopPropagation(),f?.()},children:[n.jsx(Es,{size:14}),R("sectionsEditor.pageVariantTabs.deleteAction")]})]})]}),e[5]=h,e[6]=b,e[7]=a,e[8]=f,e[9]=v,e[10]=p,e[11]=R,e[12]=j):j=e[12];let i;return e[13]!==V||e[14]!==D||e[15]!==j?(i=n.jsxs(n.Fragment,{children:[V,D,j]}),e[13]=V,e[14]=D,e[15]=j,e[16]=i):i=e[16],i}function Nr(m){return m.stopPropagation()}function Vr(m){return m.stopPropagation()}function Dr(m){const e=We.c(33),{entry:a,isActive:l,canDelete:d,decofile:h,meta:b,matchers:p,onSelect:v,onRename:f,onDuplicate:R,onDelete:V}=m;let D;e[0]!==a.id?(D={id:a.id,animateLayoutChanges:Pr},e[0]=a.id,e[1]=D):D=e[1];const{attributes:j,listeners:i,setNodeRef:x,transform:E,isDragging:c}=ls(D);let w;e[2]!==E?(w=cs.Transform.toString(E?{...E,x:0}:null),e[2]=E,e[3]=w):w=e[3];const r=c?0:void 0;let B;e[4]!==w||e[5]!==r?(B={transform:w,opacity:r},e[4]=w,e[5]=r,e[6]=B):B=e[6];const I=B,X=b??void 0;let K;e[7]!==h||e[8]!==a.variant.rule||e[9]!==X?(K=Lt(a.variant.rule,h,X),e[7]=h,e[8]=a.variant.rule,e[9]=X,e[10]=K):K=e[10];const g=K;let L;e[11]!==v?(L=O=>{O.target===O.currentTarget&&(O.key==="Enter"||O.key===" ")&&(O.preventDefault(),v())},e[11]=v,e[12]=L):L=e[12];const ke=c?"cursor-grabbing":"cursor-pointer active:cursor-grabbing",C=l?hs:us;let te;e[13]!==ke||e[14]!==C?(te=ze("group flex select-none items-center gap-2 rounded-md px-2 py-2.5 transition-colors touch-none",ke,C),e[13]=ke,e[14]=C,e[15]=te):te=e[15];let P;e[16]!==d||e[17]!==g||e[18]!==a.variant.label||e[19]!==p||e[20]!==V||e[21]!==R||e[22]!==f?(P=n.jsx(Cs,{label:a.variant.label,effectiveRule:g,matchers:p,canDelete:d,onRename:f,onDuplicate:R,onDelete:V}),e[16]=d,e[17]=g,e[18]=a.variant.label,e[19]=p,e[20]=V,e[21]=R,e[22]=f,e[23]=P):P=e[23];let ne;return e[24]!==j||e[25]!==i||e[26]!==v||e[27]!==x||e[28]!==I||e[29]!==te||e[30]!==P||e[31]!==L?(ne=n.jsx("div",{ref:x,style:I,...j,...i,onClick:v,onKeyDown:L,className:te,children:P}),e[24]=j,e[25]=i,e[26]=v,e[27]=x,e[28]=I,e[29]=te,e[30]=P,e[31]=L,e[32]=ne):ne=e[32],ne}function Pr(){return!1}function Cr(m){const e=We.c(9),{variant:a,decofile:l,meta:d,matchers:h}=m,b=d??void 0;let p;e[0]!==l||e[1]!==b||e[2]!==a.rule?(p=Lt(a.rule,l,b),e[0]=l,e[1]=b,e[2]=a.rule,e[3]=p):p=e[3];const v=p;let f;e[4]===Symbol.for("react.memo_cache_sentinel")?(f=ze("flex items-center gap-2 rounded-md px-2 py-2.5 shadow-lg ring-1 ring-border/60 cursor-grabbing",hs),e[4]=f):f=e[4];let R;return e[5]!==v||e[6]!==h||e[7]!==a.label?(R=n.jsx("div",{className:f,children:n.jsx(Cs,{label:a.label,effectiveRule:v,matchers:h,canDelete:!1,dragging:!0})}),e[5]=v,e[6]=h,e[7]=a.label,e[8]=R):R=e[8],R}function Ar(m){const e=We.c(91),{listKey:a,variants:l,activeIndex:d,decofile:h,meta:b,matchers:p,onSelect:v,onReorder:f,onRename:R,onDuplicate:V,onDelete:D,onAdd:j}=m,i=ut();let x;e[0]!==l?(x=()=>Jn(l),e[0]=l,e[1]=x):x=e[1];const[E,c]=T.useState(x),[w,r]=T.useState(null),[B,I]=T.useState(a),[X,K]=T.useState(l.length);let g;e[2]!==l?(g=()=>Wn(l),e[2]=l,e[3]=g):g=e[3];const[L,ke]=T.useState(g),C=T.useRef(!1),te=Wn(l);B!==a?(I(a),K(l.length),ke(te),c(Jn(l))):(X!==l.length||L!==te)&&(K(l.length),ke(te),c(he=>kr(he,l)));let P;e[4]===Symbol.for("react.memo_cache_sentinel")?(P={activationConstraint:{distance:8}},e[4]=P):P=e[4];let ne;e[5]===Symbol.for("react.memo_cache_sentinel")?(ne={coordinateGetter:ds},e[5]=ne):ne=e[5];const O=ns(Xt(rs,P),Xt(as,ne));let Ae;e[6]!==E?(Ae=E.map(Mr),e[6]=E,e[7]=Ae):Ae=e[7];const xe=Ae,Te=l.length>1;let W;e[8]!==E?(W=he=>{const Re=String(he.active.id);r(E.find(oe=>oe.id===Re)??null)},e[8]=E,e[9]=W):W=e[9];const de=W;let re;e[10]!==xe||e[11]!==f?(re=he=>{r(null);const{active:Re,over:oe}=he;if(!oe||Re.id===oe.id)return;const Z=xe.indexOf(String(Re.id)),ue=xe.indexOf(String(oe.id));Z===-1||ue===-1||(c(ve=>Tr(Bt([...ve],Z,ue))),C.current=!0,requestAnimationFrame(()=>{C.current=!1}),f(Z,ue))},e[10]=xe,e[11]=f,e[12]=re):re=e[12];const se=re;let F;e[13]===Symbol.for("react.memo_cache_sentinel")?(F=()=>{r(null)},e[13]=F):F=e[13];const Ye=F;let Ke,Fe,Be,$,me,Ie,Me,ee,ye,ie,le,fe,pe;if(e[14]!==d||e[15]!==Te||e[16]!==h||e[17]!==E||e[18]!==xe||e[19]!==se||e[20]!==de||e[21]!==p||e[22]!==b||e[23]!==j||e[24]!==D||e[25]!==V||e[26]!==R||e[27]!==v||e[28]!==O||e[29]!==i){const he=ae=>{C.current||v(ae)};le="space-y-1 border-b p-2";let Re;e[43]!==i?(Re=i("sectionsEditor.pageVariantTabs.variantsLabel"),e[43]=i,e[44]=Re):Re=e[44];let oe;e[45]!==Re?(oe=n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:Re}),e[45]=Re,e[46]=oe):oe=e[46];let Z;e[47]!==i?(Z=i("sectionsEditor.pageVariantTabs.addVariantAriaLabel"),e[47]=i,e[48]=Z):Z=e[48];let ue;e[49]===Symbol.for("react.memo_cache_sentinel")?(ue=n.jsx(bn,{size:14}),e[49]=ue):ue=e[49];let ve;e[50]!==j||e[51]!==Z?(ve=n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":Z,className:"size-6",onClick:j,children:ue})}),e[50]=j,e[51]=Z,e[52]=ve):ve=e[52];let Ne;e[53]!==i?(Ne=i("sectionsEditor.pageVariantTabs.addVariantTooltip"),e[53]=i,e[54]=Ne):Ne=e[54];let k;e[55]!==Ne?(k=n.jsx(Et,{children:Ne}),e[55]=Ne,e[56]=k):k=e[56];let be;e[57]!==ve||e[58]!==k?(be=n.jsxs(_t,{children:[ve,k]}),e[57]=ve,e[58]=k,e[59]=be):be=e[59],e[60]!==oe||e[61]!==be?(fe=n.jsxs("div",{className:"flex items-center justify-between",children:[oe,be]}),e[60]=oe,e[61]=be,e[62]=fe):fe=e[62],Fe=ms,Ie=O,Me=fs,ee=de,ye=se,ie=Ye,Ke=ps,$=xe,me=gs,pe="space-y-0.5",Be=E.map(ae=>n.jsx(Dr,{entry:ae,isActive:ae.index===d,canDelete:Te,decofile:h,meta:b,matchers:p,onSelect:()=>he(ae.index),onRename:()=>R(ae.index),onDuplicate:()=>V(ae.index),onDelete:()=>D(ae.index)},ae.id)),e[14]=d,e[15]=Te,e[16]=h,e[17]=E,e[18]=xe,e[19]=se,e[20]=de,e[21]=p,e[22]=b,e[23]=j,e[24]=D,e[25]=V,e[26]=R,e[27]=v,e[28]=O,e[29]=i,e[30]=Ke,e[31]=Fe,e[32]=Be,e[33]=$,e[34]=me,e[35]=Ie,e[36]=Me,e[37]=ee,e[38]=ye,e[39]=ie,e[40]=le,e[41]=fe,e[42]=pe}else Ke=e[30],Fe=e[31],Be=e[32],$=e[33],me=e[34],Ie=e[35],Me=e[36],ee=e[37],ye=e[38],ie=e[39],le=e[40],fe=e[41],pe=e[42];let ge;e[63]!==Be||e[64]!==pe?(ge=n.jsx("div",{className:pe,children:Be}),e[63]=Be,e[64]=pe,e[65]=ge):ge=e[65];let _e;e[66]!==Ke||e[67]!==$||e[68]!==me||e[69]!==ge?(_e=n.jsx(Ke,{items:$,strategy:me,children:ge}),e[66]=Ke,e[67]=$,e[68]=me,e[69]=ge,e[70]=_e):_e=e[70];let je;e[71]!==w||e[72]!==h||e[73]!==p||e[74]!==b?(je=w?n.jsx(Cr,{variant:w.variant,decofile:h,meta:b,matchers:p}):null,e[71]=w,e[72]=h,e[73]=p,e[74]=b,e[75]=je):je=e[75];let ce;e[76]!==je?(ce=Zn.createPortal(n.jsx(ss,{dropAnimation:os,children:je}),document.body),e[76]=je,e[77]=ce):ce=e[77];let z;e[78]!==Fe||e[79]!==Ie||e[80]!==Me||e[81]!==ee||e[82]!==ye||e[83]!==ie||e[84]!==_e||e[85]!==ce?(z=n.jsxs(Fe,{sensors:Ie,collisionDetection:Me,onDragStart:ee,onDragEnd:ye,onDragCancel:ie,children:[_e,ce]}),e[78]=Fe,e[79]=Ie,e[80]=Me,e[81]=ee,e[82]=ye,e[83]=ie,e[84]=_e,e[85]=ce,e[86]=z):z=e[86];let Ee;return e[87]!==le||e[88]!==fe||e[89]!==z?(Ee=n.jsxs("div",{className:le,children:[fe,z]}),e[87]=le,e[88]=fe,e[89]=z,e[90]=Ee):Ee=e[90],Ee}function Mr(m){return m.id}function Br(m){const e=We.c(16),{schema:a,value:l,onChange:d,meta:h,decofile:b,onSaveReferencedBlock:p,sandbox:v}=m,f=ut();let R;e[0]===Symbol.for("react.memo_cache_sentinel")?(R=[],e[0]=R):R=e[0];const[V,D]=T.useState(R);let j;e[1]!==V||e[2]!==f?(j=V.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:()=>D([]),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(xs,{className:"size-3.5"})}),V.map((E,c)=>{const w=c===V.length-1,r=bs(E);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[c>0&&n.jsx(ys,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>D(V.slice(0,c+1)),title:r,className:ze("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors hover:bg-accent hover:text-accent-foreground",w?"font-medium text-foreground":"text-muted-foreground"),children:r})]},`${r}-${c}`)})]}),e[1]=V,e[2]=f,e[3]=j):j=e[3];let i;e[4]!==V||e[5]!==b||e[6]!==h||e[7]!==d||e[8]!==p||e[9]!==v||e[10]!==a||e[11]!==l?(i=n.jsx(vs,{schema:a,value:l,onChange:d,basePath:"",breadcrumbPath:V,onBreadcrumbChange:D,meta:h,decofile:b,onSaveReferencedBlock:p,sandbox:v}),e[4]=V,e[5]=b,e[6]=h,e[7]=d,e[8]=p,e[9]=v,e[10]=a,e[11]=l,e[12]=i):i=e[12];let x;return e[13]!==j||e[14]!==i?(x=n.jsxs("div",{className:"space-y-2",children:[j,i]}),e[13]=j,e[14]=i,e[15]=x):x=e[15],x}function Yn(m){const e=We.c(23),{activeSchema:a,formValue:l,formResetKey:d,onFormChange:h,onBreadcrumbChange:b,breadcrumbPath:p,emptyMessage:v,beforeForm:f,seoResolveType:R,siteDefaultSeo:V,meta:D,decofile:j,onSaveReferencedBlock:i,sandbox:x,previewBaseUrl:E,onRequestAddSection:c}=m;let w;e[0]!==p?(w=p===void 0?[]:p,e[0]=p,e[1]=w):w=e[1];const r=w;let B;e[2]!==a||e[3]!==r||e[4]!==j||e[5]!==d||e[6]!==l||e[7]!==D||e[8]!==b||e[9]!==h||e[10]!==c||e[11]!==i||e[12]!==E||e[13]!==x||e[14]!==R||e[15]!==V?(B=a&&l?R?n.jsx(Ya,{schema:a,resolveType:R,value:l,formResetKey:d,onChange:h,onBreadcrumbChange:b,siteDefaultSeo:V}):n.jsx(vs,{schema:a,value:l,onChange:h,basePath:"",breadcrumbPath:r,onBreadcrumbChange:b,meta:D,decofile:j,onSaveReferencedBlock:i,sandbox:x,previewBaseUrl:E,onRequestAddSection:c},d):null,e[2]=a,e[3]=r,e[4]=j,e[5]=d,e[6]=l,e[7]=D,e[8]=b,e[9]=h,e[10]=c,e[11]=i,e[12]=E,e[13]=x,e[14]=R,e[15]=V,e[16]=B):B=e[16];const I=B;let X;e[17]!==v||e[18]!==I?(X=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]=X):X=e[19];let K;return e[20]!==f||e[21]!==X?(K=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,X]})}),e[20]=f,e[21]=X,e[22]=K):K=e[22],K}const Lr="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 Kr(m,e){return Yo(m,e,ct)}function Fr(m){const e=We.c(19),{pageKey:a,initialName:l,initialPath:d,onFieldChange:h}=m,b=ut(),[p,v]=T.useState(l),[f,R]=T.useState(d),[V,D]=T.useState(a);V!==a&&(D(a),v(l),R(d));let j;e[0]!==h?(j=B=>{v(B.target.value),h("name",B.target.value)},e[0]=h,e[1]=j):j=e[1];let i;e[2]!==b?(i=b("sectionsEditor.sectionsEditorPanels.pageNamePlaceholder"),e[2]=b,e[3]=i):i=e[3];let x;e[4]!==p||e[5]!==j||e[6]!==i?(x=n.jsx("input",{type:"text",value:p,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:i}),e[4]=p,e[5]=j,e[6]=i,e[7]=x):x=e[7];let E;e[8]!==h?(E=B=>{R(B.target.value),h("path",B.target.value)},e[8]=h,e[9]=E):E=e[9];let c;e[10]!==b?(c=b("sectionsEditor.sectionsEditorPanels.pathPlaceholder"),e[10]=b,e[11]=c):c=e[11];let w;e[12]!==f||e[13]!==E||e[14]!==c?(w=n.jsx("input",{type:"text",value:f,onChange:E,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:c}),e[12]=f,e[13]=E,e[14]=c,e[15]=w):w=e[15];let r;return e[16]!==x||e[17]!==w?(r=n.jsxs("div",{className:"space-y-1",children:[x,w]}),e[16]=x,e[17]=w,e[18]=r):r=e[18],r}function Qn(m){const e=We.c(13),{onClick:a}=m,l=ut();let d;e[0]!==l?(d=l("sectionsEditor.sectionsEditorPanels.addVariant"),e[0]=l,e[1]=d):d=e[1];let h;e[2]===Symbol.for("react.memo_cache_sentinel")?(h=n.jsx(js,{size:14}),e[2]=h):h=e[2];let b;e[3]!==a||e[4]!==d?(b=n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{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 p;e[6]!==l?(p=l("sectionsEditor.sectionsEditorPanels.addVariant"),e[6]=l,e[7]=p):p=e[7];let v;e[8]!==p?(v=n.jsx(Et,{side:"bottom",children:p}),e[8]=p,e[9]=v):v=e[9];let f;return e[10]!==b||e[11]!==v?(f=n.jsxs(_t,{children:[b,v]}),e[10]=b,e[11]=v,e[12]=f):f=e[12],f}function Xn(m){const e=We.c(21),{currentRt:a,currentLabel:l,currentGlobalKey:d,matchers:h,globals:b,onSelect:p,onSelectGlobal:v,schema:f,formValue:R,onChange:V,formKey:D,formWrapperClassName:j,meta:i,decofile:x,onSaveReferencedBlock:E,sandbox:c}=m;let w;e[0]!==d||e[1]!==l||e[2]!==a||e[3]!==b||e[4]!==h||e[5]!==p||e[6]!==v?(w=n.jsx(Qo,{currentRt:a,currentLabel:l,currentGlobalKey:d,matchers:h,globals:b,onSelect:p,onSelectGlobal:v}),e[0]=d,e[1]=l,e[2]=a,e[3]=b,e[4]=h,e[5]=p,e[6]=v,e[7]=w):w=e[7];let r;e[8]!==x||e[9]!==D||e[10]!==R||e[11]!==j||e[12]!==i||e[13]!==V||e[14]!==E||e[15]!==c||e[16]!==f?(r=f&&R&&n.jsx("div",{className:j,children:n.jsx(Br,{schema:f,value:R,onChange:V,meta:i,decofile:x,onSaveReferencedBlock:E,sandbox:c},D)}),e[8]=x,e[9]=D,e[10]=R,e[11]=j,e[12]=i,e[13]=V,e[14]=E,e[15]=c,e[16]=f,e[17]=r):r=e[17];let B;return e[18]!==w||e[19]!==r?(B=n.jsxs(n.Fragment,{children:[w,r]}),e[18]=w,e[19]=r,e[20]=B):B=e[20],B}function kc({orgSlug:m,virtualMcpId:e,branch:a,previewReady:l=!0,previewUrl:d,currentPath:h,activePageBlockKey:b=null,activeGlobalBlockKey:p=null,externalSelection:v,onSaved:f,initialEditSeo:R=!1,onExitSeo:V,onViewJsonFile:D,onVariantPreviewOverride:j}){const i=ut(),x=Io()?.taskId??null,E=l?{orgSlug:m,virtualMcpId:e,branch:a,threadId:x,previewUrl:d}:null,{data:c,isLoading:w}=Xo(E),{data:r,isLoading:B}=Zo(E),I=ea(),X=I?.entity?.id===e?I.entity.metadata?.siteSlug??null:null,K=ar({virtualMcpId:e,sandboxUrl:d}),[g,L]=T.useState(null),[ke,C]=T.useState(null),[te,P]=T.useState(null),[ne,O]=T.useState(0),[Ae,xe]=T.useState(void 0),[Te,W]=T.useState(null),[de,re]=T.useState(null),[se,F]=T.useState([]),Ye=T.useRef(null),[Ke,Fe]=T.useState(se.length);Ke!==se.length&&(Fe(se.length),requestAnimationFrame(()=>{Ye.current&&(Ye.current.scrollTop=0)}));const[Be,$]=T.useState(0),[me,Ie]=T.useState(null),[Me,ee]=T.useState(null),[ye,ie]=T.useState(null),[le,fe]=T.useState(!0),[pe,ge]=T.useState(!1),[_e,je]=T.useState(!1),ce=T.useRef(null),[z,Ee]=T.useState(R),[he,Re]=T.useState(R);R&&!he&&(Re(!0),Ee(!0),L(null),C(null),P(null),F([])),!R&&he&&Re(!1);const[oe,Z]=T.useState(null),[ue,ve]=T.useState(void 0),[Ne,k]=T.useState([]),[be,ae]=T.useState(0),[Ve,Oe]=T.useState(0),[dt,De]=T.useState(null),[et,qe]=T.useState(null),[Sn,xn]=T.useState(null),As=Ko(),Ms=`${m}/${e}/${a}`,Zt=ta({orgSlug:m,virtualMcpId:e,branch:a}),[Bs,Ls]=T.useState(h),[Ks,Fs]=T.useState(b),[Is,Os]=T.useState(p);(Bs!==h||Ks!==b||Is!==p)&&(queueMicrotask(()=>Zt.flush()),Ls(h),Fs(b),Os(p),L(null),C(null),P(null),O(0),W(null),re(null),Oe(0),De(null),qe(null),F([]),$(t=>t+1),Ee(!1),Z(null),ve(void 0),k([]),ae(t=>t+1));const Pe=na({orgSlug:m,virtualMcpId:e,branch:a}),Kt=ya((t,s)=>{Pe.mutate({blockKey:t,data:s},{onSuccess:()=>f?.(),onError:o=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:o.message}))})}),en=sa({orgSlug:m,virtualMcpId:e,branch:a}),[Vt,Ft]=T.useState(!1),He=T.useRef(null),ot=T.useRef(null),at=T.useRef(null),tn=T.useRef({}),tt=T.useRef({rawSections:[],parsedSections:[],decofile:{},activePageKey:null,pageVariants:[],variantIndex:0,sectionVariantIndex:0,selectedSectionIndex:null});if(!l||w||B)return n.jsx("div",{className:"h-full w-full flex items-center justify-center",children:n.jsx(es,{size:20,className:"animate-spin text-muted-foreground"})});if(!c||!r)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.couldNotLoadSiteData")});const $s=oa(c),Ce=!!p,Je=Ce?null:aa($s,h,b),N=Ce?p:Je?.key??null,nn=Ce&&p?c[p]:void 0,yn=Ce&&p&&nn?ra(p,nn):Ce&&p?p:"",It=!Ce&&N&&c[N]?c[N]:null,sn=z&&c&&r&&N&&Je?Un(c,{kind:"page",pageKey:N,pageName:String(Je.name??""),path:String(Je.path??"")},r):null,zs=z?It?.seo:void 0,on=ue!==void 0?ue:zs,Hs=z?Qa(on):void 0,Us=sn?.seoTypeOptions??[],Gs=z&&r?Xa(r):"",_n=oe??Hs??{},an=z&&sn?Za(_n,sn):null,qs=z&&an&&er(on)?qt(an,r):null,Ws=z?tr(c,r)?.seoData:void 0,Ge=Ce?[{label:"Default",sections:[{__resolveType:p}]}]:Kr(It?.sections,c??{}),Ot=Ge.length>1,$e=Math.min(ne,Ge.length-1),mt=Ge[$e],G=mt?.sections??[],Ue=Wt(G,c),jn=!Ce&&ia(It?.sections);if(Ce&&p&&Sn!==p){xn(p);const t=G[0],s=Ue[0];if(t&&s){L(0),Oe(0),F([]);const o=xt(t,s,c);o&&(C(o.data),P(o.resolveType),qe(null),De(null))}}!Ce&&Sn!==null&&xn(null),tt.current={rawSections:G,parsedSections:Ue,decofile:c??{},activePageKey:N,pageVariants:Ge,variantIndex:$e,sectionVariantIndex:Ve,selectedSectionIndex:g};const Js=()=>({multivariate:jn,index:$e,variants:Ge.map(t=>({rule:t.rule}))}),En=(t,s)=>{if(!j)return;if(!N||!jn||t.length<=1){j(null);return}const o=Hn(N,{multivariate:!0,index:s,variants:t},c,r);j(o.length>0?o:null)},Rt=(t,s,o)=>{if(!j)return;if(!N){j(null);return}const u=Js(),S=Hn(N,u,c,r);if(!t||s<0){j(S.length>0?S:null);return}const _=wa({pageKey:N,page:u,sectionIndex:s,sectionLazy:Ue[s]?.isLazy??!1,mvObj:t,selectedVariantIndex:o,decofile:c,meta:r}),y=[...S,..._];j(y.length>0?y:null)},ft=(t,s,o,u=g??-1,S=!1)=>{const _=st(t,s);if(!_){C(null),P(null),qe(null),De(null),S&&Rt(null,u,o);return}const A=Kn(_,ct)[o];if(!A){C(null),P(null),qe(null),De(null),S&&Rt(null,u,o);return}const Q=fa(A.value,c);C(Q?.data??null),P(Q?.resolveType??null);const{resolveType:M,formValue:H}=Ct(A.rule,c,r??void 0);qe(M),De(H),S&&Rt(_,u,o)},Dt=v?.index;if(v!==void 0&&(v?.seq??null)!==Ae&&(xe(v?.seq??null),typeof Dt=="number")){const t=G[Dt],s=Ue[Dt];if(t&&s)if(L(Dt),Oe(0),F([]),$(o=>o+1),s.isMultivariate)ft(t,s,0,Dt);else{const o=xt(t,s,c);o?(C(o.data),P(o.resolveType)):(C(null),P(null)),qe(null),De(null)}}const $t={orgSlug:m,virtualMcpId:e,branch:a,threadId:x,previewUrl:d??void 0,siteSlug:X},rn=te&&r?qt(te,r):null,Qe=(t,s)=>{if(!N)return;He.current&&(clearTimeout(He.current),He.current=null),at.current&&(clearTimeout(at.current),at.current=null),ot.current&&(clearTimeout(ot.current),ot.current=null);const o=Mt(c,N,t,$e,Ge);Pe.mutate({blockKey:N,data:o},{onSuccess:()=>s?.onSuccess?.()??f?.(),onError:u=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:u.message}))})},wt=()=>{L(null),C(null),P(null),Oe(0),De(null),qe(null),F([]),$(t=>t+1)},Ys=(t,s)=>{He.current&&clearTimeout(He.current);const o=tt.current.sectionVariantIndex;He.current=setTimeout(()=>{const{rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:A,variantIndex:Q}=tt.current,M=u[s];if(!M)return;const H=S[s];if(!H)return;if(H.isSavedBlock){const q=H.isLazy?M.section?.__resolveType??M.__resolveType:M.__resolveType;Pe.mutate({blockKey:q,data:t},{onSuccess:()=>f?.(),onError:J=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:J.message}))});return}if(!y)return;const U={..._[y]},we=[...u];if(H.isMultivariate){const q=st(M,H);if(!q||!y)return;const J=Ta(q,o,t);we[s]=yt(M,H,J)}else if(H.isHidden){const q=is(M.__resolveType),J=q?{...M.section}:{...M},Le=Array.isArray(J.variants)?[...J.variants]:[];Le[0]&&(Le[0]={...Le[0],value:t}),J.variants=Le,q?we[s]={...M,section:J}:we[s]=J}else H.isLazy?we[s]={...M,section:t}:we[s]=t;if(A.length>1){const q=U.sections,J=[...q?.variants??[]];J[Q]&&(J[Q]={...J[Q],value:we}),U.sections={...q,variants:J}}else U.sections=we;Pe.mutate({blockKey:y,data:U},{onSuccess:()=>f?.(),onError:q=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:q.message}))})},gn)},Qs=t=>{L(t),Oe(0),F([]),$(S=>S+1);const s=G[t],o=Ue[t];if(!s||!o)return;if(o.isMultivariate){ft(s,o,0,t);return}const u=xt(s,o,c);if(!u){C(null),P(null),qe(null),De(null),Rt(null,t,0);return}C(u.data),P(u.resolveType),qe(null),De(null),Rt(null,t,0)},Rn=t=>{const s=t;C(s),g!==null&&Ys(s,g)},ln=t=>{if(!N||!c||!r||!Je)return;const s={kind:"page",pageKey:N,pageName:String(Je.name??""),path:String(Je.path??"")},o=Un(c,s,r);o&&Zt.save(N,()=>{const u=As.getQueryData(Fo.decofile(Ms))?.[N];if(!u||typeof u!="object"||u===null||Array.isArray(u))return null;const S={...u,...tn.current};return tn.current={},t?.raw!==void 0?{...S,seo:t.raw}:t?.inner!==void 0?sr(s,o,S,t.inner):S})},Xs=(t,s)=>{N&&(tn.current[t]=s,ln())},Zs=(t,s)=>{if(!N)return;const o=Bt([...G],t,s);g!==null&&(g===t?L(s):t<g&&s>=g?L(g-1):t>g&&s<=g&&L(g+1)),Qe(o)},eo=t=>{if(!N)return;const s=G.filter((o,u)=>u!==t);g===t?wt():g!==null&&g>t&&L(g-1),Qe(s)},to=t=>{if(!N)return;const s=G[t];if(!s)return;const o=[...G];o.splice(t+1,0,Ra(s)),g!==null&&g>t&&L(g+1),Qe(o)},no=t=>{if(!N)return;const s=G[t],o=Ue[t];if(!s||!o||o.isMultivariate)return;const u=o.isHidden?ja(s):Ea(s);if(!u)return;const S=[...G];S[t]=u,g===t&&wt(),Qe(S)},so=t=>{if(!N)return;const s=G[t],o=Ue[t];if(!s||!o||o.isMultivariate)return;const u=_a(s);if(!u)return;const S=[...G];S[t]=u,g===t&&wt(),Qe(S)},oo=t=>{if(!N)return;const s=G[t],o=Ue[t];if(!s||!o?.isSavedBlock)return;const u=xt(s,o,c);if(!u?.data)return;const{name:S,..._}=u.data,y=[...G];o.isLazy?y[t]={...s,section:_}:y[t]=_,g===t&&wt(),Qe(y)},ao=t=>{if(!N)return;const s=[...G,{__resolveType:t.resolveType}],o=s.length-1;Qe(s,{onSuccess:()=>{ge(!1),L(o),Oe(0),F([]),$(y=>y+1);const u=s[o],S=Wt(s,c)[o];if(!u||!S)return;if(S.isMultivariate){ft(u,S,0);return}const _=xt(u,S,c);if(!_){C(null),P(null),qe(null),De(null);return}C(_.data),P(_.resolveType),qe(null),De(null)}})},wn=t=>{ce.current=t.append,ge(!0)},ro=t=>{const s=ce.current;if(!s){ao(t);return}s({__resolveType:t.resolveType}),ge(!1),ce.current=null},io=t=>{if(g===null)return;const s=G[g],o=Ue[g];!s||!o?.isMultivariate||(Oe(t),F([]),$(u=>u+1),ft(s,o,t,g,!0))},lo=t=>{if(g===null||!N)return;const s=G[g],o=Ue[g];if(!s||!o?.isMultivariate)return;const u=st(s,o);if(!u)return;const S=Sa(u,t);if(!S){Y.error(i("sectionsEditor.sectionsEditor.cannotDeleteOnlyVariant"));return}const _=[...G];_[g]=yt(s,o,S);const y=S.variants;let A=Ve;t===Ve?A=Math.min(t,y.length-1):t<Ve&&(A=Ve-1),Oe(A),F([]),$(Q=>Q+1),ft(_[g],o,A),Qe(_)},co=t=>{if(g===null||!N)return;const s=G[g],o=Ue[g];if(!s||!o?.isMultivariate)return;const u=st(s,o);if(!u)return;const S=xa(u,t),_=[...G];_[g]=yt(s,o,S);const y=t+1;Oe(y),F([]),$(A=>A+1),ft(_[g],o,y),Qe(_)},uo=(t,s)=>{if(g===null||!N||t===s)return;const o=G[g],u=Ue[g];if(!o||!u?.isMultivariate)return;const S=st(o,u);if(!S)return;const _=va(S,t,s),y=[...G];y[g]=yt(o,u,_);let A=Ve;Ve===t?A=s:t<Ve&&s>=Ve?A=Ve-1:t>Ve&&s<=Ve&&(A=Ve+1),Oe(A),ft(y[g],u,A),Qe(y)},cn=t=>{const s=t??g;if(s===null||!N)return;const o=G[s],u=Ue[s];if(!o||!u)return;const S=pa(o,u);if(!S){Y.error(i("sectionsEditor.sectionsEditor.sectionCannotHaveVariants"));return}const _=[...G];_[s]=S.section;const y=Wt(_,c)[s];if(!y?.isMultivariate){Y.error(i("sectionsEditor.sectionsEditor.couldNotAddVariant"));return}L(s),Oe(S.newVariantIndex),F([]),$(A=>A+1),ft(S.section,y,S.newVariantIndex,s),Qe(_)},mo=()=>{if(g===null||!N)return;const t=G[g],s=Ue[g];if(!t||!s?.isMultivariate)return;const o=st(t,s);if(!o)return;const u=ba(t,s,o);if(!u){Y.error(i("sectionsEditor.sectionsEditor.couldNotRemoveVariants"));return}const S=[...G];S[g]=u;const _=Wt(S,c)[g];if(!_)return;Oe(0),qe(null),De(null),F([]),$(A=>A+1);const y=xt(u,_,c);y?(C(y.data),P(y.resolveType)):(C(null),P(null)),Rt(null,g,0),Qe(S)},fo=async t=>{if(me===null||!N)return;const s=pn(t,c);if(s){Y.error(s);return}const o=G[me],u=Ue[me];if(!o||!u)return;const S=xt(o,u,c);if(!S){Y.error(i("sectionsEditor.sectionsEditor.sectionCannotBeSavedAsGlobal"));return}const _={...S.data,name:t};try{await Pe.mutateAsync({blockKey:t,data:_});const y=[...G];y[me]={__resolveType:t},await Pe.mutateAsync({blockKey:N,data:Mt(c,N,y,$e,Ge)}),g===me&&wt(),Ie(null),Y.success(i("sectionsEditor.sectionsEditor.savedGlobalBlock",{blockId:t})),f?.()}catch(y){Y.error(y instanceof Error?y.message:i("sectionsEditor.sectionsEditor.failedToSaveGlobalBlock"))}},kn=mt?.rule;if(Ot&&g===null&&de===null&&kn){const{resolveType:t,formValue:s}=Ct(kn,c??{},r??void 0);re(t),W(s)}const zt=r?la(r):[],Tn=r&&c?ca(r,c):[],po=!Ce&&!!(K&&r&&c),go=de&&r?qt(de,r):null,kt=()=>{ot.current&&(clearTimeout(ot.current),ot.current=null),at.current&&(clearTimeout(at.current),at.current=null)},Pt=async(t,s)=>{if(!(ka(s,t,r)>0))try{await en.mutateAsync({blockKey:t})}catch(o){Y.error(o instanceof Error?o.message:i("sectionsEditor.sectionsEditor.couldNotDeleteMatcherBlock"))}},Nn=t=>{ot.current&&clearTimeout(ot.current),ot.current=setTimeout(()=>{const{activePageKey:s,decofile:o,variantIndex:u}=tt.current;if(!s)return;const S={...o[s]},_={...S.sections},y=[..._.variants??[]],A=y[u],Q=A?.rule;if(Tt(Q,o,r)){const M=Q?.__resolveType??"",H=o[M],U=typeof H?.name=="string"?H.name:M,{__resolveType:we,...q}=t;Pe.mutate({blockKey:M,data:Nt(we??"",q,U)},{onSuccess:()=>f?.(),onError:J=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:J.message}))});return}A&&(y[u]={...A,rule:t}),S.sections={..._,variants:y},Pe.mutate({blockKey:s,data:S},{onSuccess:()=>f?.(),onError:M=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},gn)},ho=t=>{re(t);const s=t?In(t,r):{__resolveType:On};W(t?s:{}),Nn(s)},vo=t=>{const s=t;W(s);const o=de?{__resolveType:de,...s}:{...s};Nn(o)},bo=async t=>{kt();const{activePageKey:s,decofile:o,variantIndex:u}=tt.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 A=[...y.variants],Q=A[u];if(!Q)return;const M=At(Q.rule,o,r),H=Yt(t);A[u]={...Q,rule:H};const U={...o,[s]:{...S,sections:{...y,variants:A}}},{resolveType:we,formValue:q}=Ct(H,U,r??void 0);re(we),W(q);try{await Pe.mutateAsync({blockKey:s,data:U[s]}),M&&M!==t&&await Pt(M,U),f?.()}catch(J){Y.error(J instanceof Error?J.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}},Vn=t=>{at.current&&clearTimeout(at.current);const{selectedSectionIndex:s,sectionVariantIndex:o}=tt.current;s!==null&&(at.current=setTimeout(()=>{const{rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:A,variantIndex:Q}=tt.current;if(!y)return;const M=u[s],H=S[s];if(!M||!H?.isMultivariate)return;const U=st(M,H);if(!U)return;const q=(U.variants??[])[o]?.rule;if(Tt(q,_,r)){const Se=q?.__resolveType??"",Xe=_[Se],it=typeof Xe?.name=="string"?Xe.name:Se,{__resolveType:ht,...lt}=t;Pe.mutate({blockKey:Se,data:Nt(ht??"",lt,it)},{onSuccess:()=>f?.(),onError:vt=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:vt.message}))});return}const J=Fn(U,o,t),Le=[...u];Le[s]=yt(M,H,J);const nt=Mt(_,y,Le,Q,A);Pe.mutate({blockKey:y,data:nt},{onSuccess:()=>f?.(),onError:Se=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:Se.message}))})},gn))},So=t=>{qe(t);const s=t?In(t,r):{__resolveType:On};De(t?s:{}),Vn(s)},xo=t=>{const s=t;De(s);const o=et?{__resolveType:et,...s}:{...s};Vn(o)},yo=async t=>{kt();const{selectedSectionIndex:s,sectionVariantIndex:o,rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:A,variantIndex:Q}=tt.current;if(s===null||!y)return;const M=u[s],H=S[s];if(!M||!H?.isMultivariate)return;const U=st(M,H);if(!U)return;const we=U.variants??[],q=At(we[o]?.rule,_,r),J=Yt(t),Le=Fn(U,o,J),nt=[...u];nt[s]=yt(M,H,Le);const Se=Mt(_,y,nt,Q,A),Xe={..._,[y]:Se},{resolveType:it,formValue:ht}=Ct(J,Xe,r??void 0);qe(it),De(ht);try{await Pe.mutateAsync({blockKey:y,data:Se}),q&&q!==t&&await Pt(q,Xe),f?.()}catch(lt){Y.error(lt instanceof Error?lt.message:i("sectionsEditor.sectionsEditor.couldNotApplySavedRule"))}};if(!Ce&&!Je)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.noPageFound",{currentPath:h})});if(Ce&&!nn)return n.jsx("div",{className:"h-full w-full flex items-center justify-center text-sm text-muted-foreground",children:i("sectionsEditor.sectionsEditor.globalBlockNotFound")});const pt=g!==null?Ue[g]??null:null,Dn=g!==null?G[g]:null,Pn=Dn&&pt?.isMultivariate?st(Dn,pt):null,St=Pn?Kn(Pn,ct):[],un=Math.min(Ve,Math.max(St.length-1,0)),Ht=St[un]??null,gt=pt?.isMultivariate===!0,Cn=g!==null&&pt!==null,Ut=Cn&&(gt||!!(rn&&ke)),_o=Ut&&!Ce&&pt?.isSavedBlock===!0,rt=Ce||_o,jo=Ce?yn:pt?.label??"",Eo=et&&r?qt(et,r):null,dn=Ut&&(!Ce||se.length>0)?Ce?[yn,...se]:[Je.name,pt.label,...gt&&Ht?[Ht.label]:[],...se]:[],Ro=z&&Je?[Je.name,"SEO",...Ne]:[],Gt=z?Ro:rt?dn.length>0?dn:[jo]:dn,wo=!z&&!Ce&&gt&&se.length===0,An=()=>{if(!N)return;kt(),He.current&&(clearTimeout(He.current),He.current=null);const t=c[N],s=ga(t.sections,G);if(!s)return;const o=ha(s);Pe.mutate({blockKey:N,data:{...t,sections:s}},{onSuccess:()=>{O(o),L(null),C(null),P(null),F([]),W(null),re(null)},onError:u=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:u.message}))})},mn=(t,s,o)=>{if(!N)return;kt(),He.current&&(clearTimeout(He.current),He.current=null);const u=c[N],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 A=Na(_,y),Q={...c,[N]:{...u,sections:A}};Pe.mutate({blockKey:N,data:Q[N]},{onSuccess:()=>{s?.(),o&&Pt(o,Q)},onError:M=>Y.error(i("sectionsEditor.sectionsEditor.saveFailed",{error:M.message}))})},ko=t=>{ee(null),O(t),L(null),C(null),P(null),F([]);const s=Ge[t]?.rule,{resolveType:o,formValue:u}=Ct(s,c??{},r??void 0);re(o),W(u),En(Ge.map(S=>({rule:S.rule})),t)},To=(t,s)=>{if(t===s)return;let o=$e;$e===t?o=s:t<$e&&s>=$e?o=$e-1:t>$e&&s<=$e&&(o=$e+1),O(o);const u=Bt(Ge.map(S=>({rule:S.rule})),t,s);En(u,o),mn(S=>Bt(S,t,s))},No=t=>{const s=Ge[t]?.rule,o=At(s,c??{},r??void 0);mn(u=>u.length<=1?null:(u.splice(t,1),u),()=>{Ge.length-1===1?O(0):t<$e?O($e-1):t===$e&&O(Math.max(0,t-1)),L(null),C(null),P(null),F([]),W(null),re(null)},o)},Vo=t=>{mn(s=>Va(s,t),()=>{O(t+1),L(null),C(null),P(null),F([]),W(null),re(null)})},Do=async(t,s)=>{kt(),He.current&&(clearTimeout(He.current),He.current=null);const o=tt.current.activePageKey,u=tt.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 A=[...y.variants],Q=A[t];if(!Q?.rule||typeof Q.rule!="object"){Y.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const M=Q.rule,H=s.trim();Ft(!0);try{if(!H){if(!Tt(M,u,r)){ee(null);return}const nt=M.__resolveType??"";A[t]={...Q,rule:$n(M,u,r)};const Se={...u,[o]:{...S,sections:{...y,variants:A}}};await Pe.mutateAsync({blockKey:o,data:Se[o]}),await Pt(nt,Se),ee(null),f?.();return}const U=zn(M,u,r);if(!U){Y.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(U.blockKey){await Pe.mutateAsync({blockKey:U.blockKey,data:Nt(U.resolveType,U.data,H)}),ee(null),f?.();return}const we=fn(H),q=pn(we,u);if(q){Y.error(q);return}const J=Nt(U.resolveType,U.data,H);let Le=null;try{await Pe.mutateAsync({blockKey:we,data:J}),Le=we,A[t]={...Q,rule:Yt(we)},await Pe.mutateAsync({blockKey:o,data:{...S,sections:{...y,variants:A}}}),Le=null}catch(nt){throw Le&&await en.mutateAsync({blockKey:Le}).catch(()=>{}),nt}ee(null),Y.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:H})),f?.()}catch(U){Y.error(U instanceof Error?U.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Ft(!1)}},Po=async(t,s)=>{kt(),He.current&&(clearTimeout(He.current),He.current=null);const{selectedSectionIndex:o,rawSections:u,parsedSections:S,decofile:_,activePageKey:y,pageVariants:A,variantIndex:Q}=tt.current;if(o===null||!y)return;const M=u[o],H=S[o];if(!M||!H?.isMultivariate)return;const U=st(M,H);if(!U)return;const we=U.variants??[],q=we[t];if(!q?.rule||typeof q.rule!="object"){Y.error(i("sectionsEditor.sectionsEditor.variantHasNoMatcherRule"));return}const J=q.rule,Le=s.trim();Ft(!0);const nt=async Se=>{const Xe={...U,variants:Se},it=[...u];it[o]=yt(M,H,Xe);const ht=Mt(_,y,it,Q,A);return await Pe.mutateAsync({blockKey:y,data:ht}),{..._,[y]:ht}};try{if(!Le){if(!Tt(J,_,r)){ie(null);return}const vt=J.__resolveType??"",Ln=[...we];Ln[t]={...q,rule:$n(J,_,r)};const Lo=await nt(Ln);await Pt(vt,Lo),ie(null),f?.();return}const Se=zn(J,_,r);if(!Se){Y.error(i("sectionsEditor.sectionsEditor.couldNotReadVariantMatcherRule"));return}if(Se.blockKey){await Pe.mutateAsync({blockKey:Se.blockKey,data:Nt(Se.resolveType,Se.data,Le)}),ie(null),f?.();return}const Xe=fn(Le),it=pn(Xe,_);if(it){Y.error(it);return}const ht=Nt(Se.resolveType,Se.data,Le);let lt=null;try{await Pe.mutateAsync({blockKey:Xe,data:ht}),lt=Xe;const vt=[...we];vt[t]={...q,rule:Yt(Xe)},await nt(vt),lt=null}catch(vt){throw lt&&await en.mutateAsync({blockKey:lt}).catch(()=>{}),vt}ie(null),Y.success(i("sectionsEditor.sectionsEditor.savedMatcherAsGlobalBlock",{trimmed:Le})),f?.()}catch(Se){Y.error(Se instanceof Error?Se.message:i("sectionsEditor.sectionsEditor.failedToRenameVariant"))}finally{Ft(!1)}},Mn=()=>{wt()},Co=t=>{Z(t),ln({inner:t})},Ao=t=>{ve(t),ln({raw:t})},Mo=()=>{Z(null),k([])},Bo=()=>ae(t=>t+1),Bn=t=>{if(z){if(t===0){Zt.flush(),Ee(!1),Z(null),ve(void 0),k([]),ae(o=>o+1),V?.();return}if(t===1){k([]),ae(o=>o+1);return}k(Ne.slice(0,t-1)),ae(o=>o+1);return}if(Ce){F(se.slice(0,t)),$(o=>o+1);return}if(t===0){Mn();return}if(t===1){F([]),$(o=>o+1);return}if(gt&&t===2){F([]),$(o=>o+1);return}const s=gt?2:1;F(se.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:rt||Ut||z?n.jsxs("div",{className:ze("border-b px-3 py-2.5",rt&&"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:[Gt.length>1&&n.jsx("button",{type:"button",onClick:()=>Bn(Da(Gt.length,{isMultivariateSectionTop:wo})),title:i("sectionsEditor.sectionsEditor.back"),"aria-label":i("sectionsEditor.sectionsEditor.back"),className:ze("shrink-0 inline-flex size-6 items-center justify-center rounded-md transition-colors",rt?"text-foreground/80 hover:bg-global-section/15":"text-muted-foreground hover:bg-accent hover:text-accent-foreground"),children:n.jsx(xs,{className:"size-4"})}),!Ce&&Ot&&mt&&n.jsxs("button",{type:"button",onClick:Mn,title:i("sectionsEditor.sectionsEditor.editingInVariant",{variant:mt.label}),className:ze("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",Lr),children:[n.jsx(Ps,{rule:Lt(mt.rule,c??{},r??void 0),matchers:zt}),n.jsx("span",{className:"max-w-[160px] truncate",children:mt.label})]}),n.jsx("nav",{"aria-label":i("sectionsEditor.sectionsEditor.editingBreadcrumb"),className:"flex min-w-0 flex-1 items-center gap-1 overflow-hidden text-sm",children:Gt.map((t,s)=>{const o=s===Gt.length-1,u=bs(t);return n.jsxs("span",{className:"flex min-w-0 items-center gap-1 overflow-hidden",children:[s>0&&n.jsx(ys,{className:"size-3 shrink-0 text-muted-foreground/60"}),n.jsx("button",{type:"button",onClick:()=>Bn(s),title:u,className:ze("min-w-0 truncate rounded-md px-1 py-0.5 text-left transition-colors",o?rt?"font-semibold text-global-section-fg dark:text-global-section-fg-dark":"font-medium text-foreground":rt?"text-foreground/80":"text-muted-foreground",rt?"hover:bg-global-section/15":"hover:bg-accent hover:text-accent-foreground"),children:u})]},`${u}-${s}`)})}),rt&&n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx("span",{className:"shrink-0 cursor-help",children:n.jsx(Ka,{className:"size-4 text-global-section-fg dark:text-global-section-fg-dark"})})}),n.jsx(Et,{side:"bottom",className:"max-w-[260px]",children:i("sectionsEditor.sectionsEditor.globalSectionTooltip")})]}),Cn&&!gt&&!pt?.isHidden&&N&&n.jsx(Qn,{onClick:()=>cn()})]}),rt&&n.jsx("p",{className:"mt-1.5 py-1.5 pl-1 text-sm leading-snug text-foreground",children:i("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(Fr,{pageKey:N,initialName:Je.name,initialPath:Je.path,onFieldChange:Xs})}),n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.editSeo"),className:"size-7 shrink-0",onClick:()=>Ee(!0),children:n.jsx(Ma,{size:14})})}),n.jsx(Et,{side:"bottom",children:i("sectionsEditor.sectionsEditor.editSeo")})]}),n.jsxs(_t,{children:[n.jsx(jt,{asChild:!0,children:n.jsx(Ze,{type:"button",variant:"ghost",size:"icon","aria-label":i("sectionsEditor.sectionsEditor.viewJson"),className:"size-7 shrink-0",onClick:()=>D&&N?D(N):je(!0),children:n.jsx(Ba,{size:14})})}),n.jsx(Et,{side:"bottom",children:i("sectionsEditor.sectionsEditor.viewJson")})]}),n.jsx(Qn,{onClick:An})]})}),z?n.jsx(Qt,{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:It&&N?n.jsx(nr,{rawSeo:on,innerSeo:_n,defaultResolveType:Gs,seoSchema:qs,activeResolveType:an,seoTypeOptions:Us,formResetKey:be,siteDefaultSeo:Ws,onBreadcrumbChange:k,onPersistRaw:Ao,onInnerChange:Co,onClearForm:Mo,onBumpFormKey:Bo}):n.jsx("div",{className:"px-3 py-6 text-center text-xs text-muted-foreground",children:i("sectionsEditor.sectionsEditor.seoSchemaNotFound")})})})},"editor-seo"):Ut?n.jsxs(Qt,{viewportRef:Ye,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[gt&&St.length>0&&se.length===0&&n.jsxs(n.Fragment,{children:[n.jsx(ua,{listKey:`${N??""}:${g??""}`,variants:St.map((t,s)=>({index:s,label:t.label})),selectedIndex:un,onSelect:io,onRename:ie,onDuplicate:co,onDelete:lo,onRemoveAll:mo,onReorder:uo,onAdd:()=>cn()}),gt&&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:i("sectionsEditor.sectionsEditor.variantRule")}),n.jsx(Xn,{currentRt:et??"",currentLabel:Jt(Ht?.rule,c??{},ct,r??void 0),currentGlobalKey:At(Ht?.rule,c??{},r??void 0)??void 0,matchers:zt,globals:Tn,onSelect:So,onSelectGlobal:yo,schema:Eo,formValue:dt,onChange:xo,formKey:`${g??"none"}:${un}:${et??""}`,formWrapperClassName:"pt-1",meta:r??void 0,decofile:c,onSaveReferencedBlock:Kt,sandbox:$t})]})]}),n.jsx(Yn,{activeSchema:rn,formValue:ke,formResetKey:Be,onFormChange:Rn,onBreadcrumbChange:F,breadcrumbPath:se,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForVariant"),meta:r,decofile:c,onSaveReferencedBlock:Kt,sandbox:$t,previewBaseUrl:K,onRequestAddSection:wn})]},"editor-section-form"):Ce?n.jsx(Qt,{viewportRef:Ye,className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:n.jsx(Yn,{activeSchema:rn,formValue:ke,formResetKey:Be,onFormChange:Rn,onBreadcrumbChange:F,breadcrumbPath:se,emptyMessage:i("sectionsEditor.sectionsEditor.noEditableFieldsForGlobalBlock"),meta:r,decofile:c,onSaveReferencedBlock:Kt,sandbox:$t,previewBaseUrl:K,onRequestAddSection:wn})},"editor-global-block"):n.jsxs(Qt,{className:"flex-1 min-h-0 [&_[data-slot=scroll-area-viewport]>div]:!block",children:[Ot&&N&&n.jsx(Ar,{listKey:N,variants:Ge,activeIndex:$e,decofile:c??{},meta:r,matchers:zt,onSelect:ko,onReorder:To,onRename:ee,onDuplicate:Vo,onDelete:No,onAdd:An}),Ot&&de!==null&&n.jsxs("div",{className:ze("px-3 border-b",le?"pt-3 pb-5 space-y-3":"py-2"),children:[n.jsxs("button",{type:"button",onClick:()=>fe(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":le,children:[n.jsx("span",{className:"text-xs font-medium text-muted-foreground",children:i("sectionsEditor.sectionsEditor.variantRule")}),le?n.jsx(La,{className:"size-3.5 shrink-0 text-muted-foreground"}):n.jsx(Pa,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),le&&n.jsx("div",{className:ze("space-y-3",Vt&&"pointer-events-none opacity-50"),children:n.jsx(Xn,{currentRt:de,currentLabel:Jt(mt?.rule,c??{},ct,r??void 0),currentGlobalKey:At(mt?.rule,c??{},r??void 0)??void 0,matchers:zt,globals:Tn,onSelect:ho,onSelectGlobal:bo,schema:go,formValue:Te,onChange:vo,formKey:`${$e}:${de??""}`,formWrapperClassName:"space-y-3",meta:r??void 0,decofile:c,onSaveReferencedBlock:Kt,sandbox:$t})})]}),n.jsx("div",{className:"p-2 pt-3",children:n.jsx(Rr,{listKey:`${N??""}-${$e}`,rawSections:G,sections:Ue,meta:r,selectedIndex:g,onSelect:Qs,onReorder:Zs,onDelete:eo,onDuplicate:to,onMakeReusable:Ie,onToggleHidden:no,onToggleLazy:so,onAddVariant:cn,onDetach:oo,onAddSection:()=>ge(!0),canAddSection:po})})]},"editor-section-list"),n.jsx(da,{open:me!==null,onOpenChange:t=>{t||Ie(null)},defaultBlockId:me!==null?fn(Ue[me]?.label??""):"",isPending:Pe.isPending,onSubmit:fo}),K&&n.jsx(rr,{open:pe,onOpenChange:t=>{ge(t),t||(ce.current=null)},meta:r,decofile:c,previewBaseUrl:K,onSelect:ro}),_e&&N&&c&&n.jsx(ma,{open:_e,onOpenChange:je,pageKey:N,decofile:c}),Me!==null&&n.jsx(qn,{open:!0,initialName:Tt(Ge[Me]?.rule,c??{},r??void 0)?Jt(Ge[Me]?.rule,c??{},ct,r??void 0):"",autoLabel:ct(Lt(Ge[Me]?.rule,c??{},r??void 0)),isPending:Vt,onSubmit:async t=>{await Do(Me,t)},onOpenChange:t=>{!t&&!Vt&&ee(null)}}),ye!==null&&n.jsx(qn,{open:!0,initialName:Tt(St[ye]?.rule,c??{},r??void 0)?Jt(St[ye]?.rule,c??{},ct,r??void 0):"",autoLabel:ct(Lt(St[ye]?.rule,c??{},r??void 0)),isPending:Vt,onSubmit:async t=>{await Po(ye,t)},onOpenChange:t=>{!t&&!Vt&&ie(null)}})]})}export{kc as SectionsEditor};
@@ -1 +1 @@
1
- import{r as i,bi as nt,bg as Pe,j as d,dK as rt,bk as Ie,bh as k,dL as st,bd as j,bj as N,cs as $,dM as lt,aC as _e,dN as Ee,be as at,cj as ct,dO as it,cu as dt,dP as ut,dQ as pt,dR as ft,dS as mt,dT as ht,bf as gt,dU as vt,dV as xt,dW as St,c as ee,n as oe}from"./index-eMuSvnay.js";import{i as wt}from"./Check-DPWJue1l.js";import{t as Re}from"./ChevronDown-Bchtg7Ey.js";import{n as Ct}from"./ChevronUp-CJaWrIn8.js";function Ne(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],Q="Select",[de,ue,It]=at(Q),[ne]=gt(Q,[It,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,Nt]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:v,disabled:I,required:w,form:S}=r,p=pe(e),[g,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:Q}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=i.useRef(null),B=g?S||!!g.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:g,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:Ie(),value:F,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:I,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{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(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:v,value:F,onChange:E=>q(E.target.value),disabled:I,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;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"),[v,I,w]=tt(p=>{const g=u().filter(x=>!x.disabled),C=g.find(x=>x.value===s.value),m=ot(g,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:N(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&I(p.key),!(g&&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,v=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:v,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 J="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(J,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=J;var A=10,[Ve,Y]=ne(J),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:v,collisionBoundary:I,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g,...C}=r,m=G(J,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 ut(x)},[x]),pt();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),b=document.activeElement;for(const P of f)if(P===b||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==b))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(b=>!b.disabled),R=T.find(b=>b.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:v,collisionBoundary:I,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};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(ft,{as:jt,allowPinchZoom:!0,children:d.jsx(mt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(ht,{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:N(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(b=>!b.disabled).map(b=>b.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const b=f.target,P=y.indexOf(b);y=y.slice(P+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(J,t),s=Y(J,t),[l,a]=i.useState(null),[u,h]=i.useState(null),v=k(e,_=>h(_)),I=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&g&&C){const _=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const b=q.left-O.left,P=F.left-b,X=_.left-P,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const b=O.right-q.right,P=window.innerWidth-F.right-b,X=window.innerWidth-_.right-P,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=I(),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(g.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=g.offsetHeight/2,f=g.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const b=L.length>0&&g===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(b?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const b=L.length>0&&g===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(b?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)}},[I,c.trigger,c.valueNode,l,u,p,g,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:v,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(xt,{...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(J,{}),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:N(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:I}=s;if(I?.current&&v){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),C=Math.max(p,g);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;v.style.height=x+"px",v.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,v.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=Ie();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,v]=i.useState(c??""),[I,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=Ie(),g=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=>{v(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":I?"":void 0,"aria-selected":u&&I,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>w(!0)),onBlur:N(s.onBlur,()=>w(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{g.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{g.current=m.pointerType,n?a.onItemLeave?.():g.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(bt.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=Nt(le,t),[h,v]=i.useState(null),I=k(e,C=>v(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:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:I}),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(Qe,{...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(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=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:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(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 be="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(be,t),s=Y(be,t);return c.open&&s.position==="popper"?d.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=be;var Ft="SelectBubbleInput",Je=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 v=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(v)}},[s,e]),d.jsx(j.select,{...t,style:{...it,...t.style},ref:c,defaultValue:e})});Je.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=dt(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,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;function io(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 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(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(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 fo(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 v;e[9]!==a?(v=!a&&d.jsx(no,{}),e[9]=a,e[10]=v):v=e[10];const I=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==I?(w=oe("p-1",I),e[11]=I,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 g;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==v||e[22]!==S||e[23]!==p?(g=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",translate:"no",className:h,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(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(Jt,{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(Qt,{"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{io as S,po as a,uo as b,fo as c,mo as d,Ne as e};
1
+ import{r as i,bi as nt,bg as Pe,j as d,dK as rt,bk as Ie,bh as k,dL as st,bd as j,bj as N,cs as $,dM as lt,aC as _e,dN as Ee,be as at,cj as ct,dO as it,cu as dt,dP as ut,dQ as pt,dR as ft,dS as mt,dT as ht,bf as gt,dU as vt,dV as xt,dW as St,c as ee,n as oe}from"./index-KDqP1Gsm.js";import{i as wt}from"./Check-DOZ1j5aP.js";import{t as Re}from"./ChevronDown-CfTwRjpu.js";import{n as Ct}from"./ChevronUp-DY84NWjt.js";function Ne(r,[e,t]){return Math.min(t,Math.max(e,r))}var yt=[" ","Enter","ArrowUp","ArrowDown"],bt=[" ","Enter"],Q="Select",[de,ue,It]=at(Q),[ne]=gt(Q,[It,Ee]),pe=Ee(),[Tt,G]=ne(Q),[Pt,Nt]=ne(Q),je=r=>{const{__scopeSelect:e,children:t,open:o,defaultOpen:n,onOpenChange:c,value:s,defaultValue:l,onValueChange:a,dir:u,name:h,autoComplete:v,disabled:I,required:w,form:S}=r,p=pe(e),[g,C]=i.useState(null),[m,x]=i.useState(null),[U,M]=i.useState(!1),re=nt(u),[_,O]=Pe({prop:o,defaultProp:n??!1,onChange:c,caller:Q}),[F,q]=Pe({prop:s,defaultProp:l,onChange:a,caller:Q}),L=i.useRef(null),B=g?S||!!g.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:g,onTriggerChange:C,valueNode:m,onValueNodeChange:x,valueNodeHasChildren:U,onValueNodeHasChildrenChange:M,contentId:Ie(),value:F,onValueChange:q,open:_,onOpenChange:O,dir:re,triggerPointerDownPosRef:L,disabled:I,children:[d.jsx(de.Provider,{scope:e,children:d.jsx(Pt,{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(Je,{"aria-hidden":!0,required:w,tabIndex:-1,name:h,autoComplete:v,value:F,onChange:E=>q(E.target.value),disabled:I,form:S,children:[F===void 0?d.jsx("option",{value:""}):null,Array.from(W)]},H):null]})})};je.displayName=Q;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"),[v,I,w]=tt(p=>{const g=u().filter(x=>!x.disabled),C=g.find(x=>x.value===s.value),m=ot(g,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:N(n.onClick,p=>{p.currentTarget.focus(),h.current!=="mouse"&&S(p)}),onPointerDown:N(n.onPointerDown,p=>{h.current=p.pointerType;const g=p.target;g.hasPointerCapture(p.pointerId)&&g.releasePointerCapture(p.pointerId),p.button===0&&p.ctrlKey===!1&&p.pointerType==="mouse"&&(S(p),p.preventDefault())}),onKeyDown:N(n.onKeyDown,p=>{const g=v.current!=="";!(p.ctrlKey||p.altKey||p.metaKey)&&p.key.length===1&&I(p.key),!(g&&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,v=k(e,a.onValueNodeChange);return $(()=>{u(h)},[u,h]),d.jsx(j.span,{...l,ref:v,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 J="SelectContent",Be=i.forwardRef((r,e)=>{const t=G(J,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=J;var A=10,[Ve,Y]=ne(J),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:v,collisionBoundary:I,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g,...C}=r,m=G(J,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 ut(x)},[x]),pt();const E=i.useCallback(f=>{const[T,...R]=B().map(P=>P.ref.current),[y]=R.slice(-1),b=document.activeElement;for(const P of f)if(P===b||(P?.scrollIntoView({block:"nearest"}),P===T&&M&&(M.scrollTop=0),P===y&&M&&(M.scrollTop=M.scrollHeight),P?.focus(),document.activeElement!==b))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(b=>!b.disabled),R=T.find(b=>b.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:v,collisionBoundary:I,collisionPadding:w,sticky:S,hideWhenDetached:p,avoidCollisions:g}:{};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(ft,{as:jt,allowPinchZoom:!0,children:d.jsx(mt,{asChild:!0,trapped:m.open,onMountAutoFocus:f=>{f.preventDefault()},onUnmountAutoFocus:N(n,f=>{m.trigger?.focus({preventScroll:!0}),f.preventDefault()}),children:d.jsx(ht,{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:N(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(b=>!b.disabled).map(b=>b.ref.current);if(["ArrowUp","End"].includes(f.key)&&(y=y.slice().reverse()),["ArrowUp","ArrowDown"].includes(f.key)){const b=f.target,P=y.indexOf(b);y=y.slice(P+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(J,t),s=Y(J,t),[l,a]=i.useState(null),[u,h]=i.useState(null),v=k(e,_=>h(_)),I=ue(t),w=i.useRef(!1),S=i.useRef(!0),{viewport:p,selectedItem:g,selectedItemText:C,focusSelectedItem:m}=s,x=i.useCallback(()=>{if(c.trigger&&c.valueNode&&l&&u&&p&&g&&C){const _=c.trigger.getBoundingClientRect(),O=u.getBoundingClientRect(),F=c.valueNode.getBoundingClientRect(),q=C.getBoundingClientRect();if(c.dir!=="rtl"){const b=q.left-O.left,P=F.left-b,X=_.left-P,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.left=xe+"px"}else{const b=O.right-q.right,P=window.innerWidth-F.right-b,X=window.innerWidth-_.right-P,Z=_.width+X,ge=Math.max(Z,O.width),ve=window.innerWidth-A,xe=Ne(P,[A,Math.max(A,ve-ge)]);l.style.minWidth=Z+"px",l.style.right=xe+"px"}const L=I(),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(g.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=g.offsetHeight/2,f=g.offsetTop+se,T=H+E+f,R=K-T;if(T<=te){const b=L.length>0&&g===L[L.length-1].ref.current;l.style.bottom="0px";const P=u.clientHeight-p.offsetTop-p.offsetHeight,X=Math.max(ce,se+(b?he:0)+P+D),Z=T+X;l.style.height=Z+"px"}else{const b=L.length>0&&g===L[0].ref.current;l.style.top="0px";const X=Math.max(te,H+p.offsetTop+(b?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)}},[I,c.trigger,c.valueNode,l,u,p,g,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:v,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(xt,{...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(J,{}),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:N(n.onScroll,u=>{const h=u.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:I}=s;if(I?.current&&v){const w=Math.abs(a.current-h.scrollTop);if(w>0){const S=window.innerHeight-A*2,p=parseFloat(v.style.minHeight),g=parseFloat(v.style.height),C=Math.max(p,g);if(C<S){const m=C+w,x=Math.min(S,m),U=m-x;v.style.height=x+"px",v.style.bottom==="0px"&&(h.scrollTop=U>0?U:0,v.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=Ie();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,v]=i.useState(c??""),[I,w]=i.useState(!1),S=k(e,m=>a.itemRefCallback?.(m,o,n)),p=Ie(),g=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=>{v(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":I?"":void 0,"aria-selected":u&&I,"data-state":u?"checked":"unchecked","aria-disabled":n||void 0,"data-disabled":n?"":void 0,tabIndex:n?void 0:-1,...s,ref:S,onFocus:N(s.onFocus,()=>w(!0)),onBlur:N(s.onBlur,()=>w(!1)),onClick:N(s.onClick,()=>{g.current!=="mouse"&&C()}),onPointerUp:N(s.onPointerUp,()=>{g.current==="mouse"&&C()}),onPointerDown:N(s.onPointerDown,m=>{g.current=m.pointerType}),onPointerMove:N(s.onPointerMove,m=>{g.current=m.pointerType,n?a.onItemLeave?.():g.current==="mouse"&&m.currentTarget.focus({preventScroll:!0})}),onPointerLeave:N(s.onPointerLeave,m=>{m.currentTarget===document.activeElement&&a.onItemLeave?.()}),onKeyDown:N(s.onKeyDown,m=>{a.searchRef?.current!==""&&m.key===" "||(bt.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=Nt(le,t),[h,v]=i.useState(null),I=k(e,C=>v(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:g}=u;return $(()=>(p(S),()=>g(S)),[p,g,S]),d.jsxs(d.Fragment,{children:[d.jsx(j.span,{id:a.textId,...c,ref:I}),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(Qe,{...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(Qe,{...r,ref:s,onAutoScroll:()=>{const{viewport:l,selectedItem:a}=t;l&&a&&(l.scrollTop=l.scrollTop+a.offsetHeight)}}):null});Ze.displayName=ye;var Qe=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:N(n.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(o,50))}),onPointerMove:N(n.onPointerMove,()=>{c.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(o,50))}),onPointerLeave:N(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 be="SelectArrow",Ut=i.forwardRef((r,e)=>{const{__scopeSelect:t,...o}=r,n=pe(t),c=G(be,t),s=Y(be,t);return c.open&&s.position==="popper"?d.jsx(St,{...n,...o,ref:e}):null});Ut.displayName=be;var Ft="SelectBubbleInput",Je=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 v=new Event("change",{bubbles:!0});h.call(l,e),l.dispatchEvent(v)}},[s,e]),d.jsx(j.select,{...t,style:{...it,...t.style},ref:c,defaultValue:e})});Je.displayName=Ft;function et(r){return r===""||r===void 0}function tt(r){const e=dt(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,Qt=$e,Jt=Ge,eo=qe,to=Xe,oo=Ze;function io(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 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(Gt,{"data-slot":"select-value",...t}),e[2]=t,e[3]=o):o=e[3],o}function po(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 fo(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 v;e[9]!==a?(v=!a&&d.jsx(no,{}),e[9]=a,e[10]=v):v=e[10];const I=l==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1";let w;e[11]!==I?(w=oe("p-1",I),e[11]=I,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 g;return e[18]!==l||e[19]!==n||e[20]!==h||e[21]!==v||e[22]!==S||e[23]!==p?(g=d.jsx(qt,{children:d.jsxs(Xt,{"data-slot":"select-content",translate:"no",className:h,position:l,...n,children:[v,S,p]})}),e[18]=l,e[19]=n,e[20]=h,e[21]=v,e[22]=S,e[23]=p,e[24]=g):g=e[24],g}function mo(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(Jt,{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(Qt,{"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{io as S,po as a,uo as b,fo as c,mo as d,Ne as e};