@zonos/elements 1.3.12-alpha.7 → 1.3.12-alpha.8
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-fe91535c.js → cart-37e23be9.js} +199 -3
- package/dist/cjs/{sendErrorLog-fb356701.js → sendErrorLog-7b3d82e4.js} +1 -1
- package/dist/cjs/{submitGtag-62c97f6b.js → submitGtag-d0718b63.js} +1 -1
- package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-card_2.cjs.entry.js +1 -1
- package/dist/cjs/zonos-cart-items_10.cjs.entry.js +3 -3
- package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
- 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-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 +9 -0
- package/dist/collection/components/store/translationStore/strings.base.js +9 -0
- package/dist/collection/components/store/translationStore/strings.chinese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.danish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.dutch.js +9 -0
- package/dist/collection/components/store/translationStore/strings.french.js +9 -0
- package/dist/collection/components/store/translationStore/strings.german.js +9 -0
- package/dist/collection/components/store/translationStore/strings.hebrew.js +9 -0
- package/dist/collection/components/store/translationStore/strings.indonesian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.italian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.japanese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.korean.js +9 -0
- package/dist/collection/components/store/translationStore/strings.norwegian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.polish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.portuguese.js +9 -0
- package/dist/collection/components/store/translationStore/strings.russian.js +9 -0
- package/dist/collection/components/store/translationStore/strings.spanish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.swedish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.turkish.js +9 -0
- package/dist/collection/components/store/translationStore/strings.vietnamese.js +9 -0
- package/dist/collection/components/store/translationStore.js +19 -3
- package/dist/collection/types/generated/graphql.customer.types.js +3 -0
- package/dist/components/stripe.js +199 -3
- package/dist/components/zonos-hello-dialog2.js +89 -25
- package/dist/esm/{cart-53f5c10c.js → cart-7961927b.js} +199 -3
- package/dist/esm/{sendErrorLog-1c2f093d.js → sendErrorLog-4d9581da.js} +1 -1
- package/dist/esm/{submitGtag-d2658ed5.js → submitGtag-4c1f09dc.js} +1 -1
- package/dist/esm/zonos-address_4.entry.js +2 -2
- 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-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/{sendErrorLog-1c2f093d.js → sendErrorLog-4d9581da.js} +1 -1
- package/dist/esm-es5/{submitGtag-d2658ed5.js → submitGtag-4c1f09dc.js} +1 -1
- 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-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 +9 -0
- package/dist/types/components/store/translationStore/strings.base.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.chinese.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.danish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.dutch.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.french.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.german.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.hebrew.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.indonesian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.italian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.japanese.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.korean.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.norwegian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.polish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.portuguese.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.russian.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.spanish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.swedish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.turkish.d.ts +9 -0
- package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +9 -0
- package/dist/types/components/store/translationStore.d.ts +24 -1
- package/dist/types/components/utils/api/getCountryLandedCost.d.ts +10 -1
- package/dist/types/types/generated/graphql.customer.types.d.ts +16 -0
- package/dist/types/types/generated/graphql.customer.types.ts +28 -0
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/assets/importIcon.svg +4 -0
- package/dist/zonos-elements/p-0bdac452.system.js +1 -0
- package/dist/zonos-elements/{p-beb55ff1.js → p-0c5d3595.js} +1 -1
- package/dist/zonos-elements/{p-6f6850aa.entry.js → p-2191b884.entry.js} +1 -1
- package/dist/zonos-elements/{p-c30554b1.system.entry.js → p-2da8e12a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0cc5cfbd.system.entry.js → p-339c505b.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-969f36b3.entry.js → p-33f5634a.entry.js} +1 -1
- package/dist/zonos-elements/{p-7e6bc603.entry.js → p-3eb402c8.entry.js} +1 -1
- package/dist/zonos-elements/{p-9f4b0222.system.entry.js → p-431648d8.system.entry.js} +1 -1
- package/dist/zonos-elements/p-44842b39.system.entry.js +1 -0
- package/dist/zonos-elements/{p-df6fd81f.entry.js → p-44f4dd4b.entry.js} +1 -1
- package/dist/zonos-elements/{p-09d7a0f8.system.entry.js → p-4b3923d2.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-af17ec7f.entry.js → p-4eba3abe.entry.js} +1 -1
- package/dist/zonos-elements/p-5a3ceb49.entry.js +1 -0
- package/dist/zonos-elements/{p-bc25e1aa.js → p-63775f6d.js} +1 -1
- package/dist/zonos-elements/p-6e81adba.system.js +1 -1
- package/dist/zonos-elements/{p-fd7ab92d.system.entry.js → p-7efb9c12.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-ac576bd7.system.entry.js → p-8eb876e8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d24296a6.system.js → p-a6c9c505.system.js} +1 -1
- package/dist/zonos-elements/{p-e9732f93.system.entry.js → p-bdb72353.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-b6c83e0b.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-bece7adb.entry.js → p-e1796e2a.entry.js} +1 -1
- package/dist/zonos-elements/{p-ff32ea53.entry.js → p-e4919505.entry.js} +1 -1
- package/dist/zonos-elements/p-e4be7bd8.js +1 -0
- package/dist/zonos-elements/{p-ea1afd2d.system.entry.js → p-e5fd850c.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-19dbd8c2.entry.js → p-e90e2126.entry.js} +1 -1
- package/dist/zonos-elements/{p-125043b5.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/esm-es5/cart-53f5c10c.js +0 -1
- package/dist/zonos-elements/p-176f65e1.system.entry.js +0 -1
- package/dist/zonos-elements/p-3555ce7c.system.js +0 -1
- package/dist/zonos-elements/p-4cc4aba3.system.js +0 -1
- package/dist/zonos-elements/p-aa46e052.js +0 -1
- package/dist/zonos-elements/p-ecc72526.entry.js +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as registerInstance, a as getAssetPath, h, H as Host, F as Fragment, c as createEvent, d as getElement } from './index-dd40cc85.js';
|
|
2
|
-
import { f as cartStore, t as translate, r as handleFetch, q as stripeStoreReset, j as stripeStore, C as stripeStoreRetrievePayment, l as localizationStore, D as cartStoreUpdateSelectedShippingOption, E as cartStoreGetShippingTransitInfo } from './cart-
|
|
2
|
+
import { f as cartStore, t as translate, r as handleFetch, q as stripeStoreReset, j as stripeStore, C as stripeStoreRetrievePayment, l as localizationStore, D as cartStoreUpdateSelectedShippingOption, E as cartStoreGetShippingTransitInfo } from './cart-7961927b.js';
|
|
3
3
|
import { z as zonosStore, d as zonosStoreFontFamily } from './zonosStore-c4c45591.js';
|
|
4
|
-
import { t as trackConversionEvent, s as submitGtag, c as createCustomEvent } from './submitGtag-
|
|
4
|
+
import { t as trackConversionEvent, s as submitGtag, c as createCustomEvent } from './submitGtag-4c1f09dc.js';
|
|
5
5
|
import { g as getBorderRadius } from './getBorderRadius-a89e45fb.js';
|
|
6
|
-
import { s as sendErrorLog, i as isCheckoutMobile } from './sendErrorLog-
|
|
6
|
+
import { s as sendErrorLog, i as isCheckoutMobile } from './sendErrorLog-4d9581da.js';
|
|
7
7
|
import { c as classes } from './classes-0d95c529.js';
|
|
8
8
|
import { l as languages } from './ILanguage-97790bee.js';
|
|
9
9
|
import { t as tinycolor, i as isDarkColor } from './isDarkColor-6bf71e51.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as registerInstance, h, F as Fragment, H as Host } from './index-dd40cc85.js';
|
|
2
|
-
import { l as localizationStore, a as log, s as stripeStoreGetDomesticShippingSession, b as localizationStoreUpdateSelectedCountryCode, c as stripeStoreCleanupDomesticShippingSession, d as logError, e as stripeStoreSaveDomesticShippingSession, i as initStripeElements, f as cartStore, g as cartStoreUpdateItems, h as cartStoreReset, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreUpdateToErrorState, n as stripeStorePrefetchLandedCost, o as cartStoreNextStep, p as stripeStoreConfirmPayment, q as stripeStoreReset
|
|
2
|
+
import { l as localizationStore, a as log, s as stripeStoreGetDomesticShippingSession, b as localizationStoreUpdateSelectedCountryCode, c as stripeStoreCleanupDomesticShippingSession, d as logError, e as stripeStoreSaveDomesticShippingSession, i as initStripeElements, f as cartStore, g as cartStoreUpdateItems, h as cartStoreReset, j as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreUpdateToErrorState, t as translate, n as stripeStorePrefetchLandedCost, o as cartStoreNextStep, p as stripeStoreConfirmPayment, q as stripeStoreReset } from './cart-7961927b.js';
|
|
3
3
|
import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-c4c45591.js';
|
|
4
|
-
import { c as createCustomEvent, s as submitGtag, t as trackConversionEvent } from './submitGtag-
|
|
5
|
-
import { s as sendErrorLog, i as isCheckoutMobile } from './sendErrorLog-
|
|
4
|
+
import { c as createCustomEvent, s as submitGtag, t as trackConversionEvent } from './submitGtag-4c1f09dc.js';
|
|
5
|
+
import { s as sendErrorLog, i as isCheckoutMobile } from './sendErrorLog-4d9581da.js';
|
|
6
6
|
import { c as classes } from './classes-0d95c529.js';
|
|
7
7
|
import { g as getBorderRadius } from './getBorderRadius-a89e45fb.js';
|
|
8
8
|
import { i as isDarkColor } from './isDarkColor-6bf71e51.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-dd40cc85.js';
|
|
2
|
-
import { r as handleFetch, d as logError, u as isValidSelector, a as log, j as stripeStore, v as initLocalizationStore, b as localizationStoreUpdateSelectedCountryCode } from './cart-
|
|
2
|
+
import { r as handleFetch, d as logError, u as isValidSelector, a as log, j as stripeStore, v as initLocalizationStore, b as localizationStoreUpdateSelectedCountryCode } from './cart-7961927b.js';
|
|
3
3
|
import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-c4c45591.js';
|
|
4
4
|
import './isDarkColor-6bf71e51.js';
|
|
5
5
|
import './getBorderRadius-a89e45fb.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-dd40cc85.js';
|
|
2
|
-
import { l as localizationStore } from './cart-
|
|
2
|
+
import { l as localizationStore } from './cart-7961927b.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-c4c45591.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import './isDarkColor-6bf71e51.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-dd40cc85.js';
|
|
2
|
-
import { b as localizationStoreUpdateSelectedCountryCode, l as localizationStore } from './cart-
|
|
2
|
+
import { b as localizationStoreUpdateSelectedCountryCode, l as localizationStore } from './cart-7961927b.js';
|
|
3
3
|
import { d as zonosStoreFontFamily } from './zonosStore-c4c45591.js';
|
|
4
4
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
5
5
|
import { i as isDarkColor } from './isDarkColor-6bf71e51.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host } from './index-dd40cc85.js';
|
|
2
|
-
import { B as currencyFormat, l as localizationStore, t as translate } from './cart-
|
|
2
|
+
import { B as currencyFormat, l as localizationStore, t as translate } from './cart-7961927b.js';
|
|
3
3
|
import { z as zonosStore } from './zonosStore-c4c45591.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import { f as formatStringWithLinks } from './formatStringWithLinks-9e819405.js';
|
|
@@ -19,6 +19,12 @@ const BagIcon = `<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xml
|
|
|
19
19
|
</svg>
|
|
20
20
|
`;
|
|
21
21
|
|
|
22
|
+
const ImportIcon = `<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
23
|
+
<path d="M9.35028 11.5744C9.05738 11.2815 8.58251 11.2815 8.28962 11.5744C7.99672 11.8673 7.99672 12.3422 8.28962 12.635L11.2917 15.6372C11.6823 16.0277 12.3154 16.0277 12.7059 15.6372L15.708 12.6351C16.0009 12.3422 16.0009 11.8674 15.708 11.5745C15.4151 11.2816 14.9402 11.2816 14.6473 11.5745L12.7488 13.4729V4.68005C12.7488 4.26584 12.413 3.93005 11.9988 3.93005C11.5846 3.93005 11.2488 4.26584 11.2488 4.68005L11.2488 13.4729L9.35028 11.5744Z" fill="#4D505A"/>
|
|
24
|
+
<path d="M20 14C20 13.5858 19.6642 13.25 19.25 13.25C18.8358 13.25 18.5 13.5858 18.5 14L18.5 17.25C18.5 17.9404 17.9404 18.5 17.25 18.5L6.75 18.5C6.05964 18.5 5.5 17.9404 5.5 17.25L5.5 14C5.5 13.5858 5.16421 13.25 4.75 13.25C4.33579 13.25 4 13.5858 4 14V17.25C4 18.7688 5.23122 20 6.75 20H17.25C18.7688 20 20 18.7688 20 17.25L20 14Z" fill="#4D505A"/>
|
|
25
|
+
</svg>
|
|
26
|
+
`;
|
|
27
|
+
|
|
22
28
|
const MessageIcon = `<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">
|
|
23
29
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>
|
|
24
30
|
</svg>
|
|
@@ -63,6 +69,81 @@ const ZonosHelloDialog = class {
|
|
|
63
69
|
this.setShowLanguageSelect = async (value) => {
|
|
64
70
|
this.showLanguageSelect = value;
|
|
65
71
|
};
|
|
72
|
+
this.getDutyMessage = () => {
|
|
73
|
+
const { countryLandedCost } = localizationStore;
|
|
74
|
+
// Our Robby API spells deminimis wrong here
|
|
75
|
+
const dutyDeminimis = (countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.dutyDeminimus)
|
|
76
|
+
? currencyFormat(countryLandedCost.dutyDeminimus)
|
|
77
|
+
: null;
|
|
78
|
+
// If Canada, use 40 CAD (courier duty de minimis)
|
|
79
|
+
const dutyDeminimisToUse = localizationStore.selectedCountryCode === 'CA'
|
|
80
|
+
? currencyFormat(40)
|
|
81
|
+
: dutyDeminimis;
|
|
82
|
+
// If deminimis is undefined or null, assume it's $0
|
|
83
|
+
return dutyDeminimisToUse
|
|
84
|
+
? `${translate('Spend')} ${dutyDeminimisToUse} ${translate('duty free')}`
|
|
85
|
+
: translate('Duties will apply to all orders');
|
|
86
|
+
};
|
|
87
|
+
this.getTaxMessage = () => {
|
|
88
|
+
const { countryLandedCost } = localizationStore;
|
|
89
|
+
// Our Robby API spells deminimis wrong here
|
|
90
|
+
const taxDeminimis = (countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.vatTaxDeminimus)
|
|
91
|
+
? currencyFormat(countryLandedCost.vatTaxDeminimus)
|
|
92
|
+
: null;
|
|
93
|
+
// If Canada, use 150 CAD (courier tax de minimis)
|
|
94
|
+
const taxDeminimisToUse = localizationStore.selectedCountryCode === 'CA'
|
|
95
|
+
? currencyFormat(150)
|
|
96
|
+
: taxDeminimis;
|
|
97
|
+
return taxDeminimisToUse
|
|
98
|
+
? `${translate('Spend')} ${taxDeminimisToUse} ${translate('tax free')}`
|
|
99
|
+
: translate('Taxes will apply to all orders');
|
|
100
|
+
};
|
|
101
|
+
this.getUkDutyTaxMessage = (landedCost) => {
|
|
102
|
+
if (landedCost.allowLowValueOrders) {
|
|
103
|
+
// show nothing if low value orders are allowed
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
const dutyDeminimis = landedCost.dutyDeminimus;
|
|
107
|
+
return translate('Orders to ${countryName} must be over ${threshold} to ship.', {
|
|
108
|
+
countryName: 'United Kingdom',
|
|
109
|
+
threshold: currencyFormat(dutyDeminimis),
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
this.getAustraliaDutyTaxMessage = (landedCost) => {
|
|
113
|
+
return translate('${percentage} GST due on any order above ${threshold}.', {
|
|
114
|
+
percentage: `${landedCost.vatTaxRate * 100}%`,
|
|
115
|
+
threshold: currencyFormat(landedCost.vatTaxDeminimus),
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
this.getNewZealandDutyTaxMessge = (landedCost) => {
|
|
119
|
+
return translate('${percentage} GST due on any order above ${threshold} along with an import entry transaction fee and MPI levy.', {
|
|
120
|
+
percentage: `${landedCost.vatTaxRate * 100}%`,
|
|
121
|
+
threshold: currencyFormat(landedCost.vatTaxDeminimus),
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Get additional duty tax message if selected country has tax id
|
|
126
|
+
*/
|
|
127
|
+
this.getAdditionalDutyTaxMessage = () => {
|
|
128
|
+
if (!localizationStore.countryLandedCost) {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
// only show the message if the store has a tax id for selected country
|
|
132
|
+
if (!localizationStore.countryLandedCost.hasTaxId) {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
switch (localizationStore.countryLandedCost.countryCode) {
|
|
136
|
+
case 'GB':
|
|
137
|
+
return this.getUkDutyTaxMessage(localizationStore.countryLandedCost);
|
|
138
|
+
case 'AU':
|
|
139
|
+
return this.getAustraliaDutyTaxMessage(localizationStore.countryLandedCost);
|
|
140
|
+
case 'NZ':
|
|
141
|
+
return this.getNewZealandDutyTaxMessge(localizationStore.countryLandedCost);
|
|
142
|
+
default:
|
|
143
|
+
// show nothing
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
66
147
|
this.isOpen = false;
|
|
67
148
|
this.setIsOpen = () => { };
|
|
68
149
|
this.mobileLocationOverride = undefined;
|
|
@@ -84,30 +165,13 @@ const ZonosHelloDialog = class {
|
|
|
84
165
|
}
|
|
85
166
|
render() {
|
|
86
167
|
var _a;
|
|
87
|
-
const {
|
|
88
|
-
//
|
|
89
|
-
const
|
|
90
|
-
? currencyFormat(countryLandedCost.dutyDeminimus)
|
|
91
|
-
: null;
|
|
92
|
-
// If Canada, use 40 CAD (courier duty de minimis)
|
|
93
|
-
const dutyDeminimisToUse = localizationStore.selectedCountryCode === 'CA'
|
|
94
|
-
? currencyFormat(40)
|
|
95
|
-
: dutyDeminimis;
|
|
168
|
+
const { selectedCountryCode } = localizationStore;
|
|
169
|
+
// If deminimis is undefined or null, assume it's $0
|
|
170
|
+
const dutyDeMinimisMessage = this.getDutyMessage();
|
|
96
171
|
// If deminimis is undefined or null, assume it's $0
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
// Our Robby API spells deminimis wrong here
|
|
101
|
-
const taxDeminimis = (countryLandedCost === null || countryLandedCost === void 0 ? void 0 : countryLandedCost.vatTaxDeminimus)
|
|
102
|
-
? currencyFormat(countryLandedCost.vatTaxDeminimus)
|
|
103
|
-
: null;
|
|
104
|
-
// If Canada, use 150 CAD (courier tax de minimis)
|
|
105
|
-
const taxDeminimisToUse = localizationStore.selectedCountryCode === 'CA'
|
|
106
|
-
? currencyFormat(150)
|
|
107
|
-
: taxDeminimis;
|
|
108
|
-
const taxDeMinimisMessage = taxDeminimisToUse
|
|
109
|
-
? `${translate('Spend')} ${taxDeminimisToUse} ${translate('tax free')}`
|
|
110
|
-
: translate('Taxes will apply to all orders');
|
|
172
|
+
const taxDeMinimisMessage = this.getTaxMessage();
|
|
173
|
+
// Show additional information if selected country has tax id
|
|
174
|
+
const additionalInformation = this.getAdditionalDutyTaxMessage();
|
|
111
175
|
const animateLeft = this.animateFromLeftOverride ||
|
|
112
176
|
(this.dialogRef && getHasMoreSpaceOnRight(this.dialogRef));
|
|
113
177
|
const animateFromBottom = this.dialogRef && getHasMoreSpaceAbove(this.dialogRef);
|
|
@@ -118,7 +182,7 @@ const ZonosHelloDialog = class {
|
|
|
118
182
|
const defaultMessage = formatStringWithLinks(defaultMessageStr);
|
|
119
183
|
const currentPage = this.getCurrentPageEnum();
|
|
120
184
|
const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
|
|
121
|
-
return (h(Host, { key: '
|
|
185
|
+
return (h(Host, { key: 'ccabd686943b009ed6bb9c0ec64a6a4e7cc917f5', class: "zonos--elements" }, h("div", { key: '6bfbae15f5b43413fc76d21b94d0d56a2ce48f4d', "aria-hidden": "true", class: classes([
|
|
122
186
|
'zonos--hello-dialog',
|
|
123
187
|
animateLeft && 'zonos--hello-dialog-animate-from-left',
|
|
124
188
|
animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
|
|
@@ -128,7 +192,7 @@ const ZonosHelloDialog = class {
|
|
|
128
192
|
]), ref: el => el && (this.dialogRef = el) }, !this.showCountrySelect && !this.showLanguageSelect && (h("div", null, h("div", { class: "zonos--hello-dialog-content" }, h("zonos-button", { 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", { spacing: 24 }, h("zonos-country-flag", { class: "zonos--hello-country-flag", countryCode: selectedCountryCode }), h("zonos-v-stack", { class: "zonos--hello-dialog-header", spacing: 4 }, h("zonos-text", { type: "boldSubheader" }, welcomeMessage), h("zonos-text", { innerHTML: defaultMessage, textColor: "gray-800" })), h("zonos-v-stack", { spacing: 8 }, this.restrictedItems.map(item => {
|
|
129
193
|
var _a;
|
|
130
194
|
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)))));
|
|
131
|
-
}), h("zonos-card", { spacing: "12px" }, h("zonos-v-stack", { spacing: 12 }, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content:
|
|
195
|
+
}), h("zonos-card", { spacing: "12px" }, h("zonos-v-stack", { spacing: 12 }, h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Duty de minimis", content: ImportIcon }), h("zonos-text", null, dutyDeMinimisMessage)), h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Tax de minimis", content: MoneyIcon }), h("zonos-text", null, taxDeMinimisMessage)), additionalInformation && (h("div", { class: "zonos--flex-message" }, h("zonos-icon", { "aria-label": "Low value order shipping restriction", content: BagIcon }), h("zonos-text", null, additionalInformation))))), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))))), h("zonos-hello-dialog-footer", { appearanceSettings: this.appearanceSettings, setShowCountrySelect: value => this.setShowCountrySelect(value), setShowLanguageSelect: value => this.setShowLanguageSelect(value) }))), this.showCountrySelect && (h("div", null, h("zonos-country-select", { handleOnClose: () => this.setShowCountrySelect(false) }))), this.showLanguageSelect && (h("div", null, h("zonos-language-select", { handleOnClose: () => this.setShowLanguageSelect(false) }))))));
|
|
132
196
|
}
|
|
133
197
|
static get assetsDirs() { return ["assets"]; }
|
|
134
198
|
static get watchers() { return {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host } from './index-dd40cc85.js';
|
|
2
2
|
import { _ as _root, e as _baseGetTag, i as isObjectLike_1, f as isObject_1, z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-c4c45591.js';
|
|
3
|
-
import { r as handleFetch, d as logError, l as localizationStore, u as isValidSelector, t as translate, w as getZCountryUrlParam, x as setZCountryUrlParam, a as log, y as currencyDisplay, z as currencyConvertAndFormat, A as currencyConvert, B as currencyFormat } from './cart-
|
|
3
|
+
import { r as handleFetch, d as logError, l as localizationStore, u as isValidSelector, t as translate, w as getZCountryUrlParam, x as setZCountryUrlParam, a as log, y as currencyDisplay, z as currencyConvertAndFormat, A as currencyConvert, B as currencyFormat } from './cart-7961927b.js';
|
|
4
4
|
import { c as classes } from './classes-0d95c529.js';
|
|
5
5
|
import { g as getHasMoreSpaceOnRight } from './getHasMoreSpaceOnRight-70eb913a.js';
|
|
6
6
|
import './isDarkColor-6bf71e51.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, d as getElement } from './index-dd40cc85.js';
|
|
2
|
-
import { j as stripeStore, d as logError } from './cart-
|
|
2
|
+
import { j as stripeStore, d as logError } from './cart-7961927b.js';
|
|
3
3
|
import './zonosStore-c4c45591.js';
|
|
4
4
|
import './isDarkColor-6bf71e51.js';
|
|
5
5
|
import './getBorderRadius-a89e45fb.js';
|