@templatical/editor 0.59.2 → 0.60.1

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 (311) hide show
  1. package/dist/{AiAltTextPopover-BhWHOOKX.js → AiAltTextPopover-DSA1wiiW.js} +1 -1
  2. package/dist/{AiAltTextReview-CmW7pLmo.js → AiAltTextReview-B9-vfzCj.js} +1 -1
  3. package/dist/{AiChatPanel-CV0mCtad.js → AiChatPanel-DPoq2Til.js} +8 -8
  4. package/dist/{AiPanels-C8M7q_vM.js → AiPanels-UdfhAzzu.js} +1 -1
  5. package/dist/{AiRewriteMenu-DC2ZLH5L.js → AiRewriteMenu-BaeMlSEx.js} +8 -8
  6. package/dist/{BlockIssueBadge-B8sl9BM1.js → BlockIssueBadge-DQ_6NI4p.js} +2 -2
  7. package/dist/{BlockPreviewCanvas-yhOQAQhJ.js → BlockPreviewCanvas-DWDfih6j.js} +19 -44
  8. package/dist/{CloudPanels-CD0lsL0R.js → CloudPanels-ClHDM3ge.js} +3 -3
  9. package/dist/{CollaborationNotices-DrMrP73M.js → CollaborationNotices-PqWv0q8W.js} +1 -1
  10. package/dist/{CollaboratorBar-TsK872uC.js → CollaboratorBar-p-_PWqXW.js} +1 -1
  11. package/dist/{CommentsPanel-BX8JVrXU.js → CommentsPanel-BUo-YhSX.js} +1 -1
  12. package/dist/{CommentsSidebar-BUlseNwL.js → CommentsSidebar-D_Pz7FPz.js} +10 -10
  13. package/dist/{CountdownToolbar-dx3FVRjh.js → CountdownToolbar-DYFSFwkD.js} +4 -4
  14. package/dist/{IssuesPanel-BwnvXxBC.js → IssuesPanel-C7mBrK6a.js} +9 -9
  15. package/dist/{LanguageMenu-Cf5bKocE.js → LanguageMenu-f7js1FF8.js} +12 -12
  16. package/dist/{LocaleNotices-CGEp0pQ8.js → LocaleNotices-CAvDAawJ.js} +2 -2
  17. package/dist/{LogicTagInsertButton-BdDe-vrZ.js → LogicTagInsertButton-Clc3JTg_.js} +16 -16
  18. package/dist/{MediaEditModal-BWOqjEZN.js → MediaEditModal-YXOL0d_y.js} +1 -1
  19. package/dist/{MediaPanels-C-XrldMu.js → MediaPanels-VCv5epgs.js} +1 -1
  20. package/dist/{MergeTagInput-CTTi-eB0.js → MergeTagInput-B5a9noTB.js} +1 -1
  21. package/dist/{MergeTagModeToggle-Bd0svGQm.js → MergeTagModeToggle-D1r2aH5x.js} +4 -4
  22. package/dist/{MergeTagTextarea-DiahMV-3.js → MergeTagTextarea-CA9dPfMH.js} +5 -5
  23. package/dist/{ParagraphEditor-Db1cmj8Y.js → ParagraphEditor-ByzfpepN.js} +43 -43
  24. package/dist/{RestoreVersionDialog-DA1Z0q9Z.js → RestoreVersionDialog-Da5sTCFI.js} +3 -3
  25. package/dist/{RichTextEditorContent-CyO6e4ZG.js → RichTextEditorContent-gnRxu4-L.js} +4 -4
  26. package/dist/{SaveBlockDialog-D7SaFxa_.js → SaveBlockDialog-BM1Fki_2.js} +7 -7
  27. package/dist/{SavedBlocksBrowserModal-B5r3LWWG.js → SavedBlocksBrowserModal-DHOTdJKB.js} +9 -9
  28. package/dist/{SavedBlocksPanels-BH2f7jm-.js → SavedBlocksPanels-BJ2OM0cG.js} +1 -1
  29. package/dist/{SavedBlocksPickBar-B24TScw0.js → SavedBlocksPickBar-C4Bv1K_9.js} +2 -2
  30. package/dist/{TemplateSettings-CuN9Vkl_.js → TemplateSettings-DsaSsCC8.js} +8 -8
  31. package/dist/{TestEmailModal-C4DAaohi.js → TestEmailModal-CMo0cJik.js} +8 -8
  32. package/dist/{TestEmailPanel-DoMcVJSE.js → TestEmailPanel-B2OoOy9K.js} +1 -1
  33. package/dist/{TitleEditor-b5Pr_m9j.js → TitleEditor--gFbrR7V.js} +9 -9
  34. package/dist/{Toolbar-BOf7Y862.js → Toolbar-UXT03-Dc.js} +1003 -792
  35. package/dist/{TplModal-DAcXzBJh.js → TplModal-DkoyIwy1.js} +1 -1
  36. package/dist/{VersionHistoryMenu-TbIGteNi.js → VersionHistoryMenu-D-RCk3oB.js} +5 -5
  37. package/dist/{VersionHistoryPanels-Ia6ipOqG.js → VersionHistoryPanels-TzzRlmqK.js} +1 -1
  38. package/dist/{VersionPreviewBanner-CRfu6quf.js → VersionPreviewBanner-DMg2sw3V.js} +1 -1
  39. package/dist/{WrapperBlock-BZenrXM6.js → WrapperBlock-B4mdW2CP.js} +3 -3
  40. package/dist/{blockTypeIcons-DdYZy8yG.js → blockTypeIcons-MX-xQH_Z.js} +3 -3
  41. package/dist/bundle-stats.json +6 -6
  42. package/dist/{cdn/chunks/ca-YfIxwO1G.js → ca-C8N05sCU.js} +10 -4
  43. package/dist/cdn/chunks/{AiAltTextPopover-CcX_OMUU.js → AiAltTextPopover-BLNN_Pnd.js} +2 -2
  44. package/dist/cdn/chunks/AiAltTextPopover-BLNN_Pnd.js.map +1 -0
  45. package/dist/cdn/chunks/{AiAltTextReview-Dmm3h0jd.js → AiAltTextReview-Db8vSNpe.js} +2 -2
  46. package/dist/cdn/chunks/AiAltTextReview-Db8vSNpe.js.map +1 -0
  47. package/dist/cdn/chunks/{AiChatPanel-DV23DJ-2.js → AiChatPanel-cIT2haLo.js} +2 -2
  48. package/dist/cdn/chunks/AiChatPanel-cIT2haLo.js.map +1 -0
  49. package/dist/cdn/chunks/{AiPanels-CxhOpMAp.js → AiPanels-B4GG8w3J.js} +2 -2
  50. package/dist/cdn/chunks/AiPanels-B4GG8w3J.js.map +1 -0
  51. package/dist/cdn/chunks/{AiRewriteMenu-87-O514r.js → AiRewriteMenu-C34wZVcW.js} +6 -6
  52. package/dist/cdn/chunks/AiRewriteMenu-C34wZVcW.js.map +1 -0
  53. package/dist/cdn/chunks/{BlockIssueBadge-Dp06vQd3.js → BlockIssueBadge-C50pmOMZ.js} +2 -2
  54. package/dist/cdn/chunks/BlockIssueBadge-C50pmOMZ.js.map +1 -0
  55. package/dist/cdn/chunks/{BlockPreviewCanvas-DQGzUvZ5.js → BlockPreviewCanvas-CUOrwkWR.js} +20 -45
  56. package/dist/cdn/chunks/BlockPreviewCanvas-CUOrwkWR.js.map +1 -0
  57. package/dist/cdn/chunks/CloudHeaderExtras-Cd-ePldd.js.map +1 -1
  58. package/dist/cdn/chunks/{CloudPanels-D8fchoYt.js → CloudPanels-BAGDHObm.js} +3 -3
  59. package/dist/cdn/chunks/CloudPanels-BAGDHObm.js.map +1 -0
  60. package/dist/cdn/chunks/{CollaborationNotices-DNEs3g9B.js → CollaborationNotices-CTmjjbHv.js} +2 -2
  61. package/dist/cdn/chunks/CollaborationNotices-CTmjjbHv.js.map +1 -0
  62. package/dist/cdn/chunks/{CollaboratorBar-CN6XAlbn.js → CollaboratorBar-CzHjawjF.js} +2 -2
  63. package/dist/cdn/chunks/CollaboratorBar-CzHjawjF.js.map +1 -0
  64. package/dist/cdn/chunks/{CommentsPanel-CxZ1kFcK.js → CommentsPanel-Dh0_eRBe.js} +2 -2
  65. package/dist/cdn/chunks/CommentsPanel-Dh0_eRBe.js.map +1 -0
  66. package/dist/cdn/chunks/{CommentsSidebar-DCr2mV8b.js → CommentsSidebar-JxZ-O2mY.js} +2 -2
  67. package/dist/cdn/chunks/CommentsSidebar-JxZ-O2mY.js.map +1 -0
  68. package/dist/cdn/chunks/CountdownBlock--hlKE2aj.js.map +1 -1
  69. package/dist/cdn/chunks/{CountdownToolbar-CUTbVPPV.js → CountdownToolbar-BBiK9EaU.js} +5 -5
  70. package/dist/cdn/chunks/CountdownToolbar-BBiK9EaU.js.map +1 -0
  71. package/dist/cdn/chunks/{IssuesPanel-BhcSzwuL.js → IssuesPanel-BtAn12hl.js} +4 -4
  72. package/dist/cdn/chunks/IssuesPanel-BtAn12hl.js.map +1 -0
  73. package/dist/cdn/chunks/{LanguageMenu-6wGhkyFT.js → LanguageMenu-BDldm-Hp.js} +7 -7
  74. package/dist/cdn/chunks/LanguageMenu-BDldm-Hp.js.map +1 -0
  75. package/dist/cdn/chunks/{LocaleNotices-Br92Xueo.js → LocaleNotices-CzrNKR-N.js} +2 -2
  76. package/dist/cdn/chunks/LocaleNotices-CzrNKR-N.js.map +1 -0
  77. package/dist/cdn/chunks/{LogicTagInsertButton-r2EVUtDU.js → LogicTagInsertButton-B4wuPoMa.js} +5 -5
  78. package/dist/cdn/chunks/LogicTagInsertButton-B4wuPoMa.js.map +1 -0
  79. package/dist/cdn/chunks/{MediaEditModal-CfgN7Jyi.js → MediaEditModal-DJ2wxInt.js} +2 -2
  80. package/dist/cdn/chunks/MediaEditModal-DJ2wxInt.js.map +1 -0
  81. package/dist/cdn/chunks/{MediaPanels-Cb5vsgb-.js → MediaPanels-BJawNjr9.js} +2 -2
  82. package/dist/cdn/chunks/MediaPanels-BJawNjr9.js.map +1 -0
  83. package/dist/cdn/chunks/{MergeTagInput-Dh3N6CEV.js → MergeTagInput-DZD-p4nR.js} +2 -2
  84. package/dist/cdn/chunks/MergeTagInput-DZD-p4nR.js.map +1 -0
  85. package/dist/cdn/chunks/{MergeTagModeToggle-D6u3hMrI.js → MergeTagModeToggle-DGuJCgqO.js} +3 -3
  86. package/dist/cdn/chunks/MergeTagModeToggle-DGuJCgqO.js.map +1 -0
  87. package/dist/cdn/chunks/{MergeTagTextarea-BpVtpiNL.js → MergeTagTextarea-BRiaRBr_.js} +7 -7
  88. package/dist/cdn/chunks/MergeTagTextarea-BRiaRBr_.js.map +1 -0
  89. package/dist/cdn/chunks/{ParagraphEditor-DGJmPAC1.js → ParagraphEditor-CPYQXRIc.js} +23 -23
  90. package/dist/cdn/chunks/ParagraphEditor-CPYQXRIc.js.map +1 -0
  91. package/dist/cdn/chunks/{RestoreVersionDialog-D5qeCa0F.js → RestoreVersionDialog-NjbHial9.js} +3 -3
  92. package/dist/cdn/chunks/RestoreVersionDialog-NjbHial9.js.map +1 -0
  93. package/dist/cdn/chunks/{RichTextEditorContent-DyGiXKKI.js → RichTextEditorContent-CtV0Q0SO.js} +4 -4
  94. package/dist/cdn/chunks/RichTextEditorContent-CtV0Q0SO.js.map +1 -0
  95. package/dist/cdn/chunks/{SaveBlockDialog-B0TJYxd8.js → SaveBlockDialog-BZqPkGrE.js} +6 -6
  96. package/dist/cdn/chunks/SaveBlockDialog-BZqPkGrE.js.map +1 -0
  97. package/dist/cdn/chunks/{SavedBlocksBrowserModal-D8Ly7LrA.js → SavedBlocksBrowserModal-CqfyRtlX.js} +6 -6
  98. package/dist/cdn/chunks/SavedBlocksBrowserModal-CqfyRtlX.js.map +1 -0
  99. package/dist/cdn/chunks/{SavedBlocksPanels-Co1cbWR8.js → SavedBlocksPanels-BILHEdkP.js} +2 -2
  100. package/dist/cdn/chunks/SavedBlocksPanels-BILHEdkP.js.map +1 -0
  101. package/dist/cdn/chunks/{SavedBlocksPickBar-DNtVbpm-.js → SavedBlocksPickBar-C9NKqOEU.js} +3 -3
  102. package/dist/cdn/chunks/SavedBlocksPickBar-C9NKqOEU.js.map +1 -0
  103. package/dist/cdn/chunks/{TemplateSettings-BRc878ZF.js → TemplateSettings--_ZfbhnU.js} +6 -6
  104. package/dist/cdn/chunks/TemplateSettings--_ZfbhnU.js.map +1 -0
  105. package/dist/cdn/chunks/{TestEmailModal-CIui7VfS.js → TestEmailModal-CtfoV82K.js} +7 -7
  106. package/dist/cdn/chunks/TestEmailModal-CtfoV82K.js.map +1 -0
  107. package/dist/cdn/chunks/{TestEmailPanel-vKvruW_r.js → TestEmailPanel-NK26SU2u.js} +2 -2
  108. package/dist/cdn/chunks/TestEmailPanel-NK26SU2u.js.map +1 -0
  109. package/dist/cdn/chunks/{TitleEditor-BI-9Nnj3.js → TitleEditor-DXN_aOn0.js} +8 -8
  110. package/dist/cdn/chunks/TitleEditor-DXN_aOn0.js.map +1 -0
  111. package/dist/cdn/chunks/ToggleSwitch-C0w0srN_.js.map +1 -1
  112. package/dist/cdn/chunks/{Toolbar-CYnnArxv.js → Toolbar-HCxD4Ifc.js} +918 -707
  113. package/dist/cdn/chunks/Toolbar-HCxD4Ifc.js.map +1 -0
  114. package/dist/cdn/chunks/{TplModal-B3nZeGWK.js → TplModal-DzHoLmGo.js} +2 -2
  115. package/dist/cdn/chunks/TplModal-DzHoLmGo.js.map +1 -0
  116. package/dist/cdn/chunks/{VersionHistoryMenu-CMGfAKuV.js → VersionHistoryMenu-CVGlUPwS.js} +2 -2
  117. package/dist/cdn/chunks/VersionHistoryMenu-CVGlUPwS.js.map +1 -0
  118. package/dist/cdn/chunks/{VersionHistoryPanels-Bb2ouQg7.js → VersionHistoryPanels-Du8sQry2.js} +2 -2
  119. package/dist/cdn/chunks/VersionHistoryPanels-Du8sQry2.js.map +1 -0
  120. package/dist/cdn/chunks/{VersionPreviewBanner-573UP-g4.js → VersionPreviewBanner-5RFz4AQx.js} +2 -2
  121. package/dist/cdn/chunks/VersionPreviewBanner-5RFz4AQx.js.map +1 -0
  122. package/dist/cdn/chunks/{WrapperBlock-DVu632LD.js → WrapperBlock-DTayPD6Q.js} +4 -4
  123. package/dist/cdn/chunks/WrapperBlock-DTayPD6Q.js.map +1 -0
  124. package/dist/cdn/chunks/{blockTypeIcons-CGxNYHVA.js → blockTypeIcons-BOonB9gK.js} +2 -2
  125. package/dist/cdn/chunks/{blockTypeIcons-CGxNYHVA.js.map → blockTypeIcons-BOonB9gK.js.map} +1 -1
  126. package/dist/{ca-YfIxwO1G.js → cdn/chunks/ca-C8N05sCU.js} +12 -2
  127. package/dist/cdn/chunks/ca-C8N05sCU.js.map +1 -0
  128. package/dist/cdn/chunks/{composables-DY3anqHO.js → composables-BJBr8B4t.js} +611 -592
  129. package/dist/cdn/chunks/composables-BJBr8B4t.js.map +1 -0
  130. package/dist/cdn/chunks/{createCloudRuntime-B5numxlW.js → createCloudRuntime-CUlw09ix.js} +3 -3
  131. package/dist/cdn/chunks/{createCloudRuntime-B5numxlW.js.map → createCloudRuntime-CUlw09ix.js.map} +1 -1
  132. package/dist/{da-CM6DCvRG.js → cdn/chunks/da-Dno_4nGy.js} +12 -2
  133. package/dist/cdn/chunks/da-Dno_4nGy.js.map +1 -0
  134. package/dist/{de-Dugz1zXC.js → cdn/chunks/de-DRR5JSkh.js} +12 -2
  135. package/dist/cdn/chunks/de-DRR5JSkh.js.map +1 -0
  136. package/dist/cdn/chunks/{editor-modal-CXSSZplR.js → editor-modal-BVM_0uoL.js} +4 -4
  137. package/dist/cdn/chunks/editor-modal-BVM_0uoL.js.map +1 -0
  138. package/dist/{en-BykoFuFY.js → cdn/chunks/en-DAcLbbpg.js} +12 -2
  139. package/dist/cdn/chunks/en-DAcLbbpg.js.map +1 -0
  140. package/dist/cdn/chunks/en-DlDEofnd.js +1 -0
  141. package/dist/{es-DaWsTkpj.js → cdn/chunks/es-BcEQLQxe.js} +12 -2
  142. package/dist/cdn/chunks/es-BcEQLQxe.js.map +1 -0
  143. package/dist/cdn/chunks/{extensions-BWVlr8Ga.js → extensions-BPZirXpF.js} +5 -5
  144. package/dist/cdn/chunks/extensions-BPZirXpF.js.map +1 -0
  145. package/dist/{fr-DqwQHtJo.js → cdn/chunks/fr-CNQG7ESr.js} +12 -2
  146. package/dist/cdn/chunks/fr-CNQG7ESr.js.map +1 -0
  147. package/dist/cdn/chunks/{icons-C7vjUBLn.js → icons-CWEBTtbR.js} +23 -23
  148. package/dist/cdn/chunks/{icons-C7vjUBLn.js.map → icons-CWEBTtbR.js.map} +1 -1
  149. package/dist/cdn/chunks/{ja-BH4MS1Ye.js → ja-CMxWxqSH.js} +11 -3
  150. package/dist/cdn/chunks/ja-CMxWxqSH.js.map +1 -0
  151. package/dist/{nl-BQl1_UHv.js → cdn/chunks/nl-BjyYZDkC.js} +12 -2
  152. package/dist/cdn/chunks/nl-BjyYZDkC.js.map +1 -0
  153. package/dist/cdn/chunks/{normalizeMergeTagMarkup-Dw3rFvyd.js → normalizeMergeTagMarkup-CExCfSYI.js} +64 -64
  154. package/dist/cdn/chunks/{normalizeMergeTagMarkup-Dw3rFvyd.js.map → normalizeMergeTagMarkup-CExCfSYI.js.map} +1 -1
  155. package/dist/cdn/chunks/{preRenderCustomBlocks-BGtb8Xbp.js → preRenderCustomBlocks-BLVFtvl8.js} +2 -2
  156. package/dist/cdn/chunks/{preRenderCustomBlocks-BGtb8Xbp.js.map → preRenderCustomBlocks-BLVFtvl8.js.map} +1 -1
  157. package/dist/{pt-BR-eyzmU9Vs.js → cdn/chunks/pt-BR-DC2A3C0v.js} +12 -2
  158. package/dist/cdn/chunks/pt-BR-DC2A3C0v.js.map +1 -0
  159. package/dist/cdn/chunks/{sanitizeHtml-CLRY8s2s.js → sanitizeHtml-Db0S2JVP.js} +2 -2
  160. package/dist/cdn/chunks/{sanitizeHtml-CLRY8s2s.js.map → sanitizeHtml-Db0S2JVP.js.map} +1 -1
  161. package/dist/cdn/chunks/{socialIcons-kYhdXJ9P.js → socialIcons-WD1cjZDr.js} +495 -517
  162. package/dist/cdn/chunks/socialIcons-WD1cjZDr.js.map +1 -0
  163. package/dist/cdn/chunks/{src-DY2kMjoD.js → src-A0kzK-pR.js} +775 -667
  164. package/dist/cdn/chunks/src-A0kzK-pR.js.map +1 -0
  165. package/dist/cdn/chunks/src-C9opbQj_.js +684 -0
  166. package/dist/cdn/chunks/src-C9opbQj_.js.map +1 -0
  167. package/dist/cdn/chunks/{src-BmzzkUf7.js → src-edESkGqO.js} +708 -603
  168. package/dist/cdn/chunks/src-edESkGqO.js.map +1 -0
  169. package/dist/cdn/chunks/{tiptap-B7gxx0aJ.js → tiptap-D9amDW4u.js} +1030 -1027
  170. package/dist/cdn/chunks/tiptap-D9amDW4u.js.map +1 -0
  171. package/dist/cdn/chunks/useLocalizedDisplay-Brdkp3KH.js +33 -0
  172. package/dist/cdn/chunks/{useLocalizedDisplay-B5wMJLru.js.map → useLocalizedDisplay-Brdkp3KH.js.map} +1 -1
  173. package/dist/cdn/chunks/{useLogicTag-0wkSxy3z.js → useLogicTag-CKtQlJDa.js} +2 -2
  174. package/dist/cdn/chunks/{useLogicTag-0wkSxy3z.js.map → useLogicTag-CKtQlJDa.js.map} +1 -1
  175. package/dist/cdn/chunks/{useMergeTag-y3bX8M_6.js → useMergeTag-Dwy3U0PI.js} +2 -2
  176. package/dist/cdn/chunks/{useMergeTag-y3bX8M_6.js.map → useMergeTag-Dwy3U0PI.js.map} +1 -1
  177. package/dist/cdn/chunks/{withCurrentFont-B42BKo9N.js → withCurrentFont-C4pIesdB.js} +2 -2
  178. package/dist/cdn/chunks/{withCurrentFont-B42BKo9N.js.map → withCurrentFont-C4pIesdB.js.map} +1 -1
  179. package/dist/cdn/editor.js +109 -109
  180. package/dist/cdn/editor.js.map +1 -1
  181. package/dist/{check-ErKdPXG6.js → check-C82yyyf1.js} +1 -1
  182. package/dist/{chevron-down-C_vv5fZE.js → chevron-down-BaBVjNbM.js} +1 -1
  183. package/dist/{chevron-right-Cw4GpjFA.js → chevron-right-DkS-bw8X.js} +1 -1
  184. package/dist/{chevron-up-uijYZoph.js → chevron-up-C1KzUIK4.js} +1 -1
  185. package/dist/{circle-exclamation-point-CIYHx5Tw.js → circle-exclamation-point-DsmqtTUQ.js} +1 -1
  186. package/dist/{clock-tnC1IvZk.js → clock-dpIs7vo0.js} +1 -1
  187. package/dist/{composables-CFTH0Nqb.js → composables-DjCuq6RV.js} +1399 -1380
  188. package/dist/{createCloudRuntime-BvWlm_38.js → createCloudRuntime-CiEo0wkr.js} +2 -2
  189. package/dist/{createLucideIcon-CssArtUe.js → createLucideIcon-BSam2AUu.js} +5 -5
  190. package/dist/{cdn/chunks/da-CM6DCvRG.js → da-Dno_4nGy.js} +10 -4
  191. package/dist/{cdn/chunks/de-Dugz1zXC.js → de-DRR5JSkh.js} +10 -4
  192. package/dist/dist-AyAOL8Bj.js +4 -0
  193. package/dist/{dist-BTUMr4Pb.js → dist-BNrGwgev.js} +2 -2
  194. package/dist/{dist-CsplpC_6.js → dist-BPVNNdTv.js} +2 -2
  195. package/dist/{dist-bWIkrMkM.js → dist-C7YLw60i.js} +2 -2
  196. package/dist/{dist-Clfx1JeL.js → dist-CBnAqr27.js} +2 -2
  197. package/dist/{dist-CkHJRChP.js → dist-COvAA64n.js} +2 -2
  198. package/dist/{dist-C-NRkFsp.js → dist-CuRjmtWu.js} +5 -5
  199. package/dist/{dist-HKEDfp__.js → dist-DG_AWt8v.js} +2 -2
  200. package/dist/{dist-CMo4K5So.js → dist-DX_IQgcU.js} +802 -696
  201. package/dist/{dist-DY3WbyCO.js → dist-DYtuc3jc.js} +2 -2
  202. package/dist/dist-DkPTWQuO.js +4 -0
  203. package/dist/{dist-DwpKFWF4.js → dist-DoWk1r7z.js} +77 -74
  204. package/dist/{dist-BlrlMP8f.js → dist-fDsB6dCL.js} +2 -2
  205. package/dist/{editor-modal-BWvxfSj8.js → editor-modal-odubnc9x.js} +15 -15
  206. package/dist/en-CAImT1hl.js +1 -0
  207. package/dist/{cdn/chunks/en-BykoFuFY.js → en-DAcLbbpg.js} +10 -4
  208. package/dist/{cdn/chunks/es-DaWsTkpj.js → es-BcEQLQxe.js} +10 -4
  209. package/dist/{extensions-BPVackEE.js → extensions-C7OLgMEj.js} +73 -73
  210. package/dist/{eye-DK4--qHk.js → eye-CxCHEszj.js} +1 -1
  211. package/dist/{cdn/chunks/fr-DqwQHtJo.js → fr-CNQG7ESr.js} +10 -4
  212. package/dist/{image-B5pJOw5Q.js → image-DvXPzqNd.js} +1 -1
  213. package/dist/index.d.ts +72 -13
  214. package/dist/{info-DKM0_thN.js → info-2KHWaZ2L.js} +1 -1
  215. package/dist/{ja-BH4MS1Ye.js → ja-CMxWxqSH.js} +10 -2
  216. package/dist/{link-BNgTZ_Sw.js → link-_OmrcJMv.js} +1 -1
  217. package/dist/{list-Bqynqm7o.js → list-Dekd7JE8.js} +1 -1
  218. package/dist/{loader-circle-BMc3fVpa.js → loader-circle-D_hT5mFS.js} +1 -1
  219. package/dist/{message-circle-D_TpvAJh.js → message-circle-DDbiG-jz.js} +1 -1
  220. package/dist/{cdn/chunks/nl-BQl1_UHv.js → nl-BjyYZDkC.js} +10 -4
  221. package/dist/{normalizeMergeTagMarkup-PQqrbfmt.js → normalizeMergeTagMarkup-Cv5Wvs5f.js} +45 -45
  222. package/dist/{package-D2fov5PU.js → package-cORUe57D.js} +1 -1
  223. package/dist/{pencil-BNdkJyfY.js → pencil-D67H4fxq.js} +1 -1
  224. package/dist/{plus-CWmBmMx-.js → plus-BpTZAx28.js} +1 -1
  225. package/dist/{preRenderCustomBlocks-Dg5GBNi2.js → preRenderCustomBlocks-6CLw2rP6.js} +3 -3
  226. package/dist/{cdn/chunks/pt-BR-eyzmU9Vs.js → pt-BR-DC2A3C0v.js} +10 -4
  227. package/dist/{refresh-cw-Ryg1j66N.js → refresh-cw-B4T0IFwI.js} +1 -1
  228. package/dist/{rotate-ccw-D8j7gXXv.js → rotate-ccw-BDQgjpuo.js} +1 -1
  229. package/dist/{sanitizeHtml-DVdfdxOz.js → sanitizeHtml-Ru5_-IbM.js} +6 -6
  230. package/dist/{search-CX2JkSHz.js → search-Dp9pkaVt.js} +1 -1
  231. package/dist/{send-BLR1b-p5.js → send-DO9GhgCH.js} +1 -1
  232. package/dist/{smartphone-Co8m0LLg.js → smartphone-CPW3I3hV.js} +1 -1
  233. package/dist/{socialIcons-DBHv_ntg.js → socialIcons-CPBiLTjY.js} +561 -583
  234. package/dist/{sparkles-Dc3Undp5.js → sparkles-CIBjNfij.js} +1 -1
  235. package/dist/{square-CPw_cyX8.js → square-3W65qrrH.js} +1 -1
  236. package/dist/templatical-editor.js +139 -139
  237. package/dist/{text-align-start-2VZGhCiK.js → text-align-start-Bs70tpRU.js} +1 -1
  238. package/dist/{trash-t6XXliVc.js → trash-CTzhAm1o.js} +1 -1
  239. package/dist/{triangle-exclamation-point-_YYWE2ZH.js → triangle-exclamation-point-D_13CuJY.js} +1 -1
  240. package/dist/{upload-BWYXWYHb.js → upload-DFxkP9MI.js} +1 -1
  241. package/dist/useLocalizedDisplay-DfiE-KjV.js +31 -0
  242. package/dist/{useLogicTag-CVOj0VUv.js → useLogicTag-K5CPoMTk.js} +1 -1
  243. package/dist/{useMergeTag-Bams_kam.js → useMergeTag-tsU_Sw2x.js} +3 -3
  244. package/dist/{useScrollToBlock-CwUQ_nKz.js → useScrollToBlock-194ePl4q.js} +1 -1
  245. package/dist/withCurrentFont-C-_IYTqP.js +18 -0
  246. package/dist/{x-CTKOxIyZ.js → x-D7L8mLHJ.js} +1 -1
  247. package/package.json +22 -22
  248. package/dist/cdn/chunks/AiAltTextPopover-CcX_OMUU.js.map +0 -1
  249. package/dist/cdn/chunks/AiAltTextReview-Dmm3h0jd.js.map +0 -1
  250. package/dist/cdn/chunks/AiChatPanel-DV23DJ-2.js.map +0 -1
  251. package/dist/cdn/chunks/AiPanels-CxhOpMAp.js.map +0 -1
  252. package/dist/cdn/chunks/AiRewriteMenu-87-O514r.js.map +0 -1
  253. package/dist/cdn/chunks/BlockIssueBadge-Dp06vQd3.js.map +0 -1
  254. package/dist/cdn/chunks/BlockPreviewCanvas-DQGzUvZ5.js.map +0 -1
  255. package/dist/cdn/chunks/CloudPanels-D8fchoYt.js.map +0 -1
  256. package/dist/cdn/chunks/CollaborationNotices-DNEs3g9B.js.map +0 -1
  257. package/dist/cdn/chunks/CollaboratorBar-CN6XAlbn.js.map +0 -1
  258. package/dist/cdn/chunks/CommentsPanel-CxZ1kFcK.js.map +0 -1
  259. package/dist/cdn/chunks/CommentsSidebar-DCr2mV8b.js.map +0 -1
  260. package/dist/cdn/chunks/CountdownToolbar-CUTbVPPV.js.map +0 -1
  261. package/dist/cdn/chunks/IssuesPanel-BhcSzwuL.js.map +0 -1
  262. package/dist/cdn/chunks/LanguageMenu-6wGhkyFT.js.map +0 -1
  263. package/dist/cdn/chunks/LocaleNotices-Br92Xueo.js.map +0 -1
  264. package/dist/cdn/chunks/LogicTagInsertButton-r2EVUtDU.js.map +0 -1
  265. package/dist/cdn/chunks/MediaEditModal-CfgN7Jyi.js.map +0 -1
  266. package/dist/cdn/chunks/MediaPanels-Cb5vsgb-.js.map +0 -1
  267. package/dist/cdn/chunks/MergeTagInput-Dh3N6CEV.js.map +0 -1
  268. package/dist/cdn/chunks/MergeTagModeToggle-D6u3hMrI.js.map +0 -1
  269. package/dist/cdn/chunks/MergeTagTextarea-BpVtpiNL.js.map +0 -1
  270. package/dist/cdn/chunks/ParagraphEditor-DGJmPAC1.js.map +0 -1
  271. package/dist/cdn/chunks/RestoreVersionDialog-D5qeCa0F.js.map +0 -1
  272. package/dist/cdn/chunks/RichTextEditorContent-DyGiXKKI.js.map +0 -1
  273. package/dist/cdn/chunks/SaveBlockDialog-B0TJYxd8.js.map +0 -1
  274. package/dist/cdn/chunks/SavedBlocksBrowserModal-D8Ly7LrA.js.map +0 -1
  275. package/dist/cdn/chunks/SavedBlocksPanels-Co1cbWR8.js.map +0 -1
  276. package/dist/cdn/chunks/SavedBlocksPickBar-DNtVbpm-.js.map +0 -1
  277. package/dist/cdn/chunks/TemplateSettings-BRc878ZF.js.map +0 -1
  278. package/dist/cdn/chunks/TestEmailModal-CIui7VfS.js.map +0 -1
  279. package/dist/cdn/chunks/TestEmailPanel-vKvruW_r.js.map +0 -1
  280. package/dist/cdn/chunks/TitleEditor-BI-9Nnj3.js.map +0 -1
  281. package/dist/cdn/chunks/Toolbar-CYnnArxv.js.map +0 -1
  282. package/dist/cdn/chunks/TplModal-B3nZeGWK.js.map +0 -1
  283. package/dist/cdn/chunks/VersionHistoryMenu-CMGfAKuV.js.map +0 -1
  284. package/dist/cdn/chunks/VersionHistoryPanels-Bb2ouQg7.js.map +0 -1
  285. package/dist/cdn/chunks/VersionPreviewBanner-573UP-g4.js.map +0 -1
  286. package/dist/cdn/chunks/WrapperBlock-DVu632LD.js.map +0 -1
  287. package/dist/cdn/chunks/ca-YfIxwO1G.js.map +0 -1
  288. package/dist/cdn/chunks/composables-DY3anqHO.js.map +0 -1
  289. package/dist/cdn/chunks/da-CM6DCvRG.js.map +0 -1
  290. package/dist/cdn/chunks/de-Dugz1zXC.js.map +0 -1
  291. package/dist/cdn/chunks/editor-modal-CXSSZplR.js.map +0 -1
  292. package/dist/cdn/chunks/en-BykoFuFY.js.map +0 -1
  293. package/dist/cdn/chunks/en-DYMYt1TN.js +0 -1
  294. package/dist/cdn/chunks/es-DaWsTkpj.js.map +0 -1
  295. package/dist/cdn/chunks/extensions-BWVlr8Ga.js.map +0 -1
  296. package/dist/cdn/chunks/fr-DqwQHtJo.js.map +0 -1
  297. package/dist/cdn/chunks/ja-BH4MS1Ye.js.map +0 -1
  298. package/dist/cdn/chunks/nl-BQl1_UHv.js.map +0 -1
  299. package/dist/cdn/chunks/pt-BR-eyzmU9Vs.js.map +0 -1
  300. package/dist/cdn/chunks/socialIcons-kYhdXJ9P.js.map +0 -1
  301. package/dist/cdn/chunks/src-B7X7x_ST.js +0 -707
  302. package/dist/cdn/chunks/src-B7X7x_ST.js.map +0 -1
  303. package/dist/cdn/chunks/src-BmzzkUf7.js.map +0 -1
  304. package/dist/cdn/chunks/src-DY2kMjoD.js.map +0 -1
  305. package/dist/cdn/chunks/tiptap-B7gxx0aJ.js.map +0 -1
  306. package/dist/cdn/chunks/useLocalizedDisplay-B5wMJLru.js +0 -33
  307. package/dist/dist-CkIeJEsa.js +0 -4
  308. package/dist/dist-eAgG-nCb.js +0 -4
  309. package/dist/en-DvCaYqiR.js +0 -1
  310. package/dist/useLocalizedDisplay-CbFM0cCV.js +0 -31
  311. package/dist/withCurrentFont-y0O5kOLW.js +0 -18
