@zonos/elements 1.3.34 → 1.3.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{cart-42cc98d9.js → cart-401b6d32.js} +51 -19
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/{submitGtag-09f2e437.js → submitGtag-bc6af393.js} +1 -1
- package/dist/cjs/zonos-address_8.cjs.entry.js +18 -17
- package/dist/cjs/zonos-cart-items_12.cjs.entry.js +10 -4
- package/dist/cjs/zonos-checkout.cjs.entry.js +2 -2
- package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
- package/dist/cjs/zonos-country-select_3.cjs.entry.js +11 -4
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-notification_2.cjs.entry.js +1 -1
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +6 -5
- package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +8 -8
- package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +8 -2
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.css +2 -0
- package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +9 -2
- package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +4 -4
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
- package/dist/collection/components/utils/api/prepCalculateLandedCost.js +51 -19
- package/dist/esm/{cart-b9f15a63.js → cart-f29968a8.js} +51 -19
- package/dist/esm/index.js +4 -4
- package/dist/esm/{submitGtag-8b52cfdd.js → submitGtag-fcfd5cf4.js} +1 -1
- package/dist/esm/zonos-address_8.entry.js +18 -17
- package/dist/esm/zonos-cart-items_12.entry.js +10 -4
- package/dist/esm/zonos-checkout.entry.js +2 -2
- package/dist/esm/zonos-controller.entry.js +1 -1
- package/dist/esm/zonos-country-flag.entry.js +1 -1
- package/dist/esm/zonos-country-select_3.entry.js +11 -4
- package/dist/esm/zonos-hello-dialog.entry.js +5 -5
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-language-select_2.entry.js +1 -1
- package/dist/esm/zonos-notification_2.entry.js +1 -1
- package/dist/esm-es5/{cart-b9f15a63.js → cart-f29968a8.js} +1 -1
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{submitGtag-8b52cfdd.js → submitGtag-fcfd5cf4.js} +1 -1
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_12.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-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_2.entry.js +1 -1
- package/dist/scripts/index.d.ts +2 -2
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.d.ts +2 -2
- package/dist/types/components.d.ts +2 -2
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-758c2820.system.js → p-1c2de5da.system.js} +1 -1
- package/dist/zonos-elements/{p-b65cc2cf.system.js → p-1fbf0527.system.js} +1 -1
- package/dist/zonos-elements/{p-b5f769ba.js → p-2947c138.js} +1 -1
- package/dist/zonos-elements/p-2cee5f3a.system.entry.js +1 -0
- package/dist/zonos-elements/{p-af5fc5f7.system.entry.js → p-38f882ea.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3625cdc7.system.entry.js → p-4d95b4f4.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3bc94271.js → p-5b723a1d.js} +1 -1
- package/dist/zonos-elements/{p-fdf79bff.system.entry.js → p-5ce19bce.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-4c49eb9b.entry.js → p-60f7bcee.entry.js} +1 -1
- package/dist/zonos-elements/{p-7a3bf998.system.entry.js → p-62e21e2b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-88e5c33b.entry.js → p-6b06ac3d.entry.js} +1 -1
- package/dist/zonos-elements/{p-09f89949.entry.js → p-6ec40c8f.entry.js} +1 -1
- package/dist/zonos-elements/{p-6f51a7ee.entry.js → p-8363436f.entry.js} +1 -1
- package/dist/zonos-elements/{p-829bac92.system.entry.js → p-891d2c76.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-679e42d8.system.js → p-91635589.system.js} +1 -1
- package/dist/zonos-elements/p-952e331c.entry.js +1 -0
- package/dist/zonos-elements/p-bf9578d3.entry.js +1 -0
- package/dist/zonos-elements/{p-3143bbf8.system.entry.js → p-c0efa3a3.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9b525aaa.system.entry.js → p-c9062536.system.entry.js} +1 -1
- package/dist/zonos-elements/p-cfe9c940.entry.js +1 -0
- package/dist/zonos-elements/{p-f64ac752.system.entry.js → p-d410ef50.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-1b33ed3b.entry.js → p-e0709be2.entry.js} +1 -1
- package/dist/zonos-elements/p-e0bf9666.system.js +1 -1
- package/dist/zonos-elements/{p-1a67d86d.entry.js → p-e4ef71bd.entry.js} +1 -1
- package/dist/zonos-elements/{p-6a42fa2a.entry.js → p-eea3ec17.entry.js} +1 -1
- package/dist/zonos-elements/{p-210f3405.system.entry.js → p-f9931ad1.system.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/zonos-elements/p-0f58c8ab.entry.js +0 -1
- package/dist/zonos-elements/p-27538d28.system.entry.js +0 -1
- package/dist/zonos-elements/p-4ff5c708.entry.js +0 -1
- package/dist/zonos-elements/p-83e265cf.entry.js +0 -1
|
@@ -49,7 +49,9 @@ export class ZonosCustomerInfo {
|
|
|
49
49
|
// overwrite the address object with the new data
|
|
50
50
|
stripeEventDataObj = Object.assign(Object.assign({}, stripeEventDataObj), { complete: true, value: Object.assign(Object.assign({}, stripeEventDataObj === null || stripeEventDataObj === void 0 ? void 0 : stripeEventDataObj.value), { address: Object.assign(Object.assign({}, stripeEventDataObj === null || stripeEventDataObj === void 0 ? void 0 : stripeEventDataObj.value.address), { city: submitDataByKey.city ||
|
|
51
51
|
(stripeEventDataObj === null || stripeEventDataObj === void 0 ? void 0 : stripeEventDataObj.value.address.city) ||
|
|
52
|
-
'', line1: submitDataByKey.line1, line2: submitDataByKey.line2, postal_code: submitDataByKey.postal_code, state: submitDataByKey.state }), firstName: submitDataByKey.name.split(' ')[0],
|
|
52
|
+
'', line1: submitDataByKey.line1, line2: submitDataByKey.line2, postal_code: submitDataByKey.postal_code, state: submitDataByKey.state }), firstName: submitDataByKey.name.split(' ')[0],
|
|
53
|
+
// get all the names after
|
|
54
|
+
lastName: submitDataByKey.name.split(' ').slice(1).join(' '), name: submitDataByKey.name }) });
|
|
53
55
|
};
|
|
54
56
|
/**
|
|
55
57
|
* handler for continue button click
|
|
@@ -178,12 +180,16 @@ export class ZonosCustomerInfo {
|
|
|
178
180
|
variant: this.submitBtnType }, translate('Continue to shipping')))), stripeStore.stripeAddressEventData && (h("zonos-address-update-dialog", { billingAddress: !stripeStore.stripeShippingSameAsBilling &&
|
|
179
181
|
stripeStore.stripeBillingAddressEventData
|
|
180
182
|
? this.prepareAddressObject(stripeStore.stripeBillingAddressEventData)
|
|
181
|
-
: null, "data-theme": theme, dialogLoading: this.isValidatingAddress, dialogOpen: this.openAddressValidationDialog, isMobile: this.isMobile,
|
|
183
|
+
: null, "data-theme": theme, dialogLoading: this.isValidatingAddress, dialogOpen: this.openAddressValidationDialog, isMobile: this.isMobile, onCloseUpdateDialog: () => (this.openAddressValidationDialog = false), onContinueClicked: e => {
|
|
182
184
|
const submitData = e.detail;
|
|
183
185
|
this.transformTranslatedAddressToStripeEvent({
|
|
184
186
|
submitData,
|
|
185
187
|
type: 'shippingAddress',
|
|
186
188
|
});
|
|
189
|
+
this.transformTranslatedAddressToStripeEvent({
|
|
190
|
+
submitData,
|
|
191
|
+
type: 'billingAddress',
|
|
192
|
+
});
|
|
187
193
|
}, shippingAddress: this.prepareAddressObject(stripeStore.stripeAddressEventData), translatedBillingAddress: stripeStore.translatedAddress.billingAddress, translatedShippingAddress: stripeStore.translatedAddress.address }))));
|
|
188
194
|
}
|
|
189
195
|
static get is() { return "zonos-customer-info"; }
|
|
@@ -12,8 +12,15 @@ export class ZonosCountrySelect {
|
|
|
12
12
|
this.handleOnClose();
|
|
13
13
|
};
|
|
14
14
|
this.handleInputChange = (event) => {
|
|
15
|
+
var _a;
|
|
15
16
|
const input = event.target;
|
|
16
17
|
this.inputValue = input.value;
|
|
18
|
+
// query the country list container
|
|
19
|
+
const countryListSelector = (_a = this.ele.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.zonos--country-select');
|
|
20
|
+
// scroll to top every time the input changes
|
|
21
|
+
if (countryListSelector) {
|
|
22
|
+
countryListSelector.scrollTop = 0;
|
|
23
|
+
}
|
|
17
24
|
};
|
|
18
25
|
this.handleOnClose = () => { };
|
|
19
26
|
this.inputValue = '';
|
|
@@ -35,9 +42,9 @@ export class ZonosCountrySelect {
|
|
|
35
42
|
const filteredCountries = this.inputValue
|
|
36
43
|
? fuseObject.map(country => country.item)
|
|
37
44
|
: countries.sort((a, b) => a.displayName.localeCompare(b.displayName));
|
|
38
|
-
return (h(Host, { key: '
|
|
45
|
+
return (h(Host, { key: '55753f75d50712e9a27a9db9131130ce1e042c7e', class: "zonos--elements", style: {
|
|
39
46
|
'--font-family': zonosStoreFontFamily(),
|
|
40
|
-
} }, h("div", { key: '
|
|
47
|
+
} }, h("div", { key: 'c96d6b99ea3d55074256b39deaab01e14c5cea0b', class: "zonos--country-select" }, h("zonos-v-stack", { key: '2e87ea4ed6a5d4b9bd0aa6764f0aa9661e7d68fd', class: "zonos--country-select-header", spacing: 8 }, h("zonos-select-dialog-header", { key: 'd8dec91571385908913825d8bad4beda4dcaa409', handleOnClose: () => this.handleOnClose(), label: "Select a country" }, h("input", { key: 'b93ab3eb035c813af752da077b493140ae0fa394', class: "zonos--country-select-input", onInput: this.handleInputChange, placeholder: "Search countries", value: this.inputValue }))), h("div", { key: 'aaaf3dbd925250d799119b5a57ca95691eeaa985', class: "zonos--country-select-content" }, filteredCountries.map(country => (h("button", { class: "zonos--country-select-country", onClick: () => this.countrySelected(country.code) }, h("zonos-country-flag", { class: "zonos--country-flag", countryCode: country.code }), h("zonos-text", { textColor: "gray-800" }, country.displayName), country.code === localizationStore.selectedCountryCode && (h("zonos-icon", { content: GreenCheckDuotoneIcon, size: 20 })))))))));
|
|
41
48
|
}
|
|
42
49
|
static get is() { return "zonos-country-select"; }
|
|
43
50
|
static get encapsulation() { return "shadow"; }
|
|
@@ -59,7 +59,7 @@ export class ZonosDialog {
|
|
|
59
59
|
const borderStyle = getBorderRadius({
|
|
60
60
|
overrideBorderStyle: this.borderStyle,
|
|
61
61
|
});
|
|
62
|
-
return (h(Host, { key: '
|
|
62
|
+
return (h(Host, { key: '018771d0e01311ae520abcf33fbd64316794b202', class: classes([
|
|
63
63
|
'zonos--elements',
|
|
64
64
|
this.open && 'open',
|
|
65
65
|
this.isLoading && 'is-loading',
|
|
@@ -71,10 +71,10 @@ export class ZonosDialog {
|
|
|
71
71
|
'--height': this.height || 'initial',
|
|
72
72
|
'--min-height': this.minHeight || '500px',
|
|
73
73
|
'--width': this.width,
|
|
74
|
-
} }, h("div", { key: '
|
|
74
|
+
} }, h("div", { key: 'a86c9f8465054fde894bbdd71149e59d97e8cbcf', class: "zonos--backdrop" }), h("div", { key: 'b2f0c86fa0e768474ba4d522f8c2b8157f89cd56', class: "zonos--dialog-layout", inert: !this.open, onClick: this.clickOutsideDialogHandler }, h("div", { key: '26cd8a7b98d38c53dcf4789c8781f0c1ced99633', class: "zonos--dialog" }, this.isLoading && (h("div", { key: '34d0ba841a9af9ca2ff6d21d0471113cc86cdec3', class: "zonos--loading" }, h("zonos-spinner", { key: '0109778b1a9734de0959035e3975414fb1cac1be', size: 30 }))), (this.headerText || !this.noCloseButton) && (h("div", { key: 'f80a4c337727500ee1ad92c1d80d7b3088eccc0f', class: "zonos--header" }, this.headerText && (h("h3", { key: '92b078fbbcd9ca5f8bf178fc67f2bee817d1e961', class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { key: '698e45fffd466f22b6179aa220d35fe39ee5374c', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler, variant: "subtle" })))), h("div", { key: 'a4012e5a48d5fbcc77cac038d8a39fe05f332008', class: classes([
|
|
75
75
|
'zonos--body',
|
|
76
76
|
this.noBodyPadding && 'zonos--no-body-padding',
|
|
77
|
-
]) }, h("slot", { key: '
|
|
77
|
+
]) }, h("slot", { key: 'd64b381cb91afde4ddbde58348a62612d9871c8e' })), h("slot", { key: '4ddd73bfe41ecd1c90b18f82a8d8f12a1eacf144', name: "dialog-footer" })))));
|
|
78
78
|
}
|
|
79
79
|
static get is() { return "zonos-dialog"; }
|
|
80
80
|
static get encapsulation() { return "shadow"; }
|
|
@@ -363,7 +363,7 @@ export class ZonosDialog {
|
|
|
363
363
|
return [{
|
|
364
364
|
"method": "closeDialog",
|
|
365
365
|
"name": "closeDialog",
|
|
366
|
-
"bubbles":
|
|
366
|
+
"bubbles": false,
|
|
367
367
|
"cancelable": true,
|
|
368
368
|
"composed": true,
|
|
369
369
|
"docs": {
|
|
@@ -184,18 +184,18 @@ export class ZonosHelloDialog {
|
|
|
184
184
|
const defaultMessage = formatStringWithLinks(defaultMessageStr);
|
|
185
185
|
const currentPage = this.getCurrentPageEnum();
|
|
186
186
|
const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
|
|
187
|
-
return (h(Host, { key: 'af2c46bcc413205d644a2b94ee2ff568d3d004f2', class: "zonos--elements" }, h("div", { key: '
|
|
187
|
+
return (h(Host, { key: 'af2c46bcc413205d644a2b94ee2ff568d3d004f2', class: "zonos--elements" }, h("div", { key: 'e74b871d52d734ca9ad772d8ae1c5bef1aaf06f9', class: classes([
|
|
188
188
|
'zonos--hello-dialog',
|
|
189
189
|
animateLeft && 'zonos--hello-dialog-animate-from-left',
|
|
190
190
|
animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
|
|
191
191
|
!!this.mobileLocationOverride &&
|
|
192
192
|
'zonos--hello-dialog-mobile-override',
|
|
193
193
|
this.isOpen && 'zonos--hello-dialog-open',
|
|
194
|
-
]), ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", { key: '
|
|
194
|
+
]), inert: !this.isOpen, ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", { key: 'd973d051143ab56e1af29b7ee812f1e5405b7768' }, h("div", { key: '1539bbc35aebccc9748e2d3b77b1717bd2e5dec5', class: "zonos--hello-dialog-content" }, h("zonos-button", { key: '675ff7bb8fdf8373c1aa21200ccc42ff9b585355', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close Zonos Hello dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.setIsOpen(false) }), h("zonos-v-stack", { key: 'c82a41c292facb00fd1a48ce69920b1de47d3f09', spacing: 24 }, h("zonos-country-flag", { key: '6b083cf77226e3766ad50a812c1201809593f3d6', class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), h("zonos-v-stack", { key: 'f0ab4ca66f22b0448edff37fc730e72790b83de8', class: "zonos--hello-dialog-header", spacing: 4 }, h("zonos-text", { key: '574f22410d18fbeea3ac3fe22a735a2d858b5c9e', type: "boldSubheader" }, welcomeMessage), h("zonos-text", { key: '35f718094fcbd34d8e8ae9ec46fd0429cfcd1104', innerHTML: defaultMessage, textColor: "gray-800" })), h("zonos-v-stack", { key: 'e4bd687a84f1d48d0a20564a4ac9b9c1a24b3850', spacing: 8 }, this.restrictedItems.map(item => {
|
|
195
195
|
var _a;
|
|
196
196
|
return item && (h("zonos-banner", { bannerTitle: item.name, intent: "error" }, (_a = item.itemRestrictions) === null || _a === void 0 ? void 0 : _a.map(x => (h("zonos-text", { textColor: "red-800" }, x === null || x === void 0 ? void 0 : x.note)))));
|
|
197
|
-
}), h("zonos-card", { key: '
|
|
198
|
-
additionalInformation.map(info => (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Additional information for buying goods from selected country", content: BagIcon }), h("zonos-text", { innerHTML: info })))))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { key: '
|
|
197
|
+
}), h("zonos-card", { key: '53fa284d1d87505e550bb893a895e944894cd8b6', spacing: "12px" }, h("zonos-v-stack", { key: 'ee8ecb870af875c1bbc49be88464094753d96b26', spacing: 12 }, h("div", { key: '9bb07220319b2635d66722c79a81c77c049e2aa0', class: "zonos--flex-message" }, h("zonos-icon", { key: 'cf345dace81622f3fd240a1538f25fce855d2ae2', "aria-label": "Duty de minimis", content: ImportIcon }), h("zonos-text", { key: '4a047bc63a8e2a1f88203241b927ac3f3f05a398' }, dutyDeMinimisMessage)), h("div", { key: 'af75e4d21ae1189d015376bfed3caf9156788ceb', class: "zonos--flex-message" }, h("zonos-icon", { key: '356fbbe36379ab8513822be08f8b4f3af4f8baf5', "aria-label": "Tax de minimis", content: MoneyIcon }), h("zonos-text", { key: '5b8fb3f1622bb49bbed21e0a81d6725a5825e931' }, taxDeMinimisMessage)), additionalInformation === null || additionalInformation === void 0 ? void 0 :
|
|
198
|
+
additionalInformation.map(info => (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Additional information for buying goods from selected country", content: BagIcon }), h("zonos-text", { innerHTML: info })))))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { key: '362873c8bac81efc80e44fae1d74a0bffae5e605', appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value), setShowLanguageSelect: value => this.setShowLanguageSelect(value) }))), this.showCountrySelect && (h("div", { key: '86d0d738e77d51666d3f63288aa1e954d539bb06' }, h("zonos-country-select", { key: '98766f096f97b249f0b4b3ebe053474de4ae498a', handleOnClose: () => this.setShowCountrySelect(false) }))), this.showLanguageSelect && (h("div", { key: '3268e1c0a9f7300b0e997ef238a4d95ec9d4f894' }, h("zonos-language-select", { key: '1b6d9dd2872332b2eba343ffd8798b1e87c71c2a', handleOnClose: () => this.setShowLanguageSelect(false) }))))));
|
|
199
199
|
}
|
|
200
200
|
static get is() { return "zonos-hello-dialog"; }
|
|
201
201
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
import { cartStore } from "../../store/checkout/cart";
|
|
2
2
|
import { stripeStore } from "../../store/checkout/stripe";
|
|
3
|
+
/**
|
|
4
|
+
* Extract value from translated object
|
|
5
|
+
*/
|
|
6
|
+
const getTranslatedAddress = ({ currentAddress, translatedAddress, }) => {
|
|
7
|
+
var _a, _b, _c, _d, _e, _f;
|
|
8
|
+
const { city, country, line1, line2, postal_code, state } = currentAddress.value.address;
|
|
9
|
+
const name = currentAddress.value.name ||
|
|
10
|
+
[currentAddress.value.firstName, currentAddress.value.lastName].join(' ');
|
|
11
|
+
return {
|
|
12
|
+
city: ((_a = translatedAddress.city) === null || _a === void 0 ? void 0 : _a[city]) || city,
|
|
13
|
+
country,
|
|
14
|
+
line1: ((_b = translatedAddress.line1) === null || _b === void 0 ? void 0 : _b[line1]) || line1,
|
|
15
|
+
line2: ((_c = translatedAddress.line2) === null || _c === void 0 ? void 0 : _c[line2 || '']) || line2 || '',
|
|
16
|
+
name: ((_d = translatedAddress.name) === null || _d === void 0 ? void 0 : _d[name]) || name,
|
|
17
|
+
phone: currentAddress.value.phone || '',
|
|
18
|
+
postal_code: ((_e = translatedAddress.postal_code) === null || _e === void 0 ? void 0 : _e[postal_code]) || postal_code,
|
|
19
|
+
state: ((_f = translatedAddress.state) === null || _f === void 0 ? void 0 : _f[state]) || state,
|
|
20
|
+
};
|
|
21
|
+
};
|
|
3
22
|
export const prepCalculateLandedCost = () => {
|
|
4
23
|
// maybe we don't need email now for prefetch the landed cost
|
|
5
24
|
const stripeLinkData = stripeStore.stripeLinkEventData;
|
|
@@ -10,39 +29,52 @@ export const prepCalculateLandedCost = () => {
|
|
|
10
29
|
if (!(stripeAddressData === null || stripeAddressData === void 0 ? void 0 : stripeAddressData.complete) || !(stripeBillingAddressData === null || stripeBillingAddressData === void 0 ? void 0 : stripeBillingAddressData.complete)) {
|
|
11
30
|
throw new Error('Missing stripe address data');
|
|
12
31
|
}
|
|
32
|
+
// Attempt to get translated address if available
|
|
33
|
+
const translatedShippingAddress = getTranslatedAddress({
|
|
34
|
+
currentAddress: stripeAddressData,
|
|
35
|
+
translatedAddress: stripeStore.translatedAddress.address,
|
|
36
|
+
});
|
|
37
|
+
const shippingFirstName = translatedShippingAddress.name.split(' ')[0] || '';
|
|
38
|
+
const shippingLastName = translatedShippingAddress.name.split(' ').splice(1).join(' ') || '';
|
|
39
|
+
const translatedBillingAddress = getTranslatedAddress({
|
|
40
|
+
currentAddress: stripeBillingAddressData,
|
|
41
|
+
translatedAddress: stripeStore.translatedAddress.address,
|
|
42
|
+
});
|
|
43
|
+
const billingFirstName = translatedBillingAddress.name.split(' ')[0] || '';
|
|
44
|
+
const billingLastName = translatedBillingAddress.name.split(' ').splice(1).join(' ') || '';
|
|
13
45
|
return {
|
|
14
46
|
billingAddress: {
|
|
15
|
-
addressLine1:
|
|
16
|
-
addressLine2:
|
|
17
|
-
city:
|
|
18
|
-
country:
|
|
19
|
-
postalCode:
|
|
20
|
-
state:
|
|
47
|
+
addressLine1: translatedBillingAddress.line1,
|
|
48
|
+
addressLine2: translatedBillingAddress.line2 || '',
|
|
49
|
+
city: translatedBillingAddress.city,
|
|
50
|
+
country: translatedBillingAddress.country,
|
|
51
|
+
postalCode: translatedBillingAddress.postal_code,
|
|
52
|
+
state: translatedBillingAddress.state,
|
|
21
53
|
},
|
|
22
54
|
billingContact: {
|
|
23
55
|
// firstName and lastName should be valid now since stripe only mark
|
|
24
56
|
// the address as complete when both fields are filled.
|
|
25
|
-
firstName:
|
|
26
|
-
lastName:
|
|
27
|
-
phone:
|
|
57
|
+
firstName: billingFirstName,
|
|
58
|
+
lastName: billingLastName,
|
|
59
|
+
phone: translatedBillingAddress.phone,
|
|
28
60
|
},
|
|
29
61
|
checkoutSessionId: cartStore.checkoutSessionId || '',
|
|
30
62
|
contact: {
|
|
31
|
-
email:
|
|
63
|
+
email: stripeLinkData === null || stripeLinkData === void 0 ? void 0 : stripeLinkData.value.email,
|
|
32
64
|
// firstName and lastName should be valid now since stripe only mark
|
|
33
65
|
// the address as complete when both fields are filled.
|
|
34
|
-
firstName:
|
|
35
|
-
lastName:
|
|
36
|
-
phone:
|
|
66
|
+
firstName: shippingFirstName,
|
|
67
|
+
lastName: shippingLastName,
|
|
68
|
+
phone: translatedShippingAddress.phone,
|
|
37
69
|
},
|
|
38
70
|
items: cartStore.items,
|
|
39
71
|
shippingAddress: {
|
|
40
|
-
addressLine1:
|
|
41
|
-
addressLine2:
|
|
42
|
-
city:
|
|
43
|
-
country:
|
|
44
|
-
postalCode:
|
|
45
|
-
state:
|
|
72
|
+
addressLine1: translatedShippingAddress.line1,
|
|
73
|
+
addressLine2: translatedShippingAddress.line2,
|
|
74
|
+
city: translatedShippingAddress.city,
|
|
75
|
+
country: translatedShippingAddress.country,
|
|
76
|
+
postalCode: translatedShippingAddress.postal_code,
|
|
77
|
+
state: translatedShippingAddress.state,
|
|
46
78
|
},
|
|
47
79
|
};
|
|
48
80
|
};
|
|
@@ -7140,6 +7140,25 @@ const localizationStoreUpdateSelectedLocale = (newSelectedLocale) => {
|
|
|
7140
7140
|
void updateCheckoutSessionLanguage();
|
|
7141
7141
|
};
|
|
7142
7142
|
|
|
7143
|
+
/**
|
|
7144
|
+
* Extract value from translated object
|
|
7145
|
+
*/
|
|
7146
|
+
const getTranslatedAddress = ({ currentAddress, translatedAddress, }) => {
|
|
7147
|
+
var _a, _b, _c, _d, _e, _f;
|
|
7148
|
+
const { city, country, line1, line2, postal_code, state } = currentAddress.value.address;
|
|
7149
|
+
const name = currentAddress.value.name ||
|
|
7150
|
+
[currentAddress.value.firstName, currentAddress.value.lastName].join(' ');
|
|
7151
|
+
return {
|
|
7152
|
+
city: ((_a = translatedAddress.city) === null || _a === void 0 ? void 0 : _a[city]) || city,
|
|
7153
|
+
country,
|
|
7154
|
+
line1: ((_b = translatedAddress.line1) === null || _b === void 0 ? void 0 : _b[line1]) || line1,
|
|
7155
|
+
line2: ((_c = translatedAddress.line2) === null || _c === void 0 ? void 0 : _c[line2 || '']) || line2 || '',
|
|
7156
|
+
name: ((_d = translatedAddress.name) === null || _d === void 0 ? void 0 : _d[name]) || name,
|
|
7157
|
+
phone: currentAddress.value.phone || '',
|
|
7158
|
+
postal_code: ((_e = translatedAddress.postal_code) === null || _e === void 0 ? void 0 : _e[postal_code]) || postal_code,
|
|
7159
|
+
state: ((_f = translatedAddress.state) === null || _f === void 0 ? void 0 : _f[state]) || state,
|
|
7160
|
+
};
|
|
7161
|
+
};
|
|
7143
7162
|
const prepCalculateLandedCost = () => {
|
|
7144
7163
|
// maybe we don't need email now for prefetch the landed cost
|
|
7145
7164
|
const stripeLinkData = stripeStore.stripeLinkEventData;
|
|
@@ -7150,39 +7169,52 @@ const prepCalculateLandedCost = () => {
|
|
|
7150
7169
|
if (!(stripeAddressData === null || stripeAddressData === void 0 ? void 0 : stripeAddressData.complete) || !(stripeBillingAddressData === null || stripeBillingAddressData === void 0 ? void 0 : stripeBillingAddressData.complete)) {
|
|
7151
7170
|
throw new Error('Missing stripe address data');
|
|
7152
7171
|
}
|
|
7172
|
+
// Attempt to get translated address if available
|
|
7173
|
+
const translatedShippingAddress = getTranslatedAddress({
|
|
7174
|
+
currentAddress: stripeAddressData,
|
|
7175
|
+
translatedAddress: stripeStore.translatedAddress.address,
|
|
7176
|
+
});
|
|
7177
|
+
const shippingFirstName = translatedShippingAddress.name.split(' ')[0] || '';
|
|
7178
|
+
const shippingLastName = translatedShippingAddress.name.split(' ').splice(1).join(' ') || '';
|
|
7179
|
+
const translatedBillingAddress = getTranslatedAddress({
|
|
7180
|
+
currentAddress: stripeBillingAddressData,
|
|
7181
|
+
translatedAddress: stripeStore.translatedAddress.address,
|
|
7182
|
+
});
|
|
7183
|
+
const billingFirstName = translatedBillingAddress.name.split(' ')[0] || '';
|
|
7184
|
+
const billingLastName = translatedBillingAddress.name.split(' ').splice(1).join(' ') || '';
|
|
7153
7185
|
return {
|
|
7154
7186
|
billingAddress: {
|
|
7155
|
-
addressLine1:
|
|
7156
|
-
addressLine2:
|
|
7157
|
-
city:
|
|
7158
|
-
country:
|
|
7159
|
-
postalCode:
|
|
7160
|
-
state:
|
|
7187
|
+
addressLine1: translatedBillingAddress.line1,
|
|
7188
|
+
addressLine2: translatedBillingAddress.line2 || '',
|
|
7189
|
+
city: translatedBillingAddress.city,
|
|
7190
|
+
country: translatedBillingAddress.country,
|
|
7191
|
+
postalCode: translatedBillingAddress.postal_code,
|
|
7192
|
+
state: translatedBillingAddress.state,
|
|
7161
7193
|
},
|
|
7162
7194
|
billingContact: {
|
|
7163
7195
|
// firstName and lastName should be valid now since stripe only mark
|
|
7164
7196
|
// the address as complete when both fields are filled.
|
|
7165
|
-
firstName:
|
|
7166
|
-
lastName:
|
|
7167
|
-
phone:
|
|
7197
|
+
firstName: billingFirstName,
|
|
7198
|
+
lastName: billingLastName,
|
|
7199
|
+
phone: translatedBillingAddress.phone,
|
|
7168
7200
|
},
|
|
7169
7201
|
checkoutSessionId: cartStore.checkoutSessionId || '',
|
|
7170
7202
|
contact: {
|
|
7171
|
-
email:
|
|
7203
|
+
email: stripeLinkData === null || stripeLinkData === void 0 ? void 0 : stripeLinkData.value.email,
|
|
7172
7204
|
// firstName and lastName should be valid now since stripe only mark
|
|
7173
7205
|
// the address as complete when both fields are filled.
|
|
7174
|
-
firstName:
|
|
7175
|
-
lastName:
|
|
7176
|
-
phone:
|
|
7206
|
+
firstName: shippingFirstName,
|
|
7207
|
+
lastName: shippingLastName,
|
|
7208
|
+
phone: translatedShippingAddress.phone,
|
|
7177
7209
|
},
|
|
7178
7210
|
items: cartStore.items,
|
|
7179
7211
|
shippingAddress: {
|
|
7180
|
-
addressLine1:
|
|
7181
|
-
addressLine2:
|
|
7182
|
-
city:
|
|
7183
|
-
country:
|
|
7184
|
-
postalCode:
|
|
7185
|
-
state:
|
|
7212
|
+
addressLine1: translatedShippingAddress.line1,
|
|
7213
|
+
addressLine2: translatedShippingAddress.line2,
|
|
7214
|
+
city: translatedShippingAddress.city,
|
|
7215
|
+
country: translatedShippingAddress.country,
|
|
7216
|
+
postalCode: translatedShippingAddress.postal_code,
|
|
7217
|
+
state: translatedShippingAddress.state,
|
|
7186
7218
|
},
|
|
7187
7219
|
};
|
|
7188
7220
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -245,9 +245,9 @@ const zonosLoadUrl = (() => {
|
|
|
245
245
|
}
|
|
246
246
|
return null;
|
|
247
247
|
})();
|
|
248
|
-
const ZONOS_URL = "https://v1.3.
|
|
249
|
-
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.
|
|
250
|
-
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.
|
|
248
|
+
const ZONOS_URL = "https://v1.3.36.js.zonos.com";
|
|
249
|
+
const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.36";
|
|
250
|
+
const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.36";
|
|
251
251
|
const MAIN_LOAD_CDN_TYPE = 'jsdelivr';
|
|
252
252
|
const INTER_FONT_URL = 'https://rsms.me';
|
|
253
253
|
const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
|
|
@@ -267,7 +267,7 @@ Zonos.isBigCommerce = false;
|
|
|
267
267
|
*/
|
|
268
268
|
Zonos.isNpm = true;
|
|
269
269
|
Zonos.zonosQaUrl = null;
|
|
270
|
-
Zonos.version = `v${"1.3.
|
|
270
|
+
Zonos.version = `v${"1.3.36"}`;
|
|
271
271
|
Zonos.modeAlerted = false;
|
|
272
272
|
Zonos.tempCartData = null;
|
|
273
273
|
Zonos.getCurrentTimestamp = () => new Date().getTime();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as handleFetch, d as cartStore, l as localizationStore } from './cart-
|
|
1
|
+
import { r as handleFetch, d as cartStore, l as localizationStore } from './cart-f29968a8.js';
|
|
2
2
|
import { z as zonosStore } from './zonosStore-ba9e541e.js';
|
|
3
3
|
import { l as log } from './logError-c456c092.js';
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-3b46f3c3.js';
|
|
2
|
-
import { h as stripeStore, l as localizationStore, t as translate } from './cart-
|
|
2
|
+
import { h as stripeStore, l as localizationStore, t as translate } from './cart-f29968a8.js';
|
|
3
3
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
4
4
|
import { a as logError } from './logError-c456c092.js';
|
|
5
5
|
import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
|
|
@@ -208,16 +208,17 @@ const ZonosAddressForm = class {
|
|
|
208
208
|
render() {
|
|
209
209
|
const { city, country, line1, line2, name, phone, postal_code, state } = this.localAddress;
|
|
210
210
|
const firstName = name.split(' ')[0] || '';
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
// get the rest of the name if it exists
|
|
212
|
+
const lastName = name.split(' ').slice(1).join(' ') || '';
|
|
213
|
+
return (h(Host, { key: '8b578737e33203a23563be7e9be0778deec99bbf', class: "zonos--address-form zonos--elements" }, h("div", { key: '793675a1348547bf3f781788956befe325191011', class: "zonos--title" }, h("zonos-text", { key: '13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9', textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
|
|
213
214
|
? translate('Shipping')
|
|
214
|
-
: translate('Billing'))), h("div", { key: '
|
|
215
|
+
: translate('Billing'))), h("div", { key: '2c5de5b5283fb99ee5f8b61d7a217177986fc2db', class: "zonos--address-group" }, h("div", { key: '23bf3c893071000d5995a5f175867bab11929193', class: "zonos--contact" }, h("zonos-text", { key: '7cdfe2a84ebad89ba5b16498d75def99cf392384', type: "label" }, translate('Contact')), h("zonos-input", { key: '1c39c38767fd306c5eb1164cdc989b8291209cf0', class: "zonos--form-email", inputLabel: translate('Email'), inputValue: this.currentAddress.email, isDisabled: true }), h("div", { key: 'cbdf61217125e22b1a6cec9a340ef0aca2c75670', class: "zonos--name zonos--address-row" }, h("zonos-input", { key: '360c99e7b2c6caa64580d5768b5bb53368927275', class: "zonos--form-first-name", inputLabel: translate('First name'), inputValue: firstName, isError: isTextContainsNonLatinChars(firstName), onInputChange: e => this.onInputChange({
|
|
215
216
|
key: 'name',
|
|
216
217
|
value: `${e.detail} ${lastName}`,
|
|
217
|
-
}) }), h("zonos-input", { key: '
|
|
218
|
+
}) }), h("zonos-input", { key: '8ce5fa5c15c6f7928339ea10009ce0e68954a91f', class: "zonos--form-last-name", inputLabel: translate('Last name'), inputValue: lastName, isError: isTextContainsNonLatinChars(lastName), onInputChange: e => this.onInputChange({
|
|
218
219
|
key: 'name',
|
|
219
220
|
value: `${firstName} ${e.detail}`,
|
|
220
|
-
}) }))), h("div", { key: '
|
|
221
|
+
}) }))), h("div", { key: '7b4fa2d3baa6cb257e7688e5ba6777123898b3fd', class: "zonos--address" }, h("zonos-text", { key: '9d5782331b2642755a755aeb7f98c9f4d87f9a20', type: "label" }, translate('Address')), h("zonos-input", { key: 'a622025924ca86bdbf1d3c04b79e6dee172b4c42', class: "zonos--form-country", inputLabel: translate('Country'), inputValue: country, isDisabled: true }), h("zonos-input", { key: 'f99b3a74db09ab5730878e80705b9aeac76bf800', class: "zonos--form-line1", inputLabel: translate('Address line 1'), inputValue: line1, isError: isTextContainsNonLatinChars(line1), onInputChange: e => this.onInputChange({ key: 'line1', value: e.detail }) }), h("zonos-input", { key: '5d16aefa45a78045c87d166aaaec0255606e455e', class: "zonos--form-line2", inputLabel: translate('Address line 2'), inputValue: line2, isError: isTextContainsNonLatinChars(line2), onInputChange: e => this.onInputChange({ key: 'line2', value: e.detail }) }), h("div", { key: 'dc166be9381142835d72e731cb38a718522a068a', class: "zonos--address-row" }, h("zonos-input", { key: '4f1a98f9d10ce0cff3ef18a3037a12382552b31d', class: "zonos--form-city", inputLabel: translate('City'), inputValue: city, isError: isTextContainsNonLatinChars(city), onInputChange: e => this.onInputChange({ key: 'city', value: e.detail }) }), h("zonos-input", { key: 'd4f97900b5fe2e1619950a52d1d1f716a8bc19ff', class: "zonos--form-state", inputLabel: translate('State/Province'), inputValue: state, isError: isTextContainsNonLatinChars(state), onInputChange: e => this.onInputChange({ key: 'state', value: e.detail }) })), h("zonos-input", { key: 'cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733', class: "zonos--form-postal-code", inputLabel: translate('Postal code'), inputValue: postal_code, isError: isTextContainsNonLatinChars(postal_code), onInputChange: e => this.onInputChange({ key: 'postal_code', value: e.detail }) }), h("zonos-input", { key: '7421c82847eded6bdbcce49ef8196124d8e50c1d', class: "zonos--form-phone", inputLabel: translate('Phone number'), inputValue: phone, onInputChange: e => this.onInputChange({ key: 'phone', value: e.detail }) })))));
|
|
221
222
|
}
|
|
222
223
|
static get watchers() { return {
|
|
223
224
|
"translatedAddress": ["watchCurrentAddress"]
|
|
@@ -231,13 +232,13 @@ const ZonosAddressUpdateDialogStyle0 = zonosAddressUpdateDialogCss;
|
|
|
231
232
|
const ZonosAddressUpdateDialog = class {
|
|
232
233
|
constructor(hostRef) {
|
|
233
234
|
registerInstance(this, hostRef);
|
|
234
|
-
this.
|
|
235
|
+
this.closeUpdateDialog = createEvent(this, "closeUpdateDialog", 7);
|
|
235
236
|
this.continueClicked = createEvent(this, "continueClicked", 7);
|
|
236
237
|
/**
|
|
237
238
|
* handler for close button click
|
|
238
239
|
*/
|
|
239
|
-
this.
|
|
240
|
-
this.
|
|
240
|
+
this.closeUpdateDialogHandler = () => {
|
|
241
|
+
this.closeUpdateDialog.emit();
|
|
241
242
|
};
|
|
242
243
|
/**
|
|
243
244
|
* Extract value from translated object
|
|
@@ -367,24 +368,24 @@ const ZonosAddressUpdateDialog = class {
|
|
|
367
368
|
: this.submitBtnType || 'standard';
|
|
368
369
|
const billing = this.billingAddress;
|
|
369
370
|
const shipping = this.shippingAddress;
|
|
370
|
-
return (h(Host, { key: '
|
|
371
|
+
return (h(Host, { key: '655845cef04f4af526b1a1c4e49243c4f2b4c7f6', class: classes([
|
|
371
372
|
'zonos--address-update-dialog zonos--elements',
|
|
372
373
|
this.isMobile && 'mobile',
|
|
373
|
-
]) }, h("zonos-dialog", { key: '
|
|
374
|
+
]) }, h("zonos-dialog", { key: 'eab429bb78ce6f05ba463d8748d7edd5499402fa', isLoading: this.dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeUpdateDialog.emit(), open: this.dialogOpen, width: "568px" }, h("div", { key: '08f0400e62addfcaffd91bf5200999d29bbd2da9', class: "zonos--body" }, h("div", { key: '8699df5e2f823e19066fbb552ba2a66c127c05e9', class: "zonos--dialog-header" }, h("div", { key: '92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3', class: "zonos--dialog-title" }, h("zonos-text", { key: 'aaac3375526bddb319ce7c8f49bde30da7210264', type: "title" }, translate('Update your address')), h("zonos-button", { key: '66abf7b74045e68e84e631298504236d32ca9c4e', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon$1 }), noBackground: true, onClick: () => this.closeUpdateDialogHandler() })), h("zonos-text", { key: 'ffb3d8f169867d5f6dff269e1becd99c98c5a7da' }, translate('To ensure delivery all address details must be in Latin characters.'))), h("div", { key: '2cb61f06ce174e2317870decfdd337c67c5cf128', class: "zonos--group" }, h("zonos-text", { key: 'a616c540984120b468e52bccfb380ea3974ced22', class: "zonos--what-you-entered", type: "semiBoldLabel" }, translate('What you entered')), h("div", { key: '6ac8f9c14472370c501af1b0d50bd8f8746b7694', class: "zonos--address-display-group" }, h("zonos-address-display", { key: 'ea2c67a7bba51c99f80be968e448beeffcf1f863', addressType: "shipping", currentAddress: shipping }), billing && (h("zonos-address-display", { key: '7ea1683dc04a292810e04ed6550d86086f25186f', addressType: "billing", currentAddress: billing }))), h("div", { key: '4d1cd9096943518b8b4e267608a5e1542befb6a9', class: "zonos--address-form-section" }, h("zonos-text", { key: 'e4184a2cc618d26d43979fa8cfe06070cf8b5af8', type: "semiBoldLabel" }, translate('Translated address')), h("zonos-address-form", { key: 'c55d9d3c658565ceb7c7b879f444e3937b9f7ad6', addressType: "shipping", class: "zonos--shipping-address-form", currentAddress: shipping, onAddressChange: e => {
|
|
374
375
|
const address = e.detail;
|
|
375
376
|
this.translatedShippingAddressState =
|
|
376
377
|
this.buildTranslateAddressState({
|
|
377
378
|
currentAddress: shipping,
|
|
378
379
|
translatedAddress: address,
|
|
379
380
|
});
|
|
380
|
-
}, translatedAddress: this.translatedShippingAddressState }), billing && (h("zonos-address-form", { key: '
|
|
381
|
+
}, translatedAddress: this.translatedShippingAddressState }), billing && (h("zonos-address-form", { key: 'c3facc295b1322bb00baa6081f343dcea4f10777', addressType: "billing", class: "zonos--billing-address-form", currentAddress: billing, onAddressChange: e => {
|
|
381
382
|
const address = e.detail;
|
|
382
383
|
this.translatedBillingAddressState =
|
|
383
384
|
this.buildTranslateAddressState({
|
|
384
385
|
currentAddress: billing,
|
|
385
386
|
translatedAddress: address,
|
|
386
387
|
});
|
|
387
|
-
}, translatedAddress: this.translatedBillingAddressState })))), h("div", { key: '
|
|
388
|
+
}, translatedAddress: this.translatedBillingAddressState })))), h("div", { key: '1c89c9604ba0dece40275fcfac97e7f93706b430', class: "zonos--group-btn" }, h("div", { key: 'e47d393940b094b4e123864e4070daa87f0616f0', class: "zonos--button-wrapper" }, h("zonos-button", { key: '216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6', class: "zonos--cancel-btn", onClick: () => this.closeUpdateDialogHandler(), variant: "subtle" }, translate('Cancel')), h("zonos-button", { key: 'acbacb92cedb325b46843d8f3aff13f4e7c86ab5', backgroundColor: this.submitBtnColor, class: "zonos--update-btn", loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "sm", variant: submitBtnType }, translate('Update address'))))))));
|
|
388
389
|
}
|
|
389
390
|
get el() { return getElement(this); }
|
|
390
391
|
static get watchers() { return {
|
|
@@ -516,7 +517,7 @@ const ZonosDialogStyle0 = zonosDialogCss;
|
|
|
516
517
|
const ZonosDialog = class {
|
|
517
518
|
constructor(hostRef) {
|
|
518
519
|
registerInstance(this, hostRef);
|
|
519
|
-
this.closeDialog = createEvent(this, "closeDialog",
|
|
520
|
+
this.closeDialog = createEvent(this, "closeDialog", 3);
|
|
520
521
|
this.isMobileMode = () => {
|
|
521
522
|
return this.mobile || window.innerWidth <= 768;
|
|
522
523
|
};
|
|
@@ -569,7 +570,7 @@ const ZonosDialog = class {
|
|
|
569
570
|
const borderStyle = getBorderRadius({
|
|
570
571
|
overrideBorderStyle: this.borderStyle,
|
|
571
572
|
});
|
|
572
|
-
return (h(Host, { key: '
|
|
573
|
+
return (h(Host, { key: '018771d0e01311ae520abcf33fbd64316794b202', class: classes([
|
|
573
574
|
'zonos--elements',
|
|
574
575
|
this.open && 'open',
|
|
575
576
|
this.isLoading && 'is-loading',
|
|
@@ -581,10 +582,10 @@ const ZonosDialog = class {
|
|
|
581
582
|
'--height': this.height || 'initial',
|
|
582
583
|
'--min-height': this.minHeight || '500px',
|
|
583
584
|
'--width': this.width,
|
|
584
|
-
} }, h("div", { key: '
|
|
585
|
+
} }, h("div", { key: 'a86c9f8465054fde894bbdd71149e59d97e8cbcf', class: "zonos--backdrop" }), h("div", { key: 'b2f0c86fa0e768474ba4d522f8c2b8157f89cd56', class: "zonos--dialog-layout", inert: !this.open, onClick: this.clickOutsideDialogHandler }, h("div", { key: '26cd8a7b98d38c53dcf4789c8781f0c1ced99633', class: "zonos--dialog" }, this.isLoading && (h("div", { key: '34d0ba841a9af9ca2ff6d21d0471113cc86cdec3', class: "zonos--loading" }, h("zonos-spinner", { key: '0109778b1a9734de0959035e3975414fb1cac1be', size: 30 }))), (this.headerText || !this.noCloseButton) && (h("div", { key: 'f80a4c337727500ee1ad92c1d80d7b3088eccc0f', class: "zonos--header" }, this.headerText && (h("h3", { key: '92b078fbbcd9ca5f8bf178fc67f2bee817d1e961', class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { key: '698e45fffd466f22b6179aa220d35fe39ee5374c', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler, variant: "subtle" })))), h("div", { key: 'a4012e5a48d5fbcc77cac038d8a39fe05f332008', class: classes([
|
|
585
586
|
'zonos--body',
|
|
586
587
|
this.noBodyPadding && 'zonos--no-body-padding',
|
|
587
|
-
]) }, h("slot", { key: '
|
|
588
|
+
]) }, h("slot", { key: 'd64b381cb91afde4ddbde58348a62612d9871c8e' })), h("slot", { key: '4ddd73bfe41ecd1c90b18f82a8d8f12a1eacf144', name: "dialog-footer" })))));
|
|
588
589
|
}
|
|
589
590
|
static get assetsDirs() { return ["assets"]; }
|
|
590
591
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-3b46f3c3.js';
|
|
2
|
-
import { d as cartStore, B as currencyFormat, C as cartStoreHasOneEligibleItem, t as translate, r as handleFetch, p as stripeStoreReset, h as stripeStore, D as stripeStoreRetrievePayment, l as localizationStore, E as stripeStoreTranslateAddressToLatin, F as cartStoreUpdateSelectedShippingOption, G as cartStoreGetShippingTransitInfo } from './cart-
|
|
2
|
+
import { d as cartStore, B as currencyFormat, C as cartStoreHasOneEligibleItem, t as translate, r as handleFetch, p as stripeStoreReset, h as stripeStore, D as stripeStoreRetrievePayment, l as localizationStore, E as stripeStoreTranslateAddressToLatin, F as cartStoreUpdateSelectedShippingOption, G as cartStoreGetShippingTransitInfo } from './cart-f29968a8.js';
|
|
3
3
|
import { c as classes } from './classes-0d95c529.js';
|
|
4
4
|
import { z as zonosStore, g as getZonosStoreTheme, d as zonosStoreFontFamily } from './zonosStore-ba9e541e.js';
|
|
5
|
-
import { t as trackConversionEvent, s as sendErrorLog, a as submitGtag, c as createCustomEvent, g as getIsTestMode } from './submitGtag-
|
|
5
|
+
import { t as trackConversionEvent, s as sendErrorLog, a as submitGtag, c as createCustomEvent, g as getIsTestMode } from './submitGtag-fcfd5cf4.js';
|
|
6
6
|
import { g as getBorderRadius } from './getBorderRadius-947c24de.js';
|
|
7
7
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
8
8
|
import { l as languages } from './ILanguage-cd6acb72.js';
|
|
@@ -715,7 +715,9 @@ const ZonosCustomerInfo = class {
|
|
|
715
715
|
// overwrite the address object with the new data
|
|
716
716
|
stripeEventDataObj = Object.assign(Object.assign({}, stripeEventDataObj), { complete: true, value: Object.assign(Object.assign({}, stripeEventDataObj === null || stripeEventDataObj === void 0 ? void 0 : stripeEventDataObj.value), { address: Object.assign(Object.assign({}, stripeEventDataObj === null || stripeEventDataObj === void 0 ? void 0 : stripeEventDataObj.value.address), { city: submitDataByKey.city ||
|
|
717
717
|
(stripeEventDataObj === null || stripeEventDataObj === void 0 ? void 0 : stripeEventDataObj.value.address.city) ||
|
|
718
|
-
'', line1: submitDataByKey.line1, line2: submitDataByKey.line2, postal_code: submitDataByKey.postal_code, state: submitDataByKey.state }), firstName: submitDataByKey.name.split(' ')[0],
|
|
718
|
+
'', line1: submitDataByKey.line1, line2: submitDataByKey.line2, postal_code: submitDataByKey.postal_code, state: submitDataByKey.state }), firstName: submitDataByKey.name.split(' ')[0],
|
|
719
|
+
// get all the names after
|
|
720
|
+
lastName: submitDataByKey.name.split(' ').slice(1).join(' '), name: submitDataByKey.name }) });
|
|
719
721
|
};
|
|
720
722
|
/**
|
|
721
723
|
* handler for continue button click
|
|
@@ -844,12 +846,16 @@ const ZonosCustomerInfo = class {
|
|
|
844
846
|
variant: this.submitBtnType }, translate('Continue to shipping')))), stripeStore.stripeAddressEventData && (h("zonos-address-update-dialog", { billingAddress: !stripeStore.stripeShippingSameAsBilling &&
|
|
845
847
|
stripeStore.stripeBillingAddressEventData
|
|
846
848
|
? this.prepareAddressObject(stripeStore.stripeBillingAddressEventData)
|
|
847
|
-
: null, "data-theme": theme, dialogLoading: this.isValidatingAddress, dialogOpen: this.openAddressValidationDialog, isMobile: this.isMobile,
|
|
849
|
+
: null, "data-theme": theme, dialogLoading: this.isValidatingAddress, dialogOpen: this.openAddressValidationDialog, isMobile: this.isMobile, onCloseUpdateDialog: () => (this.openAddressValidationDialog = false), onContinueClicked: e => {
|
|
848
850
|
const submitData = e.detail;
|
|
849
851
|
this.transformTranslatedAddressToStripeEvent({
|
|
850
852
|
submitData,
|
|
851
853
|
type: 'shippingAddress',
|
|
852
854
|
});
|
|
855
|
+
this.transformTranslatedAddressToStripeEvent({
|
|
856
|
+
submitData,
|
|
857
|
+
type: 'billingAddress',
|
|
858
|
+
});
|
|
853
859
|
}, shippingAddress: this.prepareAddressObject(stripeStore.stripeAddressEventData), translatedBillingAddress: stripeStore.translatedAddress.billingAddress, translatedShippingAddress: stripeStore.translatedAddress.address }))));
|
|
854
860
|
}
|
|
855
861
|
get el() { return getElement(this); }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, F as Fragment } from './index-3b46f3c3.js';
|
|
2
|
-
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as stripeStore, j as stripeStoreInitCheckoutSession, k as cartStoreUpdateToErrorState, t as translate, m as stripeStorePrefetchLandedCost, n as cartStoreNextStep, o as stripeStoreConfirmPayment, p as stripeStoreReset, q as localizationStoreOnUpdate } from './cart-
|
|
2
|
+
import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as cartStore, e as cartStoreUpdateItems, f as cartStoreReset, g as cartStoreResetTabItems, h as stripeStore, j as stripeStoreInitCheckoutSession, k as cartStoreUpdateToErrorState, t as translate, m as stripeStorePrefetchLandedCost, n as cartStoreNextStep, o as stripeStoreConfirmPayment, p as stripeStoreReset, q as localizationStoreOnUpdate } from './cart-f29968a8.js';
|
|
3
3
|
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-ba9e541e.js';
|
|
4
|
-
import { c as createCustomEvent, s as sendErrorLog, a as submitGtag, t as trackConversionEvent, g as getIsTestMode } from './submitGtag-
|
|
4
|
+
import { c as createCustomEvent, s as sendErrorLog, a as submitGtag, t as trackConversionEvent, g as getIsTestMode } from './submitGtag-fcfd5cf4.js';
|
|
5
5
|
import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
|
|
6
6
|
import { l as log, a as logError } from './logError-c456c092.js';
|
|
7
7
|
import { c as classes } from './classes-0d95c529.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-3b46f3c3.js';
|
|
2
|
-
import { r as handleFetch, u as isValidSelector, h as stripeStore, v as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-
|
|
2
|
+
import { r as handleFetch, u as isValidSelector, h as stripeStore, v as initLocalizationStore, d as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-f29968a8.js';
|
|
3
3
|
import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-ba9e541e.js';
|
|
4
4
|
import { a as logError, l as log } from './logError-c456c092.js';
|
|
5
5
|
import './isDarkColor-f8324c10.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-3b46f3c3.js';
|
|
2
|
-
import { l as localizationStore } from './cart-
|
|
2
|
+
import { l as localizationStore } from './cart-f29968a8.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-ba9e541e.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import './logError-c456c092.js';
|