@templatical/editor 0.51.1 → 0.52.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 (380) hide show
  1. package/THIRD_PARTY_NOTICES.md +208 -0
  2. package/dist/{AiAltTextPopover-BZQ95GXL.js → AiAltTextPopover-DawbUywc.js} +16 -17
  3. package/dist/{AiAltTextReview-DoBEudnE.js → AiAltTextReview-9ySsXOTU.js} +25 -26
  4. package/dist/{AiChatPanel-Bs6sES3b.js → AiChatPanel-CupPhmsN.js} +141 -143
  5. package/dist/{AiPanels-CfN7A-ZA.js → AiPanels-DqT4PgQ0.js} +6 -8
  6. package/dist/{AiRewriteMenu-C3ZfDDYy.js → AiRewriteMenu-28agTycW.js} +66 -67
  7. package/dist/BlockIssueBadge-BxpDy3u-.js +33 -0
  8. package/dist/{BlockPreviewCanvas-BXNLLLYi.js → BlockPreviewCanvas-B-4bmJ3t.js} +26 -27
  9. package/dist/{CloudHeaderExtras-CsJMEiyN.js → CloudHeaderExtras-QI82yF54.js} +4 -5
  10. package/dist/{CloudPanels-B4F5m7vy.js → CloudPanels-BKJaLkUN.js} +52 -53
  11. package/dist/{CollaborationNotices-CNuDp7Y2.js → CollaborationNotices-CTw4JThq.js} +12 -13
  12. package/dist/{CollaboratorBar-BtHPiuHq.js → CollaboratorBar-CXQqN3VP.js} +16 -17
  13. package/dist/{CommentsPanel-CyCM-BvT.js → CommentsPanel-DwwFuh1h.js} +3 -5
  14. package/dist/CommentsSidebar-9ZfiC2DO.js +500 -0
  15. package/dist/{CountdownBlock-DR4Xm2-T.js → CountdownBlock-CU2yTWtF.js} +21 -22
  16. package/dist/{CountdownToolbar-CEIMPojJ.js → CountdownToolbar-BqoYzf_6.js} +55 -56
  17. package/dist/IssuesPanel-4ykrf1ax.js +359 -0
  18. package/dist/{LoadingTrack-B0RKQWq3.js → LoadingTrack-DM4g6j7b.js} +3 -4
  19. package/dist/{LogicTagInsertButton-CqfU52CO.js → LogicTagInsertButton-CfscnwCn.js} +243 -250
  20. package/dist/{MediaEditModal-DHtkZ4OU.js → MediaEditModal-Dy08GEwE.js} +449 -452
  21. package/dist/{MediaPanels-CGcOB2pR.js → MediaPanels-BgEp7iCp.js} +3 -5
  22. package/dist/{MergeTagInput-YnEkorTZ.js → MergeTagInput-B9dtUthD.js} +14 -15
  23. package/dist/{MergeTagModeToggle-Dhb1DAcQ.js → MergeTagModeToggle-DxujhYJ4.js} +30 -31
  24. package/dist/{MergeTagTextarea-e4lnwtqZ.js → MergeTagTextarea-CPFEjJZd.js} +12 -13
  25. package/dist/{ParagraphEditor-B6NK0ytw.js → ParagraphEditor-CWXfurGh.js} +233 -236
  26. package/dist/{RestoreVersionDialog-Bq_IGOLJ.js → RestoreVersionDialog-C4s_JYCx.js} +16 -17
  27. package/dist/{RichTextEditorContent-AOM6fylS.js → RichTextEditorContent-o6HmE8GR.js} +40 -40
  28. package/dist/{SaveBlockDialog-C8GngfQx.js → SaveBlockDialog-CWLrly6l.js} +58 -59
  29. package/dist/SavedBlocksBrowserModal-CE8n4EBS.js +359 -0
  30. package/dist/{SavedBlocksPanels-C2s3q0pJ.js → SavedBlocksPanels-BE1N9rNZ.js} +7 -9
  31. package/dist/{SavedBlocksPickBar-BjcTiV87.js → SavedBlocksPickBar-Dwl94xhP.js} +14 -15
  32. package/dist/{TemplateSettings-BVBWpiDU.js → TemplateSettings-CS0f1Ues.js} +75 -76
  33. package/dist/{TestEmailModal-SyhO9bn3.js → TestEmailModal-DBD0X5nV.js} +54 -56
  34. package/dist/{TestEmailPanel-BDd2Rtav.js → TestEmailPanel-DaFjP9QK.js} +3 -5
  35. package/dist/{TitleEditor-pxD53y_l.js → TitleEditor-DSqtle77.js} +78 -79
  36. package/dist/{ToggleSwitch-D51U9cmR.js → ToggleSwitch-JykPyD_8.js} +5 -6
  37. package/dist/{Toolbar-CZSPZYbj.js → Toolbar-BZPFfKrf.js} +977 -985
  38. package/dist/{TplModal-DCzBzicE.js → TplModal-DLMssVlt.js} +16 -17
  39. package/dist/{VersionHistoryMenu-BQeWPT85.js → VersionHistoryMenu-BkbYUs0Q.js} +37 -38
  40. package/dist/{VersionHistoryPanels-BBm7YbRQ.js → VersionHistoryPanels-DP7HaYWv.js} +5 -7
  41. package/dist/{VersionPreviewBanner-DUGF0tUJ.js → VersionPreviewBanner-DECaBwLq.js} +11 -12
  42. package/dist/WrapperBlock-BsJv_Fiw.js +44 -0
  43. package/dist/{_plugin-vue_export-helper-B3ysoDQm.js → _plugin-vue_export-helper-Djzt4Yr7.js} +1 -2
  44. package/dist/{aiErrors-D5UOoYOt.js → aiErrors-C3QEMB0x.js} +3 -5
  45. package/dist/{aiImageContext-BH4Ss1h3.js → aiImageContext-BQ5mQ6B5.js} +2 -3
  46. package/dist/{aiRewritePreview-DLGM05Ge.js → aiRewritePreview-DlMyx6Si.js} +1 -2
  47. package/dist/{blockTypeIcons-NzaYvAI4.js → blockTypeIcons-BHjlPnPf.js} +23 -23
  48. package/dist/bundle-stats.json +6 -6
  49. package/dist/{ca-C7mTzW1r.js → ca-CD-Kt1qz.js} +1 -2
  50. package/dist/{ca-CYQH3J0b.js → ca-Cc6eL0ZS.js} +1 -2
  51. package/dist/cdn/chunks/{AiAltTextPopover-CQu0Q_ZX.js → AiAltTextPopover-SEEjkd-I.js} +24 -25
  52. package/dist/cdn/chunks/{AiAltTextPopover-CQu0Q_ZX.js.map → AiAltTextPopover-SEEjkd-I.js.map} +1 -1
  53. package/dist/cdn/chunks/{AiAltTextReview-CI2HbWfn.js → AiAltTextReview-BGLLSKLm.js} +43 -44
  54. package/dist/cdn/chunks/{AiAltTextReview-CI2HbWfn.js.map → AiAltTextReview-BGLLSKLm.js.map} +1 -1
  55. package/dist/cdn/chunks/{AiChatPanel-BYqn1bKu.js → AiChatPanel-DKDAaBNi.js} +129 -131
  56. package/dist/cdn/chunks/{AiChatPanel-BYqn1bKu.js.map → AiChatPanel-DKDAaBNi.js.map} +1 -1
  57. package/dist/cdn/chunks/{AiPanels-CIFKQv8Y.js → AiPanels-0wBarZSH.js} +5 -7
  58. package/dist/cdn/chunks/{AiPanels-CIFKQv8Y.js.map → AiPanels-0wBarZSH.js.map} +1 -1
  59. package/dist/cdn/chunks/{AiRewriteMenu-Bhh71zcc.js → AiRewriteMenu-qf-cfEpy.js} +52 -53
  60. package/dist/cdn/chunks/AiRewriteMenu-qf-cfEpy.js.map +1 -0
  61. package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js +34 -0
  62. package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js.map +1 -0
  63. package/dist/cdn/chunks/{BlockPreviewCanvas-D0--EQkP.js → BlockPreviewCanvas-DGBh6mqe.js} +22 -23
  64. package/dist/cdn/chunks/{BlockPreviewCanvas-D0--EQkP.js.map → BlockPreviewCanvas-DGBh6mqe.js.map} +1 -1
  65. package/dist/cdn/chunks/{CloudHeaderExtras-DaUU8P8R.js → CloudHeaderExtras-BMNK_F9p.js} +4 -5
  66. package/dist/cdn/chunks/{CloudHeaderExtras-DaUU8P8R.js.map → CloudHeaderExtras-BMNK_F9p.js.map} +1 -1
  67. package/dist/cdn/chunks/{CloudPanels-C3jsxo_f.js → CloudPanels-JMWIoVWh.js} +34 -35
  68. package/dist/cdn/chunks/{CloudPanels-C3jsxo_f.js.map → CloudPanels-JMWIoVWh.js.map} +1 -1
  69. package/dist/cdn/chunks/{CollaborationNotices-DjRI8gvs.js → CollaborationNotices-Bsf1rGW9.js} +13 -14
  70. package/dist/cdn/chunks/{CollaborationNotices-DjRI8gvs.js.map → CollaborationNotices-Bsf1rGW9.js.map} +1 -1
  71. package/dist/cdn/chunks/{CollaboratorBar-Dfzm6A9A.js → CollaboratorBar-CXByAoUz.js} +16 -17
  72. package/dist/cdn/chunks/{CollaboratorBar-Dfzm6A9A.js.map → CollaboratorBar-CXByAoUz.js.map} +1 -1
  73. package/dist/cdn/chunks/{CommentsPanel-CSO79OeX.js → CommentsPanel-DoJnKLXI.js} +4 -6
  74. package/dist/cdn/chunks/{CommentsPanel-CSO79OeX.js.map → CommentsPanel-DoJnKLXI.js.map} +1 -1
  75. package/dist/cdn/chunks/{CommentsSidebar-CCvplq1Z.js → CommentsSidebar-CUtgvdBC.js} +110 -110
  76. package/dist/cdn/chunks/CommentsSidebar-CUtgvdBC.js.map +1 -0
  77. package/dist/cdn/chunks/{CountdownBlock-C6USdwk3.js → CountdownBlock-BqRw147R.js} +19 -20
  78. package/dist/cdn/chunks/{CountdownBlock-C6USdwk3.js.map → CountdownBlock-BqRw147R.js.map} +1 -1
  79. package/dist/cdn/chunks/{CountdownToolbar-Cjud2Tos.js → CountdownToolbar-xobieKoU.js} +28 -29
  80. package/dist/cdn/chunks/{CountdownToolbar-Cjud2Tos.js.map → CountdownToolbar-xobieKoU.js.map} +1 -1
  81. package/dist/cdn/chunks/{IssuesPanel-BaWHPDxZ.js → IssuesPanel-C7LfxaAY.js} +76 -77
  82. package/dist/cdn/chunks/{IssuesPanel-BaWHPDxZ.js.map → IssuesPanel-C7LfxaAY.js.map} +1 -1
  83. package/dist/cdn/chunks/LoadingTrack-CZuLTazv.js +11 -0
  84. package/dist/cdn/chunks/{LoadingTrack-BIcL4NiY.js.map → LoadingTrack-CZuLTazv.js.map} +1 -1
  85. package/dist/cdn/chunks/{LogicTagInsertButton-CsL2JDOG.js → LogicTagInsertButton-BIi05UQu.js} +258 -265
  86. package/dist/cdn/chunks/{LogicTagInsertButton-CsL2JDOG.js.map → LogicTagInsertButton-BIi05UQu.js.map} +1 -1
  87. package/dist/cdn/chunks/{MediaEditModal-BuHCiyMu.js → MediaEditModal-Cpcod6_U.js} +152 -155
  88. package/dist/cdn/chunks/{MediaEditModal-BuHCiyMu.js.map → MediaEditModal-Cpcod6_U.js.map} +1 -1
  89. package/dist/cdn/chunks/{MediaPanels-DAgUf_T1.js → MediaPanels-BIdcW_1f.js} +4 -6
  90. package/dist/cdn/chunks/{MediaPanels-DAgUf_T1.js.map → MediaPanels-BIdcW_1f.js.map} +1 -1
  91. package/dist/cdn/chunks/{MergeTagInput-C8U-7LxL.js → MergeTagInput-BvWg8o5E.js} +35 -36
  92. package/dist/cdn/chunks/{MergeTagInput-C8U-7LxL.js.map → MergeTagInput-BvWg8o5E.js.map} +1 -1
  93. package/dist/cdn/chunks/{MergeTagModeToggle-Mm-p0A52.js → MergeTagModeToggle-BgKEVUtV.js} +28 -29
  94. package/dist/cdn/chunks/{MergeTagModeToggle-Mm-p0A52.js.map → MergeTagModeToggle-BgKEVUtV.js.map} +1 -1
  95. package/dist/cdn/chunks/{MergeTagTextarea-DuLScsWM.js → MergeTagTextarea-tBz8McZf.js} +33 -34
  96. package/dist/cdn/chunks/{MergeTagTextarea-DuLScsWM.js.map → MergeTagTextarea-tBz8McZf.js.map} +1 -1
  97. package/dist/cdn/chunks/{ParagraphEditor-CqSj6Ayz.js → ParagraphEditor-B3Rj_cWF.js} +197 -200
  98. package/dist/cdn/chunks/ParagraphEditor-B3Rj_cWF.js.map +1 -0
  99. package/dist/cdn/chunks/{RestoreVersionDialog-CdA5osuA.js → RestoreVersionDialog-CjOdD2xj.js} +21 -22
  100. package/dist/cdn/chunks/{RestoreVersionDialog-CdA5osuA.js.map → RestoreVersionDialog-CjOdD2xj.js.map} +1 -1
  101. package/dist/cdn/chunks/{RichTextEditorContent-Q1d2xqBT.js → RichTextEditorContent-DNjR_sNN.js} +30 -31
  102. package/dist/cdn/chunks/{RichTextEditorContent-Q1d2xqBT.js.map → RichTextEditorContent-DNjR_sNN.js.map} +1 -1
  103. package/dist/cdn/chunks/{SaveBlockDialog-CijargAy.js → SaveBlockDialog-CUhpawq0.js} +77 -78
  104. package/dist/cdn/chunks/{SaveBlockDialog-CijargAy.js.map → SaveBlockDialog-CUhpawq0.js.map} +1 -1
  105. package/dist/cdn/chunks/SavedBlocksBrowserModal-BPYcRoGa.js +356 -0
  106. package/dist/cdn/chunks/{SavedBlocksBrowserModal-DtOz_X5S.js.map → SavedBlocksBrowserModal-BPYcRoGa.js.map} +1 -1
  107. package/dist/cdn/chunks/{SavedBlocksPanels-BowyED5h.js → SavedBlocksPanels-C6--Bc81.js} +4 -6
  108. package/dist/cdn/chunks/{SavedBlocksPanels-BowyED5h.js.map → SavedBlocksPanels-C6--Bc81.js.map} +1 -1
  109. package/dist/cdn/chunks/{SavedBlocksPickBar-BPRaJBv3.js → SavedBlocksPickBar-DUavxpbU.js} +16 -17
  110. package/dist/cdn/chunks/{SavedBlocksPickBar-BPRaJBv3.js.map → SavedBlocksPickBar-DUavxpbU.js.map} +1 -1
  111. package/dist/cdn/chunks/{TemplateSettings-ByZeBO34.js → TemplateSettings-CKtI-dof.js} +72 -73
  112. package/dist/cdn/chunks/{TemplateSettings-ByZeBO34.js.map → TemplateSettings-CKtI-dof.js.map} +1 -1
  113. package/dist/cdn/chunks/{TestEmailModal-BUVTj3Ic.js → TestEmailModal-CDQTgESD.js} +68 -70
  114. package/dist/cdn/chunks/{TestEmailModal-BUVTj3Ic.js.map → TestEmailModal-CDQTgESD.js.map} +1 -1
  115. package/dist/cdn/chunks/{TestEmailPanel-BxutYoWg.js → TestEmailPanel-CcUpEpAn.js} +4 -6
  116. package/dist/cdn/chunks/{TestEmailPanel-BxutYoWg.js.map → TestEmailPanel-CcUpEpAn.js.map} +1 -1
  117. package/dist/cdn/chunks/{TitleEditor-Ccv6uoTz.js → TitleEditor-Cob7RLyK.js} +71 -72
  118. package/dist/cdn/chunks/TitleEditor-Cob7RLyK.js.map +1 -0
  119. package/dist/cdn/chunks/{ToggleSwitch-Ctdmj621.js → ToggleSwitch-J7Vwhvha.js} +6 -7
  120. package/dist/cdn/chunks/{ToggleSwitch-Ctdmj621.js.map → ToggleSwitch-J7Vwhvha.js.map} +1 -1
  121. package/dist/cdn/chunks/{Toolbar-DoprRgTn.js → Toolbar-CdpsvNOR.js} +977 -985
  122. package/dist/cdn/chunks/{Toolbar-DoprRgTn.js.map → Toolbar-CdpsvNOR.js.map} +1 -1
  123. package/dist/cdn/chunks/TplModal-CFPDgbwQ.js +51 -0
  124. package/dist/cdn/chunks/{TplModal-BXQzmsJX.js.map → TplModal-CFPDgbwQ.js.map} +1 -1
  125. package/dist/cdn/chunks/{VersionHistoryMenu-BF2fNCvq.js → VersionHistoryMenu-BYlLRvRJ.js} +34 -35
  126. package/dist/cdn/chunks/{VersionHistoryMenu-BF2fNCvq.js.map → VersionHistoryMenu-BYlLRvRJ.js.map} +1 -1
  127. package/dist/cdn/chunks/{VersionHistoryPanels-Dal0Uk69.js → VersionHistoryPanels-C6SOVoiT.js} +4 -6
  128. package/dist/cdn/chunks/{VersionHistoryPanels-Dal0Uk69.js.map → VersionHistoryPanels-C6SOVoiT.js.map} +1 -1
  129. package/dist/cdn/chunks/{VersionPreviewBanner-BaGcn-b1.js → VersionPreviewBanner-Dvg0ZfAW.js} +12 -13
  130. package/dist/cdn/chunks/{VersionPreviewBanner-BaGcn-b1.js.map → VersionPreviewBanner-Dvg0ZfAW.js.map} +1 -1
  131. package/dist/cdn/chunks/{WrapperBlock-DkQJtLz0.js → WrapperBlock-C7Md56IT.js} +14 -15
  132. package/dist/cdn/chunks/{WrapperBlock-DkQJtLz0.js.map → WrapperBlock-C7Md56IT.js.map} +1 -1
  133. package/dist/cdn/chunks/{_plugin-vue_export-helper-B3ysoDQm.js → _plugin-vue_export-helper-Djzt4Yr7.js} +1 -2
  134. package/dist/cdn/chunks/{aiErrors-D5UOoYOt.js → aiErrors-C3QEMB0x.js} +4 -6
  135. package/dist/cdn/chunks/{aiErrors-D5UOoYOt.js.map → aiErrors-C3QEMB0x.js.map} +1 -1
  136. package/dist/cdn/chunks/{aiImageContext-BH4Ss1h3.js → aiImageContext-BQ5mQ6B5.js} +3 -4
  137. package/dist/cdn/chunks/{aiImageContext-BH4Ss1h3.js.map → aiImageContext-BQ5mQ6B5.js.map} +1 -1
  138. package/dist/cdn/chunks/{aiRewritePreview-DLGM05Ge.js → aiRewritePreview-DlMyx6Si.js} +2 -3
  139. package/dist/cdn/chunks/{aiRewritePreview-DLGM05Ge.js.map → aiRewritePreview-DlMyx6Si.js.map} +1 -1
  140. package/dist/cdn/chunks/blockTypeIcons-D7FW7Ypo.js +21 -0
  141. package/dist/cdn/chunks/blockTypeIcons-D7FW7Ypo.js.map +1 -0
  142. package/dist/cdn/chunks/{ca-C7mTzW1r.js → ca-CD-Kt1qz.js} +2 -3
  143. package/dist/cdn/chunks/{ca-C7mTzW1r.js.map → ca-CD-Kt1qz.js.map} +1 -1
  144. package/dist/cdn/chunks/{ca-CYQH3J0b.js → ca-Cc6eL0ZS.js} +2 -3
  145. package/dist/cdn/chunks/{ca-CYQH3J0b.js.map → ca-Cc6eL0ZS.js.map} +1 -1
  146. package/dist/cdn/chunks/{createCloudRuntime-DpBWhrv3.js → createCloudRuntime-Cth2JCEh.js} +58 -77
  147. package/dist/cdn/chunks/{createCloudRuntime-DpBWhrv3.js.map → createCloudRuntime-Cth2JCEh.js.map} +1 -1
  148. package/dist/cdn/chunks/{de-DBOTcDj2.js → de-6M4JoHoD.js} +2 -3
  149. package/dist/cdn/chunks/{de-DBOTcDj2.js.map → de-6M4JoHoD.js.map} +1 -1
  150. package/dist/cdn/chunks/{de-DNuYQTmS.js → de-CeFJ6wbM.js} +2 -3
  151. package/dist/cdn/chunks/{de-DNuYQTmS.js.map → de-CeFJ6wbM.js.map} +1 -1
  152. package/dist/cdn/chunks/{de-JvCTMJPy.js → de-DtrXVcuY.js} +2 -3
  153. package/dist/cdn/chunks/{de-JvCTMJPy.js.map → de-DtrXVcuY.js.map} +1 -1
  154. package/dist/cdn/chunks/{dist-Bo8Thh8v.js → dist-8ym3y-pH.js} +44 -45
  155. package/dist/cdn/chunks/{dist-Bo8Thh8v.js.map → dist-8ym3y-pH.js.map} +1 -1
  156. package/dist/{dist-DI4_YSnG.js → cdn/chunks/dist-BMzNabtD.js} +107 -109
  157. package/dist/cdn/chunks/{dist-S-rLGqax.js.map → dist-BMzNabtD.js.map} +1 -1
  158. package/dist/cdn/chunks/dompurify-JVtr5-B1.js +872 -0
  159. package/dist/cdn/chunks/dompurify-JVtr5-B1.js.map +1 -0
  160. package/dist/cdn/chunks/{draggable-DZ0gwUJ6.js → draggable-Du8AUMFT.js} +654 -654
  161. package/dist/cdn/chunks/draggable-Du8AUMFT.js.map +1 -0
  162. package/dist/{editor-modal-Bzhl-PgI.js → cdn/chunks/editor-modal-CyCe560f.js} +893 -979
  163. package/dist/cdn/chunks/{editor-modal-CI6EfeMd.js.map → editor-modal-CyCe560f.js.map} +1 -1
  164. package/dist/cdn/chunks/{emojiData-6m0DBh7O.js → emojiData-CBNuCfum.js} +2 -3
  165. package/dist/cdn/chunks/{emojiData-6m0DBh7O.js.map → emojiData-CBNuCfum.js.map} +1 -1
  166. package/dist/cdn/chunks/{en-CW71OK66.js → en-D14i5nFh.js} +2 -3
  167. package/dist/cdn/chunks/{en-CW71OK66.js.map → en-D14i5nFh.js.map} +1 -1
  168. package/dist/cdn/chunks/{en-CDhWRrF_.js → en-FzUuJ8HW.js} +2 -3
  169. package/dist/cdn/chunks/{en-CDhWRrF_.js.map → en-FzUuJ8HW.js.map} +1 -1
  170. package/dist/cdn/chunks/en-TIqv4ag3.js +1 -0
  171. package/dist/cdn/chunks/{es-CAv-Vldw.js → es-Dw_h7Oll.js} +2 -3
  172. package/dist/cdn/chunks/{es-CAv-Vldw.js.map → es-Dw_h7Oll.js.map} +1 -1
  173. package/dist/cdn/chunks/{es-DdK7zQfi.js → es-zDacbMhs.js} +2 -3
  174. package/dist/cdn/chunks/{es-DdK7zQfi.js.map → es-zDacbMhs.js.map} +1 -1
  175. package/dist/cdn/chunks/{extensions-taJTZlLK.js → extensions-CFF2KWy-.js} +60 -65
  176. package/dist/cdn/chunks/{extensions-taJTZlLK.js.map → extensions-CFF2KWy-.js.map} +1 -1
  177. package/dist/cdn/chunks/{formatAbsoluteDateTime-DMmop3C-.js → formatAbsoluteDateTime-Ck2_zXra.js} +2 -3
  178. package/dist/cdn/chunks/{formatAbsoluteDateTime-DMmop3C-.js.map → formatAbsoluteDateTime-Ck2_zXra.js.map} +1 -1
  179. package/dist/cdn/chunks/{formatRelativeTime-CtUU-QZ8.js → formatRelativeTime-BTD8Ktt-.js} +1 -2
  180. package/dist/cdn/chunks/{formatRelativeTime-CtUU-QZ8.js.map → formatRelativeTime-BTD8Ktt-.js.map} +1 -1
  181. package/dist/cdn/chunks/{fr-DVPtxpR6.js → fr-BJaeKu_8.js} +2 -3
  182. package/dist/cdn/chunks/{fr-DVPtxpR6.js.map → fr-BJaeKu_8.js.map} +1 -1
  183. package/dist/cdn/chunks/{fr-Dz5Bgb7-.js → fr-CSgYtjOd.js} +2 -3
  184. package/dist/cdn/chunks/{fr-Dz5Bgb7-.js.map → fr-CSgYtjOd.js.map} +1 -1
  185. package/dist/cdn/chunks/{htmlparser-CDRsn-gn.js → htmlparser-hu3YnNQU.js} +6 -11
  186. package/dist/cdn/chunks/{htmlparser-CDRsn-gn.js.map → htmlparser-hu3YnNQU.js.map} +1 -1
  187. package/dist/cdn/chunks/{icons-DNX6StSs.js → icons-okSPsLOa.js} +111 -114
  188. package/dist/cdn/chunks/icons-okSPsLOa.js.map +1 -0
  189. package/dist/cdn/chunks/{ja-Di-zJiT8.js → ja-B7H3ID8O.js} +2 -3
  190. package/dist/cdn/chunks/{ja-Di-zJiT8.js.map → ja-B7H3ID8O.js.map} +1 -1
  191. package/dist/cdn/chunks/{ja-dcWzjStz.js → ja-Cu2HdYaK.js} +2 -3
  192. package/dist/cdn/chunks/{ja-dcWzjStz.js.map → ja-Cu2HdYaK.js.map} +1 -1
  193. package/dist/cdn/chunks/{keys-BTpmg2Tt.js → keys-CUj6UA38.js} +3 -4
  194. package/dist/cdn/chunks/{keys-BTpmg2Tt.js.map → keys-CUj6UA38.js.map} +1 -1
  195. package/dist/{liquid.browser-Ct2-EezB.js → cdn/chunks/liquid.browser-rubac0VA.js} +993 -937
  196. package/dist/cdn/chunks/liquid.browser-rubac0VA.js.map +1 -0
  197. package/dist/cdn/chunks/{logger-Tj0RPskW.js → logger-CqQTfJGx.js} +2 -3
  198. package/dist/cdn/chunks/{logger-Tj0RPskW.js.map → logger-CqQTfJGx.js.map} +1 -1
  199. package/dist/cdn/chunks/{nl-CvVuHYFL.js → nl-176ySmc5.js} +2 -3
  200. package/dist/cdn/chunks/{nl-CvVuHYFL.js.map → nl-176ySmc5.js.map} +1 -1
  201. package/dist/cdn/chunks/{nl-LZNqQgE4.js → nl-1Ai2NykB.js} +2 -3
  202. package/dist/cdn/chunks/{nl-LZNqQgE4.js.map → nl-1Ai2NykB.js.map} +1 -1
  203. package/dist/cdn/chunks/{normalizeMergeTagMarkup-DyePIGqu.js → normalizeMergeTagMarkup-C_KlfSW4.js} +3 -4
  204. package/dist/cdn/chunks/{normalizeMergeTagMarkup-DyePIGqu.js.map → normalizeMergeTagMarkup-C_KlfSW4.js.map} +1 -1
  205. package/dist/cdn/chunks/{preRenderCustomBlocks-Dc-QLntG.js → preRenderCustomBlocks-BcXIz7oJ.js} +6 -7
  206. package/dist/cdn/chunks/{preRenderCustomBlocks-Dc-QLntG.js.map → preRenderCustomBlocks-BcXIz7oJ.js.map} +1 -1
  207. package/dist/cdn/chunks/{pt-BR-CHM-ZKvE.js → pt-BR-Bp92Fc6J.js} +2 -3
  208. package/dist/cdn/chunks/{pt-BR-CHM-ZKvE.js.map → pt-BR-Bp92Fc6J.js.map} +1 -1
  209. package/dist/cdn/chunks/{pt-BR-D6P_mNwA.js → pt-BR-CIbp__Z7.js} +2 -3
  210. package/dist/cdn/chunks/{pt-BR-D6P_mNwA.js.map → pt-BR-CIbp__Z7.js.map} +1 -1
  211. package/dist/cdn/chunks/{pt-BR-ZhO4vgyq.js → pt-BR-dDlTwX18.js} +2 -3
  212. package/dist/cdn/chunks/{pt-BR-ZhO4vgyq.js.map → pt-BR-dDlTwX18.js.map} +1 -1
  213. package/dist/cdn/chunks/{pusher-Cs4GGEtd.js → pusher-x9rNqzon.js} +3 -4
  214. package/dist/cdn/chunks/{pusher-Cs4GGEtd.js.map → pusher-x9rNqzon.js.map} +1 -1
  215. package/dist/cdn/chunks/{readableTextColor-f8Kykfnh.js → readableTextColor-BfZUGnVj.js} +2 -3
  216. package/dist/cdn/chunks/{readableTextColor-f8Kykfnh.js.map → readableTextColor-BfZUGnVj.js.map} +1 -1
  217. package/dist/cdn/chunks/{rolldown-runtime-Y_bBpyJl.js → rolldown-runtime-QGRDbDUS.js} +1 -2
  218. package/dist/cdn/chunks/sanitizeHtml-CN85EDrO.js +72 -0
  219. package/dist/cdn/chunks/sanitizeHtml-CN85EDrO.js.map +1 -0
  220. package/dist/cdn/chunks/{socialIcons-BBvsTwCV.js → socialIcons-jsTDmkbb.js} +608 -632
  221. package/dist/cdn/chunks/{socialIcons-BBvsTwCV.js.map → socialIcons-jsTDmkbb.js.map} +1 -1
  222. package/dist/cdn/chunks/src-C7bkofBL.js +647 -0
  223. package/dist/cdn/chunks/src-C7bkofBL.js.map +1 -0
  224. package/dist/cdn/chunks/{src-Bs_yxk3h.js → src-DEd87i_U.js} +502 -537
  225. package/dist/cdn/chunks/src-DEd87i_U.js.map +1 -0
  226. package/dist/cdn/chunks/{src-BNFnxfrA.js → src-DwWrYnUj.js} +188 -171
  227. package/dist/cdn/chunks/src-DwWrYnUj.js.map +1 -0
  228. package/dist/cdn/chunks/{styleConstants-v1dNKgJf.js → styleConstants-B8xVRiwX.js} +2 -3
  229. package/dist/cdn/chunks/{styleConstants-v1dNKgJf.js.map → styleConstants-B8xVRiwX.js.map} +1 -1
  230. package/dist/cdn/chunks/{templateSettingsFields-YCFVBVYh.js → templateSettingsFields-cjlP-jdw.js} +2 -3
  231. package/dist/cdn/chunks/{templateSettingsFields-YCFVBVYh.js.map → templateSettingsFields-cjlP-jdw.js.map} +1 -1
  232. package/dist/cdn/chunks/{tiptap-CtVrAViq.js → tiptap-CbiTlECY.js} +3402 -3278
  233. package/dist/cdn/chunks/tiptap-CbiTlECY.js.map +1 -0
  234. package/dist/cdn/chunks/{useCloudI18n-AVXhzbhQ.js → useCloudI18n-DY8_-ETE.js} +4 -5
  235. package/dist/cdn/chunks/{useCloudI18n-AVXhzbhQ.js.map → useCloudI18n-DY8_-ETE.js.map} +1 -1
  236. package/dist/cdn/chunks/useEditorCore-BrY66C2y.js +2582 -0
  237. package/dist/cdn/chunks/useEditorCore-BrY66C2y.js.map +1 -0
  238. package/dist/cdn/chunks/useEditorRoot-vjZJwKrV.js +9 -0
  239. package/dist/cdn/chunks/{useEditorRoot-CR5GjJD6.js.map → useEditorRoot-vjZJwKrV.js.map} +1 -1
  240. package/dist/cdn/chunks/{useI18n-CbVubQhM.js → useI18n-D8pY4LTq.js} +4 -5
  241. package/dist/cdn/chunks/{useI18n-CbVubQhM.js.map → useI18n-D8pY4LTq.js.map} +1 -1
  242. package/dist/{useLogicTag-DKLZ1T9H.js → cdn/chunks/useLogicTag-DBJDtpKA.js} +6 -5
  243. package/dist/cdn/chunks/{useLogicTag-B49Nc53Y.js.map → useLogicTag-DBJDtpKA.js.map} +1 -1
  244. package/dist/{useMergeTag-Bhdx7AKk.js → cdn/chunks/useMergeTag-B-aG--s1.js} +8 -7
  245. package/dist/cdn/chunks/{useMergeTag-B0KryMj8.js.map → useMergeTag-B-aG--s1.js.map} +1 -1
  246. package/dist/{usePopoverPosition-BZea45XK.js → cdn/chunks/usePopoverPosition-DSMtmu2W.js} +8 -10
  247. package/dist/cdn/chunks/{usePopoverPosition-C829ps5i.js.map → usePopoverPosition-DSMtmu2W.js.map} +1 -1
  248. package/dist/cdn/chunks/{useScrollToBlock-CAwvulog.js → useScrollToBlock-vjQ0fe-L.js} +5 -7
  249. package/dist/cdn/chunks/{useScrollToBlock-CAwvulog.js.map → useScrollToBlock-vjQ0fe-L.js.map} +1 -1
  250. package/dist/cdn/chunks/{withCurrentFont-DFPXeVfG.js → withCurrentFont-hZTvYBHO.js} +3 -4
  251. package/dist/cdn/chunks/{withCurrentFont-DFPXeVfG.js.map → withCurrentFont-hZTvYBHO.js.map} +1 -1
  252. package/dist/cdn/editor.css +1 -1
  253. package/dist/cdn/editor.js +1433 -1454
  254. package/dist/cdn/editor.js.map +1 -1
  255. package/dist/{check-yYsp5Xpk.js → check-BZ8o0eet.js} +1 -2
  256. package/dist/{chevron-down-DTmD06_j.js → chevron-down-DfAAfILv.js} +1 -2
  257. package/dist/{chevron-right-BSeYZOxc.js → chevron-right-Bk4mGdr7.js} +1 -2
  258. package/dist/{chevron-up-BOApwrxi.js → chevron-up-MhUf_azW.js} +1 -2
  259. package/dist/{circle-alert-BMszY8im.js → circle-alert-CShJwVFv.js} +1 -2
  260. package/dist/{clock-HADxnl6-.js → clock-CTfD6OCt.js} +1 -2
  261. package/dist/{createCloudRuntime-DVQI_ReU.js → createCloudRuntime-DCgO4A1r.js} +31 -37
  262. package/dist/{createLucideIcon-0lYYH3EW.js → createLucideIcon-CvhTA2KG.js} +6 -11
  263. package/dist/{de-DBOTcDj2.js → de-6M4JoHoD.js} +1 -2
  264. package/dist/{de-DNuYQTmS.js → de-CeFJ6wbM.js} +1 -2
  265. package/dist/{de-JvCTMJPy.js → de-DtrXVcuY.js} +1 -2
  266. package/dist/{dist-BC-ZEYLd.js → dist-BF5zEHop.js} +2 -3
  267. package/dist/{dist-CyBwSiAa.js → dist-BS5uKktL.js} +2 -3
  268. package/dist/{cdn/chunks/dist-S-rLGqax.js → dist-ByCWA2Tv.js} +101 -101
  269. package/dist/{dist-DtOF3bDW.js → dist-CKi_npZM.js} +378 -343
  270. package/dist/{dist-C7EtxNCb.js → dist-CVy-7PHQ.js} +55 -56
  271. package/dist/{dist-Cr7RPxI9.js → dist-CWSG7Kj0.js} +478 -461
  272. package/dist/{dist-DXyGqIDE.js → dist-Cy8I5scI.js} +2 -3
  273. package/dist/{dist-C_dV9QAx.js → dist-D6cMdrfG.js} +133 -133
  274. package/dist/{dist-DVNjPKsH.js → dist-D6fZec6r.js} +3 -4
  275. package/dist/{dist-CuLwJF7H.js → dist-Dd5MU2Ev.js} +23 -14
  276. package/dist/dist-DyFArF_G.js +4 -0
  277. package/dist/{dist-DBxgrOeo.js → dist-V7W1UhVr.js} +1882 -1792
  278. package/dist/{dist-DPcf6XZ8.js → dist-p3wymUDt.js} +2 -3
  279. package/dist/dist-pA3ooG6N.js +4 -0
  280. package/dist/{dist-3HpYixwF.js → dist-txQLT2sF.js} +173 -161
  281. package/dist/{cdn/chunks/editor-modal-CI6EfeMd.js → editor-modal-zaZHcmlO.js} +915 -859
  282. package/dist/{emojiData-6m0DBh7O.js → emojiData-CBNuCfum.js} +1 -2
  283. package/dist/{en-CW71OK66.js → en-D14i5nFh.js} +1 -2
  284. package/dist/en-Db76vJbY.js +1 -0
  285. package/dist/{en-CDhWRrF_.js → en-FzUuJ8HW.js} +1 -2
  286. package/dist/{es-CAv-Vldw.js → es-Dw_h7Oll.js} +1 -2
  287. package/dist/{es-DdK7zQfi.js → es-zDacbMhs.js} +1 -2
  288. package/dist/{extensions-CdyweA50.js → extensions-fo_c-vqf.js} +82 -91
  289. package/dist/{eye-DWkSvYpj.js → eye-7W4t5e0Q.js} +1 -2
  290. package/dist/{formatAbsoluteDateTime-DMmop3C-.js → formatAbsoluteDateTime-Ck2_zXra.js} +1 -2
  291. package/dist/{formatRelativeTime-CtUU-QZ8.js → formatRelativeTime-BTD8Ktt-.js} +0 -1
  292. package/dist/{fr-DVPtxpR6.js → fr-BJaeKu_8.js} +1 -2
  293. package/dist/{fr-Dz5Bgb7-.js → fr-CSgYtjOd.js} +1 -2
  294. package/dist/{image-DesWjcZ4.js → image-BDiRFzSd.js} +1 -2
  295. package/dist/index.d.ts +6 -6
  296. package/dist/{info-ClWJGoZy.js → info-Cxi3-Kh9.js} +1 -2
  297. package/dist/{ja-Di-zJiT8.js → ja-B7H3ID8O.js} +1 -2
  298. package/dist/{ja-dcWzjStz.js → ja-Cu2HdYaK.js} +1 -2
  299. package/dist/{keys-Zd9KWRD1.js → keys-BgRERHzu.js} +2 -3
  300. package/dist/{link-BqRicFTA.js → link-ju_2Cmir.js} +1 -2
  301. package/dist/{cdn/chunks/liquid.browser-Bbt17cVz.js → liquid.browser-DUXEekoN.js} +991 -939
  302. package/dist/{list-bojQr9bn.js → list-DYZJf0aZ.js} +1 -2
  303. package/dist/{loader-circle-B2B8LbUu.js → loader-circle-BZRD0a4I.js} +1 -2
  304. package/dist/{logger-k9Nbj3Cp.js → logger-BOu7oEtk.js} +1 -2
  305. package/dist/{message-circle-BEuiNsyZ.js → message-circle-DuEw4Zfx.js} +1 -2
  306. package/dist/{nl-CvVuHYFL.js → nl-176ySmc5.js} +1 -2
  307. package/dist/{nl-LZNqQgE4.js → nl-1Ai2NykB.js} +1 -2
  308. package/dist/{normalizeMergeTagMarkup-P6SUBuPv.js → normalizeMergeTagMarkup-CELnOlgK.js} +30 -31
  309. package/dist/{package-DCROB4aM.js → package-CePMr2kK.js} +1 -2
  310. package/dist/{pencil-CEotCKbf.js → pencil-D3aFCL7c.js} +1 -2
  311. package/dist/{preRenderCustomBlocks-D8rr61_z.js → preRenderCustomBlocks--_xc0XK3.js} +4 -5
  312. package/dist/{pt-BR-CHM-ZKvE.js → pt-BR-Bp92Fc6J.js} +1 -2
  313. package/dist/{pt-BR-D6P_mNwA.js → pt-BR-CIbp__Z7.js} +1 -2
  314. package/dist/{pt-BR-ZhO4vgyq.js → pt-BR-dDlTwX18.js} +1 -2
  315. package/dist/{readableTextColor-f8Kykfnh.js → readableTextColor-BfZUGnVj.js} +1 -2
  316. package/dist/{refresh-cw-C6M2mHNC.js → refresh-cw-xnro7_Sk.js} +1 -2
  317. package/dist/{rolldown-runtime-Dy4uBu1J.js → rolldown-runtime-CGnMp29N.js} +1 -2
  318. package/dist/{runtime-dom.esm-bundler-B8WCZWUm.js → runtime-dom.esm-bundler-BURR-bj5.js} +121 -122
  319. package/dist/sanitizeHtml-BzfzpYJY.js +942 -0
  320. package/dist/{search-Cy99zPYf.js → search-CDrstRBv.js} +1 -2
  321. package/dist/{send-BDLJFsf3.js → send-DROkPOaX.js} +1 -2
  322. package/dist/{smartphone-CVvQaNA4.js → smartphone-Bx6u_tjn.js} +1 -2
  323. package/dist/{socialIcons-Dd-jRiVe.js → socialIcons-D7MGsg0d.js} +553 -564
  324. package/dist/{sparkles-Ce0Qz0ox.js → sparkles-CdaTtvoz.js} +1 -2
  325. package/dist/{square-BWlolnXe.js → square-BbCROH_f.js} +1 -2
  326. package/dist/style.css +1 -1
  327. package/dist/{styleConstants-v1dNKgJf.js → styleConstants-B8xVRiwX.js} +1 -2
  328. package/dist/{templateSettingsFields-YCFVBVYh.js → templateSettingsFields-cjlP-jdw.js} +1 -2
  329. package/dist/templatical-editor.js +1231 -1251
  330. package/dist/{text-align-start-D1V5gPTy.js → text-align-start-CGacJ9Vw.js} +1 -2
  331. package/dist/{trash-CZfiUFmw.js → trash-DxCd7zIy.js} +1 -2
  332. package/dist/{triangle-alert-CFDzyFC7.js → triangle-alert-7_oaitpf.js} +1 -2
  333. package/dist/{upload-BJfvdIrD.js → upload-DuFEOi_0.js} +1 -2
  334. package/dist/{useCloudI18n-Dcjua65H.js → useCloudI18n-DEMmUKuO.js} +3 -4
  335. package/dist/{useEditorCore-BTLeAVlM.js → useEditorCore-BSo2sSID.js} +1568 -1573
  336. package/dist/useEditorRoot-BMcoCLBx.js +7 -0
  337. package/dist/{useI18n-BdoY7xDE.js → useI18n-BBrHTdu8.js} +3 -4
  338. package/dist/{cdn/chunks/useLogicTag-B49Nc53Y.js → useLogicTag-ZPC39rfH.js} +4 -7
  339. package/dist/{cdn/chunks/useMergeTag-B0KryMj8.js → useMergeTag-BQ4qqWpQ.js} +6 -9
  340. package/dist/{cdn/chunks/usePopoverPosition-C829ps5i.js → usePopoverPosition-DV1PxL66.js} +6 -12
  341. package/dist/{useScrollToBlock-FmNMALM_.js → useScrollToBlock-BSyAV4pk.js} +4 -6
  342. package/dist/{vue.runtime.esm-bundler-DgFJ6GPG.js → vue.runtime.esm-bundler-CnEeTfhs.js} +1001 -1002
  343. package/dist/{withCurrentFont-BATJHNve.js → withCurrentFont-B22FXAF5.js} +2 -3
  344. package/dist/{x-CZ0Js0hA.js → x-BpfG7v9g.js} +1 -2
  345. package/package.json +26 -24
  346. package/dist/BlockIssueBadge-CKwZ1Vgn.js +0 -34
  347. package/dist/CommentsSidebar-Ca3DyFOX.js +0 -500
  348. package/dist/IssuesPanel-C8nMUccy.js +0 -360
  349. package/dist/SavedBlocksBrowserModal-wnkvxpm_.js +0 -360
  350. package/dist/WrapperBlock-BO619LAb.js +0 -45
  351. package/dist/cdn/chunks/AiRewriteMenu-Bhh71zcc.js.map +0 -1
  352. package/dist/cdn/chunks/BlockIssueBadge-DAn2vsMJ.js +0 -35
  353. package/dist/cdn/chunks/BlockIssueBadge-DAn2vsMJ.js.map +0 -1
  354. package/dist/cdn/chunks/CommentsSidebar-CCvplq1Z.js.map +0 -1
  355. package/dist/cdn/chunks/LoadingTrack-BIcL4NiY.js +0 -12
  356. package/dist/cdn/chunks/ParagraphEditor-CqSj6Ayz.js.map +0 -1
  357. package/dist/cdn/chunks/SavedBlocksBrowserModal-DtOz_X5S.js +0 -357
  358. package/dist/cdn/chunks/TitleEditor-Ccv6uoTz.js.map +0 -1
  359. package/dist/cdn/chunks/TplModal-BXQzmsJX.js +0 -52
  360. package/dist/cdn/chunks/blockTypeIcons-ikZAmd6U.js +0 -22
  361. package/dist/cdn/chunks/blockTypeIcons-ikZAmd6U.js.map +0 -1
  362. package/dist/cdn/chunks/draggable-DZ0gwUJ6.js.map +0 -1
  363. package/dist/cdn/chunks/en-ifvu6oPv.js +0 -1
  364. package/dist/cdn/chunks/icons-DNX6StSs.js.map +0 -1
  365. package/dist/cdn/chunks/liquid.browser-Bbt17cVz.js.map +0 -1
  366. package/dist/cdn/chunks/sanitizeRichTextHtml-DeISfLFr.js +0 -62
  367. package/dist/cdn/chunks/sanitizeRichTextHtml-DeISfLFr.js.map +0 -1
  368. package/dist/cdn/chunks/src-BNFnxfrA.js.map +0 -1
  369. package/dist/cdn/chunks/src-Bs_yxk3h.js.map +0 -1
  370. package/dist/cdn/chunks/src-YGkzYyu0.js +0 -649
  371. package/dist/cdn/chunks/src-YGkzYyu0.js.map +0 -1
  372. package/dist/cdn/chunks/tiptap-CtVrAViq.js.map +0 -1
  373. package/dist/cdn/chunks/useEditorCore-CCVFi1YZ.js +0 -2586
  374. package/dist/cdn/chunks/useEditorCore-CCVFi1YZ.js.map +0 -1
  375. package/dist/cdn/chunks/useEditorRoot-CR5GjJD6.js +0 -10
  376. package/dist/dist-BPFcLKTw.js +0 -5
  377. package/dist/dist-D7Yj7E-F.js +0 -5
  378. package/dist/en-DwV15ltA.js +0 -1
  379. package/dist/sanitizeRichTextHtml-DeISfLFr.js +0 -60
  380. package/dist/useEditorRoot-DUy67lJu.js +0 -8