@@ -1,12 +1,12 @@
1
1
  import { $ as e, C as t, F as n, H as r, M as i, O as a, Q as o, X as s, Y as c, _ as l, at as u, b as d, ct as f, dt as p, et as m, lt as h, mt as g, ot as _, p as v, pt as y, q as b, rt as x, tt as S, u as C, x as w } from "./draggable-IRVFEZ-b.js";
2
- import { $t as T, Bt as E, Ft as D, Gt as O, H as k, I as A, It as j, Kt as M, Lt as ee, Mt as N, Pt as P, Qt as te, Rt as F, Tt as I, Ut as L, Vt as R, W as z, Wt as ne, Xt as B, Zt as re, an as V, en as H, fn as ie, h as U, in as W, m as G, nn as K, on as ae, p as oe, pt as se, qt as ce, rn as q, tn as le, v as ue, wn as de, y as fe, zt as pe } from "./src-DY2kMjoD.js";
3
- import { at as me, s as he } from "./icons-C7vjUBLn.js";
4
- import { B as ge, C as _e, W as ve, u as ye } from "./keys-ywH4jHJ2.js";
5
- import { t as be } from "./useI18n-DPg6rPbu.js";
6
- import { r as xe } from "./dist-zu1jwYIS.js";
7
- import { i as J, r as Se } from "./usePopoverPosition-CBp9uwjV.js";
2
+ import { $t as T, An as E, Ft as D, H as O, I as k, Mt as A, Pt as ee, Qt as te, Tt as j, Vt as M, W as N, Xt as P, Yt as ne, Zt as F, _n as re, an as I, bn as L, cn as R, dn as z, en as B, fn as ie, gn as V, h as H, hn as ae, in as U, m as W, mn as G, nn as oe, on as se, p as ce, pn as le, pt as ue, sn as de, tn as fe, v as pe, vn as K, y as me, yn as q } from "./src-A0kzK-pR.js";
3
+ import { at as he, s as ge } from "./icons-CWEBTtbR.js";
4
+ import { B as _e, C as ve, W as ye, u as be } from "./keys-ywH4jHJ2.js";
5
+ import { t as xe } from "./useI18n-DPg6rPbu.js";
6
+ import { r as J } from "./dist-zu1jwYIS.js";
7
+ import { i as Se, r as Ce } from "./usePopoverPosition-CBp9uwjV.js";
8
8
  // ../core/src/localized-edit.ts
