@zonos/elements 1.3.83 → 1.3.85

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.
Files changed (144) hide show
  1. package/dist/cjs/{cart-4de3faca.js → cart-fc426d98.js} +94 -144
  2. package/dist/cjs/{createCustomEvent-65331eae.js → createCustomEvent-354c8e63.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{paypal-370b3a10.js → paypal-1fe5ed0c.js} +1 -1
  5. package/dist/cjs/zonos-address_7.cjs.entry.js +3 -3
  6. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +30 -13
  7. package/dist/cjs/zonos-checkout.cjs.entry.js +9 -7
  8. package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
  9. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
  12. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  13. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  14. package/dist/cjs/zonos-notification_3.cjs.entry.js +4 -4
  15. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +3 -1
  16. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +12 -3
  17. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +7 -3
  18. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +2 -1
  19. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +3 -2
  20. package/dist/collection/components/store/checkout/cart.js +0 -1
  21. package/dist/collection/components/store/checkout/stripe.js +4 -2
  22. package/dist/collection/components/store/hello/localization.js +6 -2
  23. package/dist/collection/components/store/translationStore/strings.arabic.js +4 -7
  24. package/dist/collection/components/store/translationStore/strings.base.js +4 -7
  25. package/dist/collection/components/store/translationStore/strings.chinese.js +4 -7
  26. package/dist/collection/components/store/translationStore/strings.danish.js +4 -7
  27. package/dist/collection/components/store/translationStore/strings.dutch.js +4 -7
  28. package/dist/collection/components/store/translationStore/strings.french.js +4 -7
  29. package/dist/collection/components/store/translationStore/strings.german.js +4 -7
  30. package/dist/collection/components/store/translationStore/strings.hebrew.js +4 -7
  31. package/dist/collection/components/store/translationStore/strings.indonesian.js +4 -7
  32. package/dist/collection/components/store/translationStore/strings.italian.js +4 -7
  33. package/dist/collection/components/store/translationStore/strings.japanese.js +4 -7
  34. package/dist/collection/components/store/translationStore/strings.korean.js +4 -7
  35. package/dist/collection/components/store/translationStore/strings.norwegian.js +4 -7
  36. package/dist/collection/components/store/translationStore/strings.polish.js +4 -7
  37. package/dist/collection/components/store/translationStore/strings.portuguese.js +4 -7
  38. package/dist/collection/components/store/translationStore/strings.russian.js +4 -7
  39. package/dist/collection/components/store/translationStore/strings.spanish.js +4 -7
  40. package/dist/collection/components/store/translationStore/strings.swedish.js +4 -7
  41. package/dist/collection/components/store/translationStore/strings.turkish.js +4 -7
  42. package/dist/collection/components/store/translationStore/strings.vietnamese.js +4 -7
  43. package/dist/collection/components/stripe/zonos-address/zonos-address.js +3 -3
  44. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +2 -2
  45. package/dist/collection/components/utils/checkout/isDisabledCountry.js +0 -2
  46. package/dist/collection/components/utils/checkout/isShippableCountry.js +0 -2
  47. package/dist/collection/components/utils/getContrastColor.js +8 -3
  48. package/dist/collection/styles/stripe/addressRuleStyle.js +4 -0
  49. package/dist/esm/{cart-bdc45f59.js → cart-6c44367a.js} +94 -145
  50. package/dist/esm/{createCustomEvent-4db13122.js → createCustomEvent-ec15a4a7.js} +1 -1
  51. package/dist/esm/index.js +7 -7
  52. package/dist/esm/{paypal-1b29d424.js → paypal-a562a640.js} +1 -1
  53. package/dist/esm/zonos-address_7.entry.js +3 -3
  54. package/dist/esm/zonos-cart-items_12.entry.js +30 -13
  55. package/dist/esm/zonos-checkout.entry.js +9 -7
  56. package/dist/esm/zonos-controller.entry.js +1 -1
  57. package/dist/esm/zonos-country-flag.entry.js +1 -1
  58. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  59. package/dist/esm/zonos-hello-dialog.entry.js +1 -1
  60. package/dist/esm/zonos-hello.entry.js +1 -1
  61. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  62. package/dist/esm/zonos-notification_3.entry.js +4 -4
  63. package/dist/esm-es5/cart-6c44367a.js +1 -0
  64. package/dist/esm-es5/{createCustomEvent-4db13122.js → createCustomEvent-ec15a4a7.js} +1 -1
  65. package/dist/esm-es5/index.js +1 -1
  66. package/dist/esm-es5/{paypal-1b29d424.js → paypal-a562a640.js} +1 -1
  67. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  68. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  69. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  70. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  71. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  72. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  73. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  74. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  75. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  76. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  77. package/dist/scripts/index.js +1 -1
  78. package/dist/scripts/loadZonos.js +1 -1
  79. package/dist/scripts/zonos.js +1 -1
  80. package/dist/types/components/store/hello/localization.d.ts +4 -0
  81. package/dist/types/components/store/translationStore/strings.arabic.d.ts +2 -5
  82. package/dist/types/components/store/translationStore/strings.base.d.ts +2 -5
  83. package/dist/types/components/store/translationStore/strings.chinese.d.ts +2 -5
  84. package/dist/types/components/store/translationStore/strings.danish.d.ts +2 -5
  85. package/dist/types/components/store/translationStore/strings.dutch.d.ts +2 -5
  86. package/dist/types/components/store/translationStore/strings.french.d.ts +2 -5
  87. package/dist/types/components/store/translationStore/strings.german.d.ts +2 -5
  88. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +2 -5
  89. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +2 -5
  90. package/dist/types/components/store/translationStore/strings.italian.d.ts +2 -5
  91. package/dist/types/components/store/translationStore/strings.japanese.d.ts +2 -5
  92. package/dist/types/components/store/translationStore/strings.korean.d.ts +2 -5
  93. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +2 -5
  94. package/dist/types/components/store/translationStore/strings.polish.d.ts +2 -5
  95. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +2 -5
  96. package/dist/types/components/store/translationStore/strings.russian.d.ts +2 -5
  97. package/dist/types/components/store/translationStore/strings.spanish.d.ts +2 -5
  98. package/dist/types/components/store/translationStore/strings.swedish.d.ts +2 -5
  99. package/dist/types/components/store/translationStore/strings.turkish.d.ts +2 -5
  100. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +2 -5
  101. package/dist/types/components/store/translationStore.d.ts +1 -1
  102. package/dist/zonos-elements/assets/ChevronUpIcon.svg +1 -23
  103. package/dist/zonos-elements/index.esm.js +1 -1
  104. package/dist/zonos-elements/{p-a34f0674.entry.js → p-01604d44.entry.js} +1 -1
  105. package/dist/zonos-elements/{p-a6cff57f.system.js → p-08fee913.system.js} +1 -1
  106. package/dist/zonos-elements/{p-4ec7afc5.system.js → p-092961f1.system.js} +1 -1
  107. package/dist/zonos-elements/{p-2140ccb4.system.entry.js → p-133595ff.system.entry.js} +1 -1
  108. package/dist/zonos-elements/{p-2183128a.system.entry.js → p-1eb59b7c.system.entry.js} +1 -1
  109. package/dist/zonos-elements/{p-3457c5e8.system.entry.js → p-35b6b151.system.entry.js} +1 -1
  110. package/dist/zonos-elements/{p-017bf338.entry.js → p-3b3cb2a4.entry.js} +1 -1
  111. package/dist/zonos-elements/p-51e2df70.entry.js +1 -0
  112. package/dist/zonos-elements/{p-b0303b0e.entry.js → p-5ba198b3.entry.js} +1 -1
  113. package/dist/zonos-elements/{p-e3df5ff6.system.entry.js → p-5ebde561.system.entry.js} +1 -1
  114. package/dist/zonos-elements/{p-9cfa3736.system.entry.js → p-63a33354.system.entry.js} +1 -1
  115. package/dist/zonos-elements/p-64b67900.entry.js +1 -0
  116. package/dist/zonos-elements/p-6b7fa35e.system.js +1 -0
  117. package/dist/zonos-elements/p-710ac059.js +1 -0
  118. package/dist/zonos-elements/{p-01d11845.system.entry.js → p-76013796.system.entry.js} +1 -1
  119. package/dist/zonos-elements/{p-f1d043ad.system.entry.js → p-7b4a5b9b.system.entry.js} +1 -1
  120. package/dist/zonos-elements/p-95241447.entry.js +1 -0
  121. package/dist/zonos-elements/p-a26a8ca5.system.entry.js +1 -0
  122. package/dist/zonos-elements/{p-9b911f6f.entry.js → p-a858a304.entry.js} +1 -1
  123. package/dist/zonos-elements/{p-6aa35f18.entry.js → p-b5316c2c.entry.js} +1 -1
  124. package/dist/zonos-elements/{p-a1fa0a1c.system.js → p-b9645c27.system.js} +1 -1
  125. package/dist/zonos-elements/p-c37b99dd.system.entry.js +1 -0
  126. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  127. package/dist/zonos-elements/{p-7cc5e325.js → p-cbb742ab.js} +1 -1
  128. package/dist/zonos-elements/p-d7b341e3.system.entry.js +1 -0
  129. package/dist/zonos-elements/p-de6c2a4a.entry.js +1 -0
  130. package/dist/zonos-elements/{p-771e2623.entry.js → p-e78c2429.entry.js} +1 -1
  131. package/dist/zonos-elements/p-ee8b5e53.js +1 -0
  132. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  133. package/package.json +1 -1
  134. package/dist/esm-es5/cart-bdc45f59.js +0 -1
  135. package/dist/zonos-elements/p-00bb8221.system.entry.js +0 -1
  136. package/dist/zonos-elements/p-0cc8c6a3.system.js +0 -1
  137. package/dist/zonos-elements/p-278d61ed.js +0 -1
  138. package/dist/zonos-elements/p-2b60faf8.entry.js +0 -1
  139. package/dist/zonos-elements/p-3347e142.entry.js +0 -1
  140. package/dist/zonos-elements/p-5fb337a0.entry.js +0 -1
  141. package/dist/zonos-elements/p-7f3aeb53.system.entry.js +0 -1
  142. package/dist/zonos-elements/p-844ec9f9.system.entry.js +0 -1
  143. package/dist/zonos-elements/p-c6350880.entry.js +0 -1
  144. package/dist/zonos-elements/p-ce41cbde.js +0 -1
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const cart = require('./cart-4de3faca.js');
3
+ const cart = require('./cart-fc426d98.js');
4
4
  const zonosStore = require('./zonosStore-a4395972.js');
5
5
  const handleFetch = require('./handleFetch-45e76490.js');
6
6
 
@@ -97,7 +97,7 @@ const getZonosQaUrl = () => {
97
97
  return null;
98
98
  }
99
99
  const qaUrl = extractZonosQaUrl(window.location.href);
100
- const cdnUrl = "https://v1.3.83.js.zonos.com";
100
+ const cdnUrl = "https://v1.3.85.js.zonos.com";
101
101
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
102
102
  if (!qaUrl &&
103
103
  (cdnUrl.includes('test.') ||
@@ -281,10 +281,10 @@ const zonosLoadUrl = (() => {
281
281
  }
282
282
  return null;
283
283
  })();
284
- const ZONOS_URL = "https://v1.3.83.js.zonos.com";
285
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.83";
286
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.83";
287
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.83";
284
+ const ZONOS_URL = "https://v1.3.85.js.zonos.com";
285
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.85";
286
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.85";
287
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.85";
288
288
  const INTER_FONT_URL = 'https://rsms.me';
289
289
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
290
290
  const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
@@ -299,7 +299,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
299
299
  !!window.location.search.match(/\?.*(&*)zonosConversionTest/);
300
300
  Zonos._paypalMockResponse = null;
301
301
  Zonos.isBigCommerce = false;
302
- Zonos.releaseDate = "1728684691259";
302
+ Zonos.releaseDate = "1728761799096";
303
303
  Zonos.isLegacyCheckout = false;
304
304
  /**
305
305
  * By default, the package will load from npm
@@ -307,7 +307,7 @@ Zonos.isLegacyCheckout = false;
307
307
  Zonos.isNpm = true;
308
308
  Zonos.zonosQaUrl = null;
309
309
  Zonos.zonosQaUrlApi = null;
310
- Zonos.version = `v${"1.3.83"}`;
310
+ Zonos.version = `v${"1.3.85"}`;
311
311
  Zonos.modeAlerted = false;
312
312
  Zonos.cartData = null;
313
313
  Zonos.paypal = null;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-a4395972.js');
4
- const cart = require('./cart-4de3faca.js');
4
+ const cart = require('./cart-fc426d98.js');
5
5
  const handleFetch = require('./handleFetch-45e76490.js');
6
6
  const isDarkColor = require('./isDarkColor-5efc8367.js');
7
7
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-4de3faca.js');
6
+ const cart = require('./cart-fc426d98.js');
7
7
  const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
8
8
  const handleFetch = require('./handleFetch-45e76490.js');
9
9
  const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
@@ -84,7 +84,7 @@ const ZonosAddress = class {
84
84
  defaultValues: {
85
85
  address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
86
86
  cart.localizationStore.selectedCountryCode ||
87
- 'AL' }),
87
+ cart.DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT }),
88
88
  firstName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName,
89
89
  lastName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName,
90
90
  phone: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone,
@@ -147,7 +147,7 @@ const ZonosAddress = class {
147
147
  }
148
148
  render() {
149
149
  // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
150
- return (index.h(index.Host, { key: 'c8d513bc9890590db622ec8f26d4e9b0694c33e5', class: "zonos--address zonos--elements" }, index.h("zonos-text", { key: '775b454620360bed4186a23371bc3867a5745155', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), index.h("div", { key: '4844b5379a33a3668cae0036c1a952cd42229efb', class: "zonos--address-component" })));
150
+ return (index.h(index.Host, { key: 'aa9a569b302099681082cd4219b553f9c70842ea', class: "zonos--address zonos--elements" }, index.h("zonos-text", { key: '60050e9f8f0b80dde9acc9ffbd868333fdabf2b3', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), index.h("div", { key: '5af7ee4f23d75fc877cdde7babe0edaefef14da8', class: "zonos--address-component" })));
151
151
  }
152
152
  get el() { return index.getElement(this); }
153
153
  static get watchers() { return {
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-4de3faca.js');
6
+ const cart = require('./cart-fc426d98.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const paypal = require('./paypal-370b3a10.js');
8
+ const paypal = require('./paypal-1fe5ed0c.js');
9
9
  const zonosStore = require('./zonosStore-a4395972.js');
10
- const createCustomEvent = require('./createCustomEvent-65331eae.js');
10
+ const createCustomEvent = require('./createCustomEvent-354c8e63.js');
11
11
  const getBorderRadius = require('./getBorderRadius-5a64574c.js');
12
12
  const handleFetch = require('./handleFetch-45e76490.js');
13
13
  const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
@@ -31,11 +31,13 @@ const ZonosCartItems = class {
31
31
  const nonRestrictedItems = cart.cartStore.items.filter(item => !item.isRestricted);
32
32
  return (index.h(index.Host, { key: '7bdf8d1972edb2d11669441b3d8ec6643fca1f4b', class: "zonos--cart-items zonos--elements" }, index.h("table", { key: '1c2fe6d444ea93e40b981a8935d16192bf61928c', class: "zonos--cart-table" }, index.h("tbody", { key: '84279bea6821077bf117a7a13ca497155276c622' }, nonRestrictedItems.map(item => {
33
33
  const itemImg = item.imageUrl;
34
+ // Split the name by <br> tag
35
+ const namesWithNewLine = item.name.split(/<br\s*\/*>/);
34
36
  return (index.h("tr", { class: "zonos--cart-item" }, index.h("td", { class: "zonos--column zonos--cart-item-image" }, itemImg && !this.errorImages.includes(itemImg) ? (index.h("img", { alt: item.name, onError: () => {
35
37
  this.errorImages = [...this.errorImages, itemImg];
36
38
  }, src: item.imageUrl, style: {
37
39
  'min-width': '40px',
38
- }, width: 40 })) : (index.h("img", { alt: item.name, src: emptyItemImg, width: 40 }))), index.h("td", { class: "zonos--column zonos--cart-item-name" }, index.h("zonos-text", { type: "label" }, item.name), index.h("zonos-text", { textColor: "gray-600", type: "caption" }, cart.translate('Quantity'), ": ", item.quantity)), index.h("td", { class: "zonos--column zonos--cart-item-price" }, index.h("zonos-text", { type: "semiBoldLabel", weight: 600 }, cart.currencyFormat({
40
+ }, width: 40 })) : (index.h("img", { alt: item.name, src: emptyItemImg, width: 40 }))), index.h("td", { class: "zonos--column zonos--cart-item-name" }, index.h("div", null, namesWithNewLine.map(name => (index.h("zonos-text", { type: "label" }, name)))), index.h("zonos-text", { textColor: "gray-600", type: "caption" }, cart.translate('Quantity'), ": ", item.quantity)), index.h("td", { class: "zonos--column zonos--cart-item-price" }, index.h("zonos-text", { type: "semiBoldLabel", weight: 600 }, cart.currencyFormat({
39
41
  amount: item.amount * rate * item.quantity,
40
42
  currency: cart.cartStore.currency,
41
43
  })))));
@@ -540,6 +542,7 @@ const ZonosCheckoutPayment = class {
540
542
  this.showErrorBanner = false;
541
543
  }
542
544
  render() {
545
+ var _a;
543
546
  if (!cart.stripeStore.stripeElements) {
544
547
  return null;
545
548
  }
@@ -549,16 +552,24 @@ const ZonosCheckoutPayment = class {
549
552
  }
550
553
  const isTestMode = createCustomEvent.getIsTestMode();
551
554
  const hasPaypalEnabled = paypal.paypalStoreHasPaypalEnabled();
552
- return (index.h(index.Host, { class: "zonos--checkout-payment zonos--elements" }, index.h("div", { class: "zonos--group" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Payment method')), this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, cart.translate('Missing required fields. Make sure all fields are completed.'))), cart.stripeStore.hasPaymentError && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, cart.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), index.h("zonos-payment", null), index.h("div", { class: "zonos--group-btn" }, index.h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
555
+ const isPaypalTabSelected = ((_a = cart.stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
556
+ return (index.h(index.Host, { class: "zonos--checkout-payment zonos--elements" }, index.h("div", { class: "zonos--group" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Payment method')), this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, cart.translate('Missing required fields. Make sure all fields are completed.'))), cart.stripeStore.hasPaymentError && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, cart.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), index.h("zonos-payment", null), index.h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (index.h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => {
557
+ if (!hasPaypalEnabled) {
558
+ return;
559
+ }
560
+ this.continueClickHandler();
561
+ }, size: "lg",
553
562
  // use primary type when on mobile mode
554
563
  variant: this.submitBtnType }, cart.translate('Pay [orderTotal]', {
555
564
  orderTotal: cart.currencyFormat({
556
565
  amount: cart.cartStore.total,
557
566
  currency: cart.cartStore.currency,
558
567
  }),
559
- })), hasPaypalEnabled && (index.h("zonos-text", { type: "smallHeader" }, cart.translate('or'))), index.h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
568
+ }))), index.h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
560
569
  this.paypalSessionDone.emit(orderId);
561
- }, onPaypalSessionFail: () => this.paypalSessionFailed.emit() })), isTestMode && (index.h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, index.h("zonos-v-stack", { spacing: 16 }, index.h("div", null, index.h("zonos-text", { type: "semiBoldLabel" }, cart.translate('Test cards')), index.h("zonos-text", { textColor: "gray-700" }, cart.translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), index.h("zonos-button", { icon: index.h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, cart.translate('Success'), " (****4242)"), index.h("zonos-button", { icon: index.h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, cart.translate('Failure'), " (****0002)")), index.h("zonos-notification", null))))));
570
+ }, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
571
+ display: isPaypalTabSelected ? 'block' : 'none',
572
+ } })), isTestMode && (index.h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, index.h("zonos-v-stack", { spacing: 16 }, index.h("div", null, index.h("zonos-text", { type: "semiBoldLabel" }, cart.translate('Test cards')), index.h("zonos-text", { textColor: "gray-700" }, cart.translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), index.h("zonos-button", { icon: index.h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, cart.translate('Success'), " (****4242)"), index.h("zonos-button", { icon: index.h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, cart.translate('Failure'), " (****0002)")), index.h("zonos-notification", null))))));
562
573
  }
563
574
  };
564
575
  ZonosCheckoutPayment.style = ZonosCheckoutPaymentStyle0;
@@ -576,9 +587,14 @@ const getContrastColor = ({ backgroundColor, color, }) => {
576
587
  if (isDarkColor.isDarkColor(color)) {
577
588
  return '#ffffff';
578
589
  }
579
- else {
580
- return isDarkColor.tinycolor(color).darken(25).toHexString();
581
- }
590
+ const newDarkerColor = isDarkColor.tinycolor(color).darken(25).toHexString();
591
+ const newLigherColor = isDarkColor.tinycolor(color).lighten(25).toHexString();
592
+ // get readibility of the color
593
+ const isNewColorContrastEnough = paypal.isContrastColor({
594
+ backgroundColor1: backgroundColor,
595
+ backgroundColor2: newDarkerColor,
596
+ });
597
+ return isNewColorContrastEnough ? newDarkerColor : newLigherColor;
582
598
  };
583
599
 
584
600
  const TabCheckmark = `<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">
@@ -1069,7 +1085,7 @@ const ChevronUpIcon = `<svg width="25" height="24" viewBox="0 0 25 24" fill="non
1069
1085
  </svg>
1070
1086
  `;
1071
1087
 
1072
- const zonosShippingCss = ".sc-zonos-shipping-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-shipping-h *.sc-zonos-shipping{font-family:var(--font-family, Inter), Inter}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:-16px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h .zonos--error-banner.sc-zonos-shipping{margin-bottom:16px}.sc-zonos-shipping-h .zonos--shipping-method-error.sc-zonos-shipping{margin-top:24px}.sc-zonos-shipping-h zonos-button.sc-zonos-shipping{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;margin-top:12px;background:var(--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:100%}.sc-zonos-shipping-h .zonos--shipping-options-wrapper.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:24px;-ms-flex-align:center;align-items:center;background:var(--zonos-elements-gray-0);width:100%;border:none;cursor:pointer;position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-transition:0.5s all ease;transition:0.5s all ease}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping zonos-icon.sc-zonos-shipping{-webkit-transition:-webkit-transform 0.3s ease;transition:-webkit-transform 0.3s ease;transition:transform 0.3s ease;transition:transform 0.3s ease, -webkit-transform 0.3s ease}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.collapsed.sc-zonos-shipping{margin-bottom:0}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.collapsed.sc-zonos-shipping zonos-icon.sc-zonos-shipping{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping::before,.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping::after{content:\"\";display:block;width:80%;height:1px;background-color:var(--zonos-elements-border-color);-ms-flex-negative:1;flex-shrink:1}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping .zonos--title-wrapper.sc-zonos-shipping{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:row;flex-direction:row;gap:8px;-ms-flex-align:center;align-items:center}.sc-zonos-shipping-h .zonos--dap-wrapper.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}";
1088
+ const zonosShippingCss = ".sc-zonos-shipping-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-shipping-h *.sc-zonos-shipping{font-family:var(--font-family, Inter), Inter}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:-16px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h .zonos--error-banner.sc-zonos-shipping{margin-bottom:16px}.sc-zonos-shipping-h .zonos--shipping-method-error.sc-zonos-shipping{margin-top:24px}.sc-zonos-shipping-h zonos-button.sc-zonos-shipping{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;z-index:1;margin-top:12px;background:var(--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:100%}.sc-zonos-shipping-h .zonos--shipping-options-wrapper.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:24px;-ms-flex-align:center;align-items:center;background:transparent;width:100%;border:none;cursor:pointer;position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-transition:0.5s all ease;transition:0.5s all ease}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping zonos-icon.sc-zonos-shipping{-webkit-transition:-webkit-transform 0.3s ease;transition:-webkit-transform 0.3s ease;transition:transform 0.3s ease;transition:transform 0.3s ease, -webkit-transform 0.3s ease}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.collapsed.sc-zonos-shipping{margin-bottom:0}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.collapsed.sc-zonos-shipping zonos-icon.sc-zonos-shipping{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping::before,.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping::after{content:\"\";display:block;width:80%;height:1px;background-color:var(--zonos-elements-border-color);-ms-flex-negative:1;flex-shrink:1}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping .zonos--title-wrapper.sc-zonos-shipping{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:row;flex-direction:row;gap:8px;-ms-flex-align:center;align-items:center}.sc-zonos-shipping-h .zonos--dap-wrapper.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}";
1073
1089
  const ZonosShippingStyle0 = zonosShippingCss;
1074
1090
 
1075
1091
  const ZonosShipping = class {
@@ -1212,12 +1228,13 @@ const ZonosShipping = class {
1212
1228
  if (this.showErrorBanner) {
1213
1229
  this.showErrorBanner = !this.handleValidate();
1214
1230
  }
1215
- return (index.h(index.Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, index.h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, index.h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (index.h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, cart.translate('No shipping method selected'))), index.h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, cart.translate('Shipping method')), !allServiceLevels.length ? (index.h("zonos-banner", { bannerTitle: cart.translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (index.h("div", { class: "zonos--shipping-options-wrapper" }, index.h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), !!defaultShownServiceLevels.length && (index.h("button", { class: classes.classes([
1231
+ return (index.h(index.Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, index.h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, index.h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (index.h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, cart.translate('No shipping method selected'))), index.h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, cart.translate('Shipping method')), !allServiceLevels.length ? (index.h("zonos-banner", { bannerTitle: cart.translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (index.h("div", { class: "zonos--shipping-options-wrapper" }, index.h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), (!!this.serviceLevelsDAP.length ||
1232
+ !defaultShownServiceLevels.length) && (index.h("button", { class: classes.classes([
1216
1233
  'zonos--shipping-options-collapse-trigger',
1217
1234
  this.collapsedDAPOptions && 'collapsed',
1218
1235
  ]), onClick: () => {
1219
1236
  this.collapsedDAPOptions = !this.collapsedDAPOptions;
1220
- } }, index.h("div", { class: "zonos--title-wrapper" }, index.h("zonos-text", { type: "label" }, `${cart.translate(this.collapsedDAPOptions ? 'Show non prepaid methods' : 'Hide non prepaid methods')} `), index.h("zonos-icon", { content: ChevronUpIcon })))), index.h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, index.h("div", { class: "zonos--dap-wrapper" }, index.h("zonos-banner", { bannerTitle: cart.translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, cart.translate('You may incur additional fees from the shipping carrier by not prepaying.')), index.h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), index.h("div", { key: '43619b89b2274e38683ade860402ff026ddcdd9a', class: "zonos--group-btn" }, index.h("zonos-button", { key: 'fff71598501c5a83ea415a72f3bc64ee004cbeae', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
1237
+ } }, index.h("div", { class: "zonos--title-wrapper" }, index.h("zonos-text", { type: "label" }, `${cart.translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), index.h("zonos-icon", { content: ChevronUpIcon })))), index.h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, index.h("div", { class: "zonos--dap-wrapper" }, index.h("zonos-banner", { bannerTitle: cart.translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, cart.translate('You may incur additional fees from the shipping carrier by not prepaying.')), index.h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), index.h("div", { key: 'fdc7807bc26ec718cb51e23dbb9e4ccf286e6d91', class: "zonos--group-btn" }, index.h("zonos-button", { key: '7f1f43317f4734333df48bd244d0bf44f4cd252e', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
1221
1238
  // use primary type when on mobile mode
1222
1239
  variant: this.submitBtnType }, cart.translate('Go to payment'))))));
1223
1240
  }
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-4de3faca.js');
7
- const paypal = require('./paypal-370b3a10.js');
6
+ const cart = require('./cart-fc426d98.js');
7
+ const paypal = require('./paypal-1fe5ed0c.js');
8
8
  const zonosStore = require('./zonosStore-a4395972.js');
9
- const createCustomEvent = require('./createCustomEvent-65331eae.js');
9
+ const createCustomEvent = require('./createCustomEvent-354c8e63.js');
10
10
  const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
11
11
  const handleFetch = require('./handleFetch-45e76490.js');
12
12
  const classes = require('./classes-b7918f56.js');
@@ -45,7 +45,6 @@ const isDisabledCountry = (showLog = true) => {
45
45
  return true;
46
46
  }
47
47
  if (cart.localizationStore.isDisabledCountry) {
48
- document.dispatchEvent(createCustomEvent.createCustomEvent('legacyCheckoutError', 'Unable to initiate checkout process in a country that has been disabled for checkout'));
49
48
  if (showLog) {
50
49
  handleFetch.log(`Checkout: disabled country`);
51
50
  }
@@ -60,7 +59,6 @@ const isShippableCountry = (showLog = true) => {
60
59
  }
61
60
  // if localization is loaded and the localization is not a shippable country, keep the original click event
62
61
  if (!cart.localizationStore.isShippableCountry) {
63
- document.dispatchEvent(createCustomEvent.createCustomEvent('legacyCheckoutError', 'Unable to initiate checkout process in a country where shipping is not available'));
64
62
  if (showLog) {
65
63
  handleFetch.log(`Checkout: not shippable country`);
66
64
  }
@@ -354,7 +352,9 @@ const ZonosCheckout = class {
354
352
  });
355
353
  button.addEventListener('click', async (e) => {
356
354
  var _a;
357
- if (!isShippableCountry() || isDisabledCountry()) {
355
+ // Allow no country set for legacy facades. Otherwise enforce it being a shippable country and not disabled.
356
+ if (!window.Zonos.isLegacyCheckout &&
357
+ (!isShippableCountry() || isDisabledCountry())) {
358
358
  return;
359
359
  }
360
360
  e.preventDefault();
@@ -438,7 +438,9 @@ const ZonosCheckout = class {
438
438
  const legacyShippingInfo = {
439
439
  country:
440
440
  // fallback to selected country code if country is not provided
441
- urlParams.get('country') || cart.localizationStore.selectedCountryCode,
441
+ urlParams.get('country') ||
442
+ cart.localizationStore.selectedCountryCode ||
443
+ cart.DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT,
442
444
  customerAddress1: urlParams.get('customerAddress1'),
443
445
  customerAddress2: urlParams.get('customerAddress2'),
444
446
  customerCity: urlParams.get('customerCity'),
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-4de3faca.js');
6
+ const cart = require('./cart-fc426d98.js');
7
7
  const zonosStore = require('./zonosStore-a4395972.js');
8
8
  const handleFetch = require('./handleFetch-45e76490.js');
9
9
  require('./isDarkColor-5efc8367.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-4de3faca.js');
6
+ const cart = require('./cart-fc426d98.js');
7
7
  const zonosStore = require('./zonosStore-a4395972.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  require('./handleFetch-45e76490.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-4de3faca.js');
6
+ const cart = require('./cart-fc426d98.js');
7
7
  const zonosStore = require('./zonosStore-a4395972.js');
8
8
  const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
9
9
  const isDarkColor = require('./isDarkColor-5efc8367.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-4de3faca.js');
6
+ const cart = require('./cart-fc426d98.js');
7
7
  const zonosStore = require('./zonosStore-a4395972.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
6
  const zonosStore = require('./zonosStore-a4395972.js');
7
- const cart = require('./cart-4de3faca.js');
7
+ const cart = require('./cart-fc426d98.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  const handleFetch = require('./handleFetch-45e76490.js');
10
10
  const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-4de3faca.js');
6
+ const cart = require('./cart-fc426d98.js');
7
7
  const zonosStore = require('./zonosStore-a4395972.js');
8
8
  const ILanguage = require('./ILanguage-98b04442.js');
9
9
  require('./handleFetch-45e76490.js');
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-d56e0a8b.js');
6
6
  const zonosStore = require('./zonosStore-a4395972.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const cart = require('./cart-4de3faca.js');
8
+ const cart = require('./cart-fc426d98.js');
9
9
  const handleFetch = require('./handleFetch-45e76490.js');
10
- const paypal = require('./paypal-370b3a10.js');
10
+ const paypal = require('./paypal-1fe5ed0c.js');
11
11
  require('./isDarkColor-5efc8367.js');
12
12
  require('./getBorderRadius-5a64574c.js');
13
13
 
@@ -91,7 +91,7 @@ const ZonosPayment = class {
91
91
  // Create and mount the Authentication Element in ${type} mode
92
92
  const paymentElement = cart.stripeStore.stripePaymentElement ||
93
93
  this.stripeElements.create('payment', {
94
- layout: 'accordion',
94
+ layout: 'tabs',
95
95
  });
96
96
  const paymentElementContainer = this.el.querySelector('.zonos--payment-component');
97
97
  if (!paymentElementContainer) {
@@ -110,7 +110,7 @@ const ZonosPayment = class {
110
110
  }
111
111
  render() {
112
112
  // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
113
- return (index.h(index.Host, { key: 'c461a967d00b2d96fa70aaaf1651b435cdcd84bd', class: "zonos--payment zonos--elements" }, this.titleText && (index.h("zonos-text", { key: '44da1d89ce19f7174cad1214ab9463f0b1174c0d', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), index.h("div", { key: 'b9e3491b48d9ede19a5cdef639bd47e6bf0ba742', class: "zonos--payment-component" }), index.h("div", { key: '578516ce1ca1dc01eebb2268bb5449613e14298f', class: "zonos--payment-paypal-container" })));
113
+ return (index.h(index.Host, { key: 'cf616ec959fd1b7396ed86b23561f459e0da8722', class: "zonos--payment zonos--elements" }, this.titleText && (index.h("zonos-text", { key: 'e5564db71ba2c0d67d372cb1804d6d462cdf1b33', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), index.h("div", { key: '3ea47f2c0a541590210d181bc73ecb3fb27e7783', class: "zonos--payment-component" }), index.h("div", { key: 'd3a46a127448568caf4309806e88556594075c12', class: "zonos--payment-paypal-container" })));
114
114
  }
115
115
  get el() { return index.getElement(this); }
116
116
  static get watchers() { return {
@@ -13,11 +13,13 @@ export class ZonosCartItems {
13
13
  const nonRestrictedItems = cartStore.items.filter(item => !item.isRestricted);
14
14
  return (h(Host, { key: '7bdf8d1972edb2d11669441b3d8ec6643fca1f4b', class: "zonos--cart-items zonos--elements" }, h("table", { key: '1c2fe6d444ea93e40b981a8935d16192bf61928c', class: "zonos--cart-table" }, h("tbody", { key: '84279bea6821077bf117a7a13ca497155276c622' }, nonRestrictedItems.map(item => {
15
15
  const itemImg = item.imageUrl;
16
+ // Split the name by <br> tag
17
+ const namesWithNewLine = item.name.split(/<br\s*\/*>/);
16
18
  return (h("tr", { class: "zonos--cart-item" }, h("td", { class: "zonos--column zonos--cart-item-image" }, itemImg && !this.errorImages.includes(itemImg) ? (h("img", { alt: item.name, onError: () => {
17
19
  this.errorImages = [...this.errorImages, itemImg];
18
20
  }, src: item.imageUrl, style: {
19
21
  'min-width': '40px',
20
- }, width: 40 })) : (h("img", { alt: item.name, src: emptyItemImg, width: 40 }))), h("td", { class: "zonos--column zonos--cart-item-name" }, h("zonos-text", { type: "label" }, item.name), h("zonos-text", { textColor: "gray-600", type: "caption" }, translate('Quantity'), ": ", item.quantity)), h("td", { class: "zonos--column zonos--cart-item-price" }, h("zonos-text", { type: "semiBoldLabel", weight: 600 }, currencyFormat({
22
+ }, width: 40 })) : (h("img", { alt: item.name, src: emptyItemImg, width: 40 }))), h("td", { class: "zonos--column zonos--cart-item-name" }, h("div", null, namesWithNewLine.map(name => (h("zonos-text", { type: "label" }, name)))), h("zonos-text", { textColor: "gray-600", type: "caption" }, translate('Quantity'), ": ", item.quantity)), h("td", { class: "zonos--column zonos--cart-item-price" }, h("zonos-text", { type: "semiBoldLabel", weight: 600 }, currencyFormat({
21
23
  amount: item.amount * rate * item.quantity,
22
24
  currency: cartStore.currency,
23
25
  })))));
@@ -42,6 +42,7 @@ export class ZonosCheckoutPayment {
42
42
  this.showErrorBanner = false;
43
43
  }
44
44
  render() {
45
+ var _a;
45
46
  if (!stripeStore.stripeElements) {
46
47
  return null;
47
48
  }
@@ -51,16 +52,24 @@ export class ZonosCheckoutPayment {
51
52
  }
52
53
  const isTestMode = getIsTestMode();
53
54
  const hasPaypalEnabled = paypalStoreHasPaypalEnabled();
54
- return (h(Host, { class: "zonos--checkout-payment zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Payment method')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), stripeStore.hasPaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), h("zonos-payment", null), h("div", { class: "zonos--group-btn" }, h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
55
+ const isPaypalTabSelected = ((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
56
+ return (h(Host, { class: "zonos--checkout-payment zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Payment method')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), stripeStore.hasPaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), h("zonos-payment", null), h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => {
57
+ if (!hasPaypalEnabled) {
58
+ return;
59
+ }
60
+ this.continueClickHandler();
61
+ }, size: "lg",
55
62
  // use primary type when on mobile mode
56
63
  variant: this.submitBtnType }, translate('Pay [orderTotal]', {
57
64
  orderTotal: currencyFormat({
58
65
  amount: cartStore.total,
59
66
  currency: cartStore.currency,
60
67
  }),
61
- })), hasPaypalEnabled && (h("zonos-text", { type: "smallHeader" }, translate('or'))), h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
68
+ }))), h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
62
69
  this.paypalSessionDone.emit(orderId);
63
- }, onPaypalSessionFail: () => this.paypalSessionFailed.emit() })), isTestMode && (h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, h("zonos-v-stack", { spacing: 16 }, h("div", null, h("zonos-text", { type: "semiBoldLabel" }, translate('Test cards')), h("zonos-text", { textColor: "gray-700" }, translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), h("zonos-button", { icon: h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, translate('Success'), " (****4242)"), h("zonos-button", { icon: h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, translate('Failure'), " (****0002)")), h("zonos-notification", null))))));
70
+ }, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
71
+ display: isPaypalTabSelected ? 'block' : 'none',
72
+ } })), isTestMode && (h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, h("zonos-v-stack", { spacing: 16 }, h("div", null, h("zonos-text", { type: "semiBoldLabel" }, translate('Test cards')), h("zonos-text", { textColor: "gray-700" }, translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), h("zonos-button", { icon: h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, translate('Success'), " (****4242)"), h("zonos-button", { icon: h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, translate('Failure'), " (****0002)")), h("zonos-notification", null))))));
64
73
  }
65
74
  static get is() { return "zonos-checkout-payment"; }
66
75
  static get encapsulation() { return "scoped"; }
@@ -2,7 +2,7 @@ import { Fragment, h, Host, } from "@stencil/core";
2
2
  import { cartStore, cartStoreClearCheckoutInterval, cartStoreNextStep, cartStoreReset, cartStoreResetTabItems, cartStoreSetCheckoutSession, cartStoreStartCheckoutInterval, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
3
3
  import { paypalInitScript } from "../../store/checkout/paypal";
4
4
  import { initStripeElements, stripeStore, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreHandleInventoryCheck, stripeStoreInitCheckoutSession, stripeStorePrefetchLandedCost, stripeStoreReset, } from "../../store/checkout/stripe";
5
- import { localizationStore, localizationStoreOnUpdate, } from "../../store/hello/localization";
5
+ import { DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT, localizationStore, localizationStoreOnUpdate, } from "../../store/hello/localization";
6
6
  import { translate } from "../../store/translationStore";
7
7
  import { getZonosStoreTheme, zonosStore, } from "../../store/zonosStore";
8
8
  import { buildCartItemsByTempCart } from "../../utils/api/buildCartItemsByTempCart";
@@ -198,7 +198,9 @@ export class ZonosCheckout {
198
198
  });
199
199
  button.addEventListener('click', async (e) => {
200
200
  var _a;
201
- if (!isShippableCountry() || isDisabledCountry()) {
201
+ // Allow no country set for legacy facades. Otherwise enforce it being a shippable country and not disabled.
202
+ if (!window.Zonos.isLegacyCheckout &&
203
+ (!isShippableCountry() || isDisabledCountry())) {
202
204
  return;
203
205
  }
204
206
  e.preventDefault();
@@ -282,7 +284,9 @@ export class ZonosCheckout {
282
284
  const legacyShippingInfo = {
283
285
  country:
284
286
  // fallback to selected country code if country is not provided
285
- urlParams.get('country') || localizationStore.selectedCountryCode,
287
+ urlParams.get('country') ||
288
+ localizationStore.selectedCountryCode ||
289
+ DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT,
286
290
  customerAddress1: urlParams.get('customerAddress1'),
287
291
  customerAddress2: urlParams.get('customerAddress2'),
288
292
  customerCity: urlParams.get('customerCity'),
@@ -77,6 +77,7 @@
77
77
  display: flex;
78
78
  justify-content: center;
79
79
  bottom: 0;
80
+ z-index: 1;
80
81
  margin-top: 12px;
81
82
  background: var(--primary-color, var(--zonos-elements-gray-0));
82
83
  }
@@ -93,7 +94,7 @@
93
94
  flex-direction: row;
94
95
  gap: 24px;
95
96
  align-items: center;
96
- background: var(--zonos-elements-gray-0);
97
+ background: transparent;
97
98
  width: 100%;
98
99
  border: none;
99
100
  cursor: pointer;
@@ -146,12 +146,13 @@ export class ZonosShipping {
146
146
  if (this.showErrorBanner) {
147
147
  this.showErrorBanner = !this.handleValidate();
148
148
  }
149
- return (h(Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !allServiceLevels.length ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (h("div", { class: "zonos--shipping-options-wrapper" }, h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), !!defaultShownServiceLevels.length && (h("button", { class: classes([
149
+ return (h(Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !allServiceLevels.length ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (h("div", { class: "zonos--shipping-options-wrapper" }, h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), (!!this.serviceLevelsDAP.length ||
150
+ !defaultShownServiceLevels.length) && (h("button", { class: classes([
150
151
  'zonos--shipping-options-collapse-trigger',
151
152
  this.collapsedDAPOptions && 'collapsed',
152
153
  ]), onClick: () => {
153
154
  this.collapsedDAPOptions = !this.collapsedDAPOptions;
154
- } }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non prepaid methods' : 'Hide non prepaid methods')} `), h("zonos-icon", { content: ChevronUpIcon })))), h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, h("div", { class: "zonos--dap-wrapper" }, h("zonos-banner", { bannerTitle: translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, translate('You may incur additional fees from the shipping carrier by not prepaying.')), h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), h("div", { key: '43619b89b2274e38683ade860402ff026ddcdd9a', class: "zonos--group-btn" }, h("zonos-button", { key: 'fff71598501c5a83ea415a72f3bc64ee004cbeae', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
155
+ } }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), h("zonos-icon", { content: ChevronUpIcon })))), h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, h("div", { class: "zonos--dap-wrapper" }, h("zonos-banner", { bannerTitle: translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, translate('You may incur additional fees from the shipping carrier by not prepaying.')), h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), h("div", { key: 'fdc7807bc26ec718cb51e23dbb9e4ccf286e6d91', class: "zonos--group-btn" }, h("zonos-button", { key: '7f1f43317f4734333df48bd244d0bf44f4cd252e', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
155
156
  // use primary type when on mobile mode
156
157
  variant: this.submitBtnType }, translate('Go to payment'))))));
157
158
  }
@@ -310,7 +310,6 @@ const cartStoreUpdateItems = async ({ adjustments, cartItems, }) => {
310
310
  adjustmentsAmount: adjustmentTotal,
311
311
  cartId: window.Zonos.cartId,
312
312
  currency: currency,
313
- // TEMP: test
314
313
  dutiesTaxesFeesEstimate: 0,
315
314
  itemsAmount: total,
316
315
  });
@@ -1,6 +1,6 @@
1
1
  import { createStore } from "@stencil/store";
2
2
  import { cartStore, cartStoreApplySubtotals, cartStoreCheckItemRestrictions, cartStorePreviousStep, cartStoreResetCartItems, cartStoreSetCheckoutSession, cartStoreUpdateSelectedShippingOption, } from "./cart";
3
- import { localizationStore } from "../hello/localization";
3
+ import { DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT, localizationStore, } from "../hello/localization";
4
4
  import { translate } from "../translationStore";
5
5
  import { zonosStore } from "../zonosStore";
6
6
  import { calculateLandedCostNormalized } from "../../utils/api/calculateLandedCostNormaliz";
@@ -66,6 +66,7 @@ const getStripeOptions = ({ clientSecret, overrideBorderRadius, overridePrimaryC
66
66
  }),
67
67
  },
68
68
  clientSecret,
69
+ externalPaymentMethodTypes: ['external_paypal'],
69
70
  locale: localizationStore.selectedLocale,
70
71
  };
71
72
  };
@@ -420,7 +421,8 @@ const stripeStoreInitCheckoutSession = async () => {
420
421
  currency: ((_a = cartStore.items.find(Boolean)) === null || _a === void 0 ? void 0 : _a.currencyCode) || '',
421
422
  itemsAmount: total,
422
423
  metadata: [{ key: 'language', value: localizationStore.selectedLocale }],
423
- presentmentCountryCode: localizationStore.selectedCountryCode || null,
424
+ presentmentCountryCode: localizationStore.selectedCountryCode ||
425
+ DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT,
424
426
  },
425
427
  method: 'POST',
426
428
  });
@@ -15,6 +15,10 @@ import { getCurrencyCode } from "../../utils/hello/currencyConversion/getCurrenc
15
15
  import { setZCountryUrlParam } from "../../utils/hello/setZCountryUrlParam";
16
16
  import { log } from "../../utils/logging/log";
17
17
  import { logError } from "../../utils/logging/logError";
18
+ /**
19
+ * CHORE: This is mostly for legacy checkout as the country param is not guaranteed.
20
+ */
21
+ export const DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT = 'CA';
18
22
  const { dispose: localizationDispose, onChange: localizationStoreOnUpdate, state: localizationStore, } = createStore({
19
23
  countryLandedCost: null,
20
24
  customMessages: [],
@@ -128,7 +132,7 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
128
132
  // update shippable country
129
133
  localizationStore.isShippableCountry = isShippableCountry;
130
134
  log(`${localizationStore.selectedCountryCode} is a shippable country: ${localizationStore.isShippableCountry}`);
131
- const isDisabledCountry = !selectedCountryCode ||
135
+ const isDisabledCountry = !!selectedCountryCode &&
132
136
  zonosStore.disabledCountries.includes(selectedCountryCode);
133
137
  localizationStore.isDisabledCountry = isDisabledCountry;
134
138
  log(`${localizationStore.selectedCountryCode} is a disabled country: ${localizationStore.isDisabledCountry}`);
@@ -206,7 +210,7 @@ const initLocalizationStore = async () => {
206
210
  if (!localizationStore.selectedCountryCode &&
207
211
  devSites.some(site => window.location.origin.includes(site))) {
208
212
  // update selected country code in store
209
- localizationStoreUpdateSelectedCountryCode('US');
213
+ localizationStoreUpdateSelectedCountryCode('CA');
210
214
  }
211
215
  localizationStore.localizationLoaded = true;
212
216
  };