@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.
- package/README.md +1 -1
- package/dist/AiAltTextPopover-NMJqQKvD.js +106 -0
- package/dist/{AiAltTextReview-9ySsXOTU.js → AiAltTextReview-Ci4zHwRc.js} +68 -66
- package/dist/AiChatPanel-DdhtfsmO.js +561 -0
- package/dist/{AiPanels-DqT4PgQ0.js → AiPanels-HBx7xoJR.js} +6 -6
- package/dist/{AiRewriteMenu-28agTycW.js → AiRewriteMenu-DPzSekZt.js} +76 -105
- package/dist/BlockIssueBadge-eIXZJ9M3.js +33 -0
- package/dist/BlockPreviewCanvas-DO-2TP_6.js +140 -0
- package/dist/{CloudHeaderExtras-QI82yF54.js → CloudHeaderExtras-XpjJjn3o.js} +4 -4
- package/dist/{CloudPanels-BKJaLkUN.js → CloudPanels-i2kZdrdP.js} +53 -53
- package/dist/CollaborationNotices-DANsjl7c.js +65 -0
- package/dist/{CollaboratorBar-CXQqN3VP.js → CollaboratorBar-CbbAA0m1.js} +24 -24
- package/dist/CommentsPanel-CYW3LWis.js +16 -0
- package/dist/CommentsSidebar-CcF4ISMi.js +526 -0
- package/dist/{CountdownBlock-CU2yTWtF.js → CountdownBlock-BMezkFbJ.js} +15 -15
- package/dist/CountdownToolbar-D3Lv74kU.js +258 -0
- package/dist/IssuesPanel-BMAG9042.js +371 -0
- package/dist/LanguageMenu-FlP_Jbup.js +403 -0
- package/dist/{LoadingTrack-DM4g6j7b.js → LoadingTrack-BG8cg9xi.js} +2 -2
- package/dist/LocaleNotices-DAnVszWu.js +46 -0
- package/dist/LogicTagInsertButton-BjYs-UQX.js +1096 -0
- package/dist/{MediaEditModal-Dy08GEwE.js → MediaEditModal-LnG-cF_S.js} +451 -451
- package/dist/{MediaPanels-BgEp7iCp.js → MediaPanels-C2r5fiFo.js} +4 -4
- package/dist/{MergeTagInput-B9dtUthD.js → MergeTagInput-BsnogCeY.js} +30 -30
- package/dist/{MergeTagModeToggle-DxujhYJ4.js → MergeTagModeToggle-DiufIQ-_.js} +49 -49
- package/dist/MergeTagTextarea-BweI-Xsi.js +126 -0
- package/dist/ParagraphEditor-qgBp5yIB.js +825 -0
- package/dist/{RestoreVersionDialog-C4s_JYCx.js → RestoreVersionDialog-DdYUrFiK.js} +23 -23
- package/dist/{RichTextEditorContent-o6HmE8GR.js → RichTextEditorContent-C5MAzx3E.js} +47 -47
- package/dist/{SaveBlockDialog-CWLrly6l.js → SaveBlockDialog-eK6fjtTy.js} +86 -86
- package/dist/{cdn/chunks/SavedBlocksBrowserModal-BPYcRoGa.js → SavedBlocksBrowserModal-D2QHd2Yp.js} +135 -132
- package/dist/{SavedBlocksPanels-BE1N9rNZ.js → SavedBlocksPanels-Cl61f4Mf.js} +9 -9
- package/dist/{SavedBlocksPickBar-Dwl94xhP.js → SavedBlocksPickBar-CXP2dkeB.js} +15 -15
- package/dist/TemplateSettings-BKJrdZcH.js +294 -0
- package/dist/TestEmailModal-DQotJg6g.js +212 -0
- package/dist/{TestEmailPanel-DaFjP9QK.js → TestEmailPanel-CwiTzJsh.js} +4 -4
- package/dist/TitleEditor-CzSvsPAn.js +202 -0
- package/dist/ToggleSwitch-R3wCCYE6.js +43 -0
- package/dist/Toolbar-Cd75ci5W.js +3711 -0
- package/dist/{TplModal-DLMssVlt.js → TplModal-ZoXu40T9.js} +17 -17
- package/dist/{VersionHistoryMenu-BkbYUs0Q.js → VersionHistoryMenu-BvhN-Ofk.js} +39 -39
- package/dist/{VersionHistoryPanels-DP7HaYWv.js → VersionHistoryPanels-DPWMnYbd.js} +5 -5
- package/dist/VersionPreviewBanner-CuJnasxH.js +37 -0
- package/dist/WrapperBlock-D4fPwO0t.js +44 -0
- package/dist/{blockTypeIcons-BHjlPnPf.js → blockTypeIcons-BXMxu86H.js} +7 -7
- package/dist/bundle-stats.json +8 -8
- package/dist/{cdn/chunks/ca-CD-Kt1qz.js → ca-DOuIxWRv.js} +114 -2
- package/dist/cdn/chunks/AiAltTextPopover-ByZ0FEqI.js +107 -0
- package/dist/cdn/chunks/AiAltTextPopover-ByZ0FEqI.js.map +1 -0
- package/dist/cdn/chunks/{AiAltTextReview-BGLLSKLm.js → AiAltTextReview-Dtm3A2cD.js} +70 -68
- package/dist/cdn/chunks/AiAltTextReview-Dtm3A2cD.js.map +1 -0
- package/dist/cdn/chunks/AiChatPanel-DciEt27y.js +487 -0
- package/dist/cdn/chunks/AiChatPanel-DciEt27y.js.map +1 -0
- package/dist/cdn/chunks/{AiPanels-0wBarZSH.js → AiPanels-BV5D1itk.js} +11 -11
- package/dist/cdn/chunks/{AiPanels-0wBarZSH.js.map → AiPanels-BV5D1itk.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-qf-cfEpy.js → AiRewriteMenu-D3jkh6Xb.js} +79 -79
- package/dist/cdn/chunks/AiRewriteMenu-D3jkh6Xb.js.map +1 -0
- package/dist/cdn/chunks/BlockIssueBadge-DyEgBZtR.js +34 -0
- package/dist/cdn/chunks/BlockIssueBadge-DyEgBZtR.js.map +1 -0
- package/dist/cdn/chunks/BlockPreviewCanvas-RQFilqXC.js +142 -0
- package/dist/cdn/chunks/{BlockPreviewCanvas-DGBh6mqe.js.map → BlockPreviewCanvas-RQFilqXC.js.map} +1 -1
- package/dist/cdn/chunks/{CloudHeaderExtras-BMNK_F9p.js → CloudHeaderExtras-BtqdN777.js} +4 -4
- package/dist/cdn/chunks/{CloudHeaderExtras-BMNK_F9p.js.map → CloudHeaderExtras-BtqdN777.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-JMWIoVWh.js → CloudPanels-BSJ-Z5Hw.js} +45 -45
- package/dist/cdn/chunks/{CloudPanels-JMWIoVWh.js.map → CloudPanels-BSJ-Z5Hw.js.map} +1 -1
- package/dist/cdn/chunks/CollaborationNotices-BS7xrlPE.js +67 -0
- package/dist/cdn/chunks/CollaborationNotices-BS7xrlPE.js.map +1 -0
- package/dist/cdn/chunks/{CollaboratorBar-CXByAoUz.js → CollaboratorBar-Bc9914Az.js} +17 -17
- package/dist/cdn/chunks/{CollaboratorBar-CXByAoUz.js.map → CollaboratorBar-Bc9914Az.js.map} +1 -1
- package/dist/cdn/chunks/CommentsPanel-DbR9phAk.js +18 -0
- package/dist/cdn/chunks/{CommentsPanel-DoJnKLXI.js.map → CommentsPanel-DbR9phAk.js.map} +1 -1
- package/dist/cdn/chunks/CommentsSidebar-BD4--XP2.js +496 -0
- package/dist/cdn/chunks/CommentsSidebar-BD4--XP2.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-BqRw147R.js → CountdownBlock-CjMhMhnv.js} +22 -22
- package/dist/cdn/chunks/{CountdownBlock-BqRw147R.js.map → CountdownBlock-CjMhMhnv.js.map} +1 -1
- package/dist/cdn/chunks/CountdownToolbar-DxwYBw-d.js +260 -0
- package/dist/cdn/chunks/CountdownToolbar-DxwYBw-d.js.map +1 -0
- package/dist/cdn/chunks/{IssuesPanel-C7LfxaAY.js → IssuesPanel-CUmI4HMm.js} +133 -121
- package/dist/cdn/chunks/IssuesPanel-CUmI4HMm.js.map +1 -0
- package/dist/cdn/chunks/LanguageMenu-3ydCozQJ.js +359 -0
- package/dist/cdn/chunks/LanguageMenu-3ydCozQJ.js.map +1 -0
- package/dist/cdn/chunks/{LoadingTrack-CZuLTazv.js → LoadingTrack-DUYcDHOV.js} +2 -2
- package/dist/cdn/chunks/{LoadingTrack-CZuLTazv.js.map → LoadingTrack-DUYcDHOV.js.map} +1 -1
- package/dist/cdn/chunks/LocaleNotices-BfoH6gST.js +47 -0
- package/dist/cdn/chunks/LocaleNotices-BfoH6gST.js.map +1 -0
- package/dist/{LogicTagInsertButton-CfscnwCn.js → cdn/chunks/LogicTagInsertButton-5Z3fFzjc.js} +422 -449
- package/dist/cdn/chunks/LogicTagInsertButton-5Z3fFzjc.js.map +1 -0
- package/dist/cdn/chunks/{MediaEditModal-Cpcod6_U.js → MediaEditModal-DDCIwr9U.js} +421 -421
- package/dist/cdn/chunks/MediaEditModal-DDCIwr9U.js.map +1 -0
- package/dist/cdn/chunks/{MediaPanels-BIdcW_1f.js → MediaPanels-Dz79oy8P.js} +5 -5
- package/dist/cdn/chunks/{MediaPanels-BIdcW_1f.js.map → MediaPanels-Dz79oy8P.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-BvWg8o5E.js → MergeTagInput-CIWy-cXf.js} +28 -28
- package/dist/cdn/chunks/{MergeTagInput-BvWg8o5E.js.map → MergeTagInput-CIWy-cXf.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-BgKEVUtV.js → MergeTagModeToggle-BrP5GR-x.js} +52 -52
- package/dist/cdn/chunks/MergeTagModeToggle-BrP5GR-x.js.map +1 -0
- package/dist/cdn/chunks/MergeTagTextarea-D3nNDlhV.js +128 -0
- package/dist/cdn/chunks/MergeTagTextarea-D3nNDlhV.js.map +1 -0
- package/dist/cdn/chunks/ParagraphEditor-DDolH_Pf.js +660 -0
- package/dist/cdn/chunks/ParagraphEditor-DDolH_Pf.js.map +1 -0
- package/dist/cdn/chunks/{RestoreVersionDialog-CjOdD2xj.js → RestoreVersionDialog-Crj1DBqC.js} +22 -22
- package/dist/cdn/chunks/{RestoreVersionDialog-CjOdD2xj.js.map → RestoreVersionDialog-Crj1DBqC.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-DNjR_sNN.js → RichTextEditorContent-rCCqFlwJ.js} +44 -44
- package/dist/cdn/chunks/{RichTextEditorContent-DNjR_sNN.js.map → RichTextEditorContent-rCCqFlwJ.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-CUhpawq0.js → SaveBlockDialog-C34RW1aM.js} +77 -77
- package/dist/cdn/chunks/{SaveBlockDialog-CUhpawq0.js.map → SaveBlockDialog-C34RW1aM.js.map} +1 -1
- package/dist/{SavedBlocksBrowserModal-CE8n4EBS.js → cdn/chunks/SavedBlocksBrowserModal-CJnwWPT-.js} +103 -106
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BPYcRoGa.js.map → SavedBlocksBrowserModal-CJnwWPT-.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-C6--Bc81.js → SavedBlocksPanels-CA2PqXIH.js} +9 -9
- package/dist/cdn/chunks/{SavedBlocksPanels-C6--Bc81.js.map → SavedBlocksPanels-CA2PqXIH.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-DUavxpbU.js → SavedBlocksPickBar-Dj3ortee.js} +16 -16
- package/dist/cdn/chunks/{SavedBlocksPickBar-DUavxpbU.js.map → SavedBlocksPickBar-Dj3ortee.js.map} +1 -1
- package/dist/cdn/chunks/TemplateSettings-sW0ZlDl1.js +266 -0
- package/dist/cdn/chunks/TemplateSettings-sW0ZlDl1.js.map +1 -0
- package/dist/cdn/chunks/TestEmailModal-BXeCtTjU.js +212 -0
- package/dist/cdn/chunks/TestEmailModal-BXeCtTjU.js.map +1 -0
- package/dist/cdn/chunks/{TestEmailPanel-CcUpEpAn.js → TestEmailPanel-CpZcpB9D.js} +5 -5
- package/dist/cdn/chunks/{TestEmailPanel-CcUpEpAn.js.map → TestEmailPanel-CpZcpB9D.js.map} +1 -1
- package/dist/cdn/chunks/TitleEditor-Bv3SmSO6.js +202 -0
- package/dist/cdn/chunks/TitleEditor-Bv3SmSO6.js.map +1 -0
- package/dist/cdn/chunks/ToggleSwitch-BSkySwA1.js +45 -0
- package/dist/cdn/chunks/ToggleSwitch-BSkySwA1.js.map +1 -0
- package/dist/cdn/chunks/Toolbar-BJKpJ2Mg.js +3626 -0
- package/dist/cdn/chunks/Toolbar-BJKpJ2Mg.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-CFPDgbwQ.js → TplModal-DDDUDMYC.js} +20 -20
- package/dist/cdn/chunks/{TplModal-CFPDgbwQ.js.map → TplModal-DDDUDMYC.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-BYlLRvRJ.js → VersionHistoryMenu-DSElv3Sv.js} +33 -33
- package/dist/cdn/chunks/{VersionHistoryMenu-BYlLRvRJ.js.map → VersionHistoryMenu-DSElv3Sv.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-C6SOVoiT.js → VersionHistoryPanels-H2nuik1l.js} +6 -6
- package/dist/cdn/chunks/{VersionHistoryPanels-C6SOVoiT.js.map → VersionHistoryPanels-H2nuik1l.js.map} +1 -1
- package/dist/cdn/chunks/VersionPreviewBanner-Whwxh55w.js +39 -0
- package/dist/cdn/chunks/VersionPreviewBanner-Whwxh55w.js.map +1 -0
- package/dist/cdn/chunks/WrapperBlock-jTqsuLnS.js +46 -0
- package/dist/cdn/chunks/WrapperBlock-jTqsuLnS.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-D7FW7Ypo.js → blockTypeIcons-DMgLcuI8.js} +5 -5
- package/dist/cdn/chunks/{blockTypeIcons-D7FW7Ypo.js.map → blockTypeIcons-DMgLcuI8.js.map} +1 -1
- package/dist/{ca-CD-Kt1qz.js → cdn/chunks/ca-DOuIxWRv.js} +116 -0
- package/dist/cdn/chunks/ca-DOuIxWRv.js.map +1 -0
- package/dist/cdn/chunks/composables-D0UYam2P.js +3039 -0
- package/dist/cdn/chunks/composables-D0UYam2P.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-Cth2JCEh.js → createCloudRuntime-BdsclY8_.js} +75 -73
- package/dist/cdn/chunks/createCloudRuntime-BdsclY8_.js.map +1 -0
- package/dist/{de-CeFJ6wbM.js → cdn/chunks/de-DaOUfYBX.js} +116 -0
- package/dist/cdn/chunks/de-DaOUfYBX.js.map +1 -0
- package/dist/cdn/chunks/{dist-8ym3y-pH.js → dist-BzXULHvI.js} +48 -48
- package/dist/cdn/chunks/{dist-8ym3y-pH.js.map → dist-BzXULHvI.js.map} +1 -1
- package/dist/cdn/chunks/{dist-BMzNabtD.js → dist-DqGgijFI.js} +114 -114
- package/dist/cdn/chunks/{dist-BMzNabtD.js.map → dist-DqGgijFI.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-Du8AUMFT.js → draggable-DepKdldn.js} +1491 -1486
- package/dist/cdn/chunks/draggable-DepKdldn.js.map +1 -0
- package/dist/cdn/chunks/{editor-modal-CyCe560f.js → editor-modal-CPbgthOv.js} +781 -781
- package/dist/cdn/chunks/{editor-modal-CyCe560f.js.map → editor-modal-CPbgthOv.js.map} +1 -1
- package/dist/{en-D14i5nFh.js → cdn/chunks/en-C0pHHMiR.js} +116 -0
- package/dist/cdn/chunks/en-C0pHHMiR.js.map +1 -0
- package/dist/cdn/chunks/en-IYVryJRl.js +1 -0
- package/dist/{es-zDacbMhs.js → cdn/chunks/es-CxyEKr6n.js} +116 -0
- package/dist/cdn/chunks/es-CxyEKr6n.js.map +1 -0
- package/dist/cdn/chunks/{extensions-CFF2KWy-.js → extensions-Uh9vuFfK.js} +59 -59
- package/dist/cdn/chunks/{extensions-CFF2KWy-.js.map → extensions-Uh9vuFfK.js.map} +1 -1
- package/dist/{fr-CSgYtjOd.js → cdn/chunks/fr-CYbamiI6.js} +116 -0
- package/dist/cdn/chunks/fr-CYbamiI6.js.map +1 -0
- package/dist/cdn/chunks/{icons-okSPsLOa.js → icons-CSSMtbGK.js} +150 -109
- package/dist/cdn/chunks/icons-CSSMtbGK.js.map +1 -0
- package/dist/{ja-B7H3ID8O.js → cdn/chunks/ja-DfaIAoGI.js} +116 -0
- package/dist/cdn/chunks/ja-DfaIAoGI.js.map +1 -0
- package/dist/cdn/chunks/keys-CoQtCqNv.js +11 -0
- package/dist/cdn/chunks/keys-CoQtCqNv.js.map +1 -0
- package/dist/cdn/chunks/languageName-DEEOhDWI.js +12 -0
- package/dist/cdn/chunks/languageName-DEEOhDWI.js.map +1 -0
- package/dist/{nl-176ySmc5.js → cdn/chunks/nl-DkrB-VKZ.js} +116 -0
- package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +1 -0
- package/dist/cdn/chunks/normalizeMergeTagMarkup-oGhwVscw.js +290 -0
- package/dist/cdn/chunks/normalizeMergeTagMarkup-oGhwVscw.js.map +1 -0
- package/dist/cdn/chunks/noticeTones-D7BPu-Le.js +16 -0
- package/dist/cdn/chunks/noticeTones-D7BPu-Le.js.map +1 -0
- package/dist/cdn/chunks/plural-CyxrJXL1.js +17 -0
- package/dist/cdn/chunks/plural-CyxrJXL1.js.map +1 -0
- package/dist/cdn/chunks/{preRenderCustomBlocks-BcXIz7oJ.js → preRenderCustomBlocks-C8k7tw98.js} +5 -5
- package/dist/cdn/chunks/{preRenderCustomBlocks-BcXIz7oJ.js.map → preRenderCustomBlocks-C8k7tw98.js.map} +1 -1
- package/dist/{pt-BR-dDlTwX18.js → cdn/chunks/pt-BR-CY5Ye7eP.js} +116 -0
- package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +1 -0
- package/dist/cdn/chunks/sanitizeHtml-DYklmvgX.js +61 -0
- package/dist/cdn/chunks/sanitizeHtml-DYklmvgX.js.map +1 -0
- package/dist/cdn/chunks/socialIcons-BAiuHyJs.js +2638 -0
- package/dist/cdn/chunks/socialIcons-BAiuHyJs.js.map +1 -0
- package/dist/cdn/chunks/src-CACM3o--.js +2606 -0
- package/dist/cdn/chunks/src-CACM3o--.js.map +1 -0
- package/dist/cdn/chunks/{src-C7bkofBL.js → src-Ddpm4HsS.js} +222 -256
- package/dist/cdn/chunks/src-Ddpm4HsS.js.map +1 -0
- package/dist/cdn/chunks/{src-DEd87i_U.js → src-DheBmnvF.js} +635 -478
- package/dist/cdn/chunks/src-DheBmnvF.js.map +1 -0
- package/dist/{styleConstants-B8xVRiwX.js → cdn/chunks/styleConstants-CgiNKdnc.js} +7 -5
- package/dist/cdn/chunks/styleConstants-CgiNKdnc.js.map +1 -0
- package/dist/cdn/chunks/templateSettingsFields-cjlP-jdw.js.map +1 -1
- package/dist/cdn/chunks/{tiptap-CbiTlECY.js → tiptap-Dipw_zOQ.js} +40 -40
- package/dist/cdn/chunks/{tiptap-CbiTlECY.js.map → tiptap-Dipw_zOQ.js.map} +1 -1
- package/dist/cdn/chunks/{useCloudI18n-DY8_-ETE.js → useCloudI18n-Cc5NZqiI.js} +3 -3
- package/dist/cdn/chunks/{useCloudI18n-DY8_-ETE.js.map → useCloudI18n-Cc5NZqiI.js.map} +1 -1
- package/dist/cdn/chunks/useEditorRoot-D_LuZ_hE.js +9 -0
- package/dist/cdn/chunks/{useEditorRoot-vjZJwKrV.js.map → useEditorRoot-D_LuZ_hE.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-D8pY4LTq.js → useI18n-BnJYydPv.js} +3 -3
- package/dist/cdn/chunks/{useI18n-D8pY4LTq.js.map → useI18n-BnJYydPv.js.map} +1 -1
- package/dist/cdn/chunks/useLocalizedDisplay-yXbRKNrs.js +33 -0
- package/dist/cdn/chunks/useLocalizedDisplay-yXbRKNrs.js.map +1 -0
- package/dist/cdn/chunks/{useLogicTag-DBJDtpKA.js → useLogicTag-B7RpqVFQ.js} +5 -5
- package/dist/cdn/chunks/{useLogicTag-DBJDtpKA.js.map → useLogicTag-B7RpqVFQ.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-B-aG--s1.js → useMergeTag-C-32ETjj.js} +6 -6
- package/dist/cdn/chunks/{useMergeTag-B-aG--s1.js.map → useMergeTag-C-32ETjj.js.map} +1 -1
- package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js +78 -0
- package/dist/cdn/chunks/usePopoverPosition-BWAXWeBv.js.map +1 -0
- package/dist/cdn/chunks/{useScrollToBlock-vjQ0fe-L.js → useScrollToBlock-Ct1AwLD-.js} +5 -5
- package/dist/cdn/chunks/useScrollToBlock-Ct1AwLD-.js.map +1 -0
- package/dist/cdn/chunks/{withCurrentFont-hZTvYBHO.js → withCurrentFont-D33ZXoWp.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-hZTvYBHO.js.map → withCurrentFont-D33ZXoWp.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +2190 -1496
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-BZ8o0eet.js → check-ChQ0l8EQ.js} +1 -1
- package/dist/{chevron-down-DfAAfILv.js → chevron-down-Bh6cp6PI.js} +1 -1
- package/dist/{chevron-right-Bk4mGdr7.js → chevron-right-LUgdqdoW.js} +1 -1
- package/dist/{chevron-up-MhUf_azW.js → chevron-up-XsDeJxQN.js} +1 -1
- package/dist/{circle-alert-CShJwVFv.js → circle-alert-lODfDsrj.js} +1 -1
- package/dist/{clock-CTfD6OCt.js → clock-DrqFEZkT.js} +1 -1
- package/dist/composables-BOP3ERRP.js +4517 -0
- package/dist/{createCloudRuntime-DCgO4A1r.js → createCloudRuntime-DGV5a5Af.js} +54 -52
- package/dist/{createLucideIcon-CvhTA2KG.js → createLucideIcon-Dw5e5gVE.js} +11 -11
- package/dist/{cdn/chunks/de-CeFJ6wbM.js → de-DaOUfYBX.js} +114 -2
- package/dist/{dist-ByCWA2Tv.js → dist-0alKVRc_.js} +101 -101
- package/dist/{dist-Cy8I5scI.js → dist-54VCNoC0.js} +2 -2
- package/dist/dist-6DU0me3E.js +4 -0
- package/dist/{dist-p3wymUDt.js → dist-B8dY8drK.js} +2 -2
- package/dist/{dist-Dd5MU2Ev.js → dist-B9a7iVye.js} +2 -2
- package/dist/{dist-V7W1UhVr.js → dist-BWflWcpW.js} +2 -2
- package/dist/{dist-D6fZec6r.js → dist-C3hu_C3w.js} +2 -2
- package/dist/{dist-CVy-7PHQ.js → dist-CX7skkvG.js} +48 -48
- package/dist/dist-CcOn7WCo.js +4 -0
- package/dist/dist-Cdkm20M6.js +2542 -0
- package/dist/{dist-BS5uKktL.js → dist-ChOb5XHW.js} +2 -2
- package/dist/{dist-BF5zEHop.js → dist-DZ3X-uB8.js} +2 -2
- package/dist/{dist-CWSG7Kj0.js → dist-D_XrUEET.js} +5 -5
- package/dist/{dist-txQLT2sF.js → dist-TAv500j6.js} +2 -2
- package/dist/{dist-D6cMdrfG.js → dist-fqSers8_.js} +55 -55
- package/dist/{editor-modal-zaZHcmlO.js → editor-modal-B_2EAOjN.js} +953 -952
- package/dist/{cdn/chunks/en-D14i5nFh.js → en-C0pHHMiR.js} +114 -2
- package/dist/en-DTtwco2Q.js +1 -0
- package/dist/{cdn/chunks/es-zDacbMhs.js → es-CxyEKr6n.js} +114 -2
- package/dist/{extensions-fo_c-vqf.js → extensions-DOLZkLzV.js} +173 -173
- package/dist/{eye-7W4t5e0Q.js → eye-DChfk0gi.js} +1 -1
- package/dist/{cdn/chunks/fr-CSgYtjOd.js → fr-CYbamiI6.js} +114 -2
- package/dist/{image-BDiRFzSd.js → image--Hj2by1G.js} +1 -1
- package/dist/index.d.ts +182 -14
- package/dist/{info-Cxi3-Kh9.js → info-BbXgy82f.js} +1 -1
- package/dist/{cdn/chunks/ja-B7H3ID8O.js → ja-DfaIAoGI.js} +114 -2
- package/dist/keys-BCqskl51.js +9 -0
- package/dist/languageName-DEEOhDWI.js +10 -0
- package/dist/{link-ju_2Cmir.js → link-C2_8yJno.js} +1 -1
- package/dist/{list-DYZJf0aZ.js → list-DLGs2n0V.js} +1 -1
- package/dist/{loader-circle-BZRD0a4I.js → loader-circle-BbDItE_O.js} +1 -1
- package/dist/{message-circle-DuEw4Zfx.js → message-circle-NAModq0p.js} +1 -1
- package/dist/{cdn/chunks/nl-176ySmc5.js → nl-DkrB-VKZ.js} +114 -2
- package/dist/normalizeMergeTagMarkup-CUCo7B5X.js +288 -0
- package/dist/noticeTones-D7BPu-Le.js +14 -0
- package/dist/{package-CePMr2kK.js → package-BuzsfRyH.js} +1 -1
- package/dist/{pencil-D3aFCL7c.js → pencil-BTUUECH4.js} +1 -1
- package/dist/plural-CyxrJXL1.js +15 -0
- package/dist/plus-Dm7DN65T.js +13 -0
- package/dist/{preRenderCustomBlocks--_xc0XK3.js → preRenderCustomBlocks-Bs3N9no-.js} +4 -4
- package/dist/{cdn/chunks/pt-BR-dDlTwX18.js → pt-BR-CY5Ye7eP.js} +114 -2
- package/dist/{refresh-cw-xnro7_Sk.js → refresh-cw-xMURqGWi.js} +2 -12
- package/dist/rotate-ccw-DqVcEIn5.js +13 -0
- package/dist/{runtime-dom.esm-bundler-BURR-bj5.js → runtime-dom.esm-bundler-DlHp8xgy.js} +154 -154
- package/dist/sanitizeHtml-mKgNUdME.js +962 -0
- package/dist/{search-CDrstRBv.js → search-Cfr3W44N.js} +1 -1
- package/dist/{send-DROkPOaX.js → send-CH1SrvyB.js} +1 -1
- package/dist/{smartphone-Bx6u_tjn.js → smartphone-pAkvzjdI.js} +1 -1
- package/dist/socialIcons-Dqr4DJOz.js +2705 -0
- package/dist/{sparkles-CdaTtvoz.js → sparkles-CRO0cCnp.js} +1 -1
- package/dist/{square-BbCROH_f.js → square-CaQWMntx.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{cdn/chunks/styleConstants-B8xVRiwX.js → styleConstants-CgiNKdnc.js} +5 -7
- package/dist/templatical-editor.js +2438 -1752
- package/dist/{text-align-start-CGacJ9Vw.js → text-align-start-BQ39AaRK.js} +1 -1
- package/dist/{trash-DxCd7zIy.js → trash-BL5gEFHN.js} +1 -1
- package/dist/{triangle-alert-7_oaitpf.js → triangle-alert-BYbKu7zZ.js} +1 -1
- package/dist/{upload-DuFEOi_0.js → upload-BhmL4Vqx.js} +1 -1
- package/dist/{useCloudI18n-DEMmUKuO.js → useCloudI18n-Dh2iydo1.js} +4 -4
- package/dist/useEditorRoot-DY3mgcHm.js +7 -0
- package/dist/{useI18n-BBrHTdu8.js → useI18n-CgtvtF4C.js} +4 -4
- package/dist/useLocalizedDisplay-DNNwDRxL.js +31 -0
- package/dist/{useLogicTag-ZPC39rfH.js → useLogicTag-BXXXQQmi.js} +4 -4
- package/dist/{useMergeTag-BQ4qqWpQ.js → useMergeTag-C9Okr87y.js} +5 -5
- package/dist/usePopoverPosition-VDQjyX_A.js +76 -0
- package/dist/{useScrollToBlock-BSyAV4pk.js → useScrollToBlock-C0Kapxdh.js} +5 -5
- package/dist/{vue.runtime.esm-bundler-CnEeTfhs.js → vue.runtime.esm-bundler-BJXc_Mri.js} +1373 -1368
- package/dist/withCurrentFont-DJiQqZzL.js +18 -0
- package/dist/{x-BpfG7v9g.js → x-B7NZYzhx.js} +1 -1
- package/package.json +20 -20
- package/dist/AiAltTextPopover-DawbUywc.js +0 -105
- package/dist/AiChatPanel-CupPhmsN.js +0 -548
- package/dist/BlockIssueBadge-BxpDy3u-.js +0 -33
- package/dist/BlockPreviewCanvas-B-4bmJ3t.js +0 -140
- package/dist/CollaborationNotices-CTw4JThq.js +0 -75
- package/dist/CommentsPanel-DwwFuh1h.js +0 -16
- package/dist/CommentsSidebar-9ZfiC2DO.js +0 -500
- package/dist/CountdownToolbar-BqoYzf_6.js +0 -197
- package/dist/IssuesPanel-4ykrf1ax.js +0 -359
- package/dist/MergeTagTextarea-CPFEjJZd.js +0 -69
- package/dist/ParagraphEditor-CWXfurGh.js +0 -796
- package/dist/TemplateSettings-CS0f1Ues.js +0 -236
- package/dist/TestEmailModal-DBD0X5nV.js +0 -209
- package/dist/TitleEditor-DSqtle77.js +0 -198
- package/dist/ToggleSwitch-JykPyD_8.js +0 -36
- package/dist/Toolbar-BZPFfKrf.js +0 -3145
- package/dist/VersionPreviewBanner-DECaBwLq.js +0 -37
- package/dist/WrapperBlock-BsJv_Fiw.js +0 -44
- package/dist/cdn/chunks/AiAltTextPopover-SEEjkd-I.js +0 -106
- package/dist/cdn/chunks/AiAltTextPopover-SEEjkd-I.js.map +0 -1
- package/dist/cdn/chunks/AiAltTextReview-BGLLSKLm.js.map +0 -1
- package/dist/cdn/chunks/AiChatPanel-DKDAaBNi.js +0 -474
- package/dist/cdn/chunks/AiChatPanel-DKDAaBNi.js.map +0 -1
- package/dist/cdn/chunks/AiRewriteMenu-qf-cfEpy.js.map +0 -1
- package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js +0 -34
- package/dist/cdn/chunks/BlockIssueBadge-jdf91-nk.js.map +0 -1
- package/dist/cdn/chunks/BlockPreviewCanvas-DGBh6mqe.js +0 -142
- package/dist/cdn/chunks/CollaborationNotices-Bsf1rGW9.js +0 -77
- package/dist/cdn/chunks/CollaborationNotices-Bsf1rGW9.js.map +0 -1
- package/dist/cdn/chunks/CommentsPanel-DoJnKLXI.js +0 -18
- package/dist/cdn/chunks/CommentsSidebar-CUtgvdBC.js +0 -470
- package/dist/cdn/chunks/CommentsSidebar-CUtgvdBC.js.map +0 -1
- package/dist/cdn/chunks/CountdownToolbar-xobieKoU.js +0 -199
- package/dist/cdn/chunks/CountdownToolbar-xobieKoU.js.map +0 -1
- package/dist/cdn/chunks/IssuesPanel-C7LfxaAY.js.map +0 -1
- package/dist/cdn/chunks/LogicTagInsertButton-BIi05UQu.js +0 -1051
- package/dist/cdn/chunks/LogicTagInsertButton-BIi05UQu.js.map +0 -1
- package/dist/cdn/chunks/MediaEditModal-Cpcod6_U.js.map +0 -1
- package/dist/cdn/chunks/MergeTagModeToggle-BgKEVUtV.js.map +0 -1
- package/dist/cdn/chunks/MergeTagTextarea-tBz8McZf.js +0 -71
- package/dist/cdn/chunks/MergeTagTextarea-tBz8McZf.js.map +0 -1
- package/dist/cdn/chunks/ParagraphEditor-B3Rj_cWF.js +0 -631
- package/dist/cdn/chunks/ParagraphEditor-B3Rj_cWF.js.map +0 -1
- package/dist/cdn/chunks/TemplateSettings-CKtI-dof.js +0 -208
- package/dist/cdn/chunks/TemplateSettings-CKtI-dof.js.map +0 -1
- package/dist/cdn/chunks/TestEmailModal-CDQTgESD.js +0 -209
- package/dist/cdn/chunks/TestEmailModal-CDQTgESD.js.map +0 -1
- package/dist/cdn/chunks/TitleEditor-Cob7RLyK.js +0 -198
- package/dist/cdn/chunks/TitleEditor-Cob7RLyK.js.map +0 -1
- package/dist/cdn/chunks/ToggleSwitch-J7Vwhvha.js +0 -38
- package/dist/cdn/chunks/ToggleSwitch-J7Vwhvha.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-CdpsvNOR.js +0 -3061
- package/dist/cdn/chunks/Toolbar-CdpsvNOR.js.map +0 -1
- package/dist/cdn/chunks/VersionPreviewBanner-Dvg0ZfAW.js +0 -39
- package/dist/cdn/chunks/VersionPreviewBanner-Dvg0ZfAW.js.map +0 -1
- package/dist/cdn/chunks/WrapperBlock-C7Md56IT.js +0 -46
- package/dist/cdn/chunks/WrapperBlock-C7Md56IT.js.map +0 -1
- package/dist/cdn/chunks/ca-CD-Kt1qz.js.map +0 -1
- package/dist/cdn/chunks/createCloudRuntime-Cth2JCEh.js.map +0 -1
- package/dist/cdn/chunks/de-CeFJ6wbM.js.map +0 -1
- package/dist/cdn/chunks/draggable-Du8AUMFT.js.map +0 -1
- package/dist/cdn/chunks/en-D14i5nFh.js.map +0 -1
- package/dist/cdn/chunks/en-TIqv4ag3.js +0 -1
- package/dist/cdn/chunks/es-zDacbMhs.js.map +0 -1
- package/dist/cdn/chunks/fr-CSgYtjOd.js.map +0 -1
- package/dist/cdn/chunks/icons-okSPsLOa.js.map +0 -1
- package/dist/cdn/chunks/ja-B7H3ID8O.js.map +0 -1
- package/dist/cdn/chunks/keys-CUj6UA38.js +0 -11
- package/dist/cdn/chunks/keys-CUj6UA38.js.map +0 -1
- package/dist/cdn/chunks/nl-176ySmc5.js.map +0 -1
- package/dist/cdn/chunks/normalizeMergeTagMarkup-C_KlfSW4.js +0 -198
- package/dist/cdn/chunks/normalizeMergeTagMarkup-C_KlfSW4.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-dDlTwX18.js.map +0 -1
- package/dist/cdn/chunks/sanitizeHtml-CN85EDrO.js +0 -72
- package/dist/cdn/chunks/sanitizeHtml-CN85EDrO.js.map +0 -1
- package/dist/cdn/chunks/socialIcons-jsTDmkbb.js +0 -2008
- package/dist/cdn/chunks/socialIcons-jsTDmkbb.js.map +0 -1
- package/dist/cdn/chunks/src-C7bkofBL.js.map +0 -1
- package/dist/cdn/chunks/src-DEd87i_U.js.map +0 -1
- package/dist/cdn/chunks/src-DwWrYnUj.js +0 -1404
- package/dist/cdn/chunks/src-DwWrYnUj.js.map +0 -1
- package/dist/cdn/chunks/styleConstants-B8xVRiwX.js.map +0 -1
- package/dist/cdn/chunks/useEditorCore-BrY66C2y.js +0 -2582
- package/dist/cdn/chunks/useEditorCore-BrY66C2y.js.map +0 -1
- package/dist/cdn/chunks/useEditorRoot-vjZJwKrV.js +0 -9
- package/dist/cdn/chunks/usePopoverPosition-DSMtmu2W.js +0 -70
- package/dist/cdn/chunks/usePopoverPosition-DSMtmu2W.js.map +0 -1
- package/dist/cdn/chunks/useScrollToBlock-vjQ0fe-L.js.map +0 -1
- package/dist/dist-CKi_npZM.js +0 -1344
- package/dist/dist-DyFArF_G.js +0 -4
- package/dist/dist-pA3ooG6N.js +0 -4
- package/dist/en-Db76vJbY.js +0 -1
- package/dist/keys-BgRERHzu.js +0 -9
- package/dist/normalizeMergeTagMarkup-CELnOlgK.js +0 -196
- package/dist/sanitizeHtml-BzfzpYJY.js +0 -942
- package/dist/socialIcons-D7MGsg0d.js +0 -2075
- package/dist/useEditorCore-BSo2sSID.js +0 -4059
- package/dist/useEditorRoot-BMcoCLBx.js +0 -7
- package/dist/usePopoverPosition-DV1PxL66.js +0 -68
- package/dist/withCurrentFont-B22FXAF5.js +0 -18
|
@@ -0,0 +1,2705 @@
|
|
|
1
|
+
import { $ as e, B as t, Ft as n, G as r, M as i, Mt as a, Pt as o, Q as s, Y as c, Z as l, _ as u, c as d, ct as f, et as p, f as m, g as h, it as g, k as _, lt as v, nt as y, ot as b, q as x, r as S, w as C, y as w } from "./vue.runtime.esm-bundler-BJXc_Mri.js";
|
|
2
|
+
import { A as T, Bt as E, C as D, D as O, E as k, Et as ee, F as A, Ft as j, Gt as M, H as te, Nt as ne, O as re, Pt as ie, Qt as N, St as P, T as F, Tt as I, Ut as ae, Yt as L, Z as R, _ as z, at as B, d as V, et as H, g as U, gt as oe, h as se, jt as W, m as ce, mt as le, ot as ue, tn as de, w as fe, wt as pe, x as me, xt as he } from "./dist-Cdkm20M6.js";
|
|
3
|
+
import { t as G } from "./createLucideIcon-Dw5e5gVE.js";
|
|
4
|
+
import { t as K } from "./upload-BhmL4Vqx.js";
|
|
5
|
+
import { t as ge } from "./loader-circle-BbDItE_O.js";
|
|
6
|
+
import { B as _e, C as ve, U as ye, u as be } from "./keys-BCqskl51.js";
|
|
7
|
+
import { t as xe } from "./useI18n-CgtvtF4C.js";
|
|
8
|
+
import { r as Se } from "./dist-0alKVRc_.js";
|
|
9
|
+
import { i as q, r as Ce } from "./usePopoverPosition-VDQjyX_A.js";
|
|
10
|
+
// ../core/dist/index.js
|
|
11
|
+
var J = (e) => typeof e == "object" && !!e && !Array.isArray(e), Y = (e) => Array.isArray(e) && e.length > 0 && e.every((e) => J(e) && typeof e.id == "string"), we = /* @__PURE__ */ new Set([
|
|
12
|
+
"id",
|
|
13
|
+
"type",
|
|
14
|
+
"children",
|
|
15
|
+
"columns",
|
|
16
|
+
"l10n",
|
|
17
|
+
"renderedHtml"
|
|
18
|
+
]);
|
|
19
|
+
function Te(e, t, n) {
|
|
20
|
+
let r = /* @__PURE__ */ new Set();
|
|
21
|
+
for (let i of n) {
|
|
22
|
+
if (!he(i)) continue;
|
|
23
|
+
let n = i.split("."), a = n.pop(), o = n.join("."), s = j(e, i), c = t;
|
|
24
|
+
for (let [t, i] of n.entries()) {
|
|
25
|
+
let a = n.slice(0, t + 1).join(".");
|
|
26
|
+
s !== void 0 && J(c) && j(c, i) === void 0 && J(j(e, a)) && (c[i] = {}, r.add(a)), c = j(c, i);
|
|
27
|
+
}
|
|
28
|
+
if (Array.isArray(c)) {
|
|
29
|
+
let e = c.findIndex((e) => J(e) && e.id === a);
|
|
30
|
+
if (e < 0) continue;
|
|
31
|
+
s === void 0 ? c.splice(e, 1) : c[e] = M(s);
|
|
32
|
+
} else J(c) && (s === void 0 ? delete c[a] : c[a] = M(s), o && Object.keys(c).length === 0 && j(e, o) === void 0 && Te(e, t, [o]));
|
|
33
|
+
}
|
|
34
|
+
return r;
|
|
35
|
+
}
|
|
36
|
+
function X(e, t, n, r, i = !0, a = /* @__PURE__ */ new Set()) {
|
|
37
|
+
if (J(e) && J(t) && !a.has(n)) for (let o of /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)])) (n || !we.has(o)) && X(e[o], t[o], n ? `${n}.${o}` : o, r, i, a);
|
|
38
|
+
else if (i && Y(e) && Y(t)) for (let o of t) {
|
|
39
|
+
if (o.id.includes(".")) continue;
|
|
40
|
+
let t = e.find((e) => e.id === o.id);
|
|
41
|
+
t && X(t, o, `${n}.${o.id}`, r, i, a);
|
|
42
|
+
}
|
|
43
|
+
else R(e, t) || r.set(n, t);
|
|
44
|
+
}
|
|
45
|
+
function Ee(e, t, n, r = [], i = /* @__PURE__ */ new Set()) {
|
|
46
|
+
let a = /* @__PURE__ */ new Map();
|
|
47
|
+
X(e, t, "", a, e.type !== "custom", i);
|
|
48
|
+
let o = new Set(e.type === "custom" ? de(e, r) : []), s = {}, c = {};
|
|
49
|
+
for (let [t, r] of a) if ((e.type === "custom" ? o.has(t) : I(e.type, t)) && typeof r == "string" && j(e, t) !== void 0) {
|
|
50
|
+
let i = n?.text?.[t];
|
|
51
|
+
s[t] = i && i.value === r ? i : {
|
|
52
|
+
value: r,
|
|
53
|
+
sourceHash: L(String(j(e, t) ?? ""))
|
|
54
|
+
};
|
|
55
|
+
} else c[t] = r === void 0 ? null : r;
|
|
56
|
+
let l = {};
|
|
57
|
+
return Object.keys(s).length && (l.text = s), Object.keys(c).length && (l.set = c), n?.hidden && (l.hidden = !0), l;
|
|
58
|
+
}
|
|
59
|
+
function De(e, t, n) {
|
|
60
|
+
let r = !1;
|
|
61
|
+
function i(e, t, n, a) {
|
|
62
|
+
let o = e[n], s = t[n], c = (e) => Array.isArray(e) && e.every((e) => J(e) && typeof e.id == "string");
|
|
63
|
+
if (c(o) && c(s) && (JSON.stringify(o.map((e) => e.id)) !== JSON.stringify(s.map((e) => e.id)) && (r = !0, e[n] = s.map((e) => M(o.find((t) => t.id === e.id) ?? e))), a)) for (let t of s) {
|
|
64
|
+
let r = e[n].find((e) => e.id === t.id);
|
|
65
|
+
r && i(r, t, a);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
let a = e, o = t;
|
|
69
|
+
if (e.type === "menu" && i(a, o, "items"), e.type === "table" && i(a, o, "rows", "cells"), e.type === "social" && i(a, o, "icons"), e.type === "section" && t.type === "section") {
|
|
70
|
+
let i = (e) => e.map((e) => e.map((e) => e.id));
|
|
71
|
+
(e.columns !== t.columns || JSON.stringify(i(e.children)) !== JSON.stringify(i(t.children))) && (r = !0, e.columns = t.columns, e.children = t.children.map((e) => e.map((e) => M(n(e.id) ?? e))));
|
|
72
|
+
}
|
|
73
|
+
return r;
|
|
74
|
+
}
|
|
75
|
+
function Oe(e, t, n) {
|
|
76
|
+
let r = (e) => {
|
|
77
|
+
let { locale: t, locales: n, l10n: r, ...i } = e;
|
|
78
|
+
return i;
|
|
79
|
+
}, i = /* @__PURE__ */ new Map();
|
|
80
|
+
X(r(e), r(t), "", i);
|
|
81
|
+
let a = {};
|
|
82
|
+
for (let [t, r] of i) if (ce.includes(t) && typeof r == "string" && j(e, t) !== void 0) {
|
|
83
|
+
let i = n?.text?.[t];
|
|
84
|
+
(a.text ??= {})[t] = i?.value === r ? i : {
|
|
85
|
+
value: r,
|
|
86
|
+
sourceHash: L(String(j(e, t) ?? ""))
|
|
87
|
+
};
|
|
88
|
+
} else (a.set ??= {})[t] = r === void 0 ? null : r;
|
|
89
|
+
return a;
|
|
90
|
+
}
|
|
91
|
+
function ke(e, t, n, r, i, a = []) {
|
|
92
|
+
let o = M(e ?? {}), s = [.../* @__PURE__ */ new Set([...a, ...[.../* @__PURE__ */ new Set([
|
|
93
|
+
...Object.keys(t.text ?? {}),
|
|
94
|
+
...Object.keys(t.set ?? {}),
|
|
95
|
+
...Object.keys(n.text ?? {}),
|
|
96
|
+
...Object.keys(n.set ?? {})
|
|
97
|
+
])].filter((e) => !R(t.text?.[e], n.text?.[e]) || !R(t.set?.[e], n.set?.[e]))])], c = Object.keys(e?.set ?? {}).filter((e) => s.some((t) => t.startsWith(`${e}.`)));
|
|
98
|
+
for (let e of c) {
|
|
99
|
+
let t = j(i, e), n = s.filter((t) => t.startsWith(`${e}.`) && R(j(r, t), j(i, t)));
|
|
100
|
+
if (R(t, j(r, e))) delete o.set[e];
|
|
101
|
+
else if (n.length && J(j(r, e)) && J(t)) {
|
|
102
|
+
delete o.set[e];
|
|
103
|
+
let i = (e, t, a) => {
|
|
104
|
+
if (!n.some((t) => e === t || e.startsWith(`${t}.`))) {
|
|
105
|
+
if (J(t) && J(a)) for (let n of /* @__PURE__ */ new Set([...Object.keys(t), ...Object.keys(a)])) i(`${e}.${n}`, t[n], a[n]);
|
|
106
|
+
else if (J(r) && r.type !== "custom" && Y(t) && Y(a)) for (let n of a) i(`${e}.${n.id}`, t.find((e) => e.id === n.id), n);
|
|
107
|
+
else J(r) && typeof r.type == "string" && pe(r, e, a) || o.text?.[e] && o.text[e].value === a || ((o.set ??= {})[e] = a === void 0 ? null : M(a));
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
i(e, j(r, e), t);
|
|
111
|
+
} else o.set[e] = t === void 0 ? null : M(t);
|
|
112
|
+
for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) {
|
|
113
|
+
if (!n.startsWith(`${e}.`)) continue;
|
|
114
|
+
let r = t === "text" ? o.text[n].value : o.set[n] ?? void 0;
|
|
115
|
+
R(r, j(i, n)) || delete o[t][n];
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
for (let e of s) if (!c.includes(e)) {
|
|
119
|
+
for (let t of ["text", "set"]) for (let n of Object.keys(o[t] ?? {})) (n === e || n.startsWith(`${e}.`)) && delete o[t][n];
|
|
120
|
+
n.text && Object.hasOwn(n.text, e) && ((o.text ??= {})[e] = n.text[e]), n.set && Object.hasOwn(n.set, e) && !c.some((t) => Object.hasOwn(o.set ?? {}, t) && e.startsWith(`${t}.`)) && ((o.set ??= {})[e] = n.set[e]);
|
|
121
|
+
}
|
|
122
|
+
return o.text && !Object.keys(o.text).length && delete o.text, o.set && !Object.keys(o.set).length && delete o.set, o;
|
|
123
|
+
}
|
|
124
|
+
function Ae(e) {
|
|
125
|
+
return [
|
|
126
|
+
"addBlock",
|
|
127
|
+
"removeBlock",
|
|
128
|
+
"moveBlock",
|
|
129
|
+
"duplicateBlock"
|
|
130
|
+
].includes(e);
|
|
131
|
+
}
|
|
132
|
+
function je(e, t, n) {
|
|
133
|
+
if (e.canEdit && !e.canEdit()) return !1;
|
|
134
|
+
let r = t === "addBlock", i = t === "duplicateBlock", a = typeof n[0] == "string" ? n[0] : n[0].id, o = r ? n[0] : e.findBlock?.(a);
|
|
135
|
+
if (!r && e.findBlock && !o) return !1;
|
|
136
|
+
let s = r ? null : e.findBlockLocation?.(a);
|
|
137
|
+
if (!r && e.findBlockLocation && !s || !r && e.isBlockLocked(a, !0) || s?.targetSectionId && e.isBlockLocked(s.targetSectionId, !0)) return !1;
|
|
138
|
+
if (r && e.content) {
|
|
139
|
+
let t = {
|
|
140
|
+
...e.content(),
|
|
141
|
+
blocks: [o]
|
|
142
|
+
};
|
|
143
|
+
F(t), k(t);
|
|
144
|
+
}
|
|
145
|
+
if (t === "removeBlock") return !0;
|
|
146
|
+
let c = i && n[1] === void 0 && n[2] === void 0, l = c ? s?.targetSectionId : n[t === "moveBlock" ? 2 : 1], u = (c ? s?.columnIndex : n[t === "moveBlock" ? 3 : 2]) ?? 0;
|
|
147
|
+
if (l) {
|
|
148
|
+
if (e.isBlockLocked(l, !0) || o?.type === "section") return !1;
|
|
149
|
+
if (e.findBlock) {
|
|
150
|
+
let t = e.findBlock(l);
|
|
151
|
+
if (t?.type !== "section" || u < 0 || u >= ue(t.columns)) return !1;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return t !== "moveBlock" || s?.targetSectionId !== l || (s?.columnIndex ?? 0) !== u || s?.index !== n[1];
|
|
155
|
+
}
|
|
156
|
+
var Me = /* @__PURE__ */ new WeakMap();
|
|
157
|
+
function Ne(e, t) {
|
|
158
|
+
Me.set(e, t);
|
|
159
|
+
for (let n of Object.values(e)) typeof n == "function" && Me.set(n, t);
|
|
160
|
+
}
|
|
161
|
+
function Z(e, t) {
|
|
162
|
+
let n = Me.get(e);
|
|
163
|
+
n && Me.set(t, n);
|
|
164
|
+
}
|
|
165
|
+
function Q(e, t, n) {
|
|
166
|
+
let r = Reflect.get(e, t), i = Me.get(e) ?? (typeof r == "function" ? Me.get(r) : void 0);
|
|
167
|
+
if (i) return i(t, n);
|
|
168
|
+
if (!Ae(t)) return !0;
|
|
169
|
+
let a = Reflect.get(e, "isBlockLocked");
|
|
170
|
+
if (typeof a != "function") return !0;
|
|
171
|
+
let o = { isBlockLocked: (t, n) => a.call(e, t, n) }, s = Reflect.get(e, "content");
|
|
172
|
+
c(s) ? o.content = () => s.value : typeof s == "function" && (o.content = () => s.call(e));
|
|
173
|
+
for (let t of [
|
|
174
|
+
"canEdit",
|
|
175
|
+
"findBlock",
|
|
176
|
+
"findBlockLocation"
|
|
177
|
+
]) {
|
|
178
|
+
let n = Reflect.get(e, t);
|
|
179
|
+
typeof n == "function" && (o[t] = n.bind(e));
|
|
180
|
+
}
|
|
181
|
+
return je(o, t, n);
|
|
182
|
+
}
|
|
183
|
+
function Pe(e) {
|
|
184
|
+
return e instanceof Error ? e : Error(String(e), { cause: e });
|
|
185
|
+
}
|
|
186
|
+
function Fe(e, t) {
|
|
187
|
+
try {
|
|
188
|
+
t();
|
|
189
|
+
} catch (t) {
|
|
190
|
+
e?.(Pe(t));
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
function Ie(t) {
|
|
194
|
+
let n = t.content ?? A(t.defaultFontFamily, t.templateDefaults);
|
|
195
|
+
F(n), k(n);
|
|
196
|
+
let i = s({
|
|
197
|
+
template: null,
|
|
198
|
+
content: n,
|
|
199
|
+
activeLocale: null,
|
|
200
|
+
selectedBlockId: null,
|
|
201
|
+
viewport: "desktop",
|
|
202
|
+
darkMode: !1,
|
|
203
|
+
previewMode: !1,
|
|
204
|
+
isDirty: !1,
|
|
205
|
+
isSaving: !1,
|
|
206
|
+
isLoading: !1,
|
|
207
|
+
uiTheme: "auto"
|
|
208
|
+
}), a = g(i, "activeLocale"), o = [];
|
|
209
|
+
function c(e) {
|
|
210
|
+
let t = H(i.content);
|
|
211
|
+
if (e === t && (e = null), e !== null && !i.content.settings.locales?.includes(e)) throw new z(`This template has no "${e}" version.`, void 0, "unknown_locale");
|
|
212
|
+
a.value = e;
|
|
213
|
+
}
|
|
214
|
+
v(() => a.value ?? H(i.content), (e) => Fe(t.onError, () => t.onLocaleChange?.(e))), v(() => i.content.settings.locales?.includes(a.value ?? ""), () => {
|
|
215
|
+
a.value && !i.content.settings.locales?.includes(a.value) && c(null);
|
|
216
|
+
});
|
|
217
|
+
function l() {
|
|
218
|
+
return a.value === null || t.localization === void 0 || t.localization.locales.includes(a.value);
|
|
219
|
+
}
|
|
220
|
+
function u(e) {
|
|
221
|
+
o = e;
|
|
222
|
+
}
|
|
223
|
+
function d(e) {
|
|
224
|
+
return te(i.content, e, o);
|
|
225
|
+
}
|
|
226
|
+
function f(e, n) {
|
|
227
|
+
if (!l()) return null;
|
|
228
|
+
if (e === "addLocale" && (!oe(n) || t.localization && !t.localization.locales.includes(n))) throw new z(`Locale "${n}" is not enabled.`, void 0, "unknown_locale");
|
|
229
|
+
let r = M(i.content);
|
|
230
|
+
return fe(r, [{
|
|
231
|
+
op: e,
|
|
232
|
+
locale: n
|
|
233
|
+
}]), R(r, i.content) ? null : r;
|
|
234
|
+
}
|
|
235
|
+
function m(e, t) {
|
|
236
|
+
let n = f(e, t);
|
|
237
|
+
n && (i.content = n, O());
|
|
238
|
+
}
|
|
239
|
+
function h(e) {
|
|
240
|
+
m("addLocale", e);
|
|
241
|
+
}
|
|
242
|
+
function _(e) {
|
|
243
|
+
m("removeLocale", e);
|
|
244
|
+
}
|
|
245
|
+
function y(e, t) {
|
|
246
|
+
let n = a.value;
|
|
247
|
+
Object.keys(t).length ? e.l10n = {
|
|
248
|
+
...e.l10n,
|
|
249
|
+
[n]: t
|
|
250
|
+
} : e.l10n && (delete e.l10n[n], Object.keys(e.l10n).length || delete e.l10n);
|
|
251
|
+
}
|
|
252
|
+
function b(e, t) {
|
|
253
|
+
let [n, r] = t;
|
|
254
|
+
if (!a.value || !l() || B(n)) return null;
|
|
255
|
+
let s = N(i.content.blocks, n);
|
|
256
|
+
if (!s) return null;
|
|
257
|
+
let c = s.l10n?.[a.value], u = W(s, a.value, H(i.content)), d = Ee(s, u, c, o), f = e === "resetLocaleFields" && Array.isArray(r) ? Te(s, u, r) : void 0, p = e === "resetLocaleFields" ? ke(c, d, Ee(s, u, c, o, f), s, u, Array.isArray(r) ? r : []) : M(c ?? {});
|
|
258
|
+
if (e === "setBlockHidden") r ? p.hidden = !0 : delete p.hidden;
|
|
259
|
+
else if (e === "resetLocaleFields") r || (delete p.text, delete p.set, delete p.hidden);
|
|
260
|
+
else for (let e of r) {
|
|
261
|
+
let t = p.text?.[e];
|
|
262
|
+
t && (t.sourceHash = L(String(j(s, e) ?? "")));
|
|
263
|
+
}
|
|
264
|
+
return p.text && !Object.keys(p.text).length && delete p.text, p.set && !Object.keys(p.set).length && delete p.set, R(c ?? {}, p) ? null : {
|
|
265
|
+
block: s,
|
|
266
|
+
layer: p
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
function x(e, t) {
|
|
270
|
+
let n = b(e, t);
|
|
271
|
+
n && (y(n.block, n.layer), O());
|
|
272
|
+
}
|
|
273
|
+
function S(e, t) {
|
|
274
|
+
x("setBlockHidden", [e, t]);
|
|
275
|
+
}
|
|
276
|
+
function C(e, t) {
|
|
277
|
+
x("resetLocaleFields", [e, t]);
|
|
278
|
+
}
|
|
279
|
+
function w(e, t) {
|
|
280
|
+
x("keepTranslations", [e, t]);
|
|
281
|
+
}
|
|
282
|
+
let T = p(0), E = 0, D = 0;
|
|
283
|
+
function O() {
|
|
284
|
+
i.isDirty = !0, D++;
|
|
285
|
+
}
|
|
286
|
+
let ee = r({
|
|
287
|
+
get: () => i.content,
|
|
288
|
+
set: (e) => {
|
|
289
|
+
i.content = e, O();
|
|
290
|
+
}
|
|
291
|
+
}), re = r(() => i.selectedBlockId ? N(i.content.blocks, i.selectedBlockId) : null);
|
|
292
|
+
function N(e, t) {
|
|
293
|
+
for (let n of e) {
|
|
294
|
+
if (n.id === t) return n;
|
|
295
|
+
if (n.type === "section") for (let e of n.children) {
|
|
296
|
+
let n = N(e, t);
|
|
297
|
+
if (n) return n;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
return null;
|
|
301
|
+
}
|
|
302
|
+
function P(e, t) {
|
|
303
|
+
if (t.add(e.id), e.type === "section") for (let n of e.children) for (let e of n) P(e, t);
|
|
304
|
+
}
|
|
305
|
+
function I(e, t, n = { blocks: e }) {
|
|
306
|
+
for (let r = 0; r < e.length; r++) {
|
|
307
|
+
let i = e[r];
|
|
308
|
+
if (i.id === t) return n;
|
|
309
|
+
if (i.type === "section") for (let e = 0; e < i.children.length; e++) {
|
|
310
|
+
let n = I(i.children[e], t, {
|
|
311
|
+
blocks: i.children[e],
|
|
312
|
+
sectionId: i.id,
|
|
313
|
+
columnIndex: e
|
|
314
|
+
});
|
|
315
|
+
if (n) return n;
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return null;
|
|
319
|
+
}
|
|
320
|
+
function B(e, n = !1) {
|
|
321
|
+
let r = a.value ?? t.lockLocale?.value ?? null;
|
|
322
|
+
for (let [i, a] of t.lockedBlocks?.value ?? []) {
|
|
323
|
+
let o = a;
|
|
324
|
+
if (o?.blockId === void 0) {
|
|
325
|
+
if (i === e) return !0;
|
|
326
|
+
} else if (o.blockId === e && o.holder?.sessionId !== t.lockSessionId && (n || r === null || o.locale == null || o.locale === r)) return !0;
|
|
327
|
+
}
|
|
328
|
+
return !1;
|
|
329
|
+
}
|
|
330
|
+
function V(e) {
|
|
331
|
+
let t = I(i.content.blocks, e);
|
|
332
|
+
if (!t) return null;
|
|
333
|
+
let n = t.blocks.findIndex((t) => t.id === e);
|
|
334
|
+
return n === -1 ? null : {
|
|
335
|
+
targetSectionId: t.sectionId,
|
|
336
|
+
columnIndex: t.columnIndex,
|
|
337
|
+
index: n
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
function U(e, t = !0) {
|
|
341
|
+
F(e), k(e), i.content = e, t && O();
|
|
342
|
+
}
|
|
343
|
+
function se(e) {
|
|
344
|
+
e && B(e) || (i.selectedBlockId = e);
|
|
345
|
+
}
|
|
346
|
+
function ce(e) {
|
|
347
|
+
i.viewport = e;
|
|
348
|
+
}
|
|
349
|
+
function le(e) {
|
|
350
|
+
i.darkMode = e;
|
|
351
|
+
}
|
|
352
|
+
function ue(e) {
|
|
353
|
+
i.uiTheme = e;
|
|
354
|
+
}
|
|
355
|
+
function de(e) {
|
|
356
|
+
i.previewMode = e, e && (i.selectedBlockId = null);
|
|
357
|
+
}
|
|
358
|
+
function pe(e, t) {
|
|
359
|
+
if (!l()) return !1;
|
|
360
|
+
let n = N(i.content.blocks, e);
|
|
361
|
+
if (!n) return !1;
|
|
362
|
+
if ("l10n" in t) throw new z("l10n is immutable in updateBlock.", void 0, "invalid_operation");
|
|
363
|
+
let r = {
|
|
364
|
+
...n,
|
|
365
|
+
...t
|
|
366
|
+
};
|
|
367
|
+
return !B(e, De(M(n), r, (e) => N(i.content.blocks, e)));
|
|
368
|
+
}
|
|
369
|
+
function me(e, n) {
|
|
370
|
+
if (!pe(e, n)) return;
|
|
371
|
+
let r = N(i.content.blocks, e);
|
|
372
|
+
if (!r) return;
|
|
373
|
+
let s = a.value;
|
|
374
|
+
if (s) {
|
|
375
|
+
let a = W(r, s, H(i.content)), c = {
|
|
376
|
+
...a,
|
|
377
|
+
...n
|
|
378
|
+
}, l = M(r), u = De(l, c, (e) => N(i.content.blocks, e));
|
|
379
|
+
if (B(e, u)) return;
|
|
380
|
+
u && t.onStructureChange?.();
|
|
381
|
+
let d = ne(l);
|
|
382
|
+
delete r.l10n, Object.assign(r, d), y(r, ke(r.l10n?.[s], Ee(r, a, r.l10n?.[s], o), Ee(r, c, r.l10n?.[s], o), r, c));
|
|
383
|
+
} else {
|
|
384
|
+
if (B(e, "children" in n || "columns" in n)) return;
|
|
385
|
+
let t = ne({
|
|
386
|
+
...r,
|
|
387
|
+
...n
|
|
388
|
+
});
|
|
389
|
+
delete r.l10n, Object.assign(r, t);
|
|
390
|
+
}
|
|
391
|
+
O();
|
|
392
|
+
}
|
|
393
|
+
function he(e) {
|
|
394
|
+
if ("locales" in e || "l10n" in e) throw new z("locales and l10n are immutable in updateSettings.", void 0, "invalid_operation");
|
|
395
|
+
if ("locale" in e && e.locale !== H(i.content) && i.content.settings.locales?.length) throw new z("The default locale can't change while language versions exist.", void 0, "invalid_operation");
|
|
396
|
+
}
|
|
397
|
+
function G(e) {
|
|
398
|
+
if (!l()) return;
|
|
399
|
+
he(e);
|
|
400
|
+
let t = a.value;
|
|
401
|
+
if (!t) i.content.settings = ie({
|
|
402
|
+
...i.content.settings,
|
|
403
|
+
...e
|
|
404
|
+
});
|
|
405
|
+
else {
|
|
406
|
+
let n = i.content.settings, r = ae(i.content, t).settings, a = {
|
|
407
|
+
...r,
|
|
408
|
+
locale: n.locale,
|
|
409
|
+
...e
|
|
410
|
+
}, o = n.l10n?.[t], s = ke(o, Oe(n, r, o), Oe(n, a, o), n, a);
|
|
411
|
+
Object.keys(s).length ? n.l10n = {
|
|
412
|
+
...n.l10n,
|
|
413
|
+
[t]: s
|
|
414
|
+
} : n.l10n && (delete n.l10n[t], Object.keys(n.l10n).length || delete n.l10n);
|
|
415
|
+
}
|
|
416
|
+
O();
|
|
417
|
+
}
|
|
418
|
+
let K = {
|
|
419
|
+
canEdit: l,
|
|
420
|
+
content: () => i.content,
|
|
421
|
+
findBlock: (e) => N(i.content.blocks, e),
|
|
422
|
+
findBlockLocation: V,
|
|
423
|
+
isBlockLocked: B
|
|
424
|
+
};
|
|
425
|
+
function ge(e, n, r = 0, o) {
|
|
426
|
+
if (je(K, "addBlock", [
|
|
427
|
+
e,
|
|
428
|
+
n,
|
|
429
|
+
r,
|
|
430
|
+
o
|
|
431
|
+
])) {
|
|
432
|
+
if (n) {
|
|
433
|
+
let t = N(i.content.blocks, n);
|
|
434
|
+
if (t && t.type === "section") {
|
|
435
|
+
t.children[r] = t.children[r] || [];
|
|
436
|
+
let n = t.children[r];
|
|
437
|
+
o !== void 0 && o < n.length ? n.splice(o, 0, e) : n.push(e);
|
|
438
|
+
}
|
|
439
|
+
} else o !== void 0 && o < i.content.blocks.length ? i.content.blocks.splice(o, 0, e) : i.content.blocks.push(e);
|
|
440
|
+
a.value && t.onStructureChange?.(), O();
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
function _e(e) {
|
|
444
|
+
if (!je(K, "removeBlock", [e])) return;
|
|
445
|
+
let n = I(i.content.blocks, e);
|
|
446
|
+
if (n) {
|
|
447
|
+
let r = n.blocks.findIndex((t) => t.id === e);
|
|
448
|
+
if (r !== -1) {
|
|
449
|
+
let [e] = n.blocks.splice(r, 1);
|
|
450
|
+
if (i.selectedBlockId) {
|
|
451
|
+
let t = /* @__PURE__ */ new Set();
|
|
452
|
+
P(e, t), t.has(i.selectedBlockId) && (i.selectedBlockId = null);
|
|
453
|
+
}
|
|
454
|
+
a.value && t.onStructureChange?.(), O();
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
function ve(e, n, r, o = 0) {
|
|
459
|
+
if (!je(K, "moveBlock", [
|
|
460
|
+
e,
|
|
461
|
+
n,
|
|
462
|
+
r,
|
|
463
|
+
o
|
|
464
|
+
])) return;
|
|
465
|
+
let s = I(i.content.blocks, e), c = s.blocks.findIndex((t) => t.id === e), l;
|
|
466
|
+
if (r) {
|
|
467
|
+
let e = N(i.content.blocks, r);
|
|
468
|
+
e.children[o] = e.children[o] || [], l = e.children[o];
|
|
469
|
+
} else l = i.content.blocks;
|
|
470
|
+
let [u] = s.blocks.splice(c, 1);
|
|
471
|
+
l.splice(n, 0, u), a.value && t.onStructureChange?.(), O();
|
|
472
|
+
}
|
|
473
|
+
function ye() {
|
|
474
|
+
O();
|
|
475
|
+
}
|
|
476
|
+
function be(e, t) {
|
|
477
|
+
throw new z(`[Templatical] Templates: ${e} ${t}`);
|
|
478
|
+
}
|
|
479
|
+
function xe(e) {
|
|
480
|
+
Fe(t.onError, e);
|
|
481
|
+
}
|
|
482
|
+
function Se(e) {
|
|
483
|
+
let { templates: n } = t;
|
|
484
|
+
return n || be(e, "needs a templates provider. Pass one as `init({ templates })` to enable saving and loading."), n;
|
|
485
|
+
}
|
|
486
|
+
function q(e) {
|
|
487
|
+
i.template && (i.template = {
|
|
488
|
+
...i.template,
|
|
489
|
+
name: e
|
|
490
|
+
}, O());
|
|
491
|
+
}
|
|
492
|
+
async function Ce(e) {
|
|
493
|
+
let n = Se("create()"), { create: r } = n;
|
|
494
|
+
typeof r != "function" && be("create()", "is disabled by the provider — its `create` is `false`.");
|
|
495
|
+
let a, o = ++E;
|
|
496
|
+
i.isLoading = !0;
|
|
497
|
+
try {
|
|
498
|
+
e?.content && (i.content = e.content);
|
|
499
|
+
let t = D;
|
|
500
|
+
a = await r(e?.name === void 0 ? { content: i.content } : {
|
|
501
|
+
name: e.name,
|
|
502
|
+
content: i.content
|
|
503
|
+
}), i.template = a, D === t && (i.isDirty = !1), T.value++;
|
|
504
|
+
} catch (e) {
|
|
505
|
+
throw t.onError?.(e), e;
|
|
506
|
+
} finally {
|
|
507
|
+
E === o && (i.isLoading = !1);
|
|
508
|
+
}
|
|
509
|
+
return xe(() => n.onCreated?.(a)), a;
|
|
510
|
+
}
|
|
511
|
+
async function J(e, n) {
|
|
512
|
+
let r = Se("load()"), a, o = ++E;
|
|
513
|
+
i.isLoading = !0;
|
|
514
|
+
try {
|
|
515
|
+
if (a = await r.load(e), F(a.content), k(a.content), n && !n()) return a;
|
|
516
|
+
i.template = a, i.content = a.content, i.isDirty = !1, T.value++;
|
|
517
|
+
} catch (e) {
|
|
518
|
+
throw t.onError?.(e), e;
|
|
519
|
+
} finally {
|
|
520
|
+
E === o && (i.isLoading = !1);
|
|
521
|
+
}
|
|
522
|
+
return xe(() => r.onLoaded?.(a)), a;
|
|
523
|
+
}
|
|
524
|
+
async function Y(e = "api") {
|
|
525
|
+
let n = Se("save()"), { save: r } = n;
|
|
526
|
+
typeof r != "function" && be("save()", "is disabled by the provider — its `save` is `false`.");
|
|
527
|
+
let a = i.template;
|
|
528
|
+
a || be("save()", "has no template loaded. Call create() or load() first.");
|
|
529
|
+
let o = a.name === void 0 ? { content: i.content } : {
|
|
530
|
+
name: a.name,
|
|
531
|
+
content: i.content
|
|
532
|
+
}, s;
|
|
533
|
+
i.isSaving = !0;
|
|
534
|
+
try {
|
|
535
|
+
let e = D;
|
|
536
|
+
if (s = await r(a.id, o), i.template?.id === a.id) {
|
|
537
|
+
let e = i.template.name;
|
|
538
|
+
i.template = e === a.name ? s : {
|
|
539
|
+
...s,
|
|
540
|
+
name: e
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
D === e && (i.isDirty = !1);
|
|
544
|
+
} catch (e) {
|
|
545
|
+
throw t.onError?.(e), e;
|
|
546
|
+
} finally {
|
|
547
|
+
i.isSaving = !1;
|
|
548
|
+
}
|
|
549
|
+
return xe(() => n.onSaved?.(s, { trigger: e })), s;
|
|
550
|
+
}
|
|
551
|
+
function we() {
|
|
552
|
+
return i.template?.id !== void 0;
|
|
553
|
+
}
|
|
554
|
+
let X = {
|
|
555
|
+
state: e(i),
|
|
556
|
+
loadVersion: e(T),
|
|
557
|
+
content: ee,
|
|
558
|
+
selectedBlock: re,
|
|
559
|
+
activeLocale: a,
|
|
560
|
+
setActiveLocale: c,
|
|
561
|
+
addLocale: h,
|
|
562
|
+
removeLocale: _,
|
|
563
|
+
setBlockHidden: S,
|
|
564
|
+
resetLocaleFields: C,
|
|
565
|
+
keepTranslations: w,
|
|
566
|
+
setCustomBlockDefinitions: u,
|
|
567
|
+
createSetDefaultLocaleOperation: d,
|
|
568
|
+
isBlockLocked: B,
|
|
569
|
+
setContent: U,
|
|
570
|
+
selectBlock: se,
|
|
571
|
+
setViewport: ce,
|
|
572
|
+
setDarkMode: le,
|
|
573
|
+
setUiTheme: ue,
|
|
574
|
+
setPreviewMode: de,
|
|
575
|
+
updateBlock: me,
|
|
576
|
+
updateSettings: G,
|
|
577
|
+
addBlock: ge,
|
|
578
|
+
removeBlock: _e,
|
|
579
|
+
moveBlock: ve,
|
|
580
|
+
markDirty: ye,
|
|
581
|
+
findBlockLocation: V,
|
|
582
|
+
setName: q,
|
|
583
|
+
create: Ce,
|
|
584
|
+
load: J,
|
|
585
|
+
save: Y,
|
|
586
|
+
hasTemplate: we
|
|
587
|
+
};
|
|
588
|
+
return Ne(X, (e, t) => Ae(e) ? je(K, e, t) : l() ? e === "updateBlock" ? pe(t[0], t[1]) : (e === "updateSettings" && he(t[0]), e === "addLocale" || e === "removeLocale" ? f(e, t[0]) !== null : e === "setBlockHidden" || e === "resetLocaleFields" || e === "keepTranslations" ? b(e, t) !== null : !0) : !1), X;
|
|
589
|
+
}
|
|
590
|
+
var Le = 50, Re = 300, ze = 1500;
|
|
591
|
+
function Be(e) {
|
|
592
|
+
let { content: t, setContent: n, maxSize: i = Le } = e, a = p([]), o = p([]), s = p(!1), c = null, l = null, u = r(() => a.value.length > 0), d = r(() => o.value.length > 0);
|
|
593
|
+
function f() {
|
|
594
|
+
return M(t.value);
|
|
595
|
+
}
|
|
596
|
+
function m(e) {
|
|
597
|
+
a.value.push(e), a.value.length > i && a.value.splice(0, a.value.length - i);
|
|
598
|
+
}
|
|
599
|
+
function h() {
|
|
600
|
+
l &&= (clearTimeout(l.timeoutId), null);
|
|
601
|
+
}
|
|
602
|
+
function g() {
|
|
603
|
+
h(), m(f()), o.value = [];
|
|
604
|
+
}
|
|
605
|
+
function _(e) {
|
|
606
|
+
l && l.blockId === e ? (clearTimeout(l.timeoutId), l.timeoutId = setTimeout(() => {
|
|
607
|
+
l = null;
|
|
608
|
+
}, Re)) : (h(), m(f()), o.value = [], l = {
|
|
609
|
+
blockId: e,
|
|
610
|
+
timeoutId: setTimeout(() => {
|
|
611
|
+
l = null;
|
|
612
|
+
}, Re)
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
function v() {
|
|
616
|
+
s.value = !0, c && clearTimeout(c), c = setTimeout(() => {
|
|
617
|
+
s.value = !1, c = null;
|
|
618
|
+
}, ze);
|
|
619
|
+
}
|
|
620
|
+
function y() {
|
|
621
|
+
if (a.value.length === 0) return;
|
|
622
|
+
h();
|
|
623
|
+
let e = a.value.pop();
|
|
624
|
+
o.value.push(f()), n(e, !0), v();
|
|
625
|
+
}
|
|
626
|
+
function b() {
|
|
627
|
+
if (o.value.length === 0) return;
|
|
628
|
+
h();
|
|
629
|
+
let e = o.value.pop();
|
|
630
|
+
a.value.push(f()), n(e, !0), v();
|
|
631
|
+
}
|
|
632
|
+
function x() {
|
|
633
|
+
a.value = [], o.value = [], h();
|
|
634
|
+
}
|
|
635
|
+
function S() {
|
|
636
|
+
x(), c &&= (clearTimeout(c), null);
|
|
637
|
+
}
|
|
638
|
+
return {
|
|
639
|
+
canUndo: u,
|
|
640
|
+
canRedo: d,
|
|
641
|
+
isNavigating: s,
|
|
642
|
+
undo: y,
|
|
643
|
+
redo: b,
|
|
644
|
+
record: g,
|
|
645
|
+
recordDebounced: _,
|
|
646
|
+
clear: x,
|
|
647
|
+
destroy: S,
|
|
648
|
+
flushDebounce: h
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
function Ve(e) {
|
|
652
|
+
let { addBlock: t, removeBlock: n, updateBlock: r, selectBlock: i, findBlockLocation: a } = e;
|
|
653
|
+
function o(n, r, a) {
|
|
654
|
+
let o = typeof e.blockDefaults == "function" ? e.blockDefaults() : e.blockDefaults, s = T(n, o);
|
|
655
|
+
return t(s, r, a), i(s.id), s;
|
|
656
|
+
}
|
|
657
|
+
function s(e, n, r) {
|
|
658
|
+
let o = O(e);
|
|
659
|
+
if (!Q(t, "duplicateBlock", [
|
|
660
|
+
e,
|
|
661
|
+
n,
|
|
662
|
+
r
|
|
663
|
+
])) return o;
|
|
664
|
+
if (n !== void 0 || r !== void 0) t(o, n, r);
|
|
665
|
+
else {
|
|
666
|
+
let i = a?.(e.id) ?? null;
|
|
667
|
+
i ? t(o, i.targetSectionId, i.columnIndex, i.index + 1) : t(o, n, r);
|
|
668
|
+
}
|
|
669
|
+
return i(o.id), o;
|
|
670
|
+
}
|
|
671
|
+
function c(e) {
|
|
672
|
+
n(e);
|
|
673
|
+
}
|
|
674
|
+
function l(e, t, n) {
|
|
675
|
+
r(e, { [t]: n });
|
|
676
|
+
}
|
|
677
|
+
return {
|
|
678
|
+
createAndAddBlock: o,
|
|
679
|
+
duplicateBlock: s,
|
|
680
|
+
deleteBlock: c,
|
|
681
|
+
updateBlockProperty: l
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
var He = 2e3;
|
|
685
|
+
function Ue(e) {
|
|
686
|
+
let { content: t, isDirty: n, onChange: r, debounce: i = He, enabled: a = !0 } = e, o = null, s = !1;
|
|
687
|
+
function c() {
|
|
688
|
+
return typeof a == "function" ? a() : a;
|
|
689
|
+
}
|
|
690
|
+
function l() {
|
|
691
|
+
s = !0, d();
|
|
692
|
+
}
|
|
693
|
+
function u() {
|
|
694
|
+
s = !1;
|
|
695
|
+
}
|
|
696
|
+
function d() {
|
|
697
|
+
o &&= (clearTimeout(o), null);
|
|
698
|
+
}
|
|
699
|
+
function f() {
|
|
700
|
+
d(), n() && r(JSON.parse(JSON.stringify(t.value)));
|
|
701
|
+
}
|
|
702
|
+
function p() {
|
|
703
|
+
c() && !s && (d(), o = setTimeout(() => {
|
|
704
|
+
o = null, c() && !s && n() && r(JSON.parse(JSON.stringify(t.value)));
|
|
705
|
+
}, i));
|
|
706
|
+
}
|
|
707
|
+
let m = v(t, () => {
|
|
708
|
+
p();
|
|
709
|
+
}, { deep: !0 });
|
|
710
|
+
function h() {
|
|
711
|
+
m(), d();
|
|
712
|
+
}
|
|
713
|
+
return {
|
|
714
|
+
flush: f,
|
|
715
|
+
cancel: d,
|
|
716
|
+
pause: l,
|
|
717
|
+
resume: u,
|
|
718
|
+
destroy: h
|
|
719
|
+
};
|
|
720
|
+
}
|
|
721
|
+
function We(e) {
|
|
722
|
+
let t = s(/* @__PURE__ */ new Set()), n = r(() => t.size > 0);
|
|
723
|
+
function i(e) {
|
|
724
|
+
return t.has(e);
|
|
725
|
+
}
|
|
726
|
+
function a(n) {
|
|
727
|
+
t.has(n) ? t.delete(n) : (t.add(n), e.state.selectedBlockId === n && e.selectBlock(null));
|
|
728
|
+
}
|
|
729
|
+
function o() {
|
|
730
|
+
t.clear();
|
|
731
|
+
}
|
|
732
|
+
return {
|
|
733
|
+
isHidden: i,
|
|
734
|
+
toggleBlock: a,
|
|
735
|
+
reset: o,
|
|
736
|
+
hasHiddenBlocks: n
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
function Ge(e) {
|
|
740
|
+
let t = p(!1), n = p(!1), i = r(() => !!e.definition.value?.dataSource), a = r(() => i.value && !e.block.value.dataSourceFetched);
|
|
741
|
+
async function o() {
|
|
742
|
+
let r = e.definition.value;
|
|
743
|
+
if (r?.dataSource) {
|
|
744
|
+
t.value = !0, n.value = !1;
|
|
745
|
+
try {
|
|
746
|
+
let t = await r.dataSource.onFetch({
|
|
747
|
+
fieldValues: { ...e.block.value.fieldValues },
|
|
748
|
+
blockId: e.block.value.id
|
|
749
|
+
});
|
|
750
|
+
if (t == null) return;
|
|
751
|
+
let n = { ...e.block.value.fieldValues };
|
|
752
|
+
for (let e of Object.keys(n)) e in t && (n[e] = t[e]);
|
|
753
|
+
e.onUpdate(n, !0);
|
|
754
|
+
} catch (e) {
|
|
755
|
+
console.warn("[Templatical] Data source fetch error:", e), n.value = !0;
|
|
756
|
+
} finally {
|
|
757
|
+
t.value = !1;
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
return {
|
|
762
|
+
isFetching: t,
|
|
763
|
+
fetchError: n,
|
|
764
|
+
fetch: o,
|
|
765
|
+
hasDataSource: i,
|
|
766
|
+
needsFetch: a
|
|
767
|
+
};
|
|
768
|
+
}
|
|
769
|
+
function Ke(e, t) {
|
|
770
|
+
e.activeLocale && v(e.activeLocale, () => t.flushDebounce?.());
|
|
771
|
+
for (let n of [
|
|
772
|
+
"addLocale",
|
|
773
|
+
"removeLocale",
|
|
774
|
+
"setBlockHidden",
|
|
775
|
+
"resetLocaleFields",
|
|
776
|
+
"keepTranslations"
|
|
777
|
+
]) {
|
|
778
|
+
let r = e[n];
|
|
779
|
+
r && (Object.assign(e, { [n]: (...i) => {
|
|
780
|
+
Q(e, n, i) && (["addLocale", "removeLocale"].includes(n) || !e.isBlockLocked(i[0])) && (t.record(), r(...i));
|
|
781
|
+
} }), Z(r, e[n]));
|
|
782
|
+
}
|
|
783
|
+
let n = e.addBlock, r = e.removeBlock, i = e.moveBlock, a = e.updateBlock, o = e.updateSettings;
|
|
784
|
+
e.addBlock = (r, i, a, o) => {
|
|
785
|
+
Q(e, "addBlock", [
|
|
786
|
+
r,
|
|
787
|
+
i,
|
|
788
|
+
a,
|
|
789
|
+
o
|
|
790
|
+
]) && (t.record(), n(r, i, a, o));
|
|
791
|
+
}, e.removeBlock = (n) => {
|
|
792
|
+
Q(e, "removeBlock", [n]) && (t.record(), r(n));
|
|
793
|
+
}, e.moveBlock = (n, r, a, o) => {
|
|
794
|
+
Q(e, "moveBlock", [
|
|
795
|
+
n,
|
|
796
|
+
r,
|
|
797
|
+
a,
|
|
798
|
+
o
|
|
799
|
+
]) && (t.record(), i(n, r, a, o));
|
|
800
|
+
}, Z(n, e.addBlock), Z(r, e.removeBlock), Z(i, e.moveBlock), e.updateBlock = (n, r) => {
|
|
801
|
+
Q(e, "updateBlock", [n, r]) && (e.isBlockLocked(n) || (t.recordDebounced(n), a(n, r)));
|
|
802
|
+
}, e.updateSettings = (n) => {
|
|
803
|
+
Q(e, "updateSettings", [n]) && (t.record(), o(n));
|
|
804
|
+
}, Z(a, e.updateBlock), Z(o, e.updateSettings);
|
|
805
|
+
}
|
|
806
|
+
var qe = "root", Je = /* @__PURE__ */ new Set([
|
|
807
|
+
"id",
|
|
808
|
+
"type",
|
|
809
|
+
"children",
|
|
810
|
+
"l10n"
|
|
811
|
+
]), Ye = /* @__PURE__ */ new Set([
|
|
812
|
+
"id",
|
|
813
|
+
"type",
|
|
814
|
+
"children",
|
|
815
|
+
"columns",
|
|
816
|
+
"l10n"
|
|
817
|
+
]), Xe = /* @__PURE__ */ new Set(), Ze = /* @__PURE__ */ new Set(["locales", "l10n"]);
|
|
818
|
+
function Qe(e) {
|
|
819
|
+
return e === null ? qe : JSON.stringify([e.sectionId, e.column]);
|
|
820
|
+
}
|
|
821
|
+
function $e(e) {
|
|
822
|
+
let t = e.children;
|
|
823
|
+
return e.type === "section" && Array.isArray(t) ? t : [];
|
|
824
|
+
}
|
|
825
|
+
function et(e) {
|
|
826
|
+
let t = /* @__PURE__ */ new Map(), n = (e, r) => {
|
|
827
|
+
e.forEach((e, i) => {
|
|
828
|
+
t.has(e.id) || t.set(e.id, {
|
|
829
|
+
block: e,
|
|
830
|
+
key: Qe(r),
|
|
831
|
+
index: i
|
|
832
|
+
}), $e(e).forEach((t, r) => {
|
|
833
|
+
Array.isArray(t) && n(t, {
|
|
834
|
+
sectionId: e.id,
|
|
835
|
+
column: r
|
|
836
|
+
});
|
|
837
|
+
});
|
|
838
|
+
});
|
|
839
|
+
};
|
|
840
|
+
return n(e, null), t;
|
|
841
|
+
}
|
|
842
|
+
function tt(e) {
|
|
843
|
+
let t = [], n = Array(e.length).fill(-1);
|
|
844
|
+
e.forEach((r, i) => {
|
|
845
|
+
let a = 0, o = t.length;
|
|
846
|
+
for (; a < o;) {
|
|
847
|
+
let n = a + o >> 1;
|
|
848
|
+
e[t[n]] < r ? a = n + 1 : o = n;
|
|
849
|
+
}
|
|
850
|
+
a > 0 && (n[i] = t[a - 1]), t[a] = i;
|
|
851
|
+
});
|
|
852
|
+
let r = /* @__PURE__ */ new Set(), i = t.length > 0 ? t[t.length - 1] : -1;
|
|
853
|
+
for (; i !== -1;) r.add(i), i = n[i];
|
|
854
|
+
return r;
|
|
855
|
+
}
|
|
856
|
+
function nt(e, t, n) {
|
|
857
|
+
let r = {}, i = [];
|
|
858
|
+
for (let i of Object.keys(t)) n.has(i) || t[i] === void 0 || R(e[i], t[i]) || (r[i] = M(t[i]));
|
|
859
|
+
for (let r of Object.keys(e)) n.has(r) || e[r] === void 0 || t[r] === void 0 && i.push(r);
|
|
860
|
+
return {
|
|
861
|
+
set: r,
|
|
862
|
+
unset: i
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
function rt(e = {}, t = {}) {
|
|
866
|
+
let n = nt(e.text ?? {}, t.text ?? {}, Xe), r = nt(e.set ?? {}, t.set ?? {}, Xe), i = [.../* @__PURE__ */ new Set([...n.unset, ...r.unset])];
|
|
867
|
+
return {
|
|
868
|
+
...Object.keys(n.set).length > 0 ? { text: n.set } : {},
|
|
869
|
+
...Object.keys(r.set).length > 0 ? { set: r.set } : {},
|
|
870
|
+
...i.length > 0 ? { unset: i } : {},
|
|
871
|
+
...e.hidden === t.hidden ? {} : { hidden: t.hidden === !0 }
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
function it(e, t) {
|
|
875
|
+
if (e.settings.locale !== t.settings.locale && (e.settings.locales?.length || t.settings.locales?.length)) return [{
|
|
876
|
+
op: "setContent",
|
|
877
|
+
content: M(t)
|
|
878
|
+
}];
|
|
879
|
+
let n = et(e.blocks), r = et(t.blocks), i = [], a = (e) => {
|
|
880
|
+
let t = r.get(e), i = n.get(e);
|
|
881
|
+
return t !== void 0 && i !== void 0 && t.block.type !== i.block.type;
|
|
882
|
+
}, o = (e) => r.has(e.id) && !a(e.id), s = (e) => $e(e).some((e) => Array.isArray(e) && e.some((e) => o(e) || !a(e.id) && s(e))), c = /* @__PURE__ */ new Set(), l = [], u = (e, t) => {
|
|
883
|
+
let n = "kept";
|
|
884
|
+
t === "dropped" ? (c.add(e.id), n = "dropped") : a(e.id) ? (i.push({
|
|
885
|
+
op: "deleteBlock",
|
|
886
|
+
blockId: e.id
|
|
887
|
+
}), c.add(e.id), n = "dropped") : r.has(e.id) || (t === "deferred" ? n = "deferred" : s(e) ? (l.push(e.id), n = "deferred") : (i.push({
|
|
888
|
+
op: "deleteBlock",
|
|
889
|
+
blockId: e.id
|
|
890
|
+
}), c.add(e.id), n = "dropped"));
|
|
891
|
+
for (let t of $e(e)) if (Array.isArray(t)) for (let e of t) u(e, n);
|
|
892
|
+
};
|
|
893
|
+
for (let t of e.blocks) u(t, "kept");
|
|
894
|
+
let d = (e) => n.has(e) && !c.has(e), f = (e) => {
|
|
895
|
+
let t = M(e);
|
|
896
|
+
return t.type === "section" && (t.children = $e(e).map((e) => Array.isArray(e) ? e.filter((e) => !d(e.id)).map((e) => M(e)) : e)), t;
|
|
897
|
+
}, p = (e, t, r) => {
|
|
898
|
+
let a = Qe(e), o = [], s = [];
|
|
899
|
+
t.forEach((e, t) => {
|
|
900
|
+
let r = n.get(e.id);
|
|
901
|
+
d(e.id) && r !== void 0 && r.key === a && (o.push(r.index), s.push(t));
|
|
902
|
+
});
|
|
903
|
+
let c = new Set([...tt(o)].map((e) => s[e]));
|
|
904
|
+
t.forEach((n, a) => {
|
|
905
|
+
if (c.has(a) || r(n)) return;
|
|
906
|
+
let o = a > 0 ? t[a - 1].id : null;
|
|
907
|
+
i.push(d(n.id) ? {
|
|
908
|
+
op: "moveBlock",
|
|
909
|
+
blockId: n.id,
|
|
910
|
+
parent: e,
|
|
911
|
+
after: o
|
|
912
|
+
} : {
|
|
913
|
+
op: "addBlock",
|
|
914
|
+
block: f(n),
|
|
915
|
+
parent: e,
|
|
916
|
+
after: o
|
|
917
|
+
});
|
|
918
|
+
});
|
|
919
|
+
};
|
|
920
|
+
p(null, t.blocks, () => !1);
|
|
921
|
+
let m = t.blocks.filter((e) => e.type === "section"), h = /* @__PURE__ */ new Set(), g = (e) => {
|
|
922
|
+
for (let t of m) {
|
|
923
|
+
if (!d(t.id)) continue;
|
|
924
|
+
let r = $e(n.get(t.id).block).length, a = $e(t).length;
|
|
925
|
+
(e ? a > r : a < r) && (i.push({
|
|
926
|
+
op: "updateBlock",
|
|
927
|
+
blockId: t.id,
|
|
928
|
+
set: { columns: t.columns }
|
|
929
|
+
}), h.add(t.id));
|
|
930
|
+
}
|
|
931
|
+
};
|
|
932
|
+
g(!0);
|
|
933
|
+
for (let e of m) {
|
|
934
|
+
let t = !d(e.id);
|
|
935
|
+
$e(e).forEach((n, r) => {
|
|
936
|
+
Array.isArray(n) && p({
|
|
937
|
+
sectionId: e.id,
|
|
938
|
+
column: r
|
|
939
|
+
}, n, (e) => t && !d(e.id));
|
|
940
|
+
});
|
|
941
|
+
}
|
|
942
|
+
g(!1);
|
|
943
|
+
for (let e of l) i.push({
|
|
944
|
+
op: "deleteBlock",
|
|
945
|
+
blockId: e
|
|
946
|
+
});
|
|
947
|
+
for (let [e, t] of r) {
|
|
948
|
+
if (!d(e)) continue;
|
|
949
|
+
let { set: r, unset: a } = nt(n.get(e).block, t.block, h.has(e) ? Ye : Je);
|
|
950
|
+
(Object.keys(r).length !== 0 || a.length !== 0) && i.push({
|
|
951
|
+
op: "updateBlock",
|
|
952
|
+
blockId: e,
|
|
953
|
+
...Object.keys(r).length > 0 ? { set: r } : {},
|
|
954
|
+
...a.length > 0 ? { unset: a } : {}
|
|
955
|
+
});
|
|
956
|
+
}
|
|
957
|
+
let _ = nt(e.settings, t.settings, Ze);
|
|
958
|
+
(Object.keys(_.set).length > 0 || _.unset.length > 0) && i.push({
|
|
959
|
+
op: "updateSettings",
|
|
960
|
+
...Object.keys(_.set).length > 0 ? { set: _.set } : {},
|
|
961
|
+
..._.unset.length > 0 ? { unset: _.unset } : {}
|
|
962
|
+
});
|
|
963
|
+
let v = new Set(e.settings.locales ?? []), y = new Set(t.settings.locales ?? []);
|
|
964
|
+
for (let e of y) v.has(e) || i.push({
|
|
965
|
+
op: "addLocale",
|
|
966
|
+
locale: e
|
|
967
|
+
});
|
|
968
|
+
for (let [e, t] of r) {
|
|
969
|
+
if (!d(e)) continue;
|
|
970
|
+
let r = n.get(e).block.l10n ?? {}, a = t.block.l10n ?? {};
|
|
971
|
+
for (let t of /* @__PURE__ */ new Set([...Object.keys(r), ...Object.keys(a)])) {
|
|
972
|
+
if (!y.has(t)) continue;
|
|
973
|
+
let n = rt(r[t], a[t]);
|
|
974
|
+
Object.keys(n).length > 0 && i.push({
|
|
975
|
+
op: "updateBlockLocale",
|
|
976
|
+
blockId: e,
|
|
977
|
+
locale: t,
|
|
978
|
+
...n
|
|
979
|
+
});
|
|
980
|
+
}
|
|
981
|
+
}
|
|
982
|
+
let b = e.settings.l10n ?? {}, x = t.settings.l10n ?? {};
|
|
983
|
+
for (let e of /* @__PURE__ */ new Set([...Object.keys(b), ...Object.keys(x)])) {
|
|
984
|
+
if (!y.has(e)) continue;
|
|
985
|
+
let t = rt(b[e], x[e]);
|
|
986
|
+
Object.keys(t).length > 0 && i.push({
|
|
987
|
+
op: "updateSettingsLocale",
|
|
988
|
+
locale: e,
|
|
989
|
+
...t
|
|
990
|
+
});
|
|
991
|
+
}
|
|
992
|
+
for (let e of v) y.has(e) || i.push({
|
|
993
|
+
op: "removeLocale",
|
|
994
|
+
locale: e
|
|
995
|
+
});
|
|
996
|
+
return i;
|
|
997
|
+
}
|
|
998
|
+
function $(e) {
|
|
999
|
+
let t = /* @__PURE__ */ new Map(), n = (e) => {
|
|
1000
|
+
t.set(e.id, e), e.type === "section" && e.children.flat().forEach(n);
|
|
1001
|
+
};
|
|
1002
|
+
return e.forEach(n), t;
|
|
1003
|
+
}
|
|
1004
|
+
function at(e, t) {
|
|
1005
|
+
if (t === null) return e.blocks;
|
|
1006
|
+
let n = $(e.blocks).get(t.sectionId);
|
|
1007
|
+
return n.type === "section" ? n.children[t.column] : [];
|
|
1008
|
+
}
|
|
1009
|
+
function ot(e, t) {
|
|
1010
|
+
let n = (e, r) => {
|
|
1011
|
+
let i = e.findIndex((e) => e.id === t);
|
|
1012
|
+
if (i >= 0) return {
|
|
1013
|
+
parent: r,
|
|
1014
|
+
after: e[i - 1]?.id ?? null
|
|
1015
|
+
};
|
|
1016
|
+
for (let t of e) if (t.type === "section") for (let [e, r] of t.children.entries()) {
|
|
1017
|
+
let i = n(r, {
|
|
1018
|
+
sectionId: t.id,
|
|
1019
|
+
column: e
|
|
1020
|
+
});
|
|
1021
|
+
if (i) return i;
|
|
1022
|
+
}
|
|
1023
|
+
};
|
|
1024
|
+
return n(e.blocks, null);
|
|
1025
|
+
}
|
|
1026
|
+
function st(e, t, n, r, i) {
|
|
1027
|
+
if (r !== null) return r;
|
|
1028
|
+
let a = at(t, n).find((e) => e.id !== i), o = at(e, n).filter((e) => e.id !== i);
|
|
1029
|
+
return o[(a ? o.findIndex((e) => e.id === a.id) : o.length) - 1]?.id ?? null;
|
|
1030
|
+
}
|
|
1031
|
+
function ct(e, t, n) {
|
|
1032
|
+
Object.keys(n).length ? (e.l10n ??= {})[t] = n : e.l10n && (delete e.l10n[t], Object.keys(e.l10n).length || delete e.l10n);
|
|
1033
|
+
}
|
|
1034
|
+
function lt(e) {
|
|
1035
|
+
let t = M(e);
|
|
1036
|
+
return delete t.l10n, t.type === "section" && (t.children = t.children.map((e) => e.map(lt))), t;
|
|
1037
|
+
}
|
|
1038
|
+
function ut(e, t, n, r) {
|
|
1039
|
+
let i = ae(e, t), a = M(e), o = M(i.settings), s = !1, c = /* @__PURE__ */ new Map(), l = (n, r) => {
|
|
1040
|
+
for (let [i, a] of $(n)) c.set(i, {
|
|
1041
|
+
initial: W(a, t, H(e)),
|
|
1042
|
+
added: r,
|
|
1043
|
+
changed: !1
|
|
1044
|
+
});
|
|
1045
|
+
};
|
|
1046
|
+
l(i.blocks, !1);
|
|
1047
|
+
let u = [], d = (e, t, n) => {
|
|
1048
|
+
if (t.some((e) => e?.op === "setDefaultLocale")) throw new V("invalid_operation", n, "Changing the default language isn't possible in a language view; switch to the default language.");
|
|
1049
|
+
if (t.some((e) => e?.op === "setContent")) throw new V("invalid_operation", n, "Replacing the whole template isn't possible in a language view; switch to the default language.");
|
|
1050
|
+
try {
|
|
1051
|
+
return D(e, t);
|
|
1052
|
+
} catch (e) {
|
|
1053
|
+
throw e instanceof V ? new V(e.code, n, e.message, e.blockId) : e;
|
|
1054
|
+
}
|
|
1055
|
+
}, f = (e, t) => {
|
|
1056
|
+
a = d(a, e, t), u.push(...e);
|
|
1057
|
+
}, p = (e, n) => {
|
|
1058
|
+
let o = c.get(e);
|
|
1059
|
+
if (!o?.changed) return;
|
|
1060
|
+
let s = $(a.blocks).get(e), l = $(i.blocks).get(e), u = M(a), d = at(u, ot(u, e).parent), p = M(s);
|
|
1061
|
+
if (o.added) p = lt(l), p.type === "section" && s.type === "section" && (p.children = s.children, p.columns = s.columns);
|
|
1062
|
+
else {
|
|
1063
|
+
let e = p.type === "section" ? {
|
|
1064
|
+
...l,
|
|
1065
|
+
children: p.children,
|
|
1066
|
+
columns: p.columns
|
|
1067
|
+
} : l;
|
|
1068
|
+
De(p, e, (e) => $(a.blocks).get(e) ?? null), p = ne(p);
|
|
1069
|
+
let n = p.l10n?.[t];
|
|
1070
|
+
ct(p, t, ke(n, Ee(p, o.initial, n, r), Ee(p, l, n, r), p, l));
|
|
1071
|
+
}
|
|
1072
|
+
d[d.findIndex((t) => t.id === e)] = p, f(it(a, u), n), o.changed = !1;
|
|
1073
|
+
}, m = (e, t, n) => {
|
|
1074
|
+
let r = $(a.blocks).get(e.blockId), i = $(t.blocks).get(e.blockId);
|
|
1075
|
+
if (r.type !== "section" || i.type !== "section" || r.columns === i.columns) return;
|
|
1076
|
+
let o = i.children.length, s = r.children.slice(0, o), c = r.children.slice(o).flat(), l = [...s[o - 1] ?? [], ...c];
|
|
1077
|
+
for (let [e, t] of c.entries()) f([{
|
|
1078
|
+
op: "moveBlock",
|
|
1079
|
+
blockId: t.id,
|
|
1080
|
+
parent: {
|
|
1081
|
+
sectionId: r.id,
|
|
1082
|
+
column: o - 1
|
|
1083
|
+
},
|
|
1084
|
+
after: l[l.length - c.length + e - 1]?.id ?? null
|
|
1085
|
+
}], n);
|
|
1086
|
+
let u = $(a.blocks).get(e.blockId);
|
|
1087
|
+
f([{
|
|
1088
|
+
op: "updateBlock",
|
|
1089
|
+
blockId: e.blockId,
|
|
1090
|
+
set: { columns: i.columns },
|
|
1091
|
+
...e.expect ? { expect: Object.fromEntries(Object.keys(e.expect).map((e) => [e, j(u, e) ?? null])) } : {}
|
|
1092
|
+
}], n);
|
|
1093
|
+
};
|
|
1094
|
+
n.forEach((e, t) => {
|
|
1095
|
+
e?.op === "updateSettings" && (Object.hasOwn(e.set ?? {}, "locale") || Array.isArray(e.unset) && e.unset.includes("locale")) && d(a, [e], t);
|
|
1096
|
+
let n = d(i, [e], t);
|
|
1097
|
+
switch (e.op) {
|
|
1098
|
+
case "addBlock": {
|
|
1099
|
+
let n = lt(e.block);
|
|
1100
|
+
f([{
|
|
1101
|
+
...e,
|
|
1102
|
+
block: n,
|
|
1103
|
+
after: st(a, i, e.parent, e.after)
|
|
1104
|
+
}], t), l([n], !0);
|
|
1105
|
+
break;
|
|
1106
|
+
}
|
|
1107
|
+
case "moveBlock":
|
|
1108
|
+
f([{
|
|
1109
|
+
...e,
|
|
1110
|
+
after: st(a, i, e.parent, e.after, e.blockId),
|
|
1111
|
+
...e.expect ? { expect: ot(a, e.blockId) } : {}
|
|
1112
|
+
}], t);
|
|
1113
|
+
break;
|
|
1114
|
+
case "deleteBlock": {
|
|
1115
|
+
let n = [...$([$(a.blocks).get(e.blockId)]).keys()];
|
|
1116
|
+
for (let e of n) p(e, t);
|
|
1117
|
+
f([{
|
|
1118
|
+
op: "deleteBlock",
|
|
1119
|
+
blockId: e.blockId
|
|
1120
|
+
}], t);
|
|
1121
|
+
for (let e of n) c.delete(e);
|
|
1122
|
+
break;
|
|
1123
|
+
}
|
|
1124
|
+
case "updateBlock":
|
|
1125
|
+
m(e, n, t), c.get(e.blockId).changed = !0;
|
|
1126
|
+
break;
|
|
1127
|
+
case "updateSettings":
|
|
1128
|
+
s = !0;
|
|
1129
|
+
break;
|
|
1130
|
+
default: f([e], t);
|
|
1131
|
+
}
|
|
1132
|
+
i = n;
|
|
1133
|
+
});
|
|
1134
|
+
for (let e of c.keys()) p(e, n.length - 1);
|
|
1135
|
+
if (s) {
|
|
1136
|
+
let e = M(a), r = e.settings.l10n?.[t];
|
|
1137
|
+
ct(e.settings, t, ke(r, Oe(e.settings, o, r), Oe(e.settings, i.settings, r), e.settings, i.settings)), f(it(a, e), n.length - 1);
|
|
1138
|
+
}
|
|
1139
|
+
return u;
|
|
1140
|
+
}
|
|
1141
|
+
var dt = 1e3, ft = 1e4, pt = [
|
|
1142
|
+
1e3,
|
|
1143
|
+
2e3,
|
|
1144
|
+
5e3,
|
|
1145
|
+
1e4,
|
|
1146
|
+
3e4
|
|
1147
|
+
], mt = 50, ht = 100, gt = /* @__PURE__ */ new Set([
|
|
1148
|
+
"block_exists",
|
|
1149
|
+
"block_missing",
|
|
1150
|
+
"anchor_missing",
|
|
1151
|
+
"precondition_failed",
|
|
1152
|
+
"lock_held",
|
|
1153
|
+
"locked_by_others",
|
|
1154
|
+
"invalid_operation",
|
|
1155
|
+
"lock_lost",
|
|
1156
|
+
"content_too_large"
|
|
1157
|
+
]);
|
|
1158
|
+
function _t(e, t) {
|
|
1159
|
+
return e.ops.some((e) => e.op === "setContent") ? e.view = t : delete e.view, e;
|
|
1160
|
+
}
|
|
1161
|
+
function vt(e) {
|
|
1162
|
+
let t = e?.code;
|
|
1163
|
+
return typeof t == "string" && gt.has(t) ? t : null;
|
|
1164
|
+
}
|
|
1165
|
+
function yt(e) {
|
|
1166
|
+
let t = e?.holder;
|
|
1167
|
+
return typeof t == "object" && t && typeof t.sessionId == "string" ? t : void 0;
|
|
1168
|
+
}
|
|
1169
|
+
function bt(e) {
|
|
1170
|
+
let t = e?.statusCode;
|
|
1171
|
+
return typeof t != "number" || t >= 500 || t === 408 || t === 429;
|
|
1172
|
+
}
|
|
1173
|
+
function xt(e, t) {
|
|
1174
|
+
return e.some((e) => {
|
|
1175
|
+
if (e.id === t) return !0;
|
|
1176
|
+
let n = e.children;
|
|
1177
|
+
return e.type === "section" && Array.isArray(n) && n.some((e) => Array.isArray(e) && xt(e, t));
|
|
1178
|
+
});
|
|
1179
|
+
}
|
|
1180
|
+
function St(e) {
|
|
1181
|
+
if (e.length === 1 && e[0].op === "updateSettings") return !0;
|
|
1182
|
+
let t = e[0];
|
|
1183
|
+
return t.op === "updateBlock" && e.every((e) => e.op === "updateBlock" && e.blockId === t.blockId) || t.op === "updateBlockLocale" && e.every((e) => e.op === "updateBlockLocale" && e.blockId === t.blockId && e.locale === t.locale);
|
|
1184
|
+
}
|
|
1185
|
+
function Ct(e) {
|
|
1186
|
+
return e.map((e) => {
|
|
1187
|
+
if (!("expect" in e)) return e;
|
|
1188
|
+
let { expect: t, ...n } = e;
|
|
1189
|
+
return n;
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
function wt(e) {
|
|
1193
|
+
let { provider: t } = e, n = e.sessionId ?? crypto.randomUUID(), i = e.maxUndo ?? mt, a = typeof t.acquireLock == "function" && typeof t.renewLock == "function" && typeof t.releaseLock == "function", o = y([]), s = y(/* @__PURE__ */ new Map()), c = /* @__PURE__ */ new WeakSet(), u = /* @__PURE__ */ new WeakMap(), d = 0, f = p(null), m = p(null), h = p(0), g = p(0), _ = null, b = null, S = !1, C = !1, w = !1, T = !1, E = null, O = 0, k = !1, ee = [], A = null, j = null, te = Promise.resolve(), ne = null, re = r(() => (g.value, (b?.undo.length ?? 0) > 0)), ie = r(() => (g.value, (b?.redo.length ?? 0) > 0));
|
|
1194
|
+
function N(t) {
|
|
1195
|
+
e.onError?.(t instanceof Error ? t : Error(String(t)));
|
|
1196
|
+
}
|
|
1197
|
+
function P(t, n = b) {
|
|
1198
|
+
n !== b || k || e.onNotice?.(t);
|
|
1199
|
+
}
|
|
1200
|
+
function F() {
|
|
1201
|
+
return {
|
|
1202
|
+
locks: [...s.value.values()].map((e) => ({
|
|
1203
|
+
blockId: e.blockId,
|
|
1204
|
+
sessionId: e.holder.sessionId,
|
|
1205
|
+
locale: e.locale
|
|
1206
|
+
})),
|
|
1207
|
+
session: n
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
function I() {
|
|
1211
|
+
g.value++;
|
|
1212
|
+
}
|
|
1213
|
+
function ae(e, t) {
|
|
1214
|
+
e.push(t), e.length > i && e.splice(0, e.length - i);
|
|
1215
|
+
}
|
|
1216
|
+
function L(e) {
|
|
1217
|
+
if (!_ || S) return;
|
|
1218
|
+
C = !0;
|
|
1219
|
+
try {
|
|
1220
|
+
let t = _.content.value, n = it(t, e);
|
|
1221
|
+
if (n.length > 0) try {
|
|
1222
|
+
fe(t, n);
|
|
1223
|
+
} catch {
|
|
1224
|
+
_.setContent(M(e), !1);
|
|
1225
|
+
}
|
|
1226
|
+
R(_.content.value, e) || _.setContent(M(e), !1);
|
|
1227
|
+
} finally {
|
|
1228
|
+
C = !1;
|
|
1229
|
+
}
|
|
1230
|
+
let t = _.state.selectedBlockId;
|
|
1231
|
+
t && !xt(e.blocks, t) && _.selectBlock(null);
|
|
1232
|
+
}
|
|
1233
|
+
function z() {
|
|
1234
|
+
C || T || (T = !0, queueMicrotask(() => {
|
|
1235
|
+
T = !1, H(!1);
|
|
1236
|
+
}));
|
|
1237
|
+
}
|
|
1238
|
+
function B() {
|
|
1239
|
+
E &&= (clearTimeout(E), null);
|
|
1240
|
+
}
|
|
1241
|
+
function H(e, t = !1) {
|
|
1242
|
+
let n = b;
|
|
1243
|
+
if (!_ || !n || S || C || _.state.isLoading && !t || _.state.template?.id !== n.templateId) return;
|
|
1244
|
+
let r = it(n.view, _.content.value);
|
|
1245
|
+
if (r.length === 0) B();
|
|
1246
|
+
else {
|
|
1247
|
+
if (!e && St(r)) {
|
|
1248
|
+
let e = Date.now();
|
|
1249
|
+
if (E === null && (O = e), e - O < 1e3) {
|
|
1250
|
+
E && clearTimeout(E), E = setTimeout(() => {
|
|
1251
|
+
E = null, H(!0);
|
|
1252
|
+
}, 300);
|
|
1253
|
+
return;
|
|
1254
|
+
}
|
|
1255
|
+
}
|
|
1256
|
+
B(), oe(n, r);
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
function U() {
|
|
1260
|
+
H(!0);
|
|
1261
|
+
}
|
|
1262
|
+
function oe(e, t) {
|
|
1263
|
+
let n = t, r;
|
|
1264
|
+
try {
|
|
1265
|
+
r = D(e.view, n, F());
|
|
1266
|
+
} catch (n) {
|
|
1267
|
+
if (!(n instanceof V)) throw n;
|
|
1268
|
+
L(e.view);
|
|
1269
|
+
let r = n.blockId === void 0 ? void 0 : ke(n.blockId).find((e) => {
|
|
1270
|
+
let r = t[n.opIndex];
|
|
1271
|
+
return r.op !== "updateBlockLocale" || e.locale == null || e.locale === r.locale;
|
|
1272
|
+
})?.holder;
|
|
1273
|
+
P({
|
|
1274
|
+
type: "editRefused",
|
|
1275
|
+
code: n.code,
|
|
1276
|
+
...r ? { holder: r } : {}
|
|
1277
|
+
}), n.code === "invalid_operation" && N(n);
|
|
1278
|
+
return;
|
|
1279
|
+
}
|
|
1280
|
+
let i = _.content.value;
|
|
1281
|
+
if (!R(r, i)) {
|
|
1282
|
+
N(/* @__PURE__ */ Error("[Templatical] Collaboration: a change couldn't be expressed as block operations, so the whole content was sent.")), n = [{
|
|
1283
|
+
op: "setContent",
|
|
1284
|
+
content: M(i)
|
|
1285
|
+
}];
|
|
1286
|
+
try {
|
|
1287
|
+
r = D(e.view, n, F());
|
|
1288
|
+
} catch (t) {
|
|
1289
|
+
if (!(t instanceof V)) throw t;
|
|
1290
|
+
L(e.view), P({
|
|
1291
|
+
type: "editRefused",
|
|
1292
|
+
code: t.code
|
|
1293
|
+
});
|
|
1294
|
+
return;
|
|
1295
|
+
}
|
|
1296
|
+
}
|
|
1297
|
+
let a = _t({ ops: le(e.view, n) }, r);
|
|
1298
|
+
ae(e.undo, a), e.redo = [], I();
|
|
1299
|
+
let o = e.view;
|
|
1300
|
+
e.view = r, se(e, n, "edit", a, o);
|
|
1301
|
+
}
|
|
1302
|
+
function se(e, t, n, r, i) {
|
|
1303
|
+
let a = { dropped: !1 }, o = 0, s = i;
|
|
1304
|
+
do {
|
|
1305
|
+
let i = t.slice(o, o + ht);
|
|
1306
|
+
if (e.pending.push({
|
|
1307
|
+
batchId: crypto.randomUUID(),
|
|
1308
|
+
ops: i,
|
|
1309
|
+
origin: n,
|
|
1310
|
+
entry: r,
|
|
1311
|
+
group: a,
|
|
1312
|
+
sent: !1,
|
|
1313
|
+
revision: null,
|
|
1314
|
+
...s && i.some((e) => e.op === "setContent") ? { base: s } : {}
|
|
1315
|
+
}), o += ht, s && t.slice(o).some((e) => e.op === "setContent")) try {
|
|
1316
|
+
s = D(s, i);
|
|
1317
|
+
} catch {
|
|
1318
|
+
s = null;
|
|
1319
|
+
}
|
|
1320
|
+
} while (o < t.length);
|
|
1321
|
+
W(e);
|
|
1322
|
+
}
|
|
1323
|
+
function W(e) {
|
|
1324
|
+
if (e.inFlight || w) return;
|
|
1325
|
+
let t = e.pending.find((e) => !e.sent);
|
|
1326
|
+
t ? (t.sent = !0, e.inFlight = t, ce(e, t, 0)) : G(e);
|
|
1327
|
+
}
|
|
1328
|
+
function ce(e, n, r) {
|
|
1329
|
+
t.submit(e.templateId, {
|
|
1330
|
+
batchId: n.batchId,
|
|
1331
|
+
baseRevision: n.baseRevision ??= e.revision,
|
|
1332
|
+
ops: n.ops,
|
|
1333
|
+
...n.origin === "ai" ? { origin: "ai" } : {}
|
|
1334
|
+
}).then(({ revision: t }) => {
|
|
1335
|
+
e.inFlight = null, ue(e, n, t), W(e);
|
|
1336
|
+
}, (t) => {
|
|
1337
|
+
if (vt(t) !== null) e.inFlight = null, he(e, n, t), W(e);
|
|
1338
|
+
else if (bt(t)) {
|
|
1339
|
+
K(e, t);
|
|
1340
|
+
let i = pt[Math.min(r, pt.length - 1)];
|
|
1341
|
+
setTimeout(() => {
|
|
1342
|
+
k || ce(e, n, r + 1);
|
|
1343
|
+
}, i);
|
|
1344
|
+
} else e.inFlight = null, N(t), he(e, n, t), W(e);
|
|
1345
|
+
});
|
|
1346
|
+
}
|
|
1347
|
+
function ue(e, t, n) {
|
|
1348
|
+
t.revision === null && (t.revision = n, n <= e.revision ? (de(e, t), ye(e)) : (e.own.set(n, t), ve(e)));
|
|
1349
|
+
}
|
|
1350
|
+
function de(e, t) {
|
|
1351
|
+
e.pending = e.pending.filter((e) => e !== t), G(e);
|
|
1352
|
+
}
|
|
1353
|
+
function pe(e, t) {
|
|
1354
|
+
if (t.entry) {
|
|
1355
|
+
for (let n of [e.undo, e.redo]) {
|
|
1356
|
+
let e = n.indexOf(t.entry);
|
|
1357
|
+
e !== -1 && n.splice(e, 1);
|
|
1358
|
+
}
|
|
1359
|
+
I();
|
|
1360
|
+
}
|
|
1361
|
+
}
|
|
1362
|
+
function me(e, t) {
|
|
1363
|
+
let n = !t.group.dropped;
|
|
1364
|
+
return t.group.dropped = !0, e.pending = e.pending.filter((e) => e.group !== t.group || e.sent), n && pe(e, t), G(e), n;
|
|
1365
|
+
}
|
|
1366
|
+
function he(e, t, n) {
|
|
1367
|
+
if (de(e, t), me(e, t)) {
|
|
1368
|
+
let r = vt(n) ?? "invalid_operation";
|
|
1369
|
+
if (t.origin === "edit" || t.origin === "ai") {
|
|
1370
|
+
let t = yt(n);
|
|
1371
|
+
P({
|
|
1372
|
+
type: "editRefused",
|
|
1373
|
+
code: r,
|
|
1374
|
+
...t ? { holder: t } : {}
|
|
1375
|
+
}, e);
|
|
1376
|
+
} else P({
|
|
1377
|
+
type: "undoSkipped",
|
|
1378
|
+
code: r
|
|
1379
|
+
}, e);
|
|
1380
|
+
}
|
|
1381
|
+
ye(e), e === b && q();
|
|
1382
|
+
}
|
|
1383
|
+
function G(e) {
|
|
1384
|
+
if (!(e.pending.length > 0 || e.waiters.length === 0)) for (let t of e.waiters.splice(0)) t.resolve();
|
|
1385
|
+
}
|
|
1386
|
+
function K(e, t) {
|
|
1387
|
+
let n = t instanceof Error ? t : Error(String(t));
|
|
1388
|
+
for (let t of e.waiters.splice(0)) t.reject(n);
|
|
1389
|
+
}
|
|
1390
|
+
function ge(e, t) {
|
|
1391
|
+
if (t.revision <= e.revision) return;
|
|
1392
|
+
let n = e.pending.find((e) => e.batchId === t.batchId);
|
|
1393
|
+
n ? ue(e, n, t.revision) : (e.remote.set(t.revision, t), ve(e));
|
|
1394
|
+
}
|
|
1395
|
+
function _e(t, n) {
|
|
1396
|
+
let r = n.ops;
|
|
1397
|
+
if (e.normalizeRemoteOperations) try {
|
|
1398
|
+
r = e.normalizeRemoteOperations(n.ops, t.confirmed);
|
|
1399
|
+
} catch (e) {
|
|
1400
|
+
N(e);
|
|
1401
|
+
}
|
|
1402
|
+
return Ct(r);
|
|
1403
|
+
}
|
|
1404
|
+
function ve(t) {
|
|
1405
|
+
let n = [], r = !1;
|
|
1406
|
+
for (;;) {
|
|
1407
|
+
let e = t.revision + 1, i = t.remote.get(e), a = t.own.get(e);
|
|
1408
|
+
if (!i && !a) break;
|
|
1409
|
+
try {
|
|
1410
|
+
t.confirmed = D(t.confirmed, i ? _e(t, i) : a.ops);
|
|
1411
|
+
} catch {
|
|
1412
|
+
if (t.recovering) {
|
|
1413
|
+
t.remote.clear(), t.own.clear(), N(/* @__PURE__ */ Error("[Templatical] Collaboration: this editor can't follow the template's changes. Reload the page."));
|
|
1414
|
+
return;
|
|
1415
|
+
}
|
|
1416
|
+
Ce(t);
|
|
1417
|
+
return;
|
|
1418
|
+
}
|
|
1419
|
+
t.revision = e, i ? (t.remote.delete(e), n.push(i)) : (t.own.delete(e), a.group.dropped && (r = !0), de(t, a));
|
|
1420
|
+
}
|
|
1421
|
+
if (t === b && (h.value = t.revision), t.remote.size > 0 || t.own.size > 0 ? xe(t) : Se(t), (n.length !== 0 || r) && (ye(t), t === b)) for (let t of n) try {
|
|
1422
|
+
e.onRemoteChange?.({
|
|
1423
|
+
actor: t.actor,
|
|
1424
|
+
ops: t.ops,
|
|
1425
|
+
locale: t.ops.find((e) => e.op !== "setDefaultLocale" && "locale" in e)?.locale ?? null
|
|
1426
|
+
});
|
|
1427
|
+
} catch (e) {
|
|
1428
|
+
N(e);
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
function ye(e) {
|
|
1432
|
+
let t = !w;
|
|
1433
|
+
w = !0;
|
|
1434
|
+
try {
|
|
1435
|
+
be(e);
|
|
1436
|
+
} finally {
|
|
1437
|
+
t && (w = !1);
|
|
1438
|
+
}
|
|
1439
|
+
t && W(e);
|
|
1440
|
+
}
|
|
1441
|
+
function be(e) {
|
|
1442
|
+
e === b && U();
|
|
1443
|
+
let t = e.confirmed;
|
|
1444
|
+
for (let n = 0; n < e.pending.length; n++) {
|
|
1445
|
+
let r = e.pending[n], i;
|
|
1446
|
+
if (r.base && !R(r.base, t)) i = "precondition_failed";
|
|
1447
|
+
else try {
|
|
1448
|
+
t = D(t, r.ops);
|
|
1449
|
+
continue;
|
|
1450
|
+
} catch (e) {
|
|
1451
|
+
i = e instanceof V ? e.code : "invalid_operation";
|
|
1452
|
+
}
|
|
1453
|
+
r.sent || (me(e, r) && P(r.origin === "edit" || r.origin === "ai" ? {
|
|
1454
|
+
type: "editRefused",
|
|
1455
|
+
code: i
|
|
1456
|
+
} : {
|
|
1457
|
+
type: "undoSkipped",
|
|
1458
|
+
code: i
|
|
1459
|
+
}, e), t = e.confirmed, n = -1);
|
|
1460
|
+
}
|
|
1461
|
+
e.view = t, G(e), e === b && L(t);
|
|
1462
|
+
}
|
|
1463
|
+
function xe(e) {
|
|
1464
|
+
e.gapTimer ||= setTimeout(() => {
|
|
1465
|
+
e.gapTimer = null, e === b && q();
|
|
1466
|
+
}, dt);
|
|
1467
|
+
}
|
|
1468
|
+
function Se(e) {
|
|
1469
|
+
e.gapTimer &&= (clearTimeout(e.gapTimer), null);
|
|
1470
|
+
}
|
|
1471
|
+
function q() {
|
|
1472
|
+
let e = b;
|
|
1473
|
+
return e ? (e.catchingUp ||= (async () => {
|
|
1474
|
+
try {
|
|
1475
|
+
let n = await t.operationsAfter(e.templateId, e.revision);
|
|
1476
|
+
if (e.retired) return;
|
|
1477
|
+
if ("resync" in n) {
|
|
1478
|
+
await Ce(e);
|
|
1479
|
+
return;
|
|
1480
|
+
}
|
|
1481
|
+
for (let t of n.batches) ge(e, t);
|
|
1482
|
+
} catch (e) {
|
|
1483
|
+
N(e);
|
|
1484
|
+
} finally {
|
|
1485
|
+
e.catchingUp = null;
|
|
1486
|
+
}
|
|
1487
|
+
})(), e.catchingUp) : Promise.resolve();
|
|
1488
|
+
}
|
|
1489
|
+
async function Ce(t) {
|
|
1490
|
+
t.recovering = !0;
|
|
1491
|
+
try {
|
|
1492
|
+
let n = await e.loadTemplate(t.templateId);
|
|
1493
|
+
if (t.retired) return;
|
|
1494
|
+
let r = n.revision ?? t.revision;
|
|
1495
|
+
t.confirmed = M(n.content), t.revision = r, t.remote = new Map([...t.remote].filter(([e]) => e > r));
|
|
1496
|
+
for (let [e, n] of [...t.own]) e <= r && (t.own.delete(e), de(t, n));
|
|
1497
|
+
t === b && (h.value = r), ye(t), ve(t);
|
|
1498
|
+
} catch (e) {
|
|
1499
|
+
N(e);
|
|
1500
|
+
} finally {
|
|
1501
|
+
t.recovering = !1;
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
function J(t) {
|
|
1505
|
+
let n = () => t === b && !t.retired;
|
|
1506
|
+
return {
|
|
1507
|
+
onBatch: (e) => {
|
|
1508
|
+
n() && ge(t, e);
|
|
1509
|
+
},
|
|
1510
|
+
onResync: (r, i) => {
|
|
1511
|
+
if (!(!n() || r <= t.revision)) {
|
|
1512
|
+
if (i) try {
|
|
1513
|
+
e.onRemoteResync?.({
|
|
1514
|
+
revision: r,
|
|
1515
|
+
actor: i
|
|
1516
|
+
});
|
|
1517
|
+
} catch (e) {
|
|
1518
|
+
N(e);
|
|
1519
|
+
}
|
|
1520
|
+
q();
|
|
1521
|
+
}
|
|
1522
|
+
},
|
|
1523
|
+
onLock: (e) => {
|
|
1524
|
+
n() && je(e);
|
|
1525
|
+
},
|
|
1526
|
+
onUnlock: (e, t, r) => {
|
|
1527
|
+
n() && Me(e, t, r);
|
|
1528
|
+
},
|
|
1529
|
+
onMembers: (e) => {
|
|
1530
|
+
n() && Z(e);
|
|
1531
|
+
},
|
|
1532
|
+
onConnectionChange: (e) => {
|
|
1533
|
+
n() && X(t, e);
|
|
1534
|
+
}
|
|
1535
|
+
};
|
|
1536
|
+
}
|
|
1537
|
+
function Y(e, r) {
|
|
1538
|
+
let i = d;
|
|
1539
|
+
t.join(e.templateId, { sessionId: n }, J(e)).then((t) => {
|
|
1540
|
+
e.retired || e !== b ? r || t.leave() : (e.leave = t.leave, Ne(t.locks, !r, i), Z(t.members), t.members.length > 0 && (m.value = "connected"), t.revision > e.revision && q(), r && Pe());
|
|
1541
|
+
}, (e) => N(e));
|
|
1542
|
+
}
|
|
1543
|
+
function we(e) {
|
|
1544
|
+
let t = M(e.content), n = {
|
|
1545
|
+
templateId: e.id,
|
|
1546
|
+
confirmed: t,
|
|
1547
|
+
revision: e.revision ?? 0,
|
|
1548
|
+
pending: [],
|
|
1549
|
+
view: M(t),
|
|
1550
|
+
remote: /* @__PURE__ */ new Map(),
|
|
1551
|
+
own: /* @__PURE__ */ new Map(),
|
|
1552
|
+
inFlight: null,
|
|
1553
|
+
gapTimer: null,
|
|
1554
|
+
catchingUp: null,
|
|
1555
|
+
leave: null,
|
|
1556
|
+
retired: !1,
|
|
1557
|
+
recovering: !1,
|
|
1558
|
+
undo: [],
|
|
1559
|
+
redo: [],
|
|
1560
|
+
waiters: []
|
|
1561
|
+
};
|
|
1562
|
+
b = n, h.value = n.revision, I(), Y(n, !1), _?.state.selectedBlockId && ze(_.state.selectedBlockId), z();
|
|
1563
|
+
}
|
|
1564
|
+
function Te(e) {
|
|
1565
|
+
e.retired = !0, Se(e), e.leave?.(), e.leave = null, K(e, /* @__PURE__ */ Error("[Templatical] The template was closed."));
|
|
1566
|
+
}
|
|
1567
|
+
function X(e, t) {
|
|
1568
|
+
let n = m.value;
|
|
1569
|
+
m.value = t, t === "connected" && n !== null && n !== "connected" && Y(e, !0);
|
|
1570
|
+
}
|
|
1571
|
+
function Ee(e) {
|
|
1572
|
+
b && b.templateId === e?.id || (b &&= (B(), Te(b), null), o.value = [], s.value = /* @__PURE__ */ new Map(), m.value = null, A = null, Pe(), I(), e && we(e));
|
|
1573
|
+
}
|
|
1574
|
+
function De(e, t) {
|
|
1575
|
+
return `${e}\u0000${t ?? ""}`;
|
|
1576
|
+
}
|
|
1577
|
+
function Oe(e, t, n) {
|
|
1578
|
+
return e.blockId === t && (n == null || e.locale == null || e.locale === n);
|
|
1579
|
+
}
|
|
1580
|
+
function ke(e) {
|
|
1581
|
+
return [...s.value.values()].filter((t) => t.blockId === e);
|
|
1582
|
+
}
|
|
1583
|
+
function Ae(e) {
|
|
1584
|
+
e !== f.value && (U(), f.value = e, ze(_?.state.selectedBlockId ?? null));
|
|
1585
|
+
}
|
|
1586
|
+
function je(e, t = !1) {
|
|
1587
|
+
if (e.holder.sessionId === n) return;
|
|
1588
|
+
t ? c.add(e) : u.set(e, ++d);
|
|
1589
|
+
let r = new Map([...s.value].filter(([, t]) => t.holder.sessionId !== e.holder.sessionId));
|
|
1590
|
+
r.set(De(e.blockId, e.locale), e), s.value = r, _?.state.selectedBlockId === e.blockId && (f.value === null || e.locale == null || e.locale === f.value) && (_.selectBlock(null), P({
|
|
1591
|
+
type: "selectionRefused",
|
|
1592
|
+
blockId: e.blockId,
|
|
1593
|
+
holder: e.holder
|
|
1594
|
+
}));
|
|
1595
|
+
}
|
|
1596
|
+
function Me(e, t, n) {
|
|
1597
|
+
let r = De(e, n), i = new Map([...s.value].filter(([n, i]) => i.holder.sessionId !== t || n !== r && !(i.blockId === e && c.has(i))));
|
|
1598
|
+
i.size !== s.value.size && (s.value = i);
|
|
1599
|
+
}
|
|
1600
|
+
function Ne(e, t, r) {
|
|
1601
|
+
let i = new Map([...s.value].filter(([, e]) => !c.has(e) && (t || (u.get(e) ?? 0) > r))), a = [...i.values()];
|
|
1602
|
+
for (let t of e) if (t.holder.sessionId !== n && !a.some((e) => e.holder.sessionId === t.holder.sessionId || Oe(e, t.blockId, t.locale))) {
|
|
1603
|
+
for (let [e, n] of i) n.holder.sessionId === t.holder.sessionId && i.delete(e);
|
|
1604
|
+
i.set(De(t.blockId, t.locale), t);
|
|
1605
|
+
}
|
|
1606
|
+
s.value = i;
|
|
1607
|
+
}
|
|
1608
|
+
function Z(e) {
|
|
1609
|
+
let t = new Set(e.map((e) => e.sessionId)), n = new Set(o.value.map((e) => e.sessionId).filter((e) => !t.has(e)));
|
|
1610
|
+
if (o.value = e, n.size === 0) return;
|
|
1611
|
+
let r = new Map([...s.value].filter(([, e]) => !n.has(e.holder.sessionId)));
|
|
1612
|
+
r.size !== s.value.size && (s.value = r);
|
|
1613
|
+
}
|
|
1614
|
+
function Q(e) {
|
|
1615
|
+
te = te.then(e).catch(N);
|
|
1616
|
+
}
|
|
1617
|
+
function Pe() {
|
|
1618
|
+
a && Q(async () => {
|
|
1619
|
+
if (j && (A === null || j.templateId !== A.templateId || j.locale !== A.locale)) {
|
|
1620
|
+
let e = j;
|
|
1621
|
+
j = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale);
|
|
1622
|
+
}
|
|
1623
|
+
let e = A;
|
|
1624
|
+
if (!(!e || j?.templateId === e.templateId && j.blockId === e.blockId && j.locale === e.locale)) try {
|
|
1625
|
+
let n = await t.acquireLock(e.templateId, e.blockId, e.locale);
|
|
1626
|
+
j = e, Le(), Fe(n.blockId, n.locale ?? null);
|
|
1627
|
+
} catch (n) {
|
|
1628
|
+
if (j?.templateId === e.templateId) {
|
|
1629
|
+
let e = j;
|
|
1630
|
+
j = null, Re(), await t.releaseLock(e.templateId, e.blockId, e.locale).catch(() => {});
|
|
1631
|
+
}
|
|
1632
|
+
if (A !== e) return;
|
|
1633
|
+
Ie(e.blockId, n);
|
|
1634
|
+
}
|
|
1635
|
+
});
|
|
1636
|
+
}
|
|
1637
|
+
function Fe(e, t) {
|
|
1638
|
+
let n = new Map([...s.value].filter(([, n]) => !Oe(n, e, t)));
|
|
1639
|
+
n.size !== s.value.size && (s.value = n);
|
|
1640
|
+
}
|
|
1641
|
+
function Ie(e, t) {
|
|
1642
|
+
let n = vt(t);
|
|
1643
|
+
if (n === "lock_held" || n === "block_missing") {
|
|
1644
|
+
A = null;
|
|
1645
|
+
let n = yt(t);
|
|
1646
|
+
n ? je({
|
|
1647
|
+
blockId: e,
|
|
1648
|
+
holder: n,
|
|
1649
|
+
expiresAt: ""
|
|
1650
|
+
}, !0) : _?.state.selectedBlockId === e && _.selectBlock(null);
|
|
1651
|
+
} else N(t), setTimeout(() => {
|
|
1652
|
+
A?.blockId === e && Pe();
|
|
1653
|
+
}, pt[0]);
|
|
1654
|
+
}
|
|
1655
|
+
function Le() {
|
|
1656
|
+
ne ||= setInterval(() => {
|
|
1657
|
+
Q(async () => {
|
|
1658
|
+
let e = j;
|
|
1659
|
+
if (e) try {
|
|
1660
|
+
await t.renewLock(e.templateId, e.blockId, e.locale);
|
|
1661
|
+
} catch (e) {
|
|
1662
|
+
if (vt(e) === "lock_lost") {
|
|
1663
|
+
j = null, Re(), Pe();
|
|
1664
|
+
return;
|
|
1665
|
+
}
|
|
1666
|
+
N(e);
|
|
1667
|
+
}
|
|
1668
|
+
});
|
|
1669
|
+
}, ft);
|
|
1670
|
+
}
|
|
1671
|
+
function Re() {
|
|
1672
|
+
ne &&= (clearInterval(ne), null);
|
|
1673
|
+
}
|
|
1674
|
+
function ze(e) {
|
|
1675
|
+
U(), b && (A = e ? {
|
|
1676
|
+
templateId: b.templateId,
|
|
1677
|
+
blockId: e,
|
|
1678
|
+
locale: f.value
|
|
1679
|
+
} : null, Pe());
|
|
1680
|
+
}
|
|
1681
|
+
function Be() {
|
|
1682
|
+
U(), j && a && (t.releaseLock(j.templateId, j.blockId, j.locale).catch(() => {}), j = null, Re()), b?.leave?.(), b && (b.leave = null);
|
|
1683
|
+
}
|
|
1684
|
+
function Ve(e) {
|
|
1685
|
+
let t = b;
|
|
1686
|
+
if (!t || S) return;
|
|
1687
|
+
U();
|
|
1688
|
+
let n = (e === "undo" ? t.undo : t.redo).pop();
|
|
1689
|
+
if (!n) return;
|
|
1690
|
+
if (I(), n.view && !R(n.view, t.view)) {
|
|
1691
|
+
P({
|
|
1692
|
+
type: "undoSkipped",
|
|
1693
|
+
code: "precondition_failed"
|
|
1694
|
+
});
|
|
1695
|
+
return;
|
|
1696
|
+
}
|
|
1697
|
+
let r;
|
|
1698
|
+
try {
|
|
1699
|
+
r = D(t.view, n.ops, F());
|
|
1700
|
+
} catch (e) {
|
|
1701
|
+
if (!(e instanceof V)) throw e;
|
|
1702
|
+
P({
|
|
1703
|
+
type: "undoSkipped",
|
|
1704
|
+
code: e.code
|
|
1705
|
+
});
|
|
1706
|
+
return;
|
|
1707
|
+
}
|
|
1708
|
+
let i = _t({ ops: le(t.view, n.ops) }, r);
|
|
1709
|
+
ae(e === "undo" ? t.redo : t.undo, i);
|
|
1710
|
+
let a = t.view;
|
|
1711
|
+
t.view = r, L(r), _?.markDirty(), se(t, n.ops, e, i, a);
|
|
1712
|
+
}
|
|
1713
|
+
function He(e, t) {
|
|
1714
|
+
let n = b;
|
|
1715
|
+
if (!_ || !n || S) return {
|
|
1716
|
+
applied: !1,
|
|
1717
|
+
error: new V("invalid_operation", 0, "No template is open for editing.")
|
|
1718
|
+
};
|
|
1719
|
+
if (t.origin === void 0) try {
|
|
1720
|
+
D(_.content.value, e, F());
|
|
1721
|
+
} catch (e) {
|
|
1722
|
+
if (e instanceof V) return {
|
|
1723
|
+
applied: !1,
|
|
1724
|
+
error: e
|
|
1725
|
+
};
|
|
1726
|
+
throw e;
|
|
1727
|
+
}
|
|
1728
|
+
U();
|
|
1729
|
+
let r, i;
|
|
1730
|
+
try {
|
|
1731
|
+
r = D(n.view, e, F()), i = le(n.view, e);
|
|
1732
|
+
} catch (e) {
|
|
1733
|
+
if (e instanceof V) return {
|
|
1734
|
+
applied: !1,
|
|
1735
|
+
error: e
|
|
1736
|
+
};
|
|
1737
|
+
throw e;
|
|
1738
|
+
}
|
|
1739
|
+
let a = n.undo.at(-1), o;
|
|
1740
|
+
if (t.origin === "ai" && t.turn !== void 0 && a && a.turn === t.turn) {
|
|
1741
|
+
let e = a.view !== void 0 && !R(a.view, n.view);
|
|
1742
|
+
a.ops = [...i, ...a.ops], o = e ? a : _t(a, r);
|
|
1743
|
+
} else o = _t({
|
|
1744
|
+
ops: i,
|
|
1745
|
+
...t.origin === "ai" && t.turn !== void 0 ? { turn: t.turn } : {}
|
|
1746
|
+
}, r), ae(n.undo, o);
|
|
1747
|
+
n.redo = [], I();
|
|
1748
|
+
let s = n.view;
|
|
1749
|
+
return n.view = r, L(r), _.markDirty(), se(n, e, t.origin ?? "edit", o, s), {
|
|
1750
|
+
applied: !0,
|
|
1751
|
+
inverse: i
|
|
1752
|
+
};
|
|
1753
|
+
}
|
|
1754
|
+
function Ue(e) {
|
|
1755
|
+
_ = e;
|
|
1756
|
+
let t = e;
|
|
1757
|
+
if (t.moveBlock && t.findBlockLocation) {
|
|
1758
|
+
let n = t.moveBlock, r = (...r) => {
|
|
1759
|
+
let i = b, a = i && !S && !C && !e.state.isLoading && e.state.template?.id === i.templateId;
|
|
1760
|
+
if (a && H(!0), n(...r), !a || R(i.view, e.content.value)) return;
|
|
1761
|
+
let o = t.findBlockLocation(r[0]);
|
|
1762
|
+
if (!o) return;
|
|
1763
|
+
let s = o.targetSectionId ? {
|
|
1764
|
+
sectionId: o.targetSectionId,
|
|
1765
|
+
column: o.columnIndex ?? 0
|
|
1766
|
+
} : null, c = s ? e.content.value.blocks.find((e) => e.id === s.sectionId) : void 0, l = s && c?.type === "section" ? c.children[s.column] : e.content.value.blocks;
|
|
1767
|
+
oe(i, [{
|
|
1768
|
+
op: "moveBlock",
|
|
1769
|
+
blockId: r[0],
|
|
1770
|
+
parent: s,
|
|
1771
|
+
after: l[o.index - 1]?.id ?? null
|
|
1772
|
+
}]);
|
|
1773
|
+
};
|
|
1774
|
+
t.moveBlock = r, ee.push(() => {
|
|
1775
|
+
t.moveBlock === r && (t.moveBlock = n);
|
|
1776
|
+
});
|
|
1777
|
+
}
|
|
1778
|
+
ee.push(v(() => e.state.template, (e) => Ee(e), { immediate: !0 }), v(() => e.content.value, z, { deep: !0 }), v(() => e.state.selectedBlockId, ze), v(() => e.state.isLoading, (e) => e ? H(!0, !0) : z())), typeof window < "u" && (window.addEventListener("pagehide", Be), window.addEventListener("blur", U)), x() && l(qe);
|
|
1779
|
+
}
|
|
1780
|
+
function We() {
|
|
1781
|
+
U();
|
|
1782
|
+
let e = b;
|
|
1783
|
+
return !e || e.pending.length === 0 ? Promise.resolve() : new Promise((t, n) => e.waiters.push({
|
|
1784
|
+
resolve: t,
|
|
1785
|
+
reject: n
|
|
1786
|
+
}));
|
|
1787
|
+
}
|
|
1788
|
+
function Ge() {
|
|
1789
|
+
U(), S = !0;
|
|
1790
|
+
}
|
|
1791
|
+
function Ke() {
|
|
1792
|
+
S = !1, b && L(b.view);
|
|
1793
|
+
}
|
|
1794
|
+
function qe() {
|
|
1795
|
+
if (!k) {
|
|
1796
|
+
U();
|
|
1797
|
+
for (let e of ee.splice(0)) e();
|
|
1798
|
+
B(), Be(), k = !0, b && Te(b), b = null, Re(), typeof window < "u" && (window.removeEventListener("pagehide", Be), window.removeEventListener("blur", U));
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
return {
|
|
1802
|
+
sessionId: n,
|
|
1803
|
+
members: o,
|
|
1804
|
+
locks: s,
|
|
1805
|
+
locksOf: ke,
|
|
1806
|
+
lockLocale: f,
|
|
1807
|
+
setLockLocale: Ae,
|
|
1808
|
+
connection: m,
|
|
1809
|
+
revision: h,
|
|
1810
|
+
canUndo: re,
|
|
1811
|
+
canRedo: ie,
|
|
1812
|
+
attach: Ue,
|
|
1813
|
+
undo: () => Ve("undo"),
|
|
1814
|
+
redo: () => Ve("redo"),
|
|
1815
|
+
clearHistory: () => {
|
|
1816
|
+
b && (b.undo = [], b.redo = [], I());
|
|
1817
|
+
},
|
|
1818
|
+
flush: U,
|
|
1819
|
+
settle: We,
|
|
1820
|
+
suspend: Ge,
|
|
1821
|
+
resume: Ke,
|
|
1822
|
+
catchUp: q,
|
|
1823
|
+
hasConfirmedBlock: (e) => b ? xt(b.confirmed.blocks, e) : !1,
|
|
1824
|
+
applyOperations: He,
|
|
1825
|
+
destroy: qe
|
|
1826
|
+
};
|
|
1827
|
+
}
|
|
1828
|
+
function Tt(e) {
|
|
1829
|
+
let { provider: t } = e, n = p([]), r = p(!1), i = d(() => {
|
|
1830
|
+
let e = /* @__PURE__ */ new Set();
|
|
1831
|
+
for (let t of n.value) {
|
|
1832
|
+
let n = t.category?.trim();
|
|
1833
|
+
n && e.add(n);
|
|
1834
|
+
}
|
|
1835
|
+
return [...e].sort((e, t) => e.localeCompare(t));
|
|
1836
|
+
}), a = d(() => typeof t.create == "function"), o = d(() => typeof t.update == "function"), s = d(() => typeof t.delete == "function");
|
|
1837
|
+
function c(e) {
|
|
1838
|
+
return o.value && e.canUpdate !== !1;
|
|
1839
|
+
}
|
|
1840
|
+
function l(e) {
|
|
1841
|
+
return s.value && e.canDelete !== !1;
|
|
1842
|
+
}
|
|
1843
|
+
function u(e, t) {
|
|
1844
|
+
throw new z(`[Templatical] Saved blocks: ${e} is ${t}. Check the capability before calling — the editor's own UI hides the action.`);
|
|
1845
|
+
}
|
|
1846
|
+
function f(t) {
|
|
1847
|
+
Fe(e.onError, t);
|
|
1848
|
+
}
|
|
1849
|
+
async function m(i) {
|
|
1850
|
+
r.value = !0;
|
|
1851
|
+
try {
|
|
1852
|
+
n.value = await t.list(i);
|
|
1853
|
+
} catch (t) {
|
|
1854
|
+
throw e.onError?.(t), t;
|
|
1855
|
+
} finally {
|
|
1856
|
+
r.value = !1;
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
async function h(r, i, a) {
|
|
1860
|
+
let { create: o } = t;
|
|
1861
|
+
typeof o != "function" && u("create", "disabled by the provider");
|
|
1862
|
+
try {
|
|
1863
|
+
let e = await o(a ? {
|
|
1864
|
+
name: r,
|
|
1865
|
+
content: i,
|
|
1866
|
+
category: a
|
|
1867
|
+
} : {
|
|
1868
|
+
name: r,
|
|
1869
|
+
content: i
|
|
1870
|
+
});
|
|
1871
|
+
return n.value = [e, ...n.value], f(() => t.onCreated?.(e)), e;
|
|
1872
|
+
} catch (t) {
|
|
1873
|
+
throw e.onError?.(t), t;
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
async function g(r, i) {
|
|
1877
|
+
let { update: a } = t;
|
|
1878
|
+
typeof a != "function" && u("update", "disabled by the provider");
|
|
1879
|
+
let o = n.value.find((e) => e.id === r);
|
|
1880
|
+
o && o.canUpdate === !1 && u("update", `not permitted for entry "${r}"`);
|
|
1881
|
+
try {
|
|
1882
|
+
let e = await a(r, i);
|
|
1883
|
+
return n.value = n.value.map((t) => t.id === r ? e : t), f(() => t.onUpdated?.(e)), e;
|
|
1884
|
+
} catch (t) {
|
|
1885
|
+
throw e.onError?.(t), t;
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
async function _(r) {
|
|
1889
|
+
let { delete: i } = t;
|
|
1890
|
+
typeof i != "function" && u("delete", "disabled by the provider");
|
|
1891
|
+
let a = n.value.find((e) => e.id === r) ?? null;
|
|
1892
|
+
a && a.canDelete === !1 && u("delete", `not permitted for entry "${r}"`);
|
|
1893
|
+
try {
|
|
1894
|
+
await i(r), n.value = n.value.filter((e) => e.id !== r), a && f(() => t.onDeleted?.(a));
|
|
1895
|
+
} catch (t) {
|
|
1896
|
+
throw e.onError?.(t), t;
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
return {
|
|
1900
|
+
savedBlocks: n,
|
|
1901
|
+
isLoading: r,
|
|
1902
|
+
categories: i,
|
|
1903
|
+
canCreate: a,
|
|
1904
|
+
canUpdate: o,
|
|
1905
|
+
canDelete: s,
|
|
1906
|
+
canUpdateBlock: c,
|
|
1907
|
+
canDeleteBlock: l,
|
|
1908
|
+
load: m,
|
|
1909
|
+
create: h,
|
|
1910
|
+
update: g,
|
|
1911
|
+
remove: _
|
|
1912
|
+
};
|
|
1913
|
+
}
|
|
1914
|
+
var Et = "templatical:saved-blocks";
|
|
1915
|
+
function Dt(e = {}) {
|
|
1916
|
+
let t = e.key ?? Et;
|
|
1917
|
+
function n() {
|
|
1918
|
+
if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageSavedBlocksProvider requires a browser environment with localStorage. Supply your own SavedBlocksProvider for server-side or non-browser use.");
|
|
1919
|
+
return localStorage;
|
|
1920
|
+
}
|
|
1921
|
+
function r() {
|
|
1922
|
+
let e = n().getItem(t);
|
|
1923
|
+
if (!e) return [];
|
|
1924
|
+
try {
|
|
1925
|
+
let t = JSON.parse(e);
|
|
1926
|
+
return Array.isArray(t) ? t : [];
|
|
1927
|
+
} catch {
|
|
1928
|
+
return [];
|
|
1929
|
+
}
|
|
1930
|
+
}
|
|
1931
|
+
function i(e) {
|
|
1932
|
+
n().setItem(t, JSON.stringify(e));
|
|
1933
|
+
}
|
|
1934
|
+
return {
|
|
1935
|
+
async list(e) {
|
|
1936
|
+
let t = r(), n = e?.search?.trim().toLowerCase(), i = e?.category?.trim();
|
|
1937
|
+
return t.filter((e) => !(n && !e.name.toLowerCase().includes(n) || i && e.category !== i));
|
|
1938
|
+
},
|
|
1939
|
+
async create(e) {
|
|
1940
|
+
let t = (/* @__PURE__ */ new Date()).toISOString(), n = {
|
|
1941
|
+
id: B(),
|
|
1942
|
+
name: e.name,
|
|
1943
|
+
content: e.content,
|
|
1944
|
+
...e.category ? { category: e.category } : {},
|
|
1945
|
+
createdAt: t,
|
|
1946
|
+
updatedAt: t
|
|
1947
|
+
};
|
|
1948
|
+
return i([n, ...r()]), n;
|
|
1949
|
+
},
|
|
1950
|
+
async update(e, t) {
|
|
1951
|
+
let n = r(), a = n.findIndex((t) => t.id === e);
|
|
1952
|
+
if (a === -1) throw Error(`[Templatical] Saved block not found: ${e}`);
|
|
1953
|
+
let o = {
|
|
1954
|
+
...n[a],
|
|
1955
|
+
...t,
|
|
1956
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1957
|
+
}, s = [...n];
|
|
1958
|
+
return s[a] = o, i(s), o;
|
|
1959
|
+
},
|
|
1960
|
+
async delete(e) {
|
|
1961
|
+
let t = r();
|
|
1962
|
+
if (!t.some((t) => t.id === e)) throw Error(`[Templatical] Saved block not found: ${e}`);
|
|
1963
|
+
i(t.filter((t) => t.id !== e));
|
|
1964
|
+
}
|
|
1965
|
+
};
|
|
1966
|
+
}
|
|
1967
|
+
var Ot = "templatical:media", kt = 50;
|
|
1968
|
+
function At(e = {}) {
|
|
1969
|
+
let t = e.key ?? Ot;
|
|
1970
|
+
function n() {
|
|
1971
|
+
if (typeof localStorage > "u") throw Error("[Templatical] createLocalStorageMediaProvider requires a browser environment with localStorage. Supply your own MediaProvider for server-side or non-browser use.");
|
|
1972
|
+
return localStorage;
|
|
1973
|
+
}
|
|
1974
|
+
function r() {
|
|
1975
|
+
let e = n().getItem(t);
|
|
1976
|
+
if (!e) return [];
|
|
1977
|
+
try {
|
|
1978
|
+
let t = JSON.parse(e);
|
|
1979
|
+
return Array.isArray(t) ? t : [];
|
|
1980
|
+
} catch {
|
|
1981
|
+
return [];
|
|
1982
|
+
}
|
|
1983
|
+
}
|
|
1984
|
+
function i(e) {
|
|
1985
|
+
n().setItem(t, JSON.stringify(e));
|
|
1986
|
+
}
|
|
1987
|
+
function a(e) {
|
|
1988
|
+
return typeof FileReader > "u" ? Promise.reject(/* @__PURE__ */ Error("[Templatical] createLocalStorageMediaProvider requires a browser environment with FileReader.")) : new Promise((t, n) => {
|
|
1989
|
+
let r = new FileReader();
|
|
1990
|
+
r.onload = () => {
|
|
1991
|
+
typeof r.result == "string" ? t(r.result) : n(/* @__PURE__ */ Error("[Templatical] Failed to read file as a data URL."));
|
|
1992
|
+
}, r.onerror = () => {
|
|
1993
|
+
n(r.error ?? /* @__PURE__ */ Error("[Templatical] Failed to read file as a data URL."));
|
|
1994
|
+
}, r.readAsDataURL(e);
|
|
1995
|
+
});
|
|
1996
|
+
}
|
|
1997
|
+
return {
|
|
1998
|
+
async list(e) {
|
|
1999
|
+
let t = r(), n = e?.search?.trim().toLowerCase(), i = n ? t.filter((e) => {
|
|
2000
|
+
let t = e.filename?.toLowerCase() ?? "", r = e.alt?.toLowerCase() ?? "";
|
|
2001
|
+
return t.includes(n) || r.includes(n);
|
|
2002
|
+
}) : t, a = e?.cursor ? Number.parseInt(e.cursor, 10) : 0, o = Number.isFinite(a) && a > 0 ? a : 0, s = i.slice(o, o + kt), c = { items: s }, l = o + s.length;
|
|
2003
|
+
return l < i.length && (c.nextCursor = String(l)), c;
|
|
2004
|
+
},
|
|
2005
|
+
async create(e) {
|
|
2006
|
+
let t = await a(e.file), n = (/* @__PURE__ */ new Date()).toISOString(), o = {
|
|
2007
|
+
id: B(),
|
|
2008
|
+
url: t,
|
|
2009
|
+
filename: e.filename || e.file.name,
|
|
2010
|
+
createdAt: n,
|
|
2011
|
+
updatedAt: n,
|
|
2012
|
+
size: e.file.size
|
|
2013
|
+
};
|
|
2014
|
+
return e.alt !== void 0 && (o.alt = e.alt), e.file.type && (o.mimeType = e.file.type), e.folderId !== void 0 && (o.folderId = e.folderId), i([o, ...r()]), o;
|
|
2015
|
+
},
|
|
2016
|
+
async update(e, t) {
|
|
2017
|
+
let n = r(), a = n.findIndex((t) => t.id === e);
|
|
2018
|
+
if (a === -1) throw Error(`[Templatical] Media asset not found: ${e}`);
|
|
2019
|
+
let o = n[a], s = {
|
|
2020
|
+
...o,
|
|
2021
|
+
...t,
|
|
2022
|
+
id: o.id,
|
|
2023
|
+
url: o.url,
|
|
2024
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2025
|
+
}, c = [...n];
|
|
2026
|
+
return c[a] = s, i(c), s;
|
|
2027
|
+
},
|
|
2028
|
+
async delete(e) {
|
|
2029
|
+
let t = r();
|
|
2030
|
+
for (let n of e) if (!t.some((e) => e.id === n)) throw Error(`[Templatical] Media asset not found: ${n}`);
|
|
2031
|
+
let n = new Set(e);
|
|
2032
|
+
i(t.filter((e) => !n.has(e.id)));
|
|
2033
|
+
},
|
|
2034
|
+
folders: !1,
|
|
2035
|
+
replace: !1,
|
|
2036
|
+
importFromUrl: !1,
|
|
2037
|
+
checkUsage: !1,
|
|
2038
|
+
frequentlyUsed: !1,
|
|
2039
|
+
storage: !1
|
|
2040
|
+
};
|
|
2041
|
+
}
|
|
2042
|
+
function jt(e) {
|
|
2043
|
+
let { provider: t, getTemplateId: n } = e, r = p([]), i = p(!1), a = p(void 0), o = p(!1), s = /* @__PURE__ */ new Map(), c = d(() => typeof t.create == "function"), l = d(() => typeof t.restore == "function");
|
|
2044
|
+
function u(e) {
|
|
2045
|
+
let t = n();
|
|
2046
|
+
if (!t) throw new z(`[Templatical] Version history: ${e} needs a template. Call create() or load() first.`);
|
|
2047
|
+
return t;
|
|
2048
|
+
}
|
|
2049
|
+
function f(e) {
|
|
2050
|
+
throw new z(`[Templatical] Version history: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
2051
|
+
}
|
|
2052
|
+
function m(t) {
|
|
2053
|
+
Fe(e.onError, t);
|
|
2054
|
+
}
|
|
2055
|
+
async function h(n) {
|
|
2056
|
+
let o = u("list");
|
|
2057
|
+
i.value = !0;
|
|
2058
|
+
try {
|
|
2059
|
+
let e = await t.list(o, n);
|
|
2060
|
+
r.value = e.versions, a.value = e.nextCursor;
|
|
2061
|
+
} catch (t) {
|
|
2062
|
+
throw e.onError?.(t), t;
|
|
2063
|
+
} finally {
|
|
2064
|
+
i.value = !1;
|
|
2065
|
+
}
|
|
2066
|
+
}
|
|
2067
|
+
function g(e) {
|
|
2068
|
+
return e.content ?? s.get(e.id) ?? null;
|
|
2069
|
+
}
|
|
2070
|
+
async function _(n) {
|
|
2071
|
+
let r = g(n);
|
|
2072
|
+
if (r) return r;
|
|
2073
|
+
let i = u("get");
|
|
2074
|
+
try {
|
|
2075
|
+
let e = await t.get(i, n.id);
|
|
2076
|
+
return s.set(n.id, e), e;
|
|
2077
|
+
} catch (t) {
|
|
2078
|
+
throw e.onError?.(t), t;
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
async function v(n, i) {
|
|
2082
|
+
let { create: a } = t;
|
|
2083
|
+
typeof a != "function" && f("create");
|
|
2084
|
+
let o = u("create");
|
|
2085
|
+
try {
|
|
2086
|
+
let e = await a(o, n, i);
|
|
2087
|
+
return r.value = [e, ...r.value], m(() => t.onCreated?.(e)), e;
|
|
2088
|
+
} catch (t) {
|
|
2089
|
+
throw e.onError?.(t), t;
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
async function y(n) {
|
|
2093
|
+
let { restore: r } = t;
|
|
2094
|
+
typeof r != "function" && f("restore");
|
|
2095
|
+
let i = u("restore"), a;
|
|
2096
|
+
o.value = !0;
|
|
2097
|
+
try {
|
|
2098
|
+
a = await r(i, n);
|
|
2099
|
+
} catch (t) {
|
|
2100
|
+
throw e.onError?.(t), t;
|
|
2101
|
+
} finally {
|
|
2102
|
+
o.value = !1;
|
|
2103
|
+
}
|
|
2104
|
+
return m(() => t.onRestored?.(a)), a;
|
|
2105
|
+
}
|
|
2106
|
+
return {
|
|
2107
|
+
nextCursor: a,
|
|
2108
|
+
versions: r,
|
|
2109
|
+
isLoading: i,
|
|
2110
|
+
isRestoring: o,
|
|
2111
|
+
canCreate: c,
|
|
2112
|
+
canRestore: l,
|
|
2113
|
+
load: h,
|
|
2114
|
+
peekContent: g,
|
|
2115
|
+
resolveContent: _,
|
|
2116
|
+
create: v,
|
|
2117
|
+
restore: y
|
|
2118
|
+
};
|
|
2119
|
+
}
|
|
2120
|
+
function Mt(e) {
|
|
2121
|
+
let { provider: t, getTemplateId: n, getUser: r } = e, i = p([]), a = p(!1), o = p(!1), s = d(() => typeof t.create == "function"), c = d(() => typeof t.update == "function"), l = d(() => typeof t.delete == "function"), u = d(() => typeof t.setResolved == "function"), f = d(() => i.value.reduce((e, t) => e + 1 + (t.replies?.length ?? 0), 0)), m = d(() => i.value.filter((e) => !e.resolvedAt).length), h = d(() => {
|
|
2122
|
+
let e = /* @__PURE__ */ new Map();
|
|
2123
|
+
for (let t of i.value) t.blockId && e.set(t.blockId, (e.get(t.blockId) ?? 0) + 1 + (t.replies?.length ?? 0));
|
|
2124
|
+
return e;
|
|
2125
|
+
});
|
|
2126
|
+
function g(e) {
|
|
2127
|
+
let t = n();
|
|
2128
|
+
if (!t) throw new z(`[Templatical] Comments: ${e} needs a template. Call create() or load() first.`);
|
|
2129
|
+
return t;
|
|
2130
|
+
}
|
|
2131
|
+
function _(e) {
|
|
2132
|
+
let t = r();
|
|
2133
|
+
if (!t) throw new z(`[Templatical] Comments: ${e} needs to know who is commenting. Pass init({ user: { id, name } }) — an unattributed comment is not written.`);
|
|
2134
|
+
return t;
|
|
2135
|
+
}
|
|
2136
|
+
function v(e) {
|
|
2137
|
+
throw new z(`[Templatical] Comments: ${e} is disabled by the provider. Check the capability before calling — the editor's own UI hides the action.`);
|
|
2138
|
+
}
|
|
2139
|
+
function y(e) {
|
|
2140
|
+
for (let t of i.value) {
|
|
2141
|
+
if (t.id === e) return t;
|
|
2142
|
+
for (let n of t.replies ?? []) if (n.id === e) return n;
|
|
2143
|
+
}
|
|
2144
|
+
return null;
|
|
2145
|
+
}
|
|
2146
|
+
function b(e) {
|
|
2147
|
+
let t = r();
|
|
2148
|
+
return t !== null && e.author.id === t.id;
|
|
2149
|
+
}
|
|
2150
|
+
function x(t) {
|
|
2151
|
+
let n = Pe(t);
|
|
2152
|
+
throw e.onError?.(n), n;
|
|
2153
|
+
}
|
|
2154
|
+
function S(t) {
|
|
2155
|
+
Fe(e.onError, t);
|
|
2156
|
+
}
|
|
2157
|
+
function C(e, t, n) {
|
|
2158
|
+
return [
|
|
2159
|
+
...e.slice(0, t),
|
|
2160
|
+
n,
|
|
2161
|
+
...e.slice(t + 1)
|
|
2162
|
+
];
|
|
2163
|
+
}
|
|
2164
|
+
function w(e, t) {
|
|
2165
|
+
return e !== void 0 && JSON.stringify(e) === JSON.stringify(t);
|
|
2166
|
+
}
|
|
2167
|
+
function T(e) {
|
|
2168
|
+
if (e.parentId) {
|
|
2169
|
+
let t = !1, n = i.value.map((n) => {
|
|
2170
|
+
if (n.id !== e.parentId) return n;
|
|
2171
|
+
let r = n.replies ?? [], i = r.findIndex((t) => t.id === e.id);
|
|
2172
|
+
return i !== -1 && w(r[i], e) ? n : (t = !0, {
|
|
2173
|
+
...n,
|
|
2174
|
+
replies: i === -1 ? [...r, e] : C(r, i, e)
|
|
2175
|
+
});
|
|
2176
|
+
});
|
|
2177
|
+
return t && (i.value = n), t;
|
|
2178
|
+
}
|
|
2179
|
+
let t = i.value.findIndex((t) => t.id === e.id);
|
|
2180
|
+
if (t === -1) return i.value = [...i.value, e], !0;
|
|
2181
|
+
let n = {
|
|
2182
|
+
...e,
|
|
2183
|
+
replies: e.replies ?? i.value[t].replies
|
|
2184
|
+
};
|
|
2185
|
+
return !w(i.value[t], n) && (i.value = C(i.value, t, n), !0);
|
|
2186
|
+
}
|
|
2187
|
+
function E(e, t) {
|
|
2188
|
+
let n = y(e), r = t ?? n?.parentId ?? null;
|
|
2189
|
+
return r ? i.value = i.value.map((t) => t.id === r ? {
|
|
2190
|
+
...t,
|
|
2191
|
+
replies: (t.replies ?? []).filter((t) => t.id !== e)
|
|
2192
|
+
} : t) : i.value = i.value.filter((t) => t.id !== e), n;
|
|
2193
|
+
}
|
|
2194
|
+
async function D(e) {
|
|
2195
|
+
let n = g("list");
|
|
2196
|
+
a.value = !0;
|
|
2197
|
+
try {
|
|
2198
|
+
i.value = await t.list(n, e);
|
|
2199
|
+
} catch (e) {
|
|
2200
|
+
x(e);
|
|
2201
|
+
} finally {
|
|
2202
|
+
a.value = !1;
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
async function O(e) {
|
|
2206
|
+
let { create: n } = t;
|
|
2207
|
+
typeof n != "function" && v("create");
|
|
2208
|
+
let r = g("create");
|
|
2209
|
+
_("create"), o.value = !0;
|
|
2210
|
+
try {
|
|
2211
|
+
let i = await n(r, e);
|
|
2212
|
+
return T(i), S(() => t.onCreated?.(i, { origin: "local" })), i;
|
|
2213
|
+
} catch (e) {
|
|
2214
|
+
x(e);
|
|
2215
|
+
} finally {
|
|
2216
|
+
o.value = !1;
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
async function k(e, n) {
|
|
2220
|
+
let { update: r } = t;
|
|
2221
|
+
typeof r != "function" && v("update");
|
|
2222
|
+
let i = g("update");
|
|
2223
|
+
_("update"), o.value = !0;
|
|
2224
|
+
try {
|
|
2225
|
+
let a = await r(i, e, n);
|
|
2226
|
+
return T(a), S(() => t.onUpdated?.(a, { origin: "local" })), a;
|
|
2227
|
+
} catch (e) {
|
|
2228
|
+
x(e);
|
|
2229
|
+
} finally {
|
|
2230
|
+
o.value = !1;
|
|
2231
|
+
}
|
|
2232
|
+
}
|
|
2233
|
+
async function ee(e) {
|
|
2234
|
+
let { delete: n } = t;
|
|
2235
|
+
typeof n != "function" && v("delete");
|
|
2236
|
+
let r = g("delete");
|
|
2237
|
+
_("delete");
|
|
2238
|
+
let i = y(e);
|
|
2239
|
+
o.value = !0;
|
|
2240
|
+
try {
|
|
2241
|
+
await n(r, e), E(e), i && S(() => t.onDeleted?.(i, { origin: "local" }));
|
|
2242
|
+
} catch (e) {
|
|
2243
|
+
x(e);
|
|
2244
|
+
} finally {
|
|
2245
|
+
o.value = !1;
|
|
2246
|
+
}
|
|
2247
|
+
}
|
|
2248
|
+
async function A(e, n) {
|
|
2249
|
+
let { setResolved: r } = t;
|
|
2250
|
+
typeof r != "function" && v("setResolved");
|
|
2251
|
+
let i = g("setResolved");
|
|
2252
|
+
_("setResolved"), o.value = !0;
|
|
2253
|
+
try {
|
|
2254
|
+
let a = await r(i, e, n);
|
|
2255
|
+
return T(a), S(() => (a.resolvedAt ? t.onResolved : t.onUnresolved)?.(a, { origin: "local" })), a;
|
|
2256
|
+
} catch (e) {
|
|
2257
|
+
x(e);
|
|
2258
|
+
} finally {
|
|
2259
|
+
o.value = !1;
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
function j(e) {
|
|
2263
|
+
T(e) && S(() => t.onCreated?.(e, { origin: "remote" }));
|
|
2264
|
+
}
|
|
2265
|
+
function M(e) {
|
|
2266
|
+
T(e) && S(() => (e.resolvedAt ? t.onResolved : t.onUpdated)?.(e, { origin: "remote" }));
|
|
2267
|
+
}
|
|
2268
|
+
function te(e, n) {
|
|
2269
|
+
let r = E(e, n);
|
|
2270
|
+
r && S(() => t.onDeleted?.(r, { origin: "remote" }));
|
|
2271
|
+
}
|
|
2272
|
+
return {
|
|
2273
|
+
comments: i,
|
|
2274
|
+
isLoading: a,
|
|
2275
|
+
isSubmitting: o,
|
|
2276
|
+
canCreate: s,
|
|
2277
|
+
canUpdate: c,
|
|
2278
|
+
canDelete: l,
|
|
2279
|
+
canResolve: u,
|
|
2280
|
+
totalCount: f,
|
|
2281
|
+
unresolvedCount: m,
|
|
2282
|
+
commentCountByBlock: h,
|
|
2283
|
+
load: D,
|
|
2284
|
+
create: O,
|
|
2285
|
+
update: k,
|
|
2286
|
+
remove: ee,
|
|
2287
|
+
setResolved: A,
|
|
2288
|
+
find: y,
|
|
2289
|
+
isOwn: b,
|
|
2290
|
+
applyRemoteCreate: j,
|
|
2291
|
+
applyRemoteUpdate: M,
|
|
2292
|
+
applyRemoteDelete: te
|
|
2293
|
+
};
|
|
2294
|
+
}
|
|
2295
|
+
function Nt(e) {
|
|
2296
|
+
let { comments: n, provider: r, getTemplateId: i } = e, { subscribe: a } = r;
|
|
2297
|
+
if (typeof a != "function") return;
|
|
2298
|
+
let o = null;
|
|
2299
|
+
function s() {
|
|
2300
|
+
o?.(), o = null;
|
|
2301
|
+
}
|
|
2302
|
+
t(() => i(), (e) => {
|
|
2303
|
+
s(), e && (o = a(e, (e) => {
|
|
2304
|
+
switch (e.type) {
|
|
2305
|
+
case "created":
|
|
2306
|
+
n.applyRemoteCreate(e.comment);
|
|
2307
|
+
break;
|
|
2308
|
+
case "updated":
|
|
2309
|
+
n.applyRemoteUpdate(e.comment);
|
|
2310
|
+
break;
|
|
2311
|
+
case "deleted": n.applyRemoteDelete(e.commentId, e.parentId);
|
|
2312
|
+
}
|
|
2313
|
+
}));
|
|
2314
|
+
}, { immediate: !0 }), l(s);
|
|
2315
|
+
}
|
|
2316
|
+
var Pt = G({
|
|
2317
|
+
name: "code",
|
|
2318
|
+
size: 24,
|
|
2319
|
+
node: [["path", {
|
|
2320
|
+
d: "m16 18 6-6-6-6",
|
|
2321
|
+
key: "eg8j8"
|
|
2322
|
+
}], ["path", {
|
|
2323
|
+
d: "m8 6-6 6 6 6",
|
|
2324
|
+
key: "ppft3o"
|
|
2325
|
+
}]]
|
|
2326
|
+
}), Ft = G({
|
|
2327
|
+
name: "navigation",
|
|
2328
|
+
size: 24,
|
|
2329
|
+
node: [["polygon", {
|
|
2330
|
+
points: "3 11 22 2 13 21 11 13 3 11",
|
|
2331
|
+
key: "1ltx0t"
|
|
2332
|
+
}]]
|
|
2333
|
+
}), It = G({
|
|
2334
|
+
name: "share-2",
|
|
2335
|
+
size: 24,
|
|
2336
|
+
node: [
|
|
2337
|
+
["circle", {
|
|
2338
|
+
cx: "18",
|
|
2339
|
+
cy: "5",
|
|
2340
|
+
r: "3",
|
|
2341
|
+
key: "gq8acd"
|
|
2342
|
+
}],
|
|
2343
|
+
["circle", {
|
|
2344
|
+
cx: "6",
|
|
2345
|
+
cy: "12",
|
|
2346
|
+
r: "3",
|
|
2347
|
+
key: "w7nqdw"
|
|
2348
|
+
}],
|
|
2349
|
+
["circle", {
|
|
2350
|
+
cx: "18",
|
|
2351
|
+
cy: "19",
|
|
2352
|
+
r: "3",
|
|
2353
|
+
key: "1xt0gg"
|
|
2354
|
+
}],
|
|
2355
|
+
["line", {
|
|
2356
|
+
x1: "8.59",
|
|
2357
|
+
x2: "15.42",
|
|
2358
|
+
y1: "13.51",
|
|
2359
|
+
y2: "17.49",
|
|
2360
|
+
key: "47mynk"
|
|
2361
|
+
}],
|
|
2362
|
+
["line", {
|
|
2363
|
+
x1: "15.41",
|
|
2364
|
+
x2: "8.59",
|
|
2365
|
+
y1: "6.51",
|
|
2366
|
+
y2: "10.49",
|
|
2367
|
+
key: "1n3mei"
|
|
2368
|
+
}]
|
|
2369
|
+
]
|
|
2370
|
+
}), Lt = G({
|
|
2371
|
+
name: "table",
|
|
2372
|
+
size: 24,
|
|
2373
|
+
node: [
|
|
2374
|
+
["path", {
|
|
2375
|
+
d: "M12 3v18",
|
|
2376
|
+
key: "108xh3"
|
|
2377
|
+
}],
|
|
2378
|
+
["rect", {
|
|
2379
|
+
width: "18",
|
|
2380
|
+
height: "18",
|
|
2381
|
+
x: "3",
|
|
2382
|
+
y: "3",
|
|
2383
|
+
rx: "2",
|
|
2384
|
+
key: "afitv7"
|
|
2385
|
+
}],
|
|
2386
|
+
["path", {
|
|
2387
|
+
d: "M3 9h18",
|
|
2388
|
+
key: "1pudct"
|
|
2389
|
+
}],
|
|
2390
|
+
["path", {
|
|
2391
|
+
d: "M3 15h18",
|
|
2392
|
+
key: "5xshup"
|
|
2393
|
+
}]
|
|
2394
|
+
]
|
|
2395
|
+
}), Rt = 1e4;
|
|
2396
|
+
// src/composables/useImageUrlResolver.ts
|
|
2397
|
+
function zt(e) {
|
|
2398
|
+
let t = s(/* @__PURE__ */ new Map()), n = /* @__PURE__ */ new Set();
|
|
2399
|
+
function r(e) {
|
|
2400
|
+
return t.get(e);
|
|
2401
|
+
}
|
|
2402
|
+
function i(e) {
|
|
2403
|
+
return t.has(e) || n.has(e);
|
|
2404
|
+
}
|
|
2405
|
+
function a(r) {
|
|
2406
|
+
if (i(r)) return;
|
|
2407
|
+
let a;
|
|
2408
|
+
try {
|
|
2409
|
+
a = e(r);
|
|
2410
|
+
} catch {
|
|
2411
|
+
t.set(r, null);
|
|
2412
|
+
return;
|
|
2413
|
+
}
|
|
2414
|
+
a === null || typeof a == "string" ? t.set(r, a) : (n.add(r), Promise.resolve(a).then((e) => {
|
|
2415
|
+
t.set(r, typeof e == "string" ? e : null);
|
|
2416
|
+
}, () => {
|
|
2417
|
+
t.set(r, null);
|
|
2418
|
+
}).finally(() => n.delete(r)));
|
|
2419
|
+
}
|
|
2420
|
+
return {
|
|
2421
|
+
get: r,
|
|
2422
|
+
has: i,
|
|
2423
|
+
lookup: a
|
|
2424
|
+
};
|
|
2425
|
+
}
|
|
2426
|
+
function Bt(e) {
|
|
2427
|
+
let n = C(ve, null), r = d(e);
|
|
2428
|
+
if (!n) return r;
|
|
2429
|
+
let i;
|
|
2430
|
+
function a() {
|
|
2431
|
+
i !== void 0 && (clearTimeout(i), i = void 0);
|
|
2432
|
+
}
|
|
2433
|
+
x() && l(a);
|
|
2434
|
+
let o = !0;
|
|
2435
|
+
return t(r, (e) => {
|
|
2436
|
+
a();
|
|
2437
|
+
let t = o;
|
|
2438
|
+
o = !1, e && !n.has(e) && (t ? n.lookup(e) : i = setTimeout(() => {
|
|
2439
|
+
i = void 0, n.lookup(e);
|
|
2440
|
+
}, 300));
|
|
2441
|
+
}, { immediate: !0 }), d(() => {
|
|
2442
|
+
let e = r.value;
|
|
2443
|
+
if (!e) return e;
|
|
2444
|
+
let t = n.get(e);
|
|
2445
|
+
return typeof t == "string" && t.length > 0 ? t : e;
|
|
2446
|
+
});
|
|
2447
|
+
}
|
|
2448
|
+
function Vt(e, t) {
|
|
2449
|
+
if (!e || !t) return t;
|
|
2450
|
+
let n = e.get(t);
|
|
2451
|
+
return typeof n == "string" && n.length > 0 ? n : t;
|
|
2452
|
+
}
|
|
2453
|
+
function Ht(e, t) {
|
|
2454
|
+
return typeof e?.url == "string" && re(e.url, t);
|
|
2455
|
+
}
|
|
2456
|
+
function Ut(e, t) {
|
|
2457
|
+
let n = e?.url;
|
|
2458
|
+
if (typeof n == "string" && n.trim() !== "") return re(n, t) ? void 0 : n;
|
|
2459
|
+
}
|
|
2460
|
+
function Wt(e) {
|
|
2461
|
+
let t = C(_e, U.liquid), n = Bt(() => Ut(e(), t));
|
|
2462
|
+
return d(() => Ht(e(), t) ? null : n.value);
|
|
2463
|
+
}
|
|
2464
|
+
function Gt(e, t, n) {
|
|
2465
|
+
return Ht(t, n) ? null : Vt(e, Ut(t, n));
|
|
2466
|
+
}
|
|
2467
|
+
// src/utils/blockTypeLabels.ts
|
|
2468
|
+
function Kt(e, t) {
|
|
2469
|
+
return t.blocks[e] ?? e;
|
|
2470
|
+
}
|
|
2471
|
+
function qt(e, t, n = []) {
|
|
2472
|
+
if (e.type !== "custom") return Kt(e.type, t);
|
|
2473
|
+
let { customType: r } = e;
|
|
2474
|
+
return n.find((e) => e.type === r)?.name ?? r;
|
|
2475
|
+
}
|
|
2476
|
+
// src/utils/resolveFieldColors.ts
|
|
2477
|
+
function Jt(e, t) {
|
|
2478
|
+
let n = q({ presets: e.presets }, Ce), r = n.presets.length === 0, i = e.allowCustom ?? t.allowCustom;
|
|
2479
|
+
return {
|
|
2480
|
+
presets: r ? t.presets : n.presets,
|
|
2481
|
+
allowCustom: t.allowCustom !== !1 && i,
|
|
2482
|
+
invalidPresets: n.invalidPresets,
|
|
2483
|
+
emptyPresets: e.presets !== void 0 && e.presets.length === 0,
|
|
2484
|
+
presetsInherited: r,
|
|
2485
|
+
allowCustomIgnored: e.allowCustom === !0 && t.allowCustom === !1
|
|
2486
|
+
};
|
|
2487
|
+
}
|
|
2488
|
+
// src/utils/imageNaturalSize.ts
|
|
2489
|
+
function Yt(e) {
|
|
2490
|
+
return typeof e == "number" && Number.isFinite(e) && e > 0;
|
|
2491
|
+
}
|
|
2492
|
+
function Xt(e, t) {
|
|
2493
|
+
return Yt(e) && Yt(t) ? {
|
|
2494
|
+
width: e,
|
|
2495
|
+
height: t
|
|
2496
|
+
} : null;
|
|
2497
|
+
}
|
|
2498
|
+
function Zt(e) {
|
|
2499
|
+
return Xt(e.naturalWidth, e.naturalHeight);
|
|
2500
|
+
}
|
|
2501
|
+
function Qt(e) {
|
|
2502
|
+
return e ? {
|
|
2503
|
+
naturalWidth: e.width,
|
|
2504
|
+
naturalHeight: e.height
|
|
2505
|
+
} : {
|
|
2506
|
+
naturalWidth: void 0,
|
|
2507
|
+
naturalHeight: void 0
|
|
2508
|
+
};
|
|
2509
|
+
}
|
|
2510
|
+
function $t(e, t) {
|
|
2511
|
+
if (typeof Image > "u") return t(null), () => {};
|
|
2512
|
+
let n = new Image(), r = () => {
|
|
2513
|
+
n.onload = null, n.onerror = null;
|
|
2514
|
+
};
|
|
2515
|
+
return n.onload = () => {
|
|
2516
|
+
r(), t(Xt(n.naturalWidth, n.naturalHeight));
|
|
2517
|
+
}, n.onerror = () => {
|
|
2518
|
+
r(), t(null);
|
|
2519
|
+
}, n.src = e, r;
|
|
2520
|
+
}
|
|
2521
|
+
function en(e) {
|
|
2522
|
+
return new Promise((t) => {
|
|
2523
|
+
let n = setTimeout(() => {
|
|
2524
|
+
r(), t(null);
|
|
2525
|
+
}, Rt), r = $t(e, (e) => {
|
|
2526
|
+
clearTimeout(n), t(e);
|
|
2527
|
+
});
|
|
2528
|
+
});
|
|
2529
|
+
}
|
|
2530
|
+
// src/components/MediaDropOverlay.vue
|
|
2531
|
+
var tn = /* @__PURE__ */ w({
|
|
2532
|
+
__name: "MediaDropOverlay",
|
|
2533
|
+
props: {
|
|
2534
|
+
uploading: { type: Boolean },
|
|
2535
|
+
size: { default: "field" }
|
|
2536
|
+
},
|
|
2537
|
+
setup(e) {
|
|
2538
|
+
let t = e, { t: r } = xe(), s = {
|
|
2539
|
+
field: {
|
|
2540
|
+
gap: "tpl:gap-1.5",
|
|
2541
|
+
icon: 18,
|
|
2542
|
+
veil: "90%"
|
|
2543
|
+
},
|
|
2544
|
+
canvas: {
|
|
2545
|
+
gap: "tpl:gap-2",
|
|
2546
|
+
icon: 20,
|
|
2547
|
+
veil: "85%"
|
|
2548
|
+
}
|
|
2549
|
+
}, c = d(() => s[t.size]);
|
|
2550
|
+
return (t, s) => (i(), m("div", {
|
|
2551
|
+
class: a(["tpl:pointer-events-none tpl:absolute tpl:inset-0 tpl:z-10 tpl:flex tpl:flex-col tpl:items-center tpl:justify-center tpl:rounded tpl:border-2 tpl:border-dashed tpl:text-xs tpl:font-medium tpl:border-[var(--tpl-primary)] tpl:text-[var(--tpl-primary)]", c.value.gap]),
|
|
2552
|
+
style: o({ backgroundColor: `color-mix(in srgb, var(--tpl-bg) ${c.value.veil}, transparent)` })
|
|
2553
|
+
}, [e.uploading ? (i(), m(S, { key: 0 }, [u(f(ge), {
|
|
2554
|
+
class: "tpl-spinner",
|
|
2555
|
+
size: c.value.icon,
|
|
2556
|
+
"stroke-width": 2
|
|
2557
|
+
}, null, 8, ["size"]), h(" " + n(f(r).image.uploading), 1)], 64)) : (i(), m(S, { key: 1 }, [u(f(K), {
|
|
2558
|
+
size: c.value.icon,
|
|
2559
|
+
"stroke-width": 1.5
|
|
2560
|
+
}, null, 8, ["size"]), h(" " + n(f(r).image.dropToUpload), 1)], 64))], 6));
|
|
2561
|
+
}
|
|
2562
|
+
});
|
|
2563
|
+
// src/composables/useAliveFlag.ts
|
|
2564
|
+
function nn() {
|
|
2565
|
+
let e = { alive: !0 };
|
|
2566
|
+
return _(() => {
|
|
2567
|
+
e.alive = !1;
|
|
2568
|
+
}), e;
|
|
2569
|
+
}
|
|
2570
|
+
// src/composables/useImageDrop.ts
|
|
2571
|
+
var rn = "image/";
|
|
2572
|
+
function an(e) {
|
|
2573
|
+
let { target: t, onFiles: n, enabled: r } = e, i = () => r === void 0 || b(r), { isOverDropZone: a } = Se(t, {
|
|
2574
|
+
preventDefaultForUnhandled: !0,
|
|
2575
|
+
onDrop: (e) => {
|
|
2576
|
+
if (!i()) return;
|
|
2577
|
+
let t = (e ?? []).filter((e) => e.type.startsWith(rn));
|
|
2578
|
+
t.length > 0 && n([t[0]]);
|
|
2579
|
+
}
|
|
2580
|
+
});
|
|
2581
|
+
return { isOver: d(() => i() && a.value) };
|
|
2582
|
+
}
|
|
2583
|
+
// src/composables/useMediaDropField.ts
|
|
2584
|
+
function on(e) {
|
|
2585
|
+
let { target: t, blocked: n, apply: r } = e, i = C(ye, null), a = C(be, null), o = nn();
|
|
2586
|
+
async function s() {
|
|
2587
|
+
let e = await i?.({ accept: ["images"] });
|
|
2588
|
+
o.alive && e && r(e);
|
|
2589
|
+
}
|
|
2590
|
+
let c = p(!1), l = d(() => (a?.value ?? !!i) && !c.value && !b(n));
|
|
2591
|
+
async function u(e) {
|
|
2592
|
+
if (i) {
|
|
2593
|
+
c.value = !0;
|
|
2594
|
+
try {
|
|
2595
|
+
let t = await i({
|
|
2596
|
+
accept: ["images"],
|
|
2597
|
+
files: e
|
|
2598
|
+
});
|
|
2599
|
+
if (!o.alive) return;
|
|
2600
|
+
t && r(t);
|
|
2601
|
+
} finally {
|
|
2602
|
+
o.alive && (c.value = !1);
|
|
2603
|
+
}
|
|
2604
|
+
}
|
|
2605
|
+
}
|
|
2606
|
+
let { isOver: f } = an({
|
|
2607
|
+
target: t,
|
|
2608
|
+
enabled: l,
|
|
2609
|
+
onFiles: u
|
|
2610
|
+
}), m = d(() => l.value && f.value || c.value);
|
|
2611
|
+
return {
|
|
2612
|
+
canBrowse: !!i,
|
|
2613
|
+
dropEnabled: l,
|
|
2614
|
+
isUploading: c,
|
|
2615
|
+
showOverlay: m,
|
|
2616
|
+
openMediaBrowser: s
|
|
2617
|
+
};
|
|
2618
|
+
}
|
|
2619
|
+
function sn(e, t = "desktop") {
|
|
2620
|
+
return t === "mobile" ? 375 : e?.width ?? 600;
|
|
2621
|
+
}
|
|
2622
|
+
var cn = "width 300ms cubic-bezier(0.34, 1.56, 0.64, 1)", ln = {
|
|
2623
|
+
1: [100],
|
|
2624
|
+
2: [50, 50],
|
|
2625
|
+
3: [
|
|
2626
|
+
33.33,
|
|
2627
|
+
33.33,
|
|
2628
|
+
33.34
|
|
2629
|
+
],
|
|
2630
|
+
"1-2": [33.33, 66.67],
|
|
2631
|
+
"2-1": [66.67, 33.33]
|
|
2632
|
+
};
|
|
2633
|
+
function un(e, t) {
|
|
2634
|
+
let n = (e) => Math.trunc(e ?? 0), r = (e) => N(e) === null ? 0 : Math.trunc(e.width);
|
|
2635
|
+
return n(e?.left) + n(e?.right) + r(t?.left) + r(t?.right);
|
|
2636
|
+
}
|
|
2637
|
+
function dn(e, t) {
|
|
2638
|
+
return Math.floor(e) - un(t);
|
|
2639
|
+
}
|
|
2640
|
+
function fn(e, t) {
|
|
2641
|
+
let n = "border" in e ? e.border : void 0;
|
|
2642
|
+
return Math.floor(t) - un(e.styles.padding, n);
|
|
2643
|
+
}
|
|
2644
|
+
function* pn(e, t) {
|
|
2645
|
+
for (let n of e) ee(n) ? yield* pn(n.children, dn(t, n.styles.padding)) : yield {
|
|
2646
|
+
block: n,
|
|
2647
|
+
bandWidth: P(n) && n.wrapper ? dn(t, n.wrapper.padding) : t
|
|
2648
|
+
};
|
|
2649
|
+
}
|
|
2650
|
+
function mn(e, t, n = H(e)) {
|
|
2651
|
+
if (!t) return e;
|
|
2652
|
+
try {
|
|
2653
|
+
return me(ae(t, n, { missing: "default" }), e);
|
|
2654
|
+
} catch {
|
|
2655
|
+
return e;
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
function hn(e, t, n, r) {
|
|
2659
|
+
let i = mn(e, n, r);
|
|
2660
|
+
for (let { block: e, bandWidth: n } of pn(i.blocks, i.settings.width)) if (P(e)) {
|
|
2661
|
+
let r = E(e)?.applied ? void 0 : e.border, i = Math.floor(n) - un(e.styles.padding, r), a = ln[e.columns] ?? [100];
|
|
2662
|
+
for (let n = 0; n < e.children.length; n++) {
|
|
2663
|
+
let r = Math.floor(i * (a[n] ?? 100) / 100), o = e.children[n].find((e) => e.id === t);
|
|
2664
|
+
if (o) return fn(o, r);
|
|
2665
|
+
}
|
|
2666
|
+
} else if (e.id === t) return fn(e, n);
|
|
2667
|
+
return null;
|
|
2668
|
+
}
|
|
2669
|
+
function gn(e, t, n, r) {
|
|
2670
|
+
let i = mn(e, n, r);
|
|
2671
|
+
for (let { block: e, bandWidth: n } of pn(i.blocks, i.settings.width)) if (e.id === t) return Math.floor(n);
|
|
2672
|
+
return null;
|
|
2673
|
+
}
|
|
2674
|
+
function _n(e) {
|
|
2675
|
+
let t = P(e) ? E(e) : null;
|
|
2676
|
+
return !!t?.applied && t.height === "image";
|
|
2677
|
+
}
|
|
2678
|
+
function vn(e, t, n, r) {
|
|
2679
|
+
if (_n(e)) return (t ? gn(t, e.id, n, r) : null) ?? sn(t?.settings);
|
|
2680
|
+
}
|
|
2681
|
+
// src/constants/socialIcons.ts
|
|
2682
|
+
var yn = se, bn = {
|
|
2683
|
+
small: 24,
|
|
2684
|
+
medium: 32,
|
|
2685
|
+
large: 48
|
|
2686
|
+
}, xn = [
|
|
2687
|
+
"facebook",
|
|
2688
|
+
"twitter",
|
|
2689
|
+
"instagram",
|
|
2690
|
+
"linkedin",
|
|
2691
|
+
"youtube",
|
|
2692
|
+
"tiktok",
|
|
2693
|
+
"pinterest",
|
|
2694
|
+
"email",
|
|
2695
|
+
"website",
|
|
2696
|
+
"whatsapp",
|
|
2697
|
+
"telegram",
|
|
2698
|
+
"discord",
|
|
2699
|
+
"snapchat",
|
|
2700
|
+
"reddit",
|
|
2701
|
+
"github",
|
|
2702
|
+
"dribbble",
|
|
2703
|
+
"behance"
|
|
2704
|
+
];
|
|
2705
|
+
export { He as A, Ge as B, Gt as C, It as D, Lt as E, Ve as F, jt as G, Be as H, wt as I, Nt as L, Dt as M, ut as N, Ft as O, Ue as P, Mt as R, Ut as S, Bt as T, Ke as U, Ie as V, Tt as W, Xt as _, _n as a, Kt as b, cn as c, nn as d, tn as f, Zt as g, Qt as h, hn as i, At as j, Pt as k, sn as l, en as m, yn as n, vn as o, $t as p, xn as r, gn as s, bn as t, on as u, Jt as v, Wt as w, zt as x, qt as y, We as z };
|