@templatical/editor 0.54.2 → 0.55.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 (168) hide show
  1. package/dist/{AiAltTextPopover-BBKVJ6HA.js → AiAltTextPopover-D5QosKvB.js} +1 -1
  2. package/dist/{AiAltTextReview-BuVbeQh-.js → AiAltTextReview-D1W_lrI_.js} +1 -1
  3. package/dist/{AiRewriteMenu-ZpYJfm-O.js → AiRewriteMenu-BwztoMov.js} +4 -4
  4. package/dist/{BlockPreviewCanvas-DtOo5y3U.js → BlockPreviewCanvas-C23A6FRm.js} +4 -4
  5. package/dist/{CloudPanels-DQRWMc59.js → CloudPanels-Baoaj6Xf.js} +1 -1
  6. package/dist/{CountdownToolbar-DTpMEDyh.js → CountdownToolbar-CA_gDIdZ.js} +4 -4
  7. package/dist/{IssuesPanel-BZn7-p9e.js → IssuesPanel-nmFhWG1p.js} +1 -1
  8. package/dist/{LanguageMenu-OOmQWVzO.js → LanguageMenu-DcABUYop.js} +3 -3
  9. package/dist/{LogicTagInsertButton-XESwnJia.js → LogicTagInsertButton-qZ82VMFx.js} +284 -279
  10. package/dist/{MergeTagInput-CAsBRoSm.js → MergeTagInput-JJeZbFkD.js} +1 -1
  11. package/dist/{MergeTagModeToggle-bOf27Hg1.js → MergeTagModeToggle-DDucd1eC.js} +1 -1
  12. package/dist/{MergeTagTextarea-DH_6JFui.js → MergeTagTextarea-dQ2LRrNB.js} +2 -2
  13. package/dist/{ParagraphEditor-XGUkV5Uw.js → ParagraphEditor-VXYwGoz_.js} +8 -8
  14. package/dist/{RestoreVersionDialog-C72kWccI.js → RestoreVersionDialog-BibNvAaJ.js} +1 -1
  15. package/dist/{RichTextEditorContent-BZN8KRvR.js → RichTextEditorContent-CU5EOlM_.js} +2 -2
  16. package/dist/{SaveBlockDialog-CKOnTMTU.js → SaveBlockDialog-S9aFi0cy.js} +4 -4
  17. package/dist/{SavedBlocksBrowserModal-BrlNxqDH.js → SavedBlocksBrowserModal-DIdn6B0J.js} +4 -4
  18. package/dist/{SavedBlocksPanels--lPR6gdh.js → SavedBlocksPanels-Cme2M6u8.js} +1 -1
  19. package/dist/{SavedBlocksPickBar-4ON4_KKl.js → SavedBlocksPickBar-BDmA7r3m.js} +1 -1
  20. package/dist/{TemplateSettings-BE0jZmRJ.js → TemplateSettings-C_LHLm5M.js} +4 -4
  21. package/dist/{TestEmailModal-BKmNGrZN.js → TestEmailModal-CLIRn7eL.js} +5 -5
  22. package/dist/{TestEmailPanel-DT1wllX3.js → TestEmailPanel-frdtjC8h.js} +1 -1
  23. package/dist/{TitleEditor-HjVZuUTB.js → TitleEditor-D5kC56Jl.js} +4 -4
  24. package/dist/{Toolbar-BppchV2k.js → Toolbar-D904Yw_R.js} +551 -503
  25. package/dist/{TplModal-BFWOoK8l.js → TplModal-BBdotDf1.js} +1 -1
  26. package/dist/{VersionHistoryPanels-D4yNVLvq.js → VersionHistoryPanels-DhagEgOk.js} +1 -1
  27. package/dist/{WrapperBlock-BUzQTZuu.js → WrapperBlock-BAT3T0Cz.js} +3 -3
  28. package/dist/{blockTypeIcons-D91v9k0x.js → blockTypeIcons-CoRQV_hP.js} +1 -1
  29. package/dist/bundle-stats.json +6 -6
  30. package/dist/{cdn/chunks/ca-DOuIxWRv.js → ca-DIkMxYCN.js} +10 -3
  31. package/dist/cdn/chunks/{AiAltTextPopover-CAI18sdv.js → AiAltTextPopover-CUGOPuRo.js} +2 -2
  32. package/dist/cdn/chunks/{AiAltTextPopover-CAI18sdv.js.map → AiAltTextPopover-CUGOPuRo.js.map} +1 -1
  33. package/dist/cdn/chunks/{AiAltTextReview-CWEyMOF-.js → AiAltTextReview-B9vm_L-8.js} +2 -2
  34. package/dist/cdn/chunks/{AiAltTextReview-CWEyMOF-.js.map → AiAltTextReview-B9vm_L-8.js.map} +1 -1
  35. package/dist/cdn/chunks/{AiRewriteMenu-BEepu1vo.js → AiRewriteMenu-BvV_7tNZ.js} +7 -7
  36. package/dist/cdn/chunks/{AiRewriteMenu-BEepu1vo.js.map → AiRewriteMenu-BvV_7tNZ.js.map} +1 -1
  37. package/dist/cdn/chunks/{BlockPreviewCanvas-B6ndvof2.js → BlockPreviewCanvas-Dr-xGq6v.js} +7 -7
  38. package/dist/cdn/chunks/{BlockPreviewCanvas-B6ndvof2.js.map → BlockPreviewCanvas-Dr-xGq6v.js.map} +1 -1
  39. package/dist/cdn/chunks/{CloudPanels-BGwDb0jB.js → CloudPanels-CQ0vNgsH.js} +2 -2
  40. package/dist/cdn/chunks/{CloudPanels-BGwDb0jB.js.map → CloudPanels-CQ0vNgsH.js.map} +1 -1
  41. package/dist/cdn/chunks/{CountdownToolbar-B-0FsTj-.js → CountdownToolbar-BxW-J7DX.js} +5 -5
  42. package/dist/cdn/chunks/{CountdownToolbar-B-0FsTj-.js.map → CountdownToolbar-BxW-J7DX.js.map} +1 -1
  43. package/dist/cdn/chunks/{IssuesPanel-LyjMBDok.js → IssuesPanel-BoHeIjvw.js} +3 -3
  44. package/dist/cdn/chunks/{IssuesPanel-LyjMBDok.js.map → IssuesPanel-BoHeIjvw.js.map} +1 -1
  45. package/dist/cdn/chunks/{LanguageMenu-CGwMCOQ5.js → LanguageMenu-BnYN5N1h.js} +7 -7
  46. package/dist/cdn/chunks/{LanguageMenu-CGwMCOQ5.js.map → LanguageMenu-BnYN5N1h.js.map} +1 -1
  47. package/dist/cdn/chunks/{LogicTagInsertButton-PDKuo2J3.js → LogicTagInsertButton-Bt2PXbQ0.js} +255 -250
  48. package/dist/cdn/chunks/LogicTagInsertButton-Bt2PXbQ0.js.map +1 -0
  49. package/dist/cdn/chunks/{MergeTagInput-DoQHBJk2.js → MergeTagInput-BELdMRni.js} +2 -2
  50. package/dist/cdn/chunks/{MergeTagInput-DoQHBJk2.js.map → MergeTagInput-BELdMRni.js.map} +1 -1
  51. package/dist/cdn/chunks/{MergeTagModeToggle-Ct5IG4VW.js → MergeTagModeToggle-DKfMDIEF.js} +2 -2
  52. package/dist/cdn/chunks/{MergeTagModeToggle-Ct5IG4VW.js.map → MergeTagModeToggle-DKfMDIEF.js.map} +1 -1
  53. package/dist/cdn/chunks/{MergeTagTextarea-BMsnjphR.js → MergeTagTextarea-w6xen3Xh.js} +5 -5
  54. package/dist/cdn/chunks/{MergeTagTextarea-BMsnjphR.js.map → MergeTagTextarea-w6xen3Xh.js.map} +1 -1
  55. package/dist/cdn/chunks/{ParagraphEditor-CVW-kuHW.js → ParagraphEditor-Cal9hY3U.js} +9 -9
  56. package/dist/cdn/chunks/{ParagraphEditor-CVW-kuHW.js.map → ParagraphEditor-Cal9hY3U.js.map} +1 -1
  57. package/dist/cdn/chunks/{RestoreVersionDialog-7MFZz-Sb.js → RestoreVersionDialog-f_ulmASY.js} +2 -2
  58. package/dist/cdn/chunks/{RestoreVersionDialog-7MFZz-Sb.js.map → RestoreVersionDialog-f_ulmASY.js.map} +1 -1
  59. package/dist/cdn/chunks/{RichTextEditorContent-CiL-SkZg.js → RichTextEditorContent-C_v0kS4A.js} +3 -3
  60. package/dist/cdn/chunks/{RichTextEditorContent-CiL-SkZg.js.map → RichTextEditorContent-C_v0kS4A.js.map} +1 -1
  61. package/dist/cdn/chunks/{SaveBlockDialog-CxdekCYy.js → SaveBlockDialog-C6N9RFls.js} +5 -5
  62. package/dist/cdn/chunks/{SaveBlockDialog-CxdekCYy.js.map → SaveBlockDialog-C6N9RFls.js.map} +1 -1
  63. package/dist/cdn/chunks/{SavedBlocksBrowserModal-D9CAa2U3.js → SavedBlocksBrowserModal-Bl2sl09D.js} +4 -4
  64. package/dist/cdn/chunks/{SavedBlocksBrowserModal-D9CAa2U3.js.map → SavedBlocksBrowserModal-Bl2sl09D.js.map} +1 -1
  65. package/dist/cdn/chunks/{SavedBlocksPanels-jfkYWtss.js → SavedBlocksPanels-DqVcmEUK.js} +2 -2
  66. package/dist/cdn/chunks/{SavedBlocksPanels-jfkYWtss.js.map → SavedBlocksPanels-DqVcmEUK.js.map} +1 -1
  67. package/dist/cdn/chunks/{SavedBlocksPickBar-yaCumC4j.js → SavedBlocksPickBar-DE-J1JVL.js} +2 -2
  68. package/dist/cdn/chunks/{SavedBlocksPickBar-yaCumC4j.js.map → SavedBlocksPickBar-DE-J1JVL.js.map} +1 -1
  69. package/dist/cdn/chunks/{TemplateSettings-SaV2UVh_.js → TemplateSettings-CpoKZ8oV.js} +5 -5
  70. package/dist/cdn/chunks/{TemplateSettings-SaV2UVh_.js.map → TemplateSettings-CpoKZ8oV.js.map} +1 -1
  71. package/dist/cdn/chunks/{TestEmailModal-ByfhP_sm.js → TestEmailModal-DI3z__Bd.js} +8 -8
  72. package/dist/cdn/chunks/{TestEmailModal-ByfhP_sm.js.map → TestEmailModal-DI3z__Bd.js.map} +1 -1
  73. package/dist/cdn/chunks/{TestEmailPanel-CfzpqpDs.js → TestEmailPanel-Cp5d2YGn.js} +2 -2
  74. package/dist/cdn/chunks/{TestEmailPanel-CfzpqpDs.js.map → TestEmailPanel-Cp5d2YGn.js.map} +1 -1
  75. package/dist/cdn/chunks/{TitleEditor-Ceb0YfWv.js → TitleEditor-C2syRLdZ.js} +4 -4
  76. package/dist/cdn/chunks/{TitleEditor-Ceb0YfWv.js.map → TitleEditor-C2syRLdZ.js.map} +1 -1
  77. package/dist/cdn/chunks/{Toolbar-Cv6Rv1S-.js → Toolbar-NEE8qxYh.js} +754 -706
  78. package/dist/cdn/chunks/Toolbar-NEE8qxYh.js.map +1 -0
  79. package/dist/cdn/chunks/{TplModal-DGpGdwgf.js → TplModal-B1MgvtX8.js} +2 -2
  80. package/dist/cdn/chunks/{TplModal-DGpGdwgf.js.map → TplModal-B1MgvtX8.js.map} +1 -1
  81. package/dist/cdn/chunks/{VersionHistoryPanels-BJnHCMAH.js → VersionHistoryPanels-Cefd8i_e.js} +2 -2
  82. package/dist/cdn/chunks/{VersionHistoryPanels-BJnHCMAH.js.map → VersionHistoryPanels-Cefd8i_e.js.map} +1 -1
  83. package/dist/cdn/chunks/{WrapperBlock-C_uE5rPJ.js → WrapperBlock-DFY-7YSs.js} +4 -4
  84. package/dist/cdn/chunks/{WrapperBlock-C_uE5rPJ.js.map → WrapperBlock-DFY-7YSs.js.map} +1 -1
  85. package/dist/{ca-DOuIxWRv.js → cdn/chunks/ca-DIkMxYCN.js} +12 -1
  86. package/dist/cdn/chunks/{ca-DOuIxWRv.js.map → ca-DIkMxYCN.js.map} +1 -1
  87. package/dist/cdn/chunks/{composables-BxikPuC1.js → composables-nyxwrM27.js} +610 -594
  88. package/dist/cdn/chunks/composables-nyxwrM27.js.map +1 -0
  89. package/dist/cdn/chunks/{createCloudRuntime-D2DUaudp.js → createCloudRuntime-DJkDGKQ_.js} +3 -3
  90. package/dist/cdn/chunks/{createCloudRuntime-D2DUaudp.js.map → createCloudRuntime-DJkDGKQ_.js.map} +1 -1
  91. package/dist/{de-DaOUfYBX.js → cdn/chunks/de-Cc6Ue0UD.js} +12 -1
  92. package/dist/cdn/chunks/de-Cc6Ue0UD.js.map +1 -0
  93. package/dist/cdn/chunks/{en-C0pHHMiR.js → en-BX4FujAQ.js} +11 -2
  94. package/dist/cdn/chunks/en-BX4FujAQ.js.map +1 -0
  95. package/dist/{es-CxyEKr6n.js → cdn/chunks/es-Do5b-MKU.js} +12 -1
  96. package/dist/cdn/chunks/es-Do5b-MKU.js.map +1 -0
  97. package/dist/cdn/chunks/{extensions-DuDWpKo7.js → extensions-BcwkOjVq.js} +76 -70
  98. package/dist/cdn/chunks/extensions-BcwkOjVq.js.map +1 -0
  99. package/dist/{fr-CYbamiI6.js → cdn/chunks/fr-S1n2Ebzp.js} +12 -1
  100. package/dist/cdn/chunks/fr-S1n2Ebzp.js.map +1 -0
  101. package/dist/cdn/chunks/{ja-DfaIAoGI.js → ja-DLwcq4bA.js} +11 -2
  102. package/dist/cdn/chunks/ja-DLwcq4bA.js.map +1 -0
  103. package/dist/{nl-DkrB-VKZ.js → cdn/chunks/nl-0JSWaZpT.js} +12 -1
  104. package/dist/cdn/chunks/nl-0JSWaZpT.js.map +1 -0
  105. package/dist/cdn/chunks/{normalizeMergeTagMarkup-Bn_hl4jd.js → normalizeMergeTagMarkup-BrGw5jxk.js} +99 -89
  106. package/dist/cdn/chunks/normalizeMergeTagMarkup-BrGw5jxk.js.map +1 -0
  107. package/dist/cdn/chunks/{preRenderCustomBlocks-C9oavydG.js → preRenderCustomBlocks-Cj0XYwuh.js} +4 -4
  108. package/dist/cdn/chunks/{preRenderCustomBlocks-C9oavydG.js.map → preRenderCustomBlocks-Cj0XYwuh.js.map} +1 -1
  109. package/dist/{pt-BR-CY5Ye7eP.js → cdn/chunks/pt-BR-D3VlIMDZ.js} +12 -1
  110. package/dist/cdn/chunks/pt-BR-D3VlIMDZ.js.map +1 -0
  111. package/dist/cdn/chunks/{sanitizeHtml-DfXoetOm.js → sanitizeHtml-GxJCxKcP.js} +3 -3
  112. package/dist/cdn/chunks/{sanitizeHtml-DfXoetOm.js.map → sanitizeHtml-GxJCxKcP.js.map} +1 -1
  113. package/dist/cdn/chunks/{socialIcons-DPwkrn5v.js → socialIcons-B5zrrV8-.js} +387 -386
  114. package/dist/cdn/chunks/{socialIcons-DPwkrn5v.js.map → socialIcons-B5zrrV8-.js.map} +1 -1
  115. package/dist/cdn/chunks/{src-712f3ofG.js → src-Diw9SLIe.js} +673 -554
  116. package/dist/cdn/chunks/src-Diw9SLIe.js.map +1 -0
  117. package/dist/cdn/chunks/{src-B2tQbzf6.js → src-UR3AQocX.js} +221 -215
  118. package/dist/cdn/chunks/src-UR3AQocX.js.map +1 -0
  119. package/dist/cdn/chunks/{src-ZFw5fg_z.js → src-v47QHNmB.js} +809 -659
  120. package/dist/cdn/chunks/src-v47QHNmB.js.map +1 -0
  121. package/dist/cdn/chunks/useLocalizedDisplay-DekV8qar.js +33 -0
  122. package/dist/cdn/chunks/{useLocalizedDisplay-DiNjT22M.js.map → useLocalizedDisplay-DekV8qar.js.map} +1 -1
  123. package/dist/cdn/chunks/{useLogicTag-SvMW4g00.js → useLogicTag-Cbp3I7UN.js} +2 -2
  124. package/dist/cdn/chunks/{useLogicTag-SvMW4g00.js.map → useLogicTag-Cbp3I7UN.js.map} +1 -1
  125. package/dist/cdn/chunks/{useMergeTag-JLz3Pqcw.js → useMergeTag-1lrpNyR5.js} +4 -4
  126. package/dist/cdn/chunks/{useMergeTag-JLz3Pqcw.js.map → useMergeTag-1lrpNyR5.js.map} +1 -1
  127. package/dist/cdn/chunks/{withCurrentFont-BcoPpkDS.js → withCurrentFont-DZfmiv8V.js} +2 -2
  128. package/dist/cdn/chunks/{withCurrentFont-BcoPpkDS.js.map → withCurrentFont-DZfmiv8V.js.map} +1 -1
  129. package/dist/cdn/editor.js +284 -284
  130. package/dist/cdn/editor.js.map +1 -1
  131. package/dist/{composables-BbPFRlBf.js → composables-DPgNn9GZ.js} +929 -913
  132. package/dist/{createCloudRuntime-Dlrg88gS.js → createCloudRuntime-Bw8TLmQ8.js} +2 -2
  133. package/dist/{cdn/chunks/de-DaOUfYBX.js → de-Cc6Ue0UD.js} +10 -3
  134. package/dist/{dist-C34cYI5S.js → dist-CBdk1Vcb.js} +963 -813
  135. package/dist/{en-C0pHHMiR.js → en-BX4FujAQ.js} +10 -1
  136. package/dist/{cdn/chunks/es-CxyEKr6n.js → es-Do5b-MKU.js} +10 -3
  137. package/dist/{extensions-xCiyqSg7.js → extensions-QFAARrjF.js} +338 -332
  138. package/dist/{cdn/chunks/fr-CYbamiI6.js → fr-S1n2Ebzp.js} +10 -3
  139. package/dist/index.d.ts +14 -1
  140. package/dist/{ja-DfaIAoGI.js → ja-DLwcq4bA.js} +10 -1
  141. package/dist/{cdn/chunks/nl-DkrB-VKZ.js → nl-0JSWaZpT.js} +10 -3
  142. package/dist/{normalizeMergeTagMarkup-C7FGNURu.js → normalizeMergeTagMarkup-BS0nRvhq.js} +89 -79
  143. package/dist/{preRenderCustomBlocks-DvbRa3L3.js → preRenderCustomBlocks-CiKvKd8V.js} +1 -1
  144. package/dist/{cdn/chunks/pt-BR-CY5Ye7eP.js → pt-BR-D3VlIMDZ.js} +10 -3
  145. package/dist/{sanitizeHtml-D_ab7dD6.js → sanitizeHtml-USjTyALR.js} +1 -1
  146. package/dist/{socialIcons-DhAolBjt.js → socialIcons-NvIg5ahU.js} +338 -337
  147. package/dist/templatical-editor.js +41 -41
  148. package/dist/{useLocalizedDisplay-C9MBFUr4.js → useLocalizedDisplay-LdjosX4w.js} +1 -1
  149. package/dist/{useLogicTag-BmuakZBd.js → useLogicTag-D8zgkXfb.js} +1 -1
  150. package/dist/{useMergeTag-DC4a8b_v.js → useMergeTag-k7Kr0nMd.js} +1 -1
  151. package/dist/{withCurrentFont-BSxJai99.js → withCurrentFont-Bzeg_gfH.js} +1 -1
  152. package/package.json +7 -7
  153. package/dist/cdn/chunks/LogicTagInsertButton-PDKuo2J3.js.map +0 -1
  154. package/dist/cdn/chunks/Toolbar-Cv6Rv1S-.js.map +0 -1
  155. package/dist/cdn/chunks/composables-BxikPuC1.js.map +0 -1
  156. package/dist/cdn/chunks/de-DaOUfYBX.js.map +0 -1
  157. package/dist/cdn/chunks/en-C0pHHMiR.js.map +0 -1
  158. package/dist/cdn/chunks/es-CxyEKr6n.js.map +0 -1
  159. package/dist/cdn/chunks/extensions-DuDWpKo7.js.map +0 -1
  160. package/dist/cdn/chunks/fr-CYbamiI6.js.map +0 -1
  161. package/dist/cdn/chunks/ja-DfaIAoGI.js.map +0 -1
  162. package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +0 -1
  163. package/dist/cdn/chunks/normalizeMergeTagMarkup-Bn_hl4jd.js.map +0 -1
  164. package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +0 -1
  165. package/dist/cdn/chunks/src-712f3ofG.js.map +0 -1
  166. package/dist/cdn/chunks/src-B2tQbzf6.js.map +0 -1
  167. package/dist/cdn/chunks/src-ZFw5fg_z.js.map +0 -1
  168. package/dist/cdn/chunks/useLocalizedDisplay-DiNjT22M.js +0 -33
