@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,29 +1,29 @@
1
- import { At as e, C as t, G as n, Mt as r, O as i, Q as a, U as o, X as s, Y as c, Z as l, _ as u, c as d, et as f, f as p, g as m, it as h, j as g, jt as _, ot as v, r as y, st as b, y as x, z as S } from "./vue.runtime.esm-bundler-DgFJ6GPG.js";
2
- import { C, D as w, K as T, V as E, _ as ee, b as D, ct as O, d as k, f as A, g as j, h as M, l as N, mt as P, ot as F, p as I, q as L, tt as te, v as R, vt as z, wt as B, x as V, y as H } from "./dist-DtOF3bDW.js";
3
- import { r as ne } from "./dist-DI4_YSnG.js";
4
- import { L as U, P as re, c as ie, x as W } from "./keys-Zd9KWRD1.js";
5
- import { t as ae } from "./useI18n-BdoY7xDE.js";
6
- import { o as oe, s as G } from "./usePopoverPosition-BZea45XK.js";
7
- import { t as K } from "./createLucideIcon-0lYYH3EW.js";
8
- import { t as se } from "./upload-BJfvdIrD.js";
9
- import { t as ce } from "./loader-circle-B2B8LbUu.js";
10
- //#region ../core/dist/index.js
11
- function q(e) {
1
+ import { $ as e, C as t, K as n, Mt as r, Nt as i, O as a, Q as o, W as s, X as c, Z as l, _ as u, at as d, c as f, ct as p, f as m, g as h, j as g, jt as _, r as v, st as y, tt as b, y as x, z as S } from "./vue.runtime.esm-bundler-CnEeTfhs.js";
2
+ import { Ot as C, S as w, St as T, U as E, X as D, Y as O, _ as k, b as A, f as j, ft as M, g as N, it as P, k as F, l as I, m as L, p as R, ut as z, v as ee, vt as B, w as V, x as te, y as H } from "./dist-CKi_npZM.js";
3
+ import { r as U } from "./dist-ByCWA2Tv.js";
4
+ import { L as W, P as ne, c as re, x as G } from "./keys-BgRERHzu.js";
5
+ import { t as ie } from "./useI18n-BBrHTdu8.js";
6
+ import { o as ae, s as K } from "./usePopoverPosition-DV1PxL66.js";
7
+ import { t as q } from "./createLucideIcon-CvhTA2KG.js";
8
+ import { t as oe } from "./upload-DuFEOi_0.js";
9
+ import { t as se } from "./loader-circle-BZRD0a4I.js";
10
+ // ../core/dist/index.js
11
+ function J(e) {
12
12
  return e instanceof Error ? e : Error(String(e), { cause: e });
13
13
  }
14
- function J(e, t) {
14
+ function Y(e, t) {
15
15
  try {
16
16
  t();
17
17
  } catch (t) {
18
- e?.(q(t));
18
+ e?.(J(t));
19
19
  }
20
20
  }
21
- function le(e) {
22
- let t = e.content ?? w(e.defaultFontFamily, e.templateDefaults);
23
- R(t), H(t);
24
- let n = s({
21
+ function ce(t) {
22
+ let n = t.content ?? F(t.defaultFontFamily, t.templateDefaults);
23
+ H(n), A(n);
24
+ let r = l({
25
25
  template: null,
26
- content: t,
26
+ content: n,
27
27
  selectedBlockId: null,
28
28
  viewport: "desktop",
29
29
  darkMode: !1,
@@ -32,16 +32,16 @@ function le(e) {
32
32
  isSaving: !1,
33
33
  isLoading: !1,
34
34
  uiTheme: "auto"
35
- }), r = a(0), i = 0, c = 0;
35
+ }), i = e(0), a = 0, c = 0;
36
36
  function u() {
37
- n.isDirty = !0, c++;
37
+ r.isDirty = !0, c++;
38
38
  }
39
- let d = o({
40
- get: () => n.content,
39
+ let d = s({
40
+ get: () => r.content,
41
41
  set: (e) => {
42
- n.content = e, u();
42
+ r.content = e, u();
43
43
  }
44
- }), f = o(() => n.selectedBlockId ? p(n.content.blocks, n.selectedBlockId) : null);
44
+ }), f = s(() => r.selectedBlockId ? p(r.content.blocks, r.selectedBlockId) : null);
45
45
  function p(e, t) {
46
46
  for (let n of e) {
47
47
  if (n.id === t) return n;
@@ -70,181 +70,181 @@ function le(e) {
70
70
  }
71
71
  return null;
72
72
  }
73
- function g(t) {
74
- return e.lockedBlocks?.value.has(t) ?? !1;
73
+ function g(e) {
74
+ return t.lockedBlocks?.value.has(e) ?? !1;
75
75
  }
76
76
  function _(e) {
77
- let t = h(n.content.blocks, e);
77
+ let t = h(r.content.blocks, e);
78
78
  if (!t) return null;
79
- let r = t.blocks.findIndex((t) => t.id === e);
80
- return r === -1 ? null : {
79
+ let n = t.blocks.findIndex((t) => t.id === e);
80
+ return n === -1 ? null : {
81
81
  targetSectionId: t.sectionId,
82
82
  columnIndex: t.columnIndex,
83
- index: r
83
+ index: n
84
84
  };
85
85
  }
86
86
  function v(e, t = !0) {
87
- R(e), H(e), n.content = e, t && u();
87
+ H(e), A(e), r.content = e, t && u();
88
88
  }
89
89
  function y(e) {
90
- e && g(e) || (n.selectedBlockId = e);
90
+ e && g(e) || (r.selectedBlockId = e);
91
91
  }
92
92
  function b(e) {
93
- n.viewport = e;
93
+ r.viewport = e;
94
94
  }
95
95
  function x(e) {
96
- n.darkMode = e;
96
+ r.darkMode = e;
97
97
  }
98
98
  function S(e) {
99
- n.uiTheme = e;
99
+ r.uiTheme = e;
100
100
  }
101
101
  function C(e) {
102
- n.previewMode = e, e && (n.selectedBlockId = null);
102
+ r.previewMode = e, e && (r.selectedBlockId = null);
103
103
  }
104
- function T(e, t) {
104
+ function w(e, t) {
105
105
  if (g(e)) return;
106
- let r = p(n.content.blocks, e);
107
- r && (Object.assign(r, t), u());
106
+ let n = p(r.content.blocks, e);
107
+ n && (Object.assign(n, t), u());
108
108
  }
109
- function E(e) {
110
- n.content.settings = {
111
- ...n.content.settings,
109
+ function T(e) {
110
+ r.content.settings = {
111
+ ...r.content.settings,
112
112
  ...e
113
113
  }, u();
114
114
  }
115
- function ee(e, t, r = 0, i) {
115
+ function E(e, t, n = 0, i) {
116
116
  let a = {
117
- settings: n.content.settings,
117
+ settings: r.content.settings,
118
118
  blocks: [e]
119
119
  };
120
- if (R(a), H(a), !(t && e.type === "section")) {
120
+ if (H(a), A(a), !(t && e.type === "section")) {
121
121
  if (t) {
122
122
  if (g(t)) return;
123
- let a = p(n.content.blocks, t);
123
+ let a = p(r.content.blocks, t);
124
124
  if (a && a.type === "section") {
125
- if (r < 0 || r >= L(a.columns)) return;
126
- a.children[r] = a.children[r] || [];
127
- let t = a.children[r];
125
+ if (n < 0 || n >= D(a.columns)) return;
126
+ a.children[n] = a.children[n] || [];
127
+ let t = a.children[n];
128
128
  i !== void 0 && i < t.length ? t.splice(i, 0, e) : t.push(e);
129
129
  }
130
- } else i !== void 0 && i < n.content.blocks.length ? n.content.blocks.splice(i, 0, e) : n.content.blocks.push(e);
130
+ } else i !== void 0 && i < r.content.blocks.length ? r.content.blocks.splice(i, 0, e) : r.content.blocks.push(e);
131
131
  u();
132
132
  }
133
133
  }
134
- function D(e) {
134
+ function O(e) {
135
135
  if (g(e)) return;
136
- let t = h(n.content.blocks, e);
136
+ let t = h(r.content.blocks, e);
137
137
  if (t) {
138
- let r = t.blocks.findIndex((t) => t.id === e);
139
- if (r !== -1) {
140
- let [e] = t.blocks.splice(r, 1);
141
- if (n.selectedBlockId) {
138
+ let n = t.blocks.findIndex((t) => t.id === e);
139
+ if (n !== -1) {
140
+ let [e] = t.blocks.splice(n, 1);
141
+ if (r.selectedBlockId) {
142
142
  let t = /* @__PURE__ */ new Set();
143
- m(e, t), t.has(n.selectedBlockId) && (n.selectedBlockId = null);
143
+ m(e, t), t.has(r.selectedBlockId) && (r.selectedBlockId = null);
144
144
  }
145
145
  u();
146
146
  }
147
147
  }
148
148
  }
149
- function O(e, t, r, i = 0) {
150
- if (g(e) || r && g(r)) return;
151
- let a = h(n.content.blocks, e);
149
+ function k(e, t, n, i = 0) {
150
+ if (g(e) || n && g(n)) return;
151
+ let a = h(r.content.blocks, e);
152
152
  if (!a) return;
153
153
  let o = a.blocks.findIndex((t) => t.id === e);
154
- if (o === -1 || r && a.blocks[o].type === "section") return;
154
+ if (o === -1 || n && a.blocks[o].type === "section") return;
155
155
  let s;
156
- if (r) {
157
- let e = p(n.content.blocks, r);
158
- if (!e || e.type !== "section" || i < 0 || i >= L(e.columns)) return;
156
+ if (n) {
157
+ let e = p(r.content.blocks, n);
158
+ if (!e || e.type !== "section" || i < 0 || i >= D(e.columns)) return;
159
159
  e.children[i] = e.children[i] || [], s = e.children[i];
160
- } else s = n.content.blocks;
160
+ } else s = r.content.blocks;
161
161
  let [c] = a.blocks.splice(o, 1);
162
162
  s.splice(t, 0, c), u();
163
163
  }
164
- function k() {
164
+ function j() {
165
165
  u();
166
166
  }
167
- function A(e, t) {
168
- throw new I(`[Templatical] Templates: ${e} ${t}`);
167
+ function M(e, t) {
168
+ throw new L(`[Templatical] Templates: ${e} ${t}`);
169
169
  }
170
- function j(t) {
171
- J(e.onError, t);
170
+ function N(e) {
171
+ Y(t.onError, e);
172
172
  }
173
- function M(t) {
174
- let { templates: n } = e;
175
- return n || A(t, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
173
+ function P(e) {
174
+ let { templates: n } = t;
175
+ return n || M(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
176
176
  }
177
- function N(e) {
178
- n.template && (n.template = {
179
- ...n.template,
177
+ function I(e) {
178
+ r.template && (r.template = {
179
+ ...r.template,
180
180
  name: e
181
181
  }, u());
182
182
  }
183
- async function P(t) {
184
- let a = M("create()"), { create: o } = a;
185
- typeof o != "function" && A("create()", "is disabled by the provider — its `create` is `false`.");
186
- let s, l = ++i;
187
- n.isLoading = !0;
183
+ async function R(e) {
184
+ let n = P("create()"), { create: o } = n;
185
+ typeof o != "function" && M("create()", "is disabled by the provider — its `create` is `false`.");
186
+ let s, l = ++a;
187
+ r.isLoading = !0;
188
188
  try {
189
- t?.content && (n.content = t.content);
190
- let e = c;
191
- s = await o(t?.name === void 0 ? { content: n.content } : {
192
- name: t.name,
193
- content: n.content
194
- }), n.template = s, c === e && (n.isDirty = !1), r.value++;
195
- } catch (t) {
196
- throw e.onError?.(t), t;
189
+ e?.content && (r.content = e.content);
190
+ let t = c;
191
+ s = await o(e?.name === void 0 ? { content: r.content } : {
192
+ name: e.name,
193
+ content: r.content
194
+ }), r.template = s, c === t && (r.isDirty = !1), i.value++;
195
+ } catch (e) {
196
+ throw t.onError?.(e), e;
197
197
  } finally {
198
- i === l && (n.isLoading = !1);
198
+ a === l && (r.isLoading = !1);
199
199
  }
200
- return j(() => a.onCreated?.(s)), s;
200
+ return N(() => n.onCreated?.(s)), s;
201
201
  }
202
- async function F(t, a) {
203
- let o = M("load()"), s, c = ++i;
204
- n.isLoading = !0;
202
+ async function z(e, n) {
203
+ let o = P("load()"), s, c = ++a;
204
+ r.isLoading = !0;
205
205
  try {
206
- if (s = await o.load(t), R(s.content), H(s.content), a && !a()) return s;
207
- n.template = s, n.content = s.content, n.isDirty = !1, r.value++;
208
- } catch (t) {
209
- throw e.onError?.(t), t;
206
+ if (s = await o.load(e), H(s.content), A(s.content), n && !n()) return s;
207
+ r.template = s, r.content = s.content, r.isDirty = !1, i.value++;
208
+ } catch (e) {
209
+ throw t.onError?.(e), e;
210
210
  } finally {
211
- i === c && (n.isLoading = !1);
211
+ a === c && (r.isLoading = !1);
212
212
  }
213
- return j(() => o.onLoaded?.(s)), s;
214
- }
215
- async function te(t = "api") {
216
- let r = M("save()"), { save: i } = r;
217
- typeof i != "function" && A("save()", "is disabled by the provider — its `save` is `false`.");
218
- let a = n.template;
219
- a || A("save()", "has no template loaded. Call create() or load() first.");
220
- let o = a.name === void 0 ? { content: n.content } : {
213
+ return N(() => o.onLoaded?.(s)), s;
214
+ }
215
+ async function ee(e = "api") {
216
+ let n = P("save()"), { save: i } = n;
217
+ typeof i != "function" && M("save()", "is disabled by the provider — its `save` is `false`.");
218
+ let a = r.template;
219
+ a || M("save()", "has no template loaded. Call create() or load() first.");
220
+ let o = a.name === void 0 ? { content: r.content } : {
221
221
  name: a.name,
222
- content: n.content
222
+ content: r.content
223
223
  }, s;
224
- n.isSaving = !0;
224
+ r.isSaving = !0;
225
225
  try {
226
226
  let e = c;
227
- if (s = await i(a.id, o), n.template?.id === a.id) {
228
- let e = n.template.name;
229
- n.template = e === a.name ? s : {
227
+ if (s = await i(a.id, o), r.template?.id === a.id) {
228
+ let e = r.template.name;
229
+ r.template = e === a.name ? s : {
230
230
  ...s,
231
231
  name: e
232
232
  };
233
233
  }
234
- c === e && (n.isDirty = !1);
235
- } catch (t) {
236
- throw e.onError?.(t), t;
234
+ c === e && (r.isDirty = !1);
235
+ } catch (e) {
236
+ throw t.onError?.(e), e;
237
237
  } finally {
238
- n.isSaving = !1;
238
+ r.isSaving = !1;
239
239
  }
240
- return j(() => r.onSaved?.(s, { trigger: t })), s;
240
+ return N(() => n.onSaved?.(s, { trigger: e })), s;
241
241
  }
242
- function z() {
243
- return n.template?.id !== void 0;
242
+ function B() {
243
+ return r.template?.id !== void 0;
244
244
  }
245
245
  return {
246
- state: l(n),
247
- loadVersion: l(r),
246
+ state: o(r),
247
+ loadVersion: o(i),
248
248
  content: d,
249
249
  selectedBlock: f,
250
250
  isBlockLocked: g,
@@ -254,43 +254,43 @@ function le(e) {
254
254
  setDarkMode: x,
255
255
  setUiTheme: S,
256
256
  setPreviewMode: C,
257
- updateBlock: T,
258
- updateSettings: E,
259
- addBlock: ee,
260
- removeBlock: D,
261
- moveBlock: O,
262
- markDirty: k,
257
+ updateBlock: w,
258
+ updateSettings: T,
259
+ addBlock: E,
260
+ removeBlock: O,
261
+ moveBlock: k,
262
+ markDirty: j,
263
263
  findBlockLocation: _,
264
- setName: N,
265
- create: P,
266
- load: F,
267
- save: te,
268
- hasTemplate: z
264
+ setName: I,
265
+ create: R,
266
+ load: z,
267
+ save: ee,
268
+ hasTemplate: B
269
269
  };
270
270
  }
271
- var ue = 50, Y = 300, de = 1500;
272
- function fe(e) {
273
- let { content: t, setContent: n, maxSize: r = ue } = e, i = a([]), s = a([]), c = a(!1), l = null, u = null, d = o(() => i.value.length > 0), f = o(() => s.value.length > 0);
271
+ var le = 50, ue = 300, de = 1500;
272
+ function fe(t) {
273
+ let { content: n, setContent: r, maxSize: i = le } = t, a = e([]), o = e([]), c = e(!1), l = null, u = null, d = s(() => a.value.length > 0), f = s(() => o.value.length > 0);
274
274
  function p() {
275
- return z(t.value);
275
+ return T(n.value);
276
276
  }
277
277
  function m(e) {
278
- i.value.push(e), i.value.length > r && i.value.splice(0, i.value.length - r);
278
+ a.value.push(e), a.value.length > i && a.value.splice(0, a.value.length - i);
279
279
  }
280
280
  function h() {
281
281
  u &&= (clearTimeout(u.timeoutId), null);
282
282
  }
283
283
  function g() {
284
- h(), m(p()), s.value = [];
284
+ h(), m(p()), o.value = [];
285
285
  }
286
286
  function _(e) {
287
287
  u && u.blockId === e ? (clearTimeout(u.timeoutId), u.timeoutId = setTimeout(() => {
288
288
  u = null;
289
- }, Y)) : (h(), m(p()), s.value = [], u = {
289
+ }, ue)) : (h(), m(p()), o.value = [], u = {
290
290
  blockId: e,
291
291
  timeoutId: setTimeout(() => {
292
292
  u = null;
293
- }, Y)
293
+ }, ue)
294
294
  });
295
295
  }
296
296
  function v() {
@@ -299,19 +299,19 @@ function fe(e) {
299
299
  }, de);
300
300
  }
301
301
  function y() {
302
- if (i.value.length === 0) return;
302
+ if (a.value.length === 0) return;
303
303
  h();
304
- let e = i.value.pop();
305
- s.value.push(p()), n(e, !0), v();
304
+ let e = a.value.pop();
305
+ o.value.push(p()), r(e, !0), v();
306
306
  }
307
307
  function b() {
308
- if (s.value.length === 0) return;
308
+ if (o.value.length === 0) return;
309
309
  h();
310
- let e = s.value.pop();
311
- i.value.push(p()), n(e, !0), v();
310
+ let e = o.value.pop();
311
+ a.value.push(p()), r(e, !0), v();
312
312
  }
313
313
  function x() {
314
- i.value = [], s.value = [], h();
314
+ a.value = [], o.value = [], h();
315
315
  }
316
316
  function S() {
317
317
  x(), l &&= (clearTimeout(l), null);
@@ -331,11 +331,11 @@ function fe(e) {
331
331
  function pe(e) {
332
332
  let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
333
333
  function o(n, r, a) {
334
- let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = C(n, o);
334
+ let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = V(n, o);
335
335
  return t(s, r, a), i(s.id), s;
336
336
  }
337
337
  function s(e, n, r) {
338
- let o = D(e);
338
+ let o = te(e);
339
339
  if (n !== void 0 || r !== void 0) t(o, n, r);
340
340
  else {
341
341
  let i = a?.(e.id) ?? null;
@@ -374,27 +374,27 @@ function me(e) {
374
374
  function f() {
375
375
  d(), n() && r(JSON.parse(JSON.stringify(t.value)));
376
376
  }
377
- function p() {
377
+ function m() {
378
378
  c() && !s && (d(), o = setTimeout(() => {
379
379
  o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
380
380
  }, i));
381
381
  }
382
- let m = b(t, () => {
383
- p();
382
+ let h = p(t, () => {
383
+ m();
384
384
  }, { deep: !0 });
385
- function h() {
386
- m(), d();
385
+ function g() {
386
+ h(), d();
387
387
  }
388
388
  return {
389
389
  flush: f,
390
390
  cancel: d,
391
391
  pause: l,
392
392
  resume: u,
393
- destroy: h
393
+ destroy: g
394
394
  };
395
395
  }
396
396
  function he(e) {
397
- let t = s(/* @__PURE__ */ new Set()), n = o(() => t.size > 0);
397
+ let t = l(/* @__PURE__ */ new Set()), n = s(() => t.size > 0);
398
398
  function r(e) {
399
399
  return t.has(e);
400
400
  }
@@ -411,34 +411,34 @@ function he(e) {
411
411
  hasHiddenBlocks: n
412
412
  };
413
413
  }
414
- function ge(e) {
415
- let t = a(!1), n = a(!1), r = o(() => !!e.definition.value?.dataSource), i = o(() => r.value && !e.block.value.dataSourceFetched);
416
- async function s() {
417
- let r = e.definition.value;
418
- if (r?.dataSource) {
419
- t.value = !0, n.value = !1;
414
+ function ge(t) {
415
+ let n = e(!1), r = e(!1), i = s(() => !!t.definition.value?.dataSource), a = s(() => i.value && !t.block.value.dataSourceFetched);
416
+ async function o() {
417
+ let e = t.definition.value;
418
+ if (e?.dataSource) {
419
+ n.value = !0, r.value = !1;
420
420
  try {
421
- let t = await r.dataSource.onFetch({
422
- fieldValues: { ...e.block.value.fieldValues },
423
- blockId: e.block.value.id
421
+ let n = await e.dataSource.onFetch({
422
+ fieldValues: { ...t.block.value.fieldValues },
423
+ blockId: t.block.value.id
424
424
  });
425
- if (t == null) return;
426
- let n = { ...e.block.value.fieldValues };
427
- for (let e of Object.keys(n)) e in t && (n[e] = t[e]);
428
- e.onUpdate(n, !0);
425
+ if (n == null) return;
426
+ let r = { ...t.block.value.fieldValues };
427
+ for (let e of Object.keys(r)) e in n && (r[e] = n[e]);
428
+ t.onUpdate(r, !0);
429
429
  } catch (e) {
430
- console.warn("[Templatical] Data source fetch error:", e), n.value = !0;
430
+ console.warn("[Templatical] Data source fetch error:", e), r.value = !0;
431
431
  } finally {
432
- t.value = !1;
432
+ n.value = !1;
433
433
  }
434
434
  }
435
435
  }
436
436
  return {
437
- isFetching: t,
438
- fetchError: n,
439
- fetch: s,
440
- hasDataSource: r,
441
- needsFetch: i
437
+ isFetching: n,
438
+ fetchError: r,
439
+ fetch: o,
440
+ hasDataSource: i,
441
+ needsFetch: a
442
442
  };
443
443
  }
444
444
  function _e(e, t) {
@@ -505,7 +505,7 @@ function we(e) {
505
505
  }
506
506
  function Q(e, t, n) {
507
507
  let r = {}, i = [];
508
- for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || E(e[i], t[i]) || (r[i] = z(t[i]));
508
+ for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || E(e[i], t[i]) || (r[i] = T(t[i]));
509
509
  for (let r of Object.keys(e)) n.has(r) || e[r] === void 0 || t[r] === void 0 && i.push(r);
510
510
  return {
511
511
  set: r,
@@ -529,8 +529,8 @@ function Te(e, t) {
529
529
  };
530
530
  for (let t of e.blocks) u(t, "kept");
531
531
  let d = (e) => n.has(e) && !c.has(e), f = (e) => {
532
- let t = z(e);
533
- return t.type === "section" && (t.children = Z(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => z(e)) : e)), t;
532
+ let t = T(e);
533
+ 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;
534
534
  }, p = (e, t, r) => {
535
535
  let a = Se(e), o = [], s = [];
536
536
  t.forEach((e, t) => {
@@ -646,30 +646,30 @@ function Le(e) {
646
646
  return n;
647
647
  });
648
648
  }
649
- function Re(e) {
650
- let { provider: t } = e, r = e.sessionId ?? crypto.randomUUID(), i = e.maxUndo ?? ke, s = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", l = f([]), u = f(/* @__PURE__ */ new Map()), d = a(null), p = a(0), m = a(0), h = null, g = null, _ = !1, v = !1, y = !1, x = null, S = 0, C = !1, w = [], T = null, D = null, O = Promise.resolve(), k = null, A = o(() => (m.value, (g?.undo.length ?? 0) > 0)), M = o(() => (m.value, (g?.redo.length ?? 0) > 0));
651
- function P(t) {
652
- e.onError?.(t instanceof Error ? t : Error(String(t)));
649
+ function Re(t) {
650
+ let { provider: r } = t, i = t.sessionId ?? crypto.randomUUID(), a = t.maxUndo ?? ke, o = typeof r.acquireLock == "function" && typeof r.renewLock == "function" && typeof r.releaseLock == "function", l = b([]), u = b(/* @__PURE__ */ new Map()), d = e(null), f = e(0), m = e(0), h = null, g = null, _ = !1, v = !1, y = !1, x = null, S = 0, C = !1, w = [], D = null, O = null, A = Promise.resolve(), j = null, M = s(() => (m.value, (g?.undo.length ?? 0) > 0)), N = s(() => (m.value, (g?.redo.length ?? 0) > 0));
651
+ function F(e) {
652
+ t.onError?.(e instanceof Error ? e : Error(String(e)));
653
653
  }
654
- function F(t, n = g) {
655
- n !== g || C || e.onNotice?.(t);
654
+ function L(e, n = g) {
655
+ n !== g || C || t.onNotice?.(e);
656
656
  }
657
- function I() {
657
+ function R() {
658
658
  return {
659
659
  locks: [...u.value.values()].map((e) => ({
660
660
  blockId: e.blockId,
661
661
  sessionId: e.holder.sessionId
662
662
  })),
663
- session: r
663
+ session: i
664
664
  };
665
665
  }
666
- function L() {
666
+ function z() {
667
667
  m.value++;
668
668
  }
669
- function R(e, t) {
670
- e.push(t), e.length > i && e.splice(0, e.length - i);
669
+ function B(e, t) {
670
+ e.push(t), e.length > a && e.splice(0, e.length - a);
671
671
  }
672
- function B(e) {
672
+ function V(e) {
673
673
  if (!h || _) return;
674
674
  v = !0;
675
675
  try {
@@ -677,24 +677,24 @@ function Re(e) {
677
677
  if (n.length > 0) try {
678
678
  ee(t, n);
679
679
  } catch {
680
- h.setContent(z(e), !1);
680
+ h.setContent(T(e), !1);
681
681
  }
682
- E(h.content.value, e) || h.setContent(z(e), !1);
682
+ E(h.content.value, e) || h.setContent(T(e), !1);
683
683
  } finally {
684
684
  v = !1;
685
685
  }
686
686
  let t = h.state.selectedBlockId;
687
687
  t && !Fe(e.blocks, t) && h.selectBlock(null);
688
688
  }
689
- function V() {
689
+ function te() {
690
690
  v || y || (y = !0, queueMicrotask(() => {
691
- y = !1, ne(!1);
691
+ y = !1, U(!1);
692
692
  }));
693
693
  }
694
694
  function H() {
695
695
  x &&= (clearTimeout(x), null);
696
696
  }
697
- function ne(e, t = !1) {
697
+ function U(e, t = !1) {
698
698
  let n = g;
699
699
  if (!h || !n || _ || v || h.state.isLoading && !t || h.state.template?.id !== n.templateId) return;
700
700
  let r = Te(n.view, h.content.value);
@@ -704,53 +704,53 @@ function Re(e) {
704
704
  let e = Date.now();
705
705
  if (x === null && (S = e), e - S < 1e3) {
706
706
  x && clearTimeout(x), x = setTimeout(() => {
707
- x = null, ne(!0);
707
+ x = null, U(!0);
708
708
  }, 300);
709
709
  return;
710
710
  }
711
711
  }
712
- H(), re(n, r);
712
+ H(), ne(n, r);
713
713
  }
714
714
  }
715
- function U() {
716
- ne(!0);
715
+ function W() {
716
+ U(!0);
717
717
  }
718
- function re(e, t) {
718
+ function ne(e, t) {
719
719
  let n = t, r;
720
720
  try {
721
- r = j(e.view, n, I());
721
+ r = k(e.view, n, R());
722
722
  } catch (t) {
723
- if (!(t instanceof N)) throw t;
724
- B(e.view);
723
+ if (!(t instanceof I)) throw t;
724
+ V(e.view);
725
725
  let n = t.blockId === void 0 ? void 0 : u.value.get(t.blockId)?.holder;
726
- F({
726
+ L({
727
727
  type: "editRefused",
728
728
  code: t.code,
729
729
  ...n ? { holder: n } : {}
730
- }), t.code === "invalid_operation" && P(t);
730
+ }), t.code === "invalid_operation" && F(t);
731
731
  return;
732
732
  }
733
733
  let i = h.content.value;
734
734
  if (!E(r, i)) {
735
- P(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
735
+ F(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
736
736
  op: "setContent",
737
- content: z(i)
737
+ content: T(i)
738
738
  }];
739
739
  try {
740
- r = j(e.view, n, I());
740
+ r = k(e.view, n, R());
741
741
  } catch (t) {
742
- if (!(t instanceof N)) throw t;
743
- B(e.view), F({
742
+ if (!(t instanceof I)) throw t;
743
+ V(e.view), L({
744
744
  type: "editRefused",
745
745
  code: t.code
746
746
  });
747
747
  return;
748
748
  }
749
749
  }
750
- let a = { ops: te(e.view, n) };
751
- R(e.undo, a), e.redo = [], L(), e.view = r, ie(e, n, "edit", a);
750
+ let a = { ops: P(e.view, n) };
751
+ B(e.undo, a), e.redo = [], z(), e.view = r, re(e, n, "edit", a);
752
752
  }
753
- function ie(e, t, n, r) {
753
+ function re(e, t, n, r) {
754
754
  let i = { dropped: !1 }, a = 0;
755
755
  do
756
756
  e.pending.push({
@@ -763,127 +763,127 @@ function Re(e) {
763
763
  revision: null
764
764
  }), a += Ae;
765
765
  while (a < t.length);
766
- W(e);
766
+ G(e);
767
767
  }
768
- function W(e) {
768
+ function G(e) {
769
769
  if (e.inFlight) return;
770
770
  let t = e.pending.find((e) => !e.sent);
771
- t ? (t.sent = !0, e.inFlight = t, ae(e, t, 0)) : q(e);
771
+ t ? (t.sent = !0, e.inFlight = t, ie(e, t, 0)) : J(e);
772
772
  }
773
- function ae(e, n, r) {
774
- t.submit(e.templateId, {
775
- batchId: n.batchId,
773
+ function ie(e, t, n) {
774
+ r.submit(e.templateId, {
775
+ batchId: t.batchId,
776
776
  baseRevision: e.revision,
777
- ops: n.ops,
778
- ...n.origin === "ai" ? { origin: "ai" } : {}
779
- }).then(({ revision: t }) => {
780
- e.inFlight = null, oe(e, n, t), W(e);
781
- }, (t) => {
782
- if (Me(t) !== null) e.inFlight = null, ce(e, n, t), W(e);
783
- else if (Pe(t)) {
784
- J(e, t);
785
- let i = Oe[Math.min(r, Oe.length - 1)];
777
+ ops: t.ops,
778
+ ...t.origin === "ai" ? { origin: "ai" } : {}
779
+ }).then(({ revision: n }) => {
780
+ e.inFlight = null, ae(e, t, n), G(e);
781
+ }, (r) => {
782
+ if (Me(r) !== null) e.inFlight = null, se(e, t, r), G(e);
783
+ else if (Pe(r)) {
784
+ Y(e, r);
785
+ let i = Oe[Math.min(n, Oe.length - 1)];
786
786
  setTimeout(() => {
787
- C || ae(e, n, r + 1);
787
+ C || ie(e, t, n + 1);
788
788
  }, i);
789
- } else e.inFlight = null, P(t), ce(e, n, t), W(e);
789
+ } else e.inFlight = null, F(r), se(e, t, r), G(e);
790
790
  });
791
791
  }
792
- function oe(e, t, n) {
793
- t.revision === null && (t.revision = n, n <= e.revision ? (G(e, t), de(e)) : (e.own.set(n, t), Y(e)));
794
- }
795
- function G(e, t) {
796
- e.pending = e.pending.filter((e) => e !== t), q(e);
792
+ function ae(e, t, n) {
793
+ t.revision === null && (t.revision = n, n <= e.revision ? (K(e, t), de(e)) : (e.own.set(n, t), ue(e)));
797
794
  }
798
795
  function K(e, t) {
796
+ e.pending = e.pending.filter((e) => e !== t), J(e);
797
+ }
798
+ function q(e, t) {
799
799
  if (t.entry) {
800
800
  for (let n of [e.undo, e.redo]) {
801
801
  let e = n.indexOf(t.entry);
802
802
  e !== -1 && n.splice(e, 1);
803
803
  }
804
- L();
804
+ z();
805
805
  }
806
806
  }
807
- function se(e, t) {
807
+ function oe(e, t) {
808
808
  let n = !t.group.dropped;
809
- return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && K(e, t), q(e), n;
809
+ return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && q(e, t), J(e), n;
810
810
  }
811
- function ce(e, t, n) {
812
- if (G(e, t), se(e, t)) {
811
+ function se(e, t, n) {
812
+ if (K(e, t), oe(e, t)) {
813
813
  let r = Me(n) ?? "invalid_operation";
814
814
  if (t.origin === "edit" || t.origin === "ai") {
815
815
  let t = Ne(n);
816
- F({
816
+ L({
817
817
  type: "editRefused",
818
818
  code: r,
819
819
  ...t ? { holder: t } : {}
820
820
  }, e);
821
- } else F({
821
+ } else L({
822
822
  type: "undoSkipped",
823
823
  code: r
824
824
  }, e);
825
825
  }
826
826
  de(e), e === g && X();
827
827
  }
828
- function q(e) {
828
+ function J(e) {
829
829
  if (!(e.pending.length > 0 || e.waiters.length === 0)) for (let t of e.waiters.splice(0)) t.resolve();
830
830
  }
831
- function J(e, t) {
831
+ function Y(e, t) {
832
832
  let n = t instanceof Error ? t : Error(String(t));
833
833
  for (let t of e.waiters.splice(0)) t.reject(n);
834
834
  }
835
- function le(e, t) {
835
+ function ce(e, t) {
836
836
  if (t.revision <= e.revision) return;
837
837
  let n = e.pending.find((e) => e.batchId === t.batchId);
838
- n ? oe(e, n, t.revision) : (e.remote.set(t.revision, t), Y(e));
838
+ n ? ae(e, n, t.revision) : (e.remote.set(t.revision, t), ue(e));
839
839
  }
840
- function ue(t, n) {
840
+ function le(e, n) {
841
841
  let r = n.ops;
842
- if (e.normalizeRemoteOperations) try {
843
- r = e.normalizeRemoteOperations(n.ops, t.confirmed);
842
+ if (t.normalizeRemoteOperations) try {
843
+ r = t.normalizeRemoteOperations(n.ops, e.confirmed);
844
844
  } catch (e) {
845
- P(e);
845
+ F(e);
846
846
  }
847
847
  return Le(r);
848
848
  }
849
- function Y(t) {
849
+ function ue(e) {
850
850
  let n = [], r = !1;
851
851
  for (;;) {
852
- let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
852
+ let t = e.revision + 1, i = e.remote.get(t), a = e.own.get(t);
853
853
  if (!i && !a) break;
854
854
  try {
855
- t.confirmed = j(t.confirmed, i ? ue(t, i) : a.ops);
855
+ e.confirmed = k(e.confirmed, i ? le(e, i) : a.ops);
856
856
  } catch {
857
- if (t.recovering) {
858
- t.remote.clear(), t.own.clear(), P(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
857
+ if (e.recovering) {
858
+ e.remote.clear(), e.own.clear(), F(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
859
859
  return;
860
860
  }
861
- me(t);
861
+ me(e);
862
862
  return;
863
863
  }
864
- t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), G(t, a));
864
+ e.revision = t, i ? (e.remote.delete(t), n.push(i)) : (e.own.delete(t), a.group.dropped && (r = !0), K(e, a));
865
865
  }
866
- if (t === g && (p.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? fe(t) : pe(t), (n.length !== 0 || r) && (de(t), t === g)) for (let t of n) try {
867
- e.onRemoteChange?.({
868
- actor: t.actor,
869
- ops: t.ops
866
+ if (e === g && (f.value = e.revision), e.remote.size > 0 || e.own.size > 0 ? fe(e) : pe(e), (n.length !== 0 || r) && (de(e), e === g)) for (let e of n) try {
867
+ t.onRemoteChange?.({
868
+ actor: e.actor,
869
+ ops: e.ops
870
870
  });
871
871
  } catch (e) {
872
- P(e);
872
+ F(e);
873
873
  }
874
874
  }
875
875
  function de(e) {
876
- e === g && U();
876
+ e === g && W();
877
877
  let t = e.confirmed;
878
878
  for (let n = 0; n < e.pending.length; n++) {
879
879
  let r = e.pending[n];
880
880
  try {
881
- t = j(t, r.ops);
881
+ t = k(t, r.ops);
882
882
  } catch (i) {
883
883
  if (r.sent) continue;
884
- if (se(e, r)) {
885
- let t = i instanceof N ? i.code : "invalid_operation";
886
- F(r.origin === "edit" || r.origin === "ai" ? {
884
+ if (oe(e, r)) {
885
+ let t = i instanceof I ? i.code : "invalid_operation";
886
+ L(r.origin === "edit" || r.origin === "ai" ? {
887
887
  type: "editRefused",
888
888
  code: t
889
889
  } : {
@@ -894,7 +894,7 @@ function Re(e) {
894
894
  t = e.confirmed, n = -1;
895
895
  }
896
896
  }
897
- e.view = t, q(e), e === g && B(t);
897
+ e.view = t, J(e), e === g && V(t);
898
898
  }
899
899
  function fe(e) {
900
900
  e.gapTimer ||= setTimeout(() => {
@@ -908,50 +908,50 @@ function Re(e) {
908
908
  let e = g;
909
909
  return e ? (e.catchingUp ||= (async () => {
910
910
  try {
911
- let n = await t.operationsAfter(e.templateId, e.revision);
911
+ let t = await r.operationsAfter(e.templateId, e.revision);
912
912
  if (e.retired) return;
913
- if ("resync" in n) {
913
+ if ("resync" in t) {
914
914
  await me(e);
915
915
  return;
916
916
  }
917
- for (let t of n.batches) le(e, t);
917
+ for (let n of t.batches) ce(e, n);
918
918
  } catch (e) {
919
- P(e);
919
+ F(e);
920
920
  } finally {
921
921
  e.catchingUp = null;
922
922
  }
923
923
  })(), e.catchingUp) : Promise.resolve();
924
924
  }
925
- async function me(t) {
926
- t.recovering = !0;
925
+ async function me(e) {
926
+ e.recovering = !0;
927
927
  try {
928
- let n = await e.loadTemplate(t.templateId);
929
- if (t.retired) return;
930
- let r = n.revision ?? t.revision;
931
- t.confirmed = z(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
932
- for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), G(t, n));
933
- t === g && (p.value = r), de(t), Y(t);
928
+ let n = await t.loadTemplate(e.templateId);
929
+ if (e.retired) return;
930
+ let r = n.revision ?? e.revision;
931
+ e.confirmed = T(n.content), e.revision = r, e.remote = new Map([...e.remote].filter(([e]) => e > r));
932
+ for (let [t, n] of [...e.own]) t <= r && (e.own.delete(t), K(e, n));
933
+ e === g && (f.value = r), de(e), ue(e);
934
934
  } catch (e) {
935
- P(e);
935
+ F(e);
936
936
  } finally {
937
- t.recovering = !1;
937
+ e.recovering = !1;
938
938
  }
939
939
  }
940
- function he(t) {
941
- let n = () => t === g && !t.retired;
940
+ function he(e) {
941
+ let n = () => e === g && !e.retired;
942
942
  return {
943
- onBatch: (e) => {
944
- n() && le(t, e);
943
+ onBatch: (t) => {
944
+ n() && ce(e, t);
945
945
  },
946
946
  onResync: (r, i) => {
947
- if (!(!n() || r <= t.revision)) {
947
+ if (!(!n() || r <= e.revision)) {
948
948
  if (i) try {
949
- e.onRemoteResync?.({
949
+ t.onRemoteResync?.({
950
950
  revision: r,
951
951
  actor: i
952
952
  });
953
953
  } catch (e) {
954
- P(e);
954
+ F(e);
955
955
  }
956
956
  X();
957
957
  }
@@ -965,23 +965,23 @@ function Re(e) {
965
965
  onMembers: (e) => {
966
966
  n() && Ce(e);
967
967
  },
968
- onConnectionChange: (e) => {
969
- n() && ye(t, e);
968
+ onConnectionChange: (t) => {
969
+ n() && ye(e, t);
970
970
  }
971
971
  };
972
972
  }
973
- function ge(e, n) {
974
- t.join(e.templateId, { sessionId: r }, he(e)).then((t) => {
975
- e.retired || e !== g ? n || t.leave() : (e.leave = t.leave, Z(t.locks, !n), Ce(t.members), t.members.length > 0 && (d.value = "connected"), t.revision > e.revision && X(), n && Q());
976
- }, (e) => P(e));
973
+ function ge(e, t) {
974
+ r.join(e.templateId, { sessionId: i }, he(e)).then((n) => {
975
+ e.retired || e !== g ? t || n.leave() : (e.leave = n.leave, Z(n.locks, !t), Ce(n.members), n.members.length > 0 && (d.value = "connected"), n.revision > e.revision && X(), t && Q());
976
+ }, (e) => F(e));
977
977
  }
978
978
  function _e(e) {
979
- let t = z(e.content), n = {
979
+ let t = T(e.content), n = {
980
980
  templateId: e.id,
981
981
  confirmed: t,
982
982
  revision: e.revision ?? 0,
983
983
  pending: [],
984
- view: z(t),
984
+ view: T(t),
985
985
  remote: /* @__PURE__ */ new Map(),
986
986
  own: /* @__PURE__ */ new Map(),
987
987
  inFlight: null,
@@ -994,22 +994,22 @@ function Re(e) {
994
994
  redo: [],
995
995
  waiters: []
996
996
  };
997
- g = n, p.value = n.revision, L(), ge(n, !1), h?.state.selectedBlockId && Be(h.state.selectedBlockId), V();
997
+ g = n, f.value = n.revision, z(), ge(n, !1), h?.state.selectedBlockId && Be(h.state.selectedBlockId), te();
998
998
  }
999
999
  function ve(e) {
1000
- e.retired = !0, pe(e), e.leave?.(), e.leave = null, J(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
1000
+ e.retired = !0, pe(e), e.leave?.(), e.leave = null, Y(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
1001
1001
  }
1002
1002
  function ye(e, t) {
1003
1003
  let n = d.value;
1004
1004
  d.value = t, t === "connected" && n !== null && n !== "connected" && ge(e, !0);
1005
1005
  }
1006
1006
  function be(e) {
1007
- g && g.templateId === e?.id || (g &&= (H(), ve(g), null), l.value = [], u.value = /* @__PURE__ */ new Map(), d.value = null, T = null, Q(), L(), e && _e(e));
1007
+ g && g.templateId === e?.id || (g &&= (H(), ve(g), null), l.value = [], u.value = /* @__PURE__ */ new Map(), d.value = null, D = null, Q(), z(), e && _e(e));
1008
1008
  }
1009
1009
  function xe(e) {
1010
- if (e.holder.sessionId === r) return;
1010
+ if (e.holder.sessionId === i) return;
1011
1011
  let t = new Map([...u.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
1012
- t.set(e.blockId, e), u.value = t, h?.state.selectedBlockId === e.blockId && (h.selectBlock(null), F({
1012
+ t.set(e.blockId, e), u.value = t, h?.state.selectedBlockId === e.blockId && (h.selectBlock(null), L({
1013
1013
  type: "selectionRefused",
1014
1014
  blockId: e.blockId,
1015
1015
  holder: e.holder
@@ -1022,7 +1022,7 @@ function Re(e) {
1022
1022
  }
1023
1023
  function Z(e, t) {
1024
1024
  let n = t ? new Map(u.value) : /* @__PURE__ */ new Map();
1025
- for (let i of e) i.holder.sessionId !== r && (t && n.has(i.blockId) || n.set(i.blockId, i));
1025
+ for (let r of e) r.holder.sessionId !== i && (t && n.has(r.blockId) || n.set(r.blockId, r));
1026
1026
  u.value = n;
1027
1027
  }
1028
1028
  function Ce(e) {
@@ -1032,24 +1032,24 @@ function Re(e) {
1032
1032
  r.size !== u.value.size && (u.value = r);
1033
1033
  }
1034
1034
  function we(e) {
1035
- O = O.then(e).catch(P);
1035
+ A = A.then(e).catch(F);
1036
1036
  }
1037
1037
  function Q() {
1038
- s && we(async () => {
1039
- if (D && (T === null || D.templateId !== T.templateId)) {
1040
- let e = D;
1041
- D = null, $(), await t.releaseLock(e.templateId, e.blockId);
1038
+ o && we(async () => {
1039
+ if (O && (D === null || O.templateId !== D.templateId)) {
1040
+ let e = O;
1041
+ O = null, $(), await r.releaseLock(e.templateId, e.blockId);
1042
1042
  }
1043
- let e = T;
1044
- if (!(!e || D?.templateId === e.templateId && D.blockId === e.blockId)) try {
1045
- await t.acquireLock(e.templateId, e.blockId), D = e, ze(), je(e.blockId);
1046
- } catch (n) {
1047
- if (D?.templateId === e.templateId) {
1048
- let e = D;
1049
- D = null, $(), await t.releaseLock(e.templateId, e.blockId).catch(() => {});
1043
+ let e = D;
1044
+ if (!(!e || O?.templateId === e.templateId && O.blockId === e.blockId)) try {
1045
+ await r.acquireLock(e.templateId, e.blockId), O = e, ze(), je(e.blockId);
1046
+ } catch (t) {
1047
+ if (O?.templateId === e.templateId) {
1048
+ let e = O;
1049
+ O = null, $(), await r.releaseLock(e.templateId, e.blockId).catch(() => {});
1050
1050
  }
1051
- if (T !== e) return;
1052
- Re(e.blockId, n);
1051
+ if (D !== e) return;
1052
+ Re(e.blockId, t);
1053
1053
  }
1054
1054
  });
1055
1055
  }
@@ -1061,78 +1061,78 @@ function Re(e) {
1061
1061
  function Re(e, t) {
1062
1062
  let n = Me(t);
1063
1063
  if (n === "lock_held" || n === "block_missing") {
1064
- T = null;
1064
+ D = null;
1065
1065
  let n = Ne(t);
1066
1066
  n ? xe({
1067
1067
  blockId: e,
1068
1068
  holder: n,
1069
1069
  expiresAt: ""
1070
1070
  }) : h?.state.selectedBlockId === e && h.selectBlock(null);
1071
- } else P(t), setTimeout(() => {
1072
- T?.blockId === e && Q();
1071
+ } else F(t), setTimeout(() => {
1072
+ D?.blockId === e && Q();
1073
1073
  }, Oe[0]);
1074
1074
  }
1075
1075
  function ze() {
1076
- k ||= setInterval(() => {
1076
+ j ||= setInterval(() => {
1077
1077
  we(async () => {
1078
- let e = D;
1078
+ let e = O;
1079
1079
  if (e) try {
1080
- await t.renewLock(e.templateId, e.blockId);
1080
+ await r.renewLock(e.templateId, e.blockId);
1081
1081
  } catch (e) {
1082
1082
  if (Me(e) === "lock_lost") {
1083
- D = null, $(), Q();
1083
+ O = null, $(), Q();
1084
1084
  return;
1085
1085
  }
1086
- P(e);
1086
+ F(e);
1087
1087
  }
1088
1088
  });
1089
1089
  }, De);
1090
1090
  }
1091
1091
  function $() {
1092
- k &&= (clearInterval(k), null);
1092
+ j &&= (clearInterval(j), null);
1093
1093
  }
1094
1094
  function Be(e) {
1095
- U(), g && (T = e ? {
1095
+ W(), g && (D = e ? {
1096
1096
  templateId: g.templateId,
1097
1097
  blockId: e
1098
1098
  } : null, Q());
1099
1099
  }
1100
1100
  function Ve() {
1101
- U(), D && s && (t.releaseLock(D.templateId, D.blockId).catch(() => {}), D = null, $()), g?.leave?.(), g && (g.leave = null);
1101
+ W(), O && o && (r.releaseLock(O.templateId, O.blockId).catch(() => {}), O = null, $()), g?.leave?.(), g && (g.leave = null);
1102
1102
  }
1103
1103
  function He(e) {
1104
1104
  let t = g;
1105
1105
  if (!t || _) return;
1106
- U();
1106
+ W();
1107
1107
  let n = (e === "undo" ? t.undo : t.redo).pop();
1108
1108
  if (!n) return;
1109
- L();
1109
+ z();
1110
1110
  let r;
1111
1111
  try {
1112
- r = j(t.view, n.ops, I());
1112
+ r = k(t.view, n.ops, R());
1113
1113
  } catch (e) {
1114
- if (!(e instanceof N)) throw e;
1115
- F({
1114
+ if (!(e instanceof I)) throw e;
1115
+ L({
1116
1116
  type: "undoSkipped",
1117
1117
  code: e.code
1118
1118
  });
1119
1119
  return;
1120
1120
  }
1121
- let i = { ops: te(t.view, n.ops) };
1122
- R(e === "undo" ? t.redo : t.undo, i), t.view = r, B(r), h?.markDirty(), ie(t, n.ops, e, i);
1121
+ let i = { ops: P(t.view, n.ops) };
1122
+ B(e === "undo" ? t.redo : t.undo, i), t.view = r, V(r), h?.markDirty(), re(t, n.ops, e, i);
1123
1123
  }
1124
1124
  function Ue(e, t) {
1125
1125
  let n = g;
1126
1126
  if (!h || !n || _) return {
1127
1127
  applied: !1,
1128
- error: new N("invalid_operation", 0, "No template is open for editing.")
1128
+ error: new I("invalid_operation", 0, "No template is open for editing.")
1129
1129
  };
1130
- U();
1130
+ W();
1131
1131
  let r, i;
1132
1132
  try {
1133
- r = j(n.view, e, I()), i = te(n.view, e);
1133
+ r = k(n.view, e, R()), i = P(n.view, e);
1134
1134
  } catch (e) {
1135
- if (e instanceof N) return {
1135
+ if (e instanceof I) return {
1136
1136
  applied: !1,
1137
1137
  error: e
1138
1138
  };
@@ -1142,16 +1142,16 @@ function Re(e) {
1142
1142
  return a && a.turn === t.turn ? (a.ops = [...i, ...a.ops], o = a) : (o = {
1143
1143
  ops: i,
1144
1144
  turn: t.turn
1145
- }, R(n.undo, o)), n.redo = [], L(), n.view = r, B(r), h.markDirty(), ie(n, e, t.origin, o), {
1145
+ }, B(n.undo, o)), n.redo = [], z(), n.view = r, V(r), h.markDirty(), re(n, e, t.origin, o), {
1146
1146
  applied: !0,
1147
1147
  inverse: i
1148
1148
  };
1149
1149
  }
1150
1150
  function We(e) {
1151
- h = e, w.push(b(() => e.state.template, (e) => be(e), { immediate: !0 }), b(() => e.content.value, V, { deep: !0 }), b(() => e.state.selectedBlockId, Be), b(() => e.state.isLoading, (e) => e ? ne(!0, !0) : V())), typeof window < "u" && (window.addEventListener("pagehide", Ve), window.addEventListener("blur", U)), n() && c(Je);
1151
+ h = e, w.push(p(() => e.state.template, (e) => be(e), { immediate: !0 }), p(() => e.content.value, te, { deep: !0 }), p(() => e.state.selectedBlockId, Be), p(() => e.state.isLoading, (e) => e ? U(!0, !0) : te())), typeof window < "u" && (window.addEventListener("pagehide", Ve), window.addEventListener("blur", W)), n() && c(Je);
1152
1152
  }
1153
1153
  function Ge() {
1154
- U();
1154
+ W();
1155
1155
  let e = g;
1156
1156
  return !e || e.pending.length === 0 ? Promise.resolve() : new Promise((t, n) => e.waiters.push({
1157
1157
  resolve: t,
@@ -1159,33 +1159,33 @@ function Re(e) {
1159
1159
  }));
1160
1160
  }
1161
1161
  function Ke() {
1162
- U(), _ = !0;
1162
+ W(), _ = !0;
1163
1163
  }
1164
1164
  function qe() {
1165
- _ = !1, g && B(g.view);
1165
+ _ = !1, g && V(g.view);
1166
1166
  }
1167
1167
  function Je() {
1168
1168
  if (!C) {
1169
- U();
1169
+ W();
1170
1170
  for (let e of w.splice(0)) e();
1171
- H(), Ve(), C = !0, g && ve(g), g = null, $(), typeof window < "u" && (window.removeEventListener("pagehide", Ve), window.removeEventListener("blur", U));
1171
+ H(), Ve(), C = !0, g && ve(g), g = null, $(), typeof window < "u" && (window.removeEventListener("pagehide", Ve), window.removeEventListener("blur", W));
1172
1172
  }
1173
1173
  }
1174
1174
  return {
1175
- sessionId: r,
1175
+ sessionId: i,
1176
1176
  members: l,
1177
1177
  locks: u,
1178
1178
  connection: d,
1179
- revision: p,
1180
- canUndo: A,
1181
- canRedo: M,
1179
+ revision: f,
1180
+ canUndo: M,
1181
+ canRedo: N,
1182
1182
  attach: We,
1183
1183
  undo: () => He("undo"),
1184
1184
  redo: () => He("redo"),
1185
1185
  clearHistory: () => {
1186
- g && (g.undo = [], g.redo = [], L());
1186
+ g && (g.undo = [], g.redo = [], z());
1187
1187
  },
1188
- flush: U,
1188
+ flush: W,
1189
1189
  settle: Ge,
1190
1190
  suspend: Ke,
1191
1191
  resume: qe,
@@ -1195,81 +1195,81 @@ function Re(e) {
1195
1195
  destroy: Je
1196
1196
  };
1197
1197
  }
1198
- function ze(e) {
1199
- let { provider: t } = e, n = a([]), r = a(!1), i = d(() => {
1198
+ function ze(t) {
1199
+ let { provider: n } = t, r = e([]), i = e(!1), a = f(() => {
1200
1200
  let e = /* @__PURE__ */ new Set();
1201
- for (let t of n.value) {
1201
+ for (let t of r.value) {
1202
1202
  let n = t.category?.trim();
1203
1203
  n && e.add(n);
1204
1204
  }
1205
1205
  return [...e].sort((e, t) => e.localeCompare(t));
1206
- }), o = d(() => typeof t.create == "function"), s = d(() => typeof t.update == "function"), c = d(() => typeof t.delete == "function");
1206
+ }), o = f(() => typeof n.create == "function"), s = f(() => typeof n.update == "function"), c = f(() => typeof n.delete == "function");
1207
1207
  function l(e) {
1208
1208
  return s.value && e.canUpdate !== !1;
1209
1209
  }
1210
1210
  function u(e) {
1211
1211
  return c.value && e.canDelete !== !1;
1212
1212
  }
1213
- function f(e, t) {
1214
- throw new I(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1213
+ function d(e, t) {
1214
+ throw new L(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
1215
1215
  }
1216
- function p(t) {
1217
- J(e.onError, t);
1216
+ function p(e) {
1217
+ Y(t.onError, e);
1218
1218
  }
1219
- async function m(i) {
1220
- r.value = !0;
1219
+ async function m(e) {
1220
+ i.value = !0;
1221
1221
  try {
1222
- n.value = await t.list(i);
1223
- } catch (t) {
1224
- throw e.onError?.(t), t;
1222
+ r.value = await n.list(e);
1223
+ } catch (e) {
1224
+ throw t.onError?.(e), e;
1225
1225
  } finally {
1226
- r.value = !1;
1226
+ i.value = !1;
1227
1227
  }
1228
1228
  }
1229
- async function h(r, i, a) {
1230
- let { create: o } = t;
1231
- typeof o != "function" && f("create", "disabled by the provider");
1229
+ async function h(e, i, a) {
1230
+ let { create: o } = n;
1231
+ typeof o != "function" && d("create", "disabled by the provider");
1232
1232
  try {
1233
- let e = await o(a ? {
1234
- name: r,
1233
+ let t = await o(a ? {
1234
+ name: e,
1235
1235
  content: i,
1236
1236
  category: a
1237
1237
  } : {
1238
- name: r,
1238
+ name: e,
1239
1239
  content: i
1240
1240
  });
1241
- return n.value = [e, ...n.value], p(() => t.onCreated?.(e)), e;
1242
- } catch (t) {
1243
- throw e.onError?.(t), t;
1241
+ return r.value = [t, ...r.value], p(() => n.onCreated?.(t)), t;
1242
+ } catch (e) {
1243
+ throw t.onError?.(e), e;
1244
1244
  }
1245
1245
  }
1246
- async function g(r, i) {
1247
- let { update: a } = t;
1248
- typeof a != "function" && f("update", "disabled by the provider");
1249
- let o = n.value.find((e) => e.id === r);
1250
- o && o.canUpdate === !1 && f("update", `not permitted for entry "${r}"`);
1246
+ async function g(e, i) {
1247
+ let { update: a } = n;
1248
+ typeof a != "function" && d("update", "disabled by the provider");
1249
+ let o = r.value.find((t) => t.id === e);
1250
+ o && o.canUpdate === !1 && d("update", `not permitted for entry "${e}"`);
1251
1251
  try {
1252
- let e = await a(r, i);
1253
- return n.value = n.value.map((t) => t.id === r ? e : t), p(() => t.onUpdated?.(e)), e;
1254
- } catch (t) {
1255
- throw e.onError?.(t), t;
1252
+ let t = await a(e, i);
1253
+ return r.value = r.value.map((n) => n.id === e ? t : n), p(() => n.onUpdated?.(t)), t;
1254
+ } catch (e) {
1255
+ throw t.onError?.(e), e;
1256
1256
  }
1257
1257
  }
1258
- async function _(r) {
1259
- let { delete: i } = t;
1260
- typeof i != "function" && f("delete", "disabled by the provider");
1261
- let a = n.value.find((e) => e.id === r) ?? null;
1262
- a && a.canDelete === !1 && f("delete", `not permitted for entry "${r}"`);
1258
+ async function _(e) {
1259
+ let { delete: i } = n;
1260
+ typeof i != "function" && d("delete", "disabled by the provider");
1261
+ let a = r.value.find((t) => t.id === e) ?? null;
1262
+ a && a.canDelete === !1 && d("delete", `not permitted for entry "${e}"`);
1263
1263
  try {
1264
- await i(r), n.value = n.value.filter((e) => e.id !== r), a && p(() => t.onDeleted?.(a));
1265
- } catch (t) {
1266
- throw e.onError?.(t), t;
1264
+ await i(e), r.value = r.value.filter((t) => t.id !== e), a && p(() => n.onDeleted?.(a));
1265
+ } catch (e) {
1266
+ throw t.onError?.(e), e;
1267
1267
  }
1268
1268
  }
1269
1269
  return {
1270
- savedBlocks: n,
1271
- isLoading: r,
1272
- categories: i,
1270
+ savedBlocks: r,
1271
+ isLoading: i,
1272
+ categories: a,
1273
1273
  canCreate: o,
1274
1274
  canUpdate: s,
1275
1275
  canDelete: c,
@@ -1308,7 +1308,7 @@ function Be(e = {}) {
1308
1308
  },
1309
1309
  async create(e) {
1310
1310
  let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
1311
- id: T(),
1311
+ id: O(),
1312
1312
  name: e.name,
1313
1313
  content: e.content,
1314
1314
  ...e.category ? { category: e.category } : {},
@@ -1374,7 +1374,7 @@ function Ue(e = {}) {
1374
1374
  },
1375
1375
  async create(e) {
1376
1376
  let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
1377
- id: T(),
1377
+ id: O(),
1378
1378
  url: t,
1379
1379
  filename: e.filename || e.file.name,
1380
1380
  createdAt: n,
@@ -1409,74 +1409,74 @@ function Ue(e = {}) {
1409
1409
  storage: !1
1410
1410
  };
1411
1411
  }
1412
- function We(e) {
1413
- let { provider: t, getTemplateId: n } = e, r = a([]), i = a(!1), o = a(void 0), s = a(!1), c = /* @__PURE__ */ new Map(), l = d(() => typeof t.create == "function"), u = d(() => typeof t.restore == "function");
1414
- function f(e) {
1415
- let t = n();
1416
- if (!t) throw new I(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
1412
+ function We(t) {
1413
+ let { provider: n, getTemplateId: r } = t, i = e([]), a = e(!1), o = e(void 0), s = e(!1), c = /* @__PURE__ */ new Map(), l = f(() => typeof n.create == "function"), u = f(() => typeof n.restore == "function");
1414
+ function d(e) {
1415
+ let t = r();
1416
+ if (!t) throw new L(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
1417
1417
  return t;
1418
1418
  }
1419
1419
  function p(e) {
1420
- throw new I(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
1420
+ throw new L(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
1421
1421
  }
1422
- function m(t) {
1423
- J(e.onError, t);
1422
+ function m(e) {
1423
+ Y(t.onError, e);
1424
1424
  }
1425
- async function h(n) {
1426
- let a = f("list");
1427
- i.value = !0;
1425
+ async function h(e) {
1426
+ let r = d("list");
1427
+ a.value = !0;
1428
1428
  try {
1429
- let e = await t.list(a, n);
1430
- r.value = e.versions, o.value = e.nextCursor;
1431
- } catch (t) {
1432
- throw e.onError?.(t), t;
1429
+ let t = await n.list(r, e);
1430
+ i.value = t.versions, o.value = t.nextCursor;
1431
+ } catch (e) {
1432
+ throw t.onError?.(e), e;
1433
1433
  } finally {
1434
- i.value = !1;
1434
+ a.value = !1;
1435
1435
  }
1436
1436
  }
1437
1437
  function g(e) {
1438
1438
  return e.content ?? c.get(e.id) ?? null;
1439
1439
  }
1440
- async function _(n) {
1441
- let r = g(n);
1440
+ async function _(e) {
1441
+ let r = g(e);
1442
1442
  if (r) return r;
1443
- let i = f("get");
1443
+ let i = d("get");
1444
1444
  try {
1445
- let e = await t.get(i, n.id);
1446
- return c.set(n.id, e), e;
1447
- } catch (t) {
1448
- throw e.onError?.(t), t;
1445
+ let t = await n.get(i, e.id);
1446
+ return c.set(e.id, t), t;
1447
+ } catch (e) {
1448
+ throw t.onError?.(e), e;
1449
1449
  }
1450
1450
  }
1451
- async function v(n, i) {
1452
- let { create: a } = t;
1451
+ async function v(e, r) {
1452
+ let { create: a } = n;
1453
1453
  typeof a != "function" && p("create");
1454
- let o = f("create");
1454
+ let o = d("create");
1455
1455
  try {
1456
- let e = await a(o, n, i);
1457
- return r.value = [e, ...r.value], m(() => t.onCreated?.(e)), e;
1458
- } catch (t) {
1459
- throw e.onError?.(t), t;
1456
+ let t = await a(o, e, r);
1457
+ return i.value = [t, ...i.value], m(() => n.onCreated?.(t)), t;
1458
+ } catch (e) {
1459
+ throw t.onError?.(e), e;
1460
1460
  }
1461
1461
  }
1462
- async function y(n) {
1463
- let { restore: r } = t;
1462
+ async function y(e) {
1463
+ let { restore: r } = n;
1464
1464
  typeof r != "function" && p("restore");
1465
- let i = f("restore"), a;
1465
+ let i = d("restore"), a;
1466
1466
  s.value = !0;
1467
1467
  try {
1468
- a = await r(i, n);
1469
- } catch (t) {
1470
- throw e.onError?.(t), t;
1468
+ a = await r(i, e);
1469
+ } catch (e) {
1470
+ throw t.onError?.(e), e;
1471
1471
  } finally {
1472
1472
  s.value = !1;
1473
1473
  }
1474
- return m(() => t.onRestored?.(a)), a;
1474
+ return m(() => n.onRestored?.(a)), a;
1475
1475
  }
1476
1476
  return {
1477
1477
  nextCursor: o,
1478
- versions: r,
1479
- isLoading: i,
1478
+ versions: i,
1479
+ isLoading: a,
1480
1480
  isRestoring: s,
1481
1481
  canCreate: l,
1482
1482
  canRestore: u,
@@ -1487,42 +1487,42 @@ function We(e) {
1487
1487
  restore: y
1488
1488
  };
1489
1489
  }
1490
- function Ge(e) {
1491
- let { provider: t, getTemplateId: n, getUser: r } = e, i = a([]), o = a(!1), s = a(!1), c = d(() => typeof t.create == "function"), l = d(() => typeof t.update == "function"), u = d(() => typeof t.delete == "function"), f = d(() => typeof t.setResolved == "function"), p = d(() => i.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), m = d(() => i.value.filter((e) => !e.resolvedAt).length), h = d(() => {
1490
+ function Ge(t) {
1491
+ let { provider: n, getTemplateId: r, getUser: i } = t, a = e([]), o = e(!1), s = e(!1), c = f(() => typeof n.create == "function"), l = f(() => typeof n.update == "function"), u = f(() => typeof n.delete == "function"), d = f(() => typeof n.setResolved == "function"), p = f(() => a.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), m = f(() => a.value.filter((e) => !e.resolvedAt).length), h = f(() => {
1492
1492
  let e = /* @__PURE__ */ new Map();
1493
- for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
1493
+ for (let t of a.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
1494
1494
  return e;
1495
1495
  });
1496
1496
  function g(e) {
1497
- let t = n();
1498
- if (!t) throw new I(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
1497
+ let t = r();
1498
+ if (!t) throw new L(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
1499
1499
  return t;
1500
1500
  }
1501
1501
  function _(e) {
1502
- let t = r();
1503
- if (!t) throw new I(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
1502
+ let t = i();
1503
+ if (!t) throw new L(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
1504
1504
  return t;
1505
1505
  }
1506
1506
  function v(e) {
1507
- throw new I(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
1507
+ throw new L(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
1508
1508
  }
1509
1509
  function y(e) {
1510
- for (let t of i.value) {
1510
+ for (let t of a.value) {
1511
1511
  if (t.id === e) return t;
1512
1512
  for (let n of t.replies ?? []) if (n.id === e) return n;
1513
1513
  }
1514
1514
  return null;
1515
1515
  }
1516
1516
  function b(e) {
1517
- let t = r();
1517
+ let t = i();
1518
1518
  return t !== null && e.author.id === t.id;
1519
1519
  }
1520
- function x(t) {
1521
- let n = q(t);
1522
- throw e.onError?.(n), n;
1520
+ function x(e) {
1521
+ let n = J(e);
1522
+ throw t.onError?.(n), n;
1523
1523
  }
1524
- function S(t) {
1525
- J(e.onError, t);
1524
+ function S(e) {
1525
+ Y(t.onError, e);
1526
1526
  }
1527
1527
  function C(e, t, n) {
1528
1528
  return [
@@ -1536,7 +1536,7 @@ function Ge(e) {
1536
1536
  }
1537
1537
  function T(e) {
1538
1538
  if (e.parentId) {
1539
- let t = !1, n = i.value.map((n) => {
1539
+ let t = !1, n = a.value.map((n) => {
1540
1540
  if (n.id !== e.parentId) return n;
1541
1541
  let r = n.replies ?? [], i = r.findIndex((t) => t.id === e.id);
1542
1542
  return i !== -1 && w(r[i], e) ? n : (t = !0, {
@@ -1544,122 +1544,122 @@ function Ge(e) {
1544
1544
  replies: i === -1 ? [...r, e] : C(r, i, e)
1545
1545
  });
1546
1546
  });
1547
- return t && (i.value = n), t;
1547
+ return t && (a.value = n), t;
1548
1548
  }
1549
- let t = i.value.findIndex((t) => t.id === e.id);
1550
- if (t === -1) return i.value = [...i.value, e], !0;
1549
+ let t = a.value.findIndex((t) => t.id === e.id);
1550
+ if (t === -1) return a.value = [...a.value, e], !0;
1551
1551
  let n = {
1552
1552
  ...e,
1553
- replies: e.replies ?? i.value[t].replies
1553
+ replies: e.replies ?? a.value[t].replies
1554
1554
  };
1555
- return !w(i.value[t], n) && (i.value = C(i.value, t, n), !0);
1555
+ return !w(a.value[t], n) && (a.value = C(a.value, t, n), !0);
1556
1556
  }
1557
1557
  function E(e, t) {
1558
1558
  let n = y(e), r = t ?? n?.parentId ?? null;
1559
- return r ? i.value = i.value.map((t) => t.id === r ? {
1559
+ return r ? a.value = a.value.map((t) => t.id === r ? {
1560
1560
  ...t,
1561
1561
  replies: (t.replies ?? []).filter((t) => t.id !== e)
1562
- } : t) : i.value = i.value.filter((t) => t.id !== e), n;
1562
+ } : t) : a.value = a.value.filter((t) => t.id !== e), n;
1563
1563
  }
1564
- async function ee(e) {
1565
- let n = g("list");
1564
+ async function D(e) {
1565
+ let t = g("list");
1566
1566
  o.value = !0;
1567
1567
  try {
1568
- i.value = await t.list(n, e);
1568
+ a.value = await n.list(t, e);
1569
1569
  } catch (e) {
1570
1570
  x(e);
1571
1571
  } finally {
1572
1572
  o.value = !1;
1573
1573
  }
1574
1574
  }
1575
- async function D(e) {
1576
- let { create: n } = t;
1577
- typeof n != "function" && v("create");
1575
+ async function O(e) {
1576
+ let { create: t } = n;
1577
+ typeof t != "function" && v("create");
1578
1578
  let r = g("create");
1579
1579
  _("create"), s.value = !0;
1580
1580
  try {
1581
- let i = await n(r, e);
1582
- return T(i), S(() => t.onCreated?.(i, { origin: "local" })), i;
1581
+ let i = await t(r, e);
1582
+ return T(i), S(() => n.onCreated?.(i, { origin: "local" })), i;
1583
1583
  } catch (e) {
1584
1584
  x(e);
1585
1585
  } finally {
1586
1586
  s.value = !1;
1587
1587
  }
1588
1588
  }
1589
- async function O(e, n) {
1590
- let { update: r } = t;
1589
+ async function k(e, t) {
1590
+ let { update: r } = n;
1591
1591
  typeof r != "function" && v("update");
1592
1592
  let i = g("update");
1593
1593
  _("update"), s.value = !0;
1594
1594
  try {
1595
- let a = await r(i, e, n);
1596
- return T(a), S(() => t.onUpdated?.(a, { origin: "local" })), a;
1595
+ let a = await r(i, e, t);
1596
+ return T(a), S(() => n.onUpdated?.(a, { origin: "local" })), a;
1597
1597
  } catch (e) {
1598
1598
  x(e);
1599
1599
  } finally {
1600
1600
  s.value = !1;
1601
1601
  }
1602
1602
  }
1603
- async function k(e) {
1604
- let { delete: n } = t;
1605
- typeof n != "function" && v("delete");
1603
+ async function A(e) {
1604
+ let { delete: t } = n;
1605
+ typeof t != "function" && v("delete");
1606
1606
  let r = g("delete");
1607
1607
  _("delete");
1608
1608
  let i = y(e);
1609
1609
  s.value = !0;
1610
1610
  try {
1611
- await n(r, e), E(e), i && S(() => t.onDeleted?.(i, { origin: "local" }));
1611
+ await t(r, e), E(e), i && S(() => n.onDeleted?.(i, { origin: "local" }));
1612
1612
  } catch (e) {
1613
1613
  x(e);
1614
1614
  } finally {
1615
1615
  s.value = !1;
1616
1616
  }
1617
1617
  }
1618
- async function A(e, n) {
1619
- let { setResolved: r } = t;
1618
+ async function j(e, t) {
1619
+ let { setResolved: r } = n;
1620
1620
  typeof r != "function" && v("setResolved");
1621
1621
  let i = g("setResolved");
1622
1622
  _("setResolved"), s.value = !0;
1623
1623
  try {
1624
- let a = await r(i, e, n);
1625
- return T(a), S(() => (a.resolvedAt ? t.onResolved : t.onUnresolved)?.(a, { origin: "local" })), a;
1624
+ let a = await r(i, e, t);
1625
+ return T(a), S(() => (a.resolvedAt ? n.onResolved : n.onUnresolved)?.(a, { origin: "local" })), a;
1626
1626
  } catch (e) {
1627
1627
  x(e);
1628
1628
  } finally {
1629
1629
  s.value = !1;
1630
1630
  }
1631
1631
  }
1632
- function j(e) {
1633
- T(e) && S(() => t.onCreated?.(e, { origin: "remote" }));
1634
- }
1635
1632
  function M(e) {
1636
- T(e) && S(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
1633
+ T(e) && S(() => n.onCreated?.(e, { origin: "remote" }));
1634
+ }
1635
+ function N(e) {
1636
+ T(e) && S(() => (e.resolvedAt ? n.onResolved : n.onUpdated)?.(e, { origin: "remote" }));
1637
1637
  }
1638
- function N(e, n) {
1639
- let r = E(e, n);
1640
- r && S(() => t.onDeleted?.(r, { origin: "remote" }));
1638
+ function P(e, t) {
1639
+ let r = E(e, t);
1640
+ r && S(() => n.onDeleted?.(r, { origin: "remote" }));
1641
1641
  }
1642
1642
  return {
1643
- comments: i,
1643
+ comments: a,
1644
1644
  isLoading: o,
1645
1645
  isSubmitting: s,
1646
1646
  canCreate: c,
1647
1647
  canUpdate: l,
1648
1648
  canDelete: u,
1649
- canResolve: f,
1649
+ canResolve: d,
1650
1650
  totalCount: p,
1651
1651
  unresolvedCount: m,
1652
1652
  commentCountByBlock: h,
1653
- load: ee,
1654
- create: D,
1655
- update: O,
1656
- remove: k,
1657
- setResolved: A,
1653
+ load: D,
1654
+ create: O,
1655
+ update: k,
1656
+ remove: A,
1657
+ setResolved: j,
1658
1658
  find: y,
1659
1659
  isOwn: b,
1660
- applyRemoteCreate: j,
1661
- applyRemoteUpdate: M,
1662
- applyRemoteDelete: N
1660
+ applyRemoteCreate: M,
1661
+ applyRemoteUpdate: N,
1662
+ applyRemoteDelete: P
1663
1663
  };
1664
1664
  }
1665
1665
  function Ke(e) {
@@ -1683,13 +1683,11 @@ function Ke(e) {
1683
1683
  }));
1684
1684
  }, { immediate: !0 }), c(o);
1685
1685
  }
1686
- //#endregion
1687
- //#region src/constants/timeouts.ts
1686
+ // src/constants/timeouts.ts
1688
1687
  var qe = 1e4;
1689
- //#endregion
1690
- //#region src/composables/useImageUrlResolver.ts
1688
+ // src/composables/useImageUrlResolver.ts
1691
1689
  function Je(e) {
1692
- let t = s(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
1690
+ let t = l(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
1693
1691
  function r(e) {
1694
1692
  return t.get(e);
1695
1693
  }
@@ -1718,7 +1716,7 @@ function Je(e) {
1718
1716
  };
1719
1717
  }
1720
1718
  function Ye(e) {
1721
- let r = t(W, null), i = d(e);
1719
+ let r = t(G, null), i = f(e);
1722
1720
  if (!r) return i;
1723
1721
  let a;
1724
1722
  function o() {
@@ -1732,7 +1730,7 @@ function Ye(e) {
1732
1730
  s = !1, e && !r.has(e) && (t ? r.lookup(e) : a = setTimeout(() => {
1733
1731
  a = void 0, r.lookup(e);
1734
1732
  }, 300));
1735
- }, { immediate: !0 }), d(() => {
1733
+ }, { immediate: !0 }), f(() => {
1736
1734
  let e = i.value;
1737
1735
  if (!e) return e;
1738
1736
  let t = r.get(e);
@@ -1745,21 +1743,20 @@ function Xe(e, t) {
1745
1743
  return typeof n == "string" && n.length > 0 ? n : t;
1746
1744
  }
1747
1745
  function Ze(e, t) {
1748
- return typeof e?.url == "string" && V(e.url, t);
1746
+ return typeof e?.url == "string" && w(e.url, t);
1749
1747
  }
1750
1748
  function Qe(e, t) {
1751
1749
  let n = e?.url;
1752
- if (typeof n == "string" && n.trim() !== "") return V(n, t) ? void 0 : n;
1750
+ if (typeof n == "string" && n.trim() !== "") return w(n, t) ? void 0 : n;
1753
1751
  }
1754
1752
  function $e(e) {
1755
- let n = t(re, A.liquid), r = Ye(() => Qe(e(), n));
1756
- return d(() => Ze(e(), n) ? null : r.value);
1753
+ let n = t(ne, R.liquid), r = Ye(() => Qe(e(), n));
1754
+ return f(() => Ze(e(), n) ? null : r.value);
1757
1755
  }
1758
1756
  function et(e, t, n) {
1759
1757
  return Ze(t, n) ? null : Xe(e, Qe(t, n));
1760
1758
  }
1761
- //#endregion
1762
- //#region src/utils/blockTypeLabels.ts
1759
+ // src/utils/blockTypeLabels.ts
1763
1760
  function tt(e, t) {
1764
1761
  return t.blocks[e] ?? e;
1765
1762
  }
@@ -1768,10 +1765,9 @@ function nt(e, t, n = []) {
1768
1765
  let { customType: r } = e;
1769
1766
  return n.find((e) => e.type === r)?.name ?? r;
1770
1767
  }
1771
- //#endregion
1772
- //#region src/utils/resolveFieldColors.ts
1768
+ // src/utils/resolveFieldColors.ts
1773
1769
  function rt(e, t) {
1774
- let n = G({ presets: e.presets }, oe), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
1770
+ let n = K({ presets: e.presets }, ae), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
1775
1771
  return {
1776
1772
  presets: r ? t.presets : n.presets,
1777
1773
  allowCustom: t.allowCustom !== !1 && i,
@@ -1781,7 +1777,7 @@ function rt(e, t) {
1781
1777
  allowCustomIgnored: e.allowCustom === !0 && t.allowCustom === !1
1782
1778
  };
1783
1779
  }
1784
- var it = K({
1780
+ var it = q({
1785
1781
  name: "code",
1786
1782
  size: 24,
1787
1783
  node: [["path", {
@@ -1791,14 +1787,14 @@ var it = K({
1791
1787
  d: "m8 6-6 6 6 6",
1792
1788
  key: "ppft3o"
1793
1789
  }]]
1794
- }), at = K({
1790
+ }), at = q({
1795
1791
  name: "navigation",
1796
1792
  size: 24,
1797
1793
  node: [["polygon", {
1798
1794
  points: "3 11 22 2 13 21 11 13 3 11",
1799
1795
  key: "1ltx0t"
1800
1796
  }]]
1801
- }), ot = K({
1797
+ }), ot = q({
1802
1798
  name: "share-2",
1803
1799
  size: 24,
1804
1800
  node: [
@@ -1835,7 +1831,7 @@ var it = K({
1835
1831
  key: "1n3mei"
1836
1832
  }]
1837
1833
  ]
1838
- }), st = K({
1834
+ }), st = q({
1839
1835
  name: "table",
1840
1836
  size: 24,
1841
1837
  node: [
@@ -1861,8 +1857,7 @@ var it = K({
1861
1857
  }]
1862
1858
  ]
1863
1859
  });
1864
- //#endregion
1865
- //#region src/utils/imageNaturalSize.ts
1860
+ // src/utils/imageNaturalSize.ts
1866
1861
  function ct(e) {
1867
1862
  return typeof e == "number" && Number.isFinite(e) && e > 0;
1868
1863
  }
@@ -1904,16 +1899,15 @@ function pt(e) {
1904
1899
  });
1905
1900
  });
1906
1901
  }
1907
- //#endregion
1908
- //#region src/components/MediaDropOverlay.vue
1902
+ // src/components/MediaDropOverlay.vue
1909
1903
  var mt = /* @__PURE__ */ x({
1910
1904
  __name: "MediaDropOverlay",
1911
1905
  props: {
1912
1906
  uploading: { type: Boolean },
1913
1907
  size: { default: "field" }
1914
1908
  },
1915
- setup(t) {
1916
- let n = t, { t: i } = ae(), a = {
1909
+ setup(e) {
1910
+ let t = e, { t: n } = ie(), a = {
1917
1911
  field: {
1918
1912
  gap: "tpl:gap-1.5",
1919
1913
  icon: 18,
@@ -1924,33 +1918,31 @@ var mt = /* @__PURE__ */ x({
1924
1918
  icon: 20,
1925
1919
  veil: "85%"
1926
1920
  }
1927
- }, o = d(() => a[n.size]);
1928
- return (n, a) => (g(), p("div", {
1929
- class: e(["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)]", o.value.gap]),
1930
- style: _({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${o.value.veil}, transparent)` })
1931
- }, [t.uploading ? (g(), p(y, { key: 0 }, [u(v(ce), {
1921
+ }, o = f(() => a[t.size]);
1922
+ return (t, a) => (g(), m("div", {
1923
+ class: _(["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)]", o.value.gap]),
1924
+ style: r({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${o.value.veil}, transparent)` })
1925
+ }, [e.uploading ? (g(), m(v, { key: 0 }, [u(y(se), {
1932
1926
  class: "tpl-spinner",
1933
1927
  size: o.value.icon,
1934
1928
  "stroke-width": 2
1935
- }, null, 8, ["size"]), m(" " + r(v(i).image.uploading), 1)], 64)) : (g(), p(y, { key: 1 }, [u(v(se), {
1929
+ }, null, 8, ["size"]), h(" " + i(y(n).image.uploading), 1)], 64)) : (g(), m(v, { key: 1 }, [u(y(oe), {
1936
1930
  size: o.value.icon,
1937
1931
  "stroke-width": 1.5
1938
- }, null, 8, ["size"]), m(" " + r(v(i).image.dropToUpload), 1)], 64))], 6));
1932
+ }, null, 8, ["size"]), h(" " + i(y(n).image.dropToUpload), 1)], 64))], 6));
1939
1933
  }
1940
1934
  });
1941
- //#endregion
1942
- //#region src/composables/useAliveFlag.ts
1935
+ // src/composables/useAliveFlag.ts
1943
1936
  function ht() {
1944
1937
  let e = { alive: !0 };
1945
- return i(() => {
1938
+ return a(() => {
1946
1939
  e.alive = !1;
1947
1940
  }), e;
1948
1941
  }
1949
- //#endregion
1950
- //#region src/composables/useImageDrop.ts
1942
+ // src/composables/useImageDrop.ts
1951
1943
  var gt = "image/";
1952
1944
  function _t(e) {
1953
- let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || h(r), { isOverDropZone: a } = ne(t, {
1945
+ let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || d(r), { isOverDropZone: a } = U(t, {
1954
1946
  preventDefaultForUnhandled: !0,
1955
1947
  onDrop: (e) => {
1956
1948
  if (!i()) return;
@@ -1958,18 +1950,17 @@ function _t(e) {
1958
1950
  t.length > 0 && n([t[0]]);
1959
1951
  }
1960
1952
  });
1961
- return { isOver: d(() => i() && a.value) };
1953
+ return { isOver: f(() => i() && a.value) };
1962
1954
  }
1963
- //#endregion
1964
- //#region src/composables/useMediaDropField.ts
1965
- function vt(e) {
1966
- let { target: n, blocked: r, apply: i } = e, o = t(U, null), s = t(ie, null), c = ht();
1955
+ // src/composables/useMediaDropField.ts
1956
+ function vt(n) {
1957
+ let { target: r, blocked: i, apply: a } = n, o = t(W, null), s = t(re, null), c = ht();
1967
1958
  async function l() {
1968
1959
  let e = await o?.({ accept: ["images"] });
1969
- c.alive && e && i(e);
1960
+ c.alive && e && a(e);
1970
1961
  }
1971
- let u = a(!1), f = d(() => (s?.value ?? !!o) && !u.value && !h(r));
1972
- async function p(e) {
1962
+ let u = e(!1), p = f(() => (s?.value ?? !!o) && !u.value && !d(i));
1963
+ async function m(e) {
1973
1964
  if (o) {
1974
1965
  u.value = !0;
1975
1966
  try {
@@ -1978,20 +1969,20 @@ function vt(e) {
1978
1969
  files: e
1979
1970
  });
1980
1971
  if (!c.alive) return;
1981
- t && i(t);
1972
+ t && a(t);
1982
1973
  } finally {
1983
1974
  c.alive && (u.value = !1);
1984
1975
  }
1985
1976
  }
1986
1977
  }
1987
- let { isOver: m } = _t({
1988
- target: n,
1989
- enabled: f,
1990
- onFiles: p
1991
- }), g = d(() => f.value && m.value || u.value);
1978
+ let { isOver: h } = _t({
1979
+ target: r,
1980
+ enabled: p,
1981
+ onFiles: m
1982
+ }), g = f(() => p.value && h.value || u.value);
1992
1983
  return {
1993
1984
  canBrowse: !!o,
1994
- dropEnabled: f,
1985
+ dropEnabled: p,
1995
1986
  isUploading: u,
1996
1987
  showOverlay: g,
1997
1988
  openMediaBrowser: l
@@ -2012,7 +2003,7 @@ var bt = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", xt = {
2012
2003
  "2-1": [66.67, 33.33]
2013
2004
  };
2014
2005
  function St(e, t) {
2015
- let n = (e) => Math.trunc(e ?? 0), r = (e) => B(e) === null ? 0 : Math.trunc(e.width);
2006
+ let n = (e) => Math.trunc(e ?? 0), r = (e) => C(e) === null ? 0 : Math.trunc(e.width);
2016
2007
  return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
2017
2008
  }
2018
2009
  function Ct(e, t) {
@@ -2023,23 +2014,23 @@ function wt(e, t) {
2023
2014
  return Math.floor(t) - St(e.styles.padding, n);
2024
2015
  }
2025
2016
  function* Tt(e, t) {
2026
- for (let n of e) O(n) ? yield* Tt(n.children, Ct(t, n.styles.padding)) : yield {
2017
+ for (let n of e) M(n) ? yield* Tt(n.children, Ct(t, n.styles.padding)) : yield {
2027
2018
  block: n,
2028
- bandWidth: F(n) && n.wrapper ? Ct(t, n.wrapper.padding) : t
2019
+ bandWidth: z(n) && n.wrapper ? Ct(t, n.wrapper.padding) : t
2029
2020
  };
2030
2021
  }
2031
2022
  function Et(e, t) {
2032
2023
  if (!t) return e;
2033
2024
  try {
2034
- return M(t, e);
2025
+ return N(t, e);
2035
2026
  } catch {
2036
2027
  return e;
2037
2028
  }
2038
2029
  }
2039
2030
  function Dt(e, t, n) {
2040
2031
  let r = Et(e, n);
2041
- for (let { block: e, bandWidth: n } of Tt(r.blocks, r.settings.width)) if (F(e)) {
2042
- let r = P(e)?.applied ? void 0 : e.border, i = Math.floor(n) - St(e.styles.padding, r), a = xt[e.columns] ?? [100];
2032
+ for (let { block: e, bandWidth: n } of Tt(r.blocks, r.settings.width)) if (z(e)) {
2033
+ let r = B(e)?.applied ? void 0 : e.border, i = Math.floor(n) - St(e.styles.padding, r), a = xt[e.columns] ?? [100];
2043
2034
  for (let n = 0; n < e.children.length; n++) {
2044
2035
  let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
2045
2036
  if (o) return wt(o, r);
@@ -2053,13 +2044,12 @@ function Ot(e, t, n) {
2053
2044
  return null;
2054
2045
  }
2055
2046
  function kt(e, t, n) {
2056
- if (!F(e)) return;
2057
- let r = P(e);
2047
+ if (!z(e)) return;
2048
+ let r = B(e);
2058
2049
  if (r?.applied && r.height === "image") return (t ? Ot(t, e.id, n) : null) ?? yt(t?.settings);
2059
2050
  }
2060
- //#endregion
2061
- //#region src/constants/socialIcons.ts
2062
- var At = k, jt = {
2051
+ // src/constants/socialIcons.ts
2052
+ var At = j, jt = {
2063
2053
  small: 24,
2064
2054
  medium: 32,
2065
2055
  large: 48
@@ -2082,5 +2072,4 @@ var At = k, jt = {
2082
2072
  "dribbble",
2083
2073
  "behance"
2084
2074
  ];
2085
- //#endregion
2086
- export { Ue as A, fe as B, tt as C, $e as D, et as E, Ke as F, ze as H, Ge as I, he as L, me as M, pe as N, Ye as O, Re as P, ge as R, nt as S, Qe as T, We as U, _e as V, st as _, kt as a, it as b, yt as c, mt as d, ft as f, lt as g, ut as h, Dt as i, Be as j, X as k, vt as l, dt as m, At as n, Ot as o, pt as p, Mt as r, bt as s, jt as t, ht as u, ot as v, Je as w, rt as x, at as y, le as z };
2075
+ export { Ue as A, fe as B, tt as C, $e as D, et as E, Ke as F, ze as H, Ge as I, he as L, me as M, pe as N, Ye as O, Re as P, ge as R, nt as S, Qe as T, We as U, _e as V, st as _, kt as a, it as b, yt as c, mt as d, ft as f, lt as g, ut as h, Dt as i, Be as j, X as k, vt as l, dt as m, At as n, Ot as o, pt as p, Mt as r, bt as s, jt as t, ht as u, ot as v, Je as w, rt as x, at as y, ce as z };