@templatical/editor 0.49.0 → 0.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (378) hide show
  1. package/README.md +4 -2
  2. package/dist/AiAltTextPopover-BZQ95GXL.js +106 -0
  3. package/dist/AiAltTextReview-DoBEudnE.js +206 -0
  4. package/dist/AiChatPanel-Bs6sES3b.js +550 -0
  5. package/dist/AiHeaderMenu-BEaTazx4.js +36 -0
  6. package/dist/AiPanels-CfN7A-ZA.js +33 -0
  7. package/dist/AiRewriteMenu-C3ZfDDYy.js +276 -0
  8. package/dist/{BlockIssueBadge-BdpJwim0.js → BlockIssueBadge-CKwZ1Vgn.js} +11 -11
  9. package/dist/{BlockPreviewCanvas-D_sowkf0.js → BlockPreviewCanvas-BXNLLLYi.js} +33 -33
  10. package/dist/CloudHeaderExtras-CsJMEiyN.js +23 -0
  11. package/dist/{CloudPanels-1hwFiJ0G.js → CloudPanels-B4F5m7vy.js} +66 -85
  12. package/dist/{CollaborationNotices-BWpKzueF.js → CollaborationNotices-CNuDp7Y2.js} +19 -16
  13. package/dist/{CollaboratorBar-D87phJsw.js → CollaboratorBar-BtHPiuHq.js} +22 -22
  14. package/dist/{CommentsPanel-BUvUzO3T.js → CommentsPanel-CyCM-BvT.js} +4 -4
  15. package/dist/CommentsSidebar-Ca3DyFOX.js +500 -0
  16. package/dist/{cdn/chunks/CountdownBlock-DB4JNdqh.js → CountdownBlock-DR4Xm2-T.js} +24 -26
  17. package/dist/{CountdownToolbar-CLMIwfK7.js → CountdownToolbar-CEIMPojJ.js} +55 -55
  18. package/dist/IssuesPanel-C8nMUccy.js +360 -0
  19. package/dist/{LoadingTrack-BXOptf5g.js → LoadingTrack-B0RKQWq3.js} +2 -2
  20. package/dist/{LogicTagInsertButton-CR5E4jSG.js → LogicTagInsertButton-CqfU52CO.js} +273 -268
  21. package/dist/{cdn/chunks/MediaEditModal-DD0SZ-S3.js → MediaEditModal-DHtkZ4OU.js} +202 -186
  22. package/dist/{MediaPanels-BVXDkqtH.js → MediaPanels-CGcOB2pR.js} +4 -4
  23. package/dist/{MergeTagInput-BEw_r0PJ.js → MergeTagInput-YnEkorTZ.js} +25 -25
  24. package/dist/{MergeTagModeToggle-CJTpFmVd.js → MergeTagModeToggle-Dhb1DAcQ.js} +40 -40
  25. package/dist/MergeTagTextarea-e4lnwtqZ.js +70 -0
  26. package/dist/ParagraphEditor-B6NK0ytw.js +799 -0
  27. package/dist/{RestoreVersionDialog-BaDpy3cL.js → RestoreVersionDialog-Bq_IGOLJ.js} +21 -21
  28. package/dist/{RichTextEditorContent-CsvniFlI.js → RichTextEditorContent-AOM6fylS.js} +48 -48
  29. package/dist/{SaveBlockDialog-DzWURF_e.js → SaveBlockDialog-C8GngfQx.js} +87 -87
  30. package/dist/{cdn/chunks/SavedBlocksBrowserModal-BMtyUrUP.js → SavedBlocksBrowserModal-wnkvxpm_.js} +102 -99
  31. package/dist/{SavedBlocksPanels-B3Af8ns2.js → SavedBlocksPanels-C2s3q0pJ.js} +9 -9
  32. package/dist/{SavedBlocksPickBar-Dj11-Lqp.js → SavedBlocksPickBar-BjcTiV87.js} +13 -13
  33. package/dist/TemplateSettings-BVBWpiDU.js +237 -0
  34. package/dist/{TestEmailModal-BeRYV3eg.js → TestEmailModal-SyhO9bn3.js} +57 -57
  35. package/dist/{TestEmailPanel-B8c3fQi2.js → TestEmailPanel-BDd2Rtav.js} +4 -4
  36. package/dist/{TitleEditor-CvpNUoAp.js → TitleEditor-pxD53y_l.js} +75 -75
  37. package/dist/ToggleSwitch-D51U9cmR.js +37 -0
  38. package/dist/{Toolbar-BadDSkkF.js → Toolbar-CZSPZYbj.js} +1138 -1138
  39. package/dist/{TplModal-BZgi9Tes.js → TplModal-DCzBzicE.js} +19 -19
  40. package/dist/{VersionHistoryMenu-BRlcQ8wX.js → VersionHistoryMenu-BQeWPT85.js} +35 -35
  41. package/dist/{VersionHistoryPanels-DGkllN3a.js → VersionHistoryPanels-BBm7YbRQ.js} +5 -5
  42. package/dist/{VersionPreviewBanner-F-811aps.js → VersionPreviewBanner-DUGF0tUJ.js} +9 -9
  43. package/dist/WrapperBlock-BO619LAb.js +45 -0
  44. package/dist/aiErrors-D5UOoYOt.js +41 -0
  45. package/dist/aiImageContext-BH4Ss1h3.js +48 -0
  46. package/dist/aiRewritePreview-DLGM05Ge.js +44 -0
  47. package/dist/{blockTypeIcons-CayLluou.js → blockTypeIcons-NzaYvAI4.js} +15 -14
  48. package/dist/bundle-stats.json +8 -8
  49. package/dist/{cdn/chunks/ca-DSJwJ5ov.js → ca-C7mTzW1r.js} +130 -13
  50. package/dist/cdn/chunks/AiAltTextPopover-CQu0Q_ZX.js +107 -0
  51. package/dist/cdn/chunks/AiAltTextPopover-CQu0Q_ZX.js.map +1 -0
  52. package/dist/cdn/chunks/AiAltTextReview-CI2HbWfn.js +207 -0
  53. package/dist/cdn/chunks/AiAltTextReview-CI2HbWfn.js.map +1 -0
  54. package/dist/cdn/chunks/AiChatPanel-BYqn1bKu.js +476 -0
  55. package/dist/cdn/chunks/AiChatPanel-BYqn1bKu.js.map +1 -0
  56. package/dist/cdn/chunks/AiHeaderMenu-oldAAFyL.js +37 -0
  57. package/dist/cdn/chunks/AiHeaderMenu-oldAAFyL.js.map +1 -0
  58. package/dist/cdn/chunks/AiPanels-CIFKQv8Y.js +34 -0
  59. package/dist/cdn/chunks/AiPanels-CIFKQv8Y.js.map +1 -0
  60. package/dist/cdn/chunks/AiRewriteMenu-Bhh71zcc.js +208 -0
  61. package/dist/cdn/chunks/AiRewriteMenu-Bhh71zcc.js.map +1 -0
  62. package/dist/cdn/chunks/{BlockIssueBadge-D1VBS_6x.js → BlockIssueBadge-DAn2vsMJ.js} +13 -13
  63. package/dist/cdn/chunks/{BlockIssueBadge-D1VBS_6x.js.map → BlockIssueBadge-DAn2vsMJ.js.map} +1 -1
  64. package/dist/cdn/chunks/{BlockPreviewCanvas-m2tWRyWv.js → BlockPreviewCanvas-D0--EQkP.js} +38 -38
  65. package/dist/cdn/chunks/{BlockPreviewCanvas-m2tWRyWv.js.map → BlockPreviewCanvas-D0--EQkP.js.map} +1 -1
  66. package/dist/cdn/chunks/CloudHeaderExtras-DaUU8P8R.js +25 -0
  67. package/dist/cdn/chunks/CloudHeaderExtras-DaUU8P8R.js.map +1 -0
  68. package/dist/cdn/chunks/{CloudPanels-XufhBZYF.js → CloudPanels-C3jsxo_f.js} +52 -71
  69. package/dist/cdn/chunks/CloudPanels-C3jsxo_f.js.map +1 -0
  70. package/dist/cdn/chunks/{CollaborationNotices-CBvKEj1Q.js → CollaborationNotices-DjRI8gvs.js} +23 -20
  71. package/dist/cdn/chunks/CollaborationNotices-DjRI8gvs.js.map +1 -0
  72. package/dist/cdn/chunks/{CollaboratorBar-DWW54Bn_.js → CollaboratorBar-Dfzm6A9A.js} +20 -20
  73. package/dist/cdn/chunks/{CollaboratorBar-DWW54Bn_.js.map → CollaboratorBar-Dfzm6A9A.js.map} +1 -1
  74. package/dist/cdn/chunks/CommentsPanel-CSO79OeX.js +20 -0
  75. package/dist/cdn/chunks/{CommentsPanel-R8YLLO3v.js.map → CommentsPanel-CSO79OeX.js.map} +1 -1
  76. package/dist/cdn/chunks/CommentsSidebar-CCvplq1Z.js +470 -0
  77. package/dist/cdn/chunks/{CommentsSidebar-96NZHVq3.js.map → CommentsSidebar-CCvplq1Z.js.map} +1 -1
  78. package/dist/{CountdownBlock-DPQXWRvU.js → cdn/chunks/CountdownBlock-C6USdwk3.js} +19 -17
  79. package/dist/cdn/chunks/{CountdownBlock-DB4JNdqh.js.map → CountdownBlock-C6USdwk3.js.map} +1 -1
  80. package/dist/cdn/chunks/{CountdownToolbar-tmiTPEXm.js → CountdownToolbar-Cjud2Tos.js} +70 -70
  81. package/dist/cdn/chunks/{CountdownToolbar-tmiTPEXm.js.map → CountdownToolbar-Cjud2Tos.js.map} +1 -1
  82. package/dist/cdn/chunks/IssuesPanel-BaWHPDxZ.js +340 -0
  83. package/dist/cdn/chunks/IssuesPanel-BaWHPDxZ.js.map +1 -0
  84. package/dist/cdn/chunks/{LoadingTrack-YU44CM8X.js → LoadingTrack-BIcL4NiY.js} +2 -2
  85. package/dist/cdn/chunks/{LoadingTrack-YU44CM8X.js.map → LoadingTrack-BIcL4NiY.js.map} +1 -1
  86. package/dist/cdn/chunks/{LogicTagInsertButton-BJ2t2vxC.js → LogicTagInsertButton-CsL2JDOG.js} +367 -362
  87. package/dist/cdn/chunks/LogicTagInsertButton-CsL2JDOG.js.map +1 -0
  88. package/dist/{MediaEditModal-C_wxoUMG.js → cdn/chunks/MediaEditModal-BuHCiyMu.js} +544 -560
  89. package/dist/cdn/chunks/MediaEditModal-BuHCiyMu.js.map +1 -0
  90. package/dist/cdn/chunks/MediaPanels-DAgUf_T1.js +45 -0
  91. package/dist/cdn/chunks/{MediaPanels-CkdJ_kGp.js.map → MediaPanels-DAgUf_T1.js.map} +1 -1
  92. package/dist/cdn/chunks/{MergeTagInput-7wXX71DH.js → MergeTagInput-C8U-7LxL.js} +33 -33
  93. package/dist/cdn/chunks/{MergeTagInput-7wXX71DH.js.map → MergeTagInput-C8U-7LxL.js.map} +1 -1
  94. package/dist/cdn/chunks/{MergeTagModeToggle-r9vHH4u_.js → MergeTagModeToggle-Mm-p0A52.js} +41 -41
  95. package/dist/cdn/chunks/{MergeTagModeToggle-r9vHH4u_.js.map → MergeTagModeToggle-Mm-p0A52.js.map} +1 -1
  96. package/dist/cdn/chunks/MergeTagTextarea-DuLScsWM.js +72 -0
  97. package/dist/cdn/chunks/MergeTagTextarea-DuLScsWM.js.map +1 -0
  98. package/dist/cdn/chunks/ParagraphEditor-CqSj6Ayz.js +634 -0
  99. package/dist/cdn/chunks/ParagraphEditor-CqSj6Ayz.js.map +1 -0
  100. package/dist/cdn/chunks/{RestoreVersionDialog-C5cxBRKi.js → RestoreVersionDialog-CdA5osuA.js} +25 -25
  101. package/dist/cdn/chunks/{RestoreVersionDialog-C5cxBRKi.js.map → RestoreVersionDialog-CdA5osuA.js.map} +1 -1
  102. package/dist/cdn/chunks/{RichTextEditorContent-BfE7Bkge.js → RichTextEditorContent-Q1d2xqBT.js} +46 -46
  103. package/dist/cdn/chunks/{RichTextEditorContent-BfE7Bkge.js.map → RichTextEditorContent-Q1d2xqBT.js.map} +1 -1
  104. package/dist/cdn/chunks/{SaveBlockDialog-BKbjUnPM.js → SaveBlockDialog-CijargAy.js} +77 -77
  105. package/dist/cdn/chunks/{SaveBlockDialog-BKbjUnPM.js.map → SaveBlockDialog-CijargAy.js.map} +1 -1
  106. package/dist/cdn/chunks/SavedBlocksBrowserModal-DtOz_X5S.js +357 -0
  107. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BMtyUrUP.js.map → SavedBlocksBrowserModal-DtOz_X5S.js.map} +1 -1
  108. package/dist/cdn/chunks/SavedBlocksPanels-BowyED5h.js +38 -0
  109. package/dist/cdn/chunks/{SavedBlocksPanels-s_gxi1im.js.map → SavedBlocksPanels-BowyED5h.js.map} +1 -1
  110. package/dist/cdn/chunks/{SavedBlocksPickBar-B8WHk5mI.js → SavedBlocksPickBar-BPRaJBv3.js} +18 -18
  111. package/dist/cdn/chunks/{SavedBlocksPickBar-B8WHk5mI.js.map → SavedBlocksPickBar-BPRaJBv3.js.map} +1 -1
  112. package/dist/cdn/chunks/TemplateSettings-ByZeBO34.js +209 -0
  113. package/dist/cdn/chunks/{TemplateSettings-CtrzzQWl.js.map → TemplateSettings-ByZeBO34.js.map} +1 -1
  114. package/dist/cdn/chunks/{TestEmailModal-DuZKYMWD.js → TestEmailModal-BUVTj3Ic.js} +54 -54
  115. package/dist/cdn/chunks/{TestEmailModal-DuZKYMWD.js.map → TestEmailModal-BUVTj3Ic.js.map} +1 -1
  116. package/dist/cdn/chunks/TestEmailPanel-BxutYoWg.js +35 -0
  117. package/dist/cdn/chunks/{TestEmailPanel-DERaCdpG.js.map → TestEmailPanel-BxutYoWg.js.map} +1 -1
  118. package/dist/cdn/chunks/TitleEditor-Ccv6uoTz.js +199 -0
  119. package/dist/cdn/chunks/{TitleEditor-CEgxjtUX.js.map → TitleEditor-Ccv6uoTz.js.map} +1 -1
  120. package/dist/cdn/chunks/ToggleSwitch-Ctdmj621.js +39 -0
  121. package/dist/cdn/chunks/ToggleSwitch-Ctdmj621.js.map +1 -0
  122. package/dist/cdn/chunks/{Toolbar-GFIZQHzw.js → Toolbar-DoprRgTn.js} +986 -987
  123. package/dist/cdn/chunks/{Toolbar-GFIZQHzw.js.map → Toolbar-DoprRgTn.js.map} +1 -1
  124. package/dist/cdn/chunks/{TplModal-DDrbWJcE.js → TplModal-BXQzmsJX.js} +21 -21
  125. package/dist/cdn/chunks/{TplModal-DDrbWJcE.js.map → TplModal-BXQzmsJX.js.map} +1 -1
  126. package/dist/cdn/chunks/{VersionHistoryMenu-MlxsUmuT.js → VersionHistoryMenu-BF2fNCvq.js} +41 -41
  127. package/dist/cdn/chunks/{VersionHistoryMenu-MlxsUmuT.js.map → VersionHistoryMenu-BF2fNCvq.js.map} +1 -1
  128. package/dist/cdn/chunks/VersionHistoryPanels-Dal0Uk69.js +48 -0
  129. package/dist/cdn/chunks/{VersionHistoryPanels-DVOV8QLv.js.map → VersionHistoryPanels-Dal0Uk69.js.map} +1 -1
  130. package/dist/cdn/chunks/{VersionPreviewBanner-BQwRKc6S.js → VersionPreviewBanner-BaGcn-b1.js} +12 -12
  131. package/dist/cdn/chunks/{VersionPreviewBanner-BQwRKc6S.js.map → VersionPreviewBanner-BaGcn-b1.js.map} +1 -1
  132. package/dist/cdn/chunks/WrapperBlock-DkQJtLz0.js +47 -0
  133. package/dist/cdn/chunks/{WrapperBlock-CFuP4R0c.js.map → WrapperBlock-DkQJtLz0.js.map} +1 -1
  134. package/dist/cdn/chunks/aiErrors-D5UOoYOt.js +43 -0
  135. package/dist/cdn/chunks/aiErrors-D5UOoYOt.js.map +1 -0
  136. package/dist/cdn/chunks/aiImageContext-BH4Ss1h3.js +50 -0
  137. package/dist/cdn/chunks/aiImageContext-BH4Ss1h3.js.map +1 -0
  138. package/dist/cdn/chunks/aiRewritePreview-DLGM05Ge.js +46 -0
  139. package/dist/cdn/chunks/aiRewritePreview-DLGM05Ge.js.map +1 -0
  140. package/dist/cdn/chunks/blockTypeIcons-ikZAmd6U.js +22 -0
  141. package/dist/cdn/chunks/{blockTypeIcons-BnAd8qsP.js.map → blockTypeIcons-ikZAmd6U.js.map} +1 -1
  142. package/dist/{ca-DSJwJ5ov.js → cdn/chunks/ca-C7mTzW1r.js} +132 -11
  143. package/dist/cdn/chunks/ca-C7mTzW1r.js.map +1 -0
  144. package/dist/cdn/chunks/{cloud-CI_fgDyy.js → createCloudRuntime-DpBWhrv3.js} +489 -593
  145. package/dist/cdn/chunks/createCloudRuntime-DpBWhrv3.js.map +1 -0
  146. package/dist/cdn/chunks/de-DBOTcDj2.js +22 -0
  147. package/dist/cdn/chunks/de-DBOTcDj2.js.map +1 -0
  148. package/dist/{de-CBE6O79z.js → cdn/chunks/de-DNuYQTmS.js} +132 -11
  149. package/dist/cdn/chunks/de-DNuYQTmS.js.map +1 -0
  150. package/dist/{dist-Bv_GBr2l.js → cdn/chunks/dist-Bo8Thh8v.js} +60 -58
  151. package/dist/cdn/chunks/{dist-Doy3r07H.js.map → dist-Bo8Thh8v.js.map} +1 -1
  152. package/dist/cdn/chunks/dist-S-rLGqax.js +406 -0
  153. package/dist/cdn/chunks/{dist-DdwjXLme.js.map → dist-S-rLGqax.js.map} +1 -1
  154. package/dist/cdn/chunks/{draggable-akeQH_JP.js → draggable-DZ0gwUJ6.js} +1822 -1728
  155. package/dist/cdn/chunks/draggable-DZ0gwUJ6.js.map +1 -0
  156. package/dist/cdn/chunks/{editor-modal-HJBy9kLj.js → editor-modal-CI6EfeMd.js} +884 -884
  157. package/dist/cdn/chunks/{editor-modal-HJBy9kLj.js.map → editor-modal-CI6EfeMd.js.map} +1 -1
  158. package/dist/cdn/chunks/en-CDhWRrF_.js +22 -0
  159. package/dist/cdn/chunks/en-CDhWRrF_.js.map +1 -0
  160. package/dist/{en-CDexnk0p.js → cdn/chunks/en-CW71OK66.js} +132 -11
  161. package/dist/cdn/chunks/en-CW71OK66.js.map +1 -0
  162. package/dist/cdn/chunks/en-ifvu6oPv.js +1 -0
  163. package/dist/{es-BE42B6uN.js → cdn/chunks/es-DdK7zQfi.js} +132 -11
  164. package/dist/cdn/chunks/es-DdK7zQfi.js.map +1 -0
  165. package/dist/cdn/chunks/{extensions-koOuDeZS.js → extensions-taJTZlLK.js} +59 -59
  166. package/dist/cdn/chunks/{extensions-koOuDeZS.js.map → extensions-taJTZlLK.js.map} +1 -1
  167. package/dist/{fr-DlJFPDQR.js → cdn/chunks/fr-Dz5Bgb7-.js} +132 -11
  168. package/dist/cdn/chunks/fr-Dz5Bgb7-.js.map +1 -0
  169. package/dist/cdn/chunks/{icons-CjlNV8xD.js → icons-DNX6StSs.js} +178 -145
  170. package/dist/cdn/chunks/icons-DNX6StSs.js.map +1 -0
  171. package/dist/{ja-CUT8gkNI.js → cdn/chunks/ja-Di-zJiT8.js} +132 -11
  172. package/dist/cdn/chunks/ja-Di-zJiT8.js.map +1 -0
  173. package/dist/cdn/chunks/keys-BTpmg2Tt.js +12 -0
  174. package/dist/cdn/chunks/keys-BTpmg2Tt.js.map +1 -0
  175. package/dist/{logger-BBlvSn6q.js → cdn/chunks/logger-Tj0RPskW.js} +7 -1
  176. package/dist/cdn/chunks/logger-Tj0RPskW.js.map +1 -0
  177. package/dist/{nl-bXWqqRyS.js → cdn/chunks/nl-CvVuHYFL.js} +132 -11
  178. package/dist/cdn/chunks/{nl-bXWqqRyS.js.map → nl-CvVuHYFL.js.map} +1 -1
  179. package/dist/cdn/chunks/normalizeMergeTagMarkup-DyePIGqu.js +199 -0
  180. package/dist/cdn/chunks/normalizeMergeTagMarkup-DyePIGqu.js.map +1 -0
  181. package/dist/cdn/chunks/{preRenderCustomBlocks-DqKbdTJ8.js → preRenderCustomBlocks-Dc-QLntG.js} +4 -4
  182. package/dist/cdn/chunks/{preRenderCustomBlocks-DqKbdTJ8.js.map → preRenderCustomBlocks-Dc-QLntG.js.map} +1 -1
  183. package/dist/cdn/chunks/pt-BR-CHM-ZKvE.js +22 -0
  184. package/dist/cdn/chunks/pt-BR-CHM-ZKvE.js.map +1 -0
  185. package/dist/{pt-BR-2_H4-wlb.js → cdn/chunks/pt-BR-ZhO4vgyq.js} +132 -11
  186. package/dist/cdn/chunks/pt-BR-ZhO4vgyq.js.map +1 -0
  187. package/dist/cdn/chunks/sanitizeRichTextHtml-DeISfLFr.js +62 -0
  188. package/dist/cdn/chunks/sanitizeRichTextHtml-DeISfLFr.js.map +1 -0
  189. package/dist/cdn/chunks/socialIcons-BBvsTwCV.js +2032 -0
  190. package/dist/cdn/chunks/socialIcons-BBvsTwCV.js.map +1 -0
  191. package/dist/{dist-DBG3nh3k.js → cdn/chunks/src-BNFnxfrA.js} +552 -350
  192. package/dist/cdn/chunks/src-BNFnxfrA.js.map +1 -0
  193. package/dist/cdn/chunks/src-Bs_yxk3h.js +4392 -0
  194. package/dist/cdn/chunks/src-Bs_yxk3h.js.map +1 -0
  195. package/dist/cdn/chunks/{src-B77z1iw4.js → src-K6fw_35b.js} +113 -113
  196. package/dist/cdn/chunks/{src-B77z1iw4.js.map → src-K6fw_35b.js.map} +1 -1
  197. package/dist/cdn/chunks/{tiptap-B1RfWFzB.js → tiptap-CtVrAViq.js} +43 -43
  198. package/dist/cdn/chunks/{tiptap-B1RfWFzB.js.map → tiptap-CtVrAViq.js.map} +1 -1
  199. package/dist/cdn/chunks/{useCloudI18n-kp07GQmk.js → useCloudI18n-AVXhzbhQ.js} +4 -4
  200. package/dist/cdn/chunks/{useCloudI18n-kp07GQmk.js.map → useCloudI18n-AVXhzbhQ.js.map} +1 -1
  201. package/dist/cdn/chunks/useEditorCore-CCVFi1YZ.js +2586 -0
  202. package/dist/cdn/chunks/useEditorCore-CCVFi1YZ.js.map +1 -0
  203. package/dist/cdn/chunks/useEditorRoot-CR5GjJD6.js +10 -0
  204. package/dist/cdn/chunks/{useEditorRoot-5SBqm90x.js.map → useEditorRoot-CR5GjJD6.js.map} +1 -1
  205. package/dist/cdn/chunks/{useI18n-DEqtEgOs.js → useI18n-CbVubQhM.js} +3 -3
  206. package/dist/cdn/chunks/{useI18n-DEqtEgOs.js.map → useI18n-CbVubQhM.js.map} +1 -1
  207. package/dist/cdn/chunks/{useLogicTag-X8bc5qNl.js → useLogicTag-B49Nc53Y.js} +5 -5
  208. package/dist/cdn/chunks/{useLogicTag-X8bc5qNl.js.map → useLogicTag-B49Nc53Y.js.map} +1 -1
  209. package/dist/cdn/chunks/{useMergeTag-DFoOexIQ.js → useMergeTag-B0KryMj8.js} +5 -5
  210. package/dist/cdn/chunks/{useMergeTag-DFoOexIQ.js.map → useMergeTag-B0KryMj8.js.map} +1 -1
  211. package/dist/cdn/chunks/{usePopoverPosition-Cz9-XiXR.js → usePopoverPosition-C829ps5i.js} +4 -4
  212. package/dist/cdn/chunks/{usePopoverPosition-Cz9-XiXR.js.map → usePopoverPosition-C829ps5i.js.map} +1 -1
  213. package/dist/cdn/chunks/useScrollToBlock-CAwvulog.js +51 -0
  214. package/dist/cdn/chunks/useScrollToBlock-CAwvulog.js.map +1 -0
  215. package/dist/cdn/chunks/{withCurrentFont-D-f61ghC.js → withCurrentFont-DFPXeVfG.js} +2 -2
  216. package/dist/cdn/chunks/{withCurrentFont-D-f61ghC.js.map → withCurrentFont-DFPXeVfG.js.map} +1 -1
  217. package/dist/cdn/editor.css +1 -1
  218. package/dist/cdn/editor.js +2151 -1480
  219. package/dist/cdn/editor.js.map +1 -1
  220. package/dist/{check-DQQzkmIC.js → check-yYsp5Xpk.js} +1 -1
  221. package/dist/{chevron-down-CIF4bdon.js → chevron-down-DTmD06_j.js} +1 -1
  222. package/dist/{chevron-right-Cg7Xu-ev.js → chevron-right-BSeYZOxc.js} +1 -1
  223. package/dist/{chevron-up-Csu7ISD-.js → chevron-up-BOApwrxi.js} +1 -1
  224. package/dist/{circle-alert-YUvIJAgY.js → circle-alert-BMszY8im.js} +1 -1
  225. package/dist/{clock-CnSIGKQW.js → clock-HADxnl6-.js} +1 -1
  226. package/dist/{cloud-YUYDtdHt.js → createCloudRuntime-DVQI_ReU.js} +474 -570
  227. package/dist/{createLucideIcon-BcP1sjdp.js → createLucideIcon-0lYYH3EW.js} +6 -6
  228. package/dist/de-DBOTcDj2.js +20 -0
  229. package/dist/{cdn/chunks/de-CBE6O79z.js → de-DNuYQTmS.js} +130 -13
  230. package/dist/{cdn/chunks/dist-Doy3r07H.js → dist-C7EtxNCb.js} +49 -51
  231. package/dist/{dist-CNqjHA8e.js → dist-C_dV9QAx.js} +130 -130
  232. package/dist/{cdn/chunks/dist-DdwjXLme.js → dist-DI4_YSnG.js} +111 -110
  233. package/dist/{cdn/chunks/src-CvLTYGdO.js → dist-DtOF3bDW.js} +446 -393
  234. package/dist/{editor-modal--7_9A6j-.js → editor-modal-Bzhl-PgI.js} +832 -834
  235. package/dist/en-CDhWRrF_.js +20 -0
  236. package/dist/{cdn/chunks/en-CDexnk0p.js → en-CW71OK66.js} +130 -13
  237. package/dist/en-DwV15ltA.js +1 -0
  238. package/dist/{cdn/chunks/es-BE42B6uN.js → es-DdK7zQfi.js} +130 -13
  239. package/dist/{extensions-zwsZlWjH.js → extensions-CdyweA50.js} +57 -57
  240. package/dist/{eye-B1bua-ck.js → eye-DWkSvYpj.js} +1 -1
  241. package/dist/{cdn/chunks/fr-DlJFPDQR.js → fr-Dz5Bgb7-.js} +130 -13
  242. package/dist/image-DesWjcZ4.js +28 -0
  243. package/dist/index.d.ts +361 -24
  244. package/dist/{info-x26nGOo2.js → info-ClWJGoZy.js} +1 -1
  245. package/dist/{cdn/chunks/ja-CUT8gkNI.js → ja-Di-zJiT8.js} +130 -13
  246. package/dist/keys-Zd9KWRD1.js +10 -0
  247. package/dist/{link-CezhndyR.js → link-BqRicFTA.js} +1 -1
  248. package/dist/{list-DQqdptI0.js → list-bojQr9bn.js} +1 -1
  249. package/dist/{loader-circle-DCEeoYoi.js → loader-circle-B2B8LbUu.js} +1 -1
  250. package/dist/{cdn/chunks/logger-ByvdoAwq.js → logger-k9Nbj3Cp.js} +5 -3
  251. package/dist/{message-circle-BLGzfv_7.js → message-circle-BEuiNsyZ.js} +1 -1
  252. package/dist/{cdn/chunks/nl-bXWqqRyS.js → nl-CvVuHYFL.js} +130 -13
  253. package/dist/normalizeMergeTagMarkup-P6SUBuPv.js +197 -0
  254. package/dist/{package-D_kEQCMU.js → package-DCROB4aM.js} +1 -1
  255. package/dist/{pencil-Dct8zGLy.js → pencil-CEotCKbf.js} +1 -1
  256. package/dist/{preRenderCustomBlocks-CtKJecE-.js → preRenderCustomBlocks-D8rr61_z.js} +4 -4
  257. package/dist/pt-BR-CHM-ZKvE.js +20 -0
  258. package/dist/{cdn/chunks/pt-BR-2_H4-wlb.js → pt-BR-ZhO4vgyq.js} +130 -13
  259. package/dist/{refresh-cw-tGMRDxr8.js → refresh-cw-C6M2mHNC.js} +12 -2
  260. package/dist/{runtime-dom.esm-bundler-DYn1z2Xf.js → runtime-dom.esm-bundler-B8WCZWUm.js} +134 -134
  261. package/dist/sanitizeRichTextHtml-DeISfLFr.js +60 -0
  262. package/dist/{search-Bm2cCQpe.js → search-Cy99zPYf.js} +1 -1
  263. package/dist/{send-sVLaKZ7f.js → send-BDLJFsf3.js} +1 -1
  264. package/dist/{smartphone-B2W81p02.js → smartphone-CVvQaNA4.js} +1 -1
  265. package/dist/{cdn/chunks/socialIcons-CkZSYpoG.js → socialIcons-Dd-jRiVe.js} +688 -693
  266. package/dist/{sparkles-a1qkBZ8X.js → sparkles-Ce0Qz0ox.js} +1 -1
  267. package/dist/square-BWlolnXe.js +15 -0
  268. package/dist/style.css +1 -1
  269. package/dist/templatical-editor.js +2114 -1422
  270. package/dist/{text-align-start-CTuwQ5YW.js → text-align-start-D1V5gPTy.js} +1 -1
  271. package/dist/{trash-I3D2peFQ.js → trash-CZfiUFmw.js} +1 -1
  272. package/dist/{triangle-alert-CenxmLRE.js → triangle-alert-CFDzyFC7.js} +1 -1
  273. package/dist/upload-BJfvdIrD.js +36 -0
  274. package/dist/{useCloudI18n-CGVEZV3o.js → useCloudI18n-Dcjua65H.js} +5 -5
  275. package/dist/{useEditorCore-DRbMRe8F.js → useEditorCore-BTLeAVlM.js} +1463 -1499
  276. package/dist/{useEditorRoot-BVm2-1N8.js → useEditorRoot-DUy67lJu.js} +2 -2
  277. package/dist/{useI18n-CSh4gO5c.js → useI18n-BdoY7xDE.js} +4 -4
  278. package/dist/{useLogicTag-zcI6BWIf.js → useLogicTag-DKLZ1T9H.js} +3 -3
  279. package/dist/{useMergeTag-C-iBLlp0.js → useMergeTag-Bhdx7AKk.js} +3 -3
  280. package/dist/{usePopoverPosition-CMcsMBtK.js → usePopoverPosition-BZea45XK.js} +2 -2
  281. package/dist/useScrollToBlock-FmNMALM_.js +74 -0
  282. package/dist/{vue.runtime.esm-bundler-DV0Wx4r_.js → vue.runtime.esm-bundler-DgFJ6GPG.js} +1428 -1332
  283. package/dist/{withCurrentFont-D62njRLu.js → withCurrentFont-BATJHNve.js} +1 -1
  284. package/dist/{x-KFQ4S-Kz.js → x-CZ0Js0hA.js} +1 -1
  285. package/package.json +14 -12
  286. package/dist/AiChatSidebar-CdjTb9ej.js +0 -230
  287. package/dist/AiFeatureMenu-DKm7VYCs.js +0 -57
  288. package/dist/CloudHeaderExtras-CI8RR9hG.js +0 -55
  289. package/dist/CommentsSidebar-J65znlrH.js +0 -500
  290. package/dist/DesignReferenceSidebar-BTwCFgz8.js +0 -279
  291. package/dist/IssuesPanel-DeeVsfG7.js +0 -117
  292. package/dist/ParagraphEditor-zLV44z-R.js +0 -797
  293. package/dist/SavedBlocksBrowserModal-B8DCFW7t.js +0 -360
  294. package/dist/TemplateScoringPanel-Ba9sgvjS.js +0 -273
  295. package/dist/TemplateSettings-Cu5X9DgA.js +0 -246
  296. package/dist/ToggleSwitch-DHweVJOr.js +0 -102
  297. package/dist/WrapperBlock-DiiaxpMb.js +0 -45
  298. package/dist/cdn/chunks/AiChatSidebar-yXJ85Zcg.js +0 -205
  299. package/dist/cdn/chunks/AiChatSidebar-yXJ85Zcg.js.map +0 -1
  300. package/dist/cdn/chunks/AiFeatureMenu-4ydjrhsQ.js +0 -57
  301. package/dist/cdn/chunks/AiFeatureMenu-4ydjrhsQ.js.map +0 -1
  302. package/dist/cdn/chunks/CloudHeaderExtras-DEkRww7n.js +0 -56
  303. package/dist/cdn/chunks/CloudHeaderExtras-DEkRww7n.js.map +0 -1
  304. package/dist/cdn/chunks/CloudPanels-XufhBZYF.js.map +0 -1
  305. package/dist/cdn/chunks/CollaborationNotices-CBvKEj1Q.js.map +0 -1
  306. package/dist/cdn/chunks/CommentsPanel-R8YLLO3v.js +0 -20
  307. package/dist/cdn/chunks/CommentsSidebar-96NZHVq3.js +0 -470
  308. package/dist/cdn/chunks/DesignReferenceSidebar-D14IIu_P.js +0 -229
  309. package/dist/cdn/chunks/DesignReferenceSidebar-D14IIu_P.js.map +0 -1
  310. package/dist/cdn/chunks/IssuesPanel-BoPiCLGc.js +0 -100
  311. package/dist/cdn/chunks/IssuesPanel-BoPiCLGc.js.map +0 -1
  312. package/dist/cdn/chunks/LogicTagInsertButton-BJ2t2vxC.js.map +0 -1
  313. package/dist/cdn/chunks/MediaEditModal-DD0SZ-S3.js.map +0 -1
  314. package/dist/cdn/chunks/MediaPanels-CkdJ_kGp.js +0 -45
  315. package/dist/cdn/chunks/ParagraphEditor-CJQjRHXV.js +0 -632
  316. package/dist/cdn/chunks/ParagraphEditor-CJQjRHXV.js.map +0 -1
  317. package/dist/cdn/chunks/SavedBlocksPanels-s_gxi1im.js +0 -38
  318. package/dist/cdn/chunks/TemplateScoringPanel-BBPnHILC.js +0 -237
  319. package/dist/cdn/chunks/TemplateScoringPanel-BBPnHILC.js.map +0 -1
  320. package/dist/cdn/chunks/TemplateSettings-CtrzzQWl.js +0 -208
  321. package/dist/cdn/chunks/TestEmailPanel-DERaCdpG.js +0 -35
  322. package/dist/cdn/chunks/TitleEditor-CEgxjtUX.js +0 -199
  323. package/dist/cdn/chunks/ToggleSwitch-DGQ7iRc-.js +0 -104
  324. package/dist/cdn/chunks/ToggleSwitch-DGQ7iRc-.js.map +0 -1
  325. package/dist/cdn/chunks/VersionHistoryPanels-DVOV8QLv.js +0 -48
  326. package/dist/cdn/chunks/WrapperBlock-CFuP4R0c.js +0 -47
  327. package/dist/cdn/chunks/blockTypeIcons-BnAd8qsP.js +0 -22
  328. package/dist/cdn/chunks/ca-DSJwJ5ov.js.map +0 -1
  329. package/dist/cdn/chunks/cloud-CI_fgDyy.js.map +0 -1
  330. package/dist/cdn/chunks/createCloudRuntime-DiYCJ21w.js +0 -358
  331. package/dist/cdn/chunks/createCloudRuntime-DiYCJ21w.js.map +0 -1
  332. package/dist/cdn/chunks/de-CBE6O79z.js.map +0 -1
  333. package/dist/cdn/chunks/de-D_atmUVB.js +0 -89
  334. package/dist/cdn/chunks/de-D_atmUVB.js.map +0 -1
  335. package/dist/cdn/chunks/draggable-akeQH_JP.js.map +0 -1
  336. package/dist/cdn/chunks/en-CDexnk0p.js.map +0 -1
  337. package/dist/cdn/chunks/en-DhJLnaBx.js +0 -89
  338. package/dist/cdn/chunks/en-DhJLnaBx.js.map +0 -1
  339. package/dist/cdn/chunks/en-Ve-PWSXu.js +0 -1
  340. package/dist/cdn/chunks/es-BE42B6uN.js.map +0 -1
  341. package/dist/cdn/chunks/fr-DlJFPDQR.js.map +0 -1
  342. package/dist/cdn/chunks/icons-CjlNV8xD.js.map +0 -1
  343. package/dist/cdn/chunks/ja-CUT8gkNI.js.map +0 -1
  344. package/dist/cdn/chunks/keys-UAWhQ3zW.js +0 -12
  345. package/dist/cdn/chunks/keys-UAWhQ3zW.js.map +0 -1
  346. package/dist/cdn/chunks/logger-ByvdoAwq.js.map +0 -1
  347. package/dist/cdn/chunks/pt-BR-2_H4-wlb.js.map +0 -1
  348. package/dist/cdn/chunks/pt-BR-BphMoUTw.js +0 -89
  349. package/dist/cdn/chunks/pt-BR-BphMoUTw.js.map +0 -1
  350. package/dist/cdn/chunks/socialIcons-CkZSYpoG.js.map +0 -1
  351. package/dist/cdn/chunks/src-B1e5SSYP.js +0 -1272
  352. package/dist/cdn/chunks/src-B1e5SSYP.js.map +0 -1
  353. package/dist/cdn/chunks/src-CvLTYGdO.js.map +0 -1
  354. package/dist/cdn/chunks/timeouts-o5Y9BuqI.js +0 -6
  355. package/dist/cdn/chunks/timeouts-o5Y9BuqI.js.map +0 -1
  356. package/dist/cdn/chunks/useAliveFlag-PuXh83UK.js +0 -12
  357. package/dist/cdn/chunks/useAliveFlag-PuXh83UK.js.map +0 -1
  358. package/dist/cdn/chunks/useEditorCore-DpCFvHg_.js +0 -2623
  359. package/dist/cdn/chunks/useEditorCore-DpCFvHg_.js.map +0 -1
  360. package/dist/cdn/chunks/useEditorRoot-5SBqm90x.js +0 -10
  361. package/dist/cdn/chunks/useScrollToBlock-MNzurEZV.js +0 -21
  362. package/dist/cdn/chunks/useScrollToBlock-MNzurEZV.js.map +0 -1
  363. package/dist/copy-CUC43md_.js +0 -19
  364. package/dist/createCloudRuntime-BMDRjL0k.js +0 -356
  365. package/dist/de-D_atmUVB.js +0 -87
  366. package/dist/dist-CCqn-RqE.js +0 -407
  367. package/dist/en-BHCMzqib.js +0 -1
  368. package/dist/en-DhJLnaBx.js +0 -87
  369. package/dist/image-up-BqiO7KCO.js +0 -27
  370. package/dist/keys-BymCnLHD.js +0 -10
  371. package/dist/plus-BDd0gTEm.js +0 -14
  372. package/dist/pt-BR-BphMoUTw.js +0 -87
  373. package/dist/shield-check-YhsbXfQc.js +0 -14
  374. package/dist/socialIcons-Bwv-49EB.js +0 -2167
  375. package/dist/timeouts-o5Y9BuqI.js +0 -4
  376. package/dist/upload-uU2cK0Ce.js +0 -21
  377. package/dist/useAliveFlag-BjP0Gxza.js +0 -10
  378. package/dist/useScrollToBlock-CdCQK9QQ.js +0 -47