@@ -63,7 +63,7 @@ var s = {
63
63
  "center",
64
64
  "bottom"
65
65
  ];
66
- function ee(e) {
66
+ function p(e) {
67
67
  return {
68
68
  url: e,
69
69
  size: "cover",
@@ -74,7 +74,7 @@ function ee(e) {
74
74
  repeat: !1
75
75
  };
76
76
  }
77
- function te(e) {
77
+ function ee(e) {
78
78
  let t = "";
79
79
  for (let n of e) {
80
80
  let e = n.charCodeAt(0);
@@ -82,36 +82,36 @@ function te(e) {
82
82
  }
83
83
  return t;
84
84
  }
85
- function ne(e) {
85
+ function te(e) {
86
86
  let t = typeof e?.url == "string" ? e.url.trim() : "";
87
87
  if (!e || !t) return null;
88
88
  let n = u.includes(e.size) ? e.size : "cover", r = e.position, i = r && d.includes(r.x) ? r.x : "center", a = r && f.includes(r.y) ? r.y : "center";
89
89
  return {
90
- url: te(t),
90
+ url: ee(t),
91
91
  size: n,
92
92
  position: `${i} ${a}`,
93
93
  repeat: e.repeat ? "repeat" : "no-repeat"
94
94
  };
95
95
  }
96
96
  // ../types/src/hero.ts
97
- var re = [
97
+ var ne = [
98
98
  "top",
99
99
  "middle",
100
100
  "bottom"
101
101
  ];
102
- function ie(e) {
102
+ function re(e) {
103
103
  let t = e.hero;
104
104
  if (!t || typeof t != "object") return null;
105
105
  if (e.columns !== "1") return {
106
106
  applied: !1,
107
107
  reason: "columns"
108
108
  };
109
- let n = ne(e.backgroundImage);
109
+ let n = te(e.backgroundImage);
110
110
  if (n === null) return {
111
111
  applied: !1,
112
112
  reason: "image"
113
113
  };
114
- let r = oe(e.backgroundImage), i = ae(t.height) ? Math.round(t.height) : "image";
114
+ let r = ae(e.backgroundImage), i = ie(t.height) ? Math.round(t.height) : "image";
115
115
  return i === "image" && r === null ? {
116
116
  applied: !1,
117
117
  reason: "size"
@@ -119,19 +119,19 @@ function ie(e) {
119
119
  applied: !0,
120
120
  image: n,
121
121
  height: i,
122
- verticalAlign: re.includes(t.verticalAlign) ? t.verticalAlign : "middle",
122
+ verticalAlign: ne.includes(t.verticalAlign) ? t.verticalAlign : "middle",
123
123
  aspectRatio: r
124
124
  };
125
125
  }
126
- function ae(e) {
126
+ function ie(e) {
127
127
  return typeof e == "number" && Number.isFinite(e) && e >= 1;
128
128
  }
129
- function oe(e) {
129
+ function ae(e) {
130
130
  let t = e?.naturalWidth, n = e?.naturalHeight;
131
131
  return typeof t != "number" || typeof n != "number" || !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 || n <= 0 ? null : n / t;
132
132
  }
133
133
  // ../types/src/social.ts
134
- var se = {
134
+ var oe = {
135
135
  facebook: {
136
136
  color: "#1877F2",
137
137
  path: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"
@@ -148,6 +148,10 @@ var se = {
148
148
  color: "#0A66C2",
149
149
  path: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"
150
150
  },
151
+ xing: {
152
+ color: "#006567",
153
+ path: "M18.188 0c-.517 0-.741.325-.927.66c0 0-7.455 13.224-7.702 13.657c.015.024 4.919 9.023 4.919 9.023c.17.308.436.66.967.66h3.454c.211 0 .375-.078.463-.22c.089-.151.089-.346-.009-.536l-4.879-8.916a.02.02 0 0 1 0-.022L22.139.756c.095-.191.097-.387.006-.535C22.056.078 21.894 0 21.686 0zM3.648 4.74c-.211 0-.385.074-.473.216c-.09.149-.078.339.02.531l2.34 4.05q.006.014 0 .021L1.86 16.051a.52.52 0 0 0 0 .529c.085.142.239.234.45.234h3.461c.518 0 .766-.348.945-.667l3.734-6.609l-2.378-4.155c-.172-.315-.434-.659-.962-.659H3.648z"
154
+ },
151
155
  youtube: {
152
156
  color: "#FF0000",
153
157
  path: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"
@@ -200,36 +204,36 @@ var se = {
200
204
  color: "#1769FF",
201
205
  path: "M22 7h-7V5h7v2zm1.726 10c-.442 1.297-2.029 3-5.101 3-3.074 0-5.564-1.729-5.564-5.675 0-3.91 2.325-5.92 5.466-5.92 3.082 0 4.964 1.782 5.375 4.426.078.506.109 1.188.095 2.14H15.97c.13 3.211 3.483 3.312 4.588 2.029h3.168zm-7.686-4h4.965c-.105-1.547-1.136-2.219-2.477-2.219-1.466 0-2.277.768-2.488 2.219zm-9.574 6.988H0V5.021h6.953c5.476.081 5.58 5.444 2.72 6.906 3.461 1.26 3.577 8.061-3.207 8.061zM3 11h3.584c2.508 0 2.906-3-.312-3H3v3zm3.391 3H3v3.016h3.341c3.055 0 2.868-3.016.05-3.016z"
202
206
  }
203
- }, ce = {
207
+ }, se = {
204
208
  dark: "#1f1f1f",
205
209
  light: "#ffffff"
206
210
  };
207
- function le(e) {
211
+ function ce(e) {
208
212
  return e === "dark" || e === "light" ? e : void 0;
209
213
  }
210
- function ue(e, t) {
211
- let n = le(t);
214
+ function le(e, t) {
215
+ let n = ce(t);
212
216
  return {
213
- fill: n ? ce[n] : se[e].color,
214
- onFill: n === "light" ? ce.dark : "#ffffff"
217
+ fill: n ? se[n] : oe[e].color,
218
+ onFill: n === "light" ? se.dark : "#ffffff"
215
219
  };
216
220
  }
217
- function de(e, t) {
218
- let n = le(t);
221
+ function ue(e, t) {
222
+ let n = ce(t);
219
223
  return n ? `${e}-${n}` : e;
220
224
  }
221
- function fe(e, t) {
222
- if (le(t) === "dark" && (e === "plain" || e === "outlined")) return {
223
- color: ce.light,
225
+ function de(e, t) {
226
+ if (ce(t) === "dark" && (e === "plain" || e === "outlined")) return {
227
+ color: se.light,
224
228
  opacity: .6,
225
229
  width: 1.4
226
230
  };
227
231
  }
228
- function pe(e) {
232
+ function fe(e) {
229
233
  return e === "plain" ? .84 : .6;
230
234
  }
231
235
  // ../types/src/element-ids.ts
232
- function me(e) {
236
+ function pe(e) {
233
237
  let t = [], n = (e, n) => {
234
238
  typeof e == "string" && /[./]/.test(e) && t.push({
235
239
  path: n,
@@ -248,7 +252,7 @@ function me(e) {
248
252
  return r(e.blocks, "blocks"), t;
249
253
  }
250
254
  // ../types/src/clone.ts
251
- function p(e) {
255
+ function m(e) {
252
256
  let t = [];
253
257
  return JSON.parse(JSON.stringify(e, function(e, n) {
254
258
  if (typeof n != "object" || !n) return n;
@@ -257,22 +261,22 @@ function p(e) {
257
261
  }));
258
262
  }
259
263
  // ../types/src/deep-equal.ts
260
- function he(e) {
264
+ function me(e) {
261
265
  return typeof e == "object" && !!e && !Array.isArray(e);
262
266
  }
263
- function m(e, t) {
267
+ function h(e, t) {
264
268
  if (e === t) return !0;
265
- if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => m(e, t[n]));
266
- if (he(e)) {
267
- if (!he(t)) return !1;
269
+ if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => h(e, t[n]));
270
+ if (me(e)) {
271
+ if (!me(t)) return !1;
268
272
  let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
269
- for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !m(e[r], t[r])) return !1;
273
+ for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !h(e[r], t[r])) return !1;
270
274
  return !0;
271
275
  }
272
276
  return !1;
273
277
  }
274
278
  // ../types/src/config.ts
275
- var ge = class extends Error {
279
+ var he = class extends Error {
276
280
  statusCode;
277
281
  code;
278
282
  constructor(e, t, n, r) {
@@ -287,7 +291,7 @@ var ge = class extends Error {
287
291
  get isServerError() {
288
292
  return this.statusCode !== void 0 && this.statusCode >= 500;
289
293
  }
290
- }, _e = {
294
+ }, ge = {
291
295
  title: ["content"],
292
296
  paragraph: ["content"],
293
297
  html: ["content"],
@@ -304,58 +308,58 @@ var ge = class extends Error {
304
308
  "expiredMessage"
305
309
  ],
306
310
  custom: ["fieldValues.*"]
307
- }, h = ["preheaderText"];
308
- function ve(e) {
311
+ }, g = ["preheaderText"];
312
+ function _e(e) {
309
313
  return typeof e == "string" && /^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/.test(e);
310
314
  }
311
- function g(e) {
315
+ function _(e) {
312
316
  return typeof e == "object" && !!e && !Array.isArray(e);
313
317
  }
314
- var ye = /* @__PURE__ */ new Set([
318
+ var ve = /* @__PURE__ */ new Set([
315
319
  "__proto__",
316
320
  "constructor",
317
321
  "prototype"
318
322
  ]);
319
- function _(e) {
320
- return e.split(".").every((e) => e !== "" && !ye.has(e));
323
+ function v(e) {
324
+ return e.split(".").every((e) => e !== "" && !ve.has(e));
321
325
  }
322
- function be(e, t) {
323
- if (!ye.has(t)) return Array.isArray(e) ? e.find((e) => g(e) && e.id === t) : g(e) && Object.hasOwn(e, t) ? e[t] : void 0;
326
+ function ye(e, t) {
327
+ if (!ve.has(t)) return Array.isArray(e) ? e.find((e) => _(e) && e.id === t) : _(e) && Object.hasOwn(e, t) ? e[t] : void 0;
324
328
  }
325
- function v(e, t) {
326
- return t.split(".").reduce(be, e);
329
+ function y(e, t) {
330
+ return t.split(".").reduce(ye, e);
327
331
  }
328
- function xe(e) {
329
- let t = p(e);
332
+ function be(e) {
333
+ let t = m(e);
330
334
  for (let [n, r] of Object.entries(t.l10n ?? {})) {
331
335
  for (let t of ["text", "set"]) {
332
336
  for (let n of Object.keys(r[t] ?? {})) {
333
- let i = n.includes(".") ? v(e, n.slice(0, n.lastIndexOf("."))) : e;
334
- _(n) && (t !== "text" && g(i) || v(e, n) !== void 0) || delete r[t][n];
337
+ let i = n.includes(".") ? y(e, n.slice(0, n.lastIndexOf("."))) : e;
338
+ v(n) && (t !== "text" && _(i) || y(e, n) !== void 0) || delete r[t][n];
335
339
  }
336
340
  r[t] && !Object.keys(r[t]).length && delete r[t];
337
341
  }
338
342
  Object.keys(r).length || delete t.l10n[n];
339
343
  }
340
- return t.l10n && !Object.keys(t.l10n).length && delete t.l10n, m(t, e) ? e : t;
344
+ return t.l10n && !Object.keys(t.l10n).length && delete t.l10n, h(t, e) ? e : t;
341
345
  }
342
- function y(e) {
343
- let t = xe(e);
346
+ function b(e) {
347
+ let t = be(e);
344
348
  if (t.type === "wrapper") {
345
- let e = t.children.map(y);
349
+ let e = t.children.map(b);
346
350
  return e.some((e, n) => e !== t.children[n]) ? {
347
351
  ...t,
348
352
  children: e
349
353
  } : t;
350
354
  }
351
355
  if (t.type !== "section") return t;
352
- let n = t.children.map((e) => e.map(y));
356
+ let n = t.children.map((e) => e.map(b));
353
357
  return n.some((e, n) => e.some((e, r) => e !== t.children[n][r])) ? {
354
358
  ...t,
355
359
  children: n
356
360
  } : t;
357
361
  }
358
- function Se(e, t, n) {
362
+ function xe(e, t, n) {
359
363
  if (e.type === "custom") return !1;
360
364
  if (e.type === "section") return t === "columns";
361
365
  let r = e.type === "menu" ? "items" : e.type === "social" ? "icons" : e.type === "table" ? "rows" : null;
@@ -368,44 +372,44 @@ function Se(e, t, n) {
368
372
  let o = a.split(".").length;
369
373
  if (i[o] === "id") return !0;
370
374
  if (i.length !== o) return !1;
371
- let s = v(e, a);
372
- if (!g(s) || !g(n) || s.id !== n.id) return !0;
375
+ let s = y(e, a);
376
+ if (!_(s) || !_(n) || s.id !== n.id) return !0;
373
377
  if (e.type === "table" && o === 2) {
374
- let e = (e) => Array.isArray(e) ? e.map((e) => g(e) ? e.id : void 0) : null;
375
- return !m(e(s.cells), e(n.cells));
378
+ let e = (e) => Array.isArray(e) ? e.map((e) => _(e) ? e.id : void 0) : null;
379
+ return !h(e(s.cells), e(n.cells));
376
380
  }
377
381
  return !1;
378
382
  }
379
- function Ce(e) {
380
- return xe(e);
383
+ function Se(e) {
384
+ return be(e);
381
385
  }
382
- function b(e, t, n) {
383
- if (!_(t)) return !1;
384
- let r = t.split("."), i = r.pop(), a = r.reduce(be, e);
386
+ function x(e, t, n) {
387
+ if (!v(t)) return !1;
388
+ let r = t.split("."), i = r.pop(), a = r.reduce(ye, e);
385
389
  if (Array.isArray(a)) {
386
- let e = a.findIndex((e) => g(e) && e.id === i);
387
- return e < 0 ? !1 : (a[e] = p(n), !0);
390
+ let e = a.findIndex((e) => _(e) && e.id === i);
391
+ return e < 0 ? !1 : (a[e] = m(n), !0);
388
392
  }
389
- return g(a) ? (n === null ? delete a[i] : a[i] = p(n), !0) : !1;
393
+ return _(a) ? (n === null ? delete a[i] : a[i] = m(n), !0) : !1;
390
394
  }
391
- function we(e, t) {
395
+ function Ce(e, t) {
392
396
  let [n, ...r] = t.split(".");
393
397
  if (n === void 0) return [""];
394
398
  let i = [];
395
399
  if (n === "*") {
396
400
  let t = Array.isArray(e) ? e : [];
397
- for (let e of t) if (g(e) && typeof e.id == "string") for (let t of r.length ? we(e, r.join(".")) : [""]) i.push(t ? `${e.id}.${t}` : e.id);
401
+ for (let e of t) if (_(e) && typeof e.id == "string") for (let t of r.length ? Ce(e, r.join(".")) : [""]) i.push(t ? `${e.id}.${t}` : e.id);
398
402
  return i;
399
403
  }
400
- let a = g(e) ? e[n] : void 0;
404
+ let a = _(e) ? e[n] : void 0;
401
405
  if (r.length === 0) return a === void 0 ? [] : [n];
402
- for (let e of we(a, r.join("."))) i.push(`${n}.${e}`);
406
+ for (let e of Ce(a, r.join("."))) i.push(`${n}.${e}`);
403
407
  return i;
404
408
  }
405
- function x(e, t = []) {
409
+ function S(e, t = []) {
406
410
  if (e.type === "custom") {
407
411
  let n = t.find((t) => t.type === e.customType), r = new Set((n?.fields ?? []).filter((e) => e.type === "text" || e.type === "textarea").map((e) => e.key)), i = e.fieldValues;
408
- return g(i) ? Object.keys(i).filter((e) => r.has(e)).map((e) => `fieldValues.${e}`) : [];
412
+ return _(i) ? Object.keys(i).filter((e) => r.has(e)).map((e) => `fieldValues.${e}`) : [];
409
413
  }
410
414
  let n = (e) => !e.id.includes("."), r = e.type === "menu" ? {
411
415
  ...e,
@@ -417,10 +421,10 @@ function x(e, t = []) {
417
421
  cells: e.cells.filter(n)
418
422
  }))
419
423
  } : e;
420
- return (_e[e.type] ?? []).flatMap((e) => we(r, e));
424
+ return (ge[e.type] ?? []).flatMap((e) => Ce(r, e));
421
425
  }
422
- function S(e, t) {
423
- return (_e[e] ?? []).some((e) => {
426
+ function we(e, t) {
427
+ return (ge[e] ?? []).some((e) => {
424
428
  let n = e.split("."), r = t.split(".");
425
429
  return n.length === r.length && n.every((e, t) => e === "*" || e === r[t]);
426
430
  });
@@ -434,101 +438,101 @@ function Te(e) {
434
438
  let { l10n: t, ...n } = e;
435
439
  return n;
436
440
  }
437
- function w(e = {}) {
441
+ function Ee(e = {}) {
438
442
  return Object.entries(e).sort(([e], [t]) => e.split(".").length - t.split(".").length);
439
443
  }
440
- function Ee(e, t, n) {
441
- let r = e, i = p(Te(r));
444
+ function De(e, t, n) {
445
+ let r = e, i = m(Te(r));
442
446
  if (t === n) return i;
443
447
  let a = r.l10n?.[t];
444
448
  if (!a) return i;
445
- for (let [e, t] of w(a.set)) b(i, e, t);
446
- for (let [t, n] of Object.entries(a.text ?? {})) v(e, t) !== void 0 && b(i, t, n.value);
449
+ for (let [e, t] of Ee(a.set)) x(i, e, t);
450
+ for (let [t, n] of Object.entries(a.text ?? {})) y(e, t) !== void 0 && x(i, t, n.value);
447
451
  return e.type === "custom" && (Object.keys(a.text ?? {}).length > 0 || Object.keys(a.set ?? {}).length > 0) && delete i.renderedHtml, i;
448
452
  }
449
- function De(e, t) {
453
+ function Oe(e, t) {
450
454
  return e.l10n?.[t]?.hidden === !0;
451
455
  }
452
- function Oe(e) {
456
+ function ke(e) {
453
457
  let { locales: t, l10n: n, ...r } = e;
454
458
  return r;
455
459
  }
456
- function T(e) {
460
+ function w(e) {
457
461
  return e.settings?.locale ?? "en";
458
462
  }
459
- function ke(e, t, n) {
460
- let r = T(e);
463
+ function Ae(e, t, n) {
464
+ let r = w(e);
461
465
  if (t !== r && !(e.settings?.locales ?? []).includes(t)) {
462
466
  if (n?.missing === "default") t = r;
463
- else throw new ge(`This template has no "${t}" version.`, void 0, "unknown_locale");
467
+ else throw new he(`This template has no "${t}" version.`, void 0, "unknown_locale");
464
468
  }
465
469
  let i = (e) => e.flatMap((e) => {
466
- if (t !== r && De(e, t)) return [];
467
- let n = Ee(e, t, r);
470
+ if (t !== r && Oe(e, t)) return [];
471
+ let n = De(e, t, r);
468
472
  return n.type === "section" && Array.isArray(n.children) ? n.children = n.children.map((e) => i(e)) : n.type === "wrapper" && Array.isArray(n.children) && (n.children = i(n.children)), [n];
469
- }), a = p(Oe(e.settings)), o = e.settings?.l10n?.[t];
473
+ }), a = m(ke(e.settings)), o = e.settings?.l10n?.[t];
470
474
  if (t !== r && o) {
471
- for (let [e, t] of w(o.set)) b(a, e, t);
472
- for (let [t, n] of Object.entries(o.text ?? {})) v(e.settings, t) !== void 0 && b(a, t, n.value);
475
+ for (let [e, t] of Ee(o.set)) x(a, e, t);
476
+ for (let [t, n] of Object.entries(o.text ?? {})) y(e.settings, t) !== void 0 && x(a, t, n.value);
473
477
  }
474
478
  return a.locale = t, {
475
479
  blocks: i(e.blocks),
476
480
  settings: a
477
481
  };
478
482
  }
479
- function Ae(e, t, n = []) {
483
+ function je(e, t, n = []) {
480
484
  let r = {
481
485
  translated: [],
482
486
  missing: [],
483
487
  stale: []
484
488
  }, i = (e, t, n, i) => {
485
489
  for (let a of n) {
486
- let n = v(t, a);
490
+ let n = y(t, a);
487
491
  if (typeof n != "string") continue;
488
492
  let o = i?.[a];
489
493
  (o || n !== "") && (o ? o.sourceHash === C(n) ? r.translated.push(`${e}/${a}`) : r.stale.push(`${e}/${a}`) : r.missing.push(`${e}/${a}`));
490
494
  }
491
495
  }, a = (e) => {
492
496
  for (let r of e) {
493
- if (De(r, t)) continue;
497
+ if (Oe(r, t)) continue;
494
498
  let e = r.l10n?.[t];
495
- i(r.id, r, x(r, n), e?.text);
499
+ i(r.id, r, S(r, n), e?.text);
496
500
  let o = r.children;
497
501
  if (r.type === "section" && Array.isArray(o)) for (let e of o) a(e);
498
502
  else r.type === "wrapper" && Array.isArray(o) && a(o);
499
503
  }
500
504
  };
501
- return a(e.blocks), i("settings", e.settings, [...h], e.settings?.l10n?.[t]?.text), r;
505
+ return a(e.blocks), i("settings", e.settings, [...g], e.settings?.l10n?.[t]?.text), r;
502
506
  }
503
- function je(e, t) {
504
- if (t === T(e) || !e.settings.locales?.includes(t)) return [];
507
+ function Me(e, t) {
508
+ if (t === w(e) || !e.settings.locales?.includes(t)) return [];
505
509
  let n = [], r = (e) => {
506
- for (let i of e) De(i, t) && n.push(i.id), i.type === "section" ? i.children.forEach(r) : i.type === "wrapper" && r(i.children);
510
+ for (let i of e) Oe(i, t) && n.push(i.id), i.type === "section" ? i.children.forEach(r) : i.type === "wrapper" && r(i.children);
507
511
  };
508
512
  return r(e.blocks), n;
509
513
  }
510
- function Me(e, t, n = []) {
511
- if (t === T(e) || !e.settings.locales?.includes(t)) return [];
514
+ function Ne(e, t, n = []) {
515
+ if (t === w(e) || !e.settings.locales?.includes(t)) return [];
512
516
  let r = [], i = (e, n, i) => {
513
- r.push(...Ne(n, t, i).map((t) => `${e}/${t}`));
517
+ r.push(...Pe(n, t, i).map((t) => `${e}/${t}`));
514
518
  }, a = (e) => {
515
- for (let t of e) i(t.id, t, x(t, n)), t.type === "section" ? t.children.forEach(a) : t.type === "wrapper" && a(t.children);
519
+ for (let t of e) i(t.id, t, S(t, n)), t.type === "section" ? t.children.forEach(a) : t.type === "wrapper" && a(t.children);
516
520
  };
517
- return a(e.blocks), i("settings", e.settings, h), r;
521
+ return a(e.blocks), i("settings", e.settings, g), r;
518
522
  }
519
- function Ne(e, t, n) {
523
+ function Pe(e, t, n) {
520
524
  let r = e.l10n?.[t];
521
525
  return n.filter((t) => {
522
- let n = v(e, t);
523
- return typeof n != "string" || n === "" || r?.text?.[t] ? !1 : !Object.keys(r?.set ?? {}).some((n) => (t === n || t.startsWith(`${n}.`)) && (!n.includes(".") || v(e, n.slice(0, n.lastIndexOf("."))) !== void 0));
526
+ let n = y(e, t);
527
+ return typeof n != "string" || n === "" || r?.text?.[t] ? !1 : !Object.keys(r?.set ?? {}).some((n) => (t === n || t.startsWith(`${n}.`)) && (!n.includes(".") || y(e, n.slice(0, n.lastIndexOf("."))) !== void 0));
524
528
  });
525
529
  }
526
- function Pe(e, t, n = {}) {
527
- let r = T(e), i = (e, n, i) => {
528
- let a = Ne(e, t, i), o = p(e.l10n ?? {}), s = o[t] ?? {}, c = p(e);
530
+ function Fe(e, t, n = {}) {
531
+ let r = w(e), i = (e, n, i) => {
532
+ let a = Pe(e, t, i), o = m(e.l10n ?? {}), s = o[t] ?? {}, c = m(e);
529
533
  delete c.l10n;
530
- for (let [e, t] of w(s.set)) b(c, e, t);
531
- for (let [t, n] of Object.entries(s.text ?? {})) v(e, t) !== void 0 && b(c, t, n.value);
534
+ for (let [e, t] of Ee(s.set)) x(c, e, t);
535
+ for (let [t, n] of Object.entries(s.text ?? {})) y(e, t) !== void 0 && x(c, t, n.value);
532
536
  delete o[t];
533
537
  let l = {}, u = /* @__PURE__ */ new Set([
534
538
  ...Object.keys(s.set ?? {}),
@@ -536,22 +540,22 @@ function Pe(e, t, n = {}) {
536
540
  ...a
537
541
  ]);
538
542
  for (let t of u) {
539
- let r = v(e, t), i = v(c, t);
540
- m(r, i) ? (s.text?.[t] || a.includes(t)) && n(t) && typeof r == "string" && r !== "" && ((l.text ??= {})[t] = {
543
+ let r = y(e, t), i = y(c, t);
544
+ h(r, i) ? (s.text?.[t] || a.includes(t)) && n(t) && typeof r == "string" && r !== "" && ((l.text ??= {})[t] = {
541
545
  value: r,
542
546
  sourceHash: C(r)
543
547
  }) : n(t) && typeof r == "string" && typeof i == "string" ? (l.text ??= {})[t] = {
544
548
  value: r,
545
549
  sourceHash: C(i)
546
- } : (l.set ??= {})[t] = r === void 0 ? null : p(r);
550
+ } : (l.set ??= {})[t] = r === void 0 ? null : m(r);
547
551
  }
548
552
  let d = (e, t) => {
549
553
  let n = /* @__PURE__ */ new Set();
550
554
  for (let t of Object.keys(e.set ?? {})) {
551
555
  let e = t.split(".");
552
556
  for (; e.length > 1;) {
553
- let t = v(c, e.slice(0, -1).join("."));
554
- if (g(t) || Array.isArray(t) && v(c, e.join(".")) !== void 0) break;
557
+ let t = y(c, e.slice(0, -1).join("."));
558
+ if (_(t) || Array.isArray(t) && y(c, e.join(".")) !== void 0) break;
555
559
  e.pop();
556
560
  }
557
561
  let r = e.join(".");
@@ -559,20 +563,20 @@ function Pe(e, t, n = {}) {
559
563
  }
560
564
  for (let r of n) {
561
565
  for (let t of ["text", "set"]) for (let n of Object.keys(e[t] ?? {})) (n === r || n.startsWith(`${r}.`)) && delete e[t][n];
562
- let n = v(t, r);
563
- (e.set ??= {})[r] = n === void 0 ? null : p(n);
566
+ let n = y(t, r);
567
+ (e.set ??= {})[r] = n === void 0 ? null : m(n);
564
568
  }
565
569
  e.text && !Object.keys(e.text).length && delete e.text;
566
570
  };
567
571
  for (let t of Object.values(o)) {
568
- let n = p(e);
569
- for (let [e, r] of w(t.set)) b(n, e, r);
570
- for (let [r, i] of Object.entries(t.text ?? {})) v(e, r) !== void 0 && b(n, r, i.value);
572
+ let n = m(e);
573
+ for (let [e, r] of Ee(t.set)) x(n, e, r);
574
+ for (let [r, i] of Object.entries(t.text ?? {})) y(e, r) !== void 0 && x(n, r, i.value);
571
575
  for (let [n, r] of Object.entries(t.text ?? {})) {
572
- let i = v(c, n);
576
+ let i = y(c, n);
573
577
  if (typeof i != "string") (t.set ??= {})[n] = r.value, delete t.text[n];
574
578
  else {
575
- let t = v(e, n);
579
+ let t = y(e, n);
576
580
  typeof t == "string" && r.sourceHash === C(t) && (r.sourceHash = C(i));
577
581
  }
578
582
  }
@@ -580,20 +584,20 @@ function Pe(e, t, n = {}) {
580
584
  }
581
585
  return Object.keys(l).length && (d(l, e), o[r] = l), Object.keys(o).length && (c.l10n = o), c;
582
586
  }, a = (e) => e.map((e) => {
583
- let t = e.type === "custom" ? [.../* @__PURE__ */ new Set([...Object.hasOwn(n, e.id) ? n[e.id] : [], ...Object.values(e.l10n ?? {}).flatMap((e) => Object.keys(e.text ?? {}))])] : x(e), r = i(e, (n) => e.type === "custom" ? t.includes(n) : S(e.type, n), t);
584
- return e.type === "custom" && r.type === "custom" && !m(e.fieldValues, r.fieldValues) && delete r.renderedHtml, r.type === "section" ? r.children = r.children.map(a) : r.type === "wrapper" && (r.children = a(r.children)), r;
585
- }), o = i(e.settings, (e) => h.includes(e), h);
587
+ let t = e.type === "custom" ? [.../* @__PURE__ */ new Set([...Object.hasOwn(n, e.id) ? n[e.id] : [], ...Object.values(e.l10n ?? {}).flatMap((e) => Object.keys(e.text ?? {}))])] : S(e), r = i(e, (n) => e.type === "custom" ? t.includes(n) : we(e.type, n), t);
588
+ return e.type === "custom" && r.type === "custom" && !h(e.fieldValues, r.fieldValues) && delete r.renderedHtml, r.type === "section" ? r.children = r.children.map(a) : r.type === "wrapper" && (r.children = a(r.children)), r;
589
+ }), o = i(e.settings, (e) => g.includes(e), g);
586
590
  return o.locale = t, o.locales = e.settings.locales.map((e) => e === t ? r : e), {
587
591
  blocks: a(e.blocks),
588
592
  settings: o
589
593
  };
590
594
  }
591
595
  // ../types/src/operations.ts
592
- function Fe(e, t, n = []) {
596
+ function Ie(e, t, n = []) {
593
597
  let r = Object.fromEntries(I(e.blocks).flatMap((e) => {
594
598
  if (e.type !== "custom") return [];
595
- let t = x(e, n).filter((t) => typeof v(e, t) == "string");
596
- return t.length && Ve.has(e.id) && O("invalid_operation", 0, He), t.length ? [[e.id, t]] : [];
599
+ let t = S(e, n).filter((t) => typeof y(e, t) == "string");
600
+ return t.length && He.has(e.id) && D("invalid_operation", 0, Ue), t.length ? [[e.id, t]] : [];
597
601
  }));
598
602
  return {
599
603
  op: "setDefaultLocale",
@@ -601,7 +605,7 @@ function Fe(e, t, n = []) {
601
605
  ...Object.keys(r).length ? { customTextFields: r } : {}
602
606
  };
603
607
  }
604
- var E = class extends Error {
608
+ var T = class extends Error {
605
609
  code;
606
610
  opIndex;
607
611
  blockId;
@@ -609,68 +613,68 @@ var E = class extends Error {
609
613
  super(n), this.name = "OperationError", this.code = e, this.opIndex = t, r !== void 0 && (this.blockId = r);
610
614
  }
611
615
  };
612
- function Ie(e) {
616
+ function Le(e) {
613
617
  return e === "1" ? 1 : e === "3" ? 3 : 2;
614
618
  }
615
- function Le(e, t, n = {}) {
616
- let r = p(e);
617
- return D(r, t, n), r;
619
+ function Re(e, t, n = {}) {
620
+ let r = m(e);
621
+ return E(r, t, n), r;
618
622
  }
619
- function D(e, t, n = {}) {
623
+ function E(e, t, n = {}) {
620
624
  let r = {
621
625
  locks: n.locks ?? [],
622
626
  session: n.session ?? null
623
627
  };
624
628
  t.forEach((t, n) => at(e, t, n, r));
625
629
  }
626
- var Re = /* @__PURE__ */ new Set([
630
+ var ze = /* @__PURE__ */ new Set([
627
631
  "id",
628
632
  "type",
629
633
  "children",
630
634
  "l10n"
631
- ]), ze = /* @__PURE__ */ new Set(["locales", "l10n"]), Be = /* @__PURE__ */ new Set([
635
+ ]), Be = /* @__PURE__ */ new Set(["locales", "l10n"]), Ve = /* @__PURE__ */ new Set([
632
636
  "locale",
633
637
  "locales",
634
638
  "l10n"
635
- ]), Ve = /* @__PURE__ */ new Set([
639
+ ]), He = /* @__PURE__ */ new Set([
636
640
  "__proto__",
637
641
  "constructor",
638
642
  "prototype"
639
- ]), He = "customTextFields must map existing custom block ids to lists of string fieldValues paths.";
640
- function O(e, t, n, r) {
641
- throw new E(e, t, n, r);
643
+ ]), Ue = "customTextFields must map existing custom block ids to lists of string fieldValues paths.";
644
+ function D(e, t, n, r) {
645
+ throw new T(e, t, n, r);
642
646
  }
643
- function k(e) {
647
+ function O(e) {
644
648
  return typeof e == "object" && !!e && !Array.isArray(e);
645
649
  }
646
- function A(e) {
650
+ function k(e) {
647
651
  return e.type === "section";
648
652
  }
649
- function j(e) {
653
+ function A(e) {
650
654
  return Array.isArray(e.blocks) ? e.blocks : [];
651
655
  }
652
- function Ue(e) {
656
+ function We(e) {
653
657
  let t = e.children;
654
658
  return Array.isArray(t) ? t.map((e) => Array.isArray(e) ? e : []) : [];
655
659
  }
656
- function M(e, t) {
657
- let n = j(e);
660
+ function j(e, t) {
661
+ let n = A(e);
658
662
  for (let e = 0; e < n.length; e++) {
659
663
  let r = n[e];
660
- if (!k(r)) continue;
664
+ if (!O(r)) continue;
661
665
  if (r.id === t) return {
662
666
  block: r,
663
667
  list: n,
664
668
  index: e,
665
669
  parent: null
666
670
  };
667
- if (!A(r) || typeof r.id != "string") continue;
671
+ if (!k(r) || typeof r.id != "string") continue;
668
672
  let i = r.children;
669
673
  if (Array.isArray(i)) for (let e = 0; e < i.length; e++) {
670
674
  let n = i[e];
671
675
  if (Array.isArray(n)) for (let i = 0; i < n.length; i++) {
672
676
  let a = n[i];
673
- if (k(a) && a.id === t) return {
677
+ if (O(a) && a.id === t) return {
674
678
  block: a,
675
679
  list: n,
676
680
  index: i,
@@ -684,82 +688,82 @@ function M(e, t) {
684
688
  }
685
689
  return null;
686
690
  }
687
- function N(e) {
691
+ function M(e) {
688
692
  let t = typeof e.id == "string" ? [e.id] : [];
689
- if (A(e)) for (let n of Ue(e)) t.push(...We(n));
693
+ if (k(e)) for (let n of We(e)) t.push(...Ge(n));
690
694
  return t;
691
695
  }
692
- function We(e) {
693
- return e.flatMap((e) => k(e) ? N(e) : []);
696
+ function Ge(e) {
697
+ return e.flatMap((e) => O(e) ? M(e) : []);
694
698
  }
695
- function P(e, t) {
696
- return typeof e.blockId != "string" || e.blockId === "" ? O("invalid_operation", t, "blockId must be a block id.") : e.blockId;
699
+ function N(e, t) {
700
+ return typeof e.blockId != "string" || e.blockId === "" ? D("invalid_operation", t, "blockId must be a block id.") : e.blockId;
697
701
  }
698
- function Ge(e, t) {
702
+ function Ke(e, t) {
699
703
  let n = e.parent;
700
- return n === null ? null : k(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
704
+ return n === null ? null : O(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
701
705
  sectionId: n.sectionId,
702
706
  column: n.column
703
- } : O("invalid_operation", t, "parent must be null or { \"sectionId\", \"column\" }.");
707
+ } : D("invalid_operation", t, "parent must be null or { \"sectionId\", \"column\" }.");
704
708
  }
705
- function Ke(e, t) {
709
+ function qe(e, t) {
706
710
  let n = e.after;
707
- return n === null ? null : typeof n == "string" && n !== "" ? n : O("invalid_operation", t, "after must be null or a block id.");
711
+ return n === null ? null : typeof n == "string" && n !== "" ? n : D("invalid_operation", t, "after must be null or a block id.");
708
712
  }
709
- function F(e, t) {
713
+ function P(e, t) {
710
714
  let n = e.expect;
711
- return n == null ? null : k(n) ? n : O("invalid_operation", t, "expect must be an object.");
715
+ return n == null ? null : O(n) ? n : D("invalid_operation", t, "expect must be an object.");
712
716
  }
713
- function qe(e, t, n) {
717
+ function Je(e, t, n) {
714
718
  let r = e.set ?? null, i = e.unset ?? [];
715
- (r === null || k(r)) && Array.isArray(i) && i.every((e) => typeof e == "string") || O("invalid_operation", t, "set must be an object and unset a list of keys.");
719
+ (r === null || O(r)) && Array.isArray(i) && i.every((e) => typeof e == "string") || D("invalid_operation", t, "set must be an object and unset a list of keys.");
716
720
  let a = r === null ? {} : r, o = Object.keys(a).filter((e) => a[e] !== void 0);
717
- o.length === 0 && i.length === 0 && O("invalid_operation", t, "Set or unset at least one key.");
718
- for (let e of [...o, ...i]) n.has(e) && O("invalid_operation", t, `"${e}" can't be set or unset.`);
721
+ o.length === 0 && i.length === 0 && D("invalid_operation", t, "Set or unset at least one key.");
722
+ for (let e of [...o, ...i]) n.has(e) && D("invalid_operation", t, `"${e}" can't be set or unset.`);
719
723
  let s = i.find((e) => o.includes(e));
720
- return s !== void 0 && O("invalid_operation", t, `"${s}" is both set and unset.`), {
724
+ return s !== void 0 && D("invalid_operation", t, `"${s}" is both set and unset.`), {
721
725
  set: Object.fromEntries(o.map((e) => [e, a[e]])),
722
726
  unset: i
723
727
  };
724
728
  }
725
- function Je(e, t, n) {
726
- if (k(e) && typeof e.id == "string" && e.id !== "" && typeof e.type == "string" || O("invalid_operation", t, "A block needs a non-empty string id and a string type."), !A(e)) return;
727
- n && O("invalid_operation", t, "Sections can only be placed at the top level.");
729
+ function Ye(e, t, n) {
730
+ if (O(e) && typeof e.id == "string" && e.id !== "" && typeof e.type == "string" || D("invalid_operation", t, "A block needs a non-empty string id and a string type."), !k(e)) return;
731
+ n && D("invalid_operation", t, "Sections can only be placed at the top level.");
728
732
  let r = e.children;
729
- Array.isArray(r) && r.every((e) => Array.isArray(e)) || O("invalid_operation", t, "A section needs children: a list of columns, each a list of blocks.");
730
- for (let e of r) for (let n of e) Je(n, t, !0);
733
+ Array.isArray(r) && r.every((e) => Array.isArray(e)) || D("invalid_operation", t, "A section needs children: a list of columns, each a list of blocks.");
734
+ for (let e of r) for (let n of e) Ye(n, t, !0);
731
735
  }
732
- function Ye(e, t) {
736
+ function F(e, t) {
733
737
  return e.session === null || t.sessionId !== e.session;
734
738
  }
735
739
  function Xe(e, t, n) {
736
- let r = e.locks.find((n) => t.includes(n.blockId) && Ye(e, n));
737
- r && O("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
740
+ let r = e.locks.find((n) => t.includes(n.blockId) && F(e, n));
741
+ r && D("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
738
742
  }
739
743
  function Ze(e, t, n, r) {
740
- e.locks.find((r) => Ye(e, r) && r.blockId === t && ((r.locale ?? null) === null || r.locale === n)) && O("lock_held", r, `Block "${t}" is being edited in another session.`, t);
744
+ e.locks.find((r) => F(e, r) && r.blockId === t && ((r.locale ?? null) === null || r.locale === n)) && D("lock_held", r, `Block "${t}" is being edited in another session.`, t);
741
745
  }
742
746
  function Qe(e, t, n, r) {
743
- for (let [i, a] of Object.entries(t)) a !== void 0 && (m(Object.hasOwn(e, i) && e[i] !== void 0 ? e[i] : null, a) || O("precondition_failed", n, r === void 0 ? `Setting "${i}" has changed since.` : `"${i}" of block "${r}" has changed since.`, r));
747
+ for (let [i, a] of Object.entries(t)) a !== void 0 && (h(Object.hasOwn(e, i) && e[i] !== void 0 ? e[i] : null, a) || D("precondition_failed", n, r === void 0 ? `Setting "${i}" has changed since.` : `"${i}" of block "${r}" has changed since.`, r));
744
748
  }
745
749
  function $e(e, t, n) {
746
750
  if (t === null) return Array.isArray(e.blocks) || (e.blocks = []), e.blocks;
747
- let r = M(e, t.sectionId);
748
- if (!r) return O("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
749
- if (!A(r.block)) return O("invalid_operation", n, `Block "${t.sectionId}" isn't a section.`);
751
+ let r = j(e, t.sectionId);
752
+ if (!r) return D("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
753
+ if (!k(r.block)) return D("invalid_operation", n, `Block "${t.sectionId}" isn't a section.`);
750
754
  let i = r.block.children;
751
- return !Array.isArray(i) || t.column < 0 || t.column >= i.length ? O("invalid_operation", n, `Section "${t.sectionId}" has no column ${t.column}.`) : (Array.isArray(i[t.column]) || (i[t.column] = []), i[t.column]);
755
+ return !Array.isArray(i) || t.column < 0 || t.column >= i.length ? D("invalid_operation", n, `Section "${t.sectionId}" has no column ${t.column}.`) : (Array.isArray(i[t.column]) || (i[t.column] = []), i[t.column]);
752
756
  }
753
757
  function et(e, t, n) {
754
758
  if (t === null) return 0;
755
- let r = e.findIndex((e) => k(e) && e.id === t);
756
- return r === -1 ? O("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
759
+ let r = e.findIndex((e) => O(e) && e.id === t);
760
+ return r === -1 ? D("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
757
761
  }
758
762
  function tt(e, t, n, r) {
759
- let i = Ie(t), a = Array.isArray(e.children) ? e.children : [];
763
+ let i = Le(t), a = Array.isArray(e.children) ? e.children : [];
760
764
  for (let e = i; e < a.length; e++) {
761
765
  let t = a[e];
762
- Array.isArray(t) && t.length > 0 && O("invalid_operation", n, `Column ${e} of section "${r}" still holds blocks, so the layout can't drop it.`);
766
+ Array.isArray(t) && t.length > 0 && D("invalid_operation", n, `Column ${e} of section "${r}" still holds blocks, so the layout can't drop it.`);
763
767
  }
764
768
  let o = a.slice(0, i);
765
769
  for (; o.length < i;) o.push([]);
@@ -767,15 +771,15 @@ function tt(e, t, n, r) {
767
771
  }
768
772
  function nt(e, t, n) {
769
773
  for (let [n, r] of Object.entries(t)) n === "__proto__" ? Object.defineProperty(e, n, {
770
- value: p(r),
774
+ value: m(r),
771
775
  writable: !0,
772
776
  enumerable: !0,
773
777
  configurable: !0
774
- }) : e[n] = p(r);
778
+ }) : e[n] = m(r);
775
779
  for (let t of n) delete e[t];
776
780
  }
777
781
  function rt(e) {
778
- return me(e).map((t) => {
782
+ return pe(e).map((t) => {
779
783
  let n = t.path.replace(/\.(items|icons|rows)\[.*$/, "").replace(/\[(\d+)\]/g, ".$1").split(".").reduce((e, t) => e[t], e);
780
784
  return {
781
785
  id: t.id,
@@ -785,11 +789,11 @@ function rt(e) {
785
789
  }
786
790
  function it(e, t, n) {
787
791
  let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ? rt(n).map(r) : []), a = rt(e).find((e) => !i.has(r(e)));
788
- a && O("invalid_operation", t, `Element id "${a.id}" must not contain "." or "/".`, a.blockId);
792
+ a && D("invalid_operation", t, `Element id "${a.id}" must not contain "." or "/".`, a.blockId);
789
793
  }
790
794
  function at(e, t, n, r) {
791
795
  let i = t;
792
- switch (k(i) && typeof i.op == "string" || O("invalid_operation", n, "Each operation must be an object with an \"op\"."), i.op) {
796
+ switch (O(i) && typeof i.op == "string" || D("invalid_operation", n, "Each operation must be an object with an \"op\"."), i.op) {
793
797
  case "addBlock": return ot(e, i, n);
794
798
  case "moveBlock": return st(e, i, n, r);
795
799
  case "deleteBlock": return ct(e, i, n, r);
@@ -801,41 +805,41 @@ function at(e, t, n, r) {
801
805
  case "removeLocale": return ht(e, i, n);
802
806
  case "updateBlockLocale": return Ct(e, i, n, r);
803
807
  case "updateSettingsLocale": return wt(e, i, n);
804
- default: O("invalid_operation", n, `Unknown operation "${i.op}".`);
808
+ default: D("invalid_operation", n, `Unknown operation "${i.op}".`);
805
809
  }
806
810
  }
807
811
  function ot(e, t, n) {
808
- let r = Ge(t, n), i = Ke(t, n), a = t.block;
809
- Je(a, n, r !== null), it({
812
+ let r = Ke(t, n), i = qe(t, n), a = t.block;
813
+ Ye(a, n, r !== null), it({
810
814
  blocks: [a],
811
815
  settings: e.settings
812
816
  }, n);
813
- let o = new Set(We(j(e))), s = /* @__PURE__ */ new Set();
814
- for (let e of N(a)) (o.has(e) || s.has(e)) && O("block_exists", n, `A block with id "${e}" already exists.`, e), s.add(e);
817
+ let o = new Set(Ge(A(e))), s = /* @__PURE__ */ new Set();
818
+ for (let e of M(a)) (o.has(e) || s.has(e)) && D("block_exists", n, `A block with id "${e}" already exists.`, e), s.add(e);
815
819
  let c = $e(e, r, n), l = et(c, i, n);
816
- St(e, a, r, n, !0), c.splice(l, 0, p(a));
820
+ St(e, a, r, n, !0), c.splice(l, 0, m(a));
817
821
  }
818
822
  function st(e, t, n, r) {
819
- let i = P(t, n), a = Ge(t, n), o = Ke(t, n), s = F(t, n), c = M(e, i);
820
- if (!c) return O("block_missing", n, `No block with id "${i}".`, i);
821
- if (Xe(r, N(c.block), n), s) {
822
- let e = c.index > 0 ? c.list[c.index - 1] : null, t = k(e) ? e.id ?? null : null;
823
- m(c.parent, s.parent ?? null) && m(t, s.after ?? null) || O("precondition_failed", n, `Block "${i}" has moved since.`, i);
823
+ let i = N(t, n), a = Ke(t, n), o = qe(t, n), s = P(t, n), c = j(e, i);
824
+ if (!c) return D("block_missing", n, `No block with id "${i}".`, i);
825
+ if (Xe(r, M(c.block), n), s) {
826
+ let e = c.index > 0 ? c.list[c.index - 1] : null, t = O(e) ? e.id ?? null : null;
827
+ h(c.parent, s.parent ?? null) && h(t, s.after ?? null) || D("precondition_failed", n, `Block "${i}" has moved since.`, i);
824
828
  }
825
- A(c.block) && a !== null && O("invalid_operation", n, "Sections can only be placed at the top level."), o === i && O("invalid_operation", n, "A block can't be placed after itself.");
829
+ k(c.block) && a !== null && D("invalid_operation", n, "Sections can only be placed at the top level."), o === i && D("invalid_operation", n, "A block can't be placed after itself.");
826
830
  let l = $e(e, a, n);
827
831
  et(l.filter((e) => e !== c.block), o, n), St(e, c.block, a, n, !1), c.list.splice(c.index, 1), l.splice(et(l, o, n), 0, c.block);
828
832
  }
829
833
  function ct(e, t, n, r) {
830
- let i = P(t, n), a = F(t, n), o = M(e, i);
831
- if (!o) return O("block_missing", n, `No block with id "${i}".`, i);
832
- Xe(r, N(o.block), n), a && !m(o.block, a.block ?? null) && O("precondition_failed", n, `Block "${i}" has changed since.`, i), o.list.splice(o.index, 1);
834
+ let i = N(t, n), a = P(t, n), o = j(e, i);
835
+ if (!o) return D("block_missing", n, `No block with id "${i}".`, i);
836
+ Xe(r, M(o.block), n), a && !h(o.block, a.block ?? null) && D("precondition_failed", n, `Block "${i}" has changed since.`, i), o.list.splice(o.index, 1);
833
837
  }
834
838
  function lt(e, t, n, r) {
835
- let i = P(t, n), { set: a, unset: o } = qe(t, n, Re), s = F(t, n), c = M(e, i);
836
- if (!c) return O("block_missing", n, `No block with id "${i}".`, i);
837
- let l = c.block, u = A(l);
838
- u && o.includes("columns") && O("invalid_operation", n, "A section's columns can't be unset; set another layout instead."), Xe(r, [i], n), s && Qe(l, s, n, i);
839
+ let i = N(t, n), { set: a, unset: o } = Je(t, n, ze), s = P(t, n), c = j(e, i);
840
+ if (!c) return D("block_missing", n, `No block with id "${i}".`, i);
841
+ let l = c.block, u = k(l);
842
+ u && o.includes("columns") && D("invalid_operation", n, "A section's columns can't be unset; set another layout instead."), Xe(r, [i], n), s && Qe(l, s, n, i);
839
843
  let d = { ...l };
840
844
  nt(d, a, o), it({
841
845
  blocks: [d],
@@ -844,53 +848,53 @@ function lt(e, t, n, r) {
844
848
  blocks: [l],
845
849
  settings: e.settings
846
850
  }), u && Object.hasOwn(a, "columns") && tt(l, a.columns, n, i), nt(l, a, o);
847
- let f = y(l);
848
- m(l.l10n, f.l10n) || (f.l10n ? l.l10n = f.l10n : delete l.l10n), u && f.type === "section" && !m(l.children, f.children) && (l.children = f.children);
851
+ let f = b(l);
852
+ h(l.l10n, f.l10n) || (f.l10n ? l.l10n = f.l10n : delete l.l10n), u && f.type === "section" && !h(l.children, f.children) && (l.children = f.children);
849
853
  }
850
854
  function ut(e, t, n) {
851
- let { set: r, unset: i } = qe(t, n, ze), a = F(t, n);
852
- e.settings?.locales?.length && (Object.hasOwn(r, "locale") || i.includes("locale")) && O("invalid_operation", n, "The default locale can't change while language versions exist."), k(e.settings) || (e.settings = {});
855
+ let { set: r, unset: i } = Je(t, n, Be), a = P(t, n);
856
+ e.settings?.locales?.length && (Object.hasOwn(r, "locale") || i.includes("locale")) && D("invalid_operation", n, "The default locale can't change while language versions exist."), O(e.settings) || (e.settings = {});
853
857
  let o = e.settings;
854
858
  a && Qe(o, a, n), nt(o, r, i);
855
- let s = Ce(e.settings);
856
- m(o.l10n, s.l10n) || (s.l10n ? o.l10n = s.l10n : delete o.l10n);
859
+ let s = Se(e.settings);
860
+ h(o.l10n, s.l10n) || (s.l10n ? o.l10n = s.l10n : delete o.l10n);
857
861
  }
858
862
  function dt(e, t) {
859
863
  let n = e.locale;
860
- return ve(n) && n !== "__proto__" && n !== "constructor" && n !== "prototype" || O("invalid_operation", t, "locale must be a language tag."), n;
864
+ return _e(n) && n !== "__proto__" && n !== "constructor" && n !== "prototype" || D("invalid_operation", t, "locale must be a language tag."), n;
861
865
  }
862
866
  function ft(e, t, n) {
863
867
  let r = dt(t, n);
864
- return e.settings.locales?.includes(r) || O("invalid_operation", n, `Locale "${r}" isn't in settings.locales.`), r;
868
+ return e.settings.locales?.includes(r) || D("invalid_operation", n, `Locale "${r}" isn't in settings.locales.`), r;
865
869
  }
866
870
  function pt(e, t, n) {
867
871
  let r = dt(t, n), i = e.settings.locales ?? [], a = r.toLowerCase(), o = t.position === void 0 ? i.length : t.position;
868
- (T(e).toLowerCase() === a || i.some((e) => e.toLowerCase() === a) || typeof o != "number" || !Number.isInteger(o) || o < 0 || o > i.length) && O("invalid_operation", n, "The locale already exists or its insertion position is invalid."), e.settings.locales || (e.settings.locales = []), e.settings.locales.splice(o, 0, r);
872
+ (w(e).toLowerCase() === a || i.some((e) => e.toLowerCase() === a) || typeof o != "number" || !Number.isInteger(o) || o < 0 || o > i.length) && D("invalid_operation", n, "The locale already exists or its insertion position is invalid."), e.settings.locales || (e.settings.locales = []), e.settings.locales.splice(o, 0, r);
869
873
  }
870
874
  function I(e) {
871
- return e.flatMap((e) => k(e) ? [e, ...A(e) ? Ue(e).flatMap(I) : e.type === "wrapper" && Array.isArray(e.children) ? I(e.children) : []] : []);
875
+ return e.flatMap((e) => O(e) ? [e, ...k(e) ? We(e).flatMap(I) : e.type === "wrapper" && Array.isArray(e.children) ? I(e.children) : []] : []);
872
876
  }
873
877
  function mt(e, t) {
874
878
  let n = e.l10n;
875
- return k(n) && k(n[t]) ? n[t] : {};
879
+ return O(n) && O(n[t]) ? n[t] : {};
876
880
  }
877
881
  function ht(e, t, n) {
878
- let r = ft(e, t, n), i = F(t, n);
879
- i && (!k(i.blocks) || i.settings !== void 0 && !k(i.settings)) && O("invalid_operation", n, "expect needs a blocks object and an optional settings layer.");
880
- let a = e.settings, o = I(j(e)), s = Object.fromEntries(o.flatMap((e) => k(e.l10n) && Object.hasOwn(e.l10n, r) ? [[String(e.id), e.l10n[r]]] : []));
881
- !i || m(s, i.blocks) && m(k(a.l10n) ? a.l10n[r] : void 0, i.settings) || O("precondition_failed", n, `Locale "${r}" has changed since.`);
882
- for (let e of [...o, a]) k(e.l10n) && (delete e.l10n[r], Object.keys(e.l10n).length === 0 && delete e.l10n);
882
+ let r = ft(e, t, n), i = P(t, n);
883
+ i && (!O(i.blocks) || i.settings !== void 0 && !O(i.settings)) && D("invalid_operation", n, "expect needs a blocks object and an optional settings layer.");
884
+ let a = e.settings, o = I(A(e)), s = Object.fromEntries(o.flatMap((e) => O(e.l10n) && Object.hasOwn(e.l10n, r) ? [[String(e.id), e.l10n[r]]] : []));
885
+ !i || h(s, i.blocks) && h(O(a.l10n) ? a.l10n[r] : void 0, i.settings) || D("precondition_failed", n, `Locale "${r}" has changed since.`);
886
+ for (let e of [...o, a]) O(e.l10n) && (delete e.l10n[r], Object.keys(e.l10n).length === 0 && delete e.l10n);
883
887
  e.settings.locales.splice(e.settings.locales.indexOf(r), 1), e.settings.locales.length === 0 && delete e.settings.locales;
884
888
  }
885
889
  function gt(e, t, n) {
886
- (e.text === void 0 || ((e) => k(e) && Object.values(e).every((e) => k(e) && typeof e.value == "string" && typeof e.sourceHash == "string"))(e.text)) && (e.set === void 0 || k(e.set) && !Object.values(e.set).some((e) => e === void 0)) && (e.unset === void 0 || Array.isArray(e.unset) && e.unset.every((e) => typeof e == "string" && e !== "" && _(e))) && (e.hidden === void 0 || !n && typeof e.hidden == "boolean") && [
890
+ (e.text === void 0 || ((e) => O(e) && Object.values(e).every((e) => O(e) && typeof e.value == "string" && typeof e.sourceHash == "string"))(e.text)) && (e.set === void 0 || O(e.set) && !Object.values(e.set).some((e) => e === void 0)) && (e.unset === void 0 || Array.isArray(e.unset) && e.unset.every((e) => typeof e == "string" && e !== "" && v(e))) && (e.hidden === void 0 || !n && typeof e.hidden == "boolean") && [
887
891
  "text",
888
892
  "set",
889
893
  "unset",
890
894
  ...n ? [] : ["hidden"]
891
- ].some((t) => e[t] !== void 0) || O("invalid_operation", t, "A locale update needs text, set, unset or a block's boolean hidden.");
892
- let r = F(e, t);
893
- return r && (r.text !== void 0 && !k(r.text) || r.set !== void 0 && !k(r.set) || r.hidden !== void 0 && (n || typeof r.hidden != "boolean")) && O("invalid_operation", t, "The locale layer expect is malformed."), {
895
+ ].some((t) => e[t] !== void 0) || D("invalid_operation", t, "A locale update needs text, set, unset or a block's boolean hidden.");
896
+ let r = P(e, t);
897
+ return r && (r.text !== void 0 && !O(r.text) || r.set !== void 0 && !O(r.set) || r.hidden !== void 0 && (n || typeof r.hidden != "boolean")) && D("invalid_operation", t, "The locale layer expect is malformed."), {
894
898
  text: e.text ?? {},
895
899
  set: e.set ?? {},
896
900
  unset: e.unset ?? [],
@@ -899,45 +903,45 @@ function gt(e, t, n) {
899
903
  };
900
904
  }
901
905
  function _t(e, t, n, r) {
902
- for (let i of Object.keys(t.text)) _(i) && (r ? h.includes(i) : S(String(e.type), i)) && v(e, i) !== void 0 || O("invalid_operation", n, `Text path "${i}" isn't translatable or doesn't resolve.`);
906
+ for (let i of Object.keys(t.text)) v(i) && (r ? g.includes(i) : we(String(e.type), i)) && y(e, i) !== void 0 || D("invalid_operation", n, `Text path "${i}" isn't translatable or doesn't resolve.`);
903
907
  for (let i of Object.keys(t.set)) {
904
- let a = i.split("."), o = r ? Be : Re, s = a.length === 1 ? e : v(e, a.slice(0, -1).join("."));
905
- (!_(i) || o.has(a[0]) || !r && Se(e, i, t.set[i]) || v(e, i) === void 0 && !k(s)) && O("invalid_operation", n, `Override path "${i}" is immutable or doesn't resolve.`);
908
+ let a = i.split("."), o = r ? Ve : ze, s = a.length === 1 ? e : y(e, a.slice(0, -1).join("."));
909
+ (!v(i) || o.has(a[0]) || !r && xe(e, i, t.set[i]) || y(e, i) === void 0 && !O(s)) && D("invalid_operation", n, `Override path "${i}" is immutable or doesn't resolve.`);
906
910
  }
907
911
  }
908
912
  function vt(e, t, n, r) {
909
913
  if (t) {
910
- for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {})) m(e[i]?.[a] ?? null, o) || O("precondition_failed", n, `Locale path "${a}" has changed since.`, r);
911
- t.hidden !== void 0 && !m(e.hidden === !0, t.hidden) && O("precondition_failed", n, "The locale's hidden state has changed since.", r);
914
+ for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {})) h(e[i]?.[a] ?? null, o) || D("precondition_failed", n, `Locale path "${a}" has changed since.`, r);
915
+ t.hidden !== void 0 && !h(e.hidden === !0, t.hidden) && D("precondition_failed", n, "The locale's hidden state has changed since.", r);
912
916
  }
913
917
  }
914
918
  function yt(e, t, n) {
915
- k(e.l10n) || (e.l10n = {});
919
+ O(e.l10n) || (e.l10n = {});
916
920
  let r = e.l10n;
917
- k(r[t]) || (r[t] = {});
921
+ O(r[t]) || (r[t] = {});
918
922
  let i = r[t];
919
923
  for (let e of n.unset) i.text && delete i.text[e], i.set && delete i.set[e];
920
- for (let [e, t] of Object.entries(n.text)) i.text ||= {}, i.text[e] = p(t), i.set && delete i.set[e];
921
- for (let [e, t] of Object.entries(n.set)) i.set ||= {}, i.set[e] = p(t), i.text && delete i.text[e];
924
+ for (let [e, t] of Object.entries(n.text)) i.text ||= {}, i.text[e] = m(t), i.set && delete i.set[e];
925
+ for (let [e, t] of Object.entries(n.set)) i.set ||= {}, i.set[e] = m(t), i.text && delete i.text[e];
922
926
  n.hidden === !0 ? i.hidden = !0 : n.hidden === !1 && delete i.hidden, i.text && Object.keys(i.text).length === 0 && delete i.text, i.set && Object.keys(i.set).length === 0 && delete i.set, Object.keys(i).length === 0 && delete r[t], Object.keys(r).length === 0 && delete e.l10n;
923
927
  }
924
928
  function L(e) {
925
- return k(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(L) : L(e)) : !1;
929
+ return O(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(L) : L(e)) : !1;
926
930
  }
927
931
  function bt(e) {
928
- return k(e) && k(e.l10n) && Object.values(e.l10n).some((e) => k(e) && e.hidden === !0);
932
+ return O(e) && O(e.l10n) && Object.values(e.l10n).some((e) => O(e) && e.hidden === !0);
929
933
  }
930
934
  function xt(e) {
931
- return !k(e) || !L(e) ? !1 : bt(e) ? !0 : Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(xt) : xt(e));
935
+ return !O(e) || !L(e) ? !1 : bt(e) ? !0 : Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(xt) : xt(e));
932
936
  }
933
937
  function St(e, t, n, r, i) {
934
938
  if (!L(t)) return;
935
- let a = n === null ? null : M(e, n.sectionId);
936
- (a !== null && bt(a.block) || i && xt(t)) && O("invalid_operation", r, "A layout's slot block can't be placed inside a block that a language hides.", k(t) && typeof t.id == "string" ? t.id : void 0);
939
+ let a = n === null ? null : j(e, n.sectionId);
940
+ (a !== null && bt(a.block) || i && xt(t)) && D("invalid_operation", r, "A layout's slot block can't be placed inside a block that a language hides.", O(t) && typeof t.id == "string" ? t.id : void 0);
937
941
  }
938
942
  function Ct(e, t, n, r) {
939
- let i = ft(e, t, n), a = P(t, n), o = gt(t, n, !1), s = I(j(e)).find((e) => e.id === a);
940
- s || O("block_missing", n, `No block with id "${a}".`, a), _t(s, o, n, !1), Ze(r, a, i, n), vt(mt(s, i), o.expect, n, a), o.hidden === !0 && L(s) && O("invalid_operation", n, "A layout's slot block, and any block that contains it, can't be hidden.", a), yt(s, i, o);
943
+ let i = ft(e, t, n), a = N(t, n), o = gt(t, n, !1), s = I(A(e)).find((e) => e.id === a);
944
+ s || D("block_missing", n, `No block with id "${a}".`, a), _t(s, o, n, !1), Ze(r, a, i, n), vt(mt(s, i), o.expect, n, a), o.hidden === !0 && L(s) && D("invalid_operation", n, "A layout's slot block, and any block that contains it, can't be hidden.", a), yt(s, i, o);
941
945
  }
942
946
  function wt(e, t, n) {
943
947
  let r = ft(e, t, n), i = gt(t, n, !0), a = e.settings;
@@ -945,28 +949,28 @@ function wt(e, t, n) {
945
949
  }
946
950
  function Tt(e, t, n, r) {
947
951
  let i = t.content;
948
- if (!k(i) || !Array.isArray(i.blocks) || !k(i.settings)) return O("invalid_operation", n, "setContent needs content with a blocks array and a settings object.");
952
+ if (!O(i) || !Array.isArray(i.blocks) || !O(i.settings)) return D("invalid_operation", n, "setContent needs content with a blocks array and a settings object.");
949
953
  it(i, n, e);
950
- let a = r.locks.find((e) => Ye(r, e));
951
- a && O("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = p(i.blocks), e.settings = p(i.settings);
954
+ let a = r.locks.find((e) => F(r, e));
955
+ a && D("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = m(i.blocks), e.settings = m(i.settings);
952
956
  }
953
957
  function Et(e, t, n, r) {
954
958
  let i = dt(t, n);
955
- e.settings.locales?.includes(i) || O("invalid_operation", n, `"${i}" is not a language version of this template.`);
956
- let a = je(e, i);
957
- a.length && O("invalid_operation", n, a.length === 1 ? `1 block is hidden in "${i}". Show it before making it the default.` : `${a.length} blocks are hidden in "${i}". Show them before making it the default.`, a[0]);
958
- let o = r.locks.find((e) => Ye(r, e));
959
- o && O("locked_by_others", n, "Other sessions hold locks on this template.", o.blockId);
959
+ e.settings.locales?.includes(i) || D("invalid_operation", n, `"${i}" is not a language version of this template.`);
960
+ let a = Me(e, i);
961
+ a.length && D("invalid_operation", n, a.length === 1 ? `1 block is hidden in "${i}". Show it before making it the default.` : `${a.length} blocks are hidden in "${i}". Show them before making it the default.`, a[0]);
962
+ let o = r.locks.find((e) => F(r, e));
963
+ o && D("locked_by_others", n, "Other sessions hold locks on this template.", o.blockId);
960
964
  let s = t.customTextFields;
961
965
  if (s !== void 0) {
962
966
  let t = I(e.blocks);
963
- (!k(s) || Object.getOwnPropertyNames(s).some((e) => {
964
- if (Ve.has(e)) return !0;
967
+ (!O(s) || Object.getOwnPropertyNames(s).some((e) => {
968
+ if (He.has(e)) return !0;
965
969
  let n = s[e], r = t.find((t) => t.id === e);
966
- return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !_(e) || !S("custom", e) || typeof v(r, e) != "string");
967
- })) && O("invalid_operation", n, He);
970
+ return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !v(e) || !we("custom", e) || typeof y(r, e) != "string");
971
+ })) && D("invalid_operation", n, Ue);
968
972
  }
969
- let c = Pe(e, i, t.customTextFields);
973
+ let c = Fe(e, i, t.customTextFields);
970
974
  e.blocks = c.blocks, e.settings = c.settings;
971
975
  }
972
976
  // ../types/src/invert-operations.ts
@@ -996,16 +1000,16 @@ function Ot(e, t, n = null) {
996
1000
  }
997
1001
  function kt(e, t, n) {
998
1002
  let r = Ot(e.blocks, t);
999
- if (!r) throw new E("block_missing", n, `No block with id "${t}".`, t);
1003
+ if (!r) throw new T("block_missing", n, `No block with id "${t}".`, t);
1000
1004
  return r;
1001
1005
  }
1002
1006
  function At(e, t, n) {
1003
1007
  let r = {}, i = [], a = {}, o = [.../* @__PURE__ */ new Set([...Object.keys(t ?? {}), ...n ?? []])];
1004
1008
  for (let n of o) {
1005
1009
  let o = e[n];
1006
- o === void 0 ? i.push(n) : r[n] = p(o);
1010
+ o === void 0 ? i.push(n) : r[n] = m(o);
1007
1011
  let s = t && n in t ? t[n] : void 0;
1008
- a[n] = s === void 0 ? null : p(s);
1012
+ a[n] = s === void 0 ? null : m(s);
1009
1013
  }
1010
1014
  return {
1011
1015
  set: r,
@@ -1019,7 +1023,7 @@ function R(e, t) {
1019
1023
  function z(e, t, n, r) {
1020
1024
  let i = {}, a = {}, o = {};
1021
1025
  n.length && (o.text = {}, o.set = {});
1022
- for (let r of n) e.text?.[r] !== void 0 && (i[r] = p(e.text[r])), e.set && Object.hasOwn(e.set, r) && (a[r] = p(e.set[r])), o.text[r] = p(t.text?.[r] ?? null), o.set[r] = p(t.set?.[r] ?? null);
1026
+ for (let r of n) e.text?.[r] !== void 0 && (i[r] = m(e.text[r])), e.set && Object.hasOwn(e.set, r) && (a[r] = m(e.set[r])), o.text[r] = m(t.text?.[r] ?? null), o.set[r] = m(t.set?.[r] ?? null);
1023
1027
  return r && (o.hidden = t.hidden === !0), {
1024
1028
  unset: n,
1025
1029
  ...Object.keys(i).length ? { text: i } : {},
@@ -1036,8 +1040,8 @@ function B(e) {
1036
1040
  return e.flatMap((e) => [e, ...e.type === "wrapper" ? B(e.children) : Dt(e).flatMap(B)]);
1037
1041
  }
1038
1042
  function Mt(e, t) {
1039
- let n = p(e);
1040
- D(n, [t]);
1043
+ let n = m(e);
1044
+ E(n, [t]);
1041
1045
  let r = [], i = (e, t, n) => {
1042
1046
  for (let [i, a] of Object.entries(e.l10n ?? {})) {
1043
1047
  let e = t.l10n?.[i] ?? {}, o = [.../* @__PURE__ */ new Set([...Object.keys(a.text ?? {}).filter((t) => !Object.hasOwn(e.text ?? {}, t)), ...Object.keys(a.set ?? {}).filter((t) => !Object.hasOwn(e.set ?? {}, t))])];
@@ -1070,13 +1074,13 @@ function Nt(e, t, n) {
1070
1074
  case "addBlock": return {
1071
1075
  op: "deleteBlock",
1072
1076
  blockId: t.block.id,
1073
- expect: { block: p(t.block) }
1077
+ expect: { block: m(t.block) }
1074
1078
  };
1075
1079
  case "deleteBlock": {
1076
1080
  let r = kt(e, t.blockId, n);
1077
1081
  return {
1078
1082
  op: "addBlock",
1079
- block: p(r.block),
1083
+ block: m(r.block),
1080
1084
  parent: r.parent,
1081
1085
  after: r.after
1082
1086
  };
@@ -1146,8 +1150,8 @@ function Nt(e, t, n) {
1146
1150
  }
1147
1151
  case "updateBlockLocale":
1148
1152
  case "updateSettingsLocale": {
1149
- let n = p(e);
1150
- D(n, [t]);
1153
+ let n = m(e);
1154
+ E(n, [t]);
1151
1155
  let r = [.../* @__PURE__ */ new Set([
1152
1156
  ...Object.keys(t.text ?? {}),
1153
1157
  ...Object.keys(t.set ?? {}),
@@ -1173,20 +1177,20 @@ function Nt(e, t, n) {
1173
1177
  case "setContent": return {
1174
1178
  op: "setContent",
1175
1179
  content: {
1176
- blocks: p(e.blocks),
1177
- settings: p(e.settings)
1180
+ blocks: m(e.blocks),
1181
+ settings: m(e.settings)
1178
1182
  }
1179
1183
  };
1180
1184
  }
1181
1185
  }
1182
1186
  function Pt(e, t) {
1183
- let n = p(e), r = [];
1187
+ let n = m(e), r = [];
1184
1188
  return t.forEach((e, t) => {
1185
1189
  try {
1186
1190
  let i = Nt(n, e, t);
1187
- r.push(...Array.isArray(i) ? [...i].reverse() : [i]), D(n, [e]);
1191
+ r.push(...Array.isArray(i) ? [...i].reverse() : [i]), E(n, [e]);
1188
1192
  } catch (e) {
1189
- throw e instanceof E ? new E(e.code, t, e.message, e.blockId) : e;
1193
+ throw e instanceof T ? new T(e.code, t, e.message, e.blockId) : e;
1190
1194
  }
1191
1195
  }), r.reverse();
1192
1196
  }
@@ -1194,7 +1198,7 @@ function Pt(e, t) {
1194
1198
  function Ft(e) {
1195
1199
  return e === "invalid_operation" ? 422 : e === "content_too_large" ? 413 : 409;
1196
1200
  }
1197
- var It = class extends ge {
1201
+ var It = class extends he {
1198
1202
  opIndex;
1199
1203
  holder;
1200
1204
  holders;
@@ -1392,14 +1396,14 @@ function vn(e) {
1392
1396
  }
1393
1397
  // ../types/src/translation.ts
1394
1398
  var yn = 2e4, bn = /* @__PURE__ */ new Set(["\"", "'"]);
1395
- function U(e, t) {
1399
+ function xn(e, t) {
1396
1400
  let n = null, r = "tag";
1397
1401
  for (let i = t; i < e.length; i++) {
1398
1402
  let t = e[i];
1399
1403
  if (n !== null) t === n && (n = null);
1400
1404
  else {
1401
1405
  if (r === "beforeValue") {
1402
- if (W(t)) continue;
1406
+ if (U(t)) continue;
1403
1407
  if (bn.has(t)) {
1404
1408
  n = t, r = "tag";
1405
1409
  continue;
@@ -1408,20 +1412,40 @@ function U(e, t) {
1408
1412
  }
1409
1413
  if (r === "unquotedValue") {
1410
1414
  if (t === ">") return i;
1411
- W(t) && (r = "tag");
1415
+ U(t) && (r = "tag");
1412
1416
  } else if (t === "=") r = "beforeValue";
1413
1417
  else if (t === ">") return i;
1414
1418
  }
1415
1419
  }
1416
1420
  return -1;
1417
1421
  }
1418
- function xn(e) {
1422
+ function Sn(e, t) {
1423
+ let n = null;
1424
+ for (let r = t; r < e.length; r++) {
1425
+ let t = e[r];
1426
+ if (n !== null) t === n && (n = null);
1427
+ else if (bn.has(t)) n = t;
1428
+ else if (t === ">") return {
1429
+ end: r,
1430
+ nextSpan: -1
1431
+ };
1432
+ else if (t === "<" && e.startsWith("<span", r)) return {
1433
+ end: -1,
1434
+ nextSpan: r
1435
+ };
1436
+ }
1437
+ return {
1438
+ end: -1,
1439
+ nextSpan: -1
1440
+ };
1441
+ }
1442
+ function Cn(e) {
1419
1443
  return e !== " " && e !== " " && e !== "\n" && e !== "\r" && e !== "\f" && e !== "=" && e !== ">" && e !== "/";
1420
1444
  }
1421
- function W(e) {
1445
+ function U(e) {
1422
1446
  return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
1423
1447
  }
1424
- var Sn = {
1448
+ var wn = {
1425
1449
  AMP: "&",
1426
1450
  COPY: "©",
1427
1451
  GT: ">",
@@ -1682,54 +1706,54 @@ var Sn = {
1682
1706
  zwj: "‍",
1683
1707
  zwnj: "‌"
1684
1708
  };
1685
- function G(e) {
1709
+ function W(e) {
1686
1710
  return e.includes("&") ? e.replace(/&(#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g, (e, t) => {
1687
1711
  if (t[0] === "#") {
1688
1712
  let n = t[1] === "x" || t[1] === "X" ? Number.parseInt(t.slice(2), 16) : Number.parseInt(t.slice(1), 10);
1689
1713
  return !Number.isFinite(n) || n < 1 || n > 1114111 || n >= 55296 && n <= 57343 ? e : String.fromCodePoint(n);
1690
1714
  }
1691
- return Object.hasOwn(Sn, t) ? Sn[t] : e;
1715
+ return Object.hasOwn(wn, t) ? wn[t] : e;
1692
1716
  }) : e;
1693
1717
  }
1694
- function Cn(e, t) {
1718
+ function Tn(e, t) {
1695
1719
  let n = t.toLowerCase(), r = 0;
1696
1720
  for (; r < e.length;) {
1697
- for (; r < e.length && (W(e[r]) || e[r] === "/");) r++;
1721
+ for (; r < e.length && (U(e[r]) || e[r] === "/");) r++;
1698
1722
  if (r >= e.length) break;
1699
1723
  let t = r;
1700
- for (; r < e.length && xn(e[r]);) r++;
1724
+ for (; r < e.length && Cn(e[r]);) r++;
1701
1725
  let i = e.substring(t, r).toLowerCase();
1702
1726
  if (i === "") {
1703
1727
  r++;
1704
1728
  continue;
1705
1729
  }
1706
- for (; r < e.length && W(e[r]);) r++;
1730
+ for (; r < e.length && U(e[r]);) r++;
1707
1731
  if (e[r] !== "=") continue;
1708
- for (r++; r < e.length && W(e[r]);) r++;
1732
+ for (r++; r < e.length && U(e[r]);) r++;
1709
1733
  let a = e[r];
1710
1734
  if (bn.has(a)) {
1711
1735
  let t = r + 1, o = e.indexOf(a, t);
1712
1736
  if (o === -1) return null;
1713
- if (i === n) return G(e.substring(t, o));
1737
+ if (i === n) return W(e.substring(t, o));
1714
1738
  r = o + 1;
1715
1739
  continue;
1716
1740
  }
1717
1741
  let o = r;
1718
- for (; r < e.length && !W(e[r]) && e[r] !== ">";) r++;
1719
- if (i === n) return G(e.substring(o, r));
1742
+ for (; r < e.length && !U(e[r]) && e[r] !== ">";) r++;
1743
+ if (i === n) return W(e.substring(o, r));
1720
1744
  }
1721
1745
  return null;
1722
1746
  }
1723
1747
  // ../types/src/merge-tag-html.ts
1724
- function wn(e) {
1725
- return Dn(e, (e) => e, !1);
1748
+ function En(e) {
1749
+ return kn(e, (e) => e, !1);
1726
1750
  }
1727
- function Tn(e, t) {
1728
- return Dn(e, t, !0);
1751
+ function Dn(e, t) {
1752
+ return kn(e, t, !0);
1729
1753
  }
1730
- function En(e) {
1754
+ function On(e) {
1731
1755
  let t = [];
1732
- return Dn(e, (n, r, i) => {
1756
+ return kn(e, (n, r, i) => {
1733
1757
  let a = e.slice(r, i);
1734
1758
  return t.push({
1735
1759
  start: r,
@@ -1738,7 +1762,7 @@ function En(e) {
1738
1762
  }), a;
1739
1763
  }, !0), t;
1740
1764
  }
1741
- function Dn(e, t, n) {
1765
+ function kn(e, t, n) {
1742
1766
  let r = "", i = 0;
1743
1767
  for (; i < e.length;) {
1744
1768
  let a = e.indexOf("<span", i);
@@ -1751,26 +1775,30 @@ function Dn(e, t, n) {
1751
1775
  r += e.substring(i, a + 5), i = a + 5;
1752
1776
  continue;
1753
1777
  }
1754
- let s = U(e, a + 5);
1778
+ let { end: s, nextSpan: c } = Sn(e, a + 5);
1779
+ if (c !== -1) {
1780
+ r += e.substring(i, c), i = c;
1781
+ continue;
1782
+ }
1755
1783
  if (s === -1) {
1756
1784
  r += e.substring(i);
1757
1785
  break;
1758
1786
  }
1759
- let c = e.substring(a + 5, s), l = kn(c, "data-merge-tag") ?? kn(c, "data-logic-merge-tag");
1760
- if (l === null) {
1761
- r += e.substring(i, a + 5), i = a + 5;
1787
+ let l = e.substring(a + 5, s), u = jn(l, "data-merge-tag") ?? jn(l, "data-logic-merge-tag");
1788
+ if (u === null) {
1789
+ r += e.substring(i, s + 1), i = s + 1;
1762
1790
  continue;
1763
1791
  }
1764
- let u = On(e, s + 1, n);
1765
- if (u === -1) {
1792
+ let d = An(e, s + 1, n);
1793
+ if (d === -1) {
1766
1794
  r += e.substring(i);
1767
1795
  break;
1768
1796
  }
1769
- r += e.substring(i, a), r += t(l, a, u), i = u;
1797
+ r += e.substring(i, a), r += t(u, a, d), i = d;
1770
1798
  }
1771
1799
  return r;
1772
1800
  }
1773
- function On(e, t, n) {
1801
+ function An(e, t, n) {
1774
1802
  if (!n) {
1775
1803
  let n = e.indexOf("</span>", t);
1776
1804
  return n === -1 ? -1 : n + 7;
@@ -1779,7 +1807,7 @@ function On(e, t, n) {
1779
1807
  for (; i < e.length;) {
1780
1808
  let t = e.indexOf("<", i);
1781
1809
  if (t === -1) return -1;
1782
- let n = U(e, t + 1);
1810
+ let n = xn(e, t + 1);
1783
1811
  if (n === -1) return -1;
1784
1812
  let a = e.startsWith("</span", t), o = e.startsWith("<span", t), s = e[t + (a ? 6 : 5)];
1785
1813
  if ((o || a) && (s === ">" || s === "/" || /\s/.test(s)) && (r += a ? -1 : 1, r === 0)) return n + 1;
@@ -1787,18 +1815,259 @@ function On(e, t, n) {
1787
1815
  }
1788
1816
  return -1;
1789
1817
  }
1790
- function kn(e, t) {
1791
- return Cn(e, t);
1818
+ function jn(e, t) {
1819
+ return Tn(e, t);
1820
+ }
1821
+ // ../types/src/merge-tags.ts
1822
+ var G = {
1823
+ liquid: {
1824
+ value: /\{\{.+?\}\}/g,
1825
+ logic: /\{%-?\s*(\w+).*?-?%\}/g,
1826
+ opener: "{{",
1827
+ closer: "}}"
1828
+ },
1829
+ handlebars: {
1830
+ value: /\{\{\{?.+?\}?\}\}/g,
1831
+ logic: /\{\{[#/](\w+).*?\}\}/g,
1832
+ opener: "{{",
1833
+ closer: "}}"
1834
+ },
1835
+ mailchimp: {
1836
+ value: /\*\|\w+\|\*/g,
1837
+ logic: /\*\|(\w+)[:|].*?\|\*/g,
1838
+ opener: "*|",
1839
+ closer: "|*"
1840
+ },
1841
+ ampscript: {
1842
+ value: /%%=.+?=%%/g,
1843
+ logic: /%%\[\s*(\w+).*?\]%%/g,
1844
+ opener: "%%=",
1845
+ closer: "=%%"
1846
+ }
1847
+ };
1848
+ function Mn(e, t, n) {
1849
+ for (let r = n; r < e.length; r++) {
1850
+ let n = e.charCodeAt(r);
1851
+ if (n === 10 || n === 13 || n === 8232 || n === 8233) return {
1852
+ close: -1,
1853
+ lineBreak: r
1854
+ };
1855
+ if (e.startsWith(t, r)) return {
1856
+ close: r,
1857
+ lineBreak: -1
1858
+ };
1859
+ }
1860
+ return {
1861
+ close: -1,
1862
+ lineBreak: -1
1863
+ };
1864
+ }
1865
+ function K(e, t, n, r = 0, i = Infinity) {
1866
+ let a = Object.keys(G).find((e) => G[e] === t);
1867
+ if (!a) {
1868
+ let a = t[n], o = new RegExp(a.source, a.flags.replace(/[gy]/g, "") + "g");
1869
+ return o.lastIndex = r, [...e.matchAll(o)].slice(0, i).map((e) => ({
1870
+ index: e.index,
1871
+ value: e[0]
1872
+ }));
1873
+ }
1874
+ let o = t[n], s = a === "ampscript" ? n === "value" ? "%%=" : "%%[" : a === "liquid" && n === "logic" ? "{%" : a === "mailchimp" ? "*|" : "{{", c = a === "ampscript" ? n === "value" ? "=%%" : "]%%" : a === "liquid" && n === "logic" ? "%}" : a === "mailchimp" ? "|*" : "}}", l = n === "logic" ? {
1875
+ liquid: String.raw`\{%-?\s*\w+`,
1876
+ handlebars: String.raw`\{\{[#/]\w+`,
1877
+ mailchimp: String.raw`\*\|\w+[:|]`,
1878
+ ampscript: String.raw`%%\[\s*\w+`
1879
+ }[a] : a === "mailchimp" ? String.raw`\*\|\w+` : null, u = l ? new RegExp(l, "y") : null, d = new RegExp(o.source, "y"), f = [], p = r;
1880
+ for (; p < e.length && f.length < i;) {
1881
+ let t = e.indexOf(s, p);
1882
+ if (t < 0) break;
1883
+ if (u && (u.lastIndex = t, !u.exec(e))) {
1884
+ p = t + 1;
1885
+ continue;
1886
+ }
1887
+ let r = u?.lastIndex ?? t + s.length, i = a === "mailchimp" && n === "value" ? {
1888
+ close: e.startsWith(c, r) ? r : -1,
1889
+ lineBreak: -1
1890
+ } : Mn(e, c, Math.max(r, t + s.length + +(n === "value")));
1891
+ if (i.lineBreak >= 0) {
1892
+ let r = i.lineBreak, o = n === "logic" && (a === "liquid" || a === "ampscript") ? e.lastIndexOf(s, r) : -1;
1893
+ p = o > t ? o : r + 1;
1894
+ continue;
1895
+ }
1896
+ if (i.close < 0) {
1897
+ if (a === "mailchimp" && n === "value") {
1898
+ p = t + 1;
1899
+ continue;
1900
+ }
1901
+ break;
1902
+ }
1903
+ d.lastIndex = t;
1904
+ let o = d.exec(e);
1905
+ o ? (f.push({
1906
+ index: t,
1907
+ value: o[0]
1908
+ }), p = d.lastIndex) : p = t + 1;
1909
+ }
1910
+ return f;
1911
+ }
1912
+ function Nn(e, t) {
1913
+ if (!Object.values(G).includes(t)) {
1914
+ let n = RegExp(`(${t.value.source}|${t.logic.source})`, "g");
1915
+ return [...e.matchAll(n)].map((e) => ({
1916
+ index: e.index,
1917
+ value: e[0]
1918
+ }));
1919
+ }
1920
+ if (t === G.handlebars) return K(e, t, "value");
1921
+ if (t === G.mailchimp) {
1922
+ let n = [], r = new RegExp(t.value.source, "y"), i = new RegExp(t.logic.source, "y"), a = /\*\|\w+[:|]/y, o = 0;
1923
+ for (; o < e.length;) {
1924
+ let t = e.indexOf("*|", o);
1925
+ if (t < 0) break;
1926
+ r.lastIndex = t;
1927
+ let s = r.exec(e);
1928
+ if (s) {
1929
+ n.push({
1930
+ index: t,
1931
+ value: s[0]
1932
+ }), o = r.lastIndex;
1933
+ continue;
1934
+ }
1935
+ if (a.lastIndex = t, !a.exec(e)) {
1936
+ o = t + 2;
1937
+ continue;
1938
+ }
1939
+ let c = Mn(e, "|*", a.lastIndex);
1940
+ if (c.lineBreak >= 0) {
1941
+ o = c.lineBreak + 1;
1942
+ continue;
1943
+ }
1944
+ if (c.close < 0) break;
1945
+ i.lastIndex = t;
1946
+ let l = i.exec(e);
1947
+ l ? (n.push({
1948
+ index: t,
1949
+ value: l[0]
1950
+ }), o = i.lastIndex) : o = t + 2;
1951
+ }
1952
+ return n;
1953
+ }
1954
+ let n = [], r = 0, i = K(e, t, "value", r, 1)[0], a = K(e, t, "logic", r, 1)[0];
1955
+ for (; i || a;) {
1956
+ let o = !a || i && i.index <= a.index ? i : a;
1957
+ n.push(o), r = o.index + o.value.length, (o === i || i && i.index < r) && (i = K(e, t, "value", r, 1)[0]), (o === a || a && a.index < r) && (a = K(e, t, "logic", r, 1)[0]);
1958
+ }
1959
+ return n;
1960
+ }
1961
+ function Pn(e) {
1962
+ return typeof e == "string" && e.trim() !== "" ? e : null;
1963
+ }
1964
+ function Fn(e) {
1965
+ return Object.values(G).find((t) => t.value.source === e.value.source) ?? null;
1966
+ }
1967
+ function In(e) {
1968
+ return Pn(e.opener) ?? Fn(e)?.opener ?? null;
1969
+ }
1970
+ function Ln(e) {
1971
+ return Pn(e.closer) ?? Fn(e)?.closer ?? null;
1972
+ }
1973
+ function Rn(e) {
1974
+ return e ? typeof e == "string" ? G[e] ?? G.liquid : e : G.liquid;
1975
+ }
1976
+ function zn(e) {
1977
+ let t = e.source, n = e.flags.replace("g", "");
1978
+ return RegExp(`^${t}$`, n);
1979
+ }
1980
+ function Bn(e, t) {
1981
+ let n = e?.trim() || "";
1982
+ return !zn(t.logic).test(n) && zn(t.value).test(n);
1983
+ }
1984
+ function Vn(e, t) {
1985
+ let n = t.find((t) => t.value === e);
1986
+ return n ? n.label : e;
1987
+ }
1988
+ function Hn(e, t) {
1989
+ return Qn(e, "data-merge-tag", (e) => Vn(e, t));
1990
+ }
1991
+ function Un(e, t) {
1992
+ return t.find((t) => t.value === e)?.sample;
1993
+ }
1994
+ function Wn(e, t) {
1995
+ return Qn(e, "data-merge-tag", (e) => qn(Un(e, t) ?? Vn(e, t)), { unwrap: (e) => Un(e, t) !== void 0 });
1996
+ }
1997
+ function Gn(e) {
1998
+ return e.some((e) => e.sample !== void 0);
1999
+ }
2000
+ function Kn(e, t) {
2001
+ if (!e) return e;
2002
+ let n = e;
2003
+ for (let e of t) e.sample !== void 0 && (n = n.split(e.value).join(e.sample));
2004
+ return n;
2005
+ }
2006
+ function qn(e) {
2007
+ return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
2008
+ }
2009
+ function Jn(e, t) {
2010
+ if (!e) return !1;
2011
+ if (Object.values(G).includes(t)) return K(e, t, "value", 0, 1).length > 0 || K(e, t, "logic", 0, 1).length > 0;
2012
+ let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
2013
+ return n.test(e) || r.test(e);
2014
+ }
2015
+ function Yn(e, t) {
2016
+ return zn(t.logic).test(e?.trim() || "");
2017
+ }
2018
+ function Xn(e, t) {
2019
+ let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
2020
+ return r && r[1] ? r[1].toUpperCase() : e;
2021
+ }
2022
+ function Zn(e, t) {
2023
+ return Qn(e, "data-logic-merge-tag", (e) => Xn(e, t));
2024
+ }
2025
+ function Qn(e, t, n, r) {
2026
+ let i = "", a = 0;
2027
+ for (; a < e.length;) {
2028
+ let o = e.indexOf("<span", a);
2029
+ if (o === -1) {
2030
+ i += e.substring(a);
2031
+ break;
2032
+ }
2033
+ let s = e[o + 5];
2034
+ if (s !== ">" && s !== " " && s !== " " && s !== "\n" && s !== "\r" && s !== "/") {
2035
+ i += e.substring(a, o + 5), a = o + 5;
2036
+ continue;
2037
+ }
2038
+ let { end: c, nextSpan: l } = Sn(e, o + 5);
2039
+ if (l !== -1) {
2040
+ i += e.substring(a, l), a = l;
2041
+ continue;
2042
+ }
2043
+ if (c === -1) {
2044
+ i += e.substring(a);
2045
+ break;
2046
+ }
2047
+ let u = Tn(e.substring(o + 5, c), t);
2048
+ if (u === null) {
2049
+ i += e.substring(a, c + 1), a = c + 1;
2050
+ continue;
2051
+ }
2052
+ let d = e.indexOf("</span>", c + 1);
2053
+ if (d === -1) {
2054
+ i += e.substring(a);
2055
+ break;
2056
+ }
2057
+ let f = n(u);
2058
+ r?.unwrap?.(u) ? (i += e.substring(a, o), i += f) : (i += e.substring(a, c + 1), i += f, i += "</span>"), a = d + 7;
2059
+ }
2060
+ return i;
1792
2061
  }
1793
2062
  // ../types/src/locale-strings.ts
1794
- var An = {
2063
+ var $n = {
1795
2064
  title: ["content"],
1796
2065
  paragraph: ["content"]
1797
2066
  };
1798
- function jn(e) {
2067
+ function er(e) {
1799
2068
  let t = [], n = /<[a-z][\w:-]*\b/gi;
1800
2069
  for (; n.exec(e);) {
1801
- let r = U(e, n.lastIndex);
2070
+ let r = xn(e, n.lastIndex);
1802
2071
  if (r < 0) break;
1803
2072
  let i = n.lastIndex, a = e.slice(i, r), o = /[^\s"'<>/=]+\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/g;
1804
2073
  for (let e; e = o.exec(a);) {
@@ -1812,42 +2081,46 @@ function jn(e) {
1812
2081
  }
1813
2082
  return t;
1814
2083
  }
1815
- function Mn(e, t, n) {
1816
- let r = n === "html" ? En(e) : [], i = n === "html" ? jn(e) : [], a = r.map((e) => ({
2084
+ function tr(e, t, n) {
2085
+ let r = n === "html" ? On(e) : [], i = n === "html" ? er(e) : [], a = r.map((e) => ({
1817
2086
  ...e,
1818
2087
  attribute: !1
1819
- })), o = (n, r) => {
1820
- let o = e.slice(n, r), s = [t.logic, t.value].map((e) => new RegExp(e.source, e.flags.replace(/[gy]/g, "") + "g")), c = 0;
1821
- for (; c < o.length;) {
1822
- let e = s.flatMap((e) => {
1823
- e.lastIndex = c;
1824
- let t = e.exec(o);
1825
- for (; t && t[0].length === 0;) e.lastIndex = t.index + 1, t = e.exec(o);
1826
- return t ? [t] : [];
2088
+ })), o = 0, s = (n, r) => {
2089
+ let s = e.slice(n, r), c = Object.values(G).includes(t), l = ["logic", "value"], u = c ? l.map((e) => K(s, t, e, 0, 1)[0]) : null, d = c ? null : [t.logic, t.value].map((e) => new RegExp(e.source, e.flags.replace(/[gy]/g, "") + "g")), f = 0;
2090
+ for (; f < s.length;) {
2091
+ let e = c ? u.flatMap((e) => e ? [e] : []) : d.flatMap((e) => {
2092
+ e.lastIndex = f;
2093
+ let t = e.exec(s);
2094
+ for (; t && t[0].length === 0;) e.lastIndex = t.index + 1, t = e.exec(s);
2095
+ return t ? [{
2096
+ index: t.index,
2097
+ value: t[0]
2098
+ }] : [];
1827
2099
  });
1828
- e.sort((e, t) => e.index - t.index || e[0].length - t[0].length);
1829
- let t = e[0];
1830
- if (!t) break;
1831
- let r = n + t.index, l = r + t[0].length;
1832
- a.push({
1833
- start: r,
1834
- end: l,
1835
- markup: t[0],
1836
- attribute: i.some((e) => r >= e.start && l <= e.end)
1837
- }), c = t.index + t[0].length;
2100
+ e.sort((e, t) => e.index - t.index || e.value.length - t.value.length);
2101
+ let r = e[0];
2102
+ if (!r) break;
2103
+ let p = n + r.index, ee = p + r.value.length;
2104
+ for (; i[o]?.end <= p;) o++;
2105
+ if (a.push({
2106
+ start: p,
2107
+ end: ee,
2108
+ markup: r.value,
2109
+ attribute: i[o] !== void 0 && p >= i[o].start && ee <= i[o].end
2110
+ }), f = r.index + r.value.length, c) for (let e = 0; e < l.length; e++) u[e] && u[e].index < f && (u[e] = K(s, t, l[e], f, 1)[0]);
1838
2111
  }
1839
- }, s = 0;
1840
- for (let e of r) o(s, e.start), s = e.end;
1841
- return o(s, e.length), a.sort((e, t) => e.start - t.start);
2112
+ }, c = 0;
2113
+ for (let e of r) s(c, e.start), c = e.end;
2114
+ return s(c, e.length), a.sort((e, t) => e.start - t.start);
1842
2115
  }
1843
- function Nn(e) {
2116
+ function nr(e) {
1844
2117
  if (!e.includes("&")) return { text: e };
1845
2118
  let t = "", n = [0], r = 0, i = (i) => {
1846
2119
  for (t += e.slice(r, i); r < i;) n.push(++r);
1847
2120
  };
1848
2121
  for (let a of e.matchAll(/&(?:#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g)) {
1849
2122
  i(a.index);
1850
- let e = G(a[0]);
2123
+ let e = W(a[0]);
1851
2124
  t += e;
1852
2125
  for (let t = 1; t < e.length; t++) n.push(-1);
1853
2126
  r = a.index + a[0].length, n.push(r);
@@ -1857,17 +2130,17 @@ function Nn(e) {
1857
2130
  offsets: n
1858
2131
  };
1859
2132
  }
1860
- var K = /* @__PURE__ */ new Map(), Pn = 32;
1861
- function Fn(e) {
1862
- let t = JSON.stringify(e), n = K.get(t);
2133
+ var q = /* @__PURE__ */ new Map(), rr = 32;
2134
+ function ir(e) {
2135
+ let t = JSON.stringify(e), n = q.get(t);
1863
2136
  if (n === void 0) {
1864
2137
  let r = e.map((e) => e.trim()).filter(Boolean).sort((e, t) => t.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
1865
- n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null, K.size >= Pn && K.delete(K.keys().next().value), K.set(t, n);
2138
+ n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null, q.size >= rr && q.delete(q.keys().next().value), q.set(t, n);
1866
2139
  }
1867
2140
  return n;
1868
2141
  }
1869
- function In(e, t, n) {
1870
- let r = n.length ? Fn(n) : null;
2142
+ function ar(e, t, n) {
2143
+ let r = n.length ? ir(n) : null;
1871
2144
  if (!r) return [];
1872
2145
  let i = [];
1873
2146
  if (t === "text") i.push({
@@ -1876,7 +2149,7 @@ function In(e, t, n) {
1876
2149
  attribute: !1
1877
2150
  });
1878
2151
  else {
1879
- i.push(...jn(e).map((e) => ({
2152
+ i.push(...er(e).map((e) => ({
1880
2153
  ...e,
1881
2154
  attribute: !0
1882
2155
  })));
@@ -1887,7 +2160,7 @@ function In(e, t, n) {
1887
2160
  end: r.index,
1888
2161
  attribute: !1
1889
2162
  });
1890
- let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) : U(e, t.lastIndex);
2163
+ let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) : xn(e, t.lastIndex);
1891
2164
  if (a < 0) return [];
1892
2165
  n = a + (r[0] === "<!--" ? 3 : 1), t.lastIndex = n;
1893
2166
  }
@@ -1900,7 +2173,7 @@ function In(e, t, n) {
1900
2173
  let a = [];
1901
2174
  for (let n of i) {
1902
2175
  r.lastIndex = 0;
1903
- let i = e.slice(n.start, n.end), o = t === "html" ? Nn(i) : {
2176
+ let i = e.slice(n.start, n.end), o = t === "html" ? nr(i) : {
1904
2177
  text: i,
1905
2178
  offsets: void 0
1906
2179
  };
@@ -1919,51 +2192,51 @@ function In(e, t, n) {
1919
2192
  }
1920
2193
  return a;
1921
2194
  }
1922
- function Ln(e, t, n, r) {
1923
- let i = Mn(e, t, n), a = In(e, n, r?.doNotTranslate ?? []).filter((e) => !i.some((t) => e.start < t.end && e.end > t.start));
2195
+ function or(e, t, n, r) {
2196
+ let i = tr(e, t, n), a = ar(e, n, r?.doNotTranslate ?? []).filter((e) => !i.some((t) => e.start < t.end && e.end > t.start));
1924
2197
  return [...i, ...a].sort((e, t) => e.start - t.start);
1925
2198
  }
1926
- function Rn(e, t, n) {
2199
+ function sr(e, t, n) {
1927
2200
  let r = "", i = 0;
1928
2201
  return t.forEach((t, a) => {
1929
2202
  r += e.slice(i, t.start), r += t.attribute ? `__x${n[a]}__` : `<x id="${n[a]}"/>`, i = t.end;
1930
2203
  }), r + e.slice(i);
1931
2204
  }
1932
- function zn(e, t, n, r) {
1933
- let i = Ln(e, t, n, r);
2205
+ function cr(e, t, n, r) {
2206
+ let i = or(e, t, n, r);
1934
2207
  return {
1935
- text: Rn(e, i, i.map((e, t) => t + 1)),
2208
+ text: sr(e, i, i.map((e, t) => t + 1)),
1936
2209
  tokens: i.map((e) => e.markup)
1937
2210
  };
1938
2211
  }
1939
- function Bn(e, t) {
2212
+ function lr(e, t) {
1940
2213
  let n = /* @__PURE__ */ new Set(), r = !0, i = e.replace(/<x id="(\d+)"\s*\/>|<x id="(\d+)"><\/x>|__x(\d+)__/g, (e, i, a, o) => {
1941
2214
  let s = Number(i ?? a ?? o);
1942
2215
  return (s < 1 || s > t.length || n.has(s)) && (r = !1), n.add(s), t[s - 1] ?? "";
1943
2216
  });
1944
2217
  return r && n.size === t.length ? i : null;
1945
2218
  }
1946
- function Vn(e, t, n, r, i) {
1947
- let a = Ln(e, n, r, i), o = /* @__PURE__ */ new Set(), s = (e) => {
2219
+ function ur(e, t, n, r, i) {
2220
+ let a = or(e, n, r, i), o = /* @__PURE__ */ new Set(), s = (e) => {
1948
2221
  let n = t.findIndex((t, n) => !o.has(n) && e(t));
1949
2222
  return n >= 0 && o.add(n), n;
1950
2223
  }, c = a.map((e) => s((t) => t === e.markup));
1951
2224
  return a.forEach((e, t) => {
1952
- c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) => G(t) === e.term));
1953
- }), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null : Rn(e, a.filter((e, t) => c[t] >= 0), c.filter((e) => e >= 0).map((e) => e + 1));
2225
+ c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) => W(t) === e.term));
2226
+ }), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null : sr(e, a.filter((e, t) => c[t] >= 0), c.filter((e) => e >= 0).map((e) => e + 1));
1954
2227
  }
1955
- function Hn(e, t, n = []) {
2228
+ function dr(e, t, n = []) {
1956
2229
  let r = /* @__PURE__ */ new Map();
1957
- if (t === T(e) || !e.settings.locales?.includes(t)) return r;
2230
+ if (t === w(e) || !e.settings.locales?.includes(t)) return r;
1958
2231
  let i = (e, n, i, a) => {
1959
2232
  let o = n.l10n?.[t];
1960
2233
  for (let t of i) {
1961
- let i = v(n, t);
2234
+ let i = y(n, t);
1962
2235
  typeof i != "string" || i === "" || Object.keys(o?.set ?? {}).some((e) => e === t || t.startsWith(`${e}.`)) || r.set(`${e.kind === "block" ? e.blockId : "settings"}/${t}`, {
1963
2236
  target: e,
1964
2237
  path: t,
1965
2238
  source: i,
1966
- format: a && An[a]?.includes(t) ? "html" : "text",
2239
+ format: a && $n[a]?.includes(t) ? "html" : "text",
1967
2240
  text: o?.text?.[t]
1968
2241
  });
1969
2242
  }
@@ -1972,17 +2245,17 @@ function Hn(e, t, n = []) {
1972
2245
  if (r.type !== "html" && i({
1973
2246
  kind: "block",
1974
2247
  blockId: r.id
1975
- }, r, x(r, n), r.type), r.type === "section") for (let e of r.children) a(e);
2248
+ }, r, S(r, n), r.type), r.type === "section") for (let e of r.children) a(e);
1976
2249
  else r.type === "wrapper" && a(r.children);
1977
2250
  }
1978
2251
  };
1979
- return a(e.blocks), i({ kind: "settings" }, e.settings, h), r;
2252
+ return a(e.blocks), i({ kind: "settings" }, e.settings, g), r;
1980
2253
  }
1981
- function Un(e, t, n) {
1982
- let r = n.only === "all" ? null : Ae(e, t, n.definitions), i = r && /* @__PURE__ */ new Set([...r.missing, ...r.stale]), a = [], o = {};
1983
- for (let [r, s] of Hn(e, t, n.definitions)) {
2254
+ function fr(e, t, n) {
2255
+ let r = n.only === "all" ? null : je(e, t, n.definitions), i = r && /* @__PURE__ */ new Set([...r.missing, ...r.stale]), a = [], o = {};
2256
+ for (let [r, s] of dr(e, t, n.definitions)) {
1984
2257
  if (i && !i.has(r) || n.blockId !== void 0 && (s.target.kind !== "block" || s.target.blockId !== n.blockId)) continue;
1985
- let e = zn(s.source, n.syntax, s.format, n), t = s.text ? Vn(s.text.value, e.tokens, n.syntax, s.format, n) : void 0;
2258
+ let e = cr(s.source, n.syntax, s.format, n), t = s.text ? ur(s.text.value, e.tokens, n.syntax, s.format, n) : void 0;
1986
2259
  a.push({
1987
2260
  id: r,
1988
2261
  format: s.format,
@@ -1996,8 +2269,8 @@ function Un(e, t, n) {
1996
2269
  tokens: o
1997
2270
  };
1998
2271
  }
1999
- function Wn(e, t, n, r) {
2000
- let i = Hn(e, t, r.definitions), a = /* @__PURE__ */ new Map(), o = (e) => {
2272
+ function pr(e, t, n, r) {
2273
+ let i = dr(e, t, r.definitions), a = /* @__PURE__ */ new Map(), o = (e) => {
2001
2274
  for (let t of e) if (a.set(t.id, t), t.type === "section") for (let e of t.children) o(e);
2002
2275
  else t.type === "wrapper" && o(t.children);
2003
2276
  };
@@ -2009,12 +2282,12 @@ function Wn(e, t, n, r) {
2009
2282
  let n = t.id.lastIndexOf("/"), r = t.id.slice(0, n), i = r === "settings" ? [a.get(r), e.settings] : [a.get(r)];
2010
2283
  l.push({
2011
2284
  id: t.id,
2012
- reason: n < 0 || !i.some((e) => e && v(e, t.id.slice(n + 1)) !== void 0) ? "unknown_field" : "not_translatable"
2285
+ reason: n < 0 || !i.some((e) => e && y(e, t.id.slice(n + 1)) !== void 0) ? "unknown_field" : "not_translatable"
2013
2286
  });
2014
2287
  continue;
2015
2288
  }
2016
- let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ? Bn(t.text, o) : null;
2017
- if (!o || u === null || Vn(u, o, r.syntax, n.format, r) === null) {
2289
+ let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ? lr(t.text, o) : null;
2290
+ if (!o || u === null || ur(u, o, r.syntax, n.format, r) === null) {
2018
2291
  l.push({
2019
2292
  id: t.id,
2020
2293
  reason: "tags_changed"
@@ -2044,7 +2317,7 @@ function Wn(e, t, n, r) {
2044
2317
  };
2045
2318
  }
2046
2319
  // ../types/src/custom-block-liquid.ts
2047
- function Gn(e) {
2320
+ function mr(e) {
2048
2321
  return new e.Liquid({
2049
2322
  strictVariables: !1,
2050
2323
  strictFilters: !1,
@@ -2053,17 +2326,17 @@ function Gn(e) {
2053
2326
  });
2054
2327
  }
2055
2328
  // ../types/src/factory.ts
2056
- function q(e, t) {
2057
- let n = p(e);
2329
+ function J(e, t) {
2330
+ let n = m(e);
2058
2331
  return !t || Object.keys(t).length === 0 ? n : mn(n, t);
2059
2332
  }
2060
- function J(e) {
2061
- return e === void 0 ? void 0 : p(e);
2333
+ function Y(e) {
2334
+ return e === void 0 ? void 0 : m(e);
2062
2335
  }
2063
- function Y() {
2336
+ function X() {
2064
2337
  return crypto.randomUUID();
2065
2338
  }
2066
- function Kn(e = 0) {
2339
+ function hr(e = 0) {
2067
2340
  return {
2068
2341
  top: e,
2069
2342
  right: e,
@@ -2071,135 +2344,135 @@ function Kn(e = 0) {
2071
2344
  left: e
2072
2345
  };
2073
2346
  }
2074
- function X(e = 10) {
2075
- return { padding: Kn(e) };
2347
+ function Z(e = 10) {
2348
+ return { padding: hr(e) };
2076
2349
  }
2077
- function qn(e = {}) {
2078
- return q({
2079
- id: Y(),
2350
+ function gr(e = {}) {
2351
+ return J({
2352
+ id: X(),
2080
2353
  type: "title",
2081
2354
  ...Zt,
2082
- styles: X()
2355
+ styles: Z()
2083
2356
  }, e);
2084
2357
  }
2085
- function Jn(e = {}) {
2086
- return q({
2087
- id: Y(),
2358
+ function _r(e = {}) {
2359
+ return J({
2360
+ id: X(),
2088
2361
  type: "paragraph",
2089
2362
  ...Qt,
2090
- styles: X()
2363
+ styles: Z()
2091
2364
  }, e);
2092
2365
  }
2093
- function Yn(e = {}) {
2094
- return q({
2095
- id: Y(),
2366
+ function vr(e = {}) {
2367
+ return J({
2368
+ id: X(),
2096
2369
  type: "image",
2097
2370
  ...$t,
2098
- styles: X()
2371
+ styles: Z()
2099
2372
  }, e);
2100
2373
  }
2101
- function Xn(e = {}) {
2102
- return q({
2103
- id: Y(),
2374
+ function yr(e = {}) {
2375
+ return J({
2376
+ id: X(),
2104
2377
  type: "button",
2105
2378
  ...en,
2106
- styles: X()
2379
+ styles: Z()
2107
2380
  }, e);
2108
2381
  }
2109
- function Zn(e = {}) {
2110
- return q({
2111
- id: Y(),
2382
+ function br(e = {}) {
2383
+ return J({
2384
+ id: X(),
2112
2385
  type: "divider",
2113
2386
  ...tn,
2114
- styles: X(20)
2387
+ styles: Z(20)
2115
2388
  }, e);
2116
2389
  }
2117
- function Qn(e = {}) {
2118
- return q({
2119
- id: Y(),
2390
+ function xr(e = {}) {
2391
+ return J({
2392
+ id: X(),
2120
2393
  type: "section",
2121
2394
  ...nn,
2122
2395
  children: [[]],
2123
- styles: X(20)
2396
+ styles: Z(20)
2124
2397
  }, e);
2125
2398
  }
2126
- function $n(e = {}) {
2127
- return q({
2128
- id: Y(),
2399
+ function Sr(e = {}) {
2400
+ return J({
2401
+ id: X(),
2129
2402
  type: "video",
2130
2403
  ...rn,
2131
- styles: X()
2404
+ styles: Z()
2132
2405
  }, e);
2133
2406
  }
2134
- function er(e = {}) {
2135
- return q({
2136
- id: Y(),
2407
+ function Cr(e = {}) {
2408
+ return J({
2409
+ id: X(),
2137
2410
  type: "social",
2138
2411
  icons: [],
2139
2412
  ...an,
2140
- styles: X()
2413
+ styles: Z()
2141
2414
  }, e);
2142
2415
  }
2143
- function tr(e = {}) {
2144
- return q({
2145
- id: Y(),
2416
+ function wr(e = {}) {
2417
+ return J({
2418
+ id: X(),
2146
2419
  type: "spacer",
2147
2420
  ...on,
2148
- styles: X(0)
2421
+ styles: Z(0)
2149
2422
  }, e);
2150
2423
  }
2151
- function nr(e = {}) {
2152
- return q({
2153
- id: Y(),
2424
+ function Tr(e = {}) {
2425
+ return J({
2426
+ id: X(),
2154
2427
  type: "html",
2155
2428
  ...sn,
2156
- styles: X()
2429
+ styles: Z()
2157
2430
  }, e);
2158
2431
  }
2159
- function rr(e = {}) {
2160
- return q({
2161
- id: Y(),
2432
+ function Er(e = {}) {
2433
+ return J({
2434
+ id: X(),
2162
2435
  type: "menu",
2163
2436
  items: [],
2164
2437
  ...cn,
2165
- styles: X()
2438
+ styles: Z()
2166
2439
  }, e);
2167
2440
  }
2168
- function ir(e, t) {
2441
+ function Dr(e, t) {
2169
2442
  return Array.from({ length: t }, () => ({
2170
- id: Y(),
2443
+ id: X(),
2171
2444
  cells: Array.from({ length: e }, () => ({
2172
- id: Y(),
2445
+ id: X(),
2173
2446
  content: ""
2174
2447
  }))
2175
2448
  }));
2176
2449
  }
2177
- function ar(e = {}) {
2178
- return q({
2179
- id: Y(),
2450
+ function Or(e = {}) {
2451
+ return J({
2452
+ id: X(),
2180
2453
  type: "table",
2181
- rows: ir(3, 3),
2454
+ rows: Dr(3, 3),
2182
2455
  ...ln,
2183
- styles: X()
2456
+ styles: Z()
2184
2457
  }, e);
2185
2458
  }
2186
- function or(e = {}) {
2187
- return q({
2188
- id: Y(),
2459
+ function kr(e = {}) {
2460
+ return J({
2461
+ id: X(),
2189
2462
  type: "countdown",
2190
2463
  ...un,
2191
- styles: X()
2464
+ styles: Z()
2192
2465
  }, e);
2193
2466
  }
2194
- function sr(e) {
2467
+ function Ar(e) {
2195
2468
  return e.type === "repeatable" ? e.default ?? [] : e.type === "boolean" ? e.default ?? !1 : e.type === "number" ? e.default ?? 0 : e.default ?? "";
2196
2469
  }
2197
- function cr(e) {
2470
+ function jr(e) {
2198
2471
  let t = {};
2199
- for (let n of e.fields) t[n.key] = J(sr(n));
2200
- let n = q(X(), J(e.defaultStyles));
2472
+ for (let n of e.fields) t[n.key] = Y(Ar(n));
2473
+ let n = J(Z(), Y(e.defaultStyles));
2201
2474
  return {
2202
- id: Y(),
2475
+ id: X(),
2203
2476
  type: "custom",
2204
2477
  customType: e.type,
2205
2478
  fieldValues: t,
@@ -2207,42 +2480,42 @@ function cr(e) {
2207
2480
  ...e.dataSource ? { dataSourceFetched: !1 } : {}
2208
2481
  };
2209
2482
  }
2210
- function lr() {
2483
+ function Mr() {
2211
2484
  return {
2212
- id: Y(),
2485
+ id: X(),
2213
2486
  type: "slot",
2214
- styles: X(0)
2487
+ styles: Z(0)
2215
2488
  };
2216
2489
  }
2217
- function ur(e = {}) {
2218
- return q({
2219
- id: Y(),
2490
+ function Nr(e = {}) {
2491
+ return J({
2492
+ id: X(),
2220
2493
  type: "wrapper",
2221
2494
  children: [],
2222
- styles: X(0)
2495
+ styles: Z(0)
2223
2496
  }, e);
2224
2497
  }
2225
- function dr(e, t) {
2498
+ function Pr(e, t) {
2226
2499
  switch (e) {
2227
- case "section": return Qn(J(t?.section));
2228
- case "title": return qn(J(t?.title));
2229
- case "paragraph": return Jn(J(t?.paragraph));
2230
- case "image": return Yn(J(t?.image));
2231
- case "button": return Xn(J(t?.button));
2232
- case "divider": return Zn(J(t?.divider));
2233
- case "video": return $n(J(t?.video));
2234
- case "social": return er(J(t?.social));
2235
- case "spacer": return tr(J(t?.spacer));
2236
- case "html": return nr(J(t?.html));
2237
- case "menu": return rr(J(t?.menu));
2238
- case "table": return ar(J(t?.table));
2239
- case "countdown": return or(J(t?.countdown));
2500
+ case "section": return xr(Y(t?.section));
2501
+ case "title": return gr(Y(t?.title));
2502
+ case "paragraph": return _r(Y(t?.paragraph));
2503
+ case "image": return vr(Y(t?.image));
2504
+ case "button": return yr(Y(t?.button));
2505
+ case "divider": return br(Y(t?.divider));
2506
+ case "video": return Sr(Y(t?.video));
2507
+ case "social": return Cr(Y(t?.social));
2508
+ case "spacer": return wr(Y(t?.spacer));
2509
+ case "html": return Tr(Y(t?.html));
2510
+ case "menu": return Er(Y(t?.menu));
2511
+ case "table": return Or(Y(t?.table));
2512
+ case "countdown": return kr(Y(t?.countdown));
2240
2513
  case "slot": throw Error("[Templatical] slot cannot be inserted into content. Use createSlotBlock() to build a layout.");
2241
2514
  case "wrapper": throw Error("[Templatical] wrapper cannot be inserted into content. Use createWrapperBlock() to build a layout.");
2242
2515
  default: throw Error(`Unknown block type: ${e}`);
2243
2516
  }
2244
2517
  }
2245
- function fr(e, t) {
2518
+ function Fr(e, t) {
2246
2519
  let n = e.l10n;
2247
2520
  if (!n || t.size === 0) return;
2248
2521
  let r = (n) => {
@@ -2257,12 +2530,12 @@ function fr(e, t) {
2257
2530
  n && (e[t] = Object.fromEntries(Object.entries(n).map(([e, t]) => [r(e), t])));
2258
2531
  }
2259
2532
  }
2260
- function Z(e) {
2533
+ function Q(e) {
2261
2534
  let t = JSON.parse(JSON.stringify(e));
2262
- t.id = Y();
2535
+ t.id = X();
2263
2536
  let n = /* @__PURE__ */ new Map(), r = (e, t) => {
2264
2537
  let r = e.id;
2265
- e.id = Y();
2538
+ e.id = X();
2266
2539
  let i = n.get(t);
2267
2540
  return i || (i = /* @__PURE__ */ new Map(), n.set(t, i)), i.set(r, e.id), r;
2268
2541
  };
@@ -2272,52 +2545,52 @@ function Z(e) {
2272
2545
  }
2273
2546
  if (t.type === "menu") for (let e of t.items) r(e, "items");
2274
2547
  if (t.type === "social") for (let e of t.icons) r(e, "icons");
2275
- return t.type === "section" && (t.children = t.children.map((e) => e.map((e) => Z(e)))), t.type === "wrapper" && (t.children = t.children.map((e) => Z(e))), fr(t, n), t;
2548
+ return t.type === "section" && (t.children = t.children.map((e) => e.map((e) => Q(e)))), t.type === "wrapper" && (t.children = t.children.map((e) => Q(e))), Fr(t, n), t;
2276
2549
  }
2277
2550
  // ../types/src/layout.ts
2278
- var pr = "[Templatical] layout: must contain exactly one slot block", mr = "[Templatical] layout: slot must be a top-level or wrapper child, not nested in a section", hr = "[Templatical] layout: a wrapper cannot contain a wrapper", gr = "[Templatical] layout: a wrapper around the slot cannot contain blocks that emit mj-wrapper (section.wrapper)", _r = "[Templatical] slot is not a valid content block", vr = "[Templatical] wrapper is not a valid content block";
2279
- function Q(e, t, n = null, r = !1) {
2280
- for (let i of e) if (t(i, n, r), Lt(i)) for (let e of i.children) Q(e, t, i, !0);
2281
- else H(i) && Q(i.children, t, i, r);
2551
+ var Ir = "[Templatical] layout: must contain exactly one slot block", Lr = "[Templatical] layout: slot must be a top-level or wrapper child, not nested in a section", Rr = "[Templatical] layout: a wrapper cannot contain a wrapper", zr = "[Templatical] layout: a wrapper around the slot cannot contain blocks that emit mj-wrapper (section.wrapper)", Br = "[Templatical] slot is not a valid content block", Vr = "[Templatical] wrapper is not a valid content block";
2552
+ function $(e, t, n = null, r = !1) {
2553
+ for (let i of e) if (t(i, n, r), Lt(i)) for (let e of i.children) $(e, t, i, !0);
2554
+ else H(i) && $(i.children, t, i, r);
2282
2555
  }
2283
- function yr(e) {
2556
+ function Hr(e) {
2284
2557
  let t = 0;
2285
- if (Q(e.blocks, (e, n, r) => {
2286
- if (V(e) && (t += 1, r)) throw Error(mr);
2558
+ if ($(e.blocks, (e, n, r) => {
2559
+ if (V(e) && (t += 1, r)) throw Error(Lr);
2287
2560
  if (H(e)) {
2288
- if (r) throw Error(mr);
2289
- if (e.children.some(H)) throw Error(hr);
2561
+ if (r) throw Error(Lr);
2562
+ if (e.children.some(H)) throw Error(Rr);
2290
2563
  }
2291
- }), t !== 1) throw Error(pr);
2564
+ }), t !== 1) throw Error(Ir);
2292
2565
  }
2293
- function br(e) {
2294
- Q(e.blocks, (e) => {
2295
- if (V(e)) throw Error(_r);
2566
+ function Ur(e) {
2567
+ $(e.blocks, (e) => {
2568
+ if (V(e)) throw Error(Br);
2296
2569
  });
2297
2570
  }
2298
- function xr(e) {
2299
- Q(e.blocks, (e) => {
2300
- if (H(e)) throw Error(vr);
2571
+ function Wr(e) {
2572
+ $(e.blocks, (e) => {
2573
+ if (H(e)) throw Error(Vr);
2301
2574
  });
2302
2575
  }
2303
- function Sr(e) {
2576
+ function Gr(e) {
2304
2577
  let t = !1;
2305
- return Q(e.blocks, (e, n) => {
2578
+ return $(e.blocks, (e, n) => {
2306
2579
  V(e) && n !== null && H(n) && (t = !0);
2307
2580
  }), t;
2308
2581
  }
2309
- function Cr(e) {
2582
+ function Kr(e) {
2310
2583
  if (V(e)) return e;
2311
2584
  if (H(e)) {
2312
- let t = Z({
2585
+ let t = Q({
2313
2586
  ...e,
2314
2587
  children: []
2315
2588
  });
2316
- return t.children = e.children.map(Cr), t;
2589
+ return t.children = e.children.map(Kr), t;
2317
2590
  }
2318
- return Z(e);
2591
+ return Q(e);
2319
2592
  }
2320
- function wr(e) {
2593
+ function qr(e) {
2321
2594
  for (let t = 0; t < e.length; t++) {
2322
2595
  let n = e[t];
2323
2596
  if (V(n)) return {
@@ -2325,33 +2598,33 @@ function wr(e) {
2325
2598
  index: t
2326
2599
  };
2327
2600
  if (H(n)) {
2328
- let e = wr(n.children);
2601
+ let e = qr(n.children);
2329
2602
  if (e) return e;
2330
2603
  }
2331
2604
  }
2332
2605
  return null;
2333
2606
  }
2334
- function Tr(e) {
2607
+ function Jr(e) {
2335
2608
  for (let t of e) if (Lt(t)) {
2336
2609
  if (t.wrapper) return !0;
2337
- for (let e of t.children) if (Tr(e)) return !0;
2610
+ for (let e of t.children) if (Jr(e)) return !0;
2338
2611
  }
2339
2612
  return !1;
2340
2613
  }
2341
- function Er(e, t) {
2342
- if (yr(e), br(t), xr(t), Sr(e) && Tr(t.blocks)) throw Error(gr);
2343
- let n = e.blocks.map(Cr), r = wr(n);
2344
- if (!r) throw Error(pr);
2345
- return r.parent.splice(r.index, 1, ...p(t.blocks)), {
2614
+ function Yr(e, t) {
2615
+ if (Hr(e), Ur(t), Wr(t), Gr(e) && Jr(t.blocks)) throw Error(zr);
2616
+ let n = e.blocks.map(Kr), r = qr(n);
2617
+ if (!r) throw Error(Ir);
2618
+ return r.parent.splice(r.index, 1, ...m(t.blocks)), {
2346
2619
  blocks: n,
2347
2620
  settings: {
2348
- ...p(t.settings),
2621
+ ...m(t.settings),
2349
2622
  backgroundColor: e.settings.backgroundColor
2350
2623
  }
2351
2624
  };
2352
2625
  }
2353
2626
  // ../types/src/url-policy.ts
2354
- var Dr = Object.freeze([
2627
+ var Xr = Object.freeze([
2355
2628
  "http",
2356
2629
  "https",
2357
2630
  "mailto",
@@ -2361,44 +2634,44 @@ var Dr = Object.freeze([
2361
2634
  "sms",
2362
2635
  "xmpp",
2363
2636
  "cid"
2364
- ]), Or = Object.freeze([
2637
+ ]), Zr = Object.freeze([
2365
2638
  "javascript",
2366
2639
  "data",
2367
2640
  "vbscript"
2368
2641
  ]);
2369
- function kr(e) {
2642
+ function Qr(e) {
2370
2643
  return e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
2371
2644
  }
2372
- function Ar(e) {
2373
- let t = /^([a-z][a-z0-9+.-]*):/i.exec(kr(e));
2645
+ function $r(e) {
2646
+ let t = /^([a-z][a-z0-9+.-]*):/i.exec(Qr(e));
2374
2647
  return t ? t[1].toLowerCase() : null;
2375
2648
  }
2376
- var jr = /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i, Mr = Object.freeze([
2649
+ var ei = /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i, ti = Object.freeze([
2377
2650
  "href",
2378
2651
  "xlink:href",
2379
2652
  "background",
2380
2653
  "poster",
2381
2654
  "src"
2382
- ]), Nr = Object.freeze([
2655
+ ]), ni = Object.freeze([
2383
2656
  "srcdoc",
2384
2657
  "ping",
2385
2658
  "formaction",
2386
2659
  "action"
2387
2660
  ]);
2388
- function Pr(e, t) {
2389
- let n = kr(e), r = Ar(n);
2390
- return r === null || Dr.some((e) => e === r) ? !0 : t.toLowerCase() === "src" && jr.test(n);
2661
+ function ri(e, t) {
2662
+ let n = Qr(e), r = $r(n);
2663
+ return r === null || Xr.some((e) => e === r) ? !0 : t.toLowerCase() === "src" && ei.test(n);
2391
2664
  }
2392
2665
  // ../types/src/rich-text.ts
2393
- var Fr = /<\/?p\b[^<>]*>/gi, Ir = /<p\b([^<>]*)>\s*<\/p>/gi;
2394
- function Lr(e) {
2395
- return e.replace(Fr, "").trim() === "";
2666
+ var ii = /<\/?p\b[^<>]*>/gi, ai = /<p\b([^<>]*)>\s*<\/p>/gi;
2667
+ function oi(e) {
2668
+ return e.replace(ii, "").trim() === "";
2396
2669
  }
2397
- function Rr(e) {
2398
- return Lr(e) ? e : e.replace(Ir, "<p$1>&nbsp;</p>");
2670
+ function si(e) {
2671
+ return oi(e) ? e : e.replace(ai, "<p$1>&nbsp;</p>");
2399
2672
  }
2400
2673
  // ../types/src/fonts.ts
2401
- var zr = {
2674
+ var ci = {
2402
2675
  arial: "Arial, sans-serif",
2403
2676
  helvetica: "Helvetica, sans-serif",
2404
2677
  georgia: "Georgia, serif",
@@ -2407,13 +2680,13 @@ var zr = {
2407
2680
  "trebuchet ms": "'Trebuchet MS', sans-serif",
2408
2681
  "courier new": "'Courier New', monospace",
2409
2682
  tahoma: "Tahoma, sans-serif"
2410
- }, Br = /* @__PURE__ */ new Set([
2683
+ }, li = /* @__PURE__ */ new Set([
2411
2684
  "inherit",
2412
2685
  "initial",
2413
2686
  "unset",
2414
2687
  "revert",
2415
2688
  "revert-layer"
2416
- ]), Vr = /* @__PURE__ */ new Set([
2689
+ ]), ui = /* @__PURE__ */ new Set([
2417
2690
  "serif",
2418
2691
  "sans-serif",
2419
2692
  "monospace",
@@ -2428,14 +2701,14 @@ var zr = {
2428
2701
  "math",
2429
2702
  "fangsong"
2430
2703
  ]);
2431
- function Hr(e) {
2704
+ function di(e) {
2432
2705
  return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
2433
2706
  }
2434
- function Ur(e) {
2707
+ function fi(e) {
2435
2708
  if (typeof e != "string") return [];
2436
2709
  let t = e.replace(/!\s*important\s*$/i, ""), n = [], r = 0;
2437
2710
  for (;;) {
2438
- for (; r < t.length && Hr(t[r]);) r++;
2711
+ for (; r < t.length && di(t[r]);) r++;
2439
2712
  if (r >= t.length) return [];
2440
2713
  let e = t[r];
2441
2714
  if (e === "\"" || e === "'") {
@@ -2452,7 +2725,7 @@ function Ur(e) {
2452
2725
  }
2453
2726
  }
2454
2727
  if (!o) return [];
2455
- for (; a < t.length && Hr(t[a]);) a++;
2728
+ for (; a < t.length && di(t[a]);) a++;
2456
2729
  if (a < t.length && t[a] !== ",") return [];
2457
2730
  n.push({
2458
2731
  name: i,
@@ -2460,7 +2733,7 @@ function Ur(e) {
2460
2733
  }), r = a;
2461
2734
  } else {
2462
2735
  let e = t.indexOf(",", r), i = e === -1 ? t.length : e, a = t.slice(r, i).trim().split(/\s+/).join(" ");
2463
- if (a === "" || a.includes("\"") || a.includes("'") || Br.has(a.toLowerCase())) return [];
2736
+ if (a === "" || a.includes("\"") || a.includes("'") || li.has(a.toLowerCase())) return [];
2464
2737
  n.push({
2465
2738
  name: a,
2466
2739
  quoted: !1
@@ -2470,150 +2743,27 @@ function Ur(e) {
2470
2743
  r++;
2471
2744
  }
2472
2745
  }
2473
- function Wr(e) {
2746
+ function pi(e) {
2474
2747
  return `'${e.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
2475
2748
  }
2476
- function Gr(e) {
2477
- return !e.quoted && Vr.has(e.name.toLowerCase());
2749
+ function mi(e) {
2750
+ return !e.quoted && ui.has(e.name.toLowerCase());
2478
2751
  }
2479
- function Kr(e) {
2480
- return Ur(e)[0]?.name ?? "";
2752
+ function hi(e) {
2753
+ return fi(e)[0]?.name ?? "";
2481
2754
  }
2482
- function qr(e, t) {
2483
- let n = (e) => `${Wr(e.name)}, ${e.fallback ?? t.defaultFallback}`, r = typeof e == "string" ? e.trim().toLowerCase() : "", i = t.customFonts.find((e) => e.name.toLowerCase() === r);
2755
+ function gi(e, t) {
2756
+ let n = (e) => `${pi(e.name)}, ${e.fallback ?? t.defaultFallback}`, r = typeof e == "string" ? e.trim().toLowerCase() : "", i = t.customFonts.find((e) => e.name.toLowerCase() === r);
2484
2757
  if (i) return n(i);
2485
- let a = Ur(e);
2758
+ let a = fi(e);
2486
2759
  if (a.length !== 1) return e;
2487
2760
  let [o] = a, s = o.name.toLowerCase(), c = t.customFonts.find((e) => e.name.toLowerCase() === s);
2488
- return c ? n(c) : zr[s] || (Gr(o) ? e : `${Wr(o.name)}, ${t.defaultFallback}`);
2489
- }
2490
- // ../types/src/merge-tags.ts
2491
- var $ = {
2492
- liquid: {
2493
- value: /\{\{.+?\}\}/g,
2494
- logic: /\{%-?\s*(\w+).*?-?%\}/g,
2495
- opener: "{{",
2496
- closer: "}}"
2497
- },
2498
- handlebars: {
2499
- value: /\{\{\{?.+?\}?\}\}/g,
2500
- logic: /\{\{[#/](\w+).*?\}\}/g,
2501
- opener: "{{",
2502
- closer: "}}"
2503
- },
2504
- mailchimp: {
2505
- value: /\*\|\w+\|\*/g,
2506
- logic: /\*\|(\w+)[:|].*?\|\*/g,
2507
- opener: "*|",
2508
- closer: "|*"
2509
- },
2510
- ampscript: {
2511
- value: /%%=.+?=%%/g,
2512
- logic: /%%\[\s*(\w+).*?\]%%/g,
2513
- opener: "%%=",
2514
- closer: "=%%"
2515
- }
2516
- };
2517
- function Jr(e) {
2518
- return typeof e == "string" && e.trim() !== "" ? e : null;
2519
- }
2520
- function Yr(e) {
2521
- return Object.values($).find((t) => t.value.source === e.value.source) ?? null;
2522
- }
2523
- function Xr(e) {
2524
- return Jr(e.opener) ?? Yr(e)?.opener ?? null;
2525
- }
2526
- function Zr(e) {
2527
- return Jr(e.closer) ?? Yr(e)?.closer ?? null;
2528
- }
2529
- function Qr(e) {
2530
- return e ? typeof e == "string" ? $[e] ?? $.liquid : e : $.liquid;
2531
- }
2532
- function $r(e) {
2533
- let t = e.source, n = e.flags.replace("g", "");
2534
- return RegExp(`^${t}$`, n);
2535
- }
2536
- function ei(e, t) {
2537
- let n = e?.trim() || "";
2538
- return !$r(t.logic).test(n) && $r(t.value).test(n);
2539
- }
2540
- function ti(e, t) {
2541
- let n = t.find((t) => t.value === e);
2542
- return n ? n.label : e;
2543
- }
2544
- function ni(e, t) {
2545
- return fi(e, "data-merge-tag", (e) => ti(e, t));
2546
- }
2547
- function ri(e, t) {
2548
- return t.find((t) => t.value === e)?.sample;
2549
- }
2550
- function ii(e, t) {
2551
- return fi(e, "data-merge-tag", (e) => si(ri(e, t) ?? ti(e, t)), { unwrap: (e) => ri(e, t) !== void 0 });
2552
- }
2553
- function ai(e) {
2554
- return e.some((e) => e.sample !== void 0);
2555
- }
2556
- function oi(e, t) {
2557
- if (!e) return e;
2558
- let n = e;
2559
- for (let e of t) e.sample !== void 0 && (n = n.split(e.value).join(e.sample));
2560
- return n;
2561
- }
2562
- function si(e) {
2563
- return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
2564
- }
2565
- function ci(e, t) {
2566
- if (!e) return !1;
2567
- let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
2568
- return n.test(e) || r.test(e);
2569
- }
2570
- function li(e, t) {
2571
- return $r(t.logic).test(e?.trim() || "");
2572
- }
2573
- function ui(e, t) {
2574
- let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
2575
- return r && r[1] ? r[1].toUpperCase() : e;
2576
- }
2577
- function di(e, t) {
2578
- return fi(e, "data-logic-merge-tag", (e) => ui(e, t));
2579
- }
2580
- function fi(e, t, n, r) {
2581
- let i = "", a = 0;
2582
- for (; a < e.length;) {
2583
- let o = e.indexOf("<span", a);
2584
- if (o === -1) {
2585
- i += e.substring(a);
2586
- break;
2587
- }
2588
- let s = e[o + 5];
2589
- if (s !== ">" && s !== " " && s !== " " && s !== "\n" && s !== "\r" && s !== "/") {
2590
- i += e.substring(a, o + 5), a = o + 5;
2591
- continue;
2592
- }
2593
- let c = U(e, o + 5);
2594
- if (c === -1) {
2595
- i += e.substring(a);
2596
- break;
2597
- }
2598
- let l = e.indexOf("</span>", c + 1);
2599
- if (l === -1) {
2600
- i += e.substring(a);
2601
- break;
2602
- }
2603
- let u = Cn(e.substring(o + 5, c), t);
2604
- if (u === null) {
2605
- i += e.substring(a, o + 5), a = o + 5;
2606
- continue;
2607
- }
2608
- let d = n(u);
2609
- r?.unwrap?.(u) ? (i += e.substring(a, o), i += d) : (i += e.substring(a, c + 1), i += d, i += "</span>"), a = l + 7;
2610
- }
2611
- return i;
2761
+ return c ? n(c) : ci[s] || (mi(o) ? e : `${pi(o.name)}, ${t.defaultFallback}`);
2612
2762
  }
2613
2763
  // ../types/src/preview-resolution.ts
2614
- function pi(e) {
2764
+ function _i(e) {
2615
2765
  return typeof e != "object" || !e ? !1 : Array.isArray(e.blocks);
2616
2766
  }
2617
- export { An as $, m as $t, xr as A, Pt as At, Yn as B, _ as Bt, Nr as C, Wt as Ct, Pr as D, Ut as Dt, Ar as E, Rt as Et, Xn as F, Ie as Ft, er as G, Ee as Gt, Jn as H, S as Ht, or as I, h as It, qn as J, v as Jt, tr as K, y as Kt, cr as L, Me as Lt, yr as M, Le as Mt, Z as N, D as Nt, Er as O, H as Ot, dr as P, Fe as Pt, Gn as Q, ge as Qt, Zn as R, T as Rt, Or as S, V as St, Dr as T, Jt as Tt, Qn as U, Ae as Ut, rr as V, Se as Vt, lr as W, je as Wt, ur as X, C as Xt, $n as Y, ke as Yt, Y as Z, x as Zt, Kr as _, c as _n, Kt as _t, ti as a, fe as an, G as at, Rr as b, o as bn, zt as bt, Xr as c, d as cn, vn as ct, ei as d, te as dn, fn as dt, p as en, Wn as et, di as f, ne as fn, mn as ft, oi as g, l as gn, Ht as gt, ii as h, s as hn, Xt as ht, ui as i, pe as in, Tn as it, Sr as j, E as jt, br as k, It as kt, ai as l, f as ln, hn as lt, Qr as m, e as mn, Yt as mt, $ as n, de as nn, Bn as nt, ri as o, oe as on, U as ot, ni as p, i as pn, Vt as pt, ar as q, Ce as qt, ci as r, ue as rn, wn as rt, Zr as s, ie as sn, yn as st, pi as t, se as tn, Un as tt, li as u, ee as un, dn as ut, Ur as v, n as vn, Bt as vt, Mr as w, Gt as wt, Lr as x, t as xn, Lt as xt, qr as y, r as yn, qt as yt, nr as z, ve as zt };
2767
+ export { Hn as $, S as $t, Cr as A, H as At, fr as B, w as Bt, br as C, t as Cn, Lt as Ct, _r as D, Jt as Dt, Er as E, Gt as Et, Nr as F, E as Ft, Vn as G, je as Gt, G as H, v as Ht, X as I, Ie as It, In as J, b as Jt, Un as K, Me as Kt, mr as L, Le as Lt, Or as M, Pt as Mt, gr as N, T as Nt, xr as O, Rt as Ot, Sr as P, Re as Pt, Zn as Q, C as Qt, $n as R, g as Rt, jr as S, o as Sn, zt as St, vr as T, Wt as Tt, Jn as U, xe as Ut, lr as V, _e as Vt, Xn as W, we as Wt, Yn as X, y as Xt, Gn as Y, Se as Yt, Bn as Z, Ae as Zt, Hr as _, s as _n, Xt as _t, si as a, le as an, En as at, yr as b, n as bn, Bt as bt, ni as c, ae as cn, xn as ct, $r as d, f as dn, hn as dt, he as en, Rn as et, ri as f, p as fn, dn as ft, Gr as g, e as gn, Yt as gt, Wr as h, i as hn, Vt as ht, gi as i, ue as in, Kn as it, wr as j, It as jt, Mr as k, Ut as kt, ti as l, re as ln, yn as lt, Ur as m, te as mn, mn as mt, hi as n, m as nn, K as nt, oi as o, fe as on, Dn as ot, Yr as p, ee as pn, fn as pt, Ln as q, De as qt, fi as r, oe as rn, Wn as rt, Zr as s, de as sn, W as st, _i as t, h as tn, Nn as tt, Xr as u, d as un, vn as ut, Q as v, l as vn, Ht as vt, Tr as w, V as wt, kr as x, r as xn, qt as xt, Pr as y, c as yn, Kt as yt, pr as z, Ne as zt };
2618
2768
 
2619
- //# sourceMappingURL=src-ZFw5fg_z.js.map
2769
+ //# sourceMappingURL=src-v47QHNmB.js.map