@emailmaker/emailmaker 1.0.107-dev.3 → 1.0.107-dev.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/cli/dist/lib/cli/project.js +2 -16
- package/cli/dist/lib/config.js +20 -29
- package/cli/dist/lib/local-test.js +3 -19
- package/cli/dist/lib/paths.js +11 -0
- package/cli/dist/lib/resolveNpmSpawn.d.ts +20 -0
- package/cli/dist/lib/resolveNpmSpawn.js +71 -0
- package/cli/dist/lib/template-engine/context/pluginPackageJsonData.js +21 -19
- package/cli/dist/lib/template-engine/context/standVitePackageJsonData.js +7 -8
- package/cli/dist/lib/template-engine/resolveVariantDir.d.ts +5 -1
- package/cli/dist/lib/template-engine/resolveVariantDir.js +22 -0
- package/cli/dist/lib/templates/shared/i18n.js +2 -2
- package/cli/dist/lib/templates/shared/paths.js +3 -4
- package/cli/dist/lib/types/package-config.d.ts +1 -0
- package/cli/lib/cli/project.ts +2 -18
- package/cli/lib/config.ts +19 -30
- package/cli/lib/local-test.ts +3 -22
- package/cli/lib/paths.ts +15 -0
- package/cli/lib/resolveNpmSpawn.ts +72 -0
- package/cli/lib/template-engine/buildStandIndexHtml.test.ts +1 -0
- package/cli/lib/template-engine/context/pluginPackageJsonData.ts +23 -23
- package/cli/lib/template-engine/context/standVitePackageJsonData.ts +7 -12
- package/cli/lib/template-engine/pluginEtaParity.test.ts +1 -0
- package/cli/lib/template-engine/resolveVariantDir.ts +22 -0
- package/cli/lib/template-engine/standAdvancedViteDevHostEta.test.ts +4 -3
- package/cli/lib/template-engine/standWebpackDevHostEta.test.ts +7 -6
- package/cli/lib/templates/shared/i18n.ts +2 -2
- package/cli/lib/templates/shared/paths.ts +3 -4
- package/cli/lib/types/package-config.ts +1 -0
- package/cli/package.json +1 -1
- package/cli/project-templates/plugin/assets/vite/{plugin-build.config.mjs → plugin-build.config.ts} +7 -5
- package/cli/project-templates/plugin/assets/vite/{sandbox-build.config.mjs → sandbox-build.config.ts} +7 -5
- package/cli/project-templates/plugin/assets/webpack/{plugin-build.legacy.module.cjs → plugin-build.legacy.module.ts} +20 -7
- package/cli/project-templates/plugin/assets/webpack/{plugin-build.legacy.umd.cjs → plugin-build.legacy.umd.ts} +20 -7
- package/cli/project-templates/plugin/assets/webpack/{plugin-build.modern.module.cjs → plugin-build.modern.module.ts} +9 -4
- package/cli/project-templates/plugin/assets/webpack/{plugin-build.modern.umd.cjs → plugin-build.modern.umd.ts} +9 -4
- package/cli/project-templates/plugin/assets/webpack/{sandbox-build.config.cjs → sandbox-build.config.ts} +13 -3
- package/cli/project-templates/plugin/bundler-vite/release.html.eta +1 -0
- package/cli/project-templates/plugin/bundler-webpack/public/release.html.eta +1 -0
- package/cli/project-templates/plugin/shared-base/public/demo/product-1.svg +10 -0
- package/cli/project-templates/plugin/shared-base/public/demo/product-2.svg +10 -0
- package/cli/project-templates/plugin/shared-base/scripts/build-runner.ts +22 -0
- package/cli/project-templates/plugin/shared-base/scripts/build-types.ts +17 -0
- package/cli/project-templates/plugin/shared-base/scripts/clean.ts +16 -0
- package/cli/project-templates/plugin/shared-base/scripts/dev-runner.ts +52 -0
- package/cli/project-templates/plugin/shared-base/scripts/npmRun.ts +61 -0
- package/cli/project-templates/plugin/shared-base/scripts/release-runner.ts +18 -0
- package/cli/project-templates/plugin/shared-base/scripts/scriptRuntime.ts +10 -0
- package/cli/project-templates/plugin/shared-base/src/dev/hostApp.tsx.eta +1 -0
- package/cli/project-templates/plugin/shared-base/src/dev-release.tsx.eta +1 -0
- package/cli/project-templates/plugin/shared-base/src/dev.tsx.eta +1 -1
- package/cli/project-templates/shared/partials/plugin-dev-host-app-advanced.eta +93 -0
- package/cli/project-templates/shared/partials/plugin-dev-host-app-minimal.eta +54 -0
- package/cli/project-templates/shared/partials/plugin-dev-tsx-advanced.eta +3 -2
- package/cli/project-templates/shared/partials/plugin-dev-tsx-debug.eta +18 -0
- package/cli/project-templates/shared/partials/plugin-dev-tsx-release.eta +33 -0
- package/cli/project-templates/shared/partials/plugin-dev-tsx-runtime-helpers.eta +8 -8
- package/cli/project-templates/shared/partials/plugin-index-ts.eta +0 -1
- package/cli/project-templates/shared/partials/plugin-vite-dev-host.eta +9 -5
- package/cli/project-templates/shared/partials/plugin-vite-plugin-build.eta +7 -5
- package/cli/project-templates/shared/partials/plugin-vite-release-html.eta +12 -0
- package/cli/project-templates/shared/partials/plugin-vite-sandbox-build.eta +7 -5
- package/cli/project-templates/shared/partials/plugin-webpack-dev-host-legacy.eta +12 -5
- package/cli/project-templates/shared/partials/plugin-webpack-dev-host-modern.eta +13 -6
- package/cli/project-templates/shared/partials/plugin-webpack-release-html.eta +12 -0
- package/cli/project-templates/shared/partials/plugin-webpack-sandbox-build.eta +13 -3
- package/cli/project-templates/shared/partials/plugin-wp-legacy-module.eta +28 -10
- package/cli/project-templates/shared/partials/plugin-wp-legacy-umd.eta +28 -10
- package/cli/project-templates/shared/partials/plugin-wp-modern-module.eta +9 -4
- package/cli/project-templates/shared/partials/plugin-wp-modern-umd.eta +9 -4
- package/cli/project-templates/shared/partials/stand-dev-host-vite-memory.eta +3 -3
- package/cli/project-templates/shared/partials/stand-dev-host-vite-subpath.eta +8 -4
- package/cli/project-templates/shared/partials/stand-dev-host-vite-umd.eta +5 -5
- package/cli/project-templates/shared/partials/stand-dev-host-vite.eta +3 -3
- package/cli/project-templates/shared/partials/stand-dev-host-webpack-subpath.eta +8 -4
- package/cli/project-templates/shared/partials/stand-dev-host-webpack-umd.eta +9 -3
- package/cli/project-templates/shared/partials/stand-dev-host-webpack.eta +8 -4
- package/cli/project-templates/shared/partials/stand-dev-storage-middleware.eta +370 -0
- package/cli/project-templates/shared/stand-vite-base/config/lib/createViteStandConfig.ts +80 -0
- package/cli/project-templates/shared/stand-vite-base/scripts/devStorageMiddleware.ts.eta +1 -0
- package/cli/project-templates/shared/stand-webpack-base/config/lib/{createWebpackStandConfig.cjs → createWebpackStandConfig.ts} +31 -19
- package/cli/project-templates/{stand/advanced/umd/vite/config/lib/umdServeMiddleware.mjs → shared/stand-webpack-base/config/lib/umdServeMiddleware.ts} +19 -11
- package/cli/project-templates/shared/stand-webpack-base/scripts/devStorageMiddleware.ts.eta +1 -0
- package/cli/project-templates/stand/advanced/memory-usage/vite/config/lib/{createMemoryUsageStandConfig.mjs → createMemoryUsageStandConfig.ts} +25 -20
- package/cli/project-templates/stand/advanced/umd/vite/config/lib/umdServeMiddleware.ts +68 -0
- package/cli/project-templates/stand/react-adapter/webpack/README.md.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/config/dev-host.ts.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/package.json.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/public/index.html.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/dev/editorConfig.ts.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/dev/email.html.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/dev/getAuthToken.ts.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/dev/oauthCredentials.ts +9 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/dev/storageProvider.ts.eta +1 -0
- package/cli/project-templates/stand/react-adapter/webpack/src/index.tsx.eta +1 -0
- package/cli/scripts/cli-matrix-smoke.ts +19 -10
- package/cli/scripts/verify-global-cli.ts +1 -1
- package/cli/scripts/vite-plugin-version-matrix.ts +299 -0
- package/cli/tsconfig.json +2 -2
- package/emailmaker-core.ed344c04.js +1 -0
- package/emailmaker-esm.js +788 -153
- package/emailmaker.d.ts +32 -0
- package/emailmaker.js +4 -4
- package/iframe/js/amp.BGJMqoms.js +1 -1
- package/iframe/js/chunk.oX6nCJbK.js +1 -1
- package/iframe/js/iframe-eblock.js +1 -1
- package/iframe/js/iframe.js +1 -1
- package/iframe/js/rules.BSaCN7eK.js +1 -1
- package/iframe/js/sanitize-html.Dy7Uwo8P.js +1 -1
- package/images/integrations/activecampaign.svg +4 -0
- package/images/integrations/bento.svg +9 -0
- package/images/integrations/brevo.svg +7 -0
- package/images/integrations/campaign_monitor.svg +10 -0
- package/images/integrations/constant_contact.svg +24 -0
- package/images/integrations/dotdigital.svg +144 -0
- package/images/integrations/getresponse.svg +23 -0
- package/images/integrations/hubspot.svg +3 -0
- package/images/integrations/klaviyo.svg +10 -0
- package/images/integrations/mailchimp.svg +9 -0
- package/images/integrations/salesforce.svg +20 -0
- package/js/browser-image-compression.js +9 -0
- package/package.json +2 -5
- package/runtime/@ant-design/cssinjs/index.js +1 -1
- package/runtime/@ant-design/icons/index.js +1 -1
- package/runtime/@ant-design/pro-layout/index.js +1 -1
- package/runtime/README.md +13 -13
- package/runtime/antd/index.js +1 -1
- package/runtime/app-core/index.js +1 -2
- package/runtime/classnames/index.js +1 -1
- package/runtime/core/index.js +6 -6
- package/runtime/dayjs/index.js +1 -1
- package/runtime/di/index.js +1 -2
- package/runtime/disposable/index.js +1 -2
- package/runtime/errors-runtime/index.js +1 -2
- package/runtime/guid/index.js +1 -2
- package/runtime/index.js +2 -4
- package/runtime/package.json +2 -3
- package/runtime/prop-types/index.js +1 -1
- package/runtime/react/index.js +1 -1
- package/runtime/react/jsx-dev-runtime/index.js +1 -1
- package/runtime/react/jsx-runtime/index.js +1 -1
- package/runtime/react-dom/client/index.js +1 -1
- package/runtime/react-dom/index.js +1 -1
- package/runtime/react-router-dom/index.js +1 -1
- package/runtime/uuid/index.js +1 -1
- package/static/amd/{8fc2a596.js → 19aeb269.js} +88 -88
- package/static/core/192ec827.js +1 -0
- package/static/core/22c1de2e2.js +1 -0
- package/static/core/24faedf0.js +1 -0
- package/static/core/29231645.js +1 -0
- package/static/core/2a3177fc2.js +1 -0
- package/static/core/346aabd2.js +3 -0
- package/static/core/3b800ed6.js +1 -0
- package/static/core/3e840e90.js +1 -0
- package/static/core/40cc9fd7.js +1 -0
- package/static/core/421bdec22.js +1 -0
- package/static/core/50ff48bc.js +4 -0
- package/static/core/5282795d2.js +6 -0
- package/static/core/555e2e2f2.js +903 -0
- package/static/core/563a283d.js +1 -0
- package/static/core/5d47e095.js +47 -0
- package/static/core/5f574386.js +1 -0
- package/static/core/67a41193.js +1 -0
- package/static/core/698dace4.js +7 -0
- package/static/core/6b648e2d.js +1 -0
- package/static/core/7629adfd.js +1 -0
- package/static/core/7717f2932.js +3 -0
- package/static/core/776cb34a.js +1 -0
- package/static/core/78a1e31e.js +1 -0
- package/static/core/7d56d643.js +1 -0
- package/static/core/841752212.js +40 -0
- package/static/core/8477e97e.js +1 -0
- package/static/core/8756d562.js +1 -0
- package/static/core/91d328d8.js +1 -0
- package/static/core/9270dbb6.js +6 -0
- package/static/core/96371334.js +566 -0
- package/static/core/9b9ddaef2.js +168 -0
- package/static/core/af1da4b4.js +1 -0
- package/static/core/b5096b152.js +471 -0
- package/static/core/bde6775a.js +1 -0
- package/static/core/bf1b888c.js +4 -0
- package/static/core/c3747df72.js +598 -0
- package/static/core/cec8d739.js +11 -0
- package/static/core/cfac3d32.js +1 -0
- package/static/core/d21c95cf2.js +1 -0
- package/static/core/dbd9ca52.js +1 -0
- package/static/core/dc590181.js +1 -0
- package/static/core/e0039d55.js +1 -0
- package/static/core/e4071c1a.js +4 -0
- package/static/core/ef87b75c.js +41 -0
- package/static/core/f47701f32.js +20 -0
- package/static/core/f83d7ac42.js +3 -0
- package/static/core/fcc67e6b.js +1 -0
- package/static/core/fd40d85c.js +1 -0
- package/static/core/fe638847.js +1 -0
- package/static/esm/{e8401d17.js → 203c9644.js} +3 -3
- package/static/esm/4b679053.js +27 -0
- package/static/esm/{b273a6c2.js → f31a26c6.js} +1 -1
- package/static/runtime/disposable-CD74igiJ.js +1 -0
- package/static/runtime/guid-C0wuVR8v.js +1 -0
- package/vite/index.d.ts +17 -6
- package/vite/index.js +315 -270
- package/vite/pluginDev/index.d.ts +10 -19
- package/vite/pluginDev/index.js +251 -204
- package/webpack/index.d.ts +24 -5
- package/webpack/index.js +168 -144
- package/webpack/pluginDev/index.d.ts +21 -22
- package/webpack/pluginDev/index.js +242 -177
- package/cli/dist/lib/template-engine/buildStandIndexHtml.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/buildStandIndexHtml.test.js +0 -89
- package/cli/dist/lib/template-engine/emitEtaTree.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/emitEtaTree.test.js +0 -34
- package/cli/dist/lib/template-engine/pluginEtaParity.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/pluginEtaParity.test.js +0 -105
- package/cli/dist/lib/template-engine/resolveVariantDir.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/resolveVariantDir.test.js +0 -52
- package/cli/dist/lib/template-engine/standAdvancedViteDevHostEta.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/standAdvancedViteDevHostEta.test.js +0 -67
- package/cli/dist/lib/template-engine/standWebpackDevHostEta.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/standWebpackDevHostEta.test.js +0 -83
- package/cli/dist/lib/template-engine/storageProviderEta.test.d.ts +0 -2
- package/cli/dist/lib/template-engine/storageProviderEta.test.js +0 -26
- package/cli/project-templates/plugin/shared-base/scripts/build-types.cjs +0 -8
- package/cli/project-templates/plugin/shared-base/scripts/clean.cjs +0 -6
- package/cli/project-templates/plugin/shared-base/scripts/dev-runner.cjs +0 -48
- package/cli/project-templates/plugin/shared-base/scripts/release-runner.cjs +0 -63
- package/cli/project-templates/shared/stand-vite-base/config/lib/createViteStandConfig.mjs +0 -80
- package/cli/project-templates/shared/stand-vite-base/scripts/devStorageMiddleware.cjs +0 -235
- package/cli/project-templates/shared/stand-webpack-base/config/lib/umdServeMiddleware.cjs +0 -38
- package/cli/project-templates/shared/stand-webpack-base/scripts/devStorageMiddleware.cjs +0 -235
- package/emailmaker-core.80d62b88.js +0 -569
- package/runtime/_core/app-core/index.js +0 -1
- package/runtime/_core/chunks/app-core-DphKKh8f.js +0 -1
- package/runtime/_core/chunks/chunk-oqAt0Dze.js +0 -1
- package/runtime/_core/chunks/di-BHUzE57z.js +0 -1
- package/runtime/_core/chunks/disposable-PhM3rJkj.js +0 -1
- package/runtime/_core/chunks/errors-runtime-VjCOXaQX.js +0 -1
- package/runtime/_core/chunks/guid-D2-FTZQG.js +0 -1
- package/runtime/_core/di/index.js +0 -1
- package/runtime/_core/disposable/index.js +0 -1
- package/runtime/_core/errors-runtime/index.js +0 -1
- package/runtime/_core/guid/index.js +0 -1
- package/runtime/_core/index.js +0 -1
- package/shared/hostBootstrap.js +0 -47
- package/shared/pluginDevOptions.js +0 -31
- package/shared/runtimeManifest.js +0 -72
- package/shared/stringCase.js +0 -16
- package/static/core/2360f32a.js +0 -3
- package/static/core/2687db56.js +0 -3
- package/static/core/2b250af6.js +0 -1261
- package/static/core/3469930c.js +0 -302
- package/static/core/34ce9042.js +0 -201
- package/static/core/4091ba5b.js +0 -25
- package/static/core/41ce3a6a.js +0 -173
- package/static/core/4ac4908c.js +0 -2213
- package/static/core/519096c1.js +0 -2597
- package/static/core/5fa1772b.js +0 -116550
- package/static/core/61312909.js +0 -3
- package/static/core/62a98c07.js +0 -75301
- package/static/core/6309c0f2.js +0 -3
- package/static/core/68d9f440.js +0 -3
- package/static/core/73b645ab.js +0 -2
- package/static/core/81019351.js +0 -280
- package/static/core/835b37ef.js +0 -591
- package/static/core/91242fb3.js +0 -3
- package/static/core/972b15b0.js +0 -92399
- package/static/core/974ef468.js +0 -493
- package/static/core/a17614422.js +0 -38078
- package/static/core/a2fa7b5b.js +0 -4232
- package/static/core/a513adfd.js +0 -89857
- package/static/core/a7c73a9b.js +0 -3813
- package/static/core/b64c7c90.js +0 -228
- package/static/core/cdc9ba92.js +0 -4711
- package/static/core/d1db685d.js +0 -2193
- package/static/core/d661febc.js +0 -3
- package/static/core/d6d2d2d0.js +0 -23
- package/static/core/df1a1225.js +0 -607
- package/static/core/e5bff179.js +0 -1302
- package/static/core/e5d602f5.js +0 -2
- package/static/core/eb029366.js +0 -1532
- package/static/core/f46c035a.js +0 -2
- package/static/core/f8b9d89a.js +0 -461
- package/static/core/fd897ad7.js +0 -3
- package/static/core/fdd890c7.js +0 -6168
- package/static/esm/29eb18ff.js +0 -164
- package/vite/mime-types.js +0 -179
- package/vite/utils.js +0 -44
- /package/cli/project-templates/plugin/bundler-vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/plugin/bundler-vite/config/{plugin-build.mjs.eta → plugin-build.ts.eta} +0 -0
- /package/cli/project-templates/plugin/bundler-vite/config/{sandbox-build.mjs.eta → sandbox-build.ts.eta} +0 -0
- /package/cli/project-templates/plugin/bundler-webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/plugin/bundler-webpack/config/{plugin-build.cjs.eta → plugin-build.ts.eta} +0 -0
- /package/cli/project-templates/plugin/bundler-webpack/config/{sandbox-build.cjs.eta → sandbox-build.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/memory-usage/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/shadow-dom/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/shadow-dom/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/subpath/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/subpath/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/umd/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/advanced/umd/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/closed-loop/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/closed-loop/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/oauth/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/oauth/webpack/config/{dev-host.cjs.eta → dev-host.ts.eta} +0 -0
- /package/cli/project-templates/stand/react-adapter/vite/config/{dev-host.mjs.eta → dev-host.ts.eta} +0 -0
- /package/iframe/{iframe-eblock.80d62b88.html → iframe-eblock.ed344c04.html} +0 -0
- /package/iframe/{iframe.80d62b88.html → iframe.ed344c04.html} +0 -0
- /package/{runtime/chunks → static/runtime}/DownloadOutlined-a2ZUz7zB.js +0 -0
- /package/{runtime/chunks → static/runtime}/chunk-D-iEO58U.js +0 -0
- /package/{runtime/chunks → static/runtime}/classnames-DBEldvch.js +0 -0
- /package/{runtime/chunks → static/runtime}/client-5XqXGmAI.js +0 -0
- /package/{runtime/chunks → static/runtime}/dayjs.min-CO3mzOeV.js +0 -0
- /package/{runtime/_core/chunks/defineProperty-BGJFuFMq.js → static/runtime/defineProperty-CGNmw-jw.js} +0 -0
- /package/{runtime/chunks → static/runtime}/dist-Cns8cA2n.js +0 -0
- /package/{runtime/chunks → static/runtime}/dist-Ct0xRt3Y.js +0 -0
- /package/{runtime/chunks → static/runtime}/es-0FFT3fCz.js +0 -0
- /package/{runtime/chunks → static/runtime}/es-BwJ3eGbx.js +0 -0
- /package/{runtime/chunks → static/runtime}/es-D8EsVtRL.js +0 -0
- /package/{runtime/chunks → static/runtime}/es-Da4O25Kw.js +0 -0
- /package/{runtime/chunks → static/runtime}/jsx-dev-runtime-V4_MuHNS.js +0 -0
- /package/{runtime/chunks → static/runtime}/jsx-runtime-DBeCoE0b.js +0 -0
- /package/{runtime/chunks → static/runtime}/objectWithoutProperties-Bk0EDksJ.js +0 -0
- /package/{runtime/chunks → static/runtime}/prop-types-DxD5wgQ0.js +0 -0
- /package/{runtime/chunks → static/runtime}/react-TEeeBWTl.js +0 -0
- /package/{runtime/chunks → static/runtime}/react-dom-BKKa1g6U.js +0 -0
package/static/core/974ef468.js
DELETED
|
@@ -1,493 +0,0 @@
|
|
|
1
|
-
import { qt as e } from "./cdc9ba92.js";
|
|
2
|
-
import { Zt as t } from "./4ac4908c.js";
|
|
3
|
-
import { C as n, D as r, O as i, T as a, _ as o, b as s, g as c, y as l } from "./eb029366.js";
|
|
4
|
-
//#region src/plugin/utils/prepareEvent.ts
|
|
5
|
-
var u = class extends t.Disposable {
|
|
6
|
-
_listener;
|
|
7
|
-
_disposeEvent;
|
|
8
|
-
constructor(e) {
|
|
9
|
-
super(), this._event = e;
|
|
10
|
-
}
|
|
11
|
-
setListener(e) {
|
|
12
|
-
this._listener !== e && (this._listener = e, this._disposeEvent && this._disposeEvent(), e ? this._disposeEvent = this._event(e) : this._disposeEvent = void 0);
|
|
13
|
-
}
|
|
14
|
-
dispose() {
|
|
15
|
-
this._disposeEvent && this._disposeEvent(), super.dispose();
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
function d(t, n, r) {
|
|
19
|
-
let i = e(t);
|
|
20
|
-
return (e, t, a) => {
|
|
21
|
-
let o = i(async (t) => {
|
|
22
|
-
let i = n ? n(t) : t;
|
|
23
|
-
a && e.bind(a);
|
|
24
|
-
let o = await e(i);
|
|
25
|
-
return r ? r(o) : o;
|
|
26
|
-
}, t, a);
|
|
27
|
-
return () => o.dispose();
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region packages/html2amp/lib/utils.ts
|
|
32
|
-
function f(e) {
|
|
33
|
-
let t = e.documentElement;
|
|
34
|
-
return t || (t = e.createElement("html"), e.appendChild(t)), t;
|
|
35
|
-
}
|
|
36
|
-
function p(e) {
|
|
37
|
-
let t = e.head;
|
|
38
|
-
if (!t) {
|
|
39
|
-
t = e.createElement("head");
|
|
40
|
-
let n = f(e);
|
|
41
|
-
n.insertBefore(t, n.firstChild);
|
|
42
|
-
}
|
|
43
|
-
return t;
|
|
44
|
-
}
|
|
45
|
-
function m(e) {
|
|
46
|
-
let t = Object.create(null), n = e.getAttributeNames();
|
|
47
|
-
for (let r of n) t[r] = e.getAttribute(r);
|
|
48
|
-
return t;
|
|
49
|
-
}
|
|
50
|
-
function h(e) {
|
|
51
|
-
for (let t of document.querySelectorAll("iframe")) if (t.contentDocument === e.ownerDocument) return t;
|
|
52
|
-
}
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region packages/html2amp/lib/boilerplate.ts
|
|
55
|
-
function g(e) {
|
|
56
|
-
let t = p(e);
|
|
57
|
-
if (!e.querySelector("style[amp4email-boilerplate]")) {
|
|
58
|
-
let n = e.createElement("style");
|
|
59
|
-
n.setAttribute("amp4email-boilerplate", ""), n.innerHTML = "body{visibility:hidden}", t.prepend(n);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
function _(e) {
|
|
63
|
-
let t = e.querySelector("style[amp4email-boilerplate]");
|
|
64
|
-
t && t.remove();
|
|
65
|
-
}
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region packages/html2amp/lib/css.ts
|
|
68
|
-
var v = "amp-custom";
|
|
69
|
-
function y(e, t) {
|
|
70
|
-
return `em-${e.replaceAll("-", "_")}-${t.toLowerCase()}`;
|
|
71
|
-
}
|
|
72
|
-
function b(e, t, n) {
|
|
73
|
-
for (let i of t) if (o.isStyleRule(i)) {
|
|
74
|
-
let t = i.selectorText.split(/\+>~/).flatMap((e) => e.trim().split(" "));
|
|
75
|
-
if (t.length === 1 && t[0].trim().startsWith(".em-")) {
|
|
76
|
-
for (let t of i.style) if (i.style.getPropertyPriority(t) === "important") {
|
|
77
|
-
for (let a of e.querySelectorAll(i.selectorText)) if (r(a)) {
|
|
78
|
-
let e = a.style;
|
|
79
|
-
for (let r of [...e]) if (r.startsWith(t)) {
|
|
80
|
-
let t = n(r, e.getPropertyValue(r)), i = a.getAttribute("class");
|
|
81
|
-
a.setAttribute("class", i ? `${t} ${i}` : t), e.removeProperty(r);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
} else o.isMediaRule(i) && b(e, i.cssRules, n);
|
|
87
|
-
}
|
|
88
|
-
function x(e, t) {
|
|
89
|
-
let n = t.sheet;
|
|
90
|
-
if (n) {
|
|
91
|
-
let r = /* @__PURE__ */ new Set();
|
|
92
|
-
b(e, n.cssRules, (e, i) => {
|
|
93
|
-
let a = y(e, i), s = [...n.cssRules], c = `.${a} { ${e}: ${i} }`;
|
|
94
|
-
return !s.find((e) => o.isStyleRule(e) && e.selectorText === `.${a}`) && !r.has(c) && (r.add(c), t.innerHTML = `\n.${a} { ${e}: ${i} };\n${t.innerHTML}`), a;
|
|
95
|
-
}), r.size && (t.innerHTML = `\n${[...r].join("\n")};\n${t.innerHTML}`);
|
|
96
|
-
}
|
|
97
|
-
let r = t.innerHTML, i = r.replace(/!important/g, "");
|
|
98
|
-
r !== i && (t.innerHTML = i);
|
|
99
|
-
}
|
|
100
|
-
function S(e) {
|
|
101
|
-
let t = p(e), n = e.querySelectorAll("link[rel=\"stylesheet\"]"), r = [...e.querySelectorAll("style")].filter((e) => !e.hasAttribute("amp4email-boilerplate"));
|
|
102
|
-
if (r.length === 1) {
|
|
103
|
-
let n = r[0];
|
|
104
|
-
if (n.parentElement === t && n.getAttribute(v) === "") {
|
|
105
|
-
x(e, n);
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
let i = [];
|
|
110
|
-
for (let e of r) i.push(e.innerHTML), e.remove();
|
|
111
|
-
if (i.length) {
|
|
112
|
-
let n = e.createElement("style");
|
|
113
|
-
n.innerHTML = `\n${i.join("")}\n`, n.setAttribute(v, ""), t.append(n), x(e, n);
|
|
114
|
-
}
|
|
115
|
-
for (let e of n) e.remove();
|
|
116
|
-
}
|
|
117
|
-
function C(e) {
|
|
118
|
-
let t = e.querySelector(`style[${v}]`);
|
|
119
|
-
t && t.removeAttribute(v);
|
|
120
|
-
}
|
|
121
|
-
//#endregion
|
|
122
|
-
//#region packages/html2amp/lib/docType.ts
|
|
123
|
-
var w = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">", T = "<!doctype html>";
|
|
124
|
-
function E(e) {
|
|
125
|
-
let t = e.doctype;
|
|
126
|
-
if (t) {
|
|
127
|
-
if (s(t) === T) return;
|
|
128
|
-
let n = new DOMParser().parseFromString(T, "text/html").doctype;
|
|
129
|
-
e.replaceChild(n, t);
|
|
130
|
-
} else {
|
|
131
|
-
let t = new DOMParser().parseFromString(T, "text/html").doctype;
|
|
132
|
-
e.insertBefore(t, e.firstChild);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
function D(e) {
|
|
136
|
-
let t = e.doctype;
|
|
137
|
-
if (t && s(t).toLowerCase() === T) {
|
|
138
|
-
let n = new DOMParser().parseFromString(w, "text/html").doctype;
|
|
139
|
-
e.replaceChild(n, t);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
//#endregion
|
|
143
|
-
//#region packages/html2amp/lib/img.ts
|
|
144
|
-
async function O(e, t = {}) {
|
|
145
|
-
let n = document.createElement("amp-img"), i = await l(e) || void 0, a = [];
|
|
146
|
-
try {
|
|
147
|
-
let o = e;
|
|
148
|
-
for (; o && r(o);) getComputedStyle(o)?.display === "none" && (o.style.display = "initial", a.push([o, o.style.display])), o = o.parentElement;
|
|
149
|
-
let s = i?.height ? `${parseInt(i.height)}` : "", l = i?.width ? `${parseInt(i.width)}` : "", u = h(e), d = !1;
|
|
150
|
-
if (u) {
|
|
151
|
-
let t = u.getAttribute("width");
|
|
152
|
-
try {
|
|
153
|
-
let n = l ? `${l}px` : "";
|
|
154
|
-
t || (u.setAttribute("width", "720px"), n = getComputedStyle(e).width || ""), u.setAttribute("width", !t || parseInt(t) > 320 ? "320px" : "720px"), n !== (getComputedStyle(e).width || "") && (d = !0);
|
|
155
|
-
} finally {
|
|
156
|
-
t && u.setAttribute("width", t || "");
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
let f = e.src || e.srcset.split(",")[0];
|
|
160
|
-
e.style.width === "100%" && e.style.removeProperty("width"), e.style.maxWidth === "100%" && e.style.removeProperty("max-width"), t = {
|
|
161
|
-
...m(e),
|
|
162
|
-
alt: e.alt,
|
|
163
|
-
width: l,
|
|
164
|
-
height: s,
|
|
165
|
-
src: f,
|
|
166
|
-
layout: d ? "responsive" : "fixed",
|
|
167
|
-
...t
|
|
168
|
-
};
|
|
169
|
-
for (let e of Object.keys(t)) c(n, e, t[e]);
|
|
170
|
-
} finally {
|
|
171
|
-
for (let [e, t] of a) e.style.display = t;
|
|
172
|
-
}
|
|
173
|
-
return n;
|
|
174
|
-
}
|
|
175
|
-
function k(e) {
|
|
176
|
-
let t = document.createElement("img"), { layout: n, height: r, ...i } = m(e), a = n === "responsive";
|
|
177
|
-
for (let e of Object.keys(i)) c(t, e, i[e]);
|
|
178
|
-
return a && (t.style.maxWidth = i.width || "0px", t.style.width = "100%"), t;
|
|
179
|
-
}
|
|
180
|
-
async function A(e, t) {
|
|
181
|
-
let n = [...e.querySelectorAll("img")], r = [];
|
|
182
|
-
for (let e of n) r.push(O(e).then((t) => [e, t], () => [e, void 0]));
|
|
183
|
-
let i = [...e.querySelectorAll("picture")];
|
|
184
|
-
for (let e of i) {
|
|
185
|
-
let t = e.querySelector("img");
|
|
186
|
-
t ? r.push(O(t).then((t) => [e, t], () => [e, void 0])) : r.push([e, void 0]);
|
|
187
|
-
}
|
|
188
|
-
if (r.length) {
|
|
189
|
-
let e = await Promise.all(r);
|
|
190
|
-
for (let [t, n] of e) n ? t.replaceWith(n) : t.remove();
|
|
191
|
-
t?.();
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
function j(e, t) {
|
|
195
|
-
let n = [...e.querySelectorAll("amp-img")];
|
|
196
|
-
for (let e of n) e.replaceWith(k(e));
|
|
197
|
-
n.length && t?.();
|
|
198
|
-
}
|
|
199
|
-
//#endregion
|
|
200
|
-
//#region packages/html2amp/lib/meta/charset.ts
|
|
201
|
-
function M(e) {
|
|
202
|
-
let t = e.querySelectorAll("meta");
|
|
203
|
-
for (let e of t) {
|
|
204
|
-
let t = e.getAttribute("charset");
|
|
205
|
-
if (t) {
|
|
206
|
-
t !== "utf-8" && e.setAttribute("charset", "utf-8");
|
|
207
|
-
return;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
let n = p(e), r = e.createElement("meta");
|
|
211
|
-
r.setAttribute("charset", "utf-8"), n.insertBefore(r, n.firstChild);
|
|
212
|
-
}
|
|
213
|
-
//#endregion
|
|
214
|
-
//#region packages/html2amp/lib/script.ts
|
|
215
|
-
function N(e, t, n) {
|
|
216
|
-
let r = n("script:not([type=\"application/ld+json\"])"), i = e.querySelectorAll(r);
|
|
217
|
-
for (let e of i) !e.getAttribute("src")?.startsWith("https://cdn.ampproject.org/") && !(e.closest("amp-state") && e.getAttribute("type") === "application/json") && e.remove();
|
|
218
|
-
}
|
|
219
|
-
//#endregion
|
|
220
|
-
//#region packages/html2amp/lib/const.ts
|
|
221
|
-
var P = "https://cdn.ampproject.org/v0", F = `${P}.js`, I = `script[src='${F}']`;
|
|
222
|
-
//#endregion
|
|
223
|
-
//#region packages/html2amp/lib/extensions.ts
|
|
224
|
-
function L(e, t) {
|
|
225
|
-
return `${P}/${e.toLowerCase()}-${t}.js`;
|
|
226
|
-
}
|
|
227
|
-
async function R(e, t, n) {
|
|
228
|
-
for (let { name: r, versions: i } of t) {
|
|
229
|
-
let t = n.replaceSelectors(r === "amp-mustache" ? `script[async][custom-template='${r}']` : `script[async][custom-element='${r}']`);
|
|
230
|
-
if (!e.querySelector(t)) {
|
|
231
|
-
let t = p(e), a = n.createElementFn("script"), o = L(r, i.findLast((e) => e !== "latest") || "v0");
|
|
232
|
-
a.setAttribute("async", ""), a.setAttribute(r === "amp-mustache" ? "custom-template" : "custom-element", r), a.setAttribute("src", o), t.appendChild(a), t.appendChild(e.createTextNode("\n"));
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
function z(e, t) {
|
|
237
|
-
let n = e.querySelectorAll("*"), r = e.querySelectorAll(t.replaceSelectors("script[src]"));
|
|
238
|
-
for (let e of r) e.getAttribute("src")?.startsWith("https://cdn.ampproject.org/v0") && e.remove();
|
|
239
|
-
for (let e of n) Y(e) && e.tagName !== "FORM" && e.remove();
|
|
240
|
-
}
|
|
241
|
-
//#endregion
|
|
242
|
-
//#region packages/html2amp/getValidationRules.ts
|
|
243
|
-
var B = void 0;
|
|
244
|
-
async function V() {
|
|
245
|
-
return B ||= await import("./d1db685d.js").then((e) => e.default);
|
|
246
|
-
}
|
|
247
|
-
//#endregion
|
|
248
|
-
//#region packages/html2amp/getSelectorCache.ts
|
|
249
|
-
var H = /* @__PURE__ */ new Map();
|
|
250
|
-
async function U() {
|
|
251
|
-
if (!H.size) {
|
|
252
|
-
let e = await V(), t = e.tags;
|
|
253
|
-
for (let n = 0; n < t.length; n++) {
|
|
254
|
-
let r = t[n], { selector: i, attrs: a, attrLists: o } = r, s = o?.flatMap((t) => e.attrLists.filter(({ name: e }) => e === t).flatMap((e) => e.attrs)) || [];
|
|
255
|
-
H.set(i, {
|
|
256
|
-
...r,
|
|
257
|
-
priority: n,
|
|
258
|
-
attrs: new Map([...a, ...s].map((e) => [e.name, e]))
|
|
259
|
-
});
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
return H;
|
|
263
|
-
}
|
|
264
|
-
//#endregion
|
|
265
|
-
//#region packages/html2amp/getDeclarationsCache.ts
|
|
266
|
-
var W = /* @__PURE__ */ new Map();
|
|
267
|
-
async function G() {
|
|
268
|
-
if (!W.size) {
|
|
269
|
-
let e = await V();
|
|
270
|
-
for (let t of e.declarations) W.set(t.name, t);
|
|
271
|
-
}
|
|
272
|
-
return W;
|
|
273
|
-
}
|
|
274
|
-
//#endregion
|
|
275
|
-
//#region packages/html2amp/getGlobalsAttributes.ts
|
|
276
|
-
var K = "$GLOBAL_ATTRS", q = /* @__PURE__ */ new Map();
|
|
277
|
-
async function J() {
|
|
278
|
-
if (!q.size) {
|
|
279
|
-
let e = (await V()).attrLists.find((e) => e.name === K)?.attrs;
|
|
280
|
-
if (e) for (let t of e) q.set(t.name, t);
|
|
281
|
-
}
|
|
282
|
-
return q;
|
|
283
|
-
}
|
|
284
|
-
//#endregion
|
|
285
|
-
//#region packages/html2amp/index.ts
|
|
286
|
-
function Y(e) {
|
|
287
|
-
return a(e) && (e.tagName.startsWith("AMP") || e.tagName === "FORM" || e.tagName === "TEMPLATE" && e.getAttribute("type")?.toLowerCase() === "amp-mustache");
|
|
288
|
-
}
|
|
289
|
-
function X(e, t, r) {
|
|
290
|
-
if (!t) return;
|
|
291
|
-
function o() {
|
|
292
|
-
let n = t.compareDocumentPosition(e);
|
|
293
|
-
if (!(n & 8)) {
|
|
294
|
-
if (n & 2) return t.insertBefore(e, t.firstChild), !0;
|
|
295
|
-
if (n & 4) return t.appendChild(e), !0;
|
|
296
|
-
}
|
|
297
|
-
return !1;
|
|
298
|
-
}
|
|
299
|
-
function s() {
|
|
300
|
-
let n = [...e.childNodes];
|
|
301
|
-
for (let e = n.length - 1; e >= 0; e--) X(n[e], t, r);
|
|
302
|
-
}
|
|
303
|
-
if (a(e)) switch (e.tagName.toLowerCase()) {
|
|
304
|
-
case "body": return;
|
|
305
|
-
case r("script"):
|
|
306
|
-
case "style":
|
|
307
|
-
case "meta":
|
|
308
|
-
case "title": return;
|
|
309
|
-
case "head":
|
|
310
|
-
case "html":
|
|
311
|
-
s();
|
|
312
|
-
break;
|
|
313
|
-
default:
|
|
314
|
-
o() || s();
|
|
315
|
-
break;
|
|
316
|
-
}
|
|
317
|
-
else n(e) ? s() : i(e) && (e.textContent?.trim() || e.nextSibling?.textContent?.trim() && i(e.nextSibling)) && o();
|
|
318
|
-
}
|
|
319
|
-
async function Z(e, t) {
|
|
320
|
-
let n = /* @__PURE__ */ new Set(), i = t.commit, o = (e) => t.replaceSelectors(e.toLowerCase());
|
|
321
|
-
if (t.replaceImages && await A(e, i), t.injectExtensions) {
|
|
322
|
-
let n = t.replaceSelectors(I);
|
|
323
|
-
if (!e.querySelector(n)) {
|
|
324
|
-
let n = t.createElementFn("script");
|
|
325
|
-
n.setAttribute("src", F), n.setAttribute("async", ""), p(e).appendChild(n), i?.();
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
t.injectRequiredTags && (N(e, t.createElementFn, o), E(e), g(e), M(e), i?.()), t.replaceStylesAndLinks && (S(e), i?.());
|
|
329
|
-
let s = await V(), l = await U(), u = new Set(t.removeUnsupportedTags ? e.querySelectorAll("*") : []), d = /* @__PURE__ */ new Map();
|
|
330
|
-
for (let [n, r] of l) if (!r.deprecation) {
|
|
331
|
-
n = o(n);
|
|
332
|
-
let i = [...e.querySelectorAll(n)].filter((e) => !d.has(e));
|
|
333
|
-
r.unique && i.length && (i = [i[0]]), t.injectRequiredTags && r.required && !i.length && (i = [...i, t.createElementFn(r.name)]);
|
|
334
|
-
for (let e of i) {
|
|
335
|
-
if (t.injectRequiredAttributes && e.getAttribute("on") && !e.getAttribute("tabindex") && e.setAttribute("tabindex", "0"), t.removeUnsupportedStyles) {
|
|
336
|
-
let t = !1;
|
|
337
|
-
for (let n of [...e.classList]) n.startsWith("i-amphtml") && (t = !0, e.classList.remove(n));
|
|
338
|
-
t && !e.classList.length && e.removeAttribute("class");
|
|
339
|
-
}
|
|
340
|
-
let n = d.get(e);
|
|
341
|
-
n && n.priority > r.priority || d.set(e, r);
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
i?.();
|
|
345
|
-
for (let [r, o] of d) {
|
|
346
|
-
if (t.injectExtensions && o.requiresExtension) for (let e of o.requiresExtension) n.add(e);
|
|
347
|
-
let s = o.requiredParent ? o.requiredParent === "$ROOT" ? e : e.querySelector(o.requiredParent) : null;
|
|
348
|
-
s && (!r.parentNode || t.moveInvalidTagPosition) ? s !== r.parentNode && (o.name === "HEAD" || a(s) && s.tagName === "HEAD" ? s.insertBefore(r, s.firstChild) : s.appendChild(r)) : r.parentNode || e.body.appendChild(r), t.removeUnsupportedTags && u.delete(r), i?.();
|
|
349
|
-
let l = await J();
|
|
350
|
-
if (t.removeUnsupportedAttributes || t.injectRequiredAttributes) {
|
|
351
|
-
let e = o.attrs, n = t.injectRequiredAttributes ? new Set([...e].map(([e, t]) => t).filter((e) => e.required && e.value)) : void 0, i = r.getAttributeNames();
|
|
352
|
-
for (let a of i) {
|
|
353
|
-
let i = e.get(a) || l.get(a);
|
|
354
|
-
if (i) {
|
|
355
|
-
if (a === "id" || a === "class" || a === "style") {
|
|
356
|
-
n?.delete(i);
|
|
357
|
-
continue;
|
|
358
|
-
}
|
|
359
|
-
if (t.removeUnsupportedAttributes) {
|
|
360
|
-
let e = r.getAttribute(a);
|
|
361
|
-
if (i.value && i.value.indexOf(e) < 0) {
|
|
362
|
-
r.removeAttribute(a);
|
|
363
|
-
continue;
|
|
364
|
-
}
|
|
365
|
-
if (i.valueRegex && !new RegExp(i.valueRegex).test(e)) {
|
|
366
|
-
r.removeAttribute(a);
|
|
367
|
-
continue;
|
|
368
|
-
}
|
|
369
|
-
if (i.disallowedValueRegex && new RegExp(i.disallowedValueRegex).test(e)) {
|
|
370
|
-
r.removeAttribute(a);
|
|
371
|
-
continue;
|
|
372
|
-
}
|
|
373
|
-
let t = i.valueUrl;
|
|
374
|
-
if (t) {
|
|
375
|
-
if (e === "") {
|
|
376
|
-
if (!t.allowEmpty) {
|
|
377
|
-
r.removeAttribute(a);
|
|
378
|
-
continue;
|
|
379
|
-
}
|
|
380
|
-
} else if (!(e.indexOf("<!--") > 0 && e.indexOf("-->") > 0) && !t.allowRelative) if (e.startsWith("#") || e.startsWith("/")) {
|
|
381
|
-
r.removeAttribute(a);
|
|
382
|
-
continue;
|
|
383
|
-
} else {
|
|
384
|
-
let n = t.protocol.length ? t.protocol : ["https"], i = e.substring(0, e.indexOf(":"));
|
|
385
|
-
if (i) {
|
|
386
|
-
if (n.indexOf(i) < 0) {
|
|
387
|
-
let t = n[0] + e.substring(e.indexOf(":"));
|
|
388
|
-
if (URL.canParse(t)) c(r, a, t);
|
|
389
|
-
else {
|
|
390
|
-
r.removeAttribute(a);
|
|
391
|
-
continue;
|
|
392
|
-
}
|
|
393
|
-
} else if (!URL.canParse(e)) {
|
|
394
|
-
r.removeAttribute(a);
|
|
395
|
-
continue;
|
|
396
|
-
}
|
|
397
|
-
} else {
|
|
398
|
-
let t = n[0] + e;
|
|
399
|
-
if (URL.canParse(t)) c(r, a, t);
|
|
400
|
-
else {
|
|
401
|
-
r.removeAttribute(a);
|
|
402
|
-
continue;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
n?.delete(i);
|
|
409
|
-
} else {
|
|
410
|
-
if (a === "id" || a === "class" || a === "style") continue;
|
|
411
|
-
t.removeUnsupportedAttributes && r.removeAttribute(a);
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
if (n) for (let e of n) c(r, e.name, e.value[0]);
|
|
415
|
-
}
|
|
416
|
-
i?.();
|
|
417
|
-
}
|
|
418
|
-
t.moveInvalidTagPosition && (X(e, e.body, o), i?.());
|
|
419
|
-
for (let e of u) e.remove();
|
|
420
|
-
if (i?.(), t.removeUnsupportedStyles) {
|
|
421
|
-
let t = e.querySelectorAll("*"), n = await G();
|
|
422
|
-
function a(e) {
|
|
423
|
-
let t = e.cssText.replaceAll(/\".*\"/g, "").replaceAll(/\'.*\'/g, "").replaceAll(/\/\*.*\*\/|(-moz-|-ms-|-o-|-webkit-)+\w+(?=:)/g, "").match(/[a-z-]+(?=:[^before|after|hover])/gi) || [];
|
|
424
|
-
for (let r of t) {
|
|
425
|
-
if (!r) continue;
|
|
426
|
-
let t = e.getPropertyValue(r);
|
|
427
|
-
e.getPropertyPriority(r) === "important" && e.setProperty(r, t);
|
|
428
|
-
let i = n.get(r);
|
|
429
|
-
i ? i.value ? i.value.indexOf(t) < 0 && e.removeProperty(r) : i.valueRegex && (new RegExp(i.valueRegex).test(t) || e.removeProperty(r)) : e.removeProperty(r);
|
|
430
|
-
}
|
|
431
|
-
i?.();
|
|
432
|
-
}
|
|
433
|
-
function o(e) {
|
|
434
|
-
return e.constructor.name === "CSSStyleRule";
|
|
435
|
-
}
|
|
436
|
-
function s(e) {
|
|
437
|
-
return e.constructor.name === "CSSMediaRule";
|
|
438
|
-
}
|
|
439
|
-
function c(e) {
|
|
440
|
-
let t = e.cssRules;
|
|
441
|
-
for (let n = t.length - 1; n >= 0; n--) {
|
|
442
|
-
let r = t[n];
|
|
443
|
-
o(r) ? r.selectorText.indexOf("[") >= 0 || r.selectorText.indexOf(":") >= 0 ? e.deleteRule(n) : (a(r.style), r.style.cssText || e.deleteRule(n)) : s(r) ? (c(r), r.cssRules.length || e.deleteRule(n)) : e.deleteRule(n);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
for (let e of t) if (r(e)) {
|
|
447
|
-
let t = e.getAttribute("style");
|
|
448
|
-
t && (a(e.style), e.style.length ? e.style.cssText !== t && e.setAttribute("style", e.style.cssText) : e.removeAttribute("style"));
|
|
449
|
-
}
|
|
450
|
-
let l = e.querySelector("style[amp-custom]");
|
|
451
|
-
if (l) {
|
|
452
|
-
let e = l.sheet;
|
|
453
|
-
e && (c(e), l.innerHTML = [...e.cssRules].map((e) => e.cssText).join("\n")), i?.();
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
await R(e, s.extensions.filter(({ name: e }) => n.has(e)), t);
|
|
457
|
-
}
|
|
458
|
-
function Q(e, t) {
|
|
459
|
-
return Object.keys(t).reduce((e, n) => e.replaceAll(n, t[n]), e);
|
|
460
|
-
}
|
|
461
|
-
function $(e, t = {}) {
|
|
462
|
-
let { correct: n = !0, injectExtensions: r = !0, mappedTags: i = {} } = t;
|
|
463
|
-
return Z(e, {
|
|
464
|
-
replaceImages: n,
|
|
465
|
-
replaceStylesAndLinks: n,
|
|
466
|
-
injectRequiredTags: n,
|
|
467
|
-
injectExtensions: r,
|
|
468
|
-
formsAsAmpForms: r,
|
|
469
|
-
injectRequiredAttributes: n,
|
|
470
|
-
moveInvalidTagPosition: n,
|
|
471
|
-
removeUnsupportedTags: n,
|
|
472
|
-
removeUnsupportedAttributes: n,
|
|
473
|
-
removeUnsupportedStyles: n,
|
|
474
|
-
createElementFn: (t) => e.createElement(i[t.toLowerCase()] || t),
|
|
475
|
-
replaceSelectors: (e) => Q(e.toLowerCase(), i),
|
|
476
|
-
commit: t.commit
|
|
477
|
-
});
|
|
478
|
-
}
|
|
479
|
-
function ee(e, t = {}) {
|
|
480
|
-
let { correct: n = !0, removeExtensions: r = !0, mappedTags: i = {} } = t, a = t.commit, o = (t) => e.createElement(i[t.toLowerCase()] || t), s = (e) => Q(e, i);
|
|
481
|
-
if (n) {
|
|
482
|
-
j(e), D(e), C(e), _(e);
|
|
483
|
-
let t = f(e);
|
|
484
|
-
t.removeAttribute("⚡4email"), t.removeAttribute("data-css-strict"), a?.();
|
|
485
|
-
}
|
|
486
|
-
r && (z(e, {
|
|
487
|
-
formsAsAmpForms: t.removeExtensions,
|
|
488
|
-
createElementFn: o,
|
|
489
|
-
replaceSelectors: s
|
|
490
|
-
}), a?.());
|
|
491
|
-
}
|
|
492
|
-
//#endregion
|
|
493
|
-
export { u as a, P as i, $ as n, d as o, Y as r, ee as t };
|