9
- 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([
9
+ var Y = (e) => typeof e == "object" && !!e && !Array.isArray(e), we = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => Y(e) && typeof e.id == "string"), Te = /* @__PURE__ */ new Set([
10
10
  "id",
11
11
  "type",
12
12
  "children",
@@ -14,41 +14,41 @@ var Y = (e) => typeof e == "object" && !!e && !Array.isArray(e), Ce = (e) => Arr
14
14
  "l10n",
15
15
  "renderedHtml"
16
16
  ]);
17
- function Te(e, t, n) {
17
+ function Ee(e, t, n) {
18
18
  let r = /* @__PURE__ */ new Set();
19
19
  for (let i of n) {
20
- if (!O(i)) continue;
21
- let n = i.split("."), a = n.pop(), o = n.join("."), s = T(e, i), c = t;
20
+ if (!se(i)) continue;
21
+ let n = i.split("."), a = n.pop(), o = n.join("."), s = G(e, i), c = t;
22
22
  for (let [t, i] of n.entries()) {
23
23
  let a = n.slice(0, t + 1).join(".");
24
- s !== void 0 && Y(c) && T(c, i) === void 0 && Y(T(e, a)) && (c[i] = {}, r.add(a)), c = T(c, i);
24
+ s !== void 0 && Y(c) && G(c, i) === void 0 && Y(G(e, a)) && (c[i] = {}, r.add(a)), c = G(c, i);
25
25
  }
26
26
  if (Array.isArray(c)) {
27
27
  let e = c.findIndex((e) => Y(e) && e.id === a);
28
28
  if (e < 0) continue;
29
- s === void 0 ? c.splice(e, 1) : c[e] = V(s);
30
- } else Y(c) && (s === void 0 ? delete c[a] : c[a] = V(s), o && Object.keys(c).length === 0 && T(e, o) === void 0 && Te(e, t, [o]));
29
+ s === void 0 ? c.splice(e, 1) : c[e] = L(s);
30
+ } else Y(c) && (s === void 0 ? delete c[a] : c[a] = L(s), o && Object.keys(c).length === 0 && G(e, o) === void 0 && Ee(e, t, [o]));
31
31
  }
32
32
  return r;
33
33
  }
34
- function Ee(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
35
- 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);
36
- else if (i && Ce(e) && Ce(t)) for (let o of t) {
34
+ function De(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
35
+ if (Y(e) && Y(t) && !a.has(n)) for (let o of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) (n || !Te.has(o)) && De(e[o], t[o], n ? `${n}.${o}` : o, r, i, a);
36
+ else if (i && we(e) && we(t)) for (let o of t) {
37
37
  if (o.id.includes(".")) continue;
38
38
  let t = e.find((e) => e.id === o.id);
39
- t && Ee(t, o, `${n}.${o.id}`, r, i, a);
39
+ t && De(t, o, `${n}.${o.id}`, r, i, a);
40
40
  }
41
- else W(e, t) || r.set(n, t);
41
+ else q(e, t) || r.set(n, t);
42
42
  }
43
- function De(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
43
+ function X(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
44
44
  let a = /* @__PURE__ */ new Map();
45
- Ee(e, t, "", a, e.type !== "custom", i);
46
- let o = new Set(e.type === "custom" ? K(e, r) : []), s = {}, c = {};
47
- for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : ce(e.type, t)) && typeof r == "string" && T(e, t) !== void 0) {
45
+ De(e, t, "", a, e.type !== "custom", i);
46
+ let o = new Set(e.type === "custom" ? re(e, r) : []), s = {}, c = {};
47
+ for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : R(e.type, t)) && typeof r == "string" && G(e, t) !== void 0) {
48
48
  let i = n?.text?.[t];
49
49
  s[t] = i && i.value === r ? i : {
50
50
  value: r,
51
- sourceHash: le(String(T(e, t) ?? ""))
51
+ sourceHash: V(String(G(e, t) ?? ""))
52
52
  };
53
53
  } else c[t] = r === void 0 ? null : r;
54
54
  let l = {};
@@ -58,7 +58,7 @@ function Oe(e, t, n) {
58
58
  let r = !1;
59
59
  function i(e, t, n, a) {
60
60
  let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) => Y(e) && typeof e.id == "string");
61
- 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) => V(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
61
+ 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) => L(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
62
62
  let r = e[n].find((e) => e.id === t.id);
63
63
  r && i(r, t, a);
64
64
  }
@@ -66,7 +66,7 @@ function Oe(e, t, n) {
66
66
  let a = e, o = t;
67
67
  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") {
68
68
  let i = (e) => e.map((e) => e.map((e) => e.id));
69
- (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) => V(n(e.id) ?? e))));
69
+ (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) => L(n(e.id) ?? e))));
70
70
  }
71
71
  return r;
72
72
  }
@@ -75,39 +75,39 @@ function ke(e, t, n) {
75
75
  let { locale: t, locales: n, l10n: r, ...i } = e;
76
76
  return i;
77
77
  }, i = /* @__PURE__ */ new Map();
78
- Ee(r(e), r(t), "", i);
78
+ De(r(e), r(t), "", i);
79
79
  let a = {};
80
- for (let [t, r] of i) if (R.includes(t) && typeof r == "string" && T(e, t) !== void 0) {
80
+ for (let [t, r] of i) if (oe.includes(t) && typeof r == "string" && G(e, t) !== void 0) {
81
81
  let i = n?.text?.[t];
82
82
  (a.text ??= {})[t] = i?.value === r ? i : {
83
83
  value: r,
84
- sourceHash: le(String(T(e, t) ?? ""))
84
+ sourceHash: V(String(G(e, t) ?? ""))
85
85
  };
86
86
  } else (a.set ??= {})[t] = r === void 0 ? null : r;
87
87
  return a;
88
88
  }
89
89
  function Ae(e, t, n, r, i, a = []) {
90
- let o = V(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
90
+ let o = L(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
91
91
  ...Object.keys(t.text ?? {}),
92
92
  ...Object.keys(t.set ?? {}),
93
93
  ...Object.keys(n.text ?? {}),
94
94
  ...Object.keys(n.set ?? {})
95
- ])].filter((e) => !W(t.text?.[e], n.text?.[e]) || !W(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
95
+ ])].filter((e) => !q(t.text?.[e], n.text?.[e]) || !q(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
96
96
  for (let e of c) {
97
- let t = T(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && W(T(r, t), T(i, t)));
98
- if (W(t, T(r, e))) delete o.set[e];
99
- else if (n.length && Y(T(r, e)) && Y(t)) {
97
+ let t = G(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && q(G(r, t), G(i, t)));
98
+ if (q(t, G(r, e))) delete o.set[e];
99
+ else if (n.length && Y(G(r, e)) && Y(t)) {
100
100
  delete o.set[e];
101
101
  let i = (e, t, a) => {
102
102
  if (!n.some((t) => e === t || e.startsWith(`${t}.`))) {
103
103
  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]);
104
- 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);
105
- else Y(r) && typeof r.type == "string" && M(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : V(a));
104
+ else if (Y(r) && r.type !== "custom" && we(t) && we(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
105
+ else Y(r) && typeof r.type == "string" && de(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : L(a));
106
106
  }
107
107
  };
108
- i(e, T(r, e), t);
109
- } else o.set[e] = t === void 0 ? null : V(t);
110
- for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) n.startsWith(`${e}.`) && (W(t === "text" ? o.text[n].value : o.set[n] ?? void 0, T(i, n)) || delete o[t][n]);
108
+ i(e, G(r, e), t);
109
+ } else o.set[e] = t === void 0 ? null : L(t);
110
+ for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) n.startsWith(`${e}.`) && (q(t === "text" ? o.text[n].value : o.set[n] ?? void 0, G(i, n)) || delete o[t][n]);
111
111
  }
112
112
  for (let e of s) if (!c.includes(e)) {
113
113
  for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) (n === e || n.startsWith(`${e}.`)) && delete o[t][n];
@@ -129,13 +129,13 @@ function Me(e, t, n) {
129
129
  let r = t === "addBlock", i = t === "duplicateBlock", a = typeof n[0] == "string" ? n[0] : n[0].id, o = r ? n[0] : e.findBlock?.(a);
130
130
  if (!r && e.findBlock && !o) return !1;
131
131
  let s = r ? null : e.findBlockLocation?.(a);
132
- if (!r && e.findBlockLocation && !s || !r && e.isBlockLocked(a, !0) || !r && o && F(o).some((t) => t !== a && e.isBlockLocked(t, !0)) || s?.targetSectionId && e.isBlockLocked(s.targetSectionId, !0)) return !1;
132
+ if (!r && e.findBlockLocation && !s || !r && e.isBlockLocked(a, !0) || !r && o && T(o).some((t) => t !== a && e.isBlockLocked(t, !0)) || s?.targetSectionId && e.isBlockLocked(s.targetSectionId, !0)) return !1;
133
133
  if (r && e.content) {
134
134
  let t = {
135
135
  ...e.content(),
136
136
  blocks: [o]
137
137
  };
138
- G(t), U(t);
138
+ W(t), H(t);
139
139
  }
140
140
  if (t === "removeBlock") return !0;
141
141
  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;
@@ -143,22 +143,22 @@ function Me(e, t, n) {
143
143
  if (e.isBlockLocked(l, !0) || o?.type === "section") return !1;
144
144
  if (e.findBlock) {
145
145
  let t = e.findBlock(l);
146
- if (t?.type !== "section" || u < 0 || u >= E(t.columns)) return !1;
146
+ if (t?.type !== "section" || u < 0 || u >= fe(t.columns)) return !1;
147
147
  }
148
148
  }
149
149
  return t !== "moveBlock" || s?.targetSectionId !== l || (s?.columnIndex ?? 0) !== u || s?.index !== n[1];
150
150
  }
151
- var X = /* @__PURE__ */ new WeakMap();
152
- function Ne(e, t) {
153
- X.set(e, t);
154
- for (let n of Object.values(e)) typeof n == "function" && X.set(n, t);
155
- }
151
+ var Ne = /* @__PURE__ */ new WeakMap();
156
152
  function Pe(e, t) {
157
- let n = X.get(e);
158
- n && X.set(t, n);
153
+ Ne.set(e, t);
154
+ for (let n of Object.values(e)) typeof n == "function" && Ne.set(n, t);
155
+ }
156
+ function Z(e, t) {
157
+ let n = Ne.get(e);
158
+ n && Ne.set(t, n);
159
159
  }
