@zonos/elements 1.3.200 → 1.3.202
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-0cb1e118.js +12 -0
- package/dist/cjs/cart-637ba3d0.js +1943 -0
- package/dist/cjs/{debounce-d393fafe.js → debounce-94e1b7ff.js} +1 -1
- package/dist/cjs/{getBorderRadius-3d0a563e.js → getBorderRadius-8d3b1049.js} +1 -1
- package/dist/cjs/index.cjs.js +10 -8
- package/dist/cjs/{isDarkColor-92a10a85.js → isDarkColor-bcf49625.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{cart-add8fe50.js → localization-2f17c95f.js} +74 -1926
- package/dist/cjs/{paypal-afc19dec.js → paypal-0eceff03.js} +10 -9
- package/dist/cjs/zonos-address_11.cjs.entry.js +98 -72
- package/dist/cjs/zonos-badge.cjs.entry.js +2 -1
- package/dist/cjs/zonos-banner.cjs.entry.js +2 -1
- package/dist/cjs/zonos-button_3.cjs.entry.js +4 -3
- package/dist/cjs/zonos-card.cjs.entry.js +3 -2
- package/dist/cjs/{zonos-cart-items_13.cjs.entry.js → zonos-cart-items_14.cjs.entry.js} +99 -80
- package/dist/cjs/zonos-checkout.cjs.entry.js +395 -50
- package/dist/cjs/zonos-collapse.cjs.entry.js +2 -1
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +13 -11
- package/dist/cjs/zonos-country-flag.cjs.entry.js +4 -5
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +13 -13
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +10 -8
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +41 -42
- package/dist/cjs/zonos-hello.cjs.entry.js +30 -31
- package/dist/cjs/zonos-input.cjs.entry.js +3 -2
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +8 -9
- package/dist/cjs/zonos-logo.cjs.entry.js +4 -3
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -2
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +8 -7
- package/dist/cjs/zonos-text.cjs.entry.js +2 -1
- package/dist/cjs/zonos-toggle.cjs.entry.js +4 -3
- package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/zonos-v-stack.cjs.entry.js +4 -3
- package/dist/cjs/{zonosStore-c466b127.js → zonosStore-9264749e.js} +15 -5
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +18 -17
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +235 -15
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +3 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +2 -1
- package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.css +62 -0
- package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +90 -0
- package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
- package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
- package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
- package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +4 -4
- package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +5 -5
- package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +5 -5
- package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
- package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
- package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
- package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
- package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
- package/dist/collection/components/main/zonos-controller.js +3 -3
- package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
- package/dist/collection/components/store/checkout/cart.js +15 -16
- package/dist/collection/components/store/checkout/paypal.js +2 -1
- package/dist/collection/components/store/checkout/stripe.js +33 -13
- package/dist/collection/components/store/hello/localization.js +5 -5
- package/dist/collection/components/store/storageStore.js +32 -0
- package/dist/collection/components/store/zonosStore.js +12 -6
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +18 -6
- package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -2
- package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +19 -7
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +3 -3
- package/dist/collection/components/utils/api/getCheckoutSession.js +3 -3
- package/dist/collection/components/utils/api/placeTestOrder.js +2 -1
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +3 -2
- package/dist/collection/components/utils/api/selectVarianceTest.js +20 -0
- package/dist/collection/components/utils/buildCartUrl.js +44 -0
- package/dist/collection/components/utils/getLegacyQueryParams.js +42 -0
- package/dist/collection/components/utils/varianceTest/filterExpiredTests.js +6 -0
- package/dist/collection/components/utils/varianceTest/filterValidTests.js +23 -0
- package/dist/collection/components/utils/varianceTest/getSelectedTestVariant.js +6 -0
- package/dist/collection/components/utils/varianceTest/hasAtLeastOneAvailableTestKey.js +14 -0
- package/dist/collection/components/utils/varianceTest/isInAvailableTestKey.js +4 -0
- package/dist/collection/components/utils/varianceTest/isTestEnabled.js +4 -0
- package/dist/collection/components/utils/varianceTest/isTestKeysAllVariantSelected.js +6 -0
- package/dist/collection/components/utils/varianceTest/mergeTest.js +13 -0
- package/dist/collection/scripts/_getZonosQaUrl.js +2 -2
- package/dist/collection/types/checkout/api/VarianceTest.js +8 -0
- package/dist/collection/types/generated/graphql.internal.types.js +12 -0
- package/dist/collection/types/index.js +1 -0
- package/dist/esm/VarianceTest-fef2d958.js +10 -0
- package/dist/esm/cart-b7c15b61.js +1907 -0
- package/dist/esm/{debounce-a2121722.js → debounce-3a9f27a0.js} +1 -1
- package/dist/esm/{getBorderRadius-413e97eb.js → getBorderRadius-78b28b4d.js} +1 -1
- package/dist/esm/index.js +9 -8
- package/dist/esm/{isDarkColor-4c7b2ffc.js → isDarkColor-31dd7dff.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{cart-e03d615e.js → localization-bf7224aa.js} +70 -1892
- package/dist/esm/{paypal-23dd5023.js → paypal-932fd3dd.js} +5 -4
- package/dist/esm/zonos-address_11.entry.js +54 -28
- package/dist/esm/zonos-badge.entry.js +2 -1
- package/dist/esm/zonos-banner.entry.js +2 -1
- package/dist/esm/zonos-button_3.entry.js +4 -3
- package/dist/esm/zonos-card.entry.js +3 -2
- package/dist/esm/{zonos-cart-items_13.entry.js → zonos-cart-items_14.entry.js} +48 -30
- package/dist/esm/zonos-checkout.entry.js +363 -18
- package/dist/esm/zonos-collapse.entry.js +2 -1
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +8 -6
- package/dist/esm/zonos-country-flag.entry.js +3 -4
- package/dist/esm/zonos-country-select_4.entry.js +8 -8
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-empty-state-payment_4.entry.js +10 -8
- package/dist/esm/zonos-hello-dialog.entry.js +7 -8
- package/dist/esm/zonos-hello.entry.js +4 -5
- package/dist/esm/zonos-input.entry.js +3 -2
- package/dist/esm/zonos-language-select_2.entry.js +5 -6
- package/dist/esm/zonos-logo.entry.js +4 -3
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -2
- package/dist/esm/zonos-stripe-input.entry.js +8 -7
- package/dist/esm/zonos-text.entry.js +2 -1
- package/dist/esm/zonos-toggle.entry.js +4 -3
- package/dist/esm/zonos-tooltip.entry.js +2 -2
- package/dist/esm/zonos-v-stack.entry.js +4 -3
- package/dist/esm/{zonosStore-cdabc848.js → zonosStore-d10a829f.js} +15 -5
- package/dist/esm-es5/VarianceTest-fef2d958.js +1 -0
- package/dist/esm-es5/cart-b7c15b61.js +1 -0
- package/dist/esm-es5/{debounce-a2121722.js → debounce-3a9f27a0.js} +1 -1
- package/dist/esm-es5/{getBorderRadius-413e97eb.js → getBorderRadius-78b28b4d.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-4c7b2ffc.js → isDarkColor-31dd7dff.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/localization-bf7224aa.js +1 -0
- package/dist/esm-es5/{paypal-23dd5023.js → paypal-932fd3dd.js} +2 -2
- 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.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_14.entry.js +1 -0
- 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-component.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-elements.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-tooltip.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/esm-es5/zonosStore-d10a829f.js +1 -0
- package/dist/scripts/index.d.ts +839 -765
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +16 -0
- package/dist/types/components/common/zonos-loading-overlay/zonos-loading-overlay.d.ts +16 -0
- package/dist/types/components/store/checkout/cart.d.ts +0 -1
- package/dist/types/components/store/checkout/stripe.d.ts +2 -2
- package/dist/types/components/store/hello/localization.d.ts +2 -2
- package/dist/types/components/store/storageStore.d.ts +13 -0
- package/dist/types/components/store/zonosStore.d.ts +7 -2
- package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +2 -0
- package/dist/types/components/stripe/zonos-custom-address/zonos-custom-address.d.ts +2 -0
- package/dist/types/components/utils/api/selectVarianceTest.d.ts +6 -0
- package/dist/types/components/utils/buildCartUrl.d.ts +10 -0
- package/dist/types/components/utils/getLegacyQueryParams.d.ts +2 -0
- package/dist/types/components/utils/varianceTest/filterExpiredTests.d.ts +2 -0
- package/dist/types/components/utils/varianceTest/filterValidTests.d.ts +9 -0
- package/dist/types/components/utils/varianceTest/getSelectedTestVariant.d.ts +2 -0
- package/dist/types/components/utils/varianceTest/hasAtLeastOneAvailableTestKey.d.ts +8 -0
- package/dist/types/components/utils/varianceTest/isInAvailableTestKey.d.ts +2 -0
- package/dist/types/components/utils/varianceTest/isTestEnabled.d.ts +2 -0
- package/dist/types/components/utils/varianceTest/isTestKeysAllVariantSelected.d.ts +9 -0
- package/dist/types/components/utils/varianceTest/mergeTest.d.ts +5 -0
- package/dist/types/components.d.ts +51 -0
- package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +7 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +13 -1
- package/dist/types/types/checkout/api/CheckoutSession.d.ts +7 -0
- package/dist/types/types/checkout/api/VarianceTest.d.ts +30 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +163 -0
- package/dist/types/types/generated/graphql.internal.types.ts +199 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/utils/ZonosSettings.d.ts +7 -6
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-609c32a3.system.entry.js → p-01987cb2.system.entry.js} +1 -1
- package/dist/zonos-elements/p-04a01cb1.js +1 -0
- package/dist/zonos-elements/p-04b43dd5.entry.js +1 -0
- package/dist/zonos-elements/p-0f77d087.system.entry.js +1 -0
- package/dist/zonos-elements/{p-329efa8c.system.entry.js → p-1dcdb65f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-26a634a5.system.entry.js +1 -0
- package/dist/zonos-elements/p-27987298.system.entry.js +1 -0
- package/dist/zonos-elements/p-2af2eb6f.system.entry.js +1 -0
- package/dist/zonos-elements/p-2b8f787a.entry.js +1 -0
- package/dist/zonos-elements/p-30cfa524.entry.js +1 -0
- package/dist/zonos-elements/p-32320d9a.system.js +1 -0
- package/dist/zonos-elements/p-3284f459.system.entry.js +1 -0
- package/dist/zonos-elements/{p-13796f98.js → p-3d82a352.js} +1 -1
- package/dist/zonos-elements/p-452070af.system.entry.js +1 -0
- package/dist/zonos-elements/p-45ebc788.entry.js +1 -0
- package/dist/zonos-elements/p-4c81112f.entry.js +1 -0
- package/dist/zonos-elements/p-4efa8187.js +1 -0
- package/dist/zonos-elements/p-5170bc41.entry.js +1 -0
- package/dist/zonos-elements/p-5a2dd041.system.js +1 -0
- package/dist/zonos-elements/p-5c74e5c9.system.entry.js +1 -0
- package/dist/zonos-elements/p-5d0f7364.system.js +1 -0
- package/dist/zonos-elements/p-6a52a2bc.system.entry.js +1 -0
- package/dist/zonos-elements/p-715d0f59.system.entry.js +1 -0
- package/dist/zonos-elements/{p-b8d87932.js → p-72f37935.js} +1 -1
- package/dist/zonos-elements/p-7ae5cd60.entry.js +1 -0
- package/dist/zonos-elements/p-80bbd9c0.system.entry.js +1 -0
- package/dist/zonos-elements/p-851c642e.system.entry.js +1 -0
- package/dist/zonos-elements/{p-623a30aa.entry.js → p-8d870d4c.entry.js} +1 -1
- package/dist/zonos-elements/p-98b65387.entry.js +1 -0
- package/dist/zonos-elements/p-9af5e93a.entry.js +1 -0
- package/dist/zonos-elements/p-aa1193bc.entry.js +1 -0
- package/dist/zonos-elements/{p-8fc08673.js → p-aae60057.js} +2 -2
- package/dist/zonos-elements/p-ab176281.system.entry.js +1 -0
- package/dist/zonos-elements/p-b52aba52.entry.js +1 -0
- package/dist/zonos-elements/p-bc220d35.system.js +1 -0
- package/dist/zonos-elements/p-bc8bda92.entry.js +1 -0
- package/dist/zonos-elements/p-be5afc91.system.entry.js +1 -0
- package/dist/zonos-elements/p-bec2a3ce.entry.js +1 -0
- package/dist/zonos-elements/p-c291bac1.entry.js +1 -0
- package/dist/zonos-elements/p-c3d2422e.entry.js +1 -0
- package/dist/zonos-elements/{p-f28eb1dd.system.js → p-c50b3100.system.js} +1 -1
- package/dist/zonos-elements/p-c58acd4c.system.entry.js +1 -0
- package/dist/zonos-elements/p-c5fcbc92.system.entry.js +1 -0
- package/dist/zonos-elements/p-c767242b.entry.js +1 -0
- package/dist/zonos-elements/p-c9aa902e.system.entry.js +1 -0
- package/dist/zonos-elements/p-cb823c4d.system.js +1 -0
- package/dist/zonos-elements/{p-24554580.system.js → p-d2466fbd.system.js} +2 -2
- package/dist/zonos-elements/{p-d422ad1d.system.js → p-d42dfd32.system.js} +1 -1
- package/dist/zonos-elements/p-d46349d3.system.entry.js +1 -0
- package/dist/zonos-elements/p-d60ca44b.system.entry.js +1 -0
- package/dist/zonos-elements/{p-b2241919.entry.js → p-d6a10007.entry.js} +1 -1
- package/dist/zonos-elements/p-db025dfc.system.entry.js +1 -0
- package/dist/zonos-elements/p-db3968a2.js +1 -0
- package/dist/zonos-elements/p-dcd6acd4.system.entry.js +1 -0
- package/dist/zonos-elements/p-dd1cfa74.entry.js +1 -0
- package/dist/zonos-elements/p-df4c46a6.entry.js +1 -0
- package/dist/zonos-elements/{p-4593324c.js → p-e26c9e83.js} +1 -1
- package/dist/zonos-elements/p-e68d5219.entry.js +1 -0
- package/dist/zonos-elements/p-ea6d87a1.system.js +1 -1
- package/dist/zonos-elements/p-ef3e05e5.system.js +1 -0
- package/dist/zonos-elements/p-f255e822.js +1 -0
- package/dist/zonos-elements/p-f655ec36.entry.js +1 -0
- package/dist/zonos-elements/{p-e91b244c.entry.js → p-f891d470.entry.js} +1 -1
- package/dist/zonos-elements/p-f8d0d488.system.entry.js +1 -0
- package/dist/zonos-elements/{p-240ee490.system.entry.js → p-fbe36bc8.system.entry.js} +1 -1
- package/dist/zonos-elements/p-fcc2e712.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-e03d615e.js +0 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +0 -1
- package/dist/esm-es5/zonosStore-cdabc848.js +0 -1
- package/dist/zonos-elements/p-06ed3582.system.js +0 -1
- package/dist/zonos-elements/p-0a2101d4.system.js +0 -1
- package/dist/zonos-elements/p-0aa20875.system.entry.js +0 -1
- package/dist/zonos-elements/p-0bfd23da.entry.js +0 -1
- package/dist/zonos-elements/p-0f3568a7.entry.js +0 -1
- package/dist/zonos-elements/p-147ca395.entry.js +0 -1
- package/dist/zonos-elements/p-190398dd.entry.js +0 -1
- package/dist/zonos-elements/p-1eddec23.entry.js +0 -1
- package/dist/zonos-elements/p-1f2c3f5c.system.entry.js +0 -1
- package/dist/zonos-elements/p-24a2e899.system.entry.js +0 -1
- package/dist/zonos-elements/p-2882b9f4.entry.js +0 -1
- package/dist/zonos-elements/p-28ba5a6b.system.entry.js +0 -1
- package/dist/zonos-elements/p-33488109.system.entry.js +0 -1
- package/dist/zonos-elements/p-337fab4e.js +0 -1
- package/dist/zonos-elements/p-35573f66.entry.js +0 -1
- package/dist/zonos-elements/p-394d468f.system.js +0 -1
- package/dist/zonos-elements/p-3ddecaa4.system.entry.js +0 -1
- package/dist/zonos-elements/p-48f70043.system.entry.js +0 -1
- package/dist/zonos-elements/p-55711b80.system.entry.js +0 -1
- package/dist/zonos-elements/p-578bf5d7.entry.js +0 -1
- package/dist/zonos-elements/p-5b8e5d1a.entry.js +0 -1
- package/dist/zonos-elements/p-5c061a35.entry.js +0 -1
- package/dist/zonos-elements/p-6096c1c5.entry.js +0 -1
- package/dist/zonos-elements/p-6adc6e27.entry.js +0 -1
- package/dist/zonos-elements/p-7bb9c330.entry.js +0 -1
- package/dist/zonos-elements/p-7c6b8d3f.entry.js +0 -1
- package/dist/zonos-elements/p-85270076.system.entry.js +0 -1
- package/dist/zonos-elements/p-8a9d4605.system.entry.js +0 -1
- package/dist/zonos-elements/p-94e3e50d.system.entry.js +0 -1
- package/dist/zonos-elements/p-9f272e8e.system.entry.js +0 -1
- package/dist/zonos-elements/p-9f6dd86a.entry.js +0 -1
- package/dist/zonos-elements/p-a64ab131.system.entry.js +0 -1
- package/dist/zonos-elements/p-aac95779.system.entry.js +0 -1
- package/dist/zonos-elements/p-ad3c5358.entry.js +0 -1
- package/dist/zonos-elements/p-ad8a0584.entry.js +0 -1
- package/dist/zonos-elements/p-aeaba33e.system.entry.js +0 -1
- package/dist/zonos-elements/p-af6af82e.system.js +0 -1
- package/dist/zonos-elements/p-b2e76636.system.entry.js +0 -1
- package/dist/zonos-elements/p-b6afcf3f.system.entry.js +0 -1
- package/dist/zonos-elements/p-b8d91f99.entry.js +0 -1
- package/dist/zonos-elements/p-be8fa9a5.system.entry.js +0 -1
- package/dist/zonos-elements/p-c770044a.system.entry.js +0 -1
- package/dist/zonos-elements/p-d4842d10.system.entry.js +0 -1
- package/dist/zonos-elements/p-e390725f.js +0 -1
- package/dist/zonos-elements/p-eb85f0b6.system.entry.js +0 -1
- package/dist/zonos-elements/p-ef3d0394.entry.js +0 -1
- package/dist/zonos-elements/p-f6e587bb.entry.js +0 -1
- package/dist/zonos-elements/p-ff23980c.entry.js +0 -1
|
@@ -14,11 +14,11 @@ export class ZonosRestState {
|
|
|
14
14
|
}
|
|
15
15
|
render() {
|
|
16
16
|
const imageUrl = this.getImageRestState();
|
|
17
|
-
return (h(Host, { key: '
|
|
17
|
+
return (h(Host, { key: '754bdcff113a9ec5351d1053ddaea5e542111bbc', class: classes(['zonos--elements zonos--restState']), style: {
|
|
18
18
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
19
|
-
} }, h("div", { key: '
|
|
19
|
+
} }, h("div", { key: '3037acffd2d7da9bac11ada7cd4e06e2ae976f72', class: "zonos--restState-image" }, h("img", { key: 'd462d07f452caaaf87af20e1b2aad6ac45b43107', alt: this.restStateType, onError: () => {
|
|
20
20
|
this.isErrorImageLoad = true;
|
|
21
|
-
}, src: imageUrl })), h("div", { key: '
|
|
21
|
+
}, src: imageUrl })), h("div", { key: '9acf78ef8358ad75df01bbbb1ed52b680f896255', class: "content" }, h("zonos-text", { key: '8310474f006a1fc1dcf96bac09c770572b20590a', class: "title", type: "boldSubheader" }, this.restStateTitle), h("zonos-text", { key: '623dc98d57eaae5fb1059c658391300aa41a13fb', class: "subtitle" }, this.restStateSubtitle)), h("div", { key: 'f69613147698a147447a0aac330ad1c67739fed0', class: "action" }, h("slot", { key: '823ff6075ecac4598299c29ab2e44a6d5fb6a5d8' }))));
|
|
22
22
|
}
|
|
23
23
|
static get is() { return "zonos-rest-state"; }
|
|
24
24
|
static get encapsulation() { return "shadow"; }
|
package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js
CHANGED
|
@@ -8,9 +8,9 @@ export class ZonosSelectDialogHeader {
|
|
|
8
8
|
this.label = '';
|
|
9
9
|
}
|
|
10
10
|
render() {
|
|
11
|
-
return (h(Host, { key: '
|
|
11
|
+
return (h(Host, { key: '184508c2af24eedda1e4a59db89f787cd71a345f', class: "zonos--elements", style: {
|
|
12
12
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
13
|
-
} }, h("zonos-v-stack", { key: '
|
|
13
|
+
} }, h("zonos-v-stack", { key: '28bd290a2307c13e93036ee988f71bba87e76b19', class: "zonos--select-dialog-header-wrapper", spacing: 8 }, h("div", { key: '49c2a1c0c44d9950907f47d90c9a34a83e5158da', class: "zonos--select-dialog-header" }, h("zonos-text", { key: '244ef10f5ee38d4a056ad6c076185d42ca3cd174', type: "boldLabel" }, this.label), h("zonos-button", { key: 'dab99b609f1a3250f73e2f25b837c9300a964090', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close select dialog", content: RemoveIcon, size: 20 }), noBackground: true, onClick: () => this.handleOnClose() })), h("slot", { key: 'b2fdb25cdc7c6382ec8d171aa14f1f4b7f33a4e8' }))));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-select-dialog-header"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -50,7 +50,7 @@ export class ZonosStripeInput {
|
|
|
50
50
|
const secondaryColor = this.overrideSecondaryColor || zonosStore.appearance.colorSecondary;
|
|
51
51
|
const isDark = primaryColor && isDarkColor(primaryColor);
|
|
52
52
|
const fontSize = zonosStore.appearance.fontSizeInputValue || 16;
|
|
53
|
-
return (h(Host, { key: '
|
|
53
|
+
return (h(Host, { key: 'ce50e8c3f41abc7f7605a4423dc21c5fce755c9a', class: classes([
|
|
54
54
|
'zonos--input zonos--elements',
|
|
55
55
|
isDark && 'dark',
|
|
56
56
|
(this.isError || !!this.error) && 'has-error',
|
|
@@ -59,10 +59,10 @@ export class ZonosStripeInput {
|
|
|
59
59
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
60
60
|
'--zonos--font-size': `${fontSize}px`,
|
|
61
61
|
'--zonos--primary-color': secondaryColor,
|
|
62
|
-
} }, h("div", { key: '
|
|
62
|
+
} }, h("div", { key: '8953c4cf31d9de771ef8f6351476d5db9de5655a', class: classes([
|
|
63
63
|
'zonos--label-wrapper',
|
|
64
64
|
this.isDisabled && 'disabled',
|
|
65
|
-
]) }, h("input", Object.assign({ key: '
|
|
65
|
+
]) }, h("input", Object.assign({ key: 'c66c0e5787191ab6bb804755da7477e222b3ff40' }, this.inheritedAttributes, { autoComplete: this.autoComplete, class: classes([
|
|
66
66
|
'zonos--floated-input',
|
|
67
67
|
!!this.inputLabel && 'has-label',
|
|
68
68
|
this.internalValue && 'has-content',
|
|
@@ -72,7 +72,7 @@ export class ZonosStripeInput {
|
|
|
72
72
|
this.inputChange.emit(input.value);
|
|
73
73
|
this.el.inputValue = input.value;
|
|
74
74
|
this.el.dispatchEvent(new Event('change'));
|
|
75
|
-
}, placeholder: this.inputPlaceholder || '', required: this.required, type: "text", value: this.internalValue })), h("div", { key: '
|
|
75
|
+
}, placeholder: this.inputPlaceholder || '', required: this.required, type: "text", value: this.internalValue })), h("div", { key: '17c7fa7ef87bf765203cadb3ff24ead25ac45332', class: "zonos--floated-label" }, h("label", { key: '4d7c8e503bd0dc0081b13a36c2a1c5f976ee93e3', htmlFor: this.inputId }, this.inputLabel))), this.error && (h("zonos-text", { key: '1352d1d09b05a25ced56d31b16cf1f203b0eaaec', textColor: "red-600", type: "caption" }, this.error))));
|
|
76
76
|
}
|
|
77
77
|
static get is() { return "zonos-stripe-input"; }
|
|
78
78
|
static get encapsulation() { return "scoped"; }
|
package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js
CHANGED
|
@@ -196,24 +196,24 @@ export class ZonosStripePhoneInput {
|
|
|
196
196
|
.filter(Boolean)
|
|
197
197
|
.sort((a, b) => a.displayName.localeCompare(b.displayName))
|
|
198
198
|
: [];
|
|
199
|
-
return (h(Host, { key: '
|
|
199
|
+
return (h(Host, { key: '0d4501947787cbafe38acb60fb5ee7519b6d1c73', class: classes([
|
|
200
200
|
'zonos--phone-input zonos--elements',
|
|
201
201
|
isDark && 'dark',
|
|
202
|
-
]), "data-theme": isDark ? 'DARK' : 'LIGHT', style: Object.assign({ '--zonos--border-radius': getBorderRadius(), '--zonos--font-family': zonosStoreFontFamily(), '--zonos--font-size': `${fontSize}px`, '--zonos--primary-color': secondaryColor }, (this.minWidth ? { '--zonos--min-width': this.minWidth } : {})) }, h("div", { key: '
|
|
202
|
+
]), "data-theme": isDark ? 'DARK' : 'LIGHT', style: Object.assign({ '--zonos--border-radius': getBorderRadius(), '--zonos--font-family': zonosStoreFontFamily(), '--zonos--font-size': `${fontSize}px`, '--zonos--primary-color': secondaryColor }, (this.minWidth ? { '--zonos--min-width': this.minWidth } : {})) }, h("div", { key: 'c3e0f9655a39a5bb3d838634754be2af60a24a10', class: classes([
|
|
203
203
|
'zonos--label-wrapper',
|
|
204
204
|
this.disabled && 'disabled',
|
|
205
205
|
this.isFocused && 'focused',
|
|
206
206
|
hasContent && 'has-content',
|
|
207
207
|
this.error && 'has-error',
|
|
208
208
|
this.inputLabel && 'has-label',
|
|
209
|
-
]) }, h("select", { key: '
|
|
209
|
+
]) }, h("select", { key: '1a58471117f6748d511498e016814bd907e8775f', class: "zonos--select", disabled: this.disabled, onBlur: this.handleBlur, onChange: this.handleCountryChange, onFocus: this.handleFocus }, countryOptionsList.map(option => {
|
|
210
210
|
var _a;
|
|
211
211
|
return (h("option", { key: option.countryCode, selected: option.countryCode === ((_a = this.selectedCountry) === null || _a === void 0 ? void 0 : _a.countryCode), value: option.countryCode }, option.displayName, " (+", option.phoneCode, ")"));
|
|
212
|
-
})), h("div", { key: '
|
|
212
|
+
})), h("div", { key: '9c785521e095aae0cfc8af3ea90e4924c97202ac', class: "zonos--input-group" }, h("div", { key: 'b7fdd9db255ce33f3b6d3a982162c8286963324c', class: "zonos--select-wrapper" }, h("div", { key: '5d378436580df53793b1508af5e34bd43ba33ddf', class: "zonos--country-select" }, h("div", { key: '94628459db88e355b1c62b74cfcb48ec03022d4e', class: "zonos--country-select-content" }, this.selectedCountry && (h("div", { key: '96b332ed9c62413887f96f38ce26cb05b81a3132', class: "zonos--country-select-selected" }, h("div", { key: 'b9e5bda55328f57e15afd349789233e3c28d2bf9', class: "zonos--country-flag-wrapper" }, h("zonos-country-flag", { key: 'fc595df21c09553dc8ffb7fe79c3043831e65298', class: "zonos--country-flag", countryCode: this.selectedCountry.countryCode })), h("div", { key: '6c792c383acf3ccac02be6b954a7eb18bcdda817', class: "zonos--country-code" }, "+", this.selectedCountry.phoneCode))), h("div", { key: '970b9f6e18152e04375a248669fd7314088bcd2e', class: "zonos--select-chevron-wrapper" }, h("zonos-icon", { key: '1da5919014eee0e34b60d1df08e83d44ad20d5c2', "aria-label": "Expand collapsed section", class: "zonos--select-chevron", content: ChevronDownIcon, iconColor: "gray-800" }))))), h("div", { key: '7f0c215ddfb59c8e3c4413e44941a477a8adc6d6', class: classes([
|
|
213
213
|
'zonos--input-container',
|
|
214
214
|
this.inputLabel && 'has-label',
|
|
215
215
|
hasContent && 'has-content',
|
|
216
|
-
]) }, h("input", Object.assign({ key: '
|
|
216
|
+
]) }, h("input", Object.assign({ key: 'e3ce0b598baf78452eddaab38c80bb4f0c548a5a' }, this.inheritedAttributes, { autoComplete: this.autoComplete, class: "zonos--floated-input", disabled: this.disabled, id: this.inputId, onBlur: this.handleBlur, onFocus: this.handleFocus, onInput: this.handlePhoneChange, placeholder: ((_a = this.selectedCountry) === null || _a === void 0 ? void 0 : _a.phonePlaceholder) || '', ref: el => (this.inputRef = el), type: "tel" })), this.inputLabel && (h("div", { key: 'a108f2796571f9d8a4201d1906b2381b89d14bc2', class: "zonos--floated-label" }, h("label", { key: '50d308311270bbd8635bb7848495ee4aaa2a0cac', htmlFor: this.inputId }, this.inputLabel || translate('Phone number'))))))), this.error && (h("zonos-text", { key: '27b0233f9241ce68348b2efd1c1b525d083363e5', textColor: "red-600" }, this.error))));
|
|
217
217
|
}
|
|
218
218
|
static get is() { return "zonos-stripe-phone-input"; }
|
|
219
219
|
static get encapsulation() { return "scoped"; }
|
|
@@ -80,14 +80,14 @@ export class ZonosStripeSelect {
|
|
|
80
80
|
const fontSize = zonosStore.appearance.fontSizeInputValue || 16;
|
|
81
81
|
const hasContent = this.internalValue || this.selectPlaceholder;
|
|
82
82
|
const showClearButton = this.isClearable && this.internalValue && !this.isDisabled;
|
|
83
|
-
return (h(Host, { key: '
|
|
83
|
+
return (h(Host, { key: '18d7ba03b9136af8614874b13b9ac3ce85f7c0d0', class: classes([
|
|
84
84
|
'zonos--select zonos--elements',
|
|
85
85
|
isDark && 'dark',
|
|
86
86
|
this.isError && 'has-error',
|
|
87
|
-
]), "data-theme": isDark ? 'DARK' : 'LIGHT', style: Object.assign({ '--zonos--border-radius': getBorderRadius(), '--zonos--font-family': zonosStoreFontFamily(), '--zonos--font-size': `${fontSize}px`, '--zonos--primary-color': secondaryColor }, (this.minWidth ? { '--zonos--min-width': this.minWidth } : {})) }, h("div", { key: '
|
|
87
|
+
]), "data-theme": isDark ? 'DARK' : 'LIGHT', style: Object.assign({ '--zonos--border-radius': getBorderRadius(), '--zonos--font-family': zonosStoreFontFamily(), '--zonos--font-size': `${fontSize}px`, '--zonos--primary-color': secondaryColor }, (this.minWidth ? { '--zonos--min-width': this.minWidth } : {})) }, h("div", { key: '88b8d885c11bc0776bd0c25b5f0a08f91cfb7c72', class: classes([
|
|
88
88
|
'zonos--label-wrapper',
|
|
89
89
|
this.isDisabled && 'disabled',
|
|
90
|
-
]) }, h("select", Object.assign({ key: '
|
|
90
|
+
]) }, h("select", Object.assign({ key: 'd972a6a7b91bb51f2d5ed291a686d521c1bf82a3' }, this.inheritedAttributes, { autoComplete: this.autoComplete, class: classes([
|
|
91
91
|
'zonos--floated-select',
|
|
92
92
|
!!this.selectLabel && 'has-label',
|
|
93
93
|
hasContent && 'has-content',
|
|
@@ -97,9 +97,9 @@ export class ZonosStripeSelect {
|
|
|
97
97
|
this.selectChange.emit(select.value);
|
|
98
98
|
this.selectedValue = select.value;
|
|
99
99
|
this.el.dispatchEvent(new Event('change'));
|
|
100
|
-
}, required: this.required }), h("option", { key: '
|
|
100
|
+
}, required: this.required }), h("option", { key: 'b67730b2c3e77ba60221320519f55e67d7d2b127', disabled: true, selected: !this.internalValue, value: "" }, this.selectPlaceholder || translate('Select')), this.internalOptions.map(option => (h("option", { key: option.value, selected: this.internalValue === option.value ||
|
|
101
101
|
// Sometimes google returns the label not the code for some countries
|
|
102
|
-
this.internalValue === option.label, value: option.value }, option.label)))), h("div", { key: '
|
|
102
|
+
this.internalValue === option.label, value: option.value }, option.label)))), h("div", { key: '088c104006e983b5ec1680067af32c0479dde13b', class: "zonos--floated-label" }, h("label", { key: 'faf3bf337253d205265b181d65d8f8024ffd6124', htmlFor: this.selectId }, this.selectLabel)), h("div", { key: '7ce8d36b84b08df139877cd2e12a26b8157ce83b', class: "zonos--actions-wrapper" }, showClearButton && (h("button", { key: 'b0a1af08afd9792ba4e7989361219c5cf7d5d8bc', "aria-label": "Clear selection", class: "zonos--clear-button", onClick: this.handleClear, tabIndex: 0, type: "button" }, h("zonos-icon", { key: '50ae86d5e9d9722b5546997f9fd52a997cac3add', class: "zonos--clear-icon", content: RemoveLineIcon, iconColor: "gray-1200" }))), h("zonos-icon", { key: '30034030f97f7ed6b3027cbc5220c73cde4bbbc2', "aria-label": "Expand collapsed section", class: "zonos--select-chevron", content: ChevronDownIcon, iconColor: "gray-800" }))), this.error && (h("zonos-text", { key: 'cd02da8b1a1cb81581ac7285af84193000692eaa', textColor: "red-600" }, this.error))));
|
|
103
103
|
}
|
|
104
104
|
static get is() { return "zonos-stripe-select"; }
|
|
105
105
|
static get encapsulation() { return "shadow"; }
|
|
@@ -7,9 +7,9 @@ export class ZonosToggle {
|
|
|
7
7
|
this.value = undefined;
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: '9a526e8fee8e4c5af558442c82f7acbc634706c3', class: classes(['zonos--elements zonos--toggle']), style: {
|
|
11
11
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
12
|
-
} }, h("div", { key: '
|
|
12
|
+
} }, h("div", { key: '97ca281e8e782c3b08231c6ba705325bbf16d402', class: "wrapper" }, this.options.map(option => {
|
|
13
13
|
const selected = option.value === this.value;
|
|
14
14
|
return (h("button", { class: classes(['zonos--option', selected && 'selected']), key: option.value, onClick: () => {
|
|
15
15
|
this.toggleChanged.emit(option.value);
|
|
@@ -7,10 +7,10 @@ export class ZonosTooltip {
|
|
|
7
7
|
this.showTooltip = false;
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: 'd984faacc8d79f2001c84fb69c30f3665dca44aa', class: "zonos--elements" }, h("div", { key: '327f9d077f2400f05ff3c4337b566c461a2d05cf', class: "zonos--tooltip", onMouseEnter: () => (this.showTooltip = true), onMouseLeave: () => (this.showTooltip = false) }, h("slot", { key: '24315359176ca625f18a856d781624850d05de17' }), h("div", { key: '296041bbebddd0250c6d5d9649e6502571a08533', class: classes([
|
|
11
11
|
this.showTooltip && 'zonos--show-tooltip',
|
|
12
12
|
'zonos--tooltip-content',
|
|
13
|
-
]) }, h("zonos-text", { key: '
|
|
13
|
+
]) }, h("zonos-text", { key: '5a2828baf420acb666eb1f0029c8d0b9eadd55ce', size: "s", textColor: "gray-0", type: "boldLabel" }, this.label), h("zonos-text", { key: '1bd8bf5085edfdc3d42db03e460062bf744c174b', size: "xs", textColor: "gray-0" }, this.subtitle)))));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-tooltip"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -7,9 +7,9 @@ export class VStack {
|
|
|
7
7
|
this.spacing = 24;
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
|
-
return (h(Host, { key: '
|
|
10
|
+
return (h(Host, { key: '558218f6135d5fcc9f3649b76c568a9f514aa8e8', style: {
|
|
11
11
|
'--zonos--font-family': zonosStoreFontFamily(),
|
|
12
|
-
} }, h("div", { key: '
|
|
12
|
+
} }, h("div", { key: '86af63aa01214db20cc094ddcbfd05b3ee28f1ed', class: classes(['vstack']), style: { 'grid-row-gap': `${this.spacing}px` } }, h("slot", { key: '4786fb44cbf865a548c900b752f9b13709f1f935' }))));
|
|
13
13
|
}
|
|
14
14
|
static get is() { return "zonos-v-stack"; }
|
|
15
15
|
static get encapsulation() { return "shadow"; }
|
|
@@ -56,12 +56,12 @@ export class ZonosVirtualScroll {
|
|
|
56
56
|
} }, this.renderItem(i)));
|
|
57
57
|
accHeight += itemHeight;
|
|
58
58
|
}
|
|
59
|
-
return (h(Host, { key: '
|
|
59
|
+
return (h(Host, { key: '6ccfd807912b51223f249543b66552e945859a1a' }, h("div", { key: '21f05d8e9082b54f484badc6e52c3006068df401',
|
|
60
60
|
// to capture scroll action
|
|
61
61
|
class: "scroller", style: {
|
|
62
62
|
height: `${this.totalHeight}px`,
|
|
63
63
|
width: `${W}px`,
|
|
64
|
-
} }), h("div", { key: '
|
|
64
|
+
} }), h("div", { key: '3935dc009877c002047f41de3caeeb16e2d7c08d',
|
|
65
65
|
// to display items
|
|
66
66
|
class: "item-container", ref: el => (this.container = el), style: {
|
|
67
67
|
height: `${this.totalHeight}px`,
|
|
@@ -10,7 +10,7 @@ export class ZonosComponent {
|
|
|
10
10
|
return format(this.first, this.middle, this.last);
|
|
11
11
|
}
|
|
12
12
|
render() {
|
|
13
|
-
return h("div", { key: '
|
|
13
|
+
return h("div", { key: '725c727348687e663e6225837a2a135d177b6d4a' }, "Hello, World! I'm ", this.getText());
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-component"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -18,9 +18,9 @@ export class ZonosHelloDialogFooter {
|
|
|
18
18
|
const language = (_b = languages.find(x => x.code === localizationStore.selectedLocale)) === null || _b === void 0 ? void 0 : _b.translatedLabel;
|
|
19
19
|
// Only use gray-0 (white) when the background color is dark (apply inverted color if the element is using dark theme variable)
|
|
20
20
|
const mainColor = primaryColor && isDarkColor(primaryColor) ? 'white' : 'black';
|
|
21
|
-
return (h(Host, { key: '
|
|
21
|
+
return (h(Host, { key: 'd763a9977f7d39c71c15ec1c2b99376f02eab260', class: "zonos--elements" }, h("div", { key: 'e468a11cd1cdcdbbb2dde4768acb80e72afde1f3', class: "zonos--hello-dialog-footer", style: {
|
|
22
22
|
'--zonos--primary-color': primaryColor,
|
|
23
|
-
} }, h("a", { key: '
|
|
23
|
+
} }, h("a", { key: '3f7e809bdbc493a8e0fb7d325a317f403a8b0f69', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, h("zonos-icon", { key: '96cf205bfa3ba0118d119aeb63eb942eded07ac4', "aria-label": "Zonos Logo", autoHeight: true, content: ZonosIcon, iconColor: mainColor, size: 108 })), h("div", { key: '9c59e0f24e551260353b547c69615614de04a80b', class: "zonos--hello-locale-wrapper" }, h("zonos-button", { key: '65eec8c3f59e89c6e4ab2d0bebbfcb0b07ef51f4', buttonColor: mainColor, icon: h("zonos-icon", { "aria-label": "Open language select", content: Globe, iconColor: mainColor }), onClick: () => this.setShowLanguageSelect(true), variant: "subtle" }, language), h("zonos-button", { key: '3c3bdccb4e8d588b6228e4e3c70711b352994c58', buttonColor: mainColor, icon: h("zonos-country-flag", { "aria-label": "Open country select", class: "zonos--footer-country-flag", countryCode: localizationStore.selectedCountryCode }), onClick: () => this.setShowCountrySelect(true), variant: "subtle" }, localizationStore.selectedCountryCode)))));
|
|
24
24
|
}
|
|
25
25
|
static get is() { return "zonos-hello-dialog-footer"; }
|
|
26
26
|
static get encapsulation() { return "shadow"; }
|
|
@@ -232,18 +232,18 @@ export class ZonosHelloDialog {
|
|
|
232
232
|
const defaultMessage = formatStringWithLinks(defaultMessageStr);
|
|
233
233
|
const currentPage = this.getCurrentPageEnum();
|
|
234
234
|
const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
|
|
235
|
-
return (h(Host, { key: '
|
|
235
|
+
return (h(Host, { key: '7b6752f327fdefb40d272d30d50a5fd208ff69a6', class: "zonos--elements" }, h("div", { key: 'b03b78ddfb3a0d6cedb156161fd82ebe45926773', class: classes([
|
|
236
236
|
'zonos--hello-dialog',
|
|
237
237
|
animateLeft && 'zonos--hello-dialog-animate-from-left',
|
|
238
238
|
animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
|
|
239
239
|
!!this.mobileLocationOverride &&
|
|
240
240
|
'zonos--hello-dialog-mobile-override',
|
|
241
241
|
this.isOpen && 'zonos--hello-dialog-open',
|
|
242
|
-
]), inert: !this.isOpen, ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", { key: '
|
|
242
|
+
]), inert: !this.isOpen, ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", { key: '367b5a0158679001cb3004d5d965a518cdc3b8ce' }, h("div", { key: '01dd9b2df5b20e61764274a6405118a7b42019f3', class: "zonos--hello-dialog-content" }, h("zonos-button", { key: 'ed49fe9a95fd6ace11669ee194d90eaae951d938', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close Zonos Hello dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.setIsOpen(false) }), h("zonos-v-stack", { key: '23d391b8f4a13a1b077333f7ac788306dbeb98d6', spacing: 24 }, h("zonos-country-flag", { key: '24c6682b66fe5aa5061bab0b260d6c6fed724f52', class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), h("zonos-v-stack", { key: 'fcb2717fa3403337b507f64adb557bd300841a41', class: "zonos--hello-dialog-header", spacing: 4 }, h("zonos-text", { key: '013fbda529816a2a1f22fc9d524d087fd69145c8', type: "boldSubheader" }, welcomeMessage), h("zonos-text", { key: '2134a015a6e22f6e02db8935150055b04620eed8', innerHTML: defaultMessage, textColor: "gray-800" })), h("zonos-v-stack", { key: '67030faaca46fea72230037b594eb3d0abb18acb', spacing: 8 }, this.restrictedItems.map(item => {
|
|
243
243
|
var _a;
|
|
244
244
|
return item && (h("zonos-banner", { bannerTitle: item.name, intent: "error" }, (_a = item.itemRestrictions) === null || _a === void 0 ? void 0 : _a.map(x => (h("zonos-text", { textColor: "red-800" }, x === null || x === void 0 ? void 0 : x.note)))));
|
|
245
|
-
}), h("zonos-card", { key: '
|
|
246
|
-
additionalInformation.map(info => (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Additional information for buying goods from selected country", content: BagIcon }), h("zonos-text", { innerHTML: info })))))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { key: '
|
|
245
|
+
}), h("zonos-card", { key: '21d50e218fd560e137b68e6d2a16edf118d18148', spacing: "12px" }, h("zonos-v-stack", { key: '70c333afd352aee4a92b47b58c267ec5c6ff122c', spacing: 12 }, hasInclusivePrices ? (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content: InclusivePricingIcon }), h("zonos-text", null, inclusivePriceMessage))) : (h(Fragment, null, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content: ImportIcon }), h("zonos-text", null, dutyDeMinimisMessage)), h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Tax de minimis", content: MoneyIcon }), h("zonos-text", null, taxDeMinimisMessage)))), additionalInformation === null || additionalInformation === void 0 ? void 0 :
|
|
246
|
+
additionalInformation.map(info => (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Additional information for buying goods from selected country", content: BagIcon }), h("zonos-text", { innerHTML: info })))))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { key: '7fa2a3e7646668c37ad2026dcfe0d59d6fd350b8', appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value), setShowLanguageSelect: value => this.setShowLanguageSelect(value) }))), this.showCountrySelect && (h("div", { key: '9a59a41f8ffbef2361ada0d5390708232c829026' }, h("zonos-country-select", { key: '3f10795b4eb5695e9848e2c69611f1a4953f5370', handleOnClose: () => this.setShowCountrySelect(false) }))), this.showLanguageSelect && (h("div", { key: 'c4aa8b2d533e6735a587fc8c7eb217f52e1fc5c9' }, h("zonos-language-select", { key: 'eb75fbe3e7de95b0459d559ac7ee233b77873545', handleOnClose: () => this.setShowLanguageSelect(false) }))))));
|
|
247
247
|
}
|
|
248
248
|
static get is() { return "zonos-hello-dialog"; }
|
|
249
249
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, Host, } from "@stencil/core";
|
|
2
|
-
import { cartStore } from "../store/checkout/cart";
|
|
3
2
|
import { stripeStore } from "../store/checkout/stripe";
|
|
4
3
|
import { initLocalizationStore, localizationStoreUpdateSelectedCountryCode, } from "../store/hello/localization";
|
|
4
|
+
import { storageStore } from "../store/storageStore";
|
|
5
5
|
import { zonosStore, zonosStoreFontFamily, zonosStoreInitSetting, } from "../store/zonosStore";
|
|
6
6
|
import { getZonosSettings } from "../utils/api/getZonosSettings";
|
|
7
7
|
import { initCheckout } from "../utils/checkout/initCheckout";
|
|
@@ -241,7 +241,7 @@ export class ZonosController {
|
|
|
241
241
|
* Reset the Checkout session id and client secret (required for dashboard store switching)
|
|
242
242
|
*/
|
|
243
243
|
async reset() {
|
|
244
|
-
|
|
244
|
+
storageStore.checkoutSessionId = null;
|
|
245
245
|
stripeStore.clientSecret = '';
|
|
246
246
|
}
|
|
247
247
|
/**
|
|
@@ -274,7 +274,7 @@ export class ZonosController {
|
|
|
274
274
|
zonosStore.organizationName = organizationName;
|
|
275
275
|
}
|
|
276
276
|
render() {
|
|
277
|
-
return h(Host, { key: '
|
|
277
|
+
return h(Host, { key: '62c0b3079d64f05800da24daa19e0e1e3a890bca', class: "zonos--elements" });
|
|
278
278
|
}
|
|
279
279
|
static get is() { return "zonos-controller"; }
|
|
280
280
|
static get encapsulation() { return "shadow"; }
|
|
@@ -41,7 +41,7 @@ export class ZonosPaypalPayment {
|
|
|
41
41
|
void this.loadPaypal();
|
|
42
42
|
}
|
|
43
43
|
render() {
|
|
44
|
-
return (h(Host, { key: '
|
|
44
|
+
return (h(Host, { key: 'e8c839cc9d0286f5ae4643243b14fa66f9584833', class: "zonos--paypal-payment zonos--elements" }, h("div", { key: 'cac06948de1ccca97ba65eca10b3e5d9f3a9a362', class: "zonos--payment-paypal-container" })));
|
|
45
45
|
}
|
|
46
46
|
static get is() { return "zonos-paypal-payment"; }
|
|
47
47
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { createStore } from "@stencil/store";
|
|
2
2
|
import { stripeStore, stripeStoreInitCheckoutSession, stripeStoreReset, stripeStoreUpdateCheckoutSession, } from "./stripe";
|
|
3
3
|
import { localizationStore } from "../hello/localization";
|
|
4
|
+
import { storageStore, storageStoreSetEnabledVariantTestKeys, } from "../storageStore";
|
|
4
5
|
import { translate } from "../translationStore";
|
|
5
6
|
import { zonosStore } from "../zonosStore";
|
|
6
7
|
import { getIsStagingMode } from "../../utils/checkout/getIsStagingMode";
|
|
7
8
|
import { allLogs, log } from "../../utils/logging/log";
|
|
8
9
|
import { logError } from "../../utils/logging/logError";
|
|
9
10
|
import { sendErrorLog } from "../../utils/logging/sendErrorLog";
|
|
10
|
-
|
|
11
|
+
import { filterValidTests } from "../../utils/varianceTest/filterValidTests";
|
|
12
|
+
const { reset, state: cartStore } = createStore(() => ({
|
|
11
13
|
adjustmentTotal: 0,
|
|
12
14
|
adjustments: [],
|
|
13
15
|
checkoutSession: null,
|
|
14
|
-
checkoutSessionId: sessionStorage.getItem('zonos--checkout-session-id') || null,
|
|
15
16
|
checkoutSessionTimeoutShow: false,
|
|
16
17
|
checkoutTimeoutInterval: null,
|
|
17
18
|
currency: 'USD',
|
|
@@ -31,9 +32,9 @@ const { onChange, reset, state: cartStore, } = createStore(() => ({
|
|
|
31
32
|
landedCostData: null,
|
|
32
33
|
landedCostMethod: 'DDP',
|
|
33
34
|
partiesData: [],
|
|
34
|
-
promoCode: sessionStorage.getItem('
|
|
35
|
+
promoCode: sessionStorage.getItem('zonos--promo-code') || '',
|
|
35
36
|
// When user clicked applied button, save promocode into session storage for later use. So if session has promocode, applied button is clicked
|
|
36
|
-
promoCodeApplied: !!sessionStorage.getItem('
|
|
37
|
+
promoCodeApplied: !!sessionStorage.getItem('zonos--promo-code'),
|
|
37
38
|
promoCodeError: false,
|
|
38
39
|
restrictedItems: [],
|
|
39
40
|
selectedLandedCost: null,
|
|
@@ -133,7 +134,7 @@ const cartStoreCheckItemRestrictions = (itemsWorkflow) => {
|
|
|
133
134
|
};
|
|
134
135
|
};
|
|
135
136
|
const cartStoreReset = () => {
|
|
136
|
-
|
|
137
|
+
storageStore.checkoutSessionId = null;
|
|
137
138
|
// reset cart store
|
|
138
139
|
reset();
|
|
139
140
|
};
|
|
@@ -188,8 +189,11 @@ const cartStoreSetCheckoutSession = (checkoutSession) => {
|
|
|
188
189
|
}
|
|
189
190
|
// Only update checkout session id if it's not empty
|
|
190
191
|
if (checkoutSession.id) {
|
|
191
|
-
|
|
192
|
+
storageStore.checkoutSessionId = checkoutSession.id;
|
|
192
193
|
}
|
|
194
|
+
// Filter the response to only include test keys that we support and then save it to the session
|
|
195
|
+
const availableSelectedVariantTestKeys = filterValidTests(checkoutSession.varianceTestResults || []);
|
|
196
|
+
storageStoreSetEnabledVariantTestKeys(availableSelectedVariantTestKeys);
|
|
193
197
|
// Check if there is a redirect URL in the metadata to override
|
|
194
198
|
const externalConfirmationPageURL = ((_c = (_b = (_a = cartStore.checkoutSession) === null || _a === void 0 ? void 0 : _a.metadata) === null || _b === void 0 ? void 0 : _b.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'externalConfirmationPageURL')) === null || _c === void 0 ? void 0 : _c.value) ||
|
|
195
199
|
(
|
|
@@ -214,7 +218,7 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
|
|
|
214
218
|
log('Exchange rate updated for cart items (landed cost subtotal)', 'info', cartStore.exchangeRate);
|
|
215
219
|
}
|
|
216
220
|
// update checkout session
|
|
217
|
-
if (!
|
|
221
|
+
if (!storageStore.checkoutSessionId) {
|
|
218
222
|
log('Could not update cart total without checkout session id', 'info');
|
|
219
223
|
return false;
|
|
220
224
|
}
|
|
@@ -222,10 +226,11 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
|
|
|
222
226
|
adjustmentsAmount,
|
|
223
227
|
cartId,
|
|
224
228
|
currency,
|
|
225
|
-
id:
|
|
229
|
+
id: storageStore.checkoutSessionId,
|
|
226
230
|
itemsAmount,
|
|
227
231
|
landedCostId,
|
|
228
232
|
presentmentCountryCode: localizationStore.selectedCountryCode,
|
|
233
|
+
varianceTestInput: storageStore.enabledVariantTestKeys || [],
|
|
229
234
|
});
|
|
230
235
|
if (errors.length > 0 || !json) {
|
|
231
236
|
logError('Error occurs when updating checkout session.');
|
|
@@ -300,6 +305,7 @@ const cartStoreUpdateSelectedShippingOption = async (selectedShippingOption, lan
|
|
|
300
305
|
cartId: window.Zonos.cartId,
|
|
301
306
|
dutiesTaxesFeesEstimate: dutiesTaxesFeesEstimate,
|
|
302
307
|
landedCostId: (_f = selectedLandedCost.landedCost) === null || _f === void 0 ? void 0 : _f.id,
|
|
308
|
+
varianceTestInput: storageStore.enabledVariantTestKeys || [],
|
|
303
309
|
});
|
|
304
310
|
// update conditionally render pay in USD button
|
|
305
311
|
const firstItem = (_g = cartStore.items.find(Boolean)) === null || _g === void 0 ? void 0 : _g.currencyCode;
|
|
@@ -314,14 +320,6 @@ const cartStoreUpdateSelectedShippingOption = async (selectedShippingOption, lan
|
|
|
314
320
|
!!((_l = (_k = zonosStore.genericSettings) === null || _k === void 0 ? void 0 : _k.usdSettlementCountryEnabled) === null || _l === void 0 ? void 0 : _l.includes(shipToCountry));
|
|
315
321
|
return updateCalculateStatus;
|
|
316
322
|
};
|
|
317
|
-
onChange('checkoutSessionId', () => {
|
|
318
|
-
log('checkoutSessionId changed', 'info', cartStore.checkoutSessionId);
|
|
319
|
-
if (!cartStore.checkoutSessionId) {
|
|
320
|
-
sessionStorage.removeItem('zonos--checkout-session-id');
|
|
321
|
-
return;
|
|
322
|
-
}
|
|
323
|
-
sessionStorage.setItem('zonos--checkout-session-id', cartStore.checkoutSessionId);
|
|
324
|
-
});
|
|
325
323
|
const cartStoreStartCheckoutInterval = ({ isPreview, sessionTimeout, }) => {
|
|
326
324
|
// do nothing if in preview mode
|
|
327
325
|
if (isPreview) {
|
|
@@ -375,6 +373,7 @@ const cartStoreUpdateItems = async ({ adjustments, cartItems, }) => {
|
|
|
375
373
|
itemsAmount: total,
|
|
376
374
|
// attempt to init session on failure to update checkout session
|
|
377
375
|
shouldInitSessionOnFailure: true,
|
|
376
|
+
varianceTestInput: storageStore.enabledVariantTestKeys || [],
|
|
378
377
|
});
|
|
379
378
|
stripeStore.isFetchingSession = false;
|
|
380
379
|
};
|
|
@@ -2,6 +2,7 @@ import { loadScript, } from "@paypal/paypal-js";
|
|
|
2
2
|
import { createStore } from "@stencil/store";
|
|
3
3
|
import { cartStore, cartStoreClearCheckoutInterval, cartStoreNextStep, } from "./cart";
|
|
4
4
|
import { stripeStore, stripeStoreHandleInventoryCheck, } from "./stripe";
|
|
5
|
+
import { storageStore } from "../storageStore";
|
|
5
6
|
import { translate } from "../translationStore";
|
|
6
7
|
import { zonosStore } from "../zonosStore";
|
|
7
8
|
import { paypalCaptureOrder } from "../../utils/api/paypalCaptureOrder";
|
|
@@ -213,7 +214,7 @@ const paypalStoreInitButtons = (props) => {
|
|
|
213
214
|
log('Paypal is not available');
|
|
214
215
|
return null;
|
|
215
216
|
}
|
|
216
|
-
const checkoutSessionId =
|
|
217
|
+
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
217
218
|
if (!checkoutSessionId) {
|
|
218
219
|
log('Paypal is not available due to checkoutSessionId is not available');
|
|
219
220
|
return null;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createStore } from "@stencil/store";
|
|
2
2
|
import { cartStore, cartStoreApplySubtotals, cartStoreCheckItemRestrictions, cartStorePreviousStep, cartStoreResetCartItems, cartStoreSetCheckoutSession, cartStoreUpdateSelectedShippingOption, cartStoreUpdateToErrorState, } from "./cart";
|
|
3
3
|
import { localizationStore } from "../hello/localization";
|
|
4
|
+
import { storageStore } from "../storageStore";
|
|
4
5
|
import { translate } from "../translationStore";
|
|
5
6
|
import { zonosStore } from "../zonosStore";
|
|
6
7
|
import { calculateLandedCostNormalized } from "../../utils/api/calculateLandedCostNormaliz";
|
|
@@ -16,7 +17,7 @@ import { sendErrorLog } from "../../utils/logging/sendErrorLog";
|
|
|
16
17
|
import { validateCheckoutSession } from "../../utils/validateCheckoutSession";
|
|
17
18
|
import { addressRuleStyle } from "../../../styles/stripe/addressRuleStyle";
|
|
18
19
|
import { defaultVariable } from "../../../styles/stripe/defaultVariable";
|
|
19
|
-
const { onChange, reset, state: stripeStore, } = createStore(() => ({
|
|
20
|
+
const { onChange: stripeStoreOnChange, reset, state: stripeStore, } = createStore(() => ({
|
|
20
21
|
checkoutSettlementCurrency: 'USD',
|
|
21
22
|
clientSecret: sessionStorage.getItem('zonos--client-secret') || '',
|
|
22
23
|
companyName: '',
|
|
@@ -238,7 +239,7 @@ const stripeCalculateLandedCost = async () => {
|
|
|
238
239
|
return Object.assign(Object.assign({}, checkoutSession), { landedCost: foundLandedCost });
|
|
239
240
|
}).filter(Boolean)) || [];
|
|
240
241
|
// Send event when we get the quote back after the customer clicked "Continue to shipping"
|
|
241
|
-
const checkoutSessionId =
|
|
242
|
+
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
242
243
|
if (checkoutSessionWorkflow === null || checkoutSessionWorkflow === void 0 ? void 0 : checkoutSessionWorkflow.length) {
|
|
243
244
|
void trackConversionEvent({
|
|
244
245
|
checkoutSessionId,
|
|
@@ -255,7 +256,7 @@ const stripeCalculateLandedCost = async () => {
|
|
|
255
256
|
cartStore.promoCodeError = isInvalidPromoCode;
|
|
256
257
|
// When promocode is valid, set promoCode to session storage so if user close the modal, we can still reapply for them
|
|
257
258
|
if (!isInvalidPromoCode) {
|
|
258
|
-
sessionStorage.setItem('
|
|
259
|
+
sessionStorage.setItem('zonos--promo-code', cartStore.promoCode);
|
|
259
260
|
}
|
|
260
261
|
};
|
|
261
262
|
const stripeStorePrefetchLandedCost = async (params) => {
|
|
@@ -368,7 +369,7 @@ const stripeStoreApplyPromoCode = async () => {
|
|
|
368
369
|
};
|
|
369
370
|
const stripeStoreResetPromoCode = () => {
|
|
370
371
|
cartStore.promoCode = '';
|
|
371
|
-
sessionStorage.removeItem('
|
|
372
|
+
sessionStorage.removeItem('zonos--promo-code');
|
|
372
373
|
// reset promocode error state
|
|
373
374
|
cartStore.promoCodeError = false;
|
|
374
375
|
cartStore.promoCodeApplied = false;
|
|
@@ -465,8 +466,23 @@ const stripeStoreHandleInventoryCheck = async () => {
|
|
|
465
466
|
if (typeof onInventoryCheck !== 'function') {
|
|
466
467
|
return null;
|
|
467
468
|
}
|
|
468
|
-
|
|
469
|
-
|
|
469
|
+
try {
|
|
470
|
+
const message = await onInventoryCheck({ items: cartStore.items });
|
|
471
|
+
return message;
|
|
472
|
+
}
|
|
473
|
+
catch (err) {
|
|
474
|
+
const message = err instanceof Error ? err.message : 'Unknown error';
|
|
475
|
+
void sendErrorLog({
|
|
476
|
+
endpoint: 'onInventoryCheck',
|
|
477
|
+
errors: [`cartId: ${window.Zonos.cartId} - ${message}`],
|
|
478
|
+
metadata: {
|
|
479
|
+
cartId: window.Zonos.cartId,
|
|
480
|
+
href: window.location.href,
|
|
481
|
+
items: cartStore.items,
|
|
482
|
+
},
|
|
483
|
+
});
|
|
484
|
+
throw err;
|
|
485
|
+
}
|
|
470
486
|
};
|
|
471
487
|
/**
|
|
472
488
|
* Handle inventory check and returns error message if the callback provided.
|
|
@@ -526,7 +542,7 @@ const stripeStoreConfirmPayment = async () => {
|
|
|
526
542
|
stripeStore.customErrorMessage = checkoutSessionStatus.errorMessage;
|
|
527
543
|
throw new Error(checkoutSessionStatus.errorMessage);
|
|
528
544
|
}
|
|
529
|
-
const checkoutSessionId =
|
|
545
|
+
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
530
546
|
if (stripe &&
|
|
531
547
|
stripeElements &&
|
|
532
548
|
stripePaymentReady &&
|
|
@@ -572,6 +588,7 @@ const stripeStoreConfirmPayment = async () => {
|
|
|
572
588
|
export const getCheckoutSessionBody = () => {
|
|
573
589
|
var _a;
|
|
574
590
|
const total = cartStore.items.reduce((amount, item) => amount + item.amount * item.quantity, 0);
|
|
591
|
+
const varianceTestInput = storageStore.enabledVariantTestKeys || [];
|
|
575
592
|
const body = {
|
|
576
593
|
adjustmentsAmount: cartStore.adjustments.reduce((prev, adj) => prev + adj.amount, 0),
|
|
577
594
|
cartId: window.Zonos.cartId,
|
|
@@ -598,12 +615,13 @@ export const getCheckoutSessionBody = () => {
|
|
|
598
615
|
],
|
|
599
616
|
presentmentCountryCode: localizationStore.selectedCountryCode,
|
|
600
617
|
skipPaymentIntent: stripeStore.skipPaymentIntent,
|
|
618
|
+
varianceTestInput,
|
|
601
619
|
};
|
|
602
620
|
return body;
|
|
603
621
|
};
|
|
604
622
|
const stripeStoreGetPaymentIntent = async () => {
|
|
605
623
|
var _a;
|
|
606
|
-
if (!
|
|
624
|
+
if (!storageStore.checkoutSessionId) {
|
|
607
625
|
// We want to log the error anytime we fail to create a checkout session
|
|
608
626
|
void sendErrorLog({
|
|
609
627
|
endpoint: 'Error creating payment intent',
|
|
@@ -623,7 +641,7 @@ const stripeStoreGetPaymentIntent = async () => {
|
|
|
623
641
|
}
|
|
624
642
|
const { errors, json } = await handleFetch('/api/zonos-elements/create-payment-intent', {
|
|
625
643
|
body: {
|
|
626
|
-
checkoutSessionId:
|
|
644
|
+
checkoutSessionId: storageStore.checkoutSessionId,
|
|
627
645
|
},
|
|
628
646
|
method: 'POST',
|
|
629
647
|
});
|
|
@@ -637,7 +655,7 @@ const stripeStoreGetPaymentIntent = async () => {
|
|
|
637
655
|
metadata: {
|
|
638
656
|
allLogs,
|
|
639
657
|
cartId: window.Zonos.cartId,
|
|
640
|
-
checkoutSessionId:
|
|
658
|
+
checkoutSessionId: storageStore.checkoutSessionId,
|
|
641
659
|
clientSecret,
|
|
642
660
|
},
|
|
643
661
|
});
|
|
@@ -691,7 +709,7 @@ const stripeStoreInitCheckoutSession = async () => {
|
|
|
691
709
|
return true;
|
|
692
710
|
};
|
|
693
711
|
const stripeStoreUpdateCheckoutSessionBaseCurrency = async () => {
|
|
694
|
-
const checkoutSessionId =
|
|
712
|
+
const checkoutSessionId = storageStore.checkoutSessionId;
|
|
695
713
|
// Checkout session id should be available at this point
|
|
696
714
|
if (!checkoutSessionId) {
|
|
697
715
|
logError('Failed to update checkout session base currency');
|
|
@@ -723,6 +741,7 @@ const stripeStoreUpdateCheckoutSessionBaseCurrency = async () => {
|
|
|
723
741
|
* Update checkout session. Use for updating amount with landed cost id, or update session when cart items change
|
|
724
742
|
*/
|
|
725
743
|
const stripeStoreUpdateCheckoutSession = async ({ adjustmentsAmount, cartId, currency, id, itemsAmount, landedCostId, presentmentCountryCode, }) => {
|
|
744
|
+
const varianceTestInput = storageStore.enabledVariantTestKeys || [];
|
|
726
745
|
// No need to set loading state here because this function will be called under the hood to update
|
|
727
746
|
// landed cost id for the section.
|
|
728
747
|
const { errors, json } = await handleFetch('/api/zonos-elements/update-checkout-session', {
|
|
@@ -754,6 +773,7 @@ const stripeStoreUpdateCheckoutSession = async ({ adjustmentsAmount, cartId, cur
|
|
|
754
773
|
],
|
|
755
774
|
presentmentCountryCode,
|
|
756
775
|
skipPaymentIntent: stripeStore.skipPaymentIntent,
|
|
776
|
+
varianceTestInput,
|
|
757
777
|
},
|
|
758
778
|
method: 'POST',
|
|
759
779
|
});
|
|
@@ -882,7 +902,7 @@ const stripeStoreTranslateAddressToLatin = async ({ addressInvalidCharactersList
|
|
|
882
902
|
: {},
|
|
883
903
|
};
|
|
884
904
|
};
|
|
885
|
-
|
|
905
|
+
stripeStoreOnChange('clientSecret', clientSecret => {
|
|
886
906
|
// update stripe elements when client secret changes
|
|
887
907
|
if (clientSecret && stripeStore.stripe) {
|
|
888
908
|
sessionStorage.setItem('zonos--client-secret', clientSecret);
|
|
@@ -891,4 +911,4 @@ onChange('clientSecret', clientSecret => {
|
|
|
891
911
|
sessionStorage.removeItem('zonos--client-secret');
|
|
892
912
|
}
|
|
893
913
|
});
|
|
894
|
-
export { initStripeElements, stripeCalculateLandedCost, stripeStore, stripeStoreApplyPromoCode, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreGetDomesticShippingSession, stripeStoreGetPaymentIntent, stripeStoreHandleInventoryCheck, stripeStoreHandleInventoryRefund, stripeStoreInitCheckoutSession, stripeStoreMessageBasedOnStatus, stripeStorePrefetchLandedCost, stripeStoreRemovePromoCode, stripeStoreReset, stripeStoreResetPromoCode, stripeStoreRetrievePayment, stripeStoreSaveDomesticShippingSession, stripeStoreTranslateAddressToLatin, stripeStoreUpdateCheckoutSession, stripeStoreUpdateCheckoutSessionBaseCurrency, };
|
|
914
|
+
export { initStripeElements, stripeCalculateLandedCost, stripeStore, stripeStoreApplyPromoCode, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreGetDomesticShippingSession, stripeStoreGetPaymentIntent, stripeStoreHandleInventoryCheck, stripeStoreHandleInventoryRefund, stripeStoreInitCheckoutSession, stripeStoreMessageBasedOnStatus, stripeStoreOnChange, stripeStorePrefetchLandedCost, stripeStoreRemovePromoCode, stripeStoreReset, stripeStoreResetPromoCode, stripeStoreRetrievePayment, stripeStoreSaveDomesticShippingSession, stripeStoreTranslateAddressToLatin, stripeStoreUpdateCheckoutSession, stripeStoreUpdateCheckoutSessionBaseCurrency, };
|