@@ -1,11 +1,11 @@
1
- import { $ as e, C as t, D as n, G as r, P as i, Q as a, V as o, X as s, Z as c, _ as l, b as u, dt as d, it as f, j as p, lt as m, ot as h, p as g, q as _, st as v, tt as y, u as b, ut as x, x as S } from "./draggable-DZ0gwUJ6.js";
2
- import { A as C, At as w, Ct as T, E, St as D, T as O, Vt as k, Y as A, _t as j, bt as ee, gt as M, k as N, mt as P, n as F, q as I, r as L, st as R, vt as z, w as B, wt as V, xt as H, yt as U } from "./src-BNFnxfrA.js";
3
- import { r as W } from "./dist-S-rLGqax.js";
4
- import { L as G, P as te, c as ne, x as K } from "./keys-BTpmg2Tt.js";
5
- import { t as re } from "./useI18n-CbVubQhM.js";
6
- import { o as ie, s as q } from "./usePopoverPosition-C829ps5i.js";
7
- import { ot as ae, s as oe } from "./icons-DNX6StSs.js";
8
- //#region ../core/src/error-reporting.ts
1
+ import { $ as e, C as t, D as n, J as r, K as i, P as a, Q as o, V as s, Z as c, _ as l, at as u, b as d, ct as f, dt as p, et as m, ft as h, j as g, nt as _, p as v, st as y, u as b, ut as x, x as S } from "./draggable-Du8AUMFT.js";
2
+ import { A as C, Ct as w, Dt as T, Et as E, Ft as D, Kt as O, N as k, O as A, Ot as j, P as M, St as N, Tt as P, Z as ee, et as F, ft as I, k as L, kt as R, n as z, r as B, wt as V, xt as H, yt as U } from "./src-DwWrYnUj.js";
3
+ import { r as W } from "./dist-BMzNabtD.js";
4
+ import { L as G, P as te, c as ne, x as K } from "./keys-CUj6UA38.js";
5
+ import { t as re } from "./useI18n-D8pY4LTq.js";
6
+ import { o as ie, s as q } from "./usePopoverPosition-DSMtmu2W.js";
7
+ import { at as ae, s as oe } from "./icons-okSPsLOa.js";
8
+ // ../core/src/error-reporting.ts
9
9
  function se(e) {
10
10
  return e instanceof Error ? e : Error(String(e), { cause: e });
11
11
  }
