@templatical/editor 0.52.1 → 0.53.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 (396) hide show
  1. package/README.md +1 -1
  2. package/dist/AiAltTextPopover-NMJqQKvD.js +106 -0
  3. package/dist/{AiAltTextReview-9ySsXOTU.js → AiAltTextReview-Ci4zHwRc.js} +68 -66
  4. package/dist/AiChatPanel-DdhtfsmO.js +561 -0
  5. package/dist/{AiPanels-DqT4PgQ0.js → AiPanels-HBx7xoJR.js} +6 -6
  6. package/dist/{AiRewriteMenu-28agTycW.js → AiRewriteMenu-DPzSekZt.js} +76 -105
  7. package/dist/BlockIssueBadge-eIXZJ9M3.js +33 -0
  8. package/dist/BlockPreviewCanvas-DO-2TP_6.js +140 -0
  9. package/dist/{CloudHeaderExtras-QI82yF54.js → CloudHeaderExtras-XpjJjn3o.js} +4 -4
  10. package/dist/{CloudPanels-BKJaLkUN.js → CloudPanels-i2kZdrdP.js} +53 -53
  11. package/dist/CollaborationNotices-DANsjl7c.js +65 -0
  12. package/dist/{CollaboratorBar-CXQqN3VP.js → CollaboratorBar-CbbAA0m1.js} +24 -24
  13. package/dist/CommentsPanel-CYW3LWis.js +16 -0
  14. package/dist/CommentsSidebar-CcF4ISMi.js +526 -0
  15. package/dist/{CountdownBlock-CU2yTWtF.js → CountdownBlock-BMezkFbJ.js} +15 -15
  16. package/dist/CountdownToolbar-D3Lv74kU.js +258 -0
  17. package/dist/IssuesPanel-BMAG9042.js +371 -0
  18. package/dist/LanguageMenu-FlP_Jbup.js +403 -0
  19. package/dist/{LoadingTrack-DM4g6j7b.js → LoadingTrack-BG8cg9xi.js} +2 -2
  20. package/dist/LocaleNotices-DAnVszWu.js +46 -0
  21. package/dist/LogicTagInsertButton-BjYs-UQX.js +1096 -0
  22. package/dist/{MediaEditModal-Dy08GEwE.js → MediaEditModal-LnG-cF_S.js} +451 -451
  23. package/dist/{MediaPanels-BgEp7iCp.js → MediaPanels-C2r5fiFo.js} +4 -4
  24. package/dist/{MergeTagInput-B9dtUthD.js → MergeTagInput-BsnogCeY.js} +30 -30
  25. package/dist/{MergeTagModeToggle-DxujhYJ4.js → MergeTagModeToggle-DiufIQ-_.js} +49 -49
  26. package/dist/MergeTagTextarea-BweI-Xsi.js +126 -0
  27. package/dist/ParagraphEditor-qgBp5yIB.js +825 -0
  28. package/dist/{RestoreVersionDialog-C4s_JYCx.js → RestoreVersionDialog-DdYUrFiK.js} +23 -23
  29. package/dist/{RichTextEditorContent-o6HmE8GR.js → RichTextEditorContent-C5MAzx3E.js} +47 -47
  30. package/dist/{SaveBlockDialog-CWLrly6l.js → SaveBlockDialog-eK6fjtTy.js} +86 -86
  31. package/dist/{cdn/chunks/SavedBlocksBrowserModal-BPYcRoGa.js → SavedBlocksBrowserModal-D2QHd2Yp.js} +135 -132
  32. package/dist/{SavedBlocksPanels-BE1N9rNZ.js → SavedBlocksPanels-Cl61f4Mf.js} +9 -9
  33. package/dist/{SavedBlocksPickBar-Dwl94xhP.js → SavedBlocksPickBar-CXP2dkeB.js} +15 -15
  34. package/dist/TemplateSettings-BKJrdZcH.js +294 -0
  35. package/dist/TestEmailModal-DQotJg6g.js +212 -0
  36. package/dist/{TestEmailPanel-DaFjP9QK.js → TestEmailPanel-CwiTzJsh.js} +4 -4
  37. package/dist/TitleEditor-CzSvsPAn.js +202 -0
  38. package/dist/ToggleSwitch-R3wCCYE6.js +43 -0
  39. package/dist/Toolbar-Cd75ci5W.js +3711 -0
  40. package/dist/{TplModal-DLMssVlt.js → TplModal-ZoXu40T9.js} +17 -17
  41. package/dist/{VersionHistoryMenu-BkbYUs0Q.js → VersionHistoryMenu-BvhN-Ofk.js} +39 -39
  42. package/dist/{VersionHistoryPanels-DP7HaYWv.js → VersionHistoryPanels-DPWMnYbd.js} +5 -5
  43. package/dist/VersionPreviewBanner-CuJnasxH.js +37 -0
  44. package/dist/WrapperBlock-D4fPwO0t.js +44 -0
  45. package/dist/{blockTypeIcons-BHjlPnPf.js → blockTypeIcons-BXMxu86H.js} +7 -7
  46. package/dist/bundle-stats.json +8 -8
  47. package/dist/{cdn/chunks/ca-CD-Kt1qz.js → ca-DOuIxWRv.js} +114 -2
  48. package/dist/cdn/chunks/AiAltTextPopover-ByZ0FEqI.js +107 -0
  49. package/dist/cdn/chunks/AiAltTextPopover-ByZ0FEqI.js.map +1 -0
  50. package/dist/cdn/chunks/{AiAltTextReview-BGLLSKLm.js → AiAltTextReview-Dtm3A2cD.js} +70 -68
  51. package/dist/cdn/chunks/AiAltTextReview-Dtm3A2cD.js.map +1 -0
  52. package/dist/cdn/chunks/AiChatPanel-DciEt27y.js +487 -0
  53. package/dist/cdn/chunks/AiChatPanel-DciEt27y.js.map +1 -0
  54. package/dist/cdn/chunks/{AiPanels-0wBarZSH.js → AiPanels-BV5D1itk.js} +11 -11
  55. package/dist/cdn/chunks/{AiPanels-0wBarZSH.js.map → AiPanels-BV5D1itk.js.map} +1 -1
  56. package/dist/cdn/chunks/{AiRewriteMenu-qf-cfEpy.js → AiRewriteMenu-D3jkh6Xb.js} +79 -79
  57. package/dist/cdn/chunks/AiRewriteMenu-D3jkh6Xb.js.map +1 -0
  58. package/dist/cdn/chunks/BlockIssueBadge-DyEgBZtR.js +34 -0
  59. package/dist/cdn/chunks/BlockIssueBadge-DyEgBZtR.js.map +1 -0
  60. package/dist/cdn/chunks/BlockPreviewCanvas-RQFilqXC.js +142 -0
  61. package/dist/cdn/chunks/{BlockPreviewCanvas-DGBh6mqe.js.map → BlockPreviewCanvas-RQFilqXC.js.map} +1 -1
  62. package/dist/cdn/chunks/{CloudHeaderExtras-BMNK_F9p.js → CloudHeaderExtras-BtqdN777.js} +4 -4
  63. package/dist/cdn/chunks/{CloudHeaderExtras-BMNK_F9p.js.map → CloudHeaderExtras-BtqdN777.js.map} +1 -1
  64. package/dist/cdn/chunks/{CloudPanels-JMWIoVWh.js → CloudPanels-BSJ-Z5Hw.js} +45 -45
  65. package/dist/cdn/chunks/{CloudPanels-JMWIoVWh.js.map → CloudPanels-BSJ-Z5Hw.js.map} +1 -1
  66. package/dist/cdn/chunks/CollaborationNotices-BS7xrlPE.js +67 -0
  67. package/dist/cdn/chunks/CollaborationNotices-BS7xrlPE.js.map +1 -0
  68. package/dist/cdn/chunks/{CollaboratorBar-CXByAoUz.js → CollaboratorBar-Bc9914Az.js} +17 -17
  69. package/dist/cdn/chunks/{CollaboratorBar-CXByAoUz.js.map → CollaboratorBar-Bc9914Az.js.map} +1 -1
  70. package/dist/cdn/chunks/CommentsPanel-DbR9phAk.js +18 -0
  71. package/dist/cdn/chunks/{CommentsPanel-DoJnKLXI.js.map → CommentsPanel-DbR9phAk.js.map} +1 -1
  72. package/dist/cdn/chunks/CommentsSidebar-BD4--XP2.js +496 -0
  73. package/dist/cdn/chunks/CommentsSidebar-BD4--XP2.js.map +1 -0
  74. package/dist/cdn/chunks/{CountdownBlock-BqRw147R.js → CountdownBlock-CjMhMhnv.js} +22 -22
  75. package/dist/cdn/chunks/{CountdownBlock-BqRw147R.js.map → CountdownBlock-CjMhMhnv.js.map} +1 -1
  76. package/dist/cdn/chunks/CountdownToolbar-DxwYBw-d.js +260 -0
  77. package/dist/cdn/chunks/CountdownToolbar-DxwYBw-d.js.map +1 -0
  78. package/dist/cdn/chunks/{IssuesPanel-C7LfxaAY.js → IssuesPanel-CUmI4HMm.js} +133 -121
  79. package/dist/cdn/chunks/IssuesPanel-CUmI4HMm.js.map +1 -0
  80. package/dist/cdn/chunks/LanguageMenu-3ydCozQJ.js +359 -0
  81. package/dist/cdn/chunks/LanguageMenu-3ydCozQJ.js.map +1 -0
  82. package/dist/cdn/chunks/{LoadingTrack-CZuLTazv.js → LoadingTrack-DUYcDHOV.js} +2 -2
  83. package/dist/cdn/chunks/{LoadingTrack-CZuLTazv.js.map → LoadingTrack-DUYcDHOV.js.map} +1 -1
  84. package/dist/cdn/chunks/LocaleNotices-BfoH6gST.js +47 -0
  85. package/dist/cdn/chunks/LocaleNotices-BfoH6gST.js.map +1 -0
  86. package/dist/{LogicTagInsertButton-CfscnwCn.js → cdn/chunks/LogicTagInsertButton-5Z3fFzjc.js} +422 -449
  87. package/dist/cdn/chunks/LogicTagInsertButton-5Z3fFzjc.js.map +1 -0
  88. package/dist/cdn/chunks/{MediaEditModal-Cpcod6_U.js → MediaEditModal-DDCIwr9U.js} +421 -421
  89. package/dist/cdn/chunks/MediaEditModal-DDCIwr9U.js.map +1 -0
  90. package/dist/cdn/chunks/{MediaPanels-BIdcW_1f.js → MediaPanels-Dz79oy8P.js} +5 -5
  91. package/dist/cdn/chunks/{MediaPanels-BIdcW_1f.js.map → MediaPanels-Dz79oy8P.js.map} +1 -1
  92. package/dist/cdn/chunks/{MergeTagInput-BvWg8o5E.js → MergeTagInput-CIWy-cXf.js} +28 -28
  93. package/dist/cdn/chunks/{MergeTagInput-BvWg8o5E.js.map → MergeTagInput-CIWy-cXf.js.map} +1 -1
  94. package/dist/cdn/chunks/{MergeTagModeToggle-BgKEVUtV.js → MergeTagModeToggle-BrP5GR-x.js} +52 -52
  95. package/dist/cdn/chunks/MergeTagModeToggle-BrP5GR-x.js.map +1 -0
  96. package/dist/cdn/chunks/MergeTagTextarea-D3nNDlhV.js +128 -0
  97. package/dist/cdn/chunks/MergeTagTextarea-D3nNDlhV.js.map +1 -0
  98. package/dist/cdn/chunks/ParagraphEditor-DDolH_Pf.js +660 -0
  99. package/dist/cdn/chunks/ParagraphEditor-DDolH_Pf.js.map +1 -0
  100. package/dist/cdn/chunks/{RestoreVersionDialog-CjOdD2xj.js → RestoreVersionDialog-Crj1DBqC.js} +22 -22
  101. package/dist/cdn/chunks/{RestoreVersionDialog-CjOdD2xj.js.map → RestoreVersionDialog-Crj1DBqC.js.map} +1 -1
  102. package/dist/cdn/chunks/{RichTextEditorContent-DNjR_sNN.js → RichTextEditorContent-rCCqFlwJ.js} +44 -44
  103. package/dist/cdn/chunks/{RichTextEditorContent-DNjR_sNN.js.map → RichTextEditorContent-rCCqFlwJ.js.map} +1 -1
  104. package/dist/cdn/chunks/{SaveBlockDialog-CUhpawq0.js → SaveBlockDialog-C34RW1aM.js} +77 -77
  105. package/dist/cdn/chunks/{SaveBlockDialog-CUhpawq0.js.map → SaveBlockDialog-C34RW1aM.js.map} +1 -1
  106. package/dist/{SavedBlocksBrowserModal-CE8n4EBS.js → cdn/chunks/SavedBlocksBrowserModal-CJnwWPT-.js} +103 -106
  107. package/dist/cdn/chunks/{SavedBlocksBrowserModal-BPYcRoGa.js.map → SavedBlocksBrowserModal-CJnwWPT-.js.map} +1 -1
  108. package/dist/cdn/chunks/{SavedBlocksPanels-C6--Bc81.js → SavedBlocksPanels-CA2PqXIH.js} +9 -9
  109. package/dist/cdn/chunks/{SavedBlocksPanels-C6--Bc81.js.map → SavedBlocksPanels-CA2PqXIH.js.map} +1 -1
  110. package/dist/cdn/chunks/{SavedBlocksPickBar-DUavxpbU.js → SavedBlocksPickBar-Dj3ortee.js} +16 -16
  111. package/dist/cdn/chunks/{SavedBlocksPickBar-DUavxpbU.js.map → SavedBlocksPickBar-Dj3ortee.js.map} +1 -1
  112. package/dist/cdn/chunks/TemplateSettings-sW0ZlDl1.js +266 -0
  113. package/dist/cdn/chunks/TemplateSettings-sW0ZlDl1.js.map +1 -0
  114. package/dist/cdn/chunks/TestEmailModal-BXeCtTjU.js +212 -0
  115. package/dist/cdn/chunks/TestEmailModal-BXeCtTjU.js.map +1 -0
  116. package/dist/cdn/chunks/{TestEmailPanel-CcUpEpAn.js → TestEmailPanel-CpZcpB9D.js} +5 -5
  117. package/dist/cdn/chunks/{TestEmailPanel-CcUpEpAn.js.map → TestEmailPanel-CpZcpB9D.js.map} +1 -1
  118. package/dist/cdn/chunks/TitleEditor-Bv3SmSO6.js +202 -0
  119. package/dist/cdn/chunks/TitleEditor-Bv3SmSO6.js.map +1 -0
  120. package/dist/cdn/chunks/ToggleSwitch-BSkySwA1.js +45 -0
  121. package/dist/cdn/chunks/ToggleSwitch-BSkySwA1.js.map +1 -0
  122. package/dist/cdn/chunks/Toolbar-BJKpJ2Mg.js +3626 -0
  123. package/dist/cdn/chunks/Toolbar-BJKpJ2Mg.js.map +1 -0
  124. package/dist/cdn/chunks/{TplModal-CFPDgbwQ.js → TplModal-DDDUDMYC.js} +20 -20
  125. package/dist/cdn/chunks/{TplModal-CFPDgbwQ.js.map → TplModal-DDDUDMYC.js.map} +1 -1
  126. package/dist/cdn/chunks/{VersionHistoryMenu-BYlLRvRJ.js → VersionHistoryMenu-DSElv3Sv.js} +33 -33
  127. package/dist/cdn/chunks/{VersionHistoryMenu-BYlLRvRJ.js.map → VersionHistoryMenu-DSElv3Sv.js.map} +1 -1
  128. package/dist/cdn/chunks/{VersionHistoryPanels-C6SOVoiT.js → VersionHistoryPanels-H2nuik1l.js} +6 -6
  129. package/dist/cdn/chunks/{VersionHistoryPanels-C6SOVoiT.js.map → VersionHistoryPanels-H2nuik1l.js.map} +1 -1
  130. package/dist/cdn/chunks/VersionPreviewBanner-Whwxh55w.js +39 -0
  131. package/dist/cdn/chunks/VersionPreviewBanner-Whwxh55w.js.map +1 -0
  132. package/dist/cdn/chunks/WrapperBlock-jTqsuLnS.js +46 -0
  133. package/dist/cdn/chunks/WrapperBlock-jTqsuLnS.js.map +1 -0
  134. package/dist/cdn/chunks/{blockTypeIcons-D7FW7Ypo.js → blockTypeIcons-DMgLcuI8.js} +5 -5
  135. package/dist/cdn/chunks/{blockTypeIcons-D7FW7Ypo.js.map → blockTypeIcons-DMgLcuI8.js.map} +1 -1
  136. package/dist/{ca-CD-Kt1qz.js → cdn/chunks/ca-DOuIxWRv.js} +116 -0
  137. package/dist/cdn/chunks/ca-DOuIxWRv.js.map +1 -0
  138. package/dist/cdn/chunks/composables-D0UYam2P.js +3039 -0
  139. package/dist/cdn/chunks/composables-D0UYam2P.js.map +1 -0
  140. package/dist/cdn/chunks/{createCloudRuntime-Cth2JCEh.js → createCloudRuntime-BdsclY8_.js} +75 -73
  141. package/dist/cdn/chunks/createCloudRuntime-BdsclY8_.js.map +1 -0
  142. package/dist/{de-CeFJ6wbM.js → cdn/chunks/de-DaOUfYBX.js} +116 -0
  143. package/dist/cdn/chunks/de-DaOUfYBX.js.map +1 -0
  144. package/dist/cdn/chunks/{dist-8ym3y-pH.js → dist-BzXULHvI.js} +48 -48
  145. package/dist/cdn/chunks/{dist-8ym3y-pH.js.map → dist-BzXULHvI.js.map} +1 -1
  146. package/dist/cdn/chunks/{dist-BMzNabtD.js → dist-DqGgijFI.js} +114 -114
  147. package/dist/cdn/chunks/{dist-BMzNabtD.js.map → dist-DqGgijFI.js.map} +1 -1
  148. package/dist/cdn/chunks/{draggable-Du8AUMFT.js → draggable-DepKdldn.js} +1491 -1486
  149. package/dist/cdn/chunks/draggable-DepKdldn.js.map +1 -0
  150. package/dist/cdn/chunks/{editor-modal-CyCe560f.js → editor-modal-CPbgthOv.js} +781 -781
  151. package/dist/cdn/chunks/{editor-modal-CyCe560f.js.map → editor-modal-CPbgthOv.js.map} +1 -1
  152. package/dist/{en-D14i5nFh.js → cdn/chunks/en-C0pHHMiR.js} +116 -0
  153. package/dist/cdn/chunks/en-C0pHHMiR.js.map +1 -0
  154. package/dist/cdn/chunks/en-IYVryJRl.js +1 -0
  155. package/dist/{es-zDacbMhs.js → cdn/chunks/es-CxyEKr6n.js} +116 -0
  156. package/dist/cdn/chunks/es-CxyEKr6n.js.map +1 -0
  157. package/dist/cdn/chunks/{extensions-CFF2KWy-.js → extensions-Uh9vuFfK.js} +59 -59
  158. package/dist/cdn/chunks/{extensions-CFF2KWy-.js.map → extensions-Uh9vuFfK.js.map} +1 -1
  159. package/dist/{fr-CSgYtjOd.js → cdn/chunks/fr-CYbamiI6.js} +116 -0
  160. package/dist/cdn/chunks/fr-CYbamiI6.js.map +1 -0
  161. package/dist/cdn/chunks/{icons-okSPsLOa.js → icons-CSSMtbGK.js} +150 -109
  162. package/dist/cdn/chunks/icons-CSSMtbGK.js.map +1 -0
  163. package/dist/{ja-B7H3ID8O.js → cdn/chunks/ja-DfaIAoGI.js} +116 -0
  164. package/dist/cdn/chunks/ja-DfaIAoGI.js.map +1 -0
  165. package/dist/cdn/chunks/keys-CoQtCqNv.js +11 -0
  166. package/dist/cdn/chunks/keys-CoQtCqNv.js.map +1 -0
  167. package/dist/cdn/chunks/languageName-DEEOhDWI.js +12 -0
  168. package/dist/cdn/chunks/languageName-DEEOhDWI.js.map +1 -0
  169. package/dist/{nl-176ySmc5.js → cdn/chunks/nl-DkrB-VKZ.js} +116 -0
  170. package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +1 -0
  171. package/dist/cdn/chunks/normalizeMergeTagMarkup-oGhwVscw.js +290 -0
  172. package/dist/cdn/chunks/normalizeMergeTagMarkup-oGhwVscw.js.map +1 -0
  173. package/dist/cdn/chunks/noticeTones-D7BPu-Le.js +16 -0
  174. package/dist/cdn/chunks/noticeTones-D7BPu-Le.js.map +1 -0
  175. package/dist/cdn/chunks/plural-CyxrJXL1.js +17 -0
  176. package/dist/cdn/chunks/plural-CyxrJXL1.js.map +1 -0
  177. package/dist/cdn/chunks/{preRenderCustomBlocks-BcXIz7oJ.js → preRenderCustomBlocks-C8k7tw98.js} +5 -5
  178. package/dist/cdn/chunks/{preRenderCustomBlocks-BcXIz7oJ.js.map → preRenderCustomBlocks-C8k7tw98.js.map} +1 -1
  179. package/dist/{pt-BR-dDlTwX18.js → cdn/chunks/pt-BR-CY5Ye7eP.js} +116 -0
  180. package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +1 -0
  181. package/dist/cdn/chunks/sanitizeHtml-DYklmvgX.js +61 -0
  182. package/dist/cdn/chunks/sanitizeHtml-DYklmvgX.js.map +1 -0
  183. package/dist/cdn/chunks/socialIcons-BAiuHyJs.js +2638 -0
  184. package/dist/cdn/chunks/socialIcons-BAiuHyJs.js.map +1 -0
  185. package/dist/cdn/chunks/src-CACM3o--.js +2606 -0
  186. package/dist/cdn/chunks/src-CACM3o--.js.map +1 -0
  187. package/dist/cdn/chunks/{src-C7bkofBL.js → src-Ddpm4HsS.js} +222 -256
  188. package/dist/cdn/chunks/src-Ddpm4HsS.js.map +1 -0
  189. package/dist/cdn/chunks/{src-DEd87i_U.js → src-DheBmnvF.js} +635 -478
  190. package/dist/cdn/chunks/src-DheBmnvF.js.map +1 -0
  191. package/dist/{styleConstants-B8xVRiwX.js → cdn/chunks/styleConstants-CgiNKdnc.js} +7 -5
  192. package/dist/cdn/chunks/styleConstants-CgiNKdnc.js.map +1 -0
  193. package/dist/cdn/chunks/templateSettingsFields-cjlP-jdw.js.map +1 -1
  194. package/dist/cdn/chunks/{tiptap-CbiTlECY.js → tiptap-Dipw_zOQ.js} +40 -40
  195. package/dist/cdn/chunks/{tiptap-CbiTlECY.js.map → tiptap-Dipw_zOQ.js.map} +1 -1
  196. package/dist/cdn/chunks/{useCloudI18n-DY8_-ETE.js → useCloudI18n-Cc5NZqiI.js} +3 -3
  197. package/dist/cdn/chunks/{useCloudI18n-DY8_-ETE.js.map → useCloudI18n-Cc5NZqiI.js.map} +1 -1
  198. package/dist/cdn/chunks/useEditorRoot-D_LuZ_hE.js +9 -0
  199. package/dist/cdn/chunks/{useEditorRoot-vjZJwKrV.js.map → useEditorRoot-D_LuZ_hE.js.map} +1 -1
  200. package/dist/cdn/chunks/{useI18n-D8pY4LTq.js → useI18n-BnJYydPv.js} +3 -3
  201. package/dist/cdn/chunks/{useI18n-D8pY4LTq.js.map → useI18n-BnJYydPv.js.map} +1 -1
  202. package/dist/cdn/chunks/useLocalizedDisplay-yXbRKNrs.js +33 -0
  203. package/dist/cdn/chunks/useLocalizedDisplay-yXbRKNrs.js.map +1 -0
  204. package/dist/cdn/chunks/{useLogicTag-DBJDtpKA.js → useLogicTag-B7RpqVFQ.js} +5 -5
  205. package/dist/cdn/chunks/{useLogicTag-DBJDtpKA.js.map → useLogicTag-B7RpqVFQ.js.map} +1 -1
  206. package/dist/cdn/chunks/{useMergeTag-B-aG--s1.js → useMergeTag-C-32ETjj.js} +6 -6
  207. package/dist/cdn/chunks/{useMergeTag-B-aG--s1.js.map → useMergeTag-C-32ETjj.js.map} +1 -1
  208. package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js +78 -0
  209. package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js.map +1 -0
  210. package/dist/cdn/chunks/{useScrollToBlock-vjQ0fe-L.js → useScrollToBlock-Ct1AwLD-.js} +5 -5
  211. package/dist/cdn/chunks/useScrollToBlock-Ct1AwLD-.js.map +1 -0
  212. package/dist/cdn/chunks/{withCurrentFont-hZTvYBHO.js → withCurrentFont-D33ZXoWp.js} +2 -2
  213. package/dist/cdn/chunks/{withCurrentFont-hZTvYBHO.js.map → withCurrentFont-D33ZXoWp.js.map} +1 -1
  214. package/dist/cdn/editor.css +1 -1
  215. package/dist/cdn/editor.js +2190 -1496
  216. package/dist/cdn/editor.js.map +1 -1
  217. package/dist/{check-BZ8o0eet.js → check-ChQ0l8EQ.js} +1 -1
  218. package/dist/{chevron-down-DfAAfILv.js → chevron-down-Bh6cp6PI.js} +1 -1
  219. package/dist/{chevron-right-Bk4mGdr7.js → chevron-right-LUgdqdoW.js} +1 -1
  220. package/dist/{chevron-up-MhUf_azW.js → chevron-up-XsDeJxQN.js} +1 -1
  221. package/dist/{circle-alert-CShJwVFv.js → circle-alert-lODfDsrj.js} +1 -1
  222. package/dist/{clock-CTfD6OCt.js → clock-DrqFEZkT.js} +1 -1
  223. package/dist/composables-BOP3ERRP.js +4517 -0
  224. package/dist/{createCloudRuntime-DCgO4A1r.js → createCloudRuntime-DGV5a5Af.js} +54 -52
  225. package/dist/{createLucideIcon-CvhTA2KG.js → createLucideIcon-Dw5e5gVE.js} +11 -11
  226. package/dist/{cdn/chunks/de-CeFJ6wbM.js → de-DaOUfYBX.js} +114 -2
  227. package/dist/{dist-ByCWA2Tv.js → dist-0alKVRc_.js} +101 -101
  228. package/dist/{dist-Cy8I5scI.js → dist-54VCNoC0.js} +2 -2
  229. package/dist/dist-6DU0me3E.js +4 -0
  230. package/dist/{dist-p3wymUDt.js → dist-B8dY8drK.js} +2 -2
  231. package/dist/{dist-Dd5MU2Ev.js → dist-B9a7iVye.js} +2 -2
  232. package/dist/{dist-V7W1UhVr.js → dist-BWflWcpW.js} +2 -2
  233. package/dist/{dist-D6fZec6r.js → dist-C3hu_C3w.js} +2 -2
  234. package/dist/{dist-CVy-7PHQ.js → dist-CX7skkvG.js} +48 -48
  235. package/dist/dist-CcOn7WCo.js +4 -0
  236. package/dist/dist-Cdkm20M6.js +2542 -0
  237. package/dist/{dist-BS5uKktL.js → dist-ChOb5XHW.js} +2 -2
  238. package/dist/{dist-BF5zEHop.js → dist-DZ3X-uB8.js} +2 -2
  239. package/dist/{dist-CWSG7Kj0.js → dist-D_XrUEET.js} +5 -5
  240. package/dist/{dist-txQLT2sF.js → dist-TAv500j6.js} +2 -2
  241. package/dist/{dist-D6cMdrfG.js → dist-fqSers8_.js} +55 -55
  242. package/dist/{editor-modal-zaZHcmlO.js → editor-modal-B_2EAOjN.js} +953 -952
  243. package/dist/{cdn/chunks/en-D14i5nFh.js → en-C0pHHMiR.js} +114 -2
  244. package/dist/en-DTtwco2Q.js +1 -0
  245. package/dist/{cdn/chunks/es-zDacbMhs.js → es-CxyEKr6n.js} +114 -2
  246. package/dist/{extensions-fo_c-vqf.js → extensions-DOLZkLzV.js} +173 -173
  247. package/dist/{eye-7W4t5e0Q.js → eye-DChfk0gi.js} +1 -1
  248. package/dist/{cdn/chunks/fr-CSgYtjOd.js → fr-CYbamiI6.js} +114 -2
  249. package/dist/{image-BDiRFzSd.js → image--Hj2by1G.js} +1 -1
  250. package/dist/index.d.ts +182 -14
  251. package/dist/{info-Cxi3-Kh9.js → info-BbXgy82f.js} +1 -1
  252. package/dist/{cdn/chunks/ja-B7H3ID8O.js → ja-DfaIAoGI.js} +114 -2
  253. package/dist/keys-BCqskl51.js +9 -0
  254. package/dist/languageName-DEEOhDWI.js +10 -0
  255. package/dist/{link-ju_2Cmir.js → link-C2_8yJno.js} +1 -1
  256. package/dist/{list-DYZJf0aZ.js → list-DLGs2n0V.js} +1 -1
  257. package/dist/{loader-circle-BZRD0a4I.js → loader-circle-BbDItE_O.js} +1 -1
  258. package/dist/{message-circle-DuEw4Zfx.js → message-circle-NAModq0p.js} +1 -1
  259. package/dist/{cdn/chunks/nl-176ySmc5.js → nl-DkrB-VKZ.js} +114 -2
  260. package/dist/normalizeMergeTagMarkup-CUCo7B5X.js +288 -0
  261. package/dist/noticeTones-D7BPu-Le.js +14 -0
  262. package/dist/{package-CePMr2kK.js → package-BuzsfRyH.js} +1 -1
  263. package/dist/{pencil-D3aFCL7c.js → pencil-BTUUECH4.js} +1 -1
  264. package/dist/plural-CyxrJXL1.js +15 -0
  265. package/dist/plus-Dm7DN65T.js +13 -0
  266. package/dist/{preRenderCustomBlocks--_xc0XK3.js → preRenderCustomBlocks-Bs3N9no-.js} +4 -4
  267. package/dist/{cdn/chunks/pt-BR-dDlTwX18.js → pt-BR-CY5Ye7eP.js} +114 -2
  268. package/dist/{refresh-cw-xnro7_Sk.js → refresh-cw-xMURqGWi.js} +2 -12
  269. package/dist/rotate-ccw-DqVcEIn5.js +13 -0
  270. package/dist/{runtime-dom.esm-bundler-BURR-bj5.js → runtime-dom.esm-bundler-DlHp8xgy.js} +154 -154
  271. package/dist/sanitizeHtml-mKgNUdME.js +962 -0
  272. package/dist/{search-CDrstRBv.js → search-Cfr3W44N.js} +1 -1
  273. package/dist/{send-DROkPOaX.js → send-CH1SrvyB.js} +1 -1
  274. package/dist/{smartphone-Bx6u_tjn.js → smartphone-pAkvzjdI.js} +1 -1
  275. package/dist/socialIcons-Dqr4DJOz.js +2705 -0
  276. package/dist/{sparkles-CdaTtvoz.js → sparkles-CRO0cCnp.js} +1 -1
  277. package/dist/{square-BbCROH_f.js → square-CaQWMntx.js} +1 -1
  278. package/dist/style.css +1 -1
  279. package/dist/{cdn/chunks/styleConstants-B8xVRiwX.js → styleConstants-CgiNKdnc.js} +5 -7
  280. package/dist/templatical-editor.js +2438 -1752
  281. package/dist/{text-align-start-CGacJ9Vw.js → text-align-start-BQ39AaRK.js} +1 -1
  282. package/dist/{trash-DxCd7zIy.js → trash-BL5gEFHN.js} +1 -1
  283. package/dist/{triangle-alert-7_oaitpf.js → triangle-alert-BYbKu7zZ.js} +1 -1
  284. package/dist/{upload-DuFEOi_0.js → upload-BhmL4Vqx.js} +1 -1
  285. package/dist/{useCloudI18n-DEMmUKuO.js → useCloudI18n-Dh2iydo1.js} +4 -4
  286. package/dist/useEditorRoot-DY3mgcHm.js +7 -0
  287. package/dist/{useI18n-BBrHTdu8.js → useI18n-CgtvtF4C.js} +4 -4
  288. package/dist/useLocalizedDisplay-DNNwDRxL.js +31 -0
  289. package/dist/{useLogicTag-ZPC39rfH.js → useLogicTag-BXXXQQmi.js} +4 -4
  290. package/dist/{useMergeTag-BQ4qqWpQ.js → useMergeTag-C9Okr87y.js} +5 -5
  291. package/dist/usePopoverPosition-VDQjyX_A.js +76 -0
  292. package/dist/{useScrollToBlock-BSyAV4pk.js → useScrollToBlock-C0Kapxdh.js} +5 -5
  293. package/dist/{vue.runtime.esm-bundler-CnEeTfhs.js → vue.runtime.esm-bundler-BJXc_Mri.js} +1373 -1368
  294. package/dist/withCurrentFont-DJiQqZzL.js +18 -0
  295. package/dist/{x-BpfG7v9g.js → x-B7NZYzhx.js} +1 -1
  296. package/package.json +20 -20
  297. package/dist/AiAltTextPopover-DawbUywc.js +0 -105
  298. package/dist/AiChatPanel-CupPhmsN.js +0 -548
  299. package/dist/BlockIssueBadge-BxpDy3u-.js +0 -33
  300. package/dist/BlockPreviewCanvas-B-4bmJ3t.js +0 -140
  301. package/dist/CollaborationNotices-CTw4JThq.js +0 -75
  302. package/dist/CommentsPanel-DwwFuh1h.js +0 -16
  303. package/dist/CommentsSidebar-9ZfiC2DO.js +0 -500
  304. package/dist/CountdownToolbar-BqoYzf_6.js +0 -197
  305. package/dist/IssuesPanel-4ykrf1ax.js +0 -359
  306. package/dist/MergeTagTextarea-CPFEjJZd.js +0 -69
  307. package/dist/ParagraphEditor-CWXfurGh.js +0 -796
  308. package/dist/TemplateSettings-CS0f1Ues.js +0 -236
  309. package/dist/TestEmailModal-DBD0X5nV.js +0 -209
  310. package/dist/TitleEditor-DSqtle77.js +0 -198
  311. package/dist/ToggleSwitch-JykPyD_8.js +0 -36
  312. package/dist/Toolbar-BZPFfKrf.js +0 -3145
  313. package/dist/VersionPreviewBanner-DECaBwLq.js +0 -37
  314. package/dist/WrapperBlock-BsJv_Fiw.js +0 -44
  315. package/dist/cdn/chunks/AiAltTextPopover-SEEjkd-I.js +0 -106
  316. package/dist/cdn/chunks/AiAltTextPopover-SEEjkd-I.js.map +0 -1
  317. package/dist/cdn/chunks/AiAltTextReview-BGLLSKLm.js.map +0 -1
  318. package/dist/cdn/chunks/AiChatPanel-DKDAaBNi.js +0 -474
  319. package/dist/cdn/chunks/AiChatPanel-DKDAaBNi.js.map +0 -1
  320. package/dist/cdn/chunks/AiRewriteMenu-qf-cfEpy.js.map +0 -1
  321. package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js +0 -34
  322. package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js.map +0 -1
  323. package/dist/cdn/chunks/BlockPreviewCanvas-DGBh6mqe.js +0 -142
  324. package/dist/cdn/chunks/CollaborationNotices-Bsf1rGW9.js +0 -77
  325. package/dist/cdn/chunks/CollaborationNotices-Bsf1rGW9.js.map +0 -1
  326. package/dist/cdn/chunks/CommentsPanel-DoJnKLXI.js +0 -18
  327. package/dist/cdn/chunks/CommentsSidebar-CUtgvdBC.js +0 -470
  328. package/dist/cdn/chunks/CommentsSidebar-CUtgvdBC.js.map +0 -1
  329. package/dist/cdn/chunks/CountdownToolbar-xobieKoU.js +0 -199
  330. package/dist/cdn/chunks/CountdownToolbar-xobieKoU.js.map +0 -1
  331. package/dist/cdn/chunks/IssuesPanel-C7LfxaAY.js.map +0 -1
  332. package/dist/cdn/chunks/LogicTagInsertButton-BIi05UQu.js +0 -1051
  333. package/dist/cdn/chunks/LogicTagInsertButton-BIi05UQu.js.map +0 -1
  334. package/dist/cdn/chunks/MediaEditModal-Cpcod6_U.js.map +0 -1
  335. package/dist/cdn/chunks/MergeTagModeToggle-BgKEVUtV.js.map +0 -1
  336. package/dist/cdn/chunks/MergeTagTextarea-tBz8McZf.js +0 -71
  337. package/dist/cdn/chunks/MergeTagTextarea-tBz8McZf.js.map +0 -1
  338. package/dist/cdn/chunks/ParagraphEditor-B3Rj_cWF.js +0 -631
  339. package/dist/cdn/chunks/ParagraphEditor-B3Rj_cWF.js.map +0 -1
  340. package/dist/cdn/chunks/TemplateSettings-CKtI-dof.js +0 -208
  341. package/dist/cdn/chunks/TemplateSettings-CKtI-dof.js.map +0 -1
  342. package/dist/cdn/chunks/TestEmailModal-CDQTgESD.js +0 -209
  343. package/dist/cdn/chunks/TestEmailModal-CDQTgESD.js.map +0 -1
  344. package/dist/cdn/chunks/TitleEditor-Cob7RLyK.js +0 -198
  345. package/dist/cdn/chunks/TitleEditor-Cob7RLyK.js.map +0 -1
  346. package/dist/cdn/chunks/ToggleSwitch-J7Vwhvha.js +0 -38
  347. package/dist/cdn/chunks/ToggleSwitch-J7Vwhvha.js.map +0 -1
  348. package/dist/cdn/chunks/Toolbar-CdpsvNOR.js +0 -3061
  349. package/dist/cdn/chunks/Toolbar-CdpsvNOR.js.map +0 -1
  350. package/dist/cdn/chunks/VersionPreviewBanner-Dvg0ZfAW.js +0 -39
  351. package/dist/cdn/chunks/VersionPreviewBanner-Dvg0ZfAW.js.map +0 -1
  352. package/dist/cdn/chunks/WrapperBlock-C7Md56IT.js +0 -46
  353. package/dist/cdn/chunks/WrapperBlock-C7Md56IT.js.map +0 -1
  354. package/dist/cdn/chunks/ca-CD-Kt1qz.js.map +0 -1
  355. package/dist/cdn/chunks/createCloudRuntime-Cth2JCEh.js.map +0 -1
  356. package/dist/cdn/chunks/de-CeFJ6wbM.js.map +0 -1
  357. package/dist/cdn/chunks/draggable-Du8AUMFT.js.map +0 -1
  358. package/dist/cdn/chunks/en-D14i5nFh.js.map +0 -1
  359. package/dist/cdn/chunks/en-TIqv4ag3.js +0 -1
  360. package/dist/cdn/chunks/es-zDacbMhs.js.map +0 -1
  361. package/dist/cdn/chunks/fr-CSgYtjOd.js.map +0 -1
  362. package/dist/cdn/chunks/icons-okSPsLOa.js.map +0 -1
  363. package/dist/cdn/chunks/ja-B7H3ID8O.js.map +0 -1
  364. package/dist/cdn/chunks/keys-CUj6UA38.js +0 -11
  365. package/dist/cdn/chunks/keys-CUj6UA38.js.map +0 -1
  366. package/dist/cdn/chunks/nl-176ySmc5.js.map +0 -1
  367. package/dist/cdn/chunks/normalizeMergeTagMarkup-C_KlfSW4.js +0 -198
  368. package/dist/cdn/chunks/normalizeMergeTagMarkup-C_KlfSW4.js.map +0 -1
  369. package/dist/cdn/chunks/pt-BR-dDlTwX18.js.map +0 -1
  370. package/dist/cdn/chunks/sanitizeHtml-CN85EDrO.js +0 -72
  371. package/dist/cdn/chunks/sanitizeHtml-CN85EDrO.js.map +0 -1
  372. package/dist/cdn/chunks/socialIcons-jsTDmkbb.js +0 -2008
  373. package/dist/cdn/chunks/socialIcons-jsTDmkbb.js.map +0 -1
  374. package/dist/cdn/chunks/src-C7bkofBL.js.map +0 -1
  375. package/dist/cdn/chunks/src-DEd87i_U.js.map +0 -1
  376. package/dist/cdn/chunks/src-DwWrYnUj.js +0 -1404
  377. package/dist/cdn/chunks/src-DwWrYnUj.js.map +0 -1
  378. package/dist/cdn/chunks/styleConstants-B8xVRiwX.js.map +0 -1
  379. package/dist/cdn/chunks/useEditorCore-BrY66C2y.js +0 -2582
  380. package/dist/cdn/chunks/useEditorCore-BrY66C2y.js.map +0 -1
  381. package/dist/cdn/chunks/useEditorRoot-vjZJwKrV.js +0 -9
  382. package/dist/cdn/chunks/usePopoverPosition-DSMtmu2W.js +0 -70
  383. package/dist/cdn/chunks/usePopoverPosition-DSMtmu2W.js.map +0 -1
  384. package/dist/cdn/chunks/useScrollToBlock-vjQ0fe-L.js.map +0 -1
  385. package/dist/dist-CKi_npZM.js +0 -1344
  386. package/dist/dist-DyFArF_G.js +0 -4
  387. package/dist/dist-pA3ooG6N.js +0 -4
  388. package/dist/en-Db76vJbY.js +0 -1
  389. package/dist/keys-BgRERHzu.js +0 -9
  390. package/dist/normalizeMergeTagMarkup-CELnOlgK.js +0 -196
  391. package/dist/sanitizeHtml-BzfzpYJY.js +0 -942
  392. package/dist/socialIcons-D7MGsg0d.js +0 -2075
  393. package/dist/useEditorCore-BSo2sSID.js +0 -4059
  394. package/dist/useEditorRoot-BMcoCLBx.js +0 -7
  395. package/dist/usePopoverPosition-DV1PxL66.js +0 -68
  396. package/dist/withCurrentFont-B22FXAF5.js +0 -18
