@zonos/elements 1.3.281 → 1.3.283
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/{cart-3313cb0c.js → cart-a1c00090.js} +2 -1
- package/dist/cjs/{collect-2659c5af.js → collect-e61eafca.js} +2 -2
- package/dist/cjs/getMissingRequiredShippingFields-a6c4f625.js +50 -0
- package/dist/cjs/{hasInclusivePrice-d132daaa.js → hasInclusivePrice-e7b57e02.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{invoice-26f52c07.js → invoice-ead45797.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{localization-6189080f.js → localization-783849c8.js} +242 -0
- package/dist/cjs/{paypal-f6a256b5.js → paypal-e1548f40.js} +2 -2
- package/dist/cjs/{placeTestOrder-695f2b32.js → placeTestOrder-d99b1fe2.js} +2 -2
- package/dist/cjs/{renderCheckoutCurrency-fe56094f.js → renderCheckoutCurrency-c942fcba.js} +2 -2
- package/dist/cjs/{zonos-address-display_8.cjs.entry.js → zonos-address-completion-dialog_7.cjs.entry.js} +225 -192
- package/dist/cjs/zonos-address-display_2.cjs.entry.js +157 -0
- package/dist/cjs/zonos-address_4.cjs.entry.js +73 -12
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +3 -3
- package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
- package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card_5.cjs.entry.js +9 -9
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +89 -20
- package/dist/cjs/zonos-checkbox_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
- package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +6 -6
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +19 -19
- package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
- package/dist/cjs/zonos-component.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +3 -3
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +10 -10
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +6 -6
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-input.cjs.entry.js +4 -4
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +8 -8
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +14 -14
- package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -5
- package/dist/cjs/zonos-link.cjs.entry.js +1 -1
- package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
- package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +3 -3
- package/dist/cjs/zonos-stripe-input.cjs.entry.js +4 -4
- package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
- package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-completion-dialog/zonos-address-completion-dialog.css +105 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-completion-dialog/zonos-address-completion-dialog.js +341 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.js +11 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +5 -5
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +3 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +4 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +52 -2
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.js +1 -1
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +2 -2
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.js +3 -3
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.js +3 -3
- package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.js +5 -5
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.js +2 -2
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.js +2 -2
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.js +3 -3
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.js +3 -3
- package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.js +2 -2
- package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
- package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
- package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
- package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
- package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
- package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +3 -3
- package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
- package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.js +2 -2
- package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
- package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
- package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
- package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +1 -1
- 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-skeleton/zonos-skeleton.js +1 -1
- 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 +17 -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 +1 -1
- package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
- package/dist/collection/components/store/checkout/stripe.js +1 -1
- package/dist/collection/components/store/hello/localization.js +2 -0
- package/dist/collection/components/store/translationStore/strings.arabic.js +12 -0
- package/dist/collection/components/store/translationStore/strings.base.js +12 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +12 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +12 -0
- package/dist/collection/components/store/translationStore/strings.french.js +12 -0
- package/dist/collection/components/store/translationStore/strings.german.js +12 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +12 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +12 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +12 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +12 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +12 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +12 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +12 -0
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +11 -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 +52 -48
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
- package/dist/collection/components/utils/checkout/applyAddressCompletion.js +23 -0
- package/dist/collection/components/utils/checkout/buildAddressContacts.js +57 -0
- package/dist/collection/components/utils/checkout/getAddressCountryOptions.js +23 -0
- package/dist/collection/components/utils/checkout/getMissingRequiredShippingFields.js +44 -0
- package/dist/esm/{cart-c66ec17e.js → cart-93c36159.js} +2 -2
- package/dist/esm/{collect-915fd59d.js → collect-42d4757a.js} +2 -2
- package/dist/esm/getMissingRequiredShippingFields-ebdccdcf.js +47 -0
- package/dist/esm/{hasInclusivePrice-6fd935f3.js → hasInclusivePrice-4c12548f.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{invoice-2a17c93c.js → invoice-71471339.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{localization-6d36209f.js → localization-754e7e8b.js} +242 -0
- package/dist/esm/{paypal-cae1d404.js → paypal-b1410e02.js} +2 -2
- package/dist/esm/{placeTestOrder-955269d2.js → placeTestOrder-4267cafd.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-951386a5.js → renderCheckoutCurrency-9a81e41c.js} +2 -2
- package/dist/esm/{zonos-address-display_8.entry.js → zonos-address-completion-dialog_7.entry.js} +226 -192
- package/dist/esm/zonos-address-display_2.entry.js +152 -0
- package/dist/esm/zonos-address_4.entry.js +73 -12
- package/dist/esm/zonos-airwallex-payment.entry.js +3 -3
- package/dist/esm/zonos-badge.entry.js +3 -3
- package/dist/esm/zonos-button_3.entry.js +3 -3
- package/dist/esm/zonos-card_5.entry.js +9 -9
- package/dist/esm/zonos-cart-items_12.entry.js +90 -21
- package/dist/esm/zonos-checkbox_2.entry.js +5 -5
- package/dist/esm/zonos-checkout.entry.js +3 -3
- package/dist/esm/zonos-collapse.entry.js +2 -2
- package/dist/esm/zonos-collect-cart-items_3.entry.js +6 -6
- package/dist/esm/zonos-collect-finish_6.entry.js +19 -19
- package/dist/esm/zonos-collect.entry.js +4 -4
- package/dist/esm/zonos-component.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +3 -3
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +10 -10
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +6 -6
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-input.entry.js +4 -4
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +8 -8
- package/dist/esm/zonos-invoice-finish_5.entry.js +14 -14
- package/dist/esm/zonos-invoice.entry.js +4 -4
- package/dist/esm/zonos-language-select_2.entry.js +5 -5
- package/dist/esm/zonos-link.entry.js +1 -1
- package/dist/esm/zonos-logo.entry.js +2 -2
- package/dist/esm/zonos-policy-consent_2.entry.js +3 -3
- package/dist/esm/zonos-stripe-input.entry.js +4 -4
- package/dist/esm/zonos-tooltip.entry.js +2 -2
- package/dist/esm/zonos-v-stack.entry.js +2 -2
- package/dist/esm-es5/{cart-c66ec17e.js → cart-93c36159.js} +1 -1
- package/dist/esm-es5/{collect-915fd59d.js → collect-42d4757a.js} +1 -1
- package/dist/esm-es5/getMissingRequiredShippingFields-ebdccdcf.js +1 -0
- package/dist/esm-es5/{hasInclusivePrice-6fd935f3.js → hasInclusivePrice-4c12548f.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{invoice-2a17c93c.js → invoice-71471339.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/localization-754e7e8b.js +1 -0
- package/dist/esm-es5/{paypal-cae1d404.js → paypal-b1410e02.js} +1 -1
- package/dist/esm-es5/{placeTestOrder-955269d2.js → placeTestOrder-4267cafd.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-951386a5.js → renderCheckoutCurrency-9a81e41c.js} +1 -1
- package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +1 -0
- package/dist/esm-es5/zonos-address-display_2.entry.js +1 -0
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-badge.entry.js +1 -1
- package/dist/esm-es5/zonos-button_3.entry.js +1 -1
- package/dist/esm-es5/zonos-card_5.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-collapse.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-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-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-invoice-cart-items_2.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
- package/dist/esm-es5/zonos-invoice.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-link.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
- package/dist/esm-es5/zonos-stripe-input.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/scripts/index.d.ts +123 -0
- 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-address-completion-dialog/zonos-address-completion-dialog.d.ts +75 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +16 -0
- package/dist/types/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.d.ts +1 -0
- package/dist/types/components/store/checkout/stripe.d.ts +4 -0
- package/dist/types/components/store/hello/localization.d.ts +7 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +12 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +12 -0
- package/dist/types/components/stripe/zonos-custom-address/zonos-custom-address.d.ts +9 -13
- package/dist/types/components/utils/checkout/applyAddressCompletion.d.ts +25 -0
- package/dist/types/components/utils/checkout/buildAddressContacts.d.ts +21 -0
- package/dist/types/components/utils/checkout/getAddressCountryOptions.d.ts +29 -0
- package/dist/types/components/utils/checkout/getMissingRequiredShippingFields.d.ts +35 -0
- package/dist/types/components.d.ts +97 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-09da3c76.entry.js → p-007ff76a.entry.js} +1 -1
- package/dist/zonos-elements/{p-5aee5de5.system.entry.js → p-05cb0a0d.system.entry.js} +1 -1
- package/dist/zonos-elements/p-065f3f66.system.entry.js +1 -0
- package/dist/zonos-elements/p-07c21940.entry.js +1 -0
- package/dist/zonos-elements/p-0d183f19.system.js +1 -0
- package/dist/zonos-elements/p-1180a97c.system.entry.js +1 -0
- package/dist/zonos-elements/p-19bbf4b3.js +1 -0
- package/dist/zonos-elements/{p-ee3c7b11.system.entry.js → p-1af510ea.system.entry.js} +1 -1
- package/dist/zonos-elements/p-1cff471a.system.entry.js +1 -0
- package/dist/zonos-elements/{p-0ad6a92b.system.entry.js → p-21489ff1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-734d646b.entry.js → p-21f7d57b.entry.js} +1 -1
- package/dist/zonos-elements/p-22f7120a.system.js +1 -0
- package/dist/zonos-elements/{p-b5f67807.entry.js → p-26bf0c31.entry.js} +1 -1
- package/dist/zonos-elements/p-2837bfd2.js +1 -0
- package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
- package/dist/zonos-elements/{p-86d6961c.system.entry.js → p-29ca1415.system.entry.js} +1 -1
- package/dist/zonos-elements/p-2aebcfa8.system.entry.js +1 -0
- package/dist/zonos-elements/{p-8c54aaec.entry.js → p-32b53999.entry.js} +1 -1
- package/dist/zonos-elements/{p-c15476a1.system.entry.js → p-333f6018.system.entry.js} +1 -1
- package/dist/zonos-elements/p-33dd7dab.entry.js +1 -0
- package/dist/zonos-elements/{p-060c521b.system.entry.js → p-342b062d.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a5f8dc19.js → p-38881097.js} +1 -1
- package/dist/zonos-elements/{p-38879af9.entry.js → p-39399f67.entry.js} +1 -1
- package/dist/zonos-elements/{p-683ec0bf.entry.js → p-3d902845.entry.js} +1 -1
- package/dist/zonos-elements/{p-a6773627.entry.js → p-3dcb3794.entry.js} +1 -1
- package/dist/zonos-elements/p-4a5fa892.system.entry.js +1 -0
- package/dist/zonos-elements/{p-a34269b1.system.entry.js → p-4a73906a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5677d31f.entry.js → p-4b9c7803.entry.js} +1 -1
- package/dist/zonos-elements/{p-54a8d4cf.system.entry.js → p-4dba0e9b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1992fd91.entry.js → p-55c5977b.entry.js} +1 -1
- package/dist/zonos-elements/{p-179caaea.system.entry.js → p-58da55e6.system.entry.js} +1 -1
- package/dist/zonos-elements/p-59824ac6.entry.js +1 -0
- package/dist/zonos-elements/{p-f156e2e5.system.entry.js → p-59e4e0b6.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a44591f6.system.entry.js → p-5a37683b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-36b311f9.system.entry.js → p-5b11bbca.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-717cbe90.system.js → p-5fceef56.system.js} +1 -1
- package/dist/zonos-elements/{p-8005e102.system.js → p-602de72d.system.js} +1 -1
- package/dist/zonos-elements/{p-39695a8b.system.js → p-6325ee77.system.js} +1 -1
- package/dist/zonos-elements/p-67251274.system.js +1 -0
- package/dist/zonos-elements/{p-4441c451.entry.js → p-69871ab6.entry.js} +1 -1
- package/dist/zonos-elements/p-6be4c473.entry.js +1 -0
- package/dist/zonos-elements/p-72280783.system.js +1 -0
- package/dist/zonos-elements/{p-746bdebe.entry.js → p-73d1a554.entry.js} +1 -1
- package/dist/zonos-elements/{p-e0ec0aa3.system.entry.js → p-76a75da9.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-26ca8ce7.js → p-76cdf517.js} +1 -1
- package/dist/zonos-elements/{p-a3d3ce5d.system.entry.js → p-781b3345.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1577a739.js → p-8eaf1316.js} +1 -1
- package/dist/zonos-elements/{p-99e8743e.system.entry.js → p-8fa3a8f8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b406bb39.entry.js → p-944282af.entry.js} +1 -1
- package/dist/zonos-elements/{p-3e6bbf0b.system.entry.js → p-97f15546.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-727387ed.entry.js → p-9ceb3d1c.entry.js} +1 -1
- package/dist/zonos-elements/{p-3246d120.js → p-a2fe995b.js} +1 -1
- package/dist/zonos-elements/{p-4c3f5fda.system.entry.js → p-aa7589de.system.entry.js} +1 -1
- package/dist/zonos-elements/p-b0482924.entry.js +1 -0
- package/dist/zonos-elements/{p-ddf68916.system.js → p-b567448d.system.js} +1 -1
- package/dist/zonos-elements/{p-edf613ea.entry.js → p-b7a03b08.entry.js} +1 -1
- package/dist/zonos-elements/{p-15097876.system.entry.js → p-b93013f7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3f6fe80a.system.entry.js → p-c43130a7.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c515bc23.system.js +1 -0
- package/dist/zonos-elements/{p-732e7373.system.entry.js → p-c634546a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6df6cb8a.entry.js → p-c8a48cce.entry.js} +1 -1
- package/dist/zonos-elements/{p-3e058b4e.entry.js → p-cb376f03.entry.js} +1 -1
- package/dist/zonos-elements/{p-8308f7d6.system.entry.js → p-cc35d5f8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f314217a.system.js → p-cd5638b2.system.js} +2 -2
- package/dist/zonos-elements/{p-56fc3210.js → p-d68425ad.js} +1 -1
- package/dist/zonos-elements/{p-03fda4a8.entry.js → p-d74eda59.entry.js} +1 -1
- package/dist/zonos-elements/{p-30067eed.entry.js → p-d93f4837.entry.js} +1 -1
- package/dist/zonos-elements/{p-e7a45f6c.entry.js → p-dcf8ab79.entry.js} +1 -1
- package/dist/zonos-elements/{p-4efd7178.entry.js → p-e0cbc7c7.entry.js} +1 -1
- package/dist/zonos-elements/{p-40b96482.system.entry.js → p-e2057ab0.system.entry.js} +1 -1
- package/dist/zonos-elements/p-e2b8936a.js +1 -0
- package/dist/zonos-elements/{p-dd6da3de.entry.js → p-e3d0d8ff.entry.js} +1 -1
- package/dist/zonos-elements/{p-5a61c301.system.entry.js → p-e8159288.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5e1aad7d.entry.js → p-e8bb4f3b.entry.js} +1 -1
- package/dist/zonos-elements/{p-a23d3b3f.system.entry.js → p-e99654c1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5d4201d5.entry.js → p-ef2c264c.entry.js} +1 -1
- package/dist/zonos-elements/{p-429ab545.system.entry.js → p-f1dbeb85.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2825431d.entry.js → p-f2431e47.entry.js} +1 -1
- package/dist/zonos-elements/{p-29c1703c.system.entry.js → p-f2511b86.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-156891c5.js → p-f9f3155b.js} +1 -1
- package/dist/zonos-elements/{p-08e78d79.entry.js → p-fa80a973.entry.js} +1 -1
- package/dist/zonos-elements/{p-f59514e9.entry.js → p-fc45b3a5.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/localization-6d36209f.js +0 -1
- package/dist/esm-es5/zonos-address-display_8.entry.js +0 -1
- package/dist/zonos-elements/p-0ac1aa87.system.js +0 -1
- package/dist/zonos-elements/p-1ee5f392.entry.js +0 -1
- package/dist/zonos-elements/p-6df034d6.entry.js +0 -1
- package/dist/zonos-elements/p-71cb16da.system.entry.js +0 -1
- package/dist/zonos-elements/p-8051403a.js +0 -1
- package/dist/zonos-elements/p-9448d960.js +0 -1
- package/dist/zonos-elements/p-a6535773.system.entry.js +0 -1
- package/dist/zonos-elements/p-ae30e6c0.system.entry.js +0 -1
- package/dist/zonos-elements/p-bf942ef0.system.js +0 -1
- package/dist/zonos-elements/p-c345d1f5.system.js +0 -1
- package/dist/zonos-elements/p-d4337686.entry.js +0 -1
- package/dist/zonos-elements/p-df8b8827.entry.js +0 -1
- package/dist/zonos-elements/p-e210edd9.system.js +0 -1
- package/dist/zonos-elements/p-f3e1a6a7.system.entry.js +0 -1
|
@@ -119,6 +119,9 @@ export const stringsTurkish = {
|
|
|
119
119
|
'Company name (optional)': {
|
|
120
120
|
value: 'Şirket adı (isteğe bağlı)',
|
|
121
121
|
},
|
|
122
|
+
'Complete your shipping address': {
|
|
123
|
+
value: 'Teslimat adresinizi tamamlayın',
|
|
124
|
+
},
|
|
122
125
|
Confirm: {
|
|
123
126
|
value: 'Onayla',
|
|
124
127
|
},
|
|
@@ -536,6 +539,9 @@ export const stringsTurkish = {
|
|
|
536
539
|
'Return to merchant site': {
|
|
537
540
|
value: 'Satıcı sitesine dön',
|
|
538
541
|
},
|
|
542
|
+
'Save and continue': {
|
|
543
|
+
value: 'Kaydet ve devam et',
|
|
544
|
+
},
|
|
539
545
|
'Search countries': {
|
|
540
546
|
value: 'Ülkeleri ara',
|
|
541
547
|
},
|
|
@@ -554,6 +560,9 @@ export const stringsTurkish = {
|
|
|
554
560
|
'Select a language': {
|
|
555
561
|
value: 'Bir dil seçin',
|
|
556
562
|
},
|
|
563
|
+
'Selected address': {
|
|
564
|
+
value: 'Seçilen adres',
|
|
565
|
+
},
|
|
557
566
|
'Session does not have valid landed cost. Please contact [organizationName] for assistance.': {
|
|
558
567
|
value: 'Oturumun geçerli bir iniş maliyeti yok. Yardım için lütfen [organizationName] ile iletişime geçin.',
|
|
559
568
|
},
|
|
@@ -698,6 +707,9 @@ export const stringsTurkish = {
|
|
|
698
707
|
"There's been an error updating your checkout session. Please reload and try again or contact support if the error persists": {
|
|
699
708
|
value: 'Ödeme oturumunuzu güncelleme sırasında bir hata oluştu. Lütfen hata devam ederse sayfayı yeniden yükleyin ve tekrar deneyin veya destekle iletişime geçin',
|
|
700
709
|
},
|
|
710
|
+
'This saved address is missing information required to ship internationally. Please add the details below.': {
|
|
711
|
+
value: 'Bu kayıtlı adreste uluslararası gönderim için gerekli bilgiler eksik. Lütfen ayrıntıları aşağıya ekleyin.',
|
|
712
|
+
},
|
|
701
713
|
'To ensure delivery all address details must be in Latin characters.': {
|
|
702
714
|
value: 'Teslimatı sağlamak için tüm adres detaylarının Latin karakterleriyle olması gerekir.',
|
|
703
715
|
},
|
|
@@ -119,6 +119,9 @@ export const stringsVietnamese = {
|
|
|
119
119
|
'Company name (optional)': {
|
|
120
120
|
value: 'Tên công ty (tùy chọn)',
|
|
121
121
|
},
|
|
122
|
+
'Complete your shipping address': {
|
|
123
|
+
value: 'Hoàn tất địa chỉ giao hàng của bạn',
|
|
124
|
+
},
|
|
122
125
|
Confirm: {
|
|
123
126
|
value: 'Xác nhận',
|
|
124
127
|
},
|
|
@@ -536,6 +539,9 @@ export const stringsVietnamese = {
|
|
|
536
539
|
'Return to merchant site': {
|
|
537
540
|
value: 'Quay lại trang web của người bán',
|
|
538
541
|
},
|
|
542
|
+
'Save and continue': {
|
|
543
|
+
value: 'Lưu và tiếp tục',
|
|
544
|
+
},
|
|
539
545
|
'Search countries': {
|
|
540
546
|
value: 'Tìm kiếm quốc gia',
|
|
541
547
|
},
|
|
@@ -554,6 +560,9 @@ export const stringsVietnamese = {
|
|
|
554
560
|
'Select a language': {
|
|
555
561
|
value: 'Chọn một ngôn ngữ',
|
|
556
562
|
},
|
|
563
|
+
'Selected address': {
|
|
564
|
+
value: 'Địa chỉ đã chọn',
|
|
565
|
+
},
|
|
557
566
|
'Session does not have valid landed cost. Please contact [organizationName] for assistance.': {
|
|
558
567
|
value: 'Phiên không có chi phí hạ cánh hợp lệ. Vui lòng liên hệ [organizationName] để được hỗ trợ.',
|
|
559
568
|
},
|
|
@@ -698,6 +707,9 @@ export const stringsVietnamese = {
|
|
|
698
707
|
"There's been an error updating your checkout session. Please reload and try again or contact support if the error persists": {
|
|
699
708
|
value: 'Đã xảy ra lỗi khi cập nhật phiên thanh toán của bạn. Vui lòng tải lại và thử lại hoặc liên hệ với hỗ trợ nếu lỗi vẫn tiếp tục',
|
|
700
709
|
},
|
|
710
|
+
'This saved address is missing information required to ship internationally. Please add the details below.': {
|
|
711
|
+
value: 'Địa chỉ đã lưu này thiếu thông tin cần thiết để giao hàng quốc tế. Vui lòng thêm chi tiết bên dưới.',
|
|
712
|
+
},
|
|
701
713
|
'To ensure delivery all address details must be in Latin characters.': {
|
|
702
714
|
value: 'Để đảm bảo giao hàng, tất cả chi tiết địa chỉ phải bằng ký tự Latinh.',
|
|
703
715
|
},
|
|
@@ -6,6 +6,7 @@ import { storageStore, storageStoreOnChange, } from "../../store/storageStore";
|
|
|
6
6
|
import { translate } from "../../store/translationStore";
|
|
7
7
|
import { zonosStore } from "../../store/zonosStore";
|
|
8
8
|
import { trackConversionEvent } from "../../utils/api/trackConversionEvent";
|
|
9
|
+
import { buildAddressContacts } from "../../utils/checkout/buildAddressContacts";
|
|
9
10
|
import { isCheckoutMobile } from "../../utils/checkout/isCheckoutMobile";
|
|
10
11
|
import { shouldRenderShortAddressCodeInput } from "../../utils/checkout/shouldRenderShortAddressCodeInput";
|
|
11
12
|
import { shouldRenderTaxIdInput } from "../../utils/checkout/shouldRenderTaxIdInput";
|
|
@@ -138,10 +139,14 @@ export class ZonosAddress {
|
|
|
138
139
|
log(`Stripe country code: ${defaultAddressCountry}`, 'info');
|
|
139
140
|
const addressElement = stripeElements.create('address', {
|
|
140
141
|
allowedCountries: checkoutAllCountries ? [] : allowedCountries,
|
|
141
|
-
//
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
142
|
+
// Prepend the currently selected address so it stays selected across remounts
|
|
143
|
+
// (customer <-> shipping step navigation), de-duped against the default addresses.
|
|
144
|
+
// Contacts are computed once here at create() time and never mutated afterwards—
|
|
145
|
+
// mutating the contacts value after a remount breaks the element's onChange events.
|
|
146
|
+
contacts: buildAddressContacts({
|
|
147
|
+
currentEvent: stripeAddressEventData,
|
|
148
|
+
defaultAddress,
|
|
149
|
+
}),
|
|
145
150
|
defaultValues: {
|
|
146
151
|
address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: defaultAddressCountry }),
|
|
147
152
|
firstName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName,
|
|
@@ -352,11 +357,11 @@ export class ZonosAddress {
|
|
|
352
357
|
this.isAddressFilled = true;
|
|
353
358
|
}
|
|
354
359
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
355
|
-
return (h(Host, { key: '
|
|
360
|
+
return (h(Host, { key: '195940efdd29696d99b1ab6524a53e6a03776c6a', class: classes([
|
|
356
361
|
'zonos--address',
|
|
357
362
|
'zonos--elements',
|
|
358
363
|
`zonos--${this.type}-address`,
|
|
359
|
-
]) }, this.titleText && (h("zonos-text", { key: '
|
|
364
|
+
]) }, this.titleText && (h("zonos-text", { key: '968d5990fce9c1eb22cd10b58744e6d00f2e622d', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), h("slot", { key: 'ae6dd70dcaa5ecd3465c065736e0f31fb40e72d3', name: "below-title" }), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderShortAddressCodeInput(), h("div", { key: '0bf3075670d3fcd945f9ddcbe096399e2dc213ed', class: "zonos--address-component" })));
|
|
360
365
|
}
|
|
361
366
|
static get is() { return "zonos-address"; }
|
|
362
367
|
static get encapsulation() { return "scoped"; }
|
|
@@ -78,9 +78,9 @@ export class ZonosAddressSuggestions {
|
|
|
78
78
|
return segments;
|
|
79
79
|
}
|
|
80
80
|
render() {
|
|
81
|
-
return (h(Host, { key: '
|
|
81
|
+
return (h(Host, { key: '20e095515d18016bd1f538bd345ed58aafe8518f', class: "zonos--address-suggestions", role: "group", style: {
|
|
82
82
|
'--zonos--border-radius': getBorderRadius(),
|
|
83
|
-
} }, h("ul", { key: '
|
|
83
|
+
} }, h("ul", { key: 'f43e0820d29fc5ef96ab42402e370dc6ce381e66', "aria-label": "Suggestions", class: "wrapper", role: "listbox" }, !!this.localSuggestions.length && (h("li", { key: 'd8ff4f7b53ea5fac8f42f1c13b2255ca2ea5d5e8', "aria-selected": false, class: "powered-by option", role: "option" }, h("div", { key: '2431de3e4e5241e5d74f552051a5d3d4954624a5', class: "powered-by-container" }, h("zonos-text", { key: '48de6d435ffef45f60ebb4ef6c4b2eaf5bdee821', type: "caption" }, "Suggestions powered by"), h("zonos-text", { key: 'b0e8f2986d4f85daa2fd53b7ea812d296d28a164', type: "semiBoldLabel" }, "Google")), h("zonos-button", { key: 'e62245b99bcdc192a4ee98511c8a4a0efad6ea92', "aria-label": "Clear suggestions", icon: h("zonos-icon", { content: RemoveIcon }), noBackground: true, onClick: () => {
|
|
84
84
|
this.localSuggestions = [];
|
|
85
85
|
} }))), this.localSuggestions.map(suggestion => (
|
|
86
86
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
@@ -19,6 +19,7 @@ import { translate } from "../../store/translationStore";
|
|
|
19
19
|
import { zonosStore } from "../../store/zonosStore";
|
|
20
20
|
import { trackConversionEvent } from "../../utils/api/trackConversionEvent";
|
|
21
21
|
import { isValidZip } from "../../utils/checkout/form/isValidZip";
|
|
22
|
+
import { getAddressCountryOptions, } from "../../utils/checkout/getAddressCountryOptions";
|
|
22
23
|
import { isCheckoutMobile } from "../../utils/checkout/isCheckoutMobile";
|
|
23
24
|
import { shouldRenderShortAddressCodeInput } from "../../utils/checkout/shouldRenderShortAddressCodeInput";
|
|
24
25
|
import { shouldRenderTaxIdInput } from "../../utils/checkout/shouldRenderTaxIdInput";
|
|
@@ -70,14 +71,6 @@ export class ZonosAddress {
|
|
|
70
71
|
* Whether to start google place suggestions
|
|
71
72
|
*/
|
|
72
73
|
this.startGooglePlaceSuggestions = false;
|
|
73
|
-
/**
|
|
74
|
-
* List of countries to show in the address element
|
|
75
|
-
*/
|
|
76
|
-
this.shipToCountries = null;
|
|
77
|
-
/**
|
|
78
|
-
* Shipping zones from localization
|
|
79
|
-
*/
|
|
80
|
-
this.shippingZones = null;
|
|
81
74
|
this.city = '';
|
|
82
75
|
this.country = '';
|
|
83
76
|
this.firstName = '';
|
|
@@ -117,6 +110,14 @@ export class ZonosAddress {
|
|
|
117
110
|
* Google autocomplete overlay is conflict with our button, this is to adjust z index of the autocomplete
|
|
118
111
|
*/
|
|
119
112
|
this.isAutoCompleteAdjusted = false;
|
|
113
|
+
/**
|
|
114
|
+
* Memoized country options, keyed on the store references they derive from.
|
|
115
|
+
* `render()` runs on every keystroke, and rebuilding the list each time would
|
|
116
|
+
* re-sort ~244 countries and hand `zonos-stripe-select` a new array identity,
|
|
117
|
+
* re-rendering it needlessly. `@stencil/store` replaces these references
|
|
118
|
+
* wholesale rather than mutating them, so reference equality is a safe key.
|
|
119
|
+
*/
|
|
120
|
+
this.countryOptionsCache = null;
|
|
120
121
|
// Create a single throttled instance that persists
|
|
121
122
|
this.throttledGetAddressSuggestions = throttle(() => {
|
|
122
123
|
if (zonosStore.checkoutAddressService) {
|
|
@@ -268,6 +269,28 @@ export class ZonosAddress {
|
|
|
268
269
|
this.onStoreCheckoutSessionIdChangedSubscription = storageStoreOnChange('checkoutSessionId', onCheckoutSessionIdChange);
|
|
269
270
|
};
|
|
270
271
|
}
|
|
272
|
+
getCountryOptions() {
|
|
273
|
+
const { allCountries, shippingZoneCountries } = localizationStore;
|
|
274
|
+
const cache = this.countryOptionsCache;
|
|
275
|
+
if (cache &&
|
|
276
|
+
cache.allCountries === allCountries &&
|
|
277
|
+
cache.shippingZoneCountries === shippingZoneCountries &&
|
|
278
|
+
cache.type === this.type) {
|
|
279
|
+
return cache.options;
|
|
280
|
+
}
|
|
281
|
+
const options = getAddressCountryOptions({
|
|
282
|
+
allCountries,
|
|
283
|
+
shippingZoneCountries,
|
|
284
|
+
type: this.type,
|
|
285
|
+
});
|
|
286
|
+
this.countryOptionsCache = {
|
|
287
|
+
allCountries,
|
|
288
|
+
options,
|
|
289
|
+
shippingZoneCountries,
|
|
290
|
+
type: this.type,
|
|
291
|
+
};
|
|
292
|
+
return options;
|
|
293
|
+
}
|
|
271
294
|
getStripeAddressInstance() {
|
|
272
295
|
if (this.type === 'billing') {
|
|
273
296
|
return {
|
|
@@ -694,24 +717,19 @@ export class ZonosAddress {
|
|
|
694
717
|
this.initAddressSuggestions();
|
|
695
718
|
this.initDefaultCustomAddressForm();
|
|
696
719
|
}
|
|
697
|
-
shippingZonesChanged() {
|
|
698
|
-
this.shippingZones = localizationStore.shippingZoneCountries;
|
|
699
|
-
this.shipToCountries = Object.values(this.shippingZones || {})
|
|
700
|
-
.map(country => ({
|
|
701
|
-
label: country.displayName,
|
|
702
|
-
value: country.code,
|
|
703
|
-
}))
|
|
704
|
-
.sort((a, b) => {
|
|
705
|
-
return a.label.localeCompare(b.label);
|
|
706
|
-
});
|
|
707
|
-
}
|
|
708
720
|
renderCustomAddressForm() {
|
|
709
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r
|
|
710
|
-
const
|
|
721
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
722
|
+
const _s = this.getCustomAddressErrors(), { showError } = _s, customAddressErrors = __rest(_s, ["showError"]);
|
|
711
723
|
const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
|
|
712
724
|
const countryCode = stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country;
|
|
713
|
-
|
|
714
|
-
|
|
725
|
+
/**
|
|
726
|
+
* Billing addresses are not limited to the shipping zone: a shopper's card
|
|
727
|
+
* can be billed to any country, so restricting it would block them from
|
|
728
|
+
* checking out entirely (05CHECK-915).
|
|
729
|
+
*/
|
|
730
|
+
const countryOptions = this.getCountryOptions();
|
|
731
|
+
const firstCountry = countryOptions[0];
|
|
732
|
+
const stateOptions = Object.entries(((_a = this.countryField) === null || _a === void 0 ? void 0 : _a.regions) || {})
|
|
715
733
|
.map(([label, region]) => ({
|
|
716
734
|
label,
|
|
717
735
|
value: region.interpayCode,
|
|
@@ -745,7 +763,7 @@ export class ZonosAddress {
|
|
|
745
763
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
746
764
|
*/
|
|
747
765
|
this.lastName = event.detail;
|
|
748
|
-
}, required: true }), h("zonos-stripe-select", { "aria-required": "true", autoComplete:
|
|
766
|
+
}, required: true }), h("zonos-stripe-select", { "aria-required": "true", autoComplete: `${this.type} country`, class: "zonos--custom-address-form-input", name: `${this.type}-country`, onSelectChange: (event) => {
|
|
749
767
|
this.countryChanged(event.detail);
|
|
750
768
|
// revalidate the postal code since with empty value so it would reset the customAddressErrors
|
|
751
769
|
this.validate({
|
|
@@ -774,9 +792,9 @@ export class ZonosAddress {
|
|
|
774
792
|
this.city = '';
|
|
775
793
|
this.state = '';
|
|
776
794
|
this.postalCode = '';
|
|
777
|
-
}, options:
|
|
795
|
+
}, options: countryOptions, required: true, selectLabel: translate('Country'), selectedValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
|
|
778
796
|
localizationStore.selectedCountryCode ||
|
|
779
|
-
(firstCountry === null || firstCountry === void 0 ? void 0 : firstCountry.value), title: `${this.type} country` }), h("div", { class: "zonos--custom-address-form-line1-wrapper" }, h("zonos-stripe-input", { "aria-autocomplete": "list", "aria-controls": "autocomplete-search", "aria-required": "true", autoComplete:
|
|
797
|
+
(firstCountry === null || firstCountry === void 0 ? void 0 : firstCountry.value), title: `${this.type} country` }), h("div", { class: "zonos--custom-address-form-line1-wrapper" }, h("zonos-stripe-input", { "aria-autocomplete": "list", "aria-controls": "autocomplete-search", "aria-required": "true", autoComplete: `${this.type} address-line1`, class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.line1 : undefined, inputLabel: translate('Address line 1'), inputValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.line1, name: "address-line1", onInputChange: (event) => {
|
|
780
798
|
this.validate({
|
|
781
799
|
type: this.type,
|
|
782
800
|
value: event.detail,
|
|
@@ -807,9 +825,9 @@ export class ZonosAddress {
|
|
|
807
825
|
}, suggestions: this.addressSuggestions, type: this.type })), h("div", { "aria-label": "Additional address details", class: classes([
|
|
808
826
|
'zonos--custom-address-form-additional-fields',
|
|
809
827
|
countryCode && this.isAddressLine1Entered ? 'zonos--show' : '',
|
|
810
|
-
]), role: "group" }, h("zonos-stripe-input", { "aria-required": "false", autoComplete:
|
|
828
|
+
]), role: "group" }, h("zonos-stripe-input", { "aria-required": "false", autoComplete: `${this.type} address-line2`, class: "zonos--custom-address-form-input", inputLabel: translate(((_b = this.countryField) === null || _b === void 0 ? void 0 : _b.address2Label) || 'Address line 2'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.line2) || '', onInputChange: (event) => {
|
|
811
829
|
this.line2 = event.detail;
|
|
812
|
-
} }), ((
|
|
830
|
+
} }), ((_c = this.countryField) === null || _c === void 0 ? void 0 : _c.cityShow) && (h("zonos-stripe-input", { "aria-required": ((_d = this.countryField) === null || _d === void 0 ? void 0 : _d.cityRequired) ? 'true' : 'false', autoComplete: `${this.type} address-level2`, class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.city : undefined, inputLabel: translate(((_e = this.countryField) === null || _e === void 0 ? void 0 : _e.cityLabel) || 'City'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.city) || '', name: "locality", onInputChange: (event) => {
|
|
813
831
|
this.validate({
|
|
814
832
|
type: this.type,
|
|
815
833
|
value: event.detail,
|
|
@@ -823,7 +841,7 @@ export class ZonosAddress {
|
|
|
823
841
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
824
842
|
*/
|
|
825
843
|
this.city = event.detail;
|
|
826
|
-
}, required: (
|
|
844
|
+
}, required: (_f = this.countryField) === null || _f === void 0 ? void 0 : _f.cityRequired })), h("div", { class: "zonos--custom-address-form-state-zip-wrapper" }, ((_g = this.countryField) === null || _g === void 0 ? void 0 : _g.stateShow) && (h("zonos-stripe-select", { "aria-required": ((_h = this.countryField) === null || _h === void 0 ? void 0 : _h.stateRequired) ? 'true' : 'false', autoComplete: `${this.type} address-level1`, class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.state : undefined, isError: showError && !!customAddressErrors.state, name: `${this.type}-state`, onSelectChange: (event) => {
|
|
827
845
|
this.validate({
|
|
828
846
|
type: this.type,
|
|
829
847
|
value: event.detail,
|
|
@@ -837,9 +855,9 @@ export class ZonosAddress {
|
|
|
837
855
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
838
856
|
*/
|
|
839
857
|
this.state = event.detail;
|
|
840
|
-
}, options: stateOptions, required: (
|
|
858
|
+
}, options: stateOptions, required: (_j = this.countryField) === null || _j === void 0 ? void 0 : _j.stateRequired, selectLabel: translate(((_k = this.countryField) === null || _k === void 0 ? void 0 : _k.stateLabel) || 'State'), selectedValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.state, title: `${this.type} state` })), ((_l = this.countryField) === null || _l === void 0 ? void 0 : _l.zipShow) && (h("zonos-stripe-input", { "aria-describedby": ((_m = this.countryField) === null || _m === void 0 ? void 0 : _m.zipFormat)
|
|
841
859
|
? `zip-format-${this.type}`
|
|
842
|
-
: undefined, "aria-required": ((
|
|
860
|
+
: undefined, "aria-required": ((_o = this.countryField) === null || _o === void 0 ? void 0 : _o.zipRequired) ? 'true' : 'false', autoComplete: `${this.type} postal-code`, class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.postalCode : undefined, inputLabel: translate(((_p = this.countryField) === null || _p === void 0 ? void 0 : _p.zipLabel) || 'Zip'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.postal_code) || '', name: "postalCode", onInputChange: (event) => {
|
|
843
861
|
this.validate({
|
|
844
862
|
type: this.type,
|
|
845
863
|
value: event.detail,
|
|
@@ -853,7 +871,7 @@ export class ZonosAddress {
|
|
|
853
871
|
* Therefore, we must update the value after validation to ensure correct error state
|
|
854
872
|
*/
|
|
855
873
|
this.postalCode = event.detail;
|
|
856
|
-
}, required: (
|
|
874
|
+
}, required: (_q = this.countryField) === null || _q === void 0 ? void 0 : _q.zipRequired, title: `${this.type} zip code` }))), h("zonos-stripe-phone-input", { autoComplete: `${this.type} tel`, class: "zonos--custom-address-form-input", countryCode: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country, countryOptions: (_r = zonosStore.genericSettings) === null || _r === void 0 ? void 0 : _r.countryFields, error: showError ? customAddressErrors.phone : undefined, inputLabel: translate('Phone number'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone) || '', onInputValueChange: event => {
|
|
857
875
|
const { isEmpty, phoneNumber, valid, wrongFormat } = event.detail;
|
|
858
876
|
// Validate the phone number
|
|
859
877
|
this.validate({
|
|
@@ -894,14 +912,6 @@ export class ZonosAddress {
|
|
|
894
912
|
}
|
|
895
913
|
componentDidLoad() {
|
|
896
914
|
const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
|
|
897
|
-
this.shipToCountries = Object.values(localizationStore.shippingZoneCountries || {})
|
|
898
|
-
.map(country => ({
|
|
899
|
-
label: country.displayName,
|
|
900
|
-
value: country.code,
|
|
901
|
-
}))
|
|
902
|
-
.sort((a, b) => {
|
|
903
|
-
return a.label.localeCompare(b.label);
|
|
904
|
-
});
|
|
905
915
|
this.isDirtyAddress =
|
|
906
916
|
!!stripeAddressEventData &&
|
|
907
917
|
stripeAddressEventData.value.address.line1.length > 0;
|
|
@@ -914,7 +924,6 @@ export class ZonosAddress {
|
|
|
914
924
|
}
|
|
915
925
|
render() {
|
|
916
926
|
var _a;
|
|
917
|
-
this.shippingZones = localizationStore.shippingZoneCountries;
|
|
918
927
|
this.addressService = zonosStore.checkoutAddressService;
|
|
919
928
|
if ((_a = stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.complete) {
|
|
920
929
|
this.isAddressFilled = true;
|
|
@@ -924,10 +933,10 @@ export class ZonosAddress {
|
|
|
924
933
|
this.country = localizationStore.selectedCountryCode;
|
|
925
934
|
}
|
|
926
935
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
927
|
-
return (h(Host, { key: '
|
|
936
|
+
return (h(Host, { key: '5baf00df63a693613f493a84c906898080dcbfa2', class: classes([
|
|
928
937
|
'zonos--address zonos--elements',
|
|
929
938
|
`zonos--${this.type}-address`,
|
|
930
|
-
]) }, h("zonos-text", { key: '
|
|
939
|
+
]) }, h("zonos-text", { key: 'f5079e30a1eadceffaac7fef5aa5296b1f9f480b', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("slot", { key: 'fcbd1bac9e06e91c9e4a229d63852df9fea08c58', name: "below-title" }), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderShortAddressCodeInput(), this.renderCustomAddressForm()));
|
|
931
940
|
}
|
|
932
941
|
static get is() { return "zonos-custom-address"; }
|
|
933
942
|
static get encapsulation() { return "scoped"; }
|
|
@@ -1056,8 +1065,6 @@ export class ZonosAddress {
|
|
|
1056
1065
|
"addressSuggestions": {},
|
|
1057
1066
|
"countryField": {},
|
|
1058
1067
|
"startGooglePlaceSuggestions": {},
|
|
1059
|
-
"shipToCountries": {},
|
|
1060
|
-
"shippingZones": {},
|
|
1061
1068
|
"city": {},
|
|
1062
1069
|
"country": {},
|
|
1063
1070
|
"firstName": {},
|
|
@@ -1166,9 +1173,6 @@ export class ZonosAddress {
|
|
|
1166
1173
|
}, {
|
|
1167
1174
|
"propName": "addressService",
|
|
1168
1175
|
"methodName": "shouldEnabledCustomAddressChanged"
|
|
1169
|
-
}, {
|
|
1170
|
-
"propName": "shippingZones",
|
|
1171
|
-
"methodName": "shippingZonesChanged"
|
|
1172
1176
|
}];
|
|
1173
1177
|
}
|
|
1174
1178
|
}
|
|
@@ -67,7 +67,7 @@ export class ZonosPayment {
|
|
|
67
67
|
}
|
|
68
68
|
render() {
|
|
69
69
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
70
|
-
return (h(Host, { key: '
|
|
70
|
+
return (h(Host, { key: '8ccf61c2c78fac6b3d981b18dedae1e32921eb14', class: "zonos--payment zonos--elements" }, this.titleText && (h("zonos-text", { key: '5ae4d0452d284b793ac179254b1891c183d63f03', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), h("div", { key: '251e74ccefed8ee31135cc29cdd71497f7cb1a8a', class: "zonos--payment-component" }), h("div", { key: 'b32c007382c63482f3e7f9af7c60afaaf8b4dbb9', class: "zonos--payment-paypal-container" })));
|
|
71
71
|
}
|
|
72
72
|
static get is() { return "zonos-payment"; }
|
|
73
73
|
static get encapsulation() { return "scoped"; }
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { extractName } from "../extractName";
|
|
2
|
+
/**
|
|
3
|
+
* Merge the fields captured in the completion dialog back into a Stripe shipping address event,
|
|
4
|
+
* rebuilding the full name from the extracted first name and the provided/known last name and
|
|
5
|
+
* marking the address complete. Fields the customer wasn't asked for are left untouched.
|
|
6
|
+
*
|
|
7
|
+
* Pure: returns a new event object rather than mutating the input, so it can be unit-tested and
|
|
8
|
+
* assigned straight to the store.
|
|
9
|
+
*/
|
|
10
|
+
export const applyAddressCompletion = ({ data, event, }) => {
|
|
11
|
+
var _a, _b, _c, _d;
|
|
12
|
+
// Use the same name extraction as the detection step so the two stay in agreement even when
|
|
13
|
+
// the surname is only available via the combined `name` field.
|
|
14
|
+
const { firstName: extractedFirstName, lastName: extractedLastName } = extractName({
|
|
15
|
+
firstName: event.value.firstName,
|
|
16
|
+
lastName: event.value.lastName,
|
|
17
|
+
name: event.value.name,
|
|
18
|
+
});
|
|
19
|
+
const firstName = (_a = data.firstName) !== null && _a !== void 0 ? _a : extractedFirstName;
|
|
20
|
+
const lastName = (_b = data.lastName) !== null && _b !== void 0 ? _b : extractedLastName;
|
|
21
|
+
return Object.assign(Object.assign({}, event), { complete: true, value: Object.assign(Object.assign({}, event.value), { address: Object.assign(Object.assign({}, event.value.address), { postal_code: (_c = data.postal_code) !== null && _c !== void 0 ? _c : event.value.address.postal_code, state: (_d = data.state) !== null && _d !== void 0 ? _d : event.value.address.state }), firstName,
|
|
22
|
+
lastName, name: `${firstName} ${lastName}`.trim() }) });
|
|
23
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { extractName } from "../extractName";
|
|
2
|
+
/**
|
|
3
|
+
* Map a Stripe address change event value into a Stripe `ContactOption`, used to
|
|
4
|
+
* pre-seed the address element's saved-address (contacts) list on remount.
|
|
5
|
+
*/
|
|
6
|
+
export const mapAddressEventToContact = (value) => {
|
|
7
|
+
const { firstName, lastName } = extractName({
|
|
8
|
+
firstName: value.firstName,
|
|
9
|
+
lastName: value.lastName,
|
|
10
|
+
name: value.name,
|
|
11
|
+
});
|
|
12
|
+
return {
|
|
13
|
+
address: {
|
|
14
|
+
city: value.address.city,
|
|
15
|
+
country: value.address.country,
|
|
16
|
+
line1: value.address.line1,
|
|
17
|
+
line2: value.address.line2 || undefined,
|
|
18
|
+
postal_code: value.address.postal_code,
|
|
19
|
+
state: value.address.state,
|
|
20
|
+
},
|
|
21
|
+
name: (value.name || `${firstName} ${lastName}`).trim(),
|
|
22
|
+
phone: value.phone || undefined,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Build a dedupe key for a contact so we don't add a duplicate saved address. Compared
|
|
27
|
+
* case- and whitespace-insensitively on the distinguishing fields.
|
|
28
|
+
*/
|
|
29
|
+
export const getContactDedupKey = (contact) => {
|
|
30
|
+
var _a, _b, _c;
|
|
31
|
+
return [
|
|
32
|
+
contact.name,
|
|
33
|
+
(_a = contact.address) === null || _a === void 0 ? void 0 : _a.line1,
|
|
34
|
+
(_b = contact.address) === null || _b === void 0 ? void 0 : _b.postal_code,
|
|
35
|
+
(_c = contact.address) === null || _c === void 0 ? void 0 : _c.country,
|
|
36
|
+
]
|
|
37
|
+
.map(value => (value || '').trim().toLowerCase())
|
|
38
|
+
.join('|');
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Prepend the currently selected address (from the latest Stripe address event) to the
|
|
42
|
+
* list of default saved addresses so it stays selected when the address element is
|
|
43
|
+
* remounted (e.g. navigating between the customer and shipping steps). Avoids adding a
|
|
44
|
+
* duplicate contact when the current address already exists in the list.
|
|
45
|
+
*/
|
|
46
|
+
export const buildAddressContacts = ({ currentEvent, defaultAddress, }) => {
|
|
47
|
+
if (!currentEvent) {
|
|
48
|
+
return defaultAddress;
|
|
49
|
+
}
|
|
50
|
+
const currentContact = mapAddressEventToContact(currentEvent.value);
|
|
51
|
+
const currentKey = getContactDedupKey(currentContact);
|
|
52
|
+
const alreadyExists = defaultAddress.some(contact => getContactDedupKey(contact) === currentKey);
|
|
53
|
+
if (alreadyExists) {
|
|
54
|
+
return defaultAddress;
|
|
55
|
+
}
|
|
56
|
+
return [currentContact, ...defaultAddress];
|
|
57
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const hasCountries = (countries) => !!countries && Object.keys(countries).length > 0;
|
|
2
|
+
/**
|
|
3
|
+
* Builds the country options for an address form's country dropdown.
|
|
4
|
+
*
|
|
5
|
+
* Shipping addresses are restricted to the merchant's shipping zone, since we
|
|
6
|
+
* can only fulfill orders to those countries. Billing addresses are not — a
|
|
7
|
+
* shopper's card can be billed to any country, so restricting the billing
|
|
8
|
+
* country prevents them from checking out at all (05CHECK-915).
|
|
9
|
+
*
|
|
10
|
+
* When the full country list is unavailable we fall back to the shipping zone
|
|
11
|
+
* so the dropdown is never empty.
|
|
12
|
+
*/
|
|
13
|
+
export const getAddressCountryOptions = ({ allCountries, shippingZoneCountries, type, }) => {
|
|
14
|
+
const countries = type === 'billing' && hasCountries(allCountries)
|
|
15
|
+
? allCountries
|
|
16
|
+
: shippingZoneCountries;
|
|
17
|
+
return Object.values(countries || {})
|
|
18
|
+
.map(country => ({
|
|
19
|
+
label: country.displayName,
|
|
20
|
+
value: country.code,
|
|
21
|
+
}))
|
|
22
|
+
.sort((a, b) => a.label.localeCompare(b.label));
|
|
23
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { extractName } from "../extractName";
|
|
2
|
+
/**
|
|
3
|
+
* Minimum number of characters we treat as a valid postal code. Mirrors the
|
|
4
|
+
* landed-cost readiness check in `stripe.ts` (`isAddressReadyToRequestLandedCost`).
|
|
5
|
+
*/
|
|
6
|
+
export const MIN_POSTAL_CODE_LENGTH = 3;
|
|
7
|
+
/**
|
|
8
|
+
* Determine which Zonos-required shipping fields are still missing even though Stripe
|
|
9
|
+
* reports the address as complete.
|
|
10
|
+
*
|
|
11
|
+
* Stripe Link autofills a saved address from a single name input, so it may return only a
|
|
12
|
+
* first name and, for some countries, omit the state / postal code while still reporting
|
|
13
|
+
* `complete: true`. This surfaces the fields Zonos needs for international shipping so the
|
|
14
|
+
* customer can supply just those, without duplicating fields Stripe already captures.
|
|
15
|
+
*
|
|
16
|
+
* Pure: the caller resolves `countryField` (via `getCountryField`) and passes it in, so
|
|
17
|
+
* this can be unit-tested without the stores.
|
|
18
|
+
*/
|
|
19
|
+
export const getMissingRequiredShippingFields = ({ countryField, event, }) => {
|
|
20
|
+
var _a, _b, _c;
|
|
21
|
+
if (!event) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
const { value } = event;
|
|
25
|
+
const missingFields = [];
|
|
26
|
+
// Last name is always required for international shipping. Link's single name input
|
|
27
|
+
// often provides only a first name, leaving the extracted last name empty.
|
|
28
|
+
const { lastName } = extractName({
|
|
29
|
+
firstName: value.firstName,
|
|
30
|
+
lastName: value.lastName,
|
|
31
|
+
name: value.name,
|
|
32
|
+
});
|
|
33
|
+
if (!lastName.trim()) {
|
|
34
|
+
missingFields.push({ key: 'lastName' });
|
|
35
|
+
}
|
|
36
|
+
if ((countryField === null || countryField === void 0 ? void 0 : countryField.stateRequired) && !((_a = value.address.state) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
37
|
+
missingFields.push({ key: 'state' });
|
|
38
|
+
}
|
|
39
|
+
if ((countryField === null || countryField === void 0 ? void 0 : countryField.zipRequired) &&
|
|
40
|
+
((_c = (_b = value.address.postal_code) === null || _b === void 0 ? void 0 : _b.trim().length) !== null && _c !== void 0 ? _c : 0) < MIN_POSTAL_CODE_LENGTH) {
|
|
41
|
+
missingFields.push({ key: 'postal_code' });
|
|
42
|
+
}
|
|
43
|
+
return missingFields;
|
|
44
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { c as createStore, z as zonosStore } from './zonosStore-b7d3f9b0.js';
|
|
2
|
-
import { s as storageStore, t as translate, l as localizationStore, j as getOverridenZCountry, f as filterValidTests, d as storageStoreSetEnabledVariantTestKeys } from './localization-
|
|
2
|
+
import { s as storageStore, t as translate, l as localizationStore, j as getOverridenZCountry, f as filterValidTests, d as storageStoreSetEnabledVariantTestKeys } from './localization-754e7e8b.js';
|
|
3
3
|
import { l as log, b as allLogs } from './VarianceTest-572cecf5.js';
|
|
4
4
|
import { h as handleFetch, l as logError, f as fallbackApiList, g as getIsTestMode, a as getIsStagingMode, s as sendErrorLog, j as jsonParse } from './handleFetch-a844cac1.js';
|
|
5
5
|
import { i as isDarkColor } from './isDarkColor-039ef212.js';
|
|
@@ -2729,4 +2729,4 @@ const cartStoreUpdateStoreCredit = () => {
|
|
|
2729
2729
|
}, 300);
|
|
2730
2730
|
};
|
|
2731
2731
|
|
|
2732
|
-
export {
|
|
2732
|
+
export { getEnabledPolicies as $, validateCheckoutSession as A, storeCreditStoreCreateOrder as B, stripeStoreConfirmPayment as C, stripeStoreHandleInventoryRefund as D, policyConsentStore as E, stripeStoreReset as F, cartStoreOnChange as G, stripeStoreOnChange as H, storeCreditStoreGetEffectiveAmount as I, stripeStoreRecordPolicyConsent as J, stripeStoreBuildAddressForPartyCreate as K, cartStoreUpdateSelectedShippingOption as L, cartStoreHasOneEligibleItem as M, isEuDapRemittance as N, stripeStoreApplyPromoCode as O, stripeStoreRemovePromoCode as P, stripeStoreResetPromoCode as Q, stripeStoreMessageBasedOnStatus as R, storeCreditStore as S, storeCreditStoreReset as T, extractName as U, stripeStoreTranslateAddressToLatin as V, getCountryField as W, stripeStoreAsyncAddressUpdate as X, cartStoreGetShippingTransitInfo as Y, cartStoreGetMethod as Z, sortServiceLevelOptionsByAmount as _, stripeStoreSaveDomesticShippingSession as a, storeCreditStoreSetEnabled as a0, storeCreditStoreSetUseFullBalance as a1, cartStoreUpdateStoreCredit as a2, storeCreditStoreSetAmount as a3, storeCreditStoreRefreshBalance as a4, stripeStore as b, stripeStoreRetrievePayment as c, cartStore as d, cartStoreUpdateItems as e, cartStoreReset as f, cartStoreResetTabItems as g, cartStoreClearCheckoutInterval as h, initStripeElements as i, stripeStoreInitCheckoutSession as j, stripeStoreGetPaymentIntent as k, stripeStoreHandleInventoryCheck as l, cartStoreStartCheckoutInterval as m, getCheckoutSessionBody as n, cartStoreUpdateToErrorState as o, policyConsentStoreReset as p, stripeStoreCleanupDomesticShippingSession as q, cartStoreSetCheckoutSession as r, stripeStoreGetDomesticShippingSession as s, trackConversionEvent as t, stripeStorePrefetchLandedCost as u, cartStoreNextStep as v, isPolicyConsentRequired as w, stripeStoreUpdateCheckoutSessionBaseCurrency as x, storeCreditStoreApplyCredit as y, storeCreditStoreCoversFullAmount as z };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { c as createStore, z as zonosStore } from './zonosStore-b7d3f9b0.js';
|
|
2
|
-
import { t as translate, l as localizationStore, s as storageStore } from './localization-
|
|
2
|
+
import { t as translate, l as localizationStore, s as storageStore } from './localization-754e7e8b.js';
|
|
3
3
|
import { l as logError$1, h as handleFetch, s as sendErrorLog } from './handleFetch-a844cac1.js';
|
|
4
4
|
import { l as log, b as allLogs } from './VarianceTest-572cecf5.js';
|
|
5
|
-
import { b as stripeStore, K as stripeStoreBuildAddressForPartyCreate, d as cartStore, L as cartStoreUpdateSelectedShippingOption } from './cart-
|
|
5
|
+
import { b as stripeStore, K as stripeStoreBuildAddressForPartyCreate, d as cartStore, L as cartStoreUpdateSelectedShippingOption } from './cart-93c36159.js';
|
|
6
6
|
|
|
7
7
|
// src/constant/common.ts
|
|
8
8
|
function _array_like_to_array(arr, len) {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { U as extractName } from './cart-93c36159.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Minimum number of characters we treat as a valid postal code. Mirrors the
|
|
5
|
+
* landed-cost readiness check in `stripe.ts` (`isAddressReadyToRequestLandedCost`).
|
|
6
|
+
*/
|
|
7
|
+
const MIN_POSTAL_CODE_LENGTH = 3;
|
|
8
|
+
/**
|
|
9
|
+
* Determine which Zonos-required shipping fields are still missing even though Stripe
|
|
10
|
+
* reports the address as complete.
|
|
11
|
+
*
|
|
12
|
+
* Stripe Link autofills a saved address from a single name input, so it may return only a
|
|
13
|
+
* first name and, for some countries, omit the state / postal code while still reporting
|
|
14
|
+
* `complete: true`. This surfaces the fields Zonos needs for international shipping so the
|
|
15
|
+
* customer can supply just those, without duplicating fields Stripe already captures.
|
|
16
|
+
*
|
|
17
|
+
* Pure: the caller resolves `countryField` (via `getCountryField`) and passes it in, so
|
|
18
|
+
* this can be unit-tested without the stores.
|
|
19
|
+
*/
|
|
20
|
+
const getMissingRequiredShippingFields = ({ countryField, event, }) => {
|
|
21
|
+
var _a, _b, _c;
|
|
22
|
+
if (!event) {
|
|
23
|
+
return [];
|
|
24
|
+
}
|
|
25
|
+
const { value } = event;
|
|
26
|
+
const missingFields = [];
|
|
27
|
+
// Last name is always required for international shipping. Link's single name input
|
|
28
|
+
// often provides only a first name, leaving the extracted last name empty.
|
|
29
|
+
const { lastName } = extractName({
|
|
30
|
+
firstName: value.firstName,
|
|
31
|
+
lastName: value.lastName,
|
|
32
|
+
name: value.name,
|
|
33
|
+
});
|
|
34
|
+
if (!lastName.trim()) {
|
|
35
|
+
missingFields.push({ key: 'lastName' });
|
|
36
|
+
}
|
|
37
|
+
if ((countryField === null || countryField === void 0 ? void 0 : countryField.stateRequired) && !((_a = value.address.state) === null || _a === void 0 ? void 0 : _a.trim())) {
|
|
38
|
+
missingFields.push({ key: 'state' });
|
|
39
|
+
}
|
|
40
|
+
if ((countryField === null || countryField === void 0 ? void 0 : countryField.zipRequired) &&
|
|
41
|
+
((_c = (_b = value.address.postal_code) === null || _b === void 0 ? void 0 : _b.trim().length) !== null && _c !== void 0 ? _c : 0) < MIN_POSTAL_CODE_LENGTH) {
|
|
42
|
+
missingFields.push({ key: 'postal_code' });
|
|
43
|
+
}
|
|
44
|
+
return missingFields;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { MIN_POSTAL_CODE_LENGTH as M, getMissingRequiredShippingFields as g };
|