@zonos/elements 1.3.19 → 1.3.20-alpha.1
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-72b0bccc.js → cart-921f0a47.js} +16 -10
- package/dist/cjs/{getBorderRadius-bcb309a8.js → getBorderRadius-9ad763e1.js} +1 -1
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{isDarkColor-b0393089.js → isDarkColor-3d021ecc.js} +1 -1
- package/dist/cjs/{submitGtag-b0c8de90.js → submitGtag-71790233.js} +2 -2
- package/dist/cjs/zonos-address_8.cjs.entry.js +4 -4
- package/dist/cjs/zonos-badge_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
- package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
- package/dist/cjs/zonos-card_2.cjs.entry.js +4 -4
- package/dist/cjs/zonos-cart-items_11.cjs.entry.js +55 -29
- package/dist/cjs/zonos-checkout.cjs.entry.js +5 -5
- package/dist/cjs/zonos-controller.cjs.entry.js +4 -4
- package/dist/cjs/zonos-country-flag.cjs.entry.js +4 -4
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +4 -4
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +4 -4
- package/dist/cjs/zonos-hello.cjs.entry.js +4 -4
- package/dist/cjs/zonos-input.cjs.entry.js +2 -2
- package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification.cjs.entry.js +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +4 -4
- package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- package/dist/cjs/{zonosStore-7c6205ca.js → zonosStore-1063de5e.js} +4 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.css +1 -0
- package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +40 -23
- package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +2 -2
- package/dist/collection/components/store/zonosStore.js +4 -0
- package/dist/collection/components/utils/checkout/sortServiceLevelOptions.js +9 -0
- package/dist/collection/components/utils/hello/setZCountryUrlParam.js +14 -7
- package/dist/esm/{cart-1a37e002.js → cart-d3c98a81.js} +16 -10
- package/dist/esm/{getBorderRadius-d244b4b1.js → getBorderRadius-393bf797.js} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/{isDarkColor-39a36e82.js → isDarkColor-454ec221.js} +1 -1
- package/dist/esm/{submitGtag-754935b4.js → submitGtag-acdb8bd7.js} +2 -2
- package/dist/esm/zonos-address_8.entry.js +4 -4
- package/dist/esm/zonos-badge_2.entry.js +1 -1
- package/dist/esm/zonos-banner.entry.js +1 -1
- package/dist/esm/zonos-button_3.entry.js +3 -3
- package/dist/esm/zonos-card_2.entry.js +4 -4
- package/dist/esm/zonos-cart-items_11.entry.js +55 -29
- package/dist/esm/zonos-checkout.entry.js +5 -5
- package/dist/esm/zonos-controller.entry.js +4 -4
- package/dist/esm/zonos-country-flag.entry.js +4 -4
- package/dist/esm/zonos-country-select_3.entry.js +4 -4
- package/dist/esm/zonos-hello-dialog.entry.js +4 -4
- package/dist/esm/zonos-hello.entry.js +4 -4
- package/dist/esm/zonos-input.entry.js +2 -2
- package/dist/esm/zonos-logo.entry.js +1 -1
- package/dist/esm/zonos-notification.entry.js +1 -1
- package/dist/esm/zonos-payment.entry.js +4 -4
- package/dist/esm/zonos-select-dialog-header_2.entry.js +1 -1
- package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/{zonosStore-32e33a45.js → zonosStore-0ce57f37.js} +4 -0
- package/dist/esm-es5/{cart-1a37e002.js → cart-d3c98a81.js} +1 -1
- package/dist/esm-es5/{getBorderRadius-d244b4b1.js → getBorderRadius-393bf797.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{isDarkColor-39a36e82.js → isDarkColor-454ec221.js} +1 -1
- package/dist/esm-es5/{submitGtag-754935b4.js → submitGtag-acdb8bd7.js} +1 -1
- 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_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_11.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_3.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-input.entry.js +1 -1
- package/dist/esm-es5/zonos-logo.entry.js +1 -1
- package/dist/esm-es5/zonos-notification.entry.js +1 -1
- package/dist/esm-es5/zonos-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
- 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/{zonosStore-32e33a45.js → zonosStore-0ce57f37.js} +1 -1
- package/dist/scripts/index.d.ts +6 -0
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.d.ts +1 -0
- package/dist/types/components/utils/checkout/sortServiceLevelOptions.d.ts +5 -0
- package/dist/types/types/hello/HelloConfig.d.ts +5 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-483e1724.entry.js → p-0a4f341b.entry.js} +1 -1
- package/dist/zonos-elements/{p-9c242e4b.system.entry.js → p-0e6fe6c8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ed3524ae.system.entry.js → p-1406d696.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-de9e610d.system.entry.js → p-14bea5e6.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a37796e1.entry.js → p-14da9ed0.entry.js} +1 -1
- package/dist/zonos-elements/{p-6449c92b.js → p-15c903ff.js} +1 -1
- package/dist/zonos-elements/{p-2e02a76f.system.entry.js → p-23393abc.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-80442f16.entry.js → p-2c57097c.entry.js} +1 -1
- package/dist/zonos-elements/{p-2f759d82.js → p-2d3e3735.js} +1 -1
- package/dist/zonos-elements/{p-1b9442f6.system.js → p-3115e7a7.system.js} +1 -1
- package/dist/zonos-elements/{p-2ced091f.entry.js → p-3668f365.entry.js} +1 -1
- package/dist/zonos-elements/{p-58fc8ec1.entry.js → p-3c97c44d.entry.js} +1 -1
- package/dist/zonos-elements/{p-0878369a.entry.js → p-3edcbb56.entry.js} +1 -1
- package/dist/zonos-elements/{p-2800c274.system.entry.js → p-42a7a726.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0d1c06d7.entry.js → p-474cb030.entry.js} +1 -1
- package/dist/zonos-elements/{p-c87c76d4.entry.js → p-5968c6ad.entry.js} +1 -1
- package/dist/zonos-elements/{p-bd9b2165.entry.js → p-59913049.entry.js} +1 -1
- package/dist/zonos-elements/{p-281b8bdf.entry.js → p-67373528.entry.js} +1 -1
- package/dist/zonos-elements/{p-6eda6199.system.entry.js → p-72191005.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9389cc42.system.entry.js → p-75d52d98.system.entry.js} +1 -1
- package/dist/zonos-elements/p-824e1e83.system.js +1 -0
- package/dist/zonos-elements/{p-58be220f.system.js → p-8f3f1a1b.system.js} +1 -1
- package/dist/zonos-elements/p-957301d0.system.entry.js +1 -0
- package/dist/zonos-elements/{p-a47382ae.system.entry.js → p-971e73c3.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c195e980.system.entry.js → p-9da3b3b3.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-bdfa3705.system.entry.js → p-9e4b35d4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4594a125.js → p-b13e630b.js} +1 -1
- package/dist/zonos-elements/{p-7b2d367b.entry.js → p-b202a015.entry.js} +1 -1
- package/dist/zonos-elements/{p-6746455b.system.entry.js → p-b925e897.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9e8d38f7.system.entry.js → p-b9ed8a66.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-f9a42a3c.system.entry.js → p-bfe6f84f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8cd6633a.system.entry.js → p-c15b36c1.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ce099910.system.js +1 -0
- package/dist/zonos-elements/{p-0d5b5bcc.entry.js → p-ce4c48f6.entry.js} +1 -1
- package/dist/zonos-elements/{p-bbb84165.system.entry.js → p-d03e101b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1491717a.entry.js → p-d18990b0.entry.js} +1 -1
- package/dist/zonos-elements/{p-4f72bfee.system.entry.js → p-d1b8dcd8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-8c0b4a61.js → p-d5feef4c.js} +1 -1
- package/dist/zonos-elements/p-d79e83bd.entry.js +1 -0
- package/dist/zonos-elements/{p-597b75f3.entry.js → p-dd02f2eb.entry.js} +1 -1
- package/dist/zonos-elements/p-e0bf9666.system.js +1 -1
- package/dist/zonos-elements/{p-693b9985.js → p-eb6ddb2f.js} +1 -1
- package/dist/zonos-elements/{p-afb89d65.entry.js → p-eb765228.entry.js} +1 -1
- package/dist/zonos-elements/{p-d9011df9.entry.js → p-ebb36e4d.entry.js} +1 -1
- package/dist/zonos-elements/{p-0d0f9694.system.entry.js → p-f03b33ec.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-62ecfbcc.system.js → p-f0afca6c.system.js} +1 -1
- package/dist/zonos-elements/p-f16b80a3.system.js +1 -0
- package/dist/zonos-elements/{p-3ba8838a.entry.js → p-f3a6de62.entry.js} +1 -1
- package/dist/zonos-elements/{p-2af19b63.entry.js → p-f4c921f8.entry.js} +1 -1
- package/dist/zonos-elements/{p-d7a939df.system.entry.js → p-fc2f3e2a.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/zonos-elements/p-14ff42fe.system.entry.js +0 -1
- package/dist/zonos-elements/p-3db250f7.system.js +0 -1
- package/dist/zonos-elements/p-58e730b6.system.js +0 -1
- package/dist/zonos-elements/p-7487ef47.entry.js +0 -1
- package/dist/zonos-elements/p-f5b14bab.system.js +0 -1
|
@@ -2,6 +2,7 @@ import { h, Host, } from "@stencil/core";
|
|
|
2
2
|
import { cartStore, cartStoreGetShippingTransitInfo, cartStoreUpdateSelectedShippingOption, } from "../../../store/checkout/cart";
|
|
3
3
|
import { translate } from "../../../store/translationStore";
|
|
4
4
|
import { trackConversionEvent } from "../../../utils/api/trackConversionEvent";
|
|
5
|
+
import { sortServiceLevelOptions } from "../../../utils/checkout/sortServiceLevelOptions";
|
|
5
6
|
import { formatCurrency } from "../../../utils/formatCurrency";
|
|
6
7
|
import { submitGtag } from "../../../utils/submitGtag";
|
|
7
8
|
export class ZonosShipping {
|
|
@@ -47,28 +48,35 @@ export class ZonosShipping {
|
|
|
47
48
|
};
|
|
48
49
|
this.initServiceLevels = () => {
|
|
49
50
|
var _a;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
51
|
+
const serviceLevels = ((_a = cartStore.shippingData) === null || _a === void 0 ? void 0 : _a.map((item) => {
|
|
52
|
+
var _a;
|
|
53
|
+
const { expectedDate, maxTransit, minTransit } = cartStoreGetShippingTransitInfo(item);
|
|
54
|
+
const sublabel = expectedDate
|
|
55
|
+
? `${translate('Expected delivery')} ${expectedDate}`
|
|
56
|
+
: '';
|
|
57
|
+
const caption = minTransit && maxTransit
|
|
58
|
+
? `(${minTransit}-${maxTransit} ${translate('business days')})`
|
|
59
|
+
: '';
|
|
60
|
+
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; });
|
|
61
|
+
if (!foundShipmentRating) {
|
|
62
|
+
// exclude shipping method if there is no matching landed cost data
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const shippingAmount = foundShipmentRating.subtotals.shipping;
|
|
66
|
+
return {
|
|
67
|
+
amount: shippingAmount,
|
|
68
|
+
caption,
|
|
69
|
+
label: item.displayName,
|
|
70
|
+
price: formatCurrency({
|
|
71
|
+
amount: shippingAmount,
|
|
72
|
+
currency: cartStore.currency,
|
|
73
|
+
}),
|
|
74
|
+
sublabel,
|
|
75
|
+
value: item.id,
|
|
76
|
+
};
|
|
77
|
+
}).filter(Boolean)) || [];
|
|
78
|
+
// sort service level by price
|
|
79
|
+
this.serviceLevels = sortServiceLevelOptions(serviceLevels);
|
|
72
80
|
};
|
|
73
81
|
this.continueLoading = false;
|
|
74
82
|
this.submitBtnColor = undefined;
|
|
@@ -82,7 +90,16 @@ export class ZonosShipping {
|
|
|
82
90
|
this.initServiceLevels();
|
|
83
91
|
const selectedServiceLevel = this.serviceLevels.find(item => { var _a; return item.value === ((_a = cartStore.selectedShippingOption) === null || _a === void 0 ? void 0 : _a.id); }) || null;
|
|
84
92
|
if (selectedServiceLevel) {
|
|
93
|
+
// keep the selected shipping method
|
|
85
94
|
this.selectedShippingMethod = selectedServiceLevel;
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const firstServiceLevel = this.serviceLevels.find(Boolean);
|
|
98
|
+
if (firstServiceLevel) {
|
|
99
|
+
// preselect the first shipping method
|
|
100
|
+
void this.handleRadioSelected({
|
|
101
|
+
detail: firstServiceLevel,
|
|
102
|
+
});
|
|
86
103
|
}
|
|
87
104
|
}
|
|
88
105
|
render() {
|
|
@@ -91,7 +108,7 @@ export class ZonosShipping {
|
|
|
91
108
|
if (this.showErrorBanner) {
|
|
92
109
|
this.showErrorBanner = !this.handleValidate();
|
|
93
110
|
}
|
|
94
|
-
return (h(Host, { key: '
|
|
111
|
+
return (h(Host, { key: '7d55ffefe3cb926587a9b2d6617d732b52cf1a82', class: "zonos--shipping zonos--elements" }, h("div", { key: 'dfe3d7d7e0be1857a428c7c3dff5a60f45e2c843', class: "zonos--group" }, h("zonos-text", { key: 'dccf7b24862e88ee3ab8914b04a4ee02f02324fb', 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: 'c343522911e886a2365b795a9b95b17acbfa59c8', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: '83c873c95e5b7466cfba997a4385ea55771f2571', 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: 'c7dd64a8d84fa04629010d20010e89ea51c3b634', class: "zonos--group-btn" }, h("zonos-button", { key: '8d5ec0f9896be564ab659affd578939eff1c62dc', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
95
112
|
// use primary type when on mobile mode
|
|
96
113
|
variant: this.submitBtnType }, translate('Go to payment'))))));
|
|
97
114
|
}
|
package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js
CHANGED
|
@@ -39,7 +39,7 @@ export class ZonosShippingRichRadio {
|
|
|
39
39
|
}
|
|
40
40
|
render() {
|
|
41
41
|
var _a;
|
|
42
|
-
return (h(Host, { key: '
|
|
42
|
+
return (h(Host, { key: '48381df130f6021b73c543c7244a71e7b1e8cd05', class: "zonos--shipping-rich-radio zonos--elements", "data-theme": this.theme, style: Object.assign(Object.assign({}, this.getRadioItemStyleVariables()), { '--font-family': zonosStoreFontFamily() }) }, (_a = this.items) === null || _a === void 0 ? void 0 : _a.map(item => {
|
|
43
43
|
var _a;
|
|
44
44
|
const selected = ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.value) === item.value;
|
|
45
45
|
return (h("div", { "aria-hidden": "true", class: classes([
|
|
@@ -189,7 +189,7 @@ export class ZonosShippingRichRadio {
|
|
|
189
189
|
},
|
|
190
190
|
"complexType": {
|
|
191
191
|
"original": "ShippingRichRadioItem",
|
|
192
|
-
"resolved": "{ caption?: string | undefined; label: string; price: string; sublabel?: string | undefined; value: string | number; }",
|
|
192
|
+
"resolved": "{ amount: number; caption?: string | undefined; label: string; price: string; sublabel?: string | undefined; value: string | number; }",
|
|
193
193
|
"references": {
|
|
194
194
|
"ShippingRichRadioItem": {
|
|
195
195
|
"location": "local",
|
|
@@ -46,6 +46,10 @@ const { reset, state: zonosStore } = createStore(() => ({
|
|
|
46
46
|
helloSettings: {
|
|
47
47
|
anchorElementSelector: '',
|
|
48
48
|
cartUrlPattern: '',
|
|
49
|
+
/**
|
|
50
|
+
* @TODO Default to URL_PARAM for now, and switch SESSION later when we have API save this info, and we have the ability to update setting of merchant store without having them do it.
|
|
51
|
+
*/
|
|
52
|
+
countryOverrideBehavior: 'URL_PARAM',
|
|
49
53
|
currencyBehavior: 'ENABLED',
|
|
50
54
|
currencyElementSelector: '.money',
|
|
51
55
|
dutyTaxEstimationBehavior: 'ENABLED',
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
+
import { zonosStore } from "../../store/zonosStore";
|
|
1
2
|
export const setZCountryUrlParam = (selectedCountryCode) => {
|
|
2
3
|
if (!selectedCountryCode) {
|
|
3
4
|
return;
|
|
4
5
|
}
|
|
5
6
|
const urlSearchParams = new URLSearchParams(window.location.search);
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
// Only append zCountry if it's already in the URL or the countryOverrideBehavior is URL_PARAM
|
|
8
|
+
const shouldAppendParam = urlSearchParams.has('zCountry') ||
|
|
9
|
+
zonosStore.helloSettings.countryOverrideBehavior === 'URL_PARAM';
|
|
10
|
+
if (shouldAppendParam) {
|
|
11
|
+
// Only append zCountry if it's not already in the URL
|
|
12
|
+
urlSearchParams.set('zCountry', selectedCountryCode);
|
|
13
|
+
const newUrl = `${window.location.pathname}?${urlSearchParams.toString()}`;
|
|
14
|
+
/**
|
|
15
|
+
* Setting the state to null in window.history.replaceState can cause issues with rendering when using next/link and pressing the back button.
|
|
16
|
+
* @ref https://github.com/vercel/next.js/issues/33233#issuecomment-1052349396
|
|
17
|
+
**/
|
|
18
|
+
window.history.replaceState(window.history.state, document.title, newUrl);
|
|
19
|
+
}
|
|
13
20
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { c as createStore, z as zonosStore } from './zonosStore-
|
|
1
|
+
import { c as createStore, z as zonosStore } from './zonosStore-0ce57f37.js';
|
|
2
2
|
import { a as logError, l as log } from './logError-c456c092.js';
|
|
3
|
-
import { i as isDarkColor } from './isDarkColor-
|
|
4
|
-
import { g as getBorderRadius } from './getBorderRadius-
|
|
3
|
+
import { i as isDarkColor } from './isDarkColor-454ec221.js';
|
|
4
|
+
import { g as getBorderRadius } from './getBorderRadius-393bf797.js';
|
|
5
5
|
|
|
6
6
|
const stringsArabic = {
|
|
7
7
|
'${percentage} GST due on any order above ${threshold} along with an import entry transaction fee and MPI levy.': {
|
|
@@ -6006,13 +6006,19 @@ const setZCountryUrlParam = (selectedCountryCode) => {
|
|
|
6006
6006
|
return;
|
|
6007
6007
|
}
|
|
6008
6008
|
const urlSearchParams = new URLSearchParams(window.location.search);
|
|
6009
|
-
|
|
6010
|
-
const
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6009
|
+
// Only append zCountry if it's already in the URL or the countryOverrideBehavior is URL_PARAM
|
|
6010
|
+
const shouldAppendParam = urlSearchParams.has('zCountry') ||
|
|
6011
|
+
zonosStore.helloSettings.countryOverrideBehavior === 'URL_PARAM';
|
|
6012
|
+
if (shouldAppendParam) {
|
|
6013
|
+
// Only append zCountry if it's not already in the URL
|
|
6014
|
+
urlSearchParams.set('zCountry', selectedCountryCode);
|
|
6015
|
+
const newUrl = `${window.location.pathname}?${urlSearchParams.toString()}`;
|
|
6016
|
+
/**
|
|
6017
|
+
* Setting the state to null in window.history.replaceState can cause issues with rendering when using next/link and pressing the back button.
|
|
6018
|
+
* @ref https://github.com/vercel/next.js/issues/33233#issuecomment-1052349396
|
|
6019
|
+
**/
|
|
6020
|
+
window.history.replaceState(window.history.state, document.title, newUrl);
|
|
6021
|
+
}
|
|
6016
6022
|
};
|
|
6017
6023
|
|
|
6018
6024
|
const { onChange: localizationStoreOnUpdate, state: localizationStore } = createStore({
|
package/dist/esm/index.js
CHANGED
|
@@ -232,8 +232,8 @@ const zonosLoadUrl = (() => {
|
|
|
232
232
|
}
|
|
233
233
|
return null;
|
|
234
234
|
})();
|
|
235
|
-
const ZONOS_URL = zonosLoadUrl || "https://v1.3.
|
|
236
|
-
const JS_DELIVR_ZONOS_URL = "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
235
|
+
const ZONOS_URL = zonosLoadUrl || "https://v1.3.20-alpha.1.js.zonos.com";
|
|
236
|
+
const JS_DELIVR_ZONOS_URL = "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.20-alpha.1";
|
|
237
237
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
238
238
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
239
239
|
const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
|
|
@@ -253,7 +253,7 @@ Zonos.isBigCommerce = false;
|
|
|
253
253
|
Zonos.isNpm = true;
|
|
254
254
|
Zonos.internationalHideSelector = '';
|
|
255
255
|
Zonos.zonosQaUrl = null;
|
|
256
|
-
Zonos.version = `v${"1.3.
|
|
256
|
+
Zonos.version = `v${"1.3.20-alpha.1"}`;
|
|
257
257
|
Zonos.modeAlerted = false;
|
|
258
258
|
Zonos.tempCartData = null;
|
|
259
259
|
Zonos.getCurrentTimestamp = () => new Date().getTime();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as handleFetch, d as cartStore, l as localizationStore } from './cart-
|
|
2
|
-
import { z as zonosStore } from './zonosStore-
|
|
1
|
+
import { r as handleFetch, d as cartStore, l as localizationStore } from './cart-d3c98a81.js';
|
|
2
|
+
import { z as zonosStore } from './zonosStore-0ce57f37.js';
|
|
3
3
|
import { l as log } from './logError-c456c092.js';
|
|
4
4
|
|
|
5
5
|
const trackConversionEvent = async (eventName, metadata) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-3b46f3c3.js';
|
|
2
|
-
import { h as stripeStore, l as localizationStore, t as translate } from './cart-
|
|
2
|
+
import { h as stripeStore, l as localizationStore, t as translate } from './cart-d3c98a81.js';
|
|
3
3
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
4
4
|
import { a as logError } from './logError-c456c092.js';
|
|
5
5
|
import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
|
|
6
|
-
import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-
|
|
6
|
+
import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-0ce57f37.js';
|
|
7
7
|
import { c as classes } from './classes-0d95c529.js';
|
|
8
8
|
import { R as RemoveIcon$1 } from './RemoveIcon-9dc5dd1a.js';
|
|
9
|
-
import { g as getBorderRadius } from './getBorderRadius-
|
|
10
|
-
import { i as isDarkColor } from './isDarkColor-
|
|
9
|
+
import { g as getBorderRadius } from './getBorderRadius-393bf797.js';
|
|
10
|
+
import { i as isDarkColor } from './isDarkColor-454ec221.js';
|
|
11
11
|
|
|
12
12
|
const zonosAddressCss = ".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";
|
|
13
13
|
const ZonosAddressStyle0 = zonosAddressCss;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-3b46f3c3.js';
|
|
2
|
-
import { d as zonosStoreFontFamily } from './zonosStore-
|
|
2
|
+
import { d as zonosStoreFontFamily } from './zonosStore-0ce57f37.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
4
|
|
|
5
5
|
const zonosBadgeCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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 .zonos--badge-content{display:-ms-flexbox;display:flex;gap:8px;font-size:var(--zonos-elements-font-size-s);padding:4px 8px;text-align:center;border-radius:var(--zonos-elements-radius-6);background-color:var(--zonos-elements-gray-100);color:var(--zonos-elements-gray-800);-ms-flex-align:center;align-items:center}:host p{font-weight:600;line-height:16px}:host .icon-right svg{-ms-flex-order:2;order:2}:host .small{padding:2px 8px}:host .rounded{border-radius:20px}:host .bold{background-color:var(--zonos-elements-gray-600);color:var(--zonos-elements-gray-100)}:host .blue{background-color:var(--zonos-elements-blue-100);color:var(--zonos-elements-blue-800)}:host .blue.bold{background-color:var(--zonos-elements-blue-600);color:var(--zonos-elements-blue-100)}:host .green{background-color:var(--zonos-elements-green-100);color:var(--zonos-elements-green-800)}:host .green.bold{background-color:var(--zonos-elements-green-600);color:var(--zonos-elements-green-100)}:host .red{background-color:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800)}:host .red.bold{background-color:var(--zonos-elements-red-600);color:var(--zonos-elements-red-100)}:host .orange{background-color:var(--zonos-elements-orange-100);color:var(--zonos-elements-orange-800)}:host .orange.bold{background-color:var(--zonos-elements-orange-600);color:var(--zonos-elements-orange-100)}:host .purple{background-color:var(--zonos-elements-purple-100);color:var(--zonos-elements-purple-800)}:host .purple.bold{background-color:var(--zonos-elements-purple-600);color:var(--zonos-elements-purple-100)}:host .cyan{background-color:var(--zonos-elements-cyan-100);color:var(--zonos-elements-cyan-800)}:host .cyan.bold{background-color:var(--zonos-elements-cyan-600);color:var(--zonos-elements-cyan-100)}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-3b46f3c3.js';
|
|
2
|
-
import { d as zonosStoreFontFamily } from './zonosStore-
|
|
2
|
+
import { d as zonosStoreFontFamily } from './zonosStore-0ce57f37.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
4
|
|
|
5
5
|
const zonosBannerCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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{border-radius:var(--zonos-elements-radius-10);padding:16px;background:var(--zonos-elements-gray-100)}:host .zonos--container{display:grid;-ms-flex-align:center;align-items:center;grid-template-areas:\"icon header\" \". content\";grid-template-columns:32px auto 0}:host .zonos--icon-wrapper{grid-area:icon;display:-ms-flexbox;display:flex;justify-self:start}:host .zonos--header-wrapper{margin-top:0px;grid-area:header}:host .zonos--content-wrapper{grid-area:content;margin-top:4px}:host(.info){background-color:var(--zonos-elements-blue-100);border:1px solid var(--zonos-elements-blue-200)}:host(.success){background-color:var(--zonos-elements-green-100);border:1px solid var(--zonos-elements-green-200)}:host(.error){background-color:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host(.warning){background-color:var(--zonos-elements-orange-100);border:1px solid var(--zonos-elements-orange-200)}";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-3b46f3c3.js';
|
|
2
|
-
import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-
|
|
2
|
+
import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-0ce57f37.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { g as getBorderRadius } from './getBorderRadius-
|
|
4
|
+
import { g as getBorderRadius } from './getBorderRadius-393bf797.js';
|
|
5
5
|
import { i as isColorVariable } from './isColorVariable-82457bef.js';
|
|
6
|
-
import { i as isDarkColor } from './isDarkColor-
|
|
6
|
+
import { i as isDarkColor } from './isDarkColor-454ec221.js';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Get theme for button text based on background color
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-3b46f3c3.js';
|
|
2
|
-
import { d as zonosStoreFontFamily } from './zonosStore-
|
|
2
|
+
import { d as zonosStoreFontFamily } from './zonosStore-0ce57f37.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { H as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-
|
|
4
|
+
import { H as localizationStoreUpdateSelectedLocale, t as translate, l as localizationStore } from './cart-d3c98a81.js';
|
|
5
5
|
import { l as languages } from './ILanguage-97790bee.js';
|
|
6
6
|
import './logError-c456c092.js';
|
|
7
|
-
import './isDarkColor-
|
|
8
|
-
import './getBorderRadius-
|
|
7
|
+
import './isDarkColor-454ec221.js';
|
|
8
|
+
import './getBorderRadius-393bf797.js';
|
|
9
9
|
|
|
10
10
|
const zonosCardCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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 .styled-card{border:var(--zonos-elements-border);border-radius:var(--zonos-elements-radius-6);padding:var(--spacing, 24px);text-align:left}:host .styled-card hr{margin-left:calc(var(--spacing, 24px) * -1);margin-right:calc(var(--spacing, 24px) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, 24px);border-bottom:var(--zonos-elements-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);border-top:var(--zonos-elements-border);background:var(--zonos-elements-surface-color-secondary);margin-top:var(--spacing, 24px);border-bottom-left-radius:var(--zonos-elements-radius-8);border-bottom-right-radius:var(--zonos-elements-radius-8);height:var(--footerHeight)}";
|
|
11
11
|
const ZonosCardStyle0 = zonosCardCss;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-3b46f3c3.js';
|
|
2
|
-
import { d as cartStore, C as cartStoreHasOneEligibleItem, t as translate, r as handleFetch, p as stripeStoreReset, h as stripeStore, D as stripeStoreRetrievePayment, l as localizationStore, E as stripeStoreTranslateAddressToLatin, F as cartStoreUpdateSelectedShippingOption, G as cartStoreGetShippingTransitInfo } from './cart-
|
|
2
|
+
import { d as cartStore, C as cartStoreHasOneEligibleItem, t as translate, r as handleFetch, p as stripeStoreReset, h as stripeStore, D as stripeStoreRetrievePayment, l as localizationStore, E as stripeStoreTranslateAddressToLatin, F as cartStoreUpdateSelectedShippingOption, G as cartStoreGetShippingTransitInfo } from './cart-d3c98a81.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
|
-
import { z as zonosStore, g as getZonosStoreTheme, d as zonosStoreFontFamily } from './zonosStore-
|
|
5
|
-
import { t as trackConversionEvent, s as sendErrorLog, a as submitGtag, c as createCustomEvent } from './submitGtag-
|
|
6
|
-
import { g as getBorderRadius } from './getBorderRadius-
|
|
4
|
+
import { z as zonosStore, g as getZonosStoreTheme, d as zonosStoreFontFamily } from './zonosStore-0ce57f37.js';
|
|
5
|
+
import { t as trackConversionEvent, s as sendErrorLog, a as submitGtag, c as createCustomEvent } from './submitGtag-acdb8bd7.js';
|
|
6
|
+
import { g as getBorderRadius } from './getBorderRadius-393bf797.js';
|
|
7
7
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
8
8
|
import { l as languages } from './ILanguage-97790bee.js';
|
|
9
|
-
import { t as tinycolor, i as isDarkColor } from './isDarkColor-
|
|
9
|
+
import { t as tinycolor, i as isDarkColor } from './isDarkColor-454ec221.js';
|
|
10
10
|
import { i as isColorVariable } from './isColorVariable-82457bef.js';
|
|
11
11
|
import { c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
|
|
12
12
|
import './logError-c456c092.js';
|
|
@@ -353,7 +353,7 @@ const ZonosIcon = `<svg width="105" height="29" viewBox="0 0 105 29" fill="none"
|
|
|
353
353
|
</svg>
|
|
354
354
|
`;
|
|
355
355
|
|
|
356
|
-
const zonosCheckoutFooterCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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{position:absolute;bottom:-50px;left:0;right:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--checkout-footer{width:calc(90vw - 22px);gap:16px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px;-ms-flex-align:center;align-items:center}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:24px}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper .zonos--checkout-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper .zonos--checkout-footer-logo a{line-height:0}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper a{text-decoration:none}:host .zonos--checkout-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--checkout-footer .zonos--checkout-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--checkout-footer .zonos--checkout-locale-wrapper{gap:4px}}:host .zonos--checkout-footer .zonos--checkout-footer-dialog{position:absolute;bottom:36px;left:var(--language-dialog-left);background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);width:360px;max-width:100vw;max-height:500px;z-index:10005;overflow:auto;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:bottom left;transform-origin:bottom left;opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar{width:10px}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--checkout-footer .zonos--checkout-footer-dialog.zonos--checkout-footer-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host(.mobile){-ms-flex-direction:column;flex-direction:column;gap:32px;background:var(--zonos-elements-gray-0);position:relative;padding-top:24px;bottom:0}:host(.mobile) .zonos--checkout-footer{-ms-flex-direction:column;flex-direction:column;gap:4px}:host(.mobile) .zonos--checkout-locale-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.mobile) .zonos--checkout-footer-icon-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.mobile) .zonos--checkout-footer-dialog{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw}";
|
|
356
|
+
const zonosCheckoutFooterCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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{position:absolute;bottom:-50px;left:0;right:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--checkout-footer{width:calc(90vw - 22px);gap:16px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px;padding-left:0;-ms-flex-align:center;align-items:center}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:24px}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper .zonos--checkout-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper .zonos--checkout-footer-logo a{line-height:0}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper a{text-decoration:none}:host .zonos--checkout-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--checkout-footer .zonos--checkout-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--checkout-footer .zonos--checkout-locale-wrapper{gap:4px}}:host .zonos--checkout-footer .zonos--checkout-footer-dialog{position:absolute;bottom:36px;left:var(--language-dialog-left);background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);width:360px;max-width:100vw;max-height:500px;z-index:10005;overflow:auto;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:bottom left;transform-origin:bottom left;opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar{width:10px}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--checkout-footer .zonos--checkout-footer-dialog.zonos--checkout-footer-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host(.mobile){-ms-flex-direction:column;flex-direction:column;gap:32px;background:var(--zonos-elements-gray-0);position:relative;padding-top:24px;bottom:0}:host(.mobile) .zonos--checkout-footer{-ms-flex-direction:column;flex-direction:column;gap:4px}:host(.mobile) .zonos--checkout-locale-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.mobile) .zonos--checkout-footer-icon-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.mobile) .zonos--checkout-footer-dialog{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw}";
|
|
357
357
|
const ZonosCheckoutFooterStyle0 = zonosCheckoutFooterCss;
|
|
358
358
|
|
|
359
359
|
const ZonosCheckoutFooter = class {
|
|
@@ -883,6 +883,16 @@ const ZonosReview = class {
|
|
|
883
883
|
};
|
|
884
884
|
ZonosReview.style = ZonosReviewStyle0;
|
|
885
885
|
|
|
886
|
+
/**
|
|
887
|
+
* Sorts service levels with lower cost first
|
|
888
|
+
*/
|
|
889
|
+
const sortServiceLevelOptions = (serviceLevels) => {
|
|
890
|
+
const sortedServiceLevels = serviceLevels.sort((a, b) => {
|
|
891
|
+
return a.amount - b.amount;
|
|
892
|
+
});
|
|
893
|
+
return sortedServiceLevels;
|
|
894
|
+
};
|
|
895
|
+
|
|
886
896
|
const zonosShippingCss = ".sc-zonos-shipping-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-shipping-h *.sc-zonos-shipping{font-family:var(--font-family, Inter), Inter}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--title.sc-zonos-shipping{margin-bottom:24px}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:16px}.sc-zonos-shipping-h .zonos-shipping-rich-radio.sc-zonos-shipping{margin-bottom:24px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:20px;overflow:auto;padding:5px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h .zonos--error-banner.sc-zonos-shipping{margin-bottom:16px}.sc-zonos-shipping-h zonos-button.sc-zonos-shipping{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;margin-top:12px;background:var(--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:100%}.sc-zonos-shipping-h zonos-banner.sc-zonos-shipping{margin-top:24px}";
|
|
887
897
|
const ZonosShippingStyle0 = zonosShippingCss;
|
|
888
898
|
|
|
@@ -931,28 +941,35 @@ const ZonosShipping = class {
|
|
|
931
941
|
};
|
|
932
942
|
this.initServiceLevels = () => {
|
|
933
943
|
var _a;
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
944
|
+
const serviceLevels = ((_a = cartStore.shippingData) === null || _a === void 0 ? void 0 : _a.map((item) => {
|
|
945
|
+
var _a;
|
|
946
|
+
const { expectedDate, maxTransit, minTransit } = cartStoreGetShippingTransitInfo(item);
|
|
947
|
+
const sublabel = expectedDate
|
|
948
|
+
? `${translate('Expected delivery')} ${expectedDate}`
|
|
949
|
+
: '';
|
|
950
|
+
const caption = minTransit && maxTransit
|
|
951
|
+
? `(${minTransit}-${maxTransit} ${translate('business days')})`
|
|
952
|
+
: '';
|
|
953
|
+
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; });
|
|
954
|
+
if (!foundShipmentRating) {
|
|
955
|
+
// exclude shipping method if there is no matching landed cost data
|
|
956
|
+
return null;
|
|
957
|
+
}
|
|
958
|
+
const shippingAmount = foundShipmentRating.subtotals.shipping;
|
|
959
|
+
return {
|
|
960
|
+
amount: shippingAmount,
|
|
961
|
+
caption,
|
|
962
|
+
label: item.displayName,
|
|
963
|
+
price: formatCurrency({
|
|
964
|
+
amount: shippingAmount,
|
|
965
|
+
currency: cartStore.currency,
|
|
966
|
+
}),
|
|
967
|
+
sublabel,
|
|
968
|
+
value: item.id,
|
|
969
|
+
};
|
|
970
|
+
}).filter(Boolean)) || [];
|
|
971
|
+
// sort service level by price
|
|
972
|
+
this.serviceLevels = sortServiceLevelOptions(serviceLevels);
|
|
956
973
|
};
|
|
957
974
|
this.continueLoading = false;
|
|
958
975
|
this.submitBtnColor = undefined;
|
|
@@ -966,7 +983,16 @@ const ZonosShipping = class {
|
|
|
966
983
|
this.initServiceLevels();
|
|
967
984
|
const selectedServiceLevel = this.serviceLevels.find(item => { var _a; return item.value === ((_a = cartStore.selectedShippingOption) === null || _a === void 0 ? void 0 : _a.id); }) || null;
|
|
968
985
|
if (selectedServiceLevel) {
|
|
986
|
+
// keep the selected shipping method
|
|
969
987
|
this.selectedShippingMethod = selectedServiceLevel;
|
|
988
|
+
return;
|
|
989
|
+
}
|
|
990
|
+
const firstServiceLevel = this.serviceLevels.find(Boolean);
|
|
991
|
+
if (firstServiceLevel) {
|
|
992
|
+
// preselect the first shipping method
|
|
993
|
+
void this.handleRadioSelected({
|
|
994
|
+
detail: firstServiceLevel,
|
|
995
|
+
});
|
|
970
996
|
}
|
|
971
997
|
}
|
|
972
998
|
render() {
|
|
@@ -975,7 +1001,7 @@ const ZonosShipping = class {
|
|
|
975
1001
|
if (this.showErrorBanner) {
|
|
976
1002
|
this.showErrorBanner = !this.handleValidate();
|
|
977
1003
|
}
|
|
978
|
-
return (h(Host, { key: '
|
|
1004
|
+
return (h(Host, { key: '7d55ffefe3cb926587a9b2d6617d732b52cf1a82', class: "zonos--shipping zonos--elements" }, h("div", { key: 'dfe3d7d7e0be1857a428c7c3dff5a60f45e2c843', class: "zonos--group" }, h("zonos-text", { key: 'dccf7b24862e88ee3ab8914b04a4ee02f02324fb', 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: 'c343522911e886a2365b795a9b95b17acbfa59c8', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: '83c873c95e5b7466cfba997a4385ea55771f2571', 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: 'c7dd64a8d84fa04629010d20010e89ea51c3b634', class: "zonos--group-btn" }, h("zonos-button", { key: '8d5ec0f9896be564ab659affd578939eff1c62dc', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
|
|
979
1005
|
// use primary type when on mobile mode
|
|
980
1006
|
variant: this.submitBtnType }, translate('Go to payment'))))));
|
|
981
1007
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { r as registerInstance, h, F as Fragment, H as Host } from './index-3b46f3c3.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 stripeStore, j as stripeStoreInitCheckoutSession, k as cartStoreUpdateToErrorState, t as translate, m as stripeStorePrefetchLandedCost, n as cartStoreNextStep, o as stripeStoreConfirmPayment, p as stripeStoreReset, q as localizationStoreOnUpdate } from './cart-
|
|
3
|
-
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-
|
|
4
|
-
import { c as createCustomEvent, s as sendErrorLog, a as submitGtag, t as trackConversionEvent } from './submitGtag-
|
|
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 stripeStore, j as stripeStoreInitCheckoutSession, k as cartStoreUpdateToErrorState, t as translate, m as stripeStorePrefetchLandedCost, n as cartStoreNextStep, o as stripeStoreConfirmPayment, p as stripeStoreReset, q as localizationStoreOnUpdate } from './cart-d3c98a81.js';
|
|
3
|
+
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-0ce57f37.js';
|
|
4
|
+
import { c as createCustomEvent, s as sendErrorLog, a as submitGtag, t as trackConversionEvent } from './submitGtag-acdb8bd7.js';
|
|
5
5
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
6
6
|
import { l as log, a as logError } from './logError-c456c092.js';
|
|
7
7
|
import { c as classes } from './classes-0d95c529.js';
|
|
8
|
-
import { g as getBorderRadius } from './getBorderRadius-
|
|
9
|
-
import { i as isDarkColor } from './isDarkColor-
|
|
8
|
+
import { g as getBorderRadius } from './getBorderRadius-393bf797.js';
|
|
9
|
+
import { i as isDarkColor } from './isDarkColor-454ec221.js';
|
|
10
10
|
import { R as RemoveIcon } from './RemoveIcon-9dc5dd1a.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-3b46f3c3.js';
|
|
2
|
-
import { r as handleFetch, u as isValidSelector, h as stripeStore, v as initLocalizationStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-
|
|
3
|
-
import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-
|
|
2
|
+
import { r as handleFetch, u as isValidSelector, h as stripeStore, v as initLocalizationStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-d3c98a81.js';
|
|
3
|
+
import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-0ce57f37.js';
|
|
4
4
|
import { a as logError, l as log } from './logError-c456c092.js';
|
|
5
|
-
import './isDarkColor-
|
|
6
|
-
import './getBorderRadius-
|
|
5
|
+
import './isDarkColor-454ec221.js';
|
|
6
|
+
import './getBorderRadius-393bf797.js';
|
|
7
7
|
|
|
8
8
|
const getZonosSettings = async () => {
|
|
9
9
|
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/zonos-settings`;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-3b46f3c3.js';
|
|
2
|
-
import { l as localizationStore } from './cart-
|
|
3
|
-
import { d as zonosStoreFontFamily } from './zonosStore-
|
|
2
|
+
import { l as localizationStore } from './cart-d3c98a81.js';
|
|
3
|
+
import { d as zonosStoreFontFamily } from './zonosStore-0ce57f37.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import './logError-c456c092.js';
|
|
6
|
-
import './isDarkColor-
|
|
7
|
-
import './getBorderRadius-
|
|
6
|
+
import './isDarkColor-454ec221.js';
|
|
7
|
+
import './getBorderRadius-393bf797.js';
|
|
8
8
|
|
|
9
9
|
const zonosCountryFlagCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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 .flag-container{position:relative;overflow:hidden;width:100%;height:100%}:host .flag-icon{position:absolute;top:0;left:0;width:100%;height:100%;background-position:center;background-repeat:no-repeat;background-size:cover}";
|
|
10
10
|
const ZonosCountryFlagStyle0 = zonosCountryFlagCss;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-3b46f3c3.js';
|
|
2
|
-
import { a as localizationStoreUpdateSelectedCountryCode, l as localizationStore } from './cart-
|
|
3
|
-
import { d as zonosStoreFontFamily } from './zonosStore-
|
|
2
|
+
import { a as localizationStoreUpdateSelectedCountryCode, l as localizationStore } from './cart-d3c98a81.js';
|
|
3
|
+
import { d as zonosStoreFontFamily } from './zonosStore-0ce57f37.js';
|
|
4
4
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
5
|
-
import { i as isDarkColor } from './isDarkColor-
|
|
5
|
+
import { i as isDarkColor } from './isDarkColor-454ec221.js';
|
|
6
6
|
import { l as languages } from './ILanguage-97790bee.js';
|
|
7
7
|
import './logError-c456c092.js';
|
|
8
|
-
import './getBorderRadius-
|
|
8
|
+
import './getBorderRadius-393bf797.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Fuse.js v7.0.0 - Lightweight fuzzy-search (http://fusejs.io)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-3b46f3c3.js';
|
|
2
|
-
import { B as currencyFormat, t as translate, l as localizationStore } from './cart-
|
|
3
|
-
import { z as zonosStore } from './zonosStore-
|
|
2
|
+
import { B as currencyFormat, t as translate, l as localizationStore } from './cart-d3c98a81.js';
|
|
3
|
+
import { z as zonosStore } from './zonosStore-0ce57f37.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
6
6
|
import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
|
|
7
7
|
import './logError-c456c092.js';
|
|
8
|
-
import './isDarkColor-
|
|
9
|
-
import './getBorderRadius-
|
|
8
|
+
import './isDarkColor-454ec221.js';
|
|
9
|
+
import './getBorderRadius-393bf797.js';
|
|
10
10
|
|
|
11
11
|
const getHasMoreSpaceAbove = (ref) => {
|
|
12
12
|
const componentRect = ref.getBoundingClientRect();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-3b46f3c3.js';
|
|
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-
|
|
3
|
-
import { r as handleFetch, l as localizationStore, u as isValidSelector, t as translate, w as getZCountryUrlParam, x as setZCountryUrlParam, y as currencyDisplay, z as currencyConvertAndFormat, A as currencyConvert, B as currencyFormat } from './cart-
|
|
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-0ce57f37.js';
|
|
3
|
+
import { r as handleFetch, l as localizationStore, u as isValidSelector, t as translate, w as getZCountryUrlParam, x as setZCountryUrlParam, y as currencyDisplay, z as currencyConvertAndFormat, A as currencyConvert, B as currencyFormat } from './cart-d3c98a81.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import { a as logError, l as log } from './logError-c456c092.js';
|
|
6
6
|
import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
|
|
7
|
-
import './isDarkColor-
|
|
8
|
-
import './getBorderRadius-
|
|
7
|
+
import './isDarkColor-454ec221.js';
|
|
8
|
+
import './getBorderRadius-393bf797.js';
|
|
9
9
|
|
|
10
10
|
var root = _root;
|
|
11
11
|
|