@templatical/editor 0.54.1 → 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 (172) hide show
  1. package/dist/{AiAltTextPopover-NMJqQKvD.js → AiAltTextPopover-D5QosKvB.js} +1 -1
  2. package/dist/{AiAltTextReview-Ci4zHwRc.js → AiAltTextReview-D1W_lrI_.js} +1 -1
  3. package/dist/{AiRewriteMenu-arKoTjsQ.js → AiRewriteMenu-BwztoMov.js} +4 -4
  4. package/dist/{BlockPreviewCanvas-BTieuBmH.js → BlockPreviewCanvas-C23A6FRm.js} +6 -6
  5. package/dist/{CloudPanels-Hxdp0doU.js → CloudPanels-Baoaj6Xf.js} +1 -1
  6. package/dist/{CountdownToolbar-CM4XNEuO.js → CountdownToolbar-CA_gDIdZ.js} +4 -4
  7. package/dist/{IssuesPanel-1wGV0wiy.js → IssuesPanel-nmFhWG1p.js} +1 -1
  8. package/dist/{LanguageMenu-BpxbIJEx.js → LanguageMenu-DcABUYop.js} +5 -5
  9. package/dist/{LogicTagInsertButton-DgTJ6Lvx.js → LogicTagInsertButton-qZ82VMFx.js} +284 -279
  10. package/dist/{MergeTagInput-B_51YcQO.js → MergeTagInput-JJeZbFkD.js} +1 -1
  11. package/dist/{MergeTagModeToggle-D3Q2z317.js → MergeTagModeToggle-DDucd1eC.js} +1 -1
  12. package/dist/{MergeTagTextarea-DZz1L9DE.js → MergeTagTextarea-dQ2LRrNB.js} +2 -2
  13. package/dist/{ParagraphEditor-B38t4E2p.js → ParagraphEditor-VXYwGoz_.js} +8 -8
  14. package/dist/{RestoreVersionDialog-n7FSmWXB.js → RestoreVersionDialog-BibNvAaJ.js} +1 -1
  15. package/dist/{RichTextEditorContent-Dstovi0m.js → RichTextEditorContent-CU5EOlM_.js} +2 -2
  16. package/dist/{SaveBlockDialog-B94NpmDV.js → SaveBlockDialog-S9aFi0cy.js} +4 -4
  17. package/dist/{SavedBlocksBrowserModal-C1vSc8iM.js → SavedBlocksBrowserModal-DIdn6B0J.js} +4 -4
  18. package/dist/{SavedBlocksPanels-DLDmIYeL.js → SavedBlocksPanels-Cme2M6u8.js} +1 -1
  19. package/dist/{SavedBlocksPickBar-ngf2sFEs.js → SavedBlocksPickBar-BDmA7r3m.js} +1 -1
  20. package/dist/{TemplateSettings-Baar78_s.js → TemplateSettings-C_LHLm5M.js} +4 -4
  21. package/dist/{TestEmailModal-CB_9I1bl.js → TestEmailModal-CLIRn7eL.js} +5 -5
  22. package/dist/{TestEmailPanel-BUq-dbXQ.js → TestEmailPanel-frdtjC8h.js} +1 -1
  23. package/dist/{TitleEditor-BLP41rwy.js → TitleEditor-D5kC56Jl.js} +4 -4
  24. package/dist/{Toolbar-bOZ_eq7X.js → Toolbar-D904Yw_R.js} +747 -699
  25. package/dist/{TplModal-DFKqmJQz.js → TplModal-BBdotDf1.js} +1 -1
  26. package/dist/{VersionHistoryPanels-DPxj3mec.js → VersionHistoryPanels-DhagEgOk.js} +1 -1
  27. package/dist/{WrapperBlock-BdVIuGMR.js → WrapperBlock-BAT3T0Cz.js} +3 -3
  28. package/dist/{blockTypeIcons-BUyPZ7Su.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-Cnc_kUmb.js → AiAltTextPopover-CUGOPuRo.js} +2 -2
  32. package/dist/cdn/chunks/{AiAltTextPopover-Cnc_kUmb.js.map → AiAltTextPopover-CUGOPuRo.js.map} +1 -1
  33. package/dist/cdn/chunks/{AiAltTextReview-DPeSY-7r.js → AiAltTextReview-B9vm_L-8.js} +2 -2
  34. package/dist/cdn/chunks/{AiAltTextReview-DPeSY-7r.js.map → AiAltTextReview-B9vm_L-8.js.map} +1 -1
  35. package/dist/cdn/chunks/{AiRewriteMenu-YcVFv6RS.js → AiRewriteMenu-BvV_7tNZ.js} +7 -7
  36. package/dist/cdn/chunks/{AiRewriteMenu-YcVFv6RS.js.map → AiRewriteMenu-BvV_7tNZ.js.map} +1 -1
  37. package/dist/cdn/chunks/{BlockPreviewCanvas-6ck15xz9.js → BlockPreviewCanvas-Dr-xGq6v.js} +7 -7
  38. package/dist/cdn/chunks/{BlockPreviewCanvas-6ck15xz9.js.map → BlockPreviewCanvas-Dr-xGq6v.js.map} +1 -1
  39. package/dist/cdn/chunks/{CloudPanels-BHHpNckC.js → CloudPanels-CQ0vNgsH.js} +2 -2
  40. package/dist/cdn/chunks/{CloudPanels-BHHpNckC.js.map → CloudPanels-CQ0vNgsH.js.map} +1 -1
  41. package/dist/cdn/chunks/{CountdownToolbar-CNgsNL5-.js → CountdownToolbar-BxW-J7DX.js} +5 -5
  42. package/dist/cdn/chunks/{CountdownToolbar-CNgsNL5-.js.map → CountdownToolbar-BxW-J7DX.js.map} +1 -1
  43. package/dist/cdn/chunks/{IssuesPanel-Duic0mIs.js → IssuesPanel-BoHeIjvw.js} +3 -3
  44. package/dist/cdn/chunks/{IssuesPanel-Duic0mIs.js.map → IssuesPanel-BoHeIjvw.js.map} +1 -1
  45. package/dist/cdn/chunks/{LanguageMenu-C6utRx_4.js → LanguageMenu-BnYN5N1h.js} +7 -7
  46. package/dist/cdn/chunks/{LanguageMenu-C6utRx_4.js.map → LanguageMenu-BnYN5N1h.js.map} +1 -1
  47. package/dist/cdn/chunks/{LogicTagInsertButton-Bhvi0nWz.js → LogicTagInsertButton-Bt2PXbQ0.js} +255 -250
  48. package/dist/cdn/chunks/LogicTagInsertButton-Bt2PXbQ0.js.map +1 -0
  49. package/dist/cdn/chunks/{MergeTagInput-CrhZm-AW.js → MergeTagInput-BELdMRni.js} +2 -2
  50. package/dist/cdn/chunks/{MergeTagInput-CrhZm-AW.js.map → MergeTagInput-BELdMRni.js.map} +1 -1
  51. package/dist/cdn/chunks/{MergeTagModeToggle-CWVtXLYa.js → MergeTagModeToggle-DKfMDIEF.js} +2 -2
  52. package/dist/cdn/chunks/{MergeTagModeToggle-CWVtXLYa.js.map → MergeTagModeToggle-DKfMDIEF.js.map} +1 -1
  53. package/dist/cdn/chunks/{MergeTagTextarea-hTIBwX0F.js → MergeTagTextarea-w6xen3Xh.js} +5 -5
  54. package/dist/cdn/chunks/{MergeTagTextarea-hTIBwX0F.js.map → MergeTagTextarea-w6xen3Xh.js.map} +1 -1
  55. package/dist/cdn/chunks/{ParagraphEditor-B3EQ0Ai6.js → ParagraphEditor-Cal9hY3U.js} +9 -9
  56. package/dist/cdn/chunks/{ParagraphEditor-B3EQ0Ai6.js.map → ParagraphEditor-Cal9hY3U.js.map} +1 -1
  57. package/dist/cdn/chunks/{RestoreVersionDialog-DfNrVi0R.js → RestoreVersionDialog-f_ulmASY.js} +2 -2
  58. package/dist/cdn/chunks/{RestoreVersionDialog-DfNrVi0R.js.map → RestoreVersionDialog-f_ulmASY.js.map} +1 -1
  59. package/dist/cdn/chunks/{RichTextEditorContent-up4AqL7D.js → RichTextEditorContent-C_v0kS4A.js} +3 -3
  60. package/dist/cdn/chunks/{RichTextEditorContent-up4AqL7D.js.map → RichTextEditorContent-C_v0kS4A.js.map} +1 -1
  61. package/dist/cdn/chunks/{SaveBlockDialog-BqglcKcN.js → SaveBlockDialog-C6N9RFls.js} +5 -5
  62. package/dist/cdn/chunks/{SaveBlockDialog-BqglcKcN.js.map → SaveBlockDialog-C6N9RFls.js.map} +1 -1
  63. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BewXGlrK.js → SavedBlocksBrowserModal-Bl2sl09D.js} +4 -4
  64. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BewXGlrK.js.map → SavedBlocksBrowserModal-Bl2sl09D.js.map} +1 -1
  65. package/dist/cdn/chunks/{SavedBlocksPanels-0ZpX-jXI.js → SavedBlocksPanels-DqVcmEUK.js} +2 -2
  66. package/dist/cdn/chunks/{SavedBlocksPanels-0ZpX-jXI.js.map → SavedBlocksPanels-DqVcmEUK.js.map} +1 -1
  67. package/dist/cdn/chunks/{SavedBlocksPickBar-DHah-Uf7.js → SavedBlocksPickBar-DE-J1JVL.js} +2 -2
  68. package/dist/cdn/chunks/{SavedBlocksPickBar-DHah-Uf7.js.map → SavedBlocksPickBar-DE-J1JVL.js.map} +1 -1
  69. package/dist/cdn/chunks/{TemplateSettings-CWUpUKJb.js → TemplateSettings-CpoKZ8oV.js} +5 -5
  70. package/dist/cdn/chunks/{TemplateSettings-CWUpUKJb.js.map → TemplateSettings-CpoKZ8oV.js.map} +1 -1
  71. package/dist/cdn/chunks/{TestEmailModal-7pUDYLrk.js → TestEmailModal-DI3z__Bd.js} +8 -8
  72. package/dist/cdn/chunks/{TestEmailModal-7pUDYLrk.js.map → TestEmailModal-DI3z__Bd.js.map} +1 -1
  73. package/dist/cdn/chunks/{TestEmailPanel-DBWwMsH1.js → TestEmailPanel-Cp5d2YGn.js} +2 -2
  74. package/dist/cdn/chunks/{TestEmailPanel-DBWwMsH1.js.map → TestEmailPanel-Cp5d2YGn.js.map} +1 -1
  75. package/dist/cdn/chunks/{TitleEditor-VAanUjPQ.js → TitleEditor-C2syRLdZ.js} +4 -4
  76. package/dist/cdn/chunks/{TitleEditor-VAanUjPQ.js.map → TitleEditor-C2syRLdZ.js.map} +1 -1
  77. package/dist/cdn/chunks/{Toolbar-BlWVQRcA.js → Toolbar-NEE8qxYh.js} +754 -706
  78. package/dist/cdn/chunks/Toolbar-NEE8qxYh.js.map +1 -0
  79. package/dist/cdn/chunks/{TplModal-DDlR7mk3.js → TplModal-B1MgvtX8.js} +2 -2
  80. package/dist/cdn/chunks/{TplModal-DDlR7mk3.js.map → TplModal-B1MgvtX8.js.map} +1 -1
  81. package/dist/cdn/chunks/{VersionHistoryPanels-DJDeaf1B.js → VersionHistoryPanels-Cefd8i_e.js} +2 -2
  82. package/dist/cdn/chunks/{VersionHistoryPanels-DJDeaf1B.js.map → VersionHistoryPanels-Cefd8i_e.js.map} +1 -1
  83. package/dist/cdn/chunks/{WrapperBlock-DRJnrgy-.js → WrapperBlock-DFY-7YSs.js} +4 -4
  84. package/dist/cdn/chunks/{WrapperBlock-DRJnrgy-.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-Jc3uZuLs.js → composables-nyxwrM27.js} +619 -597
  88. package/dist/cdn/chunks/composables-nyxwrM27.js.map +1 -0
  89. package/dist/cdn/chunks/{createCloudRuntime-C2Zs5F1O.js → createCloudRuntime-DJkDGKQ_.js} +3 -3
  90. package/dist/cdn/chunks/{createCloudRuntime-C2Zs5F1O.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-DcMKZpzh.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/{normalizeMergeTagMarkup-CUCo7B5X.js → cdn/chunks/normalizeMergeTagMarkup-BrGw5jxk.js} +102 -90
  106. package/dist/cdn/chunks/normalizeMergeTagMarkup-BrGw5jxk.js.map +1 -0
  107. package/dist/{preRenderCustomBlocks-Bs3N9no-.js → cdn/chunks/preRenderCustomBlocks-Cj0XYwuh.js} +3 -1
  108. package/dist/cdn/chunks/{preRenderCustomBlocks-f7GEKdvw.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-WTfz9lZd.js → sanitizeHtml-GxJCxKcP.js} +3 -3
  112. package/dist/cdn/chunks/{sanitizeHtml-WTfz9lZd.js.map → sanitizeHtml-GxJCxKcP.js.map} +1 -1
  113. package/dist/cdn/chunks/{socialIcons-DeCYorUT.js → socialIcons-B5zrrV8-.js} +387 -386
  114. package/dist/cdn/chunks/{socialIcons-DeCYorUT.js.map → socialIcons-B5zrrV8-.js.map} +1 -1
  115. package/dist/cdn/chunks/{src-A_cKeTM_.js → src-Diw9SLIe.js} +673 -554
  116. package/dist/cdn/chunks/src-Diw9SLIe.js.map +1 -0
  117. package/dist/cdn/chunks/src-UR3AQocX.js +683 -0
  118. package/dist/cdn/chunks/src-UR3AQocX.js.map +1 -0
  119. package/dist/cdn/chunks/{src-BQUv2CYU.js → src-v47QHNmB.js} +808 -645
  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-aGfnO90D.js.map → useLocalizedDisplay-DekV8qar.js.map} +1 -1
  123. package/dist/cdn/chunks/{useLogicTag-DtYe8HIq.js → useLogicTag-Cbp3I7UN.js} +2 -2
  124. package/dist/cdn/chunks/{useLogicTag-DtYe8HIq.js.map → useLogicTag-Cbp3I7UN.js.map} +1 -1
  125. package/dist/cdn/chunks/{useMergeTag-B8ULmsnp.js → useMergeTag-1lrpNyR5.js} +4 -4
  126. package/dist/cdn/chunks/{useMergeTag-B8ULmsnp.js.map → useMergeTag-1lrpNyR5.js.map} +1 -1
  127. package/dist/cdn/chunks/{withCurrentFont-MK8ga9q9.js → withCurrentFont-DZfmiv8V.js} +2 -2
  128. package/dist/cdn/chunks/{withCurrentFont-MK8ga9q9.js.map → withCurrentFont-DZfmiv8V.js.map} +1 -1
  129. package/dist/cdn/editor.css +1 -1
  130. package/dist/cdn/editor.js +285 -285
  131. package/dist/cdn/editor.js.map +1 -1
  132. package/dist/{composables-XjYKaKhY.js → composables-DPgNn9GZ.js} +963 -941
  133. package/dist/{createCloudRuntime-DGV5a5Af.js → createCloudRuntime-Bw8TLmQ8.js} +2 -2
  134. package/dist/{cdn/chunks/de-DaOUfYBX.js → de-Cc6Ue0UD.js} +10 -3
  135. package/dist/{dist-Cdkm20M6.js → dist-CBdk1Vcb.js} +978 -815
  136. package/dist/{en-C0pHHMiR.js → en-BX4FujAQ.js} +10 -1
  137. package/dist/{cdn/chunks/es-CxyEKr6n.js → es-Do5b-MKU.js} +10 -3
  138. package/dist/{extensions-BJ184osp.js → extensions-QFAARrjF.js} +336 -330
  139. package/dist/{cdn/chunks/fr-CYbamiI6.js → fr-S1n2Ebzp.js} +10 -3
  140. package/dist/index.d.ts +14 -1
  141. package/dist/{ja-DfaIAoGI.js → ja-DLwcq4bA.js} +10 -1
  142. package/dist/{cdn/chunks/nl-DkrB-VKZ.js → nl-0JSWaZpT.js} +10 -3
  143. package/dist/{cdn/chunks/normalizeMergeTagMarkup-cC32Ox6A.js → normalizeMergeTagMarkup-BS0nRvhq.js} +97 -89
  144. package/dist/{cdn/chunks/preRenderCustomBlocks-f7GEKdvw.js → preRenderCustomBlocks-CiKvKd8V.js} +4 -6
  145. package/dist/{cdn/chunks/pt-BR-CY5Ye7eP.js → pt-BR-D3VlIMDZ.js} +10 -3
  146. package/dist/{sanitizeHtml-2rjV0r-6.js → sanitizeHtml-USjTyALR.js} +5 -5
  147. package/dist/{socialIcons-TFiOkpoU.js → socialIcons-NvIg5ahU.js} +401 -400
  148. package/dist/style.css +1 -1
  149. package/dist/templatical-editor.js +190 -190
  150. package/dist/useLocalizedDisplay-LdjosX4w.js +31 -0
  151. package/dist/{useLogicTag-BXXXQQmi.js → useLogicTag-D8zgkXfb.js} +1 -1
  152. package/dist/{useMergeTag-C9Okr87y.js → useMergeTag-k7Kr0nMd.js} +3 -3
  153. package/dist/{withCurrentFont-DJiQqZzL.js → withCurrentFont-Bzeg_gfH.js} +1 -1
  154. package/package.json +7 -7
  155. package/dist/cdn/chunks/LogicTagInsertButton-Bhvi0nWz.js.map +0 -1
  156. package/dist/cdn/chunks/Toolbar-BlWVQRcA.js.map +0 -1
  157. package/dist/cdn/chunks/composables-Jc3uZuLs.js.map +0 -1
  158. package/dist/cdn/chunks/de-DaOUfYBX.js.map +0 -1
  159. package/dist/cdn/chunks/en-C0pHHMiR.js.map +0 -1
  160. package/dist/cdn/chunks/es-CxyEKr6n.js.map +0 -1
  161. package/dist/cdn/chunks/extensions-DcMKZpzh.js.map +0 -1
  162. package/dist/cdn/chunks/fr-CYbamiI6.js.map +0 -1
  163. package/dist/cdn/chunks/ja-DfaIAoGI.js.map +0 -1
  164. package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +0 -1
  165. package/dist/cdn/chunks/normalizeMergeTagMarkup-cC32Ox6A.js.map +0 -1
  166. package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +0 -1
  167. package/dist/cdn/chunks/src-8bYYJPCt.js +0 -671
  168. package/dist/cdn/chunks/src-8bYYJPCt.js.map +0 -1
  169. package/dist/cdn/chunks/src-A_cKeTM_.js.map +0 -1
  170. package/dist/cdn/chunks/src-BQUv2CYU.js.map +0 -1
  171. package/dist/cdn/chunks/useLocalizedDisplay-aGfnO90D.js +0 -33
  172. package/dist/useLocalizedDisplay-DNNwDRxL.js +0 -31