@@ -1,13 +1,13 @@
1
- import { B as e, E as t, K as n, N as r, Q as i, S as a, W as o, X as s, Y as c, Z as l, at as u, b as d, ct as f, et as p, f as m, g as h, lt as g, ot as _, rt as v, u as y, ut as b, y as x } from "./draggable-akeQH_JP.js";
2
- import { A as S, Dt as C, E as w, Rt as T, T as E, Y as ee, _t as D, bt as O, gt as k, ht as A, k as j, mt as M, n as N, ot as P, pt as F, q as I, r as L, vt as R, w as z, xt as B, yt as te } from "./src-CvLTYGdO.js";
3
- import { r as V } from "./dist-DdwjXLme.js";
4
- import { L as H, P as U, c as ne, x as re } from "./keys-UAWhQ3zW.js";
5
- import { n as W } from "./timeouts-o5Y9BuqI.js";
6
- import { t as ie } from "./useI18n-DEqtEgOs.js";
7
- import { o as ae, s as G } from "./usePopoverPosition-Cz9-XiXR.js";
8
- import { at as oe, c as se } from "./icons-CjlNV8xD.js";
9
- import { t as K } from "./useAliveFlag-PuXh83UK.js";
10
- //#region ../core/src/error-reporting.ts
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
11
  function q(e) {
12
12
  return e instanceof Error ? e : Error(String(e), { cause: e });
13
13
  }
