@templatical/editor 0.56.1 → 0.57.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/{AiAltTextPopover-CpZ7UeAZ.js → AiAltTextPopover-BiZHthAB.js} +5 -5
- package/dist/{AiAltTextReview-LYxvn7Qe.js → AiAltTextReview-BwhROHiF.js} +6 -6
- package/dist/{AiChatPanel-Cy05P-iO.js → AiChatPanel-Cros4ZCM.js} +22 -25
- package/dist/AiPanels-D_CdHqFZ.js +26 -0
- package/dist/{AiRewriteMenu-DgqJHnza.js → AiRewriteMenu-6b8GNj64.js} +53 -53
- package/dist/{BlockIssueBadge-CxHJmuOh.js → BlockIssueBadge-i2cZy5PB.js} +5 -5
- package/dist/{BlockPreviewCanvas-DEmNZkEG.js → BlockPreviewCanvas-BAYIy-QJ.js} +27 -27
- package/dist/{CloudHeaderExtras-Cqhw-jMz.js → CloudHeaderExtras-CJsXi4Ku.js} +2 -2
- package/dist/{CloudPanels-Bmlf05Il.js → CloudPanels-Cb54vtYC.js} +6 -6
- package/dist/{CollaborationNotices-C27GCMvK.js → CollaborationNotices-DkYX-ose.js} +3 -3
- package/dist/{CollaboratorBar-CLQjksX-.js → CollaboratorBar-xDweDvB6.js} +3 -3
- package/dist/CommentsPanel-t3w16YUl.js +23 -0
- package/dist/CommentsSidebar-B3M90RY_.js +516 -0
- package/dist/{CountdownBlock-D8dqjm3F.js → CountdownBlock-BrR2uqM3.js} +4 -4
- package/dist/{CountdownToolbar-IjpCOjCd.js → CountdownToolbar-CTbJPh8B.js} +7 -7
- package/dist/{IssuesPanel-uwuzeMSW.js → IssuesPanel-BUKc8lld.js} +13 -13
- package/dist/{LanguageMenu-C-eQ0lFy.js → LanguageMenu-DruJAMET.js} +16 -16
- package/dist/{LoadingTrack-BG8cg9xi.js → LoadingTrack-c4SeD16s.js} +1 -1
- package/dist/{LocaleNotices-CDK_9D7P.js → LocaleNotices-D6zk-QCL.js} +5 -5
- package/dist/{LogicTagInsertButton-BSolF7Fd.js → LogicTagInsertButton-Ci7V0Exe.js} +65 -65
- package/dist/{MediaEditModal-C8yc9dxt.js → MediaEditModal-BxbwZxnf.js} +4 -4
- package/dist/{MediaPanels-FI4I8asn.js → MediaPanels-BiUxsTMM.js} +2 -2
- package/dist/{MergeTagInput-B1nl2ZMT.js → MergeTagInput-BA89v7KJ.js} +2 -2
- package/dist/{MergeTagModeToggle-DXvb80OE.js → MergeTagModeToggle-De_FNmcG.js} +7 -7
- package/dist/{MergeTagTextarea-DJlf3VbS.js → MergeTagTextarea-BRMB24Dg.js} +9 -9
- package/dist/{ParagraphEditor-Dqco128s.js → ParagraphEditor-DYqh0kEa.js} +51 -51
- package/dist/{RestoreVersionDialog-hqLCuGV5.js → RestoreVersionDialog-CRkyFafq.js} +5 -5
- package/dist/{RichTextEditorContent-xIEF0Y3Z.js → RichTextEditorContent-WeCqqCy3.js} +10 -10
- package/dist/{SaveBlockDialog-CQlCP_XC.js → SaveBlockDialog-D992yyO4.js} +15 -15
- package/dist/{SavedBlocksBrowserModal-BXA32Fx6.js → SavedBlocksBrowserModal-tH74h2Tz.js} +13 -13
- package/dist/{SavedBlocksPanels-BKUzbamj.js → SavedBlocksPanels-BuzEwYfp.js} +2 -2
- package/dist/{SavedBlocksPickBar-BlvF-4UF.js → SavedBlocksPickBar-DbULBPsI.js} +4 -4
- package/dist/{TemplateSettings-CYFtR8zv.js → TemplateSettings-eMBAy_wd.js} +14 -14
- package/dist/{TestEmailModal-BbaL17HO.js → TestEmailModal-hb9iopaZ.js} +13 -13
- package/dist/{TestEmailPanel-DhB1CSpg.js → TestEmailPanel-DbeZjj0u.js} +2 -2
- package/dist/{TitleEditor-3BRl8u5l.js → TitleEditor-CisDioGi.js} +14 -14
- package/dist/{ToggleSwitch-R3wCCYE6.js → ToggleSwitch-BIPdFWUr.js} +1 -1
- package/dist/{Toolbar-pzNIakGM.js → Toolbar-BUVRjylH.js} +218 -218
- package/dist/{TplModal-WNuWhHZm.js → TplModal-BPPP-uM6.js} +6 -6
- package/dist/{VersionHistoryMenu--T-Qp_mH.js → VersionHistoryMenu-Cd2IaHgT.js} +10 -10
- package/dist/{VersionHistoryPanels-BPubvYIE.js → VersionHistoryPanels-BNONrE-8.js} +2 -2
- package/dist/{VersionPreviewBanner-ClL3Wkln.js → VersionPreviewBanner-lkAf7tc8.js} +3 -3
- package/dist/{WrapperBlock-CjfCPceb.js → WrapperBlock-B3UAv5kv.js} +5 -5
- package/dist/{blockTypeIcons-12OMwVyN.js → blockTypeIcons-BPPpqFc2.js} +3 -3
- package/dist/bundle-stats.json +7 -7
- package/dist/cdn/chunks/{AiAltTextPopover-PFjTrl0y.js → AiAltTextPopover-CafZSF50.js} +5 -5
- package/dist/cdn/chunks/{AiAltTextPopover-PFjTrl0y.js.map → AiAltTextPopover-CafZSF50.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-BMjzvApH.js → AiAltTextReview-BJcaqyp5.js} +6 -6
- package/dist/cdn/chunks/{AiAltTextReview-BMjzvApH.js.map → AiAltTextReview-BJcaqyp5.js.map} +1 -1
- package/dist/cdn/chunks/{AiChatPanel-C2gpq4kP.js → AiChatPanel-DNCUpV8n.js} +15 -18
- package/dist/cdn/chunks/AiChatPanel-DNCUpV8n.js.map +1 -0
- package/dist/cdn/chunks/AiPanels-IV0VEkBL.js +27 -0
- package/dist/cdn/chunks/AiPanels-IV0VEkBL.js.map +1 -0
- package/dist/cdn/chunks/{AiRewriteMenu-CnkyjPEu.js → AiRewriteMenu-DFUZWA7e.js} +58 -58
- package/dist/cdn/chunks/AiRewriteMenu-DFUZWA7e.js.map +1 -0
- package/dist/cdn/chunks/{BlockIssueBadge-DncZ-HDf.js → BlockIssueBadge-DIlFDDwh.js} +5 -5
- package/dist/cdn/chunks/BlockIssueBadge-DIlFDDwh.js.map +1 -0
- package/dist/cdn/chunks/{BlockPreviewCanvas-CCSEzL46.js → BlockPreviewCanvas-D0VhkzY8.js} +28 -28
- package/dist/cdn/chunks/BlockPreviewCanvas-D0VhkzY8.js.map +1 -0
- package/dist/cdn/chunks/{CloudHeaderExtras-uUJYJFJ6.js → CloudHeaderExtras-CazfMn6A.js} +3 -3
- package/dist/cdn/chunks/{CloudHeaderExtras-uUJYJFJ6.js.map → CloudHeaderExtras-CazfMn6A.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-CRztnw4M.js → CloudPanels-BiU1MD-4.js} +5 -5
- package/dist/cdn/chunks/CloudPanels-BiU1MD-4.js.map +1 -0
- package/dist/cdn/chunks/{CollaborationNotices-IuLYT2x7.js → CollaborationNotices-DGA8XRZJ.js} +4 -4
- package/dist/cdn/chunks/{CollaborationNotices-IuLYT2x7.js.map → CollaborationNotices-DGA8XRZJ.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-C1ZI2xwa.js → CollaboratorBar-BWL1Shc1.js} +4 -4
- package/dist/cdn/chunks/{CollaboratorBar-C1ZI2xwa.js.map → CollaboratorBar-BWL1Shc1.js.map} +1 -1
- package/dist/cdn/chunks/CommentsPanel-4mrl4zMK.js +24 -0
- package/dist/cdn/chunks/CommentsPanel-4mrl4zMK.js.map +1 -0
- package/dist/cdn/chunks/CommentsSidebar-BJ87vc7i.js +486 -0
- package/dist/cdn/chunks/CommentsSidebar-BJ87vc7i.js.map +1 -0
- package/dist/cdn/chunks/{CountdownBlock-8aPSExrv.js → CountdownBlock-Do6oItNW.js} +5 -5
- package/dist/cdn/chunks/{CountdownBlock-8aPSExrv.js.map → CountdownBlock-Do6oItNW.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-CnWQEW5g.js → CountdownToolbar-CH8UK01N.js} +8 -8
- package/dist/cdn/chunks/{CountdownToolbar-CnWQEW5g.js.map → CountdownToolbar-CH8UK01N.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-CrplCzo8.js → IssuesPanel-3NPqHXJx.js} +9 -9
- package/dist/cdn/chunks/IssuesPanel-3NPqHXJx.js.map +1 -0
- package/dist/cdn/chunks/{LanguageMenu-B6MNInCL.js → LanguageMenu-75uu4P2d.js} +105 -105
- package/dist/cdn/chunks/LanguageMenu-75uu4P2d.js.map +1 -0
- package/dist/cdn/chunks/{LoadingTrack-DUYcDHOV.js → LoadingTrack-o-89hApJ.js} +2 -2
- package/dist/cdn/chunks/{LoadingTrack-DUYcDHOV.js.map → LoadingTrack-o-89hApJ.js.map} +1 -1
- package/dist/cdn/chunks/{LocaleNotices-TxeAl8Iq.js → LocaleNotices-CUN5K5QJ.js} +5 -5
- package/dist/cdn/chunks/{LocaleNotices-TxeAl8Iq.js.map → LocaleNotices-CUN5K5QJ.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-DvSVx2DB.js → LogicTagInsertButton-C5L73hYh.js} +12 -12
- package/dist/cdn/chunks/{LogicTagInsertButton-DvSVx2DB.js.map → LogicTagInsertButton-C5L73hYh.js.map} +1 -1
- package/dist/cdn/chunks/{MediaEditModal-tGK6htBl.js → MediaEditModal-BHTMNHx0.js} +4 -4
- package/dist/cdn/chunks/{MediaEditModal-tGK6htBl.js.map → MediaEditModal-BHTMNHx0.js.map} +1 -1
- package/dist/cdn/chunks/{MediaPanels-BVrQYz2C.js → MediaPanels-BlianNRh.js} +3 -3
- package/dist/cdn/chunks/{MediaPanels-BVrQYz2C.js.map → MediaPanels-BlianNRh.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-DeuNH3re.js → MergeTagInput-D8cbnnZu.js} +3 -3
- package/dist/cdn/chunks/{MergeTagInput-DeuNH3re.js.map → MergeTagInput-D8cbnnZu.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-D7maMGIM.js → MergeTagModeToggle-D-RhwBsO.js} +6 -6
- package/dist/cdn/chunks/{MergeTagModeToggle-D7maMGIM.js.map → MergeTagModeToggle-D-RhwBsO.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-B2xxIU3e.js → MergeTagTextarea-CAJIi2FE.js} +7 -7
- package/dist/cdn/chunks/{MergeTagTextarea-B2xxIU3e.js.map → MergeTagTextarea-CAJIi2FE.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-Bx_Hlw8d.js → ParagraphEditor-sRPXZDzp.js} +30 -30
- package/dist/cdn/chunks/{ParagraphEditor-Bx_Hlw8d.js.map → ParagraphEditor-sRPXZDzp.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-CPrrWTsT.js → RestoreVersionDialog-CJK-14PX.js} +5 -5
- package/dist/cdn/chunks/RestoreVersionDialog-CJK-14PX.js.map +1 -0
- package/dist/cdn/chunks/{RichTextEditorContent-Dze4C9VI.js → RichTextEditorContent-DU0wtA_j.js} +9 -9
- package/dist/cdn/chunks/{RichTextEditorContent-Dze4C9VI.js.map → RichTextEditorContent-DU0wtA_j.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-CXVwnfsy.js → SaveBlockDialog-C8hY9xA-.js} +13 -13
- package/dist/cdn/chunks/{SaveBlockDialog-CXVwnfsy.js.map → SaveBlockDialog-C8hY9xA-.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BDTmenOE.js → SavedBlocksBrowserModal-B3nFAgAa.js} +9 -9
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-BDTmenOE.js.map → SavedBlocksBrowserModal-B3nFAgAa.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-B41Rk_v1.js → SavedBlocksPanels-CQenugHO.js} +3 -3
- package/dist/cdn/chunks/{SavedBlocksPanels-B41Rk_v1.js.map → SavedBlocksPanels-CQenugHO.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-B97z_rFH.js → SavedBlocksPickBar-DzUP4IYv.js} +5 -5
- package/dist/cdn/chunks/{SavedBlocksPickBar-B97z_rFH.js.map → SavedBlocksPickBar-DzUP4IYv.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-YwwRbxPc.js → TemplateSettings-DnOwyN_1.js} +12 -12
- package/dist/cdn/chunks/{TemplateSettings-YwwRbxPc.js.map → TemplateSettings-DnOwyN_1.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-BiFP2Cbx.js → TestEmailModal-BFqmfOZ1.js} +10 -10
- package/dist/cdn/chunks/{TestEmailModal-BiFP2Cbx.js.map → TestEmailModal-BFqmfOZ1.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-BrivPMk2.js → TestEmailPanel-DFOhhaa9.js} +3 -3
- package/dist/cdn/chunks/{TestEmailPanel-BrivPMk2.js.map → TestEmailPanel-DFOhhaa9.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-CzPkkL2s.js → TitleEditor-ChPXTB9T.js} +13 -13
- package/dist/cdn/chunks/{TitleEditor-CzPkkL2s.js.map → TitleEditor-ChPXTB9T.js.map} +1 -1
- package/dist/cdn/chunks/{ToggleSwitch-BSkySwA1.js → ToggleSwitch-C0w0srN_.js} +2 -2
- package/dist/cdn/chunks/{ToggleSwitch-BSkySwA1.js.map → ToggleSwitch-C0w0srN_.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-VH07SzX7.js → Toolbar-bbO5WoKo.js} +302 -302
- package/dist/cdn/chunks/Toolbar-bbO5WoKo.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-DMe6J811.js → TplModal-Bg97XHIJ.js} +6 -6
- package/dist/cdn/chunks/{TplModal-DMe6J811.js.map → TplModal-Bg97XHIJ.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-DkwbKhBl.js → VersionHistoryMenu-BNPxnWiO.js} +9 -9
- package/dist/cdn/chunks/{VersionHistoryMenu-DkwbKhBl.js.map → VersionHistoryMenu-BNPxnWiO.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-CgxhMRAl.js → VersionHistoryPanels-CyyRXWPU.js} +3 -3
- package/dist/cdn/chunks/{VersionHistoryPanels-CgxhMRAl.js.map → VersionHistoryPanels-CyyRXWPU.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-WVBDBrwQ.js → VersionPreviewBanner-BldFvgxJ.js} +4 -4
- package/dist/cdn/chunks/{VersionPreviewBanner-WVBDBrwQ.js.map → VersionPreviewBanner-BldFvgxJ.js.map} +1 -1
- package/dist/cdn/chunks/{WrapperBlock-CCCIcqe2.js → WrapperBlock-ZBCf7Y8u.js} +6 -6
- package/dist/cdn/chunks/{WrapperBlock-CCCIcqe2.js.map → WrapperBlock-ZBCf7Y8u.js.map} +1 -1
- package/dist/cdn/chunks/{blockTypeIcons-CzYA5DF9.js → blockTypeIcons-19xd5ZPi.js} +6 -6
- package/dist/cdn/chunks/{blockTypeIcons-CzYA5DF9.js.map → blockTypeIcons-19xd5ZPi.js.map} +1 -1
- package/dist/cdn/chunks/{composables-D3lsO7Io.js → composables-CMBZad02.js} +750 -730
- package/dist/cdn/chunks/composables-CMBZad02.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-CE79GB1H.js → createCloudRuntime-BHGFjpek.js} +157 -143
- package/dist/cdn/chunks/createCloudRuntime-BHGFjpek.js.map +1 -0
- package/dist/cdn/chunks/da-CYWJkrTg.js +97 -0
- package/dist/cdn/chunks/da-CYWJkrTg.js.map +1 -0
- package/dist/cdn/chunks/da-qQzj0QGy.js +950 -0
- package/dist/cdn/chunks/da-qQzj0QGy.js.map +1 -0
- package/dist/cdn/chunks/{dist-BzXULHvI.js → dist-BtWMy7UQ.js} +3 -3
- package/dist/cdn/chunks/{dist-BzXULHvI.js.map → dist-BtWMy7UQ.js.map} +1 -1
- package/dist/cdn/chunks/{dist-Cf1pSluo.js → dist-zu1jwYIS.js} +4 -4
- package/dist/cdn/chunks/{dist-Cf1pSluo.js.map → dist-zu1jwYIS.js.map} +1 -1
- package/dist/cdn/chunks/{draggable-DepKdldn.js → draggable-IRVFEZ-b.js} +1535 -1500
- package/dist/cdn/chunks/draggable-IRVFEZ-b.js.map +1 -0
- package/dist/cdn/chunks/{editor-modal-CN69NlOK.js → editor-modal-CarOiAYJ.js} +77 -76
- package/dist/cdn/chunks/{editor-modal-CN69NlOK.js.map → editor-modal-CarOiAYJ.js.map} +1 -1
- package/dist/cdn/chunks/en-B4s_0ryk.js +1 -0
- package/dist/cdn/chunks/{extensions-8dlM-fU4.js → extensions-Beg0g2wm.js} +7 -7
- package/dist/cdn/chunks/{extensions-8dlM-fU4.js.map → extensions-Beg0g2wm.js.map} +1 -1
- package/dist/cdn/chunks/{icons-DHExFLlT.js → icons-Cl4oR2mf.js} +73 -73
- package/dist/cdn/chunks/icons-Cl4oR2mf.js.map +1 -0
- package/dist/cdn/chunks/keys-BQqbBUag.js +11 -0
- package/dist/cdn/chunks/keys-BQqbBUag.js.map +1 -0
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-aWjkotui.js → normalizeMergeTagMarkup-B8yU4usU.js} +55 -55
- package/dist/cdn/chunks/{normalizeMergeTagMarkup-aWjkotui.js.map → normalizeMergeTagMarkup-B8yU4usU.js.map} +1 -1
- package/dist/cdn/chunks/{preRenderCustomBlocks-Dn6dFUwx.js → preRenderCustomBlocks-CPHm2GOQ.js} +2 -2
- package/dist/cdn/chunks/{preRenderCustomBlocks-Dn6dFUwx.js.map → preRenderCustomBlocks-CPHm2GOQ.js.map} +1 -1
- package/dist/cdn/chunks/{sanitizeHtml-B3njfkSy.js → sanitizeHtml-B7LC0gKK.js} +22 -11
- package/dist/cdn/chunks/sanitizeHtml-B7LC0gKK.js.map +1 -0
- package/dist/cdn/chunks/{socialIcons-BFgc3qqJ.js → socialIcons-D9D02_y5.js} +575 -524
- package/dist/cdn/chunks/socialIcons-D9D02_y5.js.map +1 -0
- package/dist/cdn/chunks/{src-C9JWWxAk.js → src-BCrSqaj8.js} +108 -95
- package/dist/cdn/chunks/src-BCrSqaj8.js.map +1 -0
- package/dist/cdn/chunks/{src-GgKlXNxy.js → src-BO4aXl_Y.js} +232 -228
- package/dist/cdn/chunks/src-BO4aXl_Y.js.map +1 -0
- package/dist/cdn/chunks/{src-mXG-Of9A.js → src-DeywvttP.js} +812 -780
- package/dist/cdn/chunks/src-DeywvttP.js.map +1 -0
- package/dist/cdn/chunks/{tiptap-C940SvId.js → tiptap-BPiZqxCt.js} +40 -31
- package/dist/cdn/chunks/tiptap-BPiZqxCt.js.map +1 -0
- package/dist/cdn/chunks/{useCloudI18n-Xsih9yRH.js → useCloudI18n-Dr4S2TRW.js} +3 -3
- package/dist/cdn/chunks/{useCloudI18n-Xsih9yRH.js.map → useCloudI18n-Dr4S2TRW.js.map} +1 -1
- package/dist/cdn/chunks/useEditorRoot-B_kf_k-g.js +9 -0
- package/dist/cdn/chunks/{useEditorRoot-Beau2Z_T.js.map → useEditorRoot-B_kf_k-g.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-D8s7HtTn.js → useI18n-CSf-ZpcM.js} +3 -3
- package/dist/cdn/chunks/{useI18n-D8s7HtTn.js.map → useI18n-CSf-ZpcM.js.map} +1 -1
- package/dist/cdn/chunks/useLocalizedDisplay-oykFcYrW.js +33 -0
- package/dist/cdn/chunks/{useLocalizedDisplay-Bgg4qpev.js.map → useLocalizedDisplay-oykFcYrW.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-B0PDeDxl.js → useLogicTag-D_qg9qqO.js} +4 -4
- package/dist/cdn/chunks/{useLogicTag-B0PDeDxl.js.map → useLogicTag-D_qg9qqO.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-BSU75bKk.js → useMergeTag-VLnVHtxV.js} +4 -4
- package/dist/cdn/chunks/{useMergeTag-BSU75bKk.js.map → useMergeTag-VLnVHtxV.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-esO6wjvU.js → usePopoverPosition-BJFFi8x6.js} +3 -3
- package/dist/cdn/chunks/{usePopoverPosition-esO6wjvU.js.map → usePopoverPosition-BJFFi8x6.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-CJuUu7Xj.js → useScrollToBlock-MI4PP5lk.js} +3 -3
- package/dist/cdn/chunks/{useScrollToBlock-CJuUu7Xj.js.map → useScrollToBlock-MI4PP5lk.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-QqBilClC.js → withCurrentFont-m6TtR0dC.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-QqBilClC.js.map → withCurrentFont-m6TtR0dC.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +685 -663
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-CcuCoJDh.js → check-C7ua4TAK.js} +1 -1
- package/dist/{chevron-down-BfYIbFbC.js → chevron-down-DftQrAkI.js} +1 -1
- package/dist/{chevron-right-DyjFqY35.js → chevron-right-B-DULGbg.js} +1 -1
- package/dist/{chevron-up-BHEIxuS-.js → chevron-up-CeYsyD8c.js} +1 -1
- package/dist/{circle-alert-Tq7kAh9S.js → circle-exclamation-point-DHjORV_I.js} +3 -3
- package/dist/{clock-Df0ZiXwQ.js → clock-CajOtLEZ.js} +1 -1
- package/dist/{composables-DreAt_0A.js → composables-Cq7rsxRc.js} +1123 -1103
- package/dist/{createCloudRuntime-CL4tUlDC.js → createCloudRuntime-CHsFF8DI.js} +42 -28
- package/dist/{createLucideIcon-CfBdtoUw.js → createLucideIcon-D-mELTSY.js} +6 -6
- package/dist/da-CYWJkrTg.js +95 -0
- package/dist/da-qQzj0QGy.js +948 -0
- package/dist/{dist-CX7skkvG.js → dist-A328tG0Z.js} +2 -2
- package/dist/{dist-BjzK1g4Z.js → dist-B15BvV94.js} +2 -2
- package/dist/{dist-DDytHU_6.js → dist-B3G4Yvpd.js} +3 -3
- package/dist/{dist-CiYotUR8.js → dist-B6ptxfPo.js} +3 -3
- package/dist/{dist-0GWMyHtM.js → dist-BmV-2uBJ.js} +2 -2
- package/dist/{dist-CCLRTtJP.js → dist-BxKFi2h_.js} +5 -5
- package/dist/{dist-BMUUt3zJ.js → dist-C0hVefGI.js} +791 -759
- package/dist/{dist-CsknfjrZ.js → dist-CMBOqk9I.js} +7 -7
- package/dist/{dist-ZrT0vAB6.js → dist-CXTsTO5h.js} +2 -2
- package/dist/{dist-Dq9VnANT.js → dist-D5BUcCjv.js} +2 -2
- package/dist/dist-D9cbSSSx.js +4 -0
- package/dist/{dist-BsumKKh9.js → dist-DAdrn64r.js} +2 -2
- package/dist/{dist-C3avsUq9.js → dist-DENg3ORe.js} +31 -22
- package/dist/{dist-Cr1CLCmx.js → dist-DI_8rB1X.js} +2 -2
- package/dist/dist-ELLEk-lS.js +4 -0
- package/dist/{editor-modal-BD32TXws.js → editor-modal-CgsaLpwB.js} +20 -19
- package/dist/en-DBLcB-CW.js +1 -0
- package/dist/{extensions-DKxHlSd7.js → extensions-BSXjPQEc.js} +21 -21
- package/dist/{eye-B3psrAqd.js → eye-fe5sKF_K.js} +1 -1
- package/dist/{image-C3yuPDxx.js → image-CUC7SZiW.js} +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/{info-DKja7A68.js → info-DDbLU4pT.js} +1 -1
- package/dist/keys-D9oKZN1h.js +9 -0
- package/dist/{link-DhzPI4Hn.js → link-C2icj0iH.js} +1 -1
- package/dist/{list-DVGn7Ik2.js → list-KYC_Jb5A.js} +1 -1
- package/dist/{loader-circle-DqKWsMHO.js → loader-circle-DmyagWpc.js} +1 -1
- package/dist/{message-circle-C4TonoBs.js → message-circle-ijyWn6UJ.js} +1 -1
- package/dist/{normalizeMergeTagMarkup-Da9JAgx7.js → normalizeMergeTagMarkup-CBLCQe02.js} +82 -82
- package/dist/{package-9OkiEO4S.js → package-CKYm_jQY.js} +1 -1
- package/dist/{pencil-M9vkOB7C.js → pencil-C2TRSR-Y.js} +1 -1
- package/dist/{plus-DxZiv9YC.js → plus-CotJVDxb.js} +1 -1
- package/dist/{preRenderCustomBlocks-CdqSp2P7.js → preRenderCustomBlocks-e2OlY4aU.js} +3 -3
- package/dist/{refresh-cw-UY8_sdFG.js → refresh-cw-CuCRV6D5.js} +1 -1
- package/dist/{rotate-ccw-BFTGCpHn.js → rotate-ccw-BlnQ3y6R.js} +1 -1
- package/dist/{runtime-dom.esm-bundler-DlHp8xgy.js → runtime-dom.esm-bundler-nN-jsqr1.js} +20 -20
- package/dist/{sanitizeHtml-wBibnBF4.js → sanitizeHtml-Dfn-fH17.js} +25 -14
- package/dist/{search-RuGJnMEn.js → search-Dxw6oFrZ.js} +1 -1
- package/dist/{send-DGB1ar02.js → send-C-blQBZ9.js} +1 -1
- package/dist/{smartphone-CVA29CU_.js → smartphone-rLz4X-Dd.js} +1 -1
- package/dist/{socialIcons-oo4uL16Y.js → socialIcons-BZRLo0eT.js} +600 -549
- package/dist/{sparkles-IHfEwEcd.js → sparkles-JWQlUiSn.js} +1 -1
- package/dist/{square-_Cl44UU6.js → square-DshDy1Il.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +748 -726
- package/dist/{text-align-start-Dqk2Xt_Q.js → text-align-start-CyasaQtr.js} +13 -13
- package/dist/{trash-Cr7rD5Hh.js → trash-B1lZp2Tv.js} +1 -1
- package/dist/{triangle-alert-CKcpwtUj.js → triangle-exclamation-point-BhJvBEoT.js} +3 -3
- package/dist/{upload-DR9pqVON.js → upload-CNK8JX38.js} +1 -1
- package/dist/{useCloudI18n-BczJoFf4.js → useCloudI18n-HhCZYRV6.js} +2 -2
- package/dist/useEditorRoot-B0Njczhx.js +7 -0
- package/dist/{useI18n-zeWYtWSv.js → useI18n-CM9vKbYc.js} +2 -2
- package/dist/{cdn/chunks/useLocalizedDisplay-Bgg4qpev.js → useLocalizedDisplay-B7tlQF4g.js} +2 -4
- package/dist/{useLogicTag-B4Zpk3eo.js → useLogicTag-k_y-4o4W.js} +3 -3
- package/dist/{useMergeTag-B5qlq8px.js → useMergeTag-BiZ6XOdL.js} +3 -3
- package/dist/{usePopoverPosition-Br3zt_MQ.js → usePopoverPosition-CVRzzLkC.js} +2 -2
- package/dist/{useScrollToBlock-BfOzc1Z6.js → useScrollToBlock-vf_KD0FM.js} +3 -3
- package/dist/{vue.runtime.esm-bundler-BJXc_Mri.js → vue.runtime.esm-bundler-BE5V8ADU.js} +414 -362
- package/dist/{withCurrentFont-m_PHcOD0.js → withCurrentFont-CPhRujet.js} +1 -1
- package/dist/{x-DZSFHafL.js → x-DbLX5Qdm.js} +1 -1
- package/package.json +23 -23
- package/dist/AiPanels-CwKmXzyr.js +0 -31
- package/dist/CommentsPanel-B5NqPMmY.js +0 -16
- package/dist/CommentsSidebar-BDrcrDxS.js +0 -526
- package/dist/cdn/chunks/AiChatPanel-C2gpq4kP.js.map +0 -1
- package/dist/cdn/chunks/AiPanels-Cx3PE2mE.js +0 -32
- package/dist/cdn/chunks/AiPanels-Cx3PE2mE.js.map +0 -1
- package/dist/cdn/chunks/AiRewriteMenu-CnkyjPEu.js.map +0 -1
- package/dist/cdn/chunks/BlockIssueBadge-DncZ-HDf.js.map +0 -1
- package/dist/cdn/chunks/BlockPreviewCanvas-CCSEzL46.js.map +0 -1
- package/dist/cdn/chunks/CloudPanels-CRztnw4M.js.map +0 -1
- package/dist/cdn/chunks/CommentsPanel-lgjJNrrY.js +0 -18
- package/dist/cdn/chunks/CommentsPanel-lgjJNrrY.js.map +0 -1
- package/dist/cdn/chunks/CommentsSidebar-DTold7iy.js +0 -496
- package/dist/cdn/chunks/CommentsSidebar-DTold7iy.js.map +0 -1
- package/dist/cdn/chunks/IssuesPanel-CrplCzo8.js.map +0 -1
- package/dist/cdn/chunks/LanguageMenu-B6MNInCL.js.map +0 -1
- package/dist/cdn/chunks/RestoreVersionDialog-CPrrWTsT.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-VH07SzX7.js.map +0 -1
- package/dist/cdn/chunks/composables-D3lsO7Io.js.map +0 -1
- package/dist/cdn/chunks/createCloudRuntime-CE79GB1H.js.map +0 -1
- package/dist/cdn/chunks/draggable-DepKdldn.js.map +0 -1
- package/dist/cdn/chunks/en-Bcz4gS9U.js +0 -1
- package/dist/cdn/chunks/icons-DHExFLlT.js.map +0 -1
- package/dist/cdn/chunks/keys-BUmIvYy3.js +0 -11
- package/dist/cdn/chunks/keys-BUmIvYy3.js.map +0 -1
- package/dist/cdn/chunks/sanitizeHtml-B3njfkSy.js.map +0 -1
- package/dist/cdn/chunks/socialIcons-BFgc3qqJ.js.map +0 -1
- package/dist/cdn/chunks/src-C9JWWxAk.js.map +0 -1
- package/dist/cdn/chunks/src-GgKlXNxy.js.map +0 -1
- package/dist/cdn/chunks/src-mXG-Of9A.js.map +0 -1
- package/dist/cdn/chunks/tiptap-C940SvId.js.map +0 -1
- package/dist/cdn/chunks/useEditorRoot-Beau2Z_T.js +0 -9
- package/dist/dist-B_0FPmoy.js +0 -4
- package/dist/dist-DKV9m4Uu.js +0 -4
- package/dist/en-Dgs_-NBw.js +0 -1
- package/dist/keys-w_VRjoMu.js +0 -9
- package/dist/useEditorRoot-BcXKhM_8.js +0 -7
- package/dist/useLocalizedDisplay-Cbhx208c.js +0 -31
|
@@ -45,25 +45,25 @@ var s = {
|
|
|
45
45
|
2: 28,
|
|
46
46
|
3: 22,
|
|
47
47
|
4: 18
|
|
48
|
-
}, c = 1.3, l = {
|
|
48
|
+
}, c = 1.3, l = 1.2, u = {
|
|
49
49
|
paragraphGap: 8,
|
|
50
50
|
listMarginY: 8,
|
|
51
51
|
listPaddingLeft: 24,
|
|
52
52
|
listItemMarginY: 4
|
|
53
|
-
},
|
|
53
|
+
}, d = [
|
|
54
54
|
"cover",
|
|
55
55
|
"contain",
|
|
56
56
|
"auto"
|
|
57
|
-
],
|
|
57
|
+
], f = [
|
|
58
58
|
"left",
|
|
59
59
|
"center",
|
|
60
60
|
"right"
|
|
61
|
-
],
|
|
61
|
+
], p = [
|
|
62
62
|
"top",
|
|
63
63
|
"center",
|
|
64
64
|
"bottom"
|
|
65
65
|
];
|
|
66
|
-
function
|
|
66
|
+
function ee(e) {
|
|
67
67
|
return {
|
|
68
68
|
url: e,
|
|
69
69
|
size: "cover",
|
|
@@ -74,7 +74,7 @@ function p(e) {
|
|
|
74
74
|
repeat: !1
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function te(e) {
|
|
78
78
|
let t = "";
|
|
79
79
|
for (let n of e) {
|
|
80
80
|
let e = n.charCodeAt(0);
|
|
@@ -82,35 +82,35 @@ function m(e) {
|
|
|
82
82
|
}
|
|
83
83
|
return t;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function ne(e) {
|
|
86
86
|
let t = typeof e?.url == "string" ? e.url.trim() : "";
|
|
87
87
|
if (!e || !t) return null;
|
|
88
|
-
let n =
|
|
88
|
+
let n = d.includes(e.size) ? e.size : "cover", r = e.position, i = r && f.includes(r.x) ? r.x : "center", a = r && p.includes(r.y) ? r.y : "center";
|
|
89
89
|
return {
|
|
90
|
-
url:
|
|
90
|
+
url: te(t),
|
|
91
91
|
size: n,
|
|
92
92
|
position: `${i} ${a}`,
|
|
93
93
|
repeat: e.repeat ? "repeat" : "no-repeat"
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
|
-
var
|
|
96
|
+
var re = [
|
|
97
97
|
"top",
|
|
98
98
|
"middle",
|
|
99
99
|
"bottom"
|
|
100
100
|
];
|
|
101
|
-
function
|
|
101
|
+
function ie(e) {
|
|
102
102
|
let t = e.hero;
|
|
103
103
|
if (!t || typeof t != "object") return null;
|
|
104
104
|
if (e.columns !== "1") return {
|
|
105
105
|
applied: !1,
|
|
106
106
|
reason: "columns"
|
|
107
107
|
};
|
|
108
|
-
let n =
|
|
108
|
+
let n = ne(e.backgroundImage);
|
|
109
109
|
if (n === null) return {
|
|
110
110
|
applied: !1,
|
|
111
111
|
reason: "image"
|
|
112
112
|
};
|
|
113
|
-
let r =
|
|
113
|
+
let r = oe(e.backgroundImage), i = ae(t.height) ? Math.round(t.height) : "image";
|
|
114
114
|
return i === "image" && r === null ? {
|
|
115
115
|
applied: !1,
|
|
116
116
|
reason: "size"
|
|
@@ -118,18 +118,18 @@ function ne(e) {
|
|
|
118
118
|
applied: !0,
|
|
119
119
|
image: n,
|
|
120
120
|
height: i,
|
|
121
|
-
verticalAlign:
|
|
121
|
+
verticalAlign: re.includes(t.verticalAlign) ? t.verticalAlign : "middle",
|
|
122
122
|
aspectRatio: r
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function ae(e) {
|
|
126
126
|
return typeof e == "number" && Number.isFinite(e) && e >= 1;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function oe(e) {
|
|
129
129
|
let t = e?.naturalWidth, n = e?.naturalHeight;
|
|
130
130
|
return typeof t != "number" || typeof n != "number" || !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 || n <= 0 ? null : n / t;
|
|
131
131
|
}
|
|
132
|
-
var
|
|
132
|
+
var se = {
|
|
133
133
|
facebook: {
|
|
134
134
|
color: "#1877F2",
|
|
135
135
|
path: "M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z"
|
|
@@ -202,31 +202,31 @@ var ae = {
|
|
|
202
202
|
color: "#1769FF",
|
|
203
203
|
path: "M22 7h-7V5h7v2zm1.726 10c-.442 1.297-2.029 3-5.101 3-3.074 0-5.564-1.729-5.564-5.675 0-3.91 2.325-5.92 5.466-5.92 3.082 0 4.964 1.782 5.375 4.426.078.506.109 1.188.095 2.14H15.97c.13 3.211 3.483 3.312 4.588 2.029h3.168zm-7.686-4h4.965c-.105-1.547-1.136-2.219-2.477-2.219-1.466 0-2.277.768-2.488 2.219zm-9.574 6.988H0V5.021h6.953c5.476.081 5.58 5.444 2.72 6.906 3.461 1.26 3.577 8.061-3.207 8.061zM3 11h3.584c2.508 0 2.906-3-.312-3H3v3zm3.391 3H3v3.016h3.341c3.055 0 2.868-3.016.05-3.016z"
|
|
204
204
|
}
|
|
205
|
-
},
|
|
205
|
+
}, ce = {
|
|
206
206
|
dark: "#1f1f1f",
|
|
207
207
|
light: "#ffffff"
|
|
208
208
|
};
|
|
209
|
-
function
|
|
209
|
+
function le(e) {
|
|
210
210
|
return e === "dark" || e === "light" ? e : void 0;
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
let n =
|
|
212
|
+
function ue(e, t) {
|
|
213
|
+
let n = le(t);
|
|
214
214
|
return {
|
|
215
|
-
fill: n ?
|
|
216
|
-
onFill: n === "light" ?
|
|
215
|
+
fill: n ? ce[n] : se[e].color,
|
|
216
|
+
onFill: n === "light" ? ce.dark : "#ffffff"
|
|
217
217
|
};
|
|
218
218
|
}
|
|
219
|
-
function
|
|
220
|
-
if (
|
|
221
|
-
color:
|
|
219
|
+
function de(e, t) {
|
|
220
|
+
if (le(t) === "dark" && (e === "plain" || e === "outlined")) return {
|
|
221
|
+
color: ce.light,
|
|
222
222
|
opacity: .6,
|
|
223
223
|
width: 1.4
|
|
224
224
|
};
|
|
225
225
|
}
|
|
226
|
-
function
|
|
226
|
+
function fe(e) {
|
|
227
227
|
return e === "plain" ? .84 : .6;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function pe(e) {
|
|
230
230
|
let t = [], n = (e, n) => {
|
|
231
231
|
typeof e == "string" && /[./]/.test(e) && t.push({
|
|
232
232
|
path: n,
|
|
@@ -244,7 +244,7 @@ function de(e) {
|
|
|
244
244
|
};
|
|
245
245
|
return r(e.blocks, "blocks"), t;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function m(e) {
|
|
248
248
|
let t = [];
|
|
249
249
|
return JSON.parse(JSON.stringify(e, function(e, n) {
|
|
250
250
|
if (typeof n != "object" || !n) return n;
|
|
@@ -252,21 +252,21 @@ function h(e) {
|
|
|
252
252
|
if (!t.includes(n)) return t.push(n), n;
|
|
253
253
|
}));
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function me(e) {
|
|
256
256
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function h(e, t) {
|
|
259
259
|
if (e === t) return !0;
|
|
260
|
-
if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) =>
|
|
261
|
-
if (
|
|
262
|
-
if (!
|
|
260
|
+
if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => h(e, t[n]));
|
|
261
|
+
if (me(e)) {
|
|
262
|
+
if (!me(t)) return !1;
|
|
263
263
|
let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
264
|
-
for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !
|
|
264
|
+
for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !h(e[r], t[r])) return !1;
|
|
265
265
|
return !0;
|
|
266
266
|
}
|
|
267
267
|
return !1;
|
|
268
268
|
}
|
|
269
|
-
var
|
|
269
|
+
var he = class extends Error {
|
|
270
270
|
statusCode;
|
|
271
271
|
code;
|
|
272
272
|
constructor(e, t, n, r) {
|
|
@@ -281,7 +281,7 @@ var pe = class extends Error {
|
|
|
281
281
|
get isServerError() {
|
|
282
282
|
return this.statusCode !== void 0 && this.statusCode >= 500;
|
|
283
283
|
}
|
|
284
|
-
},
|
|
284
|
+
}, ge = {
|
|
285
285
|
title: ["content"],
|
|
286
286
|
paragraph: ["content"],
|
|
287
287
|
html: ["content"],
|
|
@@ -298,58 +298,58 @@ var pe = class extends Error {
|
|
|
298
298
|
"expiredMessage"
|
|
299
299
|
],
|
|
300
300
|
custom: ["fieldValues.*"]
|
|
301
|
-
},
|
|
302
|
-
function
|
|
301
|
+
}, g = ["preheaderText"];
|
|
302
|
+
function _e(e) {
|
|
303
303
|
return typeof e == "string" && /^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/.test(e);
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function _(e) {
|
|
306
306
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
307
307
|
}
|
|
308
|
-
var
|
|
308
|
+
var ve = /* @__PURE__ */ new Set([
|
|
309
309
|
"__proto__",
|
|
310
310
|
"constructor",
|
|
311
311
|
"prototype"
|
|
312
312
|
]);
|
|
313
|
-
function
|
|
314
|
-
return e.split(".").every((e) => e !== "" && !
|
|
313
|
+
function v(e) {
|
|
314
|
+
return e.split(".").every((e) => e !== "" && !ve.has(e));
|
|
315
315
|
}
|
|
316
|
-
function
|
|
317
|
-
if (!
|
|
316
|
+
function ye(e, t) {
|
|
317
|
+
if (!ve.has(t)) return Array.isArray(e) ? e.find((e) => _(e) && e.id === t) : _(e) && Object.hasOwn(e, t) ? e[t] : void 0;
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
return t.split(".").reduce(
|
|
319
|
+
function y(e, t) {
|
|
320
|
+
return t.split(".").reduce(ye, e);
|
|
321
321
|
}
|
|
322
|
-
function
|
|
323
|
-
let t =
|
|
322
|
+
function be(e) {
|
|
323
|
+
let t = m(e);
|
|
324
324
|
for (let [n, r] of Object.entries(t.l10n ?? {})) {
|
|
325
325
|
for (let t of ["text", "set"]) {
|
|
326
326
|
for (let n of Object.keys(r[t] ?? {})) {
|
|
327
|
-
let i = n.includes(".") ?
|
|
328
|
-
|
|
327
|
+
let i = n.includes(".") ? y(e, n.slice(0, n.lastIndexOf("."))) : e;
|
|
328
|
+
v(n) && (t !== "text" && _(i) || y(e, n) !== void 0) || delete r[t][n];
|
|
329
329
|
}
|
|
330
330
|
r[t] && !Object.keys(r[t]).length && delete r[t];
|
|
331
331
|
}
|
|
332
332
|
Object.keys(r).length || delete t.l10n[n];
|
|
333
333
|
}
|
|
334
|
-
return t.l10n && !Object.keys(t.l10n).length && delete t.l10n,
|
|
334
|
+
return t.l10n && !Object.keys(t.l10n).length && delete t.l10n, h(t, e) ? e : t;
|
|
335
335
|
}
|
|
336
|
-
function
|
|
337
|
-
let t =
|
|
336
|
+
function xe(e) {
|
|
337
|
+
let t = be(e);
|
|
338
338
|
if (t.type === "wrapper") {
|
|
339
|
-
let e = t.children.map(
|
|
339
|
+
let e = t.children.map(xe);
|
|
340
340
|
return e.some((e, n) => e !== t.children[n]) ? {
|
|
341
341
|
...t,
|
|
342
342
|
children: e
|
|
343
343
|
} : t;
|
|
344
344
|
}
|
|
345
345
|
if (t.type !== "section") return t;
|
|
346
|
-
let n = t.children.map((e) => e.map(
|
|
346
|
+
let n = t.children.map((e) => e.map(xe));
|
|
347
347
|
return n.some((e, n) => e.some((e, r) => e !== t.children[n][r])) ? {
|
|
348
348
|
...t,
|
|
349
349
|
children: n
|
|
350
350
|
} : t;
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function Se(e, t, n) {
|
|
353
353
|
if (e.type === "custom") return !1;
|
|
354
354
|
if (e.type === "section") return t === "columns";
|
|
355
355
|
let r = e.type === "menu" ? "items" : e.type === "social" ? "icons" : e.type === "table" ? "rows" : null;
|
|
@@ -362,44 +362,44 @@ function be(e, t, n) {
|
|
|
362
362
|
let o = a.split(".").length;
|
|
363
363
|
if (i[o] === "id") return !0;
|
|
364
364
|
if (i.length !== o) return !1;
|
|
365
|
-
let s =
|
|
366
|
-
if (!
|
|
365
|
+
let s = y(e, a);
|
|
366
|
+
if (!_(s) || !_(n) || s.id !== n.id) return !0;
|
|
367
367
|
if (e.type === "table" && o === 2) {
|
|
368
|
-
let e = (e) => Array.isArray(e) ? e.map((e) =>
|
|
369
|
-
return !
|
|
368
|
+
let e = (e) => Array.isArray(e) ? e.map((e) => _(e) ? e.id : void 0) : null;
|
|
369
|
+
return !h(e(s.cells), e(n.cells));
|
|
370
370
|
}
|
|
371
371
|
return !1;
|
|
372
372
|
}
|
|
373
|
-
function
|
|
374
|
-
return
|
|
373
|
+
function Ce(e) {
|
|
374
|
+
return be(e);
|
|
375
375
|
}
|
|
376
|
-
function
|
|
377
|
-
if (!
|
|
378
|
-
let r = t.split("."), i = r.pop(), a = r.reduce(
|
|
376
|
+
function b(e, t, n) {
|
|
377
|
+
if (!v(t)) return !1;
|
|
378
|
+
let r = t.split("."), i = r.pop(), a = r.reduce(ye, e);
|
|
379
379
|
if (Array.isArray(a)) {
|
|
380
|
-
let e = a.findIndex((e) =>
|
|
381
|
-
return e < 0 ? !1 : (a[e] =
|
|
380
|
+
let e = a.findIndex((e) => _(e) && e.id === i);
|
|
381
|
+
return e < 0 ? !1 : (a[e] = m(n), !0);
|
|
382
382
|
}
|
|
383
|
-
return
|
|
383
|
+
return _(a) ? (n === null ? delete a[i] : a[i] = m(n), !0) : !1;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function we(e, t) {
|
|
386
386
|
let [n, ...r] = t.split(".");
|
|
387
387
|
if (n === void 0) return [""];
|
|
388
388
|
let i = [];
|
|
389
389
|
if (n === "*") {
|
|
390
390
|
let t = Array.isArray(e) ? e : [];
|
|
391
|
-
for (let e of t) if (
|
|
391
|
+
for (let e of t) if (_(e) && typeof e.id == "string") for (let t of r.length ? we(e, r.join(".")) : [""]) i.push(t ? `${e.id}.${t}` : e.id);
|
|
392
392
|
return i;
|
|
393
393
|
}
|
|
394
|
-
let a =
|
|
394
|
+
let a = _(e) ? e[n] : void 0;
|
|
395
395
|
if (r.length === 0) return a === void 0 ? [] : [n];
|
|
396
|
-
for (let e of
|
|
396
|
+
for (let e of we(a, r.join("."))) i.push(`${n}.${e}`);
|
|
397
397
|
return i;
|
|
398
398
|
}
|
|
399
|
-
function
|
|
399
|
+
function x(e, t = []) {
|
|
400
400
|
if (e.type === "custom") {
|
|
401
401
|
let n = t.find((t) => t.type === e.customType), r = new Set((n?.fields ?? []).filter((e) => e.type === "text" || e.type === "textarea").map((e) => e.key)), i = e.fieldValues;
|
|
402
|
-
return
|
|
402
|
+
return _(i) ? Object.keys(i).filter((e) => r.has(e)).map((e) => `fieldValues.${e}`) : [];
|
|
403
403
|
}
|
|
404
404
|
let n = (e) => !e.id.includes("."), r = e.type === "menu" ? {
|
|
405
405
|
...e,
|
|
@@ -411,118 +411,127 @@ function S(e, t = []) {
|
|
|
411
411
|
cells: e.cells.filter(n)
|
|
412
412
|
}))
|
|
413
413
|
} : e;
|
|
414
|
-
return (
|
|
414
|
+
return (ge[e.type] ?? []).flatMap((e) => we(r, e));
|
|
415
415
|
}
|
|
416
|
-
function
|
|
417
|
-
return (
|
|
416
|
+
function Te(e, t) {
|
|
417
|
+
return (ge[e] ?? []).some((e) => {
|
|
418
418
|
let n = e.split("."), r = t.split(".");
|
|
419
419
|
return n.length === r.length && n.every((e, t) => e === "*" || e === r[t]);
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
|
-
function
|
|
422
|
+
function S(e) {
|
|
423
423
|
let t = 2166136261;
|
|
424
424
|
for (let n of new TextEncoder().encode(e)) t ^= n, t = Math.imul(t, 16777619) >>> 0;
|
|
425
425
|
return t.toString(16).padStart(8, "0");
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function Ee(e) {
|
|
428
428
|
let { l10n: t, ...n } = e;
|
|
429
429
|
return n;
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function De(e = {}) {
|
|
432
432
|
return Object.entries(e).sort(([e], [t]) => e.split(".").length - t.split(".").length);
|
|
433
433
|
}
|
|
434
|
-
function
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
434
|
+
function Oe(e, t, n) {
|
|
435
|
+
return ke(e, m(Ee(e)), t, n);
|
|
436
|
+
}
|
|
437
|
+
function ke(e, t, n, r) {
|
|
438
|
+
let i = e;
|
|
439
|
+
if (n === r) return t;
|
|
440
|
+
let a = i.l10n?.[n];
|
|
441
|
+
if (!a) return t;
|
|
442
|
+
for (let [e, n] of De(a.set)) b(t, e, n);
|
|
443
|
+
for (let [n, r] of Object.entries(a.text ?? {})) y(e, n) !== void 0 && b(t, n, r.value);
|
|
444
|
+
return e.type === "custom" && (Object.keys(a.text ?? {}).length > 0 || Object.keys(a.set ?? {}).length > 0) && delete t.renderedHtml, t;
|
|
445
|
+
}
|
|
446
|
+
function Ae(e, t, n) {
|
|
447
|
+
let r = e;
|
|
448
|
+
if (r.type !== "section" && r.type !== "wrapper" || !Array.isArray(r.children)) return Oe(e, t, n);
|
|
449
|
+
let { children: i, ...a } = Ee(r), o = m(a);
|
|
450
|
+
return o.children = i, ke(e, o, t, n);
|
|
451
|
+
}
|
|
452
|
+
function je(e, t) {
|
|
444
453
|
return e.l10n?.[t]?.hidden === !0;
|
|
445
454
|
}
|
|
446
|
-
function
|
|
455
|
+
function Me(e) {
|
|
447
456
|
let { locales: t, l10n: n, ...r } = e;
|
|
448
457
|
return r;
|
|
449
458
|
}
|
|
450
|
-
function
|
|
459
|
+
function C(e) {
|
|
451
460
|
return e.settings?.locale ?? "en";
|
|
452
461
|
}
|
|
453
|
-
function
|
|
454
|
-
let r =
|
|
462
|
+
function Ne(e, t, n) {
|
|
463
|
+
let r = C(e), i = e.settings?.locales ?? [];
|
|
455
464
|
if (t !== r && !i.includes(t)) {
|
|
456
465
|
if (n?.missing === "default") t = r;
|
|
457
|
-
else throw new
|
|
466
|
+
else throw new he(`This template has no "${t}" version.`, void 0, "unknown_locale");
|
|
458
467
|
}
|
|
459
468
|
let a = (e) => e.flatMap((e) => {
|
|
460
|
-
if (t !== r &&
|
|
461
|
-
let n =
|
|
462
|
-
return
|
|
463
|
-
}), o =
|
|
469
|
+
if (t !== r && je(e, t)) return [];
|
|
470
|
+
let n = e.l10n?.[t], i = [...Object.keys(n?.set ?? {}), ...Object.keys(n?.text ?? {})].some((e) => e.startsWith("children.")) ? Oe(e, t, r) : Ae(e, t, r);
|
|
471
|
+
return i.type === "section" && Array.isArray(i.children) ? i.children = i.children.map((e) => a(e)) : i.type === "wrapper" && Array.isArray(i.children) && (i.children = a(i.children)), [i];
|
|
472
|
+
}), o = m(Me(e.settings)), s = e.settings?.l10n?.[t];
|
|
464
473
|
if (t !== r && s) {
|
|
465
|
-
for (let [e, t] of
|
|
466
|
-
for (let [t, n] of Object.entries(s.text ?? {}))
|
|
474
|
+
for (let [e, t] of De(s.set)) b(o, e, t);
|
|
475
|
+
for (let [t, n] of Object.entries(s.text ?? {})) y(e.settings, t) !== void 0 && b(o, t, n.value);
|
|
467
476
|
}
|
|
468
477
|
return o.locale = t, {
|
|
469
478
|
blocks: a(e.blocks),
|
|
470
479
|
settings: o
|
|
471
480
|
};
|
|
472
481
|
}
|
|
473
|
-
function
|
|
482
|
+
function Pe(e, t, n = []) {
|
|
474
483
|
let r = {
|
|
475
484
|
translated: [],
|
|
476
485
|
missing: [],
|
|
477
486
|
stale: []
|
|
478
487
|
}, i = (e, t, n, i) => {
|
|
479
488
|
for (let a of n) {
|
|
480
|
-
let n =
|
|
489
|
+
let n = y(t, a);
|
|
481
490
|
if (typeof n != "string") continue;
|
|
482
491
|
let o = i?.[a];
|
|
483
|
-
(o || n !== "") && (o ? o.sourceHash ===
|
|
492
|
+
(o || n !== "") && (o ? o.sourceHash === S(n) ? r.translated.push(`${e}/${a}`) : r.stale.push(`${e}/${a}`) : r.missing.push(`${e}/${a}`));
|
|
484
493
|
}
|
|
485
494
|
}, a = (e) => {
|
|
486
495
|
for (let r of e) {
|
|
487
|
-
if (
|
|
496
|
+
if (je(r, t)) continue;
|
|
488
497
|
let e = r.l10n?.[t];
|
|
489
|
-
i(r.id, r,
|
|
498
|
+
i(r.id, r, x(r, n), e?.text);
|
|
490
499
|
let o = r.children;
|
|
491
500
|
if (r.type === "section" && Array.isArray(o)) for (let e of o) a(e);
|
|
492
501
|
else r.type === "wrapper" && Array.isArray(o) && a(o);
|
|
493
502
|
}
|
|
494
503
|
};
|
|
495
|
-
return a(e.blocks), i("settings", e.settings, [...
|
|
504
|
+
return a(e.blocks), i("settings", e.settings, [...g], e.settings?.l10n?.[t]?.text), r;
|
|
496
505
|
}
|
|
497
|
-
function
|
|
498
|
-
if (t ===
|
|
506
|
+
function Fe(e, t) {
|
|
507
|
+
if (t === C(e) || !e.settings.locales?.includes(t)) return [];
|
|
499
508
|
let n = [], r = (e) => {
|
|
500
|
-
for (let i of e)
|
|
509
|
+
for (let i of e) je(i, t) && n.push(i.id), i.type === "section" ? i.children.forEach(r) : i.type === "wrapper" && r(i.children);
|
|
501
510
|
};
|
|
502
511
|
return r(e.blocks), n;
|
|
503
512
|
}
|
|
504
|
-
function
|
|
505
|
-
if (t ===
|
|
513
|
+
function Ie(e, t, n = []) {
|
|
514
|
+
if (t === C(e) || !e.settings.locales?.includes(t)) return [];
|
|
506
515
|
let r = [], i = (e, n, i) => {
|
|
507
|
-
r.push(...
|
|
516
|
+
r.push(...Le(n, t, i).map((t) => `${e}/${t}`));
|
|
508
517
|
}, a = (e) => {
|
|
509
|
-
for (let t of e) i(t.id, t,
|
|
518
|
+
for (let t of e) i(t.id, t, x(t, n)), t.type === "section" ? t.children.forEach(a) : t.type === "wrapper" && a(t.children);
|
|
510
519
|
};
|
|
511
|
-
return a(e.blocks), i("settings", e.settings,
|
|
520
|
+
return a(e.blocks), i("settings", e.settings, g), r;
|
|
512
521
|
}
|
|
513
|
-
function
|
|
522
|
+
function Le(e, t, n) {
|
|
514
523
|
let r = e.l10n?.[t];
|
|
515
524
|
return n.filter((t) => {
|
|
516
|
-
let n =
|
|
517
|
-
return typeof n != "string" || n === "" || r?.text?.[t] ? !1 : !Object.keys(r?.set ?? {}).some((n) => (t === n || t.startsWith(`${n}.`)) && (!n.includes(".") ||
|
|
525
|
+
let n = y(e, t);
|
|
526
|
+
return typeof n != "string" || n === "" || r?.text?.[t] ? !1 : !Object.keys(r?.set ?? {}).some((n) => (t === n || t.startsWith(`${n}.`)) && (!n.includes(".") || y(e, n.slice(0, n.lastIndexOf("."))) !== void 0));
|
|
518
527
|
});
|
|
519
528
|
}
|
|
520
|
-
function
|
|
521
|
-
let r =
|
|
522
|
-
let a =
|
|
529
|
+
function Re(e, t, n = {}) {
|
|
530
|
+
let r = C(e), i = (e, n, i) => {
|
|
531
|
+
let a = Le(e, t, i), o = m(e.l10n ?? {}), s = o[t] ?? {}, c = m(e);
|
|
523
532
|
delete c.l10n;
|
|
524
|
-
for (let [e, t] of
|
|
525
|
-
for (let [t, n] of Object.entries(s.text ?? {}))
|
|
533
|
+
for (let [e, t] of De(s.set)) b(c, e, t);
|
|
534
|
+
for (let [t, n] of Object.entries(s.text ?? {})) y(e, t) !== void 0 && b(c, t, n.value);
|
|
526
535
|
delete o[t];
|
|
527
536
|
let l = {}, u = /* @__PURE__ */ new Set([
|
|
528
537
|
...Object.keys(s.set ?? {}),
|
|
@@ -530,22 +539,22 @@ function Me(e, t, n = {}) {
|
|
|
530
539
|
...a
|
|
531
540
|
]);
|
|
532
541
|
for (let t of u) {
|
|
533
|
-
let r =
|
|
534
|
-
|
|
542
|
+
let r = y(e, t), i = y(c, t);
|
|
543
|
+
h(r, i) ? (s.text?.[t] || a.includes(t)) && n(t) && typeof r == "string" && r !== "" && ((l.text ??= {})[t] = {
|
|
535
544
|
value: r,
|
|
536
|
-
sourceHash:
|
|
545
|
+
sourceHash: S(r)
|
|
537
546
|
}) : n(t) && typeof r == "string" && typeof i == "string" ? (l.text ??= {})[t] = {
|
|
538
547
|
value: r,
|
|
539
|
-
sourceHash:
|
|
540
|
-
} : (l.set ??= {})[t] = r === void 0 ? null :
|
|
548
|
+
sourceHash: S(i)
|
|
549
|
+
} : (l.set ??= {})[t] = r === void 0 ? null : m(r);
|
|
541
550
|
}
|
|
542
551
|
let d = (e, t) => {
|
|
543
552
|
let n = /* @__PURE__ */ new Set();
|
|
544
553
|
for (let t of Object.keys(e.set ?? {})) {
|
|
545
554
|
let e = t.split(".");
|
|
546
555
|
for (; e.length > 1;) {
|
|
547
|
-
let t =
|
|
548
|
-
if (
|
|
556
|
+
let t = y(c, e.slice(0, -1).join("."));
|
|
557
|
+
if (_(t) || Array.isArray(t) && y(c, e.join(".")) !== void 0) break;
|
|
549
558
|
e.pop();
|
|
550
559
|
}
|
|
551
560
|
let r = e.join(".");
|
|
@@ -553,40 +562,41 @@ function Me(e, t, n = {}) {
|
|
|
553
562
|
}
|
|
554
563
|
for (let r of n) {
|
|
555
564
|
for (let t of ["text", "set"]) for (let n of Object.keys(e[t] ?? {})) (n === r || n.startsWith(`${r}.`)) && delete e[t][n];
|
|
556
|
-
let n =
|
|
557
|
-
(e.set ??= {})[r] = n === void 0 ? null :
|
|
565
|
+
let n = y(t, r);
|
|
566
|
+
(e.set ??= {})[r] = n === void 0 ? null : m(n);
|
|
558
567
|
}
|
|
559
568
|
e.text && !Object.keys(e.text).length && delete e.text;
|
|
560
569
|
};
|
|
561
570
|
for (let t of Object.values(o)) {
|
|
562
|
-
let n =
|
|
563
|
-
for (let [e, r] of
|
|
564
|
-
for (let [r, i] of Object.entries(t.text ?? {}))
|
|
571
|
+
let n = m(e);
|
|
572
|
+
for (let [e, r] of De(t.set)) b(n, e, r);
|
|
573
|
+
for (let [r, i] of Object.entries(t.text ?? {})) y(e, r) !== void 0 && b(n, r, i.value);
|
|
565
574
|
for (let [n, r] of Object.entries(t.text ?? {})) {
|
|
566
|
-
let i =
|
|
575
|
+
let i = y(c, n);
|
|
567
576
|
if (typeof i != "string") (t.set ??= {})[n] = r.value, delete t.text[n];
|
|
568
577
|
else {
|
|
569
|
-
let t =
|
|
570
|
-
typeof t == "string" && r.sourceHash ===
|
|
578
|
+
let t = y(e, n);
|
|
579
|
+
typeof t == "string" && r.sourceHash === S(t) && (r.sourceHash = S(i));
|
|
571
580
|
}
|
|
572
581
|
}
|
|
573
582
|
d(t, n);
|
|
574
583
|
}
|
|
575
584
|
return Object.keys(l).length && (d(l, e), o[r] = l), Object.keys(o).length && (c.l10n = o), c;
|
|
576
585
|
}, a = (e) => e.map((e) => {
|
|
577
|
-
let t = e.type === "custom" ? [.../* @__PURE__ */ new Set([...Object.hasOwn(n, e.id) ? n[e.id] : [], ...Object.values(e.l10n ?? {}).flatMap((e) => Object.keys(e.text ?? {}))])] :
|
|
578
|
-
return e.type === "custom" && r.type === "custom" && !
|
|
579
|
-
}), o = i(e.settings, (e) =>
|
|
586
|
+
let t = e.type === "custom" ? [.../* @__PURE__ */ new Set([...Object.hasOwn(n, e.id) ? n[e.id] : [], ...Object.values(e.l10n ?? {}).flatMap((e) => Object.keys(e.text ?? {}))])] : x(e), r = i(e, (n) => e.type === "custom" ? t.includes(n) : Te(e.type, n), t);
|
|
587
|
+
return e.type === "custom" && r.type === "custom" && !h(e.fieldValues, r.fieldValues) && delete r.renderedHtml, r.type === "section" ? r.children = r.children.map(a) : r.type === "wrapper" && (r.children = a(r.children)), r;
|
|
588
|
+
}), o = i(e.settings, (e) => g.includes(e), g);
|
|
580
589
|
return o.locale = t, o.locales = e.settings.locales.map((e) => e === t ? r : e), {
|
|
581
590
|
blocks: a(e.blocks),
|
|
582
591
|
settings: o
|
|
583
592
|
};
|
|
584
593
|
}
|
|
585
|
-
|
|
594
|
+
var ze = "Sections with a wrapper cannot be placed inside wrappers.";
|
|
595
|
+
function Be(e, t, n = []) {
|
|
586
596
|
let r = Object.fromEntries(F(e.blocks).flatMap((e) => {
|
|
587
597
|
if (e.type !== "custom") return [];
|
|
588
|
-
let t =
|
|
589
|
-
return t.length &&
|
|
598
|
+
let t = x(e, n).filter((t) => typeof y(e, t) == "string");
|
|
599
|
+
return t.length && Ke.has(e.id) && E("invalid_operation", 0, qe), t.length ? [[e.id, t]] : [];
|
|
590
600
|
}));
|
|
591
601
|
return {
|
|
592
602
|
op: "setDefaultLocale",
|
|
@@ -594,7 +604,7 @@ function Ne(e, t, n = []) {
|
|
|
594
604
|
...Object.keys(r).length ? { customTextFields: r } : {}
|
|
595
605
|
};
|
|
596
606
|
}
|
|
597
|
-
var
|
|
607
|
+
var w = class extends Error {
|
|
598
608
|
code;
|
|
599
609
|
opIndex;
|
|
600
610
|
blockId;
|
|
@@ -602,173 +612,174 @@ var D = class extends Error {
|
|
|
602
612
|
super(n), this.name = "OperationError", this.code = e, this.opIndex = t, r !== void 0 && (this.blockId = r);
|
|
603
613
|
}
|
|
604
614
|
};
|
|
605
|
-
function
|
|
615
|
+
function Ve(e) {
|
|
606
616
|
return e === "1" ? 1 : e === "3" || e === "1-2-1" ? 3 : e === "4" ? 4 : 2;
|
|
607
617
|
}
|
|
608
|
-
function
|
|
609
|
-
let r =
|
|
610
|
-
return
|
|
618
|
+
function He(e, t, n = {}) {
|
|
619
|
+
let r = m(e);
|
|
620
|
+
return T(r, t, n), r;
|
|
611
621
|
}
|
|
612
|
-
function
|
|
622
|
+
function T(e, t, n = {}) {
|
|
613
623
|
let r = {
|
|
614
624
|
locks: n.locks ?? [],
|
|
615
625
|
session: n.session ?? null
|
|
616
626
|
};
|
|
617
|
-
t.forEach((t, n) =>
|
|
627
|
+
t.forEach((t, n) => ut(e, t, n, r));
|
|
618
628
|
}
|
|
619
|
-
var
|
|
629
|
+
var Ue = /* @__PURE__ */ new Set([
|
|
620
630
|
"id",
|
|
621
631
|
"type",
|
|
622
632
|
"children",
|
|
623
633
|
"l10n"
|
|
624
|
-
]),
|
|
634
|
+
]), We = /* @__PURE__ */ new Set(["locales", "l10n"]), Ge = /* @__PURE__ */ new Set([
|
|
625
635
|
"locale",
|
|
626
636
|
"locales",
|
|
627
637
|
"l10n"
|
|
628
|
-
]),
|
|
638
|
+
]), Ke = /* @__PURE__ */ new Set([
|
|
629
639
|
"__proto__",
|
|
630
640
|
"constructor",
|
|
631
641
|
"prototype"
|
|
632
|
-
]),
|
|
633
|
-
function
|
|
634
|
-
throw new
|
|
642
|
+
]), qe = "customTextFields must map existing custom block ids to lists of string fieldValues paths.";
|
|
643
|
+
function E(e, t, n, r) {
|
|
644
|
+
throw new w(e, t, n, r);
|
|
635
645
|
}
|
|
636
|
-
function
|
|
646
|
+
function D(e) {
|
|
637
647
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
638
648
|
}
|
|
639
|
-
function
|
|
649
|
+
function O(e) {
|
|
640
650
|
return e.type === "section";
|
|
641
651
|
}
|
|
642
|
-
function
|
|
652
|
+
function k(e) {
|
|
643
653
|
return Array.isArray(e.blocks) ? e.blocks : [];
|
|
644
654
|
}
|
|
645
|
-
function
|
|
655
|
+
function Je(e) {
|
|
646
656
|
let t = e.children;
|
|
647
657
|
return Array.isArray(t) ? t.map((e) => Array.isArray(e) ? e : []) : [];
|
|
648
658
|
}
|
|
649
|
-
function
|
|
650
|
-
let n =
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
if (!A(r)) continue;
|
|
654
|
-
if (r.id === t) return {
|
|
659
|
+
function* Ye(e, t) {
|
|
660
|
+
for (let n = 0; n < e.length; n++) {
|
|
661
|
+
let r = e[n];
|
|
662
|
+
if (D(r) && (yield {
|
|
655
663
|
block: r,
|
|
656
|
-
list:
|
|
657
|
-
index:
|
|
658
|
-
parent:
|
|
659
|
-
}
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
let a = n[i];
|
|
666
|
-
if (A(a) && a.id === t) return {
|
|
667
|
-
block: a,
|
|
668
|
-
list: n,
|
|
669
|
-
index: i,
|
|
670
|
-
parent: {
|
|
671
|
-
sectionId: r.id,
|
|
672
|
-
column: e
|
|
673
|
-
}
|
|
674
|
-
};
|
|
675
|
-
}
|
|
664
|
+
list: e,
|
|
665
|
+
index: n,
|
|
666
|
+
parent: t
|
|
667
|
+
}, typeof r.id == "string")) {
|
|
668
|
+
if (O(r)) for (let [e, t] of Je(r).entries()) yield* Ye(t, {
|
|
669
|
+
sectionId: r.id,
|
|
670
|
+
column: e
|
|
671
|
+
});
|
|
672
|
+
else r.type === "wrapper" && Array.isArray(r.children) && (yield* Ye(r.children, { wrapperId: r.id }));
|
|
676
673
|
}
|
|
677
674
|
}
|
|
675
|
+
}
|
|
676
|
+
function A(e, t) {
|
|
677
|
+
for (let n of Ye(k(e), null)) if (n.block.id === t) return n;
|
|
678
678
|
return null;
|
|
679
679
|
}
|
|
680
|
-
function
|
|
680
|
+
function j(e) {
|
|
681
|
+
if (!D(e)) return [];
|
|
681
682
|
let t = typeof e.id == "string" ? [e.id] : [];
|
|
682
|
-
if (
|
|
683
|
+
if (O(e)) for (let n of Je(e)) for (let e of Xe(n)) t.push(e);
|
|
684
|
+
else if (e.type === "wrapper" && Array.isArray(e.children)) for (let n of Xe(e.children)) t.push(n);
|
|
683
685
|
return t;
|
|
684
686
|
}
|
|
685
|
-
function
|
|
686
|
-
return e.flatMap(
|
|
687
|
+
function Xe(e) {
|
|
688
|
+
return e.flatMap(j);
|
|
687
689
|
}
|
|
688
|
-
function
|
|
689
|
-
return typeof e.blockId != "string" || e.blockId === "" ?
|
|
690
|
+
function M(e, t) {
|
|
691
|
+
return typeof e.blockId != "string" || e.blockId === "" ? E("invalid_operation", t, "blockId must be a block id.") : e.blockId;
|
|
690
692
|
}
|
|
691
|
-
function
|
|
693
|
+
function Ze(e, t) {
|
|
692
694
|
let n = e.parent;
|
|
693
|
-
return n === null ? null :
|
|
695
|
+
return n === null ? null : D(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
|
|
694
696
|
sectionId: n.sectionId,
|
|
695
697
|
column: n.column
|
|
696
|
-
} :
|
|
698
|
+
} : D(n) && typeof n.wrapperId == "string" && n.wrapperId !== "" && !Object.hasOwn(n, "sectionId") && !Object.hasOwn(n, "column") ? { wrapperId: n.wrapperId } : E("invalid_operation", t, "parent must be null, { \"sectionId\", \"column\" }, or { \"wrapperId\" }.");
|
|
697
699
|
}
|
|
698
|
-
function
|
|
700
|
+
function Qe(e, t) {
|
|
699
701
|
let n = e.after;
|
|
700
|
-
return n === null ? null : typeof n == "string" && n !== "" ? n :
|
|
702
|
+
return n === null ? null : typeof n == "string" && n !== "" ? n : E("invalid_operation", t, "after must be null or a block id.");
|
|
701
703
|
}
|
|
702
|
-
function
|
|
704
|
+
function N(e, t) {
|
|
703
705
|
let n = e.expect;
|
|
704
|
-
return n == null ? null :
|
|
706
|
+
return n == null ? null : D(n) ? n : E("invalid_operation", t, "expect must be an object.");
|
|
705
707
|
}
|
|
706
|
-
function
|
|
708
|
+
function $e(e, t, n) {
|
|
707
709
|
let r = e.set ?? null, i = e.unset ?? [];
|
|
708
|
-
(r === null ||
|
|
710
|
+
(r === null || D(r)) && Array.isArray(i) && i.every((e) => typeof e == "string") || E("invalid_operation", t, "set must be an object and unset a list of keys.");
|
|
709
711
|
let a = r === null ? {} : r, o = Object.keys(a).filter((e) => a[e] !== void 0);
|
|
710
|
-
o.length === 0 && i.length === 0 &&
|
|
711
|
-
for (let e of [...o, ...i]) n.has(e) &&
|
|
712
|
+
o.length === 0 && i.length === 0 && E("invalid_operation", t, "Set or unset at least one key.");
|
|
713
|
+
for (let e of [...o, ...i]) n.has(e) && E("invalid_operation", t, `"${e}" can't be set or unset.`);
|
|
712
714
|
let s = i.find((e) => o.includes(e));
|
|
713
|
-
return s !== void 0 &&
|
|
715
|
+
return s !== void 0 && E("invalid_operation", t, `"${s}" is both set and unset.`), {
|
|
714
716
|
set: Object.fromEntries(o.map((e) => [e, a[e]])),
|
|
715
717
|
unset: i
|
|
716
718
|
};
|
|
717
719
|
}
|
|
718
|
-
function
|
|
719
|
-
if (
|
|
720
|
-
|
|
720
|
+
function et(e, t, n) {
|
|
721
|
+
if (D(e) && typeof e.id == "string" && e.id !== "" && typeof e.type == "string" || E("invalid_operation", t, "A block needs a non-empty string id and a string type."), e.type === "wrapper") {
|
|
722
|
+
n !== "root" && E("invalid_operation", t, n === "column" ? "Wrappers can only be placed at the top level." : "Wrappers cannot be placed inside wrappers."), Array.isArray(e.children) || E("invalid_operation", t, "A wrapper needs children: a list of blocks.");
|
|
723
|
+
for (let n of e.children) et(n, t, "wrapper");
|
|
724
|
+
return;
|
|
725
|
+
}
|
|
726
|
+
if (!O(e)) return;
|
|
727
|
+
n === "column" && E("invalid_operation", t, "Sections can only be placed at the top level."), n === "wrapper" && e.wrapper && E("invalid_operation", t, ze);
|
|
721
728
|
let r = e.children;
|
|
722
|
-
Array.isArray(r) && r.every((e) => Array.isArray(e)) ||
|
|
723
|
-
for (let e of r) for (let n of e)
|
|
729
|
+
Array.isArray(r) && r.every((e) => Array.isArray(e)) || E("invalid_operation", t, "A section needs children: a list of columns, each a list of blocks.");
|
|
730
|
+
for (let e of r) for (let n of e) et(n, t, "column");
|
|
724
731
|
}
|
|
725
|
-
function
|
|
732
|
+
function P(e, t) {
|
|
726
733
|
return e.session === null || t.sessionId !== e.session;
|
|
727
734
|
}
|
|
728
|
-
function
|
|
729
|
-
let r = e.locks.find((n) => t.includes(n.blockId) &&
|
|
730
|
-
r &&
|
|
735
|
+
function tt(e, t, n) {
|
|
736
|
+
let r = e.locks.find((n) => t.includes(n.blockId) && P(e, n));
|
|
737
|
+
r && E("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
|
|
731
738
|
}
|
|
732
|
-
function
|
|
733
|
-
e.locks.find((r) =>
|
|
739
|
+
function nt(e, t, n, r) {
|
|
740
|
+
e.locks.find((r) => P(e, r) && r.blockId === t && ((r.locale ?? null) === null || r.locale === n)) && E("lock_held", r, `Block "${t}" is being edited in another session.`, t);
|
|
734
741
|
}
|
|
735
|
-
function
|
|
736
|
-
for (let [i, a] of Object.entries(t)) a !== void 0 && (
|
|
742
|
+
function rt(e, t, n, r) {
|
|
743
|
+
for (let [i, a] of Object.entries(t)) a !== void 0 && (h(Object.hasOwn(e, i) && e[i] !== void 0 ? e[i] : null, a) || E("precondition_failed", n, r === void 0 ? `Setting "${i}" has changed since.` : `"${i}" of block "${r}" has changed since.`, r));
|
|
737
744
|
}
|
|
738
|
-
function
|
|
745
|
+
function it(e, t, n) {
|
|
739
746
|
if (t === null) return Array.isArray(e.blocks) || (e.blocks = []), e.blocks;
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
747
|
+
if ("wrapperId" in t) {
|
|
748
|
+
let r = A(e, t.wrapperId);
|
|
749
|
+
return r ? r.block.type === "wrapper" ? Array.isArray(r.block.children) ? r.block.children : E("invalid_operation", n, `Wrapper "${t.wrapperId}" has no children list.`) : E("invalid_operation", n, `Block "${t.wrapperId}" isn't a wrapper.`) : E("block_missing", n, `No wrapper with id "${t.wrapperId}".`, t.wrapperId);
|
|
750
|
+
}
|
|
751
|
+
let r = A(e, t.sectionId);
|
|
752
|
+
if (!r) return E("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
|
|
753
|
+
if (!O(r.block)) return E("invalid_operation", n, `Block "${t.sectionId}" isn't a section.`);
|
|
743
754
|
let i = r.block.children;
|
|
744
|
-
return !Array.isArray(i) || t.column < 0 || t.column >= i.length ?
|
|
755
|
+
return !Array.isArray(i) || t.column < 0 || t.column >= i.length ? E("invalid_operation", n, `Section "${t.sectionId}" has no column ${t.column}.`) : (Array.isArray(i[t.column]) || (i[t.column] = []), i[t.column]);
|
|
745
756
|
}
|
|
746
|
-
function
|
|
757
|
+
function at(e, t, n) {
|
|
747
758
|
if (t === null) return 0;
|
|
748
|
-
let r = e.findIndex((e) =>
|
|
749
|
-
return r === -1 ?
|
|
759
|
+
let r = e.findIndex((e) => D(e) && e.id === t);
|
|
760
|
+
return r === -1 ? E("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
|
|
750
761
|
}
|
|
751
|
-
function
|
|
752
|
-
let i =
|
|
762
|
+
function ot(e, t, n, r) {
|
|
763
|
+
let i = Ve(t), a = Array.isArray(e.children) ? e.children : [];
|
|
753
764
|
for (let e = i; e < a.length; e++) {
|
|
754
765
|
let t = a[e];
|
|
755
|
-
Array.isArray(t) && t.length > 0 &&
|
|
766
|
+
Array.isArray(t) && t.length > 0 && E("invalid_operation", n, `Column ${e} of section "${r}" still holds blocks, so the layout can't drop it.`);
|
|
756
767
|
}
|
|
757
768
|
let o = a.slice(0, i);
|
|
758
769
|
for (; o.length < i;) o.push([]);
|
|
759
770
|
e.children = o;
|
|
760
771
|
}
|
|
761
|
-
function
|
|
772
|
+
function st(e, t, n) {
|
|
762
773
|
for (let [n, r] of Object.entries(t)) n === "__proto__" ? Object.defineProperty(e, n, {
|
|
763
|
-
value:
|
|
774
|
+
value: m(r),
|
|
764
775
|
writable: !0,
|
|
765
776
|
enumerable: !0,
|
|
766
777
|
configurable: !0
|
|
767
|
-
}) : e[n] =
|
|
778
|
+
}) : e[n] = m(r);
|
|
768
779
|
for (let t of n) delete e[t];
|
|
769
780
|
}
|
|
770
|
-
function
|
|
771
|
-
return
|
|
781
|
+
function ct(e) {
|
|
782
|
+
return pe(e).map((t) => {
|
|
772
783
|
let n = t.path.replace(/\.(items|icons|rows)\[.*$/, "").replace(/\[(\d+)\]/g, ".$1").split(".").reduce((e, t) => e[t], e);
|
|
773
784
|
return {
|
|
774
785
|
id: t.id,
|
|
@@ -776,114 +787,114 @@ function rt(e) {
|
|
|
776
787
|
};
|
|
777
788
|
});
|
|
778
789
|
}
|
|
779
|
-
function
|
|
780
|
-
let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ?
|
|
781
|
-
a &&
|
|
790
|
+
function lt(e, t, n) {
|
|
791
|
+
let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ? ct(n).map(r) : []), a = ct(e).find((e) => !i.has(r(e)));
|
|
792
|
+
a && E("invalid_operation", t, `Element id "${a.id}" must not contain "." or "/".`, a.blockId);
|
|
782
793
|
}
|
|
783
|
-
function
|
|
794
|
+
function ut(e, t, n, r) {
|
|
784
795
|
let i = t;
|
|
785
|
-
switch (
|
|
786
|
-
case "addBlock": return
|
|
787
|
-
case "moveBlock": return
|
|
788
|
-
case "deleteBlock": return
|
|
789
|
-
case "updateBlock": return
|
|
790
|
-
case "updateSettings": return
|
|
791
|
-
case "setContent": return
|
|
792
|
-
case "setDefaultLocale": return
|
|
793
|
-
case "addLocale": return
|
|
794
|
-
case "removeLocale": return
|
|
795
|
-
case "updateBlockLocale": return
|
|
796
|
-
case "updateSettingsLocale": return
|
|
797
|
-
default:
|
|
796
|
+
switch (D(i) && typeof i.op == "string" || E("invalid_operation", n, "Each operation must be an object with an \"op\"."), i.op) {
|
|
797
|
+
case "addBlock": return dt(e, i, n);
|
|
798
|
+
case "moveBlock": return ft(e, i, n, r);
|
|
799
|
+
case "deleteBlock": return pt(e, i, n, r);
|
|
800
|
+
case "updateBlock": return mt(e, i, n, r);
|
|
801
|
+
case "updateSettings": return ht(e, i, n);
|
|
802
|
+
case "setContent": return At(e, i, n, r);
|
|
803
|
+
case "setDefaultLocale": return jt(e, i, n, r);
|
|
804
|
+
case "addLocale": return vt(e, i, n);
|
|
805
|
+
case "removeLocale": return bt(e, i, n);
|
|
806
|
+
case "updateBlockLocale": return Ot(e, i, n, r);
|
|
807
|
+
case "updateSettingsLocale": return kt(e, i, n);
|
|
808
|
+
default: E("invalid_operation", n, `Unknown operation "${i.op}".`);
|
|
798
809
|
}
|
|
799
810
|
}
|
|
800
|
-
function
|
|
801
|
-
let r =
|
|
802
|
-
|
|
811
|
+
function dt(e, t, n) {
|
|
812
|
+
let r = Ze(t, n), i = Qe(t, n), a = t.block;
|
|
813
|
+
et(a, n, r === null ? "root" : "wrapperId" in r ? "wrapper" : "column"), lt({
|
|
803
814
|
blocks: [a],
|
|
804
815
|
settings: e.settings
|
|
805
816
|
}, n);
|
|
806
|
-
let o = new Set(
|
|
807
|
-
for (let e of
|
|
808
|
-
let c =
|
|
809
|
-
|
|
810
|
-
}
|
|
811
|
-
function
|
|
812
|
-
let i =
|
|
813
|
-
if (!
|
|
814
|
-
if (
|
|
815
|
-
let e =
|
|
816
|
-
|
|
817
|
+
let o = new Set(Xe(k(e))), s = /* @__PURE__ */ new Set();
|
|
818
|
+
for (let e of j(a)) (o.has(e) || s.has(e)) && E("block_exists", n, `A block with id "${e}" already exists.`, e), s.add(e);
|
|
819
|
+
let c = it(e, r, n), l = at(c, i, n);
|
|
820
|
+
Dt(e, a, r, n, !0), c.splice(l, 0, m(a));
|
|
821
|
+
}
|
|
822
|
+
function ft(e, t, n, r) {
|
|
823
|
+
let i = M(t, n), a = Ze(t, n), o = Qe(t, n), s = N(t, n), c = s && s.parent !== void 0 ? Ze({ parent: s.parent }, n) : null, l = A(e, i);
|
|
824
|
+
if (!l) return E("block_missing", n, `No block with id "${i}".`, i);
|
|
825
|
+
if (tt(r, j(l.block), n), s) {
|
|
826
|
+
let e = l.index > 0 ? l.list[l.index - 1] : null, t = D(e) ? e.id ?? null : null;
|
|
827
|
+
h(l.parent, c) && h(t, s.after ?? null) || E("precondition_failed", n, `Block "${i}" has moved since.`, i);
|
|
817
828
|
}
|
|
818
|
-
j(
|
|
819
|
-
let
|
|
820
|
-
|
|
821
|
-
}
|
|
822
|
-
function
|
|
823
|
-
let i =
|
|
824
|
-
if (!o) return
|
|
825
|
-
|
|
826
|
-
}
|
|
827
|
-
function
|
|
828
|
-
let i =
|
|
829
|
-
if (!c) return
|
|
830
|
-
let l = c.block, u =
|
|
831
|
-
u && o.includes("columns") &&
|
|
829
|
+
a !== null && ("wrapperId" in a ? a.wrapperId : a.sectionId) === i && E("invalid_operation", n, "A block cannot be moved into itself or its descendants."), a !== null && j(l.block).includes("wrapperId" in a ? a.wrapperId : a.sectionId) && E("invalid_operation", n, "A block cannot be moved into itself or its descendants."), O(l.block) && a !== null && "sectionId" in a && E("invalid_operation", n, "Sections can only be placed at the top level."), O(l.block) && l.block.wrapper && a !== null && "wrapperId" in a && E("invalid_operation", n, ze), l.block.type === "wrapper" && a !== null && E("invalid_operation", n, "wrapperId" in a ? "Wrappers cannot be placed inside wrappers." : "Wrappers can only be placed at the top level."), o === i && E("invalid_operation", n, "A block can't be placed after itself.");
|
|
830
|
+
let u = it(e, a, n);
|
|
831
|
+
at(u.filter((e) => e !== l.block), o, n), Dt(e, l.block, a, n, !1), l.list.splice(l.index, 1), u.splice(at(u, o, n), 0, l.block);
|
|
832
|
+
}
|
|
833
|
+
function pt(e, t, n, r) {
|
|
834
|
+
let i = M(t, n), a = N(t, n), o = A(e, i);
|
|
835
|
+
if (!o) return E("block_missing", n, `No block with id "${i}".`, i);
|
|
836
|
+
tt(r, j(o.block), n), a && !h(o.block, a.block ?? null) && E("precondition_failed", n, `Block "${i}" has changed since.`, i), o.list.splice(o.index, 1);
|
|
837
|
+
}
|
|
838
|
+
function mt(e, t, n, r) {
|
|
839
|
+
let i = M(t, n), { set: a, unset: o } = $e(t, n, Ue), s = N(t, n), c = A(e, i);
|
|
840
|
+
if (!c) return E("block_missing", n, `No block with id "${i}".`, i);
|
|
841
|
+
let l = c.block, u = O(l);
|
|
842
|
+
u && o.includes("columns") && E("invalid_operation", n, "A section's columns can't be unset; set another layout instead."), tt(r, [i], n), s && rt(l, s, n, i), u && c.parent !== null && "wrapperId" in c.parent && a.wrapper && E("invalid_operation", n, ze);
|
|
832
843
|
let d = { ...l };
|
|
833
|
-
|
|
844
|
+
st(d, a, o), lt({
|
|
834
845
|
blocks: [d],
|
|
835
846
|
settings: e.settings
|
|
836
847
|
}, n, {
|
|
837
848
|
blocks: [l],
|
|
838
849
|
settings: e.settings
|
|
839
|
-
}), u && Object.hasOwn(a, "columns") &&
|
|
840
|
-
let f =
|
|
841
|
-
|
|
850
|
+
}), u && Object.hasOwn(a, "columns") && ot(l, a.columns, n, i), st(l, a, o);
|
|
851
|
+
let f = xe(l);
|
|
852
|
+
h(l.l10n, f.l10n) || (f.l10n ? l.l10n = f.l10n : delete l.l10n), (u || l.type === "wrapper") && !h(l.children, f.children) && (l.children = f.children);
|
|
842
853
|
}
|
|
843
|
-
function
|
|
844
|
-
let { set: r, unset: i } =
|
|
845
|
-
e.settings?.locales?.length && (Object.hasOwn(r, "locale") || i.includes("locale")) &&
|
|
854
|
+
function ht(e, t, n) {
|
|
855
|
+
let { set: r, unset: i } = $e(t, n, We), a = N(t, n);
|
|
856
|
+
e.settings?.locales?.length && (Object.hasOwn(r, "locale") || i.includes("locale")) && E("invalid_operation", n, "The default locale can't change while language versions exist."), D(e.settings) || (e.settings = {});
|
|
846
857
|
let o = e.settings;
|
|
847
|
-
a &&
|
|
848
|
-
let s =
|
|
849
|
-
|
|
858
|
+
a && rt(o, a, n), st(o, r, i);
|
|
859
|
+
let s = Ce(e.settings);
|
|
860
|
+
h(o.l10n, s.l10n) || (s.l10n ? o.l10n = s.l10n : delete o.l10n);
|
|
850
861
|
}
|
|
851
|
-
function
|
|
862
|
+
function gt(e, t) {
|
|
852
863
|
let n = e.locale;
|
|
853
|
-
return
|
|
864
|
+
return _e(n) && n !== "__proto__" && n !== "constructor" && n !== "prototype" || E("invalid_operation", t, "locale must be a language tag."), n;
|
|
854
865
|
}
|
|
855
|
-
function
|
|
856
|
-
let r =
|
|
857
|
-
return e.settings.locales?.includes(r) ||
|
|
866
|
+
function _t(e, t, n) {
|
|
867
|
+
let r = gt(t, n);
|
|
868
|
+
return e.settings.locales?.includes(r) || E("invalid_operation", n, `Locale "${r}" isn't in settings.locales.`), r;
|
|
858
869
|
}
|
|
859
|
-
function
|
|
860
|
-
let r =
|
|
861
|
-
(
|
|
870
|
+
function vt(e, t, n) {
|
|
871
|
+
let r = gt(t, n), i = e.settings.locales ?? [], a = r.toLowerCase(), o = t.position === void 0 ? i.length : t.position;
|
|
872
|
+
(C(e).toLowerCase() === a || i.some((e) => e.toLowerCase() === a) || typeof o != "number" || !Number.isInteger(o) || o < 0 || o > i.length) && E("invalid_operation", n, "The locale already exists or its insertion position is invalid."), e.settings.locales || (e.settings.locales = []), e.settings.locales.splice(o, 0, r);
|
|
862
873
|
}
|
|
863
874
|
function F(e) {
|
|
864
|
-
return e.flatMap((e) =>
|
|
875
|
+
return e.flatMap((e) => D(e) ? [e, ...O(e) ? Je(e).flatMap(F) : e.type === "wrapper" && Array.isArray(e.children) ? F(e.children) : []] : []);
|
|
865
876
|
}
|
|
866
|
-
function
|
|
877
|
+
function yt(e, t) {
|
|
867
878
|
let n = e.l10n;
|
|
868
|
-
return
|
|
869
|
-
}
|
|
870
|
-
function
|
|
871
|
-
let r =
|
|
872
|
-
i && (!
|
|
873
|
-
let a = e.settings, o = F(
|
|
874
|
-
!i ||
|
|
875
|
-
for (let e of [...o, a])
|
|
879
|
+
return D(n) && D(n[t]) ? n[t] : {};
|
|
880
|
+
}
|
|
881
|
+
function bt(e, t, n) {
|
|
882
|
+
let r = _t(e, t, n), i = N(t, n);
|
|
883
|
+
i && (!D(i.blocks) || i.settings !== void 0 && !D(i.settings)) && E("invalid_operation", n, "expect needs a blocks object and an optional settings layer.");
|
|
884
|
+
let a = e.settings, o = F(k(e)), s = Object.fromEntries(o.flatMap((e) => D(e.l10n) && Object.hasOwn(e.l10n, r) ? [[String(e.id), e.l10n[r]]] : []));
|
|
885
|
+
!i || h(s, i.blocks) && h(D(a.l10n) ? a.l10n[r] : void 0, i.settings) || E("precondition_failed", n, `Locale "${r}" has changed since.`);
|
|
886
|
+
for (let e of [...o, a]) D(e.l10n) && (delete e.l10n[r], Object.keys(e.l10n).length === 0 && delete e.l10n);
|
|
876
887
|
e.settings.locales.splice(e.settings.locales.indexOf(r), 1), e.settings.locales.length === 0 && delete e.settings.locales;
|
|
877
888
|
}
|
|
878
|
-
function
|
|
879
|
-
(e.text === void 0 || ((e) =>
|
|
889
|
+
function xt(e, t, n) {
|
|
890
|
+
(e.text === void 0 || ((e) => D(e) && Object.values(e).every((e) => D(e) && typeof e.value == "string" && typeof e.sourceHash == "string"))(e.text)) && (e.set === void 0 || D(e.set) && !Object.values(e.set).some((e) => e === void 0)) && (e.unset === void 0 || Array.isArray(e.unset) && e.unset.every((e) => typeof e == "string" && e !== "" && v(e))) && (e.hidden === void 0 || !n && typeof e.hidden == "boolean") && [
|
|
880
891
|
"text",
|
|
881
892
|
"set",
|
|
882
893
|
"unset",
|
|
883
894
|
...n ? [] : ["hidden"]
|
|
884
|
-
].some((t) => e[t] !== void 0) ||
|
|
885
|
-
let r =
|
|
886
|
-
return r && (r.text !== void 0 && !
|
|
895
|
+
].some((t) => e[t] !== void 0) || E("invalid_operation", t, "A locale update needs text, set, unset or a block's boolean hidden.");
|
|
896
|
+
let r = N(e, t);
|
|
897
|
+
return r && (r.text !== void 0 && !D(r.text) || r.set !== void 0 && !D(r.set) || r.hidden !== void 0 && (n || typeof r.hidden != "boolean")) && E("invalid_operation", t, "The locale layer expect is malformed."), {
|
|
887
898
|
text: e.text ?? {},
|
|
888
899
|
set: e.set ?? {},
|
|
889
900
|
unset: e.unset ?? [],
|
|
@@ -891,82 +902,87 @@ function gt(e, t, n) {
|
|
|
891
902
|
expect: r
|
|
892
903
|
};
|
|
893
904
|
}
|
|
894
|
-
function
|
|
895
|
-
for (let i of Object.keys(t.text))
|
|
905
|
+
function St(e, t, n, r) {
|
|
906
|
+
for (let i of Object.keys(t.text)) v(i) && (r ? g.includes(i) : Te(String(e.type), i)) && y(e, i) !== void 0 || E("invalid_operation", n, `Text path "${i}" isn't translatable or doesn't resolve.`);
|
|
896
907
|
for (let i of Object.keys(t.set)) {
|
|
897
|
-
let a = i.split("."), o = r ?
|
|
898
|
-
(!
|
|
908
|
+
let a = i.split("."), o = r ? Ge : Ue, s = a.length === 1 ? e : y(e, a.slice(0, -1).join("."));
|
|
909
|
+
(!v(i) || o.has(a[0]) || !r && Se(e, i, t.set[i]) || y(e, i) === void 0 && !D(s)) && E("invalid_operation", n, `Override path "${i}" is immutable or doesn't resolve.`);
|
|
899
910
|
}
|
|
900
911
|
}
|
|
901
|
-
function
|
|
912
|
+
function Ct(e, t, n, r) {
|
|
902
913
|
if (t) {
|
|
903
|
-
for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {}))
|
|
904
|
-
t.hidden !== void 0 && !
|
|
914
|
+
for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {})) h(e[i]?.[a] ?? null, o) || E("precondition_failed", n, `Locale path "${a}" has changed since.`, r);
|
|
915
|
+
t.hidden !== void 0 && !h(e.hidden === !0, t.hidden) && E("precondition_failed", n, "The locale's hidden state has changed since.", r);
|
|
905
916
|
}
|
|
906
917
|
}
|
|
907
|
-
function
|
|
908
|
-
|
|
918
|
+
function wt(e, t, n) {
|
|
919
|
+
D(e.l10n) || (e.l10n = {});
|
|
909
920
|
let r = e.l10n;
|
|
910
|
-
|
|
921
|
+
D(r[t]) || (r[t] = {});
|
|
911
922
|
let i = r[t];
|
|
912
923
|
for (let e of n.unset) i.text && delete i.text[e], i.set && delete i.set[e];
|
|
913
|
-
for (let [e, t] of Object.entries(n.text)) i.text ||= {}, i.text[e] =
|
|
914
|
-
for (let [e, t] of Object.entries(n.set)) i.set ||= {}, i.set[e] =
|
|
924
|
+
for (let [e, t] of Object.entries(n.text)) i.text ||= {}, i.text[e] = m(t), i.set && delete i.set[e];
|
|
925
|
+
for (let [e, t] of Object.entries(n.set)) i.set ||= {}, i.set[e] = m(t), i.text && delete i.text[e];
|
|
915
926
|
n.hidden === !0 ? i.hidden = !0 : n.hidden === !1 && delete i.hidden, i.text && Object.keys(i.text).length === 0 && delete i.text, i.set && Object.keys(i.set).length === 0 && delete i.set, Object.keys(i).length === 0 && delete r[t], Object.keys(r).length === 0 && delete e.l10n;
|
|
916
927
|
}
|
|
917
928
|
function I(e) {
|
|
918
|
-
return
|
|
929
|
+
return D(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(I) : I(e)) : !1;
|
|
919
930
|
}
|
|
920
|
-
function
|
|
921
|
-
return
|
|
931
|
+
function Tt(e) {
|
|
932
|
+
return D(e) && D(e.l10n) && Object.values(e.l10n).some((e) => D(e) && e.hidden === !0);
|
|
922
933
|
}
|
|
923
|
-
function
|
|
924
|
-
return !
|
|
934
|
+
function Et(e) {
|
|
935
|
+
return !D(e) || !I(e) ? !1 : Tt(e) ? !0 : Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(Et) : Et(e));
|
|
925
936
|
}
|
|
926
|
-
function
|
|
937
|
+
function Dt(e, t, n, r, i) {
|
|
927
938
|
if (!I(t)) return;
|
|
928
|
-
let a = n
|
|
929
|
-
(a !== null
|
|
939
|
+
let a = n, o = !1;
|
|
940
|
+
for (; a !== null;) {
|
|
941
|
+
let t = A(e, "wrapperId" in a ? a.wrapperId : a.sectionId);
|
|
942
|
+
if (!t) break;
|
|
943
|
+
Tt(t.block) && (o = !0), a = t.parent;
|
|
944
|
+
}
|
|
945
|
+
(o || i && Et(t)) && E("invalid_operation", r, "A layout's slot block can't be placed inside a block that a language hides.", D(t) && typeof t.id == "string" ? t.id : void 0);
|
|
930
946
|
}
|
|
931
|
-
function
|
|
932
|
-
let i =
|
|
933
|
-
s ||
|
|
947
|
+
function Ot(e, t, n, r) {
|
|
948
|
+
let i = _t(e, t, n), a = M(t, n), o = xt(t, n, !1), s = F(k(e)).find((e) => e.id === a);
|
|
949
|
+
s || E("block_missing", n, `No block with id "${a}".`, a), St(s, o, n, !1), nt(r, a, i, n), Ct(yt(s, i), o.expect, n, a), o.hidden === !0 && I(s) && E("invalid_operation", n, "A layout's slot block, and any block that contains it, can't be hidden.", a), wt(s, i, o);
|
|
934
950
|
}
|
|
935
|
-
function
|
|
936
|
-
let r =
|
|
937
|
-
|
|
951
|
+
function kt(e, t, n) {
|
|
952
|
+
let r = _t(e, t, n), i = xt(t, n, !0), a = e.settings;
|
|
953
|
+
St(a, i, n, !0), Ct(yt(a, r), i.expect, n), wt(a, r, i);
|
|
938
954
|
}
|
|
939
|
-
function
|
|
955
|
+
function At(e, t, n, r) {
|
|
940
956
|
let i = t.content;
|
|
941
|
-
if (!
|
|
942
|
-
|
|
943
|
-
let a = r.locks.find((e) =>
|
|
944
|
-
a &&
|
|
945
|
-
}
|
|
946
|
-
function
|
|
947
|
-
let i =
|
|
948
|
-
e.settings.locales?.includes(i) ||
|
|
949
|
-
let a =
|
|
950
|
-
a.length &&
|
|
951
|
-
let o = r.locks.find((e) =>
|
|
952
|
-
o &&
|
|
957
|
+
if (!D(i) || !Array.isArray(i.blocks) || !D(i.settings)) return E("invalid_operation", n, "setContent needs content with a blocks array and a settings object.");
|
|
958
|
+
lt(i, n, e);
|
|
959
|
+
let a = r.locks.find((e) => P(r, e));
|
|
960
|
+
a && E("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = m(i.blocks), e.settings = m(i.settings);
|
|
961
|
+
}
|
|
962
|
+
function jt(e, t, n, r) {
|
|
963
|
+
let i = gt(t, n);
|
|
964
|
+
e.settings.locales?.includes(i) || E("invalid_operation", n, `"${i}" is not a language version of this template.`);
|
|
965
|
+
let a = Fe(e, i);
|
|
966
|
+
a.length && E("invalid_operation", n, a.length === 1 ? `1 block is hidden in "${i}". Show it before making it the default.` : `${a.length} blocks are hidden in "${i}". Show them before making it the default.`, a[0]);
|
|
967
|
+
let o = r.locks.find((e) => P(r, e));
|
|
968
|
+
o && E("locked_by_others", n, "Other sessions hold locks on this template.", o.blockId);
|
|
953
969
|
let s = t.customTextFields;
|
|
954
970
|
if (s !== void 0) {
|
|
955
971
|
let t = F(e.blocks);
|
|
956
|
-
(!
|
|
957
|
-
if (
|
|
972
|
+
(!D(s) || Object.getOwnPropertyNames(s).some((e) => {
|
|
973
|
+
if (Ke.has(e)) return !0;
|
|
958
974
|
let n = s[e], r = t.find((t) => t.id === e);
|
|
959
|
-
return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !
|
|
960
|
-
})) &&
|
|
975
|
+
return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !v(e) || !Te("custom", e) || typeof y(r, e) != "string");
|
|
976
|
+
})) && E("invalid_operation", n, qe);
|
|
961
977
|
}
|
|
962
|
-
let c =
|
|
978
|
+
let c = Re(e, i, t.customTextFields);
|
|
963
979
|
e.blocks = c.blocks, e.settings = c.settings;
|
|
964
980
|
}
|
|
965
|
-
function
|
|
981
|
+
function Mt(e) {
|
|
966
982
|
let t = e.children;
|
|
967
983
|
return e.type === "section" && Array.isArray(t) ? t : [];
|
|
968
984
|
}
|
|
969
|
-
function
|
|
985
|
+
function Nt(e, t, n = null) {
|
|
970
986
|
for (let r = 0; r < e.length; r++) {
|
|
971
987
|
let i = e[r];
|
|
972
988
|
if (i.id === t) return {
|
|
@@ -974,30 +990,34 @@ function Ot(e, t, n = null) {
|
|
|
974
990
|
parent: n,
|
|
975
991
|
after: r > 0 ? e[r - 1].id : null
|
|
976
992
|
};
|
|
977
|
-
let a =
|
|
993
|
+
let a = Mt(i);
|
|
978
994
|
for (let e = 0; e < a.length; e++) {
|
|
979
995
|
if (!Array.isArray(a[e])) continue;
|
|
980
|
-
let n =
|
|
996
|
+
let n = Nt(a[e], t, {
|
|
981
997
|
sectionId: i.id,
|
|
982
998
|
column: e
|
|
983
999
|
});
|
|
984
1000
|
if (n) return n;
|
|
985
1001
|
}
|
|
1002
|
+
if (i.type === "wrapper" && Array.isArray(i.children)) {
|
|
1003
|
+
let e = Nt(i.children, t, { wrapperId: i.id });
|
|
1004
|
+
if (e) return e;
|
|
1005
|
+
}
|
|
986
1006
|
}
|
|
987
1007
|
return null;
|
|
988
1008
|
}
|
|
989
|
-
function
|
|
990
|
-
let r =
|
|
991
|
-
if (!r) throw new
|
|
1009
|
+
function Pt(e, t, n) {
|
|
1010
|
+
let r = Nt(e.blocks, t);
|
|
1011
|
+
if (!r) throw new w("block_missing", n, `No block with id "${t}".`, t);
|
|
992
1012
|
return r;
|
|
993
1013
|
}
|
|
994
|
-
function
|
|
1014
|
+
function Ft(e, t, n) {
|
|
995
1015
|
let r = {}, i = [], a = {}, o = [.../* @__PURE__ */ new Set([...Object.keys(t ?? {}), ...n ?? []])];
|
|
996
1016
|
for (let n of o) {
|
|
997
1017
|
let o = e[n];
|
|
998
|
-
o === void 0 ? i.push(n) : r[n] =
|
|
1018
|
+
o === void 0 ? i.push(n) : r[n] = m(o);
|
|
999
1019
|
let s = t && n in t ? t[n] : void 0;
|
|
1000
|
-
a[n] = s === void 0 ? null :
|
|
1020
|
+
a[n] = s === void 0 ? null : m(s);
|
|
1001
1021
|
}
|
|
1002
1022
|
return {
|
|
1003
1023
|
set: r,
|
|
@@ -1011,7 +1031,7 @@ function L(e, t) {
|
|
|
1011
1031
|
function R(e, t, n, r) {
|
|
1012
1032
|
let i = {}, a = {}, o = {};
|
|
1013
1033
|
n.length && (o.text = {}, o.set = {});
|
|
1014
|
-
for (let r of n) e.text?.[r] !== void 0 && (i[r] =
|
|
1034
|
+
for (let r of n) e.text?.[r] !== void 0 && (i[r] = m(e.text[r])), e.set && Object.hasOwn(e.set, r) && (a[r] = m(e.set[r])), o.text[r] = m(t.text?.[r] ?? null), o.set[r] = m(t.set?.[r] ?? null);
|
|
1015
1035
|
return r && (o.hidden = t.hidden === !0), {
|
|
1016
1036
|
unset: n,
|
|
1017
1037
|
...Object.keys(i).length ? { text: i } : {},
|
|
@@ -1020,16 +1040,16 @@ function R(e, t, n, r) {
|
|
|
1020
1040
|
expect: o
|
|
1021
1041
|
};
|
|
1022
1042
|
}
|
|
1023
|
-
function
|
|
1043
|
+
function It(e) {
|
|
1024
1044
|
let { unset: t, ...n } = R(e, {}, [.../* @__PURE__ */ new Set([...Object.keys(e.text ?? {}), ...Object.keys(e.set ?? {})])], e.hidden === !0);
|
|
1025
1045
|
return n;
|
|
1026
1046
|
}
|
|
1027
1047
|
function z(e) {
|
|
1028
|
-
return e.flatMap((e) => [e, ...e.type === "wrapper" ? z(e.children) :
|
|
1048
|
+
return e.flatMap((e) => [e, ...e.type === "wrapper" ? z(e.children) : Mt(e).flatMap(z)]);
|
|
1029
1049
|
}
|
|
1030
|
-
function
|
|
1031
|
-
let n =
|
|
1032
|
-
|
|
1050
|
+
function Lt(e, t) {
|
|
1051
|
+
let n = m(e);
|
|
1052
|
+
T(n, [t]);
|
|
1033
1053
|
let r = [], i = (e, t, n) => {
|
|
1034
1054
|
for (let [i, a] of Object.entries(e.l10n ?? {})) {
|
|
1035
1055
|
let e = t.l10n?.[i] ?? {}, o = [.../* @__PURE__ */ new Set([...Object.keys(a.text ?? {}).filter((t) => !Object.hasOwn(e.text ?? {}, t)), ...Object.keys(a.set ?? {}).filter((t) => !Object.hasOwn(e.set ?? {}, t))])];
|
|
@@ -1057,24 +1077,24 @@ function Mt(e, t) {
|
|
|
1057
1077
|
}
|
|
1058
1078
|
return r;
|
|
1059
1079
|
}
|
|
1060
|
-
function
|
|
1080
|
+
function Rt(e, t, n) {
|
|
1061
1081
|
switch (t.op) {
|
|
1062
1082
|
case "addBlock": return {
|
|
1063
1083
|
op: "deleteBlock",
|
|
1064
1084
|
blockId: t.block.id,
|
|
1065
|
-
expect: { block:
|
|
1085
|
+
expect: { block: m(t.block) }
|
|
1066
1086
|
};
|
|
1067
1087
|
case "deleteBlock": {
|
|
1068
|
-
let r =
|
|
1088
|
+
let r = Pt(e, t.blockId, n);
|
|
1069
1089
|
return {
|
|
1070
1090
|
op: "addBlock",
|
|
1071
|
-
block:
|
|
1091
|
+
block: m(r.block),
|
|
1072
1092
|
parent: r.parent,
|
|
1073
1093
|
after: r.after
|
|
1074
1094
|
};
|
|
1075
1095
|
}
|
|
1076
1096
|
case "moveBlock": {
|
|
1077
|
-
let r =
|
|
1097
|
+
let r = Pt(e, t.blockId, n);
|
|
1078
1098
|
return {
|
|
1079
1099
|
op: "moveBlock",
|
|
1080
1100
|
blockId: t.blockId,
|
|
@@ -1087,23 +1107,23 @@ function Nt(e, t, n) {
|
|
|
1087
1107
|
};
|
|
1088
1108
|
}
|
|
1089
1109
|
case "updateBlock": {
|
|
1090
|
-
let r =
|
|
1110
|
+
let r = Pt(e, t.blockId, n).block, { set: i, unset: a, expect: o } = Ft(r, t.set, t.unset);
|
|
1091
1111
|
return [{
|
|
1092
1112
|
op: "updateBlock",
|
|
1093
1113
|
blockId: t.blockId,
|
|
1094
1114
|
...Object.keys(i).length > 0 ? { set: i } : {},
|
|
1095
1115
|
...a.length > 0 ? { unset: a } : {},
|
|
1096
1116
|
expect: o
|
|
1097
|
-
}, ...
|
|
1117
|
+
}, ...Lt(e, t)];
|
|
1098
1118
|
}
|
|
1099
1119
|
case "updateSettings": {
|
|
1100
|
-
let { set: n, unset: r, expect: i } =
|
|
1120
|
+
let { set: n, unset: r, expect: i } = Ft(e.settings, t.set, t.unset);
|
|
1101
1121
|
return [{
|
|
1102
1122
|
op: "updateSettings",
|
|
1103
1123
|
...Object.keys(n).length > 0 ? { set: n } : {},
|
|
1104
1124
|
...r.length > 0 ? { unset: r } : {},
|
|
1105
1125
|
expect: i
|
|
1106
|
-
}, ...
|
|
1126
|
+
}, ...Lt(e, t)];
|
|
1107
1127
|
}
|
|
1108
1128
|
case "addLocale": return {
|
|
1109
1129
|
op: "removeLocale",
|
|
@@ -1122,12 +1142,12 @@ function Nt(e, t, n) {
|
|
|
1122
1142
|
op: "updateBlockLocale",
|
|
1123
1143
|
blockId: r.id,
|
|
1124
1144
|
locale: t.locale,
|
|
1125
|
-
...
|
|
1145
|
+
...It(e)
|
|
1126
1146
|
});
|
|
1127
1147
|
}
|
|
1128
1148
|
let r = e.settings.l10n?.[t.locale];
|
|
1129
1149
|
if (r) {
|
|
1130
|
-
let { hidden: e, ...i } =
|
|
1150
|
+
let { hidden: e, ...i } = It(r);
|
|
1131
1151
|
n.push({
|
|
1132
1152
|
op: "updateSettingsLocale",
|
|
1133
1153
|
locale: t.locale,
|
|
@@ -1138,8 +1158,8 @@ function Nt(e, t, n) {
|
|
|
1138
1158
|
}
|
|
1139
1159
|
case "updateBlockLocale":
|
|
1140
1160
|
case "updateSettingsLocale": {
|
|
1141
|
-
let n =
|
|
1142
|
-
|
|
1161
|
+
let n = m(e);
|
|
1162
|
+
T(n, [t]);
|
|
1143
1163
|
let r = [.../* @__PURE__ */ new Set([
|
|
1144
1164
|
...Object.keys(t.text ?? {}),
|
|
1145
1165
|
...Object.keys(t.set ?? {}),
|
|
@@ -1165,56 +1185,56 @@ function Nt(e, t, n) {
|
|
|
1165
1185
|
case "setContent": return {
|
|
1166
1186
|
op: "setContent",
|
|
1167
1187
|
content: {
|
|
1168
|
-
blocks:
|
|
1169
|
-
settings:
|
|
1188
|
+
blocks: m(e.blocks),
|
|
1189
|
+
settings: m(e.settings)
|
|
1170
1190
|
}
|
|
1171
1191
|
};
|
|
1172
1192
|
}
|
|
1173
1193
|
}
|
|
1174
|
-
function
|
|
1175
|
-
let n =
|
|
1194
|
+
function zt(e, t) {
|
|
1195
|
+
let n = m(e), r = [];
|
|
1176
1196
|
return t.forEach((e, t) => {
|
|
1177
1197
|
try {
|
|
1178
|
-
let i =
|
|
1179
|
-
r.push(...Array.isArray(i) ? [...i].reverse() : [i]),
|
|
1198
|
+
let i = Rt(n, e, t);
|
|
1199
|
+
r.push(...Array.isArray(i) ? [...i].reverse() : [i]), T(n, [e]);
|
|
1180
1200
|
} catch (e) {
|
|
1181
|
-
throw e instanceof
|
|
1201
|
+
throw e instanceof w ? new w(e.code, t, e.message, e.blockId) : e;
|
|
1182
1202
|
}
|
|
1183
1203
|
}), r.reverse();
|
|
1184
1204
|
}
|
|
1185
|
-
function
|
|
1205
|
+
function Bt(e) {
|
|
1186
1206
|
return e === "invalid_operation" ? 422 : e === "content_too_large" ? 413 : 409;
|
|
1187
1207
|
}
|
|
1188
|
-
var
|
|
1208
|
+
var Vt = class extends he {
|
|
1189
1209
|
opIndex;
|
|
1190
1210
|
holder;
|
|
1191
1211
|
holders;
|
|
1192
1212
|
constructor(e, t) {
|
|
1193
|
-
super(e, t.status ??
|
|
1213
|
+
super(e, t.status ?? Bt(t.code), t.code), this.name = "CollaborationConflict", t.opIndex !== void 0 && (this.opIndex = t.opIndex), t.holder !== void 0 && (this.holder = t.holder), t.holders !== void 0 && (this.holders = t.holders);
|
|
1194
1214
|
}
|
|
1195
1215
|
};
|
|
1196
|
-
function
|
|
1216
|
+
function B(e) {
|
|
1197
1217
|
return e.type === "section";
|
|
1198
1218
|
}
|
|
1199
|
-
function
|
|
1219
|
+
function Ht(e) {
|
|
1200
1220
|
return e.type === "custom";
|
|
1201
1221
|
}
|
|
1202
|
-
function
|
|
1222
|
+
function V(e) {
|
|
1203
1223
|
return e.type === "slot";
|
|
1204
1224
|
}
|
|
1205
|
-
function
|
|
1225
|
+
function H(e) {
|
|
1206
1226
|
return e.type === "wrapper";
|
|
1207
1227
|
}
|
|
1208
|
-
var
|
|
1228
|
+
var Ut = {
|
|
1209
1229
|
content: "<p>Enter your title</p>",
|
|
1210
1230
|
level: 2,
|
|
1211
1231
|
textAlign: "left"
|
|
1212
|
-
},
|
|
1232
|
+
}, Wt = { content: "<p>Enter your text here</p>" }, Gt = {
|
|
1213
1233
|
src: "",
|
|
1214
1234
|
alt: "",
|
|
1215
1235
|
width: "full",
|
|
1216
1236
|
align: "center"
|
|
1217
|
-
},
|
|
1237
|
+
}, Kt = {
|
|
1218
1238
|
text: "Click Here",
|
|
1219
1239
|
url: "",
|
|
1220
1240
|
backgroundColor: "#333333",
|
|
@@ -1228,36 +1248,36 @@ var zt = {
|
|
|
1228
1248
|
left: 24
|
|
1229
1249
|
},
|
|
1230
1250
|
align: "center"
|
|
1231
|
-
},
|
|
1251
|
+
}, qt = {
|
|
1232
1252
|
lineStyle: "solid",
|
|
1233
1253
|
color: "#e0e0e0",
|
|
1234
1254
|
thickness: 1,
|
|
1235
1255
|
width: "full"
|
|
1236
|
-
},
|
|
1256
|
+
}, Jt = { columns: "1" }, Yt = {
|
|
1237
1257
|
url: "",
|
|
1238
1258
|
thumbnailUrl: "",
|
|
1239
1259
|
alt: "Video",
|
|
1240
1260
|
width: "full",
|
|
1241
1261
|
align: "center"
|
|
1242
|
-
},
|
|
1262
|
+
}, Xt = {
|
|
1243
1263
|
iconStyle: "solid",
|
|
1244
1264
|
iconSize: "medium",
|
|
1245
1265
|
spacing: 10,
|
|
1246
1266
|
align: "center"
|
|
1247
|
-
},
|
|
1267
|
+
}, Zt = { height: 24 }, Qt = { content: "" }, $t = {
|
|
1248
1268
|
fontSize: 15,
|
|
1249
1269
|
textAlign: "center",
|
|
1250
1270
|
separator: "|",
|
|
1251
1271
|
separatorColor: "#e0e0e0",
|
|
1252
1272
|
spacing: 10
|
|
1253
|
-
},
|
|
1273
|
+
}, en = {
|
|
1254
1274
|
hasHeaderRow: !0,
|
|
1255
1275
|
borderColor: "#e0e0e0",
|
|
1256
1276
|
borderWidth: 1,
|
|
1257
1277
|
cellPadding: 8,
|
|
1258
1278
|
fontSize: 15,
|
|
1259
1279
|
textAlign: "left"
|
|
1260
|
-
},
|
|
1280
|
+
}, tn = {
|
|
1261
1281
|
targetDate: "",
|
|
1262
1282
|
timezone: "UTC",
|
|
1263
1283
|
showDays: !0,
|
|
@@ -1277,21 +1297,21 @@ var zt = {
|
|
|
1277
1297
|
expiredMessage: "This offer has expired",
|
|
1278
1298
|
expiredImageUrl: "",
|
|
1279
1299
|
hideOnExpiry: !1
|
|
1280
|
-
},
|
|
1281
|
-
title:
|
|
1282
|
-
paragraph:
|
|
1283
|
-
image:
|
|
1284
|
-
button:
|
|
1285
|
-
divider:
|
|
1286
|
-
section:
|
|
1287
|
-
video:
|
|
1288
|
-
social:
|
|
1289
|
-
spacer:
|
|
1290
|
-
html:
|
|
1291
|
-
menu:
|
|
1292
|
-
table:
|
|
1293
|
-
countdown:
|
|
1294
|
-
},
|
|
1300
|
+
}, nn = {
|
|
1301
|
+
title: Ut,
|
|
1302
|
+
paragraph: Wt,
|
|
1303
|
+
image: Gt,
|
|
1304
|
+
button: Kt,
|
|
1305
|
+
divider: qt,
|
|
1306
|
+
section: Jt,
|
|
1307
|
+
video: Yt,
|
|
1308
|
+
social: Xt,
|
|
1309
|
+
spacer: Zt,
|
|
1310
|
+
html: Qt,
|
|
1311
|
+
menu: $t,
|
|
1312
|
+
table: en,
|
|
1313
|
+
countdown: tn
|
|
1314
|
+
}, rn = {
|
|
1295
1315
|
width: 600,
|
|
1296
1316
|
backgroundColor: "#ffffff",
|
|
1297
1317
|
textColor: "#1a1a1a",
|
|
@@ -1299,28 +1319,28 @@ var zt = {
|
|
|
1299
1319
|
fontFamily: "Arial",
|
|
1300
1320
|
locale: "en"
|
|
1301
1321
|
};
|
|
1302
|
-
function
|
|
1322
|
+
function an(e) {
|
|
1303
1323
|
return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
|
|
1304
1324
|
}
|
|
1305
|
-
function
|
|
1325
|
+
function on(e, t) {
|
|
1306
1326
|
let n = { ...e };
|
|
1307
1327
|
for (let r of Object.keys(t)) {
|
|
1308
1328
|
let i = e[r], a = t[r];
|
|
1309
|
-
a !== void 0 && (n[r] =
|
|
1329
|
+
a !== void 0 && (n[r] = an(i) && an(a) ? on(i, a) : a);
|
|
1310
1330
|
}
|
|
1311
1331
|
return n;
|
|
1312
1332
|
}
|
|
1313
|
-
function
|
|
1333
|
+
function sn(e = "Arial", t) {
|
|
1314
1334
|
return {
|
|
1315
1335
|
blocks: [],
|
|
1316
1336
|
settings: {
|
|
1317
|
-
|
|
1337
|
+
...rn,
|
|
1318
1338
|
fontFamily: e,
|
|
1319
1339
|
...t
|
|
1320
1340
|
}
|
|
1321
1341
|
};
|
|
1322
1342
|
}
|
|
1323
|
-
var
|
|
1343
|
+
var cn = [
|
|
1324
1344
|
"ar",
|
|
1325
1345
|
"he",
|
|
1326
1346
|
"iw",
|
|
@@ -1334,23 +1354,23 @@ var rn = [
|
|
|
1334
1354
|
"ckb",
|
|
1335
1355
|
"ks"
|
|
1336
1356
|
];
|
|
1337
|
-
function
|
|
1357
|
+
function ln(e) {
|
|
1338
1358
|
let t = e?.trim().replace(/_/g, "-").split("-")[0]?.toLowerCase();
|
|
1339
|
-
return !!t &&
|
|
1359
|
+
return !!t && cn.includes(t);
|
|
1340
1360
|
}
|
|
1341
|
-
function
|
|
1342
|
-
return e.direction === "ltr" || e.direction === "rtl" ? e.direction :
|
|
1361
|
+
function un(e) {
|
|
1362
|
+
return e.direction === "ltr" || e.direction === "rtl" ? e.direction : ln(e.locale) ? "rtl" : "ltr";
|
|
1343
1363
|
}
|
|
1344
|
-
var
|
|
1345
|
-
function
|
|
1364
|
+
var dn = 2e4, fn = /* @__PURE__ */ new Set(["\"", "'"]);
|
|
1365
|
+
function pn(e, t) {
|
|
1346
1366
|
let n = null, r = "tag";
|
|
1347
1367
|
for (let i = t; i < e.length; i++) {
|
|
1348
1368
|
let t = e[i];
|
|
1349
1369
|
if (n !== null) t === n && (n = null);
|
|
1350
1370
|
else {
|
|
1351
1371
|
if (r === "beforeValue") {
|
|
1352
|
-
if (
|
|
1353
|
-
if (
|
|
1372
|
+
if (U(t)) continue;
|
|
1373
|
+
if (fn.has(t)) {
|
|
1354
1374
|
n = t, r = "tag";
|
|
1355
1375
|
continue;
|
|
1356
1376
|
}
|
|
@@ -1358,19 +1378,19 @@ function ln(e, t) {
|
|
|
1358
1378
|
}
|
|
1359
1379
|
if (r === "unquotedValue") {
|
|
1360
1380
|
if (t === ">") return i;
|
|
1361
|
-
|
|
1381
|
+
U(t) && (r = "tag");
|
|
1362
1382
|
} else if (t === "=") r = "beforeValue";
|
|
1363
1383
|
else if (t === ">") return i;
|
|
1364
1384
|
}
|
|
1365
1385
|
}
|
|
1366
1386
|
return -1;
|
|
1367
1387
|
}
|
|
1368
|
-
function
|
|
1388
|
+
function mn(e, t) {
|
|
1369
1389
|
let n = null;
|
|
1370
1390
|
for (let r = t; r < e.length; r++) {
|
|
1371
1391
|
let t = e[r];
|
|
1372
1392
|
if (n !== null) t === n && (n = null);
|
|
1373
|
-
else if (
|
|
1393
|
+
else if (fn.has(t)) n = t;
|
|
1374
1394
|
else if (t === ">") return {
|
|
1375
1395
|
end: r,
|
|
1376
1396
|
nextSpan: -1
|
|
@@ -1385,13 +1405,13 @@ function un(e, t) {
|
|
|
1385
1405
|
nextSpan: -1
|
|
1386
1406
|
};
|
|
1387
1407
|
}
|
|
1388
|
-
function
|
|
1408
|
+
function hn(e) {
|
|
1389
1409
|
return e !== " " && e !== " " && e !== "\n" && e !== "\r" && e !== "\f" && e !== "=" && e !== ">" && e !== "/";
|
|
1390
1410
|
}
|
|
1391
|
-
function
|
|
1411
|
+
function U(e) {
|
|
1392
1412
|
return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
|
|
1393
1413
|
}
|
|
1394
|
-
var
|
|
1414
|
+
var gn = {
|
|
1395
1415
|
AMP: "&",
|
|
1396
1416
|
COPY: "©",
|
|
1397
1417
|
GT: ">",
|
|
@@ -1652,50 +1672,50 @@ var fn = {
|
|
|
1652
1672
|
zwj: "",
|
|
1653
1673
|
zwnj: ""
|
|
1654
1674
|
};
|
|
1655
|
-
function
|
|
1675
|
+
function W(e) {
|
|
1656
1676
|
return e.includes("&") ? e.replace(/&(#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g, (e, t) => {
|
|
1657
1677
|
if (t[0] === "#") {
|
|
1658
1678
|
let n = t[1] === "x" || t[1] === "X" ? Number.parseInt(t.slice(2), 16) : Number.parseInt(t.slice(1), 10);
|
|
1659
1679
|
return !Number.isFinite(n) || n < 1 || n > 1114111 || n >= 55296 && n <= 57343 ? e : String.fromCodePoint(n);
|
|
1660
1680
|
}
|
|
1661
|
-
return Object.hasOwn(
|
|
1681
|
+
return Object.hasOwn(gn, t) ? gn[t] : e;
|
|
1662
1682
|
}) : e;
|
|
1663
1683
|
}
|
|
1664
|
-
function
|
|
1684
|
+
function _n(e, t) {
|
|
1665
1685
|
let n = t.toLowerCase(), r = 0;
|
|
1666
1686
|
for (; r < e.length;) {
|
|
1667
|
-
for (; r < e.length && (
|
|
1687
|
+
for (; r < e.length && (U(e[r]) || e[r] === "/");) r++;
|
|
1668
1688
|
if (r >= e.length) break;
|
|
1669
1689
|
let t = r;
|
|
1670
|
-
for (; r < e.length &&
|
|
1690
|
+
for (; r < e.length && hn(e[r]);) r++;
|
|
1671
1691
|
let i = e.substring(t, r).toLowerCase();
|
|
1672
1692
|
if (i === "") {
|
|
1673
1693
|
r++;
|
|
1674
1694
|
continue;
|
|
1675
1695
|
}
|
|
1676
|
-
for (; r < e.length &&
|
|
1696
|
+
for (; r < e.length && U(e[r]);) r++;
|
|
1677
1697
|
if (e[r] !== "=") continue;
|
|
1678
|
-
for (r++; r < e.length &&
|
|
1698
|
+
for (r++; r < e.length && U(e[r]);) r++;
|
|
1679
1699
|
let a = e[r];
|
|
1680
|
-
if (
|
|
1700
|
+
if (fn.has(a)) {
|
|
1681
1701
|
let t = r + 1, o = e.indexOf(a, t);
|
|
1682
1702
|
if (o === -1) return null;
|
|
1683
|
-
if (i === n) return
|
|
1703
|
+
if (i === n) return W(e.substring(t, o));
|
|
1684
1704
|
r = o + 1;
|
|
1685
1705
|
continue;
|
|
1686
1706
|
}
|
|
1687
1707
|
let o = r;
|
|
1688
|
-
for (; r < e.length && !
|
|
1689
|
-
if (i === n) return
|
|
1708
|
+
for (; r < e.length && !U(e[r]) && e[r] !== ">";) r++;
|
|
1709
|
+
if (i === n) return W(e.substring(o, r));
|
|
1690
1710
|
}
|
|
1691
1711
|
return null;
|
|
1692
1712
|
}
|
|
1693
|
-
function
|
|
1694
|
-
return
|
|
1713
|
+
function vn(e, t) {
|
|
1714
|
+
return bn(e, t, !0);
|
|
1695
1715
|
}
|
|
1696
|
-
function
|
|
1716
|
+
function yn(e) {
|
|
1697
1717
|
let t = [];
|
|
1698
|
-
return
|
|
1718
|
+
return bn(e, (n, r, i) => {
|
|
1699
1719
|
let a = e.slice(r, i);
|
|
1700
1720
|
return t.push({
|
|
1701
1721
|
start: r,
|
|
@@ -1704,7 +1724,7 @@ function hn(e) {
|
|
|
1704
1724
|
}), a;
|
|
1705
1725
|
}, !0), t;
|
|
1706
1726
|
}
|
|
1707
|
-
function
|
|
1727
|
+
function bn(e, t, n) {
|
|
1708
1728
|
let r = "", i = 0;
|
|
1709
1729
|
for (; i < e.length;) {
|
|
1710
1730
|
let a = e.indexOf("<span", i);
|
|
@@ -1717,7 +1737,7 @@ function gn(e, t, n) {
|
|
|
1717
1737
|
r += e.substring(i, a + 5), i = a + 5;
|
|
1718
1738
|
continue;
|
|
1719
1739
|
}
|
|
1720
|
-
let { end: s, nextSpan: c } =
|
|
1740
|
+
let { end: s, nextSpan: c } = mn(e, a + 5);
|
|
1721
1741
|
if (c !== -1) {
|
|
1722
1742
|
r += e.substring(i, c), i = c;
|
|
1723
1743
|
continue;
|
|
@@ -1726,12 +1746,12 @@ function gn(e, t, n) {
|
|
|
1726
1746
|
r += e.substring(i);
|
|
1727
1747
|
break;
|
|
1728
1748
|
}
|
|
1729
|
-
let l = e.substring(a + 5, s), u =
|
|
1749
|
+
let l = e.substring(a + 5, s), u = Sn(l, "data-merge-tag") ?? Sn(l, "data-logic-merge-tag");
|
|
1730
1750
|
if (u === null) {
|
|
1731
1751
|
r += e.substring(i, s + 1), i = s + 1;
|
|
1732
1752
|
continue;
|
|
1733
1753
|
}
|
|
1734
|
-
let d =
|
|
1754
|
+
let d = xn(e, s + 1, n);
|
|
1735
1755
|
if (d === -1) {
|
|
1736
1756
|
r += e.substring(i);
|
|
1737
1757
|
break;
|
|
@@ -1740,7 +1760,7 @@ function gn(e, t, n) {
|
|
|
1740
1760
|
}
|
|
1741
1761
|
return r;
|
|
1742
1762
|
}
|
|
1743
|
-
function
|
|
1763
|
+
function xn(e, t, n) {
|
|
1744
1764
|
if (!n) {
|
|
1745
1765
|
let n = e.indexOf("</span>", t);
|
|
1746
1766
|
return n === -1 ? -1 : n + 7;
|
|
@@ -1749,7 +1769,7 @@ function _n(e, t, n) {
|
|
|
1749
1769
|
for (; i < e.length;) {
|
|
1750
1770
|
let t = e.indexOf("<", i);
|
|
1751
1771
|
if (t === -1) return -1;
|
|
1752
|
-
let n =
|
|
1772
|
+
let n = pn(e, t + 1);
|
|
1753
1773
|
if (n === -1) return -1;
|
|
1754
1774
|
let a = e.startsWith("</span", t), o = e.startsWith("<span", t), s = e[t + (a ? 6 : 5)];
|
|
1755
1775
|
if ((o || a) && (s === ">" || s === "/" || /\s/.test(s)) && (r += a ? -1 : 1, r === 0)) return n + 1;
|
|
@@ -1757,10 +1777,10 @@ function _n(e, t, n) {
|
|
|
1757
1777
|
}
|
|
1758
1778
|
return -1;
|
|
1759
1779
|
}
|
|
1760
|
-
function
|
|
1761
|
-
return
|
|
1780
|
+
function Sn(e, t) {
|
|
1781
|
+
return _n(e, t);
|
|
1762
1782
|
}
|
|
1763
|
-
var
|
|
1783
|
+
var G = {
|
|
1764
1784
|
liquid: {
|
|
1765
1785
|
value: /\{\{.+?\}\}/g,
|
|
1766
1786
|
logic: /\{%-?\s*(\w+).*?-?%\}/g,
|
|
@@ -1786,13 +1806,13 @@ var W = {
|
|
|
1786
1806
|
closer: "=%%"
|
|
1787
1807
|
}
|
|
1788
1808
|
};
|
|
1789
|
-
function
|
|
1790
|
-
return Object.keys(
|
|
1791
|
-
let n =
|
|
1809
|
+
function K(e) {
|
|
1810
|
+
return Object.keys(G).find((t) => {
|
|
1811
|
+
let n = G[t];
|
|
1792
1812
|
return (e.value === n.value || e.value.source === n.value.source && e.value.flags.replace(/[gy]/g, "") === n.value.flags.replace(/[gy]/g, "")) && (e.logic === n.logic || e.logic.source === n.logic.source && e.logic.flags.replace(/[gy]/g, "") === n.logic.flags.replace(/[gy]/g, ""));
|
|
1793
1813
|
});
|
|
1794
1814
|
}
|
|
1795
|
-
function
|
|
1815
|
+
function Cn(e, t, n) {
|
|
1796
1816
|
for (let r = n; r < e.length; r++) {
|
|
1797
1817
|
let n = e.charCodeAt(r);
|
|
1798
1818
|
if (n === 10 || n === 13 || n === 8232 || n === 8233) return {
|
|
@@ -1809,8 +1829,8 @@ function yn(e, t, n) {
|
|
|
1809
1829
|
lineBreak: -1
|
|
1810
1830
|
};
|
|
1811
1831
|
}
|
|
1812
|
-
function
|
|
1813
|
-
let a =
|
|
1832
|
+
function q(e, t, n, r = 0, i = Infinity) {
|
|
1833
|
+
let a = K(t);
|
|
1814
1834
|
if (!a) {
|
|
1815
1835
|
let a = t[n], o = new RegExp(a.source, a.flags.replace(/[gy]/g, "") + "g");
|
|
1816
1836
|
return o.lastIndex = r, [...e.matchAll(o)].slice(0, i).map((e) => ({
|
|
@@ -1834,7 +1854,7 @@ function K(e, t, n, r = 0, i = Infinity) {
|
|
|
1834
1854
|
let r = u?.lastIndex ?? t + s.length, i = a === "mailchimp" && n === "value" ? {
|
|
1835
1855
|
close: e.startsWith(c, r) ? r : -1,
|
|
1836
1856
|
lineBreak: -1
|
|
1837
|
-
} :
|
|
1857
|
+
} : Cn(e, c, Math.max(r, t + s.length + +(n === "value")));
|
|
1838
1858
|
if (i.lineBreak >= 0) {
|
|
1839
1859
|
let r = i.lineBreak, o = n === "logic" && (a === "liquid" || a === "ampscript") ? e.lastIndexOf(s, r) : -1;
|
|
1840
1860
|
p = o > t ? o : r + 1;
|
|
@@ -1856,8 +1876,8 @@ function K(e, t, n, r = 0, i = Infinity) {
|
|
|
1856
1876
|
}
|
|
1857
1877
|
return f;
|
|
1858
1878
|
}
|
|
1859
|
-
function
|
|
1860
|
-
let n =
|
|
1879
|
+
function wn(e, t) {
|
|
1880
|
+
let n = K(t);
|
|
1861
1881
|
if (!n) {
|
|
1862
1882
|
let n = RegExp(`(${t.value.source}|${t.logic.source})`, "g");
|
|
1863
1883
|
return [...e.matchAll(n)].map((e) => ({
|
|
@@ -1865,7 +1885,7 @@ function bn(e, t) {
|
|
|
1865
1885
|
value: e[0]
|
|
1866
1886
|
}));
|
|
1867
1887
|
}
|
|
1868
|
-
if (n === "handlebars") return
|
|
1888
|
+
if (n === "handlebars") return q(e, t, "value");
|
|
1869
1889
|
if (n === "mailchimp") {
|
|
1870
1890
|
let n = [], r = new RegExp(t.value.source, "y"), i = new RegExp(t.logic.source, "y"), a = /\*\|\w+[:|]/y, o = 0;
|
|
1871
1891
|
for (; o < e.length;) {
|
|
@@ -1884,7 +1904,7 @@ function bn(e, t) {
|
|
|
1884
1904
|
o = t + 2;
|
|
1885
1905
|
continue;
|
|
1886
1906
|
}
|
|
1887
|
-
let c =
|
|
1907
|
+
let c = Cn(e, "|*", a.lastIndex);
|
|
1888
1908
|
if (c.lineBreak >= 0) {
|
|
1889
1909
|
o = c.lineBreak + 1;
|
|
1890
1910
|
continue;
|
|
@@ -1899,78 +1919,78 @@ function bn(e, t) {
|
|
|
1899
1919
|
}
|
|
1900
1920
|
return n;
|
|
1901
1921
|
}
|
|
1902
|
-
let r = [], i = 0, a =
|
|
1922
|
+
let r = [], i = 0, a = q(e, t, "value", i, 1)[0], o = q(e, t, "logic", i, 1)[0];
|
|
1903
1923
|
for (; a || o;) {
|
|
1904
1924
|
let n = !o || a && a.index <= o.index ? a : o;
|
|
1905
|
-
r.push(n), i = n.index + n.value.length, (n === a || a && a.index < i) && (a =
|
|
1925
|
+
r.push(n), i = n.index + n.value.length, (n === a || a && a.index < i) && (a = q(e, t, "value", i, 1)[0]), (n === o || o && o.index < i) && (o = q(e, t, "logic", i, 1)[0]);
|
|
1906
1926
|
}
|
|
1907
1927
|
return r;
|
|
1908
1928
|
}
|
|
1909
|
-
function
|
|
1929
|
+
function Tn(e) {
|
|
1910
1930
|
return typeof e == "string" && e.trim() !== "" ? e : null;
|
|
1911
1931
|
}
|
|
1912
|
-
function
|
|
1913
|
-
return Object.values(
|
|
1932
|
+
function En(e) {
|
|
1933
|
+
return Object.values(G).find((t) => t.value.source === e.value.source) ?? null;
|
|
1914
1934
|
}
|
|
1915
|
-
function
|
|
1916
|
-
return
|
|
1935
|
+
function Dn(e) {
|
|
1936
|
+
return Tn(e.opener) ?? En(e)?.opener ?? null;
|
|
1917
1937
|
}
|
|
1918
|
-
function
|
|
1919
|
-
return
|
|
1938
|
+
function On(e) {
|
|
1939
|
+
return Tn(e.closer) ?? En(e)?.closer ?? null;
|
|
1920
1940
|
}
|
|
1921
|
-
function
|
|
1922
|
-
return e ? typeof e == "string" ?
|
|
1941
|
+
function kn(e) {
|
|
1942
|
+
return e ? typeof e == "string" ? G[e] ?? G.liquid : e : G.liquid;
|
|
1923
1943
|
}
|
|
1924
|
-
function
|
|
1944
|
+
function An(e) {
|
|
1925
1945
|
let t = e.source, n = e.flags.replace("g", "");
|
|
1926
1946
|
return RegExp(`^${t}$`, n);
|
|
1927
1947
|
}
|
|
1928
|
-
function
|
|
1948
|
+
function jn(e, t) {
|
|
1929
1949
|
let n = e?.trim() || "";
|
|
1930
|
-
return !
|
|
1950
|
+
return !An(t.logic).test(n) && An(t.value).test(n);
|
|
1931
1951
|
}
|
|
1932
|
-
function
|
|
1952
|
+
function Mn(e, t) {
|
|
1933
1953
|
let n = t.find((t) => t.value === e);
|
|
1934
1954
|
return n ? n.label : e;
|
|
1935
1955
|
}
|
|
1936
|
-
function
|
|
1937
|
-
return
|
|
1956
|
+
function Nn(e, t) {
|
|
1957
|
+
return Un(e, "data-merge-tag", (e) => Mn(e, t));
|
|
1938
1958
|
}
|
|
1939
|
-
function
|
|
1959
|
+
function Pn(e, t) {
|
|
1940
1960
|
return t.find((t) => t.value === e)?.sample;
|
|
1941
1961
|
}
|
|
1942
|
-
function
|
|
1943
|
-
return
|
|
1962
|
+
function Fn(e, t) {
|
|
1963
|
+
return Un(e, "data-merge-tag", (e) => Rn(Pn(e, t) ?? Mn(e, t)), { unwrap: (e) => Pn(e, t) !== void 0 });
|
|
1944
1964
|
}
|
|
1945
|
-
function
|
|
1965
|
+
function In(e) {
|
|
1946
1966
|
return e.some((e) => e.sample !== void 0);
|
|
1947
1967
|
}
|
|
1948
|
-
function
|
|
1968
|
+
function Ln(e, t) {
|
|
1949
1969
|
if (!e) return e;
|
|
1950
1970
|
let n = e;
|
|
1951
1971
|
for (let e of t) e.sample !== void 0 && (n = n.split(e.value).join(e.sample));
|
|
1952
1972
|
return n;
|
|
1953
1973
|
}
|
|
1954
|
-
function
|
|
1974
|
+
function Rn(e) {
|
|
1955
1975
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1956
1976
|
}
|
|
1957
|
-
function
|
|
1977
|
+
function zn(e, t) {
|
|
1958
1978
|
if (!e) return !1;
|
|
1959
|
-
if (
|
|
1979
|
+
if (K(t)) return q(e, t, "value", 0, 1).length > 0 || q(e, t, "logic", 0, 1).length > 0;
|
|
1960
1980
|
let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
|
|
1961
1981
|
return n.test(e) || r.test(e);
|
|
1962
1982
|
}
|
|
1963
|
-
function
|
|
1964
|
-
return
|
|
1983
|
+
function Bn(e, t) {
|
|
1984
|
+
return An(t.logic).test(e?.trim() || "");
|
|
1965
1985
|
}
|
|
1966
|
-
function
|
|
1986
|
+
function Vn(e, t) {
|
|
1967
1987
|
let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
|
|
1968
1988
|
return r && r[1] ? r[1].toUpperCase() : e;
|
|
1969
1989
|
}
|
|
1970
|
-
function
|
|
1971
|
-
return
|
|
1990
|
+
function Hn(e, t) {
|
|
1991
|
+
return Un(e, "data-logic-merge-tag", (e) => Vn(e, t));
|
|
1972
1992
|
}
|
|
1973
|
-
function
|
|
1993
|
+
function Un(e, t, n, r) {
|
|
1974
1994
|
let i = "", a = 0;
|
|
1975
1995
|
for (; a < e.length;) {
|
|
1976
1996
|
let o = e.indexOf("<span", a);
|
|
@@ -1983,7 +2003,7 @@ function zn(e, t, n, r) {
|
|
|
1983
2003
|
i += e.substring(a, o + 5), a = o + 5;
|
|
1984
2004
|
continue;
|
|
1985
2005
|
}
|
|
1986
|
-
let { end: c, nextSpan: l } =
|
|
2006
|
+
let { end: c, nextSpan: l } = mn(e, o + 5);
|
|
1987
2007
|
if (l !== -1) {
|
|
1988
2008
|
i += e.substring(a, l), a = l;
|
|
1989
2009
|
continue;
|
|
@@ -1992,7 +2012,7 @@ function zn(e, t, n, r) {
|
|
|
1992
2012
|
i += e.substring(a);
|
|
1993
2013
|
break;
|
|
1994
2014
|
}
|
|
1995
|
-
let u =
|
|
2015
|
+
let u = _n(e.substring(o + 5, c), t);
|
|
1996
2016
|
if (u === null) {
|
|
1997
2017
|
i += e.substring(a, c + 1), a = c + 1;
|
|
1998
2018
|
continue;
|
|
@@ -2007,14 +2027,14 @@ function zn(e, t, n, r) {
|
|
|
2007
2027
|
}
|
|
2008
2028
|
return i;
|
|
2009
2029
|
}
|
|
2010
|
-
var
|
|
2030
|
+
var Wn = {
|
|
2011
2031
|
title: ["content"],
|
|
2012
2032
|
paragraph: ["content"]
|
|
2013
2033
|
};
|
|
2014
|
-
function
|
|
2034
|
+
function Gn(e) {
|
|
2015
2035
|
let t = [], n = /<[a-z][\w:-]*\b/gi;
|
|
2016
2036
|
for (; n.exec(e);) {
|
|
2017
|
-
let r =
|
|
2037
|
+
let r = pn(e, n.lastIndex);
|
|
2018
2038
|
if (r < 0) break;
|
|
2019
2039
|
let i = n.lastIndex, a = e.slice(i, r), o = /[^\s"'<>/=]+\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/g;
|
|
2020
2040
|
for (let e; e = o.exec(a);) {
|
|
@@ -2028,46 +2048,50 @@ function Vn(e) {
|
|
|
2028
2048
|
}
|
|
2029
2049
|
return t;
|
|
2030
2050
|
}
|
|
2031
|
-
function
|
|
2032
|
-
let r = n === "html" ?
|
|
2051
|
+
function Kn(e, t, n) {
|
|
2052
|
+
let r = n === "html" ? yn(e) : [], i = n === "html" ? Gn(e) : [], a = r.map((e) => ({
|
|
2033
2053
|
...e,
|
|
2034
2054
|
attribute: !1
|
|
2035
|
-
})), o = 0, s =
|
|
2036
|
-
let c = e.slice(n, r), l = ["logic", "value"], u = s ? l.map((e) =>
|
|
2055
|
+
})), o = 0, s = K(t) !== void 0, c = (n, r) => {
|
|
2056
|
+
let c = e.slice(n, r), l = ["logic", "value"], u = s ? l.map((e) => q(c, t, e, 0, 1)[0]) : [void 0, void 0], d = s ? null : [t.logic, t.value].map((e) => new RegExp(e.source, e.flags.replace(/[gy]/g, "") + "g")), f = 0;
|
|
2037
2057
|
for (; f < c.length;) {
|
|
2038
|
-
let e = s ? u.flatMap((e) => e ? [e] : []) : d.flatMap((e) => {
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2058
|
+
let e = s ? u.flatMap((e) => e ? [e] : []) : d.flatMap((e, t) => {
|
|
2059
|
+
let n = u[t];
|
|
2060
|
+
if (n === void 0 || n !== null && n.index < f) {
|
|
2061
|
+
e.lastIndex = f;
|
|
2062
|
+
let n = e.exec(c);
|
|
2063
|
+
for (; n && n[0].length === 0;) e.lastIndex = n.index + 1, n = e.exec(c);
|
|
2064
|
+
u[t] = n ? {
|
|
2065
|
+
index: n.index,
|
|
2066
|
+
value: n[0]
|
|
2067
|
+
} : null;
|
|
2068
|
+
}
|
|
2069
|
+
return u[t] ? [u[t]] : [];
|
|
2046
2070
|
});
|
|
2047
2071
|
e.sort((e, t) => e.index - t.index || e.value.length - t.value.length);
|
|
2048
2072
|
let r = e[0];
|
|
2049
2073
|
if (!r) break;
|
|
2050
|
-
let p = n + r.index,
|
|
2074
|
+
let p = n + r.index, ee = p + r.value.length;
|
|
2051
2075
|
for (; i[o]?.end <= p;) o++;
|
|
2052
2076
|
if (a.push({
|
|
2053
2077
|
start: p,
|
|
2054
|
-
end:
|
|
2078
|
+
end: ee,
|
|
2055
2079
|
markup: r.value,
|
|
2056
|
-
attribute: i[o] !== void 0 && p >= i[o].start &&
|
|
2057
|
-
}), f = r.index + r.value.length, s) for (let e = 0; e < l.length; e++) u[e] && u[e].index < f && (u[e] =
|
|
2080
|
+
attribute: i[o] !== void 0 && p >= i[o].start && ee <= i[o].end
|
|
2081
|
+
}), f = r.index + r.value.length, s) for (let e = 0; e < l.length; e++) u[e] && u[e].index < f && (u[e] = q(c, t, l[e], f, 1)[0]);
|
|
2058
2082
|
}
|
|
2059
2083
|
}, l = 0;
|
|
2060
2084
|
for (let e of r) c(l, e.start), l = e.end;
|
|
2061
2085
|
return c(l, e.length), a.sort((e, t) => e.start - t.start);
|
|
2062
2086
|
}
|
|
2063
|
-
function
|
|
2087
|
+
function qn(e) {
|
|
2064
2088
|
if (!e.includes("&")) return { text: e };
|
|
2065
2089
|
let t = "", n = [0], r = 0, i = (i) => {
|
|
2066
2090
|
for (t += e.slice(r, i); r < i;) n.push(++r);
|
|
2067
2091
|
};
|
|
2068
2092
|
for (let a of e.matchAll(/&(?:#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g)) {
|
|
2069
2093
|
i(a.index);
|
|
2070
|
-
let e =
|
|
2094
|
+
let e = W(a[0]);
|
|
2071
2095
|
t += e;
|
|
2072
2096
|
for (let t = 1; t < e.length; t++) n.push(-1);
|
|
2073
2097
|
r = a.index + a[0].length, n.push(r);
|
|
@@ -2077,17 +2101,17 @@ function Un(e) {
|
|
|
2077
2101
|
offsets: n
|
|
2078
2102
|
};
|
|
2079
2103
|
}
|
|
2080
|
-
var
|
|
2081
|
-
function
|
|
2082
|
-
let t = JSON.stringify(e), n =
|
|
2104
|
+
var J = /* @__PURE__ */ new Map(), Jn = 32;
|
|
2105
|
+
function Yn(e) {
|
|
2106
|
+
let t = JSON.stringify(e), n = J.get(t);
|
|
2083
2107
|
if (n === void 0) {
|
|
2084
2108
|
let r = e.map((e) => e.trim()).filter(Boolean).sort((e, t) => t.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
2085
|
-
n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null,
|
|
2109
|
+
n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null, J.size >= Jn && J.delete(J.keys().next().value), J.set(t, n);
|
|
2086
2110
|
}
|
|
2087
2111
|
return n;
|
|
2088
2112
|
}
|
|
2089
|
-
function
|
|
2090
|
-
let r = n.length ?
|
|
2113
|
+
function Xn(e, t, n) {
|
|
2114
|
+
let r = n.length ? Yn(n) : null;
|
|
2091
2115
|
if (!r) return [];
|
|
2092
2116
|
let i = [];
|
|
2093
2117
|
if (t === "text") i.push({
|
|
@@ -2096,7 +2120,7 @@ function Kn(e, t, n) {
|
|
|
2096
2120
|
attribute: !1
|
|
2097
2121
|
});
|
|
2098
2122
|
else {
|
|
2099
|
-
i.push(...
|
|
2123
|
+
i.push(...Gn(e).map((e) => ({
|
|
2100
2124
|
...e,
|
|
2101
2125
|
attribute: !0
|
|
2102
2126
|
})));
|
|
@@ -2107,7 +2131,7 @@ function Kn(e, t, n) {
|
|
|
2107
2131
|
end: r.index,
|
|
2108
2132
|
attribute: !1
|
|
2109
2133
|
});
|
|
2110
|
-
let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) :
|
|
2134
|
+
let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) : pn(e, t.lastIndex);
|
|
2111
2135
|
if (a < 0) return [];
|
|
2112
2136
|
n = a + (r[0] === "<!--" ? 3 : 1), t.lastIndex = n;
|
|
2113
2137
|
}
|
|
@@ -2120,7 +2144,7 @@ function Kn(e, t, n) {
|
|
|
2120
2144
|
let a = [];
|
|
2121
2145
|
for (let n of i) {
|
|
2122
2146
|
r.lastIndex = 0;
|
|
2123
|
-
let i = e.slice(n.start, n.end), o = t === "html" ?
|
|
2147
|
+
let i = e.slice(n.start, n.end), o = t === "html" ? qn(i) : {
|
|
2124
2148
|
text: i,
|
|
2125
2149
|
offsets: void 0
|
|
2126
2150
|
};
|
|
@@ -2139,53 +2163,53 @@ function Kn(e, t, n) {
|
|
|
2139
2163
|
}
|
|
2140
2164
|
return a;
|
|
2141
2165
|
}
|
|
2142
|
-
function
|
|
2143
|
-
let i =
|
|
2166
|
+
function Zn(e, t, n, r) {
|
|
2167
|
+
let i = Kn(e, t, n), a = Xn(e, n, r?.doNotTranslate ?? []).filter((e) => !i.some((t) => e.start < t.end && e.end > t.start));
|
|
2144
2168
|
return [...i, ...a].sort((e, t) => e.start - t.start);
|
|
2145
2169
|
}
|
|
2146
|
-
function
|
|
2170
|
+
function Qn(e, t, n) {
|
|
2147
2171
|
let r = "", i = 0;
|
|
2148
2172
|
return t.forEach((t, a) => {
|
|
2149
2173
|
r += e.slice(i, t.start), r += t.attribute ? `__x${n[a]}__` : `<x id="${n[a]}"/>`, i = t.end;
|
|
2150
2174
|
}), r + e.slice(i);
|
|
2151
2175
|
}
|
|
2152
|
-
function
|
|
2153
|
-
let i =
|
|
2176
|
+
function $n(e, t, n, r) {
|
|
2177
|
+
let i = Zn(e, t, n, r);
|
|
2154
2178
|
return {
|
|
2155
|
-
text:
|
|
2179
|
+
text: Qn(e, i, i.map((e, t) => t + 1)),
|
|
2156
2180
|
tokens: i.map((e) => e.markup)
|
|
2157
2181
|
};
|
|
2158
2182
|
}
|
|
2159
|
-
function
|
|
2183
|
+
function er(e, t) {
|
|
2160
2184
|
let n = /* @__PURE__ */ new Set(), r = !0, i = e.replace(/<x id="(\d+)"\s*\/>|<x id="(\d+)"><\/x>|__x(\d+)__/g, (e, i, a, o) => {
|
|
2161
2185
|
let s = Number(i ?? a ?? o);
|
|
2162
2186
|
return (s < 1 || s > t.length || n.has(s)) && (r = !1), n.add(s), t[s - 1] ?? "";
|
|
2163
2187
|
});
|
|
2164
2188
|
return r && n.size === t.length ? i : null;
|
|
2165
2189
|
}
|
|
2166
|
-
function
|
|
2167
|
-
let a =
|
|
2190
|
+
function tr(e, t, n, r, i) {
|
|
2191
|
+
let a = Zn(e, n, r, i), o = /* @__PURE__ */ new Set(), s = (e) => {
|
|
2168
2192
|
let n = t.findIndex((t, n) => !o.has(n) && e(t));
|
|
2169
2193
|
return n >= 0 && o.add(n), n;
|
|
2170
2194
|
}, c = a.map((e) => s((t) => t === e.markup));
|
|
2171
2195
|
return a.forEach((e, t) => {
|
|
2172
|
-
c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) =>
|
|
2173
|
-
}), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null :
|
|
2196
|
+
c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) => W(t) === e.term));
|
|
2197
|
+
}), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null : Qn(e, a.filter((e, t) => c[t] >= 0), c.filter((e) => e >= 0).map((e) => e + 1));
|
|
2174
2198
|
}
|
|
2175
|
-
function
|
|
2199
|
+
function nr(e, t, n = []) {
|
|
2176
2200
|
let r = /* @__PURE__ */ new Map();
|
|
2177
|
-
if (t ===
|
|
2201
|
+
if (t === C(e) || !e.settings.locales?.includes(t)) return r;
|
|
2178
2202
|
let i = (e, n, i, a) => {
|
|
2179
2203
|
let o = n.l10n?.[t];
|
|
2180
2204
|
for (let t of i) {
|
|
2181
|
-
let i =
|
|
2205
|
+
let i = y(n, t);
|
|
2182
2206
|
if (typeof i != "string" || i === "" || Object.keys(o?.set ?? {}).some((e) => e === t || t.startsWith(`${e}.`))) continue;
|
|
2183
2207
|
let s = e.kind === "block" ? e.blockId : "settings";
|
|
2184
2208
|
r.set(`${s}/${t}`, {
|
|
2185
2209
|
target: e,
|
|
2186
2210
|
path: t,
|
|
2187
2211
|
source: i,
|
|
2188
|
-
format: a &&
|
|
2212
|
+
format: a && Wn[a]?.includes(t) ? "html" : "text",
|
|
2189
2213
|
text: o?.text?.[t]
|
|
2190
2214
|
});
|
|
2191
2215
|
}
|
|
@@ -2194,22 +2218,22 @@ function Qn(e, t, n = []) {
|
|
|
2194
2218
|
if (r.type !== "html" && i({
|
|
2195
2219
|
kind: "block",
|
|
2196
2220
|
blockId: r.id
|
|
2197
|
-
}, r,
|
|
2221
|
+
}, r, x(r, n), r.type), r.type === "section") for (let e of r.children) a(e);
|
|
2198
2222
|
else r.type === "wrapper" && a(r.children);
|
|
2199
2223
|
}
|
|
2200
2224
|
};
|
|
2201
|
-
return a(e.blocks), i({ kind: "settings" }, e.settings,
|
|
2225
|
+
return a(e.blocks), i({ kind: "settings" }, e.settings, g), r;
|
|
2202
2226
|
}
|
|
2203
|
-
function
|
|
2204
|
-
let r = n.only === "all" ? null :
|
|
2205
|
-
for (let [r, s] of
|
|
2227
|
+
function rr(e, t, n) {
|
|
2228
|
+
let r = n.only === "all" ? null : Pe(e, t, n.definitions), i = r && /* @__PURE__ */ new Set([...r.missing, ...r.stale]), a = [], o = {};
|
|
2229
|
+
for (let [r, s] of nr(e, t, n.definitions)) {
|
|
2206
2230
|
if (i && !i.has(r) || n.blockId !== void 0 && (s.target.kind !== "block" || s.target.blockId !== n.blockId)) continue;
|
|
2207
|
-
let e =
|
|
2231
|
+
let e = $n(s.source, n.syntax, s.format, n), t = s.text ? tr(s.text.value, e.tokens, n.syntax, s.format, n) : void 0;
|
|
2208
2232
|
a.push({
|
|
2209
2233
|
id: r,
|
|
2210
2234
|
format: s.format,
|
|
2211
2235
|
source: e.text,
|
|
2212
|
-
sourceHash:
|
|
2236
|
+
sourceHash: S(s.source),
|
|
2213
2237
|
...t == null ? {} : { text: t }
|
|
2214
2238
|
}), o[r] = e.tokens;
|
|
2215
2239
|
}
|
|
@@ -2218,8 +2242,8 @@ function $n(e, t, n) {
|
|
|
2218
2242
|
tokens: o
|
|
2219
2243
|
};
|
|
2220
2244
|
}
|
|
2221
|
-
function
|
|
2222
|
-
let i =
|
|
2245
|
+
function ir(e, t, n, r) {
|
|
2246
|
+
let i = nr(e, t, r.definitions), a = /* @__PURE__ */ new Map(), o = (e) => {
|
|
2223
2247
|
for (let t of e) if (a.set(t.id, t), t.type === "section") for (let e of t.children) o(e);
|
|
2224
2248
|
else t.type === "wrapper" && o(t.children);
|
|
2225
2249
|
};
|
|
@@ -2231,12 +2255,12 @@ function er(e, t, n, r) {
|
|
|
2231
2255
|
let n = t.id.lastIndexOf("/"), r = t.id.slice(0, n), i = r === "settings" ? [a.get(r), e.settings] : [a.get(r)];
|
|
2232
2256
|
l.push({
|
|
2233
2257
|
id: t.id,
|
|
2234
|
-
reason: n < 0 || !i.some((e) => e &&
|
|
2258
|
+
reason: n < 0 || !i.some((e) => e && y(e, t.id.slice(n + 1)) !== void 0) ? "unknown_field" : "not_translatable"
|
|
2235
2259
|
});
|
|
2236
2260
|
continue;
|
|
2237
2261
|
}
|
|
2238
|
-
let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ?
|
|
2239
|
-
if (!o || u === null ||
|
|
2262
|
+
let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ? er(t.text, o) : null;
|
|
2263
|
+
if (!o || u === null || tr(u, o, r.syntax, n.format, r) === null) {
|
|
2240
2264
|
l.push({
|
|
2241
2265
|
id: t.id,
|
|
2242
2266
|
reason: "tags_changed"
|
|
@@ -2265,25 +2289,28 @@ function er(e, t, n, r) {
|
|
|
2265
2289
|
rejected: l
|
|
2266
2290
|
};
|
|
2267
2291
|
}
|
|
2268
|
-
|
|
2292
|
+
var ar = 1e7, or = 2e3;
|
|
2293
|
+
function sr(e) {
|
|
2269
2294
|
return new e.Liquid({
|
|
2270
2295
|
strictVariables: !1,
|
|
2271
2296
|
strictFilters: !1,
|
|
2272
2297
|
outputEscape: "escape",
|
|
2298
|
+
memoryLimit: ar,
|
|
2299
|
+
renderLimit: or,
|
|
2273
2300
|
templates: {}
|
|
2274
2301
|
});
|
|
2275
2302
|
}
|
|
2276
|
-
function
|
|
2277
|
-
let n =
|
|
2278
|
-
return !t || Object.keys(t).length === 0 ? n :
|
|
2303
|
+
function Y(e, t) {
|
|
2304
|
+
let n = m(e);
|
|
2305
|
+
return !t || Object.keys(t).length === 0 ? n : on(n, t);
|
|
2279
2306
|
}
|
|
2280
|
-
function
|
|
2281
|
-
return e === void 0 ? void 0 :
|
|
2307
|
+
function X(e) {
|
|
2308
|
+
return e === void 0 ? void 0 : m(e);
|
|
2282
2309
|
}
|
|
2283
|
-
function
|
|
2310
|
+
function Z() {
|
|
2284
2311
|
return crypto.randomUUID();
|
|
2285
2312
|
}
|
|
2286
|
-
function
|
|
2313
|
+
function cr(e = 0) {
|
|
2287
2314
|
return {
|
|
2288
2315
|
top: e,
|
|
2289
2316
|
right: e,
|
|
@@ -2291,135 +2318,135 @@ function nr(e = 0) {
|
|
|
2291
2318
|
left: e
|
|
2292
2319
|
};
|
|
2293
2320
|
}
|
|
2294
|
-
function
|
|
2295
|
-
return { padding:
|
|
2321
|
+
function Q(e = 10) {
|
|
2322
|
+
return { padding: cr(e) };
|
|
2296
2323
|
}
|
|
2297
|
-
function
|
|
2298
|
-
return
|
|
2299
|
-
id:
|
|
2324
|
+
function lr(e = {}) {
|
|
2325
|
+
return Y({
|
|
2326
|
+
id: Z(),
|
|
2300
2327
|
type: "title",
|
|
2301
|
-
...
|
|
2302
|
-
styles:
|
|
2328
|
+
...Ut,
|
|
2329
|
+
styles: Q()
|
|
2303
2330
|
}, e);
|
|
2304
2331
|
}
|
|
2305
|
-
function
|
|
2306
|
-
return
|
|
2307
|
-
id:
|
|
2332
|
+
function ur(e = {}) {
|
|
2333
|
+
return Y({
|
|
2334
|
+
id: Z(),
|
|
2308
2335
|
type: "paragraph",
|
|
2309
|
-
...
|
|
2310
|
-
styles:
|
|
2336
|
+
...Wt,
|
|
2337
|
+
styles: Q()
|
|
2311
2338
|
}, e);
|
|
2312
2339
|
}
|
|
2313
|
-
function
|
|
2314
|
-
return
|
|
2315
|
-
id:
|
|
2340
|
+
function dr(e = {}) {
|
|
2341
|
+
return Y({
|
|
2342
|
+
id: Z(),
|
|
2316
2343
|
type: "image",
|
|
2317
|
-
...
|
|
2318
|
-
styles:
|
|
2344
|
+
...Gt,
|
|
2345
|
+
styles: Q()
|
|
2319
2346
|
}, e);
|
|
2320
2347
|
}
|
|
2321
|
-
function
|
|
2322
|
-
return
|
|
2323
|
-
id:
|
|
2348
|
+
function fr(e = {}) {
|
|
2349
|
+
return Y({
|
|
2350
|
+
id: Z(),
|
|
2324
2351
|
type: "button",
|
|
2325
|
-
...
|
|
2326
|
-
styles:
|
|
2352
|
+
...Kt,
|
|
2353
|
+
styles: Q()
|
|
2327
2354
|
}, e);
|
|
2328
2355
|
}
|
|
2329
|
-
function
|
|
2330
|
-
return
|
|
2331
|
-
id:
|
|
2356
|
+
function pr(e = {}) {
|
|
2357
|
+
return Y({
|
|
2358
|
+
id: Z(),
|
|
2332
2359
|
type: "divider",
|
|
2333
|
-
...
|
|
2334
|
-
styles:
|
|
2360
|
+
...qt,
|
|
2361
|
+
styles: Q(20)
|
|
2335
2362
|
}, e);
|
|
2336
2363
|
}
|
|
2337
|
-
function
|
|
2338
|
-
return
|
|
2339
|
-
id:
|
|
2364
|
+
function mr(e = {}) {
|
|
2365
|
+
return Y({
|
|
2366
|
+
id: Z(),
|
|
2340
2367
|
type: "section",
|
|
2341
|
-
...
|
|
2368
|
+
...Jt,
|
|
2342
2369
|
children: [[]],
|
|
2343
|
-
styles:
|
|
2370
|
+
styles: Q(20)
|
|
2344
2371
|
}, e);
|
|
2345
2372
|
}
|
|
2346
|
-
function
|
|
2347
|
-
return
|
|
2348
|
-
id:
|
|
2373
|
+
function hr(e = {}) {
|
|
2374
|
+
return Y({
|
|
2375
|
+
id: Z(),
|
|
2349
2376
|
type: "video",
|
|
2350
|
-
...
|
|
2351
|
-
styles:
|
|
2377
|
+
...Yt,
|
|
2378
|
+
styles: Q()
|
|
2352
2379
|
}, e);
|
|
2353
2380
|
}
|
|
2354
|
-
function
|
|
2355
|
-
return
|
|
2356
|
-
id:
|
|
2381
|
+
function gr(e = {}) {
|
|
2382
|
+
return Y({
|
|
2383
|
+
id: Z(),
|
|
2357
2384
|
type: "social",
|
|
2358
2385
|
icons: [],
|
|
2359
|
-
...
|
|
2360
|
-
styles:
|
|
2386
|
+
...Xt,
|
|
2387
|
+
styles: Q()
|
|
2361
2388
|
}, e);
|
|
2362
2389
|
}
|
|
2363
|
-
function
|
|
2364
|
-
return
|
|
2365
|
-
id:
|
|
2390
|
+
function _r(e = {}) {
|
|
2391
|
+
return Y({
|
|
2392
|
+
id: Z(),
|
|
2366
2393
|
type: "spacer",
|
|
2367
|
-
...
|
|
2368
|
-
styles:
|
|
2394
|
+
...Zt,
|
|
2395
|
+
styles: Q(0)
|
|
2369
2396
|
}, e);
|
|
2370
2397
|
}
|
|
2371
|
-
function
|
|
2372
|
-
return
|
|
2373
|
-
id:
|
|
2398
|
+
function vr(e = {}) {
|
|
2399
|
+
return Y({
|
|
2400
|
+
id: Z(),
|
|
2374
2401
|
type: "html",
|
|
2375
|
-
...
|
|
2376
|
-
styles:
|
|
2402
|
+
...Qt,
|
|
2403
|
+
styles: Q()
|
|
2377
2404
|
}, e);
|
|
2378
2405
|
}
|
|
2379
|
-
function
|
|
2380
|
-
return
|
|
2381
|
-
id:
|
|
2406
|
+
function yr(e = {}) {
|
|
2407
|
+
return Y({
|
|
2408
|
+
id: Z(),
|
|
2382
2409
|
type: "menu",
|
|
2383
2410
|
items: [],
|
|
2384
|
-
|
|
2385
|
-
styles:
|
|
2411
|
+
...$t,
|
|
2412
|
+
styles: Q()
|
|
2386
2413
|
}, e);
|
|
2387
2414
|
}
|
|
2388
|
-
function
|
|
2415
|
+
function br(e, t) {
|
|
2389
2416
|
return Array.from({ length: t }, () => ({
|
|
2390
|
-
id:
|
|
2417
|
+
id: Z(),
|
|
2391
2418
|
cells: Array.from({ length: e }, () => ({
|
|
2392
|
-
id:
|
|
2419
|
+
id: Z(),
|
|
2393
2420
|
content: ""
|
|
2394
2421
|
}))
|
|
2395
2422
|
}));
|
|
2396
2423
|
}
|
|
2397
|
-
function
|
|
2398
|
-
return
|
|
2399
|
-
id:
|
|
2424
|
+
function xr(e = {}) {
|
|
2425
|
+
return Y({
|
|
2426
|
+
id: Z(),
|
|
2400
2427
|
type: "table",
|
|
2401
|
-
rows:
|
|
2402
|
-
...
|
|
2403
|
-
styles:
|
|
2428
|
+
rows: br(3, 3),
|
|
2429
|
+
...en,
|
|
2430
|
+
styles: Q()
|
|
2404
2431
|
}, e);
|
|
2405
2432
|
}
|
|
2406
|
-
function
|
|
2407
|
-
return
|
|
2408
|
-
id:
|
|
2433
|
+
function Sr(e = {}) {
|
|
2434
|
+
return Y({
|
|
2435
|
+
id: Z(),
|
|
2409
2436
|
type: "countdown",
|
|
2410
|
-
...
|
|
2411
|
-
styles:
|
|
2437
|
+
...tn,
|
|
2438
|
+
styles: Q()
|
|
2412
2439
|
}, e);
|
|
2413
2440
|
}
|
|
2414
|
-
function
|
|
2441
|
+
function Cr(e) {
|
|
2415
2442
|
return e.type === "repeatable" ? e.default ?? [] : e.type === "boolean" ? e.default ?? !1 : e.type === "number" ? e.default ?? 0 : e.default ?? "";
|
|
2416
2443
|
}
|
|
2417
|
-
function
|
|
2444
|
+
function wr(e) {
|
|
2418
2445
|
let t = {};
|
|
2419
|
-
for (let n of e.fields) t[n.key] =
|
|
2420
|
-
let n =
|
|
2446
|
+
for (let n of e.fields) t[n.key] = X(Cr(n));
|
|
2447
|
+
let n = Y(Q(), X(e.defaultStyles));
|
|
2421
2448
|
return {
|
|
2422
|
-
id:
|
|
2449
|
+
id: Z(),
|
|
2423
2450
|
type: "custom",
|
|
2424
2451
|
customType: e.type,
|
|
2425
2452
|
fieldValues: t,
|
|
@@ -2427,42 +2454,42 @@ function vr(e) {
|
|
|
2427
2454
|
...e.dataSource ? { dataSourceFetched: !1 } : {}
|
|
2428
2455
|
};
|
|
2429
2456
|
}
|
|
2430
|
-
function
|
|
2457
|
+
function Tr() {
|
|
2431
2458
|
return {
|
|
2432
|
-
id:
|
|
2459
|
+
id: Z(),
|
|
2433
2460
|
type: "slot",
|
|
2434
|
-
styles:
|
|
2461
|
+
styles: Q(0)
|
|
2435
2462
|
};
|
|
2436
2463
|
}
|
|
2437
|
-
function
|
|
2438
|
-
return
|
|
2439
|
-
id:
|
|
2464
|
+
function Er(e = {}) {
|
|
2465
|
+
return Y({
|
|
2466
|
+
id: Z(),
|
|
2440
2467
|
type: "wrapper",
|
|
2441
2468
|
children: [],
|
|
2442
|
-
styles:
|
|
2469
|
+
styles: Q(0)
|
|
2443
2470
|
}, e);
|
|
2444
2471
|
}
|
|
2445
|
-
function
|
|
2472
|
+
function Dr(e, t) {
|
|
2446
2473
|
switch (e) {
|
|
2447
|
-
case "section": return
|
|
2448
|
-
case "title": return
|
|
2449
|
-
case "paragraph": return
|
|
2450
|
-
case "image": return
|
|
2451
|
-
case "button": return
|
|
2452
|
-
case "divider": return
|
|
2453
|
-
case "video": return
|
|
2454
|
-
case "social": return
|
|
2455
|
-
case "spacer": return
|
|
2456
|
-
case "html": return
|
|
2457
|
-
case "menu": return
|
|
2458
|
-
case "table": return
|
|
2459
|
-
case "countdown": return
|
|
2474
|
+
case "section": return mr(X(t?.section));
|
|
2475
|
+
case "title": return lr(X(t?.title));
|
|
2476
|
+
case "paragraph": return ur(X(t?.paragraph));
|
|
2477
|
+
case "image": return dr(X(t?.image));
|
|
2478
|
+
case "button": return fr(X(t?.button));
|
|
2479
|
+
case "divider": return pr(X(t?.divider));
|
|
2480
|
+
case "video": return hr(X(t?.video));
|
|
2481
|
+
case "social": return gr(X(t?.social));
|
|
2482
|
+
case "spacer": return _r(X(t?.spacer));
|
|
2483
|
+
case "html": return vr(X(t?.html));
|
|
2484
|
+
case "menu": return yr(X(t?.menu));
|
|
2485
|
+
case "table": return xr(X(t?.table));
|
|
2486
|
+
case "countdown": return Sr(X(t?.countdown));
|
|
2460
2487
|
case "slot": throw Error("[Templatical] slot cannot be inserted into content. Use createSlotBlock() to build a layout.");
|
|
2461
2488
|
case "wrapper": throw Error("[Templatical] wrapper cannot be inserted into content. Use createWrapperBlock() to build a layout.");
|
|
2462
2489
|
default: throw Error(`Unknown block type: ${e}`);
|
|
2463
2490
|
}
|
|
2464
2491
|
}
|
|
2465
|
-
function
|
|
2492
|
+
function Or(e, t) {
|
|
2466
2493
|
let n = e.l10n;
|
|
2467
2494
|
if (!n || t.size === 0) return;
|
|
2468
2495
|
let r = (n) => {
|
|
@@ -2477,99 +2504,104 @@ function Sr(e, t) {
|
|
|
2477
2504
|
n && (e[t] = Object.fromEntries(Object.entries(n).map(([e, t]) => [r(e), t])));
|
|
2478
2505
|
}
|
|
2479
2506
|
}
|
|
2480
|
-
function
|
|
2481
|
-
let t = JSON.parse(JSON.stringify(e))
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2507
|
+
function kr(e) {
|
|
2508
|
+
let t = JSON.parse(JSON.stringify(e)), n = (e) => {
|
|
2509
|
+
e.id = Z();
|
|
2510
|
+
let t = /* @__PURE__ */ new Map(), r = (e, n) => {
|
|
2511
|
+
let r = e.id;
|
|
2512
|
+
e.id = Z();
|
|
2513
|
+
let i = t.get(n);
|
|
2514
|
+
return i || (i = /* @__PURE__ */ new Map(), t.set(n, i)), i.set(r, e.id), r;
|
|
2515
|
+
};
|
|
2516
|
+
if (e.type === "table") for (let t of e.rows) {
|
|
2517
|
+
let e = r(t, "rows");
|
|
2518
|
+
for (let n of t.cells) r(n, `rows.${e}.cells`);
|
|
2519
|
+
}
|
|
2520
|
+
if (e.type === "menu") for (let t of e.items) r(t, "items");
|
|
2521
|
+
if (e.type === "social") for (let t of e.icons) r(t, "icons");
|
|
2522
|
+
if (e.type === "section") for (let t of e.children) for (let e of t) n(e);
|
|
2523
|
+
if (e.type === "wrapper") for (let t of e.children) n(t);
|
|
2524
|
+
Or(e, t);
|
|
2488
2525
|
};
|
|
2489
|
-
|
|
2490
|
-
let t = r(e, "rows");
|
|
2491
|
-
for (let n of e.cells) r(n, `rows.${t}.cells`);
|
|
2492
|
-
}
|
|
2493
|
-
if (t.type === "menu") for (let e of t.items) r(e, "items");
|
|
2494
|
-
if (t.type === "social") for (let e of t.icons) r(e, "icons");
|
|
2495
|
-
return t.type === "section" && (t.children = t.children.map((e) => e.map((e) => Q(e)))), t.type === "wrapper" && (t.children = t.children.map((e) => Q(e))), Sr(t, n), t;
|
|
2526
|
+
return n(t), t;
|
|
2496
2527
|
}
|
|
2497
|
-
var
|
|
2498
|
-
function $(e, t, n = null, r = !1) {
|
|
2499
|
-
for (let
|
|
2500
|
-
else
|
|
2528
|
+
var Ar = "[Templatical] layout: must contain exactly one slot block", jr = "[Templatical] layout: slot must be a top-level or wrapper child, not nested in a section", Mr = "[Templatical] layout: a wrapper cannot contain a wrapper", Nr = "[Templatical] layout: a wrapper around the slot cannot contain blocks that emit mj-wrapper (section.wrapper)", Pr = "[Templatical] slot is not a valid content block", Fr = "[Templatical] layout: a wrapper cannot contain a section with its own wrapper (section.wrapper)", Ir = "[Templatical] wrapper is not a valid content block";
|
|
2529
|
+
function $(e, t, n = null, r = !1, i = !1) {
|
|
2530
|
+
for (let a of e) if (t(a, n, r, i), B(a)) for (let e of a.children) $(e, t, a, !0, i);
|
|
2531
|
+
else H(a) && $(a.children, t, a, r, !0);
|
|
2501
2532
|
}
|
|
2502
|
-
function
|
|
2533
|
+
function Lr(e) {
|
|
2503
2534
|
let t = 0;
|
|
2504
|
-
if ($(e.blocks, (e, n, r) => {
|
|
2505
|
-
if (B(e) &&
|
|
2506
|
-
if (V(e))
|
|
2507
|
-
|
|
2508
|
-
if (
|
|
2535
|
+
if ($(e.blocks, (e, n, r, i) => {
|
|
2536
|
+
if (i && B(e) && e.wrapper) throw Error(Fr);
|
|
2537
|
+
if (V(e) && (t += 1, r)) throw Error(jr);
|
|
2538
|
+
if (H(e)) {
|
|
2539
|
+
if (r) throw Error(jr);
|
|
2540
|
+
if (e.children.some(H)) throw Error(Mr);
|
|
2509
2541
|
}
|
|
2510
|
-
}), t !== 1) throw Error(
|
|
2542
|
+
}), t !== 1) throw Error(Ar);
|
|
2511
2543
|
}
|
|
2512
|
-
function
|
|
2544
|
+
function Rr(e) {
|
|
2513
2545
|
$(e.blocks, (e) => {
|
|
2514
|
-
if (
|
|
2546
|
+
if (V(e)) throw Error(Pr);
|
|
2515
2547
|
});
|
|
2516
2548
|
}
|
|
2517
|
-
function
|
|
2549
|
+
function zr(e) {
|
|
2518
2550
|
$(e.blocks, (e) => {
|
|
2519
|
-
if (
|
|
2551
|
+
if (H(e)) throw Error(Ir);
|
|
2520
2552
|
});
|
|
2521
2553
|
}
|
|
2522
|
-
function
|
|
2554
|
+
function Br(e) {
|
|
2523
2555
|
let t = !1;
|
|
2524
2556
|
return $(e.blocks, (e, n) => {
|
|
2525
|
-
|
|
2557
|
+
V(e) && n !== null && H(n) && (t = !0);
|
|
2526
2558
|
}), t;
|
|
2527
2559
|
}
|
|
2528
|
-
function
|
|
2529
|
-
if (
|
|
2530
|
-
if (
|
|
2531
|
-
let t =
|
|
2560
|
+
function Vr(e) {
|
|
2561
|
+
if (V(e)) return e;
|
|
2562
|
+
if (H(e)) {
|
|
2563
|
+
let t = kr({
|
|
2532
2564
|
...e,
|
|
2533
2565
|
children: []
|
|
2534
2566
|
});
|
|
2535
|
-
return t.children = e.children.map(
|
|
2567
|
+
return t.children = e.children.map(Vr), t;
|
|
2536
2568
|
}
|
|
2537
|
-
return
|
|
2569
|
+
return kr(e);
|
|
2538
2570
|
}
|
|
2539
|
-
function
|
|
2571
|
+
function Hr(e) {
|
|
2540
2572
|
for (let t = 0; t < e.length; t++) {
|
|
2541
2573
|
let n = e[t];
|
|
2542
|
-
if (
|
|
2574
|
+
if (V(n)) return {
|
|
2543
2575
|
parent: e,
|
|
2544
2576
|
index: t
|
|
2545
2577
|
};
|
|
2546
|
-
if (
|
|
2547
|
-
let e =
|
|
2578
|
+
if (H(n)) {
|
|
2579
|
+
let e = Hr(n.children);
|
|
2548
2580
|
if (e) return e;
|
|
2549
2581
|
}
|
|
2550
2582
|
}
|
|
2551
2583
|
return null;
|
|
2552
2584
|
}
|
|
2553
|
-
function
|
|
2554
|
-
for (let t of e) if (
|
|
2585
|
+
function Ur(e) {
|
|
2586
|
+
for (let t of e) if (B(t)) {
|
|
2555
2587
|
if (t.wrapper) return !0;
|
|
2556
|
-
for (let e of t.children) if (
|
|
2588
|
+
for (let e of t.children) if (Ur(e)) return !0;
|
|
2557
2589
|
}
|
|
2558
2590
|
return !1;
|
|
2559
2591
|
}
|
|
2560
|
-
function
|
|
2561
|
-
if (
|
|
2562
|
-
let n = e.blocks.map(
|
|
2563
|
-
if (!r) throw Error(
|
|
2564
|
-
return r.parent.splice(r.index, 1, ...
|
|
2592
|
+
function Wr(e, t) {
|
|
2593
|
+
if (Lr(e), Rr(t), zr(t), Br(e) && Ur(t.blocks)) throw Error(Nr);
|
|
2594
|
+
let n = e.blocks.map(Vr), r = Hr(n);
|
|
2595
|
+
if (!r) throw Error(Ar);
|
|
2596
|
+
return r.parent.splice(r.index, 1, ...m(t.blocks)), {
|
|
2565
2597
|
blocks: n,
|
|
2566
2598
|
settings: {
|
|
2567
|
-
...
|
|
2599
|
+
...m(t.settings),
|
|
2568
2600
|
backgroundColor: e.settings.backgroundColor
|
|
2569
2601
|
}
|
|
2570
2602
|
};
|
|
2571
2603
|
}
|
|
2572
|
-
var
|
|
2604
|
+
var Gr = Object.freeze([
|
|
2573
2605
|
"http",
|
|
2574
2606
|
"https",
|
|
2575
2607
|
"mailto",
|
|
@@ -2585,37 +2617,37 @@ Object.freeze([
|
|
|
2585
2617
|
"data",
|
|
2586
2618
|
"vbscript"
|
|
2587
2619
|
]);
|
|
2588
|
-
function
|
|
2620
|
+
function Kr(e) {
|
|
2589
2621
|
return e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
|
|
2590
2622
|
}
|
|
2591
|
-
function
|
|
2592
|
-
let t = /^([a-z][a-z0-9+.-]*):/i.exec(
|
|
2623
|
+
function qr(e) {
|
|
2624
|
+
let t = /^([a-z][a-z0-9+.-]*):/i.exec(Kr(e));
|
|
2593
2625
|
return t ? t[1].toLowerCase() : null;
|
|
2594
2626
|
}
|
|
2595
|
-
var
|
|
2627
|
+
var Jr = /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i, Yr = Object.freeze([
|
|
2596
2628
|
"href",
|
|
2597
2629
|
"xlink:href",
|
|
2598
2630
|
"background",
|
|
2599
2631
|
"poster",
|
|
2600
2632
|
"src"
|
|
2601
|
-
]),
|
|
2633
|
+
]), Xr = Object.freeze([
|
|
2602
2634
|
"srcdoc",
|
|
2603
2635
|
"ping",
|
|
2604
2636
|
"formaction",
|
|
2605
2637
|
"action"
|
|
2606
2638
|
]);
|
|
2607
|
-
function
|
|
2608
|
-
let n =
|
|
2609
|
-
return r === null ||
|
|
2639
|
+
function Zr(e, t) {
|
|
2640
|
+
let n = Kr(e), r = qr(n);
|
|
2641
|
+
return r === null || Gr.some((e) => e === r) ? !0 : t.toLowerCase() === "src" && Jr.test(n);
|
|
2610
2642
|
}
|
|
2611
|
-
var
|
|
2612
|
-
function
|
|
2613
|
-
return e.replace(
|
|
2643
|
+
var Qr = /<\/?p\b[^<>]*>/gi, $r = /<p\b([^<>]*)>\s*<\/p>/gi;
|
|
2644
|
+
function ei(e) {
|
|
2645
|
+
return e.replace(Qr, "").trim() === "";
|
|
2614
2646
|
}
|
|
2615
|
-
function
|
|
2616
|
-
return
|
|
2647
|
+
function ti(e) {
|
|
2648
|
+
return ei(e) ? e : e.replace($r, "<p$1> </p>");
|
|
2617
2649
|
}
|
|
2618
|
-
var
|
|
2650
|
+
var ni = {
|
|
2619
2651
|
arial: "Arial, sans-serif",
|
|
2620
2652
|
helvetica: "Helvetica, sans-serif",
|
|
2621
2653
|
georgia: "Georgia, serif",
|
|
@@ -2624,13 +2656,13 @@ var Jr = {
|
|
|
2624
2656
|
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
2625
2657
|
"courier new": "'Courier New', monospace",
|
|
2626
2658
|
tahoma: "Tahoma, sans-serif"
|
|
2627
|
-
},
|
|
2659
|
+
}, ri = /* @__PURE__ */ new Set([
|
|
2628
2660
|
"inherit",
|
|
2629
2661
|
"initial",
|
|
2630
2662
|
"unset",
|
|
2631
2663
|
"revert",
|
|
2632
2664
|
"revert-layer"
|
|
2633
|
-
]),
|
|
2665
|
+
]), ii = /* @__PURE__ */ new Set([
|
|
2634
2666
|
"serif",
|
|
2635
2667
|
"sans-serif",
|
|
2636
2668
|
"monospace",
|
|
@@ -2645,14 +2677,14 @@ var Jr = {
|
|
|
2645
2677
|
"math",
|
|
2646
2678
|
"fangsong"
|
|
2647
2679
|
]);
|
|
2648
|
-
function
|
|
2680
|
+
function ai(e) {
|
|
2649
2681
|
return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
|
|
2650
2682
|
}
|
|
2651
|
-
function
|
|
2683
|
+
function oi(e) {
|
|
2652
2684
|
if (typeof e != "string") return [];
|
|
2653
2685
|
let t = e.replace(/!\s*important\s*$/i, ""), n = [], r = 0;
|
|
2654
2686
|
for (;;) {
|
|
2655
|
-
for (; r < t.length &&
|
|
2687
|
+
for (; r < t.length && ai(t[r]);) r++;
|
|
2656
2688
|
if (r >= t.length) return [];
|
|
2657
2689
|
let e = t[r];
|
|
2658
2690
|
if (e === "\"" || e === "'") {
|
|
@@ -2669,7 +2701,7 @@ function Qr(e) {
|
|
|
2669
2701
|
}
|
|
2670
2702
|
}
|
|
2671
2703
|
if (!o) return [];
|
|
2672
|
-
for (; a < t.length &&
|
|
2704
|
+
for (; a < t.length && ai(t[a]);) a++;
|
|
2673
2705
|
if (a < t.length && t[a] !== ",") return [];
|
|
2674
2706
|
n.push({
|
|
2675
2707
|
name: i,
|
|
@@ -2677,7 +2709,7 @@ function Qr(e) {
|
|
|
2677
2709
|
}), r = a;
|
|
2678
2710
|
} else {
|
|
2679
2711
|
let e = t.indexOf(",", r), i = e === -1 ? t.length : e, a = t.slice(r, i).trim().split(/\s+/).join(" ");
|
|
2680
|
-
if (a === "" || a.includes("\"") || a.includes("'") ||
|
|
2712
|
+
if (a === "" || a.includes("\"") || a.includes("'") || ri.has(a.toLowerCase())) return [];
|
|
2681
2713
|
n.push({
|
|
2682
2714
|
name: a,
|
|
2683
2715
|
quoted: !1
|
|
@@ -2687,26 +2719,26 @@ function Qr(e) {
|
|
|
2687
2719
|
r++;
|
|
2688
2720
|
}
|
|
2689
2721
|
}
|
|
2690
|
-
function
|
|
2722
|
+
function si(e) {
|
|
2691
2723
|
return `'${e.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
|
|
2692
2724
|
}
|
|
2693
|
-
function
|
|
2694
|
-
return !e.quoted &&
|
|
2725
|
+
function ci(e) {
|
|
2726
|
+
return !e.quoted && ii.has(e.name.toLowerCase());
|
|
2695
2727
|
}
|
|
2696
|
-
function
|
|
2697
|
-
return
|
|
2728
|
+
function li(e) {
|
|
2729
|
+
return oi(e)[0]?.name ?? "";
|
|
2698
2730
|
}
|
|
2699
|
-
function
|
|
2700
|
-
let n = (e) => `${
|
|
2731
|
+
function ui(e, t) {
|
|
2732
|
+
let n = (e) => `${si(e.name)}, ${e.fallback ?? t.defaultFallback}`, r = typeof e == "string" ? e.trim().toLowerCase() : "", i = t.customFonts.find((e) => e.name.toLowerCase() === r);
|
|
2701
2733
|
if (i) return n(i);
|
|
2702
|
-
let a =
|
|
2734
|
+
let a = oi(e);
|
|
2703
2735
|
if (a.length !== 1) return e;
|
|
2704
2736
|
let [o] = a, s = o.name.toLowerCase(), c = t.customFonts.find((e) => e.name.toLowerCase() === s);
|
|
2705
|
-
return c ? n(c) :
|
|
2737
|
+
return c ? n(c) : ni[s] || (ci(o) ? e : `${si(o.name)}, ${t.defaultFallback}`);
|
|
2706
2738
|
}
|
|
2707
|
-
function
|
|
2739
|
+
function di(e) {
|
|
2708
2740
|
if (typeof e != "object" || !e) return !1;
|
|
2709
2741
|
let t = e;
|
|
2710
2742
|
return Array.isArray(t.blocks);
|
|
2711
2743
|
}
|
|
2712
|
-
export {
|
|
2744
|
+
export { W as $, fe as $t, kr as A, H as At, vr as B, vn as Bt, ir as C, di as Ct, zr as D, V as Dt, Rr as E, B as Et, Sr as F, Oe as Ft, Be as G, Hn as Gt, yr as H, un as Ht, wr as I, oi as It, _r as J, kn as Jt, Tr as K, Nn as Kt, sr as L, xe as Lt, ee as M, Pe as Mt, Dr as N, Fe as Nt, j as O, Se as Ot, fr as P, rr as Pt, Er as Q, ue as Qt, sn as R, Ce as Rt, Wr as S, jn as St, T, v as Tt, ur as U, ui as Ut, dr as V, ne as Vt, mr as W, ie as Wt, lr as X, wn as Xt, xr as Y, m as Yt, hr as Z, q as Zt, G as _, oe as _t, l as a, r as an, qr as at, Wn as b, _e as bt, rn as c, t as cn, li as ct, Yr as d, Vn as dt, de as en, h as et, w as f, Mn as ft, se as g, In as gt, g as h, Dn as ht, e as i, n as in, te as it, zn as j, Br as jt, K as k, Te as kt, s as l, er as ln, Z as lt, Gr as m, On as mt, p as n, Fn as nn, Ie as nt, Vt as o, o as on, ti as ot, u as p, Pn as pt, gr as q, Ne as qt, i as r, Ln as rn, C as rt, nn as s, x as sn, pn as st, f as t, S as tn, on as tt, Xr as u, Lr as un, Ve as ut, he as v, zt as vt, He as w, Zr as wt, dn as x, Bn as xt, c as y, Ht as yt, pr as z, y as zt };
|