@@ -1,14 +1,14 @@
1
1
  import { $ as e, B as t, Ft as n, G as r, M as i, Mt as a, Pt as o, Q as s, Y as c, Z as l, _ as u, c as d, ct as f, et as p, f as m, g as h, it as g, k as _, lt as v, nt as y, ot as b, q as x, r as S, w as C, y as w } from "./vue.runtime.esm-bundler-BJXc_Mri.js";
2
- import { A as T, Bt as E, C as D, D as O, E as k, Et as ee, F as A, Ft as j, Gt as M, H as te, Nt as ne, O as re, Pt as ie, Qt as N, St as P, T as F, Tt as I, Ut as ae, Yt as L, Z as R, _ as z, at as B, d as V, et as H, g as U, gt as oe, h as se, jt as W, m as ce, mt as le, ot as ue, tn as de, w as fe, wt as pe, x as me, xt as he } from "./dist-Cdkm20M6.js";
3
- import { t as G } from "./createLucideIcon-CgDE3xAR.js";
4
- import { t as K } from "./upload-Cp8o-hrN.js";
5
- import { t as ge } from "./loader-circle-k6xvKgUB.js";
6
- import { B as _e, C as ve, U as ye, u as be } from "./keys-BCqskl51.js";
7
- import { t as xe } from "./useI18n-CgtvtF4C.js";
8
- import { r as Se } from "./dist-0alKVRc_.js";
9
- import { i as q, r as Ce } from "./usePopoverPosition-VDQjyX_A.js";
2
+ import { A as T, C as E, Ct as D, D as O, Dt as ee, E as k, Et as A, F as j, Ft as te, H as ne, It as M, Kt as N, Mt as re, O as P, Pt as F, Qt as I, St as L, T as R, Tt as z, Vt as B, Wt as ie, Z as V, _ as H, _t as U, d as W, et as G, g as ae, h as oe, ht as se, in as ce, m as le, ot as ue, st as de, tn as fe, w as pe, x as me } from "./dist-CBdk1Vcb.js";
3
+ import { t as K } from "./createLucideIcon-CgDE3xAR.js";
4
+ import { t as q } from "./upload-Cp8o-hrN.js";
5
+ import { t as he } from "./loader-circle-k6xvKgUB.js";
6
+ import { B as ge, C as _e, U as ve, u as ye } from "./keys-BCqskl51.js";
7
+ import { t as be } from "./useI18n-CgtvtF4C.js";
8
+ import { r as xe } from "./dist-0alKVRc_.js";
9
+ import { i as J, r as Se } from "./usePopoverPosition-VDQjyX_A.js";
10
10
  // ../core/dist/index.js
