@zonos/elements 1.3.230 → 1.3.231

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 (233) hide show
  1. package/dist/cjs/{cart-ad82a680.js → cart-9b519566.js} +6 -2
  2. package/dist/cjs/hasInclusivePrice-12605be9.js +24 -0
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{localization-31e3dfe3.js → localization-38af974b.js} +118 -30
  5. package/dist/cjs/{paypal-88b5e878.js → paypal-e8fa2302.js} +3 -3
  6. package/dist/cjs/{placeTestOrder-6aefbf9c.js → placeTestOrder-6388881f.js} +11 -7
  7. package/dist/cjs/{renderFallback-87c908ad.js → renderFallback-bb2c4bce.js} +2 -2
  8. package/dist/cjs/{translationStore-b8b25e9d.js → translationStore-f2d5eae9.js} +420 -360
  9. package/dist/cjs/zonos-address_11.cjs.entry.js +21 -5
  10. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +73 -13
  11. package/dist/cjs/zonos-checkout.cjs.entry.js +8 -5
  12. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +3 -3
  13. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
  14. package/dist/cjs/zonos-collect.cjs.entry.js +5 -5
  15. package/dist/cjs/zonos-confirm-dialog_2.cjs.entry.js +1 -1
  16. package/dist/cjs/zonos-controller.cjs.entry.js +12 -5
  17. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  18. package/dist/cjs/zonos-country-select_4.cjs.entry.js +9 -6
  19. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +4 -4
  20. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +55 -45
  21. package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
  22. package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
  23. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +68 -7
  24. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -1
  25. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.js +2 -1
  26. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +7 -4
  27. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +54 -43
  28. package/dist/collection/components/main/zonos-controller.js +5 -2
  29. package/dist/collection/components/store/hello/localization.js +47 -16
  30. package/dist/collection/components/store/translationStore/strings.arabic.js +21 -18
  31. package/dist/collection/components/store/translationStore/strings.base.js +21 -18
  32. package/dist/collection/components/store/translationStore/strings.chinese.js +21 -18
  33. package/dist/collection/components/store/translationStore/strings.danish.js +21 -18
  34. package/dist/collection/components/store/translationStore/strings.dutch.js +21 -18
  35. package/dist/collection/components/store/translationStore/strings.french.js +21 -18
  36. package/dist/collection/components/store/translationStore/strings.german.js +21 -18
  37. package/dist/collection/components/store/translationStore/strings.hebrew.js +21 -18
  38. package/dist/collection/components/store/translationStore/strings.indonesian.js +21 -18
  39. package/dist/collection/components/store/translationStore/strings.italian.js +21 -18
  40. package/dist/collection/components/store/translationStore/strings.japanese.js +21 -18
  41. package/dist/collection/components/store/translationStore/strings.korean.js +21 -18
  42. package/dist/collection/components/store/translationStore/strings.norwegian.js +21 -18
  43. package/dist/collection/components/store/translationStore/strings.polish.js +21 -18
  44. package/dist/collection/components/store/translationStore/strings.portuguese.js +21 -18
  45. package/dist/collection/components/store/translationStore/strings.russian.js +21 -18
  46. package/dist/collection/components/store/translationStore/strings.spanish.js +21 -18
  47. package/dist/collection/components/store/translationStore/strings.swedish.js +21 -18
  48. package/dist/collection/components/store/translationStore/strings.turkish.js +21 -18
  49. package/dist/collection/components/store/translationStore/strings.vietnamese.js +21 -18
  50. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +18 -2
  51. package/dist/collection/components/utils/api/{getInclusivePricing.js → getInclusivePriceConfigurations.js} +1 -1
  52. package/dist/collection/components/utils/api/getLocalization.js +2 -5
  53. package/dist/collection/components/utils/api/getZonosSettings.js +5 -0
  54. package/dist/collection/components/utils/api/prepCalculateLandedCost.js +6 -0
  55. package/dist/collection/components/utils/checkout/renderCheckoutCurrency.js +10 -5
  56. package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +4 -1
  57. package/dist/collection/components/utils/getOverridenZCountry.js +11 -0
  58. package/dist/collection/components/utils/hasInclusivePrice.js +10 -0
  59. package/dist/collection/components/utils/hello/currencyConversion/applyInclusiveEffectiveRate.js +10 -0
  60. package/dist/collection/components/utils/hello/currencyConversion/applyInclusivePrice.js +39 -0
  61. package/dist/collection/components/utils/hello/currencyConversion/calculateInclusivePrice.js +32 -0
  62. package/dist/collection/components/utils/hello/currencyConversion/defaultCurrencyConverter.js +11 -6
  63. package/dist/collection/constants/key.js +9 -0
  64. package/dist/collection/types/InclusivePricing.js +1 -0
  65. package/dist/collection/types/generated/graphql.internal.types.js +87 -3
  66. package/dist/collection/types/index.js +1 -0
  67. package/dist/collection/utils/performBlurCurrency.js +38 -5
  68. package/dist/esm/{cart-c74f9aaa.js → cart-bc0e1598.js} +6 -2
  69. package/dist/esm/hasInclusivePrice-706cc09d.js +20 -0
  70. package/dist/esm/index.js +7 -7
  71. package/dist/esm/{localization-106476cb.js → localization-53f67640.js} +117 -31
  72. package/dist/esm/{paypal-bf3a2bdd.js → paypal-3a6a048d.js} +3 -3
  73. package/dist/esm/{placeTestOrder-891295e8.js → placeTestOrder-917731cf.js} +11 -7
  74. package/dist/esm/{renderFallback-ce0e238a.js → renderFallback-cd0e40d9.js} +2 -2
  75. package/dist/esm/{translationStore-766b7521.js → translationStore-d241dcf7.js} +420 -360
  76. package/dist/esm/zonos-address_11.entry.js +21 -5
  77. package/dist/esm/zonos-cart-items_13.entry.js +73 -13
  78. package/dist/esm/zonos-checkout.entry.js +8 -5
  79. package/dist/esm/zonos-collect-cart-items_3.entry.js +3 -3
  80. package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
  81. package/dist/esm/zonos-collect.entry.js +5 -5
  82. package/dist/esm/zonos-confirm-dialog_2.entry.js +1 -1
  83. package/dist/esm/zonos-controller.entry.js +12 -5
  84. package/dist/esm/zonos-country-flag.entry.js +2 -2
  85. package/dist/esm/zonos-country-select_4.entry.js +9 -6
  86. package/dist/esm/zonos-empty-state-payment_4.entry.js +4 -4
  87. package/dist/esm/zonos-hello-dialog.entry.js +55 -45
  88. package/dist/esm/zonos-hello.entry.js +2 -2
  89. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  90. package/dist/esm-es5/cart-bc0e1598.js +1 -0
  91. package/dist/esm-es5/hasInclusivePrice-706cc09d.js +1 -0
  92. package/dist/esm-es5/index.js +1 -1
  93. package/dist/esm-es5/localization-53f67640.js +1 -0
  94. package/dist/esm-es5/{paypal-bf3a2bdd.js → paypal-3a6a048d.js} +1 -1
  95. package/dist/esm-es5/placeTestOrder-917731cf.js +1 -0
  96. package/dist/esm-es5/{renderFallback-ce0e238a.js → renderFallback-cd0e40d9.js} +1 -1
  97. package/dist/esm-es5/translationStore-d241dcf7.js +1 -0
  98. package/dist/esm-es5/zonos-address_11.entry.js +1 -1
  99. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  100. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  101. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  102. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  103. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  104. package/dist/esm-es5/zonos-confirm-dialog_2.entry.js +1 -1
  105. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  106. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  107. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  108. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  109. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  110. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  111. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  112. package/dist/scripts/blurCurrencyOnInit.js +1 -1
  113. package/dist/scripts/index.d.ts +31 -6
  114. package/dist/scripts/index.js +1 -1
  115. package/dist/scripts/loadZonos.js +1 -1
  116. package/dist/scripts/zonos.js +1 -1
  117. package/dist/types/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.d.ts +2 -0
  118. package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +1 -1
  119. package/dist/types/components/store/checkout/cart.d.ts +3 -0
  120. package/dist/types/components/store/hello/localization.d.ts +14 -3
  121. package/dist/types/components/store/translationStore/strings.arabic.d.ts +18 -15
  122. package/dist/types/components/store/translationStore/strings.base.d.ts +18 -15
  123. package/dist/types/components/store/translationStore/strings.chinese.d.ts +18 -15
  124. package/dist/types/components/store/translationStore/strings.danish.d.ts +18 -15
  125. package/dist/types/components/store/translationStore/strings.dutch.d.ts +18 -15
  126. package/dist/types/components/store/translationStore/strings.french.d.ts +18 -15
  127. package/dist/types/components/store/translationStore/strings.german.d.ts +18 -15
  128. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +18 -15
  129. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +18 -15
  130. package/dist/types/components/store/translationStore/strings.italian.d.ts +18 -15
  131. package/dist/types/components/store/translationStore/strings.japanese.d.ts +18 -15
  132. package/dist/types/components/store/translationStore/strings.korean.d.ts +18 -15
  133. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +18 -15
  134. package/dist/types/components/store/translationStore/strings.polish.d.ts +18 -15
  135. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +18 -15
  136. package/dist/types/components/store/translationStore/strings.russian.d.ts +18 -15
  137. package/dist/types/components/store/translationStore/strings.spanish.d.ts +18 -15
  138. package/dist/types/components/store/translationStore/strings.swedish.d.ts +18 -15
  139. package/dist/types/components/store/translationStore/strings.turkish.d.ts +18 -15
  140. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +18 -15
  141. package/dist/types/components/utils/api/getInclusivePriceConfigurations.d.ts +2 -0
  142. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  143. package/dist/types/components/utils/getOverridenZCountry.d.ts +5 -0
  144. package/dist/types/components/utils/hasInclusivePrice.d.ts +1 -0
  145. package/dist/types/components/utils/hello/currencyConversion/applyInclusiveEffectiveRate.d.ts +1 -0
  146. package/dist/types/components/utils/hello/currencyConversion/applyInclusivePrice.d.ts +1 -0
  147. package/dist/types/components/utils/hello/currencyConversion/calculateInclusivePrice.d.ts +27 -0
  148. package/dist/types/constants/key.d.ts +9 -0
  149. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +1 -0
  150. package/dist/types/types/InclusivePricing.d.ts +13 -0
  151. package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +1 -0
  152. package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +2 -0
  153. package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
  154. package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
  155. package/dist/types/types/generated/graphql.internal.types.d.ts +184 -51
  156. package/dist/types/types/generated/graphql.internal.types.ts +221 -50
  157. package/dist/types/types/index.d.ts +1 -0
  158. package/dist/types/types/utils/ZonosSettings.d.ts +2 -0
  159. package/dist/types/utils/performBlurCurrency.d.ts +12 -0
  160. package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
  161. package/dist/zonos-elements/index.esm.js +1 -1
  162. package/dist/zonos-elements/{p-c89e9d56.system.js → p-0047fecf.system.js} +1 -1
  163. package/dist/zonos-elements/{p-bd373de0.system.entry.js → p-0bc8e55c.system.entry.js} +1 -1
  164. package/dist/zonos-elements/{p-964a4d85.js → p-2008df67.js} +1 -1
  165. package/dist/zonos-elements/{p-2db90c99.system.entry.js → p-22338b4a.system.entry.js} +1 -1
  166. package/dist/zonos-elements/{p-38f2f63f.system.entry.js → p-2eaa5013.system.entry.js} +1 -1
  167. package/dist/zonos-elements/{p-288f5a5b.system.entry.js → p-304bdbc2.system.entry.js} +1 -1
  168. package/dist/zonos-elements/p-30981f80.entry.js +1 -0
  169. package/dist/zonos-elements/p-3a242dfc.system.js +1 -0
  170. package/dist/zonos-elements/{p-5608ac9d.entry.js → p-3eda5c2c.entry.js} +1 -1
  171. package/dist/zonos-elements/p-3f0ca5f9.js +1 -0
  172. package/dist/zonos-elements/{p-23f6a2fb.system.entry.js → p-3f35b8b1.system.entry.js} +1 -1
  173. package/dist/zonos-elements/{p-de984173.system.js → p-419c292c.system.js} +1 -1
  174. package/dist/zonos-elements/{p-7a97e1cf.system.entry.js → p-4697f061.system.entry.js} +1 -1
  175. package/dist/zonos-elements/p-4f5be8f0.entry.js +1 -0
  176. package/dist/zonos-elements/p-516a9666.system.js +1 -0
  177. package/dist/zonos-elements/p-55c6ff14.system.entry.js +1 -0
  178. package/dist/zonos-elements/p-6d563f33.system.entry.js +1 -0
  179. package/dist/zonos-elements/{p-caebc1f8.system.js → p-7730879e.system.js} +1 -1
  180. package/dist/zonos-elements/p-7920d79c.system.js +1 -0
  181. package/dist/zonos-elements/p-7c96a585.js +1 -0
  182. package/dist/zonos-elements/p-81b357f7.system.js +1 -1
  183. package/dist/zonos-elements/{p-2b84039a.entry.js → p-91fa43ef.entry.js} +1 -1
  184. package/dist/zonos-elements/p-9a444a82.system.entry.js +1 -0
  185. package/dist/zonos-elements/p-9bdad585.system.entry.js +1 -0
  186. package/dist/zonos-elements/p-abc0fb80.js +1 -0
  187. package/dist/zonos-elements/{p-b0a75761.entry.js → p-ac26a931.entry.js} +1 -1
  188. package/dist/zonos-elements/p-bb707dfd.system.js +1 -0
  189. package/dist/zonos-elements/{p-10894d36.entry.js → p-bc963b03.entry.js} +1 -1
  190. package/dist/zonos-elements/p-c0e080e3.js +1 -0
  191. package/dist/zonos-elements/p-c20429ea.entry.js +1 -0
  192. package/dist/zonos-elements/p-c28da00e.entry.js +1 -0
  193. package/dist/zonos-elements/p-c9be03e0.entry.js +1 -0
  194. package/dist/zonos-elements/{p-6c8e4f01.system.entry.js → p-cb70de13.system.entry.js} +1 -1
  195. package/dist/zonos-elements/p-cec35a21.entry.js +1 -0
  196. package/dist/zonos-elements/{p-cf56b990.entry.js → p-d15cd138.entry.js} +1 -1
  197. package/dist/zonos-elements/{p-6f1024de.system.entry.js → p-d852d6da.system.entry.js} +1 -1
  198. package/dist/zonos-elements/p-d9486c57.entry.js +1 -0
  199. package/dist/zonos-elements/p-db73c11a.entry.js +1 -0
  200. package/dist/zonos-elements/{p-203c7fda.js → p-e27a9450.js} +1 -1
  201. package/dist/zonos-elements/{p-258570ce.entry.js → p-ede9e968.entry.js} +1 -1
  202. package/dist/zonos-elements/p-ee8fcde6.js +1 -0
  203. package/dist/zonos-elements/p-f688d7a4.system.js +1 -0
  204. package/dist/zonos-elements/{p-236e0144.system.entry.js → p-ff1722d0.system.entry.js} +1 -1
  205. package/dist/zonos-elements/p-ff522088.system.entry.js +1 -0
  206. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  207. package/package.json +3 -3
  208. package/dist/esm-es5/cart-c74f9aaa.js +0 -1
  209. package/dist/esm-es5/localization-106476cb.js +0 -1
  210. package/dist/esm-es5/placeTestOrder-891295e8.js +0 -1
  211. package/dist/esm-es5/translationStore-766b7521.js +0 -1
  212. package/dist/types/components/utils/api/getInclusivePricing.d.ts +0 -6
  213. package/dist/zonos-elements/p-053a042e.entry.js +0 -1
  214. package/dist/zonos-elements/p-1d15662c.js +0 -1
  215. package/dist/zonos-elements/p-21b251f0.system.entry.js +0 -1
  216. package/dist/zonos-elements/p-225a61c4.system.entry.js +0 -1
  217. package/dist/zonos-elements/p-462f8857.entry.js +0 -1
  218. package/dist/zonos-elements/p-57ee34aa.system.entry.js +0 -1
  219. package/dist/zonos-elements/p-595668d7.system.js +0 -1
  220. package/dist/zonos-elements/p-62803534.entry.js +0 -1
  221. package/dist/zonos-elements/p-6497ce22.entry.js +0 -1
  222. package/dist/zonos-elements/p-65db3219.entry.js +0 -1
  223. package/dist/zonos-elements/p-783e7fa7.entry.js +0 -1
  224. package/dist/zonos-elements/p-9972941a.entry.js +0 -1
  225. package/dist/zonos-elements/p-ad7be556.system.entry.js +0 -1
  226. package/dist/zonos-elements/p-b4fe3604.system.js +0 -1
  227. package/dist/zonos-elements/p-b8293509.js +0 -1
  228. package/dist/zonos-elements/p-c3c3cd98.js +0 -1
  229. package/dist/zonos-elements/p-c6d0e87d.system.entry.js +0 -1
  230. package/dist/zonos-elements/p-cdaf52f4.system.js +0 -1
  231. package/dist/zonos-elements/p-cef1e888.system.js +0 -1
  232. package/dist/zonos-elements/p-eea0d8af.js +0 -1
  233. package/dist/zonos-elements/p-f4085c23.entry.js +0 -1