@@ -18,11 +18,9 @@ function J(e, t) {
18
18
  e?.(q(t));
19
19
  }
20
20
  }
21
- //#endregion
22
- //#region ../core/src/editor.ts
23
- function ce(e) {
24
- let t = e.content ?? ee(e.defaultFontFamily, e.templateDefaults);
25
- E(t), w(t);
21
+ function le(e) {
22
+ let t = e.content ?? w(e.defaultFontFamily, e.templateDefaults);
23
+ R(t), H(t);
26
24
  let n = s({
27
25
  template: null,
28
26
  content: t,
@@ -34,35 +32,35 @@ function ce(e) {
34
32
  isSaving: !1,
35
33
  isLoading: !1,
36
34
  uiTheme: "auto"
37
- }), r = 0;
38
- function i() {
39
- n.isDirty = !0, r++;
35
+ }), r = a(0), i = 0, c = 0;
36
+ function u() {
37
+ n.isDirty = !0, c++;
40
38
  }
41
- let a = o({
39
+ let d = o({
42
40
  get: () => n.content,
43
41
  set: (e) => {
44
- n.content = e, i();
42
+ n.content = e, u();
45
43
  }
46
- }), c = o(() => n.selectedBlockId ? u(n.content.blocks, n.selectedBlockId) : null);
47
- function u(e, t) {
44
+ }), f = o(() => n.selectedBlockId ? p(n.content.blocks, n.selectedBlockId) : null);
45
+ function p(e, t) {
48
46
  for (let n of e) {
49
47
  if (n.id === t) return n;
50
48
  if (n.type === "section") for (let e of n.children) {
51
- let n = u(e, t);
49
+ let n = p(e, t);
52
50
  if (n) return n;
53
51
  }
54
52
  }
55
53
  return null;
56
54
  }
57
- function d(e, t) {
58
- if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) d(e, t);
55
+ function m(e, t) {
56
+ if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) m(e, t);
59
57
  }
60
- function f(e, t, n = { blocks: e }) {
58
+ function h(e, t, n = { blocks: e }) {
61
59
  for (let r = 0; r < e.length; r++) {
62
60
  let i = e[r];
63
61
  if (i.id === t) return n;
64
62
  if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
65
- let n = f(i.children[e], t, {
63
+ let n = h(i.children[e], t, {
66
64
  blocks: i.children[e],
67
65
  sectionId: i.id,
68
66
  columnIndex: e
@@ -72,11 +70,11 @@ function ce(e) {
72
70
  }
73
71
  return null;
74
72
  }
75
- function p(t) {
73
+ function g(t) {
76
74
  return e.lockedBlocks?.value.has(t) ?? !1;
77
75
  }
78
- function m(e) {
79
- let t = f(n.content.blocks, e);
76
+ function _(e) {
77
+ let t = h(n.content.blocks, e);
80
78
  if (!t) return null;
81
79
  let r = t.blocks.findIndex((t) => t.id === e);
82
80
  return r === -1 ? null : {
@@ -85,199 +83,199 @@ function ce(e) {
85
83
  index: r
86
84
  };
87
85
  }
88
- function h(e, t = !0) {
89
- E(e), w(e), n.content = e, t && i();
86
+ function v(e, t = !0) {
87
+ R(e), H(e), n.content = e, t && u();
90
88
  }
91
- function g(e) {
92
- e && p(e) || (n.selectedBlockId = e);
89
+ function y(e) {
90
+ e && g(e) || (n.selectedBlockId = e);
93
91
  }
94
- function _(e) {
92
+ function b(e) {
95
93
  n.viewport = e;
96
94
  }
97
- function v(e) {
95
+ function x(e) {
98
96
  n.darkMode = e;
99
97
  }
100
- function y(e) {
98
+ function S(e) {
101
99
  n.uiTheme = e;
102
100
  }
103
- function b(e) {
101
+ function C(e) {
104
102
  n.previewMode = e, e && (n.selectedBlockId = null);
105
103
  }
106
- function x(e, t) {
107
- if (p(e)) return;
108
- let r = u(n.content.blocks, e);
109
- r && (Object.assign(r, t), i());
104
+ function T(e, t) {
105
+ if (g(e)) return;
106
+ let r = p(n.content.blocks, e);
107
+ r && (Object.assign(r, t), u());
110
108
  }
111
- function S(e) {
109
+ function E(e) {
112
110
  n.content.settings = {
113
111
  ...n.content.settings,
114
112
  ...e
115
- }, i();
113
+ }, u();
116
114
  }
117
- function C(e, t, r = 0, a) {
118
- let o = {
115
+ function ee(e, t, r = 0, i) {
116
+ let a = {
119
117
  settings: n.content.settings,
120
118
  blocks: [e]
121
119
  };
122
- if (E(o), w(o), !(t && e.type === "section")) {
120
+ if (R(a), H(a), !(t && e.type === "section")) {
123
121
  if (t) {
124
- if (p(t)) return;
125
- let i = u(n.content.blocks, t);
126
- if (i && i.type === "section") {
127
- if (r < 0 || r >= R(i.columns)) return;
128
- i.children[r] = i.children[r] || [];
129
- let t = i.children[r];
130
- a !== void 0 && a < t.length ? t.splice(a, 0, e) : t.push(e);
122
+ if (g(t)) return;
123
+ let a = p(n.content.blocks, t);
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];
128
+ i !== void 0 && i < t.length ? t.splice(i, 0, e) : t.push(e);
131
129
  }
132
- } else a !== void 0 && a < n.content.blocks.length ? n.content.blocks.splice(a, 0, e) : n.content.blocks.push(e);
133
- i();
130
+ } else i !== void 0 && i < n.content.blocks.length ? n.content.blocks.splice(i, 0, e) : n.content.blocks.push(e);
131
+ u();
134
132
  }
135
133
  }
136
- function T(e) {
137
- if (p(e)) return;
138
- let t = f(n.content.blocks, e);
134
+ function D(e) {
135
+ if (g(e)) return;
136
+ let t = h(n.content.blocks, e);
139
137
  if (t) {
140
138
  let r = t.blocks.findIndex((t) => t.id === e);
141
139
  if (r !== -1) {
142
140
  let [e] = t.blocks.splice(r, 1);
143
141
  if (n.selectedBlockId) {
144
142
  let t = /* @__PURE__ */ new Set();
145
- d(e, t), t.has(n.selectedBlockId) && (n.selectedBlockId = null);
143
+ m(e, t), t.has(n.selectedBlockId) && (n.selectedBlockId = null);
146
144
  }
147
- i();
145
+ u();
148
146
  }
149
147
  }
150
148
  }
151
- function D(e, t, r, a = 0) {
152
- if (p(e) || r && p(r)) return;
153
- let o = f(n.content.blocks, e);
154
- if (!o) return;
155
- let s = o.blocks.findIndex((t) => t.id === e);
156
- if (s === -1 || r && o.blocks[s].type === "section") return;
157
- let c;
149
+ function O(e, t, r, i = 0) {
150
+ if (g(e) || r && g(r)) return;
151
+ let a = h(n.content.blocks, e);
152
+ if (!a) return;
153
+ let o = a.blocks.findIndex((t) => t.id === e);
154
+ if (o === -1 || r && a.blocks[o].type === "section") return;
155
+ let s;
158
156
  if (r) {
159
- let e = u(n.content.blocks, r);
160
- if (!e || e.type !== "section" || a < 0 || a >= R(e.columns)) return;
161
- e.children[a] = e.children[a] || [], c = e.children[a];
162
- } else c = n.content.blocks;
163
- let [l] = o.blocks.splice(s, 1);
164
- c.splice(t, 0, l), i();
157
+ let e = p(n.content.blocks, r);
158
+ if (!e || e.type !== "section" || i < 0 || i >= L(e.columns)) return;
159
+ e.children[i] = e.children[i] || [], s = e.children[i];
160
+ } else s = n.content.blocks;
161
+ let [c] = a.blocks.splice(o, 1);
162
+ s.splice(t, 0, c), u();
165
163
  }
166
- function O() {
167
- i();
164
+ function k() {
165
+ u();
168
166
  }
169
- function k(e, t) {
170
- throw new M(`[Templatical] Templates: ${e} ${t}`);
167
+ function A(e, t) {
168
+ throw new I(`[Templatical] Templates: ${e} ${t}`);
171
169
  }
172
- function A(t) {
170
+ function j(t) {
173
171
  J(e.onError, t);
174
172
  }
175
- function j(t) {
173
+ function M(t) {
176
174
  let { templates: n } = e;
177
- return n || k(t, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
175
+ return n || A(t, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
178
176
  }
179
177
  function N(e) {
180
178
  n.template && (n.template = {
181
179
  ...n.template,
182
180
  name: e
183
- }, i());
181
+ }, u());
184
182
  }
185
183
  async function P(t) {
186
- let i = j("create()"), { create: a } = i;
187
- typeof a != "function" && k("create()", "is disabled by the provider — its `create` is `false`.");
188
- let o;
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;
189
187
  n.isLoading = !0;
190
188
  try {
191
189
  t?.content && (n.content = t.content);
192
- let e = r;
193
- o = await a(t?.name === void 0 ? { content: n.content } : {
190
+ let e = c;
191
+ s = await o(t?.name === void 0 ? { content: n.content } : {
194
192
  name: t.name,
195
193
  content: n.content
196
- }), n.template = o, r === e && (n.isDirty = !1);
194
+ }), n.template = s, c === e && (n.isDirty = !1), r.value++;
197
195
  } catch (t) {
198
196
  throw e.onError?.(t), t;
199
197
  } finally {
200
- n.isLoading = !1;
198
+ i === l && (n.isLoading = !1);
201
199
  }
202
- return A(() => i.onCreated?.(o)), o;
200
+ return j(() => a.onCreated?.(s)), s;
203
201
  }
204
- async function F(t) {
205
- let r = j("load()"), i;
202
+ async function F(t, a) {
203
+ let o = M("load()"), s, c = ++i;
206
204
  n.isLoading = !0;
207
205
  try {
208
- i = await r.load(t), E(i.content), w(i.content), n.template = i, n.content = i.content, n.isDirty = !1;
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++;
209
208
  } catch (t) {
210
209
  throw e.onError?.(t), t;
211
210
  } finally {
212
- n.isLoading = !1;
211
+ i === c && (n.isLoading = !1);
213
212
  }
214
- return A(() => r.onLoaded?.(i)), i;
215
- }
216
- async function I(t = "api") {
217
- let i = j("save()"), { save: a } = i;
218
- typeof a != "function" && k("save()", "is disabled by the provider — its `save` is `false`.");
219
- let o = n.template;
220
- o || k("save()", "has no template loaded. Call create() or load() first.");
221
- let s = o.name === void 0 ? { content: n.content } : {
222
- name: o.name,
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 } : {
221
+ name: a.name,
223
222
  content: n.content
224
- }, c;
223
+ }, s;
225
224
  n.isSaving = !0;
226
225
  try {
227
- let e = r;
228
- if (c = await a(o.id, s), n.template?.id === o.id) {
226
+ let e = c;
227
+ if (s = await i(a.id, o), n.template?.id === a.id) {
229
228
  let e = n.template.name;
230
- n.template = e === o.name ? c : {
231
- ...c,
229
+ n.template = e === a.name ? s : {
230
+ ...s,
232
231
  name: e
233
232
  };
234
233
  }
235
- r === e && (n.isDirty = !1);
234
+ c === e && (n.isDirty = !1);
236
235
  } catch (t) {
237
236
  throw e.onError?.(t), t;
238
237
  } finally {
239
238
  n.isSaving = !1;
240
239
  }
241
- return A(() => i.onSaved?.(c, { trigger: t })), c;
240
+ return j(() => r.onSaved?.(s, { trigger: t })), s;
242
241
  }
243
- function L() {
242
+ function z() {
244
243
  return n.template?.id !== void 0;
245
244
  }
246
245
  return {
247
246
  state: l(n),
248
- content: a,
249
- selectedBlock: c,
250
- isBlockLocked: p,
251
- setContent: h,
252
- selectBlock: g,
253
- setViewport: _,
254
- setDarkMode: v,
255
- setUiTheme: y,
256
- setPreviewMode: b,
257
- updateBlock: x,
258
- updateSettings: S,
259
- addBlock: C,
260
- removeBlock: T,
261
- moveBlock: D,
262
- markDirty: O,
263
- findBlockLocation: m,
247
+ loadVersion: l(r),
248
+ content: d,
249
+ selectedBlock: f,
250
+ isBlockLocked: g,
251
+ setContent: v,
252
+ selectBlock: y,
253
+ setViewport: b,
254
+ setDarkMode: x,
255
+ setUiTheme: S,
256
+ setPreviewMode: C,
257
+ updateBlock: T,
258
+ updateSettings: E,
259
+ addBlock: ee,
260
+ removeBlock: D,
261
+ moveBlock: O,
262
+ markDirty: k,
263
+ findBlockLocation: _,
264
264
  setName: N,
265
265
  create: P,
266
266
  load: F,
267
- save: I,
268
- hasTemplate: L
267
+ save: te,
268
+ hasTemplate: z
269
269
  };
270
270
  }
271
- //#endregion
272
- //#region ../core/src/history.ts
273
- var le = 50, Y = 300, ue = 1500;
274
- function de(e) {
275
- let { content: t, setContent: n, maxSize: r = le } = e, a = i([]), s = i([]), c = i(!1), l = null, u = null, d = o(() => a.value.length > 0), f = o(() => s.value.length > 0);
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);
276
274
  function p() {
277
- return O(t.value);
275
+ return z(t.value);
278
276
  }
279
277
  function m(e) {
280
- a.value.push(e), a.value.length > r && a.value.splice(0, a.value.length - r);
278
+ i.value.push(e), i.value.length > r && i.value.splice(0, i.value.length - r);
281
279
  }
282
280
  function h() {
283
281
  u &&= (clearTimeout(u.timeoutId), null);
@@ -298,22 +296,22 @@ function de(e) {
298
296
  function v() {
299
297
  c.value = !0, l && clearTimeout(l), l = setTimeout(() => {
300
298
  c.value = !1, l = null;
301
- }, ue);
299
+ }, de);
302
300
  }
303
301
  function y() {
304
- if (a.value.length === 0) return;
302
+ if (i.value.length === 0) return;
305
303
  h();
306
- let e = a.value.pop();
304
+ let e = i.value.pop();
307
305
  s.value.push(p()), n(e, !0), v();
308
306
  }
309
307
  function b() {
310
308
  if (s.value.length === 0) return;
311
309
  h();
312
310
  let e = s.value.pop();
313
- a.value.push(p()), n(e, !0), v();
311
+ i.value.push(p()), n(e, !0), v();
314
312
  }
315
313
  function x() {
316
- a.value = [], s.value = [], h();
314
+ i.value = [], s.value = [], h();
317
315
  }
318
316
  function S() {
319
317
  x(), l &&= (clearTimeout(l), null);
@@ -330,16 +328,14 @@ function de(e) {
330
328
  destroy: S
331
329
  };
332
330
  }
333
- //#endregion
334
- //#region ../core/src/block-actions.ts
335
- function X(e) {
331
+ function pe(e) {
336
332
  let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
337
333
  function o(n, r, a) {
338
- let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = S(n, o);
334
+ let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = C(n, o);
339
335
  return t(s, r, a), i(s.id), s;
340
336
  }
341
337
  function s(e, n, r) {
342
- let o = j(e);
338
+ let o = D(e);
343
339
  if (n !== void 0 || r !== void 0) t(o, n, r);
344
340
  else {
345
341
  let i = a?.(e.id) ?? null;
@@ -360,11 +356,9 @@ function X(e) {
360
356
  updateBlockProperty: l
361
357
  };
362
358
  }
363
- //#endregion
364
- //#region ../core/src/auto-save.ts
365
- var fe = 2e3;
366
- function pe(e) {
367
- let { content: t, isDirty: n, onChange: r, debounce: i = fe, enabled: a = !0 } = e, o = null, s = !1;
359
+ var X = 2e3;
360
+ function me(e) {
361
+ let { content: t, isDirty: n, onChange: r, debounce: i = X, enabled: a = !0 } = e, o = null, s = !1;
368
362
  function c() {
369
363
  return typeof a == "function" ? a() : a;
370
364
  }
@@ -385,7 +379,7 @@ function pe(e) {
385
379
  o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
386
380
  }, i));
387
381
  }
388
- let m = _(t, () => {
382
+ let m = b(t, () => {
389
383
  p();
390
384
  }, { deep: !0 });
391
385
  function h() {
@@ -399,9 +393,7 @@ function pe(e) {
399
393
  destroy: h
400
394
  };
401
395
  }
402
- //#endregion
403
- //#region ../core/src/condition-preview.ts
404
- function me(e) {
396
+ function he(e) {
405
397
  let t = s(/* @__PURE__ */ new Set()), n = o(() => t.size > 0);
406
398
  function r(e) {
407
399
  return t.has(e);
@@ -419,10 +411,8 @@ function me(e) {
419
411
  hasHiddenBlocks: n
420
412
  };
421
413
  }
422
- //#endregion
423
- //#region ../core/src/data-source-fetch.ts
424
- function he(e) {
425
- let t = i(!1), n = i(!1), r = o(() => !!e.definition.value?.dataSource), a = o(() => r.value && !e.block.value.dataSourceFetched);
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);
426
416
  async function s() {
427
417
  let r = e.definition.value;
428
418
  if (r?.dataSource) {
@@ -448,12 +438,10 @@ function he(e) {
448
438
  fetchError: n,
449
439
  fetch: s,
450
440
  hasDataSource: r,
451
- needsFetch: a
441
+ needsFetch: i
452
442
  };
453
443
  }
454
- //#endregion
455
- //#region ../core/src/history-interceptor.ts
456
- function ge(e, t) {
444
+ function _e(e, t) {
457
445
  let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
458
446
  e.addBlock = (r, i, a, o) => {
459
447
  i && e.isBlockLocked(i) || (t.record(), n(r, i, a, o));
@@ -467,31 +455,29 @@ function ge(e, t) {
467
455
  t.record(), o(e);
468
456
  };
469
457
  }
470
- //#endregion
471
- //#region ../core/src/diff-content.ts
472
- var _e = "root", ve = /* @__PURE__ */ new Set([
458
+ var ve = "root", ye = /* @__PURE__ */ new Set([
473
459
  "id",
474
460
  "type",
475
461
  "children"
476
- ]), ye = /* @__PURE__ */ new Set([
462
+ ]), be = /* @__PURE__ */ new Set([
477
463
  "id",
478
464
  "type",
479
465
  "children",
480
466
  "columns"
481
- ]), be = /* @__PURE__ */ new Set();
482
- function xe(e) {
483
- return e === null ? _e : JSON.stringify([e.sectionId, e.column]);
467
+ ]), xe = /* @__PURE__ */ new Set();
468
+ function Se(e) {
469
+ return e === null ? ve : JSON.stringify([e.sectionId, e.column]);
484
470
  }
485
471
  function Z(e) {
486
472
  let t = e.children;
487
473
  return e.type === "section" && Array.isArray(t) ? t : [];
488
474
  }
489
- function Se(e) {
475
+ function Ce(e) {
490
476
  let t = /* @__PURE__ */ new Map(), n = (e, r) => {
491
477
  e.forEach((e, i) => {
492
478
  t.has(e.id) || t.set(e.id, {
493
479
  block: e,
494
- key: xe(r),
480
+ key: Se(r),
495
481
  index: i
496
482
  }), Z(e).forEach((t, r) => {
497
483
  Array.isArray(t) && n(t, {
@@ -503,7 +489,7 @@ function Se(e) {
503
489
  };
504
490
  return n(e, null), t;
505
491
  }
506
- function Q(e) {
492
+ function we(e) {
507
493
  let t = [], n = Array(e.length).fill(-1);
508
494
  e.forEach((r, i) => {
509
495
  let a = 0, o = t.length;
@@ -517,17 +503,17 @@ function Q(e) {
517
503
  for (; i !== -1;) r.add(i), i = n[i];
518
504
  return r;
519
505
  }
520
- function Ce(e, t, n) {
506
+ function Q(e, t, n) {
521
507
  let r = {}, i = [];
522
- for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || te(e[i], t[i]) || (r[i] = O(t[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]));
523
509
  for (let r of Object.keys(e)) n.has(r) || e[r] === void 0 || t[r] === void 0 && i.push(r);
524
510
  return {
525
511
  set: r,
526
512
  unset: i
527
513
  };
528
514
  }
529
- function we(e, t) {
530
- let n = Se(e.blocks), r = Se(t.blocks), i = [], a = (e) => {
515
+ function Te(e, t) {
516
+ let n = Ce(e.blocks), r = Ce(t.blocks), i = [], a = (e) => {
531
517
  let t = r.get(e), i = n.get(e);
532
518
  return t !== void 0 && i !== void 0 && t.block.type !== i.block.type;
533
519
  }, o = (e) => r.has(e.id) && !a(e.id), s = (e) => Z(e).some((e) => Array.isArray(e) && e.some((e) => o(e) || !a(e.id) && s(e))), c = /* @__PURE__ */ new Set(), l = [], u = (e, t) => {
@@ -543,15 +529,15 @@ function we(e, t) {
543
529
  };
544
530
  for (let t of e.blocks) u(t, "kept");
545
531
  let d = (e) => n.has(e) && !c.has(e), f = (e) => {
546
- let t = O(e);
547
- return t.type === "section" && (t.children = Z(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => O(e)) : e)), t;
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;
548
534
  }, p = (e, t, r) => {
549
- let a = xe(e), o = [], s = [];
535
+ let a = Se(e), o = [], s = [];
550
536
  t.forEach((e, t) => {
551
537
  let r = n.get(e.id);
552
538
  d(e.id) && r !== void 0 && r.key === a && (o.push(r.index), s.push(t));
553
539
  });
554
- let c = new Set([...Q(o)].map((e) => s[e]));
540
+ let c = new Set([...we(o)].map((e) => s[e]));
555
541
  t.forEach((n, a) => {
556
542
  if (c.has(a) || r(n)) return;
557
543
  let o = a > 0 ? t[a - 1].id : null;
@@ -597,7 +583,7 @@ function we(e, t) {
597
583
  });
598
584
  for (let [e, t] of r) {
599
585
  if (!d(e)) continue;
600
- let { set: r, unset: a } = Ce(n.get(e).block, t.block, h.has(e) ? ye : ve);
586
+ let { set: r, unset: a } = Q(n.get(e).block, t.block, h.has(e) ? be : ye);
601
587
  (Object.keys(r).length !== 0 || a.length !== 0) && i.push({
602
588
  op: "updateBlock",
603
589
  blockId: e,
@@ -605,133 +591,20 @@ function we(e, t) {
605
591
  ...a.length > 0 ? { unset: a } : {}
606
592
  });
607
593
  }
608
- let _ = Ce(e.settings, t.settings, be);
594
+ let _ = Q(e.settings, t.settings, xe);
609
595
  return (Object.keys(_.set).length > 0 || _.unset.length > 0) && i.push({
610
596
  op: "updateSettings",
611
597
  ...Object.keys(_.set).length > 0 ? { set: _.set } : {},
612
598
  ..._.unset.length > 0 ? { unset: _.unset } : {}
613
599
  }), i;
614
600
  }
615
- //#endregion
616
- //#region ../core/src/invert-operations.ts
617
- function Te(e) {
618
- let t = e.children;
619
- return e.type === "section" && Array.isArray(t) ? t : [];
620
- }
621
- function Ee(e, t, n = null) {
622
- for (let r = 0; r < e.length; r++) {
623
- let i = e[r];
624
- if (i.id === t) return {
625
- block: i,
626
- parent: n,
627
- after: r > 0 ? e[r - 1].id : null
628
- };
629
- let a = Te(i);
630
- for (let e = 0; e < a.length; e++) {
631
- if (!Array.isArray(a[e])) continue;
632
- let n = Ee(a[e], t, {
633
- sectionId: i.id,
634
- column: e
635
- });
636
- if (n) return n;
637
- }
638
- }
639
- return null;
640
- }
641
- function $(e, t, n) {
642
- let r = Ee(e.blocks, t);
643
- if (!r) throw new A("block_missing", n, `No block with id "${t}".`, t);
644
- return r;
645
- }
646
- function De(e, t, n) {
647
- let r = {}, i = [], a = {}, o = [.../* @__PURE__ */ new Set([...Object.keys(t ?? {}), ...n ?? []])];
648
- for (let n of o) {
649
- let o = e[n];
650
- o === void 0 ? i.push(n) : r[n] = O(o);
651
- let s = t && n in t ? t[n] : void 0;
652
- a[n] = s === void 0 ? null : O(s);
653
- }
654
- return {
655
- set: r,
656
- unset: i,
657
- expect: a
658
- };
659
- }
660
- function Oe(e, t, n) {
661
- switch (t.op) {
662
- case "addBlock": return {
663
- op: "deleteBlock",
664
- blockId: t.block.id,
665
- expect: { block: O(t.block) }
666
- };
667
- case "deleteBlock": {
668
- let r = $(e, t.blockId, n);
669
- return {
670
- op: "addBlock",
671
- block: O(r.block),
672
- parent: r.parent,
673
- after: r.after
674
- };
675
- }
676
- case "moveBlock": {
677
- let r = $(e, t.blockId, n);
678
- return {
679
- op: "moveBlock",
680
- blockId: t.blockId,
681
- parent: r.parent,
682
- after: r.after,
683
- expect: {
684
- parent: t.parent,
685
- after: t.after
686
- }
687
- };
688
- }
689
- case "updateBlock": {
690
- let r = $(e, t.blockId, n).block, { set: i, unset: a, expect: o } = De(r, t.set, t.unset);
691
- return {
692
- op: "updateBlock",
693
- blockId: t.blockId,
694
- ...Object.keys(i).length > 0 ? { set: i } : {},
695
- ...a.length > 0 ? { unset: a } : {},
696
- expect: o
697
- };
698
- }
699
- case "updateSettings": {
700
- let { set: n, unset: r, expect: i } = De(e.settings, t.set, t.unset);
701
- return {
702
- op: "updateSettings",
703
- ...Object.keys(n).length > 0 ? { set: n } : {},
704
- ...r.length > 0 ? { unset: r } : {},
705
- expect: i
706
- };
707
- }
708
- case "setContent": return {
709
- op: "setContent",
710
- content: {
711
- blocks: O(e.blocks),
712
- settings: O(e.settings)
713
- }
714
- };
715
- }
716
- }
717
- function ke(e, t) {
718
- let n = O(e), r = [];
719
- return t.forEach((e, t) => {
720
- r.push(Oe(n, e, t));
721
- try {
722
- D(n, [e]);
723
- } catch (e) {
724
- throw e instanceof A ? new A(e.code, t, e.message, e.blockId) : e;
725
- }
726
- }), r.reverse();
727
- }
728
- var Ae = 1e3, je = 1e4, Me = [
601
+ var Ee = 1e3, De = 1e4, Oe = [
729
602
  1e3,
730
603
  2e3,
731
604
  5e3,
732
605
  1e4,
733
606
  3e4
734
- ], Ne = 50, Pe = /* @__PURE__ */ new Set([
607
+ ], ke = 50, Ae = 100, je = /* @__PURE__ */ new Set([
735
608
  "block_exists",
736
609
  "block_missing",
737
610
  "anchor_missing",
@@ -742,39 +615,39 @@ var Ae = 1e3, je = 1e4, Me = [
742
615
  "lock_lost",
743
616
  "content_too_large"
744
617
  ]);
745
- function Fe(e) {
618
+ function Me(e) {
746
619
  let t = e?.code;
747
- return typeof t == "string" && Pe.has(t) ? t : null;
620
+ return typeof t == "string" && je.has(t) ? t : null;
748
621
  }
749
- function Ie(e) {
622
+ function Ne(e) {
750
623
  let t = e?.holder;
751
624
  return typeof t == "object" && t && typeof t.sessionId == "string" ? t : void 0;
752
625
  }
753
- function Le(e) {
626
+ function Pe(e) {
754
627
  let t = e?.statusCode;
755
628
  return typeof t != "number" || t >= 500 || t === 408 || t === 429;
756
629
  }
757
- function Re(e, t) {
630
+ function Fe(e, t) {
758
631
  return e.some((e) => {
759
632
  if (e.id === t) return !0;
760
633
  let n = e.children;
761
- return e.type === "section" && Array.isArray(n) && n.some((e) => Array.isArray(e) && Re(e, t));
634
+ return e.type === "section" && Array.isArray(n) && n.some((e) => Array.isArray(e) && Fe(e, t));
762
635
  });
763
636
  }
764
- function ze(e) {
637
+ function Ie(e) {
765
638
  if (e.length === 1 && e[0].op === "updateSettings") return !0;
766
639
  let t = e[0];
767
640
  return t.op === "updateBlock" && e.every((e) => e.op === "updateBlock" && e.blockId === t.blockId);
768
641
  }
769
- function Be(e) {
642
+ function Le(e) {
770
643
  return e.map((e) => {
771
644
  if (!("expect" in e)) return e;
772
645
  let { expect: t, ...n } = e;
773
646
  return n;
774
647
  });
775
648
  }
776
- function Ve(e) {
777
- let { provider: t } = e, r = e.sessionId ?? crypto.randomUUID(), a = e.maxUndo ?? Ne, s = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", l = p([]), u = p(/* @__PURE__ */ new Map()), d = i(null), f = i(0), m = i(0), h = null, g = null, v = !1, y = !1, b = !1, x = null, S = 0, C = !1, w = [], T = null, E = null, ee = Promise.resolve(), j = null, M = o(() => (g?.undo.length ?? 0) > 0), N = o(() => (g?.redo.length ?? 0) > 0);
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));
778
651
  function P(t) {
779
652
  e.onError?.(t instanceof Error ? t : Error(String(t)));
780
653
  }
@@ -794,61 +667,61 @@ function Ve(e) {
794
667
  m.value++;
795
668
  }
796
669
  function R(e, t) {
797
- e.push(t), e.length > a && e.splice(0, e.length - a);
670
+ e.push(t), e.length > i && e.splice(0, e.length - i);
798
671
  }
799
- function z(e) {
800
- if (!h || v) return;
801
- y = !0;
672
+ function B(e) {
673
+ if (!h || _) return;
674
+ v = !0;
802
675
  try {
803
- let t = h.content.value, n = we(t, e);
676
+ let t = h.content.value, n = Te(t, e);
804
677
  if (n.length > 0) try {
805
- D(t, n);
678
+ ee(t, n);
806
679
  } catch {
807
- h.setContent(O(e), !1);
680
+ h.setContent(z(e), !1);
808
681
  }
809
- te(h.content.value, e) || h.setContent(O(e), !1);
682
+ E(h.content.value, e) || h.setContent(z(e), !1);
810
683
  } finally {
811
- y = !1;
684
+ v = !1;
812
685
  }
813
686
  let t = h.state.selectedBlockId;
814
- t && !Re(e.blocks, t) && h.selectBlock(null);
687
+ t && !Fe(e.blocks, t) && h.selectBlock(null);
815
688
  }
816
- function B() {
817
- y || b || (b = !0, queueMicrotask(() => {
818
- b = !1, H(!1);
689
+ function V() {
690
+ v || y || (y = !0, queueMicrotask(() => {
691
+ y = !1, ne(!1);
819
692
  }));
820
693
  }
821
- function V() {
694
+ function H() {
822
695
  x &&= (clearTimeout(x), null);
823
696
  }
824
- function H(e, t = !1) {
697
+ function ne(e, t = !1) {
825
698
  let n = g;
826
- if (!h || !n || v || y || h.state.isLoading && !t || h.state.template?.id !== n.templateId) return;
827
- let r = we(n.view, h.content.value);
828
- if (r.length === 0) V();
699
+ if (!h || !n || _ || v || h.state.isLoading && !t || h.state.template?.id !== n.templateId) return;
700
+ let r = Te(n.view, h.content.value);
701
+ if (r.length === 0) H();
829
702
  else {
830
- if (!e && ze(r)) {
703
+ if (!e && Ie(r)) {
831
704
  let e = Date.now();
832
705
  if (x === null && (S = e), e - S < 1e3) {
833
706
  x && clearTimeout(x), x = setTimeout(() => {
834
- x = null, H(!0);
707
+ x = null, ne(!0);
835
708
  }, 300);
836
709
  return;
837
710
  }
838
711
  }
839
- V(), ne(n, r);
712
+ H(), re(n, r);
840
713
  }
841
714
  }
842
715
  function U() {
843
- H(!0);
716
+ ne(!0);
844
717
  }
845
- function ne(e, t) {
718
+ function re(e, t) {
846
719
  let n = t, r;
847
720
  try {
848
- r = k(e.view, n, I());
721
+ r = j(e.view, n, I());
849
722
  } catch (t) {
850
- if (!(t instanceof A)) throw t;
851
- z(e.view);
723
+ if (!(t instanceof N)) throw t;
724
+ B(e.view);
852
725
  let n = t.blockId === void 0 ? void 0 : u.value.get(t.blockId)?.holder;
853
726
  F({
854
727
  type: "editRefused",
@@ -858,65 +731,71 @@ function Ve(e) {
858
731
  return;
859
732
  }
860
733
  let i = h.content.value;
861
- if (!te(r, i)) {
734
+ if (!E(r, i)) {
862
735
  P(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
863
736
  op: "setContent",
864
- content: O(i)
737
+ content: z(i)
865
738
  }];
866
739
  try {
867
- r = k(e.view, n, I());
740
+ r = j(e.view, n, I());
868
741
  } catch (t) {
869
- if (!(t instanceof A)) throw t;
870
- z(e.view), F({
742
+ if (!(t instanceof N)) throw t;
743
+ B(e.view), F({
871
744
  type: "editRefused",
872
745
  code: t.code
873
746
  });
874
747
  return;
875
748
  }
876
749
  }
877
- let a = { ops: ke(e.view, n) };
878
- R(e.undo, a), e.redo = [], L(), e.view = r, re(e, n, "edit", a);
879
- }
880
- function re(e, t, n, r) {
881
- e.pending.push({
882
- batchId: crypto.randomUUID(),
883
- ops: t,
884
- origin: n,
885
- entry: r,
886
- sent: !1,
887
- revision: null
888
- }), W(e);
750
+ let a = { ops: te(e.view, n) };
751
+ R(e.undo, a), e.redo = [], L(), e.view = r, ie(e, n, "edit", a);
752
+ }
753
+ function ie(e, t, n, r) {
754
+ let i = { dropped: !1 }, a = 0;
755
+ do
756
+ e.pending.push({
757
+ batchId: crypto.randomUUID(),
758
+ ops: t.slice(a, a + Ae),
759
+ origin: n,
760
+ entry: r,
761
+ group: i,
762
+ sent: !1,
763
+ revision: null
764
+ }), a += Ae;
765
+ while (a < t.length);
766
+ W(e);
889
767
  }
890
768
  function W(e) {
891
769
  if (e.inFlight) return;
892
770
  let t = e.pending.find((e) => !e.sent);
893
- t ? (t.sent = !0, e.inFlight = t, ie(e, t, 0)) : K(e);
771
+ t ? (t.sent = !0, e.inFlight = t, ae(e, t, 0)) : q(e);
894
772
  }
895
- function ie(e, n, r) {
773
+ function ae(e, n, r) {
896
774
  t.submit(e.templateId, {
897
775
  batchId: n.batchId,
898
776
  baseRevision: e.revision,
899
- ops: n.ops
777
+ ops: n.ops,
778
+ ...n.origin === "ai" ? { origin: "ai" } : {}
900
779
  }).then(({ revision: t }) => {
901
- e.inFlight = null, ae(e, n, t), W(e);
780
+ e.inFlight = null, oe(e, n, t), W(e);
902
781
  }, (t) => {
903
- if (Fe(t) !== null) e.inFlight = null, se(e, n, t), W(e);
904
- else if (Le(t)) {
905
- q(e, t);
906
- let i = Me[Math.min(r, Me.length - 1)];
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)];
907
786
  setTimeout(() => {
908
- C || ie(e, n, r + 1);
787
+ C || ae(e, n, r + 1);
909
788
  }, i);
910
- } else e.inFlight = null, P(t), se(e, n, t), W(e);
789
+ } else e.inFlight = null, P(t), ce(e, n, t), W(e);
911
790
  });
912
791
  }
913
- function ae(e, t, n) {
914
- t.revision === null && (t.revision = n, n <= e.revision ? (G(e, t), Y(e)) : (e.own.set(n, t), le(e)));
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)));
915
794
  }
916
795
  function G(e, t) {
917
- e.pending = e.pending.filter((e) => e !== t), K(e);
796
+ e.pending = e.pending.filter((e) => e !== t), q(e);
918
797
  }
919
- function oe(e, t) {
798
+ function K(e, t) {
920
799
  if (t.entry) {
921
800
  for (let n of [e.undo, e.redo]) {
922
801
  let e = n.indexOf(t.entry);
@@ -925,61 +804,66 @@ function Ve(e) {
925
804
  L();
926
805
  }
927
806
  }
928
- function se(e, t, n) {
929
- G(e, t), oe(e, t);
930
- let r = Fe(n) ?? "invalid_operation";
931
- if (t.origin === "edit") {
932
- let t = Ie(n);
933
- F({
934
- type: "editRefused",
935
- code: r,
936
- ...t ? { holder: t } : {}
807
+ function se(e, t) {
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;
810
+ }
811
+ function ce(e, t, n) {
812
+ if (G(e, t), se(e, t)) {
813
+ let r = Me(n) ?? "invalid_operation";
814
+ if (t.origin === "edit" || t.origin === "ai") {
815
+ let t = Ne(n);
816
+ F({
817
+ type: "editRefused",
818
+ code: r,
819
+ ...t ? { holder: t } : {}
820
+ }, e);
821
+ } else F({
822
+ type: "undoSkipped",
823
+ code: r
937
824
  }, e);
938
- } else F({
939
- type: "undoSkipped",
940
- code: r
941
- }, e);
942
- Y(e), e === g && X();
825
+ }
826
+ de(e), e === g && X();
943
827
  }
944
- function K(e) {
828
+ function q(e) {
945
829
  if (!(e.pending.length > 0 || e.waiters.length === 0)) for (let t of e.waiters.splice(0)) t.resolve();
946
830
  }
947
- function q(e, t) {
831
+ function J(e, t) {
948
832
  let n = t instanceof Error ? t : Error(String(t));
949
833
  for (let t of e.waiters.splice(0)) t.reject(n);
950
834
  }
951
- function J(e, t) {
835
+ function le(e, t) {
952
836
  if (t.revision <= e.revision) return;
953
837
  let n = e.pending.find((e) => e.batchId === t.batchId);
954
- n ? ae(e, n, t.revision) : (e.remote.set(t.revision, t), le(e));
838
+ n ? oe(e, n, t.revision) : (e.remote.set(t.revision, t), Y(e));
955
839
  }
956
- function ce(t, n) {
840
+ function ue(t, n) {
957
841
  let r = n.ops;
958
842
  if (e.normalizeRemoteOperations) try {
959
843
  r = e.normalizeRemoteOperations(n.ops, t.confirmed);
960
844
  } catch (e) {
961
845
  P(e);
962
846
  }
963
- return Be(r);
847
+ return Le(r);
964
848
  }
965
- function le(t) {
966
- let n = [];
849
+ function Y(t) {
850
+ let n = [], r = !1;
967
851
  for (;;) {
968
- let e = t.revision + 1, r = t.remote.get(e), i = t.own.get(e);
969
- if (!r && !i) break;
852
+ let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
853
+ if (!i && !a) break;
970
854
  try {
971
- t.confirmed = k(t.confirmed, r ? ce(t, r) : i.ops);
855
+ t.confirmed = j(t.confirmed, i ? ue(t, i) : a.ops);
972
856
  } catch {
973
857
  if (t.recovering) {
974
858
  t.remote.clear(), t.own.clear(), P(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
975
859
  return;
976
860
  }
977
- fe(t);
861
+ me(t);
978
862
  return;
979
863
  }
980
- t.revision = e, r ? (t.remote.delete(e), n.push(r)) : (t.own.delete(e), G(t, i));
864
+ t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), G(t, a));
981
865
  }
982
- if (t === g && (f.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? ue(t) : de(t), n.length !== 0 && (Y(t), t === g)) for (let t of n) try {
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 {
983
867
  e.onRemoteChange?.({
984
868
  actor: t.actor,
985
869
  ops: t.ops
@@ -988,34 +872,36 @@ function Ve(e) {
988
872
  P(e);
989
873
  }
990
874
  }
991
- function Y(e) {
875
+ function de(e) {
992
876
  e === g && U();
993
- let t = e.confirmed, n = [];
994
- for (let r of e.pending) try {
995
- t = k(t, r.ops), n.push(r);
996
- } catch (t) {
997
- if (r.sent) {
998
- n.push(r);
999
- continue;
877
+ let t = e.confirmed;
878
+ for (let n = 0; n < e.pending.length; n++) {
879
+ let r = e.pending[n];
880
+ try {
881
+ t = j(t, r.ops);
882
+ } catch (i) {
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" ? {
887
+ type: "editRefused",
888
+ code: t
889
+ } : {
890
+ type: "undoSkipped",
891
+ code: t
892
+ }, e);
893
+ }
894
+ t = e.confirmed, n = -1;
1000
895
  }
1001
- oe(e, r);
1002
- let i = t instanceof A ? t.code : "invalid_operation";
1003
- F(r.origin === "edit" ? {
1004
- type: "editRefused",
1005
- code: i
1006
- } : {
1007
- type: "undoSkipped",
1008
- code: i
1009
- }, e);
1010
896
  }
1011
- e.pending = n, e.view = t, K(e), e === g && z(t);
897
+ e.view = t, q(e), e === g && B(t);
1012
898
  }
1013
- function ue(e) {
899
+ function fe(e) {
1014
900
  e.gapTimer ||= setTimeout(() => {
1015
901
  e.gapTimer = null, e === g && X();
1016
- }, Ae);
902
+ }, Ee);
1017
903
  }
1018
- function de(e) {
904
+ function pe(e) {
1019
905
  e.gapTimer &&= (clearTimeout(e.gapTimer), null);
1020
906
  }
1021
907
  function X() {
@@ -1025,10 +911,10 @@ function Ve(e) {
1025
911
  let n = await t.operationsAfter(e.templateId, e.revision);
1026
912
  if (e.retired) return;
1027
913
  if ("resync" in n) {
1028
- await fe(e);
914
+ await me(e);
1029
915
  return;
1030
916
  }
1031
- for (let t of n.batches) J(e, t);
917
+ for (let t of n.batches) le(e, t);
1032
918
  } catch (e) {
1033
919
  P(e);
1034
920
  } finally {
@@ -1036,26 +922,26 @@ function Ve(e) {
1036
922
  }
1037
923
  })(), e.catchingUp) : Promise.resolve();
1038
924
  }
1039
- async function fe(t) {
925
+ async function me(t) {
1040
926
  t.recovering = !0;
1041
927
  try {
1042
928
  let n = await e.loadTemplate(t.templateId);
1043
929
  if (t.retired) return;
1044
930
  let r = n.revision ?? t.revision;
1045
- t.confirmed = O(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
931
+ t.confirmed = z(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
1046
932
  for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), G(t, n));
1047
- t === g && (f.value = r), Y(t), le(t);
933
+ t === g && (p.value = r), de(t), Y(t);
1048
934
  } catch (e) {
1049
935
  P(e);
1050
936
  } finally {
1051
937
  t.recovering = !1;
1052
938
  }
1053
939
  }
1054
- function pe(t) {
940
+ function he(t) {
1055
941
  let n = () => t === g && !t.retired;
1056
942
  return {
1057
943
  onBatch: (e) => {
1058
- n() && J(t, e);
944
+ n() && le(t, e);
1059
945
  },
1060
946
  onResync: (r, i) => {
1061
947
  if (!(!n() || r <= t.revision)) {
@@ -1071,31 +957,31 @@ function Ve(e) {
1071
957
  }
1072
958
  },
1073
959
  onLock: (e) => {
1074
- n() && ye(e);
960
+ n() && xe(e);
1075
961
  },
1076
962
  onUnlock: (e, t) => {
1077
- n() && be(e, t);
963
+ n() && Se(e, t);
1078
964
  },
1079
965
  onMembers: (e) => {
1080
- n() && Z(e);
966
+ n() && Ce(e);
1081
967
  },
1082
968
  onConnectionChange: (e) => {
1083
- n() && _e(t, e);
969
+ n() && ye(t, e);
1084
970
  }
1085
971
  };
1086
972
  }
1087
- function me(e, n) {
1088
- t.join(e.templateId, { sessionId: r }, pe(e)).then((t) => {
1089
- e.retired || e !== g ? n || t.leave() : (e.leave = t.leave, xe(t.locks, !n), Z(t.members), t.members.length > 0 && (d.value = "connected"), t.revision > e.revision && X(), n && Q());
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());
1090
976
  }, (e) => P(e));
1091
977
  }
1092
- function he(e) {
1093
- let t = O(e.content), n = {
978
+ function _e(e) {
979
+ let t = z(e.content), n = {
1094
980
  templateId: e.id,
1095
981
  confirmed: t,
1096
982
  revision: e.revision ?? 0,
1097
983
  pending: [],
1098
- view: O(t),
984
+ view: z(t),
1099
985
  remote: /* @__PURE__ */ new Map(),
1100
986
  own: /* @__PURE__ */ new Map(),
1101
987
  inFlight: null,
@@ -1108,19 +994,19 @@ function Ve(e) {
1108
994
  redo: [],
1109
995
  waiters: []
1110
996
  };
1111
- g = n, f.value = n.revision, L(), me(n, !1), h?.state.selectedBlockId && De(h.state.selectedBlockId), B();
997
+ g = n, p.value = n.revision, L(), ge(n, !1), h?.state.selectedBlockId && Be(h.state.selectedBlockId), V();
1112
998
  }
1113
- function ge(e) {
1114
- e.retired = !0, de(e), e.leave?.(), e.leave = null, q(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
999
+ function ve(e) {
1000
+ e.retired = !0, pe(e), e.leave?.(), e.leave = null, J(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
1115
1001
  }
1116
- function _e(e, t) {
1002
+ function ye(e, t) {
1117
1003
  let n = d.value;
1118
- d.value = t, t === "connected" && n !== null && n !== "connected" && me(e, !0);
1004
+ d.value = t, t === "connected" && n !== null && n !== "connected" && ge(e, !0);
1119
1005
  }
1120
- function ve(e) {
1121
- g && g.templateId === e?.id || (g &&= (V(), ge(g), null), l.value = [], u.value = /* @__PURE__ */ new Map(), d.value = null, T = null, Q(), L(), e && he(e));
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));
1122
1008
  }
1123
- function ye(e) {
1009
+ function xe(e) {
1124
1010
  if (e.holder.sessionId === r) return;
1125
1011
  let t = new Map([...u.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
1126
1012
  t.set(e.blockId, e), u.value = t, h?.state.selectedBlockId === e.blockId && (h.selectBlock(null), F({
@@ -1129,116 +1015,142 @@ function Ve(e) {
1129
1015
  holder: e.holder
1130
1016
  }));
1131
1017
  }
1132
- function be(e, t) {
1018
+ function Se(e, t) {
1133
1019
  if (u.value.get(e)?.holder.sessionId !== t) return;
1134
1020
  let n = new Map(u.value);
1135
1021
  n.delete(e), u.value = n;
1136
1022
  }
1137
- function xe(e, t) {
1023
+ function Z(e, t) {
1138
1024
  let n = t ? new Map(u.value) : /* @__PURE__ */ new Map();
1139
1025
  for (let i of e) i.holder.sessionId !== r && (t && n.has(i.blockId) || n.set(i.blockId, i));
1140
1026
  u.value = n;
1141
1027
  }
1142
- function Z(e) {
1028
+ function Ce(e) {
1143
1029
  let t = new Set(e.map((e) => e.sessionId)), n = new Set(l.value.map((e) => e.sessionId).filter((e) => !t.has(e)));
1144
1030
  if (l.value = e, n.size === 0) return;
1145
1031
  let r = new Map([...u.value].filter(([, e]) => !n.has(e.holder.sessionId)));
1146
1032
  r.size !== u.value.size && (u.value = r);
1147
1033
  }
1148
- function Se(e) {
1149
- ee = ee.then(e).catch(P);
1034
+ function we(e) {
1035
+ O = O.then(e).catch(P);
1150
1036
  }
1151
1037
  function Q() {
1152
- s && Se(async () => {
1153
- if (E && (T === null || E.templateId !== T.templateId)) {
1154
- let e = E;
1155
- E = null, $(), await t.releaseLock(e.templateId, e.blockId);
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);
1156
1042
  }
1157
1043
  let e = T;
1158
- if (!(!e || E?.templateId === e.templateId && E.blockId === e.blockId)) try {
1159
- await t.acquireLock(e.templateId, e.blockId), E = e, Ee(), Ce(e.blockId);
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);
1160
1046
  } catch (n) {
1161
- if (E?.templateId === e.templateId) {
1162
- let e = E;
1163
- E = null, $(), await t.releaseLock(e.templateId, e.blockId).catch(() => {});
1047
+ if (D?.templateId === e.templateId) {
1048
+ let e = D;
1049
+ D = null, $(), await t.releaseLock(e.templateId, e.blockId).catch(() => {});
1164
1050
  }
1165
1051
  if (T !== e) return;
1166
- Te(e.blockId, n);
1052
+ Re(e.blockId, n);
1167
1053
  }
1168
1054
  });
1169
1055
  }
1170
- function Ce(e) {
1056
+ function je(e) {
1171
1057
  if (!u.value.has(e)) return;
1172
1058
  let t = new Map(u.value);
1173
1059
  t.delete(e), u.value = t;
1174
1060
  }
1175
- function Te(e, t) {
1176
- let n = Fe(t);
1061
+ function Re(e, t) {
1062
+ let n = Me(t);
1177
1063
  if (n === "lock_held" || n === "block_missing") {
1178
1064
  T = null;
1179
- let n = Ie(t);
1180
- n ? ye({
1065
+ let n = Ne(t);
1066
+ n ? xe({
1181
1067
  blockId: e,
1182
1068
  holder: n,
1183
1069
  expiresAt: ""
1184
1070
  }) : h?.state.selectedBlockId === e && h.selectBlock(null);
1185
1071
  } else P(t), setTimeout(() => {
1186
1072
  T?.blockId === e && Q();
1187
- }, Me[0]);
1073
+ }, Oe[0]);
1188
1074
  }
1189
- function Ee() {
1190
- j ||= setInterval(() => {
1191
- Se(async () => {
1192
- let e = E;
1075
+ function ze() {
1076
+ k ||= setInterval(() => {
1077
+ we(async () => {
1078
+ let e = D;
1193
1079
  if (e) try {
1194
1080
  await t.renewLock(e.templateId, e.blockId);
1195
1081
  } catch (e) {
1196
- if (Fe(e) === "lock_lost") {
1197
- E = null, $(), Q();
1082
+ if (Me(e) === "lock_lost") {
1083
+ D = null, $(), Q();
1198
1084
  return;
1199
1085
  }
1200
1086
  P(e);
1201
1087
  }
1202
1088
  });
1203
- }, je);
1089
+ }, De);
1204
1090
  }
1205
1091
  function $() {
1206
- j &&= (clearInterval(j), null);
1092
+ k &&= (clearInterval(k), null);
1207
1093
  }
1208
- function De(e) {
1094
+ function Be(e) {
1209
1095
  U(), g && (T = e ? {
1210
1096
  templateId: g.templateId,
1211
1097
  blockId: e
1212
1098
  } : null, Q());
1213
1099
  }
1214
- function Oe() {
1215
- U(), E && s && (t.releaseLock(E.templateId, E.blockId).catch(() => {}), E = null, $()), g?.leave?.(), g && (g.leave = null);
1100
+ function Ve() {
1101
+ U(), D && s && (t.releaseLock(D.templateId, D.blockId).catch(() => {}), D = null, $()), g?.leave?.(), g && (g.leave = null);
1216
1102
  }
1217
- function Pe(e) {
1103
+ function He(e) {
1218
1104
  let t = g;
1219
- if (!t || v) return;
1105
+ if (!t || _) return;
1220
1106
  U();
1221
1107
  let n = (e === "undo" ? t.undo : t.redo).pop();
1222
1108
  if (!n) return;
1223
1109
  L();
1224
1110
  let r;
1225
1111
  try {
1226
- r = k(t.view, n.ops, I());
1112
+ r = j(t.view, n.ops, I());
1227
1113
  } catch (e) {
1228
- if (!(e instanceof A)) throw e;
1114
+ if (!(e instanceof N)) throw e;
1229
1115
  F({
1230
1116
  type: "undoSkipped",
1231
1117
  code: e.code
1232
1118
  });
1233
1119
  return;
1234
1120
  }
1235
- let i = { ops: ke(t.view, n.ops) };
1236
- R(e === "undo" ? t.redo : t.undo, i), t.view = r, z(r), h?.markDirty(), re(t, n.ops, e, i);
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);
1123
+ }
1124
+ function Ue(e, t) {
1125
+ let n = g;
1126
+ if (!h || !n || _) return {
1127
+ applied: !1,
1128
+ error: new N("invalid_operation", 0, "No template is open for editing.")
1129
+ };
1130
+ U();
1131
+ let r, i;
1132
+ try {
1133
+ r = j(n.view, e, I()), i = te(n.view, e);
1134
+ } catch (e) {
1135
+ if (e instanceof N) return {
1136
+ applied: !1,
1137
+ error: e
1138
+ };
1139
+ throw e;
1140
+ }
1141
+ let a = n.undo.at(-1), o;
1142
+ return a && a.turn === t.turn ? (a.ops = [...i, ...a.ops], o = a) : (o = {
1143
+ ops: i,
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), {
1146
+ applied: !0,
1147
+ inverse: i
1148
+ };
1237
1149
  }
1238
- function Ve(e) {
1239
- h = e, w.push(_(() => e.state.template, (e) => ve(e), { immediate: !0 }), _(() => e.content.value, B, { deep: !0 }), _(() => e.state.selectedBlockId, De), _(() => e.state.isLoading, (e) => e ? H(!0, !0) : B())), typeof window < "u" && (window.addEventListener("pagehide", Oe), window.addEventListener("blur", U)), n() && c(Ge);
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);
1240
1152
  }
1241
- function He() {
1153
+ function Ge() {
1242
1154
  U();
1243
1155
  let e = g;
1244
1156
  return !e || e.pending.length === 0 ? Promise.resolve() : new Promise((t, n) => e.waiters.push({
@@ -1246,17 +1158,17 @@ function Ve(e) {
1246
1158
  reject: n
1247
1159
  }));
1248
1160
  }
1249
- function Ue() {
1250
- U(), v = !0;
1161
+ function Ke() {
1162
+ U(), _ = !0;
1251
1163
  }
1252
- function We() {
1253
- v = !1, g && z(g.view);
1164
+ function qe() {
1165
+ _ = !1, g && B(g.view);
1254
1166
  }
1255
- function Ge() {
1167
+ function Je() {
1256
1168
  if (!C) {
1257
1169
  U();
1258
1170
  for (let e of w.splice(0)) e();
1259
- V(), Oe(), C = !0, g && ge(g), g = null, $(), typeof window < "u" && (window.removeEventListener("pagehide", Oe), window.removeEventListener("blur", U));
1171
+ H(), Ve(), C = !0, g && ve(g), g = null, $(), typeof window < "u" && (window.removeEventListener("pagehide", Ve), window.removeEventListener("blur", U));
1260
1172
  }
1261
1173
  }
1262
1174
  return {
@@ -1264,48 +1176,47 @@ function Ve(e) {
1264
1176
  members: l,
1265
1177
  locks: u,
1266
1178
  connection: d,
1267
- revision: f,
1268
- canUndo: M,
1269
- canRedo: N,
1270
- attach: Ve,
1271
- undo: () => Pe("undo"),
1272
- redo: () => Pe("redo"),
1179
+ revision: p,
1180
+ canUndo: A,
1181
+ canRedo: M,
1182
+ attach: We,
1183
+ undo: () => He("undo"),
1184
+ redo: () => He("redo"),
1273
1185
  clearHistory: () => {
1274
1186
  g && (g.undo = [], g.redo = [], L());
1275
1187
  },
1276
1188
  flush: U,
1277
- settle: He,
1278
- suspend: Ue,
1279
- resume: We,
1189
+ settle: Ge,
1190
+ suspend: Ke,
1191
+ resume: qe,
1280
1192
  catchUp: X,
1281
- hasConfirmedBlock: (e) => g ? Re(g.confirmed.blocks, e) : !1,
1282
- destroy: Ge
1193
+ hasConfirmedBlock: (e) => g ? Fe(g.confirmed.blocks, e) : !1,
1194
+ applyOperations: Ue,
1195
+ destroy: Je
1283
1196
  };
1284
1197
  }
1285
- //#endregion
1286
- //#region ../core/src/saved-blocks.ts
1287
- function He(e) {
1288
- let { provider: t } = e, n = i([]), r = i(!1), a = m(() => {
1198
+ function ze(e) {
1199
+ let { provider: t } = e, n = a([]), r = a(!1), i = d(() => {
1289
1200
  let e = /* @__PURE__ */ new Set();
1290
1201
  for (let t of n.value) {
1291
1202
  let n = t.category?.trim();
1292
1203
  n && e.add(n);
1293
1204
  }
1294
1205
  return [...e].sort((e, t) => e.localeCompare(t));
1295
- }), o = m(() => typeof t.create == "function"), s = m(() => typeof t.update == "function"), c = m(() => typeof t.delete == "function");
1206
+ }), o = d(() => typeof t.create == "function"), s = d(() => typeof t.update == "function"), c = d(() => typeof t.delete == "function");
1296
1207
  function l(e) {
1297
1208
  return s.value && e.canUpdate !== !1;
1298
1209
  }
1299
1210
  function u(e) {
1300
1211
  return c.value && e.canDelete !== !1;
1301
1212
  }
1302
- function d(e, t) {
1303
- throw new M(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
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.`);
1304
1215
  }
1305
- function f(t) {
1216
+ function p(t) {
1306
1217
  J(e.onError, t);
1307
1218
  }
1308
- async function p(i) {
1219
+ async function m(i) {
1309
1220
  r.value = !0;
1310
1221
  try {
1311
1222
  n.value = await t.list(i);
@@ -1317,7 +1228,7 @@ function He(e) {
1317
1228
  }
1318
1229
  async function h(r, i, a) {
1319
1230
  let { create: o } = t;
1320
- typeof o != "function" && d("create", "disabled by the provider");
1231
+ typeof o != "function" && f("create", "disabled by the provider");
1321
1232
  try {
1322
1233
  let e = await o(a ? {
1323
1234
  name: r,
@@ -1327,30 +1238,30 @@ function He(e) {
1327
1238
  name: r,
1328
1239
  content: i
1329
1240
  });
1330
- return n.value = [e, ...n.value], f(() => t.onCreated?.(e)), e;
1241
+ return n.value = [e, ...n.value], p(() => t.onCreated?.(e)), e;
1331
1242
  } catch (t) {
1332
1243
  throw e.onError?.(t), t;
1333
1244
  }
1334
1245
  }
1335
1246
  async function g(r, i) {
1336
1247
  let { update: a } = t;
1337
- typeof a != "function" && d("update", "disabled by the provider");
1248
+ typeof a != "function" && f("update", "disabled by the provider");
1338
1249
  let o = n.value.find((e) => e.id === r);
1339
- o && o.canUpdate === !1 && d("update", `not permitted for entry "${r}"`);
1250
+ o && o.canUpdate === !1 && f("update", `not permitted for entry "${r}"`);
1340
1251
  try {
1341
1252
  let e = await a(r, i);
1342
- return n.value = n.value.map((t) => t.id === r ? e : t), f(() => t.onUpdated?.(e)), e;
1253
+ return n.value = n.value.map((t) => t.id === r ? e : t), p(() => t.onUpdated?.(e)), e;
1343
1254
  } catch (t) {
1344
1255
  throw e.onError?.(t), t;
1345
1256
  }
1346
1257
  }
1347
1258
  async function _(r) {
1348
1259
  let { delete: i } = t;
1349
- typeof i != "function" && d("delete", "disabled by the provider");
1260
+ typeof i != "function" && f("delete", "disabled by the provider");
1350
1261
  let a = n.value.find((e) => e.id === r) ?? null;
1351
- a && a.canDelete === !1 && d("delete", `not permitted for entry "${r}"`);
1262
+ a && a.canDelete === !1 && f("delete", `not permitted for entry "${r}"`);
1352
1263
  try {
1353
- await i(r), n.value = n.value.filter((e) => e.id !== r), a && f(() => t.onDeleted?.(a));
1264
+ await i(r), n.value = n.value.filter((e) => e.id !== r), a && p(() => t.onDeleted?.(a));
1354
1265
  } catch (t) {
1355
1266
  throw e.onError?.(t), t;
1356
1267
  }
@@ -1358,23 +1269,21 @@ function He(e) {
1358
1269
  return {
1359
1270
  savedBlocks: n,
1360
1271
  isLoading: r,
1361
- categories: a,
1272
+ categories: i,
1362
1273
  canCreate: o,
1363
1274
  canUpdate: s,
1364
1275
  canDelete: c,
1365
1276
  canUpdateBlock: l,
1366
1277
  canDeleteBlock: u,
1367
- load: p,
1278
+ load: m,
1368
1279
  create: h,
1369
1280
  update: g,
1370
1281
  remove: _
1371
1282
  };
1372
1283
  }
1373
- //#endregion
1374
- //#region ../core/src/saved-blocks-local.ts
1375
- var Ue = "templatical:saved-blocks";
1376
- function We(e = {}) {
1377
- let t = e.key ?? Ue;
1284
+ var $ = "templatical:saved-blocks";
1285
+ function Be(e = {}) {
1286
+ let t = e.key ?? $;
1378
1287
  function n() {
1379
1288
  if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageSavedBlocksProvider requires a browser environment with localStorage. Supply your own SavedBlocksProvider for server-side or non-browser use.");
1380
1289
  return localStorage;
@@ -1399,7 +1308,7 @@ function We(e = {}) {
1399
1308
  },
1400
1309
  async create(e) {
1401
1310
  let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
1402
- id: I(),
1311
+ id: T(),
1403
1312
  name: e.name,
1404
1313
  content: e.content,
1405
1314
  ...e.category ? { category: e.category } : {},
@@ -1425,11 +1334,9 @@ function We(e = {}) {
1425
1334
  }
1426
1335
  };
1427
1336
  }
1428
- //#endregion
1429
- //#region ../core/src/media-local.ts
1430
- var Ge = "templatical:media", Ke = 50;
1431
- function qe(e = {}) {
1432
- let t = e.key ?? Ge;
1337
+ var Ve = "templatical:media", He = 50;
1338
+ function Ue(e = {}) {
1339
+ let t = e.key ?? Ve;
1433
1340
  function n() {
1434
1341
  if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageMediaProvider requires a browser environment with localStorage. Supply your own MediaProvider for server-side or non-browser use.");
1435
1342
  return localStorage;
@@ -1462,12 +1369,12 @@ function qe(e = {}) {
1462
1369
  let t = r(), n = e?.search?.trim().toLowerCase(), i = n ? t.filter((e) => {
1463
1370
  let t = e.filename?.toLowerCase() ?? "", r = e.alt?.toLowerCase() ?? "";
1464
1371
  return t.includes(n) || r.includes(n);
1465
- }) : t, a = e?.cursor ? Number.parseInt(e.cursor, 10) : 0, o = Number.isFinite(a) && a > 0 ? a : 0, s = i.slice(o, o + Ke), c = { items: s }, l = o + s.length;
1372
+ }) : t, a = e?.cursor ? Number.parseInt(e.cursor, 10) : 0, o = Number.isFinite(a) && a > 0 ? a : 0, s = i.slice(o, o + He), c = { items: s }, l = o + s.length;
1466
1373
  return l < i.length && (c.nextCursor = String(l)), c;
1467
1374
  },
1468
1375
  async create(e) {
1469
1376
  let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
1470
- id: I(),
1377
+ id: T(),
1471
1378
  url: t,
1472
1379
  filename: e.filename || e.file.name,
1473
1380
  createdAt: n,
@@ -1502,31 +1409,29 @@ function qe(e = {}) {
1502
1409
  storage: !1
1503
1410
  };
1504
1411
  }
1505
- //#endregion
1506
- //#region ../core/src/version-history.ts
1507
- function Je(e) {
1508
- let { provider: t, getTemplateId: n } = e, r = i([]), a = i(!1), o = i(void 0), s = i(!1), c = /* @__PURE__ */ new Map(), l = m(() => typeof t.create == "function"), u = m(() => typeof t.restore == "function");
1509
- function d(e) {
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) {
1510
1415
  let t = n();
1511
- if (!t) throw new M(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
1416
+ if (!t) throw new I(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
1512
1417
  return t;
1513
1418
  }
1514
- function f(e) {
1515
- throw new M(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
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.`);
1516
1421
  }
1517
- function p(t) {
1422
+ function m(t) {
1518
1423
  J(e.onError, t);
1519
1424
  }
1520
1425
  async function h(n) {
1521
- let i = d("list");
1522
- a.value = !0;
1426
+ let a = f("list");
1427
+ i.value = !0;
1523
1428
  try {
1524
- let e = await t.list(i, n);
1429
+ let e = await t.list(a, n);
1525
1430
  r.value = e.versions, o.value = e.nextCursor;
1526
1431
  } catch (t) {
1527
1432
  throw e.onError?.(t), t;
1528
1433
  } finally {
1529
- a.value = !1;
1434
+ i.value = !1;
1530
1435
  }
1531
1436
  }
1532
1437
  function g(e) {
@@ -1535,7 +1440,7 @@ function Je(e) {
1535
1440
  async function _(n) {
1536
1441
  let r = g(n);
1537
1442
  if (r) return r;
1538
- let i = d("get");
1443
+ let i = f("get");
1539
1444
  try {
1540
1445
  let e = await t.get(i, n.id);
1541
1446
  return c.set(n.id, e), e;
@@ -1545,19 +1450,19 @@ function Je(e) {
1545
1450
  }
1546
1451
  async function v(n, i) {
1547
1452
  let { create: a } = t;
1548
- typeof a != "function" && f("create");
1549
- let o = d("create");
1453
+ typeof a != "function" && p("create");
1454
+ let o = f("create");
1550
1455
  try {
1551
1456
  let e = await a(o, n, i);
1552
- return r.value = [e, ...r.value], p(() => t.onCreated?.(e)), e;
1457
+ return r.value = [e, ...r.value], m(() => t.onCreated?.(e)), e;
1553
1458
  } catch (t) {
1554
1459
  throw e.onError?.(t), t;
1555
1460
  }
1556
1461
  }
1557
1462
  async function y(n) {
1558
1463
  let { restore: r } = t;
1559
- typeof r != "function" && f("restore");
1560
- let i = d("restore"), a;
1464
+ typeof r != "function" && p("restore");
1465
+ let i = f("restore"), a;
1561
1466
  s.value = !0;
1562
1467
  try {
1563
1468
  a = await r(i, n);
@@ -1566,12 +1471,12 @@ function Je(e) {
1566
1471
  } finally {
1567
1472
  s.value = !1;
1568
1473
  }
1569
- return p(() => t.onRestored?.(a)), a;
1474
+ return m(() => t.onRestored?.(a)), a;
1570
1475
  }
1571
1476
  return {
1572
1477
  nextCursor: o,
1573
1478
  versions: r,
1574
- isLoading: a,
1479
+ isLoading: i,
1575
1480
  isRestoring: s,
1576
1481
  canCreate: l,
1577
1482
  canRestore: u,
@@ -1582,29 +1487,27 @@ function Je(e) {
1582
1487
  restore: y
1583
1488
  };
1584
1489
  }
1585
- //#endregion
1586
- //#region ../core/src/comments.ts
1587
- function Ye(e) {
1588
- let { provider: t, getTemplateId: n, getUser: r } = e, a = i([]), o = i(!1), s = i(!1), c = m(() => typeof t.create == "function"), l = m(() => typeof t.update == "function"), u = m(() => typeof t.delete == "function"), d = m(() => typeof t.setResolved == "function"), f = m(() => a.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), p = m(() => a.value.filter((e) => !e.resolvedAt).length), h = m(() => {
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(() => {
1589
1492
  let e = /* @__PURE__ */ new Map();
1590
- for (let t of a.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
1493
+ for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
1591
1494
  return e;
1592
1495
  });
1593
1496
  function g(e) {
1594
1497
  let t = n();
1595
- if (!t) throw new M(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
1498
+ if (!t) throw new I(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
1596
1499
  return t;
1597
1500
  }
1598
1501
  function _(e) {
1599
1502
  let t = r();
1600
- if (!t) throw new M(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
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.`);
1601
1504
  return t;
1602
1505
  }
1603
1506
  function v(e) {
1604
- throw new M(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
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.`);
1605
1508
  }
1606
1509
  function y(e) {
1607
- for (let t of a.value) {
1510
+ for (let t of i.value) {
1608
1511
  if (t.id === e) return t;
1609
1512
  for (let n of t.replies ?? []) if (n.id === e) return n;
1610
1513
  }
@@ -1633,7 +1536,7 @@ function Ye(e) {
1633
1536
  }
1634
1537
  function T(e) {
1635
1538
  if (e.parentId) {
1636
- let t = !1, n = a.value.map((n) => {
1539
+ let t = !1, n = i.value.map((n) => {
1637
1540
  if (n.id !== e.parentId) return n;
1638
1541
  let r = n.replies ?? [], i = r.findIndex((t) => t.id === e.id);
1639
1542
  return i !== -1 && w(r[i], e) ? n : (t = !0, {
@@ -1641,28 +1544,28 @@ function Ye(e) {
1641
1544
  replies: i === -1 ? [...r, e] : C(r, i, e)
1642
1545
  });
1643
1546
  });
1644
- return t && (a.value = n), t;
1547
+ return t && (i.value = n), t;
1645
1548
  }
1646
- let t = a.value.findIndex((t) => t.id === e.id);
1647
- if (t === -1) return a.value = [...a.value, e], !0;
1549
+ let t = i.value.findIndex((t) => t.id === e.id);
1550
+ if (t === -1) return i.value = [...i.value, e], !0;
1648
1551
  let n = {
1649
1552
  ...e,
1650
- replies: e.replies ?? a.value[t].replies
1553
+ replies: e.replies ?? i.value[t].replies
1651
1554
  };
1652
- return !w(a.value[t], n) && (a.value = C(a.value, t, n), !0);
1555
+ return !w(i.value[t], n) && (i.value = C(i.value, t, n), !0);
1653
1556
  }
1654
1557
  function E(e, t) {
1655
1558
  let n = y(e), r = t ?? n?.parentId ?? null;
1656
- return r ? a.value = a.value.map((t) => t.id === r ? {
1559
+ return r ? i.value = i.value.map((t) => t.id === r ? {
1657
1560
  ...t,
1658
1561
  replies: (t.replies ?? []).filter((t) => t.id !== e)
1659
- } : t) : a.value = a.value.filter((t) => t.id !== e), n;
1562
+ } : t) : i.value = i.value.filter((t) => t.id !== e), n;
1660
1563
  }
1661
1564
  async function ee(e) {
1662
1565
  let n = g("list");
1663
1566
  o.value = !0;
1664
1567
  try {
1665
- a.value = await t.list(n, e);
1568
+ i.value = await t.list(n, e);
1666
1569
  } catch (e) {
1667
1570
  x(e);
1668
1571
  } finally {
@@ -1729,23 +1632,23 @@ function Ye(e) {
1729
1632
  function j(e) {
1730
1633
  T(e) && S(() => t.onCreated?.(e, { origin: "remote" }));
1731
1634
  }
1732
- function N(e) {
1635
+ function M(e) {
1733
1636
  T(e) && S(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
1734
1637
  }
1735
- function P(e, n) {
1638
+ function N(e, n) {
1736
1639
  let r = E(e, n);
1737
1640
  r && S(() => t.onDeleted?.(r, { origin: "remote" }));
1738
1641
  }
1739
1642
  return {
1740
- comments: a,
1643
+ comments: i,
1741
1644
  isLoading: o,
1742
1645
  isSubmitting: s,
1743
1646
  canCreate: c,
1744
1647
  canUpdate: l,
1745
1648
  canDelete: u,
1746
- canResolve: d,
1747
- totalCount: f,
1748
- unresolvedCount: p,
1649
+ canResolve: f,
1650
+ totalCount: p,
1651
+ unresolvedCount: m,
1749
1652
  commentCountByBlock: h,
1750
1653
  load: ee,
1751
1654
  create: D,
@@ -1755,34 +1658,37 @@ function Ye(e) {
1755
1658
  find: y,
1756
1659
  isOwn: b,
1757
1660
  applyRemoteCreate: j,
1758
- applyRemoteUpdate: N,
1759
- applyRemoteDelete: P
1661
+ applyRemoteUpdate: M,
1662
+ applyRemoteDelete: N
1760
1663
  };
1761
1664
  }
1762
- function Xe(t) {
1763
- let { comments: n, provider: r, getTemplateId: i } = t, { subscribe: a } = r;
1764
- if (typeof a != "function") return;
1765
- let o = null;
1766
- function s() {
1767
- o?.(), o = null;
1768
- }
1769
- e(() => i(), (e) => {
1770
- s(), e && (o = a(e, (e) => {
1665
+ function Ke(e) {
1666
+ let { comments: t, provider: n, getTemplateId: r } = e, { subscribe: i } = n;
1667
+ if (typeof i != "function") return;
1668
+ let a = null;
1669
+ function o() {
1670
+ a?.(), a = null;
1671
+ }
1672
+ S(() => r(), (e) => {
1673
+ o(), e && (a = i(e, (e) => {
1771
1674
  switch (e.type) {
1772
1675
  case "created":
1773
- n.applyRemoteCreate(e.comment);
1676
+ t.applyRemoteCreate(e.comment);
1774
1677
  break;
1775
1678
  case "updated":
1776
- n.applyRemoteUpdate(e.comment);
1679
+ t.applyRemoteUpdate(e.comment);
1777
1680
  break;
1778
- case "deleted": n.applyRemoteDelete(e.commentId, e.parentId);
1681
+ case "deleted": t.applyRemoteDelete(e.commentId, e.parentId);
1779
1682
  }
1780
1683
  }));
1781
- }, { immediate: !0 }), c(s);
1684
+ }, { immediate: !0 }), c(o);
1782
1685
  }
1783
1686
  //#endregion
1687
+ //#region src/constants/timeouts.ts
1688
+ var qe = 1e4;
1689
+ //#endregion
1784
1690
  //#region src/composables/useImageUrlResolver.ts
1785
- function Ze(e) {
1691
+ function Je(e) {
1786
1692
  let t = s(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
1787
1693
  function r(e) {
1788
1694
  return t.get(e);
@@ -1811,85 +1717,165 @@ function Ze(e) {
1811
1717
  lookup: a
1812
1718
  };
1813
1719
  }
1814
- function Qe(r) {
1815
- let i = t(re, null), a = m(r);
1816
- if (!i) return a;
1817
- let o;
1818
- function s() {
1819
- o !== void 0 && (clearTimeout(o), o = void 0);
1820
- }
1821
- n() && c(s);
1822
- let l = !0;
1823
- return e(a, (e) => {
1824
- s();
1825
- let t = l;
1826
- l = !1, e && !i.has(e) && (t ? i.lookup(e) : o = setTimeout(() => {
1827
- o = void 0, i.lookup(e);
1720
+ function Ye(e) {
1721
+ let r = t(W, null), i = d(e);
1722
+ if (!r) return i;
1723
+ let a;
1724
+ function o() {
1725
+ a !== void 0 && (clearTimeout(a), a = void 0);
1726
+ }
1727
+ n() && c(o);
1728
+ let s = !0;
1729
+ return S(i, (e) => {
1730
+ o();
1731
+ let t = s;
1732
+ s = !1, e && !r.has(e) && (t ? r.lookup(e) : a = setTimeout(() => {
1733
+ a = void 0, r.lookup(e);
1828
1734
  }, 300));
1829
- }, { immediate: !0 }), m(() => {
1830
- let e = a.value;
1735
+ }, { immediate: !0 }), d(() => {
1736
+ let e = i.value;
1831
1737
  if (!e) return e;
1832
- let t = i.get(e);
1738
+ let t = r.get(e);
1833
1739
  return typeof t == "string" && t.length > 0 ? t : e;
1834
1740
  });
1835
1741
  }
1836
- function $e(e, t) {
1742
+ function Xe(e, t) {
1837
1743
  if (!e || !t) return t;
1838
1744
  let n = e.get(t);
1839
1745
  return typeof n == "string" && n.length > 0 ? n : t;
1840
1746
  }
1841
- function et(e, t) {
1842
- return typeof e?.url == "string" && L(e.url, t);
1747
+ function Ze(e, t) {
1748
+ return typeof e?.url == "string" && V(e.url, t);
1843
1749
  }
1844
- function tt(e, t) {
1750
+ function Qe(e, t) {
1845
1751
  let n = e?.url;
1846
- if (typeof n == "string" && n.trim() !== "") return L(n, t) ? void 0 : n;
1752
+ if (typeof n == "string" && n.trim() !== "") return V(n, t) ? void 0 : n;
1847
1753
  }
1848
- function nt(e) {
1849
- let n = t(U, N.liquid), r = Qe(() => tt(e(), n));
1850
- return m(() => et(e(), n) ? null : r.value);
1754
+ function $e(e) {
1755
+ let n = t(re, A.liquid), r = Ye(() => Qe(e(), n));
1756
+ return d(() => Ze(e(), n) ? null : r.value);
1851
1757
  }
1852
- function rt(e, t, n) {
1853
- return et(t, n) ? null : $e(e, tt(t, n));
1758
+ function et(e, t, n) {
1759
+ return Ze(t, n) ? null : Xe(e, Qe(t, n));
1854
1760
  }
1855
1761
  //#endregion
1856
1762
  //#region src/utils/blockTypeLabels.ts
1857
- function it(e, t) {
1763
+ function tt(e, t) {
1858
1764
  return t.blocks[e] ?? e;
1859
1765
  }
1860
- function at(e, t, n = []) {
1861
- if (e.type !== "custom") return it(e.type, t);
1766
+ function nt(e, t, n = []) {
1767
+ if (e.type !== "custom") return tt(e.type, t);
1862
1768
  let { customType: r } = e;
1863
1769
  return n.find((e) => e.type === r)?.name ?? r;
1864
1770
  }
1865
1771
  //#endregion
1866
1772
  //#region src/utils/resolveFieldColors.ts
1867
- function ot(e, t) {
1868
- let n = G({ presets: e.presets }, ae), r = n.presets.length === 0;
1773
+ function rt(e, t) {
1774
+ let n = G({ presets: e.presets }, oe), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
1869
1775
  return {
1870
1776
  presets: r ? t.presets : n.presets,
1871
- allowCustom: t.allowCustom === !1 ? !1 : e.allowCustom ?? t.allowCustom,
1777
+ allowCustom: t.allowCustom !== !1 && i,
1872
1778
  invalidPresets: n.invalidPresets,
1873
1779
  emptyPresets: e.presets !== void 0 && e.presets.length === 0,
1874
1780
  presetsInherited: r,
1875
1781
  allowCustomIgnored: e.allowCustom === !0 && t.allowCustom === !1
1876
1782
  };
1877
1783
  }
1784
+ var it = K({
1785
+ name: "code",
1786
+ size: 24,
1787
+ node: [["path", {
1788
+ d: "m16 18 6-6-6-6",
1789
+ key: "eg8j8"
1790
+ }], ["path", {
1791
+ d: "m8 6-6 6 6 6",
1792
+ key: "ppft3o"
1793
+ }]]
1794
+ }), at = K({
1795
+ name: "navigation",
1796
+ size: 24,
1797
+ node: [["polygon", {
1798
+ points: "3 11 22 2 13 21 11 13 3 11",
1799
+ key: "1ltx0t"
1800
+ }]]
1801
+ }), ot = K({
1802
+ name: "share-2",
1803
+ size: 24,
1804
+ node: [
1805
+ ["circle", {
1806
+ cx: "18",
1807
+ cy: "5",
1808
+ r: "3",
1809
+ key: "gq8acd"
1810
+ }],
1811
+ ["circle", {
1812
+ cx: "6",
1813
+ cy: "12",
1814
+ r: "3",
1815
+ key: "w7nqdw"
1816
+ }],
1817
+ ["circle", {
1818
+ cx: "18",
1819
+ cy: "19",
1820
+ r: "3",
1821
+ key: "1xt0gg"
1822
+ }],
1823
+ ["line", {
1824
+ x1: "8.59",
1825
+ x2: "15.42",
1826
+ y1: "13.51",
1827
+ y2: "17.49",
1828
+ key: "47mynk"
1829
+ }],
1830
+ ["line", {
1831
+ x1: "15.41",
1832
+ x2: "8.59",
1833
+ y1: "6.51",
1834
+ y2: "10.49",
1835
+ key: "1n3mei"
1836
+ }]
1837
+ ]
1838
+ }), st = K({
1839
+ name: "table",
1840
+ size: 24,
1841
+ node: [
1842
+ ["path", {
1843
+ d: "M12 3v18",
1844
+ key: "108xh3"
1845
+ }],
1846
+ ["rect", {
1847
+ width: "18",
1848
+ height: "18",
1849
+ x: "3",
1850
+ y: "3",
1851
+ rx: "2",
1852
+ key: "afitv7"
1853
+ }],
1854
+ ["path", {
1855
+ d: "M3 9h18",
1856
+ key: "1pudct"
1857
+ }],
1858
+ ["path", {
1859
+ d: "M3 15h18",
1860
+ key: "5xshup"
1861
+ }]
1862
+ ]
1863
+ });
1878
1864
  //#endregion
1879
1865
  //#region src/utils/imageNaturalSize.ts
1880
- function st(e) {
1866
+ function ct(e) {
1881
1867
  return typeof e == "number" && Number.isFinite(e) && e > 0;
1882
1868
  }
1883
- function ct(e, t) {
1884
- return st(e) && st(t) ? {
1869
+ function lt(e, t) {
1870
+ return ct(e) && ct(t) ? {
1885
1871
  width: e,
1886
1872
  height: t
1887
1873
  } : null;
1888
1874
  }
1889
- function lt(e) {
1890
- return ct(e.naturalWidth, e.naturalHeight);
1891
- }
1892
1875
  function ut(e) {
1876
+ return lt(e.naturalWidth, e.naturalHeight);
1877
+ }
1878
+ function dt(e) {
1893
1879
  return e ? {
1894
1880
  naturalWidth: e.width,
1895
1881
  naturalHeight: e.height
@@ -1898,36 +1884,36 @@ function ut(e) {
1898
1884
  naturalHeight: void 0
1899
1885
  };
1900
1886
  }
1901
- function dt(e, t) {
1887
+ function ft(e, t) {
1902
1888
  if (typeof Image > "u") return t(null), () => {};
1903
1889
  let n = new Image(), r = () => {
1904
1890
  n.onload = null, n.onerror = null;
1905
1891
  };
1906
1892
  return n.onload = () => {
1907
- r(), t(ct(n.naturalWidth, n.naturalHeight));
1893
+ r(), t(lt(n.naturalWidth, n.naturalHeight));
1908
1894
  }, n.onerror = () => {
1909
1895
  r(), t(null);
1910
1896
  }, n.src = e, r;
1911
1897
  }
1912
- function ft(e) {
1898
+ function pt(e) {
1913
1899
  return new Promise((t) => {
1914
1900
  let n = setTimeout(() => {
1915
1901
  r(), t(null);
1916
- }, W), r = dt(e, (e) => {
1902
+ }, qe), r = ft(e, (e) => {
1917
1903
  clearTimeout(n), t(e);
1918
1904
  });
1919
1905
  });
1920
1906
  }
1921
1907
  //#endregion
1922
1908
  //#region src/components/MediaDropOverlay.vue
1923
- var pt = /* @__PURE__ */ a({
1909
+ var mt = /* @__PURE__ */ x({
1924
1910
  __name: "MediaDropOverlay",
1925
1911
  props: {
1926
1912
  uploading: { type: Boolean },
1927
1913
  size: { default: "field" }
1928
1914
  },
1929
- setup(e) {
1930
- let t = e, { t: n } = ie(), i = {
1915
+ setup(t) {
1916
+ let n = t, { t: i } = ae(), a = {
1931
1917
  field: {
1932
1918
  gap: "tpl:gap-1.5",
1933
1919
  icon: 18,
@@ -1938,41 +1924,52 @@ var pt = /* @__PURE__ */ a({
1938
1924
  icon: 20,
1939
1925
  veil: "85%"
1940
1926
  }
1941
- }, a = m(() => i[t.size]);
1942
- return (t, i) => (r(), h("div", {
1943
- class: f(["tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]", a.value.gap]),
1944
- style: g({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${a.value.veil}, transparent)` })
1945
- }, [e.uploading ? (r(), h(y, { key: 0 }, [d(u(oe), {
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), {
1946
1932
  class: "tpl-spinner",
1947
- size: a.value.icon,
1933
+ size: o.value.icon,
1948
1934
  "stroke-width": 2
1949
- }, null, 8, ["size"]), x(" " + b(u(n).image.uploading), 1)], 64)) : (r(), h(y, { key: 1 }, [d(u(se), {
1950
- size: a.value.icon,
1935
+ }, null, 8, ["size"]), m(" " + r(v(i).image.uploading), 1)], 64)) : (g(), p(y, { key: 1 }, [u(v(se), {
1936
+ size: o.value.icon,
1951
1937
  "stroke-width": 1.5
1952
- }, null, 8, ["size"]), x(" " + b(u(n).image.dropToUpload), 1)], 64))], 6));
1938
+ }, null, 8, ["size"]), m(" " + r(v(i).image.dropToUpload), 1)], 64))], 6));
1953
1939
  }
1954
- }), mt = "image/";
1955
- function ht(e) {
1956
- let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || v(r), { isOverDropZone: a } = V(t, {
1940
+ });
1941
+ //#endregion
1942
+ //#region src/composables/useAliveFlag.ts
1943
+ function ht() {
1944
+ let e = { alive: !0 };
1945
+ return i(() => {
1946
+ e.alive = !1;
1947
+ }), e;
1948
+ }
1949
+ //#endregion
1950
+ //#region src/composables/useImageDrop.ts
1951
+ var gt = "image/";
1952
+ function _t(e) {
1953
+ let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || h(r), { isOverDropZone: a } = ne(t, {
1957
1954
  preventDefaultForUnhandled: !0,
1958
1955
  onDrop: (e) => {
1959
1956
  if (!i()) return;
1960
- let t = (e ?? []).filter((e) => e.type.startsWith(mt));
1957
+ let t = (e ?? []).filter((e) => e.type.startsWith(gt));
1961
1958
  t.length > 0 && n([t[0]]);
1962
1959
  }
1963
1960
  });
1964
- return { isOver: m(() => i() && a.value) };
1961
+ return { isOver: d(() => i() && a.value) };
1965
1962
  }
1966
1963
  //#endregion
1967
1964
  //#region src/composables/useMediaDropField.ts
1968
- function gt(e) {
1969
- let { target: n, blocked: r, apply: a } = e, o = t(H, null), s = t(ne, null), c = K();
1965
+ function vt(e) {
1966
+ let { target: n, blocked: r, apply: i } = e, o = t(U, null), s = t(ie, null), c = ht();
1970
1967
  async function l() {
1971
1968
  let e = await o?.({ accept: ["images"] });
1972
- c.alive && e && a(e);
1969
+ c.alive && e && i(e);
1973
1970
  }
1974
- let u = i(!1), d = m(() => (s?.value ?? !!o) && !u.value && !v(r));
1975
- async function f(e) {
1971
+ let u = a(!1), f = d(() => (s?.value ?? !!o) && !u.value && !h(r));
1972
+ async function p(e) {
1976
1973
  if (o) {
1977
1974
  u.value = !0;
1978
1975
  try {
@@ -1981,29 +1978,29 @@ function gt(e) {
1981
1978
  files: e
1982
1979
  });
1983
1980
  if (!c.alive) return;
1984
- t && a(t);
1981
+ t && i(t);
1985
1982
  } finally {
1986
1983
  c.alive && (u.value = !1);
1987
1984
  }
1988
1985
  }
1989
1986
  }
1990
- let { isOver: p } = ht({
1987
+ let { isOver: m } = _t({
1991
1988
  target: n,
1992
- enabled: d,
1993
- onFiles: f
1994
- }), h = m(() => d.value && p.value || u.value);
1989
+ enabled: f,
1990
+ onFiles: p
1991
+ }), g = d(() => f.value && m.value || u.value);
1995
1992
  return {
1996
1993
  canBrowse: !!o,
1997
- dropEnabled: d,
1994
+ dropEnabled: f,
1998
1995
  isUploading: u,
1999
- showOverlay: h,
1996
+ showOverlay: g,
2000
1997
  openMediaBrowser: l
2001
1998
  };
2002
1999
  }
2003
- function _t(e, t = "desktop") {
2000
+ function yt(e, t = "desktop") {
2004
2001
  return t === "mobile" ? 375 : e?.width ?? 600;
2005
2002
  }
2006
- var vt = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", yt = {
2003
+ var bt = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", xt = {
2007
2004
  1: [100],
2008
2005
  2: [50, 50],
2009
2006
  3: [
@@ -2014,59 +2011,59 @@ var vt = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", yt = {
2014
2011
  "1-2": [33.33, 66.67],
2015
2012
  "2-1": [66.67, 33.33]
2016
2013
  };
2017
- function bt(e, t) {
2018
- let n = (e) => Math.trunc(e ?? 0), r = (e) => T(e) === null ? 0 : Math.trunc(e.width);
2014
+ function St(e, t) {
2015
+ let n = (e) => Math.trunc(e ?? 0), r = (e) => B(e) === null ? 0 : Math.trunc(e.width);
2019
2016
  return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
2020
2017
  }
2021
- function xt(e, t) {
2022
- return Math.floor(e) - bt(t);
2018
+ function Ct(e, t) {
2019
+ return Math.floor(e) - St(t);
2023
2020
  }
2024
- function St(e, t) {
2021
+ function wt(e, t) {
2025
2022
  let n = "border" in e ? e.border : void 0;
2026
- return Math.floor(t) - bt(e.styles.padding, n);
2023
+ return Math.floor(t) - St(e.styles.padding, n);
2027
2024
  }
2028
- function* Ct(e, t) {
2029
- for (let n of e) F(n) ? yield* Ct(n.children, xt(t, n.styles.padding)) : yield {
2025
+ function* Tt(e, t) {
2026
+ for (let n of e) O(n) ? yield* Tt(n.children, Ct(t, n.styles.padding)) : yield {
2030
2027
  block: n,
2031
- bandWidth: P(n) && n.wrapper ? xt(t, n.wrapper.padding) : t
2028
+ bandWidth: F(n) && n.wrapper ? Ct(t, n.wrapper.padding) : t
2032
2029
  };
2033
2030
  }
2034
- function wt(e, t) {
2031
+ function Et(e, t) {
2035
2032
  if (!t) return e;
2036
2033
  try {
2037
- return z(t, e);
2034
+ return M(t, e);
2038
2035
  } catch {
2039
2036
  return e;
2040
2037
  }
2041
2038
  }
2042
- function Tt(e, t, n) {
2043
- let r = wt(e, n);
2044
- for (let { block: e, bandWidth: n } of Ct(r.blocks, r.settings.width)) if (P(e)) {
2045
- let r = C(e)?.applied ? void 0 : e.border, i = Math.floor(n) - bt(e.styles.padding, r), a = yt[e.columns] ?? [100];
2039
+ function Dt(e, t, n) {
2040
+ 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];
2046
2043
  for (let n = 0; n < e.children.length; n++) {
2047
2044
  let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
2048
- if (o) return St(o, r);
2045
+ if (o) return wt(o, r);
2049
2046
  }
2050
- } else if (e.id === t) return St(e, n);
2047
+ } else if (e.id === t) return wt(e, n);
2051
2048
  return null;
2052
2049
  }
2053
- function Et(e, t, n) {
2054
- let r = wt(e, n);
2055
- for (let { block: e, bandWidth: n } of Ct(r.blocks, r.settings.width)) if (e.id === t) return Math.floor(n);
2050
+ function Ot(e, t, n) {
2051
+ let r = Et(e, n);
2052
+ for (let { block: e, bandWidth: n } of Tt(r.blocks, r.settings.width)) if (e.id === t) return Math.floor(n);
2056
2053
  return null;
2057
2054
  }
2058
- function Dt(e, t, n) {
2059
- if (!P(e)) return;
2060
- let r = C(e);
2061
- if (r?.applied && r.height === "image") return (t ? Et(t, e.id, n) : null) ?? _t(t?.settings);
2055
+ function kt(e, t, n) {
2056
+ if (!F(e)) return;
2057
+ let r = P(e);
2058
+ if (r?.applied && r.height === "image") return (t ? Ot(t, e.id, n) : null) ?? yt(t?.settings);
2062
2059
  }
2063
2060
  //#endregion
2064
2061
  //#region src/constants/socialIcons.ts
2065
- var Ot = B, kt = {
2062
+ var At = k, jt = {
2066
2063
  small: 24,
2067
2064
  medium: 32,
2068
2065
  large: 48
2069
- }, At = [
2066
+ }, Mt = [
2070
2067
  "facebook",
2071
2068
  "twitter",
2072
2069
  "instagram",
@@ -2086,6 +2083,4 @@ var Ot = B, kt = {
2086
2083
  "behance"
2087
2084
  ];
2088
2085
  //#endregion
2089
- export { Ve as A, Qe as C, qe as D, Je as E, pe as F, X as I, de as L, he as M, me as N, We as O, fe as P, ce as R, nt as S, Ye as T, at as _, Dt as a, tt as b, _t as c, dt as d, ft as f, ot as g, ct as h, Tt as i, ge as j, He as k, gt as l, lt as m, Ot as n, Et as o, ut as p, At as r, vt as s, kt as t, pt as u, it as v, Xe as w, rt as x, Ze as y };
2090
-
2091
- //# sourceMappingURL=socialIcons-CkZSYpoG.js.map
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 };