@zonos/elements 1.3.6 → 1.3.7-alpha.0
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/{localization-2c9f5765.js → cart-ecc80eb0.js} +721 -2
- package/dist/cjs/{getBorderRadius-b252096d.js → getBorderRadius-834c321d.js} +1 -1
- package/dist/cjs/{isDarkColor-168002d6.js → isDarkColor-924e6a7a.js} +1 -1
- package/dist/cjs/{submitGtag-792fe45d.js → submitGtag-907e71d3.js} +3 -3
- package/dist/cjs/zonos-address_4.cjs.entry.js +22 -10
- 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 +7 -5
- package/dist/cjs/zonos-cart-items_9.cjs.entry.js +39 -31
- package/dist/cjs/zonos-checkout.cjs.entry.js +20 -21
- package/dist/cjs/zonos-controller.cjs.entry.js +27 -28
- package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -3
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +9 -8
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +18 -16
- package/dist/cjs/zonos-hello.cjs.entry.js +34 -32
- 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 -5
- package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
- package/dist/cjs/zonos-text.cjs.entry.js +1 -1
- package/dist/cjs/{zonosStore-5d94dabb.js → zonosStore-49d4c92a.js} +4 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +9 -4
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +2 -1
- package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +15 -2
- package/dist/collection/components/store/checkout/stripe.js +3 -0
- package/dist/collection/components/store/hello/localization.js +27 -1
- package/dist/collection/components/store/zonosStore.js +4 -4
- package/dist/collection/types/generated/graphql.customer.types.js +6 -0
- package/dist/components/stripe.js +4040 -2
- package/dist/components/submitGtag.js +1 -1
- package/dist/components/zonos-address2.js +1 -2
- package/dist/components/zonos-cart-subtotal2.js +1 -2
- package/dist/components/zonos-checkout-finish2.js +14 -6
- package/dist/components/zonos-checkout-footer2.js +1 -1
- package/dist/components/zonos-checkout-payment2.js +1 -2
- package/dist/components/zonos-checkout.js +1 -2
- package/dist/components/zonos-collapse2.js +15 -2
- package/dist/components/zonos-controller.js +1 -2
- package/dist/components/zonos-country-flag2.js +1 -1
- package/dist/components/zonos-country-select2.js +1 -1
- package/dist/components/zonos-customer-info2.js +2 -3
- package/dist/components/zonos-hello-dialog-footer2.js +1 -1
- package/dist/components/zonos-hello-dialog2.js +1 -1
- package/dist/components/zonos-hello.js +1 -1
- package/dist/components/zonos-language-select2.js +1 -1
- package/dist/components/zonos-review2.js +1 -2
- package/dist/components/zonos-shipping2.js +1 -2
- package/dist/components/zonosStore.js +4 -4
- package/dist/esm/{localization-d8f6453b.js → cart-2a0a6871.js} +707 -3
- package/dist/esm/{getBorderRadius-e9736f7e.js → getBorderRadius-0c7dfcf0.js} +1 -1
- package/dist/esm/{isDarkColor-e982fa09.js → isDarkColor-d0a57fd2.js} +1 -1
- package/dist/esm/{submitGtag-bebe2cb0.js → submitGtag-a38aed23.js} +2 -2
- package/dist/esm/zonos-address_4.entry.js +19 -7
- 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 -2
- package/dist/esm/zonos-cart-items_9.entry.js +19 -11
- package/dist/esm/zonos-checkout.entry.js +5 -6
- package/dist/esm/zonos-controller.entry.js +4 -5
- package/dist/esm/zonos-country-flag.entry.js +4 -2
- package/dist/esm/zonos-country-select_3.entry.js +4 -3
- package/dist/esm/zonos-hello-dialog.entry.js +4 -2
- package/dist/esm/zonos-hello.entry.js +4 -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 -5
- package/dist/esm/zonos-select-dialog-header_2.entry.js +1 -1
- package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
- package/dist/esm/zonos-text.entry.js +1 -1
- package/dist/esm/{zonosStore-e6c7be3a.js → zonosStore-dec6bd7e.js} +4 -4
- package/dist/esm-es5/cart-2a0a6871.js +1 -0
- package/dist/esm-es5/{getBorderRadius-e9736f7e.js → getBorderRadius-0c7dfcf0.js} +1 -1
- package/dist/esm-es5/{isDarkColor-e982fa09.js → isDarkColor-d0a57fd2.js} +1 -1
- package/dist/esm-es5/submitGtag-a38aed23.js +1 -0
- package/dist/esm-es5/zonos-address_4.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_9.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-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-e6c7be3a.js → zonosStore-dec6bd7e.js} +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/scripts/zonosBase.js +1 -1
- package/dist/types/components/store/checkout/stripe.d.ts +4 -0
- package/dist/types/components/store/zonosStore.d.ts +1 -1
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/hello/currencyConversion/getLanguageCode.d.ts +1 -1
- package/dist/types/types/ICountryJson.d.ts +2 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +15 -0
- package/dist/types/types/generated/graphql.customer.types.ts +24 -0
- package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
- package/dist/zonos-elements/p-0057e374.entry.js +1 -0
- package/dist/zonos-elements/p-066c5893.system.js +1 -1
- package/dist/zonos-elements/p-0c72fb79.system.entry.js +1 -0
- package/dist/zonos-elements/p-1f85a98c.system.entry.js +1 -0
- package/dist/zonos-elements/{p-96aabe02.entry.js → p-290c3670.entry.js} +1 -1
- package/dist/zonos-elements/{p-e8a9bc56.entry.js → p-2d2e1831.entry.js} +1 -1
- package/dist/zonos-elements/p-2f1e1cbb.system.entry.js +1 -0
- package/dist/zonos-elements/{p-a682fd38.system.entry.js → p-33080cde.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-17550a10.js → p-34c03be2.js} +1 -1
- package/dist/zonos-elements/{p-a33745e9.entry.js → p-34efed1d.entry.js} +1 -1
- package/dist/zonos-elements/p-375c472a.system.entry.js +1 -0
- package/dist/zonos-elements/{p-fcc4f140.system.js → p-549c181b.system.js} +1 -1
- package/dist/zonos-elements/{p-32bca9c8.system.entry.js → p-55970b10.system.entry.js} +1 -1
- package/dist/zonos-elements/p-561e44d6.entry.js +1 -0
- package/dist/zonos-elements/{p-50287643.system.js → p-591eb6dd.system.js} +1 -1
- package/dist/zonos-elements/p-5b44abc8.system.js +1 -0
- package/dist/zonos-elements/p-5c4dc123.js +1 -0
- package/dist/zonos-elements/{p-ec25f180.entry.js → p-656c836b.entry.js} +1 -1
- package/dist/zonos-elements/{p-49a764e9.system.entry.js → p-67737613.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-dd7729fd.system.entry.js → p-79b910bf.system.entry.js} +1 -1
- package/dist/zonos-elements/p-7d1d862f.system.entry.js +1 -0
- package/dist/zonos-elements/{p-5a113c3d.system.entry.js → p-88a55076.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-7dd8e8ba.system.entry.js → p-8aeb4679.system.entry.js} +1 -1
- package/dist/zonos-elements/p-8d645a00.entry.js +1 -0
- package/dist/zonos-elements/p-9878a770.js +1 -0
- package/dist/zonos-elements/p-a219689f.entry.js +1 -0
- package/dist/zonos-elements/p-a3d72a33.entry.js +1 -0
- package/dist/zonos-elements/p-a93c594f.entry.js +1 -0
- package/dist/zonos-elements/{p-0c7480a5.entry.js → p-a95c034c.entry.js} +1 -1
- package/dist/zonos-elements/{p-7a6144b1.entry.js → p-afe40057.entry.js} +1 -1
- package/dist/zonos-elements/p-b10ff468.entry.js +1 -0
- package/dist/zonos-elements/p-b6992dc2.system.entry.js +1 -0
- package/dist/zonos-elements/{p-3ef27745.js → p-bce46c41.js} +1 -1
- package/dist/zonos-elements/p-c56d4a44.entry.js +1 -0
- package/dist/zonos-elements/{p-bd6a2095.entry.js → p-c7098c3b.entry.js} +1 -1
- package/dist/zonos-elements/{p-f49dfd06.system.js → p-cbb1e700.system.js} +1 -1
- package/dist/zonos-elements/p-cc63a29f.system.entry.js +1 -0
- package/dist/zonos-elements/p-cd8bd5e9.system.entry.js +1 -0
- package/dist/zonos-elements/p-d36faf87.system.entry.js +1 -0
- package/dist/zonos-elements/p-dfd3edcf.entry.js +1 -0
- package/dist/zonos-elements/{p-ba43275e.entry.js → p-e161a08c.entry.js} +1 -1
- package/dist/zonos-elements/{p-9cbbf261.system.entry.js → p-e2770968.system.entry.js} +1 -1
- package/dist/zonos-elements/p-e2c6ad57.entry.js +1 -0
- package/dist/zonos-elements/{p-b81a0577.system.entry.js → p-e855966f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-ea93943a.system.entry.js +1 -0
- package/dist/zonos-elements/{p-e99d79d9.system.js → p-ec4d08b3.system.js} +1 -1
- package/dist/zonos-elements/{p-47fac33f.js → p-f455e08c.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/cart-b8bbf22d.js +0 -698
- package/dist/components/localization.js +0 -4016
- package/dist/esm/cart-bc3bb22e.js +0 -682
- package/dist/esm-es5/cart-bc3bb22e.js +0 -1
- package/dist/esm-es5/localization-d8f6453b.js +0 -1
- package/dist/esm-es5/submitGtag-bebe2cb0.js +0 -1
- package/dist/zonos-elements/p-00d63df1.system.entry.js +0 -1
- package/dist/zonos-elements/p-04f63cea.entry.js +0 -1
- package/dist/zonos-elements/p-16b74c31.system.js +0 -1
- package/dist/zonos-elements/p-1d16a6fb.js +0 -1
- package/dist/zonos-elements/p-1ea68e3b.entry.js +0 -1
- package/dist/zonos-elements/p-1ed530cc.entry.js +0 -1
- package/dist/zonos-elements/p-289c8b1a.system.entry.js +0 -1
- package/dist/zonos-elements/p-2a00c270.system.entry.js +0 -1
- package/dist/zonos-elements/p-37f53a79.entry.js +0 -1
- package/dist/zonos-elements/p-394cf1cf.js +0 -1
- package/dist/zonos-elements/p-458fd100.system.entry.js +0 -1
- package/dist/zonos-elements/p-4fafb2a5.system.entry.js +0 -1
- package/dist/zonos-elements/p-4fb71a93.js +0 -1
- package/dist/zonos-elements/p-5276c61b.system.entry.js +0 -1
- package/dist/zonos-elements/p-6308b347.entry.js +0 -1
- package/dist/zonos-elements/p-63d1b1fe.entry.js +0 -1
- package/dist/zonos-elements/p-7347ee7c.system.entry.js +0 -1
- package/dist/zonos-elements/p-8c26a080.system.js +0 -1
- package/dist/zonos-elements/p-ba1a111a.system.entry.js +0 -1
- package/dist/zonos-elements/p-c4321084.system.entry.js +0 -1
- package/dist/zonos-elements/p-cdf114a2.entry.js +0 -1
- package/dist/zonos-elements/p-d5ae3cbb.system.entry.js +0 -1
- package/dist/zonos-elements/p-d5d7c8f5.entry.js +0 -1
- package/dist/zonos-elements/p-de339fb6.entry.js +0 -1
- package/dist/zonos-elements/p-f6f5f644.entry.js +0 -1
|
@@ -3,17 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-72767498.js');
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
require('./
|
|
10
|
-
require('./getBorderRadius-b252096d.js');
|
|
6
|
+
const cart = require('./cart-ecc80eb0.js');
|
|
7
|
+
const zonosStore = require('./zonosStore-49d4c92a.js');
|
|
8
|
+
require('./isDarkColor-924e6a7a.js');
|
|
9
|
+
require('./getBorderRadius-834c321d.js');
|
|
11
10
|
|
|
12
11
|
const getZonosSettings = async () => {
|
|
13
12
|
const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/zonos-settings`;
|
|
14
|
-
const { errors, json } = await
|
|
13
|
+
const { errors, json } = await cart.handleFetch(url);
|
|
15
14
|
if (errors.length) {
|
|
16
|
-
|
|
15
|
+
cart.logError(`Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings`);
|
|
17
16
|
return { errors, json: null };
|
|
18
17
|
}
|
|
19
18
|
return { errors: [], json };
|
|
@@ -33,8 +32,8 @@ const initCheckout = (config) => {
|
|
|
33
32
|
return;
|
|
34
33
|
}
|
|
35
34
|
// check if checkout button anchor selector user pass in is valid
|
|
36
|
-
if (!
|
|
37
|
-
|
|
35
|
+
if (!cart.isValidSelector(config.placeOrderButtonSelector)) {
|
|
36
|
+
cart.logError(`Selector checkoutButtonAnchor "${config.placeOrderButtonSelector}" is not a valid selector`);
|
|
38
37
|
return;
|
|
39
38
|
}
|
|
40
39
|
injectCheckoutElement();
|
|
@@ -51,12 +50,12 @@ const injectHelloComponent = (triggerAnchorElement) => {
|
|
|
51
50
|
const initHello = async (helloSettings) => {
|
|
52
51
|
const { anchorElementSelector } = helloSettings;
|
|
53
52
|
// check if checkout button anchor selector user pass in is valid to setup hello
|
|
54
|
-
if (!anchorElementSelector || !
|
|
55
|
-
|
|
53
|
+
if (!anchorElementSelector || !cart.isValidSelector(anchorElementSelector)) {
|
|
54
|
+
cart.logError(`Selector anchorElementSelector "${helloSettings.anchorElementSelector}" is not a valid selector.`);
|
|
56
55
|
return;
|
|
57
56
|
}
|
|
58
57
|
const triggerElement = document.querySelector(anchorElementSelector);
|
|
59
|
-
|
|
58
|
+
cart.log('Hello init complete');
|
|
60
59
|
injectHelloComponent(triggerElement);
|
|
61
60
|
};
|
|
62
61
|
|
|
@@ -76,12 +75,12 @@ const ZonosController = class {
|
|
|
76
75
|
async initCheckoutElement(stripe) {
|
|
77
76
|
if (!stripe) {
|
|
78
77
|
// eslint-disable-next-line no-console
|
|
79
|
-
|
|
78
|
+
cart.log('Stripe is not loaded yet - cannot init checkout element', 'warn');
|
|
80
79
|
return;
|
|
81
80
|
}
|
|
82
81
|
cart.stripeStore.stripe = stripe;
|
|
83
82
|
void initCheckout(zonosStore.zonosStore.checkoutSettings);
|
|
84
|
-
|
|
83
|
+
cart.log('init checkout element');
|
|
85
84
|
}
|
|
86
85
|
/**
|
|
87
86
|
* Init zonos notification
|
|
@@ -106,13 +105,13 @@ const ZonosController = class {
|
|
|
106
105
|
// Do nothing if font is Inter, since we already inject it on start
|
|
107
106
|
return;
|
|
108
107
|
}
|
|
109
|
-
|
|
108
|
+
cart.log(`[FONT] Just applied Inter , but no need to inject since we already inject Inter on start`, 'warn');
|
|
110
109
|
zonosStore.zonosStore.appearance = Object.assign(Object.assign({}, zonosStore.zonosStore.appearance), { fontFamily: overrideFont });
|
|
111
110
|
}
|
|
112
111
|
const routeUrl = "https://v1.route.js.zonos.com";
|
|
113
|
-
const { errors, json } = await
|
|
112
|
+
const { errors, json } = await cart.handleFetch(`${routeUrl}/api/zonos-elements/get-font-detail?family=${fontSelected}`);
|
|
114
113
|
if (errors.length > 0 || !json) {
|
|
115
|
-
|
|
114
|
+
cart.log(`Failed to load font ${fontSelected}`, 'warn');
|
|
116
115
|
return;
|
|
117
116
|
}
|
|
118
117
|
const fontUrl = json.fontUrl;
|
|
@@ -121,7 +120,7 @@ const ZonosController = class {
|
|
|
121
120
|
return;
|
|
122
121
|
}
|
|
123
122
|
// apply override font
|
|
124
|
-
|
|
123
|
+
cart.log(`[FONT] ${overrideFont} font override applied`);
|
|
125
124
|
zonosStore.zonosStore.appearance = Object.assign(Object.assign({}, zonosStore.zonosStore.appearance), { fontFamily: overrideFont });
|
|
126
125
|
}
|
|
127
126
|
async componentWillLoad() {
|
|
@@ -131,7 +130,7 @@ const ZonosController = class {
|
|
|
131
130
|
var _a, _b;
|
|
132
131
|
const { errors, json } = await getZonosSettings();
|
|
133
132
|
if (((_a = errors[0]) === null || _a === void 0 ? void 0 : _a.type.toString()) === '403') {
|
|
134
|
-
|
|
133
|
+
cart.log('Failed to load zonos settings. This domain may not have access', 'warn');
|
|
135
134
|
return;
|
|
136
135
|
}
|
|
137
136
|
// init zonos notification
|
|
@@ -147,28 +146,28 @@ const ZonosController = class {
|
|
|
147
146
|
void initHello(zonosStore.zonosStore.helloSettings);
|
|
148
147
|
}
|
|
149
148
|
// init localization store
|
|
150
|
-
await
|
|
149
|
+
await cart.initLocalizationStore();
|
|
151
150
|
// checkout init
|
|
152
151
|
const publishableKey = ((_b = json === null || json === void 0 ? void 0 : json.checkoutSettings) === null || _b === void 0 ? void 0 : _b.externalServiceTokens.find(item => item.type === 'STRIPE_PUBLISHABLE_TOKEN')) || null;
|
|
153
152
|
if (!publishableKey || !this.stripeInitEvent) {
|
|
154
|
-
|
|
153
|
+
cart.log('Checkout failed to load -- missing publishable key', 'warn');
|
|
155
154
|
return;
|
|
156
155
|
}
|
|
157
156
|
if (zonosStore.zonosStore.checkoutSettings.subscriptionStatus === 'INACTIVE') {
|
|
158
|
-
|
|
159
|
-
|
|
157
|
+
cart.log('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===', 'warn');
|
|
158
|
+
cart.log('zonos controller loaded');
|
|
160
159
|
return;
|
|
161
160
|
}
|
|
162
161
|
if (zonosStore.zonosStore.checkoutSettings.visibilityStatus === 'DISABLED') {
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
cart.log('=== Checkout is disabled by store owner ===', 'warn');
|
|
163
|
+
cart.log('zonos controller loaded');
|
|
165
164
|
return;
|
|
166
165
|
}
|
|
167
166
|
// send publishable key out to load stripe
|
|
168
167
|
this.stripeInitEvent.emit({
|
|
169
168
|
publishableKey: publishableKey.token,
|
|
170
169
|
});
|
|
171
|
-
|
|
170
|
+
cart.log('zonos controller loaded');
|
|
172
171
|
})();
|
|
173
172
|
}
|
|
174
173
|
/**
|
|
@@ -177,7 +176,7 @@ const ZonosController = class {
|
|
|
177
176
|
async showNotification(notification) {
|
|
178
177
|
const notificationElement = document.querySelector('zonos-notification');
|
|
179
178
|
if (!notificationElement) {
|
|
180
|
-
|
|
179
|
+
cart.log('Failed to show notification - zonos-notification not found', 'warn');
|
|
181
180
|
return;
|
|
182
181
|
}
|
|
183
182
|
void notificationElement.showNotification(notification);
|
|
@@ -196,7 +195,7 @@ const ZonosController = class {
|
|
|
196
195
|
* Override country code for storybook
|
|
197
196
|
*/
|
|
198
197
|
async overrideCountry(countryCode) {
|
|
199
|
-
void
|
|
198
|
+
void cart.localizationStoreUpdateSelectedCountryCode(countryCode);
|
|
200
199
|
}
|
|
201
200
|
/**
|
|
202
201
|
* Get appearance from setting
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-72767498.js');
|
|
6
|
-
const
|
|
7
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const cart = require('./cart-ecc80eb0.js');
|
|
7
|
+
const zonosStore = require('./zonosStore-49d4c92a.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
|
+
require('./isDarkColor-924e6a7a.js');
|
|
10
|
+
require('./getBorderRadius-834c321d.js');
|
|
9
11
|
|
|
10
12
|
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}";
|
|
11
13
|
const ZonosCountryFlagStyle0 = zonosCountryFlagCss;
|
|
@@ -14,7 +16,7 @@ const FLAG_URL = "https://zonos-store-assets.s3.amazonaws.com/images/elements-fl
|
|
|
14
16
|
const ZonosCountryFlag = class {
|
|
15
17
|
constructor(hostRef) {
|
|
16
18
|
index.registerInstance(this, hostRef);
|
|
17
|
-
this.countryCode =
|
|
19
|
+
this.countryCode = cart.localizationStore.selectedCountryCode;
|
|
18
20
|
this.size = undefined;
|
|
19
21
|
}
|
|
20
22
|
render() {
|
|
@@ -3,10 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-72767498.js');
|
|
6
|
-
const
|
|
7
|
-
const zonosStore = require('./zonosStore-
|
|
8
|
-
const isDarkColor = require('./isDarkColor-
|
|
6
|
+
const cart = require('./cart-ecc80eb0.js');
|
|
7
|
+
const zonosStore = require('./zonosStore-49d4c92a.js');
|
|
8
|
+
const isDarkColor = require('./isDarkColor-924e6a7a.js');
|
|
9
9
|
const ILanguage = require('./ILanguage-d247b45b.js');
|
|
10
|
+
require('./getBorderRadius-834c321d.js');
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Fuse.js v6.6.2 - Lightweight fuzzy-search (http://fusejs.io)
|
|
@@ -1801,7 +1802,7 @@ const ZonosCountrySelect = class {
|
|
|
1801
1802
|
index.registerInstance(this, hostRef);
|
|
1802
1803
|
this.countrySelected = (countryCode) => {
|
|
1803
1804
|
// mutate the selected country code in store
|
|
1804
|
-
void
|
|
1805
|
+
void cart.localizationStoreUpdateSelectedCountryCode(countryCode);
|
|
1805
1806
|
this.handleOnClose();
|
|
1806
1807
|
};
|
|
1807
1808
|
this.handleInputChange = (event) => {
|
|
@@ -1812,7 +1813,7 @@ const ZonosCountrySelect = class {
|
|
|
1812
1813
|
this.inputValue = '';
|
|
1813
1814
|
}
|
|
1814
1815
|
render() {
|
|
1815
|
-
const { shippingZoneCountries } =
|
|
1816
|
+
const { shippingZoneCountries } = cart.localizationStore;
|
|
1816
1817
|
const countries = shippingZoneCountries
|
|
1817
1818
|
? Object.values(shippingZoneCountries)
|
|
1818
1819
|
: [];
|
|
@@ -1825,7 +1826,7 @@ const ZonosCountrySelect = class {
|
|
|
1825
1826
|
: countries.sort((a, b) => a.displayName.localeCompare(b.displayName));
|
|
1826
1827
|
return (index.h(index.Host, { key: 'fb1115a06814daaf8ebb7d9e282fdd1bd944121f', class: "zonos--elements", style: {
|
|
1827
1828
|
'--font-family': zonosStore.zonosStoreFontFamily(),
|
|
1828
|
-
} }, index.h("div", { key: 'eb9eb7dba8f170c6190fd29e670b002ecb39a849', class: "zonos--country-select" }, index.h("zonos-v-stack", { key: '4667474f03efbad9fbb0ea4153d16b49a7f2803f', class: "zonos--country-select-header", spacing: 8 }, index.h("zonos-select-dialog-header", { key: 'c2777f838d9d376878e1218868ed8df0d28dc5f2', handleOnClose: () => this.handleOnClose(), label: "Select a country" }, index.h("input", { key: '1e41b3888bce97a94ff88c4b3b3389cc8d4de096', class: "zonos--country-select-input", onInput: this.handleInputChange, placeholder: "Search countries", value: this.inputValue }))), index.h("div", { key: 'ba89ae931e2a0e564112d9989d8074674906a297', class: "zonos--country-select-content" }, filteredCountries.map(country => (index.h("button", { class: "zonos--country-select-country", onClick: () => this.countrySelected(country.code) }, index.h("zonos-country-flag", { class: "zonos--country-flag", countryCode: country.code }), index.h("zonos-text", { color: "gray-800" }, country.displayName), country.code ===
|
|
1829
|
+
} }, index.h("div", { key: 'eb9eb7dba8f170c6190fd29e670b002ecb39a849', class: "zonos--country-select" }, index.h("zonos-v-stack", { key: '4667474f03efbad9fbb0ea4153d16b49a7f2803f', class: "zonos--country-select-header", spacing: 8 }, index.h("zonos-select-dialog-header", { key: 'c2777f838d9d376878e1218868ed8df0d28dc5f2', handleOnClose: () => this.handleOnClose(), label: "Select a country" }, index.h("input", { key: '1e41b3888bce97a94ff88c4b3b3389cc8d4de096', class: "zonos--country-select-input", onInput: this.handleInputChange, placeholder: "Search countries", value: this.inputValue }))), index.h("div", { key: 'ba89ae931e2a0e564112d9989d8074674906a297', class: "zonos--country-select-content" }, filteredCountries.map(country => (index.h("button", { class: "zonos--country-select-country", onClick: () => this.countrySelected(country.code) }, index.h("zonos-country-flag", { class: "zonos--country-flag", countryCode: country.code }), index.h("zonos-text", { color: "gray-800" }, country.displayName), country.code === cart.localizationStore.selectedCountryCode && (index.h("zonos-icon", { content: GreenCheckDuotoneIcon, size: 20 })))))))));
|
|
1829
1830
|
}
|
|
1830
1831
|
};
|
|
1831
1832
|
ZonosCountrySelect.style = ZonosCountrySelectStyle0;
|
|
@@ -1873,10 +1874,10 @@ const ZonosHelloDialogFooter = class {
|
|
|
1873
1874
|
var _a, _b, _c;
|
|
1874
1875
|
const primaryColor = (_a = this.appearanceSettings) === null || _a === void 0 ? void 0 : _a.colorPrimary;
|
|
1875
1876
|
const footerTheme = primaryColor && isDarkColor.isDarkColor(primaryColor) ? 'DARK' : 'LIGHT';
|
|
1876
|
-
const language = (_b = ILanguage.languages.find(x => x.code ===
|
|
1877
|
+
const language = (_b = ILanguage.languages.find(x => x.code === cart.localizationStore.selectedLocale)) === null || _b === void 0 ? void 0 : _b.translatedLabel;
|
|
1877
1878
|
return (index.h(index.Host, { key: 'a3a6ab0e4af4981cc83802be1433c3c41da58c19', class: "zonos--elements" }, index.h("div", { key: 'fdea45d1b4d83055a3d17918a5ae78f43a7e0042', class: "zonos--hello-dialog-footer", "data-theme": footerTheme, style: {
|
|
1878
1879
|
'--primary-color': (_c = this.appearanceSettings) === null || _c === void 0 ? void 0 : _c.colorPrimary,
|
|
1879
|
-
} }, index.h("a", { key: '4d4e995052049238d4c522ff8501dddbe25e29d5', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, index.h("zonos-icon", { key: '4ca16c024473660f74cfc7a3d506b8ba4ebf7362', "aria-label": "Zonos Logo", autoHeight: true, content: ZonosIcon, iconColor: "gray-1200", size: 108 })), index.h("div", { key: 'dd1da686f8345431c3805898f374e5fb22e27289', class: "zonos--hello-locale-wrapper" }, index.h("zonos-button", { key: 'd5c34c75c5006710ff6d0426d43f07a5ade41827', buttonColor: "gray-1200", icon: index.h("zonos-icon", { "aria-label": "Open language select", content: Globe, iconColor: "gray-1200" }), onClick: () => this.setShowLanguageSelect(true), variant: "subtle" }, language), index.h("zonos-button", { key: '43759ce87473b10e078f14dce529db502a5edd4d', buttonColor: "gray-1200", icon: index.h("zonos-country-flag", { "aria-label": "Open country select", class: "zonos--footer-country-flag", countryCode:
|
|
1880
|
+
} }, index.h("a", { key: '4d4e995052049238d4c522ff8501dddbe25e29d5', href: "https://zonos.com", target: "_blank", title: "Zonos website" }, index.h("zonos-icon", { key: '4ca16c024473660f74cfc7a3d506b8ba4ebf7362', "aria-label": "Zonos Logo", autoHeight: true, content: ZonosIcon, iconColor: "gray-1200", size: 108 })), index.h("div", { key: 'dd1da686f8345431c3805898f374e5fb22e27289', class: "zonos--hello-locale-wrapper" }, index.h("zonos-button", { key: 'd5c34c75c5006710ff6d0426d43f07a5ade41827', buttonColor: "gray-1200", icon: index.h("zonos-icon", { "aria-label": "Open language select", content: Globe, iconColor: "gray-1200" }), onClick: () => this.setShowLanguageSelect(true), variant: "subtle" }, language), index.h("zonos-button", { key: '43759ce87473b10e078f14dce529db502a5edd4d', buttonColor: "gray-1200", icon: index.h("zonos-country-flag", { "aria-label": "Open country select", class: "zonos--footer-country-flag", countryCode: cart.localizationStore.selectedCountryCode }), onClick: () => this.setShowCountrySelect(true), variant: "subtle" }, cart.localizationStore.selectedCountryCode)))));
|
|
1880
1881
|
}
|
|
1881
1882
|
};
|
|
1882
1883
|
ZonosHelloDialogFooter.style = ZonosHelloDialogFooterStyle0;
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-72767498.js');
|
|
6
|
-
const
|
|
7
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const cart = require('./cart-ecc80eb0.js');
|
|
7
|
+
const zonosStore = require('./zonosStore-49d4c92a.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
10
|
+
require('./isDarkColor-924e6a7a.js');
|
|
11
|
+
require('./getBorderRadius-834c321d.js');
|
|
10
12
|
|
|
11
13
|
const getHasMoreSpaceAbove = (ref) => {
|
|
12
14
|
const componentRect = ref.getBoundingClientRect();
|
|
@@ -85,37 +87,37 @@ const ZonosHelloDialog = class {
|
|
|
85
87
|
}
|
|
86
88
|
render() {
|
|
87
89
|
var _a;
|
|
88
|
-
const { countryLandedCost, selectedCountryCode } =
|
|
90
|
+
const { countryLandedCost, selectedCountryCode } = cart.localizationStore;
|
|
89
91
|
// Our Robby API spells deminimis wrong here
|
|
90
92
|
const dutyDeminimis = (countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.dutyDeminimus)
|
|
91
|
-
?
|
|
93
|
+
? cart.currencyFormat(countryLandedCost.dutyDeminimus)
|
|
92
94
|
: null;
|
|
93
95
|
// If Canada, use 40 CAD (courier duty de minimis)
|
|
94
|
-
const dutyDeminimisToUse =
|
|
95
|
-
?
|
|
96
|
+
const dutyDeminimisToUse = cart.localizationStore.selectedCountryCode === 'CA'
|
|
97
|
+
? cart.currencyFormat(40)
|
|
96
98
|
: dutyDeminimis;
|
|
97
99
|
// If deminimis is undefined or null, assume it's $0
|
|
98
100
|
const dutyDeMinimisMessage = dutyDeminimisToUse
|
|
99
|
-
? `${
|
|
100
|
-
:
|
|
101
|
+
? `${cart.translate('Spend')} ${dutyDeminimisToUse} ${cart.translate('duty free')}`
|
|
102
|
+
: cart.translate('Duties will apply to all orders');
|
|
101
103
|
// Our Robby API spells deminimis wrong here
|
|
102
104
|
const taxDeminimis = (countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.vatTaxDeminimus)
|
|
103
|
-
?
|
|
105
|
+
? cart.currencyFormat(countryLandedCost.vatTaxDeminimus)
|
|
104
106
|
: null;
|
|
105
107
|
// If Canada, use 150 CAD (courier tax de minimis)
|
|
106
|
-
const taxDeminimisToUse =
|
|
107
|
-
?
|
|
108
|
+
const taxDeminimisToUse = cart.localizationStore.selectedCountryCode === 'CA'
|
|
109
|
+
? cart.currencyFormat(150)
|
|
108
110
|
: taxDeminimis;
|
|
109
111
|
const taxDeMinimisMessage = taxDeminimisToUse
|
|
110
|
-
? `${
|
|
111
|
-
:
|
|
112
|
+
? `${cart.translate('Spend')} ${taxDeminimisToUse} ${cart.translate('tax free')}`
|
|
113
|
+
: cart.translate('Taxes will apply to all orders');
|
|
112
114
|
const animateLeft = this.animateFromLeftOverride ||
|
|
113
115
|
(this.dialogRef && getHasMoreSpaceOnRight.getHasMoreSpaceOnRight(this.dialogRef));
|
|
114
116
|
const animateFromBottom = this.dialogRef && getHasMoreSpaceAbove(this.dialogRef);
|
|
115
|
-
const { customMessages } =
|
|
116
|
-
const welcomeMessage = `${
|
|
117
|
+
const { customMessages } = cart.localizationStore;
|
|
118
|
+
const welcomeMessage = `${cart.translate('Welcome to')} ${zonosStore.zonosStore.organizationName}!`;
|
|
117
119
|
const defaultMessage = ((_a = customMessages.find(x => x.pageName === 'hello_default')) === null || _a === void 0 ? void 0 : _a.message) ||
|
|
118
|
-
|
|
120
|
+
cart.translate('Know about duties and taxes before you buy. Shop with confidence!');
|
|
119
121
|
const currentPage = this.getCurrentPageEnum();
|
|
120
122
|
const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
|
|
121
123
|
return (index.h(index.Host, { key: '303f914b4511500edcd8d041ccfd52f0c48a7a85', class: "zonos--elements" }, index.h("div", { key: 'f52025ee53c0cdbbf20ecbb874e5639194b6507b', "aria-hidden": "true", class: classes.classes([
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-72767498.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
7
|
-
const
|
|
6
|
+
const zonosStore = require('./zonosStore-49d4c92a.js');
|
|
7
|
+
const cart = require('./cart-ecc80eb0.js');
|
|
8
8
|
const classes = require('./classes-b7918f56.js');
|
|
9
9
|
const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
|
|
10
|
+
require('./isDarkColor-924e6a7a.js');
|
|
11
|
+
require('./getBorderRadius-834c321d.js');
|
|
10
12
|
|
|
11
13
|
var root = zonosStore._root;
|
|
12
14
|
|
|
@@ -368,9 +370,9 @@ const checkItemRestrictions = async ({ items, shipFrom, shipTo, }) => {
|
|
|
368
370
|
shipFrom,
|
|
369
371
|
shipTo,
|
|
370
372
|
};
|
|
371
|
-
const { errors, json } = await
|
|
373
|
+
const { errors, json } = await cart.handleFetch(url, { body, method: 'POST' });
|
|
372
374
|
if (errors.length || !json) {
|
|
373
|
-
|
|
375
|
+
cart.logError(`Error fetching item restrictions: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
|
|
374
376
|
return [];
|
|
375
377
|
}
|
|
376
378
|
return json.filter(Boolean);
|
|
@@ -380,9 +382,9 @@ const detectItemRestrictions = async (newProducts) => {
|
|
|
380
382
|
if (!newProducts.length) {
|
|
381
383
|
return [];
|
|
382
384
|
}
|
|
383
|
-
const { selectedCountryCode } =
|
|
385
|
+
const { selectedCountryCode } = cart.localizationStore;
|
|
384
386
|
if (!selectedCountryCode) {
|
|
385
|
-
|
|
387
|
+
cart.logError('Hello Could not check item restrictions - No country code selected');
|
|
386
388
|
return [];
|
|
387
389
|
}
|
|
388
390
|
const items = newProducts.map(product => ({
|
|
@@ -426,30 +428,30 @@ const getProductsOnPage = () => {
|
|
|
426
428
|
var _a, _b;
|
|
427
429
|
const { productAddToCartElementSelector, productDescriptionElementSelector, productTitleElementSelector, restrictionBehavior, } = zonosStore.zonosStore.helloSettings;
|
|
428
430
|
if (!productTitleElementSelector || !productDescriptionElementSelector) {
|
|
429
|
-
|
|
431
|
+
cart.logError(`Hello Could not check item restrictions - must provide title and description selectors.`);
|
|
430
432
|
}
|
|
431
433
|
const titleNodes = (productTitleElementSelector &&
|
|
432
|
-
|
|
434
|
+
cart.isValidSelector(productTitleElementSelector) &&
|
|
433
435
|
document.querySelectorAll(productTitleElementSelector)) ||
|
|
434
436
|
[];
|
|
435
437
|
const descriptionNodes = (productDescriptionElementSelector &&
|
|
436
|
-
|
|
438
|
+
cart.isValidSelector(productDescriptionElementSelector) &&
|
|
437
439
|
document.querySelectorAll(productDescriptionElementSelector)) ||
|
|
438
440
|
[];
|
|
439
441
|
if (titleNodes.length !== descriptionNodes.length) {
|
|
440
442
|
// If the title and description selectors don't match, kill item restrictions altogether
|
|
441
|
-
|
|
443
|
+
cart.logError('Hello Could not check item restrictions - Title and description selectors do not match');
|
|
442
444
|
return [];
|
|
443
445
|
}
|
|
444
446
|
const shouldDisableCart = restrictionBehavior === 'RESTRICT_AND_BLOCK';
|
|
445
447
|
const cartButtonNodes = (shouldDisableCart &&
|
|
446
448
|
productAddToCartElementSelector &&
|
|
447
|
-
|
|
449
|
+
cart.isValidSelector(productAddToCartElementSelector) &&
|
|
448
450
|
document.querySelectorAll(productAddToCartElementSelector)) ||
|
|
449
451
|
[];
|
|
450
452
|
if (shouldDisableCart && cartButtonNodes.length !== descriptionNodes.length) {
|
|
451
453
|
// If the "add to cart" selectors don't match, log the error and continue
|
|
452
|
-
|
|
454
|
+
cart.logError('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match');
|
|
453
455
|
}
|
|
454
456
|
const mergedElements = [];
|
|
455
457
|
for (let i = 0; i < titleNodes.length; i++) {
|
|
@@ -480,20 +482,20 @@ const ZonosHello = class {
|
|
|
480
482
|
const isRestrictionPage = zonosStore.zonosStore.currentHelloPage === 'productDetail' ||
|
|
481
483
|
zonosStore.zonosStore.currentHelloPage === 'productList';
|
|
482
484
|
if (isRestrictionPage && this.allRestrictedItems.length) {
|
|
483
|
-
const clickMessage =
|
|
485
|
+
const clickMessage = cart.translate('click to learn more');
|
|
484
486
|
const restrictMessage = zonosStore.zonosStore.currentHelloPage === 'productDetail'
|
|
485
|
-
?
|
|
486
|
-
:
|
|
487
|
+
? cart.translate('Restricted item')
|
|
488
|
+
: cart.translate('Restricted items found');
|
|
487
489
|
return `${restrictMessage} - ${clickMessage}`;
|
|
488
490
|
}
|
|
489
491
|
switch (zonosStore.zonosStore.currentHelloPage) {
|
|
490
492
|
case 'cart':
|
|
491
|
-
return
|
|
493
|
+
return cart.translate(`Prepay duties and taxes at checkout`);
|
|
492
494
|
case 'productList':
|
|
493
495
|
case 'productDetail':
|
|
494
|
-
return
|
|
496
|
+
return cart.translate(`See duty and tax thresholds`);
|
|
495
497
|
default:
|
|
496
|
-
return `${
|
|
498
|
+
return `${cart.translate('Welcome to')} ${organizationName}`;
|
|
497
499
|
}
|
|
498
500
|
};
|
|
499
501
|
this.enableShowPeekMessage = () => {
|
|
@@ -587,9 +589,9 @@ const ZonosHello = class {
|
|
|
587
589
|
setInterval(() => {
|
|
588
590
|
if (window.location.href !== this.initialUrl) {
|
|
589
591
|
const prevUrl = this.initialUrl && new URL(this.initialUrl);
|
|
590
|
-
const initialZonosCountry = prevUrl &&
|
|
592
|
+
const initialZonosCountry = prevUrl && cart.getZCountryUrlParam(prevUrl.searchParams);
|
|
591
593
|
// If the zCountry url param changes, reset current item restriction tracking
|
|
592
|
-
if (initialZonosCountry !==
|
|
594
|
+
if (initialZonosCountry !== cart.localizationStore.selectedCountryCode) {
|
|
593
595
|
this.allFoundProducts = [];
|
|
594
596
|
this.allRestrictedItems = [];
|
|
595
597
|
this.productsOnPage = [];
|
|
@@ -597,9 +599,9 @@ const ZonosHello = class {
|
|
|
597
599
|
this.initialUrl = window.location.href;
|
|
598
600
|
zonosStore.zonosStore.currentHelloPage = getCurrentHelloLocalePage();
|
|
599
601
|
const currentUrl = new URL(window.location.href);
|
|
600
|
-
const zCountry =
|
|
602
|
+
const zCountry = cart.getZCountryUrlParam(currentUrl.searchParams);
|
|
601
603
|
if (!zCountry) {
|
|
602
|
-
|
|
604
|
+
cart.setZCountryUrlParam(cart.localizationStore.selectedCountryCode);
|
|
603
605
|
return;
|
|
604
606
|
}
|
|
605
607
|
void this.reloadHelloData();
|
|
@@ -619,13 +621,13 @@ const ZonosHello = class {
|
|
|
619
621
|
}
|
|
620
622
|
};
|
|
621
623
|
this.isShippableCountry = (showLog = true) => {
|
|
622
|
-
if (!
|
|
624
|
+
if (!cart.localizationStore.localizationLoaded) {
|
|
623
625
|
return false;
|
|
624
626
|
}
|
|
625
627
|
// if localization is loaded and the localization is not a shippable country, keep the original click event
|
|
626
|
-
if (!
|
|
628
|
+
if (!cart.localizationStore.isShippableCountry) {
|
|
627
629
|
if (showLog) {
|
|
628
|
-
|
|
630
|
+
cart.log(`Hello: not shippable country`);
|
|
629
631
|
}
|
|
630
632
|
return false;
|
|
631
633
|
}
|
|
@@ -660,33 +662,33 @@ const ZonosHello = class {
|
|
|
660
662
|
* @returns void
|
|
661
663
|
*/
|
|
662
664
|
async displayCurrency() {
|
|
663
|
-
if (!
|
|
665
|
+
if (!cart.localizationStore.exchangeRate) {
|
|
664
666
|
// eslint-disable-next-line no-console
|
|
665
667
|
console.error('Could not display currency. Exchange rate and format data is not available.');
|
|
666
668
|
return;
|
|
667
669
|
}
|
|
668
|
-
|
|
670
|
+
cart.currencyDisplay();
|
|
669
671
|
}
|
|
670
672
|
/**
|
|
671
673
|
* This method will call convert and format, and return the converted and formatted string
|
|
672
674
|
* @returns string
|
|
673
675
|
*/
|
|
674
676
|
async convertAndFormat(value) {
|
|
675
|
-
|
|
677
|
+
cart.currencyConvertAndFormat(value);
|
|
676
678
|
}
|
|
677
679
|
/**
|
|
678
680
|
* This method will convert the currency and return the converted value
|
|
679
681
|
* @returns number
|
|
680
682
|
*/
|
|
681
683
|
async convert(value) {
|
|
682
|
-
|
|
684
|
+
cart.currencyConvert(value);
|
|
683
685
|
}
|
|
684
686
|
/**
|
|
685
687
|
* This method will format the currency and return the formatted string
|
|
686
688
|
* @returns number
|
|
687
689
|
*/
|
|
688
690
|
async format(value) {
|
|
689
|
-
|
|
691
|
+
cart.currencyFormat(value);
|
|
690
692
|
}
|
|
691
693
|
handleResize() {
|
|
692
694
|
debounce_1(this.render.bind(this), RESIZE_DEBOUNCE_DELAY_MS);
|
|
@@ -695,10 +697,10 @@ const ZonosHello = class {
|
|
|
695
697
|
var _a, _b;
|
|
696
698
|
const isExcludedUrl = (_a = zonosStore.zonosStore.helloSettings.excludedUrlPatterns) === null || _a === void 0 ? void 0 : _a.some(pattern => new RegExp(pattern).test(window.location.href));
|
|
697
699
|
if (isExcludedUrl) {
|
|
698
|
-
|
|
700
|
+
cart.log('Hello is excluded on this url', 'warn');
|
|
699
701
|
return null;
|
|
700
702
|
}
|
|
701
|
-
const { selectedCountryCode } =
|
|
703
|
+
const { selectedCountryCode } = cart.localizationStore;
|
|
702
704
|
const mobileLocation = this.mobileLocationOverride || zonosStore.zonosStore.helloSettings.mobileLocation;
|
|
703
705
|
const isMobileWindow = window.innerWidth < 768;
|
|
704
706
|
const isOnLeft = this.animateFromLeftOverride ||
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-72767498.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const zonosStore = require('./zonosStore-49d4c92a.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
|
|
9
9
|
const zonosLogoCss = ":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 img{-webkit-filter:var(--filter-color);filter:var(--filter-color);width:var(--width)}";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-72767498.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const zonosStore = require('./zonosStore-49d4c92a.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
|
|
9
9
|
const zonosNotificationCss = ":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-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999;bottom:var(--amino-space-24);gap:var(--amino-space-8);display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:var(--amino-space-8);border-radius:var(--border-radius, var(--amino-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--amino-green-700)}:host .zonos--notification-item.error{background-color:var(--amino-red-700)}:host .zonos--notification-item.warning{background-color:var(--amino-orange-700)}";
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-72767498.js');
|
|
6
|
-
const cart = require('./cart-
|
|
7
|
-
require('./zonosStore-
|
|
8
|
-
require('./
|
|
9
|
-
require('./
|
|
10
|
-
require('./getBorderRadius-b252096d.js');
|
|
6
|
+
const cart = require('./cart-ecc80eb0.js');
|
|
7
|
+
require('./zonosStore-49d4c92a.js');
|
|
8
|
+
require('./isDarkColor-924e6a7a.js');
|
|
9
|
+
require('./getBorderRadius-834c321d.js');
|
|
11
10
|
|
|
12
11
|
const zonosPaymentCss = ".sc-zonos-payment-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:var(--amino-space-16)}";
|
|
13
12
|
const ZonosPaymentStyle0 = zonosPaymentCss;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-72767498.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const zonosStore = require('./zonosStore-49d4c92a.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
|
|
9
9
|
const RemoveIcon = `<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>`;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-72767498.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const zonosStore = require('./zonosStore-49d4c92a.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
|
-
const getBorderRadius = require('./getBorderRadius-
|
|
8
|
+
const getBorderRadius = require('./getBorderRadius-834c321d.js');
|
|
9
9
|
const isColorVariable = require('./isColorVariable-41cacd82.js');
|
|
10
10
|
|
|
11
11
|
const zonosShippingRichRadioCss = ":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-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host input{margin:0;accent-color:var(--selected-border-color, var(--amino-blue-600))}:host .zonos--shipping-rich-radio-item{display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;padding:var(--amino-space-16);-ms-flex-align:center;align-items:center;gap:var(--amino-space-16);cursor:pointer;border:1px solid var(--amino-gray-200)}:host .zonos--shipping-rich-radio-item:first-child{border-top-left-radius:var(--border-radius, var(--amino-radius-10));border-top-right-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--shipping-rich-radio-item:last-child{border-bottom-right-radius:var(--border-radius, var(--amino-radius-10));border-bottom-left-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--shipping-rich-radio-item:not(:last-child){border-bottom:none}:host .zonos--shipping-rich-radio-item.selected{outline:1px solid var(--selected-border-color, var(--amino-blue-600));outline-offset:-1px}:host .zonos--shipping-info{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}:host .zonos--shipping-detail{-ms-flex:1;flex:1}:host .zonos--sub-detail{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-wrap:wrap;flex-wrap:wrap}";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-72767498.js');
|
|
6
|
-
const zonosStore = require('./zonosStore-
|
|
6
|
+
const zonosStore = require('./zonosStore-49d4c92a.js');
|
|
7
7
|
const classes = require('./classes-b7918f56.js');
|
|
8
8
|
|
|
9
9
|
const textOptions = {
|
|
@@ -2843,16 +2843,16 @@ const zonosStoreInitSetting = ({ overrideSettings, zonosSettings, }) => {
|
|
|
2843
2843
|
}
|
|
2844
2844
|
zonosStore.appearance = mergeConfig(zonosStore.appearance, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.appearanceSettings) ||
|
|
2845
2845
|
(zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.appearanceSettings) ||
|
|
2846
|
-
null, overrideSettings.appearance);
|
|
2846
|
+
null, overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.appearance);
|
|
2847
2847
|
zonosStore.checkoutSettings = mergeConfig(zonosStore.checkoutSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.checkoutSettings) ||
|
|
2848
2848
|
(zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.checkoutSettings) ||
|
|
2849
|
-
null, overrideSettings.checkoutSettings);
|
|
2850
|
-
zonosStore.helloSettings = mergeConfig(zonosStore.helloSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.helloSettings) || (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.helloSettings) || null, overrideSettings.helloSettings);
|
|
2849
|
+
null, overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.checkoutSettings);
|
|
2850
|
+
zonosStore.helloSettings = mergeConfig(zonosStore.helloSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.helloSettings) || (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.helloSettings) || null, overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.helloSettings);
|
|
2851
2851
|
// set flag to true to indicate that config is ready
|
|
2852
2852
|
zonosStore.loadedConfig = true;
|
|
2853
2853
|
zonosStore.organizationName = ((_a = zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.organization) === null || _a === void 0 ? void 0 : _a.name) || '';
|
|
2854
2854
|
zonosStore.storeId = ((_c = (_b = zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.organization) === null || _b === void 0 ? void 0 : _b.references) === null || _c === void 0 ? void 0 : _c.storeId) || null;
|
|
2855
|
-
zonosStore.currencyConverter = overrideSettings.currencyConverter;
|
|
2855
|
+
zonosStore.currencyConverter = overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.currencyConverter;
|
|
2856
2856
|
};
|
|
2857
2857
|
const zonosStoreFontFamily = () => {
|
|
2858
2858
|
const fontFamily = zonosStore.appearance.fontFamily || 'Inter';
|