@@ -1,6 +1,6 @@
1
1
  import { z as zonosStore, c as createStore } from './zonosStore-e3d0493a.js';
2
- import { s as storageStore, l as localizationStore, f as filterValidTests, b as storageStoreSetEnabledVariantTestKeys } from './localization-106476cb.js';
3
- import { t as translate } from './translationStore-766b7521.js';
2
+ import { s as storageStore, l as localizationStore, e as getOverridenZCountry, f as filterValidTests, b as storageStoreSetEnabledVariantTestKeys } from './localization-53f67640.js';
3
+ import { t as translate } from './translationStore-d241dcf7.js';
4
4
  import { f as fallbackApiList, h as handleFetch, g as getIsTestMode, a as getIsStagingMode, s as sendErrorLog, l as logError, j as jsonParse } from './handleFetch-a844cac1.js';
5
5
  import { l as log, b as allLogs } from './VarianceTest-572cecf5.js';
6
6
  import { i as isDarkColor } from './isDarkColor-83e0c27e.js';
@@ -73,6 +73,7 @@ const prepCartCalculateLandedCost = (cartId) => {
73
73
  const { firstName: billingFirstName, lastName: billingLastName } = extractName({
74
74
  name: translatedBillingAddress.name,
75
75
  });
76
+ const checkoutSessionCountry = getOverridenZCountry() || 'US';
76
77
  return {
77
78
  billingAddress: {
78
79
  addressLine1: translatedBillingAddress.line1,
@@ -92,6 +93,9 @@ const prepCartCalculateLandedCost = (cartId) => {
92
93
  // Use the first item's currency code
93
94
  cartCurrencyCode: (_a = cartStore.items[0]) === null || _a === void 0 ? void 0 : _a.currencyCode,
94
95
  cartId,
96
+ checkoutSessionCountry: checkoutSessionCountry ||
97
+ localizationStore.selectedCountryCode ||
98
+ undefined,
95
99
  checkoutSessionId: storageStore.checkoutSessionId || '',
96
100
  contact: {
97
101
  companyName: stripeStore.companyName,
@@ -0,0 +1,20 @@
1
+ import { l as localizationStore } from './localization-53f67640.js';
2
+
3
+ /**
4
+ * Since the backend and the frontend are using the same keys,
5
+ * make sure to not change the key value below since if it changes
6
+ * and the frontend script is cached, the formula may not work as expected.
7
+ */
8
+ const DUTY_KEY = 'gkjqw123';
9
+ const TAXES_KEY = 'Kq93wqw3';
10
+
11
+ const hasInclusivePrice = () => {
12
+ var _a;
13
+ return (_a = localizationStore.inclusivePricingConfigurations) === null || _a === void 0 ? void 0 : _a.some(x => {
14
+ var _a, _b;
15
+ return ((_a = x.configurations[DUTY_KEY]) === null || _a === void 0 ? void 0 : _a.status) === 'ENABLED' ||
16
+ ((_b = x.configurations[TAXES_KEY]) === null || _b === void 0 ? void 0 : _b.status) === 'ENABLED';
17
+ });
18
+ };
19
+
20
+ export { DUTY_KEY as D, TAXES_KEY as T, hasInclusivePrice as h };
package/dist/esm/index.js CHANGED
@@ -130,7 +130,7 @@ const getZonosQaUrl = () => {
130
130
  return null;
131
131
  }
132
132
  const qaUrl = extractZonosQaUrl(window.location.href);
133
- const cdnUrl = "https://v1.3.230.js.zonos.com";
133
+ const cdnUrl = "https://v1.3.231.js.zonos.com";
134
134
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
135
135
  if (!qaUrl &&
136
136
  (cdnUrl.includes('test.') ||
@@ -378,10 +378,10 @@ const zonosLoadUrl = (() => {
378
378
  return null;
379
379
  })();
380
380
  const startLoadTime = Date.now();
381
- const ZONOS_URL = "https://v1.3.230.js.zonos.com";
382
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.230";
383
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.230";
384
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.230";
381
+ const ZONOS_URL = "https://v1.3.231.js.zonos.com";
382
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.231";
383
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.231";
384
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.231";
385
385
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
386
386
  const GOOGLE_FONT_REGEX = /^https:\/\/fonts\.googleapis\.com/;
387
387
  class Zonos {
@@ -399,7 +399,7 @@ Zonos.iframeLogType = typeof window !== 'undefined'
399
399
  ? new URLSearchParams(window.location.search).get('iframeLogType')
400
400
  : null;
401
401
  Zonos.isBigCommerce = false;
402
- Zonos.releaseDate = "1754428639201";
402
+ Zonos.releaseDate = "1754944720824";
403
403
  Zonos.isLegacyCheckout = false;
404
404
  Zonos.startLoadTime = startLoadTime;
405
405
  Zonos.domain = typeof window !== 'undefined'
@@ -419,7 +419,7 @@ Zonos.isNpm = true;
419
419
  Zonos.zonosQaUrl = null;
420
420
  Zonos.zonosQaUrlApi = null;
421
421
  Zonos.trackEventLogs = [];
422
- Zonos.version = `v${"1.3.230"}`;
422
+ Zonos.version = `v${"1.3.231"}`;
423
423
  Zonos.modeAlerted = false;
424
424
  Zonos.cartData = null;
425
425
  Zonos.paypal = null;
@@ -1,7 +1,7 @@
1
1
  import { c as createStore, z as zonosStore } from './zonosStore-e3d0493a.js';
2
2
  import { j as jsonParse, h as handleFetch, l as logError } from './handleFetch-a844cac1.js';
3
3
  import { a as availableTestKeys, l as log } from './VarianceTest-572cecf5.js';
4
- import { a as translationStoreUpdateLanguage } from './translationStore-766b7521.js';
4
+ import { a as translationStoreUpdateLanguage } from './translationStore-d241dcf7.js';
5
5
 
6
6
  /**
7
7
  * Check if the response contains at least one available test key that we support
@@ -135,7 +135,7 @@ const getExchangeRate = async ({ country, isGuaranteed, sourceCurrency, targetCu
135
135
  return defaultUsExchangeRate;
136
136
  };
137
137
 
138
- const getInclusivePricing = async (countryCode) => {
138
+ const getInclusivePriceConfigurations = async (countryCode) => {
139
139
  var _a;
140
140
  if (!countryCode) {
141
141
  return null;
@@ -186,12 +186,20 @@ const getZCountryUrlParam = (urlParams) => {
186
186
  return zCountry || fallback || secondFallback;
187
187
  };
188
188
 
189
+ /**
190
+ * Retrieve the zCountry from the URL or session storage.
191
+ */
192
+ const getOverridenZCountry = () => {
193
+ const currentUrl = new URL(window.location.href);
194
+ // load and use country from session storage when zCountry query param is not present
195
+ const countryLoadedSession = window.sessionStorage.getItem('zonos--country');
196
+ const zCountry = getZCountryUrlParam(currentUrl.searchParams) || countryLoadedSession;
197
+ return zCountry;
198
+ };
199
+
189
200
  const getLocalization = async () => {
190
201
  try {
191
- const currentUrl = new URL(window.location.href);
192
- // load and use country from session storage when zCountry query param is not present
193
- const countryLoadedSession = window.sessionStorage.getItem('zonos--country');
194
- const zCountry = getZCountryUrlParam(currentUrl.searchParams) || countryLoadedSession;
202
+ const zCountry = getOverridenZCountry();
195
203
  const searchParams = new URLSearchParams();
196
204
  if (zCountry) {
197
205
  searchParams.set('zCountry', zCountry);
@@ -226,6 +234,16 @@ const getShippingZones = async () => {
226
234
  return shippingZones || null;
227
235
  };
228
236
 
237
+ const applyInclusiveEffectiveRate = (amount) => {
238
+ const inclusivePrice = localizationStore.inclusivePricingConfigurations.find(x => x.shipToCountry === localizationStore.selectedCountryCode);
239
+ if (!inclusivePrice) {
240
+ return amount;
241
+ }
242
+ const effectiveRate = inclusivePrice.effectiveRate;
243
+ // Just multiply the amount by the effective rate to get the new amount for inclusive pricing
244
+ return amount * (1 + effectiveRate);
245
+ };
246
+
229
247
  const currencyConvert = (value) => {
230
248
  // TODO(potentially): Bring over the code for vanity checks
231
249
  const { exchangeRate } = localizationStore;
@@ -389,15 +407,48 @@ const removeBlurCurrency = async () => {
389
407
  });
390
408
  window.zonosBlurCurrencyOnInitIntervalId = undefined;
391
409
  };
392
- const blurCurrencyElements = ({ currencySelector, }) => {
410
+ /**
411
+ * This function is used to remove the blur effect from a specific element. (combined with performBlurSpecificElement)
412
+ * @returns void
413
+ */
414
+ const removeBlurSpecificElement = async ({ specificSelector, timeoutId, }) => {
415
+ // Wait a bit to make sure price is fully rendered in DOM
416
+ await new Promise(resolve => setTimeout(resolve, 500));
417
+ if (timeoutId) {
418
+ clearTimeout(timeoutId);
419
+ }
420
+ specificSelector.classList.remove(BLUR_CURRENCY_CLASSNAME);
421
+ };
422
+ const blurCurrencyElements = ({ currencySelector, specificSelector, }) => {
393
423
  // Do nothing if the currency selector is not provided or blurCurrencyOnInit is false
394
- if (!currencySelector) {
424
+ if (!currencySelector && !specificSelector) {
395
425
  return;
396
426
  }
397
- const currencyElements = document.querySelectorAll([currencySelector].filter(Boolean).join(','));
398
- currencyElements.forEach(element => {
399
- element.classList.add(BLUR_CURRENCY_CLASSNAME);
427
+ if (specificSelector) {
428
+ specificSelector.classList.add(BLUR_CURRENCY_CLASSNAME);
429
+ }
430
+ else {
431
+ const currencyElements = document.querySelectorAll([currencySelector].filter(Boolean).join(','));
432
+ currencyElements.forEach(element => {
433
+ element.classList.add(BLUR_CURRENCY_CLASSNAME);
434
+ });
435
+ }
436
+ };
437
+ const performBlurSpecificElement = (specificSelector) => {
438
+ if (typeof window === 'undefined') {
439
+ return;
440
+ }
441
+ blurCurrencyElements({
442
+ specificSelector,
400
443
  });
444
+ // The blur will be removed as soon as we got the exchange rate back. But if the exchange rate is not available for some reason, the blur effect will be automatically removed after 10 seconds
445
+ const timeoutId = setTimeout(() => {
446
+ void removeBlurSpecificElement({
447
+ specificSelector,
448
+ timeoutId,
449
+ });
450
+ }, BLUR_CURRENCY_DURATION);
451
+ return timeoutId;
401
452
  };
402
453
  const performBlurCurrency = () => {
403
454
  if (typeof window === 'undefined') {
@@ -447,18 +498,20 @@ const convertCurrency = (element) => {
447
498
  // Update currency when the country code changes
448
499
  currentCountryValue !== localizationStore.selectedCountryCode)) {
449
500
  // Hide the currency until DOM is ready to display the new value
450
- performBlurCurrency();
501
+ const timeoutId = performBlurSpecificElement(element);
502
+ const appliedInclusivePrice = applyInclusiveEffectiveRate(amount);
451
503
  const customizedCurrencyFormat = typeof zonosStore.currencyConverter === 'function' &&
452
504
  zonosStore.currencyConverter({
453
505
  convert: currencyConvert,
454
506
  convertAndFormat: currencyConvertAndFormat,
455
507
  currencyCode: localizationStore.targetCurrency,
456
508
  format: (value) => currencyFormat({ amount: value }),
457
- originalAmount: amount,
509
+ originalAmount: appliedInclusivePrice,
458
510
  selector: element,
459
511
  });
460
512
  // default to the currencyConvertAndFormat if the currencyConverter function does not return a value, or invalid value. This is to make sure we don't break the merchant's price.
461
- const observedFormattedValue = customizedCurrencyFormat || currencyConvertAndFormat(amount);
513
+ const observedFormattedValue = customizedCurrencyFormat ||
514
+ currencyConvertAndFormat(appliedInclusivePrice);
462
515
  if (observedFormattedValue !== element.textContent) {
463
516
  // Only set textContent if the value has changed, this is to prevent it redrawing the element if the value is the same
464
517
  element.textContent = observedFormattedValue;
@@ -468,9 +521,11 @@ const convertCurrency = (element) => {
468
521
  // save the new value to the data-zintl attribute
469
522
  element.setAttribute('data-zintl', observedFormattedValue);
470
523
  element.setAttribute('data-zcountry-code', localizationStore.selectedCountryCode || '');
524
+ void removeBlurSpecificElement({
525
+ specificSelector: element,
526
+ timeoutId,
527
+ });
471
528
  }
472
- // Remove blur effect after the currency is converted
473
- void removeBlurCurrency();
474
529
  };
475
530
  const defaultCurrencyConverter = () => {
476
531
  const { currencyElementSelector } = zonosStore.helloSettings;
@@ -532,7 +587,8 @@ const { dispose: localizationDispose, onChange: localizationStoreOnChange, state
532
587
  customMessages: [],
533
588
  exchangeRate: null,
534
589
  helloCountryList: null,
535
- inclusivePricing: null,
590
+ inclusivePricingConfigurations: [],
591
+ inclusivePricingIsFetching: false,
536
592
  isDisabledCountry: true,
537
593
  isShippableCountry: false,
538
594
  localizationLoaded: false,
@@ -566,6 +622,17 @@ const getFallbackDefaultCountryCode = (allowedCountries) => {
566
622
  // Don't check if it is allowed. If it is not allowed it will fallback to Albania (first option).
567
623
  return DEFAULT_COUNTRY_CODE_LEGACY_CHECKOUT;
568
624
  };
625
+ const refreshInclusivePricingConfigurations = async (countryCode) => {
626
+ if (!countryCode) {
627
+ return;
628
+ }
629
+ // These requests are only needed for Hello, so we can skip them for legacy checkout
630
+ localizationStore.inclusivePricingIsFetching = true;
631
+ const inclusivePricingConfigurations = await getInclusivePriceConfigurations(countryCode);
632
+ localizationStore.inclusivePricingConfigurations =
633
+ inclusivePricingConfigurations || [];
634
+ localizationStore.inclusivePricingIsFetching = false;
635
+ };
569
636
  // This recursive function is for users who step away from their computer and come back needing a new exchange rate
570
637
  const startExchangeRateTimeout = ({ isGuaranteed, maxAge, }) => {
571
638
  if (localizationStore.exchangeRateTimeout) {
@@ -576,12 +643,14 @@ const startExchangeRateTimeout = ({ isGuaranteed, maxAge, }) => {
576
643
  const maxAgeToUse = maxAge || defaultMaxAge;
577
644
  // Recursively set timeouts to get new exchange rates when the current one expires
578
645
  localizationStore.exchangeRateTimeout = setTimeout(async () => {
646
+ // Refresh inclusive pricing configurations before getting a new exchange rate, so hello can use the new effective rate
647
+ await refreshInclusivePricingConfigurations(localizationStore.selectedCountryCode);
579
648
  const { maxAge: newMaxAge } = await triggerGetExchangeRate(isGuaranteed);
580
649
  startExchangeRateTimeout({ isGuaranteed, maxAge: newMaxAge });
581
650
  }, maxAgeToUse * 1000);
582
651
  };
583
- const getNewLocalization = async () => {
584
- var _a;
652
+ const getNewLocalization = async ({ isInitializing, }) => {
653
+ var _a, _b;
585
654
  log('get new localization store');
586
655
  const { isDisabledCountry, isShippableCountry, selectedCountryCode } = localizationStore;
587
656
  if (zonosStore.helloSettings.currencyBehavior === 'DISABLED' ||
@@ -595,14 +664,22 @@ const getNewLocalization = async () => {
595
664
  performBlurCurrency();
596
665
  const { maxAge } = await triggerGetExchangeRate(isGuaranteed);
597
666
  startExchangeRateTimeout({ isGuaranteed, maxAge });
667
+ if (isInitializing &&
668
+ ((_a = window.Zonos.cartSettings) === null || _a === void 0 ? void 0 : _a.inclusivePriceConfigurations)) {
669
+ localizationStore.inclusivePricingConfigurations =
670
+ ((_b = window.Zonos.cartSettings) === null || _b === void 0 ? void 0 : _b.inclusivePriceConfigurations) || [];
671
+ void removeBlurCurrency();
672
+ }
673
+ // These requests are only needed for Hello, so we can skip them for legacy checkout
598
674
  if (!window.Zonos.isLegacyCheckout) {
599
- // These requests are only needed for Hello, so we can skip them for legacy checkout
600
- localizationStore.countryLandedCost = await getCountryLandedCost(localizationStore.selectedCountryCode);
601
- localizationStore.inclusivePricing =
602
- ((_a = (await getInclusivePricing(selectedCountryCode))) === null || _a === void 0 ? void 0 : _a.setting) || null;
603
- if (localizationStore.inclusivePricing) {
604
- log(`Inclusive price setting found for this country (${selectedCountryCode}) ${JSON.stringify(localizationStore.inclusivePricing, null, 2)}`);
605
- }
675
+ localizationStore.inclusivePricingIsFetching = true;
676
+ const [countryLandedCost] = await Promise.all([
677
+ getCountryLandedCost(localizationStore.selectedCountryCode),
678
+ refreshInclusivePricingConfigurations(localizationStore.selectedCountryCode),
679
+ ]);
680
+ localizationStore.countryLandedCost = countryLandedCost;
681
+ // Remove blur effect after the currency is converted
682
+ void removeBlurCurrency();
606
683
  }
607
684
  else {
608
685
  log('Skipping country landed cost and inclusive pricing requests, because this is a legacy checkout');
@@ -647,7 +724,7 @@ const getValidCountryCode = (countryCode) => {
647
724
  }
648
725
  return countryCode;
649
726
  };
650
- const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
727
+ const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelectedCountryCode, }) => {
651
728
  var _a, _b;
652
729
  log(`Updating selected country code to ${newSelectedCountryCode}`);
653
730
  const isFirstTime = !localizationStore.selectedCountryCode;
@@ -683,7 +760,7 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
683
760
  return;
684
761
  }
685
762
  localizationStore.targetCurrency = currencyCode;
686
- void getNewLocalization();
763
+ void getNewLocalization({ isInitializing: isInitializing });
687
764
  // Save the country code to session storage for later use
688
765
  window.sessionStorage.setItem('zonos--country', selectedCountryCode);
689
766
  // Update the URL query param with the new country code
@@ -740,6 +817,7 @@ const localizationStoreUpdateSelectedLocale = (newSelectedLocale) => {
740
817
  void getCustomMessages();
741
818
  };
742
819
  const initLocalizationStore = async () => {
820
+ var _a;
743
821
  // all countries from countries.json, shipping zone and localization
744
822
  const [allCountries, shippingZoneCountries, localization] = await Promise.all([getCountries(), getShippingZones(), getLocalization()]);
745
823
  // Filter countries to only include countries in the shipping zone
@@ -749,13 +827,18 @@ const initLocalizationStore = async () => {
749
827
  ? Object.assign(Object.assign({}, acc), { [countryCode]: countryInfo }) : acc;
750
828
  }, {});
751
829
  localizationStore.shippingZoneCountries = filteredCountries || null;
830
+ localizationStore.inclusivePricingConfigurations =
831
+ ((_a = window.Zonos.cartSettings) === null || _a === void 0 ? void 0 : _a.inclusivePriceConfigurations) || [];
752
832
  // Initialize the country list for the hello widget
753
833
  initHelloCountryList(allCountries || {});
754
834
  const { country, locale } = localization;
755
835
  log(`Country code from localization: ${country}`);
756
836
  log(`Locale from localization: ${locale}`);
757
837
  // update selected country code in store
758
- localizationStoreUpdateSelectedCountryCode(country);
838
+ localizationStoreUpdateSelectedCountryCode({
839
+ isInitializing: true,
840
+ newSelectedCountryCode: country || null,
841
+ });
759
842
  // use locale from params if it exists, otherwise use locale from localization
760
843
  const overrideLocale = getOverrideLocale();
761
844
  localizationStoreUpdateSelectedLocale(overrideLocale || locale || 'en');
@@ -769,9 +852,12 @@ const initLocalizationStore = async () => {
769
852
  if (!localizationStore.selectedCountryCode &&
770
853
  devSites.some(site => window.location.origin.includes(site))) {
771
854
  // update selected country code in store
772
- localizationStoreUpdateSelectedCountryCode('CA');
855
+ localizationStoreUpdateSelectedCountryCode({
856
+ isInitializing: true,
857
+ newSelectedCountryCode: 'CA',
858
+ });
773
859
  }
774
860
  localizationStore.localizationLoaded = true;
775
861
  };
776
862
 
777
- export { VARIANT_TEST_KEY_EXPIRATION as V, localizationStoreUpdateSelectedCountryCode as a, storageStoreSetEnabledVariantTestKeys as b, localizationStoreOnChange as c, currencyFormat as d, initLocalizationStore as e, filterValidTests as f, getZCountryUrlParam as g, setZCountryUrlParam as h, isValidSelector as i, currencyDisplay as j, currencyConvertAndFormat as k, localizationStore as l, currencyConvert as m, getFallbackDefaultCountryCode as n, storageStoreOnChange as o, localizationStoreUpdateSelectedLocale as p, storageStore as s };
863
+ export { VARIANT_TEST_KEY_EXPIRATION as V, localizationStoreUpdateSelectedCountryCode as a, storageStoreSetEnabledVariantTestKeys as b, localizationStoreOnChange as c, currencyFormat as d, getOverridenZCountry as e, filterValidTests as f, getZCountryUrlParam as g, initLocalizationStore as h, isValidSelector as i, setZCountryUrlParam as j, currencyDisplay as k, localizationStore as l, currencyConvertAndFormat as m, currencyConvert as n, applyInclusiveEffectiveRate as o, getFallbackDefaultCountryCode as p, storageStoreOnChange as q, localizationStoreUpdateSelectedLocale as r, storageStore as s };
@@ -1,7 +1,7 @@
1
1
  import { z as zonosStore, c as createStore } from './zonosStore-e3d0493a.js';
2
- import { t as trackConversionEvent, A as validateCheckoutSession, c as stripeStore, e as cartStore, v as stripeStoreHandleInventoryCheck, r as cartStoreNextStep, j as cartStoreClearCheckoutInterval } from './cart-c74f9aaa.js';
3
- import { s as storageStore } from './localization-106476cb.js';
4
- import { t as translate } from './translationStore-766b7521.js';
2
+ import { t as trackConversionEvent, A as validateCheckoutSession, c as stripeStore, e as cartStore, v as stripeStoreHandleInventoryCheck, r as cartStoreNextStep, j as cartStoreClearCheckoutInterval } from './cart-bc0e1598.js';
3
+ import { s as storageStore } from './localization-53f67640.js';
4
+ import { t as translate } from './translationStore-d241dcf7.js';
5
5
  import { h as handleFetch, l as logError, j as jsonParse } from './handleFetch-a844cac1.js';
6
6
  import { t as tinycolor } from './isDarkColor-83e0c27e.js';
7
7
  import { l as log } from './VarianceTest-572cecf5.js';
@@ -1,5 +1,5 @@
1
- import { e as cartStore } from './cart-c74f9aaa.js';
2
- import { d as currencyFormat, s as storageStore } from './localization-106476cb.js';
1
+ import { e as cartStore } from './cart-bc0e1598.js';
2
+ import { o as applyInclusiveEffectiveRate, d as currencyFormat, s as storageStore } from './localization-53f67640.js';
3
3
  import { l as logError, h as handleFetch } from './handleFetch-a844cac1.js';
4
4
 
5
5
  const getDisplayCurrency = () => {
@@ -18,12 +18,16 @@ const getDisplayCurrency = () => {
18
18
  const renderCheckoutCurrency = ({ amount, isForeign }) => {
19
19
  var _a, _b;
20
20
  const targetRate = ((_a = cartStore.exchangeRate) === null || _a === void 0 ? void 0 : _a.rate) || 1;
21
+ // If the amount already in foreign currency, no need to apply the inclusive effective rate since it's already has the inclusive effective rate applied
22
+ const appliedAmount = isForeign
23
+ ? amount
24
+ : applyInclusiveEffectiveRate(amount);
21
25
  const presentmentCurrency = cartStore.currency;
22
26
  const itemCurrency = (_b = cartStore.items[0]) === null || _b === void 0 ? void 0 : _b.currencyCode;
23
27
  // If the item currency is the same as the presentment currency, we can just return the amount in the presentment currency in the same format
24
28
  if (itemCurrency === presentmentCurrency) {
25
29
  return currencyFormat({
26
- amount,
30
+ amount: appliedAmount,
27
31
  currency: presentmentCurrency,
28
32
  });
29
33
  }
@@ -32,8 +36,8 @@ const renderCheckoutCurrency = ({ amount, isForeign }) => {
32
36
  if (isForeign) {
33
37
  // Amount is in foreign currency, divide by the rate to convert it to the base currency if displaying in base currency
34
38
  const displayAmount = shouldDisplayBaseCurrency
35
- ? amount / targetRate
36
- : amount;
39
+ ? appliedAmount / targetRate
40
+ : appliedAmount;
37
41
  return currencyFormat({
38
42
  amount: displayAmount,
39
43
  currency: displayCurrency,
@@ -41,8 +45,8 @@ const renderCheckoutCurrency = ({ amount, isForeign }) => {
41
45
  }
42
46
  // Amount is already in base currency, need to multiply rate to convert to foreign currency if display in foreign currency
43
47
  const displayAmount = shouldDisplayBaseCurrency
44
- ? amount
45
- : amount * targetRate;
48
+ ? appliedAmount
49
+ : appliedAmount * targetRate;
46
50
  return currencyFormat({
47
51
  amount: displayAmount,
48
52
  currency: displayCurrency,
@@ -1,6 +1,6 @@
1
1
  import { c as createStore, z as zonosStore } from './zonosStore-e3d0493a.js';
2
- import { c as stripeStore, C as stripeStoreBuildAddressForPartyCreate, e as cartStore, D as cartStoreUpdateSelectedShippingOption } from './cart-c74f9aaa.js';
3
- import { s as storageStore } from './localization-106476cb.js';
2
+ import { c as stripeStore, C as stripeStoreBuildAddressForPartyCreate, e as cartStore, D as cartStoreUpdateSelectedShippingOption } from './cart-bc0e1598.js';
3
+ import { s as storageStore } from './localization-53f67640.js';
4
4
  import { h as handleFetch, s as sendErrorLog, l as logError } from './handleFetch-a844cac1.js';
5
5
  import { b as allLogs } from './VarianceTest-572cecf5.js';
6
6
  import { h } from './index-55a03023.js';