@zonos/elements 1.3.12-alpha.1 → 1.3.12-alpha.10
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-fcddc0e6.js → cart-37e23be9.js} +739 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/sendErrorLog-7b3d82e4.js +29 -0
- package/dist/cjs/{submitGtag-ec6ead54.js → submitGtag-d0718b63.js} +1 -20
- package/dist/cjs/zonos-address_4.cjs.entry.js +41 -17
- package/dist/cjs/zonos-card_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_10.cjs.entry.js +8 -8
- package/dist/cjs/zonos-checkout.cjs.entry.js +7 -7
- 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 +1 -1
- package/dist/cjs/zonos-elements.cjs.js +1 -1
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +90 -26
- package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
- package/dist/cjs/zonos-payment.cjs.entry.js +1 -1
- package/dist/collection/components/hello/zonos-hello-dialog/assets/importIcon.svg +4 -0
- package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +85 -25
- package/dist/collection/components/store/translationStore/strings.arabic.js +36 -0
- package/dist/collection/components/store/translationStore/strings.base.js +36 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +36 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +36 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +36 -0
- package/dist/collection/components/store/translationStore/strings.french.js +36 -0
- package/dist/collection/components/store/translationStore/strings.german.js +36 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +36 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +36 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +36 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +36 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +36 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +36 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +36 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +36 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +36 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +36 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +36 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +36 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +36 -0
- package/dist/collection/components/store/translationStore.js +19 -3
- package/dist/collection/components/stripe/zonos-address/zonos-address.js +41 -15
- package/dist/collection/components/utils/logging/getNavigatorConnection.js +16 -0
- package/dist/collection/components/utils/logging/sendLoadScriptLog.js +16 -0
- package/dist/collection/types/LogLoadScriptRequestBody.js +1 -0
- package/dist/collection/types/generated/graphql.customer.types.js +64 -14
- package/dist/collection/types/generated/graphql.frontend.types.js +4 -0
- package/dist/components/sendErrorLog.js +21 -0
- package/dist/components/stripe.js +740 -4
- package/dist/components/trackConversionEvent.js +1 -1
- package/dist/components/zonos-address2.js +41 -15
- package/dist/components/zonos-checkout-finish2.js +3 -20
- package/dist/components/zonos-checkout.js +3 -2
- package/dist/components/zonos-controller.js +1 -1
- package/dist/components/zonos-hello-dialog2.js +89 -25
- package/dist/components/zonos-hello.js +1 -1
- package/dist/components/zonos-link-authentication2.js +1 -1
- package/dist/esm/{cart-228e1ef7.js → cart-7961927b.js} +739 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/sendErrorLog-4d9581da.js +26 -0
- package/dist/esm/{submitGtag-c3727595.js → submitGtag-4c1f09dc.js} +2 -20
- package/dist/esm/zonos-address_4.entry.js +40 -16
- package/dist/esm/zonos-card_2.entry.js +1 -1
- package/dist/esm/zonos-cart-items_10.entry.js +3 -3
- package/dist/esm/zonos-checkout.entry.js +3 -3
- 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 +1 -1
- package/dist/esm/zonos-elements.js +1 -1
- package/dist/esm/zonos-hello-dialog.entry.js +90 -26
- package/dist/esm/zonos-hello.entry.js +1 -1
- package/dist/esm/zonos-payment.entry.js +1 -1
- package/dist/esm-es5/cart-7961927b.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/sendErrorLog-4d9581da.js +1 -0
- package/dist/esm-es5/submitGtag-4c1f09dc.js +1 -0
- package/dist/esm-es5/zonos-address_4.entry.js +1 -1
- package/dist/esm-es5/zonos-card_2.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_10.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-elements.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-payment.entry.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/scripts/zonosBase.js +1 -1
- package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.arabic.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +36 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +36 -0
- package/dist/types/components/store/translationStore.d.ts +24 -1
- package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +7 -1
- package/dist/types/components/utils/api/getCountryLandedCost.d.ts +10 -1
- package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
- package/dist/types/components/utils/logging/getNavigatorConnection.d.ts +8 -0
- package/dist/types/components/utils/logging/sendLoadScriptLog.d.ts +4 -0
- package/dist/types/types/LogLoadScriptRequestBody.d.ts +12 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +1 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +91 -18
- package/dist/types/types/generated/graphql.customer.types.ts +132 -22
- package/dist/types/types/generated/graphql.frontend.types.d.ts +13 -3
- package/dist/types/types/generated/graphql.frontend.types.ts +23 -3
- package/dist/types/types/global.d.ts +1 -2
- package/dist/zonos-elements/assets/importIcon.svg +4 -0
- package/dist/zonos-elements/p-0bdac452.system.js +1 -0
- package/dist/zonos-elements/p-0c5d3595.js +1 -0
- package/dist/zonos-elements/{p-5d5c0fbf.entry.js → p-2191b884.entry.js} +1 -1
- package/dist/zonos-elements/{p-0082c5be.system.entry.js → p-2da8e12a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-67ff446b.system.entry.js → p-339c505b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ac5aecca.entry.js → p-33f5634a.entry.js} +1 -1
- package/dist/zonos-elements/{p-5f662cf2.entry.js → p-3eb402c8.entry.js} +1 -1
- package/dist/zonos-elements/p-431648d8.system.entry.js +1 -0
- package/dist/zonos-elements/p-44842b39.system.entry.js +1 -0
- package/dist/zonos-elements/{p-14a2824f.entry.js → p-44f4dd4b.entry.js} +1 -1
- package/dist/zonos-elements/{p-35c328ba.system.entry.js → p-4b3923d2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-30cd191f.entry.js → p-4eba3abe.entry.js} +1 -1
- package/dist/zonos-elements/p-5a3ceb49.entry.js +1 -0
- package/dist/zonos-elements/p-63775f6d.js +1 -0
- package/dist/zonos-elements/p-6e81adba.system.js +1 -1
- package/dist/zonos-elements/{p-5f6f0581.system.entry.js → p-7efb9c12.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-5dbb80df.system.entry.js → p-8eb876e8.system.entry.js} +1 -1
- package/dist/zonos-elements/p-a6c9c505.system.js +1 -0
- package/dist/zonos-elements/{p-c815e8b4.system.entry.js → p-bdb72353.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-499d7f5d.system.entry.js → p-d6aa3011.system.entry.js} +1 -1
- package/dist/zonos-elements/p-dd4f3724.system.js +1 -0
- package/dist/zonos-elements/{p-925ae524.entry.js → p-e1796e2a.entry.js} +1 -1
- package/dist/zonos-elements/{p-db1adc42.entry.js → p-e4919505.entry.js} +1 -1
- package/dist/zonos-elements/p-e4be7bd8.js +1 -0
- package/dist/zonos-elements/{p-7ff3a533.system.entry.js → p-e5fd850c.system.entry.js} +1 -1
- package/dist/zonos-elements/p-e90e2126.entry.js +1 -0
- package/dist/zonos-elements/{p-11f1b5fb.entry.js → p-f0b5d2fb.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/isCheckoutMobile-f491ca7c.js +0 -8
- package/dist/esm/isCheckoutMobile-8846dccb.js +0 -6
- package/dist/esm-es5/cart-228e1ef7.js +0 -1
- package/dist/esm-es5/isCheckoutMobile-8846dccb.js +0 -1
- package/dist/esm-es5/submitGtag-c3727595.js +0 -1
- package/dist/zonos-elements/p-0679e872.system.entry.js +0 -1
- package/dist/zonos-elements/p-09dbb0e9.entry.js +0 -1
- package/dist/zonos-elements/p-55940b5a.system.entry.js +0 -1
- package/dist/zonos-elements/p-770e5b9e.js +0 -1
- package/dist/zonos-elements/p-81a54668.js +0 -1
- package/dist/zonos-elements/p-94bbf247.system.js +0 -1
- package/dist/zonos-elements/p-960e4021.system.js +0 -1
- package/dist/zonos-elements/p-aed0098c.system.js +0 -1
- package/dist/zonos-elements/p-d11b2449.js +0 -1
- package/dist/zonos-elements/p-d31e5fcc.entry.js +0 -1
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
export const stringsVietnamese = {
|
|
2
|
+
'${percentage} GST due on any order above ${threshold} along with an import entry transaction fee and MPI levy.': {
|
|
3
|
+
value: '${percentage} GST phải trả cho bất kỳ đơn hàng nào trên ${threshold}, cùng với phí giao dịch nhập khẩu và thuế MPI.',
|
|
4
|
+
},
|
|
5
|
+
'${percentage} GST due on any order above ${threshold}.': {
|
|
6
|
+
value: '${percentage} GST phải trả cho bất kỳ đơn hàng nào trên ${threshold}.',
|
|
7
|
+
},
|
|
2
8
|
'Above de minimis threshold for': {
|
|
3
9
|
value: 'Vượt ngưỡng miễn thuế đối với',
|
|
4
10
|
},
|
|
5
11
|
Address: {
|
|
6
12
|
value: 'Địa chỉ',
|
|
7
13
|
},
|
|
14
|
+
'Address line 1': {
|
|
15
|
+
value: 'Dòng địa chỉ 1',
|
|
16
|
+
},
|
|
17
|
+
'Address line 2': {
|
|
18
|
+
value: 'Dòng địa chỉ 2',
|
|
19
|
+
},
|
|
8
20
|
Back: {
|
|
9
21
|
value: 'Quay lại',
|
|
10
22
|
},
|
|
@@ -14,12 +26,18 @@ export const stringsVietnamese = {
|
|
|
14
26
|
'Cart subtotal': {
|
|
15
27
|
value: 'Tổng giỏ hàng',
|
|
16
28
|
},
|
|
29
|
+
City: {
|
|
30
|
+
value: 'Thành phố',
|
|
31
|
+
},
|
|
17
32
|
Contact: {
|
|
18
33
|
value: 'Liên hệ',
|
|
19
34
|
},
|
|
20
35
|
'Continue to shipping': {
|
|
21
36
|
value: 'Tiếp tục đến vận chuyển',
|
|
22
37
|
},
|
|
38
|
+
Country: {
|
|
39
|
+
value: 'Quốc gia',
|
|
40
|
+
},
|
|
23
41
|
Customer: {
|
|
24
42
|
value: 'Khách hàng',
|
|
25
43
|
},
|
|
@@ -59,6 +77,9 @@ export const stringsVietnamese = {
|
|
|
59
77
|
'Know about duties and taxes before you buy. Shop with confidence!': {
|
|
60
78
|
value: 'Tìm hiểu về thuế và phí trước khi mua hàng. Mua sắm với sự tự tin!',
|
|
61
79
|
},
|
|
80
|
+
Name: {
|
|
81
|
+
value: 'Tên',
|
|
82
|
+
},
|
|
62
83
|
'No shipping method selected': {
|
|
63
84
|
value: 'Chưa chọn phương thức vận chuyển',
|
|
64
85
|
},
|
|
@@ -77,6 +98,9 @@ export const stringsVietnamese = {
|
|
|
77
98
|
'Order total': {
|
|
78
99
|
value: 'Tổng đơn hàng',
|
|
79
100
|
},
|
|
101
|
+
'Orders to ${countryName} must be over ${threshold} to ship.': {
|
|
102
|
+
value: 'Đơn hàng đến ${countryName} phải trên ${threshold} mới được gửi.',
|
|
103
|
+
},
|
|
80
104
|
Pay: {
|
|
81
105
|
value: 'Thanh toán',
|
|
82
106
|
},
|
|
@@ -98,6 +122,12 @@ export const stringsVietnamese = {
|
|
|
98
122
|
'Please ensure your text uses the Latin alphabet only (A-Z, a-z).': {
|
|
99
123
|
value: 'Vui lòng đảm bảo rằng văn bản của bạn chỉ sử dụng bảng chữ cái Latinh (A-Z, a-z).',
|
|
100
124
|
},
|
|
125
|
+
'Please resolve the following errors:': {
|
|
126
|
+
value: 'Vui lòng giải quyết các lỗi sau:',
|
|
127
|
+
},
|
|
128
|
+
'Postal code': {
|
|
129
|
+
value: 'Mã bưu điện',
|
|
130
|
+
},
|
|
101
131
|
'Powered by': {
|
|
102
132
|
value: 'Nền tảng cung cấp bởi',
|
|
103
133
|
},
|
|
@@ -140,6 +170,9 @@ export const stringsVietnamese = {
|
|
|
140
170
|
Spend: {
|
|
141
171
|
value: 'Chi tiêu',
|
|
142
172
|
},
|
|
173
|
+
State: {
|
|
174
|
+
value: 'Bang',
|
|
175
|
+
},
|
|
143
176
|
'Taxes will apply to all orders': {
|
|
144
177
|
value: 'Thuế sẽ áp dụng cho tất cả đơn hàng',
|
|
145
178
|
},
|
|
@@ -176,6 +209,9 @@ export const stringsVietnamese = {
|
|
|
176
209
|
'duty free': {
|
|
177
210
|
value: 'miễn thuế',
|
|
178
211
|
},
|
|
212
|
+
'only supports Latin characters (A-Z, a-z)': {
|
|
213
|
+
value: 'chỉ hỗ trợ ký tự Latinh (A-Z, a-z)',
|
|
214
|
+
},
|
|
179
215
|
'tax free': {
|
|
180
216
|
value: 'không chịu thuế',
|
|
181
217
|
},
|
|
@@ -86,8 +86,24 @@ const translationStoreUpdateLanguage = (language) => {
|
|
|
86
86
|
break;
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Translate a string with variables if variable pattern is present in the string
|
|
91
|
+
* @example
|
|
92
|
+
* // Require variables:
|
|
93
|
+
* translate('${percentage} GST due on any order above ${threshold}.', { percentage: '5%', threshold: '$100' })
|
|
94
|
+
* // No variables:
|
|
95
|
+
* translate('Above de minimis threshold for')
|
|
96
|
+
*/
|
|
97
|
+
const translate = (...[key, replacement]) => {
|
|
98
|
+
var _a, _b;
|
|
99
|
+
if (replacement) {
|
|
100
|
+
// replace all variables in the string
|
|
101
|
+
let translatedString = ((_a = translationStore.translatedChunks[key]) === null || _a === void 0 ? void 0 : _a.value) || key;
|
|
102
|
+
Object.entries(replacement).forEach(([replacementKey, replaceValue]) => {
|
|
103
|
+
translatedString = translatedString.replace(new RegExp(`\\$\\{${replacementKey}\\}`, 'g'), replaceValue);
|
|
104
|
+
});
|
|
105
|
+
return translatedString;
|
|
106
|
+
}
|
|
107
|
+
return ((_b = translationStore.translatedChunks[key]) === null || _b === void 0 ? void 0 : _b.value) || key;
|
|
92
108
|
};
|
|
93
109
|
export { translate, translationStore, translationStoreUpdateLanguage };
|
|
@@ -6,6 +6,16 @@ import { zonosStore } from "../../store/zonosStore";
|
|
|
6
6
|
import { isCheckoutMobile } from "../../utils/checkout/isCheckoutMobile";
|
|
7
7
|
import { containsNonLatinChars } from "../../utils/containsNonLatinChars";
|
|
8
8
|
import { logError } from "../../utils/logging/logError";
|
|
9
|
+
import { sendErrorLog } from "../../utils/logging/sendErrorLog";
|
|
10
|
+
const mappedFields = {
|
|
11
|
+
city: 'City',
|
|
12
|
+
country: 'Country',
|
|
13
|
+
line1: 'Address line 1',
|
|
14
|
+
line2: 'Address line 2',
|
|
15
|
+
name: 'Name',
|
|
16
|
+
postal_code: 'Postal code',
|
|
17
|
+
state: 'State',
|
|
18
|
+
};
|
|
9
19
|
/**
|
|
10
20
|
* This component is a wrapper for the stripe address element that would render default style object
|
|
11
21
|
*/
|
|
@@ -15,7 +25,8 @@ export class ZonosAddress {
|
|
|
15
25
|
this.titleText = undefined;
|
|
16
26
|
this.defaultAddress = null;
|
|
17
27
|
this.stripe = window.Zonos.stripe;
|
|
18
|
-
this.
|
|
28
|
+
this.reportedInvalidCharacters = false;
|
|
29
|
+
this.invalidCharacterList = null;
|
|
19
30
|
this.isDirtyAddress = false;
|
|
20
31
|
}
|
|
21
32
|
getStripeAddressInstance() {
|
|
@@ -41,13 +52,9 @@ export class ZonosAddress {
|
|
|
41
52
|
stripeStore.stripeAddressEventData = event;
|
|
42
53
|
break;
|
|
43
54
|
}
|
|
44
|
-
const
|
|
45
|
-
this.
|
|
46
|
-
this.
|
|
47
|
-
if (hasInvalidCharacters) {
|
|
48
|
-
// no need to prefetch landed cost if the address contains invalid characters
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
55
|
+
const invalidCharacterList = this.checkInvalidCharacters(event);
|
|
56
|
+
this.invalidCharacterList = invalidCharacterList;
|
|
57
|
+
this.invalidCharacters.emit(!!invalidCharacterList);
|
|
51
58
|
}
|
|
52
59
|
updateAddressElement({ stripeAddressElement, type, }) {
|
|
53
60
|
if (type === 'shipping') {
|
|
@@ -60,7 +67,7 @@ export class ZonosAddress {
|
|
|
60
67
|
// Do nothing if the allowed character sets is ALL or the address is incomplete
|
|
61
68
|
if (!address.complete ||
|
|
62
69
|
zonosStore.checkoutSettings.allowedCharacterSets === 'ALL') {
|
|
63
|
-
return
|
|
70
|
+
return null;
|
|
64
71
|
}
|
|
65
72
|
const { address: addressValue, firstName, lastName, name } = address.value;
|
|
66
73
|
const { city, country, line1, line2, postal_code, state } = addressValue;
|
|
@@ -73,11 +80,29 @@ export class ZonosAddress {
|
|
|
73
80
|
postal_code,
|
|
74
81
|
state,
|
|
75
82
|
});
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
if (!Object.keys(invalidList).length) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
// send error event only once so we know what value is invalid
|
|
87
|
+
if (!this.reportedInvalidCharacters) {
|
|
88
|
+
this.reportedInvalidCharacters = true;
|
|
89
|
+
void sendErrorLog({
|
|
90
|
+
endpoint: 'NonLatinInput',
|
|
91
|
+
errors: Object.keys(invalidList).map(fieldName => {
|
|
92
|
+
var _a;
|
|
93
|
+
if (fieldName !== 'name') {
|
|
94
|
+
// trim all number so we don't send sensitive information
|
|
95
|
+
const trimmedAddress = (_a = addressValue[fieldName]) === null || _a === void 0 ? void 0 : _a.replace(/[\d\w]+/g, '');
|
|
96
|
+
return `Invalid character found ${fieldName}: "${trimmedAddress}"`;
|
|
97
|
+
}
|
|
98
|
+
const customerName = name || `${firstName} ${lastName}`;
|
|
99
|
+
const trimmedName = customerName.replace(/[\d\w]+/g, '');
|
|
100
|
+
return `Invalid character found ${fieldName}: "${trimmedName}"`;
|
|
101
|
+
}),
|
|
102
|
+
metadata: {},
|
|
103
|
+
});
|
|
79
104
|
}
|
|
80
|
-
return
|
|
105
|
+
return invalidList;
|
|
81
106
|
}
|
|
82
107
|
async watchInitStripe() {
|
|
83
108
|
var _a, _b;
|
|
@@ -176,7 +201,7 @@ export class ZonosAddress {
|
|
|
176
201
|
}
|
|
177
202
|
render() {
|
|
178
203
|
// this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
|
|
179
|
-
return (h(Host, { key: '
|
|
204
|
+
return (h(Host, { key: 'b1ad2f6c9c23e6411bf1adccdd34b3aa4f5250b1', class: "zonos--address zonos--elements" }, h("zonos-text", { key: '786a733a44925a670393b72bf0ae3db5ba59f9a1', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("div", { key: 'b9d58cbc17abf5daf5d13ffdebc7485c3ac6457d', class: "zonos--address-component" }), this.invalidCharacterList && (h("zonos-banner", { bannerTitle: translate('Please resolve the following errors:'), intent: "error" }, Object.keys(this.invalidCharacterList).map(fieldName => (h("zonos-text", null, `- ${translate(mappedFields[fieldName])}: ${translate('only supports Latin characters (A-Z, a-z)')}`)))))));
|
|
180
205
|
}
|
|
181
206
|
static get is() { return "zonos-address"; }
|
|
182
207
|
static get encapsulation() { return "scoped"; }
|
|
@@ -253,7 +278,8 @@ export class ZonosAddress {
|
|
|
253
278
|
static get states() {
|
|
254
279
|
return {
|
|
255
280
|
"stripe": {},
|
|
256
|
-
"
|
|
281
|
+
"reportedInvalidCharacters": {},
|
|
282
|
+
"invalidCharacterList": {},
|
|
257
283
|
"isDirtyAddress": {}
|
|
258
284
|
};
|
|
259
285
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const getNavigatorConnection = () => {
|
|
2
|
+
const connection = 'connection' in window.navigator
|
|
3
|
+
? // connection is not yet supported in all browsers
|
|
4
|
+
window.navigator.connection
|
|
5
|
+
: null;
|
|
6
|
+
const mozConnection = 'mozConnection' in window.navigator
|
|
7
|
+
? // mozConnection is not yet supported in all browsers
|
|
8
|
+
window.navigator.mozConnection
|
|
9
|
+
: null;
|
|
10
|
+
const webkitConnection = 'webkitConnection' in window.navigator
|
|
11
|
+
? // webkitConnection is not yet supported in all browsers
|
|
12
|
+
window.navigator.webkitConnection
|
|
13
|
+
: null;
|
|
14
|
+
const baseConnection = connection || mozConnection || webkitConnection;
|
|
15
|
+
return baseConnection;
|
|
16
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { handleFetch } from "../handleFetch";
|
|
2
|
+
import { getNavigatorConnection } from "./getNavigatorConnection";
|
|
3
|
+
export const sendLoadScriptLog = async (params) => {
|
|
4
|
+
const userAgentData = 'userAgentData' in window.navigator
|
|
5
|
+
? // userAgentData is not yet supported in all browsers
|
|
6
|
+
window.navigator.userAgentData
|
|
7
|
+
: null;
|
|
8
|
+
const baseConnection = getNavigatorConnection();
|
|
9
|
+
const scriptLoadLogBody = Object.assign(Object.assign({ href: window.location.href }, params), { metadata: Object.assign({ connectionDownlink: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.downlink, connectionEffectiveType: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.effectiveType, connectionRtt: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.rtt, connectionSaveData: baseConnection === null || baseConnection === void 0 ? void 0 : baseConnection.saveData, userAgent: userAgentData && userAgentData.brands.length > 0
|
|
10
|
+
? userAgentData
|
|
11
|
+
: window.navigator.userAgent }, params.metadata) });
|
|
12
|
+
void handleFetch(`${process.env.NEXT_PUBLIC_ZONOS_ROUTE_URL}/api/zonos-elements/log-script-load`, {
|
|
13
|
+
body: scriptLoadLogBody,
|
|
14
|
+
method: 'POST',
|
|
15
|
+
});
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,6 +2,16 @@ export const accountHolderType = {
|
|
|
2
2
|
Company: 'COMPANY',
|
|
3
3
|
Individual: 'INDIVIDUAL',
|
|
4
4
|
};
|
|
5
|
+
export const accountingFeeType = {
|
|
6
|
+
BugFix: 'BUG_FIX',
|
|
7
|
+
DutyTaxFee: 'DUTY_TAX_FEE',
|
|
8
|
+
General: 'GENERAL',
|
|
9
|
+
Item: 'ITEM',
|
|
10
|
+
LandedCostGuarantee: 'LANDED_COST_GUARANTEE',
|
|
11
|
+
MerchantProcessing: 'MERCHANT_PROCESSING',
|
|
12
|
+
Shipping: 'SHIPPING',
|
|
13
|
+
Transaction: 'TRANSACTION',
|
|
14
|
+
};
|
|
5
15
|
export const addressMatchThreshold = {
|
|
6
16
|
ExactAdministrativeArea: 'EXACT_ADMINISTRATIVE_AREA',
|
|
7
17
|
ExactCountry: 'EXACT_COUNTRY',
|
|
@@ -17,10 +27,23 @@ export const addressResult = {
|
|
|
17
27
|
Unavailable: 'UNAVAILABLE',
|
|
18
28
|
Valid: 'VALID',
|
|
19
29
|
};
|
|
30
|
+
export const adjustmentRecordType = {
|
|
31
|
+
ConnectAccountAdjustment: 'CONNECT_ACCOUNT_ADJUSTMENT',
|
|
32
|
+
CreditNote: 'CREDIT_NOTE',
|
|
33
|
+
InvoiceLineRecord: 'INVOICE_LINE_RECORD',
|
|
34
|
+
};
|
|
35
|
+
export const adjustmentType = {
|
|
36
|
+
Charge: 'CHARGE',
|
|
37
|
+
Credit: 'CREDIT',
|
|
38
|
+
};
|
|
20
39
|
export const alcoholRecipientType = {
|
|
21
40
|
Consumer: 'CONSUMER',
|
|
22
41
|
Licensee: 'LICENSEE',
|
|
23
42
|
};
|
|
43
|
+
export const allowedCharacterSets = {
|
|
44
|
+
All: 'ALL',
|
|
45
|
+
Latin: 'LATIN',
|
|
46
|
+
};
|
|
24
47
|
export const analyticsProviderStatus = {
|
|
25
48
|
Disabled: 'DISABLED',
|
|
26
49
|
Enabled: 'ENABLED',
|
|
@@ -169,6 +192,10 @@ export const catalogItemSource = {
|
|
|
169
192
|
LegacyMigration: 'LEGACY_MIGRATION',
|
|
170
193
|
UserProvided: 'USER_PROVIDED',
|
|
171
194
|
};
|
|
195
|
+
export const catalogSettingMigrationAction = {
|
|
196
|
+
Evaluate: 'EVALUATE',
|
|
197
|
+
Migrate: 'MIGRATE',
|
|
198
|
+
};
|
|
172
199
|
export const catalogStatus = {
|
|
173
200
|
Disabled: 'DISABLED',
|
|
174
201
|
Enabled: 'ENABLED',
|
|
@@ -743,16 +770,8 @@ export const credentialProvider = {
|
|
|
743
770
|
};
|
|
744
771
|
export const creditBehaviorTypeCode = {
|
|
745
772
|
CreditAccount: 'CREDIT_ACCOUNT',
|
|
746
|
-
CreditInvoice: 'CREDIT_INVOICE',
|
|
747
773
|
RefundPayment: 'REFUND_PAYMENT',
|
|
748
774
|
};
|
|
749
|
-
export const creditNoteStatusCode = {
|
|
750
|
-
Failed: 'FAILED',
|
|
751
|
-
Issued: 'ISSUED',
|
|
752
|
-
Pending: 'PENDING',
|
|
753
|
-
Processed: 'PROCESSED',
|
|
754
|
-
Voided: 'VOIDED',
|
|
755
|
-
};
|
|
756
775
|
export const creditReasonTypeCode = {
|
|
757
776
|
Duplicate: 'DUPLICATE',
|
|
758
777
|
Fraudulent: 'FRAUDULENT',
|
|
@@ -1194,6 +1213,10 @@ export const inclusivePriceSettingStatus = {
|
|
|
1194
1213
|
Disabled: 'DISABLED',
|
|
1195
1214
|
Enabled: 'ENABLED',
|
|
1196
1215
|
};
|
|
1216
|
+
export const inclusivePriceStatus = {
|
|
1217
|
+
Active: 'ACTIVE',
|
|
1218
|
+
Inactive: 'INACTIVE',
|
|
1219
|
+
};
|
|
1197
1220
|
export const incotermCode = {
|
|
1198
1221
|
Cif: 'CIF',
|
|
1199
1222
|
Custom: 'CUSTOM',
|
|
@@ -1252,17 +1275,16 @@ export const invoiceLanguageCode = {
|
|
|
1252
1275
|
ZhHk: 'ZH_HK',
|
|
1253
1276
|
ZhTw: 'ZH_TW',
|
|
1254
1277
|
};
|
|
1255
|
-
export const invoiceLineRecordStatusCode = {
|
|
1256
|
-
Failed: 'FAILED',
|
|
1257
|
-
Pending: 'PENDING',
|
|
1258
|
-
Processed: 'PROCESSED',
|
|
1259
|
-
Voided: 'VOIDED',
|
|
1260
|
-
};
|
|
1261
1278
|
export const invoiceStatus = {
|
|
1262
1279
|
Received: 'RECEIVED',
|
|
1263
1280
|
Reconciled: 'RECONCILED',
|
|
1264
1281
|
Voided: 'VOIDED',
|
|
1265
1282
|
};
|
|
1283
|
+
export const itemKeyPreference = {
|
|
1284
|
+
None: 'NONE',
|
|
1285
|
+
ProductId: 'PRODUCT_ID',
|
|
1286
|
+
Sku: 'SKU',
|
|
1287
|
+
};
|
|
1266
1288
|
export const itemMeasurementType = {
|
|
1267
1289
|
Height: 'HEIGHT',
|
|
1268
1290
|
Length: 'LENGTH',
|
|
@@ -1521,6 +1543,13 @@ export const lcgBillingMethod = {
|
|
|
1521
1543
|
BillingDgs: 'BILLING_DGS',
|
|
1522
1544
|
Legacy: 'LEGACY',
|
|
1523
1545
|
};
|
|
1546
|
+
export const manualClassificationBulkJobStatus = {
|
|
1547
|
+
Completed: 'COMPLETED',
|
|
1548
|
+
Error: 'ERROR',
|
|
1549
|
+
Initialized: 'INITIALIZED',
|
|
1550
|
+
ManuallyClassified: 'MANUALLY_CLASSIFIED',
|
|
1551
|
+
Processing: 'PROCESSING',
|
|
1552
|
+
};
|
|
1524
1553
|
export const manualClassificationRequestCreateStatus = {
|
|
1525
1554
|
Created: 'CREATED',
|
|
1526
1555
|
Existing: 'EXISTING',
|
|
@@ -1656,6 +1685,14 @@ export const pddpAmountType = {
|
|
|
1656
1685
|
ShoppingCartValue: 'SHOPPING_CART_VALUE',
|
|
1657
1686
|
SurchargeValue: 'SURCHARGE_VALUE',
|
|
1658
1687
|
};
|
|
1688
|
+
export const pddpCountrySpecStatus = {
|
|
1689
|
+
Active: 'ACTIVE',
|
|
1690
|
+
Disabled: 'DISABLED',
|
|
1691
|
+
};
|
|
1692
|
+
export const pddpStatus = {
|
|
1693
|
+
Active: 'ACTIVE',
|
|
1694
|
+
Disabled: 'DISABLED',
|
|
1695
|
+
};
|
|
1659
1696
|
export const pickupBuildingType = {
|
|
1660
1697
|
Apartment: 'APARTMENT',
|
|
1661
1698
|
Building: 'BUILDING',
|
|
@@ -1675,6 +1712,12 @@ export const pickupCategory = {
|
|
|
1675
1712
|
SameDay: 'SAME_DAY',
|
|
1676
1713
|
SameDayCity: 'SAME_DAY_CITY',
|
|
1677
1714
|
};
|
|
1715
|
+
export const processingStatusCode = {
|
|
1716
|
+
Failed: 'FAILED',
|
|
1717
|
+
Pending: 'PENDING',
|
|
1718
|
+
Processed: 'PROCESSED',
|
|
1719
|
+
Voided: 'VOIDED',
|
|
1720
|
+
};
|
|
1678
1721
|
export const propertyType = {
|
|
1679
1722
|
Commercial: 'COMMERCIAL',
|
|
1680
1723
|
Residental: 'RESIDENTAL',
|
|
@@ -1834,6 +1877,10 @@ export const stripePriceBillingScheme = {
|
|
|
1834
1877
|
PerUnit: 'PER_UNIT',
|
|
1835
1878
|
Tiered: 'TIERED',
|
|
1836
1879
|
};
|
|
1880
|
+
export const stripePriceType = {
|
|
1881
|
+
OneTime: 'ONE_TIME',
|
|
1882
|
+
Recurring: 'RECURRING',
|
|
1883
|
+
};
|
|
1837
1884
|
export const stripeSubscriptionStatus = {
|
|
1838
1885
|
Active: 'ACTIVE',
|
|
1839
1886
|
Canceled: 'CANCELED',
|
|
@@ -2020,6 +2067,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
2020
2067
|
GetOrders(variables, requestHeaders) {
|
|
2021
2068
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'GetOrders', 'query');
|
|
2022
2069
|
},
|
|
2070
|
+
GetTaxIdByCountry(variables, requestHeaders) {
|
|
2071
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'GetTaxIdByCountry', 'query');
|
|
2072
|
+
},
|
|
2023
2073
|
OnlineStoreSettings(variables, requestHeaders) {
|
|
2024
2074
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'OnlineStoreSettings', 'query');
|
|
2025
2075
|
},
|
|
@@ -38,6 +38,7 @@ export const featureAudienceNameEnum = {
|
|
|
38
38
|
FrontendEngineer: 'frontend_engineer',
|
|
39
39
|
I18nKnownLanguage: 'i18n_known_language',
|
|
40
40
|
I18nSales: 'i18n_sales',
|
|
41
|
+
ItHead: 'it_head',
|
|
41
42
|
NewCheckoutMerchant: 'new_checkout_merchant',
|
|
42
43
|
Onboarding: 'onboarding',
|
|
43
44
|
PrincipalEngineer: 'principal_engineer',
|
|
@@ -442,6 +443,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
|
|
|
442
443
|
CreateErrorEvent(variables, requestHeaders) {
|
|
443
444
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'CreateErrorEvent', 'mutation');
|
|
444
445
|
},
|
|
446
|
+
CreateScriptLoadEvent(variables, requestHeaders) {
|
|
447
|
+
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'CreateScriptLoadEvent', 'mutation');
|
|
448
|
+
},
|
|
445
449
|
DeleteAllStoreReserveOrders(variables, requestHeaders) {
|
|
446
450
|
return withWrapper(wrappedRequestHeaders => client.request('', variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'DeleteAllStoreReserveOrders', 'mutation');
|
|
447
451
|
},
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { h as handleFetch } from './stripe.js';
|
|
2
|
+
|
|
3
|
+
const sendErrorLog = async ({ endpoint, errors, metadata }) => {
|
|
4
|
+
const userAgentData = 'userAgentData' in window.navigator
|
|
5
|
+
? // userAgentData is not yet supported in all browsers
|
|
6
|
+
window.navigator.userAgentData
|
|
7
|
+
: null;
|
|
8
|
+
const errorObject = {
|
|
9
|
+
endpoint,
|
|
10
|
+
errors,
|
|
11
|
+
metadata: Object.assign({ href: window.location.href, userAgent: userAgentData && userAgentData.brands.length > 0
|
|
12
|
+
? userAgentData
|
|
13
|
+
: window.navigator.userAgent }, metadata),
|
|
14
|
+
};
|
|
15
|
+
void handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/log-error`, {
|
|
16
|
+
body: errorObject,
|
|
17
|
+
method: 'POST',
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { sendErrorLog as s };
|