@zonos/elements 1.3.223 → 1.3.224
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/cjs/VarianceTest-bec00ea8.js +91 -0
- package/dist/cjs/{cart-3a2a062c.js → cart-af017ac3.js} +41 -40
- package/dist/cjs/{debounce-465a4328.js → debounce-2c9f3f1e.js} +1 -1
- package/dist/cjs/{getBorderRadius-1b5e33cf.js → getBorderRadius-c7d9f676.js} +1 -1
- package/dist/cjs/{handleFetch-45f35cac.js → handleFetch-954f30e1.js} +5 -82
- package/dist/cjs/index.cjs.js +40 -37
- package/dist/cjs/{isDarkColor-428965f4.js → isDarkColor-994c38e4.js} +1 -1
- package/dist/cjs/{localization-12e7e934.js → localization-21030292.js} +82 -24
- package/dist/cjs/{paypal-a1377508.js → paypal-2b22f0f5.js} +17 -16
- package/dist/cjs/{placeTestOrder-6fcce33e.js → placeTestOrder-9cde1ca4.js} +3 -3
- package/dist/cjs/{renderFallback-39ba034b.js → renderFallback-9300dbaf.js} +8 -7
- package/dist/cjs/{translationStore-951ed4b4.js → translationStore-ce2c700d.js} +1 -1
- package/dist/cjs/{updateCheckoutSessionAttributes-c0853fdd.js → updateCheckoutSessionAttributes-a4899e90.js} +2 -2
- package/dist/cjs/zonos-address_11.cjs.entry.js +16 -16
- package/dist/cjs/zonos-badge.cjs.entry.js +2 -2
- package/dist/cjs/zonos-banner_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-button_3.cjs.entry.js +4 -4
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +25 -25
- package/dist/cjs/zonos-checkout.cjs.entry.js +68 -67
- package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +8 -8
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +19 -19
- package/dist/cjs/zonos-collect.cjs.entry.js +20 -20
- package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +4 -4
- package/dist/cjs/zonos-controller.cjs.entry.js +40 -39
- package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +6 -6
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +14 -14
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
- package/dist/cjs/zonos-hello.cjs.entry.js +12 -12
- package/dist/cjs/zonos-input.cjs.entry.js +3 -3
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +5 -5
- package/dist/cjs/zonos-text.cjs.entry.js +2 -2
- package/dist/cjs/zonos-toggle.cjs.entry.js +2 -2
- package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
- package/dist/cjs/{zonosStore-f8ee56aa.js → zonosStore-5d489c65.js} +8 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +4 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -0
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.css +1 -0
- package/dist/collection/components/main/zonos-controller.js +1 -1
- package/dist/collection/components/store/hello/localization.js +12 -9
- package/dist/collection/components/store/zonosStore.js +8 -1
- package/dist/collection/components/utils/api/getZonosSettings.js +2 -0
- package/dist/collection/components/utils/hello/currencyConversion/currencyDisplay.js +2 -0
- package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js +5 -0
- package/dist/collection/components/utils/logging/sendLoadCheckoutFacadeLog.js +1 -1
- package/dist/collection/components/utils/logging/sendLoadNativeCheckoutLog.js +1 -1
- package/dist/collection/scripts/_zonosBase.js +3 -0
- package/dist/collection/types/generated/graphql.internal.types.js +3 -0
- package/dist/collection/utils/performBlurCurrency.js +50 -0
- package/dist/esm/VarianceTest-572cecf5.js +86 -0
- package/dist/esm/{cart-7f06662c.js → cart-11b87221.js} +7 -6
- package/dist/esm/{debounce-c34d1270.js → debounce-f081e4d8.js} +1 -1
- package/dist/esm/{getBorderRadius-87593ff4.js → getBorderRadius-6281d902.js} +1 -1
- package/dist/esm/{handleFetch-99218189.js → handleFetch-a844cac1.js} +2 -76
- package/dist/esm/index.js +13 -9
- package/dist/esm/{isDarkColor-1f58b6be.js → isDarkColor-83e0c27e.js} +1 -1
- package/dist/esm/{localization-192886e4.js → localization-9320a65d.js} +71 -13
- package/dist/esm/{paypal-53f1b4a1.js → paypal-338a4350.js} +7 -6
- package/dist/esm/{placeTestOrder-95cbb623.js → placeTestOrder-d28f33c2.js} +3 -3
- package/dist/esm/{renderFallback-6352363c.js → renderFallback-28ef3364.js} +5 -4
- package/dist/esm/{translationStore-fb98a08d.js → translationStore-7eebaa41.js} +1 -1
- package/dist/esm/{updateCheckoutSessionAttributes-92f42882.js → updateCheckoutSessionAttributes-160720f6.js} +2 -2
- package/dist/esm/zonos-address_11.entry.js +9 -9
- package/dist/esm/zonos-badge.entry.js +2 -2
- package/dist/esm/zonos-banner_2.entry.js +3 -3
- package/dist/esm/zonos-button_3.entry.js +4 -4
- package/dist/esm/zonos-cart-items_12.entry.js +12 -12
- package/dist/esm/zonos-checkout.entry.js +15 -14
- package/dist/esm/zonos-collapse.entry.js +2 -2
- package/dist/esm/zonos-collect-cart-items_3.entry.js +8 -8
- package/dist/esm/zonos-collect-finish_6.entry.js +11 -11
- package/dist/esm/zonos-collect.entry.js +10 -10
- package/dist/esm/zonos-confirm-dialog_2.entry.js +4 -4
- package/dist/esm/zonos-controller.entry.js +10 -9
- package/dist/esm/zonos-country-flag.entry.js +5 -5
- package/dist/esm/zonos-country-select_4.entry.js +6 -6
- package/dist/esm/zonos-empty-state-payment_4.entry.js +9 -9
- package/dist/esm/zonos-hello-dialog.entry.js +5 -5
- package/dist/esm/zonos-hello.entry.js +6 -6
- package/dist/esm/zonos-input.entry.js +3 -3
- package/dist/esm/zonos-language-select_2.entry.js +5 -5
- package/dist/esm/zonos-logo.entry.js +2 -2
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-stripe-input.entry.js +5 -5
- package/dist/esm/zonos-text.entry.js +2 -2
- package/dist/esm/zonos-toggle.entry.js +2 -2
- package/dist/esm/zonos-v-stack.entry.js +2 -2
- package/dist/esm/{zonosStore-c456b933.js → zonosStore-e3d0493a.js} +8 -2
- package/dist/esm-es5/VarianceTest-572cecf5.js +1 -0
- package/dist/esm-es5/cart-11b87221.js +1 -0
- package/dist/esm-es5/{debounce-c34d1270.js → debounce-f081e4d8.js} +1 -1
- package/dist/esm-es5/{getBorderRadius-87593ff4.js → getBorderRadius-6281d902.js} +1 -1
- package/dist/esm-es5/handleFetch-a844cac1.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-1f58b6be.js → isDarkColor-83e0c27e.js} +1 -1
- package/dist/esm-es5/localization-9320a65d.js +1 -0
- package/dist/esm-es5/{paypal-53f1b4a1.js → paypal-338a4350.js} +2 -2
- package/dist/esm-es5/{placeTestOrder-95cbb623.js → placeTestOrder-d28f33c2.js} +1 -1
- package/dist/esm-es5/renderFallback-28ef3364.js +1 -0
- package/dist/esm-es5/{translationStore-fb98a08d.js → translationStore-7eebaa41.js} +1 -1
- package/dist/esm-es5/{updateCheckoutSessionAttributes-92f42882.js → updateCheckoutSessionAttributes-160720f6.js} +1 -1
- package/dist/esm-es5/zonos-address_11.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-banner_2.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collapse.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-confirm-dialog_2.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-input.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/zonos-toggle.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/esm-es5/zonosStore-e3d0493a.js +1 -0
- package/dist/scripts/blurCurrencyOnInit.js +1 -0
- package/dist/scripts/index.d.ts +38 -6
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/scripts/_zonosBase.d.ts +8 -3
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +7 -3
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +2 -2
- package/dist/types/types/generated/graphql.internal.types.d.ts +13 -2
- package/dist/types/types/generated/graphql.internal.types.ts +13 -2
- package/dist/types/types/global.d.ts +8 -0
- package/dist/types/types/utils/ZonosSettings.d.ts +8 -2
- package/dist/types/utils/performBlurCurrency.d.ts +2 -0
- package/dist/zonos-elements/base.css +1 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-01174496.system.js +1 -0
- package/dist/zonos-elements/p-0260fd13.js +1 -0
- package/dist/zonos-elements/{p-e970f2aa.system.entry.js → p-04c1dc63.system.entry.js} +1 -1
- package/dist/zonos-elements/p-0a377722.js +1 -0
- package/dist/zonos-elements/p-0a92e3fd.entry.js +1 -0
- package/dist/zonos-elements/{p-8350937d.system.entry.js → p-0b6a3a09.system.entry.js} +1 -1
- package/dist/zonos-elements/p-0d82e1fd.entry.js +1 -0
- package/dist/zonos-elements/{p-a7485913.system.js → p-0ec82d78.system.js} +2 -2
- package/dist/zonos-elements/{p-2b9c124d.js → p-0ffd710e.js} +1 -1
- package/dist/zonos-elements/p-112c6453.system.js +1 -0
- package/dist/zonos-elements/{p-62fa680d.system.js → p-182da73f.system.js} +1 -1
- package/dist/zonos-elements/p-1868a283.entry.js +1 -0
- package/dist/zonos-elements/{p-ba18c5f5.system.entry.js → p-1a67ae71.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-520bd291.system.entry.js → p-1b9cc0e2.system.entry.js} +1 -1
- package/dist/zonos-elements/p-1c5ba523.js +1 -0
- package/dist/zonos-elements/p-1ef793d0.entry.js +1 -0
- package/dist/zonos-elements/{p-0ed63ce0.system.js → p-23c46dfa.system.js} +1 -1
- package/dist/zonos-elements/{p-e7f8595f.system.js → p-24e26a2c.system.js} +1 -1
- package/dist/zonos-elements/p-252fa1da.entry.js +1 -0
- package/dist/zonos-elements/{p-53b46925.entry.js → p-2616ba72.entry.js} +1 -1
- package/dist/zonos-elements/p-2657f099.system.entry.js +1 -0
- package/dist/zonos-elements/{p-7d2d2c94.entry.js → p-2dc38ef3.entry.js} +1 -1
- package/dist/zonos-elements/{p-12ce9746.system.entry.js → p-360d7101.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-19f25feb.system.entry.js → p-375994d1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ee6f8c02.system.entry.js → p-38f42f10.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4637f365.system.entry.js → p-4004c838.system.entry.js} +1 -1
- package/dist/zonos-elements/p-41dd1cb8.js +1 -0
- package/dist/zonos-elements/{p-e63b8b24.system.js → p-433d76b4.system.js} +1 -1
- package/dist/zonos-elements/{p-a77ed1b9.entry.js → p-4523b982.entry.js} +1 -1
- package/dist/zonos-elements/{p-fc27467b.entry.js → p-4ce3489a.entry.js} +1 -1
- package/dist/zonos-elements/{p-a61a9b65.system.entry.js → p-4da7b6a8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7b56e345.js → p-4dfe97ad.js} +2 -2
- package/dist/zonos-elements/{p-cd1ebef9.system.js → p-57413c34.system.js} +1 -1
- package/dist/zonos-elements/{p-4d9ad3b1.system.entry.js → p-576d76fa.system.entry.js} +1 -1
- package/dist/zonos-elements/p-5c43ecdf.system.entry.js +1 -0
- package/dist/zonos-elements/{p-9fdd3264.system.entry.js → p-5f7a9b69.system.entry.js} +1 -1
- package/dist/zonos-elements/p-6092af05.entry.js +1 -0
- package/dist/zonos-elements/{p-9b062dfb.entry.js → p-67787bd4.entry.js} +1 -1
- package/dist/zonos-elements/{p-7c4e7651.entry.js → p-6bab9096.entry.js} +1 -1
- package/dist/zonos-elements/p-6d423364.entry.js +1 -0
- package/dist/zonos-elements/p-725605f6.system.js +1 -0
- package/dist/zonos-elements/p-7af39c98.js +1 -0
- package/dist/zonos-elements/{p-7f7abdf2.system.entry.js → p-7cee0e68.system.entry.js} +1 -1
- package/dist/zonos-elements/p-7eb8e2d4.js +1 -0
- package/dist/zonos-elements/p-81b357f7.system.js +1 -1
- package/dist/zonos-elements/p-820ad058.js +1 -0
- package/dist/zonos-elements/{p-5e3d2bd2.system.entry.js → p-873b6185.system.entry.js} +1 -1
- package/dist/zonos-elements/p-89c5164b.system.js +1 -0
- package/dist/zonos-elements/p-91f32c73.system.js +1 -0
- package/dist/zonos-elements/{p-245f6ad4.system.entry.js → p-9e03a145.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0ae53ff0.js → p-a199bb13.js} +1 -1
- package/dist/zonos-elements/p-ae3e4f2b.entry.js +1 -0
- package/dist/zonos-elements/{p-567f7de7.entry.js → p-b4bf2f03.entry.js} +1 -1
- package/dist/zonos-elements/p-b5b3f908.system.js +1 -0
- package/dist/zonos-elements/{p-a5b0a636.entry.js → p-b658c28a.entry.js} +1 -1
- package/dist/zonos-elements/{p-de626806.system.entry.js → p-b6ef4a5e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4f8563ad.system.entry.js → p-b91df44b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e8accbef.system.entry.js → p-ba334962.system.entry.js} +1 -1
- package/dist/zonos-elements/p-bccd49d7.system.entry.js +1 -0
- package/dist/zonos-elements/p-bdeb20cb.js +1 -0
- package/dist/zonos-elements/{p-a95d2034.system.entry.js → p-bfc0fc85.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c4b3c878.entry.js → p-c81f6387.entry.js} +1 -1
- package/dist/zonos-elements/{p-efa6203f.entry.js → p-c998e4ed.entry.js} +1 -1
- package/dist/zonos-elements/{p-9396059b.entry.js → p-cb0e6468.entry.js} +1 -1
- package/dist/zonos-elements/{p-421dfb66.system.entry.js → p-cb11d11b.system.entry.js} +1 -1
- package/dist/zonos-elements/p-cc599cd9.entry.js +1 -0
- package/dist/zonos-elements/p-ce4c6ae0.entry.js +1 -0
- package/dist/zonos-elements/{p-14f9bc8c.entry.js → p-d2f7ea09.entry.js} +1 -1
- package/dist/zonos-elements/{p-0c0fda23.js → p-d42b5113.js} +1 -1
- package/dist/zonos-elements/{p-00423fa0.system.js → p-d531b524.system.js} +1 -1
- package/dist/zonos-elements/p-d938f42f.system.js +1 -0
- package/dist/zonos-elements/{p-f4fa8720.entry.js → p-d96545ae.entry.js} +1 -1
- package/dist/zonos-elements/{p-eb6a35ce.system.entry.js → p-dc56b469.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-45d288d0.system.entry.js → p-e00e5d64.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8194fcd8.entry.js → p-e60b988c.entry.js} +1 -1
- package/dist/zonos-elements/{p-56e0ed65.js → p-e688e493.js} +1 -1
- package/dist/zonos-elements/{p-295d9c07.system.entry.js → p-f548807d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e7b05da2.entry.js → p-f912e9c3.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.css +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +4 -3
- package/dist/cjs/VarianceTest-0cb1e118.js +0 -12
- package/dist/esm/VarianceTest-fef2d958.js +0 -10
- package/dist/esm-es5/VarianceTest-fef2d958.js +0 -1
- package/dist/esm-es5/cart-7f06662c.js +0 -1
- package/dist/esm-es5/handleFetch-99218189.js +0 -1
- package/dist/esm-es5/localization-192886e4.js +0 -1
- package/dist/esm-es5/renderFallback-6352363c.js +0 -1
- package/dist/esm-es5/zonosStore-c456b933.js +0 -1
- package/dist/zonos-elements/p-04a01cb1.js +0 -1
- package/dist/zonos-elements/p-062430f9.system.js +0 -1
- package/dist/zonos-elements/p-0e28207a.js +0 -1
- package/dist/zonos-elements/p-1cd1da90.system.js +0 -1
- package/dist/zonos-elements/p-2131fa8b.entry.js +0 -1
- package/dist/zonos-elements/p-30432622.system.entry.js +0 -1
- package/dist/zonos-elements/p-366ea017.entry.js +0 -1
- package/dist/zonos-elements/p-3f3c92db.system.entry.js +0 -1
- package/dist/zonos-elements/p-4a3abbf2.js +0 -1
- package/dist/zonos-elements/p-4dcbbd60.js +0 -1
- package/dist/zonos-elements/p-5a2dd041.system.js +0 -1
- package/dist/zonos-elements/p-640a6898.system.js +0 -1
- package/dist/zonos-elements/p-6afbbe66.entry.js +0 -1
- package/dist/zonos-elements/p-6cfe66fe.entry.js +0 -1
- package/dist/zonos-elements/p-6f6573a5.system.js +0 -1
- package/dist/zonos-elements/p-7ce093aa.js +0 -1
- package/dist/zonos-elements/p-9d863a3b.system.js +0 -1
- package/dist/zonos-elements/p-a435931e.system.entry.js +0 -1
- package/dist/zonos-elements/p-a8a312b2.js +0 -1
- package/dist/zonos-elements/p-a9b3cfe1.entry.js +0 -1
- package/dist/zonos-elements/p-abcefd25.entry.js +0 -1
- package/dist/zonos-elements/p-b76db2ac.js +0 -1
- package/dist/zonos-elements/p-bbf48b31.entry.js +0 -1
- package/dist/zonos-elements/p-bdf183a3.entry.js +0 -1
- package/dist/zonos-elements/p-d1b415cd.entry.js +0 -1
- package/dist/zonos-elements/p-d2098bef.entry.js +0 -1
- package/dist/zonos-elements/p-da200c19.system.js +0 -1
- package/dist/zonos-elements/p-df0cbde4.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
|
|
6
6
|
const getGenericSettingsOverride = require('./getGenericSettingsOverride-c0ca32b9.js');
|
|
7
|
-
const
|
|
7
|
+
const VarianceTest = require('./VarianceTest-bec00ea8.js');
|
|
8
|
+
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
8
9
|
const CheckoutConfig = require('./CheckoutConfig-27c82f94.js');
|
|
9
|
-
const VarianceTest = require('./VarianceTest-0cb1e118.js');
|
|
10
10
|
const TaxId = require('./TaxId-12acedde.js');
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -70,10 +70,10 @@ const getWithTestPublicCredential = async () => {
|
|
|
70
70
|
if ((!isTestMode && !isStagingMode) || !window.Zonos.zonosApiKey) {
|
|
71
71
|
return null;
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
VarianceTest.log('[ZONOS - loadZonos] Attempt test public credential', 'info');
|
|
74
74
|
// Try to get the test public credential if the test mode is enabled and the public credential key is not a test key
|
|
75
75
|
if (!!window.Zonos.zonosApiKey.includes('credential_test')) {
|
|
76
|
-
|
|
76
|
+
VarianceTest.log('[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key', 'info');
|
|
77
77
|
return null;
|
|
78
78
|
}
|
|
79
79
|
const { errors: testPublicCredErrors, json: testPublicCredResult } = await handleFetch.handleFetch('/api/get-test-public-credential');
|
|
@@ -87,7 +87,7 @@ const getWithTestPublicCredential = async () => {
|
|
|
87
87
|
return null;
|
|
88
88
|
}
|
|
89
89
|
// Set the test public credential to the window object
|
|
90
|
-
|
|
90
|
+
VarianceTest.log(`[ZONOS - loadZonos] Retrieve new test public token ${testPublicCredential}`, 'info');
|
|
91
91
|
return testPublicCredential;
|
|
92
92
|
};
|
|
93
93
|
|
|
@@ -132,7 +132,7 @@ const getZonosQaUrl = () => {
|
|
|
132
132
|
return null;
|
|
133
133
|
}
|
|
134
134
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
135
|
-
const cdnUrl = "https://v1.3.
|
|
135
|
+
const cdnUrl = "https://v1.3.224.js.zonos.com";
|
|
136
136
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
137
137
|
if (!qaUrl &&
|
|
138
138
|
(cdnUrl.includes('test.') ||
|
|
@@ -158,7 +158,7 @@ const getZonosQaUrl = () => {
|
|
|
158
158
|
}
|
|
159
159
|
const suffixDomain = 'preview.js.zonos.com';
|
|
160
160
|
const fullUrl = `https://${qaUrl}.${suffixDomain}`;
|
|
161
|
-
|
|
161
|
+
VarianceTest.log(`[ZONOS-WARNING] using '${fullUrl}' for loading elements script`, 'warn');
|
|
162
162
|
// request to the url and check if the request has an error
|
|
163
163
|
void fetch(fullUrl)
|
|
164
164
|
.then(() => {
|
|
@@ -324,7 +324,7 @@ const getCartInfoById = async ({ cartId, retries, }) => {
|
|
|
324
324
|
});
|
|
325
325
|
const failedResponse = !json || errors.length;
|
|
326
326
|
if (failedResponse && retries) {
|
|
327
|
-
|
|
327
|
+
VarianceTest.log('[ZONOS - loadZonos] temp cart not ready, retrying in 1 second', 'info', {
|
|
328
328
|
retries,
|
|
329
329
|
});
|
|
330
330
|
// wait 1 second before retrying
|
|
@@ -344,7 +344,7 @@ const setupCartDataWithSettings = async (cartId) => {
|
|
|
344
344
|
return null;
|
|
345
345
|
}
|
|
346
346
|
const tempCartResult = await getCartInfoById({ cartId, retries: 5 });
|
|
347
|
-
|
|
347
|
+
VarianceTest.log('[ZONOS - loadZonos] getting temp cart data', 'info', tempCartResult);
|
|
348
348
|
if (!tempCartResult) {
|
|
349
349
|
handleFetch.logError('[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.');
|
|
350
350
|
return null;
|
|
@@ -379,10 +379,11 @@ const zonosLoadUrl = (() => {
|
|
|
379
379
|
}
|
|
380
380
|
return null;
|
|
381
381
|
})();
|
|
382
|
-
const
|
|
383
|
-
const
|
|
384
|
-
const
|
|
385
|
-
const
|
|
382
|
+
const startLoadTime = Date.now();
|
|
383
|
+
const ZONOS_URL = "https://v1.3.224.js.zonos.com";
|
|
384
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.224";
|
|
385
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.224";
|
|
386
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.224";
|
|
386
387
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
387
388
|
const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
|
|
388
389
|
class Zonos {
|
|
@@ -400,8 +401,9 @@ Zonos.iframeLogType = typeof window !== 'undefined'
|
|
|
400
401
|
? new URLSearchParams(window.location.search).get('iframeLogType')
|
|
401
402
|
: null;
|
|
402
403
|
Zonos.isBigCommerce = false;
|
|
403
|
-
Zonos.releaseDate = "
|
|
404
|
+
Zonos.releaseDate = "1752786758525";
|
|
404
405
|
Zonos.isLegacyCheckout = false;
|
|
406
|
+
Zonos.startLoadTime = startLoadTime;
|
|
405
407
|
Zonos.domain = typeof window !== 'undefined'
|
|
406
408
|
? // domain that embeds the iframe
|
|
407
409
|
(window.location != window.parent.location && document.referrer) ||
|
|
@@ -419,7 +421,7 @@ Zonos.isNpm = true;
|
|
|
419
421
|
Zonos.zonosQaUrl = null;
|
|
420
422
|
Zonos.zonosQaUrlApi = null;
|
|
421
423
|
Zonos.trackEventLogs = [];
|
|
422
|
-
Zonos.version = `v${"1.3.
|
|
424
|
+
Zonos.version = `v${"1.3.224"}`;
|
|
423
425
|
Zonos.modeAlerted = false;
|
|
424
426
|
Zonos.cartData = null;
|
|
425
427
|
Zonos.paypal = null;
|
|
@@ -436,15 +438,15 @@ Zonos.init = async (params) => {
|
|
|
436
438
|
// do nothing if zonos is already initialized
|
|
437
439
|
return;
|
|
438
440
|
}
|
|
439
|
-
|
|
441
|
+
VarianceTest.log(`====== ZONOS DEBUG MODE: on (${_a.version}) ======`);
|
|
440
442
|
_a.zonosApiKey = zonosApiKey;
|
|
441
443
|
_a.storeId = storeId;
|
|
442
444
|
if (_a.isNpm) {
|
|
443
|
-
|
|
445
|
+
VarianceTest.log('====== ZONOS LOADING FROM NPM ======');
|
|
444
446
|
const zonosQaUrl = getZonosQaUrl();
|
|
445
447
|
// if zonosQaUrl is available, inject the script from the zonosQaUrl and then call init again
|
|
446
448
|
if (zonosQaUrl && !window.isZonosPreview) {
|
|
447
|
-
|
|
449
|
+
VarianceTest.log(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${zonosQaUrl} ======`, 'info');
|
|
448
450
|
// inject the script from zonosQaUrl
|
|
449
451
|
const script = document.createElement('script');
|
|
450
452
|
script.src = `${zonosQaUrl}/dist/scripts/zonos.js`;
|
|
@@ -453,6 +455,7 @@ Zonos.init = async (params) => {
|
|
|
453
455
|
window.Zonos.isNpm = _a.isNpm;
|
|
454
456
|
window.Zonos.isBigCommerce = _a.isBigCommerce;
|
|
455
457
|
window.Zonos.isLegacyCheckout = _a.isLegacyCheckout;
|
|
458
|
+
window.Zonos.zonosMode = _a.zonosMode;
|
|
456
459
|
// call init again after the script is loaded
|
|
457
460
|
void window.Zonos.init(params);
|
|
458
461
|
});
|
|
@@ -473,7 +476,7 @@ Zonos.init = async (params) => {
|
|
|
473
476
|
* If cartUUID is provided in query param and cartData is not available, get and initialize cart data to prepare to open checkout right away
|
|
474
477
|
*/
|
|
475
478
|
if (!_a.cartData && _a.cartId) {
|
|
476
|
-
|
|
479
|
+
VarianceTest.log('Initialize cart data');
|
|
477
480
|
const cartInfo = await setupCartDataWithSettings(_a.cartId);
|
|
478
481
|
if (!cartInfo) {
|
|
479
482
|
handleFetch.logError('Failed to get cart data');
|
|
@@ -494,13 +497,13 @@ Zonos.init = async (params) => {
|
|
|
494
497
|
const shouldAttemptImmediatelyOpenCheckout = (_a.cartId && _a.cartData) || !!clientSecretUrlParam;
|
|
495
498
|
// inject hidden button to body to trigger checkout right away if we have cartData or stripe client secret
|
|
496
499
|
if (shouldAttemptImmediatelyOpenCheckout) {
|
|
497
|
-
|
|
500
|
+
VarianceTest.log('Cart data or stripe client secret is available, inject hidden button and trigger checkout');
|
|
498
501
|
const hiddenButton = document.createElement('button');
|
|
499
502
|
hiddenButton.style.display = 'none';
|
|
500
503
|
hiddenButton.id = `${CheckoutConfig.checkoutHiddenBtnSelector}`;
|
|
501
504
|
document.body.appendChild(hiddenButton);
|
|
502
505
|
}
|
|
503
|
-
|
|
506
|
+
VarianceTest.log('init zonos');
|
|
504
507
|
_a.restoreNativeBrowserFunctions();
|
|
505
508
|
// inject custom script for hosted checkout if can find it in metadata
|
|
506
509
|
_a.injectCustomScriptForHostedCheckout();
|
|
@@ -544,7 +547,7 @@ Zonos.injectCustomScriptForHostedCheckout = () => {
|
|
|
544
547
|
const footerScript = metadata.find(meta => meta.key === 'customFooterScript');
|
|
545
548
|
// Only inject the script if checkout is on Zonos hosted checkout and custom script is available
|
|
546
549
|
if (!window.Zonos.isLegacyCheckout || (!headerScript && !footerScript)) {
|
|
547
|
-
|
|
550
|
+
VarianceTest.log('Skip injecting custom script for hosted checkout', 'info', {
|
|
548
551
|
footerScript,
|
|
549
552
|
headerScript,
|
|
550
553
|
isLegacyCheckout: window.Zonos.isLegacyCheckout,
|
|
@@ -552,13 +555,13 @@ Zonos.injectCustomScriptForHostedCheckout = () => {
|
|
|
552
555
|
return;
|
|
553
556
|
}
|
|
554
557
|
if (headerScript) {
|
|
555
|
-
|
|
558
|
+
VarianceTest.log('Injecting custom header script');
|
|
556
559
|
const script = document.createElement('script');
|
|
557
560
|
script.textContent = headerScript.value;
|
|
558
561
|
document.head.appendChild(script);
|
|
559
562
|
}
|
|
560
563
|
if (footerScript) {
|
|
561
|
-
|
|
564
|
+
VarianceTest.log('Injecting custom footer script');
|
|
562
565
|
const script = document.createElement('script');
|
|
563
566
|
script.textContent = footerScript.value;
|
|
564
567
|
document.body.appendChild(script);
|
|
@@ -732,7 +735,7 @@ Zonos.injectController = ({ config, }) => {
|
|
|
732
735
|
zonosController.zonosApiKey = _a.zonosApiKey || '';
|
|
733
736
|
zonosController.addEventListener('stripeInitEvent', async (event) => {
|
|
734
737
|
const { detail } = event;
|
|
735
|
-
|
|
738
|
+
VarianceTest.log('loading Stripe');
|
|
736
739
|
const stripe = await zonosLoadStripe(detail.publishableKey);
|
|
737
740
|
if (!stripe) {
|
|
738
741
|
handleFetch.logError('API seems to be invalid or missing. Failed to load Stripe');
|
|
@@ -749,7 +752,7 @@ Zonos.injectController = ({ config, }) => {
|
|
|
749
752
|
document.body.appendChild(zonosController);
|
|
750
753
|
// set zonos controller to be global
|
|
751
754
|
_a.zonosController = zonosController;
|
|
752
|
-
|
|
755
|
+
VarianceTest.log('Zonos controller injected!');
|
|
753
756
|
};
|
|
754
757
|
Zonos.injectScript = ({ cdnType, isModule, theRestUrl, }) => {
|
|
755
758
|
const scriptDomain = _a.getZonosUrl(cdnType);
|
|
@@ -759,7 +762,7 @@ Zonos.injectScript = ({ cdnType, isModule, theRestUrl, }) => {
|
|
|
759
762
|
return !!script;
|
|
760
763
|
};
|
|
761
764
|
if (findScript()) {
|
|
762
|
-
|
|
765
|
+
VarianceTest.log(`Zonos script "${fullScriptUrl}" already exists in the document`, 'warn');
|
|
763
766
|
return;
|
|
764
767
|
}
|
|
765
768
|
const headOrBody = document.head || document.body;
|
|
@@ -827,7 +830,7 @@ Zonos.injectZonosCdn = () => {
|
|
|
827
830
|
isModule: false,
|
|
828
831
|
theRestUrl: 'dist/zonos-elements/zonos-elements.js',
|
|
829
832
|
});
|
|
830
|
-
|
|
833
|
+
VarianceTest.log('Zonos cdn script injected!');
|
|
831
834
|
};
|
|
832
835
|
Zonos.injectStylesheet = ({ cdnType, theRestUrl, }) => {
|
|
833
836
|
const stylesheetDomain = _a.getZonosUrl(cdnType);
|
|
@@ -860,7 +863,7 @@ Zonos.injectZonosCss = () => {
|
|
|
860
863
|
return !!document.querySelector(`link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]`);
|
|
861
864
|
};
|
|
862
865
|
if (findStyleLink()) {
|
|
863
|
-
|
|
866
|
+
VarianceTest.log('Zonos style links already injected', 'warn');
|
|
864
867
|
return;
|
|
865
868
|
}
|
|
866
869
|
// inject css for zonos elements
|
|
@@ -868,13 +871,13 @@ Zonos.injectZonosCss = () => {
|
|
|
868
871
|
cdnType: MAIN_LOAD_CDN_TYPE,
|
|
869
872
|
theRestUrl: 'dist/zonos-elements/zonos-elements.css',
|
|
870
873
|
});
|
|
871
|
-
|
|
874
|
+
VarianceTest.log('Zonos style css injected!');
|
|
872
875
|
};
|
|
873
876
|
Zonos.injectFonts = () => {
|
|
874
877
|
const findFont = () => {
|
|
875
878
|
const fontAvailable = document.fonts.check('1em Inter');
|
|
876
879
|
if (fontAvailable) {
|
|
877
|
-
|
|
880
|
+
VarianceTest.log('Inter font already loaded', 'warn');
|
|
878
881
|
return;
|
|
879
882
|
}
|
|
880
883
|
const links = document.querySelectorAll(`link[rel="stylesheet"][href^="${GOOGLE_FONT_URL}"]`);
|
|
@@ -891,7 +894,7 @@ Zonos.injectFonts = () => {
|
|
|
891
894
|
return null;
|
|
892
895
|
};
|
|
893
896
|
if (findFont()) {
|
|
894
|
-
|
|
897
|
+
VarianceTest.log('Inter font already injected', 'warn');
|
|
895
898
|
return;
|
|
896
899
|
}
|
|
897
900
|
const headOrBody = document.head || document.body;
|
|
@@ -905,7 +908,7 @@ Zonos.injectFonts = () => {
|
|
|
905
908
|
font.rel = 'stylesheet';
|
|
906
909
|
font.href = `${GOOGLE_FONT_URL}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`;
|
|
907
910
|
headOrBody.appendChild(font);
|
|
908
|
-
|
|
911
|
+
VarianceTest.log('Zonos font injected!');
|
|
909
912
|
};
|
|
910
913
|
// apply font for zonos elements and inject font if needed
|
|
911
914
|
Zonos.setupGoogleFont = (fontFamily) => {
|
|
@@ -915,7 +918,7 @@ Zonos.setupGoogleFont = (fontFamily) => {
|
|
|
915
918
|
// this function is to inject google font to the browser, not apply the font for zonos elements, to apply the font and inject font if needed, use `setupGoogleFont` instead
|
|
916
919
|
Zonos.injectSupportGoogleFont = (fontUrl) => {
|
|
917
920
|
var _b;
|
|
918
|
-
|
|
921
|
+
VarianceTest.log(`[FONT] injecting ${fontUrl}`);
|
|
919
922
|
const fontFamily = (_b = fontUrl.match(/family=(.*?):/)) === null || _b === void 0 ? void 0 : _b[1];
|
|
920
923
|
const headOrBody = document.head || document.body;
|
|
921
924
|
// inject font css for zonos elements
|
|
@@ -926,14 +929,14 @@ Zonos.injectSupportGoogleFont = (fontUrl) => {
|
|
|
926
929
|
headOrBody.appendChild(customFontPreconnect);
|
|
927
930
|
}
|
|
928
931
|
if (document.querySelector(`link[rel="stylesheet"][href="${fontUrl}"]`)) {
|
|
929
|
-
|
|
932
|
+
VarianceTest.log(`[FONT] ${fontFamily} font already injected`, 'warn');
|
|
930
933
|
return;
|
|
931
934
|
}
|
|
932
935
|
const customFont = document.createElement('link');
|
|
933
936
|
customFont.rel = 'stylesheet';
|
|
934
937
|
customFont.href = fontUrl;
|
|
935
938
|
headOrBody.appendChild(customFont);
|
|
936
|
-
|
|
939
|
+
VarianceTest.log(`[FONT] ${fontFamily} font injected!`);
|
|
937
940
|
};
|
|
938
941
|
|
|
939
942
|
const checkoutSessionMutableAttributeKeys = [
|
|
@@ -951,10 +954,10 @@ const checkoutSessionAttributeKeys = [
|
|
|
951
954
|
...checkoutSessionImmutableAttributeKeys,
|
|
952
955
|
];
|
|
953
956
|
|
|
957
|
+
exports.availableTestKeys = VarianceTest.availableTestKeys;
|
|
954
958
|
exports.checkoutHiddenBtnSelector = CheckoutConfig.checkoutHiddenBtnSelector;
|
|
955
959
|
exports.checkoutHiddenInternationalBtnSelector = CheckoutConfig.checkoutHiddenInternationalBtnSelector;
|
|
956
960
|
exports.domesticRedirectedBtnSelector = CheckoutConfig.domesticRedirectedBtnSelector;
|
|
957
|
-
exports.availableTestKeys = VarianceTest.availableTestKeys;
|
|
958
961
|
exports.countryRequireTaxId = TaxId.countryRequireTaxId;
|
|
959
962
|
exports.euCountryCodes = TaxId.euCountryCodes;
|
|
960
963
|
exports.shipToTaxIdLabels = TaxId.shipToTaxIdLabels;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const zonosStore = require('./zonosStore-
|
|
4
|
-
const handleFetch = require('./handleFetch-
|
|
5
|
-
const VarianceTest = require('./VarianceTest-
|
|
6
|
-
const translationStore = require('./translationStore-
|
|
3
|
+
const zonosStore = require('./zonosStore-5d489c65.js');
|
|
4
|
+
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
5
|
+
const VarianceTest = require('./VarianceTest-bec00ea8.js');
|
|
6
|
+
const translationStore = require('./translationStore-ce2c700d.js');
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Check if the response contains at least one available test key that we support
|
|
@@ -11,7 +11,7 @@ const translationStore = require('./translationStore-951ed4b4.js');
|
|
|
11
11
|
const hasAtLeastOneAvailableTestKey = (rawResponse) => {
|
|
12
12
|
const hasAvailableTestKey = !!rawResponse.find(item => item.testKey in VarianceTest.availableTestKeys);
|
|
13
13
|
if (!hasAvailableTestKey) {
|
|
14
|
-
|
|
14
|
+
VarianceTest.log('No available test key found in response', 'info', {
|
|
15
15
|
response: rawResponse,
|
|
16
16
|
});
|
|
17
17
|
}
|
|
@@ -349,7 +349,7 @@ const getCurrencyElements = (selector) => {
|
|
|
349
349
|
}
|
|
350
350
|
const currencyElements = document.querySelectorAll(currencySelector);
|
|
351
351
|
if (!currencyElements.length) {
|
|
352
|
-
|
|
352
|
+
VarianceTest.log(`No currency elements found with selector "${currencySelector}"`, 'warn');
|
|
353
353
|
return null;
|
|
354
354
|
}
|
|
355
355
|
// return array of currency elements instead of a NodeList
|
|
@@ -374,6 +374,57 @@ const getInitialElementAmount = (element) => {
|
|
|
374
374
|
return parseFloat(domesticValue);
|
|
375
375
|
};
|
|
376
376
|
|
|
377
|
+
const BLUR_CURRENCY_DURATION = 7000;
|
|
378
|
+
const BLUR_CURRENCY_CLASSNAME = 'z--blur';
|
|
379
|
+
const removeBlurCurrency = async () => {
|
|
380
|
+
const intervalId = window.zonosBlurCurrencyOnInitIntervalId;
|
|
381
|
+
if (!intervalId) {
|
|
382
|
+
// Do nothing if the interval is not set
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
// Wait a bit to make sure price is fully rendered in DOM
|
|
386
|
+
await new Promise(resolve => setTimeout(resolve, 500));
|
|
387
|
+
clearInterval(intervalId);
|
|
388
|
+
const currencyElements = document.querySelectorAll(`.${BLUR_CURRENCY_CLASSNAME}`);
|
|
389
|
+
currencyElements.forEach(element => {
|
|
390
|
+
element.classList.remove(BLUR_CURRENCY_CLASSNAME);
|
|
391
|
+
});
|
|
392
|
+
window.zonosBlurCurrencyOnInitIntervalId = undefined;
|
|
393
|
+
};
|
|
394
|
+
const blurCurrencyElements = ({ currencySelector, }) => {
|
|
395
|
+
// Do nothing if the currency selector is not provided or blurCurrencyOnInit is false
|
|
396
|
+
if (!currencySelector) {
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
const currencyElements = document.querySelectorAll([currencySelector].filter(Boolean).join(','));
|
|
400
|
+
currencyElements.forEach(element => {
|
|
401
|
+
element.classList.add(BLUR_CURRENCY_CLASSNAME);
|
|
402
|
+
});
|
|
403
|
+
};
|
|
404
|
+
const performBlurCurrency = () => {
|
|
405
|
+
if (typeof window === 'undefined') {
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
// If the interval is already in progress, do nothing
|
|
409
|
+
if (window.zonosBlurCurrencyOnInitIntervalId) {
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
blurCurrencyElements({
|
|
413
|
+
currencySelector: window.zonosBlurCurrencyOnInitCurrencySelector,
|
|
414
|
+
});
|
|
415
|
+
// Add blur effect to the currency elements
|
|
416
|
+
const intervalId = setInterval(() => {
|
|
417
|
+
blurCurrencyElements({
|
|
418
|
+
currencySelector: window.zonosBlurCurrencyOnInitCurrencySelector,
|
|
419
|
+
});
|
|
420
|
+
}, 10);
|
|
421
|
+
window.zonosBlurCurrencyOnInitIntervalId = intervalId;
|
|
422
|
+
// The blur will be removed as soon as we got the exchange rate back. But if the exchange rate is not available for some reason, the blur effect will be automatically removed after 10 seconds
|
|
423
|
+
setTimeout(() => {
|
|
424
|
+
void removeBlurCurrency();
|
|
425
|
+
}, BLUR_CURRENCY_DURATION);
|
|
426
|
+
};
|
|
427
|
+
|
|
377
428
|
const convertCurrency = (element) => {
|
|
378
429
|
var _a;
|
|
379
430
|
const amount = getInitialElementAmount(element);
|
|
@@ -397,6 +448,8 @@ const convertCurrency = (element) => {
|
|
|
397
448
|
rate !== currentIntlRateValue ||
|
|
398
449
|
// Update currency when the country code changes
|
|
399
450
|
currentCountryValue !== localizationStore.selectedCountryCode)) {
|
|
451
|
+
// Hide the currency until DOM is ready to display the new value
|
|
452
|
+
performBlurCurrency();
|
|
400
453
|
const customizedCurrencyFormat = typeof zonosStore.zonosStore.currencyConverter === 'function' &&
|
|
401
454
|
zonosStore.zonosStore.currencyConverter({
|
|
402
455
|
convert: currencyConvert,
|
|
@@ -418,6 +471,8 @@ const convertCurrency = (element) => {
|
|
|
418
471
|
element.setAttribute('data-zintl', observedFormattedValue);
|
|
419
472
|
element.setAttribute('data-zcountry-code', localizationStore.selectedCountryCode || '');
|
|
420
473
|
}
|
|
474
|
+
// Remove blur effect after the currency is converted
|
|
475
|
+
void removeBlurCurrency();
|
|
421
476
|
};
|
|
422
477
|
const defaultCurrencyConverter = () => {
|
|
423
478
|
const { currencyElementSelector } = zonosStore.zonosStore.helloSettings;
|
|
@@ -439,6 +494,7 @@ const defaultCurrencyConverter = () => {
|
|
|
439
494
|
const currencyDisplay = () => {
|
|
440
495
|
if (zonosStore.zonosStore.helloSettings.currencyBehavior === 'DISABLED' ||
|
|
441
496
|
window.Zonos.isLegacyCheckout) {
|
|
497
|
+
void removeBlurCurrency();
|
|
442
498
|
return;
|
|
443
499
|
}
|
|
444
500
|
defaultCurrencyConverter();
|
|
@@ -528,32 +584,34 @@ const startExchangeRateTimeout = ({ isGuaranteed, maxAge, }) => {
|
|
|
528
584
|
};
|
|
529
585
|
const getNewLocalization = async () => {
|
|
530
586
|
var _a;
|
|
531
|
-
|
|
587
|
+
VarianceTest.log('get new localization store');
|
|
532
588
|
const { isDisabledCountry, isShippableCountry, selectedCountryCode } = localizationStore;
|
|
589
|
+
if (zonosStore.zonosStore.helloSettings.currencyBehavior === 'DISABLED' ||
|
|
590
|
+
!isShippableCountry ||
|
|
591
|
+
isDisabledCountry ||
|
|
592
|
+
!selectedCountryCode) {
|
|
593
|
+
return;
|
|
594
|
+
}
|
|
595
|
+
const isGuaranteed = zonosStore.zonosStore.checkoutSettings.visibilityStatus === 'ENABLED';
|
|
596
|
+
// blur currency out before getting exchange rate
|
|
597
|
+
performBlurCurrency();
|
|
598
|
+
const { maxAge } = await triggerGetExchangeRate(isGuaranteed);
|
|
599
|
+
startExchangeRateTimeout({ isGuaranteed, maxAge });
|
|
533
600
|
if (!window.Zonos.isLegacyCheckout) {
|
|
534
601
|
// These requests are only needed for Hello, so we can skip them for legacy checkout
|
|
535
602
|
localizationStore.countryLandedCost = await getCountryLandedCost(localizationStore.selectedCountryCode);
|
|
536
603
|
localizationStore.inclusivePricing =
|
|
537
604
|
((_a = (await getInclusivePricing(selectedCountryCode))) === null || _a === void 0 ? void 0 : _a.setting) || null;
|
|
538
605
|
if (localizationStore.inclusivePricing) {
|
|
539
|
-
|
|
606
|
+
VarianceTest.log(`Inclusive price setting found for this country (${selectedCountryCode}) ${JSON.stringify(localizationStore.inclusivePricing, null, 2)}`);
|
|
540
607
|
}
|
|
541
608
|
}
|
|
542
609
|
else {
|
|
543
|
-
|
|
610
|
+
VarianceTest.log('Skipping country landed cost and inclusive pricing requests, because this is a legacy checkout');
|
|
544
611
|
}
|
|
545
|
-
if (zonosStore.zonosStore.helloSettings.currencyBehavior === 'DISABLED' ||
|
|
546
|
-
!isShippableCountry ||
|
|
547
|
-
isDisabledCountry ||
|
|
548
|
-
!selectedCountryCode) {
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
const isGuaranteed = zonosStore.zonosStore.checkoutSettings.visibilityStatus === 'ENABLED';
|
|
552
|
-
const { maxAge } = await triggerGetExchangeRate(isGuaranteed);
|
|
553
|
-
startExchangeRateTimeout({ isGuaranteed, maxAge });
|
|
554
612
|
};
|
|
555
613
|
const getCustomMessages = async () => {
|
|
556
|
-
|
|
614
|
+
VarianceTest.log(`Getting custom messages for ${localizationStore.selectedCountryCode}`);
|
|
557
615
|
if (!localizationStore.selectedCountryCode || !zonosStore.zonosStore.storeId) {
|
|
558
616
|
return;
|
|
559
617
|
}
|
|
@@ -593,7 +651,7 @@ const getValidCountryCode = (countryCode) => {
|
|
|
593
651
|
};
|
|
594
652
|
const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
|
|
595
653
|
var _a, _b;
|
|
596
|
-
|
|
654
|
+
VarianceTest.log(`Updating selected country code to ${newSelectedCountryCode}`);
|
|
597
655
|
const isFirstTime = !localizationStore.selectedCountryCode;
|
|
598
656
|
localizationStore.selectedCountryCode = getValidCountryCode(newSelectedCountryCode);
|
|
599
657
|
const { selectedCountryCode, shippingZoneCountries } = localizationStore;
|
|
@@ -604,11 +662,11 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
|
|
|
604
662
|
!zonosStore.zonosStore.disabledCountries.includes(selectedCountryCode);
|
|
605
663
|
// update shippable country
|
|
606
664
|
localizationStore.isShippableCountry = isShippableCountry;
|
|
607
|
-
|
|
665
|
+
VarianceTest.log(`${localizationStore.selectedCountryCode} is a shippable country: ${localizationStore.isShippableCountry}`);
|
|
608
666
|
const isDisabledCountry = !!selectedCountryCode &&
|
|
609
667
|
zonosStore.zonosStore.disabledCountries.includes(selectedCountryCode);
|
|
610
668
|
localizationStore.isDisabledCountry = isDisabledCountry;
|
|
611
|
-
|
|
669
|
+
VarianceTest.log(`${localizationStore.selectedCountryCode} is a disabled country: ${localizationStore.isDisabledCountry}`);
|
|
612
670
|
addInternationalHideClass();
|
|
613
671
|
if (!selectedCountryCode) {
|
|
614
672
|
return;
|
|
@@ -696,8 +754,8 @@ const initLocalizationStore = async () => {
|
|
|
696
754
|
// Initialize the country list for the hello widget
|
|
697
755
|
initHelloCountryList(allCountries || {});
|
|
698
756
|
const { country, locale } = localization;
|
|
699
|
-
|
|
700
|
-
|
|
757
|
+
VarianceTest.log(`Country code from localization: ${country}`);
|
|
758
|
+
VarianceTest.log(`Locale from localization: ${locale}`);
|
|
701
759
|
// update selected country code in store
|
|
702
760
|
localizationStoreUpdateSelectedCountryCode(country);
|
|
703
761
|
// use locale from params if it exists, otherwise use locale from localization
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const zonosStore = require('./zonosStore-
|
|
4
|
-
const cart = require('./cart-
|
|
5
|
-
const localization = require('./localization-
|
|
6
|
-
const translationStore = require('./translationStore-
|
|
7
|
-
const handleFetch = require('./handleFetch-
|
|
8
|
-
const isDarkColor = require('./isDarkColor-
|
|
3
|
+
const zonosStore = require('./zonosStore-5d489c65.js');
|
|
4
|
+
const cart = require('./cart-af017ac3.js');
|
|
5
|
+
const localization = require('./localization-21030292.js');
|
|
6
|
+
const translationStore = require('./translationStore-ce2c700d.js');
|
|
7
|
+
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
8
|
+
const isDarkColor = require('./isDarkColor-994c38e4.js');
|
|
9
|
+
const VarianceTest = require('./VarianceTest-bec00ea8.js');
|
|
9
10
|
|
|
10
11
|
/*!
|
|
11
12
|
* paypal-js v8.1.0 (2024-06-07T16:55:00.122Z)
|
|
@@ -243,7 +244,7 @@ const submitGtag = (event) => {
|
|
|
243
244
|
return;
|
|
244
245
|
}
|
|
245
246
|
if (typeof window.gtag === 'function') {
|
|
246
|
-
|
|
247
|
+
VarianceTest.log('Zonos submits gtag event', 'log', event);
|
|
247
248
|
window.gtag('event', event, {});
|
|
248
249
|
}
|
|
249
250
|
};
|
|
@@ -414,12 +415,12 @@ const paypalInitScript = async ({ currency }) => {
|
|
|
414
415
|
//
|
|
415
416
|
const isPaypalEnabled = !!((_a = zonosStore.zonosStore.checkoutSettings.externalPaymentMethods) === null || _a === void 0 ? void 0 : _a.find(item => item.type === 'PAYPAL' && item.status === 'ENABLED'));
|
|
416
417
|
if (!isPaypalEnabled) {
|
|
417
|
-
|
|
418
|
+
VarianceTest.log('=== Paypal is disabled for this store', 'warn');
|
|
418
419
|
return;
|
|
419
420
|
}
|
|
420
421
|
const paypalClientId = zonosStore.zonosStore.checkoutSettings.externalServiceTokens.find(item => item.type === 'PAYPAL_CLIENT_ID');
|
|
421
422
|
if (!paypalClientId) {
|
|
422
|
-
|
|
423
|
+
VarianceTest.log('Failed to load paypal -- missing paypal publishable key', 'warn');
|
|
423
424
|
return;
|
|
424
425
|
}
|
|
425
426
|
/**
|
|
@@ -432,7 +433,7 @@ const paypalInitScript = async ({ currency }) => {
|
|
|
432
433
|
const hasAuthorizeSettingSet = zonosStore.zonosStore.checkoutSettings.captureDelay &&
|
|
433
434
|
zonosStore.zonosStore.checkoutSettings.captureDelay > 0;
|
|
434
435
|
paypalStore.intent = hasAuthorizeSettingSet ? 'authorize' : 'capture';
|
|
435
|
-
|
|
436
|
+
VarianceTest.log('==== Paypal order intent', 'info', paypalStore.intent);
|
|
436
437
|
// send paypal publishable key out to load paypal
|
|
437
438
|
window.Zonos.paypal = await loadScript({
|
|
438
439
|
clientId: paypalClientId.token,
|
|
@@ -441,21 +442,21 @@ const paypalInitScript = async ({ currency }) => {
|
|
|
441
442
|
intent: paypalStore.intent,
|
|
442
443
|
});
|
|
443
444
|
paypalStore.paypal = window.Zonos.paypal;
|
|
444
|
-
|
|
445
|
+
VarianceTest.log('==== Paypal script loaded');
|
|
445
446
|
};
|
|
446
447
|
const paypalStoreInitButtons = (props) => {
|
|
447
448
|
var _a;
|
|
448
449
|
const paypal = window.Zonos.paypal;
|
|
449
450
|
if (!paypal) {
|
|
450
|
-
|
|
451
|
+
VarianceTest.log('Paypal is not available');
|
|
451
452
|
return null;
|
|
452
453
|
}
|
|
453
454
|
const checkoutSessionId = localization.storageStore.checkoutSessionId;
|
|
454
455
|
if (!checkoutSessionId) {
|
|
455
|
-
|
|
456
|
+
VarianceTest.log('Paypal is not available due to checkoutSessionId is not available');
|
|
456
457
|
return null;
|
|
457
458
|
}
|
|
458
|
-
|
|
459
|
+
VarianceTest.log('==== Loading Paypal buttons');
|
|
459
460
|
paypalStoreResetButtons();
|
|
460
461
|
const fundingSources = [(_a = paypal.FUNDING) === null || _a === void 0 ? void 0 : _a.PAYPAL].filter(Boolean);
|
|
461
462
|
paypalStore.paypalButtons = fundingSources
|
|
@@ -468,10 +469,10 @@ const paypalStoreInitButtons = (props) => {
|
|
|
468
469
|
fundingSource }, props))), { fundingSource }))) || null;
|
|
469
470
|
}
|
|
470
471
|
catch (err) {
|
|
471
|
-
|
|
472
|
+
VarianceTest.log(`===== Failed to load paypal's "${fundingSource}" button`, 'warn', err);
|
|
472
473
|
}
|
|
473
474
|
if (button === null || button === void 0 ? void 0 : button.isEligible()) {
|
|
474
|
-
|
|
475
|
+
VarianceTest.log(`==== Paypal button ${fundingSource} loaded`);
|
|
475
476
|
return button;
|
|
476
477
|
}
|
|
477
478
|
return null;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const cart = require('./cart-
|
|
4
|
-
const localization = require('./localization-
|
|
5
|
-
const handleFetch = require('./handleFetch-
|
|
3
|
+
const cart = require('./cart-af017ac3.js');
|
|
4
|
+
const localization = require('./localization-21030292.js');
|
|
5
|
+
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
6
6
|
|
|
7
7
|
const getDisplayCurrency = () => {
|
|
8
8
|
var _a, _b;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const zonosStore = require('./zonosStore-
|
|
4
|
-
const cart = require('./cart-
|
|
5
|
-
const localization = require('./localization-
|
|
6
|
-
const handleFetch = require('./handleFetch-
|
|
3
|
+
const zonosStore = require('./zonosStore-5d489c65.js');
|
|
4
|
+
const cart = require('./cart-af017ac3.js');
|
|
5
|
+
const localization = require('./localization-21030292.js');
|
|
6
|
+
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
7
|
+
const VarianceTest = require('./VarianceTest-bec00ea8.js');
|
|
7
8
|
const index = require('./index-1c710d00.js');
|
|
8
9
|
|
|
9
10
|
const { reset: collectStoreReset, state: collectStore } = zonosStore.createStore(() => ({
|
|
@@ -76,7 +77,7 @@ const collectStoreAsyncAddressUpdate = async () => {
|
|
|
76
77
|
endpoint: 'PF_NO_SELECTED_LANDED_COST',
|
|
77
78
|
errors: ['No selected landed cost'],
|
|
78
79
|
metadata: {
|
|
79
|
-
allLogs:
|
|
80
|
+
allLogs: VarianceTest.allLogs,
|
|
80
81
|
cartId: window.Zonos.cartId,
|
|
81
82
|
checkoutSessionId: localization.storageStore.checkoutSessionId,
|
|
82
83
|
},
|
|
@@ -90,7 +91,7 @@ const collectStoreAsyncAddressUpdate = async () => {
|
|
|
90
91
|
endpoint: 'COLLECT_NO_CHECKOUT_SESSION_ID',
|
|
91
92
|
errors: ['No checkout session id'],
|
|
92
93
|
metadata: {
|
|
93
|
-
allLogs:
|
|
94
|
+
allLogs: VarianceTest.allLogs,
|
|
94
95
|
cartId: window.Zonos.cartId,
|
|
95
96
|
landedCostRootId,
|
|
96
97
|
},
|
|
@@ -124,7 +125,7 @@ const collectStoreAsyncAddressUpdate = async () => {
|
|
|
124
125
|
endpoint: 'COLLECT_BILLING_PARTY_CREATE_FAILED',
|
|
125
126
|
errors: ['[COLLECT] Failed to create billing party'],
|
|
126
127
|
metadata: {
|
|
127
|
-
allLogs:
|
|
128
|
+
allLogs: VarianceTest.allLogs,
|
|
128
129
|
cartId: window.Zonos.cartId,
|
|
129
130
|
checkoutSessionId: localization.storageStore.checkoutSessionId,
|
|
130
131
|
errors,
|