@zonos/elements 1.3.191 → 1.3.193
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/index.cjs.js +7 -7
- package/dist/cjs/{containsNonLatinChars-2be5129b.js → shouldRenderTaxIdInput-9b8a8de1.js} +23 -0
- package/dist/cjs/zonos-address_11.cjs.entry.js +30 -14
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +26 -9
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +6 -2
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +12 -3
- package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +13 -4
- package/dist/collection/components/utils/checkout/shouldRenderTaxIdInput.js +20 -0
- package/dist/collection/components/utils/taxIdValidationResult.js +19 -5
- package/dist/esm/index.js +7 -7
- package/dist/esm/{containsNonLatinChars-2d8810c3.js → shouldRenderTaxIdInput-8bc112bb.js} +23 -1
- package/dist/esm/zonos-address_11.entry.js +24 -8
- package/dist/esm/zonos-cart-items_13.entry.js +25 -8
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/shouldRenderTaxIdInput-8bc112bb.js +1 -0
- package/dist/esm-es5/zonos-address_11.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/utils/checkout/shouldRenderTaxIdInput.d.ts +7 -0
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-091be444.entry.js +1 -0
- package/dist/zonos-elements/p-1f13a451.system.entry.js +1 -0
- package/dist/zonos-elements/p-6ac90deb.entry.js +1 -0
- package/dist/zonos-elements/p-78a6e775.system.js +1 -0
- package/dist/zonos-elements/{p-bd0dc205.system.js → p-abe9207c.system.js} +1 -1
- package/dist/zonos-elements/p-b4c0e0c5.system.entry.js +1 -0
- package/dist/zonos-elements/p-ea6d87a1.system.js +1 -1
- package/dist/zonos-elements/p-eeb1081e.js +1 -0
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/containsNonLatinChars-2d8810c3.js +0 -1
- package/dist/zonos-elements/p-01eda7f2.entry.js +0 -1
- package/dist/zonos-elements/p-0347d209.entry.js +0 -1
- package/dist/zonos-elements/p-0c64dbbb.js +0 -1
- package/dist/zonos-elements/p-2670438c.system.js +0 -1
- package/dist/zonos-elements/p-86d29d50.system.entry.js +0 -1
- package/dist/zonos-elements/p-df695903.system.entry.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -131,7 +131,7 @@ const getZonosQaUrl = () => {
|
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
133
133
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
134
|
-
const cdnUrl = "https://v1.3.
|
|
134
|
+
const cdnUrl = "https://v1.3.193.js.zonos.com";
|
|
135
135
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
136
136
|
if (!qaUrl &&
|
|
137
137
|
(cdnUrl.includes('test.') ||
|
|
@@ -372,10 +372,10 @@ const zonosLoadUrl = (() => {
|
|
|
372
372
|
}
|
|
373
373
|
return null;
|
|
374
374
|
})();
|
|
375
|
-
const ZONOS_URL = "https://v1.3.
|
|
376
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
377
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
378
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
375
|
+
const ZONOS_URL = "https://v1.3.193.js.zonos.com";
|
|
376
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.193";
|
|
377
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.193";
|
|
378
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.193";
|
|
379
379
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
380
380
|
const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
|
|
381
381
|
class Zonos {
|
|
@@ -393,7 +393,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
|
|
|
393
393
|
? new URLSearchParams(window.location.search).get('iframeLogType')
|
|
394
394
|
: null;
|
|
395
395
|
Zonos.isBigCommerce = false;
|
|
396
|
-
Zonos.releaseDate = "
|
|
396
|
+
Zonos.releaseDate = "1746131604123";
|
|
397
397
|
Zonos.isLegacyCheckout = false;
|
|
398
398
|
Zonos.domain = typeof window !== 'undefined'
|
|
399
399
|
? // domain that embeds the iframe
|
|
@@ -411,7 +411,7 @@ Zonos.isNpm = true;
|
|
|
411
411
|
Zonos.zonosQaUrl = null;
|
|
412
412
|
Zonos.zonosQaUrlApi = null;
|
|
413
413
|
Zonos.trackEventLogs = [];
|
|
414
|
-
Zonos.version = `v${"1.3.
|
|
414
|
+
Zonos.version = `v${"1.3.193"}`;
|
|
415
415
|
Zonos.modeAlerted = false;
|
|
416
416
|
Zonos.cartData = null;
|
|
417
417
|
Zonos.paypal = null;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const TaxId = require('./TaxId-12acedde.js');
|
|
4
|
+
|
|
3
5
|
const isTextContainsNonLatinChars = (text) => {
|
|
4
6
|
const specialCharacters = /[ʼˮ՚ߴߵ']{1}/u;
|
|
5
7
|
/**
|
|
@@ -20,5 +22,26 @@ const containsNonLatinChars = (params) => {
|
|
|
20
22
|
return nonLatinValueList;
|
|
21
23
|
};
|
|
22
24
|
|
|
25
|
+
const isInTaxIdCountry = (countryCode) => {
|
|
26
|
+
return TaxId.countryRequireTaxId.includes(countryCode);
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Checks if the tax ID input should be rendered based on the company name and country code.
|
|
30
|
+
*/
|
|
31
|
+
const shouldRenderTaxIdInput = ({ companyName, countryCode, }) => {
|
|
32
|
+
// Only show the tax ID input if the country is in the EU and the company name is provided
|
|
33
|
+
if (TaxId.euCountryCodes.includes(countryCode)) {
|
|
34
|
+
return companyName.trim().length > 0;
|
|
35
|
+
}
|
|
36
|
+
// If country require tax id, show the input
|
|
37
|
+
const isCountryRequireTaxId = isInTaxIdCountry(countryCode);
|
|
38
|
+
if (isCountryRequireTaxId) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
// If country doesn't require tax ID, no need to show the input
|
|
42
|
+
return false;
|
|
43
|
+
};
|
|
44
|
+
|
|
23
45
|
exports.containsNonLatinChars = containsNonLatinChars;
|
|
24
46
|
exports.isTextContainsNonLatinChars = isTextContainsNonLatinChars;
|
|
47
|
+
exports.shouldRenderTaxIdInput = shouldRenderTaxIdInput;
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-0993f42d.js');
|
|
6
6
|
const cart = require('./cart-27f6c7a4.js');
|
|
7
7
|
const handleFetch = require('./handleFetch-969d05d8.js');
|
|
8
|
+
const shouldRenderTaxIdInput = require('./shouldRenderTaxIdInput-9b8a8de1.js');
|
|
8
9
|
const TaxId = require('./TaxId-12acedde.js');
|
|
9
|
-
const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
|
|
10
10
|
const classes = require('./classes-b7918f56.js');
|
|
11
11
|
const getBorderRadius = require('./getBorderRadius-87f3b69c.js');
|
|
12
12
|
const zonosStore = require('./zonosStore-adc42868.js');
|
|
@@ -211,8 +211,16 @@ const ZonosAddress$1 = class {
|
|
|
211
211
|
if (!countryCode) {
|
|
212
212
|
return null;
|
|
213
213
|
}
|
|
214
|
-
|
|
215
|
-
if (!
|
|
214
|
+
// This just to type guard the countryCode, if it's able to get to this point it should already be in country that has tax id input
|
|
215
|
+
if (!this.isInTaxIdCountry(countryCode)) {
|
|
216
|
+
return null;
|
|
217
|
+
}
|
|
218
|
+
const taxIdInputRendered = shouldRenderTaxIdInput.shouldRenderTaxIdInput({
|
|
219
|
+
companyName: cart.stripeStore.companyName,
|
|
220
|
+
countryCode,
|
|
221
|
+
});
|
|
222
|
+
// Don't render tax id input if the country doesn't require tax id
|
|
223
|
+
if (!taxIdInputRendered) {
|
|
216
224
|
return null;
|
|
217
225
|
}
|
|
218
226
|
const taxIdInputInfo = TaxId.shipToTaxIdLabels[countryCode];
|
|
@@ -250,7 +258,7 @@ const ZonosAddress$1 = class {
|
|
|
250
258
|
this.isAddressFilled = true;
|
|
251
259
|
}
|
|
252
260
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
253
|
-
return (index.h(index.Host, { key: '
|
|
261
|
+
return (index.h(index.Host, { key: '8509c142efbfe37d81b3da8b2a2e7b3ca9b350dc', class: "zonos--address zonos--elements" }, index.h("zonos-text", { key: '16e151eb3204d656f4a726531b9a64d955ac99c8', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderTaxIdInput(), index.h("div", { key: '6b9d493c1e61cbfb77fc89cfa3cc1081b3b1c147', class: "zonos--address-component" })));
|
|
254
262
|
}
|
|
255
263
|
get el() { return index.getElement(this); }
|
|
256
264
|
static get watchers() { return {
|
|
@@ -276,7 +284,7 @@ const ZonosAddressDisplay = class {
|
|
|
276
284
|
const { city, country, email, line1, line2, name, phone, postal_code, state, } = this.currentAddress;
|
|
277
285
|
const shippingZoneCountry = (_a = cart.localizationStore.shippingZoneCountries) === null || _a === void 0 ? void 0 : _a[country];
|
|
278
286
|
const renderEnteredInfoText = ({ bold, content, }) => {
|
|
279
|
-
const textColor =
|
|
287
|
+
const textColor = shouldRenderTaxIdInput.isTextContainsNonLatinChars(content)
|
|
280
288
|
? 'red-600'
|
|
281
289
|
: 'gray-1000';
|
|
282
290
|
return (index.h("zonos-text", { textColor: textColor, type: bold ? 'boldLabel' : 'body' }, content));
|
|
@@ -322,13 +330,13 @@ const ZonosAddressForm = class {
|
|
|
322
330
|
const lastName = name.split(' ').slice(1).join(' ') || '';
|
|
323
331
|
return (index.h(index.Host, { key: '8b578737e33203a23563be7e9be0778deec99bbf', class: "zonos--address-form zonos--elements" }, index.h("div", { key: '793675a1348547bf3f781788956befe325191011', class: "zonos--title" }, index.h("zonos-text", { key: '13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9', textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
|
|
324
332
|
? cart.translate('Shipping')
|
|
325
|
-
: cart.translate('Billing'))), index.h("div", { key: '2c5de5b5283fb99ee5f8b61d7a217177986fc2db', class: "zonos--address-group" }, index.h("div", { key: '23bf3c893071000d5995a5f175867bab11929193', class: "zonos--contact" }, index.h("zonos-text", { key: '7cdfe2a84ebad89ba5b16498d75def99cf392384', type: "label" }, cart.translate('Contact')), index.h("zonos-input", { key: '1c39c38767fd306c5eb1164cdc989b8291209cf0', class: "zonos--form-email", inputLabel: cart.translate('Email'), inputValue: this.currentAddress.email, isDisabled: true }), index.h("div", { key: 'cbdf61217125e22b1a6cec9a340ef0aca2c75670', class: "zonos--name zonos--address-row" }, index.h("zonos-input", { key: '360c99e7b2c6caa64580d5768b5bb53368927275', class: "zonos--form-first-name", inputLabel: cart.translate('First name'), inputValue: firstName, isError:
|
|
333
|
+
: cart.translate('Billing'))), index.h("div", { key: '2c5de5b5283fb99ee5f8b61d7a217177986fc2db', class: "zonos--address-group" }, index.h("div", { key: '23bf3c893071000d5995a5f175867bab11929193', class: "zonos--contact" }, index.h("zonos-text", { key: '7cdfe2a84ebad89ba5b16498d75def99cf392384', type: "label" }, cart.translate('Contact')), index.h("zonos-input", { key: '1c39c38767fd306c5eb1164cdc989b8291209cf0', class: "zonos--form-email", inputLabel: cart.translate('Email'), inputValue: this.currentAddress.email, isDisabled: true }), index.h("div", { key: 'cbdf61217125e22b1a6cec9a340ef0aca2c75670', class: "zonos--name zonos--address-row" }, index.h("zonos-input", { key: '360c99e7b2c6caa64580d5768b5bb53368927275', class: "zonos--form-first-name", inputLabel: cart.translate('First name'), inputValue: firstName, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(firstName), onInputChange: e => this.onInputChange({
|
|
326
334
|
key: 'name',
|
|
327
335
|
value: `${e.detail} ${lastName}`,
|
|
328
|
-
}) }), index.h("zonos-input", { key: '8ce5fa5c15c6f7928339ea10009ce0e68954a91f', class: "zonos--form-last-name", inputLabel: cart.translate('Last name'), inputValue: lastName, isError:
|
|
336
|
+
}) }), index.h("zonos-input", { key: '8ce5fa5c15c6f7928339ea10009ce0e68954a91f', class: "zonos--form-last-name", inputLabel: cart.translate('Last name'), inputValue: lastName, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(lastName), onInputChange: e => this.onInputChange({
|
|
329
337
|
key: 'name',
|
|
330
338
|
value: `${firstName} ${e.detail}`,
|
|
331
|
-
}) }))), index.h("div", { key: '7b4fa2d3baa6cb257e7688e5ba6777123898b3fd', class: "zonos--address" }, index.h("zonos-text", { key: '9d5782331b2642755a755aeb7f98c9f4d87f9a20', type: "label" }, cart.translate('Address')), index.h("zonos-input", { key: 'a622025924ca86bdbf1d3c04b79e6dee172b4c42', class: "zonos--form-country", inputLabel: cart.translate('Country'), inputValue: country, isDisabled: true }), index.h("zonos-input", { key: 'f99b3a74db09ab5730878e80705b9aeac76bf800', class: "zonos--form-line1", inputLabel: cart.translate('Address line 1'), inputValue: line1, isError:
|
|
339
|
+
}) }))), index.h("div", { key: '7b4fa2d3baa6cb257e7688e5ba6777123898b3fd', class: "zonos--address" }, index.h("zonos-text", { key: '9d5782331b2642755a755aeb7f98c9f4d87f9a20', type: "label" }, cart.translate('Address')), index.h("zonos-input", { key: 'a622025924ca86bdbf1d3c04b79e6dee172b4c42', class: "zonos--form-country", inputLabel: cart.translate('Country'), inputValue: country, isDisabled: true }), index.h("zonos-input", { key: 'f99b3a74db09ab5730878e80705b9aeac76bf800', class: "zonos--form-line1", inputLabel: cart.translate('Address line 1'), inputValue: line1, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(line1), onInputChange: e => this.onInputChange({ key: 'line1', value: e.detail }) }), index.h("zonos-input", { key: '5d16aefa45a78045c87d166aaaec0255606e455e', class: "zonos--form-line2", inputLabel: cart.translate('Address line 2'), inputValue: line2, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(line2), onInputChange: e => this.onInputChange({ key: 'line2', value: e.detail }) }), index.h("div", { key: 'dc166be9381142835d72e731cb38a718522a068a', class: "zonos--address-row" }, index.h("zonos-input", { key: '4f1a98f9d10ce0cff3ef18a3037a12382552b31d', class: "zonos--form-city", inputLabel: cart.translate('City'), inputValue: city, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(city), onInputChange: e => this.onInputChange({ key: 'city', value: e.detail }) }), index.h("zonos-input", { key: 'd4f97900b5fe2e1619950a52d1d1f716a8bc19ff', class: "zonos--form-state", inputLabel: cart.translate('State/Province'), inputValue: state, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(state), onInputChange: e => this.onInputChange({ key: 'state', value: e.detail }) })), index.h("zonos-input", { key: 'cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733', class: "zonos--form-postal-code", inputLabel: cart.translate('Postal code'), inputValue: postal_code, isError: shouldRenderTaxIdInput.isTextContainsNonLatinChars(postal_code), onInputChange: e => this.onInputChange({ key: 'postal_code', value: e.detail }) }), index.h("zonos-input", { key: '7421c82847eded6bdbcce49ef8196124d8e50c1d', class: "zonos--form-phone", inputLabel: cart.translate('Phone number'), inputValue: phone, onInputChange: e => this.onInputChange({ key: 'phone', value: e.detail }) })))));
|
|
332
340
|
}
|
|
333
341
|
static get watchers() { return {
|
|
334
342
|
"translatedAddress": ["watchCurrentAddress"]
|
|
@@ -482,11 +490,11 @@ const ZonosAddressUpdateDialog = class {
|
|
|
482
490
|
translatedAddress: this.translatedShippingAddressState,
|
|
483
491
|
});
|
|
484
492
|
// check to see if there are still non-latin characters in the translated address
|
|
485
|
-
const shippingNonlatinChars =
|
|
493
|
+
const shippingNonlatinChars = shouldRenderTaxIdInput.containsNonLatinChars(Object.assign(Object.assign({}, translatedShippingAddress), { country: this.shippingAddress.country }));
|
|
486
494
|
// get list of non-latin characters field in the billing address
|
|
487
495
|
const billingNonLatinChars = translatedBillingAddress &&
|
|
488
496
|
this.billingAddress &&
|
|
489
|
-
|
|
497
|
+
shouldRenderTaxIdInput.containsNonLatinChars(Object.assign(Object.assign({}, translatedBillingAddress), { country: this.billingAddress.country }));
|
|
490
498
|
const shippingHasNonLatinChars = !!Object.keys(shippingNonlatinChars)
|
|
491
499
|
.length;
|
|
492
500
|
const billingHasNonLatinChars = !!billingNonLatinChars && !!Object.keys(billingNonLatinChars).length;
|
|
@@ -1060,8 +1068,16 @@ const ZonosAddress = class {
|
|
|
1060
1068
|
if (!countryCode) {
|
|
1061
1069
|
return null;
|
|
1062
1070
|
}
|
|
1063
|
-
|
|
1064
|
-
if (!
|
|
1071
|
+
// This just to type guard the countryCode, if it's able to get to this point it should already be in country that has tax id input
|
|
1072
|
+
if (!this.isInTaxIdCountry(countryCode)) {
|
|
1073
|
+
return null;
|
|
1074
|
+
}
|
|
1075
|
+
const taxIdInputRendered = shouldRenderTaxIdInput.shouldRenderTaxIdInput({
|
|
1076
|
+
companyName: cart.stripeStore.companyName,
|
|
1077
|
+
countryCode,
|
|
1078
|
+
});
|
|
1079
|
+
// Don't render tax id input if the country doesn't require tax id
|
|
1080
|
+
if (!taxIdInputRendered) {
|
|
1065
1081
|
return null;
|
|
1066
1082
|
}
|
|
1067
1083
|
const taxIdInputInfo = TaxId.shipToTaxIdLabels[countryCode];
|
|
@@ -1547,10 +1563,10 @@ const ZonosAddress = class {
|
|
|
1547
1563
|
this.country = cart.localizationStore.selectedCountryCode;
|
|
1548
1564
|
}
|
|
1549
1565
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
1550
|
-
return (index.h(index.Host, { key: '
|
|
1566
|
+
return (index.h(index.Host, { key: '7bb0587de62e4c9b50992c3b6334e0382ea6ac08', class: classes.classes([
|
|
1551
1567
|
'zonos--address zonos--elements',
|
|
1552
1568
|
`zonos--${this.type}-address`,
|
|
1553
|
-
]) }, index.h("zonos-text", { key: '
|
|
1569
|
+
]) }, index.h("zonos-text", { key: '5f2590456c7b20851af976263a82fbb17e47d995', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderCustomAddressForm()));
|
|
1554
1570
|
}
|
|
1555
1571
|
get el() { return index.getElement(this); }
|
|
1556
1572
|
static get watchers() { return {
|
|
@@ -13,7 +13,7 @@ const getBorderRadius = require('./getBorderRadius-87f3b69c.js');
|
|
|
13
13
|
const ILanguage = require('./ILanguage-98b04442.js');
|
|
14
14
|
const isDarkColor = require('./isDarkColor-d0c67c3d.js');
|
|
15
15
|
const isColorVariable = require('./isColorVariable-525dbfa7.js');
|
|
16
|
-
const
|
|
16
|
+
const shouldRenderTaxIdInput = require('./shouldRenderTaxIdInput-9b8a8de1.js');
|
|
17
17
|
const TaxId = require('./TaxId-12acedde.js');
|
|
18
18
|
|
|
19
19
|
const getDisplayCurrency = () => {
|
|
@@ -1894,7 +1894,9 @@ const ZonosCheckoutPayment = class {
|
|
|
1894
1894
|
variant: this.submitBtnType }, cart.translate('Place test order')))));
|
|
1895
1895
|
}
|
|
1896
1896
|
return (index.h(index.Fragment, null, this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, cart.translate('Missing required fields. Make sure all fields are completed.'))), this.hasStripePaymentError && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, cart.stripeStore.customErrorMessage ||
|
|
1897
|
-
cart.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), index.h("zonos-payment", null), index.h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (index.h(index.Fragment, null, index.h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true,
|
|
1897
|
+
cart.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), index.h("zonos-payment", null), index.h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (index.h(index.Fragment, null, index.h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
|
|
1898
|
+
cart.stripeStore.checkoutSettlementCurrency === 'USD', loading: this.continueLoading &&
|
|
1899
|
+
cart.stripeStore.checkoutSettlementCurrency !== 'USD', onClick: async () => {
|
|
1898
1900
|
if (!cart.cartStore.checkoutSession) {
|
|
1899
1901
|
handleFetch.log('Checkout session is not found');
|
|
1900
1902
|
return;
|
|
@@ -1910,7 +1912,9 @@ const ZonosCheckoutPayment = class {
|
|
|
1910
1912
|
amount: cart.cartStore.total,
|
|
1911
1913
|
isForeign: true,
|
|
1912
1914
|
}),
|
|
1913
|
-
})), cart.stripeStore.shouldRenderPayInUsdButton && (index.h("zonos-button", { class: "zonos--pay-in-base-currency-btn",
|
|
1915
|
+
})), cart.stripeStore.shouldRenderPayInUsdButton && (index.h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
|
|
1916
|
+
cart.stripeStore.checkoutSettlementCurrency !== 'USD', loading: this.continueLoading &&
|
|
1917
|
+
cart.stripeStore.checkoutSettlementCurrency === 'USD', onClick: async () => {
|
|
1914
1918
|
await this.continueClickHandler({
|
|
1915
1919
|
currencyCode: 'USD',
|
|
1916
1920
|
});
|
|
@@ -2208,16 +2212,29 @@ const isTaxIdRequired = (shippingCountry) => {
|
|
|
2208
2212
|
};
|
|
2209
2213
|
const taxIdValidationResult = ({ companyName, shippingCountry, taxId, }) => {
|
|
2210
2214
|
// Check to see if we are required to collect tax id for the shipping country or not
|
|
2211
|
-
const
|
|
2212
|
-
|
|
2215
|
+
const isTaxIdInputRendered = shouldRenderTaxIdInput.shouldRenderTaxIdInput({
|
|
2216
|
+
companyName,
|
|
2217
|
+
countryCode: shippingCountry,
|
|
2218
|
+
});
|
|
2219
|
+
// If the tax id input is not even rendered, no need to validate anything and allow to proceed. Validate when tax id input is not even rendered would prevent the user from checking out
|
|
2220
|
+
if (!isTaxIdInputRendered) {
|
|
2221
|
+
return {
|
|
2222
|
+
error: null,
|
|
2223
|
+
valid: true,
|
|
2224
|
+
};
|
|
2225
|
+
}
|
|
2226
|
+
// Cache the result of isTaxIdRequired for reuse
|
|
2227
|
+
const taxIdRequired = isTaxIdRequired(shippingCountry);
|
|
2228
|
+
if (!taxIdRequired) {
|
|
2229
|
+
// If the shipping country does not require a tax id, the validation immediately returns valid
|
|
2213
2230
|
return {
|
|
2214
2231
|
error: null,
|
|
2215
2232
|
valid: true,
|
|
2216
2233
|
};
|
|
2217
2234
|
}
|
|
2218
|
-
// For
|
|
2219
|
-
if (shippingCountry
|
|
2220
|
-
if (!companyName) {
|
|
2235
|
+
// For all EU countries, tax id is not required if company name is not filled (not business address)
|
|
2236
|
+
if (TaxId.euCountryCodes.includes(shippingCountry)) {
|
|
2237
|
+
if (!companyName.trim()) {
|
|
2221
2238
|
return {
|
|
2222
2239
|
error: null,
|
|
2223
2240
|
valid: true,
|
|
@@ -2534,7 +2551,7 @@ const ZonosCustomerInfo = class {
|
|
|
2534
2551
|
}
|
|
2535
2552
|
const { address: addressValue, firstName, lastName, name } = address.value;
|
|
2536
2553
|
const { city, country, line1, line2, postal_code, state } = addressValue;
|
|
2537
|
-
const invalidList =
|
|
2554
|
+
const invalidList = shouldRenderTaxIdInput.containsNonLatinChars({
|
|
2538
2555
|
city,
|
|
2539
2556
|
country,
|
|
2540
2557
|
line1,
|
|
@@ -135,7 +135,9 @@ export class ZonosCheckoutPayment {
|
|
|
135
135
|
variant: this.submitBtnType }, translate('Place test order')))));
|
|
136
136
|
}
|
|
137
137
|
return (h(Fragment, null, this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), this.hasStripePaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, stripeStore.customErrorMessage ||
|
|
138
|
-
translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), h("zonos-payment", null), h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (h(Fragment, null, h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true,
|
|
138
|
+
translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), h("zonos-payment", null), h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (h(Fragment, null, h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
|
|
139
|
+
stripeStore.checkoutSettlementCurrency === 'USD', loading: this.continueLoading &&
|
|
140
|
+
stripeStore.checkoutSettlementCurrency !== 'USD', onClick: async () => {
|
|
139
141
|
if (!cartStore.checkoutSession) {
|
|
140
142
|
log('Checkout session is not found');
|
|
141
143
|
return;
|
|
@@ -151,7 +153,9 @@ export class ZonosCheckoutPayment {
|
|
|
151
153
|
amount: cartStore.total,
|
|
152
154
|
isForeign: true,
|
|
153
155
|
}),
|
|
154
|
-
})), stripeStore.shouldRenderPayInUsdButton && (h("zonos-button", { class: "zonos--pay-in-base-currency-btn",
|
|
156
|
+
})), stripeStore.shouldRenderPayInUsdButton && (h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
|
|
157
|
+
stripeStore.checkoutSettlementCurrency !== 'USD', loading: this.continueLoading &&
|
|
158
|
+
stripeStore.checkoutSettlementCurrency === 'USD', onClick: async () => {
|
|
155
159
|
await this.continueClickHandler({
|
|
156
160
|
currencyCode: 'USD',
|
|
157
161
|
});
|
|
@@ -5,6 +5,7 @@ import { getFallbackDefaultCountryCode, localizationStore, } from "../../store/h
|
|
|
5
5
|
import { translate } from "../../store/translationStore";
|
|
6
6
|
import { trackConversionEvent } from "../../utils/api/trackConversionEvent";
|
|
7
7
|
import { isCheckoutMobile } from "../../utils/checkout/isCheckoutMobile";
|
|
8
|
+
import { shouldRenderTaxIdInput } from "../../utils/checkout/shouldRenderTaxIdInput";
|
|
8
9
|
import { log } from "../../utils/logging/log";
|
|
9
10
|
import { logError } from "../../utils/logging/logError";
|
|
10
11
|
import { countryRequireTaxId, shipToTaxIdLabels, } from "../../../types/checkout/Tax";
|
|
@@ -201,8 +202,16 @@ export class ZonosAddress {
|
|
|
201
202
|
if (!countryCode) {
|
|
202
203
|
return null;
|
|
203
204
|
}
|
|
204
|
-
|
|
205
|
-
if (!
|
|
205
|
+
// This just to type guard the countryCode, if it's able to get to this point it should already be in country that has tax id input
|
|
206
|
+
if (!this.isInTaxIdCountry(countryCode)) {
|
|
207
|
+
return null;
|
|
208
|
+
}
|
|
209
|
+
const taxIdInputRendered = shouldRenderTaxIdInput({
|
|
210
|
+
companyName: stripeStore.companyName,
|
|
211
|
+
countryCode,
|
|
212
|
+
});
|
|
213
|
+
// Don't render tax id input if the country doesn't require tax id
|
|
214
|
+
if (!taxIdInputRendered) {
|
|
206
215
|
return null;
|
|
207
216
|
}
|
|
208
217
|
const taxIdInputInfo = shipToTaxIdLabels[countryCode];
|
|
@@ -240,7 +249,7 @@ export class ZonosAddress {
|
|
|
240
249
|
this.isAddressFilled = true;
|
|
241
250
|
}
|
|
242
251
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
243
|
-
return (h(Host, { key: '
|
|
252
|
+
return (h(Host, { key: '8509c142efbfe37d81b3da8b2a2e7b3ca9b350dc', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '16e151eb3204d656f4a726531b9a64d955ac99c8', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderTaxIdInput(), h("div", { key: '6b9d493c1e61cbfb77fc89cfa3cc1081b3b1c147', class: "zonos--address-component" })));
|
|
244
253
|
}
|
|
245
254
|
static get is() { return "zonos-address"; }
|
|
246
255
|
static get encapsulation() { return "scoped"; }
|
|
@@ -20,6 +20,7 @@ import { zonosStore } from "../../store/zonosStore";
|
|
|
20
20
|
import { trackConversionEvent } from "../../utils/api/trackConversionEvent";
|
|
21
21
|
import { isValidZip } from "../../utils/checkout/form/isValidZip";
|
|
22
22
|
import { isCheckoutMobile } from "../../utils/checkout/isCheckoutMobile";
|
|
23
|
+
import { shouldRenderTaxIdInput } from "../../utils/checkout/shouldRenderTaxIdInput";
|
|
23
24
|
import { classes } from "../../utils/classes";
|
|
24
25
|
import { log } from "../../utils/logging/log";
|
|
25
26
|
import { mergeAddress } from "../../utils/mergeAddress";
|
|
@@ -308,8 +309,16 @@ export class ZonosAddress {
|
|
|
308
309
|
if (!countryCode) {
|
|
309
310
|
return null;
|
|
310
311
|
}
|
|
311
|
-
|
|
312
|
-
if (!
|
|
312
|
+
// This just to type guard the countryCode, if it's able to get to this point it should already be in country that has tax id input
|
|
313
|
+
if (!this.isInTaxIdCountry(countryCode)) {
|
|
314
|
+
return null;
|
|
315
|
+
}
|
|
316
|
+
const taxIdInputRendered = shouldRenderTaxIdInput({
|
|
317
|
+
companyName: stripeStore.companyName,
|
|
318
|
+
countryCode,
|
|
319
|
+
});
|
|
320
|
+
// Don't render tax id input if the country doesn't require tax id
|
|
321
|
+
if (!taxIdInputRendered) {
|
|
313
322
|
return null;
|
|
314
323
|
}
|
|
315
324
|
const taxIdInputInfo = shipToTaxIdLabels[countryCode];
|
|
@@ -795,10 +804,10 @@ export class ZonosAddress {
|
|
|
795
804
|
this.country = localizationStore.selectedCountryCode;
|
|
796
805
|
}
|
|
797
806
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
798
|
-
return (h(Host, { key: '
|
|
807
|
+
return (h(Host, { key: '7bb0587de62e4c9b50992c3b6334e0382ea6ac08', class: classes([
|
|
799
808
|
'zonos--address zonos--elements',
|
|
800
809
|
`zonos--${this.type}-address`,
|
|
801
|
-
]) }, h("zonos-text", { key: '
|
|
810
|
+
]) }, h("zonos-text", { key: '5f2590456c7b20851af976263a82fbb17e47d995', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderCustomAddressForm()));
|
|
802
811
|
}
|
|
803
812
|
static get is() { return "zonos-custom-address"; }
|
|
804
813
|
static get encapsulation() { return "scoped"; }
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { countryRequireTaxId, euCountryCodes, } from "../../../types/checkout/Tax";
|
|
2
|
+
const isInTaxIdCountry = (countryCode) => {
|
|
3
|
+
return countryRequireTaxId.includes(countryCode);
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Checks if the tax ID input should be rendered based on the company name and country code.
|
|
7
|
+
*/
|
|
8
|
+
export const shouldRenderTaxIdInput = ({ companyName, countryCode, }) => {
|
|
9
|
+
// Only show the tax ID input if the country is in the EU and the company name is provided
|
|
10
|
+
if (euCountryCodes.includes(countryCode)) {
|
|
11
|
+
return companyName.trim().length > 0;
|
|
12
|
+
}
|
|
13
|
+
// If country require tax id, show the input
|
|
14
|
+
const isCountryRequireTaxId = isInTaxIdCountry(countryCode);
|
|
15
|
+
if (isCountryRequireTaxId) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
// If country doesn't require tax ID, no need to show the input
|
|
19
|
+
return false;
|
|
20
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { shouldRenderTaxIdInput } from "./checkout/shouldRenderTaxIdInput";
|
|
1
2
|
import { euCountryCodes } from "../../types/index";
|
|
2
3
|
const isTaxIdRequired = (shippingCountry) => {
|
|
3
4
|
const requireTaxIdCountry = ['MX', ...euCountryCodes];
|
|
@@ -5,16 +6,29 @@ const isTaxIdRequired = (shippingCountry) => {
|
|
|
5
6
|
};
|
|
6
7
|
export const taxIdValidationResult = ({ companyName, shippingCountry, taxId, }) => {
|
|
7
8
|
// Check to see if we are required to collect tax id for the shipping country or not
|
|
8
|
-
const
|
|
9
|
-
|
|
9
|
+
const isTaxIdInputRendered = shouldRenderTaxIdInput({
|
|
10
|
+
companyName,
|
|
11
|
+
countryCode: shippingCountry,
|
|
12
|
+
});
|
|
13
|
+
// If the tax id input is not even rendered, no need to validate anything and allow to proceed. Validate when tax id input is not even rendered would prevent the user from checking out
|
|
14
|
+
if (!isTaxIdInputRendered) {
|
|
10
15
|
return {
|
|
11
16
|
error: null,
|
|
12
17
|
valid: true,
|
|
13
18
|
};
|
|
14
19
|
}
|
|
15
|
-
//
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
// Cache the result of isTaxIdRequired for reuse
|
|
21
|
+
const taxIdRequired = isTaxIdRequired(shippingCountry);
|
|
22
|
+
if (!taxIdRequired) {
|
|
23
|
+
// If the shipping country does not require a tax id, the validation immediately returns valid
|
|
24
|
+
return {
|
|
25
|
+
error: null,
|
|
26
|
+
valid: true,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
// For all EU countries, tax id is not required if company name is not filled (not business address)
|
|
30
|
+
if (euCountryCodes.includes(shippingCountry)) {
|
|
31
|
+
if (!companyName.trim()) {
|
|
18
32
|
return {
|
|
19
33
|
error: null,
|
|
20
34
|
valid: true,
|
package/dist/esm/index.js
CHANGED
|
@@ -128,7 +128,7 @@ const getZonosQaUrl = () => {
|
|
|
128
128
|
return null;
|
|
129
129
|
}
|
|
130
130
|
const qaUrl = extractZonosQaUrl(window.location.href);
|
|
131
|
-
const cdnUrl = "https://v1.3.
|
|
131
|
+
const cdnUrl = "https://v1.3.193.js.zonos.com";
|
|
132
132
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
133
133
|
if (!qaUrl &&
|
|
134
134
|
(cdnUrl.includes('test.') ||
|
|
@@ -369,10 +369,10 @@ const zonosLoadUrl = (() => {
|
|
|
369
369
|
}
|
|
370
370
|
return null;
|
|
371
371
|
})();
|
|
372
|
-
const ZONOS_URL = "https://v1.3.
|
|
373
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
374
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
375
|
-
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.
|
|
372
|
+
const ZONOS_URL = "https://v1.3.193.js.zonos.com";
|
|
373
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.193";
|
|
374
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.193";
|
|
375
|
+
const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.193";
|
|
376
376
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
377
377
|
const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
|
|
378
378
|
class Zonos {
|
|
@@ -390,7 +390,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
|
|
|
390
390
|
? new URLSearchParams(window.location.search).get('iframeLogType')
|
|
391
391
|
: null;
|
|
392
392
|
Zonos.isBigCommerce = false;
|
|
393
|
-
Zonos.releaseDate = "
|
|
393
|
+
Zonos.releaseDate = "1746131604123";
|
|
394
394
|
Zonos.isLegacyCheckout = false;
|
|
395
395
|
Zonos.domain = typeof window !== 'undefined'
|
|
396
396
|
? // domain that embeds the iframe
|
|
@@ -408,7 +408,7 @@ Zonos.isNpm = true;
|
|
|
408
408
|
Zonos.zonosQaUrl = null;
|
|
409
409
|
Zonos.zonosQaUrlApi = null;
|
|
410
410
|
Zonos.trackEventLogs = [];
|
|
411
|
-
Zonos.version = `v${"1.3.
|
|
411
|
+
Zonos.version = `v${"1.3.193"}`;
|
|
412
412
|
Zonos.modeAlerted = false;
|
|
413
413
|
Zonos.cartData = null;
|
|
414
414
|
Zonos.paypal = null;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { e as euCountryCodes, c as countryRequireTaxId } from './TaxId-50d72254.js';
|
|
2
|
+
|
|
1
3
|
const isTextContainsNonLatinChars = (text) => {
|
|
2
4
|
const specialCharacters = /[ʼˮ՚ߴߵ']{1}/u;
|
|
3
5
|
/**
|
|
@@ -18,4 +20,24 @@ const containsNonLatinChars = (params) => {
|
|
|
18
20
|
return nonLatinValueList;
|
|
19
21
|
};
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
const isInTaxIdCountry = (countryCode) => {
|
|
24
|
+
return countryRequireTaxId.includes(countryCode);
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Checks if the tax ID input should be rendered based on the company name and country code.
|
|
28
|
+
*/
|
|
29
|
+
const shouldRenderTaxIdInput = ({ companyName, countryCode, }) => {
|
|
30
|
+
// Only show the tax ID input if the country is in the EU and the company name is provided
|
|
31
|
+
if (euCountryCodes.includes(countryCode)) {
|
|
32
|
+
return companyName.trim().length > 0;
|
|
33
|
+
}
|
|
34
|
+
// If country require tax id, show the input
|
|
35
|
+
const isCountryRequireTaxId = isInTaxIdCountry(countryCode);
|
|
36
|
+
if (isCountryRequireTaxId) {
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
// If country doesn't require tax ID, no need to show the input
|
|
40
|
+
return false;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { containsNonLatinChars as c, isTextContainsNonLatinChars as i, shouldRenderTaxIdInput as s };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-a457c60c.js';
|
|
2
2
|
import { e as cartStore, f as stripeStore, t as trackConversionEvent, V as getFallbackDefaultCountryCode, r as translate, l as localizationStore } from './cart-f5c12be6.js';
|
|
3
3
|
import { b as logError, l as log, i as isCheckoutMobile } from './handleFetch-621e45bc.js';
|
|
4
|
+
import { s as shouldRenderTaxIdInput, i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './shouldRenderTaxIdInput-8bc112bb.js';
|
|
4
5
|
import { c as countryRequireTaxId, s as shipToTaxIdLabels } from './TaxId-50d72254.js';
|
|
5
|
-
import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
|
|
6
6
|
import { c as classes } from './classes-0d95c529.js';
|
|
7
7
|
import { g as getBorderRadius } from './getBorderRadius-a9a48f79.js';
|
|
8
8
|
import { z as zonosStore, d as zonosStoreFontFamily, f as isObject_1 } from './zonosStore-1ce34e04.js';
|
|
@@ -207,8 +207,16 @@ const ZonosAddress$1 = class {
|
|
|
207
207
|
if (!countryCode) {
|
|
208
208
|
return null;
|
|
209
209
|
}
|
|
210
|
-
|
|
211
|
-
if (!
|
|
210
|
+
// This just to type guard the countryCode, if it's able to get to this point it should already be in country that has tax id input
|
|
211
|
+
if (!this.isInTaxIdCountry(countryCode)) {
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
const taxIdInputRendered = shouldRenderTaxIdInput({
|
|
215
|
+
companyName: stripeStore.companyName,
|
|
216
|
+
countryCode,
|
|
217
|
+
});
|
|
218
|
+
// Don't render tax id input if the country doesn't require tax id
|
|
219
|
+
if (!taxIdInputRendered) {
|
|
212
220
|
return null;
|
|
213
221
|
}
|
|
214
222
|
const taxIdInputInfo = shipToTaxIdLabels[countryCode];
|
|
@@ -246,7 +254,7 @@ const ZonosAddress$1 = class {
|
|
|
246
254
|
this.isAddressFilled = true;
|
|
247
255
|
}
|
|
248
256
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
249
|
-
return (h(Host, { key: '
|
|
257
|
+
return (h(Host, { key: '8509c142efbfe37d81b3da8b2a2e7b3ca9b350dc', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '16e151eb3204d656f4a726531b9a64d955ac99c8', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderTaxIdInput(), h("div", { key: '6b9d493c1e61cbfb77fc89cfa3cc1081b3b1c147', class: "zonos--address-component" })));
|
|
250
258
|
}
|
|
251
259
|
get el() { return getElement(this); }
|
|
252
260
|
static get watchers() { return {
|
|
@@ -1056,8 +1064,16 @@ const ZonosAddress = class {
|
|
|
1056
1064
|
if (!countryCode) {
|
|
1057
1065
|
return null;
|
|
1058
1066
|
}
|
|
1059
|
-
|
|
1060
|
-
if (!
|
|
1067
|
+
// This just to type guard the countryCode, if it's able to get to this point it should already be in country that has tax id input
|
|
1068
|
+
if (!this.isInTaxIdCountry(countryCode)) {
|
|
1069
|
+
return null;
|
|
1070
|
+
}
|
|
1071
|
+
const taxIdInputRendered = shouldRenderTaxIdInput({
|
|
1072
|
+
companyName: stripeStore.companyName,
|
|
1073
|
+
countryCode,
|
|
1074
|
+
});
|
|
1075
|
+
// Don't render tax id input if the country doesn't require tax id
|
|
1076
|
+
if (!taxIdInputRendered) {
|
|
1061
1077
|
return null;
|
|
1062
1078
|
}
|
|
1063
1079
|
const taxIdInputInfo = shipToTaxIdLabels[countryCode];
|
|
@@ -1543,10 +1559,10 @@ const ZonosAddress = class {
|
|
|
1543
1559
|
this.country = localizationStore.selectedCountryCode;
|
|
1544
1560
|
}
|
|
1545
1561
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
1546
|
-
return (h(Host, { key: '
|
|
1562
|
+
return (h(Host, { key: '7bb0587de62e4c9b50992c3b6334e0382ea6ac08', class: classes([
|
|
1547
1563
|
'zonos--address zonos--elements',
|
|
1548
1564
|
`zonos--${this.type}-address`,
|
|
1549
|
-
]) }, h("zonos-text", { key: '
|
|
1565
|
+
]) }, h("zonos-text", { key: '5f2590456c7b20851af976263a82fbb17e47d995', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderCustomAddressForm()));
|
|
1550
1566
|
}
|
|
1551
1567
|
get el() { return getElement(this); }
|
|
1552
1568
|
static get watchers() { return {
|