@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
|
@@ -3,17 +3,19 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0993f42d.js');
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
const
|
|
6
|
+
const cart = require('./cart-637ba3d0.js');
|
|
7
|
+
const localization = require('./localization-2f17c95f.js');
|
|
8
|
+
const zonosStore = require('./zonosStore-9264749e.js');
|
|
8
9
|
const handleFetch = require('./handleFetch-969d05d8.js');
|
|
9
10
|
const shouldRenderTaxIdInput = require('./shouldRenderTaxIdInput-9b8a8de1.js');
|
|
10
11
|
const TaxId = require('./TaxId-12acedde.js');
|
|
11
12
|
const classes = require('./classes-b7918f56.js');
|
|
12
|
-
const getBorderRadius = require('./getBorderRadius-
|
|
13
|
+
const getBorderRadius = require('./getBorderRadius-8d3b1049.js');
|
|
13
14
|
const RemoveIcon$2 = require('./RemoveIcon-081ac073.js');
|
|
14
|
-
const isDarkColor = require('./isDarkColor-
|
|
15
|
-
const debounce$1 = require('./debounce-
|
|
15
|
+
const isDarkColor = require('./isDarkColor-bcf49625.js');
|
|
16
|
+
const debounce$1 = require('./debounce-94e1b7ff.js');
|
|
16
17
|
const helpers = require('./helpers-5bdbb68c.js');
|
|
18
|
+
require('./VarianceTest-0cb1e118.js');
|
|
17
19
|
|
|
18
20
|
const zonosAddressCss = ".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h .zonos--company-name-input.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";
|
|
19
21
|
const ZonosAddressStyle0 = zonosAddressCss;
|
|
@@ -23,6 +25,7 @@ const ZonosAddress$1 = class {
|
|
|
23
25
|
index.registerInstance(this, hostRef);
|
|
24
26
|
this.invalidCharacters = index.createEvent(this, "invalidCharacters", 7);
|
|
25
27
|
this.taxIdChanged = index.createEvent(this, "taxIdChanged", 7);
|
|
28
|
+
this.onStoreCheckoutSessionIdChangedSubscription = () => { };
|
|
26
29
|
/**
|
|
27
30
|
* Google autocomplete overlay is conflict with our button, this is to adjust z index of the autocomplete
|
|
28
31
|
*/
|
|
@@ -31,6 +34,14 @@ const ZonosAddress$1 = class {
|
|
|
31
34
|
* Check if the tracking event is sent
|
|
32
35
|
*/
|
|
33
36
|
this.trackingSent = false;
|
|
37
|
+
this.onStoreCheckoutSessionIdChanged = () => {
|
|
38
|
+
const onCheckoutSessionIdChange = () => {
|
|
39
|
+
this.checkoutSessionId = localization.storageStore.checkoutSessionId;
|
|
40
|
+
};
|
|
41
|
+
// Trigger it once on init because onChange doesn't get triggered on initial load
|
|
42
|
+
onCheckoutSessionIdChange();
|
|
43
|
+
this.onStoreCheckoutSessionIdChangedSubscription = localization.storageStoreOnChange('checkoutSessionId', onCheckoutSessionIdChange);
|
|
44
|
+
};
|
|
34
45
|
this.type = undefined;
|
|
35
46
|
this.titleText = undefined;
|
|
36
47
|
this.defaultAddress = [];
|
|
@@ -38,7 +49,7 @@ const ZonosAddress$1 = class {
|
|
|
38
49
|
this.stripe = window.Zonos.stripe;
|
|
39
50
|
this.isDirtyAddress = false;
|
|
40
51
|
this.isAddressFilled = false;
|
|
41
|
-
this.checkoutSessionId =
|
|
52
|
+
this.checkoutSessionId = localization.storageStore.checkoutSessionId;
|
|
42
53
|
}
|
|
43
54
|
getStripeAddressInstance() {
|
|
44
55
|
if (this.type === 'billing') {
|
|
@@ -67,7 +78,7 @@ const ZonosAddress$1 = class {
|
|
|
67
78
|
}
|
|
68
79
|
isAddressFilledChanged() {
|
|
69
80
|
// Sometimes address elements is loaded with prefilled data before checkout is loaded, need to not send the event if checkout session id is not available, and send the event after checkout is loaded
|
|
70
|
-
if (!
|
|
81
|
+
if (!localization.storageStore.checkoutSessionId) {
|
|
71
82
|
return;
|
|
72
83
|
}
|
|
73
84
|
// Only need to track the event if the shipping address is filled
|
|
@@ -75,7 +86,7 @@ const ZonosAddress$1 = class {
|
|
|
75
86
|
!this.trackingSent &&
|
|
76
87
|
this.type === 'shipping') {
|
|
77
88
|
this.trackingSent = true;
|
|
78
|
-
const checkoutSessionId =
|
|
89
|
+
const checkoutSessionId = localization.storageStore.checkoutSessionId;
|
|
79
90
|
void cart.trackConversionEvent({
|
|
80
91
|
checkoutSessionId,
|
|
81
92
|
eventName: 'checkout_customerInfoFilled',
|
|
@@ -99,7 +110,7 @@ const ZonosAddress$1 = class {
|
|
|
99
110
|
// remove phone from default address if it's not provided, stripe
|
|
100
111
|
// will throw error if key phone exist and its value is empty or 'undefined'.
|
|
101
112
|
const defaultAddress = this.defaultAddress.map(address => (Object.assign(Object.assign({}, address), { name: address.name, phone: address.phone || undefined })));
|
|
102
|
-
const shippableCountries =
|
|
113
|
+
const shippableCountries = localization.localizationStore.shippingZoneCountries;
|
|
103
114
|
const shippingZone = shippableCountries
|
|
104
115
|
? Object.values(shippableCountries).map(country => country.code)
|
|
105
116
|
: [];
|
|
@@ -107,7 +118,7 @@ const ZonosAddress$1 = class {
|
|
|
107
118
|
const checkoutAllCountries = new URLSearchParams(window.location.search).has('zonosCheckoutAllCountries');
|
|
108
119
|
const allowedCountries = this.type === 'shipping' ? shippingZone : [];
|
|
109
120
|
const defaultAddressCountry = (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
|
|
110
|
-
|
|
121
|
+
localization.getFallbackDefaultCountryCode(allowedCountries);
|
|
111
122
|
handleFetch.log(`Stripe country code: ${defaultAddressCountry}`, 'info');
|
|
112
123
|
const addressElement = stripeElements.create('address', {
|
|
113
124
|
allowedCountries: checkoutAllCountries ? [] : allowedCountries,
|
|
@@ -224,7 +235,7 @@ const ZonosAddress$1 = class {
|
|
|
224
235
|
return null;
|
|
225
236
|
}
|
|
226
237
|
const taxIdInputInfo = TaxId.shipToTaxIdLabels[countryCode];
|
|
227
|
-
return (index.h("div", { class: "zonos--tax-id-input" }, index.h("zonos-stripe-input", { inputLabel:
|
|
238
|
+
return (index.h("div", { class: "zonos--tax-id-input" }, index.h("zonos-stripe-input", { inputLabel: localization.translate(taxIdInputInfo.friendlyName), inputPlaceholder: taxIdInputInfo.placeholder, inputValue: cart.stripeStore.taxId || '', isError: !!this.taxIdErrorMessage, onInputChange: (event) => {
|
|
228
239
|
cart.stripeStore.taxId = event.detail;
|
|
229
240
|
this.taxIdChanged.emit(event.detail);
|
|
230
241
|
} }), this.taxIdErrorMessage && (index.h("zonos-text", { textColor: 'red-600', type: "caption" }, this.taxIdErrorMessage))));
|
|
@@ -239,7 +250,7 @@ const ZonosAddress$1 = class {
|
|
|
239
250
|
if (!isCompanyNameEnabled) {
|
|
240
251
|
return null;
|
|
241
252
|
}
|
|
242
|
-
return (index.h("zonos-stripe-input", { class: "zonos--company-name-input", inputLabel:
|
|
253
|
+
return (index.h("zonos-stripe-input", { class: "zonos--company-name-input", inputLabel: localization.translate('Company name (optional)'), inputValue: cart.stripeStore.companyName, onInputChange: (event) => {
|
|
243
254
|
cart.stripeStore.companyName = event.detail;
|
|
244
255
|
} }));
|
|
245
256
|
}
|
|
@@ -247,6 +258,8 @@ const ZonosAddress$1 = class {
|
|
|
247
258
|
// destroy the stripe element when this component is removed from the DOM, so that we can re-create the new one with previous value
|
|
248
259
|
const stripeElement = this.getStripeAddressInstance().stripeAddressElement;
|
|
249
260
|
stripeElement === null || stripeElement === void 0 ? void 0 : stripeElement.destroy();
|
|
261
|
+
// cleanup checkout session id subscription
|
|
262
|
+
this.onStoreCheckoutSessionIdChangedSubscription();
|
|
250
263
|
}
|
|
251
264
|
componentDidLoad() {
|
|
252
265
|
const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
|
|
@@ -255,15 +268,16 @@ const ZonosAddress$1 = class {
|
|
|
255
268
|
stripeAddressEventData.value.address.line1.length > 0;
|
|
256
269
|
// @Watch doesn't get trigger on initial load
|
|
257
270
|
void this.watchInitStripe();
|
|
271
|
+
this.onStoreCheckoutSessionIdChanged();
|
|
258
272
|
}
|
|
259
273
|
render() {
|
|
260
274
|
var _a;
|
|
261
|
-
this.checkoutSessionId =
|
|
275
|
+
this.checkoutSessionId = localization.storageStore.checkoutSessionId;
|
|
262
276
|
if ((_a = cart.stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.complete) {
|
|
263
277
|
this.isAddressFilled = true;
|
|
264
278
|
}
|
|
265
279
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
266
|
-
return (index.h(index.Host, { key: '
|
|
280
|
+
return (index.h(index.Host, { key: '6cb58defa44e55a88bdb8ad3b1b2e96033337fec', class: "zonos--address zonos--elements" }, index.h("zonos-text", { key: '2708affaeb700f6c256b38285696d3eaffa1d1ea', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderTaxIdInput(), index.h("div", { key: '290de47b8579a70f997ead2ab3ada123dfa4d204', class: "zonos--address-component" })));
|
|
267
281
|
}
|
|
268
282
|
get el() { return index.getElement(this); }
|
|
269
283
|
static get watchers() { return {
|
|
@@ -287,7 +301,7 @@ const ZonosAddressDisplay = class {
|
|
|
287
301
|
render() {
|
|
288
302
|
var _a;
|
|
289
303
|
const { city, country, email, line1, line2, name, phone, postal_code, state, } = this.currentAddress;
|
|
290
|
-
const shippingZoneCountry = (_a =
|
|
304
|
+
const shippingZoneCountry = (_a = localization.localizationStore.shippingZoneCountries) === null || _a === void 0 ? void 0 : _a[country];
|
|
291
305
|
const renderEnteredInfoText = ({ bold, content, }) => {
|
|
292
306
|
const textColor = shouldRenderTaxIdInput.isTextContainsNonLatinChars(content)
|
|
293
307
|
? 'red-600'
|
|
@@ -295,8 +309,8 @@ const ZonosAddressDisplay = class {
|
|
|
295
309
|
return (index.h("zonos-text", { textColor: textColor, type: bold ? 'boldLabel' : 'body' }, content));
|
|
296
310
|
};
|
|
297
311
|
return (index.h(index.Host, { class: "zonos--address-form zonos--elements" }, index.h("div", { class: "zonos--title" }, index.h("zonos-text", { textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
|
|
298
|
-
?
|
|
299
|
-
:
|
|
312
|
+
? localization.translate('Shipping')
|
|
313
|
+
: localization.translate('Billing'))), index.h("div", { class: "zonos--address-group" }, name && (index.h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ bold: true, content: name }))), email && (index.h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: email }))), phone && (index.h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: phone }))), line1 && (index.h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: line1 }))), line2 && (index.h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: line2 }))), index.h("div", { class: "zonos--address-line" }, city && renderEnteredInfoText({ content: city }), state && renderEnteredInfoText({ content: state }), postal_code && renderEnteredInfoText({ content: postal_code })), shippingZoneCountry && (index.h("div", { class: "zonos--address-line" }, index.h("zonos-country-flag", { class: "zonos--country-flag", countryCode: shippingZoneCountry.code }), ' ', renderEnteredInfoText({
|
|
300
314
|
content: shippingZoneCountry.displayName,
|
|
301
315
|
}))))));
|
|
302
316
|
}
|
|
@@ -334,14 +348,14 @@ const ZonosAddressForm = class {
|
|
|
334
348
|
// get the rest of the name if it exists
|
|
335
349
|
const lastName = name.split(' ').slice(1).join(' ') || '';
|
|
336
350
|
return (index.h(index.Host, { key: '8b578737e33203a23563be7e9be0778deec99bbf', class: "zonos--address-form zonos--elements" }, index.h("div", { key: '793675a1348547bf3f781788956befe325191011', class: "zonos--title" }, index.h("zonos-text", { key: '13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9', textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
|
|
337
|
-
?
|
|
338
|
-
:
|
|
351
|
+
? localization.translate('Shipping')
|
|
352
|
+
: localization.translate('Billing'))), index.h("div", { key: '2c5de5b5283fb99ee5f8b61d7a217177986fc2db', class: "zonos--address-group" }, index.h("div", { key: '23bf3c893071000d5995a5f175867bab11929193', class: "zonos--contact" }, index.h("zonos-text", { key: '7cdfe2a84ebad89ba5b16498d75def99cf392384', type: "label" }, localization.translate('Contact')), index.h("zonos-input", { key: '1c39c38767fd306c5eb1164cdc989b8291209cf0', class: "zonos--form-email", inputLabel: localization.translate('Email'), inputValue: this.currentAddress.email, isDisabled: true }), index.h("div", { key: 'cbdf61217125e22b1a6cec9a340ef0aca2c75670', class: "zonos--name zonos--address-row" }, index.h("zonos-input", { key: '360c99e7b2c6caa64580d5768b5bb53368927275', class: "zonos--form-first-name", inputLabel: localization.translate('First name'), inputValue: firstName, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(firstName), onInputChange: e => this.onInputChange({
|
|
339
353
|
key: 'name',
|
|
340
354
|
value: `${e.detail} ${lastName}`,
|
|
341
|
-
}) }), index.h("zonos-input", { key: '8ce5fa5c15c6f7928339ea10009ce0e68954a91f', class: "zonos--form-last-name", inputLabel:
|
|
355
|
+
}) }), index.h("zonos-input", { key: '8ce5fa5c15c6f7928339ea10009ce0e68954a91f', class: "zonos--form-last-name", inputLabel: localization.translate('Last name'), inputValue: lastName, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(lastName), onInputChange: e => this.onInputChange({
|
|
342
356
|
key: 'name',
|
|
343
357
|
value: `${firstName} ${e.detail}`,
|
|
344
|
-
}) }))), index.h("div", { key: '7b4fa2d3baa6cb257e7688e5ba6777123898b3fd', class: "zonos--address" }, index.h("zonos-text", { key: '9d5782331b2642755a755aeb7f98c9f4d87f9a20', type: "label" },
|
|
358
|
+
}) }))), index.h("div", { key: '7b4fa2d3baa6cb257e7688e5ba6777123898b3fd', class: "zonos--address" }, index.h("zonos-text", { key: '9d5782331b2642755a755aeb7f98c9f4d87f9a20', type: "label" }, localization.translate('Address')), index.h("zonos-input", { key: 'a622025924ca86bdbf1d3c04b79e6dee172b4c42', class: "zonos--form-country", inputLabel: localization.translate('Country'), inputValue: country, isDisabled: true }), index.h("zonos-input", { key: 'f99b3a74db09ab5730878e80705b9aeac76bf800', class: "zonos--form-line1", inputLabel: localization.translate('Address line 1'), inputValue: line1, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(line1), onInputChange: e => this.onInputChange({ key: 'line1', value: e.detail }) }), index.h("zonos-input", { key: '5d16aefa45a78045c87d166aaaec0255606e455e', class: "zonos--form-line2", inputLabel: localization.translate('Address line 2'), inputValue: line2, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(line2), onInputChange: e => this.onInputChange({ key: 'line2', value: e.detail }) }), index.h("div", { key: 'dc166be9381142835d72e731cb38a718522a068a', class: "zonos--address-row" }, index.h("zonos-input", { key: '4f1a98f9d10ce0cff3ef18a3037a12382552b31d', class: "zonos--form-city", inputLabel: localization.translate('City'), inputValue: city, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(city), onInputChange: e => this.onInputChange({ key: 'city', value: e.detail }) }), index.h("zonos-input", { key: 'd4f97900b5fe2e1619950a52d1d1f716a8bc19ff', class: "zonos--form-state", inputLabel: localization.translate('State/Province'), inputValue: state, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(state), onInputChange: e => this.onInputChange({ key: 'state', value: e.detail }) })), index.h("zonos-input", { key: 'cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733', class: "zonos--form-postal-code", inputLabel: localization.translate('Postal code'), inputValue: postal_code, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(postal_code), onInputChange: e => this.onInputChange({ key: 'postal_code', value: e.detail }) }), index.h("zonos-input", { key: '7421c82847eded6bdbcce49ef8196124d8e50c1d', class: "zonos--form-phone", inputLabel: localization.translate('Phone number'), inputValue: phone, onInputChange: e => this.onInputChange({ key: 'phone', value: e.detail }) })))));
|
|
345
359
|
}
|
|
346
360
|
static get watchers() { return {
|
|
347
361
|
"translatedAddress": ["watchCurrentAddress"]
|
|
@@ -419,9 +433,9 @@ const ZonosAddressSuggestions = class {
|
|
|
419
433
|
return segments;
|
|
420
434
|
}
|
|
421
435
|
render() {
|
|
422
|
-
return (index.h(index.Host, { key: '
|
|
436
|
+
return (index.h(index.Host, { key: 'eeb520d24c5cebca1f425c9648a2bdf0269f74c9', class: "zonos--address-suggestions", role: "group", style: {
|
|
423
437
|
'--zonos--border-radius': getBorderRadius.getBorderRadius(),
|
|
424
|
-
} }, index.h("ul", { key: '
|
|
438
|
+
} }, index.h("ul", { key: 'f7ac29ef14417f8c86dbafcf840204f4c964b3ad', "aria-label": "Suggestions", class: "wrapper", role: "listbox" }, !!this.localSuggestions.length && (index.h("li", { key: '13d34e64d8bd7711268a1f5641d0c868a89b949c', "aria-selected": false, class: "powered-by option", role: "option" }, index.h("div", { key: '00f20bd5568762ee581462826410031273e808da', class: "powered-by-container" }, index.h("zonos-text", { key: 'fc61a8ec973fc2cdf1e137563617cfed0badbb12', type: "caption" }, "Suggestions powered by"), index.h("zonos-text", { key: '96343fe696ec0d3990ffebaf450306ca91624d04', type: "semiBoldLabel" }, "Google")), index.h("zonos-button", { key: 'e7c6a9e64c8976a3c3a521b0794d2e82c1919ce2', "aria-label": "Clear suggestions", icon: index.h("zonos-icon", { content: RemoveIcon$1 }), noBackground: true, onClick: () => {
|
|
425
439
|
this.localSuggestions = [];
|
|
426
440
|
} }))), this.localSuggestions.map(suggestion => (
|
|
427
441
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
@@ -593,7 +607,7 @@ const ZonosAddressUpdateDialog = class {
|
|
|
593
607
|
return (index.h(index.Host, { key: '655845cef04f4af526b1a1c4e49243c4f2b4c7f6', class: classes.classes([
|
|
594
608
|
'zonos--address-update-dialog zonos--elements',
|
|
595
609
|
this.isMobile && 'mobile',
|
|
596
|
-
]) }, index.h("zonos-dialog", { key: 'eab429bb78ce6f05ba463d8748d7edd5499402fa', isLoading: this.dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeUpdateDialog.emit(), open: this.dialogOpen, width: "568px" }, index.h("div", { key: '08f0400e62addfcaffd91bf5200999d29bbd2da9', class: "zonos--body" }, index.h("div", { key: '8699df5e2f823e19066fbb552ba2a66c127c05e9', class: "zonos--dialog-header" }, index.h("div", { key: '92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3', class: "zonos--dialog-title" }, index.h("zonos-text", { key: 'aaac3375526bddb319ce7c8f49bde30da7210264', type: "title" },
|
|
610
|
+
]) }, index.h("zonos-dialog", { key: 'eab429bb78ce6f05ba463d8748d7edd5499402fa', isLoading: this.dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeUpdateDialog.emit(), open: this.dialogOpen, width: "568px" }, index.h("div", { key: '08f0400e62addfcaffd91bf5200999d29bbd2da9', class: "zonos--body" }, index.h("div", { key: '8699df5e2f823e19066fbb552ba2a66c127c05e9', class: "zonos--dialog-header" }, index.h("div", { key: '92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3', class: "zonos--dialog-title" }, index.h("zonos-text", { key: 'aaac3375526bddb319ce7c8f49bde30da7210264', type: "title" }, localization.translate('Update your address')), index.h("zonos-button", { key: '474cc2421cd3150daa46bfe215da6ae7df9c6087', class: "zonos--close-button", icon: index.h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon$2.RemoveIcon }), noBackground: true, onClick: () => this.closeUpdateDialogHandler(), title: "Close checkout dialog" })), index.h("zonos-text", { key: '6d019250cce57e8b30dd790a184df7273bdb234f' }, localization.translate('To ensure delivery all address details must be in Latin characters.'))), index.h("div", { key: '80ee681844f4f4f43fce69d977b634b1fbc3d5f5', class: "zonos--group" }, index.h("zonos-text", { key: '940e510eceec156a74f32de84cf58ffebd796435', class: "zonos--what-you-entered", type: "semiBoldLabel" }, localization.translate('What you entered')), index.h("div", { key: 'f626127f5c399c29ab1022deb66aaee8f8a49601', class: "zonos--address-display-group" }, index.h("zonos-address-display", { key: '9dfcba1037325c3a1f9e82b8e4797e7872dd7e3f', addressType: "shipping", currentAddress: shipping }), billing && (index.h("zonos-address-display", { key: 'fee8ae2c6786d735133c2a0a42f3e3d40d7f9ea9', addressType: "billing", currentAddress: billing }))), index.h("div", { key: '5a82195018ff8cdfd1126f4424062a26c25ee757', class: "zonos--address-form-section" }, index.h("zonos-text", { key: 'f694dfad166697e4c034cea51057133b69b1c144', type: "semiBoldLabel" }, localization.translate('Translated address')), index.h("zonos-address-form", { key: '4a99c841cf4800de43c612cce3d56d956d02c22f', addressType: "shipping", class: "zonos--shipping-address-form", currentAddress: shipping, onAddressChange: e => {
|
|
597
611
|
const address = e.detail;
|
|
598
612
|
this.translatedShippingAddressState =
|
|
599
613
|
this.buildTranslateAddressState({
|
|
@@ -607,7 +621,7 @@ const ZonosAddressUpdateDialog = class {
|
|
|
607
621
|
currentAddress: billing,
|
|
608
622
|
translatedAddress: address,
|
|
609
623
|
});
|
|
610
|
-
}, translatedAddress: this.translatedBillingAddressState })))), index.h("div", { key: '918c3271579c3fc7a7efff0473b0ccf48fb575a2', class: "zonos--group-btn" }, index.h("div", { key: 'f73be0c1124d3a4d340bc6e8512f6be8356c655d', class: "zonos--button-wrapper" }, index.h("zonos-button", { key: '172a6cc0a7b75afb400802ef6b87faae6e7e2483', class: "zonos--cancel-btn", onClick: () => this.closeUpdateDialogHandler(), variant: "subtle" },
|
|
624
|
+
}, translatedAddress: this.translatedBillingAddressState })))), index.h("div", { key: '918c3271579c3fc7a7efff0473b0ccf48fb575a2', class: "zonos--group-btn" }, index.h("div", { key: 'f73be0c1124d3a4d340bc6e8512f6be8356c655d', class: "zonos--button-wrapper" }, index.h("zonos-button", { key: '172a6cc0a7b75afb400802ef6b87faae6e7e2483', class: "zonos--cancel-btn", onClick: () => this.closeUpdateDialogHandler(), variant: "subtle" }, localization.translate('Cancel')), index.h("zonos-button", { key: '8fd08bc79b60eb9a0064c06ff9d840b1ecb09123', backgroundColor: this.submitBtnColor, class: "zonos--update-btn", loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "sm", variant: submitBtnType }, localization.translate('Update address'))))))));
|
|
611
625
|
}
|
|
612
626
|
get el() { return index.getElement(this); }
|
|
613
627
|
static get watchers() { return {
|
|
@@ -794,6 +808,7 @@ const ZonosAddress = class {
|
|
|
794
808
|
index.registerInstance(this, hostRef);
|
|
795
809
|
this.invalidCharacters = index.createEvent(this, "invalidCharacters", 7);
|
|
796
810
|
this.addressChange = index.createEvent(this, "addressChange", 7);
|
|
811
|
+
this.onStoreCheckoutSessionIdChangedSubscription = () => { };
|
|
797
812
|
/**
|
|
798
813
|
* Whether the suggestion is clicked
|
|
799
814
|
*/
|
|
@@ -869,7 +884,7 @@ const ZonosAddress = class {
|
|
|
869
884
|
(((_b = this.countryField) === null || _b === void 0 ? void 0 : _b.cityRequired) && !!(value === null || value === void 0 ? void 0 : value.trim()));
|
|
870
885
|
customErrors.city = '';
|
|
871
886
|
if (!isValid) {
|
|
872
|
-
customErrors.city =
|
|
887
|
+
customErrors.city = localization.translate('The field is incomplete');
|
|
873
888
|
}
|
|
874
889
|
break;
|
|
875
890
|
}
|
|
@@ -878,7 +893,7 @@ const ZonosAddress = class {
|
|
|
878
893
|
(((_d = this.countryField) === null || _d === void 0 ? void 0 : _d.stateRequired) && !!(value === null || value === void 0 ? void 0 : value.trim()));
|
|
879
894
|
customErrors.state = '';
|
|
880
895
|
if (!isValid) {
|
|
881
|
-
customErrors.state =
|
|
896
|
+
customErrors.state = localization.translate('The field is incomplete');
|
|
882
897
|
}
|
|
883
898
|
break;
|
|
884
899
|
}
|
|
@@ -889,7 +904,7 @@ const ZonosAddress = class {
|
|
|
889
904
|
});
|
|
890
905
|
customErrors.postalCode = '';
|
|
891
906
|
if (!isValid) {
|
|
892
|
-
customErrors.postalCode =
|
|
907
|
+
customErrors.postalCode = localization.translate('Your [zipLabel] is invalid', {
|
|
893
908
|
zipLabel: ((_e = this.countryField) === null || _e === void 0 ? void 0 : _e.zipLabel) || 'ZIP',
|
|
894
909
|
});
|
|
895
910
|
}
|
|
@@ -899,7 +914,7 @@ const ZonosAddress = class {
|
|
|
899
914
|
const isValid = !!(value === null || value === void 0 ? void 0 : value.trim());
|
|
900
915
|
customErrors.firstName = '';
|
|
901
916
|
if (!isValid) {
|
|
902
|
-
customErrors.firstName =
|
|
917
|
+
customErrors.firstName = localization.translate('Please provide your first name.');
|
|
903
918
|
}
|
|
904
919
|
break;
|
|
905
920
|
}
|
|
@@ -907,7 +922,7 @@ const ZonosAddress = class {
|
|
|
907
922
|
const isValid = !!(value === null || value === void 0 ? void 0 : value.trim());
|
|
908
923
|
customErrors.lastName = '';
|
|
909
924
|
if (!isValid) {
|
|
910
|
-
customErrors.lastName =
|
|
925
|
+
customErrors.lastName = localization.translate('Please provide your last name.');
|
|
911
926
|
}
|
|
912
927
|
break;
|
|
913
928
|
}
|
|
@@ -915,7 +930,7 @@ const ZonosAddress = class {
|
|
|
915
930
|
const isValid = !!(value === null || value === void 0 ? void 0 : value.trim());
|
|
916
931
|
customErrors.line1 = '';
|
|
917
932
|
if (!isValid) {
|
|
918
|
-
customErrors.line1 =
|
|
933
|
+
customErrors.line1 = localization.translate('The field is incomplete');
|
|
919
934
|
}
|
|
920
935
|
break;
|
|
921
936
|
}
|
|
@@ -925,17 +940,17 @@ const ZonosAddress = class {
|
|
|
925
940
|
const isValid = !!(value === null || value === void 0 ? void 0 : value.trim());
|
|
926
941
|
customErrors.phone = '';
|
|
927
942
|
if (!isValid) {
|
|
928
|
-
customErrors.phone =
|
|
943
|
+
customErrors.phone = localization.translate('Please provide a mobile phone number.');
|
|
929
944
|
}
|
|
930
945
|
}
|
|
931
946
|
else {
|
|
932
947
|
customErrors.phone = '';
|
|
933
948
|
// If the phone number is empty, set the error message
|
|
934
949
|
if (phoneValidateInfo.isEmpty) {
|
|
935
|
-
customErrors.phone =
|
|
950
|
+
customErrors.phone = localization.translate('Please provide a mobile phone number.');
|
|
936
951
|
}
|
|
937
952
|
else if (phoneValidateInfo.wrongFormat) {
|
|
938
|
-
customErrors.phone =
|
|
953
|
+
customErrors.phone = localization.translate('Your mobile phone number is incomplete.');
|
|
939
954
|
}
|
|
940
955
|
}
|
|
941
956
|
break;
|
|
@@ -948,6 +963,14 @@ const ZonosAddress = class {
|
|
|
948
963
|
cart.stripeStore.customBillingAddressErrors = customErrors;
|
|
949
964
|
}
|
|
950
965
|
};
|
|
966
|
+
this.onStoreCheckoutSessionIdChanged = () => {
|
|
967
|
+
const onCheckoutSessionIdChange = () => {
|
|
968
|
+
this.checkoutSessionId = localization.storageStore.checkoutSessionId;
|
|
969
|
+
};
|
|
970
|
+
// Trigger it once on init because onChange doesn't get triggered on initial load
|
|
971
|
+
onCheckoutSessionIdChange();
|
|
972
|
+
this.onStoreCheckoutSessionIdChangedSubscription = localization.storageStoreOnChange('checkoutSessionId', onCheckoutSessionIdChange);
|
|
973
|
+
};
|
|
951
974
|
this.type = undefined;
|
|
952
975
|
this.titleText = undefined;
|
|
953
976
|
this.defaultAddress = [];
|
|
@@ -978,7 +1001,7 @@ const ZonosAddress = class {
|
|
|
978
1001
|
this.lastNameError = '';
|
|
979
1002
|
this.isFirstInitialization = true;
|
|
980
1003
|
this.addressService = null;
|
|
981
|
-
this.checkoutSessionId =
|
|
1004
|
+
this.checkoutSessionId = localization.storageStore.checkoutSessionId;
|
|
982
1005
|
}
|
|
983
1006
|
getStripeAddressInstance() {
|
|
984
1007
|
if (this.type === 'billing') {
|
|
@@ -1007,7 +1030,7 @@ const ZonosAddress = class {
|
|
|
1007
1030
|
}
|
|
1008
1031
|
isAddressFilledChanged() {
|
|
1009
1032
|
// Sometimes address elements is loaded with prefilled data before checkout is loaded, need to not send the event if checkout session id is not available, and send the event after checkout is loaded
|
|
1010
|
-
if (!
|
|
1033
|
+
if (!localization.storageStore.checkoutSessionId) {
|
|
1011
1034
|
return;
|
|
1012
1035
|
}
|
|
1013
1036
|
// Only need to track the event if the shipping address is filled
|
|
@@ -1015,7 +1038,7 @@ const ZonosAddress = class {
|
|
|
1015
1038
|
!this.trackingSent &&
|
|
1016
1039
|
this.type === 'shipping') {
|
|
1017
1040
|
this.trackingSent = true;
|
|
1018
|
-
const checkoutSessionId =
|
|
1041
|
+
const checkoutSessionId = localization.storageStore.checkoutSessionId;
|
|
1019
1042
|
void cart.trackConversionEvent({
|
|
1020
1043
|
checkoutSessionId,
|
|
1021
1044
|
eventName: 'checkout_customerInfoFilled',
|
|
@@ -1086,7 +1109,7 @@ const ZonosAddress = class {
|
|
|
1086
1109
|
return null;
|
|
1087
1110
|
}
|
|
1088
1111
|
const taxIdInputInfo = TaxId.shipToTaxIdLabels[countryCode];
|
|
1089
|
-
return (index.h("div", { class: "zonos--tax-id-input" }, index.h("zonos-stripe-input", { error: this.taxIdErrorMessage, inputLabel:
|
|
1112
|
+
return (index.h("div", { class: "zonos--tax-id-input" }, index.h("zonos-stripe-input", { error: this.taxIdErrorMessage, inputLabel: localization.translate(taxIdInputInfo.friendlyName), inputPlaceholder: taxIdInputInfo.placeholder, inputValue: cart.stripeStore.taxId || '', isError: !!this.taxIdErrorMessage, onInputChange: (event) => {
|
|
1090
1113
|
cart.stripeStore.taxId = event.detail;
|
|
1091
1114
|
} })));
|
|
1092
1115
|
}
|
|
@@ -1100,7 +1123,7 @@ const ZonosAddress = class {
|
|
|
1100
1123
|
if (!isCompanyNameEnabled) {
|
|
1101
1124
|
return null;
|
|
1102
1125
|
}
|
|
1103
|
-
return (index.h("zonos-stripe-input", { class: "zonos--company-name-input", inputLabel:
|
|
1126
|
+
return (index.h("zonos-stripe-input", { class: "zonos--company-name-input", inputLabel: localization.translate('Company name (optional)'), inputValue: cart.stripeStore.companyName, onInputChange: (event) => {
|
|
1104
1127
|
cart.stripeStore.companyName = event.detail;
|
|
1105
1128
|
} }));
|
|
1106
1129
|
}
|
|
@@ -1117,7 +1140,7 @@ const ZonosAddress = class {
|
|
|
1117
1140
|
// Use data from Stripe address element if it's available (This may happen when user has already at shipping selection page but go back to customer page)
|
|
1118
1141
|
if (stripeAddressEventData) {
|
|
1119
1142
|
const countryCode = stripeAddressEventData.value.address.country ||
|
|
1120
|
-
|
|
1143
|
+
localization.localizationStore.selectedCountryCode ||
|
|
1121
1144
|
'US';
|
|
1122
1145
|
this.setFormValues({
|
|
1123
1146
|
city: stripeAddressEventData.value.address.city,
|
|
@@ -1137,7 +1160,7 @@ const ZonosAddress = class {
|
|
|
1137
1160
|
const firstDefaultAddress = this.defaultAddress[0];
|
|
1138
1161
|
if (firstDefaultAddress) {
|
|
1139
1162
|
const countryCode = firstDefaultAddress.address.country ||
|
|
1140
|
-
|
|
1163
|
+
localization.localizationStore.selectedCountryCode ||
|
|
1141
1164
|
'US';
|
|
1142
1165
|
this.setFormValues({
|
|
1143
1166
|
city: firstDefaultAddress.address.city,
|
|
@@ -1153,7 +1176,7 @@ const ZonosAddress = class {
|
|
|
1153
1176
|
this.initCountryField(countryCode);
|
|
1154
1177
|
return;
|
|
1155
1178
|
}
|
|
1156
|
-
const countryCode =
|
|
1179
|
+
const countryCode = localization.localizationStore.selectedCountryCode || 'US';
|
|
1157
1180
|
// Set default values
|
|
1158
1181
|
this.setFormValues({
|
|
1159
1182
|
city: '',
|
|
@@ -1368,7 +1391,7 @@ const ZonosAddress = class {
|
|
|
1368
1391
|
this.initDefaultCustomAddressForm();
|
|
1369
1392
|
}
|
|
1370
1393
|
shippingZonesChanged() {
|
|
1371
|
-
this.shippingZones =
|
|
1394
|
+
this.shippingZones = localization.localizationStore.shippingZoneCountries;
|
|
1372
1395
|
this.shipToCountries = Object.values(this.shippingZones || {})
|
|
1373
1396
|
.map(country => ({
|
|
1374
1397
|
label: country.displayName,
|
|
@@ -1394,7 +1417,7 @@ const ZonosAddress = class {
|
|
|
1394
1417
|
value: region.interpayCode,
|
|
1395
1418
|
}))
|
|
1396
1419
|
.sort((a, b) => a.label.localeCompare(b.label));
|
|
1397
|
-
return (index.h("div", { "aria-label": `${this.type} address form`, class: "zonos--custom-address-form", role: "form" }, index.h("zonos-stripe-input", { "aria-required": "true", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.firstName : undefined, inputLabel:
|
|
1420
|
+
return (index.h("div", { "aria-label": `${this.type} address form`, class: "zonos--custom-address-form", role: "form" }, index.h("zonos-stripe-input", { "aria-required": "true", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.firstName : undefined, inputLabel: localization.translate('First name'), inputValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName, onInputChange: (event) => {
|
|
1398
1421
|
this.validate({
|
|
1399
1422
|
type: this.type,
|
|
1400
1423
|
value: event.detail,
|
|
@@ -1408,7 +1431,7 @@ const ZonosAddress = class {
|
|
|
1408
1431
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
1409
1432
|
*/
|
|
1410
1433
|
this.firstName = event.detail;
|
|
1411
|
-
}, required: true }), index.h("zonos-stripe-input", { "aria-required": "true", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.lastName : undefined, inputLabel:
|
|
1434
|
+
}, required: true }), index.h("zonos-stripe-input", { "aria-required": "true", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.lastName : undefined, inputLabel: localization.translate('Last name'), inputValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName, onInputChange: (event) => {
|
|
1412
1435
|
this.validate({
|
|
1413
1436
|
type: this.type,
|
|
1414
1437
|
value: event.detail,
|
|
@@ -1427,9 +1450,9 @@ const ZonosAddress = class {
|
|
|
1427
1450
|
this.city = '';
|
|
1428
1451
|
this.state = '';
|
|
1429
1452
|
this.postalCode = '';
|
|
1430
|
-
}, options: this.shipToCountries || [], required: true, selectLabel:
|
|
1431
|
-
|
|
1432
|
-
(firstCountry === null || firstCountry === void 0 ? void 0 : firstCountry.value), title: `${this.type} country` }), index.h("div", { class: "zonos--custom-address-form-line1-wrapper" }, index.h("zonos-stripe-input", { "aria-autocomplete": "list", "aria-controls": "autocomplete-search", "aria-required": "true", autoComplete: "shipping address-line1", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.line1 : undefined, inputLabel:
|
|
1453
|
+
}, options: this.shipToCountries || [], required: true, selectLabel: localization.translate('Country'), selectedValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
|
|
1454
|
+
localization.localizationStore.selectedCountryCode ||
|
|
1455
|
+
(firstCountry === null || firstCountry === void 0 ? void 0 : firstCountry.value), title: `${this.type} country` }), index.h("div", { class: "zonos--custom-address-form-line1-wrapper" }, index.h("zonos-stripe-input", { "aria-autocomplete": "list", "aria-controls": "autocomplete-search", "aria-required": "true", autoComplete: "shipping address-line1", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.line1 : undefined, inputLabel: localization.translate('Address line 1'), inputValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.line1, name: "address-line1", onInputChange: (event) => {
|
|
1433
1456
|
this.validate({
|
|
1434
1457
|
type: this.type,
|
|
1435
1458
|
value: event.detail,
|
|
@@ -1460,9 +1483,9 @@ const ZonosAddress = class {
|
|
|
1460
1483
|
}, suggestions: this.addressSuggestions, type: this.type })), index.h("div", { "aria-label": "Additional address details", class: classes.classes([
|
|
1461
1484
|
'zonos--custom-address-form-additional-fields',
|
|
1462
1485
|
countryCode && this.isAddressLine1Entered ? 'zonos--show' : '',
|
|
1463
|
-
]), role: "group" }, index.h("zonos-stripe-input", { "aria-required": "false", autoComplete: "shipping address-line2", class: "zonos--custom-address-form-input", inputLabel:
|
|
1486
|
+
]), role: "group" }, index.h("zonos-stripe-input", { "aria-required": "false", autoComplete: "shipping address-line2", class: "zonos--custom-address-form-input", inputLabel: localization.translate(((_f = this.countryField) === null || _f === void 0 ? void 0 : _f.address2Label) || 'Address line 2'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.line2) || '', onInputChange: (event) => {
|
|
1464
1487
|
this.line2 = event.detail;
|
|
1465
|
-
} }), ((_g = this.countryField) === null || _g === void 0 ? void 0 : _g.cityShow) && (index.h("zonos-stripe-input", { "aria-required": ((_h = this.countryField) === null || _h === void 0 ? void 0 : _h.cityRequired) ? 'true' : 'false', autoComplete: "shipping address-level2", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.city : undefined, inputLabel:
|
|
1488
|
+
} }), ((_g = this.countryField) === null || _g === void 0 ? void 0 : _g.cityShow) && (index.h("zonos-stripe-input", { "aria-required": ((_h = this.countryField) === null || _h === void 0 ? void 0 : _h.cityRequired) ? 'true' : 'false', autoComplete: "shipping address-level2", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.city : undefined, inputLabel: localization.translate(((_j = this.countryField) === null || _j === void 0 ? void 0 : _j.cityLabel) || 'City'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.city) || '', name: "locality", onInputChange: (event) => {
|
|
1466
1489
|
this.validate({
|
|
1467
1490
|
type: this.type,
|
|
1468
1491
|
value: event.detail,
|
|
@@ -1490,9 +1513,9 @@ const ZonosAddress = class {
|
|
|
1490
1513
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
1491
1514
|
*/
|
|
1492
1515
|
this.state = event.detail;
|
|
1493
|
-
}, options: stateOptions, required: (_o = this.countryField) === null || _o === void 0 ? void 0 : _o.stateRequired, selectLabel:
|
|
1516
|
+
}, options: stateOptions, required: (_o = this.countryField) === null || _o === void 0 ? void 0 : _o.stateRequired, selectLabel: localization.translate(((_p = this.countryField) === null || _p === void 0 ? void 0 : _p.stateLabel) || 'State'), selectedValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.state, title: `${this.type} state` })), ((_q = this.countryField) === null || _q === void 0 ? void 0 : _q.zipShow) && (index.h("zonos-stripe-input", { "aria-describedby": ((_r = this.countryField) === null || _r === void 0 ? void 0 : _r.zipFormat)
|
|
1494
1517
|
? `zip-format-${this.type}`
|
|
1495
|
-
: undefined, "aria-required": ((_s = this.countryField) === null || _s === void 0 ? void 0 : _s.zipRequired) ? 'true' : 'false', autoComplete: "shipping postal-code", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.postalCode : undefined, inputLabel:
|
|
1518
|
+
: undefined, "aria-required": ((_s = this.countryField) === null || _s === void 0 ? void 0 : _s.zipRequired) ? 'true' : 'false', autoComplete: "shipping postal-code", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.postalCode : undefined, inputLabel: localization.translate(((_t = this.countryField) === null || _t === void 0 ? void 0 : _t.zipLabel) || 'Zip'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.postal_code) || '', onInputChange: (event) => {
|
|
1496
1519
|
this.validate({
|
|
1497
1520
|
type: this.type,
|
|
1498
1521
|
value: event.detail,
|
|
@@ -1506,7 +1529,7 @@ const ZonosAddress = class {
|
|
|
1506
1529
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
1507
1530
|
*/
|
|
1508
1531
|
this.postalCode = event.detail;
|
|
1509
|
-
}, required: (_u = this.countryField) === null || _u === void 0 ? void 0 : _u.zipRequired }))), index.h("zonos-stripe-phone-input", { autoComplete: "shipping tel", class: "zonos--custom-address-form-input", countryCode: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country, countryOptions: (_v = zonosStore.zonosStore.genericSettings) === null || _v === void 0 ? void 0 : _v.countryFields, error: showError ? customAddressErrors.phone : undefined, inputLabel:
|
|
1532
|
+
}, required: (_u = this.countryField) === null || _u === void 0 ? void 0 : _u.zipRequired }))), index.h("zonos-stripe-phone-input", { autoComplete: "shipping tel", class: "zonos--custom-address-form-input", countryCode: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country, countryOptions: (_v = zonosStore.zonosStore.genericSettings) === null || _v === void 0 ? void 0 : _v.countryFields, error: showError ? customAddressErrors.phone : undefined, inputLabel: localization.translate('Phone number'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone) || '', onInputValueChange: event => {
|
|
1510
1533
|
const { isEmpty, phoneNumber, valid, wrongFormat } = event.detail;
|
|
1511
1534
|
// Validate the phone number
|
|
1512
1535
|
this.validate({
|
|
@@ -1537,6 +1560,8 @@ const ZonosAddress = class {
|
|
|
1537
1560
|
// unsubscribe from address suggestions when this component is removed from the DOM
|
|
1538
1561
|
(_a = this.onAddressSuggestionsUnsubscribe) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
1539
1562
|
(_b = this.onAddressSelectedUnsubscribe) === null || _b === void 0 ? void 0 : _b.call(this);
|
|
1563
|
+
// cleanup checkout session id subscription
|
|
1564
|
+
this.onStoreCheckoutSessionIdChangedSubscription();
|
|
1540
1565
|
}
|
|
1541
1566
|
componentWillLoad() {
|
|
1542
1567
|
if (zonosStore.zonosStore.checkoutAddressService) {
|
|
@@ -1545,7 +1570,7 @@ const ZonosAddress = class {
|
|
|
1545
1570
|
}
|
|
1546
1571
|
componentDidLoad() {
|
|
1547
1572
|
const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
|
|
1548
|
-
this.shipToCountries = Object.values(
|
|
1573
|
+
this.shipToCountries = Object.values(localization.localizationStore.shippingZoneCountries || {})
|
|
1549
1574
|
.map(country => ({
|
|
1550
1575
|
label: country.displayName,
|
|
1551
1576
|
value: country.code,
|
|
@@ -1559,24 +1584,25 @@ const ZonosAddress = class {
|
|
|
1559
1584
|
// @Watch doesn't get trigger on initial load
|
|
1560
1585
|
this.initAddressSuggestions();
|
|
1561
1586
|
this.isFirstInitialization = false;
|
|
1587
|
+
// subscribe to checkout session id changes from storage store
|
|
1588
|
+
this.onStoreCheckoutSessionIdChanged();
|
|
1562
1589
|
}
|
|
1563
1590
|
render() {
|
|
1564
1591
|
var _a;
|
|
1565
|
-
this.shippingZones =
|
|
1592
|
+
this.shippingZones = localization.localizationStore.shippingZoneCountries;
|
|
1566
1593
|
this.addressService = zonosStore.zonosStore.checkoutAddressService;
|
|
1567
|
-
this.checkoutSessionId = cart.cartStore.checkoutSessionId;
|
|
1568
1594
|
if ((_a = cart.stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.complete) {
|
|
1569
1595
|
this.isAddressFilled = true;
|
|
1570
1596
|
}
|
|
1571
1597
|
// Only set country if custom address form is enabled
|
|
1572
|
-
if (!this.country &&
|
|
1573
|
-
this.country =
|
|
1598
|
+
if (!this.country && localization.localizationStore.selectedCountryCode) {
|
|
1599
|
+
this.country = localization.localizationStore.selectedCountryCode;
|
|
1574
1600
|
}
|
|
1575
1601
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
1576
|
-
return (index.h(index.Host, { key: '
|
|
1602
|
+
return (index.h(index.Host, { key: '7a766af62acc47886e716ac3c52c1457eae04545', class: classes.classes([
|
|
1577
1603
|
'zonos--address zonos--elements',
|
|
1578
1604
|
`zonos--${this.type}-address`,
|
|
1579
|
-
]) }, index.h("zonos-text", { key: '
|
|
1605
|
+
]) }, index.h("zonos-text", { key: '224a78f8d1e02e2b0d7c95eafe9a1d4354fb5f73', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderCustomAddressForm()));
|
|
1580
1606
|
}
|
|
1581
1607
|
get el() { return index.getElement(this); }
|
|
1582
1608
|
static get watchers() { return {
|
|
@@ -1791,7 +1817,7 @@ const ZonosLinkAuthentication = class {
|
|
|
1791
1817
|
const renderEmailAddress = () => {
|
|
1792
1818
|
var _a;
|
|
1793
1819
|
if (cart.cartStore.isStagingMode) {
|
|
1794
|
-
return (index.h("zonos-stripe-input", { inputLabel:
|
|
1820
|
+
return (index.h("zonos-stripe-input", { inputLabel: localization.translate('Email'), inputValue: this.defaultEmail ||
|
|
1795
1821
|
((_a = cart.stripeStore.stripeLinkEventData) === null || _a === void 0 ? void 0 : _a.value.email) ||
|
|
1796
1822
|
'', isError: this.isEmailError, onBlur: () => {
|
|
1797
1823
|
var _a;
|
|
@@ -1809,7 +1835,7 @@ const ZonosLinkAuthentication = class {
|
|
|
1809
1835
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
1810
1836
|
return (index.h(index.Host, { class: "zonos--link-authentication zonos--elements", style: {
|
|
1811
1837
|
'--zonos--border-radius': getBorderRadius.getBorderRadius(),
|
|
1812
|
-
} }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, this.titleText), renderEmailAddress(), this.isEmailError && (index.h("zonos-text", { textColor: "red-600" },
|
|
1838
|
+
} }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, this.titleText), renderEmailAddress(), this.isEmailError && (index.h("zonos-text", { textColor: "red-600" }, localization.translate('Please enter a valid email address.')))));
|
|
1813
1839
|
}
|
|
1814
1840
|
get el() { return index.getElement(this); }
|
|
1815
1841
|
static get watchers() { return {
|
|
@@ -7840,24 +7866,24 @@ const ZonosStripePhoneInput = class {
|
|
|
7840
7866
|
.filter(Boolean)
|
|
7841
7867
|
.sort((a, b) => a.displayName.localeCompare(b.displayName))
|
|
7842
7868
|
: [];
|
|
7843
|
-
return (index.h(index.Host, { key: '
|
|
7869
|
+
return (index.h(index.Host, { key: '0d4501947787cbafe38acb60fb5ee7519b6d1c73', class: classes.classes([
|
|
7844
7870
|
'zonos--phone-input zonos--elements',
|
|
7845
7871
|
isDark && 'dark',
|
|
7846
|
-
]), "data-theme": isDark ? 'DARK' : 'LIGHT', style: Object.assign({ '--zonos--border-radius': getBorderRadius.getBorderRadius(), '--zonos--font-family': zonosStore.zonosStoreFontFamily(), '--zonos--font-size': `${fontSize}px`, '--zonos--primary-color': secondaryColor }, (this.minWidth ? { '--zonos--min-width': this.minWidth } : {})) }, index.h("div", { key: '
|
|
7872
|
+
]), "data-theme": isDark ? 'DARK' : 'LIGHT', style: Object.assign({ '--zonos--border-radius': getBorderRadius.getBorderRadius(), '--zonos--font-family': zonosStore.zonosStoreFontFamily(), '--zonos--font-size': `${fontSize}px`, '--zonos--primary-color': secondaryColor }, (this.minWidth ? { '--zonos--min-width': this.minWidth } : {})) }, index.h("div", { key: 'c3e0f9655a39a5bb3d838634754be2af60a24a10', class: classes.classes([
|
|
7847
7873
|
'zonos--label-wrapper',
|
|
7848
7874
|
this.disabled && 'disabled',
|
|
7849
7875
|
this.isFocused && 'focused',
|
|
7850
7876
|
hasContent && 'has-content',
|
|
7851
7877
|
this.error && 'has-error',
|
|
7852
7878
|
this.inputLabel && 'has-label',
|
|
7853
|
-
]) }, index.h("select", { key: '
|
|
7879
|
+
]) }, index.h("select", { key: '1a58471117f6748d511498e016814bd907e8775f', class: "zonos--select", disabled: this.disabled, onBlur: this.handleBlur, onChange: this.handleCountryChange, onFocus: this.handleFocus }, countryOptionsList.map(option => {
|
|
7854
7880
|
var _a;
|
|
7855
7881
|
return (index.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, ")"));
|
|
7856
|
-
})), index.h("div", { key: '
|
|
7882
|
+
})), index.h("div", { key: '9c785521e095aae0cfc8af3ea90e4924c97202ac', class: "zonos--input-group" }, index.h("div", { key: 'b7fdd9db255ce33f3b6d3a982162c8286963324c', class: "zonos--select-wrapper" }, index.h("div", { key: '5d378436580df53793b1508af5e34bd43ba33ddf', class: "zonos--country-select" }, index.h("div", { key: '94628459db88e355b1c62b74cfcb48ec03022d4e', class: "zonos--country-select-content" }, this.selectedCountry && (index.h("div", { key: '96b332ed9c62413887f96f38ce26cb05b81a3132', class: "zonos--country-select-selected" }, index.h("div", { key: 'b9e5bda55328f57e15afd349789233e3c28d2bf9', class: "zonos--country-flag-wrapper" }, index.h("zonos-country-flag", { key: 'fc595df21c09553dc8ffb7fe79c3043831e65298', class: "zonos--country-flag", countryCode: this.selectedCountry.countryCode })), index.h("div", { key: '6c792c383acf3ccac02be6b954a7eb18bcdda817', class: "zonos--country-code" }, "+", this.selectedCountry.phoneCode))), index.h("div", { key: '970b9f6e18152e04375a248669fd7314088bcd2e', class: "zonos--select-chevron-wrapper" }, index.h("zonos-icon", { key: '1da5919014eee0e34b60d1df08e83d44ad20d5c2', "aria-label": "Expand collapsed section", class: "zonos--select-chevron", content: ChevronDownIcon$1, iconColor: "gray-800" }))))), index.h("div", { key: '7f0c215ddfb59c8e3c4413e44941a477a8adc6d6', class: classes.classes([
|
|
7857
7883
|
'zonos--input-container',
|
|
7858
7884
|
this.inputLabel && 'has-label',
|
|
7859
7885
|
hasContent && 'has-content',
|
|
7860
|
-
]) }, index.h("input", Object.assign({ key: '
|
|
7886
|
+
]) }, index.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 && (index.h("div", { key: 'a108f2796571f9d8a4201d1906b2381b89d14bc2', class: "zonos--floated-label" }, index.h("label", { key: '50d308311270bbd8635bb7848495ee4aaa2a0cac', htmlFor: this.inputId }, this.inputLabel || localization.translate('Phone number'))))))), this.error && (index.h("zonos-text", { key: '27b0233f9241ce68348b2efd1c1b525d083363e5', textColor: "red-600" }, this.error))));
|
|
7861
7887
|
}
|
|
7862
7888
|
get el() { return index.getElement(this); }
|
|
7863
7889
|
static get watchers() { return {
|
|
@@ -7948,14 +7974,14 @@ const ZonosStripeSelect = class {
|
|
|
7948
7974
|
const fontSize = zonosStore.zonosStore.appearance.fontSizeInputValue || 16;
|
|
7949
7975
|
const hasContent = this.internalValue || this.selectPlaceholder;
|
|
7950
7976
|
const showClearButton = this.isClearable && this.internalValue && !this.isDisabled;
|
|
7951
|
-
return (index.h(index.Host, { key: '
|
|
7977
|
+
return (index.h(index.Host, { key: '18d7ba03b9136af8614874b13b9ac3ce85f7c0d0', class: classes.classes([
|
|
7952
7978
|
'zonos--select zonos--elements',
|
|
7953
7979
|
isDark && 'dark',
|
|
7954
7980
|
this.isError && 'has-error',
|
|
7955
|
-
]), "data-theme": isDark ? 'DARK' : 'LIGHT', style: Object.assign({ '--zonos--border-radius': getBorderRadius.getBorderRadius(), '--zonos--font-family': zonosStore.zonosStoreFontFamily(), '--zonos--font-size': `${fontSize}px`, '--zonos--primary-color': secondaryColor }, (this.minWidth ? { '--zonos--min-width': this.minWidth } : {})) }, index.h("div", { key: '
|
|
7981
|
+
]), "data-theme": isDark ? 'DARK' : 'LIGHT', style: Object.assign({ '--zonos--border-radius': getBorderRadius.getBorderRadius(), '--zonos--font-family': zonosStore.zonosStoreFontFamily(), '--zonos--font-size': `${fontSize}px`, '--zonos--primary-color': secondaryColor }, (this.minWidth ? { '--zonos--min-width': this.minWidth } : {})) }, index.h("div", { key: '88b8d885c11bc0776bd0c25b5f0a08f91cfb7c72', class: classes.classes([
|
|
7956
7982
|
'zonos--label-wrapper',
|
|
7957
7983
|
this.isDisabled && 'disabled',
|
|
7958
|
-
]) }, index.h("select", Object.assign({ key: '
|
|
7984
|
+
]) }, index.h("select", Object.assign({ key: 'd972a6a7b91bb51f2d5ed291a686d521c1bf82a3' }, this.inheritedAttributes, { autoComplete: this.autoComplete, class: classes.classes([
|
|
7959
7985
|
'zonos--floated-select',
|
|
7960
7986
|
!!this.selectLabel && 'has-label',
|
|
7961
7987
|
hasContent && 'has-content',
|
|
@@ -7965,9 +7991,9 @@ const ZonosStripeSelect = class {
|
|
|
7965
7991
|
this.selectChange.emit(select.value);
|
|
7966
7992
|
this.selectedValue = select.value;
|
|
7967
7993
|
this.el.dispatchEvent(new Event('change'));
|
|
7968
|
-
}, required: this.required }), index.h("option", { key: '
|
|
7994
|
+
}, required: this.required }), index.h("option", { key: 'b67730b2c3e77ba60221320519f55e67d7d2b127', disabled: true, selected: !this.internalValue, value: "" }, this.selectPlaceholder || localization.translate('Select')), this.internalOptions.map(option => (index.h("option", { key: option.value, selected: this.internalValue === option.value ||
|
|
7969
7995
|
// Sometimes google returns the label not the code for some countries
|
|
7970
|
-
this.internalValue === option.label, value: option.value }, option.label)))), index.h("div", { key: '
|
|
7996
|
+
this.internalValue === option.label, value: option.value }, option.label)))), index.h("div", { key: '088c104006e983b5ec1680067af32c0479dde13b', class: "zonos--floated-label" }, index.h("label", { key: 'faf3bf337253d205265b181d65d8f8024ffd6124', htmlFor: this.selectId }, this.selectLabel)), index.h("div", { key: '7ce8d36b84b08df139877cd2e12a26b8157ce83b', class: "zonos--actions-wrapper" }, showClearButton && (index.h("button", { key: 'b0a1af08afd9792ba4e7989361219c5cf7d5d8bc', "aria-label": "Clear selection", class: "zonos--clear-button", onClick: this.handleClear, tabIndex: 0, type: "button" }, index.h("zonos-icon", { key: '50ae86d5e9d9722b5546997f9fd52a997cac3add', class: "zonos--clear-icon", content: RemoveLineIcon, iconColor: "gray-1200" }))), index.h("zonos-icon", { key: '30034030f97f7ed6b3027cbc5220c73cde4bbbc2', "aria-label": "Expand collapsed section", class: "zonos--select-chevron", content: ChevronDownIcon, iconColor: "gray-800" }))), this.error && (index.h("zonos-text", { key: 'cd02da8b1a1cb81581ac7285af84193000692eaa', textColor: "red-600" }, this.error))));
|
|
7971
7997
|
}
|
|
7972
7998
|
get el() { return index.getElement(this); }
|
|
7973
7999
|
static get watchers() { return {
|