@@ -1,4059 +0,0 @@
1
- import { $ as e, A as t, C as n, D as r, H as i, I as a, J as o, K as s, M as c, Mt as l, N as u, Nt as d, O as f, P as p, U as m, V as h, X as g, Z as _, _ as v, at as y, b, c as x, d as S, f as C, g as w, it as T, j as E, jt as D, k as O, l as k, ot as A, r as j, st as M, tt as ee, u as N, v as te, x as P, y as F, z as I } from "./vue.runtime.esm-bundler-CnEeTfhs.js";
2
- import { c as L, o as ne, s as re } from "./runtime-dom.esm-bundler-BURR-bj5.js";
3
- import { $ as ie, A as ae, At as oe, B as se, Ct as ce, D as le, Dt as ue, E as de, Et as fe, F as pe, G as me, K as he, L as ge, M as _e, N as ve, O as ye, Ot as be, P as xe, Q as Se, R as Ce, S as we, St as Te, T as Ee, Tt as De, V as Oe, W as ke, Z as Ae, _t as je, at as Me, bt as Ne, c as Pe, ct as Fe, d as Ie, ft as Le, g as Re, gt as ze, h as Be, ht as Ve, j as He, kt as Ue, nt as We, o as Ge, ot as Ke, p as qe, q as Je, s as Ye, st as Xe, tt as Ze, u as Qe, vt as $e, w as et, wt as tt, xt as nt, yt as rt, z as it } from "./dist-CKi_npZM.js";
4
- import { B as at, D as ot, E as st, L as ct, M as lt, N as ut, O as dt, R as ft, S as pt, V as mt, _ as ht, a as gt, b as _t, d as vt, g as yt, l as bt, m as xt, n as St, t as Ct, v as wt, w as Tt, x as Et, y as Dt } from "./socialIcons-D7MGsg0d.js";
5
- import { _ as Ot, h as kt, v as At, y as jt } from "./dist-CVy-7PHQ.js";
6
- import { a as Mt, c as Nt, i as Pt, l as Ft } from "./dist-ByCWA2Tv.js";
7
- import { $ as It, A as Lt, B as Rt, C as zt, D as Bt, E as Vt, F as Ht, H as Ut, I as Wt, J as Gt, K as Kt, L as qt, M as Jt, N as Yt, O as Xt, P as Zt, Q as Qt, R as $t, S as en, T as tn, V as nn, W as rn, X as an, Y as on, Z as sn, _ as cn, a as ln, b as un, c as dn, d as fn, f as pn, g as mn, h as hn, j as gn, k as _n, l as vn, m as yn, n as bn, o as xn, p as Sn, q as Cn, r as wn, s as Tn, v as En, w as Dn, x as On, y as kn, z as An } from "./keys-BgRERHzu.js";
8
- import { t as R } from "./logger-BOu7oEtk.js";
9
- import { t as jn } from "./useI18n-BBrHTdu8.js";
10
- import { i as Mn, r as Nn, s as Pn, t as Fn } from "./usePopoverPosition-DV1PxL66.js";
11
- import { r as In, t as Ln } from "./templateSettingsFields-cjlP-jdw.js";
12
- import { n as Rn, t as zn } from "./sanitizeHtml-BzfzpYJY.js";
13
- import { t as Bn } from "./createLucideIcon-CvhTA2KG.js";
14
- import { n as Vn } from "./upload-DuFEOi_0.js";
15
- import { t as Hn } from "./image-BDiRFzSd.js";
16
- import { t as Un } from "./message-circle-DuEw4Zfx.js";
17
- import { t as Wn } from "./trash-DxCd7zIy.js";
18
- import { t as Gn } from "./triangle-alert-7_oaitpf.js";
19
- import { t as Kn } from "./LoadingTrack-DM4g6j7b.js";
20
- import { t as qn } from "./_plugin-vue_export-helper-Djzt4Yr7.js";
21
- import { t as Jn } from "./useEditorRoot-BMcoCLBx.js";
22
- import "./useCloudI18n-DEMmUKuO.js";
23
- import { t as Yn } from "./useMergeTag-BQ4qqWpQ.js";
24
- import { t as Xn } from "./useLogicTag-ZPC39rfH.js";
25
- import { t as Zn } from "./readableTextColor-BfZUGnVj.js";
26
- // src/utils/activeEditorTracker.ts
27
- var Qn = /* @__PURE__ */ new Set(), $n = 0, er = 0;
28
- function tr() {
29
- let e = ++er;
30
- return Qn.add(e), $n === 0 && ($n = e), {
31
- id: e,
32
- isActive: () => Qn.size <= 1 || $n === e,
33
- claim: () => {
34
- $n = e;
35
- },
36
- dispose: () => {
37
- if (Qn.delete(e), $n === e) {
38
- let e = Array.from(Qn);
39
- $n = e[e.length - 1] ?? 0;
40
- }
41
- }
42
- };
43
- }
44
- // src/composables/usePreviewResolution.ts
45
- var nr = 500;
46
- function rr(t) {
47
- let n = typeof t.resolvePreview == "function", r = e(null), i = e(!1), a = e(!1), o = 0, s = null;
48
- function c() {
49
- s !== null && (clearTimeout(s), s = null);
50
- }
51
- async function l() {
52
- let e = t.resolvePreview;
53
- if (!e) return;
54
- let n = ++o;
55
- i.value = !0;
56
- let s = {
57
- content: Te(t.getContent()),
58
- ...t.getRecipient?.() === void 0 ? {} : { recipient: t.getRecipient() }
59
- };
60
- try {
61
- let t = await e(s);
62
- if (n !== o) return;
63
- if (!Fe(t)) {
64
- a.value = !0;
65
- return;
66
- }
67
- r.value = t, a.value = !1;
68
- } catch {
69
- if (n !== o) return;
70
- a.value = !0;
71
- } finally {
72
- n === o && (i.value = !1);
73
- }
74
- }
75
- function u() {
76
- n && (c(), r.value === null ? l() : s = setTimeout(() => {
77
- s = null, l();
78
- }, nr));
79
- }
80
- return I(() => [t.isActive(), t.getRecipient?.()], ([e]) => {
81
- e ? u() : (c(), o++, i.value = !1, r.value = null, a.value = !1);
82
- }, { immediate: !0 }), g(() => {
83
- c(), o++;
84
- }), {
85
- isConfigured: n,
86
- content: x(() => r.value ?? t.getContent()),
87
- isResolving: i,
88
- isInitialResolve: x(() => i.value && r.value === null),
89
- hasFailed: a,
90
- supersedesSamples: x(() => n)
91
- };
92
- }
93
- // src/composables/useMergeTagPicker.ts
94
- function ir() {
95
- let t = e(!1), n = e([]), r = e(null), i = null;
96
- function a(e, a) {
97
- if (i) {
98
- let e = i;
99
- i = null, e(null);
100
- }
101
- return n.value = e, r.value = a?.current ?? null, t.value = !0, new Promise((e) => {
102
- i = e;
103
- });
104
- }
105
- function o(e) {
106
- let a = i;
107
- i = null, t.value = !1, n.value = [], r.value = null, a && a(e);
108
- }
109
- return s() && g(() => {
110
- if (i) {
111
- let e = i;
112
- i = null, e(null);
113
- }
114
- t.value = !1, n.value = [], r.value = null;
115
- }), {
116
- isOpen: t,
117
- tags: n,
118
- current: r,
119
- open: a,
120
- resolve: o
121
- };
122
- }
123
- // src/composables/useLogicTagPicker.ts
124
- function ar() {
125
- let t = e(!1), n = e([]), r = e([]), i = null;
126
- function a(e, a) {
127
- if (i) {
128
- let e = i;
129
- i = null, e(null);
130
- }
131
- return n.value = e, r.value = a, t.value = !0, new Promise((e) => {
132
- i = e;
133
- });
134
- }
135
- function o(e) {
136
- let a = i;
137
- i = null, t.value = !1, n.value = [], r.value = [], a && a(e);
138
- }
139
- return s() && g(() => {
140
- if (i) {
141
- let e = i;
142
- i = null, e(null);
143
- }
144
- t.value = !1, n.value = [], r.value = [];
145
- }), {
146
- isOpen: t,
147
- tags: n,
148
- pairs: r,
149
- open: a,
150
- resolve: o
151
- };
152
- }
153
- // src/composables/useTemplateLint.ts
154
- function or(e) {
155
- return e ? e.disabled === !0 || e.accessibility === !1 && e.structure === !1 && e.links === !1 && e.deliverability === !1 && e.compatibility === !1 : !1;
156
- }
157
- var sr = !1;
158
- function cr(t) {
159
- let n = e([]), r = e(0), i = e(-1), a = I(t.content, () => {
160
- r.value++;
161
- }, {
162
- deep: !0,
163
- flush: "sync"
164
- }), o = e(!1), s = e(!1), c = ee(null), l = or(t.options), u = null, d = !1;
165
- l || f();
166
- async function f() {
167
- try {
168
- let e = await import("@templatical/quality");
169
- if (d) return;
170
- c.value = { lintTemplate: e.lintTemplate }, o.value = !0, p(), u = jt(t.content, p, {
171
- debounce: t.debounce ?? 500,
172
- deep: !0
173
- });
174
- } catch {
175
- if (d) return;
176
- s.value = !0, sr || (sr = !0, R.info("@templatical/quality isn't installed, so the Issues panel and its lint badges are off. Add @templatical/quality to your dependencies to turn them on."));
177
- }
178
- }
179
- function p() {
180
- if (!c.value) return;
181
- let e = c.value.lintTemplate(t.content.value, t.options);
182
- i.value = r.value, n.value = e;
183
- }
184
- let m = I(() => t.options, () => {
185
- c.value && p();
186
- }, { deep: !0 });
187
- function h(e) {
188
- e.fix && e.fix.apply({
189
- updateBlock: t.updateBlock,
190
- updateSettings: t.updateSettings,
191
- removeBlock: t.removeBlock
192
- });
193
- }
194
- function g() {
195
- d = !0, u?.(), a(), m();
196
- }
197
- return {
198
- issues: n,
199
- contentVersion: r,
200
- lintVersion: i,
201
- ready: o,
202
- unavailable: s,
203
- applyFix: h,
204
- destroy: g
205
- };
206
- }
207
- // src/composables/useKeyboardReorder.ts
208
- function lr(t, n, r = []) {
209
- let i = e(null), a = e(""), o = null;
210
- function s(e) {
211
- let n = t.content.value.blocks, r = n.findIndex((t) => t.id === e);
212
- if (r !== -1) return {
213
- index: r,
214
- total: n.length
215
- };
216
- for (let t of n) {
217
- if (t.type !== "section") continue;
218
- let n = t;
219
- for (let t = 0; t < n.children.length; t++) {
220
- let r = n.children[t], i = r.findIndex((t) => t.id === e);
221
- if (i !== -1) return {
222
- index: i,
223
- total: r.length,
224
- sectionId: n.id,
225
- columnIndex: t
226
- };
227
- }
228
- }
229
- return null;
230
- }
231
- function c(e) {
232
- let i = s(e);
233
- if (!i) return "";
234
- let a = (i.sectionId ? l(i.sectionId, i.columnIndex ?? 0) : t.content.value.blocks)?.[i.index];
235
- return a ? pt(a, n.t, r) : "";
236
- }
237
- function l(e, n) {
238
- return t.content.value.blocks.find((t) => t.id === e && t.type === "section")?.children[n] ?? null;
239
- }
240
- function u(e) {
241
- a.value = "", queueMicrotask(() => {
242
- a.value = e;
243
- });
244
- }
245
- function d(e) {
246
- return i.value === e;
247
- }
248
- function f(e) {
249
- let t = s(e);
250
- t && (i.value = e, o = t, u(n.format(n.t.blockActions.lifted, {
251
- block: c(e),
252
- position: String(t.index + 1),
253
- total: String(t.total)
254
- })));
255
- }
256
- function p(e, r) {
257
- let i = s(e);
258
- if (!i) return;
259
- let a = i.index + r;
260
- a < 0 || a >= i.total || (t.moveBlock(e, a, i.sectionId, i.columnIndex), u(n.format(n.t.blockActions.moved, {
261
- block: c(e),
262
- position: String(a + 1),
263
- total: String(i.total)
264
- })));
265
- }
266
- function m(e) {
267
- p(e, -1);
268
- }
269
- function h(e) {
270
- p(e, 1);
271
- }
272
- function g(e) {
273
- let t = s(e);
274
- t && u(n.format(n.t.blockActions.dropped, {
275
- block: c(e),
276
- position: String(t.index + 1),
277
- total: String(t.total)
278
- })), i.value = null, o = null;
279
- }
280
- function _() {
281
- let e = i.value;
282
- if (e && o) {
283
- let r = s(e), i = !!r && (r.sectionId !== o.sectionId || r.columnIndex !== o.columnIndex), a = !!r && r.index !== o.index;
284
- r && (i || a) && t.moveBlock(e, o.index, o.sectionId, o.columnIndex), u(n.format(n.t.blockActions.cancelled, {
285
- block: c(e),
286
- position: String(o.index + 1)
287
- }));
288
- }
289
- i.value = null, o = null;
290
- }
291
- return {
292
- liftedBlockId: i,
293
- announcement: a,
294
- isLifted: d,
295
- lift: f,
296
- cancel: _,
297
- moveUp: m,
298
- moveDown: h,
299
- drop: g
300
- };
301
- }
302
- // src/composables/useUiTheme.ts
303
- function ur(e) {
304
- let t = Nt("(prefers-color-scheme: dark)");
305
- return { resolvedTheme: x(() => e.value === "auto" ? t.value ? "dark" : "light" : e.value) };
306
- }
307
- // src/composables/useThemeStyles.ts
308
- var dr = {
309
- bg: "--tpl-bg",
310
- bgElevated: "--tpl-bg-elevated",
311
- bgHover: "--tpl-bg-hover",
312
- bgActive: "--tpl-bg-active",
313
- border: "--tpl-border",
314
- borderLight: "--tpl-border-light",
315
- text: "--tpl-text",
316
- textMuted: "--tpl-text-muted",
317
- textDim: "--tpl-text-dim",
318
- primary: "--tpl-primary",
319
- primaryHover: "--tpl-primary-hover",
320
- primaryLight: "--tpl-primary-light",
321
- secondary: "--tpl-secondary",
322
- secondaryHover: "--tpl-secondary-hover",
323
- secondaryLight: "--tpl-secondary-light",
324
- success: "--tpl-success",
325
- successLight: "--tpl-success-light",
326
- warning: "--tpl-warning",
327
- warningLight: "--tpl-warning-light",
328
- danger: "--tpl-danger",
329
- dangerLight: "--tpl-danger-light",
330
- canvasBg: "--tpl-canvas-bg"
331
- };
332
- function fr({ themeOverrides: e, resolvedTheme: t, extraStyles: n }) {
333
- return { themeStyles: x(() => {
334
- let r = {}, i = e.value, a = t.value === "dark" ? i.dark : i;
335
- if (a) for (let [e, t] of Object.entries(dr)) {
336
- let n = a[e];
337
- n && (r[t] = n);
338
- }
339
- return n && Object.assign(r, n()), r;
340
- }) };
341
- }
342
- // src/composables/useBlockRegistry.ts
343
- function pr() {
344
- let e = ee(/* @__PURE__ */ new Map());
345
- function t(t, n) {
346
- e.value.set(t, n), A(e);
347
- }
348
- function n(t, n) {
349
- let r = `custom:${t.type}`, i = {
350
- component: n,
351
- createBlock: () => le(t),
352
- definition: t
353
- };
354
- e.value.set(r, i), A(e);
355
- }
356
- function r(t) {
357
- if (t.type === "custom") {
358
- let n = `custom:${t.customType}`;
359
- return e.value.get(n)?.component;
360
- }
361
- return e.value.get(t.type)?.component;
362
- }
363
- function i(t) {
364
- return e.value.get(t)?.createBlock();
365
- }
366
- function a(t) {
367
- let n = `custom:${t}`;
368
- return e.value.get(n)?.definition;
369
- }
370
- function o(e) {
371
- return `<div style="color: var(--tpl-text-muted); padding: 16px; text-align: center; border: 1px dashed var(--tpl-border); border-radius: var(--tpl-radius-sm); font-family: var(--tpl-font-family); font-size: 14px;">${e}</div>`;
372
- }
373
- async function s(e) {
374
- let t = a(e.customType);
375
- if (!t) return o("Block definition not found");
376
- try {
377
- return await ye(await import("./liquid.browser-DUXEekoN.js")).parseAndRender(t.template, e.fieldValues);
378
- } catch (t) {
379
- return R.error(`Failed to render custom block "${e.customType}":`, t), o(`Render error: ${e.customType}`);
380
- }
381
- }
382
- function c(t) {
383
- return e.value.has(t);
384
- }
385
- return {
386
- registerBuiltIn: t,
387
- registerCustom: n,
388
- getComponent: r,
389
- createBlock: i,
390
- getDefinition: a,
391
- renderCustomBlock: s,
392
- isRegistered: c
393
- };
394
- }
395
- // src/composables/useCustomBlockStylesheets.ts
396
- function mr(e, t) {
397
- return x(() => {
398
- let n = hr(e.value.blocks);
399
- if (n.size === 0) return [];
400
- let r = /* @__PURE__ */ new Set(), i = [];
401
- for (let e of n) {
402
- let n = t.getDefinition(e)?.stylesheet;
403
- if (!n) continue;
404
- let a = n.trim();
405
- a === "" || r.has(a) || (r.add(a), i.push(a));
406
- }
407
- return i;
408
- });
409
- }
410
- function hr(e) {
411
- let t = /* @__PURE__ */ new Set();
412
- return gr(e, t), t;
413
- }
414
- function gr(e, t) {
415
- for (let n of e) if (Me(n)) t.add(n.customType);
416
- else if (n.type === "section") {
417
- let e = n.children;
418
- if (!e) continue;
419
- for (let n of e) gr(n, t);
420
- } else Le(n) && gr(n.children, t);
421
- }
422
- // src/utils/registerBuiltInBlocks.ts
423
- var _r = [
424
- {
425
- type: "section",
426
- createBlock: pe
427
- },
428
- {
429
- type: "title",
430
- createBlock: se
431
- },
432
- {
433
- type: "paragraph",
434
- createBlock: xe
435
- },
436
- {
437
- type: "image",
438
- createBlock: _e
439
- },
440
- {
441
- type: "button",
442
- createBlock: Ee
443
- },
444
- {
445
- type: "divider",
446
- createBlock: ae
447
- },
448
- {
449
- type: "video",
450
- createBlock: Oe
451
- },
452
- {
453
- type: "social",
454
- createBlock: ge
455
- },
456
- {
457
- type: "menu",
458
- createBlock: ve
459
- },
460
- {
461
- type: "table",
462
- createBlock: it
463
- },
464
- {
465
- type: "spacer",
466
- createBlock: Ce
467
- },
468
- {
469
- type: "html",
470
- createBlock: He
471
- },
472
- {
473
- type: "countdown",
474
- createBlock: de
475
- }
476
- ];
477
- function vr(e, t) {
478
- for (let n of _r) {
479
- let r = t[n.type];
480
- r && e.registerBuiltIn(n.type, {
481
- component: r,
482
- createBlock: n.createBlock
483
- });
484
- }
485
- }
486
- // src/utils/resolveHtmlBlockPreview.ts
487
- function yr(e) {
488
- return typeof e == "boolean" ? e : e?.enabled ?? !1;
489
- }
490
- // src/utils/collectOffPaletteDefaults.ts
491
- function br(e) {
492
- return typeof e == "object" && !!e && !Array.isArray(e);
493
- }
494
- function xr(e, t, n) {
495
- let r = new Set(e.map((e) => Nn(e))), i = [], a = (e, t) => {
496
- for (let [n, o] of Object.entries(e)) typeof o == "string" ? o !== "" && /color$/i.test(n) && !r.has(Nn(o)) && i.push(`${t}.${n}: ${o}`) : br(o) && a(o, `${t}.${n}`);
497
- }, o = t;
498
- for (let [e, t] of Object.entries(Ge)) {
499
- let n = o?.[e];
500
- a({
501
- ...t,
502
- ...br(n) ? n : {}
503
- }, e);
504
- }
505
- return a({
506
- ...Ye,
507
- ...n ?? {}
508
- }, "template"), i;
509
- }
510
- // src/utils/localizedBlockDefaults.ts
511
- function Sr(e) {
512
- return {
513
- title: { content: `<p>${e.blockDefaults.title}</p>` },
514
- paragraph: { content: `<p>${e.blockDefaults.paragraph}</p>` },
515
- button: { text: e.blockDefaults.button }
516
- };
517
- }
518
- // src/i18n/index.ts
519
- var Cr = /* #__PURE__ */ Object.assign({
520
- "./locales/ca.ts": () => import("./ca-CD-Kt1qz.js"),
521
- "./locales/de.ts": () => import("./de-CeFJ6wbM.js"),
522
- "./locales/en.ts": () => import("./en-D14i5nFh.js"),
523
- "./locales/es.ts": () => import("./es-zDacbMhs.js"),
524
- "./locales/fr.ts": () => import("./fr-CSgYtjOd.js"),
525
- "./locales/ja.ts": () => import("./ja-B7H3ID8O.js"),
526
- "./locales/nl.ts": () => import("./nl-176ySmc5.js"),
527
- "./locales/pt-BR.ts": () => import("./pt-BR-dDlTwX18.js")
528
- }), wr = /* #__PURE__ */ Object.assign({
529
- "./locales/cloud/de.ts": () => import("./de-6M4JoHoD.js"),
530
- "./locales/cloud/en.ts": () => import("./en-FzUuJ8HW.js"),
531
- "./locales/cloud/pt-BR.ts": () => import("./pt-BR-Bp92Fc6J.js")
532
- });
533
- function Tr(e) {
534
- return Object.keys(e).map((e) => e.match(/\/([^/]+)\.ts$/)?.[1]).filter((e) => !!e);
535
- }
536
- var Er = Tr(Cr), Dr = Tr(wr);
537
- function Or(e) {
538
- return e.trim().replace(/_/g, "-").toLowerCase();
539
- }
540
- function kr(e, t) {
541
- let n = Or(e);
542
- return t.find((e) => Or(e) === n);
543
- }
544
- function Ar(e) {
545
- return Or(e).split("-")[0];
546
- }
547
- function jr(e, t) {
548
- return kr(e, t) ?? kr(Ar(e), t);
549
- }
550
- function Mr(e, t) {
551
- return jr(e, t) ?? "en";
552
- }
553
- async function Nr(e) {
554
- let t = Cr[`./locales/${Mr(e, Er)}.ts`];
555
- return (await t()).default;
556
- }
557
- async function Pr(e) {
558
- let t = wr[`./locales/cloud/${Mr(e, Dr)}.ts`];
559
- return (await t()).default;
560
- }
561
- function Fr(e) {
562
- return jr(e, Er) !== void 0;
563
- }
564
- function Ir(e) {
565
- return jr(e, Dr) !== void 0;
566
- }
567
- function Lr() {
568
- return [...Er];
569
- }
570
- function Rr() {
571
- return [...Dr];
572
- }
573
- // src/i18n/contentDefaults.ts
574
- var zr = {
575
- en: {
576
- video: "Video",
577
- days: "Days",
578
- hours: "Hours",
579
- minutes: "Minutes",
580
- seconds: "Seconds",
581
- expired: "This offer has expired"
582
- },
583
- de: {
584
- video: "Video",
585
- days: "Tage",
586
- hours: "Stunden",
587
- minutes: "Minuten",
588
- seconds: "Sekunden",
589
- expired: "Dieses Angebot ist abgelaufen"
590
- },
591
- es: {
592
- video: "Vídeo",
593
- days: "Días",
594
- hours: "Horas",
595
- minutes: "Minutos",
596
- seconds: "Segundos",
597
- expired: "Esta oferta ha expirado"
598
- },
599
- fr: {
600
- video: "Vidéo",
601
- days: "Jours",
602
- hours: "Heures",
603
- minutes: "Minutes",
604
- seconds: "Secondes",
605
- expired: "Cette offre a expiré"
606
- },
607
- nl: {
608
- video: "Video",
609
- days: "Dagen",
610
- hours: "Uren",
611
- minutes: "Minuten",
612
- seconds: "Seconden",
613
- expired: "Deze aanbieding is verlopen"
614
- },
615
- "pt-BR": {
616
- video: "Vídeo",
617
- days: "Dias",
618
- hours: "Horas",
619
- minutes: "Minutos",
620
- seconds: "Segundos",
621
- expired: "Esta oferta expirou"
622
- },
623
- ca: {
624
- video: "Vídeo",
625
- days: "Dies",
626
- hours: "Hores",
627
- minutes: "Minuts",
628
- seconds: "Segons",
629
- expired: "Aquesta oferta ha caducat"
630
- },
631
- ja: {
632
- video: "動画",
633
- days: "日",
634
- hours: "時間",
635
- minutes: "分",
636
- seconds: "秒",
637
- expired: "このオファーは終了しました"
638
- }
639
- };
640
- Object.keys(zr);
641
- var Br = new Map(Object.keys(zr).map((e) => [e.toLowerCase(), e]));
642
- function Vr(e) {
643
- if (!e) return zr.en;
644
- let t = e.trim().replace(/_/g, "-").toLowerCase(), n = Br.get(t);
645
- if (n) return zr[n];
646
- let r = Br.get(Ar(t));
647
- return r ? zr[r] : zr.en;
648
- }
649
- function Hr(e) {
650
- let t = Vr(e);
651
- return {
652
- video: { alt: t.video },
653
- countdown: {
654
- labelDays: t.days,
655
- labelHours: t.hours,
656
- labelMinutes: t.minutes,
657
- labelSeconds: t.seconds,
658
- expiredMessage: t.expired
659
- }
660
- };
661
- }
662
- // src/utils/collectColorFieldIssues.ts
663
- function Ur(e, t) {
664
- let n = [], r = (r, i) => {
665
- let a = Et(r, t), o = `custom block "${e.type}" field "${i}"`, s = (t) => `${e.type}:${i}:${t}`;
666
- if (a.invalidPresets.length > 0 && n.push({
667
- id: s("invalid-presets"),
668
- message: `${o}: presets skipped invalid entries: ${a.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).` + (a.presetsInherited ? " No valid entries are left, so the field inherits colors.presets." : "")
669
- }), a.emptyPresets && n.push({
670
- id: s("empty-presets"),
671
- message: `${o}: presets is empty — a field palette can only narrow the editor's, so an empty list is ignored and the field inherits colors.presets.`
672
- }), a.allowCustomIgnored && n.push({
673
- id: s("allow-custom-ignored"),
674
- message: `${o}: allowCustom: true is ignored because colors.allowCustom is false — a field can narrow the editor-wide palette, never unlock it.`
675
- }), !a.allowCustom && a.presets.length > 0) {
676
- let e = r.default ?? "", t = new Set(a.presets.map((e) => Nn(e)));
677
- e !== "" && !t.has(Nn(e)) && n.push({
678
- id: s("off-palette-default"),
679
- message: `${o} locks custom colours, but its default ${e} falls outside the field's presets: ${a.presets.join(", ")}. New blocks start on a colour the picker can't reselect — set the default from the same palette.`
680
- });
681
- }
682
- };
683
- for (let t of e.fields) if (t.type === "color") r(t, t.key);
684
- else if (t.type === "repeatable") for (let e of t.fields) e.type === "color" && r(e, `${t.key}[].${e.key}`);
685
- return n;
686
- }
687
- // src/utils/keyboardShortcuts.ts
688
- function Wr(e) {
689
- for (let t of e.composedPath()) {
690
- if (!(t instanceof HTMLElement)) continue;
691
- if (t.isContentEditable) return !0;
692
- let e = t.tagName;
693
- if (e === "INPUT" || e === "TEXTAREA" || e === "SELECT") return !0;
694
- }
695
- return !1;
696
- }
697
- function Gr(e, t) {
698
- let n = e.metaKey || e.ctrlKey;
699
- if (n && e.key.toLowerCase() === "s") e.preventDefault(), t.onSave?.();
700
- else if (n && e.key.toLowerCase() === "z") {
701
- if (Wr(e)) return;
702
- e.preventDefault(), e.shiftKey ? t.history.redo() : t.history.undo();
703
- } else {
704
- if (t.isPicking?.() && !Wr(e)) {
705
- if (e.key === "Escape") {
706
- e.preventDefault(), t.onCancelPick?.();
707
- return;
708
- }
709
- if (e.key === "Enter") {
710
- e.preventDefault(), t.onConfirmPick?.();
711
- return;
712
- }
713
- if (e.key === "Delete" || e.key === "Backspace") {
714
- e.preventDefault();
715
- return;
716
- }
717
- }
718
- e.key === "Escape" ? t.selectBlock(null) : (e.key === "Delete" || e.key === "Backspace") && t.getSelectedBlockId() && !Wr(e) && (e.preventDefault(), t.history.record(), t.removeBlock(t.getSelectedBlockId()));
719
- }
720
- }
721
- // src/utils/blockComponentResolver.ts
722
- function Kr(e, t) {
723
- let n = { fontFamily: t(e.fontFamily) };
724
- return e.textColor && (n.color = e.textColor), e.linkColor && (n["--tpl-doc-link-color"] = e.linkColor), e.linkUnderline && (n["--tpl-doc-link-underline"] = "underline"), n;
725
- }
726
- function qr(e, t, n) {
727
- if (t) {
728
- let n = t.getComponent(e);
729
- if (n) return n;
730
- }
731
- return n[e.type] ?? null;
732
- }
733
- var Jr = "--tpl-block-bg-layer", Yr = "tpl-has-bg-image";
734
- function Xr(e, t) {
735
- if (t === null) return {};
736
- let n = Ve(e);
737
- if (n === null) return {};
738
- let r = t?.trim(), i = r ? me(r) : n.url;
739
- return {
740
- backgroundImage: `url("${i}")`,
741
- backgroundSize: n.size,
742
- backgroundPosition: n.position,
743
- backgroundRepeat: n.repeat,
744
- [Jr]: `url("${i}") ${n.position} / ${n.size} ${n.repeat}`
745
- };
746
- }
747
- function Zr(e) {
748
- return e && Jr in e ? Yr : void 0;
749
- }
750
- var Qr = {
751
- top: "flex-start",
752
- middle: "center",
753
- bottom: "flex-end"
754
- };
755
- function $r(e, t) {
756
- let n = typeof e.height == "number" ? { minHeight: `${e.height}px` } : t !== void 0 && e.aspectRatio !== null ? { minHeight: `${ei(t, e.aspectRatio)}px` } : { aspectRatio: `1 / ${e.aspectRatio ?? 1}` };
757
- return {
758
- display: "flex",
759
- flexDirection: "column",
760
- justifyContent: Qr[e.verticalAlign],
761
- boxSizing: "border-box",
762
- ...n
763
- };
764
- }
765
- function ei(e, t) {
766
- return Math.max(1, Math.round(Math.max(1, Math.round(e)) * t));
767
- }
768
- function ti(e, t = {}) {
769
- if (e.type === "wrapper") return {};
770
- let { padding: n, backgroundColor: r } = e.styles, i = {
771
- padding: `${n.top}px ${n.right}px ${n.bottom}px ${n.left}px`,
772
- backgroundColor: r || "transparent"
773
- };
774
- if ((e.type === "paragraph" || e.type === "title") && (i["--tpl-doc-paragraph-spacing"] = `${e.type === "paragraph" ? e.paragraphSpacing ?? Qe.paragraphGap : Qe.paragraphGap}px`), e.type === "section") {
775
- let n = oe(e.borderRadius);
776
- n !== null && (i.borderRadius = n);
777
- let r = $e(e);
778
- r?.applied && e.backgroundImage ? (Object.assign(i, $r(r, t.heroBoxWidth)), Object.assign(i, Xr({
779
- ...e.backgroundImage,
780
- size: "cover",
781
- repeat: !1
782
- }, t.backgroundImageUrl))) : (Object.assign(i, ri(e.border)), Object.assign(i, Xr(e.backgroundImage, t.backgroundImageUrl)));
783
- }
784
- return i;
785
- }
786
- function ni(e, t, n, r) {
787
- return e.type === "section" ? ti(e, {
788
- backgroundImageUrl: st(t, e.backgroundImage, n),
789
- heroBoxWidth: r
790
- }) : ti(e);
791
- }
792
- function ri(e) {
793
- let t = {};
794
- for (let [n, r] of Object.entries(Ue(e))) t[n.replace(/-(\w)/g, (e, t) => t.toUpperCase())] = r;
795
- return t;
796
- }
797
- function ii(e, t = {}) {
798
- if (e.type !== "section" || !e.wrapper) return null;
799
- let n = e.wrapper, r = {};
800
- n.backgroundColor && (r.backgroundColor = n.backgroundColor), n.padding && (r.padding = `${n.padding.top}px ${n.padding.right}px ${n.padding.bottom}px ${n.padding.left}px`);
801
- let i = oe(n.borderRadius);
802
- return i !== null && (r.borderRadius = i), Object.assign(r, Xr(n.backgroundImage, t.backgroundImageUrl)), r;
803
- }
804
- function ai(e, t = {}) {
805
- if (e.type !== "wrapper") return null;
806
- let n = {};
807
- if (e.styles.backgroundColor && (n.backgroundColor = e.styles.backgroundColor), e.styles.padding) {
808
- let t = e.styles.padding;
809
- n.padding = `${t.top}px ${t.right}px ${t.bottom}px ${t.left}px`;
810
- }
811
- return e.borderRadius && e.borderRadius > 0 && (n.borderRadius = `${e.borderRadius}px`), Object.assign(n, Xr(e.backgroundImage, t.backgroundImageUrl)), n;
812
- }
813
- // src/utils/mergeTagLabelSegments.ts
814
- function oi(e, t, n, r = !1) {
815
- if (!e) return [];
816
- let i = RegExp(`(${n.value.source}|${n.logic.source})`, "g"), a = [], o = 0, s;
817
- for (; (s = i.exec(e)) !== null;) {
818
- s.index > o && a.push({
819
- type: "text",
820
- value: e.slice(o, s.index)
821
- });
822
- let i = s[0];
823
- if (Xe(i, n)) {
824
- let e = r ? ie(i, t) : void 0;
825
- a.push(e === void 0 ? {
826
- type: "tag",
827
- value: Se(i, t)
828
- } : {
829
- type: "text",
830
- value: e
831
- });
832
- } else Ke(i, n) ? a.push({
833
- type: "tag",
834
- value: Ae(i, n)
835
- }) : a.push({
836
- type: "text",
837
- value: i
838
- });
839
- o = s.index + i.length;
840
- }
841
- return o < e.length && a.push({
842
- type: "text",
843
- value: e.slice(o)
844
- }), a;
845
- }
846
- // src/components/MergeTagPreviewText.vue
847
- var si = F({
848
- name: "MergeTagPreviewText",
849
- props: { text: {
850
- type: String,
851
- required: !0
852
- } },
853
- setup(e) {
854
- let t = n(Xt, Ht), r = n(Zt, qe.liquid), i = n(Qt, null), a = x(() => oi(e.text, t.value, r, i?.value ?? !1));
855
- return () => a.value.map((e, t) => e.type === "tag" ? P("span", {
856
- key: t,
857
- class: "tpl-merge-tag-label"
858
- }, e.value) : e.value);
859
- }
860
- }), ci = ["href"], li = /* @__PURE__ */ F({
861
- __name: "ButtonBlock",
862
- props: {
863
- block: {},
864
- viewport: {}
865
- },
866
- setup(e) {
867
- let t = e, n = It(En, "ButtonBlock"), r = x(() => {
868
- let e = {
869
- display: "inline-block",
870
- padding: `${t.block.buttonPadding.top}px ${t.block.buttonPadding.right}px ${t.block.buttonPadding.bottom}px ${t.block.buttonPadding.left}px`,
871
- backgroundColor: t.block.backgroundColor,
872
- color: t.block.textColor,
873
- fontSize: `${t.block.fontSize}px`,
874
- fontWeight: "bold",
875
- textDecoration: "none",
876
- borderRadius: typeof t.block.borderRadius == "number" ? `${t.block.borderRadius}px` : oe(t.block.borderRadius) ?? "0px",
877
- textAlign: "center"
878
- };
879
- return Object.assign(e, ri(t.block.border)), t.block.fontFamily && (e.fontFamily = n.resolveFontFamily(t.block.fontFamily)), t.block.width === "full" ? (e.display = "block", e.width = "100%", e.boxSizing = "border-box") : typeof t.block.width == "number" && (e.width = `${t.block.width}px`, e.boxSizing = "border-box"), e;
880
- }), i = x(() => ({ textAlign: t.block.align ?? "center" }));
881
- return (t, n) => (E(), C("div", { style: l(i.value) }, [k("a", {
882
- href: e.block.url || "#",
883
- style: l(r.value),
884
- class: "tpl:cursor-default",
885
- onClick: n[0] ||= L(() => {}, ["prevent"])
886
- }, [v(si, { text: e.block.text }, null, 8, ["text"])], 12, ci)], 4));
887
- }
888
- }), ui = Bn({
889
- name: "bookmark",
890
- size: 24,
891
- node: [["path", {
892
- d: "M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",
893
- key: "oz39mx"
894
- }]]
895
- }), di = Bn({
896
- name: "box",
897
- size: 24,
898
- node: [
899
- ["path", {
900
- d: "M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",
901
- key: "hh9hay"
902
- }],
903
- ["path", {
904
- d: "m3.3 7 8.7 5 8.7-5",
905
- key: "g66t2b"
906
- }],
907
- ["path", {
908
- d: "M12 22V12",
909
- key: "d0xqtd"
910
- }]
911
- ]
912
- }), fi = Bn({
913
- name: "eye-off",
914
- size: 24,
915
- node: [
916
- ["path", {
917
- d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",
918
- key: "ct8e1f"
919
- }],
920
- ["path", {
921
- d: "M14.084 14.158a3 3 0 0 1-4.242-4.242",
922
- key: "151rxh"
923
- }],
924
- ["path", {
925
- d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",
926
- key: "13bj9a"
927
- }],
928
- ["path", {
929
- d: "m2 2 20 20",
930
- key: "1ooewy"
931
- }]
932
- ]
933
- }), pi = Bn({
934
- name: "funnel",
935
- size: 24,
936
- node: [["path", {
937
- d: "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",
938
- key: "sc7q7i"
939
- }]],
940
- aliases: ["filter"]
941
- }), mi = Bn({
942
- name: "grip-vertical",
943
- size: 24,
944
- node: [
945
- ["circle", {
946
- cx: "9",
947
- cy: "12",
948
- r: "1",
949
- key: "1vctgf"
950
- }],
951
- ["circle", {
952
- cx: "9",
953
- cy: "5",
954
- r: "1",
955
- key: "hp0tcf"
956
- }],
957
- ["circle", {
958
- cx: "9",
959
- cy: "19",
960
- r: "1",
961
- key: "fkjjf6"
962
- }],
963
- ["circle", {
964
- cx: "15",
965
- cy: "12",
966
- r: "1",
967
- key: "1tmaij"
968
- }],
969
- ["circle", {
970
- cx: "15",
971
- cy: "5",
972
- r: "1",
973
- key: "19l28e"
974
- }],
975
- ["circle", {
976
- cx: "15",
977
- cy: "19",
978
- r: "1",
979
- key: "f4zoj3"
980
- }]
981
- ]
982
- }), hi = Bn({
983
- name: "puzzle",
984
- size: 24,
985
- node: [["path", {
986
- d: "M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",
987
- key: "w46dr5"
988
- }]]
989
- }), gi = Bn({
990
- name: "video",
991
- size: 24,
992
- node: [["path", {
993
- d: "m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",
994
- key: "ftymec"
995
- }], ["rect", {
996
- x: "2",
997
- y: "6",
998
- width: "14",
999
- height: "12",
1000
- rx: "2",
1001
- key: "158x01"
1002
- }]]
1003
- }), _i = ["innerHTML"], vi = [
1004
- "src",
1005
- "width",
1006
- "height"
1007
- ], yi = /* @__PURE__ */ F({
1008
- __name: "CustomBlockIcon",
1009
- props: {
1010
- icon: {},
1011
- size: {}
1012
- },
1013
- setup(e) {
1014
- let t = e, n = x(() => t.size ?? 20), r = x(() => t.icon && (t.icon.trimStart().startsWith("<svg") || t.icon.trimStart().startsWith("<SVG"))), i = x(() => t.icon && !r.value && (t.icon.startsWith("http") || t.icon.startsWith("/"))), a = x(() => r.value ? Rn(t.icon ?? "") : "");
1015
- return (t, o) => r.value ? (E(), C("span", {
1016
- key: 0,
1017
- class: "tpl:inline-flex tpl:items-center tpl:justify-center",
1018
- style: l({
1019
- width: `${n.value}px`,
1020
- height: `${n.value}px`
1021
- }),
1022
- innerHTML: a.value
1023
- }, null, 12, _i)) : i.value ? (E(), C("img", {
1024
- key: 1,
1025
- src: e.icon,
1026
- width: n.value,
1027
- height: n.value,
1028
- class: "tpl:inline-block",
1029
- alt: ""
1030
- }, null, 8, vi)) : (E(), N(M(di), {
1031
- key: 2,
1032
- size: n.value,
1033
- "stroke-width": 1.5
1034
- }, null, 8, ["size"]));
1035
- }
1036
- }), bi = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
1037
- function xi(e, t) {
1038
- let n = Jn(), r = null, i = null, a = null;
1039
- function o() {
1040
- return e.value ? Array.from(e.value.querySelectorAll(bi)).filter((e) => e.offsetParent !== null) : [];
1041
- }
1042
- function s(e) {
1043
- if (e.key !== "Tab") return;
1044
- let t = o();
1045
- if (t.length === 0) return;
1046
- let r = t[0], i = t[t.length - 1];
1047
- e.shiftKey ? n.activeElement === r && (e.preventDefault(), i.focus()) : n.activeElement === i && (e.preventDefault(), r.focus());
1048
- }
1049
- function c() {
1050
- let t = i !== null || a !== null;
1051
- t && l({ restoreFocus: !1 }), t || (r = n.activeElement), a = requestAnimationFrame(() => {
1052
- a = null;
1053
- let t = o();
1054
- t.length > 0 && (e.value?.querySelector("[autofocus], input:not([disabled])") ?? t[0]).focus();
1055
- }), i = Mt(e, "keydown", s);
1056
- }
1057
- function l(e = {}) {
1058
- let t = e.restoreFocus !== !1;
1059
- a !== null && (typeof cancelAnimationFrame < "u" && cancelAnimationFrame(a), a = null), i?.(), i = null, t && r && r.focus && (r.focus(), r = null);
1060
- }
1061
- let u = I([t, e], ([e, t]) => {
1062
- e && t ? c() : l();
1063
- }, { flush: "post" });
1064
- g(() => {
1065
- u(), l();
1066
- });
1067
- }
1068
- // src/composables/useEmoji.ts
1069
- function Si() {
1070
- let [e, t] = At(!1), n = ee([]), r = !1;
1071
- g(() => {
1072
- r = !0;
1073
- }), I(e, async (e) => {
1074
- if (e && n.value.length === 0) {
1075
- let { emojiCategories: e } = await import("./emojiData-CBNuCfum.js");
1076
- if (r) return;
1077
- n.value = e;
1078
- }
1079
- });
1080
- function i() {
1081
- t();
1082
- }
1083
- function a() {
1084
- e.value = !1;
1085
- }
1086
- return {
1087
- categories: n,
1088
- isOpen: e,
1089
- toggle: i,
1090
- close: a
1091
- };
1092
- }
1093
- // src/composables/useFonts.ts
1094
- var Ci = [
1095
- {
1096
- value: "Arial",
1097
- label: "Arial"
1098
- },
1099
- {
1100
- value: "Helvetica",
1101
- label: "Helvetica"
1102
- },
1103
- {
1104
- value: "Georgia",
1105
- label: "Georgia"
1106
- },
1107
- {
1108
- value: "Times New Roman",
1109
- label: "Times New Roman"
1110
- },
1111
- {
1112
- value: "Verdana",
1113
- label: "Verdana"
1114
- },
1115
- {
1116
- value: "Trebuchet MS",
1117
- label: "Trebuchet MS"
1118
- },
1119
- {
1120
- value: "Courier New",
1121
- label: "Courier New"
1122
- }
1123
- ], wi = "Arial, sans-serif";
1124
- function Ti(e) {
1125
- if (e === void 0 || e === !0) return [...Ci];
1126
- if (e === !1) return [];
1127
- let t = [], n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set();
1128
- for (let i of e) {
1129
- let e = i.toLowerCase(), a = Ci.find((t) => t.value.toLowerCase() === e);
1130
- a ? n.has(a.value) || (n.add(a.value), t.push(a)) : r.has(e) || (r.add(e), R.warn(`config.fonts.builtIns: "${i}" is not a built-in font — skipping it. Built-in fonts are: ${Ci.map((e) => e.value).join(", ")}.`));
1131
- }
1132
- return t;
1133
- }
1134
- function Ei(t) {
1135
- let n = e(t?.customFonts ?? []), r = e(!1), i = Ti(t?.builtIns), a = x(() => t?.defaultFallback ?? wi), o = x(() => {
1136
- let e = [...i], t = n.value.map((e) => ({
1137
- value: e.name,
1138
- label: e.name,
1139
- isCustom: !0
1140
- })), r = [...e, ...t];
1141
- return r.sort((e, t) => e.label.localeCompare(t.label)), r;
1142
- });
1143
- function c(e) {
1144
- return o.value.some((t) => t.label.toLowerCase() === e.toLowerCase() || t.value.toLowerCase().startsWith(e.toLowerCase()));
1145
- }
1146
- let l = t?.defaultFont ?? wi.split(",")[0].trim();
1147
- c(l) || R.warn(`config.fonts: new templates seed "${l}", which the font picker doesn't offer — authors can't reselect it. Either add it to fonts.builtIns, or set fonts.defaultFont to an offered font.`);
1148
- function u() {
1149
- if (t?.defaultFont && c(t.defaultFont)) {
1150
- let e = o.value.find((e) => e.label.toLowerCase() === t.defaultFont.toLowerCase() || e.value.toLowerCase().startsWith(t.defaultFont.toLowerCase()));
1151
- if (e) return e.value;
1152
- }
1153
- return wi;
1154
- }
1155
- let d = x(() => u());
1156
- function f(e) {
1157
- return je(e, {
1158
- customFonts: n.value,
1159
- defaultFallback: a.value
1160
- });
1161
- }
1162
- let p = [], m = !1;
1163
- async function h() {
1164
- if (n.value.length === 0) {
1165
- m || (r.value = !0);
1166
- return;
1167
- }
1168
- let e = n.value.map(async (e) => {
1169
- try {
1170
- if (document.querySelector(`link[data-custom-font="${CSS.escape(e.name)}"]`)) return;
1171
- let t = document.createElement("link");
1172
- t.rel = "stylesheet", t.href = e.url, t.setAttribute("data-custom-font", e.name), p.push(t), await new Promise((n, r) => {
1173
- t.onload = () => n(), t.onerror = () => r(/* @__PURE__ */ Error(`Failed to load font: ${e.name}`)), document.head.appendChild(t);
1174
- });
1175
- } catch (t) {
1176
- R.warn(`Failed to load custom font "${e.name}":`, t);
1177
- }
1178
- });
1179
- await Promise.allSettled(e), !m && (r.value = !0);
1180
- }
1181
- function _() {
1182
- for (let e of p) e.remove();
1183
- p.length = 0;
1184
- }
1185
- return s() && g(() => {
1186
- m = !0, _();
1187
- }), {
1188
- fonts: o,
1189
- defaultFont: d,
1190
- defaultFallback: a,
1191
- customFonts: n,
1192
- isLoaded: r,
1193
- loadCustomFonts: h,
1194
- cleanupFontLinks: _,
1195
- resolveFontFamily: f,
1196
- getDefaultFont: u
1197
- };
1198
- }
1199
- // src/utils/mergeTagNodeSpec.ts
1200
- function Di(e, t, n) {
1201
- return Ke(e, n) ? {
1202
- type: "logicMergeTagNode",
1203
- attrs: {
1204
- value: e,
1205
- keyword: Ae(e, n)
1206
- }
1207
- } : {
1208
- type: "mergeTagNode",
1209
- attrs: {
1210
- label: t,
1211
- value: e
1212
- }
1213
- };
1214
- }
1215
- // src/utils/insertLogicTag.ts
1216
- function Oi(e) {
1217
- return "before" in e && "after" in e;
1218
- }
1219
- function ki(e, t, n) {
1220
- if (!Oi(t)) {
1221
- e.chain().focus().insertContent(Di(t.value, t.label, n)).run();
1222
- return;
1223
- }
1224
- let r = Di(t.before, t.label, n), i = Di(t.after, t.label, n), { from: a, to: o } = e.state.selection;
1225
- a === o ? e.chain().focus().insertContentAt(a, [r, i]).setTextSelection(a + 1).run() : e.chain().focus().insertContentAt(o, i).insertContentAt(a, r).run();
1226
- }
1227
- // src/utils/linkColorExtension.ts
1228
- function Ai(e) {
1229
- if (!e) return null;
1230
- let t = e.trim();
1231
- return /^#[0-9a-f]{3,8}$/i.test(t) || /^(rgb|rgba|hsl|hsla)\(\s*[0-9.,%/\s]+\)$/i.test(t) || /^[a-z]+$/i.test(t) ? t : null;
1232
- }
1233
- function ji(e) {
1234
- return e.extend({ addAttributes() {
1235
- return {
1236
- ...this.parent?.(),
1237
- color: {
1238
- default: null,
1239
- parseHTML: (e) => Ai(Mn(e.style.color)),
1240
- renderHTML: (e) => {
1241
- let t = Ai(e.color);
1242
- return t ? { style: `color: ${t}` } : {};
1243
- }
1244
- }
1245
- };
1246
- } });
1247
- }
1248
- // src/composables/useRichTextLinkDialog.ts
1249
- function Mi(t, n = qe.liquid) {
1250
- let r = e(!1), i = e(""), a = e(""), o = e(null);
1251
- xi(o, r);
1252
- function s() {
1253
- let e = t.value?.getAttributes("link") ?? {};
1254
- i.value = e.href || "", a.value = e.color || "", r.value = !0;
1255
- }
1256
- function c() {
1257
- if (i.value) {
1258
- let e = d(i.value);
1259
- if (e !== null) {
1260
- let n = Ai(a.value), r = t.value?.chain().focus().extendMarkRange("link").setLink({ href: e }).updateAttributes("link", { color: n });
1261
- n && typeof t.value?.commands.unsetColor == "function" && r?.unsetColor(), r?.run();
1262
- }
1263
- }
1264
- p();
1265
- }
1266
- let l = /^(?:\/|\.{1,2}\/|\?)/;
1267
- function u(e) {
1268
- return RegExp(`^(?:${n.value.source})`).test(e);
1269
- }
1270
- function d(e) {
1271
- let t = e.trim();
1272
- if (!t) return null;
1273
- if (t.startsWith("#")) return t;
1274
- if (t.startsWith("//")) return `https:${t}`;
1275
- if (l.test(t)) return t;
1276
- let n = he(t);
1277
- return n ? Ie.some((e) => e === n) ? t : null : u(t) ? t : `https://${t}`;
1278
- }
1279
- function f() {
1280
- t.value?.chain().focus().extendMarkRange("link").unsetLink().run(), p();
1281
- }
1282
- function p() {
1283
- r.value = !1, i.value = "", a.value = "";
1284
- }
1285
- function m(e) {
1286
- e.key === "Enter" ? (e.preventDefault(), c()) : e.key === "Escape" && p();
1287
- }
1288
- return {
1289
- showLinkDialog: r,
1290
- linkUrl: i,
1291
- linkColor: a,
1292
- linkDialogRef: o,
1293
- openLinkDialog: s,
1294
- insertLink: c,
1295
- removeLink: f,
1296
- closeLinkDialog: p,
1297
- handleLinkKeydown: m
1298
- };
1299
- }
1300
- // src/composables/useRichTextEditor.ts
1301
- function Ni(t) {
1302
- let r = n(mn, null), { mergeTags: i, canRequestMergeTag: a, isRequesting: s, requestMergeTag: c, syntax: l, autocomplete: u } = Yn(), { canInsertLogicTag: d, isRequesting: p, requestLogicTag: m } = Xn(), h = n(on, null), g = (o(h) ? h.value : h)?.mergeTag?.suggestionEmpty ?? "No matching merge tags", _ = Ze(l), v = ee(null), y = () => ze(r?.content?.value?.settings ?? { locale: "en" });
1303
- I(y, (e) => {
1304
- let t = v.value?.view.dom;
1305
- t && t.setAttribute("dir", e);
1306
- });
1307
- let { showLinkDialog: b, linkUrl: x, linkColor: S, linkDialogRef: C, openLinkDialog: w, insertLink: T, removeLink: E, closeLinkDialog: D, handleLinkKeydown: O } = Mi(v, l), { start: k, stop: A } = Ot(() => v.value?.commands.focus("end"), 0, { immediate: !1 }), j = ee(null), M = e(!0), N = e(null), te = !1, P = null;
1308
- async function F() {
1309
- N.value = null, M.value = !0;
1310
- try {
1311
- let { TiptapEditor: e, EC: n, extensions: a } = await t.loadExtensions({
1312
- mergeTags: i,
1313
- syntax: l,
1314
- triggerChar: _,
1315
- autocompleteEnabled: u,
1316
- suggestionEmptyText: g
1317
- });
1318
- if (te) return;
1319
- j.value = n;
1320
- let o = /* @__PURE__ */ new Map();
1321
- a.forEach((e, t) => o.set(e.name, t));
1322
- let s = new e({
1323
- extensions: a.filter((e, t) => o.get(e.name) === t),
1324
- content: t.blockContent(),
1325
- editable: !0,
1326
- editorProps: { attributes: { dir: y() } },
1327
- onUpdate: ({ editor: e }) => {
1328
- te || r && (P = e.getHTML(), r.updateBlock(t.blockId(), { content: P }));
1329
- }
1330
- });
1331
- if (te) {
1332
- s.destroy();
1333
- return;
1334
- }
1335
- v.value = s, M.value = !1, k();
1336
- } catch (e) {
1337
- if (te) return;
1338
- R.error(`[${t.editorName ?? "RichTextEditor"}] Failed to initialize TipTap editor:`, e), N.value = e instanceof Error ? e.message : "Failed to load editor", M.value = !1;
1339
- }
1340
- }
1341
- function L() {
1342
- v.value?.destroy(), v.value = null, F();
1343
- }
1344
- F();
1345
- let ne = I(() => t.blockContent(), (e) => {
1346
- v.value && e !== P && (P = e, v.value.getHTML() !== e && v.value.commands.setContent(e, { emitUpdate: !1 }));
1347
- });
1348
- function re(e) {
1349
- if (s.value || p.value) return;
1350
- let n = e.composedPath(), r = n.find((e) => e instanceof HTMLElement);
1351
- if (!r) return;
1352
- t.onClickOutsideSideEffect?.(r);
1353
- let i = n.some((e) => e instanceof HTMLElement && e.classList.contains("tpl-color-popover"));
1354
- r.closest(".tpl-text-editor-wrapper") || r.closest(".tpl-text-toolbar") || r.closest(".tpl-link-dialog") || i || t.onDone();
1355
- }
1356
- Mt(document, "mousedown", re), f(() => {
1357
- te = !0, ne(), A(), v.value?.destroy();
1358
- });
1359
- async function ie() {
1360
- let e = await c();
1361
- te || (e && v.value ? v.value.chain().focus().insertMergeTag({
1362
- label: e.label,
1363
- value: e.value
1364
- }).run() : v.value?.commands.focus());
1365
- }
1366
- async function ae() {
1367
- let e = await m();
1368
- te || (e && v.value ? ki(v.value, e, l) : v.value?.commands.focus());
1369
- }
1370
- return {
1371
- editor: v,
1372
- EditorContent: j,
1373
- isLoading: M,
1374
- initError: N,
1375
- retry: L,
1376
- showLinkDialog: b,
1377
- linkUrl: x,
1378
- linkColor: S,
1379
- linkDialogRef: C,
1380
- mergeTags: i,
1381
- canRequestMergeTag: a,
1382
- isRequestingMergeTag: s,
1383
- syntax: l,
1384
- canInsertLogicTag: d,
1385
- isRequestingLogicTag: p,
1386
- openLinkDialog: w,
1387
- insertLink: T,
1388
- removeLink: E,
1389
- closeLinkDialog: D,
1390
- handleLinkKeydown: O,
1391
- handleAddMergeTag: ie,
1392
- handleAddLogicTag: ae
1393
- };
1394
- }
1395
- // src/composables/useSmallScreenNotice.ts
1396
- var Pi = "(max-width: 767px)";
1397
- function Fi(e) {
1398
- let t = Nt(Pi);
1399
- return {
1400
- isSmallScreen: t,
1401
- showNotice: x(() => (y(e) ?? !0) && t.value)
1402
- };
1403
- }
1404
- // src/components/blocks/CustomBlock.vue?vue&type=script&setup=true&lang.ts
1405
- var Ii = { class: "tpl:w-full" }, Li = {
1406
- key: 0,
1407
- class: "tpl:flex tpl:box-border tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-warning)] tpl:bg-[var(--tpl-warning-light)]"
1408
- }, Ri = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, zi = {
1409
- key: 1,
1410
- class: "tpl:flex tpl:box-border tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-danger)] tpl:bg-[var(--tpl-danger-light)]"
1411
- }, Bi = { class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]" }, Vi = {
1412
- key: 2,
1413
- class: "tpl:relative"
1414
- }, Hi = ["innerHTML"], Ui = {
1415
- key: 0,
1416
- class: "tpl:absolute tpl:inset-0 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-3 tpl:rounded tpl:backdrop-blur-[2px]",
1417
- style: { "background-color": "color-mix(in srgb, var(--tpl-bg) 80%, transparent)" }
1418
- }, Wi = /* @__PURE__ */ F({
1419
- __name: "CustomBlock",
1420
- props: {
1421
- block: {},
1422
- viewport: {}
1423
- },
1424
- emits: ["fetchData"],
1425
- setup(t, { emit: r }) {
1426
- let i = t, a = r, { t: o } = jn(), s = n(Tn, null), c = e(""), l = x(() => zn(c.value)), u = e(!1), f = x(() => s?.getDefinition(i.block.customType)), p = x(() => !!f.value), m = x(() => i.block), { isFetching: h, fetch: g, needsFetch: _, hasDataSource: y } = ft({
1427
- definition: f,
1428
- block: m,
1429
- onUpdate: (e, t) => {
1430
- a("fetchData", {
1431
- fieldValues: e,
1432
- dataSourceFetched: t
1433
- });
1434
- }
1435
- }), b = n(Xt, Ht), T = n(Qt, null), D = x(() => {
1436
- if (!T?.value) return i.block;
1437
- let e = {};
1438
- for (let [t, n] of Object.entries(i.block.fieldValues)) e[t] = typeof n == "string" ? ue(n, b.value) : n;
1439
- return {
1440
- ...i.block,
1441
- fieldValues: e
1442
- };
1443
- });
1444
- async function A() {
1445
- if (s) {
1446
- u.value = !1;
1447
- try {
1448
- let e = await s.renderCustomBlock(D.value);
1449
- e.includes("Template render error:") && (u.value = !0), c.value = e;
1450
- } catch {
1451
- u.value = !0, c.value = "";
1452
- }
1453
- }
1454
- }
1455
- let j = kt(A, 150);
1456
- return O(() => {
1457
- A();
1458
- }), I(() => i.block.fieldValues, () => {
1459
- j();
1460
- }, { deep: !0 }), I(() => T?.value, () => {
1461
- j();
1462
- }), (e, t) => (E(), C("div", Ii, [p.value ? u.value ? (E(), C("div", zi, [v(M(Gn), {
1463
- size: 24,
1464
- class: "tpl:text-[var(--tpl-danger)]"
1465
- }), k("span", Bi, d(M(o).customBlocks.renderError), 1)])) : (E(), C("div", Vi, [k("div", { innerHTML: l.value }, null, 8, Hi), M(y) && M(_) ? (E(), C("div", Ui, [M(h) ? (E(), N(Kn, {
1466
- key: 1,
1467
- class: "tpl:w-48"
1468
- })) : (E(), C("button", {
1469
- key: 0,
1470
- type: "button",
1471
- class: "tpl:flex tpl:cursor-pointer tpl:items-center tpl:gap-2 tpl:rounded-[var(--tpl-radius-sm)] tpl:border tpl:border-[var(--tpl-border)] tpl:px-4 tpl:py-2 tpl:text-sm tpl:font-semibold tpl:shadow-[var(--tpl-shadow)] tpl:transition-all tpl:hover:border-[var(--tpl-primary)] tpl:hover:shadow-[var(--tpl-shadow-md)] tpl:bg-[var(--tpl-primary-light)] tpl:text-[var(--tpl-primary-hover)]",
1472
- onClick: t[0] ||= L((...e) => M(g) && M(g)(...e), ["stop"])
1473
- }, [f.value?.icon ? (E(), N(yi, {
1474
- key: 0,
1475
- icon: f.value.icon,
1476
- size: 16
1477
- }, null, 8, ["icon"])) : S("", !0), w(" " + d(f.value?.dataSource?.label || M(o).customBlocks.dataSource.fetchButton), 1)]))])) : S("", !0)])) : (E(), C("div", Li, [v(M(hi), {
1478
- size: 24,
1479
- class: "tpl:text-[var(--tpl-warning)]"
1480
- }), k("span", Ri, d(M(o).customBlocks.definitionNotFound), 1)]))]));
1481
- }
1482
- }), Gi = { class: "tpl:w-full" }, Ki = /* @__PURE__ */ F({
1483
- __name: "DividerBlock",
1484
- props: {
1485
- block: {},
1486
- viewport: {}
1487
- },
1488
- setup(e) {
1489
- let t = e, n = x(() => ({
1490
- borderTop: `${t.block.thickness}px ${t.block.lineStyle} ${t.block.color}`,
1491
- width: t.block.width === "full" ? "100%" : typeof t.block.width == "number" ? `${t.block.width}px` : t.block.width,
1492
- margin: t.block.width === "full" ? "0" : "0 auto"
1493
- }));
1494
- return (e, t) => (E(), C("div", Gi, [k("hr", {
1495
- class: "tpl:m-0 tpl:border-none",
1496
- style: l(n.value)
1497
- }, null, 4)]));
1498
- }
1499
- }), qi = { class: "tpl:w-full" }, Ji = ["srcdoc", "title"], Yi = {
1500
- key: 1,
1501
- class: "tpl:flex tpl:box-border tpl:min-h-[80px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:border-[var(--tpl-border)] tpl:bg-[var(--tpl-bg-hover)]"
1502
- }, Xi = {
1503
- key: 0,
1504
- class: "tpl:text-sm tpl:text-[var(--tpl-text-muted)]"
1505
- }, Zi = {
1506
- key: 1,
1507
- class: "tpl:text-sm tpl:text-[var(--tpl-text-dim)]"
1508
- }, Qi = /* @__PURE__ */ F({
1509
- __name: "HtmlBlock",
1510
- props: {
1511
- block: {},
1512
- viewport: {}
1513
- },
1514
- setup(t) {
1515
- let r = t, { t: i } = jn(), a = n(un, !1), o = x(() => r.block.content.trim().length > 0), s = x(() => a && o.value), c = n(Xt, Ht), u = n(Qt, null), p = x(() => u?.value ? ue(r.block.content, c.value) : r.block.content), m = e(null), h = e(60), g = null;
1516
- function _() {
1517
- let e = m.value?.contentDocument;
1518
- e && (h.value = Math.max(e.body?.scrollHeight ?? 0, e.documentElement?.scrollHeight ?? 0));
1519
- }
1520
- function y() {
1521
- g?.disconnect(), g = null, _();
1522
- let e = m.value?.contentDocument?.documentElement;
1523
- e && typeof ResizeObserver < "u" && (g = new ResizeObserver(() => _()), g.observe(e));
1524
- }
1525
- return I(s, (e) => {
1526
- e || (g?.disconnect(), g = null);
1527
- }), f(() => {
1528
- g?.disconnect(), g = null;
1529
- }), (e, t) => (E(), C("div", qi, [s.value ? (E(), C("iframe", {
1530
- key: 0,
1531
- ref_key: "iframeRef",
1532
- ref: m,
1533
- srcdoc: p.value,
1534
- sandbox: "allow-same-origin",
1535
- title: M(i).html.preview,
1536
- class: "tpl:block tpl:w-full tpl:border-0",
1537
- style: l({ height: `${h.value}px` }),
1538
- onLoad: y
1539
- }, null, 44, Ji)) : (E(), C("div", Yi, [v(M(_t), {
1540
- size: 24,
1541
- class: "tpl:text-[var(--tpl-text-dim)]"
1542
- }), o.value ? (E(), C("span", Xi, d(M(i).html.preview), 1)) : (E(), C("span", Zi, d(M(i).html.empty), 1))]))]));
1543
- }
1544
- }), $i = ["data-drop-enabled"], ea = ["href"], ta = ["src", "alt"], na = ["src", "alt"], ra = {
1545
- class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
1546
- style: { opacity: "0.7" }
1547
- }, ia = ["href"], aa = ["src", "alt"], oa = ["src", "alt"], sa = {
1548
- key: 4,
1549
- class: "tpl:flex tpl:box-border tpl:min-h-[100px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm tpl:border-[var(--tpl-border-light)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-dim)]"
1550
- }, ca = ["aria-label"], la = { key: 1 }, ua = /* @__PURE__ */ F({
1551
- __name: "ImageBlock",
1552
- props: {
1553
- block: {},
1554
- viewport: {}
1555
- },
1556
- emits: ["update"],
1557
- setup(t, { emit: n }) {
1558
- let r = t, i = n, { t: a } = jn(), { syntax: o } = Yn(), s = x(() => we(r.block.src, o));
1559
- function c(e) {
1560
- let t = {
1561
- src: e.url,
1562
- ...xt(yt(e.width, e.height))
1563
- };
1564
- e.alt && (t.alt = e.alt), i("update", t);
1565
- }
1566
- let u = e(), { canBrowse: f, dropEnabled: p, isUploading: m, showOverlay: h, openMediaBrowser: g } = bt({
1567
- target: u,
1568
- blocked: s,
1569
- apply: c
1570
- }), _ = x(() => ({ textAlign: r.block.align })), y = x(() => {
1571
- let e = r.block.border, t = ["left", "right"].map((t) => be(e?.[t]) === null ? 0 : e[t].width).reduce((e, t) => e + t, 0);
1572
- return t > 0 ? `calc(100% - ${t}px)` : "100%";
1573
- }), b = x(() => {
1574
- let e = r.block.align;
1575
- return {
1576
- maxWidth: "100%",
1577
- width: r.block.width === "full" ? y.value : `${r.block.width}px`,
1578
- height: r.block.height ? `${r.block.height}px` : void 0,
1579
- borderRadius: oe(r.block.borderRadius) ?? void 0,
1580
- ...ri(r.block.border),
1581
- display: "block",
1582
- marginLeft: e === "center" || e === "right" ? "auto" : void 0,
1583
- marginRight: e === "center" ? "auto" : void 0
1584
- };
1585
- }), T = dt(() => s.value ? void 0 : r.block.src), D = dt(() => s.value ? r.block.placeholderUrl : void 0);
1586
- return (e, n) => (E(), C("div", {
1587
- ref_key: "dropZoneRef",
1588
- ref: u,
1589
- "data-testid": "image-drop-zone",
1590
- "data-drop-enabled": M(p),
1591
- class: "tpl:relative tpl:w-full",
1592
- style: l(_.value)
1593
- }, [M(h) ? (E(), N(vt, {
1594
- key: 0,
1595
- uploading: M(m),
1596
- size: "canvas"
1597
- }, null, 8, ["uploading"])) : S("", !0), t.block.src && s.value && t.block.placeholderUrl ? (E(), C(j, { key: 1 }, [t.block.linkUrl ? (E(), C("a", {
1598
- key: 0,
1599
- href: t.block.linkUrl,
1600
- target: "_blank",
1601
- rel: "noopener noreferrer",
1602
- onClick: n[0] ||= L(() => {}, ["prevent"])
1603
- }, [k("img", {
1604
- class: "tpl:border-0",
1605
- loading: "lazy",
1606
- src: M(D),
1607
- alt: t.block.alt || M(a).image.altTextPlaceholder,
1608
- style: l(b.value)
1609
- }, null, 12, ta)], 8, ea)) : (E(), C("img", {
1610
- key: 1,
1611
- class: "tpl:border-0",
1612
- src: M(D),
1613
- alt: t.block.alt,
1614
- style: l(b.value)
1615
- }, null, 12, na))], 64)) : t.block.src && s.value ? (E(), C("div", {
1616
- key: 2,
1617
- class: "tpl:!flex tpl:box-border tpl:min-h-[120px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center tpl:bg-[var(--tpl-bg-elevated)]",
1618
- style: l([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, b.value])
1619
- }, [v(M(Hn), {
1620
- size: 32,
1621
- "stroke-width": 1.5,
1622
- class: "tpl:text-[var(--tpl-primary)]",
1623
- style: { opacity: "0.5" }
1624
- }), k("span", ra, [v(si, { text: t.block.src }, null, 8, ["text"])])], 4)) : t.block.src ? (E(), C(j, { key: 3 }, [t.block.linkUrl ? (E(), C("a", {
1625
- key: 0,
1626
- href: t.block.linkUrl,
1627
- target: "_blank",
1628
- rel: "noopener noreferrer",
1629
- onClick: n[1] ||= L(() => {}, ["prevent"])
1630
- }, [k("img", {
1631
- class: "tpl:border-0",
1632
- loading: "lazy",
1633
- src: M(T),
1634
- alt: t.block.alt || M(a).image.altTextPlaceholder,
1635
- style: l(b.value)
1636
- }, null, 12, aa)], 8, ia)) : (E(), C("img", {
1637
- key: 1,
1638
- class: "tpl:border-0",
1639
- src: M(T),
1640
- alt: t.block.alt,
1641
- style: l(b.value)
1642
- }, null, 12, oa))], 64)) : (E(), C("div", sa, [M(f) ? (E(), C("button", {
1643
- key: 0,
1644
- "aria-label": M(a).image.browseMedia,
1645
- class: "tpl:flex tpl:items-center tpl:gap-1.5 tpl:rounded-md tpl:border tpl:px-3 tpl:py-2 tpl:text-xs tpl:font-medium tpl:transition-all tpl:cursor-pointer tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-primary)] tpl:bg-[var(--tpl-bg)]",
1646
- onClick: n[2] ||= L((...e) => M(g) && M(g)(...e), ["stop"])
1647
- }, [v(M(Hn), {
1648
- size: 14,
1649
- "stroke-width": 1.5
1650
- }), w(" " + d(M(a).image.browseMedia), 1)], 8, ca)) : (E(), C("span", la, d(M(a).image.clickToAdd), 1))]))], 12, $i));
1651
- }
1652
- }), da = { class: "tpl:w-full" }, fa = ["href"], pa = {
1653
- key: 1,
1654
- class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
1655
- }, ma = /* @__PURE__ */ F({
1656
- __name: "MenuBlock",
1657
- props: {
1658
- block: {},
1659
- viewport: {}
1660
- },
1661
- setup(e) {
1662
- let t = e, { t: n } = jn(), r = It(En, "MenuBlock"), i = x(() => ({
1663
- display: "flex",
1664
- flexWrap: "wrap",
1665
- gap: `0 ${t.block.spacing}px`,
1666
- justifyContent: t.block.textAlign === "left" ? "flex-start" : t.block.textAlign === "right" ? "flex-end" : "center",
1667
- fontSize: `${t.block.fontSize}px`,
1668
- fontFamily: t.block.fontFamily ? r.resolveFontFamily(t.block.fontFamily) : "inherit",
1669
- alignItems: "center"
1670
- })), a = x(() => t.block.items.length > 0);
1671
- function o(e) {
1672
- return e || t.block.linkColor || t.block.color;
1673
- }
1674
- return (t, r) => (E(), C("div", da, [a.value ? (E(), C("div", {
1675
- key: 0,
1676
- style: l(i.value)
1677
- }, [(E(!0), C(j, null, u(e.block.items, (t, n) => (E(), C(j, { key: t.id }, [k("a", {
1678
- href: t.url || "#",
1679
- class: "tpl:cursor-default tpl:no-underline",
1680
- style: l({
1681
- color: o(t.color),
1682
- fontWeight: t.bold ? "bold" : "normal",
1683
- textDecoration: t.underline ? "underline" : "none"
1684
- }),
1685
- onClick: r[0] ||= L(() => {}, ["prevent"])
1686
- }, [v(si, { text: t.text || "..." }, null, 8, ["text"])], 12, fa), n < e.block.items.length - 1 ? (E(), C("span", {
1687
- key: 0,
1688
- style: l({
1689
- color: e.block.separatorColor,
1690
- padding: `0 ${e.block.spacing}px`
1691
- })
1692
- }, d(e.block.separator), 5)) : S("", !0)], 64))), 128))], 4)) : (E(), C("div", pa, [v(M(Dt), { size: 16 }), k("span", null, d(M(n).menu.addLinks), 1)]))]));
1693
- }
1694
- });
1695
- // src/composables/useEditableTextBlock.ts
1696
- function ha(t) {
1697
- let r = n(Xt, Ht), i = n(Qt, null), { syntax: a } = Yn(), o = x(() => i?.value ? fe(t(), r.value) : Ne(t(), r.value)), s = x(() => Je(zn(rt(o.value, a)))), c = e(!1), l = e(null), { top: u, left: d } = Pt(l), { toLocal: f } = Fn(), p = x(() => f({
1698
- top: u.value - 8,
1699
- left: d.value
1700
- }));
1701
- function m() {
1702
- c.value = !0;
1703
- }
1704
- function h() {
1705
- c.value = !1;
1706
- }
1707
- return {
1708
- isEditing: c,
1709
- blockRef: l,
1710
- toolbarPosition: p,
1711
- resolvedContent: s,
1712
- handleDoubleClick: m,
1713
- handleEditorDone: h
1714
- };
1715
- }
1716
- // src/components/blocks/ParagraphBlock.vue?vue&type=script&setup=true&lang.ts
1717
- var ga = ["innerHTML"], _a = /* @__PURE__ */ F({
1718
- __name: "ParagraphBlock",
1719
- props: {
1720
- block: {},
1721
- viewport: {}
1722
- },
1723
- setup(e) {
1724
- let t = e, n = te(() => import("./ParagraphEditor-CWXfurGh.js").then((e) => e.t)), { isEditing: r, blockRef: i, toolbarPosition: a, resolvedContent: o, handleDoubleClick: s, handleEditorDone: c } = ha(() => t.block.content);
1725
- return (t, l) => (E(), C("div", {
1726
- ref_key: "blockRef",
1727
- ref: i,
1728
- class: "tpl:min-h-[1em] tpl:w-full",
1729
- onDblclick: l[0] ||= (...e) => M(s) && M(s)(...e)
1730
- }, [M(r) ? (E(), N(M(n), {
1731
- key: 0,
1732
- block: e.block,
1733
- "toolbar-position": M(a),
1734
- onDone: M(c)
1735
- }, null, 8, [
1736
- "block",
1737
- "toolbar-position",
1738
- "onDone"
1739
- ])) : (E(), C("div", {
1740
- key: 1,
1741
- class: "tpl-text-content tpl:outline-none",
1742
- innerHTML: M(o)
1743
- }, null, 8, ga))], 544));
1744
- }
1745
- }), va = [
1746
- "data-block-id",
1747
- "data-block-type",
1748
- "data-tpl-picked"
1749
- ], ya = ["aria-label"], ba = ["data-lock-holder"], xa = ["aria-label"], Sa = [
1750
- "aria-label",
1751
- "aria-pressed",
1752
- "title"
1753
- ], Ca = ["aria-label", "title"], wa = ["aria-label", "title"], Ta = ["aria-label", "title"], Ea = {
1754
- key: 3,
1755
- class: "tpl-block-hidden-overlay tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[5] tpl:flex tpl:items-center tpl:justify-center tpl:rounded-sm"
1756
- }, Da = { class: "tpl:flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-2 tpl:py-1 tpl:text-[10px] tpl:font-medium tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:text-[var(--tpl-chrome-text-muted)] tpl:shadow-[var(--tpl-shadow-sm)]" }, Oa = {
1757
- key: 4,
1758
- class: "tpl:absolute tpl:-left-1 tpl:top-1/2 tpl:z-[5] tpl:-translate-x-full tpl:-translate-y-1/2"
1759
- }, ka = ["aria-label", "title"], Aa = /*#__PURE__*/ qn(/* @__PURE__ */ F({
1760
- __name: "BlockWrapper",
1761
- props: {
1762
- block: {},
1763
- isSelected: { type: Boolean },
1764
- viewport: {},
1765
- previewMode: { type: Boolean },
1766
- nested: { type: Boolean },
1767
- picked: { type: Boolean }
1768
- },
1769
- emits: ["select"],
1770
- setup(t, { emit: i }) {
1771
- let a = te(() => import("./BlockIssueBadge-BxpDy3u-.js")), o = t, s = i, { t: c, format: u } = jn(), f = n(en, null), m = e(null), g = x(() => f?.liftedBlockId.value === o.block.id), _ = x(() => g.value ? u(c.blockActions.dragLifted, { block: o.block.type }) : c.blockActions.drag);
1772
- async function y() {
1773
- await r(), m.value?.focus();
1774
- }
1775
- function b(e) {
1776
- f && (e.key === " " || e.key === "Enter" ? (e.preventDefault(), e.stopPropagation(), g.value ? f.drop(o.block.id) : f.lift(o.block.id)) : g.value && (e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), f.cancel(), y()) : e.key === "ArrowUp" ? (e.preventDefault(), e.stopPropagation(), f.moveUp(o.block.id), y()) : e.key === "ArrowDown" && (e.preventDefault(), e.stopPropagation(), f.moveDown(o.block.id), y())));
1777
- }
1778
- let T = x(() => !o.viewport || !o.block.visibility ? !1 : o.block.visibility[o.viewport] === !1), O = x(() => o.previewMode === !0 && T.value), A = x(() => o.viewport ? {
1779
- desktop: c.viewport.desktop,
1780
- mobile: c.viewport.mobile
1781
- }[o.viewport] ?? o.viewport : ""), j = x(() => !!o.block.displayCondition), ee = n(ln, null), N = n(pn, null), P = n(vn, {}), F = x(() => P.savedBlocks?.isPicking.value === !0), I = x(() => !o.nested && P.savedBlocks?.isAvailable.value === !0 && P.savedBlocks?.canCreate.value === !0), ne = x(() => o.isSelected && !F.value), re = x(() => P.comments?.getBlockCount(o.block.id) ?? 0), ie = e(null), ae = e(null), oe = e(null), se = e(null), ce = e({
1782
- left: "calc(100% + 8px)",
1783
- top: "50%"
1784
- }), le = e(!1), ue = x(() => ae.value ?? se.value), de = x(() => ue.value?.closest(".tpl-body"));
1785
- function fe() {
1786
- let e = le.value, t = ae.value, n = se.value, i = ie.value;
1787
- if (!t && !n || !i?.offsetWidth) return;
1788
- let a = i.getBoundingClientRect(), o = a.width / i.offsetWidth || 1, s = de.value, c = s ? (s.getBoundingClientRect().left - a.left) / o + s.clientLeft : -Infinity, l = s ? c + s.clientWidth : Infinity;
1789
- if (n?.offsetWidth) {
1790
- let t = i.offsetWidth + 4 + n.offsetWidth + 4 <= l;
1791
- if (e === t) {
1792
- le.value = !t, r(fe);
1793
- return;
1794
- }
1795
- }
1796
- if (!t?.offsetWidth) return;
1797
- let u = Math.max(c + 4, Math.min(i.offsetWidth + 8, l - t.offsetWidth - 4)), d = oe.value, f = Math.max(28, d?.offsetHeight ? d.offsetTop + d.offsetHeight + 4 : 0), p = Math.max(f + t.offsetHeight / 2, i.offsetHeight / 2), m = u < i.offsetWidth && p + t.offsetHeight / 2 <= i.offsetHeight + 8 ? `${p}px` : "50%";
1798
- if (u >= i.offsetWidth && n?.offsetWidth && !e) {
1799
- let e = (n.getBoundingClientRect().bottom - a.top) / o + 4 + t.offsetHeight / 2;
1800
- e > i.offsetHeight / 2 && (m = `${e}px`);
1801
- }
1802
- if (u < i.offsetWidth && m === "50%") {
1803
- let e = d?.getBoundingClientRect();
1804
- if (e?.width) {
1805
- let n = (e.left - a.left) / o - t.offsetWidth - 8;
1806
- u = Math.max(c + 4, Math.min(n, l - t.offsetWidth - 4));
1807
- }
1808
- }
1809
- (ce.value.left !== `${u}px` || ce.value.top !== m) && (ce.value = {
1810
- left: `${u}px`,
1811
- top: m
1812
- });
1813
- }
1814
- h(fe), Ft(x(() => ue.value ? [
1815
- ie.value,
1816
- ae.value,
1817
- oe.value,
1818
- se.value,
1819
- de.value
1820
- ].filter((e) => !!e) : []), fe), Mt(de, "scroll", fe, { passive: !0 });
1821
- let pe = x(() => P.collaboration?.lockOf(o.block.id) ?? null), me = x(() => pe.value?.holder.type === "guest" ? c.collaboration.guest : pe.value?.holder.name ?? ""), he = x(() => P.collaboration?.agentHighlightOf(o.block.id) ?? P.ai?.highlightOf(o.block.id) ?? null), ge = ot(() => o.block.type === "section" ? o.block.backgroundImage : void 0), _e = ot(() => o.block.type === "section" ? o.block.wrapper?.backgroundImage : void 0), ve = n(mn, null), ye = n(zt, void 0), be = x(() => ti(o.block, {
1822
- backgroundImageUrl: ge.value,
1823
- heroBoxWidth: gt(o.block, ve?.content.value, ye)
1824
- })), xe = x(() => ii(o.block, { backgroundImageUrl: _e.value }));
1825
- function Se(e) {
1826
- o.previewMode || (e.target?.closest("a") && e.preventDefault(), e.stopPropagation(), s("select"));
1827
- }
1828
- function Ce() {
1829
- ee?.deleteBlock(o.block.id);
1830
- }
1831
- function we() {
1832
- ee?.duplicateBlock(o.block);
1833
- }
1834
- function Te() {
1835
- P.savedBlocks?.startPicking(o.block.id);
1836
- }
1837
- function Ee() {
1838
- N?.toggleBlock(o.block.id);
1839
- }
1840
- return (e, n) => O.value ? S("", !0) : (E(), C("div", {
1841
- key: 0,
1842
- ref_key: "blockElement",
1843
- ref: ie,
1844
- class: D(["tpl-block tpl:group tpl:relative tpl:cursor-pointer tpl:rounded-sm tpl:transition-shadow", {
1845
- "tpl-block--selected": t.isSelected,
1846
- "tpl-block--picked": t.picked,
1847
- "tpl-block--idle": !t.isSelected && !t.picked,
1848
- "tpl-block--lifted": g.value
1849
- }]),
1850
- "data-block-id": t.block.id,
1851
- "data-block-type": t.block.type,
1852
- "data-tpl-picked": t.picked || void 0,
1853
- onClick: Se
1854
- }, [
1855
- k("div", {
1856
- ref_key: "badgesElement",
1857
- ref: oe,
1858
- class: "tpl-block-badges tpl:absolute tpl:top-1 tpl:right-1 tpl:z-10 tpl:flex tpl:gap-1"
1859
- }, [re.value > 0 && !T.value ? (E(), C("button", {
1860
- key: 0,
1861
- ref_key: "commentElement",
1862
- ref: se,
1863
- class: D(["tpl-comment-indicator tpl:flex tpl:min-h-6 tpl:min-w-6 tpl:shrink-0 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:gap-0.5 tpl:rounded-full tpl:border-none tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-semibold tpl:transition-colors tpl:bg-[var(--tpl-chrome-primary-light)] tpl:text-[var(--tpl-primary)]", le.value ? void 0 : "tpl:absolute tpl:-top-2 tpl:left-full tpl:ml-2"]),
1864
- "aria-label": M(u)(M(c).blockActions.comments, { count: String(re.value) }),
1865
- onClick: n[0] ||= L((e) => M(P).comments?.openForBlock(t.block.id), ["stop"])
1866
- }, [v(M(Un), {
1867
- size: 12,
1868
- "stroke-width": 2.5
1869
- }), w(" " + d(re.value), 1)], 10, ya)) : S("", !0), v(M(a), { "block-id": t.block.id }, null, 8, ["block-id"])], 512),
1870
- pe.value ? (E(), C("div", {
1871
- key: 0,
1872
- "data-testid": "block-lock",
1873
- "data-lock-holder": pe.value.holder.sessionId,
1874
- class: "tpl-block-lock tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm",
1875
- style: l({
1876
- outline: `2px solid ${pe.value.holder.color}`,
1877
- outlineOffset: "-1px"
1878
- })
1879
- }, [k("span", {
1880
- class: "tpl:absolute tpl:-top-0.5 tpl:left-1/2 tpl:z-[5] tpl:-translate-x-1/2 tpl:-translate-y-full tpl:rounded-full tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium tpl:whitespace-nowrap",
1881
- style: l({
1882
- backgroundColor: pe.value.holder.color,
1883
- color: M(Zn)(pe.value.holder.color)
1884
- })
1885
- }, d(M(u)(M(c).collaboration.editing, { name: me.value })), 5)], 12, ba)) : S("", !0),
1886
- he.value === null ? S("", !0) : (E(), C("div", {
1887
- key: he.value,
1888
- "data-testid": "block-agent-highlight",
1889
- "aria-hidden": "true",
1890
- class: "tpl-block-agent-highlight tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-[4] tpl:rounded-sm"
1891
- })),
1892
- ne.value ? (E(), C("div", {
1893
- key: 2,
1894
- ref_key: "actionsElement",
1895
- ref: ae,
1896
- style: l(ce.value),
1897
- role: "toolbar",
1898
- "aria-label": M(c).blockActions.drag,
1899
- class: "tpl-block-actions tpl-fade-in tpl:absolute tpl:top-1/2 tpl:z-20 tpl:flex tpl:-translate-y-1/2 tpl:gap-0.5 tpl:rounded-[var(--tpl-radius-sm)] tpl:p-1 tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:shadow-[var(--tpl-shadow-md)] tpl:border tpl:border-[var(--tpl-border)]"
1900
- }, [
1901
- k("button", {
1902
- ref_key: "dragButtonRef",
1903
- ref: m,
1904
- class: "tpl-block-btn tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-grab tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors tpl:active:cursor-grabbing",
1905
- "aria-label": _.value,
1906
- "aria-pressed": g.value,
1907
- "aria-keyshortcuts": "Space Enter ArrowUp ArrowDown Escape",
1908
- title: M(c).blockActions.drag,
1909
- onKeydown: b
1910
- }, [v(M(mi), {
1911
- size: 14,
1912
- "stroke-width": 1.5
1913
- })], 40, Sa),
1914
- k("button", {
1915
- class: "tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors",
1916
- "aria-label": M(c).blockActions.duplicate,
1917
- title: M(c).blockActions.duplicate,
1918
- onClick: L(we, ["stop"])
1919
- }, [v(M(Vn), {
1920
- size: 14,
1921
- "stroke-width": 1.5
1922
- })], 8, Ca),
1923
- I.value ? (E(), C("button", {
1924
- key: 0,
1925
- class: "tpl-block-action-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors",
1926
- "aria-label": M(c).blockActions.saveAsBlock,
1927
- title: M(c).blockActions.saveAsBlock,
1928
- onClick: L(Te, ["stop"])
1929
- }, [v(M(ui), {
1930
- size: 14,
1931
- "stroke-width": 1.5
1932
- })], 8, wa)) : S("", !0),
1933
- k("button", {
1934
- class: "tpl-block-action-btn tpl-block-delete-btn tpl:flex tpl:size-7 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-sm tpl:border-none tpl:transition-colors",
1935
- "aria-label": M(c).blockActions.delete,
1936
- title: M(c).blockActions.delete,
1937
- onClick: L(Ce, ["stop"])
1938
- }, [v(M(Wn), {
1939
- size: 14,
1940
- "stroke-width": 1.5
1941
- })], 8, Ta)
1942
- ], 12, xa)) : S("", !0),
1943
- T.value ? (E(), C("div", Ea, [k("span", Da, [v(M(fi), {
1944
- size: 12,
1945
- "stroke-width": 1.5
1946
- }), w(" " + d(M(u)(M(c).blockActions.hiddenOnViewport, { viewport: A.value })), 1)])])) : S("", !0),
1947
- j.value && !T.value ? (E(), C("div", Oa, [k("button", {
1948
- "data-testid": "condition-toggle",
1949
- class: "tpl-condition-toggle tpl:flex tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-md tpl:p-1 tpl:transition-colors tpl:bg-[var(--tpl-chrome-bg-elevated)] tpl:text-[var(--tpl-primary)] tpl:border tpl:border-[var(--tpl-border)]",
1950
- "aria-label": M(c).blockActions.conditionToggle,
1951
- title: t.block.displayCondition?.label,
1952
- onClick: L(Ee, ["stop"])
1953
- }, [v(M(pi), {
1954
- size: 12,
1955
- "stroke-width": 2
1956
- })], 8, ka)])) : S("", !0),
1957
- xe.value ? (E(), C("div", {
1958
- key: 5,
1959
- class: D(["tpl-section-wrapper tpl-email-surface", M(Zr)(xe.value)]),
1960
- style: l(xe.value)
1961
- }, [k("div", {
1962
- class: D(["tpl-block-content tpl-email-surface", M(Zr)(be.value)]),
1963
- style: l(be.value)
1964
- }, [p(e.$slots, "default", {}, void 0, !0)], 6)], 6)) : (E(), C("div", {
1965
- key: 6,
1966
- class: D(["tpl-block-content tpl-email-surface", M(Zr)(be.value)]),
1967
- style: l(be.value)
1968
- }, [p(e.$slots, "default", {}, void 0, !0)], 6))
1969
- ], 10, va));
1970
- }
1971
- }), [["__scopeId", "data-v-f3a7bfbf"]]);
1972
- // src/utils/unwrapParagraph.ts
1973
- function ja(e) {
1974
- let t = e.match(/^\s*<p\b[^>]*>([\s\S]*)<\/p>\s*$/);
1975
- return !t || /<\/p>\s*<p\b/i.test(t[1]) ? e : t[1];
1976
- }
1977
- // src/components/blocks/TitleBlock.vue
1978
- var Ma = /* @__PURE__ */ F({
1979
- __name: "TitleBlock",
1980
- props: {
1981
- block: {},
1982
- viewport: {}
1983
- },
1984
- setup(e) {
1985
- let t = e, n = te(() => import("./TitleEditor-DSqtle77.js")), r = It(En, "TitleBlock"), { isEditing: i, blockRef: o, toolbarPosition: s, resolvedContent: c, handleDoubleClick: u, handleEditorDone: d } = ha(() => t.block.content), f = x(() => {
1986
- let e = {
1987
- fontSize: `${Pe[t.block.level]}px`,
1988
- lineHeight: String(Be),
1989
- fontWeight: "700",
1990
- textAlign: t.block.textAlign
1991
- };
1992
- return t.block.color && (e.color = t.block.color), t.block.fontFamily && (e.fontFamily = r.resolveFontFamily(t.block.fontFamily)), e;
1993
- }), p = x(() => `h${t.block.level}`), m = x(() => ja(c.value));
1994
- return (t, r) => (E(), C("div", {
1995
- ref_key: "blockRef",
1996
- ref: o,
1997
- class: "tpl:min-h-[1em] tpl:w-full",
1998
- style: l(f.value),
1999
- onDblclick: r[0] ||= (...e) => M(u) && M(u)(...e)
2000
- }, [M(i) ? (E(), N(M(n), {
2001
- key: 0,
2002
- block: e.block,
2003
- "toolbar-position": M(s),
2004
- onDone: M(d)
2005
- }, null, 8, [
2006
- "block",
2007
- "toolbar-position",
2008
- "onDone"
2009
- ])) : (E(), N(a(p.value), {
2010
- key: 1,
2011
- class: "tpl-text-content tpl:m-0 tpl:font-[inherit] tpl:text-[length:inherit] tpl:leading-[inherit] tpl:outline-none",
2012
- style: {
2013
- color: "inherit",
2014
- fontWeight: "inherit"
2015
- },
2016
- innerHTML: m.value
2017
- }, null, 8, ["innerHTML"]))], 36));
2018
- }
2019
- }), Na = "hero", Pa = "#1f2937", Fa = "#ffffff";
2020
- function Ia(e, t) {
2021
- let n = et("title", e);
2022
- n.color = Fa, n.textAlign = "center";
2023
- let r = et("paragraph", e);
2024
- r.content = `<p style="text-align: center"><span style="color: ${Fa}">${La(t)}</span></p>`;
2025
- let i = et("button", e);
2026
- return i.align = "center", pe({
2027
- columns: "1",
2028
- children: [[
2029
- n,
2030
- r,
2031
- i
2032
- ]],
2033
- hero: {
2034
- height: "image",
2035
- verticalAlign: "middle"
2036
- },
2037
- styles: {
2038
- padding: {
2039
- top: 48,
2040
- right: 24,
2041
- bottom: 48,
2042
- left: 24
2043
- },
2044
- backgroundColor: Pa
2045
- }
2046
- });
2047
- }
2048
- function La(e) {
2049
- return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
2050
- }
2051
- // src/utils/sectionColumnDrop.ts
2052
- var Ra = /* @__PURE__ */ new Set(["section", Na]);
2053
- function za(e) {
2054
- return e.dataset.blockType !== "section" && !Ra.has(e.dataset.paletteType ?? "");
2055
- }
2056
- // ../../node_modules/.pnpm/vue-draggable-plus@0.6.1_@types+sortablejs@1.15.9/node_modules/vue-draggable-plus/dist/vue-draggable-plus.js
2057
- var Ba = Object.defineProperty, Va = Object.getOwnPropertySymbols, Ha = Object.prototype.hasOwnProperty, Ua = Object.prototype.propertyIsEnumerable, Wa = (e, t, n) => t in e ? Ba(e, t, {
2058
- enumerable: !0,
2059
- configurable: !0,
2060
- writable: !0,
2061
- value: n
2062
- }) : e[t] = n, Ga = (e, t) => {
2063
- for (var n in t ||= {}) Ha.call(t, n) && Wa(e, n, t[n]);
2064
- if (Va) for (var n of Va(t)) Ua.call(t, n) && Wa(e, n, t[n]);
2065
- return e;
2066
- }, Ka = (e, t) => {
2067
- var n = {};
2068
- for (var r in e) Ha.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
2069
- if (e != null && Va) for (var r of Va(e)) t.indexOf(r) < 0 && Ua.call(e, r) && (n[r] = e[r]);
2070
- return n;
2071
- }, qa = "[vue-draggable-plus]: ";
2072
- function Ja(e) {
2073
- console.warn(qa + e);
2074
- }
2075
- function Ya(e) {
2076
- console.error(qa + e);
2077
- }
2078
- function Xa(e, t, n) {
2079
- return n >= 0 && n < e.length && e.splice(n, 0, e.splice(t, 1)[0]), e;
2080
- }
2081
- function Za(e) {
2082
- return e.replace(/-(\w)/g, (e, t) => t ? t.toUpperCase() : "");
2083
- }
2084
- function Qa(e) {
2085
- return Object.keys(e).reduce((t, n) => (e[n] !== void 0 && (t[Za(n)] = e[n]), t), {});
2086
- }
2087
- function $a(e, t) {
2088
- return Array.isArray(e) && e.splice(t, 1), e;
2089
- }
2090
- function eo(e, t, n) {
2091
- return Array.isArray(e) && e.splice(t, 0, n), e;
2092
- }
2093
- function to(e) {
2094
- return e === void 0;
2095
- }
2096
- function no(e) {
2097
- return typeof e == "string";
2098
- }
2099
- function ro(e, t, n) {
2100
- let r = e.children[n];
2101
- e.insertBefore(t, r);
2102
- }
2103
- function io(e) {
2104
- e.parentNode && e.parentNode.removeChild(e);
2105
- }
2106
- function ao(e, t = document) {
2107
- let n = null;
2108
- return n = typeof t?.querySelector == "function" ? (t?.querySelector)?.call(t, e) : document.querySelector(e), n || Ja(`Element not found: ${e}`), n;
2109
- }
2110
- function oo(e, t, n = null) {
2111
- return function(...r) {
2112
- return e.apply(n, r), t.apply(n, r);
2113
- };
2114
- }
2115
- function so(e, t) {
2116
- let n = Ga({}, e);
2117
- return Object.keys(t).forEach((r) => {
2118
- n[r] ? n[r] = oo(e[r], t[r]) : n[r] = t[r];
2119
- }), n;
2120
- }
2121
- function co(e) {
2122
- return e instanceof HTMLElement;
2123
- }
2124
- function lo(e, t) {
2125
- Object.keys(e).forEach((n) => {
2126
- t(n, e[n]);
2127
- });
2128
- }
2129
- function uo(e) {
2130
- return e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && (e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97);
2131
- }
2132
- var fo = Object.assign;
2133
- function po(e, t) {
2134
- var n = Object.keys(e);
2135
- if (Object.getOwnPropertySymbols) {
2136
- var r = Object.getOwnPropertySymbols(e);
2137
- t && (r = r.filter(function(t) {
2138
- return Object.getOwnPropertyDescriptor(e, t).enumerable;
2139
- })), n.push.apply(n, r);
2140
- }
2141
- return n;
2142
- }
2143
- function mo(e) {
2144
- for (var t = 1; t < arguments.length; t++) {
2145
- var n = arguments[t] == null ? {} : arguments[t];
2146
- t % 2 ? po(Object(n), !0).forEach(function(t) {
2147
- go(e, t, n[t]);
2148
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : po(Object(n)).forEach(function(t) {
2149
- Object.defineProperty(e, t, Object.getOwnPropertyDescriptor(n, t));
2150
- });
2151
- }
2152
- return e;
2153
- }
2154
- function ho(e) {
2155
- "@babel/helpers - typeof";
2156
- return ho = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
2157
- return typeof e;
2158
- } : function(e) {
2159
- return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
2160
- }, ho(e);
2161
- }
2162
- function go(e, t, n) {
2163
- return t in e ? Object.defineProperty(e, t, {
2164
- value: n,
2165
- enumerable: !0,
2166
- configurable: !0,
2167
- writable: !0
2168
- }) : e[t] = n, e;
2169
- }
2170
- function _o() {
2171
- return _o = Object.assign || function(e) {
2172
- for (var t = 1; t < arguments.length; t++) {
2173
- var n = arguments[t];
2174
- for (var r in n) Object.prototype.hasOwnProperty.call(n, r) && (e[r] = n[r]);
2175
- }
2176
- return e;
2177
- }, _o.apply(this, arguments);
2178
- }
2179
- function vo(e, t) {
2180
- if (e == null) return {};
2181
- for (var n = {}, r = Object.keys(e), i, a = 0; a < r.length; a++) i = r[a], !(t.indexOf(i) >= 0) && (n[i] = e[i]);
2182
- return n;
2183
- }
2184
- function yo(e, t) {
2185
- if (e == null) return {};
2186
- var n = vo(e, t), r, i;
2187
- if (Object.getOwnPropertySymbols) {
2188
- var a = Object.getOwnPropertySymbols(e);
2189
- for (i = 0; i < a.length; i++) r = a[i], !(t.indexOf(r) >= 0) && Object.prototype.propertyIsEnumerable.call(e, r) && (n[r] = e[r]);
2190
- }
2191
- return n;
2192
- }
2193
- var bo = "1.15.2";
2194
- function xo(e) {
2195
- if (typeof window < "u" && window.navigator) return !!/* @__PURE__ */ navigator.userAgent.match(e);
2196
- }
2197
- var So = xo(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), Co = xo(/Edge/i), wo = xo(/firefox/i), To = xo(/safari/i) && !xo(/chrome/i) && !xo(/android/i), Eo = xo(/iP(ad|od|hone)/i), Do = xo(/chrome/i) && xo(/android/i), Oo = {
2198
- capture: !1,
2199
- passive: !1
2200
- };
2201
- function z(e, t, n) {
2202
- e.addEventListener(t, n, !So && Oo);
2203
- }
2204
- function B(e, t, n) {
2205
- e.removeEventListener(t, n, !So && Oo);
2206
- }
2207
- function ko(e, t) {
2208
- if (t) {
2209
- if (t[0] === ">" && (t = t.substring(1)), e) try {
2210
- if (e.matches) return e.matches(t);
2211
- if (e.msMatchesSelector) return e.msMatchesSelector(t);
2212
- if (e.webkitMatchesSelector) return e.webkitMatchesSelector(t);
2213
- } catch {
2214
- return !1;
2215
- }
2216
- return !1;
2217
- }
2218
- }
2219
- function Ao(e) {
2220
- return e.host && e !== document && e.host.nodeType ? e.host : e.parentNode;
2221
- }
2222
- function jo(e, t, n, r) {
2223
- if (e) {
2224
- n ||= document;
2225
- do {
2226
- if (t != null && (t[0] === ">" ? e.parentNode === n && ko(e, t) : ko(e, t)) || r && e === n) return e;
2227
- if (e === n) break;
2228
- } while (e = Ao(e));
2229
- }
2230
- return null;
2231
- }
2232
- var Mo = /\s+/g;
2233
- function No(e, t, n) {
2234
- e && t && (e.classList ? e.classList[n ? "add" : "remove"](t) : e.className = ((" " + e.className + " ").replace(Mo, " ").replace(" " + t + " ", " ") + (n ? " " + t : "")).replace(Mo, " "));
2235
- }
2236
- function V(e, t, n) {
2237
- var r = e && e.style;
2238
- if (r) {
2239
- if (n === void 0) return document.defaultView && document.defaultView.getComputedStyle ? n = document.defaultView.getComputedStyle(e, "") : e.currentStyle && (n = e.currentStyle), t === void 0 ? n : n[t];
2240
- !(t in r) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), r[t] = n + (typeof n == "string" ? "" : "px");
2241
- }
2242
- }
2243
- function Po(e, t) {
2244
- var n = "";
2245
- if (typeof e == "string") n = e;
2246
- else do {
2247
- var r = V(e, "transform");
2248
- r && r !== "none" && (n = r + " " + n);
2249
- } while (!t && (e = e.parentNode));
2250
- var i = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
2251
- return i && new i(n);
2252
- }
2253
- function Fo(e, t, n) {
2254
- if (e) {
2255
- var r = e.getElementsByTagName(t), i = 0, a = r.length;
2256
- if (n) for (; i < a; i++) n(r[i], i);
2257
- return r;
2258
- }
2259
- return [];
2260
- }
2261
- function Io() {
2262
- return document.scrollingElement || document.documentElement;
2263
- }
2264
- function H(e, t, n, r, i) {
2265
- if (e.getBoundingClientRect || e === window) {
2266
- var a, o, s, c, l, u, d;
2267
- if (e !== window && e.parentNode && e !== Io() ? (a = e.getBoundingClientRect(), o = a.top, s = a.left, c = a.bottom, l = a.right, u = a.height, d = a.width) : (o = 0, s = 0, c = window.innerHeight, l = window.innerWidth, u = window.innerHeight, d = window.innerWidth), (t || n) && e !== window && (i ||= e.parentNode, !So)) do
2268
- if (i && i.getBoundingClientRect && (V(i, "transform") !== "none" || n && V(i, "position") !== "static")) {
2269
- var f = i.getBoundingClientRect();
2270
- o -= f.top + parseInt(V(i, "border-top-width")), s -= f.left + parseInt(V(i, "border-left-width")), c = o + a.height, l = s + a.width;
2271
- break;
2272
- }
2273
- while (i = i.parentNode);
2274
- if (r && e !== window) {
2275
- var p = Po(i || e), m = p && p.a, h = p && p.d;
2276
- p && (o /= h, s /= m, d /= m, u /= h, c = o + u, l = s + d);
2277
- }
2278
- return {
2279
- top: o,
2280
- left: s,
2281
- bottom: c,
2282
- right: l,
2283
- width: d,
2284
- height: u
2285
- };
2286
- }
2287
- }
2288
- function Lo(e, t, n) {
2289
- for (var r = Uo(e, !0), i = H(e)[t]; r;) {
2290
- var a = H(r)[n], o = void 0;
2291
- if (o = i >= a, !o) return r;
2292
- if (r === Io()) break;
2293
- r = Uo(r, !1);
2294
- }
2295
- return !1;
2296
- }
2297
- function Ro(e, t, n, r) {
2298
- for (var i = 0, a = 0, o = e.children; a < o.length;) {
2299
- if (o[a].style.display !== "none" && o[a] !== Q.ghost && (r || o[a] !== Q.dragged) && jo(o[a], n.draggable, e, !1)) {
2300
- if (i === t) return o[a];
2301
- i++;
2302
- }
2303
- a++;
2304
- }
2305
- return null;
2306
- }
2307
- function zo(e, t) {
2308
- for (var n = e.lastElementChild; n && (n === Q.ghost || V(n, "display") === "none" || t && !ko(n, t));) n = n.previousElementSibling;
2309
- return n || null;
2310
- }
2311
- function Bo(e, t) {
2312
- var n = 0;
2313
- if (!e || !e.parentNode) return -1;
2314
- for (; e = e.previousElementSibling;) e.nodeName.toUpperCase() !== "TEMPLATE" && e !== Q.clone && (!t || ko(e, t)) && n++;
2315
- return n;
2316
- }
2317
- function Vo(e) {
2318
- var t = 0, n = 0, r = Io();
2319
- if (e) do {
2320
- var i = Po(e), a = i.a, o = i.d;
2321
- t += e.scrollLeft * a, n += e.scrollTop * o;
2322
- } while (e !== r && (e = e.parentNode));
2323
- return [t, n];
2324
- }
2325
- function Ho(e, t) {
2326
- for (var n in e) if (e.hasOwnProperty(n)) {
2327
- for (var r in t) if (t.hasOwnProperty(r) && t[r] === e[n][r]) return Number(n);
2328
- }
2329
- return -1;
2330
- }
2331
- function Uo(e, t) {
2332
- if (!e || !e.getBoundingClientRect) return Io();
2333
- var n = e, r = !1;
2334
- do
2335
- if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
2336
- var i = V(n);
2337
- if (n.clientWidth < n.scrollWidth && (i.overflowX == "auto" || i.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (i.overflowY == "auto" || i.overflowY == "scroll")) {
2338
- if (!n.getBoundingClientRect || n === document.body) return Io();
2339
- if (r || t) return n;
2340
- r = !0;
2341
- }
2342
- }
2343
- while (n = n.parentNode);
2344
- return Io();
2345
- }
2346
- function Wo(e, t) {
2347
- if (e && t) for (var n in t) t.hasOwnProperty(n) && (e[n] = t[n]);
2348
- return e;
2349
- }
2350
- function Go(e, t) {
2351
- return Math.round(e.top) === Math.round(t.top) && Math.round(e.left) === Math.round(t.left) && Math.round(e.height) === Math.round(t.height) && Math.round(e.width) === Math.round(t.width);
2352
- }
2353
- var Ko;
2354
- function qo(e, t) {
2355
- return function() {
2356
- if (!Ko) {
2357
- var n = arguments, r = this;
2358
- n.length === 1 ? e.call(r, n[0]) : e.apply(r, n), Ko = setTimeout(function() {
2359
- Ko = void 0;
2360
- }, t);
2361
- }
2362
- };
2363
- }
2364
- function Jo() {
2365
- clearTimeout(Ko), Ko = void 0;
2366
- }
2367
- function Yo(e, t, n) {
2368
- e.scrollLeft += t, e.scrollTop += n;
2369
- }
2370
- function Xo(e) {
2371
- var t = window.Polymer, n = window.jQuery || window.Zepto;
2372
- return t && t.dom ? t.dom(e).cloneNode(!0) : n ? n(e).clone(!0)[0] : e.cloneNode(!0);
2373
- }
2374
- function Zo(e, t, n) {
2375
- var r = {};
2376
- return Array.from(e.children).forEach(function(i) {
2377
- if (jo(i, t.draggable, e, !1) && !i.animated && i !== n) {
2378
- var a = H(i);
2379
- r.left = Math.min(r.left ?? 1 / 0, a.left), r.top = Math.min(r.top ?? 1 / 0, a.top), r.right = Math.max(r.right ?? -1 / 0, a.right), r.bottom = Math.max(r.bottom ?? -1 / 0, a.bottom);
2380
- }
2381
- }), r.width = r.right - r.left, r.height = r.bottom - r.top, r.x = r.left, r.y = r.top, r;
2382
- }
2383
- var Qo = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
2384
- function $o() {
2385
- var e = [], t;
2386
- return {
2387
- captureAnimationState: function() {
2388
- e = [], this.options.animation && [].slice.call(this.el.children).forEach(function(t) {
2389
- if (V(t, "display") !== "none" && t !== Q.ghost) {
2390
- e.push({
2391
- target: t,
2392
- rect: H(t)
2393
- });
2394
- var n = mo({}, e[e.length - 1].rect);
2395
- if (t.thisAnimationDuration) {
2396
- var r = Po(t, !0);
2397
- r && (n.top -= r.f, n.left -= r.e);
2398
- }
2399
- t.fromRect = n;
2400
- }
2401
- });
2402
- },
2403
- addAnimationState: function(t) {
2404
- e.push(t);
2405
- },
2406
- removeAnimationState: function(t) {
2407
- e.splice(Ho(e, { target: t }), 1);
2408
- },
2409
- animateAll: function(n) {
2410
- var r = this;
2411
- if (!this.options.animation) clearTimeout(t), typeof n == "function" && n();
2412
- else {
2413
- var i = !1, a = 0;
2414
- e.forEach(function(e) {
2415
- var t = 0, n = e.target, o = n.fromRect, s = H(n), c = n.prevFromRect, l = n.prevToRect, u = e.rect, d = Po(n, !0);
2416
- d && (s.top -= d.f, s.left -= d.e), n.toRect = s, n.thisAnimationDuration && Go(c, s) && !Go(o, s) && (u.top - s.top) / (u.left - s.left) === (o.top - s.top) / (o.left - s.left) && (t = ts(u, c, l, r.options)), Go(s, o) || (n.prevFromRect = o, n.prevToRect = s, t ||= r.options.animation, r.animate(n, u, s, t)), t && (i = !0, a = Math.max(a, t), clearTimeout(n.animationResetTimer), n.animationResetTimer = setTimeout(function() {
2417
- n.animationTime = 0, n.prevFromRect = null, n.fromRect = null, n.prevToRect = null, n.thisAnimationDuration = null;
2418
- }, t), n.thisAnimationDuration = t);
2419
- }), clearTimeout(t), i ? t = setTimeout(function() {
2420
- typeof n == "function" && n();
2421
- }, a) : typeof n == "function" && n(), e = [];
2422
- }
2423
- },
2424
- animate: function(e, t, n, r) {
2425
- if (r) {
2426
- V(e, "transition", ""), V(e, "transform", "");
2427
- var i = Po(this.el), a = i && i.a, o = i && i.d, s = (t.left - n.left) / (a || 1), c = (t.top - n.top) / (o || 1);
2428
- e.animatingX = !!s, e.animatingY = !!c, V(e, "transform", "translate3d(" + s + "px," + c + "px,0)"), this.forRepaintDummy = es(e), V(e, "transition", "transform " + r + "ms" + (this.options.easing ? " " + this.options.easing : "")), V(e, "transform", "translate3d(0,0,0)"), typeof e.animated == "number" && clearTimeout(e.animated), e.animated = setTimeout(function() {
2429
- V(e, "transition", ""), V(e, "transform", ""), e.animated = !1, e.animatingX = !1, e.animatingY = !1;
2430
- }, r);
2431
- }
2432
- }
2433
- };
2434
- }
2435
- function es(e) {
2436
- return e.offsetWidth;
2437
- }
2438
- function ts(e, t, n, r) {
2439
- return Math.sqrt((t.top - e.top) ** 2 + (t.left - e.left) ** 2) / Math.sqrt((t.top - n.top) ** 2 + (t.left - n.left) ** 2) * r.animation;
2440
- }
2441
- var ns = [], rs = { initializeByDefault: !0 }, is = {
2442
- mount: function(e) {
2443
- for (var t in rs) rs.hasOwnProperty(t) && !(t in e) && (e[t] = rs[t]);
2444
- ns.forEach(function(t) {
2445
- if (t.pluginName === e.pluginName) throw `Sortable: Cannot mount plugin ${e.pluginName} more than once`;
2446
- }), ns.push(e);
2447
- },
2448
- pluginEvent: function(e, t, n) {
2449
- var r = this;
2450
- this.eventCanceled = !1, n.cancel = function() {
2451
- r.eventCanceled = !0;
2452
- };
2453
- var i = e + "Global";
2454
- ns.forEach(function(r) {
2455
- t[r.pluginName] && (t[r.pluginName][i] && t[r.pluginName][i](mo({ sortable: t }, n)), t.options[r.pluginName] && t[r.pluginName][e] && t[r.pluginName][e](mo({ sortable: t }, n)));
2456
- });
2457
- },
2458
- initializePlugins: function(e, t, n, r) {
2459
- for (var i in ns.forEach(function(r) {
2460
- var i = r.pluginName;
2461
- if (e.options[i] || r.initializeByDefault) {
2462
- var a = new r(e, t, e.options);
2463
- a.sortable = e, a.options = e.options, e[i] = a, _o(n, a.defaults);
2464
- }
2465
- }), e.options) if (e.options.hasOwnProperty(i)) {
2466
- var a = this.modifyOption(e, i, e.options[i]);
2467
- a !== void 0 && (e.options[i] = a);
2468
- }
2469
- },
2470
- getEventProperties: function(e, t) {
2471
- var n = {};
2472
- return ns.forEach(function(r) {
2473
- typeof r.eventProperties == "function" && _o(n, r.eventProperties.call(t[r.pluginName], e));
2474
- }), n;
2475
- },
2476
- modifyOption: function(e, t, n) {
2477
- var r;
2478
- return ns.forEach(function(i) {
2479
- e[i.pluginName] && i.optionListeners && typeof i.optionListeners[t] == "function" && (r = i.optionListeners[t].call(e[i.pluginName], n));
2480
- }), r;
2481
- }
2482
- };
2483
- function as(e) {
2484
- var t = e.sortable, n = e.rootEl, r = e.name, i = e.targetEl, a = e.cloneEl, o = e.toEl, s = e.fromEl, c = e.oldIndex, l = e.newIndex, u = e.oldDraggableIndex, d = e.newDraggableIndex, f = e.originalEvent, p = e.putSortable, m = e.extraEventProperties;
2485
- if (t ||= n && n[Qo], t) {
2486
- var h, g = t.options, _ = "on" + r.charAt(0).toUpperCase() + r.substr(1);
2487
- window.CustomEvent && !So && !Co ? h = new CustomEvent(r, {
2488
- bubbles: !0,
2489
- cancelable: !0
2490
- }) : (h = document.createEvent("Event"), h.initEvent(r, !0, !0)), h.to = o || n, h.from = s || n, h.item = i || n, h.clone = a, h.oldIndex = c, h.newIndex = l, h.oldDraggableIndex = u, h.newDraggableIndex = d, h.originalEvent = f, h.pullMode = p ? p.lastPutMode : void 0;
2491
- var v = mo(mo({}, m), is.getEventProperties(r, t));
2492
- for (var y in v) h[y] = v[y];
2493
- n && n.dispatchEvent(h), g[_] && g[_].call(t, h);
2494
- }
2495
- }
2496
- var os = ["evt"], U = function(e, t) {
2497
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, r = n.evt, i = yo(n, os);
2498
- is.pluginEvent.bind(Q)(e, t, mo({
2499
- dragEl: G,
2500
- parentEl: K,
2501
- ghostEl: q,
2502
- rootEl: J,
2503
- nextEl: ss,
2504
- lastDownEl: cs,
2505
- cloneEl: Y,
2506
- cloneHidden: ls,
2507
- dragStarted: ws,
2508
- putSortable: X,
2509
- activeSortable: Q.active,
2510
- originalEvent: r,
2511
- oldIndex: us,
2512
- oldDraggableIndex: fs,
2513
- newIndex: ds,
2514
- newDraggableIndex: ps,
2515
- hideGhostForTarget: Hs,
2516
- unhideGhostForTarget: Us,
2517
- cloneNowHidden: function() {
2518
- ls = !0;
2519
- },
2520
- cloneNowShown: function() {
2521
- ls = !1;
2522
- },
2523
- dispatchSortableEvent: function(e) {
2524
- W({
2525
- sortable: t,
2526
- name: e,
2527
- originalEvent: r
2528
- });
2529
- }
2530
- }, i));
2531
- };
2532
- function W(e) {
2533
- as(mo({
2534
- putSortable: X,
2535
- cloneEl: Y,
2536
- targetEl: G,
2537
- rootEl: J,
2538
- oldIndex: us,
2539
- oldDraggableIndex: fs,
2540
- newIndex: ds,
2541
- newDraggableIndex: ps
2542
- }, e));
2543
- }
2544
- var G, K, q, J, ss, cs, Y, ls, us, ds, fs, ps, ms, X, hs = !1, gs = !1, _s = [], vs, ys, bs, xs, Ss, Cs, ws, Ts, Es, Ds = !1, Os = !1, ks, Z, As = [], js = !1, Ms = [], Ns = typeof document < "u", Ps = Eo, Fs = Co || So ? "cssFloat" : "float", Is = Ns && !Do && !Eo && "draggable" in document.createElement("div"), Ls = function() {
2545
- if (Ns) {
2546
- if (So) return !1;
2547
- var e = document.createElement("x");
2548
- return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
2549
- }
2550
- }(), Rs = function(e, t) {
2551
- var n = V(e), r = parseInt(n.width) - parseInt(n.paddingLeft) - parseInt(n.paddingRight) - parseInt(n.borderLeftWidth) - parseInt(n.borderRightWidth), i = Ro(e, 0, t), a = Ro(e, 1, t), o = i && V(i), s = a && V(a), c = o && parseInt(o.marginLeft) + parseInt(o.marginRight) + H(i).width, l = s && parseInt(s.marginLeft) + parseInt(s.marginRight) + H(a).width;
2552
- if (n.display === "flex") return n.flexDirection === "column" || n.flexDirection === "column-reverse" ? "vertical" : "horizontal";
2553
- if (n.display === "grid") return n.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
2554
- if (i && o.float && o.float !== "none") {
2555
- var u = o.float === "left" ? "left" : "right";
2556
- return a && (s.clear === "both" || s.clear === u) ? "vertical" : "horizontal";
2557
- }
2558
- return i && (o.display === "block" || o.display === "flex" || o.display === "table" || o.display === "grid" || c >= r && n[Fs] === "none" || a && n[Fs] === "none" && c + l > r) ? "vertical" : "horizontal";
2559
- }, zs = function(e, t, n) {
2560
- var r = n ? e.left : e.top, i = n ? e.right : e.bottom, a = n ? e.width : e.height, o = n ? t.left : t.top, s = n ? t.right : t.bottom, c = n ? t.width : t.height;
2561
- return r === o || i === s || r + a / 2 === o + c / 2;
2562
- }, Bs = function(e, t) {
2563
- var n;
2564
- return _s.some(function(r) {
2565
- var i = r[Qo].options.emptyInsertThreshold;
2566
- if (i && !zo(r)) {
2567
- var a = H(r), o = e >= a.left - i && e <= a.right + i, s = t >= a.top - i && t <= a.bottom + i;
2568
- if (o && s) return n = r;
2569
- }
2570
- }), n;
2571
- }, Vs = function(e) {
2572
- function t(e, n) {
2573
- return function(r, i, a, o) {
2574
- var s = r.options.group.name && i.options.group.name && r.options.group.name === i.options.group.name;
2575
- if (e == null && (n || s)) return !0;
2576
- if (e == null || e === !1) return !1;
2577
- if (n && e === "clone") return e;
2578
- if (typeof e == "function") return t(e(r, i, a, o), n)(r, i, a, o);
2579
- var c = (n ? r : i).options.group.name;
2580
- return e === !0 || typeof e == "string" && e === c || e.join && e.indexOf(c) > -1;
2581
- };
2582
- }
2583
- var n = {}, r = e.group;
2584
- r && ho(r) == "object" || (r = { name: r }), n.name = r.name, n.checkPull = t(r.pull, !0), n.checkPut = t(r.put), n.revertClone = r.revertClone, e.group = n;
2585
- }, Hs = function() {
2586
- !Ls && q && V(q, "display", "none");
2587
- }, Us = function() {
2588
- !Ls && q && V(q, "display", "");
2589
- };
2590
- Ns && !Do && document.addEventListener("click", function(e) {
2591
- if (gs) return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), gs = !1, !1;
2592
- }, !0);
2593
- var Ws = function(e) {
2594
- if (G) {
2595
- e = e.touches ? e.touches[0] : e;
2596
- var t = Bs(e.clientX, e.clientY);
2597
- if (t) {
2598
- var n = {};
2599
- for (var r in e) e.hasOwnProperty(r) && (n[r] = e[r]);
2600
- n.target = n.rootEl = t, n.preventDefault = void 0, n.stopPropagation = void 0, t[Qo]._onDragOver(n);
2601
- }
2602
- }
2603
- }, Gs = function(e) {
2604
- G && G.parentNode[Qo]._isOutsideThisEl(e.target);
2605
- };
2606
- function Q(e, t) {
2607
- if (!(e && e.nodeType && e.nodeType === 1)) throw `Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;
2608
- this.el = e, this.options = t = _o({}, t), e[Qo] = this;
2609
- var n = {
2610
- group: null,
2611
- sort: !0,
2612
- disabled: !1,
2613
- store: null,
2614
- handle: null,
2615
- draggable: /^[uo]l$/i.test(e.nodeName) ? ">li" : ">*",
2616
- swapThreshold: 1,
2617
- invertSwap: !1,
2618
- invertedSwapThreshold: null,
2619
- removeCloneOnHide: !0,
2620
- direction: function() {
2621
- return Rs(e, this.options);
2622
- },
2623
- ghostClass: "sortable-ghost",
2624
- chosenClass: "sortable-chosen",
2625
- dragClass: "sortable-drag",
2626
- ignore: "a, img",
2627
- filter: null,
2628
- preventOnFilter: !0,
2629
- animation: 0,
2630
- easing: null,
2631
- setData: function(e, t) {
2632
- e.setData("Text", t.textContent);
2633
- },
2634
- dropBubble: !1,
2635
- dragoverBubble: !1,
2636
- dataIdAttr: "data-id",
2637
- delay: 0,
2638
- delayOnTouchOnly: !1,
2639
- touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
2640
- forceFallback: !1,
2641
- fallbackClass: "sortable-fallback",
2642
- fallbackOnBody: !1,
2643
- fallbackTolerance: 0,
2644
- fallbackOffset: {
2645
- x: 0,
2646
- y: 0
2647
- },
2648
- supportPointer: Q.supportPointer !== !1 && "PointerEvent" in window && !To,
2649
- emptyInsertThreshold: 5
2650
- };
2651
- for (var r in is.initializePlugins(this, e, n), n) !(r in t) && (t[r] = n[r]);
2652
- for (var i in Vs(t), this) i.charAt(0) === "_" && typeof this[i] == "function" && (this[i] = this[i].bind(this));
2653
- this.nativeDraggable = !t.forceFallback && Is, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? z(e, "pointerdown", this._onTapStart) : (z(e, "mousedown", this._onTapStart), z(e, "touchstart", this._onTapStart)), this.nativeDraggable && (z(e, "dragover", this), z(e, "dragenter", this)), _s.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), _o(this, $o());
2654
- }
2655
- Q.prototype = {
2656
- constructor: Q,
2657
- _isOutsideThisEl: function(e) {
2658
- !this.el.contains(e) && e !== this.el && (Ts = null);
2659
- },
2660
- _getDirection: function(e, t) {
2661
- return typeof this.options.direction == "function" ? this.options.direction.call(this, e, t, G) : this.options.direction;
2662
- },
2663
- _onTapStart: function(e) {
2664
- if (e.cancelable) {
2665
- var t = this, n = this.el, r = this.options, i = r.preventOnFilter, a = e.type, o = e.touches && e.touches[0] || e.pointerType && e.pointerType === "touch" && e, s = (o || e).target, c = e.target.shadowRoot && (e.path && e.path[0] || e.composedPath && e.composedPath()[0]) || s, l = r.filter;
2666
- if (tc(n), !G && !(/mousedown|pointerdown/.test(a) && e.button !== 0 || r.disabled) && !c.isContentEditable && !(!this.nativeDraggable && To && s && s.tagName.toUpperCase() === "SELECT") && (s = jo(s, r.draggable, n, !1), !(s && s.animated) && cs !== s)) {
2667
- if (us = Bo(s), fs = Bo(s, r.draggable), typeof l == "function") {
2668
- if (l.call(this, e, s, this)) {
2669
- W({
2670
- sortable: t,
2671
- rootEl: c,
2672
- name: "filter",
2673
- targetEl: s,
2674
- toEl: n,
2675
- fromEl: n
2676
- }), U("filter", t, { evt: e }), i && e.cancelable && e.preventDefault();
2677
- return;
2678
- }
2679
- } else if (l && (l = l.split(",").some(function(r) {
2680
- if (r = jo(c, r.trim(), n, !1), r) return W({
2681
- sortable: t,
2682
- rootEl: r,
2683
- name: "filter",
2684
- targetEl: s,
2685
- fromEl: n,
2686
- toEl: n
2687
- }), U("filter", t, { evt: e }), !0;
2688
- }), l)) {
2689
- i && e.cancelable && e.preventDefault();
2690
- return;
2691
- }
2692
- r.handle && !jo(c, r.handle, n, !1) || this._prepareDragStart(e, o, s);
2693
- }
2694
- }
2695
- },
2696
- _prepareDragStart: function(e, t, n) {
2697
- var r = this, i = r.el, a = r.options, o = i.ownerDocument, s;
2698
- if (n && !G && n.parentNode === i) {
2699
- var c = H(n);
2700
- if (J = i, G = n, K = G.parentNode, ss = G.nextSibling, cs = n, ms = a.group, Q.dragged = G, vs = {
2701
- target: G,
2702
- clientX: (t || e).clientX,
2703
- clientY: (t || e).clientY
2704
- }, Ss = vs.clientX - c.left, Cs = vs.clientY - c.top, this._lastX = (t || e).clientX, this._lastY = (t || e).clientY, G.style["will-change"] = "all", s = function() {
2705
- U("delayEnded", r, { evt: e }), Q.eventCanceled ? r._onDrop() : (r._disableDelayedDragEvents(), !wo && r.nativeDraggable && (G.draggable = !0), r._triggerDragStart(e, t), W({
2706
- sortable: r,
2707
- name: "choose",
2708
- originalEvent: e
2709
- }), No(G, a.chosenClass, !0));
2710
- }, a.ignore.split(",").forEach(function(e) {
2711
- Fo(G, e.trim(), Js);
2712
- }), z(o, "dragover", Ws), z(o, "mousemove", Ws), z(o, "touchmove", Ws), z(o, "mouseup", r._onDrop), z(o, "touchend", r._onDrop), z(o, "touchcancel", r._onDrop), wo && this.nativeDraggable && (this.options.touchStartThreshold = 4, G.draggable = !0), U("delayStart", this, { evt: e }), a.delay && (!a.delayOnTouchOnly || t) && (!this.nativeDraggable || !(Co || So))) {
2713
- if (Q.eventCanceled) {
2714
- this._onDrop();
2715
- return;
2716
- }
2717
- z(o, "mouseup", r._disableDelayedDrag), z(o, "touchend", r._disableDelayedDrag), z(o, "touchcancel", r._disableDelayedDrag), z(o, "mousemove", r._delayedDragTouchMoveHandler), z(o, "touchmove", r._delayedDragTouchMoveHandler), a.supportPointer && z(o, "pointermove", r._delayedDragTouchMoveHandler), r._dragStartTimer = setTimeout(s, a.delay);
2718
- } else s();
2719
- }
2720
- },
2721
- _delayedDragTouchMoveHandler: function(e) {
2722
- var t = e.touches ? e.touches[0] : e;
2723
- Math.max(Math.abs(t.clientX - this._lastX), Math.abs(t.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
2724
- },
2725
- _disableDelayedDrag: function() {
2726
- G && Js(G), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
2727
- },
2728
- _disableDelayedDragEvents: function() {
2729
- var e = this.el.ownerDocument;
2730
- B(e, "mouseup", this._disableDelayedDrag), B(e, "touchend", this._disableDelayedDrag), B(e, "touchcancel", this._disableDelayedDrag), B(e, "mousemove", this._delayedDragTouchMoveHandler), B(e, "touchmove", this._delayedDragTouchMoveHandler), B(e, "pointermove", this._delayedDragTouchMoveHandler);
2731
- },
2732
- _triggerDragStart: function(e, t) {
2733
- t ||= e.pointerType == "touch" && e, !this.nativeDraggable || t ? this.options.supportPointer ? z(document, "pointermove", this._onTouchMove) : t ? z(document, "touchmove", this._onTouchMove) : z(document, "mousemove", this._onTouchMove) : (z(G, "dragend", this), z(J, "dragstart", this._onDragStart));
2734
- try {
2735
- document.selection ? nc(function() {
2736
- document.selection.empty();
2737
- }) : window.getSelection().removeAllRanges();
2738
- } catch {}
2739
- },
2740
- _dragStarted: function(e, t) {
2741
- if (hs = !1, J && G) {
2742
- U("dragStarted", this, { evt: t }), this.nativeDraggable && z(document, "dragover", Gs);
2743
- var n = this.options;
2744
- !e && No(G, n.dragClass, !1), No(G, n.ghostClass, !0), Q.active = this, e && this._appendGhost(), W({
2745
- sortable: this,
2746
- name: "start",
2747
- originalEvent: t
2748
- });
2749
- } else this._nulling();
2750
- },
2751
- _emulateDragOver: function() {
2752
- if (ys) {
2753
- this._lastX = ys.clientX, this._lastY = ys.clientY, Hs();
2754
- for (var e = document.elementFromPoint(ys.clientX, ys.clientY), t = e; e && e.shadowRoot && (e = e.shadowRoot.elementFromPoint(ys.clientX, ys.clientY), e !== t);) t = e;
2755
- if (G.parentNode[Qo]._isOutsideThisEl(e), t) do {
2756
- if (t[Qo]) {
2757
- var n = void 0;
2758
- if (n = t[Qo]._onDragOver({
2759
- clientX: ys.clientX,
2760
- clientY: ys.clientY,
2761
- target: e,
2762
- rootEl: t
2763
- }), n && !this.options.dragoverBubble) break;
2764
- }
2765
- e = t;
2766
- } while (t = t.parentNode);
2767
- Us();
2768
- }
2769
- },
2770
- _onTouchMove: function(e) {
2771
- if (vs) {
2772
- var t = this.options, n = t.fallbackTolerance, r = t.fallbackOffset, i = e.touches ? e.touches[0] : e, a = q && Po(q, !0), o = q && a && a.a, s = q && a && a.d, c = Ps && Z && Vo(Z), l = (i.clientX - vs.clientX + r.x) / (o || 1) + (c ? c[0] - As[0] : 0) / (o || 1), u = (i.clientY - vs.clientY + r.y) / (s || 1) + (c ? c[1] - As[1] : 0) / (s || 1);
2773
- if (!Q.active && !hs) {
2774
- if (n && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < n) return;
2775
- this._onDragStart(e, !0);
2776
- }
2777
- if (q) {
2778
- a ? (a.e += l - (bs || 0), a.f += u - (xs || 0)) : a = {
2779
- a: 1,
2780
- b: 0,
2781
- c: 0,
2782
- d: 1,
2783
- e: l,
2784
- f: u
2785
- };
2786
- var d = `matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;
2787
- V(q, "webkitTransform", d), V(q, "mozTransform", d), V(q, "msTransform", d), V(q, "transform", d), bs = l, xs = u, ys = i;
2788
- }
2789
- e.cancelable && e.preventDefault();
2790
- }
2791
- },
2792
- _appendGhost: function() {
2793
- if (!q) {
2794
- var e = this.options.fallbackOnBody ? document.body : J, t = H(G, !0, Ps, !0, e), n = this.options;
2795
- if (Ps) {
2796
- for (Z = e; V(Z, "position") === "static" && V(Z, "transform") === "none" && Z !== document;) Z = Z.parentNode;
2797
- Z !== document.body && Z !== document.documentElement ? (Z === document && (Z = Io()), t.top += Z.scrollTop, t.left += Z.scrollLeft) : Z = Io(), As = Vo(Z);
2798
- }
2799
- q = G.cloneNode(!0), No(q, n.ghostClass, !1), No(q, n.fallbackClass, !0), No(q, n.dragClass, !0), V(q, "transition", ""), V(q, "transform", ""), V(q, "box-sizing", "border-box"), V(q, "margin", 0), V(q, "top", t.top), V(q, "left", t.left), V(q, "width", t.width), V(q, "height", t.height), V(q, "opacity", "0.8"), V(q, "position", Ps ? "absolute" : "fixed"), V(q, "zIndex", "100000"), V(q, "pointerEvents", "none"), Q.ghost = q, e.appendChild(q), V(q, "transform-origin", Ss / parseInt(q.style.width) * 100 + "% " + Cs / parseInt(q.style.height) * 100 + "%");
2800
- }
2801
- },
2802
- _onDragStart: function(e, t) {
2803
- var n = this, r = e.dataTransfer, i = n.options;
2804
- U("dragStart", this, { evt: e }), Q.eventCanceled ? this._onDrop() : (U("setupClone", this), Q.eventCanceled || (Y = Xo(G), Y.removeAttribute("id"), Y.draggable = !1, Y.style["will-change"] = "", this._hideClone(), No(Y, this.options.chosenClass, !1), Q.clone = Y), n.cloneId = nc(function() {
2805
- U("clone", n), !Q.eventCanceled && (n.options.removeCloneOnHide || J.insertBefore(Y, G), n._hideClone(), W({
2806
- sortable: n,
2807
- name: "clone"
2808
- }));
2809
- }), !t && No(G, i.dragClass, !0), t ? (gs = !0, n._loopId = setInterval(n._emulateDragOver, 50)) : (B(document, "mouseup", n._onDrop), B(document, "touchend", n._onDrop), B(document, "touchcancel", n._onDrop), r && (r.effectAllowed = "move", i.setData && i.setData.call(n, r, G)), z(document, "drop", n), V(G, "transform", "translateZ(0)")), hs = !0, n._dragStartId = nc(n._dragStarted.bind(n, t, e)), z(document, "selectstart", n), ws = !0, To && V(document.body, "user-select", "none"));
2810
- },
2811
- _onDragOver: function(e) {
2812
- var t = this.el, n = e.target, r, i, a, o = this.options, s = o.group, c = Q.active, l = ms === s, u = o.sort, d = X || c, f, p = this, m = !1;
2813
- if (js) return;
2814
- function h(o, s) {
2815
- U(o, p, mo({
2816
- evt: e,
2817
- isOwner: l,
2818
- axis: f ? "vertical" : "horizontal",
2819
- revert: a,
2820
- dragRect: r,
2821
- targetRect: i,
2822
- canSort: u,
2823
- fromSortable: d,
2824
- target: n,
2825
- completed: _,
2826
- onMove: function(n, i) {
2827
- return qs(J, t, G, r, n, H(n), e, i);
2828
- },
2829
- changed: v
2830
- }, s));
2831
- }
2832
- function g() {
2833
- h("dragOverAnimationCapture"), p.captureAnimationState(), p !== d && d.captureAnimationState();
2834
- }
2835
- function _(r) {
2836
- return h("dragOverCompleted", { insertion: r }), r && (l ? c._hideClone() : c._showClone(p), p !== d && (No(G, X ? X.options.ghostClass : c.options.ghostClass, !1), No(G, o.ghostClass, !0)), X !== p && p !== Q.active ? X = p : p === Q.active && X && (X = null), d === p && (p._ignoreWhileAnimating = n), p.animateAll(function() {
2837
- h("dragOverAnimationComplete"), p._ignoreWhileAnimating = null;
2838
- }), p !== d && (d.animateAll(), d._ignoreWhileAnimating = null)), (n === G && !G.animated || n === t && !n.animated) && (Ts = null), !o.dragoverBubble && !e.rootEl && n !== document && (G.parentNode[Qo]._isOutsideThisEl(e.target), !r && Ws(e)), !o.dragoverBubble && e.stopPropagation && e.stopPropagation(), m = !0;
2839
- }
2840
- function v() {
2841
- ds = Bo(G), ps = Bo(G, o.draggable), W({
2842
- sortable: p,
2843
- name: "change",
2844
- toEl: t,
2845
- newIndex: ds,
2846
- newDraggableIndex: ps,
2847
- originalEvent: e
2848
- });
2849
- }
2850
- if (e.preventDefault !== void 0 && e.cancelable && e.preventDefault(), n = jo(n, o.draggable, t, !0), h("dragOver"), Q.eventCanceled) return m;
2851
- if (G.contains(e.target) || n.animated && n.animatingX && n.animatingY || p._ignoreWhileAnimating === n) return _(!1);
2852
- if (gs = !1, c && !o.disabled && (l ? u || (a = K !== J) : X === this || (this.lastPutMode = ms.checkPull(this, c, G, e)) && s.checkPut(this, c, G, e))) {
2853
- if (f = this._getDirection(e, n) === "vertical", r = H(G), h("dragOverValid"), Q.eventCanceled) return m;
2854
- if (a) return K = J, g(), this._hideClone(), h("revert"), Q.eventCanceled || (ss ? J.insertBefore(G, ss) : J.appendChild(G)), _(!0);
2855
- var y = zo(t, o.draggable);
2856
- if (!y || Zs(e, f, this) && !y.animated) {
2857
- if (y === G) return _(!1);
2858
- if (y && t === e.target && (n = y), n && (i = H(n)), qs(J, t, G, r, n, i, e, !!n) !== !1) return g(), y && y.nextSibling ? t.insertBefore(G, y.nextSibling) : t.appendChild(G), K = t, v(), _(!0);
2859
- } else if (y && Xs(e, f, this)) {
2860
- var b = Ro(t, 0, o, !0);
2861
- if (b === G) return _(!1);
2862
- if (n = b, i = H(n), qs(J, t, G, r, n, i, e, !1) !== !1) return g(), t.insertBefore(G, b), K = t, v(), _(!0);
2863
- } else if (n.parentNode === t) {
2864
- i = H(n);
2865
- var x = 0, S, C = G.parentNode !== t, w = !zs(G.animated && G.toRect || r, n.animated && n.toRect || i, f), T = f ? "top" : "left", E = Lo(n, "top", "top") || Lo(G, "top", "top"), D = E ? E.scrollTop : void 0;
2866
- Ts !== n && (S = i[T], Ds = !1, Os = !w && o.invertSwap || C), x = Qs(e, n, i, f, w ? 1 : o.swapThreshold, o.invertedSwapThreshold == null ? o.swapThreshold : o.invertedSwapThreshold, Os, Ts === n);
2867
- var O;
2868
- if (x !== 0) {
2869
- var k = Bo(G);
2870
- do
2871
- k -= x, O = K.children[k];
2872
- while (O && (V(O, "display") === "none" || O === q));
2873
- }
2874
- if (x === 0 || O === n) return _(!1);
2875
- Ts = n, Es = x;
2876
- var A = n.nextElementSibling, j = !1;
2877
- j = x === 1;
2878
- var M = qs(J, t, G, r, n, i, e, j);
2879
- if (M !== !1) return (M === 1 || M === -1) && (j = M === 1), js = !0, setTimeout(Ys, 30), g(), j && !A ? t.appendChild(G) : n.parentNode.insertBefore(G, j ? A : n), E && Yo(E, 0, D - E.scrollTop), K = G.parentNode, S !== void 0 && !Os && (ks = Math.abs(S - H(n)[T])), v(), _(!0);
2880
- }
2881
- if (t.contains(G)) return _(!1);
2882
- }
2883
- return !1;
2884
- },
2885
- _ignoreWhileAnimating: null,
2886
- _offMoveEvents: function() {
2887
- B(document, "mousemove", this._onTouchMove), B(document, "touchmove", this._onTouchMove), B(document, "pointermove", this._onTouchMove), B(document, "dragover", Ws), B(document, "mousemove", Ws), B(document, "touchmove", Ws);
2888
- },
2889
- _offUpEvents: function() {
2890
- var e = this.el.ownerDocument;
2891
- B(e, "mouseup", this._onDrop), B(e, "touchend", this._onDrop), B(e, "pointerup", this._onDrop), B(e, "touchcancel", this._onDrop), B(document, "selectstart", this);
2892
- },
2893
- _onDrop: function(e) {
2894
- var t = this.el, n = this.options;
2895
- ds = Bo(G), ps = Bo(G, n.draggable), U("drop", this, { evt: e }), K = G && G.parentNode, ds = Bo(G), ps = Bo(G, n.draggable), Q.eventCanceled || (hs = !1, Os = !1, Ds = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), rc(this.cloneId), rc(this._dragStartId), this.nativeDraggable && (B(document, "drop", this), B(t, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), To && V(document.body, "user-select", ""), V(G, "transform", ""), e && (ws && (e.cancelable && e.preventDefault(), !n.dropBubble && e.stopPropagation()), q && q.parentNode && q.parentNode.removeChild(q), (J === K || X && X.lastPutMode !== "clone") && Y && Y.parentNode && Y.parentNode.removeChild(Y), G && (this.nativeDraggable && B(G, "dragend", this), Js(G), G.style["will-change"] = "", ws && !hs && No(G, X ? X.options.ghostClass : this.options.ghostClass, !1), No(G, this.options.chosenClass, !1), W({
2896
- sortable: this,
2897
- name: "unchoose",
2898
- toEl: K,
2899
- newIndex: null,
2900
- newDraggableIndex: null,
2901
- originalEvent: e
2902
- }), J === K ? ds !== us && ds >= 0 && (W({
2903
- sortable: this,
2904
- name: "update",
2905
- toEl: K,
2906
- originalEvent: e
2907
- }), W({
2908
- sortable: this,
2909
- name: "sort",
2910
- toEl: K,
2911
- originalEvent: e
2912
- })) : (ds >= 0 && (W({
2913
- rootEl: K,
2914
- name: "add",
2915
- toEl: K,
2916
- fromEl: J,
2917
- originalEvent: e
2918
- }), W({
2919
- sortable: this,
2920
- name: "remove",
2921
- toEl: K,
2922
- originalEvent: e
2923
- }), W({
2924
- rootEl: K,
2925
- name: "sort",
2926
- toEl: K,
2927
- fromEl: J,
2928
- originalEvent: e
2929
- }), W({
2930
- sortable: this,
2931
- name: "sort",
2932
- toEl: K,
2933
- originalEvent: e
2934
- })), X && X.save()), Q.active && ((ds == null || ds === -1) && (ds = us, ps = fs), W({
2935
- sortable: this,
2936
- name: "end",
2937
- toEl: K,
2938
- originalEvent: e
2939
- }), this.save())))), this._nulling();
2940
- },
2941
- _nulling: function() {
2942
- U("nulling", this), J = G = K = q = ss = Y = cs = ls = vs = ys = ws = ds = ps = us = fs = Ts = Es = X = ms = Q.dragged = Q.ghost = Q.clone = Q.active = null, Ms.forEach(function(e) {
2943
- e.checked = !0;
2944
- }), Ms.length = bs = xs = 0;
2945
- },
2946
- handleEvent: function(e) {
2947
- switch (e.type) {
2948
- case "drop":
2949
- case "dragend":
2950
- this._onDrop(e);
2951
- break;
2952
- case "dragenter":
2953
- case "dragover":
2954
- G && (this._onDragOver(e), Ks(e));
2955
- break;
2956
- case "selectstart": e.preventDefault();
2957
- }
2958
- },
2959
- toArray: function() {
2960
- for (var e = [], t, n = this.el.children, r = 0, i = n.length, a = this.options; r < i; r++) t = n[r], jo(t, a.draggable, this.el, !1) && e.push(t.getAttribute(a.dataIdAttr) || ec(t));
2961
- return e;
2962
- },
2963
- sort: function(e, t) {
2964
- var n = {}, r = this.el;
2965
- this.toArray().forEach(function(e, t) {
2966
- var i = r.children[t];
2967
- jo(i, this.options.draggable, r, !1) && (n[e] = i);
2968
- }, this), t && this.captureAnimationState(), e.forEach(function(e) {
2969
- n[e] && (r.removeChild(n[e]), r.appendChild(n[e]));
2970
- }), t && this.animateAll();
2971
- },
2972
- save: function() {
2973
- var e = this.options.store;
2974
- e && e.set && e.set(this);
2975
- },
2976
- closest: function(e, t) {
2977
- return jo(e, t || this.options.draggable, this.el, !1);
2978
- },
2979
- option: function(e, t) {
2980
- var n = this.options;
2981
- if (t === void 0) return n[e];
2982
- var r = is.modifyOption(this, e, t);
2983
- n[e] = r === void 0 ? t : r, e === "group" && Vs(n);
2984
- },
2985
- destroy: function() {
2986
- U("destroy", this);
2987
- var e = this.el;
2988
- e[Qo] = null, B(e, "mousedown", this._onTapStart), B(e, "touchstart", this._onTapStart), B(e, "pointerdown", this._onTapStart), this.nativeDraggable && (B(e, "dragover", this), B(e, "dragenter", this)), Array.prototype.forEach.call(e.querySelectorAll("[draggable]"), function(e) {
2989
- e.removeAttribute("draggable");
2990
- }), this._onDrop(), this._disableDelayedDragEvents(), _s.splice(_s.indexOf(this.el), 1), this.el = e = null;
2991
- },
2992
- _hideClone: function() {
2993
- if (!ls) {
2994
- if (U("hideClone", this), Q.eventCanceled) return;
2995
- V(Y, "display", "none"), this.options.removeCloneOnHide && Y.parentNode && Y.parentNode.removeChild(Y), ls = !0;
2996
- }
2997
- },
2998
- _showClone: function(e) {
2999
- if (e.lastPutMode !== "clone") this._hideClone();
3000
- else if (ls) {
3001
- if (U("showClone", this), Q.eventCanceled) return;
3002
- G.parentNode == J && !this.options.group.revertClone ? J.insertBefore(Y, G) : ss ? J.insertBefore(Y, ss) : J.appendChild(Y), this.options.group.revertClone && this.animate(G, Y), V(Y, "display", ""), ls = !1;
3003
- }
3004
- }
3005
- };
3006
- function Ks(e) {
3007
- e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault();
3008
- }
3009
- function qs(e, t, n, r, i, a, o, s) {
3010
- var c, l = e[Qo], u = l.options.onMove, d;
3011
- return window.CustomEvent && !So && !Co ? c = new CustomEvent("move", {
3012
- bubbles: !0,
3013
- cancelable: !0
3014
- }) : (c = document.createEvent("Event"), c.initEvent("move", !0, !0)), c.to = t, c.from = e, c.dragged = n, c.draggedRect = r, c.related = i || t, c.relatedRect = a || H(t), c.willInsertAfter = s, c.originalEvent = o, e.dispatchEvent(c), u && (d = u.call(l, c, o)), d;
3015
- }
3016
- function Js(e) {
3017
- e.draggable = !1;
3018
- }
3019
- function Ys() {
3020
- js = !1;
3021
- }
3022
- function Xs(e, t, n) {
3023
- var r = H(Ro(n.el, 0, n.options, !0)), i = Zo(n.el, n.options, q), a = 10;
3024
- return t ? e.clientX < i.left - a || e.clientY < r.top && e.clientX < r.right : e.clientY < i.top - a || e.clientY < r.bottom && e.clientX < r.left;
3025
- }
3026
- function Zs(e, t, n) {
3027
- var r = H(zo(n.el, n.options.draggable)), i = Zo(n.el, n.options, q), a = 10;
3028
- return t ? e.clientX > i.right + a || e.clientY > r.bottom && e.clientX > r.left : e.clientY > i.bottom + a || e.clientX > r.right && e.clientY > r.top;
3029
- }
3030
- function Qs(e, t, n, r, i, a, o, s) {
3031
- var c = r ? e.clientY : e.clientX, l = r ? n.height : n.width, u = r ? n.top : n.left, d = r ? n.bottom : n.right, f = !1;
3032
- if (!o) {
3033
- if (s && ks < l * i) {
3034
- if (!Ds && (Es === 1 ? c > u + l * a / 2 : c < d - l * a / 2) && (Ds = !0), Ds) f = !0;
3035
- else if (Es === 1 ? c < u + ks : c > d - ks) return -Es;
3036
- } else if (c > u + l * (1 - i) / 2 && c < d - l * (1 - i) / 2) return $s(t);
3037
- }
3038
- return f ||= o, f && (c < u + l * a / 2 || c > d - l * a / 2) ? c > u + l / 2 ? 1 : -1 : 0;
3039
- }
3040
- function $s(e) {
3041
- return Bo(G) < Bo(e) ? 1 : -1;
3042
- }
3043
- function ec(e) {
3044
- for (var t = e.tagName + e.className + e.src + e.href + e.textContent, n = t.length, r = 0; n--;) r += t.charCodeAt(n);
3045
- return r.toString(36);
3046
- }
3047
- function tc(e) {
3048
- Ms.length = 0;
3049
- for (var t = e.getElementsByTagName("input"), n = t.length; n--;) {
3050
- var r = t[n];
3051
- r.checked && Ms.push(r);
3052
- }
3053
- }
3054
- function nc(e) {
3055
- return setTimeout(e, 0);
3056
- }
3057
- function rc(e) {
3058
- return clearTimeout(e);
3059
- }
3060
- Ns && z(document, "touchmove", function(e) {
3061
- (Q.active || hs) && e.cancelable && e.preventDefault();
3062
- }), Q.utils = {
3063
- on: z,
3064
- off: B,
3065
- css: V,
3066
- find: Fo,
3067
- is: function(e, t) {
3068
- return !!jo(e, t, e, !1);
3069
- },
3070
- extend: Wo,
3071
- throttle: qo,
3072
- closest: jo,
3073
- toggleClass: No,
3074
- clone: Xo,
3075
- index: Bo,
3076
- nextTick: nc,
3077
- cancelNextTick: rc,
3078
- detectDirection: Rs,
3079
- getChild: Ro
3080
- }, Q.get = function(e) {
3081
- return e[Qo];
3082
- }, Q.mount = function() {
3083
- var e = [...arguments];
3084
- e[0].constructor === Array && (e = e[0]), e.forEach(function(e) {
3085
- if (!e.prototype || !e.prototype.constructor) throw `Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;
3086
- e.utils && (Q.utils = mo(mo({}, Q.utils), e.utils)), is.mount(e);
3087
- });
3088
- }, Q.create = function(e, t) {
3089
- return new Q(e, t);
3090
- }, Q.version = bo;
3091
- var $ = [], ic, ac, oc = !1, sc, cc, lc, uc;
3092
- function dc() {
3093
- function e() {
3094
- for (var e in this.defaults = {
3095
- scroll: !0,
3096
- forceAutoScrollFallback: !1,
3097
- scrollSensitivity: 30,
3098
- scrollSpeed: 10,
3099
- bubbleScroll: !0
3100
- }, this) e.charAt(0) === "_" && typeof this[e] == "function" && (this[e] = this[e].bind(this));
3101
- }
3102
- return e.prototype = {
3103
- dragStarted: function(e) {
3104
- var t = e.originalEvent;
3105
- this.sortable.nativeDraggable ? z(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? z(document, "pointermove", this._handleFallbackAutoScroll) : t.touches ? z(document, "touchmove", this._handleFallbackAutoScroll) : z(document, "mousemove", this._handleFallbackAutoScroll);
3106
- },
3107
- dragOverCompleted: function(e) {
3108
- var t = e.originalEvent;
3109
- !this.options.dragOverBubble && !t.rootEl && this._handleAutoScroll(t);
3110
- },
3111
- drop: function() {
3112
- this.sortable.nativeDraggable ? B(document, "dragover", this._handleAutoScroll) : (B(document, "pointermove", this._handleFallbackAutoScroll), B(document, "touchmove", this._handleFallbackAutoScroll), B(document, "mousemove", this._handleFallbackAutoScroll)), pc(), fc(), Jo();
3113
- },
3114
- nulling: function() {
3115
- lc = ac = ic = oc = uc = sc = cc = null, $.length = 0;
3116
- },
3117
- _handleFallbackAutoScroll: function(e) {
3118
- this._handleAutoScroll(e, !0);
3119
- },
3120
- _handleAutoScroll: function(e, t) {
3121
- var n = this, r = (e.touches ? e.touches[0] : e).clientX, i = (e.touches ? e.touches[0] : e).clientY, a = document.elementFromPoint(r, i);
3122
- if (lc = e, t || this.options.forceAutoScrollFallback || Co || So || To) {
3123
- mc(e, this.options, a, t);
3124
- var o = Uo(a, !0);
3125
- oc && (!uc || r !== sc || i !== cc) && (uc && pc(), uc = setInterval(function() {
3126
- var a = Uo(document.elementFromPoint(r, i), !0);
3127
- a !== o && (o = a, fc()), mc(e, n.options, a, t);
3128
- }, 10), sc = r, cc = i);
3129
- } else {
3130
- if (!this.options.bubbleScroll || Uo(a, !0) === Io()) {
3131
- fc();
3132
- return;
3133
- }
3134
- mc(e, this.options, Uo(a, !1), !1);
3135
- }
3136
- }
3137
- }, _o(e, {
3138
- pluginName: "scroll",
3139
- initializeByDefault: !0
3140
- });
3141
- }
3142
- function fc() {
3143
- $.forEach(function(e) {
3144
- clearInterval(e.pid);
3145
- }), $ = [];
3146
- }
3147
- function pc() {
3148
- clearInterval(uc);
3149
- }
3150
- var mc = qo(function(e, t, n, r) {
3151
- if (t.scroll) {
3152
- var i = (e.touches ? e.touches[0] : e).clientX, a = (e.touches ? e.touches[0] : e).clientY, o = t.scrollSensitivity, s = t.scrollSpeed, c = Io(), l = !1, u;
3153
- ac !== n && (ac = n, fc(), ic = t.scroll, u = t.scrollFn, ic === !0 && (ic = Uo(n, !0)));
3154
- var d = 0, f = ic;
3155
- do {
3156
- var p = f, m = H(p), h = m.top, g = m.bottom, _ = m.left, v = m.right, y = m.width, b = m.height, x = void 0, S = void 0, C = p.scrollWidth, w = p.scrollHeight, T = V(p), E = p.scrollLeft, D = p.scrollTop;
3157
- p === c ? (x = y < C && (T.overflowX === "auto" || T.overflowX === "scroll" || T.overflowX === "visible"), S = b < w && (T.overflowY === "auto" || T.overflowY === "scroll" || T.overflowY === "visible")) : (x = y < C && (T.overflowX === "auto" || T.overflowX === "scroll"), S = b < w && (T.overflowY === "auto" || T.overflowY === "scroll"));
3158
- var O = x && (Math.abs(v - i) <= o && E + y < C) - (Math.abs(_ - i) <= o && !!E), k = S && (Math.abs(g - a) <= o && D + b < w) - (Math.abs(h - a) <= o && !!D);
3159
- if (!$[d]) for (var A = 0; A <= d; A++) $[A] || ($[A] = {});
3160
- ($[d].vx != O || $[d].vy != k || $[d].el !== p) && ($[d].el = p, $[d].vx = O, $[d].vy = k, clearInterval($[d].pid), (O != 0 || k != 0) && (l = !0, $[d].pid = setInterval(function() {
3161
- r && this.layer === 0 && Q.active._onTouchMove(lc);
3162
- var t = $[this.layer].vy ? $[this.layer].vy * s : 0, n = $[this.layer].vx ? $[this.layer].vx * s : 0;
3163
- typeof u == "function" && u.call(Q.dragged.parentNode[Qo], n, t, e, lc, $[this.layer].el) !== "continue" || Yo($[this.layer].el, n, t);
3164
- }.bind({ layer: d }), 24))), d++;
3165
- } while (t.bubbleScroll && f !== c && (f = Uo(f, !1)));
3166
- oc = l;
3167
- }
3168
- }, 30), hc = function(e) {
3169
- var t = e.originalEvent, n = e.putSortable, r = e.dragEl, i = e.activeSortable, a = e.dispatchSortableEvent, o = e.hideGhostForTarget, s = e.unhideGhostForTarget;
3170
- if (t) {
3171
- var c = n || i;
3172
- o();
3173
- var l = t.changedTouches && t.changedTouches.length ? t.changedTouches[0] : t, u = document.elementFromPoint(l.clientX, l.clientY);
3174
- s(), c && !c.el.contains(u) && (a("spill"), this.onSpill({
3175
- dragEl: r,
3176
- putSortable: n
3177
- }));
3178
- }
3179
- };
3180
- function gc() {}
3181
- gc.prototype = {
3182
- startIndex: null,
3183
- dragStart: function(e) {
3184
- var t = e.oldDraggableIndex;
3185
- this.startIndex = t;
3186
- },
3187
- onSpill: function(e) {
3188
- var t = e.dragEl, n = e.putSortable;
3189
- this.sortable.captureAnimationState(), n && n.captureAnimationState();
3190
- var r = Ro(this.sortable.el, this.startIndex, this.options);
3191
- r ? this.sortable.el.insertBefore(t, r) : this.sortable.el.appendChild(t), this.sortable.animateAll(), n && n.animateAll();
3192
- },
3193
- drop: hc
3194
- }, _o(gc, { pluginName: "revertOnSpill" });
3195
- function _c() {}
3196
- _c.prototype = {
3197
- onSpill: function(e) {
3198
- var t = e.dragEl, n = e.putSortable || this.sortable;
3199
- n.captureAnimationState(), t.parentNode && t.parentNode.removeChild(t), n.animateAll();
3200
- },
3201
- drop: hc
3202
- }, _o(_c, { pluginName: "removeOnSpill" }), Q.mount(new dc()), Q.mount(_c, gc);
3203
- function vc(e) {
3204
- return e == null ? e : JSON.parse(JSON.stringify(e));
3205
- }
3206
- function yc(e) {
3207
- b() && t(e);
3208
- }
3209
- function bc(e) {
3210
- b() ? O(e) : r(e);
3211
- }
3212
- var xc = null, Sc = null;
3213
- function Cc(e = null, t = null) {
3214
- xc = e, Sc = t;
3215
- }
3216
- function wc() {
3217
- return {
3218
- data: xc,
3219
- clonedData: Sc
3220
- };
3221
- }
3222
- var Tc = Symbol("cloneElement");
3223
- function Ec(...e) {
3224
- let t = b()?.proxy, n = null, i = e[0], [, a, s] = e;
3225
- Array.isArray(M(a)) || (s = a, a = null);
3226
- let c = null, { immediate: l = !0, clone: u = vc, forceFallback: d, fallbackOnBody: f, customUpdate: p } = M(s) ?? {};
3227
- function m(e) {
3228
- let { from: t, oldIndex: r, item: i } = e, o = Array.from(t.childNodes);
3229
- n = d && !f ? o.slice(0, -1) : o;
3230
- let s = M(M(a)?.[r]), c = u(s);
3231
- Cc(s, c), i[Tc] = c;
3232
- }
3233
- function h(e) {
3234
- let t = e.item[Tc];
3235
- if (!to(t)) {
3236
- if (io(e.item), o(a)) {
3237
- let n = [...M(a)];
3238
- a.value = eo(n, e.newDraggableIndex, t);
3239
- return;
3240
- }
3241
- eo(M(a), e.newDraggableIndex, t);
3242
- }
3243
- }
3244
- function g(e) {
3245
- let { from: t, item: n, oldIndex: r, oldDraggableIndex: i, pullMode: s, clone: c } = e;
3246
- if (ro(t, n, r), s === "clone") io(c);
3247
- else if (o(a)) {
3248
- let e = [...M(a)];
3249
- a.value = $a(e, i);
3250
- } else $a(M(a), i);
3251
- }
3252
- function _(e) {
3253
- if (p) {
3254
- p(e);
3255
- return;
3256
- }
3257
- let { from: t, item: n, oldIndex: r, oldDraggableIndex: i, newDraggableIndex: s } = e;
3258
- if (io(n), ro(t, n, r), o(a)) {
3259
- let e = [...M(a)];
3260
- a.value = Xa(e, i, s);
3261
- } else Xa(M(a), i, s);
3262
- }
3263
- function v(e) {
3264
- let { newIndex: t, oldIndex: i, from: a, to: o } = e, s = null, c = t === i && a === o;
3265
- try {
3266
- if (c) {
3267
- let e = null;
3268
- n?.some((t, r) => {
3269
- if (e && n?.length !== o.childNodes.length) return a.insertBefore(e, t.nextSibling), !0;
3270
- let i = o.childNodes[r];
3271
- e = o?.replaceChild(t, i);
3272
- });
3273
- }
3274
- } catch (e) {
3275
- s = e;
3276
- } finally {
3277
- n = null;
3278
- }
3279
- r(() => {
3280
- if (Cc(), s) throw s;
3281
- });
3282
- }
3283
- let y = {
3284
- onUpdate: _,
3285
- onStart: m,
3286
- onAdd: h,
3287
- onRemove: g,
3288
- onEnd: v
3289
- };
3290
- function x(e) {
3291
- let n = M(i);
3292
- return e ||= no(n) ? ao(n, t?.$el) : n, e && !co(e) && (e = e.$el), e || Ya("Root element not found"), e;
3293
- }
3294
- function S() {
3295
- let e = M(s) ?? {}, { immediate: t, clone: n } = e, r = Ka(e, ["immediate", "clone"]);
3296
- return lo(r, (e, t) => {
3297
- uo(e) && (r[e] = (e, ...n) => (fo(e, wc()), t(e, ...n)));
3298
- }), so(a === null ? {} : y, r);
3299
- }
3300
- let C = (e) => {
3301
- e = x(e), c && w.destroy(), c = new Q(e, S());
3302
- };
3303
- I(() => s, () => {
3304
- c && lo(S(), (e, t) => {
3305
- c?.option(e, t);
3306
- });
3307
- }, { deep: !0 });
3308
- let w = {
3309
- option: (e, t) => c?.option(e, t),
3310
- destroy: () => {
3311
- c?.destroy(), c = null;
3312
- },
3313
- save: () => c?.save(),
3314
- toArray: () => c?.toArray(),
3315
- closest: (...e) => c?.closest(...e)
3316
- };
3317
- return bc(() => {
3318
- l && C();
3319
- }), yc(w.destroy), Ga({
3320
- start: C,
3321
- pause: () => w?.option("disabled", !0),
3322
- resume: () => w?.option("disabled", !1)
3323
- }, w);
3324
- }
3325
- var Dc = [
3326
- "update",
3327
- "start",
3328
- "add",
3329
- "remove",
3330
- "choose",
3331
- "unchoose",
3332
- "end",
3333
- "sort",
3334
- "filter",
3335
- "clone",
3336
- "move",
3337
- "change"
3338
- ], Oc = [
3339
- "clone",
3340
- "animation",
3341
- "ghostClass",
3342
- "group",
3343
- "sort",
3344
- "disabled",
3345
- "store",
3346
- "handle",
3347
- "draggable",
3348
- "swapThreshold",
3349
- "invertSwap",
3350
- "invertedSwapThreshold",
3351
- "removeCloneOnHide",
3352
- "direction",
3353
- "chosenClass",
3354
- "dragClass",
3355
- "ignore",
3356
- "filter",
3357
- "preventOnFilter",
3358
- "easing",
3359
- "setData",
3360
- "dropBubble",
3361
- "dragoverBubble",
3362
- "dataIdAttr",
3363
- "delay",
3364
- "delayOnTouchOnly",
3365
- "touchStartThreshold",
3366
- "forceFallback",
3367
- "fallbackClass",
3368
- "fallbackOnBody",
3369
- "fallbackTolerance",
3370
- "fallbackOffset",
3371
- "supportPointer",
3372
- "emptyInsertThreshold",
3373
- "scroll",
3374
- "forceAutoScrollFallback",
3375
- "scrollSensitivity",
3376
- "scrollSpeed",
3377
- "bubbleScroll",
3378
- "modelValue",
3379
- "tag",
3380
- "target",
3381
- "customUpdate",
3382
- ...Dc.map((e) => `on${e.replace(/^\S/, (e) => e.toUpperCase())}`)
3383
- ], kc = F({
3384
- name: "VueDraggable",
3385
- model: {
3386
- prop: "modelValue",
3387
- event: "update:modelValue"
3388
- },
3389
- props: Oc,
3390
- emits: ["update:modelValue", ...Dc],
3391
- setup(t, { slots: n, emit: r, expose: i, attrs: a }) {
3392
- let o = Dc.reduce((e, t) => {
3393
- let n = `on${t.replace(/^\S/, (e) => e.toUpperCase())}`;
3394
- return e[n] = (...e) => r(t, ...e), e;
3395
- }, {}), s = x(() => {
3396
- let e = T(t), { modelValue: n } = e, r = Ka(e, ["modelValue"]), i = Object.entries(r).reduce((e, [t, n]) => {
3397
- let r = M(n);
3398
- return r !== void 0 && (e[t] = r), e;
3399
- }, {});
3400
- return Ga(Ga({}, o), Qa(Ga(Ga({}, a), i)));
3401
- }), c = x({
3402
- get: () => t.modelValue,
3403
- set: (e) => r("update:modelValue", e)
3404
- }), l = e(), u = _(Ec(t.target || l, c, s));
3405
- return i(u), () => P(t.tag || "div", { ref: l }, (n?.default)?.call(n, u));
3406
- }
3407
- }), Ac = {
3408
- mounted: "mounted",
3409
- unmounted: "unmounted"
3410
- };
3411
- Ac.mounted, Ac.unmounted;
3412
- // src/components/blocks/SectionBlock.vue?vue&type=script&setup=true&lang.ts
3413
- var jc = { class: "tpl:relative tpl:w-full" }, Mc = {
3414
- key: 0,
3415
- "data-testid": "hero-image-hint",
3416
- class: "tpl:pointer-events-none tpl:absolute tpl:inset-x-0 tpl:bottom-full tpl:mb-2 tpl:flex tpl:justify-center tpl:text-xs tpl:text-[var(--tpl-chrome-text-dim)]"
3417
- }, Nc = {
3418
- key: 0,
3419
- "data-testid": "section-drop-hint",
3420
- class: "tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:text-xs tpl:text-[var(--tpl-chrome-text-dim)]"
3421
- }, Pc = /* @__PURE__ */ F({
3422
- __name: "SectionBlock",
3423
- props: {
3424
- block: {},
3425
- viewport: {}
3426
- },
3427
- setup(t) {
3428
- let r = {
3429
- title: Ma,
3430
- paragraph: _a,
3431
- image: ua,
3432
- button: li,
3433
- divider: Ki,
3434
- custom: Wi
3435
- }, o = t, { t: s } = jn(), c = It(mn, "SectionBlock"), f = n(pn, null), p = n(Tn, null), h = n(vn, {}), g = n(wn, null);
3436
- function _(e) {
3437
- let t = h.savedBlocks;
3438
- t?.isPicking.value ? t.togglePick(o.block.id) : c.selectBlock(e);
3439
- }
3440
- let y = x(() => {
3441
- switch (o.block.columns) {
3442
- case "2": return ["50%", "50%"];
3443
- case "3": return [
3444
- "33.33%",
3445
- "33.33%",
3446
- "33.33%"
3447
- ];
3448
- case "1-2": return ["33.33%", "66.67%"];
3449
- case "2-1": return ["66.67%", "33.33%"];
3450
- default: return ["100%"];
3451
- }
3452
- }), b = x(() => {
3453
- let e = y.value.length, t = [...o.block.children];
3454
- for (; t.length < e;) t.push([]);
3455
- return t.slice(0, e);
3456
- }), w = x(() => o.viewport === "mobile" && o.block.stackOnMobile !== !1);
3457
- function T(e) {
3458
- return b.value[e] || [];
3459
- }
3460
- function O(e) {
3461
- return g?.value === !1 || !f?.isHidden(e);
3462
- }
3463
- function A(e) {
3464
- return !T(e).some((e) => O(e.id));
3465
- }
3466
- let ee = e(null);
3467
- function te(e) {
3468
- return c.state.previewMode ? !1 : A(e) ? !0 : ee.value === e && T(e).filter((e) => O(e.id)).length <= 1;
3469
- }
3470
- let P = x(() => {
3471
- if (c.state.previewMode) return !1;
3472
- let e = $e(o.block);
3473
- return e !== null && !e.applied && e.reason === "image";
3474
- });
3475
- function F(e) {
3476
- return T(e).length === 0 && !c.state.previewMode;
3477
- }
3478
- function I(e) {
3479
- return T(e).length === 0 && c.state.previewMode;
3480
- }
3481
- function L(e, t) {
3482
- let n = t.map((e) => JSON.parse(JSON.stringify(e))), r = [...o.block.children];
3483
- for (; r.length <= e;) r.push([]);
3484
- r[e] = n, c.updateBlock(o.block.id, { children: r });
3485
- }
3486
- function re(e) {
3487
- return qr(e, p, r);
3488
- }
3489
- function ie(e, t) {
3490
- e.type === "custom" && c.updateBlock(e.id, {
3491
- fieldValues: t.fieldValues,
3492
- dataSourceFetched: t.dataSourceFetched
3493
- });
3494
- }
3495
- return (e, n) => (E(), C("div", jc, [P.value ? (E(), C("div", Mc, [k("span", null, d(M(s).section.heroAddImage), 1)])) : S("", !0), k("div", { class: D(["tpl:flex tpl:gap-0", { "tpl:flex-col": w.value }]) }, [(E(!0), C(j, null, u(b.value, (e, r) => (E(), C("div", {
3496
- key: r,
3497
- class: D(["tpl:relative tpl:flex tpl:flex-col tpl:rounded", F(r) ? "tpl:border tpl:border-dashed tpl:border-[var(--tpl-border)]" : ""]),
3498
- style: l({ width: w.value ? "100%" : y.value[r] })
3499
- }, [v(M(kc), {
3500
- "model-value": T(r),
3501
- group: {
3502
- name: "blocks",
3503
- pull: !0,
3504
- put: (e, t, n) => M(za)(n)
3505
- },
3506
- animation: 150,
3507
- "ghost-class": "tpl-ghost",
3508
- "drag-class": "tpl-dragging",
3509
- handle: ".tpl-block-btn",
3510
- "invert-swap": !0,
3511
- "inverted-swap-threshold": .65,
3512
- "empty-insert-threshold": 20,
3513
- "force-fallback": !0,
3514
- class: D(["tpl:grow", {
3515
- "tpl:min-h-[60px]": te(r),
3516
- "tpl:min-h-[34px]": I(r)
3517
- }]),
3518
- onStart: (e) => ee.value = r,
3519
- onEnd: n[0] ||= (e) => ee.value = null,
3520
- "onUpdate:modelValue": (e) => L(r, e)
3521
- }, {
3522
- default: i(() => [(E(!0), C(j, null, u(T(r), (e) => m((E(), C("div", { key: e.id }, [v(Aa, {
3523
- block: e,
3524
- "is-selected": M(c).state.selectedBlockId === e.id,
3525
- viewport: t.viewport,
3526
- "preview-mode": M(c).state.previewMode,
3527
- nested: "",
3528
- onSelect: (t) => _(e.id)
3529
- }, {
3530
- default: i(() => [(E(), N(a(re(e)), {
3531
- block: e,
3532
- viewport: t.viewport,
3533
- onFetchData: (t) => ie(e, t),
3534
- onUpdate: (t) => M(c).updateBlock(e.id, t)
3535
- }, null, 40, [
3536
- "block",
3537
- "viewport",
3538
- "onFetchData",
3539
- "onUpdate"
3540
- ]))]),
3541
- _: 2
3542
- }, 1032, [
3543
- "block",
3544
- "is-selected",
3545
- "viewport",
3546
- "preview-mode",
3547
- "onSelect"
3548
- ])])), [[ne, O(e.id)]])), 128))]),
3549
- _: 2
3550
- }, 1032, [
3551
- "model-value",
3552
- "group",
3553
- "class",
3554
- "onStart",
3555
- "onUpdate:modelValue"
3556
- ]), F(r) ? (E(), C("div", Nc, [k("span", null, d(M(s).section.dropHere), 1)])) : S("", !0)], 6))), 128))], 2)]));
3557
- }
3558
- }), Fc = ["width", "height"], Ic = [
3559
- "d",
3560
- "stroke",
3561
- "stroke-opacity",
3562
- "stroke-width"
3563
- ], Lc = ["d", "fill"], Rc = /* @__PURE__ */ F({
3564
- __name: "SocialIconSvg",
3565
- props: {
3566
- platform: {},
3567
- iconStyle: {},
3568
- iconTone: {},
3569
- iconSize: {}
3570
- },
3571
- setup(e) {
3572
- let t = e, n = x(() => St[t.platform]), r = x(() => Ct[t.iconSize]), i = x(() => ce(t.platform, t.iconTone)), a = x(() => De(t.iconStyle, t.iconTone)), o = x(() => {
3573
- let e = {
3574
- display: "inline-flex",
3575
- alignItems: "center",
3576
- justifyContent: "center",
3577
- width: `${r.value}px`,
3578
- height: `${r.value}px`
3579
- }, n = i.value.fill;
3580
- switch (t.iconStyle) {
3581
- case "solid": return {
3582
- ...e,
3583
- backgroundColor: n,
3584
- borderRadius: "4px"
3585
- };
3586
- case "outlined": return {
3587
- ...e,
3588
- backgroundColor: "transparent",
3589
- border: `2px solid ${n}`,
3590
- borderRadius: "4px",
3591
- ...a.value && { boxShadow: u(a.value) }
3592
- };
3593
- case "rounded": return {
3594
- ...e,
3595
- backgroundColor: n,
3596
- borderRadius: "8px"
3597
- };
3598
- case "square": return {
3599
- ...e,
3600
- backgroundColor: n,
3601
- borderRadius: "0"
3602
- };
3603
- case "circle": return {
3604
- ...e,
3605
- backgroundColor: n,
3606
- borderRadius: "50%"
3607
- };
3608
- default: return e;
3609
- }
3610
- }), s = x(() => tt(t.iconStyle)), c = x(() => Math.floor(r.value * s.value));
3611
- function u(e) {
3612
- let t = `${e.width / 2 * r.value / 24}px`, n = Math.round(e.opacity * 255).toString(16).padStart(2, "0"), i = `${e.color}${n}`;
3613
- return `0 0 0 ${t} ${i}, inset 0 0 0 ${t} ${i}`;
3614
- }
3615
- let d = x(() => t.iconStyle === "outlined" || t.iconStyle === "plain" ? i.value.fill : i.value.onFill);
3616
- return (e, t) => (E(), C("span", { style: l(o.value) }, [(E(), C("svg", {
3617
- width: c.value,
3618
- height: c.value,
3619
- viewBox: "0 0 24 24",
3620
- overflow: "visible",
3621
- xmlns: "http://www.w3.org/2000/svg"
3622
- }, [a.value ? (E(), C("path", {
3623
- key: 0,
3624
- "data-testid": "social-icon-halo",
3625
- d: n.value.path,
3626
- fill: "none",
3627
- stroke: a.value.color,
3628
- "stroke-opacity": a.value.opacity,
3629
- "stroke-width": a.value.width / s.value,
3630
- "stroke-linejoin": "round"
3631
- }, null, 8, Ic)) : S("", !0), k("path", {
3632
- d: n.value.path,
3633
- fill: d.value
3634
- }, null, 8, Lc)], 8, Fc))], 4));
3635
- }
3636
- }), zc = { class: "tpl:w-full" }, Bc = ["href"], Vc = {
3637
- key: 1,
3638
- class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
3639
- }, Hc = /* @__PURE__ */ F({
3640
- __name: "SocialIconsBlock",
3641
- props: {
3642
- block: {},
3643
- viewport: {}
3644
- },
3645
- setup(e) {
3646
- let t = e, { t: n } = jn(), r = x(() => ({
3647
- display: "flex",
3648
- flexWrap: "wrap",
3649
- gap: `${t.block.spacing}px`,
3650
- justifyContent: t.block.align === "left" ? "flex-start" : t.block.align === "right" ? "flex-end" : "center"
3651
- })), i = x(() => t.block.icons.length > 0);
3652
- return (t, a) => (E(), C("div", zc, [i.value ? (E(), C("div", {
3653
- key: 0,
3654
- style: l(r.value)
3655
- }, [(E(!0), C(j, null, u(e.block.icons, (t) => (E(), C("a", {
3656
- key: t.id,
3657
- href: t.url || "#",
3658
- class: "tpl:cursor-default",
3659
- onClick: a[0] ||= L(() => {}, ["prevent"])
3660
- }, [v(Rc, {
3661
- platform: t.platform,
3662
- "icon-style": e.block.iconStyle,
3663
- "icon-tone": e.block.iconTone,
3664
- "icon-size": e.block.iconSize
3665
- }, null, 8, [
3666
- "platform",
3667
- "icon-style",
3668
- "icon-tone",
3669
- "icon-size"
3670
- ])], 8, Bc))), 128))], 4)) : (E(), C("div", Vc, [v(M(wt), { size: 16 }), k("span", null, d(M(n).social.addIcons), 1)]))]));
3671
- }
3672
- }), Uc = { class: "tpl:w-full" }, Wc = {
3673
- key: 0,
3674
- class: "tpl:absolute tpl:rounded tpl:px-2 tpl:py-0.5 tpl:text-[10px] tpl:font-medium",
3675
- style: {
3676
- "background-color": "var(--tpl-bg-hover)",
3677
- color: "var(--tpl-text-dim)"
3678
- }
3679
- }, Gc = /* @__PURE__ */ F({
3680
- __name: "SpacerBlock",
3681
- props: {
3682
- block: {},
3683
- viewport: {}
3684
- },
3685
- setup(e) {
3686
- let t = e, n = It(mn, "SpacerBlock"), r = x(() => ({
3687
- height: `${t.block.height}px`,
3688
- minHeight: `${t.block.height}px`,
3689
- ...n.state.previewMode ? {} : { borderColor: "var(--tpl-border)" }
3690
- }));
3691
- return (t, i) => (E(), C("div", Uc, [k("div", {
3692
- style: l(r.value),
3693
- class: D(["tpl:relative tpl:flex tpl:items-center tpl:justify-center", { "tpl:box-border tpl:border-y tpl:border-x-0 tpl:border-dashed": !M(n).state.previewMode }])
3694
- }, [M(n).state.previewMode ? S("", !0) : (E(), C("span", Wc, d(e.block.height) + "px ", 1))], 6)]));
3695
- }
3696
- }), Kc = { class: "tpl:w-full" }, qc = { key: 0 }, Jc = [
3697
- "aria-label",
3698
- "data-placeholder",
3699
- "onBlur"
3700
- ], Yc = [
3701
- "aria-label",
3702
- "data-placeholder",
3703
- "onBlur"
3704
- ], Xc = {
3705
- key: 1,
3706
- class: "tpl:flex tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border tpl:border-dashed tpl:py-4 tpl:text-sm tpl:border-[var(--tpl-border)] tpl:text-[var(--tpl-text-dim)]"
3707
- }, Zc = /*#__PURE__*/ qn(/* @__PURE__ */ F({
3708
- __name: "TableBlock",
3709
- props: {
3710
- block: {},
3711
- viewport: {}
3712
- },
3713
- setup(e) {
3714
- let t = {
3715
- mounted(e, t) {
3716
- e.textContent = t.value ?? "";
3717
- },
3718
- updated(e, t) {
3719
- t.value !== t.oldValue && e.getRootNode().activeElement !== e && (e.textContent = t.value ?? "");
3720
- }
3721
- }, n = e, { t: r } = jn(), i = It(mn, "TableBlock"), a = It(En, "TableBlock"), o = x(() => n.block.rows.length > 0), s = x(() => {
3722
- let e = {
3723
- width: "100%",
3724
- borderCollapse: "collapse",
3725
- fontSize: `${n.block.fontSize}px`,
3726
- textAlign: n.block.textAlign,
3727
- fontFamily: n.block.fontFamily ? a.resolveFontFamily(n.block.fontFamily) : "inherit"
3728
- };
3729
- return n.block.color && (e.color = n.block.color), e;
3730
- }), c = x(() => ({
3731
- border: `${n.block.borderWidth}px solid ${n.block.borderColor}`,
3732
- padding: `${n.block.cellPadding}px`,
3733
- textAlign: n.block.textAlign
3734
- })), f = x(() => ({
3735
- ...c.value,
3736
- fontWeight: "bold",
3737
- backgroundColor: n.block.headerBackgroundColor || "transparent"
3738
- })), p = x(() => n.block.hasHeaderRow && n.block.rows.length > 0 ? n.block.rows[0] : null), h = x(() => n.block.hasHeaderRow ? n.block.rows.slice(1) : n.block.rows);
3739
- function g() {
3740
- i.selectBlock(n.block.id);
3741
- }
3742
- function _(e, t, r) {
3743
- let a = r.target.innerText.trim(), o = n.block.rows.map((n) => n.id === e ? {
3744
- ...n,
3745
- cells: n.cells.map((e) => e.id === t ? {
3746
- ...e,
3747
- content: a
3748
- } : e)
3749
- } : n);
3750
- i.updateBlock(n.block.id, { rows: o });
3751
- }
3752
- return (e, n) => (E(), C("div", Kc, [o.value ? (E(), C("table", {
3753
- key: 0,
3754
- style: l(s.value),
3755
- class: "tpl-table-editable"
3756
- }, [p.value ? (E(), C("thead", qc, [k("tr", null, [(E(!0), C(j, null, u(p.value.cells, (e) => m((E(), C("th", {
3757
- key: e.id,
3758
- style: l(f.value),
3759
- "aria-label": M(r).table.cellPlaceholder,
3760
- contenteditable: "true",
3761
- "data-placeholder": M(r).table.cellPlaceholder,
3762
- onBlur: (t) => _(p.value.id, e.id, t),
3763
- onKeydown: n[0] ||= re(L((e) => e.target.blur(), ["prevent"]), ["enter"]),
3764
- onClick: L(g, ["stop"])
3765
- }, null, 44, Jc)), [[t, e.content]])), 128))])])) : S("", !0), k("tbody", null, [(E(!0), C(j, null, u(h.value, (e) => (E(), C("tr", { key: e.id }, [(E(!0), C(j, null, u(e.cells, (i) => m((E(), C("td", {
3766
- key: i.id,
3767
- style: l(c.value),
3768
- "aria-label": M(r).table.cellPlaceholder,
3769
- contenteditable: "true",
3770
- "data-placeholder": M(r).table.cellPlaceholder,
3771
- onBlur: (t) => _(e.id, i.id, t),
3772
- onKeydown: n[1] ||= re(L((e) => e.target.blur(), ["prevent"]), ["enter"]),
3773
- onClick: L(g, ["stop"])
3774
- }, null, 44, Yc)), [[t, i.content]])), 128))]))), 128))])], 4)) : (E(), C("div", Xc, [v(M(ht), { size: 16 }), k("span", null, d(M(r).table.empty), 1)]))]));
3775
- }
3776
- }), [["__scopeId", "data-v-6751d456"]]), Qc = /* @__PURE__ */ F({
3777
- __name: "VideoPlayButton",
3778
- props: { hoverEffect: {
3779
- type: Boolean,
3780
- default: !1
3781
- } },
3782
- setup(e) {
3783
- return (t, n) => (E(), C("div", { class: D(["tpl:absolute tpl:inset-0 tpl:flex tpl:items-center tpl:justify-center tpl:bg-black/30", e.hoverEffect && "tpl:transition-opacity tpl:group-hover:bg-black/40"]) }, [...n[0] ||= [k("div", { class: "tpl:flex tpl:size-16 tpl:items-center tpl:justify-center tpl:rounded-full tpl:bg-[color-mix(in_srgb,var(--tpl-bg)_90%,transparent)] tpl:shadow-[var(--tpl-shadow-lg)]" }, [k("svg", {
3784
- class: "tpl:ml-1 tpl:text-[var(--tpl-danger)]",
3785
- width: "28",
3786
- height: "28",
3787
- viewBox: "0 0 24 24",
3788
- fill: "currentColor"
3789
- }, [k("polygon", { points: "5,3 19,12 5,21" })])], -1)]], 2));
3790
- }
3791
- });
3792
- // src/utils/videoThumbnail.ts
3793
- function $c(e) {
3794
- if (!e) return {
3795
- platform: "unknown",
3796
- videoId: null,
3797
- thumbnailUrl: null
3798
- };
3799
- for (let t of [/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/)([a-zA-Z0-9_-]{11})/i, /youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/i]) {
3800
- let n = e.match(t);
3801
- if (n) {
3802
- let e = n[1];
3803
- return {
3804
- platform: "youtube",
3805
- videoId: e,
3806
- thumbnailUrl: `https://img.youtube.com/vi/${e}/maxresdefault.jpg`
3807
- };
3808
- }
3809
- }
3810
- let t = e.match(/vimeo\.com\/(?:video\/)?(\d+)/i);
3811
- if (t) {
3812
- let e = t[1];
3813
- return {
3814
- platform: "vimeo",
3815
- videoId: e,
3816
- thumbnailUrl: `https://vumbnail.com/${e}.jpg`
3817
- };
3818
- }
3819
- return {
3820
- platform: "unknown",
3821
- videoId: null,
3822
- thumbnailUrl: null
3823
- };
3824
- }
3825
- function el(e, t) {
3826
- return t || $c(e).thumbnailUrl;
3827
- }
3828
- // src/components/blocks/VideoBlock.vue?vue&type=script&setup=true&lang.ts
3829
- var tl = ["src", "alt"], nl = {
3830
- class: "tpl:max-w-full tpl:truncate tpl:px-3 tpl:text-xs tpl:font-medium tpl:text-[var(--tpl-primary)]",
3831
- style: { opacity: "0.7" }
3832
- }, rl = ["href"], il = ["src", "alt"], al = ["src", "alt"], ol = {
3833
- key: 3,
3834
- class: "tpl:flex tpl:box-border tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-sm tpl:border-[var(--tpl-border-light)] tpl:bg-[var(--tpl-bg-hover)] tpl:text-[var(--tpl-text-dim)]"
3835
- }, sl = /* @__PURE__ */ F({
3836
- __name: "VideoBlock",
3837
- props: {
3838
- block: {},
3839
- viewport: {}
3840
- },
3841
- setup(e) {
3842
- let t = e, { t: n } = jn(), { syntax: r } = Yn(), i = x(() => we(t.block.url, r) || we(t.block.thumbnailUrl, r)), a = dt(() => i.value ? void 0 : t.block.thumbnailUrl || void 0), o = dt(() => i.value ? t.block.placeholderUrl : void 0), s = x(() => i.value ? null : t.block.thumbnailUrl ? a.value ?? null : el(t.block.url)), c = x(() => ({ textAlign: t.block.align })), u = x(() => {
3843
- let e = t.block.align;
3844
- return {
3845
- maxWidth: "100%",
3846
- width: t.block.width === "full" ? "100%" : `${t.block.width}px`,
3847
- height: t.block.height ? `${t.block.height}px` : void 0,
3848
- display: "block",
3849
- marginLeft: e === "center" || e === "right" ? "auto" : void 0,
3850
- marginRight: e === "center" ? "auto" : void 0
3851
- };
3852
- }), f = x(() => ({ height: t.block.height ? `${t.block.height}px` : void 0 })), p = x(() => we(t.block.url, r) ? t.block.url : t.block.thumbnailUrl);
3853
- return (t, r) => (E(), C("div", {
3854
- class: "tpl:w-full",
3855
- style: l(c.value)
3856
- }, [i.value && e.block.placeholderUrl ? (E(), C("div", {
3857
- key: 0,
3858
- class: "tpl:relative tpl:inline-block",
3859
- style: l(u.value)
3860
- }, [k("img", {
3861
- class: "tpl:block tpl:w-full tpl:border-0",
3862
- src: M(o),
3863
- alt: e.block.alt,
3864
- style: l(f.value)
3865
- }, null, 12, tl), v(Qc)], 4)) : i.value ? (E(), C("div", {
3866
- key: 1,
3867
- class: "tpl:relative tpl:!flex tpl:box-border tpl:min-h-[150px] tpl:flex-col tpl:items-center tpl:justify-center tpl:gap-2 tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-center tpl:bg-[var(--tpl-bg-elevated)]",
3868
- style: l([{ "border-color": "color-mix(in srgb, var(--tpl-primary) 40%, transparent)" }, u.value])
3869
- }, [v(M(gi), {
3870
- size: 36,
3871
- "stroke-width": 1.5,
3872
- class: "tpl:text-[var(--tpl-primary)]",
3873
- style: { opacity: "0.5" }
3874
- }), k("span", nl, [v(si, { text: p.value }, null, 8, ["text"])])], 4)) : s.value ? (E(), C(j, { key: 2 }, [e.block.url ? (E(), C("a", {
3875
- key: 0,
3876
- href: e.block.url,
3877
- target: "_blank",
3878
- rel: "noopener noreferrer",
3879
- class: "tpl:group tpl:relative tpl:inline-block",
3880
- style: l(u.value),
3881
- onClick: r[0] ||= L(() => {}, ["prevent"])
3882
- }, [k("img", {
3883
- class: "tpl:block tpl:w-full tpl:border-0",
3884
- src: s.value,
3885
- alt: e.block.alt,
3886
- style: l(f.value)
3887
- }, null, 12, il), v(Qc, { "hover-effect": "" })], 12, rl)) : (E(), C("div", {
3888
- key: 1,
3889
- class: "tpl:relative tpl:inline-block",
3890
- style: l(u.value)
3891
- }, [k("img", {
3892
- class: "tpl:block tpl:w-full tpl:border-0",
3893
- src: s.value,
3894
- alt: e.block.alt,
3895
- style: l(f.value)
3896
- }, null, 12, al), v(Qc)], 4))], 64)) : (E(), C("div", ol, [v(M(gi), {
3897
- size: 40,
3898
- "stroke-width": 1.5,
3899
- class: "tpl:text-[var(--tpl-border-light)]"
3900
- }), k("span", null, d(M(n).video.addVideo), 1)]))], 4));
3901
- }
3902
- }), cl = {
3903
- section: Pc,
3904
- title: Ma,
3905
- paragraph: _a,
3906
- image: ua,
3907
- button: li,
3908
- divider: Ki,
3909
- video: sl,
3910
- social: Hc,
3911
- menu: ma,
3912
- table: Zc,
3913
- spacer: Gc,
3914
- html: Qi,
3915
- countdown: te(() => import("./CountdownBlock-CU2yTWtF.js"))
3916
- };
3917
- function ll(t) {
3918
- let { editor: n, config: r, translations: i, fontsManager: a } = t, { t: o, format: l } = jn(i), u = x(() => ke(ke(ke(Sr(i), Hr(n.content.value.settings?.locale)), ze(n.content.value.settings) === "rtl" ? {
3919
- title: { textAlign: "right" },
3920
- table: { textAlign: "right" }
3921
- } : {}), r.blockDefaults ?? {}));
3922
- n.setUiTheme(r.uiTheme ?? "auto");
3923
- let { resolvedTheme: d } = ur(x(() => n.state.uiTheme)), f = e(r.theme ?? {}), { themeStyles: p } = fr({
3924
- themeOverrides: f,
3925
- resolvedTheme: d,
3926
- extraStyles: () => ({
3927
- "--tpl-drop-text": `"${i.canvas.dropHere}"`,
3928
- ...t.themeExtraStyles?.()
3929
- })
3930
- }), m = t.history ?? at({
3931
- content: n.content,
3932
- setContent: (e, t) => n.setContent(e, t)
3933
- });
3934
- t.history || mt(n, m);
3935
- let h = ut({
3936
- addBlock: n.addBlock,
3937
- removeBlock: n.removeBlock,
3938
- updateBlock: n.updateBlock,
3939
- selectBlock: n.selectBlock,
3940
- findBlockLocation: n.findBlockLocation,
3941
- blockDefaults: () => u.value
3942
- }), _ = ct(n), v = t.autoSaveOptions !== null && t.autoSaveOptions !== void 0 ? lt({
3943
- content: n.content,
3944
- isDirty: () => n.state.isDirty,
3945
- ...t.autoSaveOptions
3946
- }) : null, y = null;
3947
- v && (y = I(m.isNavigating, (e) => {
3948
- e ? v.pause() : v.resume();
3949
- }));
3950
- let b = lr(n, {
3951
- t: o,
3952
- format: l
3953
- }, r.customBlocks ?? []), S = Pn(r.colors);
3954
- if (S.allowCustomIgnored && R.warn("config.colors.allowCustom: false is ignored without presets — keeping the color wheel and hex input so a color can still be chosen."), S.invalidPresets.length > 0 && R.warn(`config.colors.presets skipped invalid entries: ${S.invalidPresets.join(", ")} — presets must be hex colors (#rgb or #rrggbb).`), S.allowCustom === !1) {
3955
- let e = xr(S.presets, r.blockDefaults, r.templateDefaults);
3956
- e.length > 0 && R.warn(`config.colors locks custom colours, but these block/template default colours fall outside colors.presets: ${e.join(", ")}. New blocks start on a colour the palette can't reselect — set blockDefaults / templateDefaults from the same palette.`);
3957
- }
3958
- let C = In(r.templateSettings);
3959
- for (let e of C.unknown) R.warn(`config.templateSettings.fields: "${e}" is not a template setting (expected one of ${Ln.join(", ")}) — skipping it.`);
3960
- let w = pr();
3961
- vr(w, cl);
3962
- let T = /* @__PURE__ */ new Set();
3963
- function E(e) {
3964
- for (let t of e) {
3965
- w.registerCustom(t, Wi);
3966
- for (let e of Ur(t, S)) T.has(e.id) || (T.add(e.id), R.warn(e.message));
3967
- }
3968
- }
3969
- r.customBlocks?.length && E(r.customBlocks);
3970
- let D = tr();
3971
- if (s() && g(D.dispose), t.containerEl) {
3972
- let e = t.containerEl;
3973
- Mt(document, "pointerdown", (t) => {
3974
- let n = e.value;
3975
- n && (t.composedPath?.() ?? []).includes(n) && D.claim();
3976
- }, { capture: !0 });
3977
- }
3978
- function O() {
3979
- let e = t.capabilities?.templates;
3980
- e ? e.save() : v?.flush();
3981
- }
3982
- function k(e) {
3983
- D.isActive() && Gr(e, {
3984
- history: m,
3985
- selectBlock: (e) => n.selectBlock(e),
3986
- getSelectedBlockId: () => n.state.selectedBlockId,
3987
- removeBlock: (e) => n.removeBlock(e),
3988
- onSave: O,
3989
- isPicking: () => t.capabilities?.savedBlocks?.isPicking.value === !0,
3990
- onConfirmPick: () => t.capabilities?.savedBlocks?.confirmPicking(),
3991
- onCancelPick: () => t.capabilities?.savedBlocks?.cancelPicking()
3992
- });
3993
- }
3994
- Mt(document, "keydown", k);
3995
- let A = e(null), j = t.editorRoot ?? document;
3996
- c(cn, j), c(Rt, A), c(on, i), c(mn, n), c(kn, m), c(ln, h), c(pn, _), c(En, a), c(Gt, p), c(sn, d), c(xn, u), c(an, r.locale), c(Tn, w), c(Sn, r.customBlocks ?? []), c(An, r.paletteBlocks), c(un, yr(r.htmlBlockPreview)), c(zt, r.layout), c(rn, r.sectionWrapper), c(fn, S), c(Cn, C.fields), c(yn, mr(n.content, w));
3997
- let M = nt(r.mergeTags?.syntax);
3998
- for (let e of ["opener", "closer"]) {
3999
- let t = M[e];
4000
- typeof t == "string" && t.trim() === "" && R.warn(`config.mergeTags.syntax.${e} is blank — ignoring it.`);
4001
- }
4002
- typeof M.opener != "string" && typeof M.closer == "string" && M.closer.trim() !== "" && Ze(M) === null && R.warn("config.mergeTags.syntax.closer has no effect without an opener — set opener to turn on autocomplete for this syntax.");
4003
- let N = ee(r.mergeTags?.tags ?? []);
4004
- function te(e) {
4005
- Array.isArray(e) ? N.value = e : R.warn(`setMergeTags() expects an array of merge tags, received ${typeof e} — ignoring.`);
4006
- }
4007
- c(Xt, N), c(Zt, M), c($t, r.mergeTags?.onRequest ?? null), c(_n, r.mergeTags?.autocomplete !== !1), c(Yt, r.mergeTags?.showRawValue !== !1);
4008
- let P = e(We(r.mergeTags?.tags ?? []));
4009
- c(Jt, P);
4010
- let F = rr({
4011
- resolvePreview: r.resolvePreview,
4012
- getContent: () => {
4013
- let e = n.content.value;
4014
- return r.layout && n.state.previewMode ? Re(r.layout, e) : e;
4015
- },
4016
- isActive: () => n.state.previewMode
4017
- });
4018
- c(nn, F), c(Ut, r.resolvePreview);
4019
- let L = x(() => !(n.state.previewMode && F.isConfigured));
4020
- c(wn, L);
4021
- let ne = ir();
4022
- c(Lt, ne), c(gn, e(!1)), c(Bt, e(!1)), c(tn, r.logicTags?.tags ?? []), c(Dn, r.logicTags?.pairs ?? []), c(Wt, r.logicTags?.onRequest ?? null), c(Vt, ar()), c(qt, r.onRequestMedia ?? null), c(dn, r.canDropMedia ?? null), c(On, r.resolveImageUrl ? Tt(r.resolveImageUrl) : null), c(hn, r.displayConditions?.conditions ?? []), c(bn, r.displayConditions?.allowCustom ?? !1), c(vn, t.capabilities ?? {}), c(en, b);
4023
- let re = or(r.lint) ? null : cr({
4024
- content: n.content,
4025
- options: r.lint ?? {},
4026
- updateBlock: n.updateBlock,
4027
- updateSettings: n.updateSettings,
4028
- removeBlock: n.removeBlock
4029
- });
4030
- c(Kt, re);
4031
- function ie() {
4032
- y?.(), re?.destroy(), v?.destroy(), m.destroy();
4033
- }
4034
- return {
4035
- t: o,
4036
- format: l,
4037
- editorRoot: j,
4038
- history: m,
4039
- blockActions: h,
4040
- conditionPreview: _,
4041
- autoSave: v,
4042
- resolvedTheme: d,
4043
- themeStyles: p,
4044
- themeOverrides: f,
4045
- registry: w,
4046
- keyboardReorder: b,
4047
- templateLint: re,
4048
- popoverRoot: A,
4049
- mergeTagSampleMode: P,
4050
- previewResolution: F,
4051
- appliesConditionFilter: L,
4052
- registerCustomBlocks: E,
4053
- setMergeTags: te,
4054
- mergeTags: N,
4055
- mergeTagSyntax: M,
4056
- destroy: ie
4057
- };
4058
- }
4059
- export { ti as A, Pr as B, xi as C, ui as D, fi as E, Ar as F, rr as H, Rr as I, Lr as L, Kr as M, ai as N, li as O, qr as P, Ir as R, Si as S, mi as T, Nr as V, Wi as _, Hc as a, ji as b, Na as c, Aa as d, _a as f, Ki as g, Qi as h, Gc as i, ni as j, Zr as k, Ia as l, ua as m, sl as n, Pc as o, ma as p, Zc as r, kc as s, ll as t, Ma as u, Fi as v, yi as w, Ei as x, Ni as y, Fr as z };