@templatical/editor 0.54.2 → 0.56.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AiAltTextPopover-BBKVJ6HA.js → AiAltTextPopover-DdsvhE78.js} +4 -4
- package/dist/{AiAltTextReview-BuVbeQh-.js → AiAltTextReview-P6to1_0t.js} +3 -3
- package/dist/{AiChatPanel-C8SeEJRP.js → AiChatPanel-BSlmzMRC.js} +10 -10
- package/dist/{AiPanels-CR6zphjP.js → AiPanels-DAsnX-a3.js} +1 -1
- package/dist/{AiRewriteMenu-ZpYJfm-O.js → AiRewriteMenu-DIISOR6U.js} +11 -11
- package/dist/{BlockIssueBadge-DaPTq1RE.js → BlockIssueBadge-Bmtc50BQ.js} +4 -4
- package/dist/BlockPreviewCanvas-BYIzNn-9.js +154 -0
- package/dist/{CloudHeaderExtras-XpjJjn3o.js → CloudHeaderExtras-Cqhw-jMz.js} +1 -1
- package/dist/{CloudPanels-DQRWMc59.js → CloudPanels-w34W8_BP.js} +4 -4
- package/dist/{CollaborationNotices-Cnx0XHzZ.js → CollaborationNotices-HTbCebjV.js} +2 -2
- package/dist/{CollaboratorBar-BaBoNhwB.js → CollaboratorBar-CLQjksX-.js} +2 -2
- package/dist/{CommentsPanel-Ck3QmqiC.js → CommentsPanel-C5qG17Ki.js} +1 -1
- package/dist/{CommentsSidebar-CHknhOar.js → CommentsSidebar-C7CWcUYZ.js} +12 -12
- package/dist/{CountdownBlock-BMezkFbJ.js → CountdownBlock-BTXcCvjZ.js} +2 -2
- package/dist/{CountdownToolbar-DTpMEDyh.js → CountdownToolbar-CP-pkntQ.js} +5 -5
- package/dist/{IssuesPanel-BZn7-p9e.js → IssuesPanel-CiiNBzH0.js} +12 -12
- package/dist/{LanguageMenu-OOmQWVzO.js → LanguageMenu-B981Av-6.js} +15 -15
- package/dist/{LocaleNotices-WzsYtBRs.js → LocaleNotices-CTCZ7BYv.js} +4 -4
- package/dist/{LogicTagInsertButton-XESwnJia.js → LogicTagInsertButton-DEOPc4RC.js} +284 -279
- package/dist/{MediaEditModal-C3U9Mi31.js → MediaEditModal-DJsPLTwP.js} +1 -1
- package/dist/{MediaPanels-CGmk9ufe.js → MediaPanels-D2WD2aE2.js} +1 -1
- package/dist/{MergeTagInput-CAsBRoSm.js → MergeTagInput-C9icdxw7.js} +1 -1
- package/dist/{MergeTagModeToggle-bOf27Hg1.js → MergeTagModeToggle-DXvb80OE.js} +6 -6
- package/dist/{MergeTagTextarea-DH_6JFui.js → MergeTagTextarea-CrAcmT3A.js} +5 -5
- package/dist/{ParagraphEditor-XGUkV5Uw.js → ParagraphEditor-BWBQ3jKz.js} +55 -55
- package/dist/{RestoreVersionDialog-C72kWccI.js → RestoreVersionDialog-CqAp16yQ.js} +4 -4
- package/dist/{RichTextEditorContent-BZN8KRvR.js → RichTextEditorContent-xbBjVPVQ.js} +8 -8
- package/dist/{SaveBlockDialog-CKOnTMTU.js → SaveBlockDialog-pebNJBTc.js} +9 -9
- package/dist/{SavedBlocksBrowserModal-BrlNxqDH.js → SavedBlocksBrowserModal-CvagMcv7.js} +11 -11
- package/dist/{SavedBlocksPanels--lPR6gdh.js → SavedBlocksPanels-B9AAVBDm.js} +1 -1
- package/dist/{SavedBlocksPickBar-4ON4_KKl.js → SavedBlocksPickBar-BIANWe3i.js} +3 -3
- package/dist/{TemplateSettings-BE0jZmRJ.js → TemplateSettings-ORq4PbCN.js} +12 -12
- package/dist/{TestEmailModal-BKmNGrZN.js → TestEmailModal-DRjCpcPl.js} +11 -11
- package/dist/{TestEmailPanel-DT1wllX3.js → TestEmailPanel-H0v8El__.js} +1 -1
- package/dist/{TitleEditor-HjVZuUTB.js → TitleEditor-CEGbJXeU.js} +11 -11
- package/dist/{Toolbar-BppchV2k.js → Toolbar-XT-uGA9J.js} +1134 -852
- package/dist/{TplModal-BFWOoK8l.js → TplModal-7NQq5-VW.js} +4 -4
- package/dist/{VersionHistoryMenu-BnP0EyLl.js → VersionHistoryMenu-C8BE3Pr-.js} +7 -7
- package/dist/{VersionHistoryPanels-D4yNVLvq.js → VersionHistoryPanels-CuKuOSJG.js} +1 -1
- package/dist/{VersionPreviewBanner-BPP939cD.js → VersionPreviewBanner-BVFBkveR.js} +2 -2
- package/dist/WrapperBlock-Bdw-072t.js +56 -0
- package/dist/{blockTypeIcons-D91v9k0x.js → blockTypeIcons-CGplGmmr.js} +3 -3
- package/dist/bundle-stats.json +6 -6
- package/dist/{ca-DOuIxWRv.js → ca-BJn8lcJx.js} +18 -1
- package/dist/cdn/chunks/{AiAltTextPopover-CAI18sdv.js → AiAltTextPopover-x999Gimz.js} +5 -5
- package/dist/cdn/chunks/{AiAltTextPopover-CAI18sdv.js.map → AiAltTextPopover-x999Gimz.js.map} +1 -1
- package/dist/cdn/chunks/{AiAltTextReview-CWEyMOF-.js → AiAltTextReview-DjnFz1wO.js} +4 -4
- package/dist/cdn/chunks/{AiAltTextReview-CWEyMOF-.js.map → AiAltTextReview-DjnFz1wO.js.map} +1 -1
- package/dist/cdn/chunks/{AiChatPanel-By8Uo1nH.js → AiChatPanel-DKDu9cs7.js} +4 -4
- package/dist/cdn/chunks/{AiChatPanel-By8Uo1nH.js.map → AiChatPanel-DKDu9cs7.js.map} +1 -1
- package/dist/cdn/chunks/{AiPanels-BblCSkQy.js → AiPanels-jMLVaiKx.js} +2 -2
- package/dist/cdn/chunks/{AiPanels-BblCSkQy.js.map → AiPanels-jMLVaiKx.js.map} +1 -1
- package/dist/cdn/chunks/{AiRewriteMenu-BEepu1vo.js → AiRewriteMenu-s79rmHFy.js} +10 -10
- package/dist/cdn/chunks/{AiRewriteMenu-BEepu1vo.js.map → AiRewriteMenu-s79rmHFy.js.map} +1 -1
- package/dist/cdn/chunks/{BlockIssueBadge-D3Plo_wt.js → BlockIssueBadge-Bnmq_M4G.js} +4 -4
- package/dist/cdn/chunks/{BlockIssueBadge-D3Plo_wt.js.map → BlockIssueBadge-Bnmq_M4G.js.map} +1 -1
- package/dist/cdn/chunks/{BlockPreviewCanvas-B6ndvof2.js → BlockPreviewCanvas-B3HkuENF.js} +46 -32
- package/dist/cdn/chunks/BlockPreviewCanvas-B3HkuENF.js.map +1 -0
- package/dist/cdn/chunks/{CloudHeaderExtras-BtqdN777.js → CloudHeaderExtras-uUJYJFJ6.js} +2 -2
- package/dist/cdn/chunks/{CloudHeaderExtras-BtqdN777.js.map → CloudHeaderExtras-uUJYJFJ6.js.map} +1 -1
- package/dist/cdn/chunks/{CloudPanels-BGwDb0jB.js → CloudPanels-DQnlH_YJ.js} +4 -4
- package/dist/cdn/chunks/{CloudPanels-BGwDb0jB.js.map → CloudPanels-DQnlH_YJ.js.map} +1 -1
- package/dist/cdn/chunks/{CollaborationNotices-DraFUhyo.js → CollaborationNotices-CHqUGhOZ.js} +3 -3
- package/dist/cdn/chunks/{CollaborationNotices-DraFUhyo.js.map → CollaborationNotices-CHqUGhOZ.js.map} +1 -1
- package/dist/cdn/chunks/{CollaboratorBar-0OEH3hrj.js → CollaboratorBar-C1ZI2xwa.js} +3 -3
- package/dist/cdn/chunks/{CollaboratorBar-0OEH3hrj.js.map → CollaboratorBar-C1ZI2xwa.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsPanel-tZZswofV.js → CommentsPanel-EtdTzTmq.js} +2 -2
- package/dist/cdn/chunks/{CommentsPanel-tZZswofV.js.map → CommentsPanel-EtdTzTmq.js.map} +1 -1
- package/dist/cdn/chunks/{CommentsSidebar-7Hfl3Hdj.js → CommentsSidebar-Qmj049QX.js} +4 -4
- package/dist/cdn/chunks/{CommentsSidebar-7Hfl3Hdj.js.map → CommentsSidebar-Qmj049QX.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownBlock-CjMhMhnv.js → CountdownBlock-DyGsh92b.js} +3 -3
- package/dist/cdn/chunks/{CountdownBlock-CjMhMhnv.js.map → CountdownBlock-DyGsh92b.js.map} +1 -1
- package/dist/cdn/chunks/{CountdownToolbar-B-0FsTj-.js → CountdownToolbar-Ddj2erNm.js} +6 -6
- package/dist/cdn/chunks/{CountdownToolbar-B-0FsTj-.js.map → CountdownToolbar-Ddj2erNm.js.map} +1 -1
- package/dist/cdn/chunks/{IssuesPanel-LyjMBDok.js → IssuesPanel-DnSnEh1X.js} +8 -8
- package/dist/cdn/chunks/{IssuesPanel-LyjMBDok.js.map → IssuesPanel-DnSnEh1X.js.map} +1 -1
- package/dist/cdn/chunks/{LanguageMenu-CGwMCOQ5.js → LanguageMenu-C2I_yTL5.js} +110 -110
- package/dist/cdn/chunks/{LanguageMenu-CGwMCOQ5.js.map → LanguageMenu-C2I_yTL5.js.map} +1 -1
- package/dist/cdn/chunks/{LocaleNotices-8J2DRWeg.js → LocaleNotices-Dr9LRCAg.js} +4 -4
- package/dist/cdn/chunks/{LocaleNotices-8J2DRWeg.js.map → LocaleNotices-Dr9LRCAg.js.map} +1 -1
- package/dist/cdn/chunks/{LogicTagInsertButton-PDKuo2J3.js → LogicTagInsertButton-BdzE9-l7.js} +260 -255
- package/dist/cdn/chunks/LogicTagInsertButton-BdzE9-l7.js.map +1 -0
- package/dist/cdn/chunks/{MediaEditModal-Dz972UFx.js → MediaEditModal-CMJFXu_o.js} +2 -2
- package/dist/cdn/chunks/{MediaEditModal-Dz972UFx.js.map → MediaEditModal-CMJFXu_o.js.map} +1 -1
- package/dist/cdn/chunks/{MediaPanels-C6Hqtp1H.js → MediaPanels-C790ZXuY.js} +2 -2
- package/dist/cdn/chunks/{MediaPanels-C6Hqtp1H.js.map → MediaPanels-C790ZXuY.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagInput-DoQHBJk2.js → MergeTagInput-CmrX8Md6.js} +2 -2
- package/dist/cdn/chunks/{MergeTagInput-DoQHBJk2.js.map → MergeTagInput-CmrX8Md6.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagModeToggle-Ct5IG4VW.js → MergeTagModeToggle-D7maMGIM.js} +5 -5
- package/dist/cdn/chunks/{MergeTagModeToggle-Ct5IG4VW.js.map → MergeTagModeToggle-D7maMGIM.js.map} +1 -1
- package/dist/cdn/chunks/{MergeTagTextarea-BMsnjphR.js → MergeTagTextarea-KOnd2teB.js} +8 -8
- package/dist/cdn/chunks/{MergeTagTextarea-BMsnjphR.js.map → MergeTagTextarea-KOnd2teB.js.map} +1 -1
- package/dist/cdn/chunks/{ParagraphEditor-CVW-kuHW.js → ParagraphEditor-I9lbKaPk.js} +19 -19
- package/dist/cdn/chunks/{ParagraphEditor-CVW-kuHW.js.map → ParagraphEditor-I9lbKaPk.js.map} +1 -1
- package/dist/cdn/chunks/{RestoreVersionDialog-7MFZz-Sb.js → RestoreVersionDialog-DqbULAbc.js} +4 -4
- package/dist/cdn/chunks/{RestoreVersionDialog-7MFZz-Sb.js.map → RestoreVersionDialog-DqbULAbc.js.map} +1 -1
- package/dist/cdn/chunks/{RichTextEditorContent-CiL-SkZg.js → RichTextEditorContent-_O22z0pn.js} +8 -8
- package/dist/cdn/chunks/{RichTextEditorContent-CiL-SkZg.js.map → RichTextEditorContent-_O22z0pn.js.map} +1 -1
- package/dist/cdn/chunks/{SaveBlockDialog-CxdekCYy.js → SaveBlockDialog-CClRLXgF.js} +8 -8
- package/dist/cdn/chunks/{SaveBlockDialog-CxdekCYy.js.map → SaveBlockDialog-CClRLXgF.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-D9CAa2U3.js → SavedBlocksBrowserModal-BIaxaxw9.js} +8 -8
- package/dist/cdn/chunks/{SavedBlocksBrowserModal-D9CAa2U3.js.map → SavedBlocksBrowserModal-BIaxaxw9.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPanels-jfkYWtss.js → SavedBlocksPanels-Dfu9N6YW.js} +2 -2
- package/dist/cdn/chunks/{SavedBlocksPanels-jfkYWtss.js.map → SavedBlocksPanels-Dfu9N6YW.js.map} +1 -1
- package/dist/cdn/chunks/{SavedBlocksPickBar-yaCumC4j.js → SavedBlocksPickBar-DiMW_dbJ.js} +4 -4
- package/dist/cdn/chunks/{SavedBlocksPickBar-yaCumC4j.js.map → SavedBlocksPickBar-DiMW_dbJ.js.map} +1 -1
- package/dist/cdn/chunks/{TemplateSettings-SaV2UVh_.js → TemplateSettings-JMUo0LIV.js} +10 -10
- package/dist/cdn/chunks/{TemplateSettings-SaV2UVh_.js.map → TemplateSettings-JMUo0LIV.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailModal-ByfhP_sm.js → TestEmailModal-D52VtwBZ.js} +12 -12
- package/dist/cdn/chunks/{TestEmailModal-ByfhP_sm.js.map → TestEmailModal-D52VtwBZ.js.map} +1 -1
- package/dist/cdn/chunks/{TestEmailPanel-CfzpqpDs.js → TestEmailPanel-D9ezVDHd.js} +2 -2
- package/dist/cdn/chunks/{TestEmailPanel-CfzpqpDs.js.map → TestEmailPanel-D9ezVDHd.js.map} +1 -1
- package/dist/cdn/chunks/{TitleEditor-Ceb0YfWv.js → TitleEditor-D04vvbUc.js} +9 -9
- package/dist/cdn/chunks/{TitleEditor-Ceb0YfWv.js.map → TitleEditor-D04vvbUc.js.map} +1 -1
- package/dist/cdn/chunks/{Toolbar-Cv6Rv1S-.js → Toolbar-C_Hfsher.js} +1196 -914
- package/dist/cdn/chunks/Toolbar-C_Hfsher.js.map +1 -0
- package/dist/cdn/chunks/{TplModal-DGpGdwgf.js → TplModal-d6fEZGJ5.js} +5 -5
- package/dist/cdn/chunks/{TplModal-DGpGdwgf.js.map → TplModal-d6fEZGJ5.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryMenu-CZury5gU.js → VersionHistoryMenu-C8ucm43v.js} +7 -7
- package/dist/cdn/chunks/{VersionHistoryMenu-CZury5gU.js.map → VersionHistoryMenu-C8ucm43v.js.map} +1 -1
- package/dist/cdn/chunks/{VersionHistoryPanels-BJnHCMAH.js → VersionHistoryPanels-BAdzmhvH.js} +2 -2
- package/dist/cdn/chunks/{VersionHistoryPanels-BJnHCMAH.js.map → VersionHistoryPanels-BAdzmhvH.js.map} +1 -1
- package/dist/cdn/chunks/{VersionPreviewBanner-C4Ji8nu4.js → VersionPreviewBanner-BWuovbFc.js} +3 -3
- package/dist/cdn/chunks/{VersionPreviewBanner-C4Ji8nu4.js.map → VersionPreviewBanner-BWuovbFc.js.map} +1 -1
- package/dist/cdn/chunks/WrapperBlock-TXDSDXUP.js +58 -0
- package/dist/cdn/chunks/WrapperBlock-TXDSDXUP.js.map +1 -0
- package/dist/cdn/chunks/{blockTypeIcons-Cc6RJ27V.js → blockTypeIcons-CzYA5DF9.js} +2 -2
- package/dist/cdn/chunks/{blockTypeIcons-Cc6RJ27V.js.map → blockTypeIcons-CzYA5DF9.js.map} +1 -1
- package/dist/cdn/chunks/{ca-DOuIxWRv.js → ca-BJn8lcJx.js} +19 -2
- package/dist/cdn/chunks/ca-BJn8lcJx.js.map +1 -0
- package/dist/cdn/chunks/{composables-BxikPuC1.js → composables-CsfQlmcf.js} +676 -620
- package/dist/cdn/chunks/composables-CsfQlmcf.js.map +1 -0
- package/dist/cdn/chunks/{createCloudRuntime-D2DUaudp.js → createCloudRuntime-PpIFCDfj.js} +4 -4
- package/dist/cdn/chunks/{createCloudRuntime-D2DUaudp.js.map → createCloudRuntime-PpIFCDfj.js.map} +1 -1
- package/dist/{de-DaOUfYBX.js → cdn/chunks/de-BLFp3nWx.js} +20 -1
- package/dist/cdn/chunks/de-BLFp3nWx.js.map +1 -0
- package/dist/cdn/chunks/{editor-modal-erQEOHZN.js → editor-modal-B8UE9V8B.js} +90 -90
- package/dist/cdn/chunks/{editor-modal-erQEOHZN.js.map → editor-modal-B8UE9V8B.js.map} +1 -1
- package/dist/cdn/chunks/en-CVxNoHww.js +1 -0
- package/dist/cdn/chunks/{en-C0pHHMiR.js → en-DGGQJGbm.js} +19 -2
- package/dist/cdn/chunks/en-DGGQJGbm.js.map +1 -0
- package/dist/{es-CxyEKr6n.js → cdn/chunks/es-DTY9qgLv.js} +20 -1
- package/dist/cdn/chunks/es-DTY9qgLv.js.map +1 -0
- package/dist/cdn/chunks/{extensions-DuDWpKo7.js → extensions-BM6ZSnsQ.js} +82 -76
- package/dist/cdn/chunks/extensions-BM6ZSnsQ.js.map +1 -0
- package/dist/{fr-CYbamiI6.js → cdn/chunks/fr-L4FqO9Gp.js} +20 -1
- package/dist/cdn/chunks/fr-L4FqO9Gp.js.map +1 -0
- package/dist/cdn/chunks/{icons-Da9GKjPx.js → icons-DHExFLlT.js} +43 -43
- package/dist/cdn/chunks/{icons-Da9GKjPx.js.map → icons-DHExFLlT.js.map} +1 -1
- package/dist/cdn/chunks/{ja-DfaIAoGI.js → ja-6uOXkh4v.js} +19 -2
- package/dist/cdn/chunks/ja-6uOXkh4v.js.map +1 -0
- package/dist/cdn/chunks/{keys-CoQtCqNv.js → keys-BUmIvYy3.js} +4 -4
- package/dist/cdn/chunks/keys-BUmIvYy3.js.map +1 -0
- package/dist/cdn/chunks/{nl-DkrB-VKZ.js → nl-DCxuxwNq.js} +19 -2
- package/dist/cdn/chunks/nl-DCxuxwNq.js.map +1 -0
- package/dist/cdn/chunks/normalizeMergeTagMarkup-aWjkotui.js +300 -0
- package/dist/cdn/chunks/normalizeMergeTagMarkup-aWjkotui.js.map +1 -0
- package/dist/cdn/chunks/{preRenderCustomBlocks-C9oavydG.js → preRenderCustomBlocks-Dn6dFUwx.js} +2 -2
- package/dist/cdn/chunks/{preRenderCustomBlocks-C9oavydG.js.map → preRenderCustomBlocks-Dn6dFUwx.js.map} +1 -1
- package/dist/cdn/chunks/{pt-BR-CY5Ye7eP.js → pt-BR-CBkcrebr.js} +19 -2
- package/dist/cdn/chunks/pt-BR-CBkcrebr.js.map +1 -0
- package/dist/cdn/chunks/{sanitizeHtml-DfXoetOm.js → sanitizeHtml-DJI7vvET.js} +3 -3
- package/dist/cdn/chunks/{sanitizeHtml-DfXoetOm.js.map → sanitizeHtml-DJI7vvET.js.map} +1 -1
- package/dist/cdn/chunks/{socialIcons-DPwkrn5v.js → socialIcons-Qw9rHc8C.js} +420 -406
- package/dist/cdn/chunks/{socialIcons-DPwkrn5v.js.map → socialIcons-Qw9rHc8C.js.map} +1 -1
- package/dist/cdn/chunks/src-Bfj1jHnn.js +710 -0
- package/dist/cdn/chunks/src-Bfj1jHnn.js.map +1 -0
- package/dist/cdn/chunks/{src-712f3ofG.js → src-C9JWWxAk.js} +683 -568
- package/dist/cdn/chunks/src-C9JWWxAk.js.map +1 -0
- package/dist/cdn/chunks/{src-ZFw5fg_z.js → src-mXG-Of9A.js} +892 -735
- package/dist/cdn/chunks/src-mXG-Of9A.js.map +1 -0
- package/dist/cdn/chunks/{useCloudI18n-Cc5NZqiI.js → useCloudI18n-Xsih9yRH.js} +2 -2
- package/dist/cdn/chunks/{useCloudI18n-Cc5NZqiI.js.map → useCloudI18n-Xsih9yRH.js.map} +1 -1
- package/dist/cdn/chunks/{useEditorRoot-D_LuZ_hE.js → useEditorRoot-Beau2Z_T.js} +2 -2
- package/dist/cdn/chunks/{useEditorRoot-D_LuZ_hE.js.map → useEditorRoot-Beau2Z_T.js.map} +1 -1
- package/dist/cdn/chunks/{useI18n-BnJYydPv.js → useI18n-D8s7HtTn.js} +2 -2
- package/dist/cdn/chunks/{useI18n-BnJYydPv.js.map → useI18n-D8s7HtTn.js.map} +1 -1
- package/dist/cdn/chunks/useLocalizedDisplay-Bgg4qpev.js +33 -0
- package/dist/cdn/chunks/{useLocalizedDisplay-DiNjT22M.js.map → useLocalizedDisplay-Bgg4qpev.js.map} +1 -1
- package/dist/cdn/chunks/{useLogicTag-SvMW4g00.js → useLogicTag-DLvWzWsp.js} +4 -4
- package/dist/cdn/chunks/{useLogicTag-SvMW4g00.js.map → useLogicTag-DLvWzWsp.js.map} +1 -1
- package/dist/cdn/chunks/{useMergeTag-JLz3Pqcw.js → useMergeTag-B4FHCGGm.js} +6 -6
- package/dist/cdn/chunks/{useMergeTag-JLz3Pqcw.js.map → useMergeTag-B4FHCGGm.js.map} +1 -1
- package/dist/cdn/chunks/{usePopoverPosition-BWAXWeBv.js → usePopoverPosition-esO6wjvU.js} +5 -5
- package/dist/cdn/chunks/{usePopoverPosition-BWAXWeBv.js.map → usePopoverPosition-esO6wjvU.js.map} +1 -1
- package/dist/cdn/chunks/{useScrollToBlock-Ct1AwLD-.js → useScrollToBlock-CJuUu7Xj.js} +2 -2
- package/dist/cdn/chunks/{useScrollToBlock-Ct1AwLD-.js.map → useScrollToBlock-CJuUu7Xj.js.map} +1 -1
- package/dist/cdn/chunks/{withCurrentFont-BcoPpkDS.js → withCurrentFont-QqBilClC.js} +2 -2
- package/dist/cdn/chunks/{withCurrentFont-BcoPpkDS.js.map → withCurrentFont-QqBilClC.js.map} +1 -1
- package/dist/cdn/editor.css +1 -1
- package/dist/cdn/editor.js +761 -764
- package/dist/cdn/editor.js.map +1 -1
- package/dist/{check-XMnOOIEC.js → check-CcuCoJDh.js} +1 -1
- package/dist/{chevron-down-DmamTEWQ.js → chevron-down-BfYIbFbC.js} +1 -1
- package/dist/{chevron-right-BEFXOH27.js → chevron-right-DyjFqY35.js} +1 -1
- package/dist/{chevron-up-Dw7woXj8.js → chevron-up-BHEIxuS-.js} +1 -1
- package/dist/{circle-alert-BTKC9vkq.js → circle-alert-Tq7kAh9S.js} +1 -1
- package/dist/{clock-BVT5u2uG.js → clock-Df0ZiXwQ.js} +1 -1
- package/dist/{composables-BbPFRlBf.js → composables-CRX6rncm.js} +1044 -988
- package/dist/{createCloudRuntime-Dlrg88gS.js → createCloudRuntime-DplyIlsy.js} +3 -3
- package/dist/{createLucideIcon-CgDE3xAR.js → createLucideIcon-CfBdtoUw.js} +5 -5
- package/dist/{cdn/chunks/de-DaOUfYBX.js → de-BLFp3nWx.js} +18 -3
- package/dist/{dist-C34cYI5S.js → dist-BMUUt3zJ.js} +964 -807
- package/dist/{editor-modal-BeX6otLk.js → editor-modal-D9HT9bD6.js} +15 -15
- package/dist/{en-C0pHHMiR.js → en-DGGQJGbm.js} +18 -1
- package/dist/en-De3uAutQ.js +1 -0
- package/dist/{cdn/chunks/es-CxyEKr6n.js → es-DTY9qgLv.js} +18 -3
- package/dist/{extensions-xCiyqSg7.js → extensions-Cm6K4SRX.js} +344 -338
- package/dist/{eye-ByMgHeA_.js → eye-B3psrAqd.js} +1 -1
- package/dist/{cdn/chunks/fr-CYbamiI6.js → fr-L4FqO9Gp.js} +18 -3
- package/dist/{image-Ch8tR35K.js → image-C3yuPDxx.js} +1 -1
- package/dist/index.d.ts +74 -13
- package/dist/{info-DzSD-Wpk.js → info-DKja7A68.js} +1 -1
- package/dist/{ja-DfaIAoGI.js → ja-6uOXkh4v.js} +18 -1
- package/dist/{keys-BCqskl51.js → keys-w_VRjoMu.js} +3 -3
- package/dist/{link-oDn9AR2w.js → link-DhzPI4Hn.js} +1 -1
- package/dist/{list-C5t07dp8.js → list-DVGn7Ik2.js} +1 -1
- package/dist/{loader-circle-k6xvKgUB.js → loader-circle-DqKWsMHO.js} +1 -1
- package/dist/{message-circle-C23R6OJR.js → message-circle-C4TonoBs.js} +1 -1
- package/dist/{nl-DkrB-VKZ.js → nl-DCxuxwNq.js} +18 -1
- package/dist/normalizeMergeTagMarkup-Da9JAgx7.js +298 -0
- package/dist/{package-C90eQ7NU.js → package-9OkiEO4S.js} +1 -1
- package/dist/{pencil-BK7GrQuA.js → pencil-M9vkOB7C.js} +1 -1
- package/dist/{plus-Cr0Mis63.js → plus-DxZiv9YC.js} +1 -1
- package/dist/{preRenderCustomBlocks-DvbRa3L3.js → preRenderCustomBlocks-CdqSp2P7.js} +4 -4
- package/dist/{pt-BR-CY5Ye7eP.js → pt-BR-CBkcrebr.js} +18 -1
- package/dist/{refresh-cw-_ZLOIEvA.js → refresh-cw-UY8_sdFG.js} +1 -1
- package/dist/{rotate-ccw-CB5wsHwv.js → rotate-ccw-BFTGCpHn.js} +1 -1
- package/dist/{sanitizeHtml-D_ab7dD6.js → sanitizeHtml-wBibnBF4.js} +6 -6
- package/dist/{search-BmrQNox8.js → search-RuGJnMEn.js} +1 -1
- package/dist/{send-blAsIBBg.js → send-DGB1ar02.js} +1 -1
- package/dist/{smartphone-BPpWYrwV.js → smartphone-CVA29CU_.js} +1 -1
- package/dist/{socialIcons-DhAolBjt.js → socialIcons-CJD6OsI7.js} +283 -269
- package/dist/{sparkles-OqIxrNp-.js → sparkles-IHfEwEcd.js} +1 -1
- package/dist/{square-BP-V7iT-.js → square-_Cl44UU6.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/templatical-editor.js +851 -854
- package/dist/{text-align-start-4mwX2o-F.js → text-align-start-Dqk2Xt_Q.js} +13 -13
- package/dist/{trash-B99WixTA.js → trash-Cr7rD5Hh.js} +1 -1
- package/dist/{triangle-alert-CHMiDkHa.js → triangle-alert-CKcpwtUj.js} +1 -1
- package/dist/{upload-Cp8o-hrN.js → upload-DR9pqVON.js} +1 -1
- package/dist/{useCloudI18n-Dh2iydo1.js → useCloudI18n-BczJoFf4.js} +1 -1
- package/dist/{useEditorRoot-DY3mgcHm.js → useEditorRoot-BcXKhM_8.js} +1 -1
- package/dist/{useI18n-CgtvtF4C.js → useI18n-zeWYtWSv.js} +1 -1
- package/dist/useLocalizedDisplay-Cbhx208c.js +31 -0
- package/dist/{useLogicTag-BmuakZBd.js → useLogicTag-DLkYos2Q.js} +3 -3
- package/dist/{useMergeTag-DC4a8b_v.js → useMergeTag-IoWOO679.js} +5 -5
- package/dist/{usePopoverPosition-VDQjyX_A.js → usePopoverPosition-Br3zt_MQ.js} +4 -4
- package/dist/{useScrollToBlock-B35ObCGK.js → useScrollToBlock-BfOzc1Z6.js} +2 -2
- package/dist/{withCurrentFont-BSxJai99.js → withCurrentFont-m_PHcOD0.js} +1 -1
- package/dist/{x-BIBStNMS.js → x-DZSFHafL.js} +1 -1
- package/package.json +10 -10
- package/dist/BlockPreviewCanvas-DtOo5y3U.js +0 -140
- package/dist/WrapperBlock-BUzQTZuu.js +0 -44
- package/dist/cdn/chunks/BlockPreviewCanvas-B6ndvof2.js.map +0 -1
- package/dist/cdn/chunks/LogicTagInsertButton-PDKuo2J3.js.map +0 -1
- package/dist/cdn/chunks/Toolbar-Cv6Rv1S-.js.map +0 -1
- package/dist/cdn/chunks/WrapperBlock-C_uE5rPJ.js +0 -46
- package/dist/cdn/chunks/WrapperBlock-C_uE5rPJ.js.map +0 -1
- package/dist/cdn/chunks/ca-DOuIxWRv.js.map +0 -1
- package/dist/cdn/chunks/composables-BxikPuC1.js.map +0 -1
- package/dist/cdn/chunks/de-DaOUfYBX.js.map +0 -1
- package/dist/cdn/chunks/en-B6tLGRHq.js +0 -1
- package/dist/cdn/chunks/en-C0pHHMiR.js.map +0 -1
- package/dist/cdn/chunks/es-CxyEKr6n.js.map +0 -1
- package/dist/cdn/chunks/extensions-DuDWpKo7.js.map +0 -1
- package/dist/cdn/chunks/fr-CYbamiI6.js.map +0 -1
- package/dist/cdn/chunks/ja-DfaIAoGI.js.map +0 -1
- package/dist/cdn/chunks/keys-CoQtCqNv.js.map +0 -1
- package/dist/cdn/chunks/nl-DkrB-VKZ.js.map +0 -1
- package/dist/cdn/chunks/normalizeMergeTagMarkup-Bn_hl4jd.js +0 -290
- package/dist/cdn/chunks/normalizeMergeTagMarkup-Bn_hl4jd.js.map +0 -1
- package/dist/cdn/chunks/pt-BR-CY5Ye7eP.js.map +0 -1
- package/dist/cdn/chunks/src-712f3ofG.js.map +0 -1
- package/dist/cdn/chunks/src-B2tQbzf6.js +0 -677
- package/dist/cdn/chunks/src-B2tQbzf6.js.map +0 -1
- package/dist/cdn/chunks/src-ZFw5fg_z.js.map +0 -1
- package/dist/cdn/chunks/useLocalizedDisplay-DiNjT22M.js +0 -33
- package/dist/en-Do0SU6tR.js +0 -1
- package/dist/normalizeMergeTagMarkup-C7FGNURu.js +0 -288
- package/dist/useLocalizedDisplay-C9MBFUr4.js +0 -31
|
@@ -63,7 +63,7 @@ var s = {
|
|
|
63
63
|
"center",
|
|
64
64
|
"bottom"
|
|
65
65
|
];
|
|
66
|
-
function
|
|
66
|
+
function p(e) {
|
|
67
67
|
return {
|
|
68
68
|
url: e,
|
|
69
69
|
size: "cover",
|
|
@@ -74,7 +74,7 @@ function ee(e) {
|
|
|
74
74
|
repeat: !1
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function m(e) {
|
|
78
78
|
let t = "";
|
|
79
79
|
for (let n of e) {
|
|
80
80
|
let e = n.charCodeAt(0);
|
|
@@ -82,36 +82,36 @@ function te(e) {
|
|
|
82
82
|
}
|
|
83
83
|
return t;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function ee(e) {
|
|
86
86
|
let t = typeof e?.url == "string" ? e.url.trim() : "";
|
|
87
87
|
if (!e || !t) return null;
|
|
88
88
|
let n = u.includes(e.size) ? e.size : "cover", r = e.position, i = r && d.includes(r.x) ? r.x : "center", a = r && f.includes(r.y) ? r.y : "center";
|
|
89
89
|
return {
|
|
90
|
-
url:
|
|
90
|
+
url: m(t),
|
|
91
91
|
size: n,
|
|
92
92
|
position: `${i} ${a}`,
|
|
93
93
|
repeat: e.repeat ? "repeat" : "no-repeat"
|
|
94
94
|
};
|
|
95
95
|
}
|
|
96
96
|
// ../types/src/hero.ts
|
|
97
|
-
var
|
|
97
|
+
var te = [
|
|
98
98
|
"top",
|
|
99
99
|
"middle",
|
|
100
100
|
"bottom"
|
|
101
101
|
];
|
|
102
|
-
function
|
|
102
|
+
function ne(e) {
|
|
103
103
|
let t = e.hero;
|
|
104
104
|
if (!t || typeof t != "object") return null;
|
|
105
105
|
if (e.columns !== "1") return {
|
|
106
106
|
applied: !1,
|
|
107
107
|
reason: "columns"
|
|
108
108
|
};
|
|
109
|
-
let n =
|
|
109
|
+
let n = ee(e.backgroundImage);
|
|
110
110
|
if (n === null) return {
|
|
111
111
|
applied: !1,
|
|
112
112
|
reason: "image"
|
|
113
113
|
};
|
|
114
|
-
let r =
|
|
114
|
+
let r = ie(e.backgroundImage), i = re(t.height) ? Math.round(t.height) : "image";
|
|
115
115
|
return i === "image" && r === null ? {
|
|
116
116
|
applied: !1,
|
|
117
117
|
reason: "size"
|
|
@@ -119,19 +119,19 @@ function ie(e) {
|
|
|
119
119
|
applied: !0,
|
|
120
120
|
image: n,
|
|
121
121
|
height: i,
|
|
122
|
-
verticalAlign:
|
|
122
|
+
verticalAlign: te.includes(t.verticalAlign) ? t.verticalAlign : "middle",
|
|
123
123
|
aspectRatio: r
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function re(e) {
|
|
127
127
|
return typeof e == "number" && Number.isFinite(e) && e >= 1;
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function ie(e) {
|
|
130
130
|
let t = e?.naturalWidth, n = e?.naturalHeight;
|
|
131
131
|
return typeof t != "number" || typeof n != "number" || !Number.isFinite(t) || !Number.isFinite(n) || t <= 0 || n <= 0 ? null : n / t;
|
|
132
132
|
}
|
|
133
133
|
// ../types/src/social.ts
|
|
134
|
-
var
|
|
134
|
+
var ae = {
|
|
135
135
|
facebook: {
|
|
136
136
|
color: "#1877F2",
|
|
137
137
|
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"
|
|
@@ -148,6 +148,10 @@ var se = {
|
|
|
148
148
|
color: "#0A66C2",
|
|
149
149
|
path: "M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433c-1.144 0-2.063-.926-2.063-2.065 0-1.138.92-2.063 2.063-2.063 1.14 0 2.064.925 2.064 2.063 0 1.139-.925 2.065-2.064 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z"
|
|
150
150
|
},
|
|
151
|
+
xing: {
|
|
152
|
+
color: "#006567",
|
|
153
|
+
path: "M18.188 0c-.517 0-.741.325-.927.66c0 0-7.455 13.224-7.702 13.657c.015.024 4.919 9.023 4.919 9.023c.17.308.436.66.967.66h3.454c.211 0 .375-.078.463-.22c.089-.151.089-.346-.009-.536l-4.879-8.916a.02.02 0 0 1 0-.022L22.139.756c.095-.191.097-.387.006-.535C22.056.078 21.894 0 21.686 0zM3.648 4.74c-.211 0-.385.074-.473.216c-.09.149-.078.339.02.531l2.34 4.05q.006.014 0 .021L1.86 16.051a.52.52 0 0 0 0 .529c.085.142.239.234.45.234h3.461c.518 0 .766-.348.945-.667l3.734-6.609l-2.378-4.155c-.172-.315-.434-.659-.962-.659H3.648z"
|
|
154
|
+
},
|
|
151
155
|
youtube: {
|
|
152
156
|
color: "#FF0000",
|
|
153
157
|
path: "M23.498 6.186a3.016 3.016 0 0 0-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 0 0 .502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 0 0 2.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 0 0 2.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z"
|
|
@@ -200,36 +204,36 @@ var se = {
|
|
|
200
204
|
color: "#1769FF",
|
|
201
205
|
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"
|
|
202
206
|
}
|
|
203
|
-
},
|
|
207
|
+
}, oe = {
|
|
204
208
|
dark: "#1f1f1f",
|
|
205
209
|
light: "#ffffff"
|
|
206
210
|
};
|
|
207
|
-
function
|
|
211
|
+
function se(e) {
|
|
208
212
|
return e === "dark" || e === "light" ? e : void 0;
|
|
209
213
|
}
|
|
210
|
-
function
|
|
211
|
-
let n =
|
|
214
|
+
function ce(e, t) {
|
|
215
|
+
let n = se(t);
|
|
212
216
|
return {
|
|
213
|
-
fill: n ?
|
|
214
|
-
onFill: n === "light" ?
|
|
217
|
+
fill: n ? oe[n] : ae[e].color,
|
|
218
|
+
onFill: n === "light" ? oe.dark : "#ffffff"
|
|
215
219
|
};
|
|
216
220
|
}
|
|
217
|
-
function
|
|
218
|
-
let n =
|
|
221
|
+
function le(e, t) {
|
|
222
|
+
let n = se(t);
|
|
219
223
|
return n ? `${e}-${n}` : e;
|
|
220
224
|
}
|
|
221
|
-
function
|
|
222
|
-
if (
|
|
223
|
-
color:
|
|
225
|
+
function ue(e, t) {
|
|
226
|
+
if (se(t) === "dark" && (e === "plain" || e === "outlined")) return {
|
|
227
|
+
color: oe.light,
|
|
224
228
|
opacity: .6,
|
|
225
229
|
width: 1.4
|
|
226
230
|
};
|
|
227
231
|
}
|
|
228
|
-
function
|
|
232
|
+
function de(e) {
|
|
229
233
|
return e === "plain" ? .84 : .6;
|
|
230
234
|
}
|
|
231
235
|
// ../types/src/element-ids.ts
|
|
232
|
-
function
|
|
236
|
+
function fe(e) {
|
|
233
237
|
let t = [], n = (e, n) => {
|
|
234
238
|
typeof e == "string" && /[./]/.test(e) && t.push({
|
|
235
239
|
path: n,
|
|
@@ -248,7 +252,7 @@ function me(e) {
|
|
|
248
252
|
return r(e.blocks, "blocks"), t;
|
|
249
253
|
}
|
|
250
254
|
// ../types/src/clone.ts
|
|
251
|
-
function
|
|
255
|
+
function h(e) {
|
|
252
256
|
let t = [];
|
|
253
257
|
return JSON.parse(JSON.stringify(e, function(e, n) {
|
|
254
258
|
if (typeof n != "object" || !n) return n;
|
|
@@ -257,22 +261,22 @@ function p(e) {
|
|
|
257
261
|
}));
|
|
258
262
|
}
|
|
259
263
|
// ../types/src/deep-equal.ts
|
|
260
|
-
function
|
|
264
|
+
function pe(e) {
|
|
261
265
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
262
266
|
}
|
|
263
|
-
function
|
|
267
|
+
function g(e, t) {
|
|
264
268
|
if (e === t) return !0;
|
|
265
|
-
if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) =>
|
|
266
|
-
if (
|
|
267
|
-
if (!
|
|
269
|
+
if (Array.isArray(e)) return !Array.isArray(t) || e.length !== t.length ? !1 : e.every((e, n) => g(e, t[n]));
|
|
270
|
+
if (pe(e)) {
|
|
271
|
+
if (!pe(t)) return !1;
|
|
268
272
|
let n = /* @__PURE__ */ new Set([...Object.keys(e), ...Object.keys(t)]);
|
|
269
|
-
for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !
|
|
273
|
+
for (let r of n) if ((e[r] !== void 0 || t[r] !== void 0) && !g(e[r], t[r])) return !1;
|
|
270
274
|
return !0;
|
|
271
275
|
}
|
|
272
276
|
return !1;
|
|
273
277
|
}
|
|
274
278
|
// ../types/src/config.ts
|
|
275
|
-
var
|
|
279
|
+
var me = class extends Error {
|
|
276
280
|
statusCode;
|
|
277
281
|
code;
|
|
278
282
|
constructor(e, t, n, r) {
|
|
@@ -287,7 +291,7 @@ var ge = class extends Error {
|
|
|
287
291
|
get isServerError() {
|
|
288
292
|
return this.statusCode !== void 0 && this.statusCode >= 500;
|
|
289
293
|
}
|
|
290
|
-
},
|
|
294
|
+
}, he = {
|
|
291
295
|
title: ["content"],
|
|
292
296
|
paragraph: ["content"],
|
|
293
297
|
html: ["content"],
|
|
@@ -304,58 +308,58 @@ var ge = class extends Error {
|
|
|
304
308
|
"expiredMessage"
|
|
305
309
|
],
|
|
306
310
|
custom: ["fieldValues.*"]
|
|
307
|
-
},
|
|
308
|
-
function
|
|
311
|
+
}, _ = ["preheaderText"];
|
|
312
|
+
function ge(e) {
|
|
309
313
|
return typeof e == "string" && /^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/.test(e);
|
|
310
314
|
}
|
|
311
|
-
function
|
|
315
|
+
function v(e) {
|
|
312
316
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
313
317
|
}
|
|
314
|
-
var
|
|
318
|
+
var _e = /* @__PURE__ */ new Set([
|
|
315
319
|
"__proto__",
|
|
316
320
|
"constructor",
|
|
317
321
|
"prototype"
|
|
318
322
|
]);
|
|
319
|
-
function
|
|
320
|
-
return e.split(".").every((e) => e !== "" && !
|
|
323
|
+
function y(e) {
|
|
324
|
+
return e.split(".").every((e) => e !== "" && !_e.has(e));
|
|
321
325
|
}
|
|
322
|
-
function
|
|
323
|
-
if (!
|
|
326
|
+
function ve(e, t) {
|
|
327
|
+
if (!_e.has(t)) return Array.isArray(e) ? e.find((e) => v(e) && e.id === t) : v(e) && Object.hasOwn(e, t) ? e[t] : void 0;
|
|
324
328
|
}
|
|
325
|
-
function
|
|
326
|
-
return t.split(".").reduce(
|
|
329
|
+
function b(e, t) {
|
|
330
|
+
return t.split(".").reduce(ve, e);
|
|
327
331
|
}
|
|
328
|
-
function
|
|
329
|
-
let t =
|
|
332
|
+
function ye(e) {
|
|
333
|
+
let t = h(e);
|
|
330
334
|
for (let [n, r] of Object.entries(t.l10n ?? {})) {
|
|
331
335
|
for (let t of ["text", "set"]) {
|
|
332
336
|
for (let n of Object.keys(r[t] ?? {})) {
|
|
333
|
-
let i = n.includes(".") ?
|
|
334
|
-
|
|
337
|
+
let i = n.includes(".") ? b(e, n.slice(0, n.lastIndexOf("."))) : e;
|
|
338
|
+
y(n) && (t !== "text" && v(i) || b(e, n) !== void 0) || delete r[t][n];
|
|
335
339
|
}
|
|
336
340
|
r[t] && !Object.keys(r[t]).length && delete r[t];
|
|
337
341
|
}
|
|
338
342
|
Object.keys(r).length || delete t.l10n[n];
|
|
339
343
|
}
|
|
340
|
-
return t.l10n && !Object.keys(t.l10n).length && delete t.l10n,
|
|
344
|
+
return t.l10n && !Object.keys(t.l10n).length && delete t.l10n, g(t, e) ? e : t;
|
|
341
345
|
}
|
|
342
|
-
function
|
|
343
|
-
let t =
|
|
346
|
+
function be(e) {
|
|
347
|
+
let t = ye(e);
|
|
344
348
|
if (t.type === "wrapper") {
|
|
345
|
-
let e = t.children.map(
|
|
349
|
+
let e = t.children.map(be);
|
|
346
350
|
return e.some((e, n) => e !== t.children[n]) ? {
|
|
347
351
|
...t,
|
|
348
352
|
children: e
|
|
349
353
|
} : t;
|
|
350
354
|
}
|
|
351
355
|
if (t.type !== "section") return t;
|
|
352
|
-
let n = t.children.map((e) => e.map(
|
|
356
|
+
let n = t.children.map((e) => e.map(be));
|
|
353
357
|
return n.some((e, n) => e.some((e, r) => e !== t.children[n][r])) ? {
|
|
354
358
|
...t,
|
|
355
359
|
children: n
|
|
356
360
|
} : t;
|
|
357
361
|
}
|
|
358
|
-
function
|
|
362
|
+
function xe(e, t, n) {
|
|
359
363
|
if (e.type === "custom") return !1;
|
|
360
364
|
if (e.type === "section") return t === "columns";
|
|
361
365
|
let r = e.type === "menu" ? "items" : e.type === "social" ? "icons" : e.type === "table" ? "rows" : null;
|
|
@@ -368,44 +372,44 @@ function Se(e, t, n) {
|
|
|
368
372
|
let o = a.split(".").length;
|
|
369
373
|
if (i[o] === "id") return !0;
|
|
370
374
|
if (i.length !== o) return !1;
|
|
371
|
-
let s =
|
|
372
|
-
if (!
|
|
375
|
+
let s = b(e, a);
|
|
376
|
+
if (!v(s) || !v(n) || s.id !== n.id) return !0;
|
|
373
377
|
if (e.type === "table" && o === 2) {
|
|
374
|
-
let e = (e) => Array.isArray(e) ? e.map((e) =>
|
|
375
|
-
return !
|
|
378
|
+
let e = (e) => Array.isArray(e) ? e.map((e) => v(e) ? e.id : void 0) : null;
|
|
379
|
+
return !g(e(s.cells), e(n.cells));
|
|
376
380
|
}
|
|
377
381
|
return !1;
|
|
378
382
|
}
|
|
379
|
-
function
|
|
380
|
-
return
|
|
383
|
+
function Se(e) {
|
|
384
|
+
return ye(e);
|
|
381
385
|
}
|
|
382
|
-
function
|
|
383
|
-
if (!
|
|
384
|
-
let r = t.split("."), i = r.pop(), a = r.reduce(
|
|
386
|
+
function x(e, t, n) {
|
|
387
|
+
if (!y(t)) return !1;
|
|
388
|
+
let r = t.split("."), i = r.pop(), a = r.reduce(ve, e);
|
|
385
389
|
if (Array.isArray(a)) {
|
|
386
|
-
let e = a.findIndex((e) =>
|
|
387
|
-
return e < 0 ? !1 : (a[e] =
|
|
390
|
+
let e = a.findIndex((e) => v(e) && e.id === i);
|
|
391
|
+
return e < 0 ? !1 : (a[e] = h(n), !0);
|
|
388
392
|
}
|
|
389
|
-
return
|
|
393
|
+
return v(a) ? (n === null ? delete a[i] : a[i] = h(n), !0) : !1;
|
|
390
394
|
}
|
|
391
|
-
function
|
|
395
|
+
function Ce(e, t) {
|
|
392
396
|
let [n, ...r] = t.split(".");
|
|
393
397
|
if (n === void 0) return [""];
|
|
394
398
|
let i = [];
|
|
395
399
|
if (n === "*") {
|
|
396
400
|
let t = Array.isArray(e) ? e : [];
|
|
397
|
-
for (let e of t) if (
|
|
401
|
+
for (let e of t) if (v(e) && typeof e.id == "string") for (let t of r.length ? Ce(e, r.join(".")) : [""]) i.push(t ? `${e.id}.${t}` : e.id);
|
|
398
402
|
return i;
|
|
399
403
|
}
|
|
400
|
-
let a =
|
|
404
|
+
let a = v(e) ? e[n] : void 0;
|
|
401
405
|
if (r.length === 0) return a === void 0 ? [] : [n];
|
|
402
|
-
for (let e of
|
|
406
|
+
for (let e of Ce(a, r.join("."))) i.push(`${n}.${e}`);
|
|
403
407
|
return i;
|
|
404
408
|
}
|
|
405
|
-
function
|
|
409
|
+
function S(e, t = []) {
|
|
406
410
|
if (e.type === "custom") {
|
|
407
411
|
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;
|
|
408
|
-
return
|
|
412
|
+
return v(i) ? Object.keys(i).filter((e) => r.has(e)).map((e) => `fieldValues.${e}`) : [];
|
|
409
413
|
}
|
|
410
414
|
let n = (e) => !e.id.includes("."), r = e.type === "menu" ? {
|
|
411
415
|
...e,
|
|
@@ -417,10 +421,10 @@ function x(e, t = []) {
|
|
|
417
421
|
cells: e.cells.filter(n)
|
|
418
422
|
}))
|
|
419
423
|
} : e;
|
|
420
|
-
return (
|
|
424
|
+
return (he[e.type] ?? []).flatMap((e) => Ce(r, e));
|
|
421
425
|
}
|
|
422
|
-
function
|
|
423
|
-
return (
|
|
426
|
+
function we(e, t) {
|
|
427
|
+
return (he[e] ?? []).some((e) => {
|
|
424
428
|
let n = e.split("."), r = t.split(".");
|
|
425
429
|
return n.length === r.length && n.every((e, t) => e === "*" || e === r[t]);
|
|
426
430
|
});
|
|
@@ -438,12 +442,12 @@ function w(e = {}) {
|
|
|
438
442
|
return Object.entries(e).sort(([e], [t]) => e.split(".").length - t.split(".").length);
|
|
439
443
|
}
|
|
440
444
|
function Ee(e, t, n) {
|
|
441
|
-
let r = e, i =
|
|
445
|
+
let r = e, i = h(Te(r));
|
|
442
446
|
if (t === n) return i;
|
|
443
447
|
let a = r.l10n?.[t];
|
|
444
448
|
if (!a) return i;
|
|
445
|
-
for (let [e, t] of w(a.set))
|
|
446
|
-
for (let [t, n] of Object.entries(a.text ?? {}))
|
|
449
|
+
for (let [e, t] of w(a.set)) x(i, e, t);
|
|
450
|
+
for (let [t, n] of Object.entries(a.text ?? {})) b(e, t) !== void 0 && x(i, t, n.value);
|
|
447
451
|
return e.type === "custom" && (Object.keys(a.text ?? {}).length > 0 || Object.keys(a.set ?? {}).length > 0) && delete i.renderedHtml, i;
|
|
448
452
|
}
|
|
449
453
|
function De(e, t) {
|
|
@@ -460,16 +464,16 @@ function ke(e, t, n) {
|
|
|
460
464
|
let r = T(e);
|
|
461
465
|
if (t !== r && !(e.settings?.locales ?? []).includes(t)) {
|
|
462
466
|
if (n?.missing === "default") t = r;
|
|
463
|
-
else throw new
|
|
467
|
+
else throw new me(`This template has no "${t}" version.`, void 0, "unknown_locale");
|
|
464
468
|
}
|
|
465
469
|
let i = (e) => e.flatMap((e) => {
|
|
466
470
|
if (t !== r && De(e, t)) return [];
|
|
467
471
|
let n = Ee(e, t, r);
|
|
468
472
|
return n.type === "section" && Array.isArray(n.children) ? n.children = n.children.map((e) => i(e)) : n.type === "wrapper" && Array.isArray(n.children) && (n.children = i(n.children)), [n];
|
|
469
|
-
}), a =
|
|
473
|
+
}), a = h(Oe(e.settings)), o = e.settings?.l10n?.[t];
|
|
470
474
|
if (t !== r && o) {
|
|
471
|
-
for (let [e, t] of w(o.set))
|
|
472
|
-
for (let [t, n] of Object.entries(o.text ?? {}))
|
|
475
|
+
for (let [e, t] of w(o.set)) x(a, e, t);
|
|
476
|
+
for (let [t, n] of Object.entries(o.text ?? {})) b(e.settings, t) !== void 0 && x(a, t, n.value);
|
|
473
477
|
}
|
|
474
478
|
return a.locale = t, {
|
|
475
479
|
blocks: i(e.blocks),
|
|
@@ -483,7 +487,7 @@ function Ae(e, t, n = []) {
|
|
|
483
487
|
stale: []
|
|
484
488
|
}, i = (e, t, n, i) => {
|
|
485
489
|
for (let a of n) {
|
|
486
|
-
let n =
|
|
490
|
+
let n = b(t, a);
|
|
487
491
|
if (typeof n != "string") continue;
|
|
488
492
|
let o = i?.[a];
|
|
489
493
|
(o || n !== "") && (o ? o.sourceHash === C(n) ? r.translated.push(`${e}/${a}`) : r.stale.push(`${e}/${a}`) : r.missing.push(`${e}/${a}`));
|
|
@@ -492,13 +496,13 @@ function Ae(e, t, n = []) {
|
|
|
492
496
|
for (let r of e) {
|
|
493
497
|
if (De(r, t)) continue;
|
|
494
498
|
let e = r.l10n?.[t];
|
|
495
|
-
i(r.id, r,
|
|
499
|
+
i(r.id, r, S(r, n), e?.text);
|
|
496
500
|
let o = r.children;
|
|
497
501
|
if (r.type === "section" && Array.isArray(o)) for (let e of o) a(e);
|
|
498
502
|
else r.type === "wrapper" && Array.isArray(o) && a(o);
|
|
499
503
|
}
|
|
500
504
|
};
|
|
501
|
-
return a(e.blocks), i("settings", e.settings, [...
|
|
505
|
+
return a(e.blocks), i("settings", e.settings, [..._], e.settings?.l10n?.[t]?.text), r;
|
|
502
506
|
}
|
|
503
507
|
function je(e, t) {
|
|
504
508
|
if (t === T(e) || !e.settings.locales?.includes(t)) return [];
|
|
@@ -512,23 +516,23 @@ function Me(e, t, n = []) {
|
|
|
512
516
|
let r = [], i = (e, n, i) => {
|
|
513
517
|
r.push(...Ne(n, t, i).map((t) => `${e}/${t}`));
|
|
514
518
|
}, a = (e) => {
|
|
515
|
-
for (let t of e) i(t.id, t,
|
|
519
|
+
for (let t of e) i(t.id, t, S(t, n)), t.type === "section" ? t.children.forEach(a) : t.type === "wrapper" && a(t.children);
|
|
516
520
|
};
|
|
517
|
-
return a(e.blocks), i("settings", e.settings,
|
|
521
|
+
return a(e.blocks), i("settings", e.settings, _), r;
|
|
518
522
|
}
|
|
519
523
|
function Ne(e, t, n) {
|
|
520
524
|
let r = e.l10n?.[t];
|
|
521
525
|
return n.filter((t) => {
|
|
522
|
-
let n =
|
|
523
|
-
return typeof n != "string" || n === "" || r?.text?.[t] ? !1 : !Object.keys(r?.set ?? {}).some((n) => (t === n || t.startsWith(`${n}.`)) && (!n.includes(".") ||
|
|
526
|
+
let n = b(e, t);
|
|
527
|
+
return typeof n != "string" || n === "" || r?.text?.[t] ? !1 : !Object.keys(r?.set ?? {}).some((n) => (t === n || t.startsWith(`${n}.`)) && (!n.includes(".") || b(e, n.slice(0, n.lastIndexOf("."))) !== void 0));
|
|
524
528
|
});
|
|
525
529
|
}
|
|
526
530
|
function Pe(e, t, n = {}) {
|
|
527
531
|
let r = T(e), i = (e, n, i) => {
|
|
528
|
-
let a = Ne(e, t, i), o =
|
|
532
|
+
let a = Ne(e, t, i), o = h(e.l10n ?? {}), s = o[t] ?? {}, c = h(e);
|
|
529
533
|
delete c.l10n;
|
|
530
|
-
for (let [e, t] of w(s.set))
|
|
531
|
-
for (let [t, n] of Object.entries(s.text ?? {}))
|
|
534
|
+
for (let [e, t] of w(s.set)) x(c, e, t);
|
|
535
|
+
for (let [t, n] of Object.entries(s.text ?? {})) b(e, t) !== void 0 && x(c, t, n.value);
|
|
532
536
|
delete o[t];
|
|
533
537
|
let l = {}, u = /* @__PURE__ */ new Set([
|
|
534
538
|
...Object.keys(s.set ?? {}),
|
|
@@ -536,22 +540,22 @@ function Pe(e, t, n = {}) {
|
|
|
536
540
|
...a
|
|
537
541
|
]);
|
|
538
542
|
for (let t of u) {
|
|
539
|
-
let r =
|
|
540
|
-
|
|
543
|
+
let r = b(e, t), i = b(c, t);
|
|
544
|
+
g(r, i) ? (s.text?.[t] || a.includes(t)) && n(t) && typeof r == "string" && r !== "" && ((l.text ??= {})[t] = {
|
|
541
545
|
value: r,
|
|
542
546
|
sourceHash: C(r)
|
|
543
547
|
}) : n(t) && typeof r == "string" && typeof i == "string" ? (l.text ??= {})[t] = {
|
|
544
548
|
value: r,
|
|
545
549
|
sourceHash: C(i)
|
|
546
|
-
} : (l.set ??= {})[t] = r === void 0 ? null :
|
|
550
|
+
} : (l.set ??= {})[t] = r === void 0 ? null : h(r);
|
|
547
551
|
}
|
|
548
552
|
let d = (e, t) => {
|
|
549
553
|
let n = /* @__PURE__ */ new Set();
|
|
550
554
|
for (let t of Object.keys(e.set ?? {})) {
|
|
551
555
|
let e = t.split(".");
|
|
552
556
|
for (; e.length > 1;) {
|
|
553
|
-
let t =
|
|
554
|
-
if (
|
|
557
|
+
let t = b(c, e.slice(0, -1).join("."));
|
|
558
|
+
if (v(t) || Array.isArray(t) && b(c, e.join(".")) !== void 0) break;
|
|
555
559
|
e.pop();
|
|
556
560
|
}
|
|
557
561
|
let r = e.join(".");
|
|
@@ -559,20 +563,20 @@ function Pe(e, t, n = {}) {
|
|
|
559
563
|
}
|
|
560
564
|
for (let r of n) {
|
|
561
565
|
for (let t of ["text", "set"]) for (let n of Object.keys(e[t] ?? {})) (n === r || n.startsWith(`${r}.`)) && delete e[t][n];
|
|
562
|
-
let n =
|
|
563
|
-
(e.set ??= {})[r] = n === void 0 ? null :
|
|
566
|
+
let n = b(t, r);
|
|
567
|
+
(e.set ??= {})[r] = n === void 0 ? null : h(n);
|
|
564
568
|
}
|
|
565
569
|
e.text && !Object.keys(e.text).length && delete e.text;
|
|
566
570
|
};
|
|
567
571
|
for (let t of Object.values(o)) {
|
|
568
|
-
let n =
|
|
569
|
-
for (let [e, r] of w(t.set))
|
|
570
|
-
for (let [r, i] of Object.entries(t.text ?? {}))
|
|
572
|
+
let n = h(e);
|
|
573
|
+
for (let [e, r] of w(t.set)) x(n, e, r);
|
|
574
|
+
for (let [r, i] of Object.entries(t.text ?? {})) b(e, r) !== void 0 && x(n, r, i.value);
|
|
571
575
|
for (let [n, r] of Object.entries(t.text ?? {})) {
|
|
572
|
-
let i =
|
|
576
|
+
let i = b(c, n);
|
|
573
577
|
if (typeof i != "string") (t.set ??= {})[n] = r.value, delete t.text[n];
|
|
574
578
|
else {
|
|
575
|
-
let t =
|
|
579
|
+
let t = b(e, n);
|
|
576
580
|
typeof t == "string" && r.sourceHash === C(t) && (r.sourceHash = C(i));
|
|
577
581
|
}
|
|
578
582
|
}
|
|
@@ -580,9 +584,9 @@ function Pe(e, t, n = {}) {
|
|
|
580
584
|
}
|
|
581
585
|
return Object.keys(l).length && (d(l, e), o[r] = l), Object.keys(o).length && (c.l10n = o), c;
|
|
582
586
|
}, a = (e) => e.map((e) => {
|
|
583
|
-
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 ?? {}))])] :
|
|
584
|
-
return e.type === "custom" && r.type === "custom" && !
|
|
585
|
-
}), o = i(e.settings, (e) =>
|
|
587
|
+
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 ?? {}))])] : S(e), r = i(e, (n) => e.type === "custom" ? t.includes(n) : we(e.type, n), t);
|
|
588
|
+
return e.type === "custom" && r.type === "custom" && !g(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;
|
|
589
|
+
}), o = i(e.settings, (e) => _.includes(e), _);
|
|
586
590
|
return o.locale = t, o.locales = e.settings.locales.map((e) => e === t ? r : e), {
|
|
587
591
|
blocks: a(e.blocks),
|
|
588
592
|
settings: o
|
|
@@ -590,9 +594,9 @@ function Pe(e, t, n = {}) {
|
|
|
590
594
|
}
|
|
591
595
|
// ../types/src/operations.ts
|
|
592
596
|
function Fe(e, t, n = []) {
|
|
593
|
-
let r = Object.fromEntries(
|
|
597
|
+
let r = Object.fromEntries(P(e.blocks).flatMap((e) => {
|
|
594
598
|
if (e.type !== "custom") return [];
|
|
595
|
-
let t =
|
|
599
|
+
let t = S(e, n).filter((t) => typeof b(e, t) == "string");
|
|
596
600
|
return t.length && Ve.has(e.id) && O("invalid_operation", 0, He), t.length ? [[e.id, t]] : [];
|
|
597
601
|
}));
|
|
598
602
|
return {
|
|
@@ -610,10 +614,10 @@ var E = class extends Error {
|
|
|
610
614
|
}
|
|
611
615
|
};
|
|
612
616
|
function Ie(e) {
|
|
613
|
-
return e === "1" ? 1 : e === "3" ? 3 : 2;
|
|
617
|
+
return e === "1" ? 1 : e === "3" || e === "1-2-1" ? 3 : e === "4" ? 4 : 2;
|
|
614
618
|
}
|
|
615
619
|
function Le(e, t, n = {}) {
|
|
616
|
-
let r =
|
|
620
|
+
let r = h(e);
|
|
617
621
|
return D(r, t, n), r;
|
|
618
622
|
}
|
|
619
623
|
function D(e, t, n = {}) {
|
|
@@ -621,7 +625,7 @@ function D(e, t, n = {}) {
|
|
|
621
625
|
locks: n.locks ?? [],
|
|
622
626
|
session: n.session ?? null
|
|
623
627
|
};
|
|
624
|
-
t.forEach((t, n) =>
|
|
628
|
+
t.forEach((t, n) => st(e, t, n, r));
|
|
625
629
|
}
|
|
626
630
|
var Re = /* @__PURE__ */ new Set([
|
|
627
631
|
"id",
|
|
@@ -646,15 +650,15 @@ function k(e) {
|
|
|
646
650
|
function A(e) {
|
|
647
651
|
return e.type === "section";
|
|
648
652
|
}
|
|
649
|
-
function
|
|
653
|
+
function Ue(e) {
|
|
650
654
|
return Array.isArray(e.blocks) ? e.blocks : [];
|
|
651
655
|
}
|
|
652
|
-
function
|
|
656
|
+
function We(e) {
|
|
653
657
|
let t = e.children;
|
|
654
658
|
return Array.isArray(t) ? t.map((e) => Array.isArray(e) ? e : []) : [];
|
|
655
659
|
}
|
|
656
|
-
function
|
|
657
|
-
let n =
|
|
660
|
+
function j(e, t) {
|
|
661
|
+
let n = Ue(e);
|
|
658
662
|
for (let e = 0; e < n.length; e++) {
|
|
659
663
|
let r = n[e];
|
|
660
664
|
if (!k(r)) continue;
|
|
@@ -684,33 +688,33 @@ function M(e, t) {
|
|
|
684
688
|
}
|
|
685
689
|
return null;
|
|
686
690
|
}
|
|
687
|
-
function
|
|
691
|
+
function Ge(e) {
|
|
688
692
|
let t = typeof e.id == "string" ? [e.id] : [];
|
|
689
|
-
if (A(e)) for (let n of
|
|
693
|
+
if (A(e)) for (let n of We(e)) t.push(...Ke(n));
|
|
690
694
|
return t;
|
|
691
695
|
}
|
|
692
|
-
function
|
|
693
|
-
return e.flatMap((e) => k(e) ?
|
|
696
|
+
function Ke(e) {
|
|
697
|
+
return e.flatMap((e) => k(e) ? Ge(e) : []);
|
|
694
698
|
}
|
|
695
|
-
function
|
|
699
|
+
function qe(e, t) {
|
|
696
700
|
return typeof e.blockId != "string" || e.blockId === "" ? O("invalid_operation", t, "blockId must be a block id.") : e.blockId;
|
|
697
701
|
}
|
|
698
|
-
function
|
|
702
|
+
function Je(e, t) {
|
|
699
703
|
let n = e.parent;
|
|
700
704
|
return n === null ? null : k(n) && typeof n.sectionId == "string" && typeof n.column == "number" && Number.isInteger(n.column) ? {
|
|
701
705
|
sectionId: n.sectionId,
|
|
702
706
|
column: n.column
|
|
703
707
|
} : O("invalid_operation", t, "parent must be null or { \"sectionId\", \"column\" }.");
|
|
704
708
|
}
|
|
705
|
-
function
|
|
709
|
+
function Ye(e, t) {
|
|
706
710
|
let n = e.after;
|
|
707
711
|
return n === null ? null : typeof n == "string" && n !== "" ? n : O("invalid_operation", t, "after must be null or a block id.");
|
|
708
712
|
}
|
|
709
|
-
function
|
|
713
|
+
function M(e, t) {
|
|
710
714
|
let n = e.expect;
|
|
711
715
|
return n == null ? null : k(n) ? n : O("invalid_operation", t, "expect must be an object.");
|
|
712
716
|
}
|
|
713
|
-
function
|
|
717
|
+
function Xe(e, t, n) {
|
|
714
718
|
let r = e.set ?? null, i = e.unset ?? [];
|
|
715
719
|
(r === null || k(r)) && Array.isArray(i) && i.every((e) => typeof e == "string") || O("invalid_operation", t, "set must be an object and unset a list of keys.");
|
|
716
720
|
let a = r === null ? {} : r, o = Object.keys(a).filter((e) => a[e] !== void 0);
|
|
@@ -722,40 +726,40 @@ function qe(e, t, n) {
|
|
|
722
726
|
unset: i
|
|
723
727
|
};
|
|
724
728
|
}
|
|
725
|
-
function
|
|
729
|
+
function Ze(e, t, n) {
|
|
726
730
|
if (k(e) && typeof e.id == "string" && e.id !== "" && typeof e.type == "string" || O("invalid_operation", t, "A block needs a non-empty string id and a string type."), !A(e)) return;
|
|
727
731
|
n && O("invalid_operation", t, "Sections can only be placed at the top level.");
|
|
728
732
|
let r = e.children;
|
|
729
733
|
Array.isArray(r) && r.every((e) => Array.isArray(e)) || O("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)
|
|
734
|
+
for (let e of r) for (let n of e) Ze(n, t, !0);
|
|
731
735
|
}
|
|
732
|
-
function
|
|
736
|
+
function N(e, t) {
|
|
733
737
|
return e.session === null || t.sessionId !== e.session;
|
|
734
738
|
}
|
|
735
|
-
function
|
|
736
|
-
let r = e.locks.find((n) => t.includes(n.blockId) &&
|
|
739
|
+
function Qe(e, t, n) {
|
|
740
|
+
let r = e.locks.find((n) => t.includes(n.blockId) && N(e, n));
|
|
737
741
|
r && O("lock_held", n, `Block "${r.blockId}" is being edited in another session.`, r.blockId);
|
|
738
742
|
}
|
|
739
|
-
function
|
|
740
|
-
e.locks.find((r) =>
|
|
743
|
+
function $e(e, t, n, r) {
|
|
744
|
+
e.locks.find((r) => N(e, r) && r.blockId === t && ((r.locale ?? null) === null || r.locale === n)) && O("lock_held", r, `Block "${t}" is being edited in another session.`, t);
|
|
741
745
|
}
|
|
742
|
-
function
|
|
743
|
-
for (let [i, a] of Object.entries(t)) a !== void 0 && (
|
|
746
|
+
function et(e, t, n, r) {
|
|
747
|
+
for (let [i, a] of Object.entries(t)) a !== void 0 && (g(Object.hasOwn(e, i) && e[i] !== void 0 ? e[i] : null, a) || O("precondition_failed", n, r === void 0 ? `Setting "${i}" has changed since.` : `"${i}" of block "${r}" has changed since.`, r));
|
|
744
748
|
}
|
|
745
|
-
function
|
|
749
|
+
function tt(e, t, n) {
|
|
746
750
|
if (t === null) return Array.isArray(e.blocks) || (e.blocks = []), e.blocks;
|
|
747
|
-
let r =
|
|
751
|
+
let r = j(e, t.sectionId);
|
|
748
752
|
if (!r) return O("block_missing", n, `No section with id "${t.sectionId}".`, t.sectionId);
|
|
749
753
|
if (!A(r.block)) return O("invalid_operation", n, `Block "${t.sectionId}" isn't a section.`);
|
|
750
754
|
let i = r.block.children;
|
|
751
755
|
return !Array.isArray(i) || t.column < 0 || t.column >= i.length ? O("invalid_operation", n, `Section "${t.sectionId}" has no column ${t.column}.`) : (Array.isArray(i[t.column]) || (i[t.column] = []), i[t.column]);
|
|
752
756
|
}
|
|
753
|
-
function
|
|
757
|
+
function nt(e, t, n) {
|
|
754
758
|
if (t === null) return 0;
|
|
755
759
|
let r = e.findIndex((e) => k(e) && e.id === t);
|
|
756
760
|
return r === -1 ? O("anchor_missing", n, `No block "${t}" in the target container.`, t) : r + 1;
|
|
757
761
|
}
|
|
758
|
-
function
|
|
762
|
+
function rt(e, t, n, r) {
|
|
759
763
|
let i = Ie(t), a = Array.isArray(e.children) ? e.children : [];
|
|
760
764
|
for (let e = i; e < a.length; e++) {
|
|
761
765
|
let t = a[e];
|
|
@@ -765,17 +769,17 @@ function tt(e, t, n, r) {
|
|
|
765
769
|
for (; o.length < i;) o.push([]);
|
|
766
770
|
e.children = o;
|
|
767
771
|
}
|
|
768
|
-
function
|
|
772
|
+
function it(e, t, n) {
|
|
769
773
|
for (let [n, r] of Object.entries(t)) n === "__proto__" ? Object.defineProperty(e, n, {
|
|
770
|
-
value:
|
|
774
|
+
value: h(r),
|
|
771
775
|
writable: !0,
|
|
772
776
|
enumerable: !0,
|
|
773
777
|
configurable: !0
|
|
774
|
-
}) : e[n] =
|
|
778
|
+
}) : e[n] = h(r);
|
|
775
779
|
for (let t of n) delete e[t];
|
|
776
780
|
}
|
|
777
|
-
function
|
|
778
|
-
return
|
|
781
|
+
function at(e) {
|
|
782
|
+
return fe(e).map((t) => {
|
|
779
783
|
let n = t.path.replace(/\.(items|icons|rows)\[.*$/, "").replace(/\[(\d+)\]/g, ".$1").split(".").reduce((e, t) => e[t], e);
|
|
780
784
|
return {
|
|
781
785
|
id: t.id,
|
|
@@ -783,113 +787,113 @@ function rt(e) {
|
|
|
783
787
|
};
|
|
784
788
|
});
|
|
785
789
|
}
|
|
786
|
-
function
|
|
787
|
-
let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ?
|
|
790
|
+
function ot(e, t, n) {
|
|
791
|
+
let r = ({ id: e, blockId: t }) => JSON.stringify([t ?? null, e]), i = new Set(n ? at(n).map(r) : []), a = at(e).find((e) => !i.has(r(e)));
|
|
788
792
|
a && O("invalid_operation", t, `Element id "${a.id}" must not contain "." or "/".`, a.blockId);
|
|
789
793
|
}
|
|
790
|
-
function
|
|
794
|
+
function st(e, t, n, r) {
|
|
791
795
|
let i = t;
|
|
792
796
|
switch (k(i) && typeof i.op == "string" || O("invalid_operation", n, "Each operation must be an object with an \"op\"."), i.op) {
|
|
793
|
-
case "addBlock": return
|
|
794
|
-
case "moveBlock": return
|
|
795
|
-
case "deleteBlock": return
|
|
796
|
-
case "updateBlock": return
|
|
797
|
-
case "updateSettings": return
|
|
798
|
-
case "setContent": return
|
|
799
|
-
case "setDefaultLocale": return
|
|
800
|
-
case "addLocale": return
|
|
801
|
-
case "removeLocale": return
|
|
802
|
-
case "updateBlockLocale": return
|
|
803
|
-
case "updateSettingsLocale": return
|
|
797
|
+
case "addBlock": return ct(e, i, n);
|
|
798
|
+
case "moveBlock": return lt(e, i, n, r);
|
|
799
|
+
case "deleteBlock": return ut(e, i, n, r);
|
|
800
|
+
case "updateBlock": return dt(e, i, n, r);
|
|
801
|
+
case "updateSettings": return ft(e, i, n);
|
|
802
|
+
case "setContent": return Dt(e, i, n, r);
|
|
803
|
+
case "setDefaultLocale": return Ot(e, i, n, r);
|
|
804
|
+
case "addLocale": return ht(e, i, n);
|
|
805
|
+
case "removeLocale": return _t(e, i, n);
|
|
806
|
+
case "updateBlockLocale": return Tt(e, i, n, r);
|
|
807
|
+
case "updateSettingsLocale": return Et(e, i, n);
|
|
804
808
|
default: O("invalid_operation", n, `Unknown operation "${i.op}".`);
|
|
805
809
|
}
|
|
806
810
|
}
|
|
807
|
-
function
|
|
808
|
-
let r =
|
|
809
|
-
|
|
811
|
+
function ct(e, t, n) {
|
|
812
|
+
let r = Je(t, n), i = Ye(t, n), a = t.block;
|
|
813
|
+
Ze(a, n, r !== null), ot({
|
|
810
814
|
blocks: [a],
|
|
811
815
|
settings: e.settings
|
|
812
816
|
}, n);
|
|
813
|
-
let o = new Set(
|
|
814
|
-
for (let e of
|
|
815
|
-
let c =
|
|
816
|
-
|
|
817
|
+
let o = new Set(Ke(Ue(e))), s = /* @__PURE__ */ new Set();
|
|
818
|
+
for (let e of Ge(a)) (o.has(e) || s.has(e)) && O("block_exists", n, `A block with id "${e}" already exists.`, e), s.add(e);
|
|
819
|
+
let c = tt(e, r, n), l = nt(c, i, n);
|
|
820
|
+
wt(e, a, r, n, !0), c.splice(l, 0, h(a));
|
|
817
821
|
}
|
|
818
|
-
function
|
|
819
|
-
let i =
|
|
822
|
+
function lt(e, t, n, r) {
|
|
823
|
+
let i = qe(t, n), a = Je(t, n), o = Ye(t, n), s = M(t, n), c = j(e, i);
|
|
820
824
|
if (!c) return O("block_missing", n, `No block with id "${i}".`, i);
|
|
821
|
-
if (
|
|
825
|
+
if (Qe(r, Ge(c.block), n), s) {
|
|
822
826
|
let e = c.index > 0 ? c.list[c.index - 1] : null, t = k(e) ? e.id ?? null : null;
|
|
823
|
-
|
|
827
|
+
g(c.parent, s.parent ?? null) && g(t, s.after ?? null) || O("precondition_failed", n, `Block "${i}" has moved since.`, i);
|
|
824
828
|
}
|
|
825
829
|
A(c.block) && a !== null && O("invalid_operation", n, "Sections can only be placed at the top level."), o === i && O("invalid_operation", n, "A block can't be placed after itself.");
|
|
826
|
-
let l =
|
|
827
|
-
|
|
830
|
+
let l = tt(e, a, n);
|
|
831
|
+
nt(l.filter((e) => e !== c.block), o, n), wt(e, c.block, a, n, !1), c.list.splice(c.index, 1), l.splice(nt(l, o, n), 0, c.block);
|
|
828
832
|
}
|
|
829
|
-
function
|
|
830
|
-
let i =
|
|
833
|
+
function ut(e, t, n, r) {
|
|
834
|
+
let i = qe(t, n), a = M(t, n), o = j(e, i);
|
|
831
835
|
if (!o) return O("block_missing", n, `No block with id "${i}".`, i);
|
|
832
|
-
|
|
836
|
+
Qe(r, Ge(o.block), n), a && !g(o.block, a.block ?? null) && O("precondition_failed", n, `Block "${i}" has changed since.`, i), o.list.splice(o.index, 1);
|
|
833
837
|
}
|
|
834
|
-
function
|
|
835
|
-
let i =
|
|
838
|
+
function dt(e, t, n, r) {
|
|
839
|
+
let i = qe(t, n), { set: a, unset: o } = Xe(t, n, Re), s = M(t, n), c = j(e, i);
|
|
836
840
|
if (!c) return O("block_missing", n, `No block with id "${i}".`, i);
|
|
837
841
|
let l = c.block, u = A(l);
|
|
838
|
-
u && o.includes("columns") && O("invalid_operation", n, "A section's columns can't be unset; set another layout instead."),
|
|
842
|
+
u && o.includes("columns") && O("invalid_operation", n, "A section's columns can't be unset; set another layout instead."), Qe(r, [i], n), s && et(l, s, n, i);
|
|
839
843
|
let d = { ...l };
|
|
840
|
-
|
|
844
|
+
it(d, a, o), ot({
|
|
841
845
|
blocks: [d],
|
|
842
846
|
settings: e.settings
|
|
843
847
|
}, n, {
|
|
844
848
|
blocks: [l],
|
|
845
849
|
settings: e.settings
|
|
846
|
-
}), u && Object.hasOwn(a, "columns") &&
|
|
847
|
-
let f =
|
|
848
|
-
|
|
850
|
+
}), u && Object.hasOwn(a, "columns") && rt(l, a.columns, n, i), it(l, a, o);
|
|
851
|
+
let f = be(l);
|
|
852
|
+
g(l.l10n, f.l10n) || (f.l10n ? l.l10n = f.l10n : delete l.l10n), u && f.type === "section" && !g(l.children, f.children) && (l.children = f.children);
|
|
849
853
|
}
|
|
850
|
-
function
|
|
851
|
-
let { set: r, unset: i } =
|
|
854
|
+
function ft(e, t, n) {
|
|
855
|
+
let { set: r, unset: i } = Xe(t, n, ze), a = M(t, n);
|
|
852
856
|
e.settings?.locales?.length && (Object.hasOwn(r, "locale") || i.includes("locale")) && O("invalid_operation", n, "The default locale can't change while language versions exist."), k(e.settings) || (e.settings = {});
|
|
853
857
|
let o = e.settings;
|
|
854
|
-
a &&
|
|
855
|
-
let s =
|
|
856
|
-
|
|
858
|
+
a && et(o, a, n), it(o, r, i);
|
|
859
|
+
let s = Se(e.settings);
|
|
860
|
+
g(o.l10n, s.l10n) || (s.l10n ? o.l10n = s.l10n : delete o.l10n);
|
|
857
861
|
}
|
|
858
|
-
function
|
|
862
|
+
function pt(e, t) {
|
|
859
863
|
let n = e.locale;
|
|
860
|
-
return
|
|
864
|
+
return ge(n) && n !== "__proto__" && n !== "constructor" && n !== "prototype" || O("invalid_operation", t, "locale must be a language tag."), n;
|
|
861
865
|
}
|
|
862
|
-
function
|
|
863
|
-
let r =
|
|
866
|
+
function mt(e, t, n) {
|
|
867
|
+
let r = pt(t, n);
|
|
864
868
|
return e.settings.locales?.includes(r) || O("invalid_operation", n, `Locale "${r}" isn't in settings.locales.`), r;
|
|
865
869
|
}
|
|
866
|
-
function
|
|
867
|
-
let r =
|
|
870
|
+
function ht(e, t, n) {
|
|
871
|
+
let r = pt(t, n), i = e.settings.locales ?? [], a = r.toLowerCase(), o = t.position === void 0 ? i.length : t.position;
|
|
868
872
|
(T(e).toLowerCase() === a || i.some((e) => e.toLowerCase() === a) || typeof o != "number" || !Number.isInteger(o) || o < 0 || o > i.length) && O("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);
|
|
869
873
|
}
|
|
870
|
-
function
|
|
871
|
-
return e.flatMap((e) => k(e) ? [e, ...A(e) ?
|
|
874
|
+
function P(e) {
|
|
875
|
+
return e.flatMap((e) => k(e) ? [e, ...A(e) ? We(e).flatMap(P) : e.type === "wrapper" && Array.isArray(e.children) ? P(e.children) : []] : []);
|
|
872
876
|
}
|
|
873
|
-
function
|
|
877
|
+
function gt(e, t) {
|
|
874
878
|
let n = e.l10n;
|
|
875
879
|
return k(n) && k(n[t]) ? n[t] : {};
|
|
876
880
|
}
|
|
877
|
-
function
|
|
878
|
-
let r =
|
|
881
|
+
function _t(e, t, n) {
|
|
882
|
+
let r = mt(e, t, n), i = M(t, n);
|
|
879
883
|
i && (!k(i.blocks) || i.settings !== void 0 && !k(i.settings)) && O("invalid_operation", n, "expect needs a blocks object and an optional settings layer.");
|
|
880
|
-
let a = e.settings, o =
|
|
881
|
-
!i ||
|
|
884
|
+
let a = e.settings, o = P(Ue(e)), s = Object.fromEntries(o.flatMap((e) => k(e.l10n) && Object.hasOwn(e.l10n, r) ? [[String(e.id), e.l10n[r]]] : []));
|
|
885
|
+
!i || g(s, i.blocks) && g(k(a.l10n) ? a.l10n[r] : void 0, i.settings) || O("precondition_failed", n, `Locale "${r}" has changed since.`);
|
|
882
886
|
for (let e of [...o, a]) k(e.l10n) && (delete e.l10n[r], Object.keys(e.l10n).length === 0 && delete e.l10n);
|
|
883
887
|
e.settings.locales.splice(e.settings.locales.indexOf(r), 1), e.settings.locales.length === 0 && delete e.settings.locales;
|
|
884
888
|
}
|
|
885
|
-
function
|
|
886
|
-
(e.text === void 0 || ((e) => k(e) && Object.values(e).every((e) => k(e) && typeof e.value == "string" && typeof e.sourceHash == "string"))(e.text)) && (e.set === void 0 || k(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 !== "" &&
|
|
889
|
+
function vt(e, t, n) {
|
|
890
|
+
(e.text === void 0 || ((e) => k(e) && Object.values(e).every((e) => k(e) && typeof e.value == "string" && typeof e.sourceHash == "string"))(e.text)) && (e.set === void 0 || k(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 !== "" && y(e))) && (e.hidden === void 0 || !n && typeof e.hidden == "boolean") && [
|
|
887
891
|
"text",
|
|
888
892
|
"set",
|
|
889
893
|
"unset",
|
|
890
894
|
...n ? [] : ["hidden"]
|
|
891
895
|
].some((t) => e[t] !== void 0) || O("invalid_operation", t, "A locale update needs text, set, unset or a block's boolean hidden.");
|
|
892
|
-
let r =
|
|
896
|
+
let r = M(e, t);
|
|
893
897
|
return r && (r.text !== void 0 && !k(r.text) || r.set !== void 0 && !k(r.set) || r.hidden !== void 0 && (n || typeof r.hidden != "boolean")) && O("invalid_operation", t, "The locale layer expect is malformed."), {
|
|
894
898
|
text: e.text ?? {},
|
|
895
899
|
set: e.set ?? {},
|
|
@@ -898,83 +902,83 @@ function gt(e, t, n) {
|
|
|
898
902
|
expect: r
|
|
899
903
|
};
|
|
900
904
|
}
|
|
901
|
-
function
|
|
902
|
-
for (let i of Object.keys(t.text))
|
|
905
|
+
function yt(e, t, n, r) {
|
|
906
|
+
for (let i of Object.keys(t.text)) y(i) && (r ? _.includes(i) : we(String(e.type), i)) && b(e, i) !== void 0 || O("invalid_operation", n, `Text path "${i}" isn't translatable or doesn't resolve.`);
|
|
903
907
|
for (let i of Object.keys(t.set)) {
|
|
904
|
-
let a = i.split("."), o = r ? Be : Re, s = a.length === 1 ? e :
|
|
905
|
-
(!
|
|
908
|
+
let a = i.split("."), o = r ? Be : Re, s = a.length === 1 ? e : b(e, a.slice(0, -1).join("."));
|
|
909
|
+
(!y(i) || o.has(a[0]) || !r && xe(e, i, t.set[i]) || b(e, i) === void 0 && !k(s)) && O("invalid_operation", n, `Override path "${i}" is immutable or doesn't resolve.`);
|
|
906
910
|
}
|
|
907
911
|
}
|
|
908
|
-
function
|
|
912
|
+
function bt(e, t, n, r) {
|
|
909
913
|
if (t) {
|
|
910
|
-
for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {}))
|
|
911
|
-
t.hidden !== void 0 && !
|
|
914
|
+
for (let i of ["text", "set"]) for (let [a, o] of Object.entries(t[i] ?? {})) g(e[i]?.[a] ?? null, o) || O("precondition_failed", n, `Locale path "${a}" has changed since.`, r);
|
|
915
|
+
t.hidden !== void 0 && !g(e.hidden === !0, t.hidden) && O("precondition_failed", n, "The locale's hidden state has changed since.", r);
|
|
912
916
|
}
|
|
913
917
|
}
|
|
914
|
-
function
|
|
918
|
+
function xt(e, t, n) {
|
|
915
919
|
k(e.l10n) || (e.l10n = {});
|
|
916
920
|
let r = e.l10n;
|
|
917
921
|
k(r[t]) || (r[t] = {});
|
|
918
922
|
let i = r[t];
|
|
919
923
|
for (let e of n.unset) i.text && delete i.text[e], i.set && delete i.set[e];
|
|
920
|
-
for (let [e, t] of Object.entries(n.text)) i.text ||= {}, i.text[e] =
|
|
921
|
-
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] = h(t), i.set && delete i.set[e];
|
|
925
|
+
for (let [e, t] of Object.entries(n.set)) i.set ||= {}, i.set[e] = h(t), i.text && delete i.text[e];
|
|
922
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;
|
|
923
927
|
}
|
|
924
|
-
function
|
|
925
|
-
return k(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(
|
|
928
|
+
function F(e) {
|
|
929
|
+
return k(e) ? e.type === "slot" || Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(F) : F(e)) : !1;
|
|
926
930
|
}
|
|
927
|
-
function
|
|
931
|
+
function St(e) {
|
|
928
932
|
return k(e) && k(e.l10n) && Object.values(e.l10n).some((e) => k(e) && e.hidden === !0);
|
|
929
933
|
}
|
|
930
|
-
function
|
|
931
|
-
return !k(e) || !
|
|
934
|
+
function Ct(e) {
|
|
935
|
+
return !k(e) || !F(e) ? !1 : St(e) ? !0 : Array.isArray(e.children) && e.children.some((e) => Array.isArray(e) ? e.some(Ct) : Ct(e));
|
|
932
936
|
}
|
|
933
|
-
function
|
|
934
|
-
if (!
|
|
935
|
-
let a = n === null ? null :
|
|
936
|
-
(a !== null &&
|
|
937
|
+
function wt(e, t, n, r, i) {
|
|
938
|
+
if (!F(t)) return;
|
|
939
|
+
let a = n === null ? null : j(e, n.sectionId);
|
|
940
|
+
(a !== null && St(a.block) || i && Ct(t)) && O("invalid_operation", r, "A layout's slot block can't be placed inside a block that a language hides.", k(t) && typeof t.id == "string" ? t.id : void 0);
|
|
937
941
|
}
|
|
938
|
-
function
|
|
939
|
-
let i =
|
|
940
|
-
s || O("block_missing", n, `No block with id "${a}".`, a),
|
|
942
|
+
function Tt(e, t, n, r) {
|
|
943
|
+
let i = mt(e, t, n), a = qe(t, n), o = vt(t, n, !1), s = P(Ue(e)).find((e) => e.id === a);
|
|
944
|
+
s || O("block_missing", n, `No block with id "${a}".`, a), yt(s, o, n, !1), $e(r, a, i, n), bt(gt(s, i), o.expect, n, a), o.hidden === !0 && F(s) && O("invalid_operation", n, "A layout's slot block, and any block that contains it, can't be hidden.", a), xt(s, i, o);
|
|
941
945
|
}
|
|
942
|
-
function
|
|
943
|
-
let r =
|
|
944
|
-
|
|
946
|
+
function Et(e, t, n) {
|
|
947
|
+
let r = mt(e, t, n), i = vt(t, n, !0), a = e.settings;
|
|
948
|
+
yt(a, i, n, !0), bt(gt(a, r), i.expect, n), xt(a, r, i);
|
|
945
949
|
}
|
|
946
|
-
function
|
|
950
|
+
function Dt(e, t, n, r) {
|
|
947
951
|
let i = t.content;
|
|
948
952
|
if (!k(i) || !Array.isArray(i.blocks) || !k(i.settings)) return O("invalid_operation", n, "setContent needs content with a blocks array and a settings object.");
|
|
949
|
-
|
|
950
|
-
let a = r.locks.find((e) =>
|
|
951
|
-
a && O("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks =
|
|
953
|
+
ot(i, n, e);
|
|
954
|
+
let a = r.locks.find((e) => N(r, e));
|
|
955
|
+
a && O("locked_by_others", n, "Other sessions hold locks on this template.", a.blockId), e.blocks = h(i.blocks), e.settings = h(i.settings);
|
|
952
956
|
}
|
|
953
|
-
function
|
|
954
|
-
let i =
|
|
957
|
+
function Ot(e, t, n, r) {
|
|
958
|
+
let i = pt(t, n);
|
|
955
959
|
e.settings.locales?.includes(i) || O("invalid_operation", n, `"${i}" is not a language version of this template.`);
|
|
956
960
|
let a = je(e, i);
|
|
957
961
|
a.length && O("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]);
|
|
958
|
-
let o = r.locks.find((e) =>
|
|
962
|
+
let o = r.locks.find((e) => N(r, e));
|
|
959
963
|
o && O("locked_by_others", n, "Other sessions hold locks on this template.", o.blockId);
|
|
960
964
|
let s = t.customTextFields;
|
|
961
965
|
if (s !== void 0) {
|
|
962
|
-
let t =
|
|
966
|
+
let t = P(e.blocks);
|
|
963
967
|
(!k(s) || Object.getOwnPropertyNames(s).some((e) => {
|
|
964
968
|
if (Ve.has(e)) return !0;
|
|
965
969
|
let n = s[e], r = t.find((t) => t.id === e);
|
|
966
|
-
return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !
|
|
970
|
+
return r?.type !== "custom" || !Array.isArray(n) || n.some((e) => typeof e != "string" || !y(e) || !we("custom", e) || typeof b(r, e) != "string");
|
|
967
971
|
})) && O("invalid_operation", n, He);
|
|
968
972
|
}
|
|
969
973
|
let c = Pe(e, i, t.customTextFields);
|
|
970
974
|
e.blocks = c.blocks, e.settings = c.settings;
|
|
971
975
|
}
|
|
972
976
|
// ../types/src/invert-operations.ts
|
|
973
|
-
function
|
|
977
|
+
function kt(e) {
|
|
974
978
|
let t = e.children;
|
|
975
979
|
return e.type === "section" && Array.isArray(t) ? t : [];
|
|
976
980
|
}
|
|
977
|
-
function
|
|
981
|
+
function At(e, t, n = null) {
|
|
978
982
|
for (let r = 0; r < e.length; r++) {
|
|
979
983
|
let i = e[r];
|
|
980
984
|
if (i.id === t) return {
|
|
@@ -982,10 +986,10 @@ function Ot(e, t, n = null) {
|
|
|
982
986
|
parent: n,
|
|
983
987
|
after: r > 0 ? e[r - 1].id : null
|
|
984
988
|
};
|
|
985
|
-
let a =
|
|
989
|
+
let a = kt(i);
|
|
986
990
|
for (let e = 0; e < a.length; e++) {
|
|
987
991
|
if (!Array.isArray(a[e])) continue;
|
|
988
|
-
let n =
|
|
992
|
+
let n = At(a[e], t, {
|
|
989
993
|
sectionId: i.id,
|
|
990
994
|
column: e
|
|
991
995
|
});
|
|
@@ -994,18 +998,18 @@ function Ot(e, t, n = null) {
|
|
|
994
998
|
}
|
|
995
999
|
return null;
|
|
996
1000
|
}
|
|
997
|
-
function
|
|
998
|
-
let r =
|
|
1001
|
+
function jt(e, t, n) {
|
|
1002
|
+
let r = At(e.blocks, t);
|
|
999
1003
|
if (!r) throw new E("block_missing", n, `No block with id "${t}".`, t);
|
|
1000
1004
|
return r;
|
|
1001
1005
|
}
|
|
1002
|
-
function
|
|
1006
|
+
function Mt(e, t, n) {
|
|
1003
1007
|
let r = {}, i = [], a = {}, o = [.../* @__PURE__ */ new Set([...Object.keys(t ?? {}), ...n ?? []])];
|
|
1004
1008
|
for (let n of o) {
|
|
1005
1009
|
let o = e[n];
|
|
1006
|
-
o === void 0 ? i.push(n) : r[n] =
|
|
1010
|
+
o === void 0 ? i.push(n) : r[n] = h(o);
|
|
1007
1011
|
let s = t && n in t ? t[n] : void 0;
|
|
1008
|
-
a[n] = s === void 0 ? null :
|
|
1012
|
+
a[n] = s === void 0 ? null : h(s);
|
|
1009
1013
|
}
|
|
1010
1014
|
return {
|
|
1011
1015
|
set: r,
|
|
@@ -1013,13 +1017,13 @@ function At(e, t, n) {
|
|
|
1013
1017
|
expect: a
|
|
1014
1018
|
};
|
|
1015
1019
|
}
|
|
1016
|
-
function
|
|
1020
|
+
function I(e, t) {
|
|
1017
1021
|
return e.l10n?.[t] ?? {};
|
|
1018
1022
|
}
|
|
1019
|
-
function
|
|
1023
|
+
function L(e, t, n, r) {
|
|
1020
1024
|
let i = {}, a = {}, o = {};
|
|
1021
1025
|
n.length && (o.text = {}, o.set = {});
|
|
1022
|
-
for (let r of n) e.text?.[r] !== void 0 && (i[r] =
|
|
1026
|
+
for (let r of n) e.text?.[r] !== void 0 && (i[r] = h(e.text[r])), e.set && Object.hasOwn(e.set, r) && (a[r] = h(e.set[r])), o.text[r] = h(t.text?.[r] ?? null), o.set[r] = h(t.set?.[r] ?? null);
|
|
1023
1027
|
return r && (o.hidden = t.hidden === !0), {
|
|
1024
1028
|
unset: n,
|
|
1025
1029
|
...Object.keys(i).length ? { text: i } : {},
|
|
@@ -1028,21 +1032,21 @@ function z(e, t, n, r) {
|
|
|
1028
1032
|
expect: o
|
|
1029
1033
|
};
|
|
1030
1034
|
}
|
|
1031
|
-
function
|
|
1032
|
-
let { unset: t, ...n } =
|
|
1035
|
+
function Nt(e) {
|
|
1036
|
+
let { unset: t, ...n } = L(e, {}, [.../* @__PURE__ */ new Set([...Object.keys(e.text ?? {}), ...Object.keys(e.set ?? {})])], e.hidden === !0);
|
|
1033
1037
|
return n;
|
|
1034
1038
|
}
|
|
1035
|
-
function
|
|
1036
|
-
return e.flatMap((e) => [e, ...e.type === "wrapper" ?
|
|
1039
|
+
function R(e) {
|
|
1040
|
+
return e.flatMap((e) => [e, ...e.type === "wrapper" ? R(e.children) : kt(e).flatMap(R)]);
|
|
1037
1041
|
}
|
|
1038
|
-
function
|
|
1039
|
-
let n =
|
|
1042
|
+
function Pt(e, t) {
|
|
1043
|
+
let n = h(e);
|
|
1040
1044
|
D(n, [t]);
|
|
1041
1045
|
let r = [], i = (e, t, n) => {
|
|
1042
1046
|
for (let [i, a] of Object.entries(e.l10n ?? {})) {
|
|
1043
1047
|
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))])];
|
|
1044
1048
|
if (!o.length) continue;
|
|
1045
|
-
let s =
|
|
1049
|
+
let s = L(a, e, o, !1);
|
|
1046
1050
|
r.push(n === void 0 ? {
|
|
1047
1051
|
op: "updateSettingsLocale",
|
|
1048
1052
|
locale: i,
|
|
@@ -1057,32 +1061,32 @@ function Mt(e, t) {
|
|
|
1057
1061
|
};
|
|
1058
1062
|
if (t.op === "updateSettings") i(e.settings, n.settings);
|
|
1059
1063
|
else {
|
|
1060
|
-
let t = new Map(
|
|
1061
|
-
for (let n of
|
|
1064
|
+
let t = new Map(R(n.blocks).map((e) => [e.id, e]));
|
|
1065
|
+
for (let n of R(e.blocks)) {
|
|
1062
1066
|
let e = t.get(n.id);
|
|
1063
1067
|
e && i(n, e, n.id);
|
|
1064
1068
|
}
|
|
1065
1069
|
}
|
|
1066
1070
|
return r;
|
|
1067
1071
|
}
|
|
1068
|
-
function
|
|
1072
|
+
function Ft(e, t, n) {
|
|
1069
1073
|
switch (t.op) {
|
|
1070
1074
|
case "addBlock": return {
|
|
1071
1075
|
op: "deleteBlock",
|
|
1072
1076
|
blockId: t.block.id,
|
|
1073
|
-
expect: { block:
|
|
1077
|
+
expect: { block: h(t.block) }
|
|
1074
1078
|
};
|
|
1075
1079
|
case "deleteBlock": {
|
|
1076
|
-
let r =
|
|
1080
|
+
let r = jt(e, t.blockId, n);
|
|
1077
1081
|
return {
|
|
1078
1082
|
op: "addBlock",
|
|
1079
|
-
block:
|
|
1083
|
+
block: h(r.block),
|
|
1080
1084
|
parent: r.parent,
|
|
1081
1085
|
after: r.after
|
|
1082
1086
|
};
|
|
1083
1087
|
}
|
|
1084
1088
|
case "moveBlock": {
|
|
1085
|
-
let r =
|
|
1089
|
+
let r = jt(e, t.blockId, n);
|
|
1086
1090
|
return {
|
|
1087
1091
|
op: "moveBlock",
|
|
1088
1092
|
blockId: t.blockId,
|
|
@@ -1095,23 +1099,23 @@ function Nt(e, t, n) {
|
|
|
1095
1099
|
};
|
|
1096
1100
|
}
|
|
1097
1101
|
case "updateBlock": {
|
|
1098
|
-
let r =
|
|
1102
|
+
let r = jt(e, t.blockId, n).block, { set: i, unset: a, expect: o } = Mt(r, t.set, t.unset);
|
|
1099
1103
|
return [{
|
|
1100
1104
|
op: "updateBlock",
|
|
1101
1105
|
blockId: t.blockId,
|
|
1102
1106
|
...Object.keys(i).length > 0 ? { set: i } : {},
|
|
1103
1107
|
...a.length > 0 ? { unset: a } : {},
|
|
1104
1108
|
expect: o
|
|
1105
|
-
}, ...
|
|
1109
|
+
}, ...Pt(e, t)];
|
|
1106
1110
|
}
|
|
1107
1111
|
case "updateSettings": {
|
|
1108
|
-
let { set: n, unset: r, expect: i } =
|
|
1112
|
+
let { set: n, unset: r, expect: i } = Mt(e.settings, t.set, t.unset);
|
|
1109
1113
|
return [{
|
|
1110
1114
|
op: "updateSettings",
|
|
1111
1115
|
...Object.keys(n).length > 0 ? { set: n } : {},
|
|
1112
1116
|
...r.length > 0 ? { unset: r } : {},
|
|
1113
1117
|
expect: i
|
|
1114
|
-
}, ...
|
|
1118
|
+
}, ...Pt(e, t)];
|
|
1115
1119
|
}
|
|
1116
1120
|
case "addLocale": return {
|
|
1117
1121
|
op: "removeLocale",
|
|
@@ -1124,18 +1128,18 @@ function Nt(e, t, n) {
|
|
|
1124
1128
|
locale: t.locale,
|
|
1125
1129
|
position: e.settings.locales?.indexOf(t.locale)
|
|
1126
1130
|
}];
|
|
1127
|
-
for (let r of
|
|
1131
|
+
for (let r of R(e.blocks)) {
|
|
1128
1132
|
let e = r.l10n?.[t.locale];
|
|
1129
1133
|
e && n.push({
|
|
1130
1134
|
op: "updateBlockLocale",
|
|
1131
1135
|
blockId: r.id,
|
|
1132
1136
|
locale: t.locale,
|
|
1133
|
-
...
|
|
1137
|
+
...Nt(e)
|
|
1134
1138
|
});
|
|
1135
1139
|
}
|
|
1136
1140
|
let r = e.settings.l10n?.[t.locale];
|
|
1137
1141
|
if (r) {
|
|
1138
|
-
let { hidden: e, ...i } =
|
|
1142
|
+
let { hidden: e, ...i } = Nt(r);
|
|
1139
1143
|
n.push({
|
|
1140
1144
|
op: "updateSettingsLocale",
|
|
1141
1145
|
locale: t.locale,
|
|
@@ -1146,7 +1150,7 @@ function Nt(e, t, n) {
|
|
|
1146
1150
|
}
|
|
1147
1151
|
case "updateBlockLocale":
|
|
1148
1152
|
case "updateSettingsLocale": {
|
|
1149
|
-
let n =
|
|
1153
|
+
let n = h(e);
|
|
1150
1154
|
D(n, [t]);
|
|
1151
1155
|
let r = [.../* @__PURE__ */ new Set([
|
|
1152
1156
|
...Object.keys(t.text ?? {}),
|
|
@@ -1154,15 +1158,15 @@ function Nt(e, t, n) {
|
|
|
1154
1158
|
...t.unset ?? []
|
|
1155
1159
|
])];
|
|
1156
1160
|
if (t.op === "updateBlockLocale") {
|
|
1157
|
-
let i =
|
|
1161
|
+
let i = R(e.blocks).find((e) => e.id === t.blockId), a = R(n.blocks).find((e) => e.id === t.blockId);
|
|
1158
1162
|
return {
|
|
1159
1163
|
op: "updateBlockLocale",
|
|
1160
1164
|
blockId: t.blockId,
|
|
1161
1165
|
locale: t.locale,
|
|
1162
|
-
...
|
|
1166
|
+
...L(I(i, t.locale), I(a, t.locale), r, t.hidden !== void 0)
|
|
1163
1167
|
};
|
|
1164
1168
|
}
|
|
1165
|
-
let { hidden: i, ...a } =
|
|
1169
|
+
let { hidden: i, ...a } = L(I(e.settings, t.locale), I(n.settings, t.locale), r, !1);
|
|
1166
1170
|
return {
|
|
1167
1171
|
op: "updateSettingsLocale",
|
|
1168
1172
|
locale: t.locale,
|
|
@@ -1173,17 +1177,17 @@ function Nt(e, t, n) {
|
|
|
1173
1177
|
case "setContent": return {
|
|
1174
1178
|
op: "setContent",
|
|
1175
1179
|
content: {
|
|
1176
|
-
blocks:
|
|
1177
|
-
settings:
|
|
1180
|
+
blocks: h(e.blocks),
|
|
1181
|
+
settings: h(e.settings)
|
|
1178
1182
|
}
|
|
1179
1183
|
};
|
|
1180
1184
|
}
|
|
1181
1185
|
}
|
|
1182
|
-
function
|
|
1183
|
-
let n =
|
|
1186
|
+
function It(e, t) {
|
|
1187
|
+
let n = h(e), r = [];
|
|
1184
1188
|
return t.forEach((e, t) => {
|
|
1185
1189
|
try {
|
|
1186
|
-
let i =
|
|
1190
|
+
let i = Ft(n, e, t);
|
|
1187
1191
|
r.push(...Array.isArray(i) ? [...i].reverse() : [i]), D(n, [e]);
|
|
1188
1192
|
} catch (e) {
|
|
1189
1193
|
throw e instanceof E ? new E(e.code, t, e.message, e.blockId) : e;
|
|
@@ -1191,77 +1195,77 @@ function Pt(e, t) {
|
|
|
1191
1195
|
}), r.reverse();
|
|
1192
1196
|
}
|
|
1193
1197
|
// ../types/src/collaboration.ts
|
|
1194
|
-
function
|
|
1198
|
+
function Lt(e) {
|
|
1195
1199
|
return e === "invalid_operation" ? 422 : e === "content_too_large" ? 413 : 409;
|
|
1196
1200
|
}
|
|
1197
|
-
var
|
|
1201
|
+
var Rt = class extends me {
|
|
1198
1202
|
opIndex;
|
|
1199
1203
|
holder;
|
|
1200
1204
|
holders;
|
|
1201
1205
|
constructor(e, t) {
|
|
1202
|
-
super(e, t.status ??
|
|
1206
|
+
super(e, t.status ?? Lt(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);
|
|
1203
1207
|
}
|
|
1204
1208
|
};
|
|
1205
1209
|
// ../types/src/guards.ts
|
|
1206
|
-
function
|
|
1210
|
+
function zt(e) {
|
|
1207
1211
|
return e.type === "section";
|
|
1208
1212
|
}
|
|
1209
|
-
function
|
|
1213
|
+
function Bt(e) {
|
|
1210
1214
|
return e.type === "title";
|
|
1211
1215
|
}
|
|
1212
|
-
function
|
|
1216
|
+
function Vt(e) {
|
|
1213
1217
|
return e.type === "paragraph";
|
|
1214
1218
|
}
|
|
1215
|
-
function
|
|
1219
|
+
function Ht(e) {
|
|
1216
1220
|
return e.type === "image";
|
|
1217
1221
|
}
|
|
1218
|
-
function
|
|
1222
|
+
function Ut(e) {
|
|
1219
1223
|
return e.type === "button";
|
|
1220
1224
|
}
|
|
1221
|
-
function
|
|
1225
|
+
function Wt(e) {
|
|
1222
1226
|
return e.type === "divider";
|
|
1223
1227
|
}
|
|
1224
|
-
function
|
|
1228
|
+
function Gt(e) {
|
|
1225
1229
|
return e.type === "video";
|
|
1226
1230
|
}
|
|
1227
|
-
function
|
|
1231
|
+
function Kt(e) {
|
|
1228
1232
|
return e.type === "social";
|
|
1229
1233
|
}
|
|
1230
|
-
function
|
|
1234
|
+
function qt(e) {
|
|
1231
1235
|
return e.type === "spacer";
|
|
1232
1236
|
}
|
|
1233
|
-
function
|
|
1237
|
+
function Jt(e) {
|
|
1234
1238
|
return e.type === "html";
|
|
1235
1239
|
}
|
|
1236
|
-
function
|
|
1240
|
+
function Yt(e) {
|
|
1237
1241
|
return e.type === "menu";
|
|
1238
1242
|
}
|
|
1239
|
-
function
|
|
1243
|
+
function Xt(e) {
|
|
1240
1244
|
return e.type === "table";
|
|
1241
1245
|
}
|
|
1242
|
-
function
|
|
1246
|
+
function Zt(e) {
|
|
1243
1247
|
return e.type === "countdown";
|
|
1244
1248
|
}
|
|
1245
|
-
function
|
|
1249
|
+
function Qt(e) {
|
|
1246
1250
|
return e.type === "custom";
|
|
1247
1251
|
}
|
|
1248
|
-
function
|
|
1252
|
+
function z(e) {
|
|
1249
1253
|
return e.type === "slot";
|
|
1250
1254
|
}
|
|
1251
|
-
function
|
|
1255
|
+
function B(e) {
|
|
1252
1256
|
return e.type === "wrapper";
|
|
1253
1257
|
}
|
|
1254
1258
|
// ../types/src/defaults.ts
|
|
1255
|
-
var
|
|
1259
|
+
var $t = {
|
|
1256
1260
|
content: "<p>Enter your title</p>",
|
|
1257
1261
|
level: 2,
|
|
1258
1262
|
textAlign: "left"
|
|
1259
|
-
},
|
|
1263
|
+
}, en = { content: "<p>Enter your text here</p>" }, tn = {
|
|
1260
1264
|
src: "",
|
|
1261
1265
|
alt: "",
|
|
1262
1266
|
width: "full",
|
|
1263
1267
|
align: "center"
|
|
1264
|
-
},
|
|
1268
|
+
}, nn = {
|
|
1265
1269
|
text: "Click Here",
|
|
1266
1270
|
url: "",
|
|
1267
1271
|
backgroundColor: "#333333",
|
|
@@ -1275,36 +1279,36 @@ var Zt = {
|
|
|
1275
1279
|
left: 24
|
|
1276
1280
|
},
|
|
1277
1281
|
align: "center"
|
|
1278
|
-
},
|
|
1282
|
+
}, rn = {
|
|
1279
1283
|
lineStyle: "solid",
|
|
1280
1284
|
color: "#e0e0e0",
|
|
1281
1285
|
thickness: 1,
|
|
1282
1286
|
width: "full"
|
|
1283
|
-
},
|
|
1287
|
+
}, an = { columns: "1" }, on = {
|
|
1284
1288
|
url: "",
|
|
1285
1289
|
thumbnailUrl: "",
|
|
1286
1290
|
alt: "Video",
|
|
1287
1291
|
width: "full",
|
|
1288
1292
|
align: "center"
|
|
1289
|
-
},
|
|
1293
|
+
}, sn = {
|
|
1290
1294
|
iconStyle: "solid",
|
|
1291
1295
|
iconSize: "medium",
|
|
1292
1296
|
spacing: 10,
|
|
1293
1297
|
align: "center"
|
|
1294
|
-
},
|
|
1298
|
+
}, cn = { height: 24 }, ln = { content: "" }, un = {
|
|
1295
1299
|
fontSize: 15,
|
|
1296
1300
|
textAlign: "center",
|
|
1297
1301
|
separator: "|",
|
|
1298
1302
|
separatorColor: "#e0e0e0",
|
|
1299
1303
|
spacing: 10
|
|
1300
|
-
},
|
|
1304
|
+
}, dn = {
|
|
1301
1305
|
hasHeaderRow: !0,
|
|
1302
1306
|
borderColor: "#e0e0e0",
|
|
1303
1307
|
borderWidth: 1,
|
|
1304
1308
|
cellPadding: 8,
|
|
1305
1309
|
fontSize: 15,
|
|
1306
1310
|
textAlign: "left"
|
|
1307
|
-
},
|
|
1311
|
+
}, fn = {
|
|
1308
1312
|
targetDate: "",
|
|
1309
1313
|
timezone: "UTC",
|
|
1310
1314
|
showDays: !0,
|
|
@@ -1324,21 +1328,21 @@ var Zt = {
|
|
|
1324
1328
|
expiredMessage: "This offer has expired",
|
|
1325
1329
|
expiredImageUrl: "",
|
|
1326
1330
|
hideOnExpiry: !1
|
|
1327
|
-
},
|
|
1328
|
-
title:
|
|
1329
|
-
paragraph:
|
|
1330
|
-
image:
|
|
1331
|
-
button:
|
|
1332
|
-
divider:
|
|
1333
|
-
section:
|
|
1334
|
-
video:
|
|
1335
|
-
social:
|
|
1336
|
-
spacer:
|
|
1337
|
-
html:
|
|
1338
|
-
menu:
|
|
1339
|
-
table:
|
|
1340
|
-
countdown:
|
|
1341
|
-
},
|
|
1331
|
+
}, pn = {
|
|
1332
|
+
title: $t,
|
|
1333
|
+
paragraph: en,
|
|
1334
|
+
image: tn,
|
|
1335
|
+
button: nn,
|
|
1336
|
+
divider: rn,
|
|
1337
|
+
section: an,
|
|
1338
|
+
video: on,
|
|
1339
|
+
social: sn,
|
|
1340
|
+
spacer: cn,
|
|
1341
|
+
html: ln,
|
|
1342
|
+
menu: un,
|
|
1343
|
+
table: dn,
|
|
1344
|
+
countdown: fn
|
|
1345
|
+
}, mn = {
|
|
1342
1346
|
width: 600,
|
|
1343
1347
|
backgroundColor: "#ffffff",
|
|
1344
1348
|
textColor: "#1a1a1a",
|
|
@@ -1346,30 +1350,30 @@ var Zt = {
|
|
|
1346
1350
|
fontFamily: "Arial",
|
|
1347
1351
|
locale: "en"
|
|
1348
1352
|
};
|
|
1349
|
-
function
|
|
1353
|
+
function hn(e) {
|
|
1350
1354
|
return typeof e == "object" && !!e && !Array.isArray(e) && Object.getPrototypeOf(e) === Object.prototype;
|
|
1351
1355
|
}
|
|
1352
|
-
function
|
|
1356
|
+
function gn(e, t) {
|
|
1353
1357
|
let n = { ...e };
|
|
1354
1358
|
for (let r of Object.keys(t)) {
|
|
1355
1359
|
let i = e[r], a = t[r];
|
|
1356
|
-
a !== void 0 && (n[r] =
|
|
1360
|
+
a !== void 0 && (n[r] = hn(i) && hn(a) ? gn(i, a) : a);
|
|
1357
1361
|
}
|
|
1358
1362
|
return n;
|
|
1359
1363
|
}
|
|
1360
1364
|
// ../types/src/template.ts
|
|
1361
|
-
function
|
|
1365
|
+
function _n(e = "Arial", t) {
|
|
1362
1366
|
return {
|
|
1363
1367
|
blocks: [],
|
|
1364
1368
|
settings: {
|
|
1365
|
-
...
|
|
1369
|
+
...mn,
|
|
1366
1370
|
fontFamily: e,
|
|
1367
1371
|
...t
|
|
1368
1372
|
}
|
|
1369
1373
|
};
|
|
1370
1374
|
}
|
|
1371
1375
|
// ../types/src/direction.ts
|
|
1372
|
-
var
|
|
1376
|
+
var vn = [
|
|
1373
1377
|
"ar",
|
|
1374
1378
|
"he",
|
|
1375
1379
|
"iw",
|
|
@@ -1383,24 +1387,24 @@ var gn = [
|
|
|
1383
1387
|
"ckb",
|
|
1384
1388
|
"ks"
|
|
1385
1389
|
];
|
|
1386
|
-
function
|
|
1390
|
+
function yn(e) {
|
|
1387
1391
|
let t = e?.trim().replace(/_/g, "-").split("-")[0]?.toLowerCase();
|
|
1388
|
-
return !!t &&
|
|
1392
|
+
return !!t && vn.includes(t);
|
|
1389
1393
|
}
|
|
1390
|
-
function
|
|
1391
|
-
return e.direction === "ltr" || e.direction === "rtl" ? e.direction :
|
|
1394
|
+
function bn(e) {
|
|
1395
|
+
return e.direction === "ltr" || e.direction === "rtl" ? e.direction : yn(e.locale) ? "rtl" : "ltr";
|
|
1392
1396
|
}
|
|
1393
1397
|
// ../types/src/translation.ts
|
|
1394
|
-
var
|
|
1395
|
-
function
|
|
1398
|
+
var xn = 2e4, Sn = /* @__PURE__ */ new Set(["\"", "'"]);
|
|
1399
|
+
function V(e, t) {
|
|
1396
1400
|
let n = null, r = "tag";
|
|
1397
1401
|
for (let i = t; i < e.length; i++) {
|
|
1398
1402
|
let t = e[i];
|
|
1399
1403
|
if (n !== null) t === n && (n = null);
|
|
1400
1404
|
else {
|
|
1401
1405
|
if (r === "beforeValue") {
|
|
1402
|
-
if (
|
|
1403
|
-
if (
|
|
1406
|
+
if (H(t)) continue;
|
|
1407
|
+
if (Sn.has(t)) {
|
|
1404
1408
|
n = t, r = "tag";
|
|
1405
1409
|
continue;
|
|
1406
1410
|
}
|
|
@@ -1408,20 +1412,40 @@ function U(e, t) {
|
|
|
1408
1412
|
}
|
|
1409
1413
|
if (r === "unquotedValue") {
|
|
1410
1414
|
if (t === ">") return i;
|
|
1411
|
-
|
|
1415
|
+
H(t) && (r = "tag");
|
|
1412
1416
|
} else if (t === "=") r = "beforeValue";
|
|
1413
1417
|
else if (t === ">") return i;
|
|
1414
1418
|
}
|
|
1415
1419
|
}
|
|
1416
1420
|
return -1;
|
|
1417
1421
|
}
|
|
1418
|
-
function
|
|
1422
|
+
function Cn(e, t) {
|
|
1423
|
+
let n = null;
|
|
1424
|
+
for (let r = t; r < e.length; r++) {
|
|
1425
|
+
let t = e[r];
|
|
1426
|
+
if (n !== null) t === n && (n = null);
|
|
1427
|
+
else if (Sn.has(t)) n = t;
|
|
1428
|
+
else if (t === ">") return {
|
|
1429
|
+
end: r,
|
|
1430
|
+
nextSpan: -1
|
|
1431
|
+
};
|
|
1432
|
+
else if (t === "<" && e.startsWith("<span", r)) return {
|
|
1433
|
+
end: -1,
|
|
1434
|
+
nextSpan: r
|
|
1435
|
+
};
|
|
1436
|
+
}
|
|
1437
|
+
return {
|
|
1438
|
+
end: -1,
|
|
1439
|
+
nextSpan: -1
|
|
1440
|
+
};
|
|
1441
|
+
}
|
|
1442
|
+
function wn(e) {
|
|
1419
1443
|
return e !== " " && e !== " " && e !== "\n" && e !== "\r" && e !== "\f" && e !== "=" && e !== ">" && e !== "/";
|
|
1420
1444
|
}
|
|
1421
|
-
function
|
|
1445
|
+
function H(e) {
|
|
1422
1446
|
return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
|
|
1423
1447
|
}
|
|
1424
|
-
var
|
|
1448
|
+
var Tn = {
|
|
1425
1449
|
AMP: "&",
|
|
1426
1450
|
COPY: "©",
|
|
1427
1451
|
GT: ">",
|
|
@@ -1682,54 +1706,54 @@ var Sn = {
|
|
|
1682
1706
|
zwj: "",
|
|
1683
1707
|
zwnj: ""
|
|
1684
1708
|
};
|
|
1685
|
-
function
|
|
1709
|
+
function U(e) {
|
|
1686
1710
|
return e.includes("&") ? e.replace(/&(#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g, (e, t) => {
|
|
1687
1711
|
if (t[0] === "#") {
|
|
1688
1712
|
let n = t[1] === "x" || t[1] === "X" ? Number.parseInt(t.slice(2), 16) : Number.parseInt(t.slice(1), 10);
|
|
1689
1713
|
return !Number.isFinite(n) || n < 1 || n > 1114111 || n >= 55296 && n <= 57343 ? e : String.fromCodePoint(n);
|
|
1690
1714
|
}
|
|
1691
|
-
return Object.hasOwn(
|
|
1715
|
+
return Object.hasOwn(Tn, t) ? Tn[t] : e;
|
|
1692
1716
|
}) : e;
|
|
1693
1717
|
}
|
|
1694
|
-
function
|
|
1718
|
+
function En(e, t) {
|
|
1695
1719
|
let n = t.toLowerCase(), r = 0;
|
|
1696
1720
|
for (; r < e.length;) {
|
|
1697
|
-
for (; r < e.length && (
|
|
1721
|
+
for (; r < e.length && (H(e[r]) || e[r] === "/");) r++;
|
|
1698
1722
|
if (r >= e.length) break;
|
|
1699
1723
|
let t = r;
|
|
1700
|
-
for (; r < e.length &&
|
|
1724
|
+
for (; r < e.length && wn(e[r]);) r++;
|
|
1701
1725
|
let i = e.substring(t, r).toLowerCase();
|
|
1702
1726
|
if (i === "") {
|
|
1703
1727
|
r++;
|
|
1704
1728
|
continue;
|
|
1705
1729
|
}
|
|
1706
|
-
for (; r < e.length &&
|
|
1730
|
+
for (; r < e.length && H(e[r]);) r++;
|
|
1707
1731
|
if (e[r] !== "=") continue;
|
|
1708
|
-
for (r++; r < e.length &&
|
|
1732
|
+
for (r++; r < e.length && H(e[r]);) r++;
|
|
1709
1733
|
let a = e[r];
|
|
1710
|
-
if (
|
|
1734
|
+
if (Sn.has(a)) {
|
|
1711
1735
|
let t = r + 1, o = e.indexOf(a, t);
|
|
1712
1736
|
if (o === -1) return null;
|
|
1713
|
-
if (i === n) return
|
|
1737
|
+
if (i === n) return U(e.substring(t, o));
|
|
1714
1738
|
r = o + 1;
|
|
1715
1739
|
continue;
|
|
1716
1740
|
}
|
|
1717
1741
|
let o = r;
|
|
1718
|
-
for (; r < e.length && !
|
|
1719
|
-
if (i === n) return
|
|
1742
|
+
for (; r < e.length && !H(e[r]) && e[r] !== ">";) r++;
|
|
1743
|
+
if (i === n) return U(e.substring(o, r));
|
|
1720
1744
|
}
|
|
1721
1745
|
return null;
|
|
1722
1746
|
}
|
|
1723
1747
|
// ../types/src/merge-tag-html.ts
|
|
1724
|
-
function
|
|
1725
|
-
return
|
|
1748
|
+
function Dn(e) {
|
|
1749
|
+
return An(e, (e) => e, !1);
|
|
1726
1750
|
}
|
|
1727
|
-
function
|
|
1728
|
-
return
|
|
1751
|
+
function On(e, t) {
|
|
1752
|
+
return An(e, t, !0);
|
|
1729
1753
|
}
|
|
1730
|
-
function
|
|
1754
|
+
function kn(e) {
|
|
1731
1755
|
let t = [];
|
|
1732
|
-
return
|
|
1756
|
+
return An(e, (n, r, i) => {
|
|
1733
1757
|
let a = e.slice(r, i);
|
|
1734
1758
|
return t.push({
|
|
1735
1759
|
start: r,
|
|
@@ -1738,7 +1762,7 @@ function En(e) {
|
|
|
1738
1762
|
}), a;
|
|
1739
1763
|
}, !0), t;
|
|
1740
1764
|
}
|
|
1741
|
-
function
|
|
1765
|
+
function An(e, t, n) {
|
|
1742
1766
|
let r = "", i = 0;
|
|
1743
1767
|
for (; i < e.length;) {
|
|
1744
1768
|
let a = e.indexOf("<span", i);
|
|
@@ -1751,26 +1775,30 @@ function Dn(e, t, n) {
|
|
|
1751
1775
|
r += e.substring(i, a + 5), i = a + 5;
|
|
1752
1776
|
continue;
|
|
1753
1777
|
}
|
|
1754
|
-
let s =
|
|
1778
|
+
let { end: s, nextSpan: c } = Cn(e, a + 5);
|
|
1779
|
+
if (c !== -1) {
|
|
1780
|
+
r += e.substring(i, c), i = c;
|
|
1781
|
+
continue;
|
|
1782
|
+
}
|
|
1755
1783
|
if (s === -1) {
|
|
1756
1784
|
r += e.substring(i);
|
|
1757
1785
|
break;
|
|
1758
1786
|
}
|
|
1759
|
-
let
|
|
1760
|
-
if (
|
|
1761
|
-
r += e.substring(i,
|
|
1787
|
+
let l = e.substring(a + 5, s), u = Mn(l, "data-merge-tag") ?? Mn(l, "data-logic-merge-tag");
|
|
1788
|
+
if (u === null) {
|
|
1789
|
+
r += e.substring(i, s + 1), i = s + 1;
|
|
1762
1790
|
continue;
|
|
1763
1791
|
}
|
|
1764
|
-
let
|
|
1765
|
-
if (
|
|
1792
|
+
let d = jn(e, s + 1, n);
|
|
1793
|
+
if (d === -1) {
|
|
1766
1794
|
r += e.substring(i);
|
|
1767
1795
|
break;
|
|
1768
1796
|
}
|
|
1769
|
-
r += e.substring(i, a), r += t(
|
|
1797
|
+
r += e.substring(i, a), r += t(u, a, d), i = d;
|
|
1770
1798
|
}
|
|
1771
1799
|
return r;
|
|
1772
1800
|
}
|
|
1773
|
-
function
|
|
1801
|
+
function jn(e, t, n) {
|
|
1774
1802
|
if (!n) {
|
|
1775
1803
|
let n = e.indexOf("</span>", t);
|
|
1776
1804
|
return n === -1 ? -1 : n + 7;
|
|
@@ -1779,7 +1807,7 @@ function On(e, t, n) {
|
|
|
1779
1807
|
for (; i < e.length;) {
|
|
1780
1808
|
let t = e.indexOf("<", i);
|
|
1781
1809
|
if (t === -1) return -1;
|
|
1782
|
-
let n =
|
|
1810
|
+
let n = V(e, t + 1);
|
|
1783
1811
|
if (n === -1) return -1;
|
|
1784
1812
|
let a = e.startsWith("</span", t), o = e.startsWith("<span", t), s = e[t + (a ? 6 : 5)];
|
|
1785
1813
|
if ((o || a) && (s === ">" || s === "/" || /\s/.test(s)) && (r += a ? -1 : 1, r === 0)) return n + 1;
|
|
@@ -1787,18 +1815,266 @@ function On(e, t, n) {
|
|
|
1787
1815
|
}
|
|
1788
1816
|
return -1;
|
|
1789
1817
|
}
|
|
1790
|
-
function
|
|
1791
|
-
return
|
|
1818
|
+
function Mn(e, t) {
|
|
1819
|
+
return En(e, t);
|
|
1820
|
+
}
|
|
1821
|
+
// ../types/src/merge-tags.ts
|
|
1822
|
+
var W = {
|
|
1823
|
+
liquid: {
|
|
1824
|
+
value: /\{\{.+?\}\}/g,
|
|
1825
|
+
logic: /\{%-?\s*(\w+).*?-?%\}/g,
|
|
1826
|
+
opener: "{{",
|
|
1827
|
+
closer: "}}"
|
|
1828
|
+
},
|
|
1829
|
+
handlebars: {
|
|
1830
|
+
value: /\{\{\{?.+?\}?\}\}/g,
|
|
1831
|
+
logic: /\{\{[#/](\w+).*?\}\}/g,
|
|
1832
|
+
opener: "{{",
|
|
1833
|
+
closer: "}}"
|
|
1834
|
+
},
|
|
1835
|
+
mailchimp: {
|
|
1836
|
+
value: /\*\|\w+\|\*/g,
|
|
1837
|
+
logic: /\*\|(\w+)[:|].*?\|\*/g,
|
|
1838
|
+
opener: "*|",
|
|
1839
|
+
closer: "|*"
|
|
1840
|
+
},
|
|
1841
|
+
ampscript: {
|
|
1842
|
+
value: /%%=.+?=%%/g,
|
|
1843
|
+
logic: /%%\[\s*(\w+).*?\]%%/g,
|
|
1844
|
+
opener: "%%=",
|
|
1845
|
+
closer: "=%%"
|
|
1846
|
+
}
|
|
1847
|
+
};
|
|
1848
|
+
function G(e) {
|
|
1849
|
+
return Object.keys(W).find((t) => {
|
|
1850
|
+
let n = W[t];
|
|
1851
|
+
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, ""));
|
|
1852
|
+
});
|
|
1853
|
+
}
|
|
1854
|
+
function Nn(e, t, n) {
|
|
1855
|
+
for (let r = n; r < e.length; r++) {
|
|
1856
|
+
let n = e.charCodeAt(r);
|
|
1857
|
+
if (n === 10 || n === 13 || n === 8232 || n === 8233) return {
|
|
1858
|
+
close: -1,
|
|
1859
|
+
lineBreak: r
|
|
1860
|
+
};
|
|
1861
|
+
if (e.startsWith(t, r)) return {
|
|
1862
|
+
close: r,
|
|
1863
|
+
lineBreak: -1
|
|
1864
|
+
};
|
|
1865
|
+
}
|
|
1866
|
+
return {
|
|
1867
|
+
close: -1,
|
|
1868
|
+
lineBreak: -1
|
|
1869
|
+
};
|
|
1870
|
+
}
|
|
1871
|
+
function K(e, t, n, r = 0, i = Infinity) {
|
|
1872
|
+
let a = G(t);
|
|
1873
|
+
if (!a) {
|
|
1874
|
+
let a = t[n], o = new RegExp(a.source, a.flags.replace(/[gy]/g, "") + "g");
|
|
1875
|
+
return o.lastIndex = r, [...e.matchAll(o)].slice(0, i).map((e) => ({
|
|
1876
|
+
index: e.index,
|
|
1877
|
+
value: e[0]
|
|
1878
|
+
}));
|
|
1879
|
+
}
|
|
1880
|
+
let o = t[n], s = a === "ampscript" ? n === "value" ? "%%=" : "%%[" : a === "liquid" && n === "logic" ? "{%" : a === "mailchimp" ? "*|" : "{{", c = a === "ampscript" ? n === "value" ? "=%%" : "]%%" : a === "liquid" && n === "logic" ? "%}" : a === "mailchimp" ? "|*" : "}}", l = n === "logic" ? {
|
|
1881
|
+
liquid: String.raw`\{%-?\s*\w+`,
|
|
1882
|
+
handlebars: String.raw`\{\{[#/]\w+`,
|
|
1883
|
+
mailchimp: String.raw`\*\|\w+[:|]`,
|
|
1884
|
+
ampscript: String.raw`%%\[\s*\w+`
|
|
1885
|
+
}[a] : a === "mailchimp" ? String.raw`\*\|\w+` : null, u = l ? new RegExp(l, "y") : null, d = new RegExp(o.source, "y"), f = [], p = r;
|
|
1886
|
+
for (; p < e.length && f.length < i;) {
|
|
1887
|
+
let t = e.indexOf(s, p);
|
|
1888
|
+
if (t < 0) break;
|
|
1889
|
+
if (u && (u.lastIndex = t, !u.exec(e))) {
|
|
1890
|
+
p = t + 1;
|
|
1891
|
+
continue;
|
|
1892
|
+
}
|
|
1893
|
+
let r = u?.lastIndex ?? t + s.length, i = a === "mailchimp" && n === "value" ? {
|
|
1894
|
+
close: e.startsWith(c, r) ? r : -1,
|
|
1895
|
+
lineBreak: -1
|
|
1896
|
+
} : Nn(e, c, Math.max(r, t + s.length + +(n === "value")));
|
|
1897
|
+
if (i.lineBreak >= 0) {
|
|
1898
|
+
let r = i.lineBreak, o = n === "logic" && (a === "liquid" || a === "ampscript") ? e.lastIndexOf(s, r) : -1;
|
|
1899
|
+
p = o > t ? o : r + 1;
|
|
1900
|
+
continue;
|
|
1901
|
+
}
|
|
1902
|
+
if (i.close < 0) {
|
|
1903
|
+
if (a === "mailchimp" && n === "value") {
|
|
1904
|
+
p = t + 1;
|
|
1905
|
+
continue;
|
|
1906
|
+
}
|
|
1907
|
+
break;
|
|
1908
|
+
}
|
|
1909
|
+
d.lastIndex = t;
|
|
1910
|
+
let o = d.exec(e);
|
|
1911
|
+
o ? (f.push({
|
|
1912
|
+
index: t,
|
|
1913
|
+
value: o[0]
|
|
1914
|
+
}), p = d.lastIndex) : p = t + 1;
|
|
1915
|
+
}
|
|
1916
|
+
return f;
|
|
1917
|
+
}
|
|
1918
|
+
function Pn(e, t) {
|
|
1919
|
+
let n = G(t);
|
|
1920
|
+
if (!n) {
|
|
1921
|
+
let n = RegExp(`(${t.value.source}|${t.logic.source})`, "g");
|
|
1922
|
+
return [...e.matchAll(n)].map((e) => ({
|
|
1923
|
+
index: e.index,
|
|
1924
|
+
value: e[0]
|
|
1925
|
+
}));
|
|
1926
|
+
}
|
|
1927
|
+
if (n === "handlebars") return K(e, t, "value");
|
|
1928
|
+
if (n === "mailchimp") {
|
|
1929
|
+
let n = [], r = new RegExp(t.value.source, "y"), i = new RegExp(t.logic.source, "y"), a = /\*\|\w+[:|]/y, o = 0;
|
|
1930
|
+
for (; o < e.length;) {
|
|
1931
|
+
let t = e.indexOf("*|", o);
|
|
1932
|
+
if (t < 0) break;
|
|
1933
|
+
r.lastIndex = t;
|
|
1934
|
+
let s = r.exec(e);
|
|
1935
|
+
if (s) {
|
|
1936
|
+
n.push({
|
|
1937
|
+
index: t,
|
|
1938
|
+
value: s[0]
|
|
1939
|
+
}), o = r.lastIndex;
|
|
1940
|
+
continue;
|
|
1941
|
+
}
|
|
1942
|
+
if (a.lastIndex = t, !a.exec(e)) {
|
|
1943
|
+
o = t + 2;
|
|
1944
|
+
continue;
|
|
1945
|
+
}
|
|
1946
|
+
let c = Nn(e, "|*", a.lastIndex);
|
|
1947
|
+
if (c.lineBreak >= 0) {
|
|
1948
|
+
o = c.lineBreak + 1;
|
|
1949
|
+
continue;
|
|
1950
|
+
}
|
|
1951
|
+
if (c.close < 0) break;
|
|
1952
|
+
i.lastIndex = t;
|
|
1953
|
+
let l = i.exec(e);
|
|
1954
|
+
l ? (n.push({
|
|
1955
|
+
index: t,
|
|
1956
|
+
value: l[0]
|
|
1957
|
+
}), o = i.lastIndex) : o = t + 2;
|
|
1958
|
+
}
|
|
1959
|
+
return n;
|
|
1960
|
+
}
|
|
1961
|
+
let r = [], i = 0, a = K(e, t, "value", i, 1)[0], o = K(e, t, "logic", i, 1)[0];
|
|
1962
|
+
for (; a || o;) {
|
|
1963
|
+
let n = !o || a && a.index <= o.index ? a : o;
|
|
1964
|
+
r.push(n), i = n.index + n.value.length, (n === a || a && a.index < i) && (a = K(e, t, "value", i, 1)[0]), (n === o || o && o.index < i) && (o = K(e, t, "logic", i, 1)[0]);
|
|
1965
|
+
}
|
|
1966
|
+
return r;
|
|
1967
|
+
}
|
|
1968
|
+
function Fn(e) {
|
|
1969
|
+
return typeof e == "string" && e.trim() !== "" ? e : null;
|
|
1970
|
+
}
|
|
1971
|
+
function In(e) {
|
|
1972
|
+
return Object.values(W).find((t) => t.value.source === e.value.source) ?? null;
|
|
1973
|
+
}
|
|
1974
|
+
function Ln(e) {
|
|
1975
|
+
return Fn(e.opener) ?? In(e)?.opener ?? null;
|
|
1976
|
+
}
|
|
1977
|
+
function Rn(e) {
|
|
1978
|
+
return Fn(e.closer) ?? In(e)?.closer ?? null;
|
|
1979
|
+
}
|
|
1980
|
+
function zn(e) {
|
|
1981
|
+
return e ? typeof e == "string" ? W[e] ?? W.liquid : e : W.liquid;
|
|
1982
|
+
}
|
|
1983
|
+
function Bn(e) {
|
|
1984
|
+
let t = e.source, n = e.flags.replace("g", "");
|
|
1985
|
+
return RegExp(`^${t}$`, n);
|
|
1986
|
+
}
|
|
1987
|
+
function Vn(e, t) {
|
|
1988
|
+
let n = e?.trim() || "";
|
|
1989
|
+
return !Bn(t.logic).test(n) && Bn(t.value).test(n);
|
|
1990
|
+
}
|
|
1991
|
+
function Hn(e, t) {
|
|
1992
|
+
let n = t.find((t) => t.value === e);
|
|
1993
|
+
return n ? n.label : e;
|
|
1994
|
+
}
|
|
1995
|
+
function Un(e, t) {
|
|
1996
|
+
return $n(e, "data-merge-tag", (e) => Hn(e, t));
|
|
1997
|
+
}
|
|
1998
|
+
function Wn(e, t) {
|
|
1999
|
+
return t.find((t) => t.value === e)?.sample;
|
|
2000
|
+
}
|
|
2001
|
+
function Gn(e, t) {
|
|
2002
|
+
return $n(e, "data-merge-tag", (e) => Jn(Wn(e, t) ?? Hn(e, t)), { unwrap: (e) => Wn(e, t) !== void 0 });
|
|
2003
|
+
}
|
|
2004
|
+
function Kn(e) {
|
|
2005
|
+
return e.some((e) => e.sample !== void 0);
|
|
2006
|
+
}
|
|
2007
|
+
function qn(e, t) {
|
|
2008
|
+
if (!e) return e;
|
|
2009
|
+
let n = e;
|
|
2010
|
+
for (let e of t) e.sample !== void 0 && (n = n.split(e.value).join(e.sample));
|
|
2011
|
+
return n;
|
|
2012
|
+
}
|
|
2013
|
+
function Jn(e) {
|
|
2014
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
2015
|
+
}
|
|
2016
|
+
function Yn(e, t) {
|
|
2017
|
+
if (!e) return !1;
|
|
2018
|
+
if (G(t)) return K(e, t, "value", 0, 1).length > 0 || K(e, t, "logic", 0, 1).length > 0;
|
|
2019
|
+
let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
|
|
2020
|
+
return n.test(e) || r.test(e);
|
|
2021
|
+
}
|
|
2022
|
+
function Xn(e, t) {
|
|
2023
|
+
return Bn(t.logic).test(e?.trim() || "");
|
|
2024
|
+
}
|
|
2025
|
+
function Zn(e, t) {
|
|
2026
|
+
let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
|
|
2027
|
+
return r && r[1] ? r[1].toUpperCase() : e;
|
|
2028
|
+
}
|
|
2029
|
+
function Qn(e, t) {
|
|
2030
|
+
return $n(e, "data-logic-merge-tag", (e) => Zn(e, t));
|
|
2031
|
+
}
|
|
2032
|
+
function $n(e, t, n, r) {
|
|
2033
|
+
let i = "", a = 0;
|
|
2034
|
+
for (; a < e.length;) {
|
|
2035
|
+
let o = e.indexOf("<span", a);
|
|
2036
|
+
if (o === -1) {
|
|
2037
|
+
i += e.substring(a);
|
|
2038
|
+
break;
|
|
2039
|
+
}
|
|
2040
|
+
let s = e[o + 5];
|
|
2041
|
+
if (s !== ">" && s !== " " && s !== " " && s !== "\n" && s !== "\r" && s !== "/") {
|
|
2042
|
+
i += e.substring(a, o + 5), a = o + 5;
|
|
2043
|
+
continue;
|
|
2044
|
+
}
|
|
2045
|
+
let { end: c, nextSpan: l } = Cn(e, o + 5);
|
|
2046
|
+
if (l !== -1) {
|
|
2047
|
+
i += e.substring(a, l), a = l;
|
|
2048
|
+
continue;
|
|
2049
|
+
}
|
|
2050
|
+
if (c === -1) {
|
|
2051
|
+
i += e.substring(a);
|
|
2052
|
+
break;
|
|
2053
|
+
}
|
|
2054
|
+
let u = En(e.substring(o + 5, c), t);
|
|
2055
|
+
if (u === null) {
|
|
2056
|
+
i += e.substring(a, c + 1), a = c + 1;
|
|
2057
|
+
continue;
|
|
2058
|
+
}
|
|
2059
|
+
let d = e.indexOf("</span>", c + 1);
|
|
2060
|
+
if (d === -1) {
|
|
2061
|
+
i += e.substring(a);
|
|
2062
|
+
break;
|
|
2063
|
+
}
|
|
2064
|
+
let f = n(u);
|
|
2065
|
+
r?.unwrap?.(u) ? (i += e.substring(a, o), i += f) : (i += e.substring(a, c + 1), i += f, i += "</span>"), a = d + 7;
|
|
2066
|
+
}
|
|
2067
|
+
return i;
|
|
1792
2068
|
}
|
|
1793
2069
|
// ../types/src/locale-strings.ts
|
|
1794
|
-
var
|
|
2070
|
+
var er = {
|
|
1795
2071
|
title: ["content"],
|
|
1796
2072
|
paragraph: ["content"]
|
|
1797
2073
|
};
|
|
1798
|
-
function
|
|
2074
|
+
function tr(e) {
|
|
1799
2075
|
let t = [], n = /<[a-z][\w:-]*\b/gi;
|
|
1800
2076
|
for (; n.exec(e);) {
|
|
1801
|
-
let r =
|
|
2077
|
+
let r = V(e, n.lastIndex);
|
|
1802
2078
|
if (r < 0) break;
|
|
1803
2079
|
let i = n.lastIndex, a = e.slice(i, r), o = /[^\s"'<>/=]+\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'=<>`]+))/g;
|
|
1804
2080
|
for (let e; e = o.exec(a);) {
|
|
@@ -1812,42 +2088,46 @@ function jn(e) {
|
|
|
1812
2088
|
}
|
|
1813
2089
|
return t;
|
|
1814
2090
|
}
|
|
1815
|
-
function
|
|
1816
|
-
let r = n === "html" ?
|
|
2091
|
+
function nr(e, t, n) {
|
|
2092
|
+
let r = n === "html" ? kn(e) : [], i = n === "html" ? tr(e) : [], a = r.map((e) => ({
|
|
1817
2093
|
...e,
|
|
1818
2094
|
attribute: !1
|
|
1819
|
-
})), o = (n, r) => {
|
|
1820
|
-
let
|
|
1821
|
-
for (;
|
|
1822
|
-
let e = s.flatMap((e) => {
|
|
1823
|
-
e.lastIndex =
|
|
1824
|
-
let t = e.exec(
|
|
1825
|
-
for (; t && t[0].length === 0;) e.lastIndex = t.index + 1, t = e.exec(
|
|
1826
|
-
return t ? [
|
|
2095
|
+
})), o = 0, s = G(t) !== void 0, c = (n, r) => {
|
|
2096
|
+
let c = e.slice(n, r), l = ["logic", "value"], u = s ? l.map((e) => K(c, t, e, 0, 1)[0]) : null, d = s ? null : [t.logic, t.value].map((e) => new RegExp(e.source, e.flags.replace(/[gy]/g, "") + "g")), f = 0;
|
|
2097
|
+
for (; f < c.length;) {
|
|
2098
|
+
let e = s ? u.flatMap((e) => e ? [e] : []) : d.flatMap((e) => {
|
|
2099
|
+
e.lastIndex = f;
|
|
2100
|
+
let t = e.exec(c);
|
|
2101
|
+
for (; t && t[0].length === 0;) e.lastIndex = t.index + 1, t = e.exec(c);
|
|
2102
|
+
return t ? [{
|
|
2103
|
+
index: t.index,
|
|
2104
|
+
value: t[0]
|
|
2105
|
+
}] : [];
|
|
1827
2106
|
});
|
|
1828
|
-
e.sort((e, t) => e.index - t.index || e
|
|
1829
|
-
let
|
|
1830
|
-
if (!
|
|
1831
|
-
let
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
2107
|
+
e.sort((e, t) => e.index - t.index || e.value.length - t.value.length);
|
|
2108
|
+
let r = e[0];
|
|
2109
|
+
if (!r) break;
|
|
2110
|
+
let p = n + r.index, m = p + r.value.length;
|
|
2111
|
+
for (; i[o]?.end <= p;) o++;
|
|
2112
|
+
if (a.push({
|
|
2113
|
+
start: p,
|
|
2114
|
+
end: m,
|
|
2115
|
+
markup: r.value,
|
|
2116
|
+
attribute: i[o] !== void 0 && p >= i[o].start && m <= i[o].end
|
|
2117
|
+
}), f = r.index + r.value.length, s) for (let e = 0; e < l.length; e++) u[e] && u[e].index < f && (u[e] = K(c, t, l[e], f, 1)[0]);
|
|
1838
2118
|
}
|
|
1839
|
-
},
|
|
1840
|
-
for (let e of r)
|
|
1841
|
-
return
|
|
2119
|
+
}, l = 0;
|
|
2120
|
+
for (let e of r) c(l, e.start), l = e.end;
|
|
2121
|
+
return c(l, e.length), a.sort((e, t) => e.start - t.start);
|
|
1842
2122
|
}
|
|
1843
|
-
function
|
|
2123
|
+
function rr(e) {
|
|
1844
2124
|
if (!e.includes("&")) return { text: e };
|
|
1845
2125
|
let t = "", n = [0], r = 0, i = (i) => {
|
|
1846
2126
|
for (t += e.slice(r, i); r < i;) n.push(++r);
|
|
1847
2127
|
};
|
|
1848
2128
|
for (let a of e.matchAll(/&(?:#[0-9]+|#[xX][0-9a-fA-F]+|[a-zA-Z][a-zA-Z0-9]*);/g)) {
|
|
1849
2129
|
i(a.index);
|
|
1850
|
-
let e =
|
|
2130
|
+
let e = U(a[0]);
|
|
1851
2131
|
t += e;
|
|
1852
2132
|
for (let t = 1; t < e.length; t++) n.push(-1);
|
|
1853
2133
|
r = a.index + a[0].length, n.push(r);
|
|
@@ -1857,17 +2137,17 @@ function Nn(e) {
|
|
|
1857
2137
|
offsets: n
|
|
1858
2138
|
};
|
|
1859
2139
|
}
|
|
1860
|
-
var
|
|
1861
|
-
function
|
|
1862
|
-
let t = JSON.stringify(e), n =
|
|
2140
|
+
var q = /* @__PURE__ */ new Map(), ir = 32;
|
|
2141
|
+
function ar(e) {
|
|
2142
|
+
let t = JSON.stringify(e), n = q.get(t);
|
|
1863
2143
|
if (n === void 0) {
|
|
1864
2144
|
let r = e.map((e) => e.trim()).filter(Boolean).sort((e, t) => t.length - e.length).map((e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"));
|
|
1865
|
-
n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null,
|
|
2145
|
+
n = r.length ? RegExp(`(?<![\\p{L}\\p{N}_])(?:${r.join("|")})(?![\\p{L}\\p{N}_])`, "gu") : null, q.size >= ir && q.delete(q.keys().next().value), q.set(t, n);
|
|
1866
2146
|
}
|
|
1867
2147
|
return n;
|
|
1868
2148
|
}
|
|
1869
|
-
function
|
|
1870
|
-
let r = n.length ?
|
|
2149
|
+
function or(e, t, n) {
|
|
2150
|
+
let r = n.length ? ar(n) : null;
|
|
1871
2151
|
if (!r) return [];
|
|
1872
2152
|
let i = [];
|
|
1873
2153
|
if (t === "text") i.push({
|
|
@@ -1876,7 +2156,7 @@ function In(e, t, n) {
|
|
|
1876
2156
|
attribute: !1
|
|
1877
2157
|
});
|
|
1878
2158
|
else {
|
|
1879
|
-
i.push(...
|
|
2159
|
+
i.push(...tr(e).map((e) => ({
|
|
1880
2160
|
...e,
|
|
1881
2161
|
attribute: !0
|
|
1882
2162
|
})));
|
|
@@ -1887,7 +2167,7 @@ function In(e, t, n) {
|
|
|
1887
2167
|
end: r.index,
|
|
1888
2168
|
attribute: !1
|
|
1889
2169
|
});
|
|
1890
|
-
let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) :
|
|
2170
|
+
let a = r[0] === "<!--" ? e.indexOf("-->", t.lastIndex) : V(e, t.lastIndex);
|
|
1891
2171
|
if (a < 0) return [];
|
|
1892
2172
|
n = a + (r[0] === "<!--" ? 3 : 1), t.lastIndex = n;
|
|
1893
2173
|
}
|
|
@@ -1900,7 +2180,7 @@ function In(e, t, n) {
|
|
|
1900
2180
|
let a = [];
|
|
1901
2181
|
for (let n of i) {
|
|
1902
2182
|
r.lastIndex = 0;
|
|
1903
|
-
let i = e.slice(n.start, n.end), o = t === "html" ?
|
|
2183
|
+
let i = e.slice(n.start, n.end), o = t === "html" ? rr(i) : {
|
|
1904
2184
|
text: i,
|
|
1905
2185
|
offsets: void 0
|
|
1906
2186
|
};
|
|
@@ -1919,51 +2199,51 @@ function In(e, t, n) {
|
|
|
1919
2199
|
}
|
|
1920
2200
|
return a;
|
|
1921
2201
|
}
|
|
1922
|
-
function
|
|
1923
|
-
let i =
|
|
2202
|
+
function sr(e, t, n, r) {
|
|
2203
|
+
let i = nr(e, t, n), a = or(e, n, r?.doNotTranslate ?? []).filter((e) => !i.some((t) => e.start < t.end && e.end > t.start));
|
|
1924
2204
|
return [...i, ...a].sort((e, t) => e.start - t.start);
|
|
1925
2205
|
}
|
|
1926
|
-
function
|
|
2206
|
+
function cr(e, t, n) {
|
|
1927
2207
|
let r = "", i = 0;
|
|
1928
2208
|
return t.forEach((t, a) => {
|
|
1929
2209
|
r += e.slice(i, t.start), r += t.attribute ? `__x${n[a]}__` : `<x id="${n[a]}"/>`, i = t.end;
|
|
1930
2210
|
}), r + e.slice(i);
|
|
1931
2211
|
}
|
|
1932
|
-
function
|
|
1933
|
-
let i =
|
|
2212
|
+
function lr(e, t, n, r) {
|
|
2213
|
+
let i = sr(e, t, n, r);
|
|
1934
2214
|
return {
|
|
1935
|
-
text:
|
|
2215
|
+
text: cr(e, i, i.map((e, t) => t + 1)),
|
|
1936
2216
|
tokens: i.map((e) => e.markup)
|
|
1937
2217
|
};
|
|
1938
2218
|
}
|
|
1939
|
-
function
|
|
2219
|
+
function ur(e, t) {
|
|
1940
2220
|
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) => {
|
|
1941
2221
|
let s = Number(i ?? a ?? o);
|
|
1942
2222
|
return (s < 1 || s > t.length || n.has(s)) && (r = !1), n.add(s), t[s - 1] ?? "";
|
|
1943
2223
|
});
|
|
1944
2224
|
return r && n.size === t.length ? i : null;
|
|
1945
2225
|
}
|
|
1946
|
-
function
|
|
1947
|
-
let a =
|
|
2226
|
+
function dr(e, t, n, r, i) {
|
|
2227
|
+
let a = sr(e, n, r, i), o = /* @__PURE__ */ new Set(), s = (e) => {
|
|
1948
2228
|
let n = t.findIndex((t, n) => !o.has(n) && e(t));
|
|
1949
2229
|
return n >= 0 && o.add(n), n;
|
|
1950
2230
|
}, c = a.map((e) => s((t) => t === e.markup));
|
|
1951
2231
|
return a.forEach((e, t) => {
|
|
1952
|
-
c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) =>
|
|
1953
|
-
}), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null :
|
|
2232
|
+
c[t] < 0 && e.term !== void 0 && r === "html" && (c[t] = s((t) => U(t) === e.term));
|
|
2233
|
+
}), o.size !== t.length || a.some((e, t) => c[t] < 0 && e.term === void 0) ? null : cr(e, a.filter((e, t) => c[t] >= 0), c.filter((e) => e >= 0).map((e) => e + 1));
|
|
1954
2234
|
}
|
|
1955
|
-
function
|
|
2235
|
+
function fr(e, t, n = []) {
|
|
1956
2236
|
let r = /* @__PURE__ */ new Map();
|
|
1957
2237
|
if (t === T(e) || !e.settings.locales?.includes(t)) return r;
|
|
1958
2238
|
let i = (e, n, i, a) => {
|
|
1959
2239
|
let o = n.l10n?.[t];
|
|
1960
2240
|
for (let t of i) {
|
|
1961
|
-
let i =
|
|
2241
|
+
let i = b(n, t);
|
|
1962
2242
|
typeof i != "string" || i === "" || Object.keys(o?.set ?? {}).some((e) => e === t || t.startsWith(`${e}.`)) || r.set(`${e.kind === "block" ? e.blockId : "settings"}/${t}`, {
|
|
1963
2243
|
target: e,
|
|
1964
2244
|
path: t,
|
|
1965
2245
|
source: i,
|
|
1966
|
-
format: a &&
|
|
2246
|
+
format: a && er[a]?.includes(t) ? "html" : "text",
|
|
1967
2247
|
text: o?.text?.[t]
|
|
1968
2248
|
});
|
|
1969
2249
|
}
|
|
@@ -1972,17 +2252,17 @@ function Hn(e, t, n = []) {
|
|
|
1972
2252
|
if (r.type !== "html" && i({
|
|
1973
2253
|
kind: "block",
|
|
1974
2254
|
blockId: r.id
|
|
1975
|
-
}, r,
|
|
2255
|
+
}, r, S(r, n), r.type), r.type === "section") for (let e of r.children) a(e);
|
|
1976
2256
|
else r.type === "wrapper" && a(r.children);
|
|
1977
2257
|
}
|
|
1978
2258
|
};
|
|
1979
|
-
return a(e.blocks), i({ kind: "settings" }, e.settings,
|
|
2259
|
+
return a(e.blocks), i({ kind: "settings" }, e.settings, _), r;
|
|
1980
2260
|
}
|
|
1981
|
-
function
|
|
2261
|
+
function pr(e, t, n) {
|
|
1982
2262
|
let r = n.only === "all" ? null : Ae(e, t, n.definitions), i = r && /* @__PURE__ */ new Set([...r.missing, ...r.stale]), a = [], o = {};
|
|
1983
|
-
for (let [r, s] of
|
|
2263
|
+
for (let [r, s] of fr(e, t, n.definitions)) {
|
|
1984
2264
|
if (i && !i.has(r) || n.blockId !== void 0 && (s.target.kind !== "block" || s.target.blockId !== n.blockId)) continue;
|
|
1985
|
-
let e =
|
|
2265
|
+
let e = lr(s.source, n.syntax, s.format, n), t = s.text ? dr(s.text.value, e.tokens, n.syntax, s.format, n) : void 0;
|
|
1986
2266
|
a.push({
|
|
1987
2267
|
id: r,
|
|
1988
2268
|
format: s.format,
|
|
@@ -1996,8 +2276,8 @@ function Un(e, t, n) {
|
|
|
1996
2276
|
tokens: o
|
|
1997
2277
|
};
|
|
1998
2278
|
}
|
|
1999
|
-
function
|
|
2000
|
-
let i =
|
|
2279
|
+
function mr(e, t, n, r) {
|
|
2280
|
+
let i = fr(e, t, r.definitions), a = /* @__PURE__ */ new Map(), o = (e) => {
|
|
2001
2281
|
for (let t of e) if (a.set(t.id, t), t.type === "section") for (let e of t.children) o(e);
|
|
2002
2282
|
else t.type === "wrapper" && o(t.children);
|
|
2003
2283
|
};
|
|
@@ -2009,12 +2289,12 @@ function Wn(e, t, n, r) {
|
|
|
2009
2289
|
let n = t.id.lastIndexOf("/"), r = t.id.slice(0, n), i = r === "settings" ? [a.get(r), e.settings] : [a.get(r)];
|
|
2010
2290
|
l.push({
|
|
2011
2291
|
id: t.id,
|
|
2012
|
-
reason: n < 0 || !i.some((e) => e &&
|
|
2292
|
+
reason: n < 0 || !i.some((e) => e && b(e, t.id.slice(n + 1)) !== void 0) ? "unknown_field" : "not_translatable"
|
|
2013
2293
|
});
|
|
2014
2294
|
continue;
|
|
2015
2295
|
}
|
|
2016
|
-
let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ?
|
|
2017
|
-
if (!o || u === null ||
|
|
2296
|
+
let o = Object.hasOwn(r.tokens, t.id) ? r.tokens[t.id] : void 0, u = o ? ur(t.text, o) : null;
|
|
2297
|
+
if (!o || u === null || dr(u, o, r.syntax, n.format, r) === null) {
|
|
2018
2298
|
l.push({
|
|
2019
2299
|
id: t.id,
|
|
2020
2300
|
reason: "tags_changed"
|
|
@@ -2044,7 +2324,7 @@ function Wn(e, t, n, r) {
|
|
|
2044
2324
|
};
|
|
2045
2325
|
}
|
|
2046
2326
|
// ../types/src/custom-block-liquid.ts
|
|
2047
|
-
function
|
|
2327
|
+
function hr(e) {
|
|
2048
2328
|
return new e.Liquid({
|
|
2049
2329
|
strictVariables: !1,
|
|
2050
2330
|
strictFilters: !1,
|
|
@@ -2053,17 +2333,17 @@ function Gn(e) {
|
|
|
2053
2333
|
});
|
|
2054
2334
|
}
|
|
2055
2335
|
// ../types/src/factory.ts
|
|
2056
|
-
function
|
|
2057
|
-
let n =
|
|
2058
|
-
return !t || Object.keys(t).length === 0 ? n :
|
|
2336
|
+
function J(e, t) {
|
|
2337
|
+
let n = h(e);
|
|
2338
|
+
return !t || Object.keys(t).length === 0 ? n : gn(n, t);
|
|
2059
2339
|
}
|
|
2060
|
-
function
|
|
2061
|
-
return e === void 0 ? void 0 :
|
|
2340
|
+
function Y(e) {
|
|
2341
|
+
return e === void 0 ? void 0 : h(e);
|
|
2062
2342
|
}
|
|
2063
|
-
function
|
|
2343
|
+
function X() {
|
|
2064
2344
|
return crypto.randomUUID();
|
|
2065
2345
|
}
|
|
2066
|
-
function
|
|
2346
|
+
function gr(e = 0) {
|
|
2067
2347
|
return {
|
|
2068
2348
|
top: e,
|
|
2069
2349
|
right: e,
|
|
@@ -2071,135 +2351,135 @@ function Kn(e = 0) {
|
|
|
2071
2351
|
left: e
|
|
2072
2352
|
};
|
|
2073
2353
|
}
|
|
2074
|
-
function
|
|
2075
|
-
return { padding:
|
|
2354
|
+
function Z(e = 10) {
|
|
2355
|
+
return { padding: gr(e) };
|
|
2076
2356
|
}
|
|
2077
|
-
function
|
|
2078
|
-
return
|
|
2079
|
-
id:
|
|
2357
|
+
function _r(e = {}) {
|
|
2358
|
+
return J({
|
|
2359
|
+
id: X(),
|
|
2080
2360
|
type: "title",
|
|
2081
|
-
|
|
2082
|
-
styles:
|
|
2361
|
+
...$t,
|
|
2362
|
+
styles: Z()
|
|
2083
2363
|
}, e);
|
|
2084
2364
|
}
|
|
2085
|
-
function
|
|
2086
|
-
return
|
|
2087
|
-
id:
|
|
2365
|
+
function vr(e = {}) {
|
|
2366
|
+
return J({
|
|
2367
|
+
id: X(),
|
|
2088
2368
|
type: "paragraph",
|
|
2089
|
-
...
|
|
2090
|
-
styles:
|
|
2369
|
+
...en,
|
|
2370
|
+
styles: Z()
|
|
2091
2371
|
}, e);
|
|
2092
2372
|
}
|
|
2093
|
-
function
|
|
2094
|
-
return
|
|
2095
|
-
id:
|
|
2373
|
+
function yr(e = {}) {
|
|
2374
|
+
return J({
|
|
2375
|
+
id: X(),
|
|
2096
2376
|
type: "image",
|
|
2097
|
-
|
|
2098
|
-
styles:
|
|
2377
|
+
...tn,
|
|
2378
|
+
styles: Z()
|
|
2099
2379
|
}, e);
|
|
2100
2380
|
}
|
|
2101
|
-
function
|
|
2102
|
-
return
|
|
2103
|
-
id:
|
|
2381
|
+
function br(e = {}) {
|
|
2382
|
+
return J({
|
|
2383
|
+
id: X(),
|
|
2104
2384
|
type: "button",
|
|
2105
|
-
...
|
|
2106
|
-
styles:
|
|
2385
|
+
...nn,
|
|
2386
|
+
styles: Z()
|
|
2107
2387
|
}, e);
|
|
2108
2388
|
}
|
|
2109
|
-
function
|
|
2110
|
-
return
|
|
2111
|
-
id:
|
|
2389
|
+
function xr(e = {}) {
|
|
2390
|
+
return J({
|
|
2391
|
+
id: X(),
|
|
2112
2392
|
type: "divider",
|
|
2113
|
-
...
|
|
2114
|
-
styles:
|
|
2393
|
+
...rn,
|
|
2394
|
+
styles: Z(20)
|
|
2115
2395
|
}, e);
|
|
2116
2396
|
}
|
|
2117
|
-
function
|
|
2118
|
-
return
|
|
2119
|
-
id:
|
|
2397
|
+
function Sr(e = {}) {
|
|
2398
|
+
return J({
|
|
2399
|
+
id: X(),
|
|
2120
2400
|
type: "section",
|
|
2121
|
-
...
|
|
2401
|
+
...an,
|
|
2122
2402
|
children: [[]],
|
|
2123
|
-
styles:
|
|
2403
|
+
styles: Z(20)
|
|
2124
2404
|
}, e);
|
|
2125
2405
|
}
|
|
2126
|
-
function
|
|
2127
|
-
return
|
|
2128
|
-
id:
|
|
2406
|
+
function Cr(e = {}) {
|
|
2407
|
+
return J({
|
|
2408
|
+
id: X(),
|
|
2129
2409
|
type: "video",
|
|
2130
|
-
...
|
|
2131
|
-
styles:
|
|
2410
|
+
...on,
|
|
2411
|
+
styles: Z()
|
|
2132
2412
|
}, e);
|
|
2133
2413
|
}
|
|
2134
|
-
function
|
|
2135
|
-
return
|
|
2136
|
-
id:
|
|
2414
|
+
function wr(e = {}) {
|
|
2415
|
+
return J({
|
|
2416
|
+
id: X(),
|
|
2137
2417
|
type: "social",
|
|
2138
2418
|
icons: [],
|
|
2139
|
-
...
|
|
2140
|
-
styles:
|
|
2419
|
+
...sn,
|
|
2420
|
+
styles: Z()
|
|
2141
2421
|
}, e);
|
|
2142
2422
|
}
|
|
2143
|
-
function
|
|
2144
|
-
return
|
|
2145
|
-
id:
|
|
2423
|
+
function Tr(e = {}) {
|
|
2424
|
+
return J({
|
|
2425
|
+
id: X(),
|
|
2146
2426
|
type: "spacer",
|
|
2147
|
-
...
|
|
2148
|
-
styles:
|
|
2427
|
+
...cn,
|
|
2428
|
+
styles: Z(0)
|
|
2149
2429
|
}, e);
|
|
2150
2430
|
}
|
|
2151
|
-
function
|
|
2152
|
-
return
|
|
2153
|
-
id:
|
|
2431
|
+
function Er(e = {}) {
|
|
2432
|
+
return J({
|
|
2433
|
+
id: X(),
|
|
2154
2434
|
type: "html",
|
|
2155
|
-
...
|
|
2156
|
-
styles:
|
|
2435
|
+
...ln,
|
|
2436
|
+
styles: Z()
|
|
2157
2437
|
}, e);
|
|
2158
2438
|
}
|
|
2159
|
-
function
|
|
2160
|
-
return
|
|
2161
|
-
id:
|
|
2439
|
+
function Dr(e = {}) {
|
|
2440
|
+
return J({
|
|
2441
|
+
id: X(),
|
|
2162
2442
|
type: "menu",
|
|
2163
2443
|
items: [],
|
|
2164
|
-
...
|
|
2165
|
-
styles:
|
|
2444
|
+
...un,
|
|
2445
|
+
styles: Z()
|
|
2166
2446
|
}, e);
|
|
2167
2447
|
}
|
|
2168
|
-
function
|
|
2448
|
+
function Or(e, t) {
|
|
2169
2449
|
return Array.from({ length: t }, () => ({
|
|
2170
|
-
id:
|
|
2450
|
+
id: X(),
|
|
2171
2451
|
cells: Array.from({ length: e }, () => ({
|
|
2172
|
-
id:
|
|
2452
|
+
id: X(),
|
|
2173
2453
|
content: ""
|
|
2174
2454
|
}))
|
|
2175
2455
|
}));
|
|
2176
2456
|
}
|
|
2177
|
-
function
|
|
2178
|
-
return
|
|
2179
|
-
id:
|
|
2457
|
+
function kr(e = {}) {
|
|
2458
|
+
return J({
|
|
2459
|
+
id: X(),
|
|
2180
2460
|
type: "table",
|
|
2181
|
-
rows:
|
|
2182
|
-
...
|
|
2183
|
-
styles:
|
|
2461
|
+
rows: Or(3, 3),
|
|
2462
|
+
...dn,
|
|
2463
|
+
styles: Z()
|
|
2184
2464
|
}, e);
|
|
2185
2465
|
}
|
|
2186
|
-
function
|
|
2187
|
-
return
|
|
2188
|
-
id:
|
|
2466
|
+
function Ar(e = {}) {
|
|
2467
|
+
return J({
|
|
2468
|
+
id: X(),
|
|
2189
2469
|
type: "countdown",
|
|
2190
|
-
...
|
|
2191
|
-
styles:
|
|
2470
|
+
...fn,
|
|
2471
|
+
styles: Z()
|
|
2192
2472
|
}, e);
|
|
2193
2473
|
}
|
|
2194
|
-
function
|
|
2474
|
+
function jr(e) {
|
|
2195
2475
|
return e.type === "repeatable" ? e.default ?? [] : e.type === "boolean" ? e.default ?? !1 : e.type === "number" ? e.default ?? 0 : e.default ?? "";
|
|
2196
2476
|
}
|
|
2197
|
-
function
|
|
2477
|
+
function Mr(e) {
|
|
2198
2478
|
let t = {};
|
|
2199
|
-
for (let n of e.fields) t[n.key] =
|
|
2200
|
-
let n =
|
|
2479
|
+
for (let n of e.fields) t[n.key] = Y(jr(n));
|
|
2480
|
+
let n = J(Z(), Y(e.defaultStyles));
|
|
2201
2481
|
return {
|
|
2202
|
-
id:
|
|
2482
|
+
id: X(),
|
|
2203
2483
|
type: "custom",
|
|
2204
2484
|
customType: e.type,
|
|
2205
2485
|
fieldValues: t,
|
|
@@ -2207,42 +2487,42 @@ function cr(e) {
|
|
|
2207
2487
|
...e.dataSource ? { dataSourceFetched: !1 } : {}
|
|
2208
2488
|
};
|
|
2209
2489
|
}
|
|
2210
|
-
function
|
|
2490
|
+
function Nr() {
|
|
2211
2491
|
return {
|
|
2212
|
-
id:
|
|
2492
|
+
id: X(),
|
|
2213
2493
|
type: "slot",
|
|
2214
|
-
styles:
|
|
2494
|
+
styles: Z(0)
|
|
2215
2495
|
};
|
|
2216
2496
|
}
|
|
2217
|
-
function
|
|
2218
|
-
return
|
|
2219
|
-
id:
|
|
2497
|
+
function Pr(e = {}) {
|
|
2498
|
+
return J({
|
|
2499
|
+
id: X(),
|
|
2220
2500
|
type: "wrapper",
|
|
2221
2501
|
children: [],
|
|
2222
|
-
styles:
|
|
2502
|
+
styles: Z(0)
|
|
2223
2503
|
}, e);
|
|
2224
2504
|
}
|
|
2225
|
-
function
|
|
2505
|
+
function Fr(e, t) {
|
|
2226
2506
|
switch (e) {
|
|
2227
|
-
case "section": return
|
|
2228
|
-
case "title": return
|
|
2229
|
-
case "paragraph": return
|
|
2230
|
-
case "image": return
|
|
2231
|
-
case "button": return
|
|
2232
|
-
case "divider": return
|
|
2233
|
-
case "video": return
|
|
2234
|
-
case "social": return
|
|
2235
|
-
case "spacer": return
|
|
2236
|
-
case "html": return
|
|
2237
|
-
case "menu": return
|
|
2238
|
-
case "table": return
|
|
2239
|
-
case "countdown": return
|
|
2507
|
+
case "section": return Sr(Y(t?.section));
|
|
2508
|
+
case "title": return _r(Y(t?.title));
|
|
2509
|
+
case "paragraph": return vr(Y(t?.paragraph));
|
|
2510
|
+
case "image": return yr(Y(t?.image));
|
|
2511
|
+
case "button": return br(Y(t?.button));
|
|
2512
|
+
case "divider": return xr(Y(t?.divider));
|
|
2513
|
+
case "video": return Cr(Y(t?.video));
|
|
2514
|
+
case "social": return wr(Y(t?.social));
|
|
2515
|
+
case "spacer": return Tr(Y(t?.spacer));
|
|
2516
|
+
case "html": return Er(Y(t?.html));
|
|
2517
|
+
case "menu": return Dr(Y(t?.menu));
|
|
2518
|
+
case "table": return kr(Y(t?.table));
|
|
2519
|
+
case "countdown": return Ar(Y(t?.countdown));
|
|
2240
2520
|
case "slot": throw Error("[Templatical] slot cannot be inserted into content. Use createSlotBlock() to build a layout.");
|
|
2241
2521
|
case "wrapper": throw Error("[Templatical] wrapper cannot be inserted into content. Use createWrapperBlock() to build a layout.");
|
|
2242
2522
|
default: throw Error(`Unknown block type: ${e}`);
|
|
2243
2523
|
}
|
|
2244
2524
|
}
|
|
2245
|
-
function
|
|
2525
|
+
function Ir(e, t) {
|
|
2246
2526
|
let n = e.l10n;
|
|
2247
2527
|
if (!n || t.size === 0) return;
|
|
2248
2528
|
let r = (n) => {
|
|
@@ -2257,12 +2537,12 @@ function fr(e, t) {
|
|
|
2257
2537
|
n && (e[t] = Object.fromEntries(Object.entries(n).map(([e, t]) => [r(e), t])));
|
|
2258
2538
|
}
|
|
2259
2539
|
}
|
|
2260
|
-
function
|
|
2540
|
+
function Q(e) {
|
|
2261
2541
|
let t = JSON.parse(JSON.stringify(e));
|
|
2262
|
-
t.id =
|
|
2542
|
+
t.id = X();
|
|
2263
2543
|
let n = /* @__PURE__ */ new Map(), r = (e, t) => {
|
|
2264
2544
|
let r = e.id;
|
|
2265
|
-
e.id =
|
|
2545
|
+
e.id = X();
|
|
2266
2546
|
let i = n.get(t);
|
|
2267
2547
|
return i || (i = /* @__PURE__ */ new Map(), n.set(t, i)), i.set(r, e.id), r;
|
|
2268
2548
|
};
|
|
@@ -2272,86 +2552,86 @@ function Z(e) {
|
|
|
2272
2552
|
}
|
|
2273
2553
|
if (t.type === "menu") for (let e of t.items) r(e, "items");
|
|
2274
2554
|
if (t.type === "social") for (let e of t.icons) r(e, "icons");
|
|
2275
|
-
return t.type === "section" && (t.children = t.children.map((e) => e.map((e) =>
|
|
2555
|
+
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))), Ir(t, n), t;
|
|
2276
2556
|
}
|
|
2277
2557
|
// ../types/src/layout.ts
|
|
2278
|
-
var
|
|
2279
|
-
function
|
|
2280
|
-
for (let i of e) if (t(i, n, r),
|
|
2281
|
-
else
|
|
2558
|
+
var Lr = "[Templatical] layout: must contain exactly one slot block", Rr = "[Templatical] layout: slot must be a top-level or wrapper child, not nested in a section", zr = "[Templatical] layout: a wrapper cannot contain a wrapper", Br = "[Templatical] layout: a wrapper around the slot cannot contain blocks that emit mj-wrapper (section.wrapper)", Vr = "[Templatical] slot is not a valid content block", Hr = "[Templatical] wrapper is not a valid content block";
|
|
2559
|
+
function $(e, t, n = null, r = !1) {
|
|
2560
|
+
for (let i of e) if (t(i, n, r), zt(i)) for (let e of i.children) $(e, t, i, !0);
|
|
2561
|
+
else B(i) && $(i.children, t, i, r);
|
|
2282
2562
|
}
|
|
2283
|
-
function
|
|
2563
|
+
function Ur(e) {
|
|
2284
2564
|
let t = 0;
|
|
2285
|
-
if (
|
|
2286
|
-
if (
|
|
2287
|
-
if (
|
|
2288
|
-
if (r) throw Error(
|
|
2289
|
-
if (e.children.some(
|
|
2565
|
+
if ($(e.blocks, (e, n, r) => {
|
|
2566
|
+
if (z(e) && (t += 1, r)) throw Error(Rr);
|
|
2567
|
+
if (B(e)) {
|
|
2568
|
+
if (r) throw Error(Rr);
|
|
2569
|
+
if (e.children.some(B)) throw Error(zr);
|
|
2290
2570
|
}
|
|
2291
|
-
}), t !== 1) throw Error(
|
|
2571
|
+
}), t !== 1) throw Error(Lr);
|
|
2292
2572
|
}
|
|
2293
|
-
function
|
|
2294
|
-
|
|
2295
|
-
if (
|
|
2573
|
+
function Wr(e) {
|
|
2574
|
+
$(e.blocks, (e) => {
|
|
2575
|
+
if (z(e)) throw Error(Vr);
|
|
2296
2576
|
});
|
|
2297
2577
|
}
|
|
2298
|
-
function
|
|
2299
|
-
|
|
2300
|
-
if (
|
|
2578
|
+
function Gr(e) {
|
|
2579
|
+
$(e.blocks, (e) => {
|
|
2580
|
+
if (B(e)) throw Error(Hr);
|
|
2301
2581
|
});
|
|
2302
2582
|
}
|
|
2303
|
-
function
|
|
2583
|
+
function Kr(e) {
|
|
2304
2584
|
let t = !1;
|
|
2305
|
-
return
|
|
2306
|
-
|
|
2585
|
+
return $(e.blocks, (e, n) => {
|
|
2586
|
+
z(e) && n !== null && B(n) && (t = !0);
|
|
2307
2587
|
}), t;
|
|
2308
2588
|
}
|
|
2309
|
-
function
|
|
2310
|
-
if (
|
|
2311
|
-
if (
|
|
2312
|
-
let t =
|
|
2589
|
+
function qr(e) {
|
|
2590
|
+
if (z(e)) return e;
|
|
2591
|
+
if (B(e)) {
|
|
2592
|
+
let t = Q({
|
|
2313
2593
|
...e,
|
|
2314
2594
|
children: []
|
|
2315
2595
|
});
|
|
2316
|
-
return t.children = e.children.map(
|
|
2596
|
+
return t.children = e.children.map(qr), t;
|
|
2317
2597
|
}
|
|
2318
|
-
return
|
|
2598
|
+
return Q(e);
|
|
2319
2599
|
}
|
|
2320
|
-
function
|
|
2600
|
+
function Jr(e) {
|
|
2321
2601
|
for (let t = 0; t < e.length; t++) {
|
|
2322
2602
|
let n = e[t];
|
|
2323
|
-
if (
|
|
2603
|
+
if (z(n)) return {
|
|
2324
2604
|
parent: e,
|
|
2325
2605
|
index: t
|
|
2326
2606
|
};
|
|
2327
|
-
if (
|
|
2328
|
-
let e =
|
|
2607
|
+
if (B(n)) {
|
|
2608
|
+
let e = Jr(n.children);
|
|
2329
2609
|
if (e) return e;
|
|
2330
2610
|
}
|
|
2331
2611
|
}
|
|
2332
2612
|
return null;
|
|
2333
2613
|
}
|
|
2334
|
-
function
|
|
2335
|
-
for (let t of e) if (
|
|
2614
|
+
function Yr(e) {
|
|
2615
|
+
for (let t of e) if (zt(t)) {
|
|
2336
2616
|
if (t.wrapper) return !0;
|
|
2337
|
-
for (let e of t.children) if (
|
|
2617
|
+
for (let e of t.children) if (Yr(e)) return !0;
|
|
2338
2618
|
}
|
|
2339
2619
|
return !1;
|
|
2340
2620
|
}
|
|
2341
|
-
function
|
|
2342
|
-
if (
|
|
2343
|
-
let n = e.blocks.map(
|
|
2344
|
-
if (!r) throw Error(
|
|
2345
|
-
return r.parent.splice(r.index, 1, ...
|
|
2621
|
+
function Xr(e, t) {
|
|
2622
|
+
if (Ur(e), Wr(t), Gr(t), Kr(e) && Yr(t.blocks)) throw Error(Br);
|
|
2623
|
+
let n = e.blocks.map(qr), r = Jr(n);
|
|
2624
|
+
if (!r) throw Error(Lr);
|
|
2625
|
+
return r.parent.splice(r.index, 1, ...h(t.blocks)), {
|
|
2346
2626
|
blocks: n,
|
|
2347
2627
|
settings: {
|
|
2348
|
-
...
|
|
2628
|
+
...h(t.settings),
|
|
2349
2629
|
backgroundColor: e.settings.backgroundColor
|
|
2350
2630
|
}
|
|
2351
2631
|
};
|
|
2352
2632
|
}
|
|
2353
2633
|
// ../types/src/url-policy.ts
|
|
2354
|
-
var
|
|
2634
|
+
var Zr = Object.freeze([
|
|
2355
2635
|
"http",
|
|
2356
2636
|
"https",
|
|
2357
2637
|
"mailto",
|
|
@@ -2361,44 +2641,44 @@ var Dr = Object.freeze([
|
|
|
2361
2641
|
"sms",
|
|
2362
2642
|
"xmpp",
|
|
2363
2643
|
"cid"
|
|
2364
|
-
]),
|
|
2644
|
+
]), Qr = Object.freeze([
|
|
2365
2645
|
"javascript",
|
|
2366
2646
|
"data",
|
|
2367
2647
|
"vbscript"
|
|
2368
2648
|
]);
|
|
2369
|
-
function
|
|
2649
|
+
function $r(e) {
|
|
2370
2650
|
return e.replace(/[\t\n\r]/g, "").replace(/^[\u0000-\u0020]+/, "").trimEnd();
|
|
2371
2651
|
}
|
|
2372
|
-
function
|
|
2373
|
-
let t = /^([a-z][a-z0-9+.-]*):/i.exec(
|
|
2652
|
+
function ei(e) {
|
|
2653
|
+
let t = /^([a-z][a-z0-9+.-]*):/i.exec($r(e));
|
|
2374
2654
|
return t ? t[1].toLowerCase() : null;
|
|
2375
2655
|
}
|
|
2376
|
-
var
|
|
2656
|
+
var ti = /^data:image\/(png|jpe?g|gif|webp|svg\+xml);/i, ni = Object.freeze([
|
|
2377
2657
|
"href",
|
|
2378
2658
|
"xlink:href",
|
|
2379
2659
|
"background",
|
|
2380
2660
|
"poster",
|
|
2381
2661
|
"src"
|
|
2382
|
-
]),
|
|
2662
|
+
]), ri = Object.freeze([
|
|
2383
2663
|
"srcdoc",
|
|
2384
2664
|
"ping",
|
|
2385
2665
|
"formaction",
|
|
2386
2666
|
"action"
|
|
2387
2667
|
]);
|
|
2388
|
-
function
|
|
2389
|
-
let n =
|
|
2390
|
-
return r === null ||
|
|
2668
|
+
function ii(e, t) {
|
|
2669
|
+
let n = $r(e), r = ei(n);
|
|
2670
|
+
return r === null || Zr.some((e) => e === r) ? !0 : t.toLowerCase() === "src" && ti.test(n);
|
|
2391
2671
|
}
|
|
2392
2672
|
// ../types/src/rich-text.ts
|
|
2393
|
-
var
|
|
2394
|
-
function
|
|
2395
|
-
return e.replace(
|
|
2673
|
+
var ai = /<\/?p\b[^<>]*>/gi, oi = /<p\b([^<>]*)>\s*<\/p>/gi;
|
|
2674
|
+
function si(e) {
|
|
2675
|
+
return e.replace(ai, "").trim() === "";
|
|
2396
2676
|
}
|
|
2397
|
-
function
|
|
2398
|
-
return
|
|
2677
|
+
function ci(e) {
|
|
2678
|
+
return si(e) ? e : e.replace(oi, "<p$1> </p>");
|
|
2399
2679
|
}
|
|
2400
2680
|
// ../types/src/fonts.ts
|
|
2401
|
-
var
|
|
2681
|
+
var li = {
|
|
2402
2682
|
arial: "Arial, sans-serif",
|
|
2403
2683
|
helvetica: "Helvetica, sans-serif",
|
|
2404
2684
|
georgia: "Georgia, serif",
|
|
@@ -2407,13 +2687,13 @@ var zr = {
|
|
|
2407
2687
|
"trebuchet ms": "'Trebuchet MS', sans-serif",
|
|
2408
2688
|
"courier new": "'Courier New', monospace",
|
|
2409
2689
|
tahoma: "Tahoma, sans-serif"
|
|
2410
|
-
},
|
|
2690
|
+
}, ui = /* @__PURE__ */ new Set([
|
|
2411
2691
|
"inherit",
|
|
2412
2692
|
"initial",
|
|
2413
2693
|
"unset",
|
|
2414
2694
|
"revert",
|
|
2415
2695
|
"revert-layer"
|
|
2416
|
-
]),
|
|
2696
|
+
]), di = /* @__PURE__ */ new Set([
|
|
2417
2697
|
"serif",
|
|
2418
2698
|
"sans-serif",
|
|
2419
2699
|
"monospace",
|
|
@@ -2428,14 +2708,14 @@ var zr = {
|
|
|
2428
2708
|
"math",
|
|
2429
2709
|
"fangsong"
|
|
2430
2710
|
]);
|
|
2431
|
-
function
|
|
2711
|
+
function fi(e) {
|
|
2432
2712
|
return e === " " || e === " " || e === "\n" || e === "\r" || e === "\f";
|
|
2433
2713
|
}
|
|
2434
|
-
function
|
|
2714
|
+
function pi(e) {
|
|
2435
2715
|
if (typeof e != "string") return [];
|
|
2436
2716
|
let t = e.replace(/!\s*important\s*$/i, ""), n = [], r = 0;
|
|
2437
2717
|
for (;;) {
|
|
2438
|
-
for (; r < t.length &&
|
|
2718
|
+
for (; r < t.length && fi(t[r]);) r++;
|
|
2439
2719
|
if (r >= t.length) return [];
|
|
2440
2720
|
let e = t[r];
|
|
2441
2721
|
if (e === "\"" || e === "'") {
|
|
@@ -2452,7 +2732,7 @@ function Ur(e) {
|
|
|
2452
2732
|
}
|
|
2453
2733
|
}
|
|
2454
2734
|
if (!o) return [];
|
|
2455
|
-
for (; a < t.length &&
|
|
2735
|
+
for (; a < t.length && fi(t[a]);) a++;
|
|
2456
2736
|
if (a < t.length && t[a] !== ",") return [];
|
|
2457
2737
|
n.push({
|
|
2458
2738
|
name: i,
|
|
@@ -2460,7 +2740,7 @@ function Ur(e) {
|
|
|
2460
2740
|
}), r = a;
|
|
2461
2741
|
} else {
|
|
2462
2742
|
let e = t.indexOf(",", r), i = e === -1 ? t.length : e, a = t.slice(r, i).trim().split(/\s+/).join(" ");
|
|
2463
|
-
if (a === "" || a.includes("\"") || a.includes("'") ||
|
|
2743
|
+
if (a === "" || a.includes("\"") || a.includes("'") || ui.has(a.toLowerCase())) return [];
|
|
2464
2744
|
n.push({
|
|
2465
2745
|
name: a,
|
|
2466
2746
|
quoted: !1
|
|
@@ -2470,150 +2750,27 @@ function Ur(e) {
|
|
|
2470
2750
|
r++;
|
|
2471
2751
|
}
|
|
2472
2752
|
}
|
|
2473
|
-
function
|
|
2753
|
+
function mi(e) {
|
|
2474
2754
|
return `'${e.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
|
|
2475
2755
|
}
|
|
2476
|
-
function
|
|
2477
|
-
return !e.quoted &&
|
|
2756
|
+
function hi(e) {
|
|
2757
|
+
return !e.quoted && di.has(e.name.toLowerCase());
|
|
2478
2758
|
}
|
|
2479
|
-
function
|
|
2480
|
-
return
|
|
2759
|
+
function gi(e) {
|
|
2760
|
+
return pi(e)[0]?.name ?? "";
|
|
2481
2761
|
}
|
|
2482
|
-
function
|
|
2483
|
-
let n = (e) => `${
|
|
2762
|
+
function _i(e, t) {
|
|
2763
|
+
let n = (e) => `${mi(e.name)}, ${e.fallback ?? t.defaultFallback}`, r = typeof e == "string" ? e.trim().toLowerCase() : "", i = t.customFonts.find((e) => e.name.toLowerCase() === r);
|
|
2484
2764
|
if (i) return n(i);
|
|
2485
|
-
let a =
|
|
2765
|
+
let a = pi(e);
|
|
2486
2766
|
if (a.length !== 1) return e;
|
|
2487
2767
|
let [o] = a, s = o.name.toLowerCase(), c = t.customFonts.find((e) => e.name.toLowerCase() === s);
|
|
2488
|
-
return c ? n(c) :
|
|
2489
|
-
}
|
|
2490
|
-
// ../types/src/merge-tags.ts
|
|
2491
|
-
var $ = {
|
|
2492
|
-
liquid: {
|
|
2493
|
-
value: /\{\{.+?\}\}/g,
|
|
2494
|
-
logic: /\{%-?\s*(\w+).*?-?%\}/g,
|
|
2495
|
-
opener: "{{",
|
|
2496
|
-
closer: "}}"
|
|
2497
|
-
},
|
|
2498
|
-
handlebars: {
|
|
2499
|
-
value: /\{\{\{?.+?\}?\}\}/g,
|
|
2500
|
-
logic: /\{\{[#/](\w+).*?\}\}/g,
|
|
2501
|
-
opener: "{{",
|
|
2502
|
-
closer: "}}"
|
|
2503
|
-
},
|
|
2504
|
-
mailchimp: {
|
|
2505
|
-
value: /\*\|\w+\|\*/g,
|
|
2506
|
-
logic: /\*\|(\w+)[:|].*?\|\*/g,
|
|
2507
|
-
opener: "*|",
|
|
2508
|
-
closer: "|*"
|
|
2509
|
-
},
|
|
2510
|
-
ampscript: {
|
|
2511
|
-
value: /%%=.+?=%%/g,
|
|
2512
|
-
logic: /%%\[\s*(\w+).*?\]%%/g,
|
|
2513
|
-
opener: "%%=",
|
|
2514
|
-
closer: "=%%"
|
|
2515
|
-
}
|
|
2516
|
-
};
|
|
2517
|
-
function Jr(e) {
|
|
2518
|
-
return typeof e == "string" && e.trim() !== "" ? e : null;
|
|
2519
|
-
}
|
|
2520
|
-
function Yr(e) {
|
|
2521
|
-
return Object.values($).find((t) => t.value.source === e.value.source) ?? null;
|
|
2522
|
-
}
|
|
2523
|
-
function Xr(e) {
|
|
2524
|
-
return Jr(e.opener) ?? Yr(e)?.opener ?? null;
|
|
2525
|
-
}
|
|
2526
|
-
function Zr(e) {
|
|
2527
|
-
return Jr(e.closer) ?? Yr(e)?.closer ?? null;
|
|
2528
|
-
}
|
|
2529
|
-
function Qr(e) {
|
|
2530
|
-
return e ? typeof e == "string" ? $[e] ?? $.liquid : e : $.liquid;
|
|
2531
|
-
}
|
|
2532
|
-
function $r(e) {
|
|
2533
|
-
let t = e.source, n = e.flags.replace("g", "");
|
|
2534
|
-
return RegExp(`^${t}$`, n);
|
|
2535
|
-
}
|
|
2536
|
-
function ei(e, t) {
|
|
2537
|
-
let n = e?.trim() || "";
|
|
2538
|
-
return !$r(t.logic).test(n) && $r(t.value).test(n);
|
|
2539
|
-
}
|
|
2540
|
-
function ti(e, t) {
|
|
2541
|
-
let n = t.find((t) => t.value === e);
|
|
2542
|
-
return n ? n.label : e;
|
|
2543
|
-
}
|
|
2544
|
-
function ni(e, t) {
|
|
2545
|
-
return fi(e, "data-merge-tag", (e) => ti(e, t));
|
|
2546
|
-
}
|
|
2547
|
-
function ri(e, t) {
|
|
2548
|
-
return t.find((t) => t.value === e)?.sample;
|
|
2549
|
-
}
|
|
2550
|
-
function ii(e, t) {
|
|
2551
|
-
return fi(e, "data-merge-tag", (e) => si(ri(e, t) ?? ti(e, t)), { unwrap: (e) => ri(e, t) !== void 0 });
|
|
2552
|
-
}
|
|
2553
|
-
function ai(e) {
|
|
2554
|
-
return e.some((e) => e.sample !== void 0);
|
|
2555
|
-
}
|
|
2556
|
-
function oi(e, t) {
|
|
2557
|
-
if (!e) return e;
|
|
2558
|
-
let n = e;
|
|
2559
|
-
for (let e of t) e.sample !== void 0 && (n = n.split(e.value).join(e.sample));
|
|
2560
|
-
return n;
|
|
2561
|
-
}
|
|
2562
|
-
function si(e) {
|
|
2563
|
-
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
2564
|
-
}
|
|
2565
|
-
function ci(e, t) {
|
|
2566
|
-
if (!e) return !1;
|
|
2567
|
-
let n = new RegExp(t.value.source, t.value.flags), r = new RegExp(t.logic.source, t.logic.flags);
|
|
2568
|
-
return n.test(e) || r.test(e);
|
|
2569
|
-
}
|
|
2570
|
-
function li(e, t) {
|
|
2571
|
-
return $r(t.logic).test(e?.trim() || "");
|
|
2572
|
-
}
|
|
2573
|
-
function ui(e, t) {
|
|
2574
|
-
let n = new RegExp(t.logic.source, t.logic.flags.replace("g", "")), r = e.match(n);
|
|
2575
|
-
return r && r[1] ? r[1].toUpperCase() : e;
|
|
2576
|
-
}
|
|
2577
|
-
function di(e, t) {
|
|
2578
|
-
return fi(e, "data-logic-merge-tag", (e) => ui(e, t));
|
|
2579
|
-
}
|
|
2580
|
-
function fi(e, t, n, r) {
|
|
2581
|
-
let i = "", a = 0;
|
|
2582
|
-
for (; a < e.length;) {
|
|
2583
|
-
let o = e.indexOf("<span", a);
|
|
2584
|
-
if (o === -1) {
|
|
2585
|
-
i += e.substring(a);
|
|
2586
|
-
break;
|
|
2587
|
-
}
|
|
2588
|
-
let s = e[o + 5];
|
|
2589
|
-
if (s !== ">" && s !== " " && s !== " " && s !== "\n" && s !== "\r" && s !== "/") {
|
|
2590
|
-
i += e.substring(a, o + 5), a = o + 5;
|
|
2591
|
-
continue;
|
|
2592
|
-
}
|
|
2593
|
-
let c = U(e, o + 5);
|
|
2594
|
-
if (c === -1) {
|
|
2595
|
-
i += e.substring(a);
|
|
2596
|
-
break;
|
|
2597
|
-
}
|
|
2598
|
-
let l = e.indexOf("</span>", c + 1);
|
|
2599
|
-
if (l === -1) {
|
|
2600
|
-
i += e.substring(a);
|
|
2601
|
-
break;
|
|
2602
|
-
}
|
|
2603
|
-
let u = Cn(e.substring(o + 5, c), t);
|
|
2604
|
-
if (u === null) {
|
|
2605
|
-
i += e.substring(a, o + 5), a = o + 5;
|
|
2606
|
-
continue;
|
|
2607
|
-
}
|
|
2608
|
-
let d = n(u);
|
|
2609
|
-
r?.unwrap?.(u) ? (i += e.substring(a, o), i += d) : (i += e.substring(a, c + 1), i += d, i += "</span>"), a = l + 7;
|
|
2610
|
-
}
|
|
2611
|
-
return i;
|
|
2768
|
+
return c ? n(c) : li[s] || (hi(o) ? e : `${mi(o.name)}, ${t.defaultFallback}`);
|
|
2612
2769
|
}
|
|
2613
2770
|
// ../types/src/preview-resolution.ts
|
|
2614
|
-
function
|
|
2771
|
+
function vi(e) {
|
|
2615
2772
|
return typeof e != "object" || !e ? !1 : Array.isArray(e.blocks);
|
|
2616
2773
|
}
|
|
2617
|
-
export {
|
|
2774
|
+
export { Qn as $, C as $t, wr as A, Gt as At, pr as B, Me as Bt, xr as C, o as Cn, Vt as Ct, vr as D, qt as Dt, Dr as E, Kt as Et, Pr as F, Le as Ft, Zn as G, we as Gt, W as H, ge as Ht, X as I, D as It, Rn as J, Ee as Jt, Hn as K, Ae as Kt, hr as L, Fe as Lt, kr as M, Rt as Mt, _r as N, It as Nt, Sr as O, Xt as Ot, Cr as P, E as Pt, Vn as Q, ke as Qt, er as R, Ie as Rt, Mr as S, r as Sn, Yt as St, yr as T, z as Tt, G as U, y as Ut, ur as V, T as Vt, Yn as W, xe as Wt, Kn as X, Se as Xt, Ln as Y, be as Yt, Xn as Z, b as Zt, Ur as _, e as _n, Zt as _t, ci as a, le as an, qn as at, br as b, c as bn, Jt as bt, ri as c, ue as cn, U as ct, ei as d, d as dn, bn as dt, S as en, Un as et, ii as f, f as fn, _n as ft, Kr as g, i as gn, Ut as gt, Gr as h, ee as hn, gn as ht, _i as i, ae as in, Gn as it, Tr as j, B as jt, Nr as k, Bt as kt, ni as l, ie as ln, V as lt, Wr as m, m as mn, mn as mt, gi as n, g as nn, Pn as nt, si as o, ce as on, Dn as ot, Xr as p, p as pn, pn as pt, Wn as q, je as qt, pi as r, h as rn, K as rt, Qr as s, de as sn, On as st, vi as t, me as tn, zn as tt, Zr as u, ne as un, xn as ut, Q as v, s as vn, Qt as vt, Er as w, t as wn, zt as wt, Ar as x, n as xn, Ht as xt, Fr as y, l as yn, Wt as yt, mr as z, _ as zt };
|
|
2618
2775
|
|
|
2619
|
-
//# sourceMappingURL=src-
|
|
2776
|
+
//# sourceMappingURL=src-mXG-Of9A.js.map
|