@zonos/elements 1.3.249 → 1.3.250
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-eca56521.js → cart-fcd1359c.js} +318 -19
- package/dist/cjs/{hasInclusivePrice-e7d67b45.js → hasInclusivePrice-745a8f29.js} +1 -1
- package/dist/cjs/index.cjs.js +7 -7
- package/dist/cjs/{invoice-918f2c2b.js → invoice-f040e147.js} +2 -2
- package/dist/cjs/{isCollectMobileTablet-89911215.js → isCollectMobileTablet-cf92852e.js} +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{localization-878ef681.js → localization-523b793a.js} +660 -0
- package/dist/cjs/{paypal-6acca678.js → paypal-8c98c0a1.js} +29 -2
- package/dist/cjs/{placeTestOrder-f1c1e939.js → placeTestOrder-9b1e09f0.js} +2 -2
- package/dist/cjs/{renderCheckoutCurrency-d9590e81.js → renderCheckoutCurrency-94b6e51d.js} +2 -2
- package/dist/cjs/{zonos-address-display_9.cjs.entry.js → zonos-address-display_8.cjs.entry.js} +3 -79
- package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-card_5.cjs.entry.js +3 -3
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +74 -20
- package/dist/cjs/zonos-checkbox_2.cjs.entry.js +113 -0
- package/dist/cjs/zonos-checkout.cjs.entry.js +52 -3
- package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +2 -2
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
- package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
- package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +6 -6
- package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-store-credit.cjs.entry.js +113 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +49 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +18 -10
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/assets/StoreCreditIcon.svg +3 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.css +139 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.js +137 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +52 -1
- package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +1 -1
- package/dist/collection/components/main/zonos-controller.js +1 -1
- package/dist/collection/components/store/checkout/cart.js +62 -4
- package/dist/collection/components/store/checkout/paypal.js +28 -0
- package/dist/collection/components/store/checkout/storeCredit.js +237 -0
- package/dist/collection/components/store/checkout/stripe.js +2 -1
- package/dist/collection/components/store/translationStore/strings.arabic.js +33 -0
- package/dist/collection/components/store/translationStore/strings.base.js +33 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +33 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +33 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +33 -0
- package/dist/collection/components/store/translationStore/strings.french.js +33 -0
- package/dist/collection/components/store/translationStore/strings.german.js +33 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +33 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +33 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +33 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +33 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +33 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +33 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +33 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +33 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +33 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +33 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +33 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +33 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +33 -0
- package/dist/collection/types/generated/graphql.internal.types.js +589 -0
- package/dist/esm/{cart-efb30253.js → cart-6e465f7b.js} +309 -21
- package/dist/esm/{hasInclusivePrice-565ddbe5.js → hasInclusivePrice-c49d384d.js} +1 -1
- package/dist/esm/index.js +7 -7
- package/dist/esm/{invoice-0e462fcc.js → invoice-d416ba65.js} +2 -2
- package/dist/esm/{isCollectMobileTablet-0bcba25a.js → isCollectMobileTablet-48040572.js} +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{localization-c1aff677.js → localization-f4a7fb5a.js} +660 -0
- package/dist/esm/{paypal-06b67be0.js → paypal-6af6b978.js} +29 -2
- package/dist/esm/{placeTestOrder-6c9a6c8a.js → placeTestOrder-d19ac166.js} +2 -2
- package/dist/esm/{renderCheckoutCurrency-910fea67.js → renderCheckoutCurrency-c8aa8e7e.js} +2 -2
- package/dist/esm/{zonos-address-display_9.entry.js → zonos-address-display_8.entry.js} +4 -79
- package/dist/esm/zonos-address_4.entry.js +2 -2
- package/dist/esm/zonos-card_5.entry.js +3 -3
- package/dist/esm/zonos-cart-items_12.entry.js +74 -20
- package/dist/esm/zonos-checkbox_2.entry.js +108 -0
- package/dist/esm/zonos-checkout.entry.js +52 -3
- package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
- package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
- package/dist/esm/zonos-collect.entry.js +4 -4
- package/dist/esm/zonos-controller.entry.js +2 -2
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_4.entry.js +1 -1
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
- package/dist/esm/zonos-invoice-finish_5.entry.js +6 -6
- package/dist/esm/zonos-invoice.entry.js +4 -4
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-store-credit.entry.js +109 -0
- package/dist/esm-es5/cart-6e465f7b.js +1 -0
- package/dist/esm-es5/hasInclusivePrice-c49d384d.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{invoice-0e462fcc.js → invoice-d416ba65.js} +1 -1
- package/dist/esm-es5/{isCollectMobileTablet-0bcba25a.js → isCollectMobileTablet-48040572.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/localization-f4a7fb5a.js +1 -0
- package/dist/esm-es5/paypal-6af6b978.js +17 -0
- package/dist/esm-es5/{placeTestOrder-6c9a6c8a.js → placeTestOrder-d19ac166.js} +1 -1
- package/dist/esm-es5/{renderCheckoutCurrency-910fea67.js → renderCheckoutCurrency-c8aa8e7e.js} +1 -1
- package/dist/esm-es5/zonos-address-display_8.entry.js +1 -0
- package/dist/esm-es5/zonos-address_4.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 -0
- package/dist/esm-es5/zonos-checkout.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-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-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-store-credit.entry.js +1 -0
- package/dist/scripts/index.d.ts +58 -1
- 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 +1 -0
- package/dist/types/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.d.ts +17 -0
- package/dist/types/components/store/checkout/cart.d.ts +8 -1
- package/dist/types/components/store/checkout/storeCredit.d.ts +111 -0
- package/dist/types/components/store/checkout/stripe.d.ts +1 -1
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +33 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +33 -0
- package/dist/types/components.d.ts +21 -0
- package/dist/types/types/checkout/api/CheckoutSession.d.ts +9 -1
- package/dist/types/types/generated/graphql.internal.types.d.ts +713 -4
- package/dist/types/types/generated/graphql.internal.types.ts +956 -4
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-456c0e52.js → p-13ed3789.js} +1 -1
- package/dist/zonos-elements/{p-0a2abbab.system.entry.js → p-17fbfda0.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8a424412.entry.js → p-1b56814d.entry.js} +1 -1
- package/dist/zonos-elements/p-1e6509d7.js +1 -0
- package/dist/zonos-elements/{p-3ad2a9a3.system.entry.js → p-1f63615f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-2435f196.entry.js +1 -0
- package/dist/zonos-elements/{p-4d4b7faa.entry.js → p-26848428.entry.js} +1 -1
- package/dist/zonos-elements/p-28d62fc8.system.entry.js +1 -0
- package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
- package/dist/zonos-elements/p-2b7ef406.system.js +18 -0
- package/dist/zonos-elements/{p-54c95926.entry.js → p-3827041d.entry.js} +1 -1
- package/dist/zonos-elements/{p-321d2963.js → p-48228d76.js} +1 -1
- package/dist/zonos-elements/p-4d5932ac.system.entry.js +1 -0
- package/dist/zonos-elements/{p-4d081ce8.entry.js → p-59fe8416.entry.js} +1 -1
- package/dist/zonos-elements/{p-101226f3.system.entry.js → p-5ca50862.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-36bea5d5.system.entry.js → p-5fceccc3.system.entry.js} +1 -1
- package/dist/zonos-elements/p-64ad0854.entry.js +1 -0
- package/dist/zonos-elements/{p-c87d3d50.system.js → p-65892fa7.system.js} +1 -1
- package/dist/zonos-elements/{p-b9a4430c.entry.js → p-66e1dc55.entry.js} +1 -1
- package/dist/zonos-elements/{p-09110bb7.system.entry.js → p-7042c6da.system.entry.js} +1 -1
- package/dist/zonos-elements/p-741e07e1.system.entry.js +1 -0
- package/dist/zonos-elements/{p-0aeba2c7.system.js → p-77113201.system.js} +1 -1
- package/dist/zonos-elements/{p-6d37f669.entry.js → p-77c0a02b.entry.js} +1 -1
- package/dist/zonos-elements/{p-a75b3efc.system.entry.js → p-85529818.system.entry.js} +1 -1
- package/dist/zonos-elements/p-8f1ab25c.system.entry.js +1 -0
- package/dist/zonos-elements/{p-1b5f89d5.system.js → p-90b8c428.system.js} +1 -1
- package/dist/zonos-elements/p-997b7eef.js +1 -0
- package/dist/zonos-elements/{p-4c087a8e.system.entry.js → p-9bc5e944.system.entry.js} +1 -1
- package/dist/zonos-elements/p-9c6917ab.system.js +1 -0
- package/dist/zonos-elements/{p-358dfb9e.entry.js → p-9d64783a.entry.js} +1 -1
- package/dist/zonos-elements/{p-1f1bf95c.system.entry.js → p-9f49e35a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3ece0f96.system.entry.js → p-a026b5ad.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4a395eea.system.entry.js → p-a1a3657e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-079bc009.system.entry.js → p-a1b0e9a5.system.entry.js} +1 -1
- package/dist/zonos-elements/p-a6a401e5.system.entry.js +1 -0
- package/dist/zonos-elements/{p-302b7105.system.entry.js → p-b07da3e8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f31fbbf0.entry.js → p-b08bf843.entry.js} +1 -1
- package/dist/zonos-elements/p-b334c76c.entry.js +1 -0
- package/dist/zonos-elements/{p-bc6b33fa.entry.js → p-b9581a92.entry.js} +1 -1
- package/dist/zonos-elements/p-c30a155e.js +1 -0
- package/dist/zonos-elements/{p-9c64ca98.system.entry.js → p-cad67b10.system.entry.js} +1 -1
- package/dist/zonos-elements/p-cc78c9d4.js +17 -0
- package/dist/zonos-elements/{p-5eaa0de1.entry.js → p-d2301d8a.entry.js} +1 -1
- package/dist/zonos-elements/p-d46484aa.entry.js +1 -0
- package/dist/zonos-elements/{p-b589f621.system.entry.js → p-d634f954.system.entry.js} +1 -1
- package/dist/zonos-elements/p-df316670.system.js +1 -0
- package/dist/zonos-elements/p-e331a235.js +1 -0
- package/dist/zonos-elements/p-e4d58bd7.js +1 -0
- package/dist/zonos-elements/{p-8d1efd7b.entry.js → p-e9ca4447.entry.js} +1 -1
- package/dist/zonos-elements/{p-c9e3bc98.system.js → p-f0855df3.system.js} +1 -1
- package/dist/zonos-elements/{p-06e2bc14.entry.js → p-f25e7f5a.entry.js} +1 -1
- package/dist/zonos-elements/{p-b360ee5b.entry.js → p-f4cc124f.entry.js} +1 -1
- package/dist/zonos-elements/{p-bd004403.system.js → p-fa0139c3.system.js} +1 -1
- package/dist/zonos-elements/{p-8b206982.system.js → p-fa5767c3.system.js} +1 -1
- package/dist/zonos-elements/{p-26718a78.entry.js → p-fbfaa4f9.entry.js} +1 -1
- package/dist/zonos-elements/p-fe6cc354.entry.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/zonos-toggle.cjs.entry.js +0 -35
- package/dist/esm/zonos-toggle.entry.js +0 -31
- package/dist/esm-es5/cart-efb30253.js +0 -1
- package/dist/esm-es5/hasInclusivePrice-565ddbe5.js +0 -1
- package/dist/esm-es5/localization-c1aff677.js +0 -1
- package/dist/esm-es5/paypal-06b67be0.js +0 -17
- package/dist/esm-es5/zonos-address-display_9.entry.js +0 -1
- package/dist/esm-es5/zonos-toggle.entry.js +0 -1
- package/dist/zonos-elements/p-096182f0.system.js +0 -1
- package/dist/zonos-elements/p-127e0395.js +0 -17
- package/dist/zonos-elements/p-197d9b23.system.entry.js +0 -1
- package/dist/zonos-elements/p-25dd58f8.system.entry.js +0 -1
- package/dist/zonos-elements/p-445072f8.js +0 -1
- package/dist/zonos-elements/p-507f00d2.js +0 -1
- package/dist/zonos-elements/p-5fd0cd66.system.js +0 -1
- package/dist/zonos-elements/p-661cd4ce.system.entry.js +0 -1
- package/dist/zonos-elements/p-777e0a81.entry.js +0 -1
- package/dist/zonos-elements/p-7e77b055.system.entry.js +0 -1
- package/dist/zonos-elements/p-80524eac.entry.js +0 -1
- package/dist/zonos-elements/p-9eea270b.entry.js +0 -1
- package/dist/zonos-elements/p-c4e358f2.js +0 -1
- package/dist/zonos-elements/p-cda52300.js +0 -1
- package/dist/zonos-elements/p-d233ef0d.entry.js +0 -1
- package/dist/zonos-elements/p-f8f7d491.js +0 -1
- package/dist/zonos-elements/p-fc0aa91e.system.js +0 -18
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const zonosStore = require('./zonosStore-f5a61112.js');
|
|
4
|
-
const cart = require('./cart-
|
|
5
|
-
const localization = require('./localization-
|
|
4
|
+
const cart = require('./cart-fcd1359c.js');
|
|
5
|
+
const localization = require('./localization-523b793a.js');
|
|
6
6
|
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
7
7
|
const isContrastColor = require('./isContrastColor-d1936a5c.js');
|
|
8
8
|
const VarianceTest = require('./VarianceTest-bec00ea8.js');
|
|
@@ -365,6 +365,33 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
|
|
|
365
365
|
if (cart.cartStore.inventoryCheckErrorMessage) {
|
|
366
366
|
return '';
|
|
367
367
|
}
|
|
368
|
+
// Apply store credit if customer has selected an amount
|
|
369
|
+
const storeCreditAmount = cart.storeCreditStoreGetEffectiveAmount();
|
|
370
|
+
if (storeCreditAmount > 0) {
|
|
371
|
+
const storeCreditResult = await cart.storeCreditStoreApplyCredit();
|
|
372
|
+
if (!storeCreditResult.success) {
|
|
373
|
+
paypalStore.paypalErrorMessage =
|
|
374
|
+
storeCreditResult.error ||
|
|
375
|
+
localization.translate('Unable to apply store credit. Please try again.');
|
|
376
|
+
onPaypalFail === null || onPaypalFail === void 0 ? void 0 : onPaypalFail();
|
|
377
|
+
return '';
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
// If store credit covers the full order, create order directly
|
|
381
|
+
if (cart.storeCreditStoreCoversFullAmount()) {
|
|
382
|
+
const orderResult = await cart.storeCreditStoreCreateOrder();
|
|
383
|
+
if (!orderResult.success) {
|
|
384
|
+
paypalStore.paypalErrorMessage =
|
|
385
|
+
orderResult.error ||
|
|
386
|
+
localization.translate('Unable to place order with store credit. Please try again.');
|
|
387
|
+
onPaypalFail === null || onPaypalFail === void 0 ? void 0 : onPaypalFail();
|
|
388
|
+
return '';
|
|
389
|
+
}
|
|
390
|
+
onPaypalSessionDone === null || onPaypalSessionDone === void 0 ? void 0 : onPaypalSessionDone({ orderId: orderResult.orderId || '' });
|
|
391
|
+
cart.cartStoreNextStep();
|
|
392
|
+
cart.cartStoreClearCheckoutInterval();
|
|
393
|
+
return '';
|
|
394
|
+
}
|
|
368
395
|
const paypalOrderId = await paypalStoreCreaterOrder({
|
|
369
396
|
checkoutSessionId,
|
|
370
397
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const cart = require('./cart-
|
|
4
|
-
const localization = require('./localization-
|
|
3
|
+
const cart = require('./cart-fcd1359c.js');
|
|
4
|
+
const localization = require('./localization-523b793a.js');
|
|
5
5
|
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
6
6
|
|
|
7
7
|
const placeTestOrder = async () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const cart = require('./cart-
|
|
4
|
-
const localization = require('./localization-
|
|
3
|
+
const cart = require('./cart-fcd1359c.js');
|
|
4
|
+
const localization = require('./localization-523b793a.js');
|
|
5
5
|
|
|
6
6
|
const getDisplayCurrency = () => {
|
|
7
7
|
var _a, _b;
|
package/dist/cjs/{zonos-address-display_9.cjs.entry.js → zonos-address-display_8.cjs.entry.js}
RENAMED
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b1f95d96.js');
|
|
6
|
-
const localization = require('./localization-
|
|
6
|
+
const localization = require('./localization-523b793a.js');
|
|
7
7
|
const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
|
|
8
|
-
const cart = require('./cart-
|
|
8
|
+
const cart = require('./cart-fcd1359c.js');
|
|
9
9
|
const classes = require('./classes-b7918f56.js');
|
|
10
10
|
const getBorderRadius = require('./getBorderRadius-27a74844.js');
|
|
11
11
|
const zonosStore = require('./zonosStore-f5a61112.js');
|
|
12
12
|
const RemoveIcon$2 = require('./RemoveIcon-081ac073.js');
|
|
13
|
-
const isDarkColor = require('./isDarkColor-a68abf7a.js');
|
|
14
13
|
const throttle = require('./throttle-ff483793.js');
|
|
15
14
|
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
16
15
|
const shouldRenderTaxIdInput = require('./shouldRenderTaxIdInput-b8abf6de.js');
|
|
17
16
|
const VarianceTest = require('./VarianceTest-bec00ea8.js');
|
|
18
17
|
const TaxId = require('./TaxId-12acedde.js');
|
|
19
18
|
const helpers = require('./helpers-5bdbb68c.js');
|
|
19
|
+
const isDarkColor = require('./isDarkColor-a68abf7a.js');
|
|
20
20
|
require('./debounce-0c75ba33.js');
|
|
21
21
|
require('./ShortAddressCode-bec338b0.js');
|
|
22
22
|
|
|
@@ -379,81 +379,6 @@ const ZonosAddressUpdateDialog = class {
|
|
|
379
379
|
};
|
|
380
380
|
ZonosAddressUpdateDialog.style = ZonosAddressUpdateDialogStyle0;
|
|
381
381
|
|
|
382
|
-
const colorPrefixes = [
|
|
383
|
-
'blue',
|
|
384
|
-
'cyan',
|
|
385
|
-
'green',
|
|
386
|
-
'orange',
|
|
387
|
-
'purple',
|
|
388
|
-
'red',
|
|
389
|
-
'gray',
|
|
390
|
-
'glass',
|
|
391
|
-
];
|
|
392
|
-
|
|
393
|
-
const zonosCheckboxCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--zonos--size);width:var(--zonos--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--zonos--background-color);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";
|
|
394
|
-
const ZonosCheckboxStyle0 = zonosCheckboxCss;
|
|
395
|
-
|
|
396
|
-
let inputId$1 = 0;
|
|
397
|
-
const ZonosCheckbox = class {
|
|
398
|
-
constructor(hostRef) {
|
|
399
|
-
index.registerInstance(this, hostRef);
|
|
400
|
-
this.checkboxSelected = index.createEvent(this, "checkboxSelected", 7);
|
|
401
|
-
this.inputId = `zonos--checkbox-${++inputId$1}`;
|
|
402
|
-
/**
|
|
403
|
-
* background color of the checkbox
|
|
404
|
-
*/
|
|
405
|
-
this.backgroundColor = 'blue';
|
|
406
|
-
/**
|
|
407
|
-
* Whether or not the checkbox is checked
|
|
408
|
-
*/
|
|
409
|
-
this.isChecked = false;
|
|
410
|
-
/**
|
|
411
|
-
* Whether or not the checkbox is disabled
|
|
412
|
-
*/
|
|
413
|
-
this.isDisabled = false;
|
|
414
|
-
/**
|
|
415
|
-
* Size of the checkbox
|
|
416
|
-
*/
|
|
417
|
-
this.size = 12;
|
|
418
|
-
/**
|
|
419
|
-
* Font size of the checkbox text
|
|
420
|
-
*/
|
|
421
|
-
this.fontSize = 'base';
|
|
422
|
-
}
|
|
423
|
-
onClick() {
|
|
424
|
-
if (this.isDisabled) {
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
427
|
-
this.checkboxSelected.emit(!this.isChecked);
|
|
428
|
-
}
|
|
429
|
-
render() {
|
|
430
|
-
const isBackgroundVariable = colorPrefixes.includes(this.backgroundColor);
|
|
431
|
-
const backgroundColor = isBackgroundVariable
|
|
432
|
-
? `var(--zonos-elements-${this.backgroundColor}-600)`
|
|
433
|
-
: this.backgroundColor;
|
|
434
|
-
const checkmarkColor = isBackgroundVariable
|
|
435
|
-
? // use lighter color if the color is amino variable
|
|
436
|
-
`var(--zonos-elements-${this.backgroundColor}-200)`
|
|
437
|
-
: // if it's not an amino variable, use white if the background is dark, and dark if the background is light
|
|
438
|
-
!isDarkColor.isDarkColor(backgroundColor)
|
|
439
|
-
? 'var(--zonos-elements-gray-800)'
|
|
440
|
-
: 'var(--zonos-elements-gray-0)';
|
|
441
|
-
const borderStyle = getBorderRadius.getBorderRadius({
|
|
442
|
-
customRoundRadius: '4px',
|
|
443
|
-
overrideBorderStyle: this.borderStyle,
|
|
444
|
-
});
|
|
445
|
-
return (index.h(index.Host, { key: 'c2a9023becafd6d19ad769d449383924c85c641f', class: classes.classes(['zonos--elements zonos--checkbox']), style: {
|
|
446
|
-
'--zonos--background-color': backgroundColor,
|
|
447
|
-
'--zonos--border-radius': borderStyle,
|
|
448
|
-
'--zonos--font-family': zonosStore.zonosStoreFontFamily(),
|
|
449
|
-
'--zonos--size': `${this.size}px`,
|
|
450
|
-
} }, index.h("label", { key: '352e8bda93f1ac9a7a55ba7038e922626c3a9594', class: classes.classes([this.isDisabled && 'disabled']), htmlFor: this.inputId }, index.h("input", { key: '71d664f9d83345ad4c143f71209bdb0a2cb16745', checked: this.isChecked, disabled: this.isDisabled, hidden: true, id: this.inputId, onChange: e => {
|
|
451
|
-
this.checkboxSelected.emit(e.target.checked);
|
|
452
|
-
}, type: "checkbox" }), index.h("span", { key: 'c772c4e8dbbbef8035874616a0254fb4114a97c8', class: "checkmark-container" }, index.h("svg", { key: 'd497191975edeca268cc014431535f4befdd7b2c', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '15b26fdf72a058e81d4472d0c757a725c04e3f47', "clip-rule": "evenodd", d: "M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z", fill: "currentColor", "fill-rule": "evenodd" }))), this.label && (index.h("zonos-text", { key: '2d6015d16eda08dc39eff677f4858d2aed620891', size: this.fontSize }, this.label)))));
|
|
453
|
-
}
|
|
454
|
-
};
|
|
455
|
-
ZonosCheckbox.style = ZonosCheckboxStyle0;
|
|
456
|
-
|
|
457
382
|
const isValidZip = ({ countryFields, zip, }) => {
|
|
458
383
|
if (!countryFields) {
|
|
459
384
|
return true;
|
|
@@ -7422,7 +7347,6 @@ exports.zonos_address_display = ZonosAddressDisplay;
|
|
|
7422
7347
|
exports.zonos_address_form = ZonosAddressForm;
|
|
7423
7348
|
exports.zonos_address_suggestions = ZonosAddressSuggestions;
|
|
7424
7349
|
exports.zonos_address_update_dialog = ZonosAddressUpdateDialog;
|
|
7425
|
-
exports.zonos_checkbox = ZonosCheckbox;
|
|
7426
7350
|
exports.zonos_custom_address = ZonosAddress;
|
|
7427
7351
|
exports.zonos_dialog = ZonosDialog;
|
|
7428
7352
|
exports.zonos_stripe_phone_input = ZonosStripePhoneInput;
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b1f95d96.js');
|
|
6
6
|
const throttle = require('./throttle-ff483793.js');
|
|
7
|
-
const cart = require('./cart-
|
|
8
|
-
const localization = require('./localization-
|
|
7
|
+
const cart = require('./cart-fcd1359c.js');
|
|
8
|
+
const localization = require('./localization-523b793a.js');
|
|
9
9
|
const zonosStore = require('./zonosStore-f5a61112.js');
|
|
10
10
|
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
11
11
|
const shouldRenderTaxIdInput = require('./shouldRenderTaxIdInput-b8abf6de.js');
|
|
@@ -6,10 +6,10 @@ const index = require('./index-b1f95d96.js');
|
|
|
6
6
|
const zonosStore = require('./zonosStore-f5a61112.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
const getBorderRadius = require('./getBorderRadius-27a74844.js');
|
|
9
|
-
const cart = require('./cart-
|
|
10
|
-
const localization = require('./localization-
|
|
9
|
+
const cart = require('./cart-fcd1359c.js');
|
|
10
|
+
const localization = require('./localization-523b793a.js');
|
|
11
11
|
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
12
|
-
const paypal = require('./paypal-
|
|
12
|
+
const paypal = require('./paypal-8c98c0a1.js');
|
|
13
13
|
const VarianceTest = require('./VarianceTest-bec00ea8.js');
|
|
14
14
|
require('./isDarkColor-a68abf7a.js');
|
|
15
15
|
require('./isContrastColor-d1936a5c.js');
|
|
@@ -3,21 +3,21 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b1f95d96.js');
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
const localization = require('./localization-
|
|
8
|
-
const renderCheckoutCurrency = require('./renderCheckoutCurrency-
|
|
6
|
+
const cart = require('./cart-fcd1359c.js');
|
|
7
|
+
const localization = require('./localization-523b793a.js');
|
|
8
|
+
const renderCheckoutCurrency = require('./renderCheckoutCurrency-94b6e51d.js');
|
|
9
9
|
const cleanHtmlMarkdown = require('./cleanHtmlMarkdown-31da84b7.js');
|
|
10
10
|
const classes = require('./classes-b7918f56.js');
|
|
11
11
|
const zonosStore = require('./zonosStore-f5a61112.js');
|
|
12
|
-
const hasInclusivePrice = require('./hasInclusivePrice-
|
|
13
|
-
const paypal = require('./paypal-
|
|
12
|
+
const hasInclusivePrice = require('./hasInclusivePrice-745a8f29.js');
|
|
13
|
+
const paypal = require('./paypal-8c98c0a1.js');
|
|
14
14
|
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
15
15
|
const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
|
|
16
16
|
const getBorderRadius = require('./getBorderRadius-27a74844.js');
|
|
17
17
|
const VarianceTest = require('./VarianceTest-bec00ea8.js');
|
|
18
18
|
const submitGtag = require('./submitGtag-cb4fb332.js');
|
|
19
19
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
20
|
-
const placeTestOrder = require('./placeTestOrder-
|
|
20
|
+
const placeTestOrder = require('./placeTestOrder-9b1e09f0.js');
|
|
21
21
|
const isDarkColor = require('./isDarkColor-a68abf7a.js');
|
|
22
22
|
const getContrastColor = require('./getContrastColor-cc087c53.js');
|
|
23
23
|
const isColorVariable = require('./isColorVariable-525dbfa7.js');
|
|
@@ -300,6 +300,9 @@ const ZonosCartSubtotal = class {
|
|
|
300
300
|
} }), index.h("zonos-button", { loading: this.loading, onClick: () => applyPromoCode(), variant: "primary" }, localization.translate('Apply'))))))), !!cart.cartStore.adjustmentTotal && (index.h("tr", { class: "zonos--row zonos--cart-discount" }, index.h("td", { class: "zonos--column" }), index.h("td", { class: "zonos--column zonos--cart-subtotal-title" }, index.h("div", { class: "zonos--title-with-icon" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, localization.translate('Discounts')))), index.h("td", { class: "zonos--column zonos--cart-subtotal-price" }, index.h("zonos-text", { type: "semiBoldLabel" }, renderCheckoutCurrency.renderCheckoutCurrency({
|
|
301
301
|
amount: cart.cartStore.adjustmentTotal,
|
|
302
302
|
isForeign: true,
|
|
303
|
+
}))))), !!cart.cartStore.storeCredit && (index.h("tr", { class: "zonos--row zonos--cart-store-credit" }, index.h("td", { class: "zonos--column" }), index.h("td", { class: "zonos--column zonos--cart-subtotal-title" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, localization.translate('Store credit'))), index.h("td", { class: "zonos--column zonos--cart-subtotal-price" }, index.h("zonos-text", { textColor: "green-600", type: "semiBoldLabel" }, "-", renderCheckoutCurrency.renderCheckoutCurrency({
|
|
304
|
+
amount: cart.cartStore.storeCredit,
|
|
305
|
+
isForeign: true,
|
|
303
306
|
}))))), index.h("tr", { class: "zonos--row zonos--cart-pay-total" }, index.h("td", { class: "zonos--column" }), index.h("td", { class: "zonos--column" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, localization.translate('Order total'))), index.h("td", { class: "zonos--column zonos--cart-total-price" }, index.h("zonos-text", { type: "semiBoldLabel" }, renderCheckoutCurrency.renderCheckoutCurrency({
|
|
304
307
|
amount: total,
|
|
305
308
|
isForeign: true,
|
|
@@ -730,6 +733,47 @@ const ZonosCheckoutFinish = class {
|
|
|
730
733
|
paypal.paypalStoreReset();
|
|
731
734
|
localization.storageStore.checkoutSessionId = null;
|
|
732
735
|
};
|
|
736
|
+
this.checkStoreCreditOrderStatus = async () => {
|
|
737
|
+
// show success message right away when order id is already created
|
|
738
|
+
this.isLoading = false;
|
|
739
|
+
if (cart.storeCreditStore.orderIdCreated) {
|
|
740
|
+
const checkoutSessionId = localization.storageStore.checkoutSessionId;
|
|
741
|
+
submitGtag.submitGtag({
|
|
742
|
+
event: 'zonos-checkout-success',
|
|
743
|
+
metadata: this.buildPurchaseMetadata({
|
|
744
|
+
checkoutSessionId: checkoutSessionId || '',
|
|
745
|
+
}),
|
|
746
|
+
});
|
|
747
|
+
submitGtag.submitGtag({
|
|
748
|
+
event: 'purchase',
|
|
749
|
+
metadata: this.buildPurchaseMetadata({
|
|
750
|
+
checkoutSessionId: checkoutSessionId || '',
|
|
751
|
+
}),
|
|
752
|
+
});
|
|
753
|
+
void cart.trackConversionEvent({
|
|
754
|
+
checkoutSessionId,
|
|
755
|
+
eventName: 'checkout_orderCompleted',
|
|
756
|
+
});
|
|
757
|
+
this.notificationType = 'success';
|
|
758
|
+
this.notificationTitle = localization.translate("You're all set!");
|
|
759
|
+
this.notificationMessages =
|
|
760
|
+
cart.stripeStoreMessageBasedOnStatus('succeeded').messages;
|
|
761
|
+
// override title if notification type is success
|
|
762
|
+
this.useOverrideSuccessNotification();
|
|
763
|
+
const successEvent = createCustomEvent.createCustomEvent('zonos-checkout-success', {
|
|
764
|
+
message: 'Zonos Checkout successfully processed order',
|
|
765
|
+
});
|
|
766
|
+
document.dispatchEvent(successEvent);
|
|
767
|
+
// wait this to finish before resetting store and checkout session id
|
|
768
|
+
await this.handleSuccessBehavior();
|
|
769
|
+
}
|
|
770
|
+
// reset stores when checkout is finished
|
|
771
|
+
cart.stripeStoreResetPromoCode();
|
|
772
|
+
cart.stripeStoreReset();
|
|
773
|
+
paypal.paypalStoreReset();
|
|
774
|
+
cart.storeCreditStoreReset();
|
|
775
|
+
localization.storageStore.checkoutSessionId = null;
|
|
776
|
+
};
|
|
733
777
|
this.closeClickHandler = () => {
|
|
734
778
|
this.closeClick.emit();
|
|
735
779
|
};
|
|
@@ -762,6 +806,9 @@ const ZonosCheckoutFinish = class {
|
|
|
762
806
|
if (cart.cartStore.isStagingMode) {
|
|
763
807
|
void this.checkStagingOrderStatus();
|
|
764
808
|
}
|
|
809
|
+
else if (cart.storeCreditStore.orderIdCreated) {
|
|
810
|
+
void this.checkStoreCreditOrderStatus();
|
|
811
|
+
}
|
|
765
812
|
else if (paypal.paypalStore.orderIdCreated) {
|
|
766
813
|
void this.checkPaypalPaymentStatus();
|
|
767
814
|
}
|
|
@@ -771,11 +818,11 @@ const ZonosCheckoutFinish = class {
|
|
|
771
818
|
}
|
|
772
819
|
render() {
|
|
773
820
|
const isTestMode = handleFetch.getIsTestMode();
|
|
774
|
-
return (index.h(index.Host, { key: '
|
|
821
|
+
return (index.h(index.Host, { key: 'c74f250bac797f8c000bac4892bc5ab56c0867bb', class: "zonos--checkout-finish zonos--elements", style: {
|
|
775
822
|
'--zonos--border-radius': getBorderRadius.getBorderRadius({
|
|
776
823
|
overrideBorderStyle: this.borderRadius,
|
|
777
824
|
}),
|
|
778
|
-
} }, !this.isLoading && (index.h("div", { key: '
|
|
825
|
+
} }, !this.isLoading && (index.h("div", { key: '5ee705381b0246f5035f512c9d19beba6dc33d4f', class: "zonos--finish-details" }, index.h("div", { key: '1d1a54d8f73535aaada32601c5e771c9fd381104', class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (index.h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), index.h("zonos-text", { key: '68c898ee87166d08bd52702ae8f9bfe51c393076', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), index.h("zonos-text", { key: '98b6eaff782fe34a8dbd258e4c7d0c81c3577bcc', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (index.h("zonos-button", { key: 'ccc5e7973b2e962e22ac56dcad6e33b048621036',
|
|
779
826
|
// Only show loading spinner if it's not an error notification
|
|
780
827
|
loading: this.isWaitingToRedirect &&
|
|
781
828
|
this.notificationType !== 'error', onClick: () => {
|
|
@@ -787,9 +834,9 @@ const ZonosCheckoutFinish = class {
|
|
|
787
834
|
}
|
|
788
835
|
this.closeClickHandler();
|
|
789
836
|
}, size: "md", variant: "primary" }, localization.translate('Close'))), !window.Zonos.isLegacyCheckout &&
|
|
790
|
-
this.shouldRenderKeepShoppingButton() && (index.h("zonos-button", { key: '
|
|
837
|
+
this.shouldRenderKeepShoppingButton() && (index.h("zonos-button", { key: 'cd30bc010f2a3e935d9b80e56389581a9150b021', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode &&
|
|
791
838
|
cart.cartStore.step === 'finish' &&
|
|
792
|
-
this.notificationType === 'success' && (index.h("div", { key: '
|
|
839
|
+
this.notificationType === 'success' && (index.h("div", { key: '458809f316ac5129efbc7fe90d1549c042d477af', class: "zonos--finish-button-wrapper" }, index.h("zonos-button", { key: 'dcf0c595cb119a731c34c1aff09960db8a1fb251', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), index.h("zonos-button", { key: '76d55870370b4906970b3e2109617ba2230eee7e', onClick: () => {
|
|
793
840
|
const isZonosDashboard = window.location.hostname.includes('dashboard.zonos.com');
|
|
794
841
|
this.redirectToUrl(isZonosDashboard
|
|
795
842
|
? '/orders/all'
|
|
@@ -908,7 +955,8 @@ const ZonosCheckoutPayment = class {
|
|
|
908
955
|
*/
|
|
909
956
|
this.continueClickHandler = async ({ currencyCode, }) => {
|
|
910
957
|
var _a, _b;
|
|
911
|
-
|
|
958
|
+
// Skip Stripe payment validation when store credit covers the full order
|
|
959
|
+
if (!cart.storeCreditStoreCoversFullAmount() && !this.handleValidate()) {
|
|
912
960
|
this.showErrorBanner = true;
|
|
913
961
|
// Attempt to submit the form so the missing input error will be shown in Stripe
|
|
914
962
|
void ((_a = cart.stripeStore.stripeElements) === null || _a === void 0 ? void 0 : _a.submit());
|
|
@@ -999,6 +1047,7 @@ const ZonosCheckoutPayment = class {
|
|
|
999
1047
|
const isTestMode = handleFetch.getIsTestMode();
|
|
1000
1048
|
const isStagingMode = cart.cartStore.isStagingMode || handleFetch.getIsStagingMode();
|
|
1001
1049
|
const isPaypalTabSelected = ((_a = cart.stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
|
|
1050
|
+
const storeCreditCoversFullOrder = cart.storeCreditStoreCoversFullAmount();
|
|
1002
1051
|
const renderPayment = () => {
|
|
1003
1052
|
if (isStagingMode) {
|
|
1004
1053
|
const { colorPrimary } = zonosStore.zonosStore.appearance;
|
|
@@ -1014,7 +1063,9 @@ const ZonosCheckoutPayment = class {
|
|
|
1014
1063
|
variant: this.submitBtnType }, localization.translate('Place test order')))));
|
|
1015
1064
|
}
|
|
1016
1065
|
return (index.h(index.Fragment, null, this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, localization.translate('Missing required fields. Make sure all fields are completed.'))), this.hasStripePaymentError && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, cart.stripeStore.customErrorMessage ||
|
|
1017
|
-
localization.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)),
|
|
1066
|
+
localization.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), cart.cartStore.customerAuthenticationToken &&
|
|
1067
|
+
cart.storeCreditStore.availableBalance != null &&
|
|
1068
|
+
cart.storeCreditStore.availableBalance > 0 && (index.h("zonos-store-credit", null)), storeCreditCoversFullOrder ? (index.h("zonos-banner", { intent: "info" }, localization.translate('Store credit covers your full order'))) : (index.h("zonos-payment", null)), index.h("div", { class: "zonos--group-btn" }, (!isPaypalTabSelected || storeCreditCoversFullOrder) && (index.h(index.Fragment, null, index.h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
|
|
1018
1069
|
cart.stripeStore.checkoutSettlementCurrency === 'USD', loading: this.continueLoading &&
|
|
1019
1070
|
cart.stripeStore.checkoutSettlementCurrency !== 'USD', onClick: async () => {
|
|
1020
1071
|
if (!cart.cartStore.checkoutSession) {
|
|
@@ -1027,22 +1078,25 @@ const ZonosCheckoutPayment = class {
|
|
|
1027
1078
|
});
|
|
1028
1079
|
}, size: "lg",
|
|
1029
1080
|
// use primary type when on mobile mode
|
|
1030
|
-
variant: this.submitBtnType },
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1081
|
+
variant: this.submitBtnType }, storeCreditCoversFullOrder
|
|
1082
|
+
? localization.translate('Place order')
|
|
1083
|
+
: localization.translate('Pay [orderTotal]', {
|
|
1084
|
+
orderTotal: renderCheckoutCurrency.renderCheckoutCurrency({
|
|
1085
|
+
amount: cart.cartStore.total,
|
|
1086
|
+
isForeign: true,
|
|
1087
|
+
}),
|
|
1088
|
+
})), !storeCreditCoversFullOrder &&
|
|
1089
|
+
cart.stripeStore.shouldRenderPayInUsdButton && (index.h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
|
|
1036
1090
|
cart.stripeStore.checkoutSettlementCurrency !== 'USD', loading: this.continueLoading &&
|
|
1037
1091
|
cart.stripeStore.checkoutSettlementCurrency === 'USD', onClick: async () => {
|
|
1038
1092
|
await this.continueClickHandler({
|
|
1039
1093
|
currencyCode: 'USD',
|
|
1040
1094
|
});
|
|
1041
|
-
}, size: "lg", variant: "subtle" }, localization.translate('Click to pay in USD'))))), index.h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
|
|
1095
|
+
}, size: "lg", variant: "subtle" }, localization.translate('Click to pay in USD'))))), !storeCreditCoversFullOrder && (index.h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
|
|
1042
1096
|
this.paypalSessionDone.emit(orderId);
|
|
1043
1097
|
}, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
|
|
1044
1098
|
display: isPaypalTabSelected ? 'block' : 'none',
|
|
1045
|
-
} })), isTestMode && (index.h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, index.h("zonos-v-stack", { spacing: 16 }, index.h("div", null, index.h("zonos-text", { type: "semiBoldLabel" }, localization.translate('Test cards')), index.h("zonos-text", { textColor: "gray-700" }, localization.translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), index.h("zonos-button", { icon: index.h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, localization.translate('Success'), " (****4242)"), index.h("zonos-button", { icon: index.h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, localization.translate('Failure'), " (****0002)")), index.h("zonos-notification", null)))));
|
|
1099
|
+
} }))), isTestMode && (index.h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, index.h("zonos-v-stack", { spacing: 16 }, index.h("div", null, index.h("zonos-text", { type: "semiBoldLabel" }, localization.translate('Test cards')), index.h("zonos-text", { textColor: "gray-700" }, localization.translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), index.h("zonos-button", { icon: index.h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, localization.translate('Success'), " (****4242)"), index.h("zonos-button", { icon: index.h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, localization.translate('Failure'), " (****0002)")), index.h("zonos-notification", null)))));
|
|
1046
1100
|
};
|
|
1047
1101
|
return (index.h(index.Host, { class: "zonos--checkout-payment zonos--elements" }, index.h("div", { class: "zonos--group" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, localization.translate('Payment method')), renderPayment())));
|
|
1048
1102
|
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-b1f95d96.js');
|
|
6
|
+
const zonosStore = require('./zonosStore-f5a61112.js');
|
|
7
|
+
const classes = require('./classes-b7918f56.js');
|
|
8
|
+
const getBorderRadius = require('./getBorderRadius-27a74844.js');
|
|
9
|
+
const isDarkColor = require('./isDarkColor-a68abf7a.js');
|
|
10
|
+
require('./VarianceTest-bec00ea8.js');
|
|
11
|
+
|
|
12
|
+
const colorPrefixes = [
|
|
13
|
+
'blue',
|
|
14
|
+
'cyan',
|
|
15
|
+
'green',
|
|
16
|
+
'orange',
|
|
17
|
+
'purple',
|
|
18
|
+
'red',
|
|
19
|
+
'gray',
|
|
20
|
+
'glass',
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const zonosCheckboxCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--zonos--size);width:var(--zonos--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--zonos--background-color);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";
|
|
24
|
+
const ZonosCheckboxStyle0 = zonosCheckboxCss;
|
|
25
|
+
|
|
26
|
+
let inputId = 0;
|
|
27
|
+
const ZonosCheckbox = class {
|
|
28
|
+
constructor(hostRef) {
|
|
29
|
+
index.registerInstance(this, hostRef);
|
|
30
|
+
this.checkboxSelected = index.createEvent(this, "checkboxSelected", 7);
|
|
31
|
+
this.inputId = `zonos--checkbox-${++inputId}`;
|
|
32
|
+
/**
|
|
33
|
+
* background color of the checkbox
|
|
34
|
+
*/
|
|
35
|
+
this.backgroundColor = 'blue';
|
|
36
|
+
/**
|
|
37
|
+
* Whether or not the checkbox is checked
|
|
38
|
+
*/
|
|
39
|
+
this.isChecked = false;
|
|
40
|
+
/**
|
|
41
|
+
* Whether or not the checkbox is disabled
|
|
42
|
+
*/
|
|
43
|
+
this.isDisabled = false;
|
|
44
|
+
/**
|
|
45
|
+
* Size of the checkbox
|
|
46
|
+
*/
|
|
47
|
+
this.size = 12;
|
|
48
|
+
/**
|
|
49
|
+
* Font size of the checkbox text
|
|
50
|
+
*/
|
|
51
|
+
this.fontSize = 'base';
|
|
52
|
+
}
|
|
53
|
+
onClick() {
|
|
54
|
+
if (this.isDisabled) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
this.checkboxSelected.emit(!this.isChecked);
|
|
58
|
+
}
|
|
59
|
+
render() {
|
|
60
|
+
const isBackgroundVariable = colorPrefixes.includes(this.backgroundColor);
|
|
61
|
+
const backgroundColor = isBackgroundVariable
|
|
62
|
+
? `var(--zonos-elements-${this.backgroundColor}-600)`
|
|
63
|
+
: this.backgroundColor;
|
|
64
|
+
const checkmarkColor = isBackgroundVariable
|
|
65
|
+
? // use lighter color if the color is amino variable
|
|
66
|
+
`var(--zonos-elements-${this.backgroundColor}-200)`
|
|
67
|
+
: // if it's not an amino variable, use white if the background is dark, and dark if the background is light
|
|
68
|
+
!isDarkColor.isDarkColor(backgroundColor)
|
|
69
|
+
? 'var(--zonos-elements-gray-800)'
|
|
70
|
+
: 'var(--zonos-elements-gray-0)';
|
|
71
|
+
const borderStyle = getBorderRadius.getBorderRadius({
|
|
72
|
+
customRoundRadius: '4px',
|
|
73
|
+
overrideBorderStyle: this.borderStyle,
|
|
74
|
+
});
|
|
75
|
+
return (index.h(index.Host, { key: 'c2a9023becafd6d19ad769d449383924c85c641f', class: classes.classes(['zonos--elements zonos--checkbox']), style: {
|
|
76
|
+
'--zonos--background-color': backgroundColor,
|
|
77
|
+
'--zonos--border-radius': borderStyle,
|
|
78
|
+
'--zonos--font-family': zonosStore.zonosStoreFontFamily(),
|
|
79
|
+
'--zonos--size': `${this.size}px`,
|
|
80
|
+
} }, index.h("label", { key: '352e8bda93f1ac9a7a55ba7038e922626c3a9594', class: classes.classes([this.isDisabled && 'disabled']), htmlFor: this.inputId }, index.h("input", { key: '71d664f9d83345ad4c143f71209bdb0a2cb16745', checked: this.isChecked, disabled: this.isDisabled, hidden: true, id: this.inputId, onChange: e => {
|
|
81
|
+
this.checkboxSelected.emit(e.target.checked);
|
|
82
|
+
}, type: "checkbox" }), index.h("span", { key: 'c772c4e8dbbbef8035874616a0254fb4114a97c8', class: "checkmark-container" }, index.h("svg", { key: 'd497191975edeca268cc014431535f4befdd7b2c', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '15b26fdf72a058e81d4472d0c757a725c04e3f47', "clip-rule": "evenodd", d: "M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z", fill: "currentColor", "fill-rule": "evenodd" }))), this.label && (index.h("zonos-text", { key: '2d6015d16eda08dc39eff677f4858d2aed620891', size: this.fontSize }, this.label)))));
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
ZonosCheckbox.style = ZonosCheckboxStyle0;
|
|
86
|
+
|
|
87
|
+
const zonosToggleCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .wrapper{position:relative;border-radius:6px;background-color:var(--zonos-elements-gray-50);display:-ms-flexbox;display:flex}:host .zonos--toggle-selected-slider{z-index:1;position:absolute;background-color:var(--zonos-elements-raised-surface-color);height:100%;-webkit-box-shadow:var(--zonos-elements-shadow-button-standard);box-shadow:var(--zonos-elements-shadow-button-standard);border-radius:6px;-webkit-animation:translate 0.3s ease-in-out;animation:translate 0.3s ease-in-out}:host .zonos--option{background:transparent;border:0;z-index:2;cursor:pointer;padding:4px 12px;border-radius:6px;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);font-size:var(--zonos-elements-font-size-base);font-weight:500;color:var(--zonos-elements-text-color-secondary)}:host .zonos--option:focus{outline:none}:host .zonos--option:hover:not(.selected){color:var(--zonos-elements-text-color)}:host .zonos--option.selected{color:var(--zonos-elements-text-color);background-color:var(--zonos-elements-raised-surface-color);height:100%;-webkit-box-shadow:var(--zonos-elements-shadow-button-standard);box-shadow:var(--zonos-elements-shadow-button-standard);border-radius:6px;-webkit-animation:translate 0.3s ease-in-out;animation:translate 0.3s ease-in-out}";
|
|
88
|
+
const ZonosToggleStyle0 = zonosToggleCss;
|
|
89
|
+
|
|
90
|
+
const ZonosToggle = class {
|
|
91
|
+
constructor(hostRef) {
|
|
92
|
+
index.registerInstance(this, hostRef);
|
|
93
|
+
this.toggleChanged = index.createEvent(this, "toggleChanged", 7);
|
|
94
|
+
/**
|
|
95
|
+
* Options for the toggle
|
|
96
|
+
*/
|
|
97
|
+
this.options = [];
|
|
98
|
+
}
|
|
99
|
+
render() {
|
|
100
|
+
return (index.h(index.Host, { key: 'e6be1b38ea1fd978a231a1c3dc85a92c1d86a24b', class: classes.classes(['zonos--elements zonos--toggle']), style: {
|
|
101
|
+
'--zonos--font-family': zonosStore.zonosStoreFontFamily(),
|
|
102
|
+
} }, index.h("div", { key: 'e9ccac29c3f653e3e9d81d336089d6aaea6bbf6c', class: "wrapper" }, this.options.map(option => {
|
|
103
|
+
const selected = option.value === this.value;
|
|
104
|
+
return (index.h("button", { class: classes.classes(['zonos--option', selected && 'selected']), key: option.value, onClick: () => {
|
|
105
|
+
this.toggleChanged.emit(option.value);
|
|
106
|
+
} }, option.label));
|
|
107
|
+
}))));
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
ZonosToggle.style = ZonosToggleStyle0;
|
|
111
|
+
|
|
112
|
+
exports.zonos_checkbox = ZonosCheckbox;
|
|
113
|
+
exports.zonos_toggle = ZonosToggle;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b1f95d96.js');
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
const paypal = require('./paypal-
|
|
8
|
-
const localization = require('./localization-
|
|
6
|
+
const cart = require('./cart-fcd1359c.js');
|
|
7
|
+
const paypal = require('./paypal-8c98c0a1.js');
|
|
8
|
+
const localization = require('./localization-523b793a.js');
|
|
9
9
|
const zonosStore = require('./zonosStore-f5a61112.js');
|
|
10
10
|
const buildCartItemsByTempCart = require('./buildCartItemsByTempCart-edddbf4b.js');
|
|
11
11
|
const handleFetch = require('./handleFetch-954f30e1.js');
|
|
@@ -1667,6 +1667,55 @@ const ZonosCheckout = class {
|
|
|
1667
1667
|
this.submitLoading = false;
|
|
1668
1668
|
return;
|
|
1669
1669
|
}
|
|
1670
|
+
// Apply store credit if customer has selected an amount
|
|
1671
|
+
const storeCreditAmount = cart.storeCreditStoreGetEffectiveAmount();
|
|
1672
|
+
if (storeCreditAmount > 0) {
|
|
1673
|
+
const storeCreditResult = await cart.storeCreditStoreApplyCredit();
|
|
1674
|
+
if (!storeCreditResult.success) {
|
|
1675
|
+
cart.stripeStore.hasPaymentError = true;
|
|
1676
|
+
cart.stripeStore.customErrorMessage =
|
|
1677
|
+
storeCreditResult.error ||
|
|
1678
|
+
localization.translate('Unable to apply store credit. Please try again.');
|
|
1679
|
+
this.submitLoading = false;
|
|
1680
|
+
return;
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
// If store credit covers the full order, create order directly without payment
|
|
1684
|
+
if (cart.storeCreditStoreCoversFullAmount()) {
|
|
1685
|
+
try {
|
|
1686
|
+
// Validate checkout session (landed cost ID, etc.) before creating order
|
|
1687
|
+
const checkoutSessionStatus = await cart.validateCheckoutSession();
|
|
1688
|
+
if (!checkoutSessionStatus.valid) {
|
|
1689
|
+
cart.stripeStore.hasPaymentError = true;
|
|
1690
|
+
cart.stripeStore.customErrorMessage = checkoutSessionStatus.errorMessage;
|
|
1691
|
+
this.submitLoading = false;
|
|
1692
|
+
return;
|
|
1693
|
+
}
|
|
1694
|
+
const orderResult = await cart.storeCreditStoreCreateOrder();
|
|
1695
|
+
if (!orderResult.success) {
|
|
1696
|
+
cart.stripeStore.hasPaymentError = true;
|
|
1697
|
+
cart.stripeStore.customErrorMessage =
|
|
1698
|
+
orderResult.error ||
|
|
1699
|
+
localization.translate('Unable to place order with store credit. Please try again.');
|
|
1700
|
+
this.submitLoading = false;
|
|
1701
|
+
return;
|
|
1702
|
+
}
|
|
1703
|
+
cart.cartStoreNextStep();
|
|
1704
|
+
cart.cartStoreClearCheckoutInterval();
|
|
1705
|
+
}
|
|
1706
|
+
catch (err) {
|
|
1707
|
+
handleFetch.logError(err);
|
|
1708
|
+
submitGtag.submitGtag({
|
|
1709
|
+
event: 'zonos-checkout-payment-fail',
|
|
1710
|
+
metadata: {
|
|
1711
|
+
checkoutSessionId: localization.storageStore.checkoutSessionId,
|
|
1712
|
+
},
|
|
1713
|
+
});
|
|
1714
|
+
cart.stripeStore.hasPaymentError = true;
|
|
1715
|
+
}
|
|
1716
|
+
this.submitLoading = false;
|
|
1717
|
+
return;
|
|
1718
|
+
}
|
|
1670
1719
|
try {
|
|
1671
1720
|
await cart.stripeStoreConfirmPayment();
|
|
1672
1721
|
cart.cartStoreNextStep();
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-b1f95d96.js');
|
|
6
|
-
const cart = require('./cart-
|
|
6
|
+
const cart = require('./cart-fcd1359c.js');
|
|
7
7
|
const cleanHtmlMarkdown = require('./cleanHtmlMarkdown-31da84b7.js');
|
|
8
8
|
const zonosStore = require('./zonosStore-f5a61112.js');
|
|
9
9
|
const classes = require('./classes-b7918f56.js');
|
|
10
10
|
const styles = require('./styles-d1e64fb9.js');
|
|
11
|
-
require('./localization-
|
|
11
|
+
require('./localization-523b793a.js');
|
|
12
12
|
require('./handleFetch-954f30e1.js');
|
|
13
13
|
require('./VarianceTest-bec00ea8.js');
|
|
14
14
|
require('./isDarkColor-a68abf7a.js');
|