@@ -16,12 +16,11 @@ function J(e, t) {
16
16
  e?.(se(t));
17
17
  }
18
18
  }
19
- //#endregion
20
- //#region ../core/src/editor.ts
19
+ // ../core/src/editor.ts
21
20
  function ce(t) {
22
- let n = t.content ?? A(t.defaultFontFamily, t.templateDefaults);
23
- O(n), E(n);
24
- let i = c({
21
+ let n = t.content ?? F(t.defaultFontFamily, t.templateDefaults);
22
+ L(n), C(n);
23
+ let r = o({
25
24
  template: null,
26
25
  content: n,
27
26
  selectedBlockId: null,
@@ -32,28 +31,28 @@ function ce(t) {
32
31
  isSaving: !1,
33
32
  isLoading: !1,
34
33
  uiTheme: "auto"
35
- }), o = e(0), s = 0, l = 0;
36
- function u() {
37
- i.isDirty = !0, l++;
34
+ }), a = m(0), s = 0, c = 0;
35
+ function l() {
36
+ r.isDirty = !0, c++;
38
37
  }
39
- let d = r({
40
- get: () => i.content,
38
+ let u = i({
39
+ get: () => r.content,
41
40
  set: (e) => {
42
- i.content = e, u();
41
+ r.content = e, l();
43
42
  }
44
- }), f = r(() => i.selectedBlockId ? p(i.content.blocks, i.selectedBlockId) : null);
45
- function p(e, t) {
43
+ }), d = i(() => r.selectedBlockId ? f(r.content.blocks, r.selectedBlockId) : null);
44
+ function f(e, t) {
46
45
  for (let n of e) {
47
46
  if (n.id === t) return n;
48
47
  if (n.type === "section") for (let e of n.children) {
49
- let n = p(e, t);
48
+ let n = f(e, t);
50
49
  if (n) return n;
51
50
  }
52
51
  }
53
52
  return null;
54
53
  }
55
- function m(e, t) {
56
- if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) m(e, t);
54
+ function p(e, t) {
55
+ if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) p(e, t);
57
56
  }
58
57
  function h(e, t, n = { blocks: e }) {
59
58
  for (let r = 0; r < e.length; r++) {
@@ -74,7 +73,7 @@ function ce(t) {
74
73
  return t.lockedBlocks?.value.has(e) ?? !1;
75
74
  }
76
75
  function _(e) {
77
- let t = h(i.content.blocks, e);
76
+ let t = h(r.content.blocks, e);
78
77
  if (!t) return null;
79
78
  let n = t.blocks.findIndex((t) => t.id === e);
80
79
  return n === -1 ? null : {
@@ -84,244 +83,243 @@ function ce(t) {
84
83
  };
85
84
  }
86
85
  function v(e, t = !0) {
87
- O(e), E(e), i.content = e, t && u();
86
+ L(e), C(e), r.content = e, t && l();
88
87
  }
89
88
  function y(e) {
90
- e && g(e) || (i.selectedBlockId = e);
89
+ e && g(e) || (r.selectedBlockId = e);
91
90
  }
92
91
  function b(e) {
93
- i.viewport = e;
92
+ r.viewport = e;
94
93
  }
95
94
  function x(e) {
96
- i.darkMode = e;
95
+ r.darkMode = e;
97
96
  }
98
97
  function S(e) {
99
- i.uiTheme = e;
98
+ r.uiTheme = e;
100
99
  }
101
- function C(e) {
102
- i.previewMode = e, e && (i.selectedBlockId = null);
100
+ function w(e) {
101
+ r.previewMode = e, e && (r.selectedBlockId = null);
103
102
  }
104
- function w(e, t) {
103
+ function T(e, t) {
105
104
  if (g(e)) return;
106
- let n = p(i.content.blocks, e);
107
- n && (Object.assign(n, t), u());
105
+ let n = f(r.content.blocks, e);
106
+ n && (Object.assign(n, t), l());
108
107
  }
109
- function T(e) {
110
- i.content.settings = {
111
- ...i.content.settings,
108
+ function D(e) {
109
+ r.content.settings = {
110
+ ...r.content.settings,
112
111
  ...e
113
- }, u();
112
+ }, l();
114
113
  }
115
- function D(e, t, n = 0, r) {
114
+ function O(e, t, n = 0, i) {
116
115
  let a = {
117
- settings: i.content.settings,
116
+ settings: r.content.settings,
118
117
  blocks: [e]
119
118
  };
120
- if (O(a), E(a), !(t && e.type === "section")) {
119
+ if (L(a), C(a), !(t && e.type === "section")) {
121
120
  if (t) {
122
121
  if (g(t)) return;
123
- let a = p(i.content.blocks, t);
122
+ let a = f(r.content.blocks, t);
124
123
  if (a && a.type === "section") {
125
- if (n < 0 || n >= H(a.columns)) return;
124
+ if (n < 0 || n >= E(a.columns)) return;
126
125
  a.children[n] = a.children[n] || [];
127
126
  let t = a.children[n];
128
- r !== void 0 && r < t.length ? t.splice(r, 0, e) : t.push(e);
127
+ i !== void 0 && i < t.length ? t.splice(i, 0, e) : t.push(e);
129
128
  }
130
- } else r !== void 0 && r < i.content.blocks.length ? i.content.blocks.splice(r, 0, e) : i.content.blocks.push(e);
131
- u();
129
+ } else i !== void 0 && i < r.content.blocks.length ? r.content.blocks.splice(i, 0, e) : r.content.blocks.push(e);
130
+ l();
132
131
  }
133
132
  }
134
133
  function k(e) {
135
134
  if (g(e)) return;
136
- let t = h(i.content.blocks, e);
135
+ let t = h(r.content.blocks, e);
137
136
  if (t) {
138
137
  let n = t.blocks.findIndex((t) => t.id === e);
139
138
  if (n !== -1) {
140
139
  let [e] = t.blocks.splice(n, 1);
141
- if (i.selectedBlockId) {
140
+ if (r.selectedBlockId) {
142
141
  let t = /* @__PURE__ */ new Set();
143
- m(e, t), t.has(i.selectedBlockId) && (i.selectedBlockId = null);
142
+ p(e, t), t.has(r.selectedBlockId) && (r.selectedBlockId = null);
144
143
  }
145
- u();
144
+ l();
146
145
  }
147
146
  }
148
147
  }
149
- function j(e, t, n, r = 0) {
148
+ function A(e, t, n, i = 0) {
150
149
  if (g(e) || n && g(n)) return;
151
- let a = h(i.content.blocks, e);
150
+ let a = h(r.content.blocks, e);
152
151
  if (!a) return;
153
152
  let o = a.blocks.findIndex((t) => t.id === e);
154
153
  if (o === -1 || n && a.blocks[o].type === "section") return;
155
154
  let s;
156
155
  if (n) {
157
- let e = p(i.content.blocks, n);
158
- if (!e || e.type !== "section" || r < 0 || r >= H(e.columns)) return;
159
- e.children[r] = e.children[r] || [], s = e.children[r];
160
- } else s = i.content.blocks;
156
+ let e = f(r.content.blocks, n);
157
+ if (!e || e.type !== "section" || i < 0 || i >= E(e.columns)) return;
158
+ e.children[i] = e.children[i] || [], s = e.children[i];
159
+ } else s = r.content.blocks;
161
160
  let [c] = a.blocks.splice(o, 1);
162
- s.splice(t, 0, c), u();
161
+ s.splice(t, 0, c), l();
163
162
  }
164
- function ee() {
165
- u();
163
+ function j() {
164
+ l();
166
165
  }
167
- function N(e, t) {
168
- throw new M(`[Templatical] Templates: ${e} ${t}`);
166
+ function M(e, t) {
167
+ throw new H(`[Templatical] Templates: ${e} ${t}`);
169
168
  }
170
- function P(e) {
169
+ function N(e) {
171
170
  J(t.onError, e);
172
171
  }
173
- function F(e) {
172
+ function P(e) {
174
173
  let { templates: n } = t;
175
- return n || N(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
174
+ return n || M(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
176
175
  }
177
- function I(e) {
178
- i.template && (i.template = {
179
- ...i.template,
176
+ function ee(e) {
177
+ r.template && (r.template = {
178
+ ...r.template,
180
179
  name: e
181
- }, u());
180
+ }, l());
182
181
  }
183
- async function L(e) {
184
- let n = F("create()"), { create: r } = n;
185
- typeof r != "function" && N("create()", "is disabled by the provider — its `create` is `false`.");
186
- let a, c = ++s;
187
- i.isLoading = !0;
182
+ async function I(e) {
183
+ let n = P("create()"), { create: i } = n;
184
+ typeof i != "function" && M("create()", "is disabled by the provider — its `create` is `false`.");
185
+ let o, l = ++s;
186
+ r.isLoading = !0;
188
187
  try {
189
- e?.content && (i.content = e.content);
190
- let t = l;
191
- a = await r(e?.name === void 0 ? { content: i.content } : {
188
+ e?.content && (r.content = e.content);
189
+ let t = c;
190
+ o = await i(e?.name === void 0 ? { content: r.content } : {
192
191
  name: e.name,
193
- content: i.content
194
- }), i.template = a, l === t && (i.isDirty = !1), o.value++;
192
+ content: r.content
193
+ }), r.template = o, c === t && (r.isDirty = !1), a.value++;
195
194
  } catch (e) {
196
195
  throw t.onError?.(e), e;
197
196
  } finally {
198
- s === c && (i.isLoading = !1);
197
+ s === l && (r.isLoading = !1);
199
198
  }
200
- return P(() => n.onCreated?.(a)), a;
199
+ return N(() => n.onCreated?.(o)), o;
201
200
  }
202
201
  async function R(e, n) {
203
- let r = F("load()"), a, c = ++s;
204
- i.isLoading = !0;
202
+ let i = P("load()"), o, c = ++s;
203
+ r.isLoading = !0;
205
204
  try {
206
- if (a = await r.load(e), O(a.content), E(a.content), n && !n()) return a;
207
- i.template = a, i.content = a.content, i.isDirty = !1, o.value++;
205
+ if (o = await i.load(e), L(o.content), C(o.content), n && !n()) return o;
206
+ r.template = o, r.content = o.content, r.isDirty = !1, a.value++;
208
207
  } catch (e) {
209
208
  throw t.onError?.(e), e;
210
209
  } finally {
211
- s === c && (i.isLoading = !1);
210
+ s === c && (r.isLoading = !1);
212
211
  }
213
- return P(() => r.onLoaded?.(a)), a;
212
+ return N(() => i.onLoaded?.(o)), o;
214
213
  }
215
214
  async function z(e = "api") {
216
- let n = F("save()"), { save: r } = n;
217
- typeof r != "function" && N("save()", "is disabled by the provider — its `save` is `false`.");
218
- let a = i.template;
219
- a || N("save()", "has no template loaded. Call create() or load() first.");
220
- let o = a.name === void 0 ? { content: i.content } : {
215
+ let n = P("save()"), { save: i } = n;
216
+ typeof i != "function" && M("save()", "is disabled by the provider — its `save` is `false`.");
217
+ let a = r.template;
218
+ a || M("save()", "has no template loaded. Call create() or load() first.");
219
+ let o = a.name === void 0 ? { content: r.content } : {
221
220
  name: a.name,
222
- content: i.content
221
+ content: r.content
223
222
  }, s;
224
- i.isSaving = !0;
223
+ r.isSaving = !0;
225
224
  try {
226
- let e = l;
227
- if (s = await r(a.id, o), i.template?.id === a.id) {
228
- let e = i.template.name;
229
- i.template = e === a.name ? s : {
225
+ let e = c;
226
+ if (s = await i(a.id, o), r.template?.id === a.id) {
227
+ let e = r.template.name;
228
+ r.template = e === a.name ? s : {
230
229
  ...s,
231
230
  name: e
232
231
  };
233
232
  }
234
- l === e && (i.isDirty = !1);
233
+ c === e && (r.isDirty = !1);
235
234
  } catch (e) {
236
235
  throw t.onError?.(e), e;
237
236
  } finally {
238
- i.isSaving = !1;
237
+ r.isSaving = !1;
239
238
  }
240
- return P(() => n.onSaved?.(s, { trigger: e })), s;
239
+ return N(() => n.onSaved?.(s, { trigger: e })), s;
241
240
  }
242
241
  function B() {
243
- return i.template?.id !== void 0;
242
+ return r.template?.id !== void 0;
244
243
  }
245
244
  return {
246
- state: a(i),
247
- loadVersion: a(o),
248
- content: d,
249
- selectedBlock: f,
245
+ state: e(r),
246
+ loadVersion: e(a),
247
+ content: u,
248
+ selectedBlock: d,
250
249
  isBlockLocked: g,
251
250
  setContent: v,
252
251
  selectBlock: y,
253
252
  setViewport: b,
254
253
  setDarkMode: x,
255
254
  setUiTheme: S,
256
- setPreviewMode: C,
257
- updateBlock: w,
258
- updateSettings: T,
259
- addBlock: D,
255
+ setPreviewMode: w,
256
+ updateBlock: T,
257
+ updateSettings: D,
258
+ addBlock: O,
260
259
  removeBlock: k,
261
- moveBlock: j,
262
- markDirty: ee,
260
+ moveBlock: A,
261
+ markDirty: j,
263
262
  findBlockLocation: _,
264
- setName: I,
265
- create: L,
263
+ setName: ee,
264
+ create: I,
266
265
  load: R,
267
266
  save: z,
268
267
  hasTemplate: B
269
268
  };
270
269
  }
271
- //#endregion
272
- //#region ../core/src/history.ts
270
+ // ../core/src/history.ts
273
271
  var le = 50, ue = 300, de = 1500;
274
- function Y(t) {
275
- let { content: n, setContent: i, maxSize: a = le } = t, o = e([]), s = e([]), c = e(!1), l = null, u = null, d = r(() => o.value.length > 0), f = r(() => s.value.length > 0);
276
- function p() {
277
- return T(n.value);
272
+ function Y(e) {
273
+ let { content: t, setContent: n, maxSize: r = le } = e, a = m([]), o = m([]), s = m(!1), c = null, l = null, u = i(() => a.value.length > 0), d = i(() => o.value.length > 0);
274
+ function f() {
275
+ return j(t.value);
278
276
  }
279
- function m(e) {
280
- o.value.push(e), o.value.length > a && o.value.splice(0, o.value.length - a);
277
+ function p(e) {
278
+ a.value.push(e), a.value.length > r && a.value.splice(0, a.value.length - r);
281
279
  }
282
280
  function h() {
283
- u &&= (clearTimeout(u.timeoutId), null);
281
+ l &&= (clearTimeout(l.timeoutId), null);
284
282
  }
285
283
  function g() {
286
- h(), m(p()), s.value = [];
284
+ h(), p(f()), o.value = [];
287
285
  }
288
286
  function _(e) {
289
- u && u.blockId === e ? (clearTimeout(u.timeoutId), u.timeoutId = setTimeout(() => {
290
- u = null;
291
- }, ue)) : (h(), m(p()), s.value = [], u = {
287
+ l && l.blockId === e ? (clearTimeout(l.timeoutId), l.timeoutId = setTimeout(() => {
288
+ l = null;
289
+ }, ue)) : (h(), p(f()), o.value = [], l = {
292
290
  blockId: e,
293
291
  timeoutId: setTimeout(() => {
294
- u = null;
292
+ l = null;
295
293
  }, ue)
296
294
  });
297
295
  }
298
296
  function v() {
299
- c.value = !0, l && clearTimeout(l), l = setTimeout(() => {
300
- c.value = !1, l = null;
297
+ s.value = !0, c && clearTimeout(c), c = setTimeout(() => {
298
+ s.value = !1, c = null;
301
299
  }, de);
302
300
  }
303
301
  function y() {
304
- if (o.value.length === 0) return;
302
+ if (a.value.length === 0) return;
305
303
  h();
306
- let e = o.value.pop();
307
- s.value.push(p()), i(e, !0), v();
304
+ let e = a.value.pop();
305
+ o.value.push(f()), n(e, !0), v();
308
306
  }
309
307
  function b() {
310
- if (s.value.length === 0) return;
308
+ if (o.value.length === 0) return;
311
309
  h();
312
- let e = s.value.pop();
313
- o.value.push(p()), i(e, !0), v();
310
+ let e = o.value.pop();
311
+ a.value.push(f()), n(e, !0), v();
314
312
  }
315
313
  function x() {
316
- o.value = [], s.value = [], h();
314
+ a.value = [], o.value = [], h();
317
315
  }
318
316
  function S() {
319
- x(), l &&= (clearTimeout(l), null);
317
+ x(), c &&= (clearTimeout(c), null);
320
318
  }
321
319
  return {
322
- canUndo: d,
323
- canRedo: f,
324
- isNavigating: c,
320
+ canUndo: u,
321
+ canRedo: d,
322
+ isNavigating: s,
325
323
  undo: y,
326
324
  redo: b,
327
325
  record: g,
@@ -330,16 +328,15 @@ function Y(t) {
330
328
  destroy: S
331
329
  };
332
330
  }
333
- //#endregion
334
- //#region ../core/src/block-actions.ts
331
+ // ../core/src/block-actions.ts
335
332
  function fe(e) {
336
333
  let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
337
334
  function o(n, r, a) {
338
- let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = C(n, o);
335
+ let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = M(n, o);
339
336
  return t(s, r, a), i(s.id), s;
340
337
  }
341
338
  function s(e, n, r) {
342
- let o = N(e);
339
+ let o = k(e);
343
340
  if (n !== void 0 || r !== void 0) t(o, n, r);
344
341
  else {
345
342
  let i = a?.(e.id) ?? null;
@@ -360,8 +357,7 @@ function fe(e) {
360
357
  updateBlockProperty: l
361
358
  };
362
359
  }
363
- //#endregion
364
- //#region ../core/src/auto-save.ts
360
+ // ../core/src/auto-save.ts
365
361
  var pe = 2e3;
366
362
  function X(e) {
367
363
  let { content: t, isDirty: n, onChange: r, debounce: i = pe, enabled: a = !0 } = e, o = null, s = !1;
@@ -377,82 +373,79 @@ function X(e) {
377
373
  function d() {
378
374
  o &&= (clearTimeout(o), null);
379
375
  }
380
- function f() {
376
+ function p() {
381
377
  d(), n() && r(JSON.parse(JSON.stringify(t.value)));
382
378
  }
383
- function p() {
379
+ function m() {
384
380
  c() && !s && (d(), o = setTimeout(() => {
385
381
  o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
386
382
  }, i));
387
383
  }
388
- let m = v(t, () => {
389
- p();
384
+ let h = f(t, () => {
385
+ m();
390
386
  }, { deep: !0 });
391
- function h() {
392
- m(), d();
387
+ function g() {
388
+ h(), d();
393
389
  }
394
390
  return {
395
- flush: f,
391
+ flush: p,
396
392
  cancel: d,
397
393
  pause: l,
398
394
  resume: u,
399
- destroy: h
395
+ destroy: g
400
396
  };
401
397
  }
402
- //#endregion
403
- //#region ../core/src/condition-preview.ts
398
+ // ../core/src/condition-preview.ts
404
399
  function me(e) {
405
- let t = c(/* @__PURE__ */ new Set()), n = r(() => t.size > 0);
406
- function i(e) {
400
+ let t = o(/* @__PURE__ */ new Set()), n = i(() => t.size > 0);
401
+ function r(e) {
407
402
  return t.has(e);
408
403
  }
409
404
  function a(n) {
410
405
  t.has(n) ? t.delete(n) : (t.add(n), e.state.selectedBlockId === n && e.selectBlock(null));
411
406
  }
412
- function o() {
407
+ function s() {
413
408
  t.clear();
414
409
  }
415
410
  return {
416
- isHidden: i,
411
+ isHidden: r,
417
412
  toggleBlock: a,
418
- reset: o,
413
+ reset: s,
419
414
  hasHiddenBlocks: n
420
415
  };
421
416
  }
422
- //#endregion
423
- //#region ../core/src/data-source-fetch.ts
424
- function he(t) {
425
- let n = e(!1), i = e(!1), a = r(() => !!t.definition.value?.dataSource), o = r(() => a.value && !t.block.value.dataSourceFetched);
426
- async function s() {
427
- let e = t.definition.value;
428
- if (e?.dataSource) {
429
- n.value = !0, i.value = !1;
417
+ // ../core/src/data-source-fetch.ts
418
+ function he(e) {
419
+ let t = m(!1), n = m(!1), r = i(() => !!e.definition.value?.dataSource), a = i(() => r.value && !e.block.value.dataSourceFetched);
420
+ async function o() {
421
+ let r = e.definition.value;
422
+ if (r?.dataSource) {
423
+ t.value = !0, n.value = !1;
430
424
  try {
431
- let n = await e.dataSource.onFetch({
432
- fieldValues: { ...t.block.value.fieldValues },
433
- blockId: t.block.value.id
425
+ let t = await r.dataSource.onFetch({
426
+ fieldValues: { ...e.block.value.fieldValues },
427
+ blockId: e.block.value.id
434
428
  });
435
- if (n == null) return;
436
- let r = { ...t.block.value.fieldValues };
437
- for (let e of Object.keys(r)) e in n && (r[e] = n[e]);
438
- t.onUpdate(r, !0);
429
+ if (t == null) return;
430
+ let n = { ...e.block.value.fieldValues };
431
+ for (let e of Object.keys(n)) e in t && (n[e] = t[e]);
432
+ e.onUpdate(n, !0);
439
433
  } catch (e) {
440
- console.warn("[Templatical] Data source fetch error:", e), i.value = !0;
434
+ console.warn("[Templatical] Data source fetch error:", e), n.value = !0;
441
435
  } finally {
442
- n.value = !1;
436
+ t.value = !1;
443
437
  }
444
438
  }
445
439
  }
446
440
  return {
447
- isFetching: n,
448
- fetchError: i,
449
- fetch: s,
450
- hasDataSource: a,
451
- needsFetch: o
441
+ isFetching: t,
442
+ fetchError: n,
443
+ fetch: o,
444
+ hasDataSource: r,
445
+ needsFetch: a
452
446
  };
453
447
  }
454
- //#endregion
455
- //#region ../core/src/history-interceptor.ts
448
+ // ../core/src/history-interceptor.ts
456
449
  function ge(e, t) {
457
450
  let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
458
451
  e.addBlock = (r, i, a, o) => {
@@ -467,8 +460,7 @@ function ge(e, t) {
467
460
  t.record(), o(e);
468
461
  };
469
462
  }
470
- //#endregion
471
- //#region ../core/src/diff-content.ts
463
+ // ../core/src/diff-content.ts
472
464
  var _e = "root", ve = /* @__PURE__ */ new Set([
473
465
  "id",
474
466
  "type",
@@ -519,7 +511,7 @@ function Ce(e) {
519
511
  }
520
512
  function we(e, t, n) {
521
513
  let r = {}, i = [];
522
- for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || D(e[i], t[i]) || (r[i] = T(t[i]));
514
+ for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || T(e[i], t[i]) || (r[i] = j(t[i]));
523
515
  for (let r of Object.keys(e)) n.has(r) || e[r] === void 0 || t[r] === void 0 && i.push(r);
524
516
  return {
525
517
  set: r,
@@ -543,8 +535,8 @@ function Te(e, t) {
543
535
  };
544
536
  for (let t of e.blocks) u(t, "kept");
545
537
  let d = (e) => n.has(e) && !c.has(e), f = (e) => {
546
- let t = T(e);
547
- return t.type === "section" && (t.children = Z(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => T(e)) : e)), t;
538
+ let t = j(e);
539
+ return t.type === "section" && (t.children = Z(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => j(e)) : e)), t;
548
540
  }, p = (e, t, r) => {
549
541
  let a = xe(e), o = [], s = [];
550
542
  t.forEach((e, t) => {
@@ -660,59 +652,59 @@ function Ie(e) {
660
652
  return n;
661
653
  });
662
654
  }
663
- function Le(t) {
664
- let { provider: n } = t, i = t.sessionId ?? crypto.randomUUID(), a = t.maxUndo ?? ke, o = typeof n.acquireLock == "function" && typeof n.renewLock == "function" && typeof n.releaseLock == "function", c = y([]), l = y(/* @__PURE__ */ new Map()), u = e(null), d = e(0), f = e(0), p = null, m = null, h = !1, g = !1, b = !1, x = null, S = 0, C = !1, w = [], E = null, O = null, k = Promise.resolve(), A = null, M = r(() => (m?.undo.length ?? 0) > 0), N = r(() => (m?.redo.length ?? 0) > 0);
665
- function P(e) {
666
- t.onError?.(e instanceof Error ? e : Error(String(e)));
655
+ function Le(e) {
656
+ let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), a = e.maxUndo ?? ke, o = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", s = _([]), l = _(/* @__PURE__ */ new Map()), u = m(null), d = m(0), p = m(0), h = null, g = null, v = !1, y = !1, b = !1, x = null, S = 0, C = !1, E = [], D = null, O = null, k = Promise.resolve(), A = null, M = i(() => (g?.undo.length ?? 0) > 0), ee = i(() => (g?.redo.length ?? 0) > 0);
657
+ function F(t) {
658
+ e.onError?.(t instanceof Error ? t : Error(String(t)));
667
659
  }
668
- function F(e, n = m) {
669
- n !== m || C || t.onNotice?.(e);
660
+ function I(t, n = g) {
661
+ n !== g || C || e.onNotice?.(t);
670
662
  }
671
- function I() {
663
+ function L() {
672
664
  return {
673
665
  locks: [...l.value.values()].map((e) => ({
674
666
  blockId: e.blockId,
675
667
  sessionId: e.holder.sessionId
676
668
  })),
677
- session: i
669
+ session: n
678
670
  };
679
671
  }
680
- function L() {
681
- f.value++;
672
+ function R() {
673
+ p.value++;
682
674
  }
683
- function R(e, t) {
675
+ function z(e, t) {
684
676
  e.push(t), e.length > a && e.splice(0, e.length - a);
685
677
  }
686
678
  function B(e) {
687
- if (!p || h) return;
688
- g = !0;
679
+ if (!h || v) return;
680
+ y = !0;
689
681
  try {
690
- let t = p.content.value, n = Te(t, e);
682
+ let t = h.content.value, n = Te(t, e);
691
683
  if (n.length > 0) try {
692
- ee(t, n);
684
+ P(t, n);
693
685
  } catch {
694
- p.setContent(T(e), !1);
686
+ h.setContent(j(e), !1);
695
687
  }
696
- D(p.content.value, e) || p.setContent(T(e), !1);
688
+ T(h.content.value, e) || h.setContent(j(e), !1);
697
689
  } finally {
698
- g = !1;
690
+ y = !1;
699
691
  }
700
- let t = p.state.selectedBlockId;
701
- t && !Pe(e.blocks, t) && p.selectBlock(null);
692
+ let t = h.state.selectedBlockId;
693
+ t && !Pe(e.blocks, t) && h.selectBlock(null);
702
694
  }
703
- function V() {
704
- g || b || (b = !0, queueMicrotask(() => {
695
+ function H() {
696
+ y || b || (b = !0, queueMicrotask(() => {
705
697
  b = !1, W(!1);
706
698
  }));
707
699
  }
708
- function H() {
700
+ function U() {
709
701
  x &&= (clearTimeout(x), null);
710
702
  }
711
703
  function W(e, t = !1) {
712
- let n = m;
713
- if (!p || !n || h || g || p.state.isLoading && !t || p.state.template?.id !== n.templateId) return;
714
- let r = Te(n.view, p.content.value);
715
- if (r.length === 0) H();
704
+ let n = g;
705
+ if (!h || !n || v || y || h.state.isLoading && !t || h.state.template?.id !== n.templateId) return;
706
+ let r = Te(n.view, h.content.value);
707
+ if (r.length === 0) U();
716
708
  else {
717
709
  if (!e && Fe(r)) {
718
710
  let e = Date.now();
@@ -723,7 +715,7 @@ function Le(t) {
723
715
  return;
724
716
  }
725
717
  }
726
- H(), te(n, r);
718
+ U(), te(n, r);
727
719
  }
728
720
  }
729
721
  function G() {
@@ -732,37 +724,37 @@ function Le(t) {
732
724
  function te(e, t) {
733
725
  let n = t, r;
734
726
  try {
735
- r = U(e.view, n, I());
727
+ r = V(e.view, n, L());
736
728
  } catch (t) {
737
- if (!(t instanceof z)) throw t;
729
+ if (!(t instanceof w)) throw t;
738
730
  B(e.view);
739
731
  let n = t.blockId === void 0 ? void 0 : l.value.get(t.blockId)?.holder;
740
- F({
732
+ I({
741
733
  type: "editRefused",
742
734
  code: t.code,
743
735
  ...n ? { holder: n } : {}
744
- }), t.code === "invalid_operation" && P(t);
736
+ }), t.code === "invalid_operation" && F(t);
745
737
  return;
746
738
  }
747
- let i = p.content.value;
748
- if (!D(r, i)) {
749
- P(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
739
+ let i = h.content.value;
740
+ if (!T(r, i)) {
741
+ F(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
750
742
  op: "setContent",
751
- content: T(i)
743
+ content: j(i)
752
744
  }];
753
745
  try {
754
- r = U(e.view, n, I());
746
+ r = V(e.view, n, L());
755
747
  } catch (t) {
756
- if (!(t instanceof z)) throw t;
757
- B(e.view), F({
748
+ if (!(t instanceof w)) throw t;
749
+ B(e.view), I({
758
750
  type: "editRefused",
759
751
  code: t.code
760
752
  });
761
753
  return;
762
754
  }
763
755
  }
764
- let a = { ops: j(e.view, n) };
765
- R(e.undo, a), e.redo = [], L(), e.view = r, ne(e, n, "edit", a);
756
+ let a = { ops: N(e.view, n) };
757
+ z(e.undo, a), e.redo = [], R(), e.view = r, ne(e, n, "edit", a);
766
758
  }
767
759
  function ne(e, t, n, r) {
768
760
  let i = { dropped: !1 }, a = 0;
@@ -784,23 +776,23 @@ function Le(t) {
784
776
  let t = e.pending.find((e) => !e.sent);
785
777
  t ? (t.sent = !0, e.inFlight = t, re(e, t, 0)) : J(e);
786
778
  }
787
- function re(e, t, r) {
788
- n.submit(e.templateId, {
789
- batchId: t.batchId,
779
+ function re(e, n, r) {
780
+ t.submit(e.templateId, {
781
+ batchId: n.batchId,
790
782
  baseRevision: e.revision,
791
- ops: t.ops,
792
- ...t.origin === "ai" ? { origin: "ai" } : {}
793
- }).then(({ revision: n }) => {
794
- e.inFlight = null, ie(e, t, n), K(e);
795
- }, (n) => {
796
- if (je(n) !== null) e.inFlight = null, se(e, t, n), K(e);
797
- else if (Ne(n)) {
798
- ce(e, n);
783
+ ops: n.ops,
784
+ ...n.origin === "ai" ? { origin: "ai" } : {}
785
+ }).then(({ revision: t }) => {
786
+ e.inFlight = null, ie(e, n, t), K(e);
787
+ }, (t) => {
788
+ if (je(t) !== null) e.inFlight = null, se(e, n, t), K(e);
789
+ else if (Ne(t)) {
790
+ ce(e, t);
799
791
  let i = Oe[Math.min(r, Oe.length - 1)];
800
792
  setTimeout(() => {
801
- C || re(e, t, r + 1);
793
+ C || re(e, n, r + 1);
802
794
  }, i);
803
- } else e.inFlight = null, P(n), se(e, t, n), K(e);
795
+ } else e.inFlight = null, F(t), se(e, n, t), K(e);
804
796
  });
805
797
  }
806
798
  function ie(e, t, n) {
@@ -815,7 +807,7 @@ function Le(t) {
815
807
  let e = n.indexOf(t.entry);
816
808
  e !== -1 && n.splice(e, 1);
817
809
  }
818
- L();
810
+ R();
819
811
  }
820
812
  }
821
813
  function oe(e, t) {
@@ -827,17 +819,17 @@ function Le(t) {
827
819
  let r = je(n) ?? "invalid_operation";
828
820
  if (t.origin === "edit" || t.origin === "ai") {
829
821
  let t = Me(n);
830
- F({
822
+ I({
831
823
  type: "editRefused",
832
824
  code: r,
833
825
  ...t ? { holder: t } : {}
834
826
  }, e);
835
- } else F({
827
+ } else I({
836
828
  type: "undoSkipped",
837
829
  code: r
838
830
  }, e);
839
831
  }
840
- Y(e), e === m && X();
832
+ Y(e), e === g && X();
841
833
  }
842
834
  function J(e) {
843
835
  if (!(e.pending.length > 0 || e.waiters.length === 0)) for (let t of e.waiters.splice(0)) t.resolve();
@@ -851,53 +843,53 @@ function Le(t) {
851
843
  let n = e.pending.find((e) => e.batchId === t.batchId);
852
844
  n ? ie(e, n, t.revision) : (e.remote.set(t.revision, t), de(e));
853
845
  }
854
- function ue(e, n) {
846
+ function ue(t, n) {
855
847
  let r = n.ops;
856
- if (t.normalizeRemoteOperations) try {
857
- r = t.normalizeRemoteOperations(n.ops, e.confirmed);
848
+ if (e.normalizeRemoteOperations) try {
849
+ r = e.normalizeRemoteOperations(n.ops, t.confirmed);
858
850
  } catch (e) {
859
- P(e);
851
+ F(e);
860
852
  }
861
853
  return Ie(r);
862
854
  }
863
- function de(e) {
855
+ function de(t) {
864
856
  let n = [], r = !1;
865
857
  for (;;) {
866
- let t = e.revision + 1, i = e.remote.get(t), a = e.own.get(t);
858
+ let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
867
859
  if (!i && !a) break;
868
860
  try {
869
- e.confirmed = U(e.confirmed, i ? ue(e, i) : a.ops);
861
+ t.confirmed = V(t.confirmed, i ? ue(t, i) : a.ops);
870
862
  } catch {
871
- if (e.recovering) {
872
- e.remote.clear(), e.own.clear(), P(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
863
+ if (t.recovering) {
864
+ t.remote.clear(), t.own.clear(), F(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
873
865
  return;
874
866
  }
875
- me(e);
867
+ me(t);
876
868
  return;
877
869
  }
878
- e.revision = t, i ? (e.remote.delete(t), n.push(i)) : (e.own.delete(t), a.group.dropped && (r = !0), q(e, a));
870
+ t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), q(t, a));
879
871
  }
880
- if (e === m && (d.value = e.revision), e.remote.size > 0 || e.own.size > 0 ? fe(e) : pe(e), (n.length !== 0 || r) && (Y(e), e === m)) for (let e of n) try {
881
- t.onRemoteChange?.({
882
- actor: e.actor,
883
- ops: e.ops
872
+ if (t === g && (d.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? fe(t) : pe(t), (n.length !== 0 || r) && (Y(t), t === g)) for (let t of n) try {
873
+ e.onRemoteChange?.({
874
+ actor: t.actor,
875
+ ops: t.ops
884
876
  });
885
877
  } catch (e) {
886
- P(e);
878
+ F(e);
887
879
  }
888
880
  }
889
881
  function Y(e) {
890
- e === m && G();
882
+ e === g && G();
891
883
  let t = e.confirmed;
892
884
  for (let n = 0; n < e.pending.length; n++) {
893
885
  let r = e.pending[n];
894
886
  try {
895
- t = U(t, r.ops);
887
+ t = V(t, r.ops);
896
888
  } catch (i) {
897
889
  if (r.sent) continue;
898
890
  if (oe(e, r)) {
899
- let t = i instanceof z ? i.code : "invalid_operation";
900
- F(r.origin === "edit" || r.origin === "ai" ? {
891
+ let t = i instanceof w ? i.code : "invalid_operation";
892
+ I(r.origin === "edit" || r.origin === "ai" ? {
901
893
  type: "editRefused",
902
894
  code: t
903
895
  } : {
@@ -908,64 +900,64 @@ function Le(t) {
908
900
  t = e.confirmed, n = -1;
909
901
  }
910
902
  }
911
- e.view = t, J(e), e === m && B(t);
903
+ e.view = t, J(e), e === g && B(t);
912
904
  }
913
905
  function fe(e) {
914
906
  e.gapTimer ||= setTimeout(() => {
915
- e.gapTimer = null, e === m && X();
907
+ e.gapTimer = null, e === g && X();
916
908
  }, Ee);
917
909
  }
918
910
  function pe(e) {
919
911
  e.gapTimer &&= (clearTimeout(e.gapTimer), null);
920
912
  }
921
913
  function X() {
922
- let e = m;
914
+ let e = g;
923
915
  return e ? (e.catchingUp ||= (async () => {
924
916
  try {
925
- let t = await n.operationsAfter(e.templateId, e.revision);
917
+ let n = await t.operationsAfter(e.templateId, e.revision);
926
918
  if (e.retired) return;
927
- if ("resync" in t) {
919
+ if ("resync" in n) {
928
920
  await me(e);
929
921
  return;
930
922
  }
931
- for (let n of t.batches) le(e, n);
923
+ for (let t of n.batches) le(e, t);
932
924
  } catch (e) {
933
- P(e);
925
+ F(e);
934
926
  } finally {
935
927
  e.catchingUp = null;
936
928
  }
937
929
  })(), e.catchingUp) : Promise.resolve();
938
930
  }
939
- async function me(e) {
940
- e.recovering = !0;
931
+ async function me(t) {
932
+ t.recovering = !0;
941
933
  try {
942
- let n = await t.loadTemplate(e.templateId);
943
- if (e.retired) return;
944
- let r = n.revision ?? e.revision;
945
- e.confirmed = T(n.content), e.revision = r, e.remote = new Map([...e.remote].filter(([e]) => e > r));
946
- for (let [t, n] of [...e.own]) t <= r && (e.own.delete(t), q(e, n));
947
- e === m && (d.value = r), Y(e), de(e);
934
+ let n = await e.loadTemplate(t.templateId);
935
+ if (t.retired) return;
936
+ let r = n.revision ?? t.revision;
937
+ t.confirmed = j(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
938
+ for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), q(t, n));
939
+ t === g && (d.value = r), Y(t), de(t);
948
940
  } catch (e) {
949
- P(e);
941
+ F(e);
950
942
  } finally {
951
- e.recovering = !1;
943
+ t.recovering = !1;
952
944
  }
953
945
  }
954
- function he(e) {
955
- let n = () => e === m && !e.retired;
946
+ function he(t) {
947
+ let n = () => t === g && !t.retired;
956
948
  return {
957
- onBatch: (t) => {
958
- n() && le(e, t);
949
+ onBatch: (e) => {
950
+ n() && le(t, e);
959
951
  },
960
952
  onResync: (r, i) => {
961
- if (!(!n() || r <= e.revision)) {
953
+ if (!(!n() || r <= t.revision)) {
962
954
  if (i) try {
963
- t.onRemoteResync?.({
955
+ e.onRemoteResync?.({
964
956
  revision: r,
965
957
  actor: i
966
958
  });
967
959
  } catch (e) {
968
- P(e);
960
+ F(e);
969
961
  }
970
962
  X();
971
963
  }
@@ -979,23 +971,23 @@ function Le(t) {
979
971
  onMembers: (e) => {
980
972
  n() && Ce(e);
981
973
  },
982
- onConnectionChange: (t) => {
983
- n() && ye(e, t);
974
+ onConnectionChange: (e) => {
975
+ n() && ye(t, e);
984
976
  }
985
977
  };
986
978
  }
987
- function ge(e, t) {
988
- n.join(e.templateId, { sessionId: i }, he(e)).then((n) => {
989
- e.retired || e !== m ? t || n.leave() : (e.leave = n.leave, Se(n.locks, !t), Ce(n.members), n.members.length > 0 && (u.value = "connected"), n.revision > e.revision && X(), t && Q());
990
- }, (e) => P(e));
979
+ function ge(e, r) {
980
+ t.join(e.templateId, { sessionId: n }, he(e)).then((t) => {
981
+ e.retired || e !== g ? r || t.leave() : (e.leave = t.leave, Se(t.locks, !r), Ce(t.members), t.members.length > 0 && (u.value = "connected"), t.revision > e.revision && X(), r && Q());
982
+ }, (e) => F(e));
991
983
  }
992
984
  function _e(e) {
993
- let t = T(e.content), n = {
985
+ let t = j(e.content), n = {
994
986
  templateId: e.id,
995
987
  confirmed: t,
996
988
  revision: e.revision ?? 0,
997
989
  pending: [],
998
- view: T(t),
990
+ view: j(t),
999
991
  remote: /* @__PURE__ */ new Map(),
1000
992
  own: /* @__PURE__ */ new Map(),
1001
993
  inFlight: null,
@@ -1008,7 +1000,7 @@ function Le(t) {
1008
1000
  redo: [],
1009
1001
  waiters: []
1010
1002
  };
1011
- m = n, d.value = n.revision, L(), ge(n, !1), p?.state.selectedBlockId && Be(p.state.selectedBlockId), V();
1003
+ g = n, d.value = n.revision, R(), ge(n, !1), h?.state.selectedBlockId && Be(h.state.selectedBlockId), H();
1012
1004
  }
1013
1005
  function ve(e) {
1014
1006
  e.retired = !0, pe(e), e.leave?.(), e.leave = null, ce(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
@@ -1018,12 +1010,12 @@ function Le(t) {
1018
1010
  u.value = t, t === "connected" && n !== null && n !== "connected" && ge(e, !0);
1019
1011
  }
1020
1012
  function be(e) {
1021
- m && m.templateId === e?.id || (m &&= (H(), ve(m), null), c.value = [], l.value = /* @__PURE__ */ new Map(), u.value = null, E = null, Q(), L(), e && _e(e));
1013
+ g && g.templateId === e?.id || (g &&= (U(), ve(g), null), s.value = [], l.value = /* @__PURE__ */ new Map(), u.value = null, D = null, Q(), R(), e && _e(e));
1022
1014
  }
1023
1015
  function xe(e) {
1024
- if (e.holder.sessionId === i) return;
1016
+ if (e.holder.sessionId === n) return;
1025
1017
  let t = new Map([...l.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
1026
- t.set(e.blockId, e), l.value = t, p?.state.selectedBlockId === e.blockId && (p.selectBlock(null), F({
1018
+ t.set(e.blockId, e), l.value = t, h?.state.selectedBlockId === e.blockId && (h.selectBlock(null), I({
1027
1019
  type: "selectionRefused",
1028
1020
  blockId: e.blockId,
1029
1021
  holder: e.holder
@@ -1035,35 +1027,35 @@ function Le(t) {
1035
1027
  n.delete(e), l.value = n;
1036
1028
  }
1037
1029
  function Se(e, t) {
1038
- let n = t ? new Map(l.value) : /* @__PURE__ */ new Map();
1039
- for (let r of e) r.holder.sessionId !== i && (t && n.has(r.blockId) || n.set(r.blockId, r));
1040
- l.value = n;
1030
+ let r = t ? new Map(l.value) : /* @__PURE__ */ new Map();
1031
+ for (let i of e) i.holder.sessionId !== n && (t && r.has(i.blockId) || r.set(i.blockId, i));
1032
+ l.value = r;
1041
1033
  }
1042
1034
  function Ce(e) {
1043
- let t = new Set(e.map((e) => e.sessionId)), n = new Set(c.value.map((e) => e.sessionId).filter((e) => !t.has(e)));
1044
- if (c.value = e, n.size === 0) return;
1035
+ let t = new Set(e.map((e) => e.sessionId)), n = new Set(s.value.map((e) => e.sessionId).filter((e) => !t.has(e)));
1036
+ if (s.value = e, n.size === 0) return;
1045
1037
  let r = new Map([...l.value].filter(([, e]) => !n.has(e.holder.sessionId)));
1046
1038
  r.size !== l.value.size && (l.value = r);
1047
1039
  }
1048
1040
  function we(e) {
1049
- k = k.then(e).catch(P);
1041
+ k = k.then(e).catch(F);
1050
1042
  }
1051
1043
  function Q() {
1052
1044
  o && we(async () => {
1053
- if (O && (E === null || O.templateId !== E.templateId)) {
1045
+ if (O && (D === null || O.templateId !== D.templateId)) {
1054
1046
  let e = O;
1055
- O = null, $(), await n.releaseLock(e.templateId, e.blockId);
1047
+ O = null, $(), await t.releaseLock(e.templateId, e.blockId);
1056
1048
  }
1057
- let e = E;
1049
+ let e = D;
1058
1050
  if (!(!e || O?.templateId === e.templateId && O.blockId === e.blockId)) try {
1059
- await n.acquireLock(e.templateId, e.blockId), O = e, ze(), Le(e.blockId);
1060
- } catch (t) {
1051
+ await t.acquireLock(e.templateId, e.blockId), O = e, ze(), Le(e.blockId);
1052
+ } catch (n) {
1061
1053
  if (O?.templateId === e.templateId) {
1062
1054
  let e = O;
1063
- O = null, $(), await n.releaseLock(e.templateId, e.blockId).catch(() => {});
1055
+ O = null, $(), await t.releaseLock(e.templateId, e.blockId).catch(() => {});
1064
1056
  }
1065
- if (E !== e) return;
1066
- Re(e.blockId, t);
1057
+ if (D !== e) return;
1058
+ Re(e.blockId, n);
1067
1059
  }
1068
1060
  });
1069
1061
  }
@@ -1075,15 +1067,15 @@ function Le(t) {
1075
1067
  function Re(e, t) {
1076
1068
  let n = je(t);
1077
1069
  if (n === "lock_held" || n === "block_missing") {
1078
- E = null;
1070
+ D = null;
1079
1071
  let n = Me(t);
1080
1072
  n ? xe({
1081
1073
  blockId: e,
1082
1074
  holder: n,
1083
1075
  expiresAt: ""
1084
- }) : p?.state.selectedBlockId === e && p.selectBlock(null);
1085
- } else P(t), setTimeout(() => {
1086
- E?.blockId === e && Q();
1076
+ }) : h?.state.selectedBlockId === e && h.selectBlock(null);
1077
+ } else F(t), setTimeout(() => {
1078
+ D?.blockId === e && Q();
1087
1079
  }, Oe[0]);
1088
1080
  }
1089
1081
  function ze() {
@@ -1091,13 +1083,13 @@ function Le(t) {
1091
1083
  we(async () => {
1092
1084
  let e = O;
1093
1085
  if (e) try {
1094
- await n.renewLock(e.templateId, e.blockId);
1086
+ await t.renewLock(e.templateId, e.blockId);
1095
1087
  } catch (e) {
1096
1088
  if (je(e) === "lock_lost") {
1097
1089
  O = null, $(), Q();
1098
1090
  return;
1099
1091
  }
1100
- P(e);
1092
+ F(e);
1101
1093
  }
1102
1094
  });
1103
1095
  }, De);
@@ -1106,47 +1098,47 @@ function Le(t) {
1106
1098
  A &&= (clearInterval(A), null);
1107
1099
  }
1108
1100
  function Be(e) {
1109
- G(), m && (E = e ? {
1110
- templateId: m.templateId,
1101
+ G(), g && (D = e ? {
1102
+ templateId: g.templateId,
1111
1103
  blockId: e
1112
1104
  } : null, Q());
1113
1105
  }
1114
1106
  function Ve() {
1115
- G(), O && o && (n.releaseLock(O.templateId, O.blockId).catch(() => {}), O = null, $()), m?.leave?.(), m && (m.leave = null);
1107
+ G(), O && o && (t.releaseLock(O.templateId, O.blockId).catch(() => {}), O = null, $()), g?.leave?.(), g && (g.leave = null);
1116
1108
  }
1117
1109
  function He(e) {
1118
- let t = m;
1119
- if (!t || h) return;
1110
+ let t = g;
1111
+ if (!t || v) return;
1120
1112
  G();
1121
1113
  let n = (e === "undo" ? t.undo : t.redo).pop();
1122
1114
  if (!n) return;
1123
- L();
1115
+ R();
1124
1116
  let r;
1125
1117
  try {
1126
- r = U(t.view, n.ops, I());
1118
+ r = V(t.view, n.ops, L());
1127
1119
  } catch (e) {
1128
- if (!(e instanceof z)) throw e;
1129
- F({
1120
+ if (!(e instanceof w)) throw e;
1121
+ I({
1130
1122
  type: "undoSkipped",
1131
1123
  code: e.code
1132
1124
  });
1133
1125
  return;
1134
1126
  }
1135
- let i = { ops: j(t.view, n.ops) };
1136
- R(e === "undo" ? t.redo : t.undo, i), t.view = r, B(r), p?.markDirty(), ne(t, n.ops, e, i);
1127
+ let i = { ops: N(t.view, n.ops) };
1128
+ z(e === "undo" ? t.redo : t.undo, i), t.view = r, B(r), h?.markDirty(), ne(t, n.ops, e, i);
1137
1129
  }
1138
1130
  function Ue(e, t) {
1139
- let n = m;
1140
- if (!p || !n || h) return {
1131
+ let n = g;
1132
+ if (!h || !n || v) return {
1141
1133
  applied: !1,
1142
- error: new z("invalid_operation", 0, "No template is open for editing.")
1134
+ error: new w("invalid_operation", 0, "No template is open for editing.")
1143
1135
  };
1144
1136
  G();
1145
1137
  let r, i;
1146
1138
  try {
1147
- r = U(n.view, e, I()), i = j(n.view, e);
1139
+ r = V(n.view, e, L()), i = N(n.view, e);
1148
1140
  } catch (e) {
1149
- if (e instanceof z) return {
1141
+ if (e instanceof w) return {
1150
1142
  applied: !1,
1151
1143
  error: e
1152
1144
  };
@@ -1156,149 +1148,147 @@ function Le(t) {
1156
1148
  return a && a.turn === t.turn ? (a.ops = [...i, ...a.ops], o = a) : (o = {
1157
1149
  ops: i,
1158
1150
  turn: t.turn
1159
- }, R(n.undo, o)), n.redo = [], L(), n.view = r, B(r), p.markDirty(), ne(n, e, t.origin, o), {
1151
+ }, z(n.undo, o)), n.redo = [], R(), n.view = r, B(r), h.markDirty(), ne(n, e, t.origin, o), {
1160
1152
  applied: !0,
1161
1153
  inverse: i
1162
1154
  };
1163
1155
  }
1164
1156
  function We(e) {
1165
- p = e, w.push(v(() => e.state.template, (e) => be(e), { immediate: !0 }), v(() => e.content.value, V, { deep: !0 }), v(() => e.state.selectedBlockId, Be), v(() => e.state.isLoading, (e) => e ? W(!0, !0) : V())), typeof window < "u" && (window.addEventListener("pagehide", Ve), window.addEventListener("blur", G)), _() && s(Je);
1157
+ h = e, E.push(f(() => e.state.template, (e) => be(e), { immediate: !0 }), f(() => e.content.value, H, { deep: !0 }), f(() => e.state.selectedBlockId, Be), f(() => e.state.isLoading, (e) => e ? W(!0, !0) : H())), typeof window < "u" && (window.addEventListener("pagehide", Ve), window.addEventListener("blur", G)), r() && c(Je);
1166
1158
  }
1167
1159
  function Ge() {
1168
1160
  G();
1169
- let e = m;
1161
+ let e = g;
1170
1162
  return !e || e.pending.length === 0 ? Promise.resolve() : new Promise((t, n) => e.waiters.push({
1171
1163
  resolve: t,
1172
1164
  reject: n
1173
1165
  }));
1174
1166
  }
1175
1167
  function Ke() {
1176
- G(), h = !0;
1168
+ G(), v = !0;
1177
1169
  }
1178
1170
  function qe() {
1179
- h = !1, m && B(m.view);
1171
+ v = !1, g && B(g.view);
1180
1172
  }
1181
1173
  function Je() {
1182
1174
  if (!C) {
1183
1175
  G();
1184
- for (let e of w.splice(0)) e();
1185
- H(), Ve(), C = !0, m && ve(m), m = null, $(), typeof window < "u" && (window.removeEventListener("pagehide", Ve), window.removeEventListener("blur", G));
1176
+ for (let e of E.splice(0)) e();
1177
+ U(), Ve(), C = !0, g && ve(g), g = null, $(), typeof window < "u" && (window.removeEventListener("pagehide", Ve), window.removeEventListener("blur", G));
1186
1178
  }
1187
1179
  }
1188
1180
  return {
1189
- sessionId: i,
1190
- members: c,
1181
+ sessionId: n,
1182
+ members: s,
1191
1183
  locks: l,
1192
1184
  connection: u,
1193
1185
  revision: d,
1194
1186
  canUndo: M,
1195
- canRedo: N,
1187
+ canRedo: ee,
1196
1188
  attach: We,
1197
1189
  undo: () => He("undo"),
1198
1190
  redo: () => He("redo"),
1199
1191
  clearHistory: () => {
1200
- m && (m.undo = [], m.redo = [], L());
1192
+ g && (g.undo = [], g.redo = [], R());
1201
1193
  },
1202
1194
  flush: G,
1203
1195
  settle: Ge,
1204
1196
  suspend: Ke,
1205
1197
  resume: qe,
1206
1198
  catchUp: X,
1207
- hasConfirmedBlock: (e) => m ? Pe(m.confirmed.blocks, e) : !1,
1199
+ hasConfirmedBlock: (e) => g ? Pe(g.confirmed.blocks, e) : !1,
1208
1200
  applyOperations: Ue,
1209
1201
  destroy: Je
1210
1202
  };
1211
1203
  }
1212
- //#endregion
1213
- //#region ../core/src/saved-blocks.ts
1214
- function Re(t) {
1215
- let { provider: n } = t, r = e([]), i = e(!1), a = g(() => {
1204
+ // ../core/src/saved-blocks.ts
1205
+ function Re(e) {
1206
+ let { provider: t } = e, n = m([]), r = m(!1), i = v(() => {
1216
1207
  let e = /* @__PURE__ */ new Set();
1217
- for (let t of r.value) {
1208
+ for (let t of n.value) {
1218
1209
  let n = t.category?.trim();
1219
1210
  n && e.add(n);
1220
1211
  }
1221
1212
  return [...e].sort((e, t) => e.localeCompare(t));
1222
- }), o = g(() => typeof n.create == "function"), s = g(() => typeof n.update == "function"), c = g(() => typeof n.delete == "function");
1223
- function l(e) {
1224
- return s.value && e.canUpdate !== !1;
1213
+ }), a = v(() => typeof t.create == "function"), o = v(() => typeof t.update == "function"), s = v(() => typeof t.delete == "function");
1214
+ function c(e) {
1215
+ return o.value && e.canUpdate !== !1;
1225
1216
  }
1226
- function u(e) {
1227
- return c.value && e.canDelete !== !1;
1217
+ function l(e) {
1218
+ return s.value && e.canDelete !== !1;
1228
1219
  }
1229
- function d(e, t) {
1230
- throw new M(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1220
+ function u(e, t) {
1221
+ throw new H(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1231
1222
  }
1232
- function f(e) {
1233
- J(t.onError, e);
1223
+ function d(t) {
1224
+ J(e.onError, t);
1234
1225
  }
1235
- async function p(e) {
1236
- i.value = !0;
1226
+ async function f(i) {
1227
+ r.value = !0;
1237
1228
  try {
1238
- r.value = await n.list(e);
1239
- } catch (e) {
1240
- throw t.onError?.(e), e;
1229
+ n.value = await t.list(i);
1230
+ } catch (t) {
1231
+ throw e.onError?.(t), t;
1241
1232
  } finally {
1242
- i.value = !1;
1233
+ r.value = !1;
1243
1234
  }
1244
1235
  }
1245
- async function m(e, i, a) {
1246
- let { create: o } = n;
1247
- typeof o != "function" && d("create", "disabled by the provider");
1236
+ async function p(r, i, a) {
1237
+ let { create: o } = t;
1238
+ typeof o != "function" && u("create", "disabled by the provider");
1248
1239
  try {
1249
- let t = await o(a ? {
1250
- name: e,
1240
+ let e = await o(a ? {
1241
+ name: r,
1251
1242
  content: i,
1252
1243
  category: a
1253
1244
  } : {
1254
- name: e,
1245
+ name: r,
1255
1246
  content: i
1256
1247
  });
1257
- return r.value = [t, ...r.value], f(() => n.onCreated?.(t)), t;
1258
- } catch (e) {
1259
- throw t.onError?.(e), e;
1248
+ return n.value = [e, ...n.value], d(() => t.onCreated?.(e)), e;
1249
+ } catch (t) {
1250
+ throw e.onError?.(t), t;
1260
1251
  }
1261
1252
  }
1262
- async function h(e, i) {
1263
- let { update: a } = n;
1264
- typeof a != "function" && d("update", "disabled by the provider");
1265
- let o = r.value.find((t) => t.id === e);
1266
- o && o.canUpdate === !1 && d("update", `not permitted for entry "${e}"`);
1253
+ async function h(r, i) {
1254
+ let { update: a } = t;
1255
+ typeof a != "function" && u("update", "disabled by the provider");
1256
+ let o = n.value.find((e) => e.id === r);
1257
+ o && o.canUpdate === !1 && u("update", `not permitted for entry "${r}"`);
1267
1258
  try {
1268
- let t = await a(e, i);
1269
- return r.value = r.value.map((n) => n.id === e ? t : n), f(() => n.onUpdated?.(t)), t;
1270
- } catch (e) {
1271
- throw t.onError?.(e), e;
1259
+ let e = await a(r, i);
1260
+ return n.value = n.value.map((t) => t.id === r ? e : t), d(() => t.onUpdated?.(e)), e;
1261
+ } catch (t) {
1262
+ throw e.onError?.(t), t;
1272
1263
  }
1273
1264
  }
1274
- async function _(e) {
1275
- let { delete: i } = n;
1276
- typeof i != "function" && d("delete", "disabled by the provider");
1277
- let a = r.value.find((t) => t.id === e) ?? null;
1278
- a && a.canDelete === !1 && d("delete", `not permitted for entry "${e}"`);
1265
+ async function g(r) {
1266
+ let { delete: i } = t;
1267
+ typeof i != "function" && u("delete", "disabled by the provider");
1268
+ let a = n.value.find((e) => e.id === r) ?? null;
1269
+ a && a.canDelete === !1 && u("delete", `not permitted for entry "${r}"`);
1279
1270
  try {
1280
- await i(e), r.value = r.value.filter((t) => t.id !== e), a && f(() => n.onDeleted?.(a));
1281
- } catch (e) {
1282
- throw t.onError?.(e), e;
1271
+ await i(r), n.value = n.value.filter((e) => e.id !== r), a && d(() => t.onDeleted?.(a));
1272
+ } catch (t) {
1273
+ throw e.onError?.(t), t;
1283
1274
  }
1284
1275
  }
1285
1276
  return {
1286
- savedBlocks: r,
1287
- isLoading: i,
1288
- categories: a,
1289
- canCreate: o,
1290
- canUpdate: s,
1291
- canDelete: c,
1292
- canUpdateBlock: l,
1293
- canDeleteBlock: u,
1294
- load: p,
1295
- create: m,
1277
+ savedBlocks: n,
1278
+ isLoading: r,
1279
+ categories: i,
1280
+ canCreate: a,
1281
+ canUpdate: o,
1282
+ canDelete: s,
1283
+ canUpdateBlock: c,
1284
+ canDeleteBlock: l,
1285
+ load: f,
1286
+ create: p,
1296
1287
  update: h,
1297
- remove: _
1288
+ remove: g
1298
1289
  };
1299
1290
  }
1300
- //#endregion
1301
- //#region ../core/src/saved-blocks-local.ts
1291
+ // ../core/src/saved-blocks-local.ts
1302
1292
  var ze = "templatical:saved-blocks";
1303
1293
  function $(e = {}) {
1304
1294
  let t = e.key ?? ze;
@@ -1326,7 +1316,7 @@ function $(e = {}) {
1326
1316
  },
1327
1317
  async create(e) {
1328
1318
  let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
1329
- id: I(),
1319
+ id: ee(),
1330
1320
  name: e.name,
1331
1321
  content: e.content,
1332
1322
  ...e.category ? { category: e.category } : {},
@@ -1352,8 +1342,7 @@ function $(e = {}) {
1352
1342
  }
1353
1343
  };
1354
1344
  }
1355
- //#endregion
1356
- //#region ../core/src/media-local.ts
1345
+ // ../core/src/media-local.ts
1357
1346
  var Be = "templatical:media", Ve = 50;
1358
1347
  function He(e = {}) {
1359
1348
  let t = e.key ?? Be;
@@ -1394,7 +1383,7 @@ function He(e = {}) {
1394
1383
  },
1395
1384
  async create(e) {
1396
1385
  let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
1397
- id: I(),
1386
+ id: ee(),
1398
1387
  url: t,
1399
1388
  filename: e.filename || e.file.name,
1400
1389
  createdAt: n,
@@ -1429,124 +1418,122 @@ function He(e = {}) {
1429
1418
  storage: !1
1430
1419
  };
1431
1420
  }
1432
- //#endregion
1433
- //#region ../core/src/version-history.ts
1434
- function Ue(t) {
1435
- let { provider: n, getTemplateId: r } = t, i = e([]), a = e(!1), o = e(void 0), s = e(!1), c = /* @__PURE__ */ new Map(), l = g(() => typeof n.create == "function"), u = g(() => typeof n.restore == "function");
1436
- function d(e) {
1437
- let t = r();
1438
- if (!t) throw new M(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
1421
+ // ../core/src/version-history.ts
1422
+ function Ue(e) {
1423
+ let { provider: t, getTemplateId: n } = e, r = m([]), i = m(!1), a = m(void 0), o = m(!1), s = /* @__PURE__ */ new Map(), c = v(() => typeof t.create == "function"), l = v(() => typeof t.restore == "function");
1424
+ function u(e) {
1425
+ let t = n();
1426
+ if (!t) throw new H(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
1439
1427
  return t;
1440
1428
  }
1441
- function f(e) {
1442
- throw new M(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
1429
+ function d(e) {
1430
+ throw new H(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
1443
1431
  }
1444
- function p(e) {
1445
- J(t.onError, e);
1432
+ function f(t) {
1433
+ J(e.onError, t);
1446
1434
  }
1447
- async function m(e) {
1448
- let r = d("list");
1449
- a.value = !0;
1435
+ async function p(n) {
1436
+ let o = u("list");
1437
+ i.value = !0;
1450
1438
  try {
1451
- let t = await n.list(r, e);
1452
- i.value = t.versions, o.value = t.nextCursor;
1453
- } catch (e) {
1454
- throw t.onError?.(e), e;
1439
+ let e = await t.list(o, n);
1440
+ r.value = e.versions, a.value = e.nextCursor;
1441
+ } catch (t) {
1442
+ throw e.onError?.(t), t;
1455
1443
  } finally {
1456
- a.value = !1;
1444
+ i.value = !1;
1457
1445
  }
1458
1446
  }
1459
1447
  function h(e) {
1460
- return e.content ?? c.get(e.id) ?? null;
1448
+ return e.content ?? s.get(e.id) ?? null;
1461
1449
  }
1462
- async function _(e) {
1463
- let r = h(e);
1450
+ async function g(n) {
1451
+ let r = h(n);
1464
1452
  if (r) return r;
1465
- let i = d("get");
1453
+ let i = u("get");
1466
1454
  try {
1467
- let t = await n.get(i, e.id);
1468
- return c.set(e.id, t), t;
1469
- } catch (e) {
1470
- throw t.onError?.(e), e;
1455
+ let e = await t.get(i, n.id);
1456
+ return s.set(n.id, e), e;
1457
+ } catch (t) {
1458
+ throw e.onError?.(t), t;
1471
1459
  }
1472
1460
  }
1473
- async function v(e, r) {
1474
- let { create: a } = n;
1475
- typeof a != "function" && f("create");
1476
- let o = d("create");
1461
+ async function _(n, i) {
1462
+ let { create: a } = t;
1463
+ typeof a != "function" && d("create");
1464
+ let o = u("create");
1477
1465
  try {
1478
- let t = await a(o, e, r);
1479
- return i.value = [t, ...i.value], p(() => n.onCreated?.(t)), t;
1480
- } catch (e) {
1481
- throw t.onError?.(e), e;
1466
+ let e = await a(o, n, i);
1467
+ return r.value = [e, ...r.value], f(() => t.onCreated?.(e)), e;
1468
+ } catch (t) {
1469
+ throw e.onError?.(t), t;
1482
1470
  }
1483
1471
  }
1484
- async function y(e) {
1485
- let { restore: r } = n;
1486
- typeof r != "function" && f("restore");
1487
- let i = d("restore"), a;
1488
- s.value = !0;
1472
+ async function y(n) {
1473
+ let { restore: r } = t;
1474
+ typeof r != "function" && d("restore");
1475
+ let i = u("restore"), a;
1476
+ o.value = !0;
1489
1477
  try {
1490
- a = await r(i, e);
1491
- } catch (e) {
1492
- throw t.onError?.(e), e;
1478
+ a = await r(i, n);
1479
+ } catch (t) {
1480
+ throw e.onError?.(t), t;
1493
1481
  } finally {
1494
- s.value = !1;
1482
+ o.value = !1;
1495
1483
  }
1496
- return p(() => n.onRestored?.(a)), a;
1484
+ return f(() => t.onRestored?.(a)), a;
1497
1485
  }
1498
1486
  return {
1499
- nextCursor: o,
1500
- versions: i,
1501
- isLoading: a,
1502
- isRestoring: s,
1503
- canCreate: l,
1504
- canRestore: u,
1505
- load: m,
1487
+ nextCursor: a,
1488
+ versions: r,
1489
+ isLoading: i,
1490
+ isRestoring: o,
1491
+ canCreate: c,
1492
+ canRestore: l,
1493
+ load: p,
1506
1494
  peekContent: h,
1507
- resolveContent: _,
1508
- create: v,
1495
+ resolveContent: g,
1496
+ create: _,
1509
1497
  restore: y
1510
1498
  };
1511
1499
  }
1512
- //#endregion
1513
- //#region ../core/src/comments.ts
1514
- function We(t) {
1515
- let { provider: n, getTemplateId: r, getUser: i } = t, a = e([]), o = e(!1), s = e(!1), c = g(() => typeof n.create == "function"), l = g(() => typeof n.update == "function"), u = g(() => typeof n.delete == "function"), d = g(() => typeof n.setResolved == "function"), f = g(() => a.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), p = g(() => a.value.filter((e) => !e.resolvedAt).length), m = g(() => {
1500
+ // ../core/src/comments.ts
1501
+ function We(e) {
1502
+ let { provider: t, getTemplateId: n, getUser: r } = e, i = m([]), a = m(!1), o = m(!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(() => {
1516
1503
  let e = /* @__PURE__ */ new Map();
1517
- for (let t of a.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
1504
+ for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
1518
1505
  return e;
1519
1506
  });
1520
1507
  function h(e) {
1521
- let t = r();
1522
- if (!t) throw new M(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
1508
+ let t = n();
1509
+ if (!t) throw new H(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
1523
1510
  return t;
1524
1511
  }
1525
- function _(e) {
1526
- let t = i();
1527
- if (!t) throw new M(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
1512
+ function g(e) {
1513
+ let t = r();
1514
+ if (!t) throw new H(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
1528
1515
  return t;
1529
1516
  }
1530
- function v(e) {
1531
- throw new M(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
1517
+ function _(e) {
1518
+ throw new H(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
1532
1519
  }
1533
1520
  function y(e) {
1534
- for (let t of a.value) {
1521
+ for (let t of i.value) {
1535
1522
  if (t.id === e) return t;
1536
1523
  for (let n of t.replies ?? []) if (n.id === e) return n;
1537
1524
  }
1538
1525
  return null;
1539
1526
  }
1540
1527
  function b(e) {
1541
- let t = i();
1528
+ let t = r();
1542
1529
  return t !== null && e.author.id === t.id;
1543
1530
  }
1544
- function x(e) {
1545
- let n = se(e);
1546
- throw t.onError?.(n), n;
1531
+ function x(t) {
1532
+ let n = se(t);
1533
+ throw e.onError?.(n), n;
1547
1534
  }
1548
- function S(e) {
1549
- J(t.onError, e);
1535
+ function S(t) {
1536
+ J(e.onError, t);
1550
1537
  }
1551
1538
  function C(e, t, n) {
1552
1539
  return [
@@ -1560,7 +1547,7 @@ function We(t) {
1560
1547
  }
1561
1548
  function T(e) {
1562
1549
  if (e.parentId) {
1563
- let t = !1, n = a.value.map((n) => {
1550
+ let t = !1, n = i.value.map((n) => {
1564
1551
  if (n.id !== e.parentId) return n;
1565
1552
  let r = n.replies ?? [], i = r.findIndex((t) => t.id === e.id);
1566
1553
  return i !== -1 && w(r[i], e) ? n : (t = !0, {
@@ -1568,112 +1555,112 @@ function We(t) {
1568
1555
  replies: i === -1 ? [...r, e] : C(r, i, e)
1569
1556
  });
1570
1557
  });
1571
- return t && (a.value = n), t;
1558
+ return t && (i.value = n), t;
1572
1559
  }
1573
- let t = a.value.findIndex((t) => t.id === e.id);
1574
- if (t === -1) return a.value = [...a.value, e], !0;
1560
+ let t = i.value.findIndex((t) => t.id === e.id);
1561
+ if (t === -1) return i.value = [...i.value, e], !0;
1575
1562
  let n = {
1576
1563
  ...e,
1577
- replies: e.replies ?? a.value[t].replies
1564
+ replies: e.replies ?? i.value[t].replies
1578
1565
  };
1579
- return !w(a.value[t], n) && (a.value = C(a.value, t, n), !0);
1566
+ return !w(i.value[t], n) && (i.value = C(i.value, t, n), !0);
1580
1567
  }
1581
1568
  function E(e, t) {
1582
1569
  let n = y(e), r = t ?? n?.parentId ?? null;
1583
- return r ? a.value = a.value.map((t) => t.id === r ? {
1570
+ return r ? i.value = i.value.map((t) => t.id === r ? {
1584
1571
  ...t,
1585
1572
  replies: (t.replies ?? []).filter((t) => t.id !== e)
1586
- } : t) : a.value = a.value.filter((t) => t.id !== e), n;
1573
+ } : t) : i.value = i.value.filter((t) => t.id !== e), n;
1587
1574
  }
1588
1575
  async function D(e) {
1589
- let t = h("list");
1590
- o.value = !0;
1576
+ let n = h("list");
1577
+ a.value = !0;
1591
1578
  try {
1592
- a.value = await n.list(t, e);
1579
+ i.value = await t.list(n, e);
1593
1580
  } catch (e) {
1594
1581
  x(e);
1595
1582
  } finally {
1596
- o.value = !1;
1583
+ a.value = !1;
1597
1584
  }
1598
1585
  }
1599
1586
  async function O(e) {
1600
- let { create: t } = n;
1601
- typeof t != "function" && v("create");
1587
+ let { create: n } = t;
1588
+ typeof n != "function" && _("create");
1602
1589
  let r = h("create");
1603
- _("create"), s.value = !0;
1590
+ g("create"), o.value = !0;
1604
1591
  try {
1605
- let i = await t(r, e);
1606
- return T(i), S(() => n.onCreated?.(i, { origin: "local" })), i;
1592
+ let i = await n(r, e);
1593
+ return T(i), S(() => t.onCreated?.(i, { origin: "local" })), i;
1607
1594
  } catch (e) {
1608
1595
  x(e);
1609
1596
  } finally {
1610
- s.value = !1;
1597
+ o.value = !1;
1611
1598
  }
1612
1599
  }
1613
- async function k(e, t) {
1614
- let { update: r } = n;
1615
- typeof r != "function" && v("update");
1600
+ async function k(e, n) {
1601
+ let { update: r } = t;
1602
+ typeof r != "function" && _("update");
1616
1603
  let i = h("update");
1617
- _("update"), s.value = !0;
1604
+ g("update"), o.value = !0;
1618
1605
  try {
1619
- let a = await r(i, e, t);
1620
- return T(a), S(() => n.onUpdated?.(a, { origin: "local" })), a;
1606
+ let a = await r(i, e, n);
1607
+ return T(a), S(() => t.onUpdated?.(a, { origin: "local" })), a;
1621
1608
  } catch (e) {
1622
1609
  x(e);
1623
1610
  } finally {
1624
- s.value = !1;
1611
+ o.value = !1;
1625
1612
  }
1626
1613
  }
1627
1614
  async function A(e) {
1628
- let { delete: t } = n;
1629
- typeof t != "function" && v("delete");
1615
+ let { delete: n } = t;
1616
+ typeof n != "function" && _("delete");
1630
1617
  let r = h("delete");
1631
- _("delete");
1618
+ g("delete");
1632
1619
  let i = y(e);
1633
- s.value = !0;
1620
+ o.value = !0;
1634
1621
  try {
1635
- await t(r, e), E(e), i && S(() => n.onDeleted?.(i, { origin: "local" }));
1622
+ await n(r, e), E(e), i && S(() => t.onDeleted?.(i, { origin: "local" }));
1636
1623
  } catch (e) {
1637
1624
  x(e);
1638
1625
  } finally {
1639
- s.value = !1;
1626
+ o.value = !1;
1640
1627
  }
1641
1628
  }
1642
- async function j(e, t) {
1643
- let { setResolved: r } = n;
1644
- typeof r != "function" && v("setResolved");
1629
+ async function j(e, n) {
1630
+ let { setResolved: r } = t;
1631
+ typeof r != "function" && _("setResolved");
1645
1632
  let i = h("setResolved");
1646
- _("setResolved"), s.value = !0;
1633
+ g("setResolved"), o.value = !0;
1647
1634
  try {
1648
- let a = await r(i, e, t);
1649
- return T(a), S(() => (a.resolvedAt ? n.onResolved : n.onUnresolved)?.(a, { origin: "local" })), a;
1635
+ let a = await r(i, e, n);
1636
+ return T(a), S(() => (a.resolvedAt ? t.onResolved : t.onUnresolved)?.(a, { origin: "local" })), a;
1650
1637
  } catch (e) {
1651
1638
  x(e);
1652
1639
  } finally {
1653
- s.value = !1;
1640
+ o.value = !1;
1654
1641
  }
1655
1642
  }
1656
- function ee(e) {
1657
- T(e) && S(() => n.onCreated?.(e, { origin: "remote" }));
1643
+ function M(e) {
1644
+ T(e) && S(() => t.onCreated?.(e, { origin: "remote" }));
1658
1645
  }
1659
1646
  function N(e) {
1660
- T(e) && S(() => (e.resolvedAt ? n.onResolved : n.onUpdated)?.(e, { origin: "remote" }));
1647
+ T(e) && S(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
1661
1648
  }
1662
- function P(e, t) {
1663
- let r = E(e, t);
1664
- r && S(() => n.onDeleted?.(r, { origin: "remote" }));
1649
+ function P(e, n) {
1650
+ let r = E(e, n);
1651
+ r && S(() => t.onDeleted?.(r, { origin: "remote" }));
1665
1652
  }
1666
1653
  return {
1667
- comments: a,
1668
- isLoading: o,
1669
- isSubmitting: s,
1670
- canCreate: c,
1671
- canUpdate: l,
1672
- canDelete: u,
1673
- canResolve: d,
1674
- totalCount: f,
1675
- unresolvedCount: p,
1676
- commentCountByBlock: m,
1654
+ comments: i,
1655
+ isLoading: a,
1656
+ isSubmitting: o,
1657
+ canCreate: s,
1658
+ canUpdate: c,
1659
+ canDelete: l,
1660
+ canResolve: u,
1661
+ totalCount: d,
1662
+ unresolvedCount: f,
1663
+ commentCountByBlock: p,
1677
1664
  load: D,
1678
1665
  create: O,
1679
1666
  update: k,
@@ -1681,7 +1668,7 @@ function We(t) {
1681
1668
  setResolved: j,
1682
1669
  find: y,
1683
1670
  isOwn: b,
1684
- applyRemoteCreate: ee,
1671
+ applyRemoteCreate: M,
1685
1672
  applyRemoteUpdate: N,
1686
1673
  applyRemoteDelete: P
1687
1674
  };
@@ -1690,11 +1677,11 @@ function Ge(e) {
1690
1677
  let { comments: t, provider: n, getTemplateId: r } = e, { subscribe: i } = n;
1691
1678
  if (typeof i != "function") return;
1692
1679
  let a = null;
1693
- function c() {
1680
+ function o() {
1694
1681
  a?.(), a = null;
1695
1682
  }
1696
- o(() => r(), (e) => {
1697
- c(), e && (a = i(e, (e) => {
1683
+ s(() => r(), (e) => {
1684
+ o(), e && (a = i(e, (e) => {
1698
1685
  switch (e.type) {
1699
1686
  case "created":
1700
1687
  t.applyRemoteCreate(e.comment);
@@ -1705,15 +1692,13 @@ function Ge(e) {
1705
1692
  case "deleted": t.applyRemoteDelete(e.commentId, e.parentId);
1706
1693
  }
1707
1694
  }));
1708
- }, { immediate: !0 }), s(c);
1695
+ }, { immediate: !0 }), c(o);
1709
1696
  }
1710
- //#endregion
1711
- //#region src/constants/timeouts.ts
1697
+ // src/constants/timeouts.ts
1712
1698
  var Ke = 1e4;
1713
- //#endregion
1714
- //#region src/composables/useImageUrlResolver.ts
1699
+ // src/composables/useImageUrlResolver.ts
1715
1700
  function qe(e) {
1716
- let t = c(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
1701
+ let t = o(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
1717
1702
  function r(e) {
1718
1703
  return t.get(e);
1719
1704
  }
@@ -1742,22 +1727,22 @@ function qe(e) {
1742
1727
  };
1743
1728
  }
1744
1729
  function Je(e) {
1745
- let t = n(K, null), r = g(e);
1746
- if (!t) return r;
1747
- let i;
1748
- function a() {
1749
- i !== void 0 && (clearTimeout(i), i = void 0);
1750
- }
1751
- _() && s(a);
1752
- let c = !0;
1753
- return o(r, (e) => {
1754
- a();
1755
- let n = c;
1756
- c = !1, e && !t.has(e) && (n ? t.lookup(e) : i = setTimeout(() => {
1757
- i = void 0, t.lookup(e);
1730
+ let t = n(K, null), i = v(e);
1731
+ if (!t) return i;
1732
+ let a;
1733
+ function o() {
1734
+ a !== void 0 && (clearTimeout(a), a = void 0);
1735
+ }
1736
+ r() && c(o);
1737
+ let l = !0;
1738
+ return s(i, (e) => {
1739
+ o();
1740
+ let n = l;
1741
+ l = !1, e && !t.has(e) && (n ? t.lookup(e) : a = setTimeout(() => {
1742
+ a = void 0, t.lookup(e);
1758
1743
  }, 300));
1759
- }, { immediate: !0 }), g(() => {
1760
- let e = r.value;
1744
+ }, { immediate: !0 }), v(() => {
1745
+ let e = i.value;
1761
1746
  if (!e) return e;
1762
1747
  let n = t.get(e);
1763
1748
  return typeof n == "string" && n.length > 0 ? n : e;
@@ -1769,21 +1754,20 @@ function Ye(e, t) {
1769
1754
  return typeof n == "string" && n.length > 0 ? n : t;
1770
1755
  }
1771
1756
  function Xe(e, t) {
1772
- return typeof e?.url == "string" && L(e.url, t);
1757
+ return typeof e?.url == "string" && B(e.url, t);
1773
1758
  }
1774
1759
  function Ze(e, t) {
1775
1760
  let n = e?.url;
1776
- if (typeof n == "string" && n.trim() !== "") return L(n, t) ? void 0 : n;
1761
+ if (typeof n == "string" && n.trim() !== "") return B(n, t) ? void 0 : n;
1777
1762
  }
1778
1763
  function Qe(e) {
1779
- let t = n(te, F.liquid), r = Je(() => Ze(e(), t));
1780
- return g(() => Xe(e(), t) ? null : r.value);
1764
+ let t = n(te, z.liquid), r = Je(() => Ze(e(), t));
1765
+ return v(() => Xe(e(), t) ? null : r.value);
1781
1766
  }
1782
1767
  function $e(e, t, n) {
1783
1768
  return Xe(t, n) ? null : Ye(e, Ze(t, n));
1784
1769
  }
1785
- //#endregion
1786
- //#region src/utils/blockTypeLabels.ts
1770
+ // src/utils/blockTypeLabels.ts
1787
1771
  function et(e, t) {
1788
1772
  return t.blocks[e] ?? e;
1789
1773
  }
@@ -1792,8 +1776,7 @@ function tt(e, t, n = []) {
1792
1776
  let { customType: r } = e;
1793
1777
  return n.find((e) => e.type === r)?.name ?? r;
1794
1778
  }
1795
- //#endregion
1796
- //#region src/utils/resolveFieldColors.ts
1779
+ // src/utils/resolveFieldColors.ts
1797
1780
  function nt(e, t) {
1798
1781
  let n = q({ presets: e.presets }, ie), r = n.presets.length === 0;
1799
1782
  return {
@@ -1805,8 +1788,7 @@ function nt(e, t) {
1805
1788
  allowCustomIgnored: e.allowCustom === !0 && t.allowCustom === !1
1806
1789
  };
1807
1790
  }
1808
- //#endregion
1809
- //#region src/utils/imageNaturalSize.ts
1791
+ // src/utils/imageNaturalSize.ts
1810
1792
  function rt(e) {
1811
1793
  return typeof e == "number" && Number.isFinite(e) && e > 0;
1812
1794
  }
@@ -1848,8 +1830,7 @@ function ct(e) {
1848
1830
  });
1849
1831
  });
1850
1832
  }
1851
- //#endregion
1852
- //#region src/components/MediaDropOverlay.vue
1833
+ // src/components/MediaDropOverlay.vue
1853
1834
  var lt = /* @__PURE__ */ t({
1854
1835
  __name: "MediaDropOverlay",
1855
1836
  props: {
@@ -1868,33 +1849,31 @@ var lt = /* @__PURE__ */ t({
1868
1849
  icon: 20,
1869
1850
  veil: "85%"
1870
1851
  }
1871
- }, a = g(() => r[t.size]);
1872
- return (t, r) => (i(), l("div", {
1873
- class: m(["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]),
1874
- style: x({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${a.value.veil}, transparent)` })
1875
- }, [e.uploading ? (i(), l(b, { key: 0 }, [S(h(ae), {
1852
+ }, i = v(() => r[t.size]);
1853
+ return (t, r) => (a(), l("div", {
1854
+ class: x(["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)]", i.value.gap]),
1855
+ style: p({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${i.value.veil}, transparent)` })
1856
+ }, [e.uploading ? (a(), l(b, { key: 0 }, [S(y(ae), {
1876
1857
  class: "tpl-spinner",
1877
- size: a.value.icon,
1858
+ size: i.value.icon,
1878
1859
  "stroke-width": 2
1879
- }, null, 8, ["size"]), u(" " + d(h(n).image.uploading), 1)], 64)) : (i(), l(b, { key: 1 }, [S(h(oe), {
1880
- size: a.value.icon,
1860
+ }, null, 8, ["size"]), d(" " + h(y(n).image.uploading), 1)], 64)) : (a(), l(b, { key: 1 }, [S(y(oe), {
1861
+ size: i.value.icon,
1881
1862
  "stroke-width": 1.5
1882
- }, null, 8, ["size"]), u(" " + d(h(n).image.dropToUpload), 1)], 64))], 6));
1863
+ }, null, 8, ["size"]), d(" " + h(y(n).image.dropToUpload), 1)], 64))], 6));
1883
1864
  }
1884
1865
  });
1885
- //#endregion
1886
- //#region src/composables/useAliveFlag.ts
1866
+ // src/composables/useAliveFlag.ts
1887
1867
  function ut() {
1888
1868
  let e = { alive: !0 };
1889
- return p(() => {
1869
+ return g(() => {
1890
1870
  e.alive = !1;
1891
1871
  }), e;
1892
1872
  }
1893
- //#endregion
1894
- //#region src/composables/useImageDrop.ts
1873
+ // src/composables/useImageDrop.ts
1895
1874
  var dt = "image/";
1896
1875
  function ft(e) {
1897
- let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || f(r), { isOverDropZone: a } = W(t, {
1876
+ let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || u(r), { isOverDropZone: a } = W(t, {
1898
1877
  preventDefaultForUnhandled: !0,
1899
1878
  onDrop: (e) => {
1900
1879
  if (!i()) return;
@@ -1902,43 +1881,42 @@ function ft(e) {
1902
1881
  t.length > 0 && n([t[0]]);
1903
1882
  }
1904
1883
  });
1905
- return { isOver: g(() => i() && a.value) };
1884
+ return { isOver: v(() => i() && a.value) };
1906
1885
  }
1907
- //#endregion
1908
- //#region src/composables/useMediaDropField.ts
1909
- function pt(t) {
1910
- let { target: r, blocked: i, apply: a } = t, o = n(G, null), s = n(ne, null), c = ut();
1911
- async function l() {
1912
- let e = await o?.({ accept: ["images"] });
1913
- c.alive && e && a(e);
1914
- }
1915
- let u = e(!1), d = g(() => (s?.value ?? !!o) && !u.value && !f(i));
1916
- async function p(e) {
1917
- if (o) {
1918
- u.value = !0;
1886
+ // src/composables/useMediaDropField.ts
1887
+ function pt(e) {
1888
+ let { target: t, blocked: r, apply: i } = e, a = n(G, null), o = n(ne, null), s = ut();
1889
+ async function c() {
1890
+ let e = await a?.({ accept: ["images"] });
1891
+ s.alive && e && i(e);
1892
+ }
1893
+ let l = m(!1), d = v(() => (o?.value ?? !!a) && !l.value && !u(r));
1894
+ async function f(e) {
1895
+ if (a) {
1896
+ l.value = !0;
1919
1897
  try {
1920
- let t = await o({
1898
+ let t = await a({
1921
1899
  accept: ["images"],
1922
1900
  files: e
1923
1901
  });
1924
- if (!c.alive) return;
1925
- t && a(t);
1902
+ if (!s.alive) return;
1903
+ t && i(t);
1926
1904
  } finally {
1927
- c.alive && (u.value = !1);
1905
+ s.alive && (l.value = !1);
1928
1906
  }
1929
1907
  }
1930
1908
  }
1931
- let { isOver: m } = ft({
1932
- target: r,
1909
+ let { isOver: p } = ft({
1910
+ target: t,
1933
1911
  enabled: d,
1934
- onFiles: p
1935
- }), h = g(() => d.value && m.value || u.value);
1912
+ onFiles: f
1913
+ }), h = v(() => d.value && p.value || l.value);
1936
1914
  return {
1937
- canBrowse: !!o,
1915
+ canBrowse: !!a,
1938
1916
  dropEnabled: d,
1939
- isUploading: u,
1917
+ isUploading: l,
1940
1918
  showOverlay: h,
1941
- openMediaBrowser: l
1919
+ openMediaBrowser: c
1942
1920
  };
1943
1921
  }
1944
1922
  function mt(e, t = "desktop") {
@@ -1956,7 +1934,7 @@ var ht = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", gt = {
1956
1934
  "2-1": [66.67, 33.33]
1957
1935
  };
1958
1936
  function _t(e, t) {
1959
- let n = (e) => Math.trunc(e ?? 0), r = (e) => k(e) === null ? 0 : Math.trunc(e.width);
1937
+ let n = (e) => Math.trunc(e ?? 0), r = (e) => O(e) === null ? 0 : Math.trunc(e.width);
1960
1938
  return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
1961
1939
  }
1962
1940
  function vt(e, t) {
@@ -1967,23 +1945,23 @@ function yt(e, t) {
1967
1945
  return Math.floor(t) - _t(e.styles.padding, n);
1968
1946
  }
1969
1947
  function* bt(e, t) {
1970
- for (let n of e) P(n) ? yield* bt(n.children, vt(t, n.styles.padding)) : yield {
1948
+ for (let n of e) U(n) ? yield* bt(n.children, vt(t, n.styles.padding)) : yield {
1971
1949
  block: n,
1972
- bandWidth: R(n) && n.wrapper ? vt(t, n.wrapper.padding) : t
1950
+ bandWidth: I(n) && n.wrapper ? vt(t, n.wrapper.padding) : t
1973
1951
  };
1974
1952
  }
1975
1953
  function xt(e, t) {
1976
1954
  if (!t) return e;
1977
1955
  try {
1978
- return B(t, e);
1956
+ return A(t, e);
1979
1957
  } catch {
1980
1958
  return e;
1981
1959
  }
1982
1960
  }
1983
1961
  function St(e, t, n) {
1984
1962
  let r = xt(e, n);
1985
- for (let { block: e, bandWidth: n } of bt(r.blocks, r.settings.width)) if (R(e)) {
1986
- let r = w(e)?.applied ? void 0 : e.border, i = Math.floor(n) - _t(e.styles.padding, r), a = gt[e.columns] ?? [100];
1963
+ for (let { block: e, bandWidth: n } of bt(r.blocks, r.settings.width)) if (I(e)) {
1964
+ let r = D(e)?.applied ? void 0 : e.border, i = Math.floor(n) - _t(e.styles.padding, r), a = gt[e.columns] ?? [100];
1987
1965
  for (let n = 0; n < e.children.length; n++) {
1988
1966
  let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
1989
1967
  if (o) return yt(o, r);
@@ -1997,13 +1975,12 @@ function Ct(e, t, n) {
1997
1975
  return null;
1998
1976
  }
1999
1977
  function wt(e, t, n) {
2000
- if (!R(e)) return;
2001
- let r = w(e);
1978
+ if (!I(e)) return;
1979
+ let r = D(e);
2002
1980
  if (r?.applied && r.height === "image") return (t ? Ct(t, e.id, n) : null) ?? mt(t?.settings);
2003
1981
  }
2004
- //#endregion
2005
- //#region src/constants/socialIcons.ts
2006
- var Tt = V, Et = {
1982
+ // src/constants/socialIcons.ts
1983
+ var Tt = R, Et = {
2007
1984
  small: 24,
2008
1985
  medium: 32,
2009
1986
  large: 48
@@ -2026,7 +2003,6 @@ var Tt = V, Et = {
2026
2003
  "dribbble",
2027
2004
  "behance"
2028
2005
  ];
2029
- //#endregion
2030
2006
  export { Re as A, Qe as C, Ue as D, We as E, pe as F, X as I, fe as L, ge as M, he as N, He as O, me as P, Y as R, $e as S, Ge as T, nt as _, wt as a, qe as b, mt as c, lt as d, st as f, it as g, at as h, St as i, Le as j, $ as k, pt as l, ot as m, Tt as n, Ct as o, ct as p, Dt as r, ht as s, Et as t, ut as u, tt as v, Je as w, Ze as x, et as y, ce as z };
2031
2007
 
2032
- //# sourceMappingURL=socialIcons-BBvsTwCV.js.map
2008
+ //# sourceMappingURL=socialIcons-jsTDmkbb.js.map