160
- function Z(e, t, n) {
161
- let r = Reflect.get(e, t), i = X.get(e) ?? (typeof r == "function" ? X.get(r) : void 0);
160
+ function Q(e, t, n) {
161
+ let r = Reflect.get(e, t), i = Ne.get(e) ?? (typeof r == "function" ? Ne.get(r) : void 0);
162
162
  if (i) return i(t, n);
163
163
  if (!je(t)) return !0;
164
164
  let a = Reflect.get(e, "isBlockLocked");
@@ -179,7 +179,7 @@ function Z(e, t, n) {
179
179
  function Fe(e) {
180
180
  return e instanceof Error ? e : Error(String(e), { cause: e });
181
181
  }
182
- function Q(e, t) {
182
+ function Ie(e, t) {
183
183
  try {
184
184
  t();
185
185
  } catch (t) {
@@ -187,9 +187,9 @@ function Q(e, t) {
187
187
  }
188
188
  }
189
189
  // ../core/src/editor.ts
190
- function Ie(t) {
191
- let n = t.content ?? se(t.defaultFontFamily, t.templateDefaults);
192
- G(n), U(n);
190
+ function Le(t) {
191
+ let n = t.content ?? ue(t.defaultFontFamily, t.templateDefaults);
192
+ W(n), H(n);
193
193
  let r = e({
194
194
  template: null,
195
195
  content: n,
@@ -204,11 +204,11 @@ function Ie(t) {
204
204
  uiTheme: "auto"
205
205
  }), i = u(r, "activeLocale"), a = [];
206
206
  function o(e) {
207
- let t = L(r.content);
208
- if (e === t && (e = null), e !== null && !r.content.settings.locales?.includes(e)) throw new q(`This template has no "${e}" version.`, void 0, "unknown_locale");
207
+ let t = U(r.content);
208
+ if (e === t && (e = null), e !== null && !r.content.settings.locales?.includes(e)) throw new K(`This template has no "${e}" version.`, void 0, "unknown_locale");
209
209
  i.value = e;
210
210
  }
211
- h(() => i.value ?? L(r.content), (e) => Q(t.onError, () => t.onLocaleChange?.(e))), h(() => r.content.settings.locales?.includes(i.value ?? ""), () => {
211
+ h(() => i.value ?? U(r.content), (e) => Ie(t.onError, () => t.onLocaleChange?.(e))), h(() => r.content.settings.locales?.includes(i.value ?? ""), () => {
212
212
  i.value && !r.content.settings.locales?.includes(i.value) && o(null);
213
213
  });
214
214
  function s() {
@@ -218,16 +218,16 @@ function Ie(t) {
218
218
  a = e;
219
219
  }
220
220
  function l(e) {
221
- return pe(r.content, e, a);
221
+ return B(r.content, e, a);
222
222
  }
223
223
  function d(e, n) {
224
224
  if (!s()) return null;
225
- if (e === "addLocale" && (!ne(n) || t.localization && !t.localization.locales.includes(n))) throw new q(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
226
- let i = V(r.content);
227
- return ee(i, [{
225
+ if (e === "addLocale" && (!I(n) || t.localization && !t.localization.locales.includes(n))) throw new K(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
226
+ let i = L(r.content);
227
+ return te(i, [{
228
228
  op: e,
229
229
  locale: n
230
- }]), W(i, r.content) ? null : i;
230
+ }]), q(i, r.content) ? null : i;
231
231
  }
232
232
  function f(e, t) {
233
233
  let n = d(e, t);
@@ -248,17 +248,17 @@ function Ie(t) {
248
248
  }
249
249
  function v(e, t) {
250
250
  let [n, o] = t;
251
- if (!i.value || !s() || I(n)) return null;
252
- let c = N(r.content.blocks, n);
251
+ if (!i.value || !s() || P(n)) return null;
252
+ let c = M(r.content.blocks, n);
253
253
  if (!c) return null;
254
- let l = c.l10n?.[i.value], u = B(c, i.value, L(r.content)), d = De(c, u, l, a), f = e === "resetLocaleFields" && Array.isArray(o) ? Te(c, u, o) : void 0, p = e === "resetLocaleFields" ? Ae(l, d, De(c, u, l, a, f), c, u, Array.isArray(o) ? o : []) : V(l ?? {});
254
+ let l = c.l10n?.[i.value], u = z(c, i.value, U(r.content)), d = X(c, u, l, a), f = e === "resetLocaleFields" && Array.isArray(o) ? Ee(c, u, o) : void 0, p = e === "resetLocaleFields" ? Ae(l, d, X(c, u, l, a, f), c, u, Array.isArray(o) ? o : []) : L(l ?? {});
255
255
  if (e === "setBlockHidden") o ? p.hidden = !0 : delete p.hidden;
256
256
  else if (e === "resetLocaleFields") o || (delete p.text, delete p.set, delete p.hidden);
257
257
  else for (let e of o) {
258
258
  let t = p.text?.[e];
259
- t && (t.sourceHash = le(String(T(c, e) ?? "")));
259
+ t && (t.sourceHash = V(String(G(c, e) ?? "")));
260
260
  }
261
- return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, W(l ?? {}, p) ? null : {
261
+ return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, q(l ?? {}, p) ? null : {
262
262
  block: c,
263
263
  layer: p
264
264
  };
@@ -280,28 +280,28 @@ function Ie(t) {
280
280
  function A() {
281
281
  r.isDirty = !0, k++;
282
282
  }
283
- let j = b({
283
+ let ee = b({
284
284
  get: () => r.content,
285
285
  set: (e) => {
286
286
  r.content = e, A();
287
287
  }
288
- }), M = b(() => r.selectedBlockId ? N(r.content.blocks, r.selectedBlockId) : null);
289
- function N(e, t) {
288
+ }), j = b(() => r.selectedBlockId ? M(r.content.blocks, r.selectedBlockId) : null);
289
+ function M(e, t) {
290
290
  for (let n of e) {
291
291
  if (n.id === t) return n;
292
292
  if (n.type === "section") for (let e of n.children) {
293
- let n = N(e, t);
293
+ let n = M(e, t);
294
294
  if (n) return n;
295
295
  }
296
296
  }
297
297
  return null;
298
298
  }
299
- function P(e, t, n = { blocks: e }) {
299
+ function N(e, t, n = { blocks: e }) {
300
300
  for (let r = 0; r < e.length; r++) {
301
301
  let i = e[r];
302
302
  if (i.id === t) return n;
303
303
  if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
304
- let n = P(i.children[e], t, {
304
+ let n = N(i.children[e], t, {
305
305
  blocks: i.children[e],
306
306
  sectionId: i.id,
307
307
  columnIndex: e
@@ -311,7 +311,7 @@ function Ie(t) {
311
311
  }
312
312
  return null;
313
313
  }
314
- function I(e, n = !1) {
314
+ function P(e, n = !1) {
315
315
  let r = i.value ?? t.lockLocale?.value ?? null;
316
316
  for (let [i, a] of t.lockedBlocks?.value ?? []) {
317
317
  let o = a;
@@ -321,8 +321,8 @@ function Ie(t) {
321
321
  }
322
322
  return !1;
323
323
  }
324
- function R(e) {
325
- let t = P(r.content.blocks, e);
324
+ function ne(e) {
325
+ let t = N(r.content.blocks, e);
326
326
  if (!t) return null;
327
327
  let n = t.blocks.findIndex((t) => t.id === e);
328
328
  return n === -1 ? null : {
@@ -331,63 +331,63 @@ function Ie(t) {
331
331
  index: n
332
332
  };
333
333
  }
334
- function z(e, t = !0) {
335
- G(e), U(e), r.content = e, t && A();
334
+ function F(e, t = !0) {
335
+ W(e), H(e), r.content = e, t && A();
336
336
  }
337
- function ie(e) {
338
- e && I(e) || (r.selectedBlockId = e);
337
+ function re(e) {
338
+ e && P(e) || (r.selectedBlockId = e);
339
339
  }
340
- function K(e) {
340
+ function R(e) {
341
341
  r.viewport = e;
342
342
  }
343
- function ae(e) {
343
+ function oe(e) {
344
344
  r.darkMode = e;
345
345
  }
346
- function oe(e) {
346
+ function se(e) {
347
347
  r.uiTheme = e;
348
348
  }
349
349
  function ce(e) {
350
350
  r.previewMode = e, e && (r.selectedBlockId = null);
351
351
  }
352
- function ue(e, t) {
352
+ function de(e, t) {
353
353
  if (!s()) return !1;
354
- let n = N(r.content.blocks, e);
354
+ let n = M(r.content.blocks, e);
355
355
  if (!n) return !1;
356
- if ("l10n" in t) throw new q("l10n is immutable in updateBlock.", void 0, "invalid_operation");
356
+ if ("l10n" in t) throw new K("l10n is immutable in updateBlock.", void 0, "invalid_operation");
357
357
  let a = {
358
358
  ...n,
359
359
  ...t
360
- }, o = V(n), c = Oe(o, a, (e) => N(r.content.blocks, e)), l = "children" in t, u = c || l || a.type !== n.type;
360
+ }, o = L(n), c = Oe(o, a, (e) => M(r.content.blocks, e)), l = "children" in t, u = c || l || a.type !== n.type;
361
361
  if (l && a.type === "section" && Array.isArray(a.children)) {
362
- let e = new Set(F(n).slice(1)), t = /* @__PURE__ */ new Set();
363
- for (let n of a.children) for (let i of n) for (let n of F(i)) {
364
- if (t.has(n) || I(n, !0) || N(r.content.blocks, n) !== null && !e.has(n)) return !1;
362
+ let e = new Set(T(n).slice(1)), t = /* @__PURE__ */ new Set();
363
+ for (let n of a.children) for (let i of n) for (let n of T(i)) {
364
+ if (t.has(n) || P(n, !0) || M(r.content.blocks, n) !== null && !e.has(n)) return !1;
365
365
  t.add(n);
366
366
  }
367
367
  if (i.value) {
368
- let e = F(o);
368
+ let e = T(o);
369
369
  if (new Set(e).size !== e.length) return !1;
370
370
  }
371
371
  }
372
- return !I(e, u || "columns" in t) && (!u || !F(n).some((t) => t !== e && I(t, !0)));
372
+ return !P(e, u || "columns" in t) && (!u || !T(n).some((t) => t !== e && P(t, !0)));
373
373
  }
374
- function de(e, n) {
375
- if (!ue(e, n)) return;
376
- let o = N(r.content.blocks, e);
374
+ function fe(e, n) {
375
+ if (!de(e, n)) return;
376
+ let o = M(r.content.blocks, e);
377
377
  if (!o) return;
378
378
  let s = i.value;
379
379
  if (s) {
380
- let i = B(o, s, L(r.content)), c = {
380
+ let i = z(o, s, U(r.content)), c = {
381
381
  ...i,
382
382
  ...n
383
- }, l = V(o), u = Oe(l, c, (e) => N(r.content.blocks, e));
384
- if (I(e, u)) return;
383
+ }, l = L(o), u = Oe(l, c, (e) => M(r.content.blocks, e));
384
+ if (P(e, u)) return;
385
385
  u && t.onStructureChange?.();
386
- let d = re(l);
387
- delete o.l10n, Object.assign(o, d), _(o, Ae(o.l10n?.[s], De(o, i, o.l10n?.[s], a), De(o, c, o.l10n?.[s], a), o, c));
386
+ let d = ie(l);
387
+ delete o.l10n, Object.assign(o, d), _(o, Ae(o.l10n?.[s], X(o, i, o.l10n?.[s], a), X(o, c, o.l10n?.[s], a), o, c));
388
388
  } else {
389
- if (I(e, "children" in n || "columns" in n)) return;
390
- let t = re({
389
+ if (P(e, "children" in n || "columns" in n)) return;
390
+ let t = ie({
391
391
  ...o,
392
392
  ...n
393
393
  });
@@ -395,20 +395,20 @@ function Ie(t) {
395
395
  }
396
396
  A();
397
397
  }
398
- function fe(e) {
399
- if ("locales" in e || "l10n" in e) throw new q("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
400
- if ("locale" in e && e.locale !== L(r.content) && r.content.settings.locales?.length) throw new q("The default locale can't change while language versions exist.", void 0, "invalid_operation");
398
+ function pe(e) {
399
+ if ("locales" in e || "l10n" in e) throw new K("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
400
+ if ("locale" in e && e.locale !== U(r.content) && r.content.settings.locales?.length) throw new K("The default locale can't change while language versions exist.", void 0, "invalid_operation");
401
401
  }
402
402
  function me(e) {
403
403
  if (!s()) return;
404
- fe(e);
404
+ pe(e);
405
405
  let t = i.value;
406
- if (!t) r.content.settings = te({
406
+ if (!t) r.content.settings = le({
407
407
  ...r.content.settings,
408
408
  ...e
409
409
  });
410
410
  else {
411
- let n = r.content.settings, i = H(r.content, t).settings, a = {
411
+ let n = r.content.settings, i = ae(r.content, t).settings, a = {
412
412
  ...i,
413
413
  locale: n.locale,
414
414
  ...e
@@ -423,9 +423,9 @@ function Ie(t) {
423
423
  let he = {
424
424
  canEdit: s,
425
425
  content: () => r.content,
426
- findBlock: (e) => N(r.content.blocks, e),
427
- findBlockLocation: R,
428
- isBlockLocked: I
426
+ findBlock: (e) => M(r.content.blocks, e),
427
+ findBlockLocation: ne,
428
+ isBlockLocked: P
429
429
  };
430
430
  function ge(e, n, a = 0, o) {
431
431
  if (Me(he, "addBlock", [
@@ -435,7 +435,7 @@ function Ie(t) {
435
435
  o
436
436
  ])) {
437
437
  if (n) {
438
- let t = N(r.content.blocks, n);
438
+ let t = M(r.content.blocks, n);
439
439
  if (t && t.type === "section") {
440
440
  t.children[a] = t.children[a] || [];
441
441
  let n = t.children[a];
@@ -447,12 +447,12 @@ function Ie(t) {
447
447
  }
448
448
  function _e(e) {
449
449
  if (!Me(he, "removeBlock", [e])) return;
450
- let n = P(r.content.blocks, e);
450
+ let n = N(r.content.blocks, e);
451
451
  if (n) {
452
452
  let a = n.blocks.findIndex((t) => t.id === e);
453
453
  if (a !== -1) {
454
454
  let [e] = n.blocks.splice(a, 1);
455
- r.selectedBlockId && new Set(F(e)).has(r.selectedBlockId) && (r.selectedBlockId = null), i.value && t.onStructureChange?.(), A();
455
+ r.selectedBlockId && new Set(T(e)).has(r.selectedBlockId) && (r.selectedBlockId = null), i.value && t.onStructureChange?.(), A();
456
456
  }
457
457
  }
458
458
  }
@@ -463,9 +463,9 @@ function Ie(t) {
463
463
  a,
464
464
  o
465
465
  ])) return;
466
- let s = P(r.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
466
+ let s = N(r.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
467
467
  if (a) {
468
- let e = N(r.content.blocks, a);
468
+ let e = M(r.content.blocks, a);
469
469
  e.children[o] = e.children[o] || [], l = e.children[o];
470
470
  } else l = r.content.blocks;
471
471
  let [u] = s.blocks.splice(c, 1);
@@ -475,10 +475,10 @@ function Ie(t) {
475
475
  A();
476
476
  }
477
477
  function be(e, t) {
478
- throw new q(`[Templatical] Templates: ${e} ${t}`);
478
+ throw new K(`[Templatical] Templates: ${e} ${t}`);
479
479
  }
480
480
  function xe(e) {
481
- Q(t.onError, e);
481
+ Ie(t.onError, e);
482
482
  }
483
483
  function J(e) {
484
484
  let { templates: n } = t;
@@ -490,7 +490,7 @@ function Ie(t) {
490
490
  name: e
491
491
  }, A());
492
492
  }
493
- async function Y(e) {
493
+ async function Ce(e) {
494
494
  let n = J("create()"), { create: i } = n;
495
495
  typeof i != "function" && be("create()", "is disabled by the provider — its `create` is `false`.");
496
496
  let a, o = ++O;
@@ -509,11 +509,11 @@ function Ie(t) {
509
509
  }
510
510
  return xe(() => n.onCreated?.(a)), a;
511
511
  }
512
- async function Ce(e, n) {
512
+ async function Y(e, n) {
513
513
  let i = J("load()"), a, o = ++O;
514
514
  r.isLoading = !0;
515
515
  try {
516
- if (a = await i.load(e), G(a.content), U(a.content), n && !n()) return a;
516
+ if (a = await i.load(e), W(a.content), H(a.content), n && !n()) return a;
517
517
  r.template = a, r.content = a.content, D.value++, r.isDirty = !1, E.value++;
518
518
  } catch (e) {
519
519
  throw t.onError?.(e), e;
@@ -549,15 +549,15 @@ function Ie(t) {
549
549
  }
550
550
  return xe(() => n.onSaved?.(s, { trigger: e })), s;
551
551
  }
552
- function Ee() {
552
+ function Te() {
553
553
  return r.template?.id !== void 0;
554
554
  }
555
- let X = {
555
+ let De = {
556
556
  state: m(r),
557
557
  loadVersion: m(E),
558
558
  contentReplaced: m(D),
559
- content: j,
560
- selectedBlock: M,
559
+ content: ee,
560
+ selectedBlock: j,
561
561
  activeLocale: i,
562
562
  setActiveLocale: o,
563
563
  addLocale: p,
@@ -567,34 +567,34 @@ function Ie(t) {
567
567
  keepTranslations: w,
568
568
  setCustomBlockDefinitions: c,
569
569
  createSetDefaultLocaleOperation: l,
570
- isBlockLocked: I,
571
- setContent: z,
572
- selectBlock: ie,
573
- setViewport: K,
574
- setDarkMode: ae,
575
- setUiTheme: oe,
570
+ isBlockLocked: P,
571
+ setContent: F,
572
+ selectBlock: re,
573
+ setViewport: R,
574
+ setDarkMode: oe,
575
+ setUiTheme: se,
576
576
  setPreviewMode: ce,
577
- updateBlock: de,
577
+ updateBlock: fe,
578
578
  updateSettings: me,
579
579
  addBlock: ge,
580
580
  removeBlock: _e,
581
581
  moveBlock: ve,
582
582
  markDirty: ye,
583
- findBlockLocation: R,
583
+ findBlockLocation: ne,
584
584
  setName: Se,
585
- create: Y,
586
- load: Ce,
585
+ create: Ce,
586
+ load: Y,
587
587
  save: we,
588
- hasTemplate: Ee
588
+ hasTemplate: Te
589
589
  };
590
- return Ne(X, (e, t) => je(e) ? Me(he, e, t) : s() ? e === "updateBlock" ? ue(t[0], t[1]) : (e === "updateSettings" && fe(t[0]), e === "addLocale" || e === "removeLocale" ? d(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? v(e, t) !== null : !0) : !1), X;
590
+ return Pe(De, (e, t) => je(e) ? Me(he, e, t) : s() ? e === "updateBlock" ? de(t[0], t[1]) : (e === "updateSettings" && pe(t[0]), e === "addLocale" || e === "removeLocale" ? d(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? v(e, t) !== null : !0) : !1), De;
591
591
  }
592
592
  // ../core/src/history.ts
593
- var Le = 50, Re = 300, ze = 1500;
594
- function Be(e) {
595
- let { content: t, setContent: n, maxSize: r = Le } = e, i = S([]), a = S([]), o = S(!1), s = null, c = null, l = b(() => i.value.length > 0), u = b(() => a.value.length > 0);
593
+ var Re = 50, ze = 300, Be = 1500;
594
+ function Ve(e) {
595
+ let { content: t, setContent: n, maxSize: r = Re } = e, i = S([]), a = S([]), o = S(!1), s = null, c = null, l = b(() => i.value.length > 0), u = b(() => a.value.length > 0);
596
596
  function d() {
597
- return V(t.value);
597
+ return L(t.value);
598
598
  }
599
599
  function f(e) {
600
600
  i.value.push(e), i.value.length > r && i.value.splice(0, i.value.length - r);
@@ -608,17 +608,17 @@ function Be(e) {
608
608
  function h(e) {
609
609
  c && c.blockId === e ? (clearTimeout(c.timeoutId), c.timeoutId = setTimeout(() => {
610
610
  c = null;
611
- }, Re)) : (p(), f(d()), a.value = [], c = {
611
+ }, ze)) : (p(), f(d()), a.value = [], c = {
612
612
  blockId: e,
613
613
  timeoutId: setTimeout(() => {
614
614
  c = null;
615
- }, Re)
615
+ }, ze)
616
616
  });
617
617
  }
618
618
  function g() {
619
619
  o.value = !0, s && clearTimeout(s), s = setTimeout(() => {
620
620
  o.value = !1, s = null;
621
- }, ze);
621
+ }, Be);
622
622
  }
623
623
  function _() {
624
624
  if (i.value.length === 0) return;
@@ -652,15 +652,15 @@ function Be(e) {
652
652
  };
653
653
  }
654
654
  // ../core/src/block-actions.ts
655
- function Ve(e) {
655
+ function He(e) {
656
656
  let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
657
657
  function o(n, r, a) {
658
- let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = fe(n, o);
658
+ let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = me(n, o);
659
659
  return t(s, r, a), i(s.id), s;
660
660
  }
661
661
  function s(e, n, r) {
662
- let o = ue(e);
663
- if (!Z(t, "duplicateBlock", [
662
+ let o = pe(e);
663
+ if (!Q(t, "duplicateBlock", [
664
664
  e,
665
665
  n,
666
666
  r
@@ -686,9 +686,9 @@ function Ve(e) {
686
686
  };
687
687
  }
688
688
  // ../core/src/auto-save.ts
689
- var He = 2e3;
690
- function Ue(e) {
691
- let { content: t, isDirty: n, onChange: r, debounce: i = He, enabled: a = !0 } = e, o = null, s = !1;
689
+ var Ue = 2e3;
690
+ function We(e) {
691
+ let { content: t, isDirty: n, onChange: r, debounce: i = Ue, enabled: a = !0 } = e, o = null, s = !1;
692
692
  function c() {
693
693
  return typeof a == "function" ? a() : a;
694
694
  }
@@ -724,7 +724,7 @@ function Ue(e) {
724
724
  };
725
725
  }
726
726
  // ../core/src/condition-preview.ts
727
- function We(t) {
727
+ function Ge(t) {
728
728
  let n = e(/* @__PURE__ */ new Set()), r = b(() => n.size > 0);
729
729
  function i(e) {
730
730
  return n.has(e);
@@ -743,7 +743,7 @@ function We(t) {
743
743
  };
744
744
  }
745
745
  // ../core/src/data-source-fetch.ts
746
- function Ge(e) {
746
+ function Ke(e) {
747
747
  let t = S(!1), n = S(!1), r = b(() => !!e.definition.value?.dataSource), i = b(() => r.value && !e.block.value.dataSourceFetched);
748
748
  async function a() {
749
749
  let r = e.definition.value;
@@ -774,7 +774,7 @@ function Ge(e) {
774
774
  };
775
775
  }
776
776
  // ../core/src/history-interceptor.ts
777
- function Ke(e, t) {
777
+ function qe(e, t) {
778
778
  e.contentReplaced && h(e.contentReplaced, () => t.clear()), e.activeLocale && h(e.activeLocale, () => t.flushDebounce?.());
779
779
  for (let n of [
780
780
  "addLocale",
@@ -785,65 +785,65 @@ function Ke(e, t) {
785
785
  ]) {
786
786
  let r = e[n];
787
787
  r && (Object.assign(e, { [n]: (...i) => {
788
- Z(e, n, i) && (["addLocale", "removeLocale"].includes(n) || !e.isBlockLocked(i[0])) && (t.record(), r(...i));
789
- } }), Pe(r, e[n]));
788
+ Q(e, n, i) && (["addLocale", "removeLocale"].includes(n) || !e.isBlockLocked(i[0])) && (t.record(), r(...i));
789
+ } }), Z(r, e[n]));
790
790
  }
791
791
  let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
792
792
  e.addBlock = (r, i, a, o) => {
793
- Z(e, "addBlock", [
793
+ Q(e, "addBlock", [
794
794
  r,
795
795
  i,
796
796
  a,
797
797
  o
798
798
  ]) && (t.record(), n(r, i, a, o));
799
799
  }, e.removeBlock = (n) => {
800
- Z(e, "removeBlock", [n]) && (t.record(), r(n));
800
+ Q(e, "removeBlock", [n]) && (t.record(), r(n));
801
801
  }, e.moveBlock = (n, r, a, o) => {
802
- Z(e, "moveBlock", [
802
+ Q(e, "moveBlock", [
803
803
  n,
804
804
  r,
805
805
  a,
806
806
  o
807
807
  ]) && (t.record(), i(n, r, a, o));
808
- }, Pe(n, e.addBlock), Pe(r, e.removeBlock), Pe(i, e.moveBlock), e.updateBlock = (n, r) => {
809
- Z(e, "updateBlock", [n, r]) && (e.isBlockLocked(n) || (t.recordDebounced(n), a(n, r)));
808
+ }, Z(n, e.addBlock), Z(r, e.removeBlock), Z(i, e.moveBlock), e.updateBlock = (n, r) => {
809
+ Q(e, "updateBlock", [n, r]) && (e.isBlockLocked(n) || (t.recordDebounced(n), a(n, r)));
810
810
  }, e.updateSettings = (n) => {
811
- Z(e, "updateSettings", [n]) && (t.record(), o(n));
812
- }, Pe(a, e.updateBlock), Pe(o, e.updateSettings);
811
+ Q(e, "updateSettings", [n]) && (t.record(), o(n));
812
+ }, Z(a, e.updateBlock), Z(o, e.updateSettings);
813
813
  }
814
814
  // ../core/src/diff-content.ts
815
- var qe = "root", Je = /* @__PURE__ */ new Set([
815
+ var Je = "root", Ye = /* @__PURE__ */ new Set([
816
816
  "id",
817
817
  "type",
818
818
  "children",
819
819
  "l10n"
820
- ]), Ye = /* @__PURE__ */ new Set([
820
+ ]), Xe = /* @__PURE__ */ new Set([
821
821
  "id",
822
822
  "type",
823
823
  "children",
824
824
  "columns",
825
825
  "l10n"
826
- ]), Xe = /* @__PURE__ */ new Set(), Ze = /* @__PURE__ */ new Set(["locales", "l10n"]);
827
- function Qe(e) {
828
- return e === null ? qe : "wrapperId" in e ? JSON.stringify(["wrapper", e.wrapperId]) : JSON.stringify([
826
+ ]), Ze = /* @__PURE__ */ new Set(), Qe = /* @__PURE__ */ new Set(["locales", "l10n"]);
827
+ function $e(e) {
828
+ return e === null ? Je : "wrapperId" in e ? JSON.stringify(["wrapper", e.wrapperId]) : JSON.stringify([
829
829
  "section",
830
830
  e.sectionId,
831
831
  e.column
832
832
  ]);
833
833
  }
834
- function $e(e) {
834
+ function et(e) {
835
835
  let t = e.children;
836
836
  return e.type === "section" && Array.isArray(t) ? t : [];
837
837
  }
838
- function et(e) {
838
+ function tt(e) {
839
839
  let t = /* @__PURE__ */ new Map(), n = (e, r) => {
840
840
  e.forEach((e, i) => {
841
841
  t.has(e.id) || t.set(e.id, {
842
842
  block: e,
843
843
  parent: r,
844
- key: Qe(r),
844
+ key: $e(r),
845
845
  index: i
846
- }), $e(e).forEach((t, r) => {
846
+ }), et(e).forEach((t, r) => {
847
847
  Array.isArray(t) && n(t, {
848
848
  sectionId: e.id,
849
849
  column: r
@@ -853,7 +853,7 @@ function et(e) {
853
853
  };
854
854
  return n(e, null), t;
855
855
  }
856
- function tt(e) {
856
+ function nt(e) {
857
857
  let t = [], n = Array(e.length).fill(-1);
858
858
  e.forEach((r, i) => {
859
859
  let a = 0, o = t.length;
@@ -867,17 +867,17 @@ function tt(e) {
867
867
  for (; i !== -1;) r.add(i), i = n[i];
868
868
  return r;
869
869
  }
870
- function nt(e, t, n) {
870
+ function rt(e, t, n) {
871
871
  let r = {}, i = [];
872
- for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || W(e[i], t[i]) || (r[i] = V(t[i]));
872
+ for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || q(e[i], t[i]) || (r[i] = L(t[i]));
873
873
  for (let r of Object.keys(e)) n.has(r) || e[r] === void 0 || t[r] === void 0 && i.push(r);
874
874
  return {
875
875
  set: r,
876
876
  unset: i
877
877
  };
878
878
  }
879
- function rt(e = {}, t = {}) {
880
- let n = nt(e.text ?? {}, t.text ?? {}, Xe), r = nt(e.set ?? {}, t.set ?? {}, Xe), i = [.../* @__PURE__ */ new Set([...n.unset, ...r.unset])];
879
+ function it(e = {}, t = {}) {
880
+ let n = rt(e.text ?? {}, t.text ?? {}, Ze), r = rt(e.set ?? {}, t.set ?? {}, Ze), i = [.../* @__PURE__ */ new Set([...n.unset, ...r.unset])];
881
881
  return {
882
882
  ...Object.keys(n.set).length > 0 ? { text: n.set } : {},
883
883
  ...Object.keys(r.set).length > 0 ? { set: r.set } : {},
@@ -885,15 +885,15 @@ function rt(e = {}, t = {}) {
885
885
  ...e.hidden === t.hidden ? {} : { hidden: t.hidden === !0 }
886
886
  };
887
887
  }
888
- function it(e, t) {
888
+ function at(e, t) {
889
889
  if (e.settings.locale !== t.settings.locale && (e.settings.locales?.length || t.settings.locales?.length)) return [{
890
890
  op: "setContent",
891
- content: V(t)
891
+ content: L(t)
892
892
  }];
893
- let n = et(e.blocks), r = et(t.blocks), i = [], a = new Set(t.settings.locales ?? []), o = new Set(e.settings.locales ?? []), s = (e) => {
893
+ let n = tt(e.blocks), r = tt(t.blocks), i = [], a = new Set(t.settings.locales ?? []), o = new Set(e.settings.locales ?? []), s = (e) => {
894
894
  let t = r.get(e), i = n.get(e);
895
895
  return t !== void 0 && i !== void 0 && t.block.type !== i.block.type;
896
- }, c = (e) => r.has(e.id) && !s(e.id), l = (e) => e.type === "wrapper" && Array.isArray(e.children) ? [e.children] : $e(e), u = (e) => l(e).some((e) => e.some((e) => c(e) || !s(e.id) && u(e))), d = /* @__PURE__ */ new Set(), f = [], p = (e, t) => {
896
+ }, c = (e) => r.has(e.id) && !s(e.id), l = (e) => e.type === "wrapper" && Array.isArray(e.children) ? [e.children] : et(e), u = (e) => l(e).some((e) => e.some((e) => c(e) || !s(e.id) && u(e))), d = /* @__PURE__ */ new Set(), f = [], p = (e, t) => {
897
897
  let n = "kept";
898
898
  t === "dropped" ? (d.add(e.id), n = "dropped") : s(e.id) ? (i.push({
899
899
  op: "deleteBlock",
@@ -906,15 +906,15 @@ function it(e, t) {
906
906
  };
907
907
  for (let t of e.blocks) p(t, "kept");
908
908
  let m = (e) => n.has(e) && !d.has(e), h = (e) => {
909
- let t = V(e);
910
- return t.type === "section" ? t.children = $e(e).map((e) => Array.isArray(e) ? e.filter((e) => !m(e.id)).map(h) : e) : t.type === "wrapper" && e.type === "wrapper" && (t.children = e.children.filter((e) => !m(e.id)).map(h)), t;
909
+ let t = L(e);
910
+ return t.type === "section" ? t.children = et(e).map((e) => Array.isArray(e) ? e.filter((e) => !m(e.id)).map(h) : e) : t.type === "wrapper" && e.type === "wrapper" && (t.children = e.children.filter((e) => !m(e.id)).map(h)), t;
911
911
  }, g = (e, t, r) => {
912
- let a = Qe(e), o = [], s = [];
912
+ let a = $e(e), o = [], s = [];
913
913
  t.forEach((e, t) => {
914
914
  let r = n.get(e.id);
915
915
  m(e.id) && r !== void 0 && r.key === a && (o.push(r.index), s.push(t));
916
916
  });
917
- let c = new Set([...tt(o)].map((e) => s[e]));
917
+ let c = new Set([...nt(o)].map((e) => s[e]));
918
918
  t.forEach((n, a) => {
919
919
  if (c.has(a) || r(n)) return;
920
920
  let o = a > 0 ? t[a - 1].id : null;
@@ -935,7 +935,7 @@ function it(e, t) {
935
935
  let _ = [...r.values()].map(({ block: e }) => e).filter((e) => e.type === "section"), v = /* @__PURE__ */ new Set(), y = (e) => {
936
936
  for (let t of _) {
937
937
  if (!m(t.id)) continue;
938
- let r = $e(n.get(t.id).block).length, a = $e(t).length;
938
+ let r = et(n.get(t.id).block).length, a = et(t).length;
939
939
  (e ? a > r : a < r) && (i.push({
940
940
  op: "updateBlock",
941
941
  blockId: t.id,
@@ -951,7 +951,7 @@ function it(e, t) {
951
951
  }
952
952
  for (let e of _) {
953
953
  let t = !m(e.id);
954
- $e(e).forEach((n, r) => {
954
+ et(e).forEach((n, r) => {
955
955
  Array.isArray(n) && g({
956
956
  sectionId: e.id,
957
957
  column: r
@@ -996,7 +996,7 @@ function it(e, t) {
996
996
  i.unshift(...w, ...E);
997
997
  for (let [e, t] of r) {
998
998
  if (!m(e)) continue;
999
- let r = nt(n.get(e).block, t.block, v.has(e) ? Ye : Je), { set: a } = r, o = T.has(e) ? r.unset.filter((e) => e !== "wrapper") : r.unset;
999
+ let r = rt(n.get(e).block, t.block, v.has(e) ? Xe : Ye), { set: a } = r, o = T.has(e) ? r.unset.filter((e) => e !== "wrapper") : r.unset;
1000
1000
  (Object.keys(a).length !== 0 || o.length !== 0) && i.push({
1001
1001
  op: "updateBlock",
1002
1002
  blockId: e,
@@ -1004,7 +1004,7 @@ function it(e, t) {
1004
1004
  ...o.length > 0 ? { unset: o } : {}
1005
1005
  });
1006
1006
  }
1007
- let D = nt(e.settings, t.settings, Ze);
1007
+ let D = rt(e.settings, t.settings, Qe);
1008
1008
  (Object.keys(D.set).length > 0 || D.unset.length > 0) && i.push({
1009
1009
  op: "updateSettings",
1010
1010
  ...Object.keys(D.set).length > 0 ? { set: D.set } : {},
@@ -1019,7 +1019,7 @@ function it(e, t) {
1019
1019
  let r = n.get(e).block.l10n ?? {}, o = t.block.l10n ?? {};
1020
1020
  for (let t of /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(o)])) {
1021
1021
  if (!a.has(t)) continue;
1022
- let n = rt(r[t], o[t]);
1022
+ let n = it(r[t], o[t]);
1023
1023
  C.has(JSON.stringify([e, t])) && delete n.hidden, Object.keys(n).length > 0 && i.push({
1024
1024
  op: "updateBlockLocale",
1025
1025
  blockId: e,
@@ -1031,7 +1031,7 @@ function it(e, t) {
1031
1031
  let O = e.settings.l10n ?? {}, k = t.settings.l10n ?? {};
1032
1032
  for (let e of /* @__PURE__ */ new Set([...Object.keys(O), ...Object.keys(k)])) {
1033
1033
  if (!a.has(e)) continue;
1034
- let t = rt(O[e], k[e]);
1034
+ let t = it(O[e], k[e]);
1035
1035
  Object.keys(t).length > 0 && i.push({
1036
1036
  op: "updateSettingsLocale",
1037
1037
  locale: e,
@@ -1051,7 +1051,7 @@ function $(e) {
1051
1051
  };
1052
1052
  return e.forEach(n), t;
1053
1053
  }
1054
- function at(e, t) {
1054
+ function ot(e, t) {
1055
1055
  if (t === null) return e.blocks;
1056
1056
  if ("sectionId" in t) {
1057
1057
  let n = $(e.blocks).get(t.sectionId);
@@ -1060,7 +1060,7 @@ function at(e, t) {
1060
1060
  let n = $(e.blocks).get(t.wrapperId);
1061
1061
  return n?.type === "wrapper" ? n.children : [];
1062
1062
  }
1063
- function ot(e, t) {
1063
+ function st(e, t) {
1064
1064
  let n = (e, r) => {
1065
1065
  let i = e.findIndex((e) => e.id === t);
1066
1066
  if (i >= 0) return {
@@ -1080,52 +1080,52 @@ function ot(e, t) {
1080
1080
  };
1081
1081
  return n(e.blocks, null);
1082
1082
  }
1083
- function st(e, t, n, r, i) {
1083
+ function ct(e, t, n, r, i) {
1084
1084
  if (r !== null) return r;
1085
- let a = at(t, n).find((e) => e.id !== i), o = at(e, n).filter((e) => e.id !== i);
1085
+ let a = ot(t, n).find((e) => e.id !== i), o = ot(e, n).filter((e) => e.id !== i);
1086
1086
  return o[(a ? o.findIndex((e) => e.id === a.id) : o.length) - 1]?.id ?? null;
1087
1087
  }
1088
- function ct(e, t, n) {
1088
+ function lt(e, t, n) {
1089
1089
  Object.keys(n).length ? (e.l10n ??= {})[t] = n : e.l10n && (delete e.l10n[t], Object.keys(e.l10n).length || delete e.l10n);
1090
1090
  }
1091
- function lt(e) {
1092
- let t = V(e);
1093
- return delete t.l10n, t.type === "section" ? t.children = t.children.map((e) => e.map(lt)) : t.type === "wrapper" && (t.children = t.children.map(lt)), t;
1091
+ function ut(e) {
1092
+ let t = L(e);
1093
+ return delete t.l10n, t.type === "section" ? t.children = t.children.map((e) => e.map(ut)) : t.type === "wrapper" && (t.children = t.children.map(ut)), t;
1094
1094
  }
1095
- function ut(e, t, n, r) {
1096
- let i = H(e, t), a = V(e), o = V(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
1095
+ function dt(e, t, n, r) {
1096
+ let i = ae(e, t), a = L(e), o = L(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
1097
1097
  for (let [i, a] of $(n)) c.set(i, {
1098
- initial: B(a, t, L(e)),
1098
+ initial: z(a, t, U(e)),
1099
1099
  added: r,
1100
1100
  changed: !1
1101
1101
  });
1102
1102
  };
1103
1103
  l(i.blocks, !1);
1104
1104
  let u = [], d = (e, t, n) => {
1105
- if (t.some((e) => e?.op === "setDefaultLocale")) throw new D("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
1106
- if (t.some((e) => e?.op === "setContent")) throw new D("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
1105
+ if (t.some((e) => e?.op === "setDefaultLocale")) throw new P("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
1106
+ if (t.some((e) => e?.op === "setContent")) throw new P("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
1107
1107
  try {
1108
- return j(e, t);
1108
+ return F(e, t);
1109
1109
  } catch (e) {
1110
- throw e instanceof D ? new D(e.code, n, e.message, e.blockId) : e;
1110
+ throw e instanceof P ? new P(e.code, n, e.message, e.blockId) : e;
1111
1111
  }
1112
1112
  }, f = (e, t) => {
1113
1113
  a = d(a, e, t), u.push(...e);
1114
1114
  }, p = (e, n) => {
1115
1115
  let o = c.get(e);
1116
1116
  if (!o?.changed) return;
1117
- let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = V(a), d = at(u, ot(u, e).parent), p = V(s);
1118
- if (o.added) p = lt(l), p.type === "section" && s.type === "section" ? (p.children = s.children, p.columns = s.columns) : p.type === "wrapper" && s.type === "wrapper" && (p.children = s.children);
1117
+ let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = L(a), d = ot(u, st(u, e).parent), p = L(s);
1118
+ if (o.added) p = ut(l), p.type === "section" && s.type === "section" ? (p.children = s.children, p.columns = s.columns) : p.type === "wrapper" && s.type === "wrapper" && (p.children = s.children);
1119
1119
  else {
1120
1120
  Oe(p, p.type === "section" ? {
1121
1121
  ...l,
1122
1122
  children: p.children,
1123
1123
  columns: p.columns
1124
- } : l, (e) => $(a.blocks).get(e) ?? null), p = re(p);
1124
+ } : l, (e) => $(a.blocks).get(e) ?? null), p = ie(p);
1125
1125
  let e = p.l10n?.[t];
1126
- ct(p, t, Ae(e, De(p, o.initial, e, r), De(p, l, e, r), p, l));
1126
+ lt(p, t, Ae(e, X(p, o.initial, e, r), X(p, l, e, r), p, l));
1127
1127
  }
1128
- d[d.findIndex((t) => t.id === e)] = p, f(it(a, u), n), o.changed = !1;
1128
+ d[d.findIndex((t) => t.id === e)] = p, f(at(a, u), n), o.changed = !1;
1129
1129
  }, m = (e, t, n) => {
1130
1130
  let r = $(a.blocks).get(e.blockId), i = $(t.blocks).get(e.blockId);
1131
1131
  if (r.type !== "section" || i.type !== "section" || r.columns === i.columns) return;
@@ -1144,7 +1144,7 @@ function ut(e, t, n, r) {
1144
1144
  op: "updateBlock",
1145
1145
  blockId: e.blockId,
1146
1146
  set: { columns: i.columns },
1147
- ...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, T(u, e) ?? null])) } : {}
1147
+ ...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, G(u, e) ?? null])) } : {}
1148
1148
  }], n);
1149
1149
  };
1150
1150
  n.forEach((e, t) => {
@@ -1152,19 +1152,19 @@ function ut(e, t, n, r) {
1152
1152
  let n = d(i, [e], t);
1153
1153
  switch (e.op) {
1154
1154
  case "addBlock": {
1155
- let n = lt(e.block);
1155
+ let n = ut(e.block);
1156
1156
  f([{
1157
1157
  ...e,
1158
1158
  block: n,
1159
- after: st(a, i, e.parent, e.after)
1159
+ after: ct(a, i, e.parent, e.after)
1160
1160
  }], t), l([n], !0);
1161
1161
  break;
1162
1162
  }
1163
1163
  case "moveBlock":
1164
1164
  f([{
1165
1165
  ...e,
1166
- after: st(a, i, e.parent, e.after, e.blockId),
1167
- ...e.expect ? { expect: ot(a, e.blockId) } : {}
1166
+ after: ct(a, i, e.parent, e.after, e.blockId),
1167
+ ...e.expect ? { expect: st(a, e.blockId) } : {}
1168
1168
  }], t);
1169
1169
  break;
1170
1170
  case "deleteBlock": {
@@ -1189,18 +1189,18 @@ function ut(e, t, n, r) {
1189
1189
  });
1190
1190
  for (let e of c.keys()) p(e, n.length - 1);
1191
1191
  if (s) {
1192
- let e = V(a), r = e.settings.l10n?.[t];
1193
- 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);
1192
+ let e = L(a), r = e.settings.l10n?.[t];
1193
+ lt(e.settings, t, Ae(r, ke(e.settings, o, r), ke(e.settings, i.settings, r), e.settings, i.settings)), f(at(a, e), n.length - 1);
1194
1194
  }
1195
1195
  return u;
1196
1196
  }
1197
- var dt = 1e3, ft = 1e4, pt = [
1197
+ var ft = 1e3, pt = 1e4, mt = [
1198
1198
  1e3,
1199
1199
  2e3,
1200
1200
  5e3,
1201
1201
  1e4,
1202
1202
  3e4
1203
- ], mt = 50, ht = 100, gt = /* @__PURE__ */ new Set([
1203
+ ], ht = 50, gt = 100, _t = /* @__PURE__ */ new Set([
1204
1204
  "block_exists",
1205
1205
  "block_missing",
1206
1206
  "anchor_missing",
@@ -1211,49 +1211,49 @@ var dt = 1e3, ft = 1e4, pt = [
1211
1211
  "lock_lost",
1212
1212
  "content_too_large"
1213
1213
  ]);
1214
- function _t(e, t) {
1214
+ function vt(e, t) {
1215
1215
  return e.ops.some((e) => e.op === "setContent") ? e.view = t : delete e.view, e;
1216
1216
  }
1217
- function vt(e) {
1217
+ function yt(e) {
1218
1218
  let t = e?.code;
1219
- return typeof t == "string" && gt.has(t) ? t : null;
1219
+ return typeof t == "string" && _t.has(t) ? t : null;
1220
1220
  }
1221
- function yt(e) {
1221
+ function bt(e) {
1222
1222
  let t = e?.holder;
1223
1223
  return typeof t == "object" && t && typeof t.sessionId == "string" ? t : void 0;
1224
1224
  }
1225
- function bt(e) {
1225
+ function xt(e) {
1226
1226
  let t = e?.statusCode;
1227
1227
  return typeof t != "number" || t >= 500 || t === 408 || t === 429;
1228
1228
  }
1229
- function xt(e, t) {
1229
+ function St(e, t) {
1230
1230
  return e.some((e) => {
1231
1231
  if (e.id === t) return !0;
1232
1232
  let n = e.children;
1233
- return e.type === "wrapper" && Array.isArray(n) && xt(n, t) || e.type === "section" && Array.isArray(n) && n.some((e) => Array.isArray(e) && xt(e, t));
1233
+ return e.type === "wrapper" && Array.isArray(n) && St(n, t) || e.type === "section" && Array.isArray(n) && n.some((e) => Array.isArray(e) && St(e, t));
1234
1234
  });
1235
1235
  }
1236
- function St(e) {
1236
+ function Ct(e) {
1237
1237
  if (e.length === 1 && e[0].op === "updateSettings") return !0;
1238
1238
  let t = e[0];
1239
1239
  return t.op === "updateBlock" && e.every((e) => e.op === "updateBlock" && e.blockId === t.blockId) || t.op === "updateBlockLocale" && e.every((e) => e.op === "updateBlockLocale" && e.blockId === t.blockId && e.locale === t.locale);
1240
1240
  }
1241
- function Ct(e) {
1241
+ function wt(e) {
1242
1242
  return e.map((e) => {
1243
1243
  if (!("expect" in e)) return e;
1244
1244
  let { expect: t, ...n } = e;
1245
1245
  return n;
1246
1246
  });
1247
1247
  }
1248
- function wt(e) {
1249
- let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), r = e.maxUndo ?? mt, i = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", a = x([]), s = x(/* @__PURE__ */ new Map()), l = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = S(null), p = S(null), m = S(0), g = S(0), _ = null, v = null, y = !1, C = !1, w = !1, T = !1, E = null, O = 0, k = !1, A = [], M = null, N = null, te = Promise.resolve(), F = null, I = b(() => (v?.undo.length ?? 0) > 0), L = b(() => (v?.redo.length ?? 0) > 0);
1250
- function R(t) {
1248
+ function Tt(e) {
1249
+ let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), r = e.maxUndo ?? ht, i = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", a = x([]), s = x(/* @__PURE__ */ new Map()), l = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = S(null), p = S(null), m = S(0), g = S(0), _ = null, v = null, y = !1, C = !1, w = !1, T = !1, E = null, D = 0, O = !1, k = [], A = null, j = null, M = Promise.resolve(), N = null, ne = b(() => (v?.undo.length ?? 0) > 0), re = b(() => (v?.redo.length ?? 0) > 0);
1250
+ function I(t) {
1251
1251
  e.onError?.(t instanceof Error ? t : Error(String(t)));
1252
1252
  }
1253
- function z(t, n = v) {
1254
- n !== v || k || e.onNotice?.(t);
1253
+ function R(t, n = v) {
1254
+ n !== v || O || e.onNotice?.(t);
1255
1255
  }
1256
- function ne() {
1256
+ function z() {
1257
1257
  return {
1258
1258
  locks: [...s.value.values()].map((e) => ({
1259
1259
  blockId: e.blockId,
@@ -1266,99 +1266,99 @@ function wt(e) {
1266
1266
  function B() {
1267
1267
  g.value++;
1268
1268
  }
1269
- function re(e, t) {
1269
+ function ie(e, t) {
1270
1270
  e.push(t), e.length > r && e.splice(0, e.length - r);
1271
1271
  }
1272
- function H(e) {
1272
+ function V(e) {
1273
1273
  if (!_ || y) return;
1274
1274
  C = !0;
1275
1275
  try {
1276
- let t = _.content.value, n = it(t, e);
1276
+ let t = _.content.value, n = at(t, e);
1277
1277
  if (n.length > 0) try {
1278
- ee(t, n);
1278
+ te(t, n);
1279
1279
  } catch {
1280
- _.setContent(V(e), !1);
1280
+ _.setContent(L(e), !1);
1281
1281
  }
1282
- W(_.content.value, e) || _.setContent(V(e), !1);
1282
+ q(_.content.value, e) || _.setContent(L(e), !1);
1283
1283
  } finally {
1284
1284
  C = !1;
1285
1285
  }
1286
1286
  let t = _.state.selectedBlockId;
1287
- t && !xt(e.blocks, t) && _.selectBlock(null);
1287
+ t && !St(e.blocks, t) && _.selectBlock(null);
1288
1288
  }
1289
- function ie() {
1289
+ function H() {
1290
1290
  C || T || (T = !0, queueMicrotask(() => {
1291
- T = !1, G(!1);
1291
+ T = !1, U(!1);
1292
1292
  }));
1293
1293
  }
1294
- function U() {
1294
+ function ae() {
1295
1295
  E &&= (clearTimeout(E), null);
1296
1296
  }
1297
- function G(e, t = !1) {
1297
+ function U(e, t = !1) {
1298
1298
  let n = v;
1299
1299
  if (!_ || !n || y || C || _.state.isLoading && !t || _.state.template?.id !== n.templateId) return;
1300
- let r = it(n.view, _.content.value);
1301
- if (r.length === 0) U();
1300
+ let r = at(n.view, _.content.value);
1301
+ if (r.length === 0) ae();
1302
1302
  else {
1303
- if (!e && St(r)) {
1303
+ if (!e && Ct(r)) {
1304
1304
  let e = Date.now();
1305
- if (E === null && (O = e), e - O < 1e3) {
1305
+ if (E === null && (D = e), e - D < 1e3) {
1306
1306
  E && clearTimeout(E), E = setTimeout(() => {
1307
- E = null, G(!0);
1307
+ E = null, U(!0);
1308
1308
  }, 300);
1309
1309
  return;
1310
1310
  }
1311
1311
  }
1312
- U(), ae(n, r);
1312
+ ae(), G(n, r);
1313
1313
  }
1314
1314
  }
1315
- function K() {
1316
- G(!0);
1315
+ function W() {
1316
+ U(!0);
1317
1317
  }
1318
- function ae(e, t) {
1318
+ function G(e, t) {
1319
1319
  let n = t, r;
1320
1320
  try {
1321
- r = j(e.view, n, ne());
1321
+ r = F(e.view, n, z());
1322
1322
  } catch (n) {
1323
- if (!(n instanceof D)) throw n;
1324
- H(e.view);
1325
- let r = n.blockId === void 0 ? void 0 : je(n.blockId).find((e) => {
1323
+ if (!(n instanceof P)) throw n;
1324
+ V(e.view);
1325
+ let r = n.blockId === void 0 ? void 0 : Ae(n.blockId).find((e) => {
1326
1326
  let r = t[n.opIndex];
1327
1327
  return r.op !== "updateBlockLocale" || e.locale == null || e.locale === r.locale;
1328
1328
  })?.holder;
1329
- z({
1329
+ R({
1330
1330
  type: "editRefused",
1331
1331
  code: n.code,
1332
1332
  ...r ? { holder: r } : {}
1333
- }), n.code === "invalid_operation" && R(n);
1333
+ }), n.code === "invalid_operation" && I(n);
1334
1334
  return;
1335
1335
  }
1336
1336
  let i = _.content.value;
1337
- if (!W(r, i)) {
1338
- R(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
1337
+ if (!q(r, i)) {
1338
+ I(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
1339
1339
  op: "setContent",
1340
- content: V(i)
1340
+ content: L(i)
1341
1341
  }];
1342
1342
  try {
1343
- r = j(e.view, n, ne());
1343
+ r = F(e.view, n, z());
1344
1344
  } catch (t) {
1345
- if (!(t instanceof D)) throw t;
1346
- H(e.view), z({
1345
+ if (!(t instanceof P)) throw t;
1346
+ V(e.view), R({
1347
1347
  type: "editRefused",
1348
1348
  code: t.code
1349
1349
  });
1350
1350
  return;
1351
1351
  }
1352
1352
  }
1353
- let a = _t({ ops: P(e.view, n) }, r);
1354
- re(e.undo, a), e.redo = [], B();
1353
+ let a = vt({ ops: ee(e.view, n) }, r);
1354
+ ie(e.undo, a), e.redo = [], B();
1355
1355
  let o = e.view;
1356
1356
  e.view = r, oe(e, n, "edit", a, o);
1357
1357
  }
1358
1358
  function oe(e, t, n, r, i) {
1359
1359
  let a = { dropped: !1 }, o = 0, s = i;
1360
1360
  do {
1361
- let i = t.slice(o, o + ht);
1361
+ let i = t.slice(o, o + gt);
1362
1362
  if (e.pending.push({
1363
1363
  batchId: crypto.randomUUID(),
1364
1364
  ops: i,
@@ -1368,8 +1368,8 @@ function wt(e) {
1368
1368
  sent: !1,
1369
1369
  revision: null,
1370
1370
  ...s && i.some((e) => e.op === "setContent") ? { base: s } : {}
1371
- }), o += ht, s && t.slice(o).some((e) => e.op === "setContent")) try {
1372
- s = j(s, i);
1371
+ }), o += gt, s && t.slice(o).some((e) => e.op === "setContent")) try {
1372
+ s = F(s, i);
1373
1373
  } catch {
1374
1374
  s = null;
1375
1375
  }
@@ -1379,7 +1379,7 @@ function wt(e) {
1379
1379
  function se(e) {
1380
1380
  if (e.inFlight || w) return;
1381
1381
  let t = e.pending.find((e) => !e.sent);
1382
- t ? (t.sent = !0, e.inFlight = t, ce(e, t, 0)) : pe(e);
1382
+ t ? (t.sent = !0, e.inFlight = t, ce(e, t, 0)) : K(e);
1383
1383
  }
1384
1384
  function ce(e, n, r) {
1385
1385
  t.submit(e.templateId, {
@@ -1388,25 +1388,25 @@ function wt(e) {
1388
1388
  ops: n.ops,
1389
1389
  ...n.origin === "ai" ? { origin: "ai" } : {}
1390
1390
  }).then(({ revision: t }) => {
1391
- e.inFlight = null, q(e, n, t), se(e);
1391
+ e.inFlight = null, le(e, n, t), se(e);
1392
1392
  }, (t) => {
1393
- if (vt(t) !== null) e.inFlight = null, fe(e, n, t), se(e);
1394
- else if (bt(t)) {
1393
+ if (yt(t) !== null) e.inFlight = null, pe(e, n, t), se(e);
1394
+ else if (xt(t)) {
1395
1395
  me(e, t);
1396
- let i = pt[Math.min(r, pt.length - 1)];
1396
+ let i = mt[Math.min(r, mt.length - 1)];
1397
1397
  setTimeout(() => {
1398
- k || ce(e, n, r + 1);
1398
+ O || ce(e, n, r + 1);
1399
1399
  }, i);
1400
- } else e.inFlight = null, R(t), fe(e, n, t), se(e);
1400
+ } else e.inFlight = null, I(t), pe(e, n, t), se(e);
1401
1401
  });
1402
1402
  }
1403
- function q(e, t, n) {
1404
- t.revision === null && (t.revision = n, n <= e.revision ? (le(e, t), ve(e)) : (e.own.set(n, t), _e(e)));
1405
- }
1406
- function le(e, t) {
1407
- e.pending = e.pending.filter((e) => e !== t), pe(e);
1403
+ function le(e, t, n) {
1404
+ t.revision === null && (t.revision = n, n <= e.revision ? (ue(e, t), ve(e)) : (e.own.set(n, t), _e(e)));
1408
1405
  }
1409
1406
  function ue(e, t) {
1407
+ e.pending = e.pending.filter((e) => e !== t), K(e);
1408
+ }
1409
+ function de(e, t) {
1410
1410
  if (t.entry) {
1411
1411
  for (let n of [e.undo, e.redo]) {
1412
1412
  let e = n.indexOf(t.entry);
@@ -1415,28 +1415,28 @@ function wt(e) {
1415
1415
  B();
1416
1416
  }
1417
1417
  }
1418
- function de(e, t) {
1418
+ function fe(e, t) {
1419
1419
  let n = !t.group.dropped;
1420
- return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && ue(e, t), pe(e), n;
1420
+ return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && de(e, t), K(e), n;
1421
1421
  }
1422
- function fe(e, t, n) {
1423
- if (le(e, t), de(e, t)) {
1424
- let r = vt(n) ?? "invalid_operation";
1422
+ function pe(e, t, n) {
1423
+ if (ue(e, t), fe(e, t)) {
1424
+ let r = yt(n) ?? "invalid_operation";
1425
1425
  if (t.origin === "edit" || t.origin === "ai") {
1426
- let t = yt(n);
1427
- z({
1426
+ let t = bt(n);
1427
+ R({
1428
1428
  type: "editRefused",
1429
1429
  code: r,
1430
1430
  ...t ? { holder: t } : {}
1431
1431
  }, e);
1432
- } else z({
1432
+ } else R({
1433
1433
  type: "undoSkipped",
1434
1434
  code: r
1435
1435
  }, e);
1436
1436
  }
1437
1437
  ve(e), e === v && J();
1438
1438
  }
1439
- function pe(e) {
1439
+ function K(e) {
1440
1440
  if (!(e.pending.length > 0 || e.waiters.length === 0)) for (let t of e.waiters.splice(0)) t.resolve();
1441
1441
  }
1442
1442
  function me(e, t) {
@@ -1446,16 +1446,16 @@ function wt(e) {
1446
1446
  function he(e, t) {
1447
1447
  if (t.revision <= e.revision) return;
1448
1448
  let n = e.pending.find((e) => e.batchId === t.batchId);
1449
- n ? q(e, n, t.revision) : (e.remote.set(t.revision, t), _e(e));
1449
+ n ? le(e, n, t.revision) : (e.remote.set(t.revision, t), _e(e));
1450
1450
  }
1451
1451
  function ge(t, n) {
1452
1452
  let r = n.ops;
1453
1453
  if (e.normalizeRemoteOperations) try {
1454
1454
  r = e.normalizeRemoteOperations(n.ops, t.confirmed);
1455
1455
  } catch (e) {
1456
- R(e);
1456
+ I(e);
1457
1457
  }
1458
- return Ct(r);
1458
+ return wt(r);
1459
1459
  }
1460
1460
  function _e(t) {
1461
1461
  let n = [], r = !1;
@@ -1463,16 +1463,16 @@ function wt(e) {
1463
1463
  let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
1464
1464
  if (!i && !a) break;
1465
1465
  try {
1466
- t.confirmed = j(t.confirmed, i ? ge(t, i) : a.ops);
1466
+ t.confirmed = F(t.confirmed, i ? ge(t, i) : a.ops);
1467
1467
  } catch {
1468
1468
  if (t.recovering) {
1469
- t.remote.clear(), t.own.clear(), R(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
1469
+ t.remote.clear(), t.own.clear(), I(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
1470
1470
  return;
1471
1471
  }
1472
1472
  Se(t);
1473
1473
  return;
1474
1474
  }
1475
- t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), le(t, a));
1475
+ t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), ue(t, a));
1476
1476
  }
1477
1477
  if (t === v && (m.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? be(t) : xe(t), (n.length !== 0 || r) && (ve(t), t === v)) for (let t of n) try {
1478
1478
  e.onRemoteChange?.({
@@ -1481,7 +1481,7 @@ function wt(e) {
1481
1481
  locale: t.ops.find((e) => e.op !== "setDefaultLocale" && "locale" in e)?.locale ?? null
1482
1482
  });
1483
1483
  } catch (e) {
1484
- R(e);
1484
+ I(e);
1485
1485
  }
1486
1486
  }
1487
1487
  function ve(e) {
@@ -1495,18 +1495,18 @@ function wt(e) {
1495
1495
  t && se(e);
1496
1496
  }
1497
1497
  function ye(e) {
1498
- e === v && K();
1498
+ e === v && W();
1499
1499
  let t = e.confirmed;
1500
1500
  for (let n = 0; n < e.pending.length; n++) {
1501
1501
  let r = e.pending[n], i;
1502
- if (r.base && !W(r.base, t)) i = "precondition_failed";
1502
+ if (r.base && !q(r.base, t)) i = "precondition_failed";
1503
1503
  else try {
1504
- t = j(t, r.ops);
1504
+ t = F(t, r.ops);
1505
1505
  continue;
1506
1506
  } catch (e) {
1507
- i = e instanceof D ? e.code : "invalid_operation";
1507
+ i = e instanceof P ? e.code : "invalid_operation";
1508
1508
  }
1509
- r.sent || (de(e, r) && z(r.origin === "edit" || r.origin === "ai" ? {
1509
+ r.sent || (fe(e, r) && R(r.origin === "edit" || r.origin === "ai" ? {
1510
1510
  type: "editRefused",
1511
1511
  code: i
1512
1512
  } : {
@@ -1514,12 +1514,12 @@ function wt(e) {
1514
1514
  code: i
1515
1515
  }, e), t = e.confirmed, n = -1);
1516
1516
  }
1517
- e.view = t, pe(e), e === v && H(t);
1517
+ e.view = t, K(e), e === v && V(t);
1518
1518
  }
1519
1519
  function be(e) {
1520
1520
  e.gapTimer ||= setTimeout(() => {
1521
1521
  e.gapTimer = null, e === v && J();
1522
- }, dt);
1522
+ }, ft);
1523
1523
  }
1524
1524
  function xe(e) {
1525
1525
  e.gapTimer &&= (clearTimeout(e.gapTimer), null);
@@ -1536,7 +1536,7 @@ function wt(e) {
1536
1536
  }
1537
1537
  for (let t of n.batches) he(e, t);
1538
1538
  } catch (e) {
1539
- R(e);
1539
+ I(e);
1540
1540
  } finally {
1541
1541
  e.catchingUp = null;
1542
1542
  }
@@ -1547,20 +1547,20 @@ function wt(e) {
1547
1547
  try {
1548
1548
  let n = await e.loadTemplate(t.templateId);
1549
1549
  if (t.retired) return;
1550
- Y(t, n);
1550
+ Ce(t, n);
1551
1551
  } catch (e) {
1552
- R(e);
1552
+ I(e);
1553
1553
  } finally {
1554
1554
  t.recovering = !1;
1555
1555
  }
1556
1556
  }
1557
- function Y(e, t) {
1557
+ function Ce(e, t) {
1558
1558
  let n = t.revision ?? e.revision;
1559
- e.confirmed = V(t.content), e.revision = n, e.remote = new Map([...e.remote].filter(([e]) => e > n));
1560
- for (let [t, r] of [...e.own]) t <= n && (e.own.delete(t), le(e, r));
1559
+ e.confirmed = L(t.content), e.revision = n, e.remote = new Map([...e.remote].filter(([e]) => e > n));
1560
+ for (let [t, r] of [...e.own]) t <= n && (e.own.delete(t), ue(e, r));
1561
1561
  e === v && (m.value = n), ve(e), _e(e);
1562
1562
  }
1563
- function Ce(t) {
1563
+ function Y(t) {
1564
1564
  let n = () => t === v && !t.retired;
1565
1565
  return {
1566
1566
  onBatch: (e) => {
@@ -1574,13 +1574,13 @@ function wt(e) {
1574
1574
  actor: i
1575
1575
  });
1576
1576
  } catch (e) {
1577
- R(e);
1577
+ I(e);
1578
1578
  }
1579
1579
  J();
1580
1580
  }
1581
1581
  },
1582
1582
  onLock: (e) => {
1583
- n() && X(e);
1583
+ n() && Me(e);
1584
1584
  },
1585
1585
  onUnlock: (e, t, r) => {
1586
1586
  n() && Ne(e, t, r);
@@ -1595,17 +1595,17 @@ function wt(e) {
1595
1595
  }
1596
1596
  function we(e, r) {
1597
1597
  let i = d;
1598
- t.join(e.templateId, { sessionId: n }, Ce(e)).then((t) => {
1599
- e.retired || e !== v ? r || t.leave() : (e.leave = t.leave, Pe(t.locks, !r, i), Z(t.members), t.members.length > 0 && (p.value = "connected"), t.revision > e.revision && J(), r && Q());
1600
- }, (e) => R(e));
1598
+ t.join(e.templateId, { sessionId: n }, Y(e)).then((t) => {
1599
+ e.retired || e !== v ? r || t.leave() : (e.leave = t.leave, Pe(t.locks, !r, i), Z(t.members), t.members.length > 0 && (p.value = "connected"), t.revision > e.revision && J(), r && Fe());
1600
+ }, (e) => I(e));
1601
1601
  }
1602
1602
  function Te(e, t) {
1603
- let n = V(e.content), r = {
1603
+ let n = L(e.content), r = {
1604
1604
  templateId: e.id,
1605
1605
  confirmed: n,
1606
1606
  revision: e.revision ?? 0,
1607
1607
  pending: [],
1608
- view: V(n),
1608
+ view: L(n),
1609
1609
  remote: /* @__PURE__ */ new Map(),
1610
1610
  own: /* @__PURE__ */ new Map(),
1611
1611
  inFlight: null,
@@ -1618,7 +1618,7 @@ function wt(e) {
1618
1618
  redo: t?.redo ?? [],
1619
1619
  waiters: []
1620
1620
  };
1621
- v = r, m.value = r.revision, B(), we(r, !1), _?.state.selectedBlockId && Be(_.state.selectedBlockId), ie();
1621
+ v = r, m.value = r.revision, B(), we(r, !1), _?.state.selectedBlockId && Be(_.state.selectedBlockId), H();
1622
1622
  }
1623
1623
  function Ee(e) {
1624
1624
  e.retired = !0, xe(e), e.leave?.(), e.leave = null, me(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
@@ -1627,40 +1627,40 @@ function wt(e) {
1627
1627
  let n = p.value;
1628
1628
  p.value = t, t === "connected" && n !== null && n !== "connected" && we(e, !0);
1629
1629
  }
1630
- function Oe(e, t) {
1631
- v && v.templateId === e?.id || (v &&= (U(), Ee(v), null), a.value = [], s.value = /* @__PURE__ */ new Map(), p.value = null, M = null, Q(), B(), e && Te(e, t));
1630
+ function X(e, t) {
1631
+ v && v.templateId === e?.id || (v &&= (ae(), Ee(v), null), a.value = [], s.value = /* @__PURE__ */ new Map(), p.value = null, A = null, Fe(), B(), e && Te(e, t));
1632
1632
  }
1633
- function ke(e, t) {
1633
+ function Oe(e, t) {
1634
1634
  return `${e}\u0000${t ?? ""}`;
1635
1635
  }
1636
- function Ae(e, t, n) {
1636
+ function ke(e, t, n) {
1637
1637
  return e.blockId === t && (n == null || e.locale == null || e.locale === n);
1638
1638
  }
1639
- function je(e) {
1639
+ function Ae(e) {
1640
1640
  return [...s.value.values()].filter((t) => t.blockId === e);
1641
1641
  }
1642
- function Me(e) {
1643
- e !== f.value && (K(), f.value = e, Be(_?.state.selectedBlockId ?? null));
1642
+ function je(e) {
1643
+ e !== f.value && (W(), f.value = e, Be(_?.state.selectedBlockId ?? null));
1644
1644
  }
1645
- function X(e, t = !1) {
1645
+ function Me(e, t = !1) {
1646
1646
  if (e.holder.sessionId === n) return;
1647
1647
  t ? l.add(e) : u.set(e, ++d);
1648
1648
  let r = new Map([...s.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
1649
- r.set(ke(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), z({
1649
+ 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), R({
1650
1650
  type: "selectionRefused",
1651
1651
  blockId: e.blockId,
1652
1652
  holder: e.holder
1653
1653
  }));
1654
1654
  }
1655
1655
  function Ne(e, t, n) {
1656
- let r = ke(e, n), i = new Map([...s.value].filter(([n, i]) => i.holder.sessionId !== t || n !== r && !(i.blockId === e && l.has(i))));
1656
+ let r = Oe(e, n), i = new Map([...s.value].filter(([n, i]) => i.holder.sessionId !== t || n !== r && !(i.blockId === e && l.has(i))));
1657
1657
  i.size !== s.value.size && (s.value = i);
1658
1658
  }
1659
1659
  function Pe(e, t, r) {
1660
1660
  let i = new Map([...s.value].filter(([, e]) => !l.has(e) && (t || (u.get(e) ?? 0) > r))), a = [...i.values()];
1661
- for (let t of e) if (t.holder.sessionId !== n && !a.some((e) => e.holder.sessionId === t.holder.sessionId || Ae(e, t.blockId, t.locale))) {
1661
+ 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))) {
1662
1662
  for (let [e, n] of i) n.holder.sessionId === t.holder.sessionId && i.delete(e);
1663
- i.set(ke(t.blockId, t.locale), t);
1663
+ i.set(Oe(t.blockId, t.locale), t);
1664
1664
  }
1665
1665
  s.value = i;
1666
1666
  }
@@ -1670,75 +1670,75 @@ function wt(e) {
1670
1670
  let r = new Map([...s.value].filter(([, e]) => !n.has(e.holder.sessionId)));
1671
1671
  r.size !== s.value.size && (s.value = r);
1672
1672
  }
1673
- function Fe(e) {
1674
- te = te.then(e).catch(R);
1673
+ function Q(e) {
1674
+ M = M.then(e).catch(I);
1675
1675
  }
1676
- function Q() {
1677
- i && Fe(async () => {
1678
- if (N && (M === null || N.templateId !== M.templateId || N.locale !== M.locale)) {
1679
- let e = N;
1680
- N = null, ze(), await t.releaseLock(e.templateId, e.blockId, e.locale);
1676
+ function Fe() {
1677
+ i && Q(async () => {
1678
+ if (j && (A === null || j.templateId !== A.templateId || j.locale !== A.locale)) {
1679
+ let e = j;
1680
+ j = null, ze(), await t.releaseLock(e.templateId, e.blockId, e.locale);
1681
1681
  }
1682
- let e = M;
1683
- if (!(!e || N?.templateId === e.templateId && N.blockId === e.blockId && N.locale === e.locale)) try {
1682
+ let e = A;
1683
+ if (!(!e || j?.templateId === e.templateId && j.blockId === e.blockId && j.locale === e.locale)) try {
1684
1684
  let n = await t.acquireLock(e.templateId, e.blockId, e.locale);
1685
- N = e, Re(), Ie(n.blockId, n.locale ?? null);
1685
+ j = e, Re(), Ie(n.blockId, n.locale ?? null);
1686
1686
  } catch (n) {
1687
- if (N?.templateId === e.templateId) {
1688
- let e = N;
1689
- N = null, ze(), await t.releaseLock(e.templateId, e.blockId, e.locale).catch(() => {});
1687
+ if (j?.templateId === e.templateId) {
1688
+ let e = j;
1689
+ j = null, ze(), await t.releaseLock(e.templateId, e.blockId, e.locale).catch(() => {});
1690
1690
  }
1691
- if (M !== e) return;
1691
+ if (A !== e) return;
1692
1692
  Le(e.blockId, n);
1693
1693
  }
1694
1694
  });
1695
1695
  }
1696
1696
  function Ie(e, t) {
1697
- let n = new Map([...s.value].filter(([, n]) => !Ae(n, e, t)));
1697
+ let n = new Map([...s.value].filter(([, n]) => !ke(n, e, t)));
1698
1698
  n.size !== s.value.size && (s.value = n);
1699
1699
  }
1700
1700
  function Le(e, t) {
1701
- let n = vt(t);
1701
+ let n = yt(t);
1702
1702
  if (n === "lock_held" || n === "block_missing") {
1703
- M = null;
1704
- let n = yt(t);
1705
- n ? X({
1703
+ A = null;
1704
+ let n = bt(t);
1705
+ n ? Me({
1706
1706
  blockId: e,
1707
1707
  holder: n,
1708
1708
  expiresAt: ""
1709
1709
  }, !0) : _?.state.selectedBlockId === e && _.selectBlock(null);
1710
- } else R(t), setTimeout(() => {
1711
- M?.blockId === e && Q();
1712
- }, pt[0]);
1710
+ } else I(t), setTimeout(() => {
1711
+ A?.blockId === e && Fe();
1712
+ }, mt[0]);
1713
1713
  }
1714
1714
  function Re() {
1715
- F ||= setInterval(() => {
1716
- Fe(async () => {
1717
- let e = N;
1715
+ N ||= setInterval(() => {
1716
+ Q(async () => {
1717
+ let e = j;
1718
1718
  if (e) try {
1719
1719
  await t.renewLock(e.templateId, e.blockId, e.locale);
1720
1720
  } catch (e) {
1721
- if (vt(e) === "lock_lost") {
1722
- N = null, ze(), Q();
1721
+ if (yt(e) === "lock_lost") {
1722
+ j = null, ze(), Fe();
1723
1723
  return;
1724
1724
  }
1725
- R(e);
1725
+ I(e);
1726
1726
  }
1727
1727
  });
1728
- }, ft);
1728
+ }, pt);
1729
1729
  }
1730
1730
  function ze() {
1731
- F &&= (clearInterval(F), null);
1731
+ N &&= (clearInterval(N), null);
1732
1732
  }
1733
1733
  function Be(e) {
1734
- K(), v && (M = e ? {
1734
+ W(), v && (A = e ? {
1735
1735
  templateId: v.templateId,
1736
1736
  blockId: e,
1737
1737
  locale: f.value
1738
- } : null, Q());
1738
+ } : null, Fe());
1739
1739
  }
1740
1740
  function Ve() {
1741
- K(), N && i && (t.releaseLock(N.templateId, N.blockId, N.locale).catch(() => {}), N = null, ze()), v?.leave?.(), v && (v.leave = null);
1741
+ W(), j && i && (t.releaseLock(j.templateId, j.blockId, j.locale).catch(() => {}), j = null, ze()), v?.leave?.(), v && (v.leave = null);
1742
1742
  }
1743
1743
  function He() {
1744
1744
  v && (v.undo = [], v.redo = [], B());
@@ -1746,11 +1746,11 @@ function wt(e) {
1746
1746
  function Ue(e) {
1747
1747
  let t = v;
1748
1748
  if (!t || y) return;
1749
- K();
1749
+ W();
1750
1750
  let n = (e === "undo" ? t.undo : t.redo).pop();
1751
1751
  if (!n) return;
1752
- if (B(), n.view && !W(n.view, t.view)) {
1753
- z({
1752
+ if (B(), n.view && !q(n.view, t.view)) {
1753
+ R({
1754
1754
  type: "undoSkipped",
1755
1755
  code: "precondition_failed"
1756
1756
  });
@@ -1758,41 +1758,41 @@ function wt(e) {
1758
1758
  }
1759
1759
  let r;
1760
1760
  try {
1761
- r = j(t.view, n.ops, ne());
1761
+ r = F(t.view, n.ops, z());
1762
1762
  } catch (e) {
1763
- if (!(e instanceof D)) throw e;
1764
- z({
1763
+ if (!(e instanceof P)) throw e;
1764
+ R({
1765
1765
  type: "undoSkipped",
1766
1766
  code: e.code
1767
1767
  });
1768
1768
  return;
1769
1769
  }
1770
- let i = _t({ ops: P(t.view, n.ops) }, r);
1771
- re(e === "undo" ? t.redo : t.undo, i);
1770
+ let i = vt({ ops: ee(t.view, n.ops) }, r);
1771
+ ie(e === "undo" ? t.redo : t.undo, i);
1772
1772
  let a = t.view;
1773
- t.view = r, H(r), _?.markDirty(), oe(t, n.ops, e, i, a);
1773
+ t.view = r, V(r), _?.markDirty(), oe(t, n.ops, e, i, a);
1774
1774
  }
1775
1775
  function We(e, t) {
1776
1776
  let n = v;
1777
1777
  if (!_ || !n || y) return {
1778
1778
  applied: !1,
1779
- error: new D("invalid_operation", 0, "No template is open for editing.")
1779
+ error: new P("invalid_operation", 0, "No template is open for editing.")
1780
1780
  };
1781
1781
  if (t.origin === void 0) try {
1782
- j(_.content.value, e, ne());
1782
+ F(_.content.value, e, z());
1783
1783
  } catch (e) {
1784
- if (e instanceof D) return {
1784
+ if (e instanceof P) return {
1785
1785
  applied: !1,
1786
1786
  error: e
1787
1787
  };
1788
1788
  throw e;
1789
1789
  }
1790
- K();
1790
+ W();
1791
1791
  let r, i;
1792
1792
  try {
1793
- r = j(n.view, e, ne()), i = P(n.view, e);
1793
+ r = F(n.view, e, z()), i = ee(n.view, e);
1794
1794
  } catch (e) {
1795
- if (e instanceof D) return {
1795
+ if (e instanceof P) return {
1796
1796
  applied: !1,
1797
1797
  error: e
1798
1798
  };
@@ -1800,15 +1800,15 @@ function wt(e) {
1800
1800
  }
1801
1801
  let a = n.undo.at(-1), o;
1802
1802
  if (t.origin === "ai" && t.turn !== void 0 && a && a.turn === t.turn) {
1803
- let e = a.view !== void 0 && !W(a.view, n.view);
1804
- a.ops = [...i, ...a.ops], o = e ? a : _t(a, r);
1805
- } else o = _t({
1803
+ let e = a.view !== void 0 && !q(a.view, n.view);
1804
+ a.ops = [...i, ...a.ops], o = e ? a : vt(a, r);
1805
+ } else o = vt({
1806
1806
  ops: i,
1807
1807
  ...t.origin === "ai" && t.turn !== void 0 ? { turn: t.turn } : {}
1808
- }, r), re(n.undo, o);
1808
+ }, r), ie(n.undo, o);
1809
1809
  n.redo = [], B();
1810
1810
  let s = n.view;
1811
- return n.view = r, H(r), _.markDirty(), oe(n, e, t.origin ?? "edit", o, s), {
1811
+ return n.view = r, V(r), _.markDirty(), oe(n, e, t.origin ?? "edit", o, s), {
1812
1812
  applied: !0,
1813
1813
  inverse: i
1814
1814
  };
@@ -1819,40 +1819,40 @@ function wt(e) {
1819
1819
  if (n.moveBlock && n.findBlockLocation) {
1820
1820
  let t = n.moveBlock, r = (...r) => {
1821
1821
  let i = v, a = i && !y && !C && !e.state.isLoading && e.state.template?.id === i.templateId;
1822
- if (a && G(!0), t(...r), !a || W(i.view, e.content.value)) return;
1822
+ if (a && U(!0), t(...r), !a || q(i.view, e.content.value)) return;
1823
1823
  let o = n.findBlockLocation(r[0]);
1824
1824
  if (!o) return;
1825
1825
  let s = o.targetSectionId ? {
1826
1826
  sectionId: o.targetSectionId,
1827
1827
  column: o.columnIndex ?? 0
1828
1828
  } : null, c = s ? e.content.value.blocks.find((e) => e.id === s.sectionId) : void 0;
1829
- ae(i, [{
1829
+ G(i, [{
1830
1830
  op: "moveBlock",
1831
1831
  blockId: r[0],
1832
1832
  parent: s,
1833
1833
  after: (s && c?.type === "section" ? c.children[s.column] : e.content.value.blocks)[o.index - 1]?.id ?? null
1834
1834
  }]);
1835
1835
  };
1836
- n.moveBlock = r, A.push(() => {
1836
+ n.moveBlock = r, k.push(() => {
1837
1837
  n.moveBlock === r && (n.moveBlock = t);
1838
1838
  });
1839
1839
  }
1840
- A.push(h(() => e.state.template, (t) => {
1841
- e.loadVersion && e.contentReplaced && e.state.isLoading || Oe(t);
1842
- }, { immediate: !0 }), h(() => e.content.value, ie, { deep: !0 }), h(() => e.state.selectedBlockId, Be), h(() => e.state.isLoading, (e) => e ? G(!0, !0) : ie()));
1840
+ k.push(h(() => e.state.template, (t) => {
1841
+ e.loadVersion && e.contentReplaced && e.state.isLoading || X(t);
1842
+ }, { immediate: !0 }), h(() => e.content.value, H, { deep: !0 }), h(() => e.state.selectedBlockId, Be), h(() => e.state.isLoading, (e) => e ? U(!0, !0) : H()));
1843
1843
  let r = e.contentReplaced, i = e.loadVersion;
1844
- r && i && A.push(h(r, He), h(i, () => {
1844
+ r && i && k.push(h(r, He), h(i, () => {
1845
1845
  let n = r.value !== t;
1846
1846
  t = r.value;
1847
1847
  let i = e.state.template;
1848
- v?.templateId === i?.id ? n && v && i && Y(v, i) : Oe(i, !n && v && i ? {
1848
+ v?.templateId === i?.id ? n && v && i && Ce(v, i) : X(i, !n && v && i ? {
1849
1849
  undo: v.undo,
1850
1850
  redo: v.redo
1851
1851
  } : void 0);
1852
- })), typeof window < "u" && (window.addEventListener("pagehide", Ve), window.addEventListener("blur", K)), c() && o(Ye);
1852
+ })), typeof window < "u" && (window.addEventListener("pagehide", Ve), window.addEventListener("blur", W)), c() && o(Ye);
1853
1853
  }
1854
1854
  function Ke() {
1855
- K();
1855
+ W();
1856
1856
  let e = v;
1857
1857
  return !e || e.pending.length === 0 ? Promise.resolve() : new Promise((t, n) => e.waiters.push({
1858
1858
  resolve: t,
@@ -1860,45 +1860,45 @@ function wt(e) {
1860
1860
  }));
1861
1861
  }
1862
1862
  function qe() {
1863
- K(), y = !0;
1863
+ W(), y = !0;
1864
1864
  }
1865
1865
  function Je() {
1866
- y = !1, v && H(v.view);
1866
+ y = !1, v && V(v.view);
1867
1867
  }
1868
1868
  function Ye() {
1869
- if (!k) {
1870
- K();
1871
- for (let e of A.splice(0)) e();
1872
- U(), Ve(), k = !0, v && Ee(v), v = null, ze(), typeof window < "u" && (window.removeEventListener("pagehide", Ve), window.removeEventListener("blur", K));
1869
+ if (!O) {
1870
+ W();
1871
+ for (let e of k.splice(0)) e();
1872
+ ae(), Ve(), O = !0, v && Ee(v), v = null, ze(), typeof window < "u" && (window.removeEventListener("pagehide", Ve), window.removeEventListener("blur", W));
1873
1873
  }
1874
1874
  }
1875
1875
  return {
1876
1876
  sessionId: n,
1877
1877
  members: a,
1878
1878
  locks: s,
1879
- locksOf: je,
1879
+ locksOf: Ae,
1880
1880
  lockLocale: f,
1881
- setLockLocale: Me,
1881
+ setLockLocale: je,
1882
1882
  connection: p,
1883
1883
  revision: m,
1884
- canUndo: I,
1885
- canRedo: L,
1884
+ canUndo: ne,
1885
+ canRedo: re,
1886
1886
  attach: Ge,
1887
1887
  undo: () => Ue("undo"),
1888
1888
  redo: () => Ue("redo"),
1889
1889
  clearHistory: He,
1890
- flush: K,
1890
+ flush: W,
1891
1891
  settle: Ke,
1892
1892
  suspend: qe,
1893
1893
  resume: Je,
1894
1894
  catchUp: J,
1895
- hasConfirmedBlock: (e) => v ? xt(v.confirmed.blocks, e) : !1,
1895
+ hasConfirmedBlock: (e) => v ? St(v.confirmed.blocks, e) : !1,
1896
1896
  applyOperations: We,
1897
1897
  destroy: Ye
1898
1898
  };
1899
1899
  }
1900
1900
  // ../core/src/saved-blocks.ts
1901
- function Tt(e) {
1901
+ function Et(e) {
1902
1902
  let { provider: t } = e, n = S([]), r = S(!1), i = v(() => {
1903
1903
  let e = /* @__PURE__ */ new Set();
1904
1904
  for (let t of n.value) {
@@ -1914,10 +1914,10 @@ function Tt(e) {
1914
1914
  return s.value && e.canDelete !== !1;
1915
1915
  }
1916
1916
  function u(e, t) {
1917
- throw new q(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1917
+ throw new K(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1918
1918
  }
1919
1919
  function d(t) {
1920
- Q(e.onError, t);
1920
+ Ie(e.onError, t);
1921
1921
  }
1922
1922
  async function f(i) {
1923
1923
  r.value = !0;
@@ -1985,9 +1985,9 @@ function Tt(e) {
1985
1985
  };
1986
1986
  }
1987
1987
  // ../core/src/saved-blocks-local.ts
1988
- var Et = "templatical:saved-blocks";
1989
- function Dt(e = {}) {
1990
- let t = e.key ?? Et;
1988
+ var Dt = "templatical:saved-blocks";
1989
+ function Ot(e = {}) {
1990
+ let t = e.key ?? Dt;
1991
1991
  function n() {
1992
1992
  if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageSavedBlocksProvider requires a browser environment with localStorage. Supply your own SavedBlocksProvider for server-side or non-browser use.");
1993
1993
  return localStorage;
@@ -2012,7 +2012,7 @@ function Dt(e = {}) {
2012
2012
  },
2013
2013
  async create(e) {
2014
2014
  let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
2015
- id: A(),
2015
+ id: k(),
2016
2016
  name: e.name,
2017
2017
  content: e.content,
2018
2018
  ...e.category ? { category: e.category } : {},
@@ -2039,9 +2039,9 @@ function Dt(e = {}) {
2039
2039
  };
2040
2040
  }
2041
2041
  // ../core/src/media-local.ts
2042
- var Ot = "templatical:media", kt = 50;
2043
- function At(e = {}) {
2044
- let t = e.key ?? Ot;
2042
+ var kt = "templatical:media", At = 50;
2043
+ function jt(e = {}) {
2044
+ let t = e.key ?? kt;
2045
2045
  function n() {
2046
2046
  if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageMediaProvider requires a browser environment with localStorage. Supply your own MediaProvider for server-side or non-browser use.");
2047
2047
  return localStorage;
@@ -2074,12 +2074,12 @@ function At(e = {}) {
2074
2074
  let t = r(), n = e?.search?.trim().toLowerCase(), i = n ? t.filter((e) => {
2075
2075
  let t = e.filename?.toLowerCase() ?? "", r = e.alt?.toLowerCase() ?? "";
2076
2076
  return t.includes(n) || r.includes(n);
2077
- }) : t, a = e?.cursor ? Number.parseInt(e.cursor, 10) : 0, o = Number.isFinite(a) && a > 0 ? a : 0, s = i.slice(o, o + kt), c = { items: s }, l = o + s.length;
2077
+ }) : t, a = e?.cursor ? Number.parseInt(e.cursor, 10) : 0, o = Number.isFinite(a) && a > 0 ? a : 0, s = i.slice(o, o + At), c = { items: s }, l = o + s.length;
2078
2078
  return l < i.length && (c.nextCursor = String(l)), c;
2079
2079
  },
2080
2080
  async create(e) {
2081
2081
  let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
2082
- id: A(),
2082
+ id: k(),
2083
2083
  url: t,
2084
2084
  filename: e.filename || e.file.name,
2085
2085
  createdAt: n,
@@ -2115,18 +2115,18 @@ function At(e = {}) {
2115
2115
  };
2116
2116
  }
2117
2117
  // ../core/src/version-history.ts
2118
- function jt(e) {
2118
+ function Mt(e) {
2119
2119
  let { provider: t, getTemplateId: n } = e, r = S([]), i = S(!1), a = S(void 0), o = S(!1), s = /* @__PURE__ */ new Map(), c = v(() => typeof t.create == "function"), l = v(() => typeof t.restore == "function");
2120
2120
  function u(e) {
2121
2121
  let t = n();
2122
- if (!t) throw new q(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
2122
+ if (!t) throw new K(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
2123
2123
  return t;
2124
2124
  }
2125
2125
  function d(e) {
2126
- throw new q(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2126
+ throw new K(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2127
2127
  }
2128
2128
  function f(t) {
2129
- Q(e.onError, t);
2129
+ Ie(e.onError, t);
2130
2130
  }
2131
2131
  async function p(n) {
2132
2132
  let o = u("list");
@@ -2194,7 +2194,7 @@ function jt(e) {
2194
2194
  };
2195
2195
  }
2196
2196
  // ../core/src/comments.ts
2197
- function Mt(e) {
2197
+ function Nt(e) {
2198
2198
  let { provider: t, getTemplateId: n, getUser: r } = e, i = S([]), a = S(!1), o = S(!1), s = v(() => typeof t.create == "function"), c = v(() => typeof t.update == "function"), l = v(() => typeof t.delete == "function"), u = v(() => typeof t.setResolved == "function"), d = v(() => i.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), f = v(() => i.value.filter((e) => !e.resolvedAt).length), p = v(() => {
2199
2199
  let e = /* @__PURE__ */ new Map();
2200
2200
  for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
@@ -2202,16 +2202,16 @@ function Mt(e) {
2202
2202
  });
2203
2203
  function m(e) {
2204
2204
  let t = n();
2205
- if (!t) throw new q(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
2205
+ if (!t) throw new K(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
2206
2206
  return t;
2207
2207
  }
2208
2208
  function h(e) {
2209
2209
  let t = r();
2210
- if (!t) throw new q(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
2210
+ if (!t) throw new K(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
2211
2211
  return t;
2212
2212
  }
2213
2213
  function g(e) {
2214
- throw new q(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2214
+ throw new K(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
2215
2215
  }
2216
2216
  function _(e) {
2217
2217
  for (let t of i.value) {
@@ -2229,7 +2229,7 @@ function Mt(e) {
2229
2229
  throw e.onError?.(n), n;
2230
2230
  }
2231
2231
  function x(t) {
2232
- Q(e.onError, t);
2232
+ Ie(e.onError, t);
2233
2233
  }
2234
2234
  function C(e, t, n) {
2235
2235
  return [
@@ -2322,7 +2322,7 @@ function Mt(e) {
2322
2322
  o.value = !1;
2323
2323
  }
2324
2324
  }
2325
- async function j(e, n) {
2325
+ async function ee(e, n) {
2326
2326
  let { setResolved: r } = t;
2327
2327
  typeof r != "function" && g("setResolved");
2328
2328
  let i = m("setResolved");
@@ -2336,13 +2336,13 @@ function Mt(e) {
2336
2336
  o.value = !1;
2337
2337
  }
2338
2338
  }
2339
- function M(e) {
2339
+ function te(e) {
2340
2340
  T(e) && x(() => t.onCreated?.(e, { origin: "remote" }));
2341
2341
  }
2342
- function ee(e) {
2342
+ function j(e) {
2343
2343
  T(e) && x(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
2344
2344
  }
2345
- function N(e, n) {
2345
+ function M(e, n) {
2346
2346
  let r = E(e, n);
2347
2347
  r && x(() => t.onDeleted?.(r, { origin: "remote" }));
2348
2348
  }
@@ -2361,15 +2361,15 @@ function Mt(e) {
2361
2361
  create: O,
2362
2362
  update: k,
2363
2363
  remove: A,
2364
- setResolved: j,
2364
+ setResolved: ee,
2365
2365
  find: _,
2366
2366
  isOwn: y,
2367
- applyRemoteCreate: M,
2368
- applyRemoteUpdate: ee,
2369
- applyRemoteDelete: N
2367
+ applyRemoteCreate: te,
2368
+ applyRemoteUpdate: j,
2369
+ applyRemoteDelete: M
2370
2370
  };
2371
2371
  }
2372
- function Nt(e) {
2372
+ function Pt(e) {
2373
2373
  let { comments: t, provider: n, getTemplateId: i } = e, { subscribe: a } = n;
2374
2374
  if (typeof a != "function") return;
2375
2375
  let s = null;
@@ -2391,9 +2391,9 @@ function Nt(e) {
2391
2391
  }, { immediate: !0 }), o(c);
2392
2392
  }
2393
2393
  // src/constants/timeouts.ts
2394
- var Pt = 1e4;
2394
+ var Ft = 1e4;
2395
2395
  // src/composables/useImageUrlResolver.ts
2396
- function Ft(t) {
2396
+ function It(t) {
2397
2397
  let n = e(/* @__PURE__ */ new Map()), r = /* @__PURE__ */ new Set();
2398
2398
  function i(e) {
2399
2399
  return n.get(e);
@@ -2422,8 +2422,8 @@ function Ft(t) {
2422
2422
  lookup: o
2423
2423
  };
2424
2424
  }
2425
- function It(e) {
2426
- let t = a(_e, null), n = v(e);
2425
+ function Lt(e) {
2426
+ let t = a(ve, null), n = v(e);
2427
2427
  if (!t) return n;
2428
2428
  let i;
2429
2429
  function s() {
@@ -2444,37 +2444,37 @@ function It(e) {
2444
2444
  return typeof r == "string" && r.length > 0 ? r : e;
2445
2445
  });
2446
2446
  }
2447
- function Lt(e, t) {
2447
+ function Rt(e, t) {
2448
2448
  if (!e || !t) return t;
2449
2449
  let n = e.get(t);
2450
2450
  return typeof n == "string" && n.length > 0 ? n : t;
2451
2451
  }
2452
- function Rt(e, t) {
2453
- return typeof e?.url == "string" && z(e.url, t);
2454
- }
2455
2452
  function zt(e, t) {
2453
+ return typeof e?.url == "string" && N(e.url, t);
2454
+ }
2455
+ function Bt(e, t) {
2456
2456
  let n = e?.url;
2457
- if (typeof n == "string" && n.trim() !== "") return z(n, t) ? void 0 : n;
2457
+ if (typeof n == "string" && n.trim() !== "") return N(n, t) ? void 0 : n;
2458
2458
  }
2459
- function Bt(e) {
2460
- let t = a(ge, k.liquid), n = It(() => zt(e(), t));
2461
- return v(() => Rt(e(), t) ? null : n.value);
2459
+ function Vt(e) {
2460
+ let t = a(_e, O.liquid), n = Lt(() => Bt(e(), t));
2461
+ return v(() => zt(e(), t) ? null : n.value);
2462
2462
  }
2463
- function Vt(e, t, n) {
2464
- return Rt(t, n) ? null : Lt(e, zt(t, n));
2463
+ function Ht(e, t, n) {
2464
+ return zt(t, n) ? null : Rt(e, Bt(t, n));
2465
2465
  }
2466
2466
  // src/utils/blockTypeLabels.ts
2467
- function Ht(e, t) {
2467
+ function Ut(e, t) {
2468
2468
  return t.blocks[e] ?? e;
2469
2469
  }
2470
- function Ut(e, t, n = []) {
2471
- if (e.type !== "custom") return Ht(e.type, t);
2470
+ function Wt(e, t, n = []) {
2471
+ if (e.type !== "custom") return Ut(e.type, t);
2472
2472
  let { customType: r } = e;
2473
2473
  return n.find((e) => e.type === r)?.name ?? r;
2474
2474
  }
2475
2475
  // src/utils/resolveFieldColors.ts
2476
- function Wt(e, t) {
2477
- let n = J({ presets: e.presets }, Se), r = n.presets.length === 0;
2476
+ function Gt(e, t) {
2477
+ let n = Se({ presets: e.presets }, Ce), r = n.presets.length === 0;
2478
2478
  return {
2479
2479
  presets: r ? t.presets : n.presets,
2480
2480
  allowCustom: t.allowCustom === !1 ? !1 : e.allowCustom ?? t.allowCustom,
@@ -2485,19 +2485,19 @@ function Wt(e, t) {
2485
2485
  };
2486
2486
  }
2487
2487
  // src/utils/imageNaturalSize.ts
2488
- function Gt(e) {
2488
+ function Kt(e) {
2489
2489
  return typeof e == "number" && Number.isFinite(e) && e > 0;
2490
2490
  }
2491
- function Kt(e, t) {
2492
- return Gt(e) && Gt(t) ? {
2491
+ function qt(e, t) {
2492
+ return Kt(e) && Kt(t) ? {
2493
2493
  width: e,
2494
2494
  height: t
2495
2495
  } : null;
2496
2496
  }
2497
- function qt(e) {
2498
- return Kt(e.naturalWidth, e.naturalHeight);
2499
- }
2500
2497
  function Jt(e) {
2498
+ return qt(e.naturalWidth, e.naturalHeight);
2499
+ }
2500
+ function Yt(e) {
2501
2501
  return e ? {
2502
2502
  naturalWidth: e.width,
2503
2503
  naturalHeight: e.height
@@ -2506,35 +2506,35 @@ function Jt(e) {
2506
2506
  naturalHeight: void 0
2507
2507
  };
2508
2508
  }
2509
- function Yt(e, t) {
2509
+ function Xt(e, t) {
2510
2510
  if (typeof Image > "u") return t(null), () => {};
2511
2511
  let n = new Image(), r = () => {
2512
2512
  n.onload = null, n.onerror = null;
2513
2513
  };
2514
2514
  return n.onload = () => {
2515
- r(), t(Kt(n.naturalWidth, n.naturalHeight));
2515
+ r(), t(qt(n.naturalWidth, n.naturalHeight));
2516
2516
  }, n.onerror = () => {
2517
2517
  r(), t(null);
2518
2518
  }, n.src = e, r;
2519
2519
  }
2520
- function Xt(e) {
2520
+ function Zt(e) {
2521
2521
  return new Promise((t) => {
2522
2522
  let n = setTimeout(() => {
2523
2523
  r(), t(null);
2524
- }, Pt), r = Yt(e, (e) => {
2524
+ }, Ft), r = Xt(e, (e) => {
2525
2525
  clearTimeout(n), t(e);
2526
2526
  });
2527
2527
  });
2528
2528
  }
2529
2529
  // src/components/MediaDropOverlay.vue
2530
- var Zt = /* @__PURE__ */ t({
2530
+ var Qt = /* @__PURE__ */ t({
2531
2531
  __name: "MediaDropOverlay",
2532
2532
  props: {
2533
2533
  uploading: { type: Boolean },
2534
2534
  size: { default: "field" }
2535
2535
  },
2536
2536
  setup(e) {
2537
- let t = e, { t: r } = be(), i = {
2537
+ let t = e, { t: r } = xe(), i = {
2538
2538
  field: {
2539
2539
  gap: "tpl:gap-1.5",
2540
2540
  icon: 18,
@@ -2549,39 +2549,39 @@ var Zt = /* @__PURE__ */ t({
2549
2549
  return (t, i) => (n(), l("div", {
2550
2550
  class: p(["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)]", a.value.gap]),
2551
2551
  style: y({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${a.value.veil}, transparent)` })
2552
- }, [e.uploading ? (n(), l(C, { key: 0 }, [w(f(me), {
2552
+ }, [e.uploading ? (n(), l(C, { key: 0 }, [w(f(he), {
2553
2553
  class: "tpl-spinner",
2554
2554
  size: a.value.icon,
2555
2555
  "stroke-width": 2
2556
- }, null, 8, ["size"]), d(" " + g(f(r).image.uploading), 1)], 64)) : (n(), l(C, { key: 1 }, [w(f(he), {
2556
+ }, null, 8, ["size"]), d(" " + g(f(r).image.uploading), 1)], 64)) : (n(), l(C, { key: 1 }, [w(f(ge), {
2557
2557
  size: a.value.icon,
2558
2558
  "stroke-width": 1.5
2559
2559
  }, null, 8, ["size"]), d(" " + g(f(r).image.dropToUpload), 1)], 64))], 6));
2560
2560
  }
2561
2561
  });
2562
2562
  // src/composables/useAliveFlag.ts
2563
- function Qt() {
2563
+ function $t() {
2564
2564
  let e = { alive: !0 };
2565
2565
  return i(() => {
2566
2566
  e.alive = !1;
2567
2567
  }), e;
2568
2568
  }
2569
2569
  // src/composables/useImageDrop.ts
2570
- var $t = "image/";
2571
- function en(e) {
2572
- let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || _(r), { isOverDropZone: a } = xe(t, {
2570
+ var en = "image/";
2571
+ function tn(e) {
2572
+ let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || _(r), { isOverDropZone: a } = J(t, {
2573
2573
  preventDefaultForUnhandled: !0,
2574
2574
  onDrop: (e) => {
2575
2575
  if (!i()) return;
2576
- let t = (e ?? []).filter((e) => e.type.startsWith($t));
2576
+ let t = (e ?? []).filter((e) => e.type.startsWith(en));
2577
2577
  t.length > 0 && n([t[0]]);
2578
2578
  }
2579
2579
  });
2580
2580
  return { isOver: v(() => i() && a.value) };
2581
2581
  }
2582
2582
  // src/composables/useMediaDropField.ts
2583
- function tn(e) {
2584
- let { target: t, blocked: n, apply: r } = e, i = a(ve, null), o = a(ye, null), s = Qt();
2583
+ function nn(e) {
2584
+ let { target: t, blocked: n, apply: r } = e, i = a(ye, null), o = a(be, null), s = $t();
2585
2585
  async function c() {
2586
2586
  let e = await i?.({ accept: ["images"] });
2587
2587
  s.alive && e && r(e);
@@ -2602,7 +2602,7 @@ function tn(e) {
2602
2602
  }
2603
2603
  }
2604
2604
  }
2605
- let { isOver: f } = en({
2605
+ let { isOver: f } = tn({
2606
2606
  target: t,
2607
2607
  enabled: u,
2608
2608
  onFiles: d
@@ -2615,35 +2615,13 @@ function tn(e) {
2615
2615
  openMediaBrowser: c
2616
2616
  };
2617
2617
  }
2618
- function nn(e, t = "desktop") {
2618
+ function rn(e, t = "desktop") {
2619
2619
  return t === "mobile" ? 375 : e?.width ?? 600;
2620
2620
  }
2621
- var rn = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", an = {
2622
- 1: [100],
2623
- 2: [50, 50],
2624
- 3: [
2625
- 33.33,
2626
- 33.33,
2627
- 33.34
2628
- ],
2629
- 4: [
2630
- 25,
2631
- 25,
2632
- 25,
2633
- 25
2634
- ],
2635
- "1-2": [33.33, 66.67],
2636
- "2-1": [66.67, 33.33],
2637
- "1-3": [25, 75],
2638
- "3-1": [75, 25],
2639
- "1-2-1": [
2640
- 25,
2641
- 50,
2642
- 25
2643
- ]
2644
- };
2621
+ var an = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)";
2622
+ // src/utils/imageRoom.ts
2645
2623
  function on(e, t) {
2646
- let n = (e) => Math.trunc(e ?? 0), r = (e) => de(e) === null ? 0 : Math.trunc(e.width);
2624
+ let n = (e) => Math.trunc(e ?? 0), r = (e) => E(e) === null ? 0 : Math.trunc(e.width);
2647
2625
  return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
2648
2626
  }
2649
2627
  function sn(e, t) {
@@ -2654,23 +2632,23 @@ function cn(e, t) {
2654
2632
  return Math.floor(t) - on(e.styles.padding, n);
2655
2633
  }
2656
2634
  function* ln(e, t) {
2657
- for (let n of e) N(n) ? yield* ln(n.children, sn(t, n.styles.padding)) : yield {
2635
+ for (let n of e) A(n) ? yield* ln(n.children, sn(t, n.styles.padding)) : yield {
2658
2636
  block: n,
2659
- bandWidth: I(n) && n.wrapper ? sn(t, n.wrapper.padding) : t
2637
+ bandWidth: j(n) && n.wrapper ? sn(t, n.wrapper.padding) : t
2660
2638
  };
2661
2639
  }
2662
- function un(e, t, n = L(e)) {
2640
+ function un(e, t, n = U(e)) {
2663
2641
  if (!t) return e;
2664
2642
  try {
2665
- return oe(H(t, n, { missing: "default" }), e);
2643
+ return ce(ae(t, n, { missing: "default" }), e);
2666
2644
  } catch {
2667
2645
  return e;
2668
2646
  }
2669
2647
  }
2670
2648
  function dn(e, t, n, r) {
2671
2649
  let i = un(e, n, r);
2672
- for (let { block: e, bandWidth: n } of ln(i.blocks, i.settings.width)) if (I(e)) {
2673
- let r = ie(e)?.applied ? void 0 : e.border, i = Math.floor(n) - on(e.styles.padding, r), a = an[e.columns] ?? [100];
2650
+ for (let { block: e, bandWidth: n } of ln(i.blocks, i.settings.width)) if (j(e)) {
2651
+ let r = M(e)?.applied ? void 0 : e.border, i = Math.floor(n) - on(e.styles.padding, r), a = ne(e);
2674
2652
  for (let n = 0; n < e.children.length; n++) {
2675
2653
  let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
2676
2654
  if (o) return cn(o, r);
@@ -2684,14 +2662,14 @@ function fn(e, t, n, r) {
2684
2662
  return null;
2685
2663
  }
2686
2664
  function pn(e) {
2687
- let t = I(e) ? ie(e) : null;
2665
+ let t = j(e) ? M(e) : null;
2688
2666
  return !!t?.applied && t.height === "image";
2689
2667
  }
2690
2668
  function mn(e, t, n, r) {
2691
- if (pn(e)) return (t ? fn(t, e.id, n, r) : null) ?? nn(t?.settings);
2669
+ if (pn(e)) return (t ? fn(t, e.id, n, r) : null) ?? rn(t?.settings);
2692
2670
  }
2693
2671
  // src/constants/socialIcons.ts
2694
- var hn = ae, gn = {
2672
+ var hn = D, gn = {
2695
2673
  small: 24,
2696
2674
  medium: 32,
2697
2675
  large: 48
@@ -2715,6 +2693,6 @@ var hn = ae, gn = {
2715
2693
  "dribbble",
2716
2694
  "behance"
2717
2695
  ];
2718
- export { Dt as A, Be as B, Vt as C, Mt as D, Nt as E, Ge as F, We as I, He as L, wt as M, ut as N, jt as O, Ke as P, Ue as R, zt as S, It as T, Ie as V, Kt as _, pn as a, Ht as b, rn as c, Qt as d, Zt as f, qt as g, Jt as h, dn as i, Tt as j, At as k, nn as l, Xt as m, hn as n, mn as o, Yt as p, _n as r, fn as s, gn as t, tn as u, Wt as v, Bt as w, Ft as x, Ut as y, Ve as z };
2696
+ export { Ot as A, Ve as B, Ht as C, Nt as D, Pt as E, Ke as F, Ge as I, Ue as L, Tt as M, dt as N, Mt as O, qe as P, We as R, Bt as S, Lt as T, Le as V, qt as _, pn as a, Ut as b, an as c, $t as d, Qt as f, Jt as g, Yt as h, dn as i, Et as j, jt as k, rn as l, Zt as m, hn as n, mn as o, Xt as p, _n as r, fn as s, gn as t, nn as u, Gt as v, Vt as w, It as x, Wt as y, He as z };
2719
2697
 
2720
- //# sourceMappingURL=socialIcons-kYhdXJ9P.js.map
2698
+ //# sourceMappingURL=socialIcons-WD1cjZDr.js.map