@zonos/elements 1.3.39 → 1.3.41
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-c7212410.js → cart-497bb434.js} +300 -7
- package/dist/cjs/{getBorderRadius-074b46ef.js → getBorderRadius-4413e191.js} +1 -1
- package/dist/cjs/{index-b071017b.js → index-d56e0a8b.js} +242 -169
- package/dist/cjs/index.cjs.js +10 -4
- package/dist/cjs/{isDarkColor-371a3b1a.js → isDarkColor-4eb96a1e.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/paypal-e65a287a.js +461 -0
- package/dist/cjs/{submitGtag-7a679d92.js → sendErrorLog-c3c315a9.js} +2 -19
- package/dist/cjs/zonos-address_8.cjs.entry.js +11 -11
- package/dist/cjs/zonos-badge_2.cjs.entry.js +4 -4
- package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
- package/dist/cjs/zonos-button_3.cjs.entry.js +4 -4
- package/dist/cjs/zonos-card.cjs.entry.js +3 -3
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +76 -38
- package/dist/cjs/zonos-checkout.cjs.entry.js +43 -70
- package/dist/cjs/zonos-component.cjs.entry.js +2 -2
- package/dist/cjs/zonos-controller.cjs.entry.js +15 -15
- package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
- package/dist/cjs/{zonos-country-select_3.cjs.entry.js → zonos-country-select_4.cjs.entry.js} +100 -14
- package/dist/cjs/zonos-elements.cjs.js +3 -3
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +9 -9
- package/dist/cjs/zonos-hello.cjs.entry.js +5 -5
- package/dist/cjs/zonos-input.cjs.entry.js +7 -7
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +9 -9
- package/dist/cjs/zonos-link.cjs.entry.js +2 -2
- package/dist/cjs/zonos-logo.cjs.entry.js +4 -4
- package/dist/cjs/{zonos-notification_2.cjs.entry.js → zonos-notification_3.cjs.entry.js} +59 -7
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +2 -2
- package/dist/cjs/zonos-v-stack.cjs.entry.js +4 -4
- package/dist/cjs/{zonosStore-4c6c85da.js → zonosStore-56401fdb.js} +5 -1
- package/dist/collection/__tests__/build-utils/urlCheckOne.js +3 -1
- package/dist/collection/collection-manifest.json +3 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.css +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +39 -8
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.css +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +7 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +37 -22
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +30 -60
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +1 -0
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.css +8 -0
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +14 -4
- 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-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-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-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.css +46 -0
- package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +177 -0
- 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 +22 -8
- package/dist/collection/components/paypal/zonos-paypal-payment.css +37 -0
- package/dist/collection/components/paypal/zonos-paypal-payment.js +92 -0
- package/dist/collection/components/store/checkout/cart.js +26 -1
- package/dist/collection/components/store/checkout/paypal.js +219 -0
- package/dist/collection/components/store/checkout/stripe.js +16 -4
- 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/store/zonosStore.js +4 -0
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +2 -2
- package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +1 -1
- package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +2 -3
- package/dist/collection/components/utils/api/getZonosSettings.js +3 -3
- package/dist/collection/components/utils/api/paypalCaptureOrder.js +8 -0
- package/dist/collection/components/utils/api/paypalCreateOrder.js +8 -0
- package/dist/collection/components/utils/getContrastColor.js +6 -2
- package/dist/collection/components/utils/handleFetch.js +6 -1
- package/dist/collection/components/utils/isContrastColor.js +7 -0
- package/dist/collection/environment.js +4 -5
- package/dist/collection/scripts/_getZonosQaUrl.js +4 -0
- package/dist/collection/scripts/_zonosBase.js +2 -0
- package/dist/collection/styles/stripe/addressRuleStyle.js +6 -0
- package/dist/collection/types/generated/graphql.customer.types.js +35 -0
- package/dist/esm/{cart-eb75b113.js → cart-f53c9f90.js} +296 -8
- package/dist/esm/{getBorderRadius-947c24de.js → getBorderRadius-3ba98361.js} +1 -1
- package/dist/esm/{index-3b46f3c3.js → index-86b8247e.js} +242 -169
- package/dist/esm/index.js +10 -4
- package/dist/esm/{isDarkColor-f8324c10.js → isDarkColor-3119e351.js} +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/paypal-72296ae6.js +453 -0
- package/dist/esm/{submitGtag-0bc0baa0.js → sendErrorLog-f8d3ec4b.js} +3 -19
- package/dist/esm/zonos-address_8.entry.js +11 -11
- package/dist/esm/zonos-badge_2.entry.js +4 -4
- package/dist/esm/zonos-banner.entry.js +2 -2
- package/dist/esm/zonos-button_3.entry.js +4 -4
- package/dist/esm/zonos-card.entry.js +3 -3
- package/dist/esm/zonos-cart-items_12.entry.js +63 -25
- package/dist/esm/zonos-checkout.entry.js +34 -61
- package/dist/esm/zonos-component.entry.js +2 -2
- package/dist/esm/zonos-controller.entry.js +15 -15
- package/dist/esm/zonos-country-flag.entry.js +5 -5
- package/dist/esm/{zonos-country-select_3.entry.js → zonos-country-select_4.entry.js} +100 -15
- package/dist/esm/zonos-elements.js +4 -4
- package/dist/esm/zonos-hello-dialog.entry.js +9 -9
- package/dist/esm/zonos-hello.entry.js +5 -5
- package/dist/esm/zonos-input.entry.js +7 -7
- package/dist/esm/zonos-language-select_2.entry.js +9 -9
- package/dist/esm/zonos-link.entry.js +2 -2
- package/dist/esm/zonos-logo.entry.js +4 -4
- package/dist/esm/{zonos-notification_2.entry.js → zonos-notification_3.entry.js} +60 -9
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +2 -2
- package/dist/esm/zonos-v-stack.entry.js +4 -4
- package/dist/esm/{zonosStore-ba9e541e.js → zonosStore-8fc9ceb2.js} +5 -1
- package/dist/esm-es5/cart-f53c9f90.js +1 -0
- package/dist/esm-es5/{getBorderRadius-947c24de.js → getBorderRadius-3ba98361.js} +1 -1
- package/dist/esm-es5/index-86b8247e.js +2 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-f8324c10.js → isDarkColor-3119e351.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/paypal-72296ae6.js +17 -0
- package/dist/esm-es5/sendErrorLog-f8d3ec4b.js +1 -0
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_2.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_12.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.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 -0
- 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-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-notification_3.entry.js +1 -0
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/zonos-text.entry.js +1 -1
- package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
- package/dist/esm-es5/{zonosStore-ba9e541e.js → zonosStore-8fc9ceb2.js} +1 -1
- package/dist/scripts/index.d.ts +170 -6
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +2 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.d.ts +8 -4
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +1 -20
- package/dist/types/components/common/zonos-virtual-scroll/zonos-virtual-scroll.d.ts +32 -0
- package/dist/types/components/main/zonos-controller.d.ts +6 -0
- package/dist/types/components/paypal/zonos-paypal-payment.d.ts +17 -0
- package/dist/types/components/store/checkout/cart.d.ts +19 -1
- package/dist/types/components/store/checkout/paypal.d.ts +28 -0
- package/dist/types/components/store/checkout/stripe.d.ts +10 -1
- 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/store/translationStore.d.ts +1 -1
- package/dist/types/components/store/zonosStore.d.ts +4 -0
- package/dist/types/components/utils/api/getZonosSettings.d.ts +2 -0
- package/dist/types/components/utils/api/paypalCaptureOrder.d.ts +10 -0
- package/dist/types/components/utils/api/paypalCreateOrder.d.ts +9 -0
- package/dist/types/components/utils/handleFetch.d.ts +4 -0
- package/dist/types/components/utils/isContrastColor.d.ts +4 -0
- package/dist/types/components.d.ts +129 -6
- package/dist/types/scripts/_zonosBase.d.ts +9 -1
- package/dist/types/stencil-public-runtime.d.ts +3 -10
- package/dist/types/types/checkout/CheckoutConfig.d.ts +14 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +71 -11
- package/dist/types/types/generated/graphql.customer.types.ts +103 -11
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-71882ac9.system.entry.js → p-0229282c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5821856c.js → p-04054425.js} +1 -1
- package/dist/zonos-elements/p-05cdd3b4.js +17 -0
- package/dist/zonos-elements/{p-a8b934c2.entry.js → p-0f9804e3.entry.js} +1 -1
- package/dist/zonos-elements/p-12266c9e.js +1 -0
- package/dist/zonos-elements/{p-01304a58.system.entry.js → p-14067782.system.entry.js} +1 -1
- package/dist/zonos-elements/p-1a89c54a.js +1 -0
- package/dist/zonos-elements/{p-d2992457.system.entry.js → p-1e4f7997.system.entry.js} +1 -1
- package/dist/zonos-elements/p-1ee2fa70.system.entry.js +1 -0
- package/dist/zonos-elements/{p-63a27875.entry.js → p-25633055.entry.js} +1 -1
- package/dist/zonos-elements/{p-e37440ad.system.js → p-40c21634.system.js} +1 -1
- package/dist/zonos-elements/p-4db5be24.system.entry.js +1 -0
- package/dist/zonos-elements/{p-da2e5289.system.entry.js → p-4f454a91.system.entry.js} +1 -1
- package/dist/zonos-elements/p-52947dab.system.entry.js +1 -0
- package/dist/zonos-elements/{p-62ed4236.entry.js → p-52fa9aab.entry.js} +1 -1
- package/dist/zonos-elements/{p-31b3d26b.js → p-52fb6876.js} +1 -1
- package/dist/zonos-elements/p-539974db.system.js +1 -0
- package/dist/zonos-elements/p-5922c099.entry.js +1 -0
- package/dist/zonos-elements/p-5b7da777.js +2 -0
- package/dist/zonos-elements/p-5fe10991.system.entry.js +1 -0
- package/dist/zonos-elements/p-678f1888.entry.js +1 -0
- package/dist/zonos-elements/p-67f22fbf.system.entry.js +1 -0
- package/dist/zonos-elements/{p-9a1c0d02.js → p-6ac72711.js} +1 -1
- package/dist/zonos-elements/{p-ed333de6.system.entry.js → p-6bb0b7d2.system.entry.js} +1 -1
- package/dist/zonos-elements/p-6de1c78a.entry.js +1 -0
- package/dist/zonos-elements/{p-d8c1eb99.entry.js → p-6de38759.entry.js} +1 -1
- package/dist/zonos-elements/{p-a21ec316.system.entry.js → p-6fbb4565.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6c3390b7.entry.js → p-706d2bad.entry.js} +1 -1
- package/dist/zonos-elements/{p-73ba4398.system.entry.js → p-717028a2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8acdf43b.system.entry.js → p-7833fa53.system.entry.js} +1 -1
- package/dist/zonos-elements/p-79fd4f3c.system.js +1 -0
- package/dist/zonos-elements/p-8809964a.system.js +1 -0
- package/dist/zonos-elements/{p-3541e6dd.entry.js → p-8b01aafb.entry.js} +1 -1
- package/dist/zonos-elements/{p-2aa72606.entry.js → p-9220f63d.entry.js} +1 -1
- package/dist/zonos-elements/{p-699a5376.entry.js → p-9420f9db.entry.js} +1 -1
- package/dist/zonos-elements/p-9525cc44.system.js +1 -0
- package/dist/zonos-elements/{p-c21802e9.entry.js → p-9a319774.entry.js} +1 -1
- package/dist/zonos-elements/{p-3523c3b4.entry.js → p-9d1f13c2.entry.js} +1 -1
- package/dist/zonos-elements/{p-c0fcc0fa.system.entry.js → p-9eadd9a7.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-966ab4e7.system.entry.js → p-a3e2592b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f06bb776.system.entry.js → p-ab11cca6.system.entry.js} +1 -1
- package/dist/zonos-elements/p-b3e825dc.system.js +17 -0
- package/dist/zonos-elements/{p-9d29f3f4.system.entry.js → p-b689309d.system.entry.js} +1 -1
- package/dist/zonos-elements/p-c460665d.system.js +1 -0
- package/dist/zonos-elements/p-c4617501.entry.js +1 -0
- package/dist/zonos-elements/{p-b903af96.system.entry.js → p-c4bb2949.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c3619b3d.entry.js → p-c7301a88.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -0
- package/dist/zonos-elements/p-d86c89e3.entry.js +1 -0
- package/dist/zonos-elements/{p-e3c014ae.entry.js → p-dc368ad5.entry.js} +1 -1
- package/dist/zonos-elements/{p-18b28104.entry.js → p-de53d9c3.entry.js} +1 -1
- package/dist/zonos-elements/p-df69fa38.system.entry.js +1 -0
- package/dist/zonos-elements/{p-22882fd6.entry.js → p-e07bf9ea.entry.js} +1 -1
- package/dist/zonos-elements/{p-9de374a7.system.entry.js → p-e8f7fb29.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-59f37de3.entry.js → p-f35ee203.entry.js} +1 -1
- package/dist/zonos-elements/p-fd061229.system.js +2 -0
- package/dist/zonos-elements/p-fd54fbb9.system.entry.js +1 -0
- package/dist/zonos-elements/p-fdb4347f.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/dist/zonos-elements/zonos-elements.js +1 -1
- package/loader/cdn.js +1 -2
- package/loader/index.cjs.js +1 -2
- package/loader/index.d.ts +3 -0
- package/loader/index.es2017.js +1 -2
- package/loader/index.js +1 -2
- package/package.json +12 -11
- package/dist/esm-es5/cart-eb75b113.js +0 -1
- package/dist/esm-es5/index-3b46f3c3.js +0 -2
- package/dist/esm-es5/submitGtag-0bc0baa0.js +0 -1
- package/dist/esm-es5/zonos-country-select_3.entry.js +0 -1
- package/dist/esm-es5/zonos-notification_2.entry.js +0 -1
- package/dist/zonos-elements/p-02405211.system.entry.js +0 -1
- package/dist/zonos-elements/p-085548f2.entry.js +0 -1
- package/dist/zonos-elements/p-0b538ed4.system.js +0 -1
- package/dist/zonos-elements/p-2a45c837.system.entry.js +0 -1
- package/dist/zonos-elements/p-357322ea.system.entry.js +0 -1
- package/dist/zonos-elements/p-3f5e2e5c.system.entry.js +0 -1
- package/dist/zonos-elements/p-53acc999.js +0 -1
- package/dist/zonos-elements/p-548ac127.entry.js +0 -1
- package/dist/zonos-elements/p-5609876a.system.entry.js +0 -1
- package/dist/zonos-elements/p-6f9448bb.entry.js +0 -1
- package/dist/zonos-elements/p-70262120.system.js +0 -1
- package/dist/zonos-elements/p-878293fe.js +0 -1
- package/dist/zonos-elements/p-97d74f84.system.js +0 -1
- package/dist/zonos-elements/p-a393c1db.system.entry.js +0 -1
- package/dist/zonos-elements/p-a8cb25de.system.js +0 -1
- package/dist/zonos-elements/p-abe8ea12.system.js +0 -1
- package/dist/zonos-elements/p-ae04d3ff.entry.js +0 -1
- package/dist/zonos-elements/p-b684f8aa.system.entry.js +0 -1
- package/dist/zonos-elements/p-ce347974.js +0 -2
- package/dist/zonos-elements/p-d99232c5.system.js +0 -2
- package/dist/zonos-elements/p-e0bf9666.system.js +0 -1
- package/dist/zonos-elements/p-e1db1bc9.entry.js +0 -1
- package/dist/zonos-elements/p-e74ca4bc.entry.js +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment, h, Host, } from "@stencil/core";
|
|
2
2
|
import { cartStore } from "../../../store/checkout/cart";
|
|
3
|
-
import {
|
|
3
|
+
import { paypalStore, paypalStoreReset, } from "../../../store/checkout/paypal";
|
|
4
|
+
import { stripeStore, stripeStoreMessageBasedOnStatus, stripeStoreReset, stripeStoreRetrievePayment, } from "../../../store/checkout/stripe";
|
|
4
5
|
import { translate } from "../../../store/translationStore";
|
|
5
6
|
import { zonosStore } from "../../../store/zonosStore";
|
|
6
7
|
import { trackConversionEvent } from "../../../utils/api/trackConversionEvent";
|
|
@@ -102,7 +103,7 @@ export class ZonosCheckoutFinish {
|
|
|
102
103
|
this.notificationActionText = successPageActionText;
|
|
103
104
|
}
|
|
104
105
|
};
|
|
105
|
-
this.
|
|
106
|
+
this.checkStripePaymentStatus = async () => {
|
|
106
107
|
this.isLoading = true;
|
|
107
108
|
const clientSecret = new URLSearchParams(window.location.search).get('payment_intent_client_secret') || stripeStore.clientSecret;
|
|
108
109
|
if (clientSecret || this.storybookForceStatus) {
|
|
@@ -115,8 +116,6 @@ export class ZonosCheckoutFinish {
|
|
|
115
116
|
this.notificationTitle = error
|
|
116
117
|
? translate('Payment failed')
|
|
117
118
|
: translate("You're all set!");
|
|
118
|
-
// override title if notification type is success
|
|
119
|
-
this.useOverrideSuccessNotification();
|
|
120
119
|
if (error) {
|
|
121
120
|
submitGtag('zonos-checkout-payment-fail');
|
|
122
121
|
}
|
|
@@ -132,6 +131,8 @@ export class ZonosCheckoutFinish {
|
|
|
132
131
|
}
|
|
133
132
|
// Attempt to pull the order details from the graph every second on 5 attempts. Only pull if checkoutSessionId is available
|
|
134
133
|
if (this.notificationType === 'success' && cartStore.checkoutSessionId) {
|
|
134
|
+
// override title if notification type is success
|
|
135
|
+
this.useOverrideSuccessNotification();
|
|
135
136
|
// wait this to finish before resetting store and checkout session id
|
|
136
137
|
await this.getPullOrder();
|
|
137
138
|
}
|
|
@@ -145,6 +146,31 @@ export class ZonosCheckoutFinish {
|
|
|
145
146
|
stripeStoreReset();
|
|
146
147
|
cartStore.checkoutSessionId = null;
|
|
147
148
|
};
|
|
149
|
+
this.checkPaypalPaymentStatus = async () => {
|
|
150
|
+
this.isLoading = true;
|
|
151
|
+
// render error message if there's an error
|
|
152
|
+
if (paypalStore.paypalErrorMessage) {
|
|
153
|
+
this.notificationType = 'error';
|
|
154
|
+
this.notificationTitle = translate('Payment failed');
|
|
155
|
+
this.notificationMessages = [paypalStore.paypalErrorMessage];
|
|
156
|
+
this.isLoading = false;
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (paypalStore.orderIdCreated) {
|
|
160
|
+
this.notificationType = 'success';
|
|
161
|
+
this.notificationTitle = translate("You're all set!");
|
|
162
|
+
this.notificationMessages =
|
|
163
|
+
stripeStoreMessageBasedOnStatus('succeeded').messages;
|
|
164
|
+
// override title if notification type is success
|
|
165
|
+
this.useOverrideSuccessNotification();
|
|
166
|
+
// wait this to finish before resetting store and checkout session id
|
|
167
|
+
await this.getPullOrder();
|
|
168
|
+
}
|
|
169
|
+
this.isLoading = false;
|
|
170
|
+
stripeStoreReset();
|
|
171
|
+
paypalStoreReset();
|
|
172
|
+
cartStore.checkoutSessionId = null;
|
|
173
|
+
};
|
|
148
174
|
this.closeClickHandler = () => {
|
|
149
175
|
this.closeClick.emit();
|
|
150
176
|
};
|
|
@@ -167,17 +193,22 @@ export class ZonosCheckoutFinish {
|
|
|
167
193
|
this.isLoading = false;
|
|
168
194
|
return;
|
|
169
195
|
}
|
|
170
|
-
|
|
196
|
+
if (paypalStore.orderIdCreated) {
|
|
197
|
+
void this.checkPaypalPaymentStatus();
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
void this.checkStripePaymentStatus();
|
|
201
|
+
}
|
|
171
202
|
}
|
|
172
203
|
render() {
|
|
173
204
|
var _a, _b;
|
|
174
205
|
const orderId = ((_a = this.order) === null || _a === void 0 ? void 0 : _a.accountOrderNumber) || ((_b = this.order) === null || _b === void 0 ? void 0 : _b.id);
|
|
175
206
|
const isTestMode = getIsTestMode();
|
|
176
|
-
return (h(Host, { key: '
|
|
207
|
+
return (h(Host, { key: '4e00e5d3d8de136e4161fdea6afba86616748d66', class: "zonos--checkout-finish zonos--elements", style: {
|
|
177
208
|
'--border-radius': getBorderRadius({
|
|
178
209
|
overrideBorderStyle: this.borderRadius,
|
|
179
210
|
}),
|
|
180
|
-
} }, this.isLoading && (h("div", { key: '
|
|
211
|
+
} }, this.isLoading && (h("div", { key: '6b4f755402951c5fd0e5150ccd05542b85ca2121', class: "loading-wrapper" }, h("zonos-spinner", { key: 'a3e6b561c6796891b33d273b9729d0f8fab4a308' }))), !this.isLoading && (h("div", { key: '798bfa6f1ee9f7b682e0d7389654f5b3d1549ba6', class: "zonos--finish-details" }, h("div", { key: 'cd7a52c193aa3bb5ef2e49e6027bf0448de14046', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: 'b4c5751d55a3ef5d06e68a1065dc017b455a9d1f', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), orderId && (h("zonos-badge", { key: 'd8c13fb55fe83d1caf26efbd037da866b26af108', badgeColor: "transparent" }, orderId)), h("zonos-text", { key: '5ae6e0d1b42e7d0ab578229d8c9eebcd660b78db', textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), h("zonos-button", { key: '0a3447480fe0ddcff91579602621b9ee70ae2a64', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText)), isTestMode && cartStore.step === 'finish' && (h("div", { key: 'c3374a72c1e2d9350f152c7e2016463bf0a7f02e', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: '7d34001e6798162cbcb1d9ef8949d15617c64362', backgroundColor: "gray-0", buttonColor: "gray-1200", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: 'e217f0bde5d4b0df0220983a32ae8853469d1d23', onClick: () => this.redirectToUrl(`/orders/all`), size: "lg", variant: "primary" }, "View order in Dashboard")))))));
|
|
181
212
|
}
|
|
182
213
|
static get is() { return "zonos-checkout-finish"; }
|
|
183
214
|
static get encapsulation() { return "shadow"; }
|
|
@@ -228,7 +259,7 @@ export class ZonosCheckoutFinish {
|
|
|
228
259
|
"PaymentIntent": {
|
|
229
260
|
"location": "import",
|
|
230
261
|
"path": "@stripe/stripe-js",
|
|
231
|
-
"id": ""
|
|
262
|
+
"id": "node_modules::PaymentIntent"
|
|
232
263
|
}
|
|
233
264
|
}
|
|
234
265
|
},
|
|
@@ -47,6 +47,7 @@
|
|
|
47
47
|
display: flex;
|
|
48
48
|
flex-direction: column;
|
|
49
49
|
flex: 1;
|
|
50
|
+
overscroll-behavior: contain;
|
|
50
51
|
}
|
|
51
52
|
:host .zonos--group::-webkit-scrollbar {
|
|
52
53
|
width: 10px;
|
|
@@ -79,10 +80,15 @@
|
|
|
79
80
|
position: sticky;
|
|
80
81
|
display: flex;
|
|
81
82
|
justify-content: center;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
gap: 12px;
|
|
82
85
|
bottom: 0;
|
|
83
|
-
|
|
86
|
+
padding-top: 12px;
|
|
84
87
|
background: var(--primary-color, var(--zonos-elements-gray-0));
|
|
85
88
|
}
|
|
89
|
+
:host .zonos--group-btn zonos-text {
|
|
90
|
+
text-align: center;
|
|
91
|
+
}
|
|
86
92
|
:host .zonos--group-btn zonos-button {
|
|
87
93
|
width: 100%;
|
|
88
94
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { h, Host, } from "@stencil/core";
|
|
2
2
|
import { cartStore } from "../../../store/checkout/cart";
|
|
3
|
+
import { paypalStore, paypalStoreHasPaypalEnabled, } from "../../../store/checkout/paypal";
|
|
3
4
|
import { stripeStore } from "../../../store/checkout/stripe";
|
|
4
5
|
import { translate } from "../../../store/translationStore";
|
|
5
6
|
import { getIsTestMode } from "../../../utils/checkout/getIsTestMode";
|
|
@@ -23,9 +24,9 @@ export class ZonosCheckoutPayment {
|
|
|
23
24
|
this.showErrorBanner = true;
|
|
24
25
|
return;
|
|
25
26
|
}
|
|
26
|
-
this.continueClicked.emit();
|
|
27
27
|
// submit google tag when the form is complete
|
|
28
28
|
submitGtag('zonos-checkout-payment-info');
|
|
29
|
+
this.continueClicked.emit();
|
|
29
30
|
};
|
|
30
31
|
this.copyCardToClipboard = (cardNumber) => {
|
|
31
32
|
void navigator.clipboard.writeText(cardNumber);
|
|
@@ -35,7 +36,6 @@ export class ZonosCheckoutPayment {
|
|
|
35
36
|
type: 'success',
|
|
36
37
|
});
|
|
37
38
|
};
|
|
38
|
-
this.paymentError = false;
|
|
39
39
|
this.submitBtnType = undefined;
|
|
40
40
|
this.continueLoading = false;
|
|
41
41
|
this.submitBtnColor = undefined;
|
|
@@ -50,14 +50,17 @@ export class ZonosCheckoutPayment {
|
|
|
50
50
|
this.showErrorBanner = !this.handleValidate();
|
|
51
51
|
}
|
|
52
52
|
const isTestMode = getIsTestMode();
|
|
53
|
-
|
|
53
|
+
const hasPaypalEnabled = paypalStoreHasPaypalEnabled();
|
|
54
|
+
return (h(Host, { class: "zonos--checkout-payment zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Payment method')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), stripeStore.hasPaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), h("zonos-payment", null), h("div", { class: "zonos--group-btn" }, h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
|
|
54
55
|
// use primary type when on mobile mode
|
|
55
56
|
variant: this.submitBtnType }, translate('Pay [orderTotal]', {
|
|
56
57
|
orderTotal: currencyFormat({
|
|
57
58
|
amount: cartStore.total,
|
|
58
59
|
currency: cartStore.currency,
|
|
59
60
|
}),
|
|
60
|
-
}))
|
|
61
|
+
})), hasPaypalEnabled && (h("zonos-text", { type: "smallHeader" }, translate('or'))), h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
|
|
62
|
+
this.paypalSessionDone.emit(orderId);
|
|
63
|
+
}, onPaypalSessionFail: () => this.paypalSessionFailed.emit() })), isTestMode && (h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, h("zonos-v-stack", { spacing: 16 }, h("div", null, h("zonos-text", { type: "semiBoldLabel" }, translate('Test cards')), h("zonos-text", { textColor: "gray-700" }, translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), h("zonos-button", { icon: h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, translate('Success'), " (****4242)"), h("zonos-button", { icon: h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, translate('Failure'), " (****0002)")), h("zonos-notification", null))))));
|
|
61
64
|
}
|
|
62
65
|
static get is() { return "zonos-checkout-payment"; }
|
|
63
66
|
static get encapsulation() { return "scoped"; }
|
|
@@ -73,24 +76,6 @@ export class ZonosCheckoutPayment {
|
|
|
73
76
|
}
|
|
74
77
|
static get properties() {
|
|
75
78
|
return {
|
|
76
|
-
"paymentError": {
|
|
77
|
-
"type": "boolean",
|
|
78
|
-
"mutable": false,
|
|
79
|
-
"complexType": {
|
|
80
|
-
"original": "boolean",
|
|
81
|
-
"resolved": "boolean",
|
|
82
|
-
"references": {}
|
|
83
|
-
},
|
|
84
|
-
"required": false,
|
|
85
|
-
"optional": false,
|
|
86
|
-
"docs": {
|
|
87
|
-
"tags": [],
|
|
88
|
-
"text": "Error occurred during payment"
|
|
89
|
-
},
|
|
90
|
-
"attribute": "payment-error",
|
|
91
|
-
"reflect": false,
|
|
92
|
-
"defaultValue": "false"
|
|
93
|
-
},
|
|
94
79
|
"submitBtnType": {
|
|
95
80
|
"type": "string",
|
|
96
81
|
"mutable": false,
|
|
@@ -171,6 +156,36 @@ export class ZonosCheckoutPayment {
|
|
|
171
156
|
"resolved": "void",
|
|
172
157
|
"references": {}
|
|
173
158
|
}
|
|
159
|
+
}, {
|
|
160
|
+
"method": "paypalSessionFailed",
|
|
161
|
+
"name": "paypalSessionFailed",
|
|
162
|
+
"bubbles": true,
|
|
163
|
+
"cancelable": true,
|
|
164
|
+
"composed": true,
|
|
165
|
+
"docs": {
|
|
166
|
+
"tags": [],
|
|
167
|
+
"text": "Event to emit when the paypal session failed"
|
|
168
|
+
},
|
|
169
|
+
"complexType": {
|
|
170
|
+
"original": "void",
|
|
171
|
+
"resolved": "void",
|
|
172
|
+
"references": {}
|
|
173
|
+
}
|
|
174
|
+
}, {
|
|
175
|
+
"method": "paypalSessionDone",
|
|
176
|
+
"name": "paypalSessionDone",
|
|
177
|
+
"bubbles": true,
|
|
178
|
+
"cancelable": true,
|
|
179
|
+
"composed": true,
|
|
180
|
+
"docs": {
|
|
181
|
+
"tags": [],
|
|
182
|
+
"text": "Event to emit when the paypal session is done"
|
|
183
|
+
},
|
|
184
|
+
"complexType": {
|
|
185
|
+
"original": "string",
|
|
186
|
+
"resolved": "string",
|
|
187
|
+
"references": {}
|
|
188
|
+
}
|
|
174
189
|
}];
|
|
175
190
|
}
|
|
176
191
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Fragment, h, Host, } from "@stencil/core";
|
|
2
|
-
import { cartStore, cartStoreNextStep, cartStoreReset, cartStoreResetTabItems, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
|
|
3
|
-
import {
|
|
2
|
+
import { cartStore, cartStoreClearCheckoutInterval, cartStoreNextStep, cartStoreReset, cartStoreResetTabItems, cartStoreStartCheckoutInterval, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
|
|
3
|
+
import { paypalInitScript } from "../../store/checkout/paypal";
|
|
4
|
+
import { initStripeElements, stripeStore, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreHandleInventoryCheck, stripeStoreInitCheckoutSession, stripeStorePrefetchLandedCost, stripeStoreReset, } from "../../store/checkout/stripe";
|
|
4
5
|
import { localizationStore, localizationStoreOnUpdate, } from "../../store/hello/localization";
|
|
5
6
|
import { translate } from "../../store/translationStore";
|
|
6
7
|
import { getZonosStoreTheme, zonosStore, } from "../../store/zonosStore";
|
|
@@ -62,7 +63,6 @@ export class ZonosCheckout {
|
|
|
62
63
|
this.open = this.forceDialogOpen;
|
|
63
64
|
this.stripe = window.Zonos.stripe;
|
|
64
65
|
this.submitLoading = false;
|
|
65
|
-
this.paymentError = false;
|
|
66
66
|
this.collapseReviewMobile = true;
|
|
67
67
|
this.isAttachError = false;
|
|
68
68
|
this.isMobile = false;
|
|
@@ -72,8 +72,6 @@ export class ZonosCheckout {
|
|
|
72
72
|
this.legacyCheckoutHiddenBtnSelector = '#legacy-checkout-hidden-button';
|
|
73
73
|
this.isLegacyCheckout = false;
|
|
74
74
|
this.confirmDialogOpen = false;
|
|
75
|
-
this.showSessionTimoutScreen = false;
|
|
76
|
-
this.checkoutTimeoutInterval = null;
|
|
77
75
|
this.inventoryCheckErrorMessage = null;
|
|
78
76
|
}
|
|
79
77
|
/**
|
|
@@ -115,7 +113,7 @@ export class ZonosCheckout {
|
|
|
115
113
|
// reset the tab item, so that user needs to click on Continue button to re-quote the landed cost if needed.
|
|
116
114
|
cartStoreResetTabItems();
|
|
117
115
|
// clear the checkout session timeout timer when checkout dialog close action is triggered
|
|
118
|
-
|
|
116
|
+
cartStoreClearCheckoutInterval();
|
|
119
117
|
/**
|
|
120
118
|
* Trigger callback when the checkout is closed
|
|
121
119
|
*/
|
|
@@ -148,30 +146,6 @@ export class ZonosCheckout {
|
|
|
148
146
|
await this.applyStripeTheme();
|
|
149
147
|
return true;
|
|
150
148
|
}
|
|
151
|
-
clearCheckoutTimeoutInterval() {
|
|
152
|
-
if (this.checkoutTimeoutInterval) {
|
|
153
|
-
clearTimeout(this.checkoutTimeoutInterval);
|
|
154
|
-
this.checkoutTimeoutInterval = null;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
startCheckoutTimeoutInterval() {
|
|
158
|
-
// do nothing if in preview mode
|
|
159
|
-
if (this.preview) {
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
const timeoutQuery = new URLSearchParams(window.location.search).get('zonosCheckoutTimeout');
|
|
163
|
-
const timeout =
|
|
164
|
-
// timeout query is mainly for testing purpose
|
|
165
|
-
timeoutQuery && !isNaN(parseInt(timeoutQuery, 10))
|
|
166
|
-
? parseInt(timeoutQuery, 10)
|
|
167
|
-
: CHECKOUT_SESSION_TIMEOUT;
|
|
168
|
-
log(`==START CHECKOUT TIMEOUT - ${timeout}==`);
|
|
169
|
-
// start a timer to validate the price
|
|
170
|
-
this.checkoutTimeoutInterval = setTimeout(() => {
|
|
171
|
-
// Show session timeout alert
|
|
172
|
-
this.showSessionTimoutScreen = true;
|
|
173
|
-
}, timeout);
|
|
174
|
-
}
|
|
175
149
|
reloadCheckoutSession() {
|
|
176
150
|
window.location.reload();
|
|
177
151
|
}
|
|
@@ -212,7 +186,10 @@ export class ZonosCheckout {
|
|
|
212
186
|
throw new Error('Error building cart');
|
|
213
187
|
}
|
|
214
188
|
// start the timer to validate the price
|
|
215
|
-
|
|
189
|
+
cartStoreStartCheckoutInterval({
|
|
190
|
+
isPreview: this.preview,
|
|
191
|
+
sessionTimeout: CHECKOUT_SESSION_TIMEOUT,
|
|
192
|
+
});
|
|
216
193
|
submitGtag('zonos-checkout-start');
|
|
217
194
|
void trackConversionEvent('checkout_open');
|
|
218
195
|
}
|
|
@@ -379,6 +356,10 @@ export class ZonosCheckout {
|
|
|
379
356
|
const interval = setInterval(() => {
|
|
380
357
|
if (cartStore.landedCostData || !stripeStore.isFetchingLandedCost) {
|
|
381
358
|
if (cartStore.landedCostData) {
|
|
359
|
+
// start init paypal with the presentment currency when landed cost is fetched
|
|
360
|
+
void paypalInitScript({
|
|
361
|
+
currency: cartStore.currency,
|
|
362
|
+
});
|
|
382
363
|
// only go to next step if landed cost data is ready
|
|
383
364
|
cartStoreNextStep();
|
|
384
365
|
}
|
|
@@ -397,41 +378,31 @@ export class ZonosCheckout {
|
|
|
397
378
|
}
|
|
398
379
|
handleInventoryCheckDialogCancel() {
|
|
399
380
|
// reset inventory check message to close the inventory check alert
|
|
400
|
-
|
|
381
|
+
cartStore.inventoryCheckErrorMessage = null;
|
|
401
382
|
}
|
|
402
383
|
handleInventoryCheckDialogConfirm() {
|
|
403
384
|
// reset inventory check message to close the inventory check alert
|
|
404
|
-
|
|
385
|
+
cartStore.inventoryCheckErrorMessage = null;
|
|
405
386
|
// close the dialog
|
|
406
387
|
void this.closeDialogHandler({ confirmed: true });
|
|
407
388
|
}
|
|
408
|
-
|
|
409
|
-
* Handle inventory check and returns error message if the callback provided.
|
|
410
|
-
*/
|
|
411
|
-
async handleInventoryCheck() {
|
|
412
|
-
const { onInventoryCheck } = zonosStore.checkoutSettings;
|
|
413
|
-
if (typeof onInventoryCheck !== 'function') {
|
|
414
|
-
return null;
|
|
415
|
-
}
|
|
416
|
-
const message = await onInventoryCheck({ items: cartStore.items });
|
|
417
|
-
return message;
|
|
418
|
-
}
|
|
419
|
-
async handleCheckoutPaymentContinue() {
|
|
389
|
+
async handleStripePaymentContinue() {
|
|
420
390
|
// reset error state
|
|
421
|
-
|
|
391
|
+
stripeStore.hasPaymentError = false;
|
|
422
392
|
this.submitLoading = true;
|
|
423
393
|
// reset inventory check message
|
|
424
|
-
|
|
394
|
+
cartStore.inventoryCheckErrorMessage = null;
|
|
425
395
|
try {
|
|
426
396
|
// check inventory before proceeding to payment
|
|
427
|
-
|
|
397
|
+
cartStore.inventoryCheckErrorMessage =
|
|
398
|
+
await stripeStoreHandleInventoryCheck();
|
|
428
399
|
}
|
|
429
400
|
catch (err) {
|
|
430
401
|
// If user provide callback and it throw an exception, default to this message and stop the payment.
|
|
431
|
-
|
|
402
|
+
cartStore.inventoryCheckErrorMessage = translate('Unable to check inventory. Please try again.');
|
|
432
403
|
}
|
|
433
404
|
// Don't proceed to payment if there's an error message
|
|
434
|
-
if (
|
|
405
|
+
if (cartStore.inventoryCheckErrorMessage) {
|
|
435
406
|
// stop the submit loading state
|
|
436
407
|
this.submitLoading = false;
|
|
437
408
|
return;
|
|
@@ -440,11 +411,11 @@ export class ZonosCheckout {
|
|
|
440
411
|
await stripeStoreConfirmPayment();
|
|
441
412
|
cartStoreNextStep();
|
|
442
413
|
// clear the checkout session timeout timer when purchase is complete
|
|
443
|
-
|
|
414
|
+
cartStoreClearCheckoutInterval();
|
|
444
415
|
}
|
|
445
416
|
catch (err) {
|
|
446
417
|
logError(err);
|
|
447
|
-
|
|
418
|
+
stripeStore.hasPaymentError = true;
|
|
448
419
|
}
|
|
449
420
|
this.submitLoading = false;
|
|
450
421
|
}
|
|
@@ -560,14 +531,16 @@ export class ZonosCheckout {
|
|
|
560
531
|
this.isMobile ? '--zonos-elements-gray-0' : null }), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))));
|
|
561
532
|
};
|
|
562
533
|
const renderContent = () => {
|
|
563
|
-
if (
|
|
534
|
+
if (cartStore.checkoutSessionTimeoutShow) {
|
|
564
535
|
return (h("zonos-rest-state", { class: "zonos--session-timeout", restStateSubtitle: translate('Your checkout session has expired. Please reload the page to continue.'), restStateTitle: translate('Session timed out'), restStateType: 'Warning' }, h("zonos-button", { onClick: () => this.reloadCheckoutSession(), variant: "primary" }, translate('Reload'))));
|
|
565
536
|
}
|
|
566
537
|
return (h("div", { class: 'zonos--content', style: {
|
|
567
538
|
'--border-radius': getBorderRadius({ overrideBorderStyle: style }),
|
|
568
539
|
} }, cartStore.step !== 'finish' && cartStore.step !== 'error' && (h(Fragment, null, h("div", { class: "zonos--left", "data-theme": leftSideTheme, style: {
|
|
569
540
|
'--primary-color': !this.isMobile ? colorPrimary : '',
|
|
570
|
-
} }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, isMobile: this.isMobile, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked:
|
|
541
|
+
} }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, isMobile: this.isMobile, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked: async () => {
|
|
542
|
+
await this.handleStripePaymentContinue();
|
|
543
|
+
}, submitBtnColor: submitButtonColor }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), !this.isLegacyCheckout && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() })), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-review", { collapsed: this.collapseReviewMobile, mobile: this.isMobile, onClick: () => {
|
|
571
544
|
// do nothing if it's not mobile
|
|
572
545
|
if (!this.isMobile) {
|
|
573
546
|
return;
|
|
@@ -596,9 +569,9 @@ export class ZonosCheckout {
|
|
|
596
569
|
// Mark user selected confirm to close the dialog
|
|
597
570
|
onConfirmClicked: () => this.closeDialogHandler({ confirmed: true }) }), h("zonos-confirm-dialog", { class: "zonos--inventory-check-failure-dialog", dialogConfirmBtnText: translate('Return to cart'), dialogIntent: "danger",
|
|
598
571
|
// Show dialog if inventory check error message is not null
|
|
599
|
-
dialogOpen: !!
|
|
572
|
+
dialogOpen: !!cartStore.inventoryCheckErrorMessage,
|
|
600
573
|
// If diallog is in open state, the message should not be null
|
|
601
|
-
dialogSubtitle:
|
|
574
|
+
dialogSubtitle: cartStore.inventoryCheckErrorMessage, dialogTitle: translate("Couldn't place order"), dialogType: "alert", onCancelClicked: () => {
|
|
602
575
|
this.handleInventoryCheckDialogCancel();
|
|
603
576
|
},
|
|
604
577
|
// Mark user selected confirm to close the dialog
|
|
@@ -727,7 +700,6 @@ export class ZonosCheckout {
|
|
|
727
700
|
"open": {},
|
|
728
701
|
"stripe": {},
|
|
729
702
|
"submitLoading": {},
|
|
730
|
-
"paymentError": {},
|
|
731
703
|
"collapseReviewMobile": {},
|
|
732
704
|
"isAttachError": {},
|
|
733
705
|
"isMobile": {},
|
|
@@ -737,8 +709,6 @@ export class ZonosCheckout {
|
|
|
737
709
|
"legacyCheckoutHiddenBtnSelector": {},
|
|
738
710
|
"isLegacyCheckout": {},
|
|
739
711
|
"confirmDialogOpen": {},
|
|
740
|
-
"showSessionTimoutScreen": {},
|
|
741
|
-
"checkoutTimeoutInterval": {},
|
|
742
712
|
"inventoryCheckErrorMessage": {}
|
|
743
713
|
};
|
|
744
714
|
}
|
|
@@ -798,7 +768,7 @@ export class ZonosCheckout {
|
|
|
798
768
|
"PaymentIntent": {
|
|
799
769
|
"location": "import",
|
|
800
770
|
"path": "@stripe/stripe-js",
|
|
801
|
-
"id": ""
|
|
771
|
+
"id": "node_modules::PaymentIntent"
|
|
802
772
|
}
|
|
803
773
|
},
|
|
804
774
|
"return": "Promise<void>"
|
|
@@ -51,6 +51,14 @@
|
|
|
51
51
|
padding: 16px;
|
|
52
52
|
padding-top: 0px;
|
|
53
53
|
}
|
|
54
|
+
:host .zonos--country-select .zonos--country-select-content .no-country {
|
|
55
|
+
position: absolute;
|
|
56
|
+
left: 17px;
|
|
57
|
+
}
|
|
58
|
+
:host .zonos--country-select .zonos--country-select-content .zonos--country-filter-content {
|
|
59
|
+
height: 300px;
|
|
60
|
+
display: block;
|
|
61
|
+
}
|
|
54
62
|
:host .zonos--country-select .zonos--country-select-country {
|
|
55
63
|
display: flex;
|
|
56
64
|
gap: 16px;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { h, Host } from "@stencil/core";
|
|
2
2
|
import Fuse from "fuse.js";
|
|
3
3
|
import { localizationStore, localizationStoreUpdateSelectedCountryCode, } from "../../store/hello/localization";
|
|
4
|
+
import { translate } from "../../store/translationStore";
|
|
4
5
|
import { zonosStoreFontFamily } from "../../store/zonosStore";
|
|
5
6
|
// eslint-disable-next-line no-relative-import-paths/no-relative-import-paths
|
|
6
7
|
import GreenCheckDuotoneIcon from "./assets/greenCheckDuotone.svg";
|
|
@@ -16,7 +17,7 @@ export class ZonosCountrySelect {
|
|
|
16
17
|
const input = event.target;
|
|
17
18
|
this.inputValue = input.value;
|
|
18
19
|
// query the country list container
|
|
19
|
-
const countryListSelector = (_a = this.ele.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.zonos--country-
|
|
20
|
+
const countryListSelector = (_a = this.ele.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.zonos--country-filter-content');
|
|
20
21
|
// scroll to top every time the input changes
|
|
21
22
|
if (countryListSelector) {
|
|
22
23
|
countryListSelector.scrollTop = 0;
|
|
@@ -28,21 +29,30 @@ export class ZonosCountrySelect {
|
|
|
28
29
|
componentDidRender() {
|
|
29
30
|
var _a, _b;
|
|
30
31
|
// focus the input on render
|
|
31
|
-
(_b = (_a = this.ele.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.zonos--country-
|
|
32
|
+
(_b = (_a = this.ele.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.zonos--country-filter-content')) === null || _b === void 0 ? void 0 : _b.focus();
|
|
32
33
|
}
|
|
33
34
|
render() {
|
|
34
35
|
const { helloCountryList } = localizationStore;
|
|
35
36
|
const countries = helloCountryList ? Object.values(helloCountryList) : [];
|
|
36
37
|
const fuse = new Fuse(countries, {
|
|
38
|
+
includeScore: true,
|
|
37
39
|
keys: ['displayName'],
|
|
40
|
+
threshold: 0.3,
|
|
38
41
|
});
|
|
39
42
|
const fuseObject = fuse.search(this.inputValue.toLowerCase());
|
|
40
43
|
const filteredCountries = this.inputValue
|
|
41
44
|
? fuseObject.map(country => country.item)
|
|
42
45
|
: countries.sort((a, b) => a.displayName.localeCompare(b.displayName));
|
|
43
|
-
|
|
46
|
+
const isEmpty = !filteredCountries.length;
|
|
47
|
+
return (h(Host, { key: '1e17d188428f8caeb495389f7870c3052d3cfb4a', class: "zonos--elements", style: {
|
|
44
48
|
'--font-family': zonosStoreFontFamily(),
|
|
45
|
-
} }, h("div", { key: '
|
|
49
|
+
} }, h("div", { key: '2f6d0f239a4fad7c48349878b53dc8cb426aa022', class: "zonos--country-select" }, h("zonos-v-stack", { key: '76ad667603fce800457dae6d8951abe97e5db9d8', class: "zonos--country-select-header", spacing: 8 }, h("zonos-select-dialog-header", { key: '091416c3c6b91d3b50dd033d8bca0df79841871b', handleOnClose: () => this.handleOnClose(), label: translate('Select a country') }, h("input", { key: '0c5d12e941bf7824594ebdd4b353ba833b6d9418', class: "zonos--country-select-input", onInput: this.handleInputChange, placeholder: translate('Search countries'), value: this.inputValue }))), h("div", { key: '9ff13fd2b3528ddff2bd379baa0b2ec919a6f928', class: "zonos--country-select-content" }, isEmpty && (h("zonos-text", { key: '9cf46a7a706d335930eeedcc3663571c5dbaaafc', class: "no-country", textColor: "gray-800" }, translate('No countries found'))), h("zonos-virtual-scroll", { key: '297237f0e2179ea95a49ae4872f6cc216026dd47', class: "zonos--country-filter-content", fallbackItemHeight: 34, itemHeights: filteredCountries.map(() => 34), renderItem: index => {
|
|
50
|
+
const country = filteredCountries[index];
|
|
51
|
+
if (!country) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
return (h("button", { class: "zonos--country-select-country", onClick: () => this.countrySelected(country.code) }, h("zonos-country-flag", { class: "zonos--country-flag", countryCode: country.code }), h("zonos-text", { textColor: "gray-800" }, country.displayName), country.code === localizationStore.selectedCountryCode && (h("zonos-icon", { content: GreenCheckDuotoneIcon, size: 20 }))));
|
|
55
|
+
} })))));
|
|
46
56
|
}
|
|
47
57
|
static get is() { return "zonos-country-select"; }
|
|
48
58
|
static get encapsulation() { return "shadow"; }
|
|
@@ -8,9 +8,9 @@ export class ZonosCustomMessage {
|
|
|
8
8
|
}
|
|
9
9
|
render() {
|
|
10
10
|
const messageWithLinks = formatStringWithLinks(this.message);
|
|
11
|
-
return (h(Host, { key: '
|
|
11
|
+
return (h(Host, { key: 'd6d31b58cf5396c136d81a5969b418c79229c930', class: "zonos--elements", style: {
|
|
12
12
|
'--font-family': zonosStoreFontFamily(),
|
|
13
|
-
} }, this.message && (h("zonos-card", { key: '
|
|
13
|
+
} }, this.message && (h("zonos-card", { key: '4c62131117e23bbe475fb6f59a5e9bba8bc7d552', class: "zonos--custom-message", spacing: "12px" }, h("div", { key: '7ec3cbde2204fe0fa3b52844109bf0379677d567', class: "zonos--flex-message" }, h("zonos-icon", { key: 'cad94039767bd3d93fe9995aee34e8eb42fb707c', "aria-label": "Custom message icon", content: this.icon }), h("zonos-text", { key: 'f5bd77fafded83fefd99c45f0a78cf5c72459e47', innerHTML: messageWithLinks }))))));
|
|
14
14
|
}
|
|
15
15
|
static get is() { return "zonos-custom-message"; }
|
|
16
16
|
static get encapsulation() { return "shadow"; }
|
|
@@ -59,7 +59,7 @@ export class ZonosDialog {
|
|
|
59
59
|
const borderStyle = getBorderRadius({
|
|
60
60
|
overrideBorderStyle: this.borderStyle,
|
|
61
61
|
});
|
|
62
|
-
return (h(Host, { key: '
|
|
62
|
+
return (h(Host, { key: '03735385e07c7f6c8a87df42ad95f8c9d9533668', class: classes([
|
|
63
63
|
'zonos--elements',
|
|
64
64
|
this.open && 'open',
|
|
65
65
|
this.isLoading && 'is-loading',
|
|
@@ -71,10 +71,10 @@ export class ZonosDialog {
|
|
|
71
71
|
'--height': this.height || 'initial',
|
|
72
72
|
'--min-height': this.minHeight || '500px',
|
|
73
73
|
'--width': this.width,
|
|
74
|
-
} }, h("div", { key: '
|
|
74
|
+
} }, h("div", { key: 'da5d599e1a247f7e3364e6f5c9b2eae3db9539f5', class: "zonos--backdrop" }), h("div", { key: 'cda1a996d9521c2e0b307f7a03ca3ee3d4915b8d', class: "zonos--dialog-layout", inert: !this.open, onClick: this.clickOutsideDialogHandler }, h("div", { key: '471d8a069d4f580233bdb3e9e971efdb268ef57d', class: "zonos--dialog" }, this.isLoading && (h("div", { key: '57220007aabcaef133c2c0782fa238cc43d63964', class: "zonos--loading" }, h("zonos-spinner", { key: '0298b754341abd61ec07706128d05df5332f915d', size: 30 }))), (this.headerText || !this.noCloseButton) && (h("div", { key: '5103dbc1c7593a8042505f767d8290825f9d10e7', class: "zonos--header" }, this.headerText && (h("h3", { key: 'a2d9cd4c8cb359aa64cf104a172ca960068c20a0', class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { key: 'de9bf8a949344d19fcb8bfb496719282553be194', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler, variant: "subtle" })))), h("div", { key: '1ec2cdca0f186cd0b28602580022ed0cb4b0eec9', class: classes([
|
|
75
75
|
'zonos--body',
|
|
76
76
|
this.noBodyPadding && 'zonos--no-body-padding',
|
|
77
|
-
]) }, h("slot", { key: '
|
|
77
|
+
]) }, h("slot", { key: '5071d921f48bf792a951a390d83b121e32771668' })), h("slot", { key: 'c1818ac301afc845f5b14fd0f2ac9a1fd3a27b99', name: "dialog-footer" })))));
|
|
78
78
|
}
|
|
79
79
|
static get is() { return "zonos-dialog"; }
|
|
80
80
|
static get encapsulation() { return "shadow"; }
|