@zonos/elements 1.3.68 → 1.3.70
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-8a585d9b.js → cart-11d066b2.js} +165 -56
- package/dist/cjs/{createCustomEvent-1ad96183.js → createCustomEvent-68af46cb.js} +1 -1
- package/dist/cjs/index.cjs.js +8 -8
- package/dist/cjs/{paypal-81274880.js → paypal-aa0570f4.js} +1 -1
- package/dist/cjs/zonos-address_8.cjs.entry.js +1 -1
- package/dist/cjs/zonos-badge_13.cjs.entry.js +14 -16
- package/dist/cjs/zonos-checkout.cjs.entry.js +14 -10
- package/dist/cjs/zonos-controller.cjs.entry.js +5 -1
- 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-hello-dialog.cjs.entry.js +1 -1
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_3.cjs.entry.js +2 -2
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +11 -7
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +10 -12
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +1 -1
- package/dist/collection/components/store/checkout/cart.js +31 -29
- package/dist/collection/components/store/checkout/stripe.js +9 -9
- package/dist/collection/components/store/translationStore/strings.arabic.js +6 -0
- package/dist/collection/components/store/translationStore/strings.base.js +6 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +6 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +6 -0
- package/dist/collection/components/store/translationStore/strings.french.js +6 -0
- package/dist/collection/components/store/translationStore/strings.german.js +6 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +6 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +6 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +6 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +6 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +6 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +6 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +6 -0
- package/dist/collection/components/store/translationStore.js +3 -3
- package/dist/collection/components/utils/hello/currencyConversion/currencyDisplay.js +2 -1
- package/dist/collection/components/utils/hello/currencyConversion/currencyFormat.js +3 -3
- package/dist/collection/components/utils/hello/initHello.js +4 -0
- package/dist/collection/scripts/_zonosBase.js +1 -1
- package/dist/collection/types/generated/graphql.customer.types.js +13 -0
- package/dist/esm/{cart-53bd48de.js → cart-7f82d6bf.js} +165 -56
- package/dist/esm/{createCustomEvent-0376082a.js → createCustomEvent-3a894453.js} +1 -1
- package/dist/esm/index.js +8 -8
- package/dist/esm/{paypal-09ebeb63.js → paypal-91a34d75.js} +1 -1
- package/dist/esm/zonos-address_8.entry.js +1 -1
- package/dist/esm/zonos-badge_13.entry.js +14 -16
- package/dist/esm/zonos-checkout.entry.js +14 -10
- package/dist/esm/zonos-controller.entry.js +5 -1
- 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-hello-dialog.entry.js +1 -1
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_3.entry.js +2 -2
- package/dist/esm/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/esm-es5/cart-7f82d6bf.js +1 -0
- package/dist/esm-es5/{createCustomEvent-0376082a.js → createCustomEvent-3a894453.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-09ebeb63.js → paypal-91a34d75.js} +1 -1
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.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-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
- package/dist/scripts/index.d.ts +14 -10
- 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/store/checkout/cart.d.ts +4 -5
- package/dist/types/components/store/checkout/stripe.d.ts +2 -2
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +6 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +6 -0
- package/dist/types/components/store/translationStore.d.ts +4 -3
- package/dist/types/types/generated/graphql.customer.types.d.ts +47 -37
- package/dist/types/types/generated/graphql.customer.types.ts +57 -40
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-f3d02a32.js → p-11c9a75c.js} +1 -1
- package/dist/zonos-elements/{p-9a868fb6.entry.js → p-12fa5286.entry.js} +1 -1
- package/dist/zonos-elements/{p-a58cb682.system.entry.js → p-2264efbe.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-05478b55.js → p-229f7399.js} +1 -1
- package/dist/zonos-elements/{p-d9c86ca5.system.entry.js → p-351f3207.system.entry.js} +1 -1
- package/dist/zonos-elements/p-3b904bf5.js +1 -0
- package/dist/zonos-elements/{p-bf8ae6bb.entry.js → p-3f0eb9df.entry.js} +1 -1
- package/dist/zonos-elements/p-43a5653e.system.entry.js +1 -0
- package/dist/zonos-elements/p-45dcfef2.system.js +1 -0
- package/dist/zonos-elements/{p-54bacb24.system.js → p-52c9d64e.system.js} +1 -1
- package/dist/zonos-elements/{p-3b1a5f38.entry.js → p-68e27f6d.entry.js} +1 -1
- package/dist/zonos-elements/{p-917aced6.system.entry.js → p-70794698.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b3eed5e5.system.js → p-7348fcb1.system.js} +1 -1
- package/dist/zonos-elements/{p-e2e28c07.system.entry.js → p-76faa16f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-77b8c1b6.entry.js +1 -0
- package/dist/zonos-elements/p-7a4fc640.entry.js +1 -0
- package/dist/zonos-elements/{p-12ade4bb.system.entry.js → p-88a79bdb.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9a5a403b.system.entry.js → p-96702555.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0f90a98b.entry.js → p-a048ee0a.entry.js} +1 -1
- package/dist/zonos-elements/{p-ef0913d2.system.entry.js → p-b2b52158.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4a4ce63c.entry.js → p-c71c9fbd.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-f8acfefd.system.entry.js → p-c93473ba.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-11bcfa61.system.entry.js → p-cc779ac1.system.entry.js} +1 -1
- package/dist/zonos-elements/p-d491eab9.system.entry.js +1 -0
- package/dist/zonos-elements/{p-6f087aaf.entry.js → p-d559e191.entry.js} +1 -1
- package/dist/zonos-elements/p-da400c8f.entry.js +1 -0
- package/dist/zonos-elements/{p-e7347556.entry.js → p-ddd3099b.entry.js} +1 -1
- package/dist/zonos-elements/p-fce17550.entry.js +1 -0
- package/dist/zonos-elements/{p-1d4b6884.system.js → p-fff15925.system.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-53bd48de.js +0 -1
- package/dist/zonos-elements/p-12e3af70.system.entry.js +0 -1
- package/dist/zonos-elements/p-4baa8211.entry.js +0 -1
- package/dist/zonos-elements/p-5b0470ad.entry.js +0 -1
- package/dist/zonos-elements/p-aaa4693a.system.js +0 -1
- package/dist/zonos-elements/p-cfe17508.js +0 -1
- package/dist/zonos-elements/p-e3b0a988.entry.js +0 -1
- package/dist/zonos-elements/p-f4a27b43.entry.js +0 -1
- package/dist/zonos-elements/p-ff905aef.system.entry.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, a as getAssetPath, F as Fragment, c as createEvent, d as getElement } from './index-86b8247e.js';
|
|
2
2
|
import { d as zonosStoreFontFamily, z as zonosStore, g as getZonosStoreTheme } from './zonosStore-0dc7a947.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { d as cartStore, E as currencyFormat, F as cartStoreHasOneEligibleItem, t as translate, v as stripeStoreReset, j as stripeStore, G as stripeStoreRetrievePayment, H as stripeStoreMessageBasedOnStatus, l as localizationStore, I as stripeStoreTranslateAddressToLatin, J as cartStoreUpdateSelectedShippingOption, K as cartStoreGetShippingTransitInfo } from './cart-
|
|
5
|
-
import { s as submitGtag, a as paypalStore, b as paypalStoreReset, c as paypalStoreHasPaypalEnabled, i as isContrastColor } from './paypal-
|
|
6
|
-
import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-
|
|
4
|
+
import { d as cartStore, E as currencyFormat, F as cartStoreHasOneEligibleItem, t as translate, v as stripeStoreReset, j as stripeStore, G as stripeStoreRetrievePayment, H as stripeStoreMessageBasedOnStatus, l as localizationStore, I as stripeStoreTranslateAddressToLatin, J as cartStoreUpdateSelectedShippingOption, K as cartStoreGetShippingTransitInfo } from './cart-7f82d6bf.js';
|
|
5
|
+
import { s as submitGtag, a as paypalStore, b as paypalStoreReset, c as paypalStoreHasPaypalEnabled, i as isContrastColor } from './paypal-91a34d75.js';
|
|
6
|
+
import { t as trackConversionEvent, c as createCustomEvent, g as getIsTestMode } from './createCustomEvent-3a894453.js';
|
|
7
7
|
import { g as getBorderRadius } from './getBorderRadius-cff1e39b.js';
|
|
8
8
|
import { h as handleFetch, s as sendErrorLog } from './handleFetch-80ecfb91.js';
|
|
9
9
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
@@ -175,7 +175,7 @@ const ZonosCartSubtotal = class {
|
|
|
175
175
|
if (!cartStore.selectedShippingOption) {
|
|
176
176
|
return (h(Fragment, null, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Shipping')), h("zonos-text", { class: "zonos--caption", type: "caption" }, translate('No shipping method selected'))));
|
|
177
177
|
}
|
|
178
|
-
return (h(Fragment, null, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, cartStore.selectedShippingOption.displayName), cartStore.selectedShippingOptionTransitTime && (h("zonos-text", { class: "zonos--caption", type: "caption" }, cartStore.selectedShippingOptionTransitTime
|
|
178
|
+
return (h(Fragment, null, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, cartStore.selectedShippingOption.displayName), cartStore.selectedShippingOptionTransitTime && (h("zonos-text", { class: "zonos--caption", type: "caption" }, cartStore.selectedShippingOptionTransitTime))));
|
|
179
179
|
};
|
|
180
180
|
return (h(Host, { class: "zonos--cart-subtotal zonos--elements" }, h("table", { class: "zonos--cart-table" }, h("tr", { class: "zonos--row zonos--cart-subtotal" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { type: "semiBoldLabel" }, translate('Cart subtotal'))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("zonos-text", { type: "semiBoldLabel" }, currencyFormat({
|
|
181
181
|
amount: subtotal,
|
|
@@ -1097,24 +1097,22 @@ const ZonosShipping = class {
|
|
|
1097
1097
|
};
|
|
1098
1098
|
this.initServiceLevels = () => {
|
|
1099
1099
|
var _a;
|
|
1100
|
-
const serviceLevels = ((_a = cartStore.shippingData) === null || _a === void 0 ? void 0 : _a.
|
|
1100
|
+
const serviceLevels = ((_a = cartStore.shippingData) === null || _a === void 0 ? void 0 : _a.flatMap(item => {
|
|
1101
1101
|
var _a;
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1108
|
-
: '';
|
|
1102
|
+
const transitData = cartStoreGetShippingTransitInfo(item);
|
|
1103
|
+
if (!transitData) {
|
|
1104
|
+
return [];
|
|
1105
|
+
}
|
|
1106
|
+
const { maxTransit, minTransit, unit } = transitData;
|
|
1107
|
+
const sublabel = minTransit && maxTransit ? `${minTransit}-${maxTransit} ${unit}` : '';
|
|
1109
1108
|
const foundShipmentRating = (_a = cartStore.landedCostData) === null || _a === void 0 ? void 0 : _a.find(landedCostItem => { var _a; return ((_a = landedCostItem.landedCost) === null || _a === void 0 ? void 0 : _a.shipmentRating.id) === item.id; });
|
|
1110
1109
|
if (!foundShipmentRating) {
|
|
1111
1110
|
// exclude shipping method if there is no matching landed cost data
|
|
1112
|
-
return
|
|
1111
|
+
return [];
|
|
1113
1112
|
}
|
|
1114
1113
|
const shippingAmount = foundShipmentRating.subtotals.shipping;
|
|
1115
1114
|
return {
|
|
1116
1115
|
amount: shippingAmount,
|
|
1117
|
-
caption,
|
|
1118
1116
|
label: item.displayName,
|
|
1119
1117
|
price: currencyFormat({
|
|
1120
1118
|
amount: shippingAmount,
|
|
@@ -1123,7 +1121,7 @@ const ZonosShipping = class {
|
|
|
1123
1121
|
sublabel,
|
|
1124
1122
|
value: item.id,
|
|
1125
1123
|
};
|
|
1126
|
-
})
|
|
1124
|
+
})) || [];
|
|
1127
1125
|
// sort service level by price
|
|
1128
1126
|
this.serviceLevels = sortServiceLevelOptions(serviceLevels);
|
|
1129
1127
|
};
|
|
@@ -1157,7 +1155,7 @@ const ZonosShipping = class {
|
|
|
1157
1155
|
if (this.showErrorBanner) {
|
|
1158
1156
|
this.showErrorBanner = !this.handleValidate();
|
|
1159
1157
|
}
|
|
1160
|
-
return (h(Host, { key: '
|
|
1158
|
+
return (h(Host, { key: '44917386c8ec8a19f8eacb9d4e76b479adc2cd54', class: "zonos--shipping zonos--elements" }, h("div", { key: '9de59b5b3e7c8fe2f8b1e9a83c1ef6119106c2ca', class: "zonos--group" }, h("zonos-text", { key: '7ef2d5c73659c625e60197c3789ff8517a1f0d57', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!((_a = this.serviceLevels) === null || _a === void 0 ? void 0 : _a.length) && (h("zonos-banner", { key: '9242f584733edb0af000a403a5f578e2859d5bd8', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: '1436b0da67bb61146af2bfbd72d9aea613114e69', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !((_b = this.serviceLevels) === null || _b === void 0 ? void 0 : _b.length) ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), intent: "error" })) : (h("zonos-shipping-rich-radio", { initialSelectedValue: (_c = this.selectedShippingMethod) === null || _c === void 0 ? void 0 : _c.value, items: this.serviceLevels, onRadioSelected: e => this.handleRadioSelected(e) })), h("div", { key: '856d1e0d7ce8d85617774edd4e2bcc7e78cf29c7', class: "zonos--group-btn" }, h("zonos-button", { key: 'f89c93131977958205f60aa651a6eac19d9c102e', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
1161
1159
|
// use primary type when on mobile mode
|
|
1162
1160
|
variant: this.submitBtnType }, translate('Go to payment'))))));
|
|
1163
1161
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, F as Fragment } from './index-86b8247e.js';
|
|
2
|
-
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreStartCheckoutInterval, n as cartStoreUpdateToErrorState, t as translate, o as cartStoreSetCheckoutSession, p as stripeStorePrefetchLandedCost, q as cartStoreNextStep, r as stripeStoreHandleInventoryCheck, u as stripeStoreConfirmPayment, v as stripeStoreReset, w as localizationStoreOnUpdate } from './cart-
|
|
3
|
-
import { s as submitGtag, p as paypalInitScript } from './paypal-
|
|
2
|
+
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as cartStoreClearCheckoutInterval, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreStartCheckoutInterval, n as cartStoreUpdateToErrorState, t as translate, o as cartStoreSetCheckoutSession, p as stripeStorePrefetchLandedCost, q as cartStoreNextStep, r as stripeStoreHandleInventoryCheck, u as stripeStoreConfirmPayment, v as stripeStoreReset, w as localizationStoreOnUpdate } from './cart-7f82d6bf.js';
|
|
3
|
+
import { s as submitGtag, p as paypalInitScript } from './paypal-91a34d75.js';
|
|
4
4
|
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-0dc7a947.js';
|
|
5
|
-
import { c as createCustomEvent, t as trackConversionEvent, g as getIsTestMode } from './createCustomEvent-
|
|
5
|
+
import { c as createCustomEvent, t as trackConversionEvent, g as getIsTestMode } from './createCustomEvent-3a894453.js';
|
|
6
6
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
7
7
|
import { l as log, a as logError, s as sendErrorLog } from './handleFetch-80ecfb91.js';
|
|
8
8
|
import { c as classes } from './classes-0d95c529.js';
|
|
@@ -178,7 +178,7 @@ const ZonosCheckout = class {
|
|
|
178
178
|
var _a, _b, _c, _d;
|
|
179
179
|
const theme = ((_a = this.appearanceSettingsOverride) === null || _a === void 0 ? void 0 : _a.theme) || zonosStore.appearance.theme;
|
|
180
180
|
await initStripeElements({
|
|
181
|
-
|
|
181
|
+
overrideBorderRadius: (_b = this.appearanceSettingsOverride) === null || _b === void 0 ? void 0 : _b.style,
|
|
182
182
|
overridePrimaryColor: (_c = this.appearanceSettingsOverride) === null || _c === void 0 ? void 0 : _c.colorPrimary,
|
|
183
183
|
overrideSecondaryColor: (_d = this.appearanceSettingsOverride) === null || _d === void 0 ? void 0 : _d.colorSecondary,
|
|
184
184
|
// only override theme or theme from appearance if it's mobile
|
|
@@ -310,7 +310,7 @@ const ZonosCheckout = class {
|
|
|
310
310
|
attachCheckout() {
|
|
311
311
|
const buttonAnchorSelector = zonosStore.checkoutSettings.placeOrderButtonSelector;
|
|
312
312
|
log(`attach checkout ${buttonAnchorSelector}`);
|
|
313
|
-
// allow to load checkout if cartData is ready (Checkout can be loaded right
|
|
313
|
+
// allow to load checkout if cartData is ready (Checkout can be loaded right away if tempCartUUID is in the URL)
|
|
314
314
|
if (!buttonAnchorSelector && !window.Zonos.cartData) {
|
|
315
315
|
// do nothing if button element is not found
|
|
316
316
|
return;
|
|
@@ -346,7 +346,7 @@ const ZonosCheckout = class {
|
|
|
346
346
|
stripeStore.isFetchingSession = true;
|
|
347
347
|
this.open = true;
|
|
348
348
|
try {
|
|
349
|
-
// buildCartDetail
|
|
349
|
+
// buildCartDetail may throw an error
|
|
350
350
|
const result = await this.buildCartAndInit();
|
|
351
351
|
if (!result) {
|
|
352
352
|
throw new Error('Error building cart');
|
|
@@ -470,12 +470,12 @@ const ZonosCheckout = class {
|
|
|
470
470
|
},
|
|
471
471
|
});
|
|
472
472
|
/**
|
|
473
|
-
* When temp cart data is available, set default address if
|
|
473
|
+
* When temp cart data is available, set default address if it exists
|
|
474
474
|
*/
|
|
475
475
|
if (window.Zonos) {
|
|
476
476
|
this.useLegacyQueryParam();
|
|
477
477
|
}
|
|
478
|
-
// only
|
|
478
|
+
// only initialize checkout if visitor's country is in the shipping zones.
|
|
479
479
|
const interval = setInterval(() => {
|
|
480
480
|
stripeStore.stripe = window.Zonos.stripe;
|
|
481
481
|
this.stripe = window.Zonos.stripe;
|
|
@@ -491,7 +491,11 @@ const ZonosCheckout = class {
|
|
|
491
491
|
if (this.preview || this.forceDialogOpen) {
|
|
492
492
|
void this.buildCartAndInit();
|
|
493
493
|
}
|
|
494
|
-
else {
|
|
494
|
+
else if (window.Zonos.isLegacyCheckout) {
|
|
495
|
+
// With legacy checkout, avoid the mutation observer. We are using a hidden button to trigger checkout.
|
|
496
|
+
this.attachCheckout();
|
|
497
|
+
}
|
|
498
|
+
else if (window) {
|
|
495
499
|
this.attachCheckout();
|
|
496
500
|
// create a mutation observer to see if any new elements that match our selector is added to the DOM
|
|
497
501
|
const observer = new MutationObserver(() => {
|
|
@@ -744,7 +748,7 @@ const ZonosCheckout = class {
|
|
|
744
748
|
onConfirmClicked: () => this.closeDialogHandler({ confirmed: true }) }), h("zonos-confirm-dialog", { class: "zonos--inventory-check-failure-dialog", dialogConfirmBtnText: translate('Return to cart'), dialogIntent: "danger",
|
|
745
749
|
// Show dialog if inventory check error message is not null
|
|
746
750
|
dialogOpen: !!cartStore.inventoryCheckErrorMessage,
|
|
747
|
-
// If
|
|
751
|
+
// If dialog is in open state, the message should not be null
|
|
748
752
|
dialogSubtitle: cartStore.inventoryCheckErrorMessage, dialogTitle: translate("Couldn't place order"), dialogType: "alert", onCancelClicked: () => {
|
|
749
753
|
this.handleInventoryCheckDialogCancel();
|
|
750
754
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import { x as isValidSelector, j as stripeStore, y as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-
|
|
2
|
+
import { x as isValidSelector, j as stripeStore, y as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-7f82d6bf.js';
|
|
3
3
|
import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
|
|
4
4
|
import { h as handleFetch, a as logError, l as log } from './handleFetch-80ecfb91.js';
|
|
5
5
|
import './isDarkColor-b3afa948.js';
|
|
@@ -82,6 +82,10 @@ const injectDefaultWrapper = ({ position = 'bottom-right', }) => {
|
|
|
82
82
|
return mobileAnchorSelector;
|
|
83
83
|
};
|
|
84
84
|
const initHello = async (helloSettings) => {
|
|
85
|
+
if (window.Zonos.isLegacyCheckout) {
|
|
86
|
+
log('Hello is disabled when isLegacyCheckout', 'info');
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
85
89
|
const { anchorElementSelector } = helloSettings;
|
|
86
90
|
// default to mobile anchor if anchorElementSelector is not provided
|
|
87
91
|
let helloAnchor = anchorElementSelector;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-86b8247e.js';
|
|
2
|
-
import { l as localizationStore } from './cart-
|
|
2
|
+
import { l as localizationStore } from './cart-7f82d6bf.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import './handleFetch-80ecfb91.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-86b8247e.js';
|
|
2
|
-
import { a as localizationStoreUpdateSelectedCountryCode, t as translate, l as localizationStore } from './cart-
|
|
2
|
+
import { a as localizationStoreUpdateSelectedCountryCode, t as translate, l as localizationStore } from './cart-7f82d6bf.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
|
|
4
4
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
5
5
|
import { i as isDarkColor } from './isDarkColor-b3afa948.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, F as Fragment, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import { t as translate, l as localizationStore, E as currencyFormat } from './cart-
|
|
2
|
+
import { t as translate, l as localizationStore, E as currencyFormat } from './cart-7f82d6bf.js';
|
|
3
3
|
import { z as zonosStore } from './zonosStore-0dc7a947.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
|
|
2
2
|
import { _ as _root, e as _baseGetTag, i as isObjectLike_1, f as isObject_1, z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-0dc7a947.js';
|
|
3
|
-
import { l as localizationStore, x as isValidSelector, t as translate, z as getZCountryUrlParam, A as setZCountryUrlParam, B as currencyDisplay, C as currencyConvertAndFormat, D as currencyConvert, E as currencyFormat } from './cart-
|
|
3
|
+
import { l as localizationStore, x as isValidSelector, t as translate, z as getZCountryUrlParam, A as setZCountryUrlParam, B as currencyDisplay, C as currencyConvertAndFormat, D as currencyConvert, E as currencyFormat } from './cart-7f82d6bf.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import { h as handleFetch, a as logError, l as log } from './handleFetch-80ecfb91.js';
|
|
6
6
|
import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-86b8247e.js';
|
|
2
|
-
import { L as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-
|
|
2
|
+
import { L as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-7f82d6bf.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
|
|
4
4
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
5
5
|
import './handleFetch-80ecfb91.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement, c as createEvent } from './index-86b8247e.js';
|
|
2
2
|
import { d as zonosStoreFontFamily } from './zonosStore-0dc7a947.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { j as stripeStore } from './cart-
|
|
4
|
+
import { j as stripeStore } from './cart-7f82d6bf.js';
|
|
5
5
|
import { a as logError, l as log } from './handleFetch-80ecfb91.js';
|
|
6
|
-
import { d as paypalStoreInitButtons } from './paypal-
|
|
6
|
+
import { d as paypalStoreInitButtons } from './paypal-91a34d75.js';
|
|
7
7
|
import './isDarkColor-b3afa948.js';
|
|
8
8
|
import './getBorderRadius-cff1e39b.js';
|
|
9
9
|
|
|
@@ -51,7 +51,7 @@ const ZonosShippingRichRadio = class {
|
|
|
51
51
|
return (h("div", { "aria-hidden": "true", class: classes([
|
|
52
52
|
'zonos--shipping-rich-radio-item',
|
|
53
53
|
selected && 'selected',
|
|
54
|
-
]), onClick: () => this.handleRichRadioSelect(item) }, h("input", { checked: selected, class: "zonos--shipping-rich-radio-input", name: "zonos--shipping-rich-radio", type: "radio", value: item.value }), h("div", { class: "zonos--shipping-info" }, h("div", { class: "zonos--shipping-detail" }, h("zonos-text", { class: "zonos--shipping-label", type: "label" }, item.label)), h("zonos-text", { type: "semiBoldLabel" }, item.price))));
|
|
54
|
+
]), onClick: () => this.handleRichRadioSelect(item) }, h("input", { checked: selected, class: "zonos--shipping-rich-radio-input", name: "zonos--shipping-rich-radio", type: "radio", value: item.value }), h("div", { class: "zonos--shipping-info" }, h("div", { class: "zonos--shipping-detail" }, h("zonos-text", { class: "zonos--shipping-label", type: "label" }, item.label), (item.sublabel || item.caption) && (h("div", { class: "zonos--sub-detail" }, item.sublabel && (h("zonos-text", { textColor: "gray-800" }, item.sublabel)), item.caption && (h("zonos-text", { textColor: "gray-600" }, item.caption))))), h("zonos-text", { type: "semiBoldLabel" }, item.price))));
|
|
55
55
|
})));
|
|
56
56
|
}
|
|
57
57
|
};
|