11
- var J = (e) => typeof e == "object" && !!e && !Array.isArray(e), Y = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => J(e) && typeof e.id == "string"), we = /* @__PURE__ */ new Set([
11
+ var Y = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ce = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => Y(e) && typeof e.id == "string"), we = /* @__PURE__ */ new Set([
12
12
  "id",
13
13
  "type",
14
14
  "children",
@@ -19,48 +19,48 @@ var J = (e) => typeof e == "object" && !!e && !Array.isArray(e), Y = (e) => Arra
19
19
  function Te(e, t, n) {
20
20
  let r = /* @__PURE__ */ new Set();
21
21
  for (let i of n) {
22
- if (!he(i)) continue;
23
- let n = i.split("."), a = n.pop(), o = n.join("."), s = j(e, i), c = t;
22
+ if (!L(i)) continue;
23
+ let n = i.split("."), a = n.pop(), o = n.join("."), s = M(e, i), c = t;
24
24
  for (let [t, i] of n.entries()) {
25
25
  let a = n.slice(0, t + 1).join(".");
26
- s !== void 0 && J(c) && j(c, i) === void 0 && J(j(e, a)) && (c[i] = {}, r.add(a)), c = j(c, i);
26
+ s !== void 0 && Y(c) && M(c, i) === void 0 && Y(M(e, a)) && (c[i] = {}, r.add(a)), c = M(c, i);
27
27
  }
28
28
  if (Array.isArray(c)) {
29
- let e = c.findIndex((e) => J(e) && e.id === a);
29
+ let e = c.findIndex((e) => Y(e) && e.id === a);
30
30
  if (e < 0) continue;
31
- s === void 0 ? c.splice(e, 1) : c[e] = M(s);
32
- } else J(c) && (s === void 0 ? delete c[a] : c[a] = M(s), o && Object.keys(c).length === 0 && j(e, o) === void 0 && Te(e, t, [o]));
31
+ s === void 0 ? c.splice(e, 1) : c[e] = N(s);
32
+ } else Y(c) && (s === void 0 ? delete c[a] : c[a] = N(s), o && Object.keys(c).length === 0 && M(e, o) === void 0 && Te(e, t, [o]));
33
33
  }
34
34
  return r;
35
35
  }
36
- function X(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
37
- if (J(e) && J(t) && !a.has(n)) for (let o of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) (n || !we.has(o)) && X(e[o], t[o], n ? `${n}.${o}` : o, r, i, a);
38
- else if (i && Y(e) && Y(t)) for (let o of t) {
36
+ function Ee(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
37
+ if (Y(e) && Y(t) && !a.has(n)) for (let o of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) (n || !we.has(o)) && Ee(e[o], t[o], n ? `${n}.${o}` : o, r, i, a);
38
+ else if (i && Ce(e) && Ce(t)) for (let o of t) {
39
39
  if (o.id.includes(".")) continue;
40
40
  let t = e.find((e) => e.id === o.id);
41
- t && X(t, o, `${n}.${o.id}`, r, i, a);
41
+ t && Ee(t, o, `${n}.${o.id}`, r, i, a);
42
42
  }
43
- else R(e, t) || r.set(n, t);
43
+ else V(e, t) || r.set(n, t);
44
44
  }
45
- function Ee(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
45
+ function De(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
46
46
  let a = /* @__PURE__ */ new Map();
47
- X(e, t, "", a, e.type !== "custom", i);
48
- let o = new Set(e.type === "custom" ? de(e, r) : []), s = {}, c = {};
49
- for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : I(e.type, t)) && typeof r == "string" && j(e, t) !== void 0) {
47
+ Ee(e, t, "", a, e.type !== "custom", i);
48
+ let o = new Set(e.type === "custom" ? ce(e, r) : []), s = {}, c = {};
49
+ for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : A(e.type, t)) && typeof r == "string" && M(e, t) !== void 0) {
50
50
  let i = n?.text?.[t];
51
51
  s[t] = i && i.value === r ? i : {
52
52
  value: r,
53
- sourceHash: L(String(j(e, t) ?? ""))
53
+ sourceHash: I(String(M(e, t) ?? ""))
54
54
  };
55
55
  } else c[t] = r === void 0 ? null : r;
56
56
  let l = {};
57
57
  return Object.keys(s).length && (l.text = s), Object.keys(c).length && (l.set = c), n?.hidden && (l.hidden = !0), l;
58
58
  }
59
- function De(e, t, n) {
59
+ function Oe(e, t, n) {
60
60
  let r = !1;
61
61
  function i(e, t, n, a) {
62
- let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) => J(e) && typeof e.id == "string");
63
- if (c(o) && c(s) && (JSON.stringify(o.map((e) => e.id)) !== JSON.stringify(s.map((e) => e.id)) && (r = !0, e[n] = s.map((e) => M(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
62
+ let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) => Y(e) && typeof e.id == "string");
63
+ if (c(o) && c(s) && (JSON.stringify(o.map((e) => e.id)) !== JSON.stringify(s.map((e) => e.id)) && (r = !0, e[n] = s.map((e) => N(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
64
64
  let r = e[n].find((e) => e.id === t.id);
65
65
  r && i(r, t, a);
66
66
  }
@@ -68,51 +68,51 @@ function De(e, t, n) {
68
68
  let a = e, o = t;
69
69
  if (e.type === "menu" && i(a, o, "items"), e.type === "table" && i(a, o, "rows", "cells"), e.type === "social" && i(a, o, "icons"), e.type === "section" && t.type === "section") {
70
70
  let i = (e) => e.map((e) => e.map((e) => e.id));
71
- (e.columns !== t.columns || JSON.stringify(i(e.children)) !== JSON.stringify(i(t.children))) && (r = !0, e.columns = t.columns, e.children = t.children.map((e) => e.map((e) => M(n(e.id) ?? e))));
71
+ (e.columns !== t.columns || JSON.stringify(i(e.children)) !== JSON.stringify(i(t.children))) && (r = !0, e.columns = t.columns, e.children = t.children.map((e) => e.map((e) => N(n(e.id) ?? e))));
72
72
  }
73
73
  return r;
74
74
  }
75
- function Oe(e, t, n) {
75
+ function ke(e, t, n) {
76
76
  let r = (e) => {
77
77
  let { locale: t, locales: n, l10n: r, ...i } = e;
78
78
  return i;
79
79
  }, i = /* @__PURE__ */ new Map();
80
- X(r(e), r(t), "", i);
80
+ Ee(r(e), r(t), "", i);
81
81
  let a = {};
82
- for (let [t, r] of i) if (ce.includes(t) && typeof r == "string" && j(e, t) !== void 0) {
82
+ for (let [t, r] of i) if (le.includes(t) && typeof r == "string" && M(e, t) !== void 0) {
83
83
  let i = n?.text?.[t];
84
84
  (a.text ??= {})[t] = i?.value === r ? i : {
85
85
  value: r,
86
- sourceHash: L(String(j(e, t) ?? ""))
86
+ sourceHash: I(String(M(e, t) ?? ""))
87
87
  };
88
88
  } else (a.set ??= {})[t] = r === void 0 ? null : r;
89
89
  return a;
90
90
  }
91
- function ke(e, t, n, r, i, a = []) {
92
- let o = M(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
91
+ function Ae(e, t, n, r, i, a = []) {
92
+ let o = N(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
93
93
  ...Object.keys(t.text ?? {}),
94
94
  ...Object.keys(t.set ?? {}),
95
95
  ...Object.keys(n.text ?? {}),
96
96
  ...Object.keys(n.set ?? {})
97
- ])].filter((e) => !R(t.text?.[e], n.text?.[e]) || !R(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
97
+ ])].filter((e) => !V(t.text?.[e], n.text?.[e]) || !V(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
98
98
  for (let e of c) {
99
- let t = j(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && R(j(r, t), j(i, t)));
100
- if (R(t, j(r, e))) delete o.set[e];
101
- else if (n.length && J(j(r, e)) && J(t)) {
99
+ let t = M(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && V(M(r, t), M(i, t)));
100
+ if (V(t, M(r, e))) delete o.set[e];
101
+ else if (n.length && Y(M(r, e)) && Y(t)) {
102
102
  delete o.set[e];
103
103
  let i = (e, t, a) => {
104
104
  if (!n.some((t) => e === t || e.startsWith(`${t}.`))) {
105
- if (J(t) && J(a)) for (let n of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(a)])) i(`${e}.${n}`, t[n], a[n]);
106
- else if (J(r) && r.type !== "custom" && Y(t) && Y(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
107
- else J(r) && typeof r.type == "string" && pe(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : M(a));
105
+ if (Y(t) && Y(a)) for (let n of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(a)])) i(`${e}.${n}`, t[n], a[n]);
106
+ else if (Y(r) && r.type !== "custom" && Ce(t) && Ce(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
107
+ else Y(r) && typeof r.type == "string" && z(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : N(a));
108
108
  }
109
109
  };
110
- i(e, j(r, e), t);
111
- } else o.set[e] = t === void 0 ? null : M(t);
110
+ i(e, M(r, e), t);
111
+ } else o.set[e] = t === void 0 ? null : N(t);
112
112
  for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) {
113
113
  if (!n.startsWith(`${e}.`)) continue;
114
114
  let r = t === "text" ? o.text[n].value : o.set[n] ?? void 0;
115
- R(r, j(i, n)) || delete o[t][n];
115
+ V(r, M(i, n)) || delete o[t][n];
116
116
  }
117
117
  }
118
118
  for (let e of s) if (!c.includes(e)) {
@@ -121,7 +121,7 @@ function ke(e, t, n, r, i, a = []) {
121
121
  }
122
122
  return o.text && !Object.keys(o.text).length && delete o.text, o.set && !Object.keys(o.set).length && delete o.set, o;
123
123
  }
124
- function Ae(e) {
124
+ function je(e) {
125
125
  return [
126
126
  "addBlock",
127
127
  "removeBlock",
@@ -129,7 +129,7 @@ function Ae(e) {
129
129
  "duplicateBlock"
130
130
  ].includes(e);
131
131
  }
132
- function je(e, t, n) {
132
+ function Me(e, t, n) {
133
133
  if (e.canEdit && !e.canEdit()) return !1;
134
134
  let r = t === "addBlock", i = t === "duplicateBlock", a = typeof n[0] == "string" ? n[0] : n[0].id, o = r ? n[0] : e.findBlock?.(a);
135
135
  if (!r && e.findBlock && !o) return !1;
@@ -140,7 +140,7 @@ function je(e, t, n) {
140
140
  ...e.content(),
141
141
  blocks: [o]
142
142
  };
143
- F(t), k(t);
143
+ R(t), k(t);
144
144
  }
145
145
  if (t === "removeBlock") return !0;
146
146
  let c = i && n[1] === void 0 && n[2] === void 0, l = c ? s?.targetSectionId : n[t === "moveBlock" ? 2 : 1], u = (c ? s?.columnIndex : n[t === "moveBlock" ? 3 : 2]) ?? 0;
@@ -148,24 +148,24 @@ function je(e, t, n) {
148
148
  if (e.isBlockLocked(l, !0) || o?.type === "section") return !1;
149
149
  if (e.findBlock) {
150
150
  let t = e.findBlock(l);
151
- if (t?.type !== "section" || u < 0 || u >= ue(t.columns)) return !1;
151
+ if (t?.type !== "section" || u < 0 || u >= de(t.columns)) return !1;
152
152
  }
153
153
  }
154
154
  return t !== "moveBlock" || s?.targetSectionId !== l || (s?.columnIndex ?? 0) !== u || s?.index !== n[1];
155
155
  }
156
- var Me = /* @__PURE__ */ new WeakMap();
157
- function Ne(e, t) {
158
- Me.set(e, t);
159
- for (let n of Object.values(e)) typeof n == "function" && Me.set(n, t);
156
+ var Ne = /* @__PURE__ */ new WeakMap();
157
+ function Pe(e, t) {
158
+ Ne.set(e, t);
159
+ for (let n of Object.values(e)) typeof n == "function" && Ne.set(n, t);
160
160
  }
161
- function Z(e, t) {
162
- let n = Me.get(e);
163
- n && Me.set(t, n);
161
+ function X(e, t) {
162
+ let n = Ne.get(e);
163
+ n && Ne.set(t, n);
164
164
  }
165
- function Q(e, t, n) {
166
- let r = Reflect.get(e, t), i = Me.get(e) ?? (typeof r == "function" ? Me.get(r) : void 0);
165
+ function Z(e, t, n) {
166
+ let r = Reflect.get(e, t), i = Ne.get(e) ?? (typeof r == "function" ? Ne.get(r) : void 0);
167
167
  if (i) return i(t, n);
168
- if (!Ae(t)) return !0;
168
+ if (!je(t)) return !0;
169
169
  let a = Reflect.get(e, "isBlockLocked");
170
170
  if (typeof a != "function") return !0;
171
171
  let o = { isBlockLocked: (t, n) => a.call(e, t, n) }, s = Reflect.get(e, "content");
@@ -178,21 +178,21 @@ function Q(e, t, n) {
178
178
  let n = Reflect.get(e, t);
179
179
  typeof n == "function" && (o[t] = n.bind(e));
180
180
  }
181
- return je(o, t, n);
181
+ return Me(o, t, n);
182
182
  }
183
- function Pe(e) {
183
+ function Q(e) {
184
184
  return e instanceof Error ? e : Error(String(e), { cause: e });
185
185
  }
186
186
  function Fe(e, t) {
187
187
  try {
188
188
  t();
189
189
  } catch (t) {
190
- e?.(Pe(t));
190
+ e?.(Q(t));
191
191
  }
192
192
  }
193
193
  function Ie(t) {
194
- let n = t.content ?? A(t.defaultFontFamily, t.templateDefaults);
195
- F(n), k(n);
194
+ let n = t.content ?? j(t.defaultFontFamily, t.templateDefaults);
195
+ R(n), k(n);
196
196
  let i = s({
197
197
  template: null,
198
198
  content: n,
@@ -207,11 +207,11 @@ function Ie(t) {
207
207
  uiTheme: "auto"
208
208
  }), a = g(i, "activeLocale"), o = [];
209
209
  function c(e) {
210
- let t = H(i.content);
211
- if (e === t && (e = null), e !== null && !i.content.settings.locales?.includes(e)) throw new z(`This template has no "${e}" version.`, void 0, "unknown_locale");
210
+ let t = G(i.content);
211
+ if (e === t && (e = null), e !== null && !i.content.settings.locales?.includes(e)) throw new H(`This template has no "${e}" version.`, void 0, "unknown_locale");
212
212
  a.value = e;
213
213
  }
214
- v(() => a.value ?? H(i.content), (e) => Fe(t.onError, () => t.onLocaleChange?.(e))), v(() => i.content.settings.locales?.includes(a.value ?? ""), () => {
214
+ v(() => a.value ?? G(i.content), (e) => Fe(t.onError, () => t.onLocaleChange?.(e))), v(() => i.content.settings.locales?.includes(a.value ?? ""), () => {
215
215
  a.value && !i.content.settings.locales?.includes(a.value) && c(null);
216
216
  });
217
217
  function l() {
@@ -221,16 +221,16 @@ function Ie(t) {
221
221
  o = e;
222
222
  }
223
223
  function d(e) {
224
- return te(i.content, e, o);
224
+ return ne(i.content, e, o);
225
225
  }
226
226
  function f(e, n) {
227
227
  if (!l()) return null;
228
- if (e === "addLocale" && (!oe(n) || t.localization && !t.localization.locales.includes(n))) throw new z(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
229
- let r = M(i.content);
230
- return fe(r, [{
228
+ if (e === "addLocale" && (!U(n) || t.localization && !t.localization.locales.includes(n))) throw new H(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
229
+ let r = N(i.content);
230
+ return pe(r, [{
231
231
  op: e,
232
232
  locale: n
233
- }]), R(r, i.content) ? null : r;
233
+ }]), V(r, i.content) ? null : r;
234
234
  }
235
235
  function m(e, t) {
236
236
  let n = f(e, t);
@@ -252,16 +252,16 @@ function Ie(t) {
252
252
  function b(e, t) {
253
253
  let [n, r] = t;
254
254
  if (!a.value || !l() || B(n)) return null;
255
- let s = N(i.content.blocks, n);
255
+ let s = P(i.content.blocks, n);
256
256
  if (!s) return null;
257
- let c = s.l10n?.[a.value], u = W(s, a.value, H(i.content)), d = Ee(s, u, c, o), f = e === "resetLocaleFields" && Array.isArray(r) ? Te(s, u, r) : void 0, p = e === "resetLocaleFields" ? ke(c, d, Ee(s, u, c, o, f), s, u, Array.isArray(r) ? r : []) : M(c ?? {});
257
+ let c = s.l10n?.[a.value], u = re(s, a.value, G(i.content)), d = De(s, u, c, o), f = e === "resetLocaleFields" && Array.isArray(r) ? Te(s, u, r) : void 0, p = e === "resetLocaleFields" ? Ae(c, d, De(s, u, c, o, f), s, u, Array.isArray(r) ? r : []) : N(c ?? {});
258
258
  if (e === "setBlockHidden") r ? p.hidden = !0 : delete p.hidden;
259
259
  else if (e === "resetLocaleFields") r || (delete p.text, delete p.set, delete p.hidden);
260
260
  else for (let e of r) {
261
261
  let t = p.text?.[e];
262
- t && (t.sourceHash = L(String(j(s, e) ?? "")));
262
+ t && (t.sourceHash = I(String(M(s, e) ?? "")));
263
263
  }
264
- return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, R(c ?? {}, p) ? null : {
264
+ return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, V(c ?? {}, p) ? null : {
265
265
  block: s,
266
266
  layer: p
267
267
  };
@@ -288,26 +288,26 @@ function Ie(t) {
288
288
  set: (e) => {
289
289
  i.content = e, O();
290
290
  }
291
- }), re = r(() => i.selectedBlockId ? N(i.content.blocks, i.selectedBlockId) : null);
292
- function N(e, t) {
291
+ }), A = r(() => i.selectedBlockId ? P(i.content.blocks, i.selectedBlockId) : null);
292
+ function P(e, t) {
293
293
  for (let n of e) {
294
294
  if (n.id === t) return n;
295
295
  if (n.type === "section") for (let e of n.children) {
296
- let n = N(e, t);
296
+ let n = P(e, t);
297
297
  if (n) return n;
298
298
  }
299
299
  }
300
300
  return null;
301
301
  }
302
- function P(e, t) {
303
- if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) P(e, t);
302
+ function L(e, t) {
303
+ if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) L(e, t);
304
304
  }
305
- function I(e, t, n = { blocks: e }) {
305
+ function z(e, t, n = { blocks: e }) {
306
306
  for (let r = 0; r < e.length; r++) {
307
307
  let i = e[r];
308
308
  if (i.id === t) return n;
309
309
  if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
310
- let n = I(i.children[e], t, {
310
+ let n = z(i.children[e], t, {
311
311
  blocks: i.children[e],
312
312
  sectionId: i.id,
313
313
  columnIndex: e
@@ -327,8 +327,8 @@ function Ie(t) {
327
327
  }
328
328
  return !1;
329
329
  }
330
- function V(e) {
331
- let t = I(i.content.blocks, e);
330
+ function W(e) {
331
+ let t = z(i.content.blocks, e);
332
332
  if (!t) return null;
333
333
  let n = t.blocks.findIndex((t) => t.id === e);
334
334
  return n === -1 ? null : {
@@ -337,52 +337,52 @@ function Ie(t) {
337
337
  index: n
338
338
  };
339
339
  }
340
- function U(e, t = !0) {
341
- F(e), k(e), i.content = e, t && O();
340
+ function ae(e, t = !0) {
341
+ R(e), k(e), i.content = e, t && O();
342
342
  }
343
- function se(e) {
343
+ function oe(e) {
344
344
  e && B(e) || (i.selectedBlockId = e);
345
345
  }
346
- function ce(e) {
346
+ function se(e) {
347
347
  i.viewport = e;
348
348
  }
349
- function le(e) {
349
+ function ce(e) {
350
350
  i.darkMode = e;
351
351
  }
352
- function ue(e) {
352
+ function le(e) {
353
353
  i.uiTheme = e;
354
354
  }
355
- function de(e) {
355
+ function ue(e) {
356
356
  i.previewMode = e, e && (i.selectedBlockId = null);
357
357
  }
358
- function pe(e, t) {
358
+ function de(e, t) {
359
359
  if (!l()) return !1;
360
- let n = N(i.content.blocks, e);
360
+ let n = P(i.content.blocks, e);
361
361
  if (!n) return !1;
362
- if ("l10n" in t) throw new z("l10n is immutable in updateBlock.", void 0, "invalid_operation");
362
+ if ("l10n" in t) throw new H("l10n is immutable in updateBlock.", void 0, "invalid_operation");
363
363
  let r = {
364
364
  ...n,
365
365
  ...t
366
366
  };
367
- return !B(e, De(M(n), r, (e) => N(i.content.blocks, e)));
367
+ return !B(e, Oe(N(n), r, (e) => P(i.content.blocks, e)));
368
368
  }
369
- function me(e, n) {
370
- if (!pe(e, n)) return;
371
- let r = N(i.content.blocks, e);
369
+ function fe(e, n) {
370
+ if (!de(e, n)) return;
371
+ let r = P(i.content.blocks, e);
372
372
  if (!r) return;
373
373
  let s = a.value;
374
374
  if (s) {
375
- let a = W(r, s, H(i.content)), c = {
375
+ let a = re(r, s, G(i.content)), c = {
376
376
  ...a,
377
377
  ...n
378
- }, l = M(r), u = De(l, c, (e) => N(i.content.blocks, e));
378
+ }, l = N(r), u = Oe(l, c, (e) => P(i.content.blocks, e));
379
379
  if (B(e, u)) return;
380
380
  u && t.onStructureChange?.();
381
- let d = ne(l);
382
- delete r.l10n, Object.assign(r, d), y(r, ke(r.l10n?.[s], Ee(r, a, r.l10n?.[s], o), Ee(r, c, r.l10n?.[s], o), r, c));
381
+ let d = F(l);
382
+ delete r.l10n, Object.assign(r, d), y(r, Ae(r.l10n?.[s], De(r, a, r.l10n?.[s], o), De(r, c, r.l10n?.[s], o), r, c));
383
383
  } else {
384
384
  if (B(e, "children" in n || "columns" in n)) return;
385
- let t = ne({
385
+ let t = F({
386
386
  ...r,
387
387
  ...n
388
388
  });
@@ -390,24 +390,24 @@ function Ie(t) {
390
390
  }
391
391
  O();
392
392
  }
393
- function he(e) {
394
- if ("locales" in e || "l10n" in e) throw new z("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
395
- if ("locale" in e && e.locale !== H(i.content) && i.content.settings.locales?.length) throw new z("The default locale can't change while language versions exist.", void 0, "invalid_operation");
393
+ function me(e) {
394
+ if ("locales" in e || "l10n" in e) throw new H("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
395
+ if ("locale" in e && e.locale !== G(i.content) && i.content.settings.locales?.length) throw new H("The default locale can't change while language versions exist.", void 0, "invalid_operation");
396
396
  }
397
- function G(e) {
397
+ function K(e) {
398
398
  if (!l()) return;
399
- he(e);
399
+ me(e);
400
400
  let t = a.value;
401
- if (!t) i.content.settings = ie({
401
+ if (!t) i.content.settings = te({
402
402
  ...i.content.settings,
403
403
  ...e
404
404
  });
405
405
  else {
406
- let n = i.content.settings, r = ae(i.content, t).settings, a = {
406
+ let n = i.content.settings, r = ie(i.content, t).settings, a = {
407
407
  ...r,
408
408
  locale: n.locale,
409
409
  ...e
410
- }, o = n.l10n?.[t], s = ke(o, Oe(n, r, o), Oe(n, a, o), n, a);
410
+ }, o = n.l10n?.[t], s = Ae(o, ke(n, r, o), ke(n, a, o), n, a);
411
411
  Object.keys(s).length ? n.l10n = {
412
412
  ...n.l10n,
413
413
  [t]: s
@@ -415,22 +415,22 @@ function Ie(t) {
415
415
  }
416
416
  O();
417
417
  }
418
- let K = {
418
+ let q = {
419
419
  canEdit: l,
420
420
  content: () => i.content,
421
- findBlock: (e) => N(i.content.blocks, e),
422
- findBlockLocation: V,
421
+ findBlock: (e) => P(i.content.blocks, e),
422
+ findBlockLocation: W,
423
423
  isBlockLocked: B
424
424
  };
425
- function ge(e, n, r = 0, o) {
426
- if (je(K, "addBlock", [
425
+ function he(e, n, r = 0, o) {
426
+ if (Me(q, "addBlock", [
427
427
  e,
428
428
  n,
429
429
  r,
430
430
  o
431
431
  ])) {
432
432
  if (n) {
433
- let t = N(i.content.blocks, n);
433
+ let t = P(i.content.blocks, n);
434
434
  if (t && t.type === "section") {
435
435
  t.children[r] = t.children[r] || [];
436
436
  let n = t.children[r];
@@ -440,58 +440,58 @@ function Ie(t) {
440
440
  a.value && t.onStructureChange?.(), O();
441
441
  }
442
442
  }
443
- function _e(e) {
444
- if (!je(K, "removeBlock", [e])) return;
445
- let n = I(i.content.blocks, e);
443
+ function ge(e) {
444
+ if (!Me(q, "removeBlock", [e])) return;
445
+ let n = z(i.content.blocks, e);
446
446
  if (n) {
447
447
  let r = n.blocks.findIndex((t) => t.id === e);
448
448
  if (r !== -1) {
449
449
  let [e] = n.blocks.splice(r, 1);
450
450
  if (i.selectedBlockId) {
451
451
  let t = /* @__PURE__ */ new Set();
452
- P(e, t), t.has(i.selectedBlockId) && (i.selectedBlockId = null);
452
+ L(e, t), t.has(i.selectedBlockId) && (i.selectedBlockId = null);
453
453
  }
454
454
  a.value && t.onStructureChange?.(), O();
455
455
  }
456
456
  }
457
457
  }
458
- function ve(e, n, r, o = 0) {
459
- if (!je(K, "moveBlock", [
458
+ function _e(e, n, r, o = 0) {
459
+ if (!Me(q, "moveBlock", [
460
460
  e,
461
461
  n,
462
462
  r,
463
463
  o
464
464
  ])) return;
465
- let s = I(i.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
465
+ let s = z(i.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
466
466
  if (r) {
467
- let e = N(i.content.blocks, r);
467
+ let e = P(i.content.blocks, r);
468
468
  e.children[o] = e.children[o] || [], l = e.children[o];
469
469
  } else l = i.content.blocks;
470
470
  let [u] = s.blocks.splice(c, 1);
471
471
  l.splice(n, 0, u), a.value && t.onStructureChange?.(), O();
472
472
  }
473
- function ye() {
473
+ function ve() {
474
474
  O();
475
475
  }
476
- function be(e, t) {
477
- throw new z(`[Templatical] Templates: ${e} ${t}`);
476
+ function ye(e, t) {
477
+ throw new H(`[Templatical] Templates: ${e} ${t}`);
478
478
  }
479
- function xe(e) {
479
+ function be(e) {
480
480
  Fe(t.onError, e);
481
481
  }
482
- function Se(e) {
482
+ function xe(e) {
483
483
  let { templates: n } = t;
484
- return n || be(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
484
+ return n || ye(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
485
485
  }
486
- function q(e) {
486
+ function J(e) {
487
487
  i.template && (i.template = {
488
488
  ...i.template,
489
489
  name: e
490
490
  }, O());
491
491
  }
492
- async function Ce(e) {
493
- let n = Se("create()"), { create: r } = n;
494
- typeof r != "function" && be("create()", "is disabled by the provider — its `create` is `false`.");
492
+ async function Se(e) {
493
+ let n = xe("create()"), { create: r } = n;
494
+ typeof r != "function" && ye("create()", "is disabled by the provider — its `create` is `false`.");
495
495
  let a, o = ++E;
496
496
  i.isLoading = !0;
497
497
  try {
@@ -506,26 +506,26 @@ function Ie(t) {
506
506
  } finally {
507
507
  E === o && (i.isLoading = !1);
508
508
  }
509
- return xe(() => n.onCreated?.(a)), a;
509
+ return be(() => n.onCreated?.(a)), a;
510
510
  }
511
- async function J(e, n) {
512
- let r = Se("load()"), a, o = ++E;
511
+ async function Y(e, n) {
512
+ let r = xe("load()"), a, o = ++E;
513
513
  i.isLoading = !0;
514
514
  try {
515
- if (a = await r.load(e), F(a.content), k(a.content), n && !n()) return a;
515
+ if (a = await r.load(e), R(a.content), k(a.content), n && !n()) return a;
516
516
  i.template = a, i.content = a.content, i.isDirty = !1, T.value++;
517
517
  } catch (e) {
518
518
  throw t.onError?.(e), e;
519
519
  } finally {
520
520
  E === o && (i.isLoading = !1);
521
521
  }
522
- return xe(() => r.onLoaded?.(a)), a;
522
+ return be(() => r.onLoaded?.(a)), a;
523
523
  }
524
- async function Y(e = "api") {
525
- let n = Se("save()"), { save: r } = n;
526
- typeof r != "function" && be("save()", "is disabled by the provider — its `save` is `false`.");
524
+ async function Ce(e = "api") {
525
+ let n = xe("save()"), { save: r } = n;
526
+ typeof r != "function" && ye("save()", "is disabled by the provider — its `save` is `false`.");
527
527
  let a = i.template;
528
- a || be("save()", "has no template loaded. Call create() or load() first.");
528
+ a || ye("save()", "has no template loaded. Call create() or load() first.");
529
529
  let o = a.name === void 0 ? { content: i.content } : {
530
530
  name: a.name,
531
531
  content: i.content
@@ -546,16 +546,16 @@ function Ie(t) {
546
546
  } finally {
547
547
  i.isSaving = !1;
548
548
  }
549
- return xe(() => n.onSaved?.(s, { trigger: e })), s;
549
+ return be(() => n.onSaved?.(s, { trigger: e })), s;
550
550
  }
551
551
  function we() {
552
552
  return i.template?.id !== void 0;
553
553
  }
554
- let X = {
554
+ let Ee = {
555
555
  state: e(i),
556
556
  loadVersion: e(T),
557
557
  content: ee,
558
- selectedBlock: re,
558
+ selectedBlock: A,
559
559
  activeLocale: a,
560
560
  setActiveLocale: c,
561
561
  addLocale: h,
@@ -566,32 +566,32 @@ function Ie(t) {
566
566
  setCustomBlockDefinitions: u,
567
567
  createSetDefaultLocaleOperation: d,
568
568
  isBlockLocked: B,
569
- setContent: U,
570
- selectBlock: se,
571
- setViewport: ce,
572
- setDarkMode: le,
573
- setUiTheme: ue,
574
- setPreviewMode: de,
575
- updateBlock: me,
576
- updateSettings: G,
577
- addBlock: ge,
578
- removeBlock: _e,
579
- moveBlock: ve,
580
- markDirty: ye,
581
- findBlockLocation: V,
582
- setName: q,
583
- create: Ce,
584
- load: J,
585
- save: Y,
569
+ setContent: ae,
570
+ selectBlock: oe,
571
+ setViewport: se,
572
+ setDarkMode: ce,
573
+ setUiTheme: le,
574
+ setPreviewMode: ue,
575
+ updateBlock: fe,
576
+ updateSettings: K,
577
+ addBlock: he,
578
+ removeBlock: ge,
579
+ moveBlock: _e,
580
+ markDirty: ve,
581
+ findBlockLocation: W,
582
+ setName: J,
583
+ create: Se,
584
+ load: Y,
585
+ save: Ce,
586
586
  hasTemplate: we
587
587
  };
588
- return Ne(X, (e, t) => Ae(e) ? je(K, e, t) : l() ? e === "updateBlock" ? pe(t[0], t[1]) : (e === "updateSettings" && he(t[0]), e === "addLocale" || e === "removeLocale" ? f(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? b(e, t) !== null : !0) : !1), X;
588
+ return Pe(Ee, (e, t) => je(e) ? Me(q, e, t) : l() ? e === "updateBlock" ? de(t[0], t[1]) : (e === "updateSettings" && me(t[0]), e === "addLocale" || e === "removeLocale" ? f(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? b(e, t) !== null : !0) : !1), Ee;
589
589
  }
590
590
  var Le = 50, Re = 300, ze = 1500;
591
591
  function Be(e) {
592
592
  let { content: t, setContent: n, maxSize: i = Le } = e, a = p([]), o = p([]), s = p(!1), c = null, l = null, u = r(() => a.value.length > 0), d = r(() => o.value.length > 0);
593
593
  function f() {
594
- return M(t.value);
594
+ return N(t.value);
595
595
  }
596
596
  function m(e) {
597
597
  a.value.push(e), a.value.length > i && a.value.splice(0, a.value.length - i);
@@ -656,7 +656,7 @@ function Ve(e) {
656
656
  }
657
657
  function s(e, n, r) {
658
658
  let o = O(e);
659
- if (!Q(t, "duplicateBlock", [
659
+ if (!Z(t, "duplicateBlock", [
660
660
  e,
661
661
  n,
662
662
  r
@@ -777,31 +777,31 @@ function Ke(e, t) {
777
777
  ]) {
778
778
  let r = e[n];
779
779
  r && (Object.assign(e, { [n]: (...i) => {
780
- Q(e, n, i) && (["addLocale", "removeLocale"].includes(n) || !e.isBlockLocked(i[0])) && (t.record(), r(...i));
781
- } }), Z(r, e[n]));
780
+ Z(e, n, i) && (["addLocale", "removeLocale"].includes(n) || !e.isBlockLocked(i[0])) && (t.record(), r(...i));
781
+ } }), X(r, e[n]));
782
782
  }
783
783
  let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
784
784
  e.addBlock = (r, i, a, o) => {
785
- Q(e, "addBlock", [
785
+ Z(e, "addBlock", [
786
786
  r,
787
787
  i,
788
788
  a,
789
789
  o
790
790
  ]) && (t.record(), n(r, i, a, o));
791
791
  }, e.removeBlock = (n) => {
792
- Q(e, "removeBlock", [n]) && (t.record(), r(n));
792
+ Z(e, "removeBlock", [n]) && (t.record(), r(n));
793
793
  }, e.moveBlock = (n, r, a, o) => {
794
- Q(e, "moveBlock", [
794
+ Z(e, "moveBlock", [
795
795
  n,
796
796
  r,
797
797
  a,
798
798
  o
799
799
  ]) && (t.record(), i(n, r, a, o));
800
- }, Z(n, e.addBlock), Z(r, e.removeBlock), Z(i, e.moveBlock), e.updateBlock = (n, r) => {
801
- Q(e, "updateBlock", [n, r]) && (e.isBlockLocked(n) || (t.recordDebounced(n), a(n, r)));
800
+ }, X(n, e.addBlock), X(r, e.removeBlock), X(i, e.moveBlock), e.updateBlock = (n, r) => {
801
+ Z(e, "updateBlock", [n, r]) && (e.isBlockLocked(n) || (t.recordDebounced(n), a(n, r)));
802
802
  }, e.updateSettings = (n) => {
803
- Q(e, "updateSettings", [n]) && (t.record(), o(n));
804
- }, Z(a, e.updateBlock), Z(o, e.updateSettings);
803
+ Z(e, "updateSettings", [n]) && (t.record(), o(n));
804
+ }, X(a, e.updateBlock), X(o, e.updateSettings);
805
805
  }
806
806
  var qe = "root", Je = /* @__PURE__ */ new Set([
807
807
  "id",
@@ -855,7 +855,7 @@ function tt(e) {
855
855
  }
856
856
  function nt(e, t, n) {
857
857
  let r = {}, i = [];
858
- for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || R(e[i], t[i]) || (r[i] = M(t[i]));
858
+ for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || V(e[i], t[i]) || (r[i] = N(t[i]));
859
859
  for (let r of Object.keys(e)) n.has(r) || e[r] === void 0 || t[r] === void 0 && i.push(r);
860
860
  return {
861
861
  set: r,
@@ -874,7 +874,7 @@ function rt(e = {}, t = {}) {
874
874
  function it(e, t) {
875
875
  if (e.settings.locale !== t.settings.locale && (e.settings.locales?.length || t.settings.locales?.length)) return [{
876
876
  op: "setContent",
877
- content: M(t)
877
+ content: N(t)
878
878
  }];
879
879
  let n = et(e.blocks), r = et(t.blocks), i = [], a = (e) => {
880
880
  let t = r.get(e), i = n.get(e);
@@ -892,8 +892,8 @@ function it(e, t) {
892
892
  };
893
893
  for (let t of e.blocks) u(t, "kept");
894
894
  let d = (e) => n.has(e) && !c.has(e), f = (e) => {
895
- let t = M(e);
896
- return t.type === "section" && (t.children = $e(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => M(e)) : e)), t;
895
+ let t = N(e);
896
+ return t.type === "section" && (t.children = $e(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => N(e)) : e)), t;
897
897
  }, p = (e, t, r) => {
898
898
  let a = Qe(e), o = [], s = [];
899
899
  t.forEach((e, t) => {
@@ -1032,32 +1032,32 @@ function ct(e, t, n) {
1032
1032
  Object.keys(n).length ? (e.l10n ??= {})[t] = n : e.l10n && (delete e.l10n[t], Object.keys(e.l10n).length || delete e.l10n);
1033
1033
  }
1034
1034
  function lt(e) {
1035
- let t = M(e);
1035
+ let t = N(e);
1036
1036
  return delete t.l10n, t.type === "section" && (t.children = t.children.map((e) => e.map(lt))), t;
1037
1037
  }
1038
1038
  function ut(e, t, n, r) {
1039
- let i = ae(e, t), a = M(e), o = M(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
1039
+ let i = ie(e, t), a = N(e), o = N(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
1040
1040
  for (let [i, a] of $(n)) c.set(i, {
1041
- initial: W(a, t, H(e)),
1041
+ initial: re(a, t, G(e)),
1042
1042
  added: r,
1043
1043
  changed: !1
1044
1044
  });
1045
1045
  };
1046
1046
  l(i.blocks, !1);
1047
1047
  let u = [], d = (e, t, n) => {
1048
- if (t.some((e) => e?.op === "setDefaultLocale")) throw new V("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
1049
- if (t.some((e) => e?.op === "setContent")) throw new V("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
1048
+ if (t.some((e) => e?.op === "setDefaultLocale")) throw new W("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
1049
+ if (t.some((e) => e?.op === "setContent")) throw new W("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
1050
1050
  try {
1051
- return D(e, t);
1051
+ return E(e, t);
1052
1052
  } catch (e) {
1053
- throw e instanceof V ? new V(e.code, n, e.message, e.blockId) : e;
1053
+ throw e instanceof W ? new W(e.code, n, e.message, e.blockId) : e;
1054
1054
  }
1055
1055
  }, f = (e, t) => {
1056
1056
  a = d(a, e, t), u.push(...e);
1057
1057
  }, p = (e, n) => {
1058
1058
  let o = c.get(e);
1059
1059
  if (!o?.changed) return;
1060
- let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = M(a), d = at(u, ot(u, e).parent), p = M(s);
1060
+ let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = N(a), d = at(u, ot(u, e).parent), p = N(s);
1061
1061
  if (o.added) p = lt(l), p.type === "section" && s.type === "section" && (p.children = s.children, p.columns = s.columns);
1062
1062
  else {
1063
1063
  let e = p.type === "section" ? {
@@ -1065,9 +1065,9 @@ function ut(e, t, n, r) {
1065
1065
  children: p.children,
1066
1066
  columns: p.columns
1067
1067
  } : l;
1068
- De(p, e, (e) => $(a.blocks).get(e) ?? null), p = ne(p);
1068
+ Oe(p, e, (e) => $(a.blocks).get(e) ?? null), p = F(p);
1069
1069
  let n = p.l10n?.[t];
1070
- ct(p, t, ke(n, Ee(p, o.initial, n, r), Ee(p, l, n, r), p, l));
1070
+ ct(p, t, Ae(n, De(p, o.initial, n, r), De(p, l, n, r), p, l));
1071
1071
  }
1072
1072
  d[d.findIndex((t) => t.id === e)] = p, f(it(a, u), n), o.changed = !1;
1073
1073
  }, m = (e, t, n) => {
@@ -1088,7 +1088,7 @@ function ut(e, t, n, r) {
1088
1088
  op: "updateBlock",
1089
1089
  blockId: e.blockId,
1090
1090
  set: { columns: i.columns },
1091
- ...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, j(u, e) ?? null])) } : {}
1091
+ ...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, M(u, e) ?? null])) } : {}
1092
1092
  }], n);
1093
1093
  };
1094
1094
  n.forEach((e, t) => {
@@ -1133,8 +1133,8 @@ function ut(e, t, n, r) {
1133
1133
  });
1134
1134
  for (let e of c.keys()) p(e, n.length - 1);
1135
1135
  if (s) {
1136
- let e = M(a), r = e.settings.l10n?.[t];
1137
- ct(e.settings, t, ke(r, Oe(e.settings, o, r), Oe(e.settings, i.settings, r), e.settings, i.settings)), f(it(a, e), n.length - 1);
1136
+ let e = N(a), r = e.settings.l10n?.[t];
1137
+ ct(e.settings, t, Ae(r, ke(e.settings, o, r), ke(e.settings, i.settings, r), e.settings, i.settings)), f(it(a, e), n.length - 1);
1138
1138
  }
1139
1139
  return u;
1140
1140
  }
@@ -1190,14 +1190,14 @@ function Ct(e) {
1190
1190
  });
1191
1191
  }
1192
1192
  function wt(e) {
1193
- let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), i = e.maxUndo ?? mt, a = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", o = y([]), s = y(/* @__PURE__ */ new Map()), c = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = p(null), m = p(null), h = p(0), g = p(0), _ = null, b = null, S = !1, C = !1, w = !1, T = !1, E = null, O = 0, k = !1, ee = [], A = null, j = null, te = Promise.resolve(), ne = null, re = r(() => (g.value, (b?.undo.length ?? 0) > 0)), ie = r(() => (g.value, (b?.redo.length ?? 0) > 0));
1194
- function N(t) {
1193
+ let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), i = e.maxUndo ?? mt, a = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", o = y([]), s = y(/* @__PURE__ */ new Map()), c = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = p(null), m = p(null), h = p(0), g = p(0), _ = null, b = null, S = !1, C = !1, w = !1, T = !1, D = null, O = 0, ee = !1, k = [], A = null, j = null, te = Promise.resolve(), ne = null, M = r(() => (g.value, (b?.undo.length ?? 0) > 0)), re = r(() => (g.value, (b?.redo.length ?? 0) > 0));
1194
+ function P(t) {
1195
1195
  e.onError?.(t instanceof Error ? t : Error(String(t)));
1196
1196
  }
1197
- function P(t, n = b) {
1198
- n !== b || k || e.onNotice?.(t);
1197
+ function F(t, n = b) {
1198
+ n !== b || ee || e.onNotice?.(t);
1199
1199
  }
1200
- function F() {
1200
+ function I() {
1201
1201
  return {
1202
1202
  locks: [...s.value.values()].map((e) => ({
1203
1203
  blockId: e.blockId,
@@ -1207,99 +1207,99 @@ function wt(e) {
1207
1207
  session: n
1208
1208
  };
1209
1209
  }
1210
- function I() {
1210
+ function L() {
1211
1211
  g.value++;
1212
1212
  }
1213
- function ae(e, t) {
1213
+ function R(e, t) {
1214
1214
  e.push(t), e.length > i && e.splice(0, e.length - i);
1215
1215
  }
1216
- function L(e) {
1216
+ function z(e) {
1217
1217
  if (!_ || S) return;
1218
1218
  C = !0;
1219
1219
  try {
1220
1220
  let t = _.content.value, n = it(t, e);
1221
1221
  if (n.length > 0) try {
1222
- fe(t, n);
1222
+ pe(t, n);
1223
1223
  } catch {
1224
- _.setContent(M(e), !1);
1224
+ _.setContent(N(e), !1);
1225
1225
  }
1226
- R(_.content.value, e) || _.setContent(M(e), !1);
1226
+ V(_.content.value, e) || _.setContent(N(e), !1);
1227
1227
  } finally {
1228
1228
  C = !1;
1229
1229
  }
1230
1230
  let t = _.state.selectedBlockId;
1231
1231
  t && !xt(e.blocks, t) && _.selectBlock(null);
1232
1232
  }
1233
- function z() {
1233
+ function B() {
1234
1234
  C || T || (T = !0, queueMicrotask(() => {
1235
1235
  T = !1, H(!1);
1236
1236
  }));
1237
1237
  }
1238
- function B() {
1239
- E &&= (clearTimeout(E), null);
1238
+ function ie() {
1239
+ D &&= (clearTimeout(D), null);
1240
1240
  }
1241
1241
  function H(e, t = !1) {
1242
1242
  let n = b;
1243
1243
  if (!_ || !n || S || C || _.state.isLoading && !t || _.state.template?.id !== n.templateId) return;
1244
1244
  let r = it(n.view, _.content.value);
1245
- if (r.length === 0) B();
1245
+ if (r.length === 0) ie();
1246
1246
  else {
1247
1247
  if (!e && St(r)) {
1248
1248
  let e = Date.now();
1249
- if (E === null && (O = e), e - O < 1e3) {
1250
- E && clearTimeout(E), E = setTimeout(() => {
1251
- E = null, H(!0);
1249
+ if (D === null && (O = e), e - O < 1e3) {
1250
+ D && clearTimeout(D), D = setTimeout(() => {
1251
+ D = null, H(!0);
1252
1252
  }, 300);
1253
1253
  return;
1254
1254
  }
1255
1255
  }
1256
- B(), oe(n, r);
1256
+ ie(), G(n, r);
1257
1257
  }
1258
1258
  }
1259
1259
  function U() {
1260
1260
  H(!0);
1261
1261
  }
1262
- function oe(e, t) {
1262
+ function G(e, t) {
1263
1263
  let n = t, r;
1264
1264
  try {
1265
- r = D(e.view, n, F());
1265
+ r = E(e.view, n, I());
1266
1266
  } catch (n) {
1267
- if (!(n instanceof V)) throw n;
1268
- L(e.view);
1269
- let r = n.blockId === void 0 ? void 0 : ke(n.blockId).find((e) => {
1267
+ if (!(n instanceof W)) throw n;
1268
+ z(e.view);
1269
+ let r = n.blockId === void 0 ? void 0 : Ae(n.blockId).find((e) => {
1270
1270
  let r = t[n.opIndex];
1271
1271
  return r.op !== "updateBlockLocale" || e.locale == null || e.locale === r.locale;
1272
1272
  })?.holder;
1273
- P({
1273
+ F({
1274
1274
  type: "editRefused",
1275
1275
  code: n.code,
1276
1276
  ...r ? { holder: r } : {}
1277
- }), n.code === "invalid_operation" && N(n);
1277
+ }), n.code === "invalid_operation" && P(n);
1278
1278
  return;
1279
1279
  }
1280
1280
  let i = _.content.value;
1281
- if (!R(r, i)) {
1282
- N(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
1281
+ if (!V(r, i)) {
1282
+ P(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
1283
1283
  op: "setContent",
1284
- content: M(i)
1284
+ content: N(i)
1285
1285
  }];
1286
1286
  try {
1287
- r = D(e.view, n, F());
1287
+ r = E(e.view, n, I());
1288
1288
  } catch (t) {
1289
- if (!(t instanceof V)) throw t;
1290
- L(e.view), P({
1289
+ if (!(t instanceof W)) throw t;
1290
+ z(e.view), F({
1291
1291
  type: "editRefused",
1292
1292
  code: t.code
1293
1293
  });
1294
1294
  return;
1295
1295
  }
1296
1296
  }
1297
- let a = _t({ ops: le(e.view, n) }, r);
1298
- ae(e.undo, a), e.redo = [], I();
1297
+ let a = _t({ ops: se(e.view, n) }, r);
1298
+ R(e.undo, a), e.redo = [], L();
1299
1299
  let o = e.view;
1300
- e.view = r, se(e, n, "edit", a, o);
1300
+ e.view = r, ae(e, n, "edit", a, o);
1301
1301
  }
1302
- function se(e, t, n, r, i) {
1302
+ function ae(e, t, n, r, i) {
1303
1303
  let a = { dropped: !1 }, o = 0, s = i;
1304
1304
  do {
1305
1305
  let i = t.slice(o, o + ht);
@@ -1313,17 +1313,17 @@ function wt(e) {
1313
1313
  revision: null,
1314
1314
  ...s && i.some((e) => e.op === "setContent") ? { base: s } : {}
1315
1315
  }), o += ht, s && t.slice(o).some((e) => e.op === "setContent")) try {
1316
- s = D(s, i);
1316
+ s = E(s, i);
1317
1317
  } catch {
1318
1318
  s = null;
1319
1319
  }
1320
1320
  } while (o < t.length);
1321
- W(e);
1321
+ oe(e);
1322
1322
  }
1323
- function W(e) {
1323
+ function oe(e) {
1324
1324
  if (e.inFlight || w) return;
1325
1325
  let t = e.pending.find((e) => !e.sent);
1326
- t ? (t.sent = !0, e.inFlight = t, ce(e, t, 0)) : G(e);
1326
+ t ? (t.sent = !0, e.inFlight = t, ce(e, t, 0)) : K(e);
1327
1327
  }
1328
1328
  function ce(e, n, r) {
1329
1329
  t.submit(e.templateId, {
@@ -1332,125 +1332,125 @@ function wt(e) {
1332
1332
  ops: n.ops,
1333
1333
  ...n.origin === "ai" ? { origin: "ai" } : {}
1334
1334
  }).then(({ revision: t }) => {
1335
- e.inFlight = null, ue(e, n, t), W(e);
1335
+ e.inFlight = null, le(e, n, t), oe(e);
1336
1336
  }, (t) => {
1337
- if (vt(t) !== null) e.inFlight = null, he(e, n, t), W(e);
1337
+ if (vt(t) !== null) e.inFlight = null, me(e, n, t), oe(e);
1338
1338
  else if (bt(t)) {
1339
- K(e, t);
1339
+ q(e, t);
1340
1340
  let i = pt[Math.min(r, pt.length - 1)];
1341
1341
  setTimeout(() => {
1342
- k || ce(e, n, r + 1);
1342
+ ee || ce(e, n, r + 1);
1343
1343
  }, i);
1344
- } else e.inFlight = null, N(t), he(e, n, t), W(e);
1344
+ } else e.inFlight = null, P(t), me(e, n, t), oe(e);
1345
1345
  });
1346
1346
  }
1347
- function ue(e, t, n) {
1348
- t.revision === null && (t.revision = n, n <= e.revision ? (de(e, t), ye(e)) : (e.own.set(n, t), ve(e)));
1347
+ function le(e, t, n) {
1348
+ t.revision === null && (t.revision = n, n <= e.revision ? (ue(e, t), ve(e)) : (e.own.set(n, t), _e(e)));
1349
1349
  }
1350
- function de(e, t) {
1351
- e.pending = e.pending.filter((e) => e !== t), G(e);
1350
+ function ue(e, t) {
1351
+ e.pending = e.pending.filter((e) => e !== t), K(e);
1352
1352
  }
1353
- function pe(e, t) {
1353
+ function de(e, t) {
1354
1354
  if (t.entry) {
1355
1355
  for (let n of [e.undo, e.redo]) {
1356
1356
  let e = n.indexOf(t.entry);
1357
1357
  e !== -1 && n.splice(e, 1);
1358
1358
  }
1359
- I();
1359
+ L();
1360
1360
  }
1361
1361
  }
1362
- function me(e, t) {
1362
+ function fe(e, t) {
1363
1363
  let n = !t.group.dropped;
1364
- return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && pe(e, t), G(e), n;
1364
+ return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && de(e, t), K(e), n;
1365
1365
  }
1366
- function he(e, t, n) {
1367
- if (de(e, t), me(e, t)) {
1366
+ function me(e, t, n) {
1367
+ if (ue(e, t), fe(e, t)) {
1368
1368
  let r = vt(n) ?? "invalid_operation";
1369
1369
  if (t.origin === "edit" || t.origin === "ai") {
1370
1370
  let t = yt(n);
1371
- P({
1371
+ F({
1372
1372
  type: "editRefused",
1373
1373
  code: r,
1374
1374
  ...t ? { holder: t } : {}
1375
1375
  }, e);
1376
- } else P({
1376
+ } else F({
1377
1377
  type: "undoSkipped",
1378
1378
  code: r
1379
1379
  }, e);
1380
1380
  }
1381
- ye(e), e === b && q();
1381
+ ve(e), e === b && J();
1382
1382
  }
1383
- function G(e) {
1383
+ function K(e) {
1384
1384
  if (!(e.pending.length > 0 || e.waiters.length === 0)) for (let t of e.waiters.splice(0)) t.resolve();
1385
1385
  }
1386
- function K(e, t) {
1386
+ function q(e, t) {
1387
1387
  let n = t instanceof Error ? t : Error(String(t));
1388
1388
  for (let t of e.waiters.splice(0)) t.reject(n);
1389
1389
  }
1390
- function ge(e, t) {
1390
+ function he(e, t) {
1391
1391
  if (t.revision <= e.revision) return;
1392
1392
  let n = e.pending.find((e) => e.batchId === t.batchId);
1393
- n ? ue(e, n, t.revision) : (e.remote.set(t.revision, t), ve(e));
1393
+ n ? le(e, n, t.revision) : (e.remote.set(t.revision, t), _e(e));
1394
1394
  }
1395
- function _e(t, n) {
1395
+ function ge(t, n) {
1396
1396
  let r = n.ops;
1397
1397
  if (e.normalizeRemoteOperations) try {
1398
1398
  r = e.normalizeRemoteOperations(n.ops, t.confirmed);
1399
1399
  } catch (e) {
1400
- N(e);
1400
+ P(e);
1401
1401
  }
1402
1402
  return Ct(r);
1403
1403
  }
1404
- function ve(t) {
1404
+ function _e(t) {
1405
1405
  let n = [], r = !1;
1406
1406
  for (;;) {
1407
1407
  let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
1408
1408
  if (!i && !a) break;
1409
1409
  try {
1410
- t.confirmed = D(t.confirmed, i ? _e(t, i) : a.ops);
1410
+ t.confirmed = E(t.confirmed, i ? ge(t, i) : a.ops);
1411
1411
  } catch {
1412
1412
  if (t.recovering) {
1413
- t.remote.clear(), t.own.clear(), N(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
1413
+ t.remote.clear(), t.own.clear(), P(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
1414
1414
  return;
1415
1415
  }
1416
- Ce(t);
1416
+ Se(t);
1417
1417
  return;
1418
1418
  }
1419
- t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), de(t, a));
1419
+ t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), ue(t, a));
1420
1420
  }
1421
- if (t === b && (h.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? xe(t) : Se(t), (n.length !== 0 || r) && (ye(t), t === b)) for (let t of n) try {
1421
+ if (t === b && (h.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? be(t) : xe(t), (n.length !== 0 || r) && (ve(t), t === b)) for (let t of n) try {
1422
1422
  e.onRemoteChange?.({
1423
1423
  actor: t.actor,
1424
1424
  ops: t.ops,
1425
1425
  locale: t.ops.find((e) => e.op !== "setDefaultLocale" && "locale" in e)?.locale ?? null
1426
1426
  });
1427
1427
  } catch (e) {
1428
- N(e);
1428
+ P(e);
1429
1429
  }
1430
1430
  }
1431
- function ye(e) {
1431
+ function ve(e) {
1432
1432
  let t = !w;
1433
1433
  w = !0;
1434
1434
  try {
1435
- be(e);
1435
+ ye(e);
1436
1436
  } finally {
1437
1437
  t && (w = !1);
1438
1438
  }
1439
- t && W(e);
1439
+ t && oe(e);
1440
1440
  }
1441
- function be(e) {
1441
+ function ye(e) {
1442
1442
  e === b && U();
1443
1443
  let t = e.confirmed;
1444
1444
  for (let n = 0; n < e.pending.length; n++) {
1445
1445
  let r = e.pending[n], i;
1446
- if (r.base && !R(r.base, t)) i = "precondition_failed";
1446
+ if (r.base && !V(r.base, t)) i = "precondition_failed";
1447
1447
  else try {
1448
- t = D(t, r.ops);
1448
+ t = E(t, r.ops);
1449
1449
  continue;
1450
1450
  } catch (e) {
1451
- i = e instanceof V ? e.code : "invalid_operation";
1451
+ i = e instanceof W ? e.code : "invalid_operation";
1452
1452
  }
1453
- r.sent || (me(e, r) && P(r.origin === "edit" || r.origin === "ai" ? {
1453
+ r.sent || (fe(e, r) && F(r.origin === "edit" || r.origin === "ai" ? {
1454
1454
  type: "editRefused",
1455
1455
  code: i
1456
1456
  } : {
@@ -1458,54 +1458,54 @@ function wt(e) {
1458
1458
  code: i
1459
1459
  }, e), t = e.confirmed, n = -1);
1460
1460
  }
1461
- e.view = t, G(e), e === b && L(t);
1461
+ e.view = t, K(e), e === b && z(t);
1462
1462
  }
1463
- function xe(e) {
1463
+ function be(e) {
1464
1464
  e.gapTimer ||= setTimeout(() => {
1465
- e.gapTimer = null, e === b && q();
1465
+ e.gapTimer = null, e === b && J();
1466
1466
  }, dt);
1467
1467
  }
1468
- function Se(e) {
1468
+ function xe(e) {
1469
1469
  e.gapTimer &&= (clearTimeout(e.gapTimer), null);
1470
1470
  }
1471
- function q() {
1471
+ function J() {
1472
1472
  let e = b;
1473
1473
  return e ? (e.catchingUp ||= (async () => {
1474
1474
  try {
1475
1475
  let n = await t.operationsAfter(e.templateId, e.revision);
1476
1476
  if (e.retired) return;
1477
1477
  if ("resync" in n) {
1478
- await Ce(e);
1478
+ await Se(e);
1479
1479
  return;
1480
1480
  }
1481
- for (let t of n.batches) ge(e, t);
1481
+ for (let t of n.batches) he(e, t);
1482
1482
  } catch (e) {
1483
- N(e);
1483
+ P(e);
1484
1484
  } finally {
1485
1485
  e.catchingUp = null;
1486
1486
  }
1487
1487
  })(), e.catchingUp) : Promise.resolve();
1488
1488
  }
1489
- async function Ce(t) {
1489
+ async function Se(t) {
1490
1490
  t.recovering = !0;
1491
1491
  try {
1492
1492
  let n = await e.loadTemplate(t.templateId);
1493
1493
  if (t.retired) return;
1494
1494
  let r = n.revision ?? t.revision;
1495
- t.confirmed = M(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
1496
- for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), de(t, n));
1497
- t === b && (h.value = r), ye(t), ve(t);
1495
+ t.confirmed = N(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
1496
+ for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), ue(t, n));
1497
+ t === b && (h.value = r), ve(t), _e(t);
1498
1498
  } catch (e) {
1499
- N(e);
1499
+ P(e);
1500
1500
  } finally {
1501
1501
  t.recovering = !1;
1502
1502
  }
1503
1503
  }
1504
- function J(t) {
1504
+ function Y(t) {
1505
1505
  let n = () => t === b && !t.retired;
1506
1506
  return {
1507
1507
  onBatch: (e) => {
1508
- n() && ge(t, e);
1508
+ n() && he(t, e);
1509
1509
  },
1510
1510
  onResync: (r, i) => {
1511
1511
  if (!(!n() || r <= t.revision)) {
@@ -1515,38 +1515,38 @@ function wt(e) {
1515
1515
  actor: i
1516
1516
  });
1517
1517
  } catch (e) {
1518
- N(e);
1518
+ P(e);
1519
1519
  }
1520
- q();
1520
+ J();
1521
1521
  }
1522
1522
  },
1523
1523
  onLock: (e) => {
1524
- n() && je(e);
1524
+ n() && Me(e);
1525
1525
  },
1526
1526
  onUnlock: (e, t, r) => {
1527
- n() && Me(e, t, r);
1527
+ n() && Ne(e, t, r);
1528
1528
  },
1529
1529
  onMembers: (e) => {
1530
- n() && Z(e);
1530
+ n() && X(e);
1531
1531
  },
1532
1532
  onConnectionChange: (e) => {
1533
- n() && X(t, e);
1533
+ n() && Ee(t, e);
1534
1534
  }
1535
1535
  };
1536
1536
  }
1537
- function Y(e, r) {
1537
+ function Ce(e, r) {
1538
1538
  let i = d;
1539
- t.join(e.templateId, { sessionId: n }, J(e)).then((t) => {
1540
- e.retired || e !== b ? r || t.leave() : (e.leave = t.leave, Ne(t.locks, !r, i), Z(t.members), t.members.length > 0 && (m.value = "connected"), t.revision > e.revision && q(), r && Pe());
1541
- }, (e) => N(e));
1539
+ t.join(e.templateId, { sessionId: n }, Y(e)).then((t) => {
1540
+ e.retired || e !== b ? r || t.leave() : (e.leave = t.leave, Pe(t.locks, !r, i), X(t.members), t.members.length > 0 && (m.value = "connected"), t.revision > e.revision && J(), r && Q());
1541
+ }, (e) => P(e));
1542
1542
  }
1543
1543
  function we(e) {
1544
- let t = M(e.content), n = {
1544
+ let t = N(e.content), n = {
1545
1545
  templateId: e.id,
1546
1546
  confirmed: t,
1547
1547
  revision: e.revision ?? 0,
1548
1548
  pending: [],
1549
- view: M(t),
1549
+ view: N(t),
1550
1550
  remote: /* @__PURE__ */ new Map(),
1551
1551
  own: /* @__PURE__ */ new Map(),
1552
1552
  inFlight: null,
@@ -1559,63 +1559,63 @@ function wt(e) {
1559
1559
  redo: [],
1560
1560
  waiters: []
1561
1561
  };
1562
- b = n, h.value = n.revision, I(), Y(n, !1), _?.state.selectedBlockId && ze(_.state.selectedBlockId), z();
1562
+ b = n, h.value = n.revision, L(), Ce(n, !1), _?.state.selectedBlockId && ze(_.state.selectedBlockId), B();
1563
1563
  }
1564
1564
  function Te(e) {
1565
- e.retired = !0, Se(e), e.leave?.(), e.leave = null, K(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
1565
+ e.retired = !0, xe(e), e.leave?.(), e.leave = null, q(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
1566
1566
  }
1567
- function X(e, t) {
1567
+ function Ee(e, t) {
1568
1568
  let n = m.value;
1569
- m.value = t, t === "connected" && n !== null && n !== "connected" && Y(e, !0);
1569
+ m.value = t, t === "connected" && n !== null && n !== "connected" && Ce(e, !0);
1570
1570
  }
1571
- function Ee(e) {
1572
- b && b.templateId === e?.id || (b &&= (B(), Te(b), null), o.value = [], s.value = /* @__PURE__ */ new Map(), m.value = null, A = null, Pe(), I(), e && we(e));
1571
+ function De(e) {
1572
+ b && b.templateId === e?.id || (b &&= (ie(), Te(b), null), o.value = [], s.value = /* @__PURE__ */ new Map(), m.value = null, A = null, Q(), L(), e && we(e));
1573
1573
  }
1574
- function De(e, t) {
1574
+ function Oe(e, t) {
1575
1575
  return `${e}\u0000${t ?? ""}`;
1576
1576
  }
1577
- function Oe(e, t, n) {
1577
+ function ke(e, t, n) {
1578
1578
  return e.blockId === t && (n == null || e.locale == null || e.locale === n);
1579
1579
  }
1580
- function ke(e) {
1580
+ function Ae(e) {
1581
1581
  return [...s.value.values()].filter((t) => t.blockId === e);
1582
1582
  }
1583
- function Ae(e) {
1583
+ function je(e) {
1584
1584
  e !== f.value && (U(), f.value = e, ze(_?.state.selectedBlockId ?? null));
1585
1585
  }
1586
- function je(e, t = !1) {
1586
+ function Me(e, t = !1) {
1587
1587
  if (e.holder.sessionId === n) return;
1588
1588
  t ? c.add(e) : u.set(e, ++d);
1589
1589
  let r = new Map([...s.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
1590
- r.set(De(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), P({
1590
+ r.set(Oe(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), F({
1591
1591
  type: "selectionRefused",
1592
1592
  blockId: e.blockId,
1593
1593
  holder: e.holder
1594
1594
  }));
1595
1595
  }
1596
- function Me(e, t, n) {
1597
- let r = De(e, n), i = new Map([...s.value].filter(([n, i]) => i.holder.sessionId !== t || n !== r && !(i.blockId === e && c.has(i))));
1596
+ function Ne(e, t, n) {
1597
+ let r = Oe(e, n), i = new Map([...s.value].filter(([n, i]) => i.holder.sessionId !== t || n !== r && !(i.blockId === e && c.has(i))));
1598
1598
  i.size !== s.value.size && (s.value = i);
1599
1599
  }
1600
- function Ne(e, t, r) {
1600
+ function Pe(e, t, r) {
1601
1601
  let i = new Map([...s.value].filter(([, e]) => !c.has(e) && (t || (u.get(e) ?? 0) > r))), a = [...i.values()];
1602
- for (let t of e) if (t.holder.sessionId !== n && !a.some((e) => e.holder.sessionId === t.holder.sessionId || Oe(e, t.blockId, t.locale))) {
1602
+ for (let t of e) if (t.holder.sessionId !== n && !a.some((e) => e.holder.sessionId === t.holder.sessionId || ke(e, t.blockId, t.locale))) {
1603
1603
  for (let [e, n] of i) n.holder.sessionId === t.holder.sessionId && i.delete(e);
1604
- i.set(De(t.blockId, t.locale), t);
1604
+ i.set(Oe(t.blockId, t.locale), t);
1605
1605
  }
1606
1606
  s.value = i;
1607
1607
  }
1608
- function Z(e) {
1608
+ function X(e) {
1609
1609
  let t = new Set(e.map((e) => e.sessionId)), n = new Set(o.value.map((e) => e.sessionId).filter((e) => !t.has(e)));
1610
1610
  if (o.value = e, n.size === 0) return;
1611
1611
  let r = new Map([...s.value].filter(([, e]) => !n.has(e.holder.sessionId)));
1612
1612
  r.size !== s.value.size && (s.value = r);
1613
1613
  }
1614
- function Q(e) {
1615
- te = te.then(e).catch(N);
1614
+ function Z(e) {
1615
+ te = te.then(e).catch(P);
1616
1616
  }
1617
- function Pe() {
1618
- a && Q(async () => {
1617
+ function Q() {
1618
+ a && Z(async () => {
1619
1619
  if (j && (A === null || j.templateId !== A.templateId || j.locale !== A.locale)) {
1620
1620
  let e = j;
1621
1621
  j = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale);
@@ -1635,7 +1635,7 @@ function wt(e) {
1635
1635
  });
1636
1636
  }
1637
1637
  function Fe(e, t) {
1638
- let n = new Map([...s.value].filter(([, n]) => !Oe(n, e, t)));
1638
+ let n = new Map([...s.value].filter(([, n]) => !ke(n, e, t)));
1639
1639
  n.size !== s.value.size && (s.value = n);
1640
1640
  }
1641
1641
  function Ie(e, t) {
@@ -1643,27 +1643,27 @@ function wt(e) {
1643
1643
  if (n === "lock_held" || n === "block_missing") {
1644
1644
  A = null;
1645
1645
  let n = yt(t);
1646
- n ? je({
1646
+ n ? Me({
1647
1647
  blockId: e,
1648
1648
  holder: n,
1649
1649
  expiresAt: ""
1650
1650
  }, !0) : _?.state.selectedBlockId === e && _.selectBlock(null);
1651
- } else N(t), setTimeout(() => {
1652
- A?.blockId === e && Pe();
1651
+ } else P(t), setTimeout(() => {
1652
+ A?.blockId === e && Q();
1653
1653
  }, pt[0]);
1654
1654
  }
1655
1655
  function Le() {
1656
1656
  ne ||= setInterval(() => {
1657
- Q(async () => {
1657
+ Z(async () => {
1658
1658
  let e = j;
1659
1659
  if (e) try {
1660
1660
  await t.renewLock(e.templateId, e.blockId, e.locale);
1661
1661
  } catch (e) {
1662
1662
  if (vt(e) === "lock_lost") {
1663
- j = null, Re(), Pe();
1663
+ j = null, Re(), Q();
1664
1664
  return;
1665
1665
  }
1666
- N(e);
1666
+ P(e);
1667
1667
  }
1668
1668
  });
1669
1669
  }, ft);
@@ -1676,7 +1676,7 @@ function wt(e) {
1676
1676
  templateId: b.templateId,
1677
1677
  blockId: e,
1678
1678
  locale: f.value
1679
- } : null, Pe());
1679
+ } : null, Q());
1680
1680
  }
1681
1681
  function Be() {
1682
1682
  U(), j && a && (t.releaseLock(j.templateId, j.blockId, j.locale).catch(() => {}), j = null, Re()), b?.leave?.(), b && (b.leave = null);
@@ -1687,8 +1687,8 @@ function wt(e) {
1687
1687
  U();
1688
1688
  let n = (e === "undo" ? t.undo : t.redo).pop();
1689
1689
  if (!n) return;
1690
- if (I(), n.view && !R(n.view, t.view)) {
1691
- P({
1690
+ if (L(), n.view && !V(n.view, t.view)) {
1691
+ F({
1692
1692
  type: "undoSkipped",
1693
1693
  code: "precondition_failed"
1694
1694
  });
@@ -1696,30 +1696,30 @@ function wt(e) {
1696
1696
  }
1697
1697
  let r;
1698
1698
  try {
1699
- r = D(t.view, n.ops, F());
1699
+ r = E(t.view, n.ops, I());
1700
1700
  } catch (e) {
1701
- if (!(e instanceof V)) throw e;
1702
- P({
1701
+ if (!(e instanceof W)) throw e;
1702
+ F({
1703
1703
  type: "undoSkipped",
1704
1704
  code: e.code
1705
1705
  });
1706
1706
  return;
1707
1707
  }
1708
- let i = _t({ ops: le(t.view, n.ops) }, r);
1709
- ae(e === "undo" ? t.redo : t.undo, i);
1708
+ let i = _t({ ops: se(t.view, n.ops) }, r);
1709
+ R(e === "undo" ? t.redo : t.undo, i);
1710
1710
  let a = t.view;
1711
- t.view = r, L(r), _?.markDirty(), se(t, n.ops, e, i, a);
1711
+ t.view = r, z(r), _?.markDirty(), ae(t, n.ops, e, i, a);
1712
1712
  }
1713
1713
  function He(e, t) {
1714
1714
  let n = b;
1715
1715
  if (!_ || !n || S) return {
1716
1716
  applied: !1,
1717
- error: new V("invalid_operation", 0, "No template is open for editing.")
1717
+ error: new W("invalid_operation", 0, "No template is open for editing.")
1718
1718
  };
1719
1719
  if (t.origin === void 0) try {
1720
- D(_.content.value, e, F());
1720
+ E(_.content.value, e, I());
1721
1721
  } catch (e) {
1722
- if (e instanceof V) return {
1722
+ if (e instanceof W) return {
1723
1723
  applied: !1,
1724
1724
  error: e
1725
1725
  };
@@ -1728,9 +1728,9 @@ function wt(e) {
1728
1728
  U();
1729
1729
  let r, i;
1730
1730
  try {
1731
- r = D(n.view, e, F()), i = le(n.view, e);
1731
+ r = E(n.view, e, I()), i = se(n.view, e);
1732
1732
  } catch (e) {
1733
- if (e instanceof V) return {
1733
+ if (e instanceof W) return {
1734
1734
  applied: !1,
1735
1735
  error: e
1736
1736
  };
@@ -1738,15 +1738,15 @@ function wt(e) {
1738
1738
  }
1739
1739
  let a = n.undo.at(-1), o;
1740
1740
  if (t.origin === "ai" && t.turn !== void 0 && a && a.turn === t.turn) {
1741
- let e = a.view !== void 0 && !R(a.view, n.view);
1741
+ let e = a.view !== void 0 && !V(a.view, n.view);
1742
1742
  a.ops = [...i, ...a.ops], o = e ? a : _t(a, r);
1743
1743
  } else o = _t({
1744
1744
  ops: i,
1745
1745
  ...t.origin === "ai" && t.turn !== void 0 ? { turn: t.turn } : {}
1746
- }, r), ae(n.undo, o);
1747
- n.redo = [], I();
1746
+ }, r), R(n.undo, o);
1747
+ n.redo = [], L();
1748
1748
  let s = n.view;
1749
- return n.view = r, L(r), _.markDirty(), se(n, e, t.origin ?? "edit", o, s), {
1749
+ return n.view = r, z(r), _.markDirty(), ae(n, e, t.origin ?? "edit", o, s), {
1750
1750
  applied: !0,
1751
1751
  inverse: i
1752
1752
  };
@@ -1757,25 +1757,25 @@ function wt(e) {
1757
1757
  if (t.moveBlock && t.findBlockLocation) {
1758
1758
  let n = t.moveBlock, r = (...r) => {
1759
1759
  let i = b, a = i && !S && !C && !e.state.isLoading && e.state.template?.id === i.templateId;
1760
- if (a && H(!0), n(...r), !a || R(i.view, e.content.value)) return;
1760
+ if (a && H(!0), n(...r), !a || V(i.view, e.content.value)) return;
1761
1761
  let o = t.findBlockLocation(r[0]);
1762
1762
  if (!o) return;
1763
1763
  let s = o.targetSectionId ? {
1764
1764
  sectionId: o.targetSectionId,
1765
1765
  column: o.columnIndex ?? 0
1766
1766
  } : null, c = s ? e.content.value.blocks.find((e) => e.id === s.sectionId) : void 0, l = s && c?.type === "section" ? c.children[s.column] : e.content.value.blocks;
1767
- oe(i, [{
1767
+ G(i, [{
1768
1768
  op: "moveBlock",
1769
1769
  blockId: r[0],
1770
1770
  parent: s,
1771
1771
  after: l[o.index - 1]?.id ?? null
1772
1772
  }]);
1773
1773
  };
1774
- t.moveBlock = r, ee.push(() => {
1774
+ t.moveBlock = r, k.push(() => {
1775
1775
  t.moveBlock === r && (t.moveBlock = n);
1776
1776
  });
1777
1777
  }
1778
- ee.push(v(() => e.state.template, (e) => Ee(e), { immediate: !0 }), v(() => e.content.value, z, { deep: !0 }), v(() => e.state.selectedBlockId, ze), v(() => e.state.isLoading, (e) => e ? H(!0, !0) : z())), typeof window < "u" && (window.addEventListener("pagehide", Be), window.addEventListener("blur", U)), x() && l(qe);
1778
+ k.push(v(() => e.state.template, (e) => De(e), { immediate: !0 }), v(() => e.content.value, B, { deep: !0 }), v(() => e.state.selectedBlockId, ze), v(() => e.state.isLoading, (e) => e ? H(!0, !0) : B())), typeof window < "u" && (window.addEventListener("pagehide", Be), window.addEventListener("blur", U)), x() && l(qe);
1779
1779
  }
1780
1780
  function We() {
1781
1781
  U();
@@ -1789,37 +1789,37 @@ function wt(e) {
1789
1789
  U(), S = !0;
1790
1790
  }
1791
1791
  function Ke() {
1792
- S = !1, b && L(b.view);
1792
+ S = !1, b && z(b.view);
1793
1793
  }
1794
1794
  function qe() {
1795
- if (!k) {
1795
+ if (!ee) {
1796
1796
  U();
1797
- for (let e of ee.splice(0)) e();
1798
- B(), Be(), k = !0, b && Te(b), b = null, Re(), typeof window < "u" && (window.removeEventListener("pagehide", Be), window.removeEventListener("blur", U));
1797
+ for (let e of k.splice(0)) e();
1798
+ ie(), Be(), ee = !0, b && Te(b), b = null, Re(), typeof window < "u" && (window.removeEventListener("pagehide", Be), window.removeEventListener("blur", U));
1799
1799
  }
1800
1800
  }
1801
1801
  return {
1802
1802
  sessionId: n,
1803
1803
  members: o,
1804
1804
  locks: s,
1805
- locksOf: ke,
1805
+ locksOf: Ae,
1806
1806
  lockLocale: f,
1807
- setLockLocale: Ae,
1807
+ setLockLocale: je,
1808
1808
  connection: m,
1809
1809
  revision: h,
1810
- canUndo: re,
1811
- canRedo: ie,
1810
+ canUndo: M,
1811
+ canRedo: re,
1812
1812
  attach: Ue,
1813
1813
  undo: () => Ve("undo"),
1814
1814
  redo: () => Ve("redo"),
1815
1815
  clearHistory: () => {
1816
- b && (b.undo = [], b.redo = [], I());
1816
+ b && (b.undo = [], b.redo = [], L());
1817
1817
  },
1818
1818
  flush: U,
1819
1819
  settle: We,
1820
1820
  suspend: Ge,
1821
1821
  resume: Ke,
1822
- catchUp: q,
1822
+ catchUp: J,
1823
1823
  hasConfirmedBlock: (e) => b ? xt(b.confirmed.blocks, e) : !1,
1824
1824
  applyOperations: He,
1825
1825
  destroy: qe
@@ -1841,7 +1841,7 @@ function Tt(e) {
1841
1841
  return s.value && e.canDelete !== !1;
1842
1842
  }
1843
1843
  function u(e, t) {
1844
- throw new z(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1844
+ throw new H(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1845
1845
  }
1846
1846
  function f(t) {
1847
1847
  Fe(e.onError, t);
@@ -1938,7 +1938,7 @@ function Dt(e = {}) {
1938
1938
  },
1939
1939
  async create(e) {
1940
1940
  let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
1941
- id: B(),
1941
+ id: ue(),
1942
1942
  name: e.name,
1943
1943
  content: e.content,
1944
1944
  ...e.category ? { category: e.category } : {},
@@ -2004,7 +2004,7 @@ function At(e = {}) {
2004
2004
  },
2005
2005
  async create(e) {
2006
2006
  let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
2007
- id: B(),
2007
+ id: ue(),
2008
2008
  url: t,
2009
2009
  filename: e.filename || e.file.name,
2010
2010
  createdAt: n,
@@ -2043,11 +2043,11 @@ function jt(e) {
2043
2043
  let { provider: t, getTemplateId: n } = e, r = p([]), i = p(!1), a = p(void 0), o = p(!1), s = /* @__PURE__ */ new Map(), c = d(() => typeof t.create == "function"), l = d(() => typeof t.restore == "function");
2044
2044
  function u(e) {
2045
2045
  let t = n();
2046
- if (!t) throw new z(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
2046
+ if (!t) throw new H(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
2047
2047
  return t;
2048
2048
  }
2049
2049
  function f(e) {
2050
- throw new z(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2050
+ throw new H(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2051
2051
  }
2052
2052
  function m(t) {
2053
2053
  Fe(e.onError, t);
@@ -2125,16 +2125,16 @@ function Mt(e) {
2125
2125
  });
2126
2126
  function g(e) {
2127
2127
  let t = n();
2128
- if (!t) throw new z(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
2128
+ if (!t) throw new H(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
2129
2129
  return t;
2130
2130
  }
2131
2131
  function _(e) {
2132
2132
  let t = r();
2133
- if (!t) throw new z(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
2133
+ if (!t) throw new H(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
2134
2134
  return t;
2135
2135
  }
2136
2136
  function v(e) {
2137
- throw new z(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2137
+ throw new H(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2138
2138
  }
2139
2139
  function y(e) {
2140
2140
  for (let t of i.value) {
@@ -2148,7 +2148,7 @@ function Mt(e) {
2148
2148
  return t !== null && e.author.id === t.id;
2149
2149
  }
2150
2150
  function x(t) {
2151
- let n = Pe(t);
2151
+ let n = Q(t);
2152
2152
  throw e.onError?.(n), n;
2153
2153
  }
2154
2154
  function S(t) {
@@ -2216,7 +2216,7 @@ function Mt(e) {
2216
2216
  o.value = !1;
2217
2217
  }
2218
2218
  }
2219
- async function k(e, n) {
2219
+ async function ee(e, n) {
2220
2220
  let { update: r } = t;
2221
2221
  typeof r != "function" && v("update");
2222
2222
  let i = g("update");
@@ -2230,7 +2230,7 @@ function Mt(e) {
2230
2230
  o.value = !1;
2231
2231
  }
2232
2232
  }
2233
- async function ee(e) {
2233
+ async function k(e) {
2234
2234
  let { delete: n } = t;
2235
2235
  typeof n != "function" && v("delete");
2236
2236
  let r = g("delete");
@@ -2262,10 +2262,10 @@ function Mt(e) {
2262
2262
  function j(e) {
2263
2263
  T(e) && S(() => t.onCreated?.(e, { origin: "remote" }));
2264
2264
  }
2265
- function M(e) {
2265
+ function te(e) {
2266
2266
  T(e) && S(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
2267
2267
  }
2268
- function te(e, n) {
2268
+ function ne(e, n) {
2269
2269
  let r = E(e, n);
2270
2270
  r && S(() => t.onDeleted?.(r, { origin: "remote" }));
2271
2271
  }
@@ -2282,14 +2282,14 @@ function Mt(e) {
2282
2282
  commentCountByBlock: h,
2283
2283
  load: D,
2284
2284
  create: O,
2285
- update: k,
2286
- remove: ee,
2285
+ update: ee,
2286
+ remove: k,
2287
2287
  setResolved: A,
2288
2288
  find: y,
2289
2289
  isOwn: b,
2290
2290
  applyRemoteCreate: j,
2291
- applyRemoteUpdate: M,
2292
- applyRemoteDelete: te
2291
+ applyRemoteUpdate: te,
2292
+ applyRemoteDelete: ne
2293
2293
  };
2294
2294
  }
2295
2295
  function Nt(e) {
@@ -2313,7 +2313,7 @@ function Nt(e) {
2313
2313
  }));
2314
2314
  }, { immediate: !0 }), l(s);
2315
2315
  }
2316
- var Pt = G({
2316
+ var Pt = K({
2317
2317
  name: "code",
2318
2318
  size: 24,
2319
2319
  node: [["path", {
@@ -2323,14 +2323,14 @@ var Pt = G({
2323
2323
  d: "m8 6-6 6 6 6",
2324
2324
  key: "ppft3o"
2325
2325
  }]]
2326
- }), Ft = G({
2326
+ }), Ft = K({
2327
2327
  name: "navigation",
2328
2328
  size: 24,
2329
2329
  node: [["polygon", {
2330
2330
  points: "3 11 22 2 13 21 11 13 3 11",
2331
2331
  key: "1ltx0t"
2332
2332
  }]]
2333
- }), It = G({
2333
+ }), It = K({
2334
2334
  name: "share-2",
2335
2335
  size: 24,
2336
2336
  node: [
@@ -2367,7 +2367,7 @@ var Pt = G({
2367
2367
  key: "1n3mei"
2368
2368
  }]
2369
2369
  ]
2370
- }), Lt = G({
2370
+ }), Lt = K({
2371
2371
  name: "table",
2372
2372
  size: 24,
2373
2373
  node: [
@@ -2424,7 +2424,7 @@ function zt(e) {
2424
2424
  };
2425
2425
  }
2426
2426
  function Bt(e) {
2427
- let n = C(ve, null), r = d(e);
2427
+ let n = C(_e, null), r = d(e);
2428
2428
  if (!n) return r;
2429
2429
  let i;
2430
2430
  function a() {
@@ -2451,14 +2451,14 @@ function Vt(e, t) {
2451
2451
  return typeof n == "string" && n.length > 0 ? n : t;
2452
2452
  }
2453
2453
  function Ht(e, t) {
2454
- return typeof e?.url == "string" && re(e.url, t);
2454
+ return typeof e?.url == "string" && P(e.url, t);
2455
2455
  }
2456
2456
  function Ut(e, t) {
2457
2457
  let n = e?.url;
2458
- if (typeof n == "string" && n.trim() !== "") return re(n, t) ? void 0 : n;
2458
+ if (typeof n == "string" && n.trim() !== "") return P(n, t) ? void 0 : n;
2459
2459
  }
2460
2460
  function Wt(e) {
2461
- let t = C(_e, U.liquid), n = Bt(() => Ut(e(), t));
2461
+ let t = C(ge, ae.liquid), n = Bt(() => Ut(e(), t));
2462
2462
  return d(() => Ht(e(), t) ? null : n.value);
2463
2463
  }
2464
2464
  function Gt(e, t, n) {
@@ -2475,7 +2475,7 @@ function qt(e, t, n = []) {
2475
2475
  }
2476
2476
  // src/utils/resolveFieldColors.ts
2477
2477
  function Jt(e, t) {
2478
- let n = q({ presets: e.presets }, Ce), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
2478
+ let n = J({ presets: e.presets }, Se), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
2479
2479
  return {
2480
2480
  presets: r ? t.presets : n.presets,
2481
2481
  allowCustom: t.allowCustom !== !1 && i,
@@ -2535,7 +2535,7 @@ var tn = /* @__PURE__ */ w({
2535
2535
  size: { default: "field" }
2536
2536
  },
2537
2537
  setup(e) {
2538
- let t = e, { t: r } = xe(), s = {
2538
+ let t = e, { t: r } = be(), s = {
2539
2539
  field: {
2540
2540
  gap: "tpl:gap-1.5",
2541
2541
  icon: 18,
@@ -2550,11 +2550,11 @@ var tn = /* @__PURE__ */ w({
2550
2550
  return (t, s) => (i(), m("div", {
2551
2551
  class: a(["tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]", c.value.gap]),
2552
2552
  style: o({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${c.value.veil}, transparent)` })
2553
- }, [e.uploading ? (i(), m(S, { key: 0 }, [u(f(ge), {
2553
+ }, [e.uploading ? (i(), m(S, { key: 0 }, [u(f(he), {
2554
2554
  class: "tpl-spinner",
2555
2555
  size: c.value.icon,
2556
2556
  "stroke-width": 2
2557
- }, null, 8, ["size"]), h(" " + n(f(r).image.uploading), 1)], 64)) : (i(), m(S, { key: 1 }, [u(f(K), {
2557
+ }, null, 8, ["size"]), h(" " + n(f(r).image.uploading), 1)], 64)) : (i(), m(S, { key: 1 }, [u(f(q), {
2558
2558
  size: c.value.icon,
2559
2559
  "stroke-width": 1.5
2560
2560
  }, null, 8, ["size"]), h(" " + n(f(r).image.dropToUpload), 1)], 64))], 6));
@@ -2570,7 +2570,7 @@ function nn() {
2570
2570
  // src/composables/useImageDrop.ts
2571
2571
  var rn = "image/";
2572
2572
  function an(e) {
2573
- let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || b(r), { isOverDropZone: a } = Se(t, {
2573
+ let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || b(r), { isOverDropZone: a } = xe(t, {
2574
2574
  preventDefaultForUnhandled: !0,
2575
2575
  onDrop: (e) => {
2576
2576
  if (!i()) return;
@@ -2582,7 +2582,7 @@ function an(e) {
2582
2582
  }
2583
2583
  // src/composables/useMediaDropField.ts
2584
2584
  function on(e) {
2585
- let { target: t, blocked: n, apply: r } = e, i = C(ye, null), a = C(be, null), o = nn();
2585
+ let { target: t, blocked: n, apply: r } = e, i = C(ve, null), a = C(ye, null), o = nn();
2586
2586
  async function s() {
2587
2587
  let e = await i?.({ accept: ["images"] });
2588
2588
  o.alive && e && r(e);
@@ -2631,7 +2631,7 @@ var cn = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", ln = {
2631
2631
  "2-1": [66.67, 33.33]
2632
2632
  };
2633
2633
  function un(e, t) {
2634
- let n = (e) => Math.trunc(e ?? 0), r = (e) => N(e) === null ? 0 : Math.trunc(e.width);
2634
+ let n = (e) => Math.trunc(e ?? 0), r = (e) => fe(e) === null ? 0 : Math.trunc(e.width);
2635
2635
  return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
2636
2636
  }
2637
2637
  function dn(e, t) {
@@ -2644,21 +2644,21 @@ function fn(e, t) {
2644
2644
  function* pn(e, t) {
2645
2645
  for (let n of e) ee(n) ? yield* pn(n.children, dn(t, n.styles.padding)) : yield {
2646
2646
  block: n,
2647
- bandWidth: P(n) && n.wrapper ? dn(t, n.wrapper.padding) : t
2647
+ bandWidth: D(n) && n.wrapper ? dn(t, n.wrapper.padding) : t
2648
2648
  };
2649
2649
  }
2650
- function mn(e, t, n = H(e)) {
2650
+ function mn(e, t, n = G(e)) {
2651
2651
  if (!t) return e;
2652
2652
  try {
2653
- return me(ae(t, n, { missing: "default" }), e);
2653
+ return me(ie(t, n, { missing: "default" }), e);
2654
2654
  } catch {
2655
2655
  return e;
2656
2656
  }
2657
2657
  }
2658
2658
  function hn(e, t, n, r) {
2659
2659
  let i = mn(e, n, r);
2660
- for (let { block: e, bandWidth: n } of pn(i.blocks, i.settings.width)) if (P(e)) {
2661
- let r = E(e)?.applied ? void 0 : e.border, i = Math.floor(n) - un(e.styles.padding, r), a = ln[e.columns] ?? [100];
2660
+ for (let { block: e, bandWidth: n } of pn(i.blocks, i.settings.width)) if (D(e)) {
2661
+ let r = B(e)?.applied ? void 0 : e.border, i = Math.floor(n) - un(e.styles.padding, r), a = ln[e.columns] ?? [100];
2662
2662
  for (let n = 0; n < e.children.length; n++) {
2663
2663
  let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
2664
2664
  if (o) return fn(o, r);
@@ -2672,14 +2672,14 @@ function gn(e, t, n, r) {
2672
2672
  return null;
2673
2673
  }
2674
2674
  function _n(e) {
2675
- let t = P(e) ? E(e) : null;
2675
+ let t = D(e) ? B(e) : null;
2676
2676
  return !!t?.applied && t.height === "image";
2677
2677
  }
2678
2678
  function vn(e, t, n, r) {
2679
2679
  if (_n(e)) return (t ? gn(t, e.id, n, r) : null) ?? sn(t?.settings);
2680
2680
  }
2681
2681
  // src/constants/socialIcons.ts
2682
- var yn = se, bn = {
2682
+ var yn = oe, bn = {
2683
2683
  small: 24,
2684
2684
  medium: 32,
2685
2685
  large: 48
@@ -2688,6 +2688,7 @@ var yn = se, bn = {
2688
2688
  "twitter",
2689
2689
  "instagram",
2690
2690
  "linkedin",
2691
+ "xing",
2691
2692
  "youtube",
2692
2693
  "tiktok",
2693
2694
  "pinterest",