@zonos/elements 1.3.288 → 1.3.290

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 (321) hide show
  1. package/dist/cjs/{cart-CV4buPlT.js → cart-7DceSLKl.js} +3 -3
  2. package/dist/cjs/{collect-jzWKzrV7.js → collect-C08DUE1L.js} +3 -3
  3. package/dist/cjs/{debounce-5sZmmlCI.js → debounce-Cd2emZPn.js} +2 -2
  4. package/dist/cjs/{debounce-Nu2lJW4A.js → debounce-vY0QYT6o.js} +1 -1
  5. package/dist/cjs/{getBorderRadius-DGZiQu09.js → getBorderRadius-CyYZw4qq.js} +1 -1
  6. package/dist/cjs/{getMissingRequiredShippingFields-r5vYIqoX.js → getMissingRequiredShippingFields-Duz8xpmf.js} +1 -1
  7. package/dist/cjs/{hasInclusivePrice-BZMQohG9.js → hasInclusivePrice-C-iyXqJ0.js} +1 -1
  8. package/dist/cjs/index.cjs.js +8 -9
  9. package/dist/cjs/{invoice-CHw-mJdS.js → invoice-DSuHUQpi.js} +3 -3
  10. package/dist/cjs/{localization-CxXsmxs5.js → localization-BJqYz_PB.js} +192 -69
  11. package/dist/cjs/{paypal-BLuHeOJH.js → paypal-CZoctP9S.js} +4 -4
  12. package/dist/cjs/{placeTestOrder-VK_CMeq0.js → placeTestOrder-D7baFuaV.js} +2 -2
  13. package/dist/cjs/{renderCheckoutCurrency-CC4CAy-a.js → renderCheckoutCurrency-Ca2HH1Gc.js} +2 -2
  14. package/dist/cjs/{shouldShowLanguageSelect-Bj_jKWPK.js → shouldShowLanguageSelect-FyTdz7U_.js} +1 -1
  15. package/dist/cjs/{submitGtag-CcEL-w5D.js → submitGtag-D79e8u6s.js} +1 -1
  16. package/dist/cjs/{throttle-BcxGntLr.js → throttle-zSVRQLC0.js} +2 -2
  17. package/dist/cjs/{updateCheckoutSessionAttributes-Dltl5RBx.js → updateCheckoutSessionAttributes-jMtfOL2m.js} +1 -1
  18. package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +11 -11
  19. package/dist/cjs/zonos-address-display_2.cjs.entry.js +3 -3
  20. package/dist/cjs/zonos-address_4.cjs.entry.js +8 -8
  21. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +5 -5
  22. package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  24. package/dist/cjs/zonos-button_3.cjs.entry.js +2 -2
  25. package/dist/cjs/zonos-card_5.cjs.entry.js +7 -7
  26. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +15 -15
  27. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +2 -2
  28. package/dist/cjs/zonos-checkout.cjs.entry.js +12 -12
  29. package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
  30. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +4 -4
  31. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +11 -11
  32. package/dist/cjs/zonos-collect.cjs.entry.js +7 -7
  33. package/dist/cjs/zonos-controller.cjs.entry.js +7 -7
  34. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  35. package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -3
  36. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
  37. package/dist/cjs/zonos-hello.cjs.entry.js +129 -51
  38. package/dist/cjs/zonos-input.cjs.entry.js +2 -2
  39. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +6 -6
  40. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +11 -11
  41. package/dist/cjs/zonos-invoice.cjs.entry.js +7 -7
  42. package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
  43. package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
  44. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +5 -5
  45. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
  46. package/dist/cjs/zonos-stripe-input.cjs.entry.js +3 -3
  47. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  48. package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
  49. package/dist/cjs/{zonosStore-BCNYr6Tk.js → zonosStore-Bx9jK82G.js} +2 -0
  50. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +1 -1
  51. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +1 -1
  52. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.js +1 -1
  53. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +1 -1
  54. package/dist/collection/components/hello/zonos-hello/zonos-hello.css +17 -15
  55. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +29 -52
  56. package/dist/collection/components/main/zonos-controller.js +2 -2
  57. package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -2
  58. package/dist/collection/components/store/hello/localization.js +69 -34
  59. package/dist/collection/components/store/zonosStore.js +2 -0
  60. package/dist/collection/components/stripe/zonos-address/zonos-address.js +2 -2
  61. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -3
  62. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +2 -2
  63. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +0 -1
  64. package/dist/collection/components/utils/api/getLocalization.js +2 -2
  65. package/dist/collection/components/utils/checkout/isShippableCountry.js +2 -4
  66. package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +1 -0
  67. package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +2 -0
  68. package/dist/collection/components/utils/formatDate.js +1 -3
  69. package/dist/collection/components/utils/getOverridenZCountry.js +3 -5
  70. package/dist/collection/components/utils/hello/countryOverrideStorage.js +49 -0
  71. package/dist/collection/components/utils/hello/getZCountryUrlParam.js +5 -9
  72. package/dist/collection/components/utils/hello/isCountryCode.js +1 -0
  73. package/dist/collection/components/utils/hello/isCountryInShippingZone.js +8 -0
  74. package/dist/collection/components/utils/hello/reconcileRememberedCountryOverride.js +37 -0
  75. package/dist/collection/components/utils/hello/resolveHelloFloatPlacement.js +98 -0
  76. package/dist/collection/components/utils/hello/shouldShowHelloWidget.js +27 -20
  77. package/dist/collection/environment.js +0 -1
  78. package/dist/collection/scripts/_stripe.js +0 -2
  79. package/dist/collection/scripts/_zonosBase.js +1 -1
  80. package/dist/collection/types/generated/graphql.frontend.types.js +218 -63
  81. package/dist/collection/types/generated/graphql.internal.types.js +815 -152
  82. package/dist/collection/utils/formattedCloudflareApiUrl.js +1 -0
  83. package/dist/collection/utils/generateCloudflareDeployUrl.js +5 -2
  84. package/dist/esm/{cart-ekBk_gxV.js → cart-Cleo1j5P.js} +3 -3
  85. package/dist/esm/{collect-33rMINDo.js → collect-CspdWIRo.js} +3 -3
  86. package/dist/esm/{debounce-D4ko2kvZ.js → debounce-BR3PaG8X.js} +1 -1
  87. package/dist/esm/{debounce-DWPsxJsW.js → debounce-CrmpwbEE.js} +2 -2
  88. package/dist/esm/{getBorderRadius-HwG64EKM.js → getBorderRadius-DYfkeXdx.js} +1 -1
  89. package/dist/esm/{getMissingRequiredShippingFields-u1nhQzJ1.js → getMissingRequiredShippingFields-B1IL1-gn.js} +1 -1
  90. package/dist/esm/{hasInclusivePrice-CAVXi310.js → hasInclusivePrice-DKRplpLX.js} +1 -1
  91. package/dist/esm/index.js +8 -9
  92. package/dist/esm/{invoice-BNDWuVsD.js → invoice-D49igPQ9.js} +3 -3
  93. package/dist/esm/{localization-AOqYXGdP.js → localization-BiL8bPsY.js} +192 -70
  94. package/dist/esm/{paypal-CW1D2XqZ.js → paypal-D4vWRxHJ.js} +4 -4
  95. package/dist/esm/{placeTestOrder-nhmsLLOA.js → placeTestOrder-BNmc5RCo.js} +2 -2
  96. package/dist/esm/{renderCheckoutCurrency-BQANmZyM.js → renderCheckoutCurrency-BNbwijGo.js} +2 -2
  97. package/dist/esm/{shouldShowLanguageSelect-BQFCXouB.js → shouldShowLanguageSelect-B82gTfHz.js} +1 -1
  98. package/dist/esm/{submitGtag-CCGQS060.js → submitGtag-df9AQ2zL.js} +1 -1
  99. package/dist/esm/{throttle-D5GyA3yr.js → throttle-Cvlvb-dm.js} +2 -2
  100. package/dist/esm/{updateCheckoutSessionAttributes-eRSqdC74.js → updateCheckoutSessionAttributes-4Jq6V4pO.js} +1 -1
  101. package/dist/esm/zonos-address-completion-dialog_7.entry.js +11 -11
  102. package/dist/esm/zonos-address-display_2.entry.js +3 -3
  103. package/dist/esm/zonos-address_4.entry.js +8 -8
  104. package/dist/esm/zonos-airwallex-payment.entry.js +5 -5
  105. package/dist/esm/zonos-badge.entry.js +1 -1
  106. package/dist/esm/zonos-banner.entry.js +1 -1
  107. package/dist/esm/zonos-button_3.entry.js +2 -2
  108. package/dist/esm/zonos-card_5.entry.js +7 -7
  109. package/dist/esm/zonos-cart-items_12.entry.js +15 -15
  110. package/dist/esm/zonos-checkbox_2.entry.js +2 -2
  111. package/dist/esm/zonos-checkout.entry.js +12 -12
  112. package/dist/esm/zonos-collapse.entry.js +1 -1
  113. package/dist/esm/zonos-collect-cart-items_3.entry.js +4 -4
  114. package/dist/esm/zonos-collect-finish_6.entry.js +11 -11
  115. package/dist/esm/zonos-collect.entry.js +7 -7
  116. package/dist/esm/zonos-controller.entry.js +7 -7
  117. package/dist/esm/zonos-country-flag.entry.js +2 -2
  118. package/dist/esm/zonos-country-select_4.entry.js +3 -3
  119. package/dist/esm/zonos-hello-dialog.entry.js +3 -3
  120. package/dist/esm/zonos-hello.entry.js +129 -51
  121. package/dist/esm/zonos-input.entry.js +2 -2
  122. package/dist/esm/zonos-invoice-cart-items_2.entry.js +6 -6
  123. package/dist/esm/zonos-invoice-finish_5.entry.js +11 -11
  124. package/dist/esm/zonos-invoice.entry.js +7 -7
  125. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  126. package/dist/esm/zonos-logo.entry.js +1 -1
  127. package/dist/esm/zonos-policy-consent_2.entry.js +5 -5
  128. package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
  129. package/dist/esm/zonos-stripe-input.entry.js +3 -3
  130. package/dist/esm/zonos-text.entry.js +1 -1
  131. package/dist/esm/zonos-v-stack.entry.js +1 -1
  132. package/dist/esm/{zonosStore-DrIOAz4M.js → zonosStore-msUlqmSD.js} +2 -0
  133. package/dist/esm-es5/{cart-ekBk_gxV.js → cart-Cleo1j5P.js} +8 -8
  134. package/dist/esm-es5/{collect-33rMINDo.js → collect-CspdWIRo.js} +1 -1
  135. package/dist/esm-es5/{debounce-D4ko2kvZ.js → debounce-BR3PaG8X.js} +7 -7
  136. package/dist/esm-es5/debounce-CrmpwbEE.js +1 -0
  137. package/dist/esm-es5/{getBorderRadius-HwG64EKM.js → getBorderRadius-DYfkeXdx.js} +1 -1
  138. package/dist/esm-es5/{getMissingRequiredShippingFields-u1nhQzJ1.js → getMissingRequiredShippingFields-B1IL1-gn.js} +3 -3
  139. package/dist/esm-es5/{hasInclusivePrice-CAVXi310.js → hasInclusivePrice-DKRplpLX.js} +1 -1
  140. package/dist/esm-es5/index.js +6 -8
  141. package/dist/esm-es5/{invoice-BNDWuVsD.js → invoice-D49igPQ9.js} +1 -1
  142. package/dist/esm-es5/{localization-AOqYXGdP.js → localization-BiL8bPsY.js} +74 -68
  143. package/dist/esm-es5/{paypal-CW1D2XqZ.js → paypal-D4vWRxHJ.js} +1 -1
  144. package/dist/esm-es5/{placeTestOrder-nhmsLLOA.js → placeTestOrder-BNmc5RCo.js} +1 -1
  145. package/dist/esm-es5/{renderCheckoutCurrency-BQANmZyM.js → renderCheckoutCurrency-BNbwijGo.js} +1 -1
  146. package/dist/esm-es5/{shouldShowLanguageSelect-BQFCXouB.js → shouldShowLanguageSelect-B82gTfHz.js} +1 -1
  147. package/dist/esm-es5/{submitGtag-CCGQS060.js → submitGtag-df9AQ2zL.js} +1 -1
  148. package/dist/esm-es5/{throttle-D5GyA3yr.js → throttle-Cvlvb-dm.js} +2 -2
  149. package/dist/esm-es5/{updateCheckoutSessionAttributes-eRSqdC74.js → updateCheckoutSessionAttributes-4Jq6V4pO.js} +1 -1
  150. package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +3 -3
  151. package/dist/esm-es5/zonos-address-display_2.entry.js +1 -1
  152. package/dist/esm-es5/zonos-address_4.entry.js +2 -2
  153. package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
  154. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  155. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  156. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  157. package/dist/esm-es5/zonos-card_5.entry.js +2 -2
  158. package/dist/esm-es5/zonos-cart-items_12.entry.js +2 -2
  159. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
  160. package/dist/esm-es5/zonos-checkout.entry.js +6 -6
  161. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  162. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  163. package/dist/esm-es5/zonos-collect-finish_6.entry.js +2 -2
  164. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  165. package/dist/esm-es5/zonos-controller.entry.js +3 -3
  166. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  167. package/dist/esm-es5/zonos-country-select_4.entry.js +2 -2
  168. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  169. package/dist/esm-es5/zonos-hello.entry.js +21 -24
  170. package/dist/esm-es5/zonos-input.entry.js +1 -1
  171. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +2 -2
  172. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +2 -2
  173. package/dist/esm-es5/zonos-invoice.entry.js +3 -3
  174. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  175. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  176. package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
  177. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  178. package/dist/esm-es5/zonos-stripe-input.entry.js +2 -2
  179. package/dist/esm-es5/zonos-text.entry.js +1 -1
  180. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  181. package/dist/esm-es5/{zonosStore-DrIOAz4M.js → zonosStore-msUlqmSD.js} +1 -1
  182. package/dist/scripts/index.d.ts +36 -6
  183. package/dist/scripts/index.js +1 -1
  184. package/dist/scripts/loadZonos.js +1 -1
  185. package/dist/scripts/zonos.js +1 -1
  186. package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +5 -3
  187. package/dist/types/components/store/hello/localization.d.ts +2 -1
  188. package/dist/types/components/utils/api/getLocalization.d.ts +3 -1
  189. package/dist/types/components/utils/getOverridenZCountry.d.ts +2 -3
  190. package/dist/types/components/utils/hello/countryOverrideStorage.d.ts +5 -0
  191. package/dist/types/components/utils/hello/isCountryCode.d.ts +2 -0
  192. package/dist/types/components/utils/hello/isCountryInShippingZone.d.ts +2 -0
  193. package/dist/types/components/utils/hello/reconcileRememberedCountryOverride.d.ts +18 -0
  194. package/dist/types/components/utils/hello/resolveHelloFloatPlacement.d.ts +39 -0
  195. package/dist/types/components/utils/hello/shouldShowHelloWidget.d.ts +8 -4
  196. package/dist/types/components.d.ts +4 -6
  197. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +10 -0
  198. package/dist/types/types/generated/graphql.frontend.types.d.ts +41 -52
  199. package/dist/types/types/generated/graphql.frontend.types.ts +226 -114
  200. package/dist/types/types/generated/graphql.internal.types.d.ts +465 -100
  201. package/dist/types/types/generated/graphql.internal.types.ts +1007 -253
  202. package/dist/types/types/hello/HelloConfig.d.ts +12 -0
  203. package/dist/types/utils/formattedCloudflareApiUrl.d.ts +1 -0
  204. package/dist/types/utils/generateCloudflareDeployUrl.d.ts +5 -2
  205. package/dist/zonos-elements/index.esm.js +1 -1
  206. package/dist/zonos-elements/{p-39c8a898.entry.js → p-028e0500.entry.js} +1 -1
  207. package/dist/zonos-elements/p-079af8c0.system.entry.js +118 -0
  208. package/dist/zonos-elements/{p-058f07aa.system.entry.js → p-0a4a7742.system.entry.js} +1 -1
  209. package/dist/zonos-elements/{p-04cc0dac.system.entry.js → p-0dca8a26.system.entry.js} +47 -47
  210. package/dist/zonos-elements/{p-d33dfc78.system.entry.js → p-0ee74bf3.system.entry.js} +30 -30
  211. package/dist/zonos-elements/{p-e284d329.entry.js → p-11bab88b.entry.js} +1 -1
  212. package/dist/zonos-elements/{p-7a5d2211.system.entry.js → p-13d3a372.system.entry.js} +18 -18
  213. package/dist/zonos-elements/{p-1568ab06.system.entry.js → p-1409de3b.system.entry.js} +1 -1
  214. package/dist/zonos-elements/{p-8328f44d.entry.js → p-193d9722.entry.js} +1 -1
  215. package/dist/zonos-elements/{p-dcdbc610.system.entry.js → p-195f6e38.system.entry.js} +2 -2
  216. package/dist/zonos-elements/{p-daf9fa07.system.entry.js → p-1b77464d.system.entry.js} +16 -16
  217. package/dist/zonos-elements/{p-cc5306fe.system.entry.js → p-1bac5ac1.system.entry.js} +1 -1
  218. package/dist/zonos-elements/{p-128485dc.entry.js → p-1c150f26.entry.js} +1 -1
  219. package/dist/zonos-elements/{p-cf5688f7.entry.js → p-234c202c.entry.js} +1 -1
  220. package/dist/zonos-elements/{p-5a631080.system.entry.js → p-23f6346b.system.entry.js} +1 -1
  221. package/dist/zonos-elements/{p-cc949df1.system.entry.js → p-244e0302.system.entry.js} +1 -1
  222. package/dist/zonos-elements/{p-7681798d.entry.js → p-24f3c547.entry.js} +1 -1
  223. package/dist/zonos-elements/{p-5c08d36b.entry.js → p-2603dce0.entry.js} +1 -1
  224. package/dist/zonos-elements/{p-6b0afaa7.entry.js → p-26295311.entry.js} +1 -1
  225. package/dist/zonos-elements/{p-d4c4a00e.entry.js → p-34c5e145.entry.js} +1 -1
  226. package/dist/zonos-elements/{p-f6e0aeba.system.entry.js → p-35509b10.system.entry.js} +185 -185
  227. package/dist/zonos-elements/{p-4a54f664.entry.js → p-35539d3d.entry.js} +1 -1
  228. package/dist/zonos-elements/{p-5024df2d.system.entry.js → p-3c800376.system.entry.js} +61 -61
  229. package/dist/zonos-elements/{p-f8fd756a.system.entry.js → p-474e8a92.system.entry.js} +1 -1
  230. package/dist/zonos-elements/{p-d55b9664.system.entry.js → p-481ecc23.system.entry.js} +20 -20
  231. package/dist/zonos-elements/{p-4973f8d8.system.entry.js → p-4fd78ecf.system.entry.js} +14 -14
  232. package/dist/zonos-elements/{p-8cd3f1e2.entry.js → p-52d9fd3a.entry.js} +1 -1
  233. package/dist/zonos-elements/{p-a6faab6a.entry.js → p-55916c90.entry.js} +1 -1
  234. package/dist/zonos-elements/p-5b06f069.entry.js +1 -0
  235. package/dist/zonos-elements/{p-5d3079e8.entry.js → p-5df25a1a.entry.js} +1 -1
  236. package/dist/zonos-elements/{p-450ed170.system.entry.js → p-5f347f91.system.entry.js} +3 -3
  237. package/dist/zonos-elements/{p-beeb9d36.system.entry.js → p-756d303f.system.entry.js} +1 -1
  238. package/dist/zonos-elements/{p-5836d426.system.entry.js → p-79ddb12a.system.entry.js} +1 -1
  239. package/dist/zonos-elements/{p-f27317d3.system.entry.js → p-7d284341.system.entry.js} +4 -4
  240. package/dist/zonos-elements/{p-f6ba59f6.system.entry.js → p-7e1050dd.system.entry.js} +10 -10
  241. package/dist/zonos-elements/{p-02ef0f99.system.entry.js → p-7ee2af6e.system.entry.js} +1 -1
  242. package/dist/zonos-elements/{p-34d1545a.entry.js → p-83aa1c8c.entry.js} +1 -1
  243. package/dist/zonos-elements/{p-9818f823.entry.js → p-84c9ce16.entry.js} +1 -1
  244. package/dist/zonos-elements/{p-CaUXHglQ.system.js → p-8PPEbm_0.system.js} +9 -9
  245. package/dist/zonos-elements/{p-b6deae2b.system.entry.js → p-92fe9a1f.system.entry.js} +2 -2
  246. package/dist/zonos-elements/{p-f57495dc.entry.js → p-990b49f2.entry.js} +1 -1
  247. package/dist/zonos-elements/{p-cadf6b63.system.entry.js → p-9ef0f69e.system.entry.js} +10 -10
  248. package/dist/zonos-elements/{p-CZl1nwqv.system.js → p-B4Ufchqh.system.js} +3 -3
  249. package/dist/zonos-elements/{p-BtMauqj_.system.js → p-B5NDhB1w.system.js} +6 -8
  250. package/dist/zonos-elements/{p-CJCoACvU.js → p-BDrM4x5N.js} +2 -2
  251. package/dist/zonos-elements/p-BGktDPwA.system.js +1 -0
  252. package/dist/zonos-elements/{p-C19J2XSh.js → p-BJzAgoqz.js} +1 -1
  253. package/dist/zonos-elements/p-BKoLoalh.js +1 -0
  254. package/dist/zonos-elements/{p-Dj-O6VfM.system.js → p-BT9_ehlh.system.js} +2 -2
  255. package/dist/zonos-elements/{p-B2EZRfoq.system.js → p-B_5RofQ9.system.js} +15 -15
  256. package/dist/zonos-elements/p-BaF00SfB.js +1 -0
  257. package/dist/zonos-elements/{p-D0erXw7p.js → p-BpDCLBwW.js} +1 -1
  258. package/dist/zonos-elements/{p-DkpYo2Fs.js → p-BtWDzGMx.js} +1 -1
  259. package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
  260. package/dist/zonos-elements/{p-CPnR_T0a.system.js → p-BuU_p5DP.system.js} +58 -58
  261. package/dist/zonos-elements/{p-D5AtAlJx.system.js → p-CASTsiDR.system.js} +3 -3
  262. package/dist/zonos-elements/{p-CaAod213.system.js → p-CBx5nYet.system.js} +1 -1
  263. package/dist/zonos-elements/{p-DIJaXkiE.system.js → p-CEmXVahp.system.js} +111 -105
  264. package/dist/zonos-elements/{p-nU86HJ5w.js → p-CUaf1cEg.js} +1 -1
  265. package/dist/zonos-elements/p-CX_vfdWt.js +1 -0
  266. package/dist/zonos-elements/p-C_z9WL8a.js +1 -0
  267. package/dist/zonos-elements/p-CcJF6xhQ.js +1 -0
  268. package/dist/zonos-elements/{p-DjuFsKLG.js → p-CewmhMGk.js} +1 -1
  269. package/dist/zonos-elements/{p-CYdt69j5.system.js → p-Cpe_ISNt.system.js} +18 -18
  270. package/dist/zonos-elements/{p-DTgv0QpG.js → p-Cuk0LLGQ.js} +1 -1
  271. package/dist/zonos-elements/p-Cxuiqv1I.js +1 -0
  272. package/dist/zonos-elements/p-DQZncB2d.system.js +9 -0
  273. package/dist/zonos-elements/{p-D-DawUYF.system.js → p-DVITR-Eu.system.js} +1 -1
  274. package/dist/zonos-elements/{p-DGsEWFDU.system.js → p-DYIisqF7.system.js} +1 -1
  275. package/dist/zonos-elements/{p-uV7m6KrY.system.js → p-DoEHepOc.system.js} +1 -1
  276. package/dist/zonos-elements/{p-DHwpNxG9.js → p-DwkyNtpD.js} +1 -1
  277. package/dist/zonos-elements/{p-CKTIJ2Gr.js → p-NJVOYjda.js} +1 -1
  278. package/dist/zonos-elements/{p-CtEsvWI6.js → p-W82paT5F.js} +1 -1
  279. package/dist/zonos-elements/{p-04bfcd72.system.entry.js → p-a571beaa.system.entry.js} +13 -13
  280. package/dist/zonos-elements/{p-5562a955.system.entry.js → p-a5c25829.system.entry.js} +3 -3
  281. package/dist/zonos-elements/{p-b68ca96f.entry.js → p-a938c174.entry.js} +1 -1
  282. package/dist/zonos-elements/{p-844a743a.entry.js → p-ab54d0a1.entry.js} +1 -1
  283. package/dist/zonos-elements/{p-9ebe9a36.entry.js → p-acd50b0b.entry.js} +1 -1
  284. package/dist/zonos-elements/{p-0f603278.system.entry.js → p-b5882fbb.system.entry.js} +2 -2
  285. package/dist/zonos-elements/{p-891b47d7.entry.js → p-ba510730.entry.js} +1 -1
  286. package/dist/zonos-elements/{p-e9320825.entry.js → p-c3b02dbf.entry.js} +1 -1
  287. package/dist/zonos-elements/{p-be64d823.system.entry.js → p-c403f004.system.entry.js} +1 -1
  288. package/dist/zonos-elements/{p-64e7bc5b.entry.js → p-c4ad6d4b.entry.js} +1 -1
  289. package/dist/zonos-elements/p-ca3175d9.entry.js +1 -0
  290. package/dist/zonos-elements/{p-a38e62cc.entry.js → p-d3d0656a.entry.js} +1 -1
  291. package/dist/zonos-elements/{p-9b6482ef.entry.js → p-d4d2b39e.entry.js} +1 -1
  292. package/dist/zonos-elements/{p-ea8790aa.entry.js → p-d6b72f6d.entry.js} +1 -1
  293. package/dist/zonos-elements/p-d74bc3e8.entry.js +1 -0
  294. package/dist/zonos-elements/p-db75322d.entry.js +1 -0
  295. package/dist/zonos-elements/p-dd8ca91e.entry.js +1 -0
  296. package/dist/zonos-elements/{p-7ae48e31.entry.js → p-ddca5ee1.entry.js} +1 -1
  297. package/dist/zonos-elements/{p-bdba7d9e.system.entry.js → p-dfc87b10.system.entry.js} +1 -1
  298. package/dist/zonos-elements/{p-e101d722.system.entry.js → p-f37b8aaf.system.entry.js} +2 -2
  299. package/dist/zonos-elements/{p-b14819ab.system.entry.js → p-fb869759.system.entry.js} +1 -1
  300. package/dist/zonos-elements/{p-i1iCWKdv.js → p-sz4L-ZnB.js} +1 -1
  301. package/dist/zonos-elements/{p-D31lQiWo.system.js → p-tGJYTlGL.system.js} +4 -4
  302. package/dist/zonos-elements/p-tkSf-lrO.system.js +13 -0
  303. package/dist/zonos-elements/{p-DPW1yXt9.system.js → p-uuZUZPIm.system.js} +61 -61
  304. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  305. package/package.json +12 -11
  306. package/dist/esm-es5/debounce-DWPsxJsW.js +0 -1
  307. package/dist/zonos-elements/p-0466650f.entry.js +0 -1
  308. package/dist/zonos-elements/p-2ba738ec.entry.js +0 -1
  309. package/dist/zonos-elements/p-3ERbuo5a.js +0 -1
  310. package/dist/zonos-elements/p-6f742021.entry.js +0 -1
  311. package/dist/zonos-elements/p-89ddab88.entry.js +0 -1
  312. package/dist/zonos-elements/p-BANhKkF2.system.js +0 -1
  313. package/dist/zonos-elements/p-BJufDgh3.js +0 -1
  314. package/dist/zonos-elements/p-BSgVcCxT.system.js +0 -9
  315. package/dist/zonos-elements/p-CQqNJo0D.system.js +0 -13
  316. package/dist/zonos-elements/p-LypTHRUC.js +0 -1
  317. package/dist/zonos-elements/p-adfee3a3.entry.js +0 -1
  318. package/dist/zonos-elements/p-f2cedbcd.system.entry.js +0 -121
  319. package/dist/zonos-elements/p-lGLcGvEA.js +0 -1
  320. package/dist/zonos-elements/p-pfIceXbY.js +0 -1
  321. package/dist/zonos-elements/p-t_ClFAJR.js +0 -1
@@ -14,6 +14,7 @@ import { getHasMoreSpaceOnRight } from "../../utils/hello/getHasMoreSpaceOnRight
14
14
  import { getHelloWidgetSize } from "../../utils/hello/getHelloWidgetSize";
15
15
  import { getProductsOnPage } from "../../utils/hello/getProductsOnPage";
16
16
  import { getZCountryUrlParam } from "../../utils/hello/getZCountryUrlParam";
17
+ import { resolveHelloFloatPlacement } from "../../utils/hello/resolveHelloFloatPlacement";
17
18
  import { setZCountryUrlParam } from "../../utils/hello/setZCountryUrlParam";
18
19
  import { shouldShowHelloWidget } from "../../utils/hello/shouldShowHelloWidget";
19
20
  import { log } from "../../utils/logging/log";
@@ -224,6 +225,8 @@ export class ZonosHello {
224
225
  return localizationStore.helloCountryList;
225
226
  }
226
227
  componentWillLoad() {
228
+ // Set before first paint so mobile uses mobile placement, not desktop.
229
+ this.isMobile = window.innerWidth <= 768;
227
230
  const initInterval = setInterval(async () => {
228
231
  if (!this.helloRef) {
229
232
  return;
@@ -309,50 +312,19 @@ export class ZonosHello {
309
312
  }
310
313
  }
311
314
  getHelloLocation() {
312
- const mobileLocation = this.mobileLocationOverride || zonosStore.helloSettings.mobileLocation;
313
- const desktopLocation = this.desktopLocationOverride || zonosStore.helloSettings.desktopLocation;
314
- const isMobileWindow = this.isMobile;
315
- switch (true) {
316
- // Mobile
317
- case isMobileWindow: {
318
- const isOnLeft = this.animateFromLeftOverride || (mobileLocation === null || mobileLocation === void 0 ? void 0 : mobileLocation.includes('LEFT'));
319
- const isOnTop = mobileLocation === null || mobileLocation === void 0 ? void 0 : mobileLocation.includes('TOP');
320
- return {
321
- isMobileWindow,
322
- isOnLeft,
323
- isOnTop,
324
- shouldFloat: !!mobileLocation,
325
- };
326
- }
327
- // Desktop
328
- default:
329
- case !isMobileWindow: {
330
- /**
331
- * Float on desktop when `desktopLocationOverride` is set (explicit
332
- * consumer request) OR when no anchor is specified and a
333
- * `desktopLocation` is configured in the store. With an anchor and no
334
- * override, the widget renders inline at the anchor.
335
- */
336
- const shouldFloat = !!this.desktopLocationOverride ||
337
- (!zonosStore.helloSettings.anchorElementSelector &&
338
- !!desktopLocation);
339
- // When a desktopLocation is set, derive the side deterministically
340
- // from it so RIGHT positions resolve to `false` (not `undefined`).
341
- // Spatial detection only runs as a fallback when no location is set
342
- // (e.g. inline / anchored placement).
343
- const isOnLeft = this.animateFromLeftOverride ||
344
- (shouldFloat && desktopLocation
345
- ? desktopLocation.includes('LEFT')
346
- : this.shouldAnimateLeftDesktop());
347
- const isOnTop = desktopLocation === null || desktopLocation === void 0 ? void 0 : desktopLocation.includes('TOP');
348
- return {
349
- isMobileWindow,
350
- isOnLeft,
351
- isOnTop,
352
- shouldFloat,
353
- };
354
- }
355
- }
315
+ // Enum @Prop `*LocationOverride` → component*; settings HelloPlacement object → settings*.
316
+ return resolveHelloFloatPlacement({
317
+ anchorElementSelector: zonosStore.helloSettings.anchorElementSelector,
318
+ animateFromLeftOverride: this.animateFromLeftOverride,
319
+ componentDesktopLocation: this.desktopLocationOverride,
320
+ componentMobileLocation: this.mobileLocationOverride,
321
+ desktopLocation: zonosStore.helloSettings.desktopLocation,
322
+ isMobileWindow: this.isMobile,
323
+ mobileLocation: zonosStore.helloSettings.mobileLocation,
324
+ settingsDesktopPlacement: zonosStore.helloSettings.desktopLocationOverride,
325
+ settingsMobilePlacement: zonosStore.helloSettings.mobileLocationOverride,
326
+ shouldAnimateLeftDesktop: () => Boolean(this.shouldAnimateLeftDesktop()),
327
+ });
356
328
  }
357
329
  handleAppearanceSettingsOverrideChange() {
358
330
  var _a;
@@ -372,7 +344,7 @@ export class ZonosHello {
372
344
  return null;
373
345
  }
374
346
  const { selectedCountryCode, targetCurrency } = localizationStore;
375
- const { isOnLeft, isOnTop, shouldFloat } = this.getHelloLocation();
347
+ const { horizontalOffset, isOnLeft, isOnTop, shouldFloat, verticalOffset } = this.getHelloLocation();
376
348
  const appearanceSettings = mergeConfig(zonosStore.appearance, this.appearanceSettingsOverride || null);
377
349
  const { theme } = appearanceSettings;
378
350
  const restrictedItemsOnPage = (_b = this.allRestrictedItems) === null || _b === void 0 ? void 0 : _b.filter(product => this.productsOnPage.some(restriction => restriction.description === product.itemDescription));
@@ -388,7 +360,15 @@ export class ZonosHello {
388
360
  });
389
361
  }
390
362
  const widgetSize = getHelloWidgetSize(zonosStore.helloSettings.widgetSize);
391
- return (h(Host, { class: "zonos--hello zonos--elements", "data-theme": theme, style: { '--zonos-elements-hello-widget-size': `${widgetSize}px` } }, showHello && (h("div", { class: classes([
363
+ const hostStyle = {
364
+ '--zonos-elements-hello-widget-size': `${widgetSize}px`,
365
+ };
366
+ if (horizontalOffset != null && verticalOffset != null) {
367
+ hostStyle['--zonos-elements-hello-float-inset-x'] =
368
+ `${horizontalOffset}px`;
369
+ hostStyle['--zonos-elements-hello-float-inset-y'] = `${verticalOffset}px`;
370
+ }
371
+ return (h(Host, { class: "zonos--hello zonos--elements", "data-theme": theme, style: hostStyle }, showHello && (h("div", { class: classes([
392
372
  'zonos--hello-wrapper',
393
373
  shouldFloat && 'zonos--hello-widget-float',
394
374
  ]) }, h("button", { class: classes([
@@ -445,11 +425,8 @@ export class ZonosHello {
445
425
  "required": false,
446
426
  "optional": true,
447
427
  "docs": {
448
- "tags": [{
449
- "name": "default",
450
- "text": "false"
451
- }],
452
- "text": "Force mobile styling instead of media query and use the passed location value"
428
+ "tags": [],
429
+ "text": "Override the configured mobile floating location (enum). Takes precedence over\n`helloSettings.mobileLocationOverride` (HelloPlacement) and\n`helloSettings.mobileLocation`."
453
430
  },
454
431
  "getter": false,
455
432
  "setter": false,
@@ -475,7 +452,7 @@ export class ZonosHello {
475
452
  "optional": true,
476
453
  "docs": {
477
454
  "tags": [],
478
- "text": "Override the configured desktop floating location. Takes precedence over\n`helloSettings.desktopLocation` and also drives the peek-message animation\ndirection, so consumers no longer need `animateFromLeftOverride` for\ndesktop positioning."
455
+ "text": "Override the configured desktop floating location. Takes precedence over\n`helloSettings.desktopLocationOverride` (HelloPlacement) and\n`helloSettings.desktopLocation`, and also drives the peek-message animation\ndirection, so consumers no longer need `animateFromLeftOverride` for\ndesktop positioning."
479
456
  },
480
457
  "getter": false,
481
458
  "setter": false,
@@ -277,7 +277,7 @@ export class ZonosController {
277
277
  return;
278
278
  }
279
279
  const hasCartCallback =
280
- // eslint-disable-next-line deprecation/deprecation -- gating Stripe load also honors the legacy callback
280
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- gating Stripe load also honors the legacy callback
281
281
  typeof ((_e = zonosStore.checkoutSettings) === null || _e === void 0 ? void 0 : _e.buildCartDetail) === 'function' ||
282
282
  typeof ((_f = zonosStore.checkoutSettings) === null || _f === void 0 ? void 0 : _f.createCartId) === 'function';
283
283
  // Checkout also runs without merchant cart callbacks when a cart is
@@ -348,7 +348,7 @@ export class ZonosController {
348
348
  zonosStore.organizationName = organizationName;
349
349
  }
350
350
  render() {
351
- return h(Host, { key: '12257443495182932a4ca497928398e22f5fb892', class: "zonos--elements" });
351
+ return h(Host, { key: '1714865012d806892f03e03896ee2f04aa1a729d', class: "zonos--elements" });
352
352
  }
353
353
  static get is() { return "zonos-controller"; }
354
354
  static get encapsulation() { return "shadow"; }
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
1
  import { h, Host, } from "@stencil/core";
3
2
  import { paypalStoreInitButtons, paypalStoreOnChange, } from "../store/checkout/paypal";
4
3
  import { log } from "../utils/logging/log";
@@ -52,7 +51,7 @@ export class ZonosPaypalPayment {
52
51
  this.storeUnsubscribeList.forEach(unsubscribe => unsubscribe());
53
52
  }
54
53
  render() {
55
- return (h(Host, { key: '2eb9e7f7acbe26f51c32ceb722f1e59832ac918a', class: "zonos--paypal-payment zonos--elements" }, h("div", { key: '47ad7f3dfdea67dd5e222e6bbba46ed4599680be', class: "zonos--payment-paypal-container" })));
54
+ return (h(Host, { key: '50cc936c450fb9afeaf488bfce6b15c2b1c29532', class: "zonos--paypal-payment zonos--elements" }, h("div", { key: '5a5f49d4486acb938d4dcffbbc41c15720201f0e', class: "zonos--payment-paypal-container" })));
56
55
  }
57
56
  static get is() { return "zonos-paypal-payment"; }
58
57
  static get encapsulation() { return "scoped"; }
@@ -12,8 +12,12 @@ import { getShippingZones } from "../../utils/api/getShippingZones";
12
12
  import { removeBigcommerceCartShipping } from "../../utils/checkout/removeBigcommerceCartShipping";
13
13
  import { getSupportedLanguages } from "../../utils/getSupportedLanguages";
14
14
  import { handleFetch } from "../../utils/handleFetch";
15
+ import { getCountryOverrideStorage, migrateCountryOverrideStorage, setCountryOverrideStorage, } from "../../utils/hello/countryOverrideStorage";
15
16
  import { currencyDisplay } from "../../utils/hello/currencyConversion/currencyDisplay";
16
17
  import { getCurrencyCode } from "../../utils/hello/currencyConversion/getCurrencyCode";
18
+ import { getZCountryUrlParam } from "../../utils/hello/getZCountryUrlParam";
19
+ import { isCountryInShippingZone } from "../../utils/hello/isCountryInShippingZone";
20
+ import { reconcileRememberedCountryOverride } from "../../utils/hello/reconcileRememberedCountryOverride";
17
21
  import { setZCountryUrlParam } from "../../utils/hello/setZCountryUrlParam";
18
22
  import { log } from "../../utils/logging/log";
19
23
  import { logError } from "../../utils/logging/logError";
@@ -124,19 +128,23 @@ const getNewLocalization = async ({ isInitializing, }) => {
124
128
  }
125
129
  };
126
130
  const getCustomMessages = async () => {
127
- log(`Getting custom messages for ${localizationStore.selectedCountryCode}`);
128
- if (!localizationStore.selectedCountryCode || !zonosStore.storeId) {
131
+ const countryCode = localizationStore.selectedCountryCode;
132
+ log(`Getting custom messages for ${countryCode}`);
133
+ if (!countryCode || !zonosStore.storeId) {
129
134
  return;
130
135
  }
131
136
  const localeMessages = await getLocaleMessages({
132
- countryCode: localizationStore.selectedCountryCode,
137
+ countryCode,
133
138
  localeTo: localizationStore.selectedLocale,
134
139
  storeId: zonosStore.storeId,
135
140
  });
141
+ if (localizationStore.selectedCountryCode !== countryCode) {
142
+ return;
143
+ }
136
144
  const allMessages = localeMessages.flatMap(x => {
137
145
  var _a;
138
146
  return {
139
- countryCode: localizationStore.selectedCountryCode,
147
+ countryCode,
140
148
  message: (_a = x.countryCodesPageMessageLinks.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message.textTo,
141
149
  pageName: x.pageName,
142
150
  };
@@ -179,17 +187,19 @@ const getValidLocale = (locale) => {
179
187
  log(`Locale ${locale} is not offered, falling back to ${fallback === null || fallback === void 0 ? void 0 : fallback.code}`);
180
188
  return (fallback === null || fallback === void 0 ? void 0 : fallback.code) || 'en';
181
189
  };
182
- const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelectedCountryCode, }) => {
183
- var _a, _b, _c;
190
+ const syncSelectedCountryToPage = (selectedCountryCode) => {
191
+ var _a;
192
+ setZCountryUrlParam(selectedCountryCode);
193
+ (_a = document
194
+ .querySelector('zonos-hello')) === null || _a === void 0 ? void 0 : _a.setAttribute('z-country', selectedCountryCode);
195
+ };
196
+ const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelectedCountryCode, persistOverride, }) => {
197
+ var _a;
184
198
  log(`Updating selected country code to ${newSelectedCountryCode}`);
185
199
  const isFirstTime = !localizationStore.selectedCountryCode;
186
200
  localizationStore.selectedCountryCode = getValidCountryCode(newSelectedCountryCode);
187
- const { selectedCountryCode, shippingZoneCountries } = localizationStore;
188
- const isShippableCountry = !!shippingZoneCountries &&
189
- !!selectedCountryCode &&
190
- !!shippingZoneCountries[selectedCountryCode] &&
191
- // Make sure the country is not in the disabled countries list
192
- !zonosStore.disabledCountries.includes(selectedCountryCode);
201
+ const { selectedCountryCode } = localizationStore;
202
+ const isShippableCountry = isCountryInShippingZone(selectedCountryCode);
193
203
  // update shippable country
194
204
  localizationStore.isShippableCountry = isShippableCountry;
195
205
  log(`${localizationStore.selectedCountryCode} is a shippable country: ${localizationStore.isShippableCountry}`);
@@ -212,9 +222,10 @@ const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelecte
212
222
  return;
213
223
  }
214
224
  const currencyCode = getCurrencyCode(selectedCountryCode);
215
- // Only trigger callback onCountryChange if the country code has been set before
216
- if (!isFirstTime) {
217
- // Trigger callback onCountryChange
225
+ const shouldPersistOverride = persistOverride !== null && persistOverride !== void 0 ? persistOverride : !isInitializing;
226
+ // Only trigger onCountryChange after init — the first apply, and any
227
+ // reconcile fallback during init, are not shopper-selected changes.
228
+ if (!isFirstTime && !isInitializing) {
218
229
  (_a = zonosStore.onCountryChange) === null || _a === void 0 ? void 0 : _a.call(zonosStore, {
219
230
  countryCode: selectedCountryCode,
220
231
  currencyCode,
@@ -244,27 +255,24 @@ const localizationStoreUpdateSelectedCountryCode = ({ isInitializing, newSelecte
244
255
  localizationStore.countryLandedCost = null;
245
256
  localizationStore.inclusivePricingConfigurations = [];
246
257
  currencyDisplay();
258
+ }
259
+ else {
260
+ localizationStore.targetCurrency = currencyCode;
261
+ // Init may apply a remembered country that reconcile then discards. Fetch
262
+ // exchange rates once after reconcile for the final country instead.
247
263
  if (!isInitializing) {
248
- void getCustomMessages();
264
+ void getNewLocalization({ isInitializing: false });
249
265
  }
250
- // Clear session so the next visit falls back to geolocation, but keep
251
- // the current shopper's explicit selection visible in the URL (so a
252
- // same-tab reload still honors it) and on the hello element.
253
- window.sessionStorage.removeItem('zonos--country');
254
- setZCountryUrlParam(selectedCountryCode);
255
- (_b = document
256
- .querySelector('zonos-hello')) === null || _b === void 0 ? void 0 : _b.setAttribute('z-country', selectedCountryCode);
257
- return;
258
266
  }
259
- localizationStore.targetCurrency = currencyCode;
260
- void getNewLocalization({ isInitializing: isInitializing });
261
267
  if (!isInitializing) {
262
268
  void getCustomMessages();
263
269
  }
264
- window.sessionStorage.setItem('zonos--country', selectedCountryCode);
265
- setZCountryUrlParam(selectedCountryCode);
266
- (_c = document
267
- .querySelector('zonos-hello')) === null || _c === void 0 ? void 0 : _c.setAttribute('z-country', selectedCountryCode);
270
+ if (shouldPersistOverride) {
271
+ setCountryOverrideStorage(selectedCountryCode);
272
+ }
273
+ if (!isInitializing) {
274
+ syncSelectedCountryToPage(selectedCountryCode);
275
+ }
268
276
  };
269
277
  const initHelloCountryList = (allCountries) => {
270
278
  var _a, _b, _c, _d, _e, _f;
@@ -343,12 +351,25 @@ const localizationStoreUpdateSelectedLocale = (requestedLocale) => {
343
351
  localizationStore.selectedLocale = newSelectedLocale;
344
352
  translationStoreUpdateLanguage(newSelectedLocale);
345
353
  void updateCheckoutSessionLanguage();
346
- void getCustomMessages();
354
+ if (localizationStore.localizationLoaded) {
355
+ void getCustomMessages();
356
+ }
347
357
  };
348
358
  const initLocalizationStore = async () => {
349
359
  var _a;
360
+ migrateCountryOverrideStorage();
361
+ const urlCountryAtLoad = getZCountryUrlParam();
362
+ const storedCountryAtLoad = getCountryOverrideStorage();
363
+ const shouldPrefetchGeo = !!storedCountryAtLoad && !urlCountryAtLoad;
350
364
  // all countries from countries.json, shipping zone and localization
351
- const [allCountries, shippingZoneCountries, localization] = await Promise.all([getCountries(), getShippingZones(), getLocalization()]);
365
+ const [allCountries, shippingZoneCountries, localization, geoLocalization] = await Promise.all([
366
+ getCountries(),
367
+ getShippingZones(),
368
+ getLocalization(),
369
+ shouldPrefetchGeo
370
+ ? getLocalization({ ignoreCountryOverride: true })
371
+ : Promise.resolve(undefined),
372
+ ]);
352
373
  // Filter countries to only include countries in the shipping zone
353
374
  const filteredCountries = shippingZoneCountries === null || shippingZoneCountries === void 0 ? void 0 : shippingZoneCountries.reduce((acc, countryCode) => {
354
375
  const countryInfo = allCountries === null || allCountries === void 0 ? void 0 : allCountries[countryCode];
@@ -367,7 +388,7 @@ const initLocalizationStore = async () => {
367
388
  // update selected country code in store
368
389
  localizationStoreUpdateSelectedCountryCode({
369
390
  isInitializing: true,
370
- newSelectedCountryCode: country || null,
391
+ newSelectedCountryCode: country || storedCountryAtLoad,
371
392
  });
372
393
  // use locale from params if it exists, otherwise use locale from localization
373
394
  const overrideLocale = getOverrideLocale();
@@ -389,10 +410,24 @@ const initLocalizationStore = async () => {
389
410
  newSelectedCountryCode: 'CA',
390
411
  });
391
412
  }
413
+ const fallbackCountry = await reconcileRememberedCountryOverride({
414
+ geoCountry: geoLocalization === null || geoLocalization === void 0 ? void 0 : geoLocalization.country,
415
+ urlCountryAtLoad,
416
+ });
417
+ if (fallbackCountry) {
418
+ localizationStoreUpdateSelectedCountryCode({
419
+ isInitializing: true,
420
+ newSelectedCountryCode: fallbackCountry,
421
+ });
422
+ }
423
+ if (localizationStore.selectedCountryCode) {
424
+ syncSelectedCountryToPage(localizationStore.selectedCountryCode);
425
+ }
426
+ void getCustomMessages();
427
+ void getNewLocalization({ isInitializing: true });
392
428
  if (!localizationStore.localizationLoaded) {
393
429
  localizationStore.localizationLoaded = true;
394
430
  void removeBigcommerceCartShipping();
395
- // shouldShowHelloWidget is false because localization is not loaded yet
396
431
  void toggleBigcommerceNativeCurrencySelector();
397
432
  }
398
433
  };
@@ -71,9 +71,11 @@ const { dispose: zonosStoreDispose, onChange: zonosStoreOnChange, reset, state:
71
71
  * Default to bottom right so hello would float if anchorElementSelector is not set. Otherwise, this will be ignored
72
72
  */
73
73
  desktopLocation: 'BOTTOM_RIGHT',
74
+ desktopLocationOverride: null,
74
75
  excludedUrlPatterns: [],
75
76
  homepageUrlPattern: '',
76
77
  mobileLocation: 'BOTTOM_RIGHT',
78
+ mobileLocationOverride: null,
77
79
  mode: 'LIVE',
78
80
  notFoundElementFallback: null,
79
81
  organization: '',
@@ -357,11 +357,11 @@ export class ZonosAddress {
357
357
  this.isAddressFilled = true;
358
358
  }
359
359
  // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
360
- return (h(Host, { key: '9b7a5340b839d63c64da03639bdfda5a11a5c25e', class: classes([
360
+ return (h(Host, { key: '302dafde973c4bf2d847640d8f0e064d88f350f8', class: classes([
361
361
  'zonos--address',
362
362
  'zonos--elements',
363
363
  `zonos--${this.type}-address`,
364
- ]) }, this.titleText && (h("zonos-text", { key: '23739f6a48e5698372df2d53098dea6ad1c0559a', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), h("slot", { key: 'dea4b437eedaad2af2f6bbe3a1e2ae4f0706aa13', name: "below-title" }), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderShortAddressCodeInput(), h("div", { key: 'b4be684977a632371b9b6ff4587ccdd7bacc8c67', class: "zonos--address-component" })));
364
+ ]) }, this.titleText && (h("zonos-text", { key: '706204604ad32eed710e38adbe8133b3384044eb', class: "zonos--title", type: "semiBoldLabel" }, this.titleText)), h("slot", { key: '0edc4c5d6c3ff965be6edbf680acaed892c71a16', name: "below-title" }), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderShortAddressCodeInput(), h("div", { key: '6aa6e4e86a76f1081c5af1f2b5f3282dfd91f3c5', class: "zonos--address-component" })));
365
365
  }
366
366
  static get is() { return "zonos-address"; }
367
367
  static get encapsulation() { return "scoped"; }
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
1
  import { h, Host, } from "@stencil/core";
3
2
  import { classes } from "../../../utils/classes";
4
3
  import { getBorderRadius } from "../../../utils/getBorderRadius";
@@ -78,9 +77,9 @@ export class ZonosAddressSuggestions {
78
77
  return segments;
79
78
  }
80
79
  render() {
81
- return (h(Host, { key: '9de4179f1bd0057ac71d6b9ed646c034035382f7', class: "zonos--address-suggestions", role: "group", style: {
80
+ return (h(Host, { key: '34018ecc951c0335041e24102329eb83a8d68439', class: "zonos--address-suggestions", role: "group", style: {
82
81
  '--zonos--border-radius': getBorderRadius(),
83
- } }, h("ul", { key: '62fa5ed92fafcdd641f9a7eb36e36e62309c9f52', "aria-label": "Suggestions", class: "wrapper", role: "listbox" }, !!this.localSuggestions.length && (h("li", { key: '27c61b5693720d0b33a75385841476787f92b884', "aria-selected": false, class: "powered-by option", role: "option" }, h("div", { key: 'fea9f2e8f65cd50fdf28fc45e18beb8976320f0d', class: "powered-by-container" }, h("zonos-text", { key: '1fec46f543e3673433b6924f7dca1cbd84e0ef16', type: "caption" }, "Suggestions powered by"), h("zonos-text", { key: '7b3fd93c18d4320522d61e07278f5388d14c8bbb', type: "semiBoldLabel" }, "Google")), h("zonos-button", { key: '61a8362ab0514a78dd71eaa9bd638dc8b50e2a9c', "aria-label": "Clear suggestions", icon: h("zonos-icon", { content: RemoveIcon }), noBackground: true, onClick: () => {
82
+ } }, h("ul", { key: '80433831c875845e57225a1317c430e2626edf9a', "aria-label": "Suggestions", class: "wrapper", role: "listbox" }, !!this.localSuggestions.length && (h("li", { key: '3510ef51b56b1cb0a36334e842792bccc2daeca5', "aria-selected": false, class: "powered-by option", role: "option" }, h("div", { key: '72773af6f9c7e0644ebc5239e4bf585bba6e164a', class: "powered-by-container" }, h("zonos-text", { key: '7fabccbe33cbc8d037dfd25f6e5b0a5bdaf97b2f', type: "caption" }, "Suggestions powered by"), h("zonos-text", { key: '2d88a3b8d7369a44e910ec60f5c7ac0c3f0ce801', type: "semiBoldLabel" }, "Google")), h("zonos-button", { key: '74315c248cc84617d854a3b51d0bad8300c6b762', "aria-label": "Clear suggestions", icon: h("zonos-icon", { content: RemoveIcon }), noBackground: true, onClick: () => {
84
83
  this.localSuggestions = [];
85
84
  } }))), this.localSuggestions.map(suggestion => (
86
85
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events
@@ -933,10 +933,10 @@ export class ZonosAddress {
933
933
  this.country = localizationStore.selectedCountryCode;
934
934
  }
935
935
  // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
936
- return (h(Host, { key: 'b4e39a6e92e646f98c0061bf3de8e028c9285556', class: classes([
936
+ return (h(Host, { key: '9d178094ee341623633d1e3822bd79f254a27e51', class: classes([
937
937
  'zonos--address zonos--elements',
938
938
  `zonos--${this.type}-address`,
939
- ]) }, h("zonos-text", { key: '28d21737c78a1b8125c5170c67f214e3f39939ff', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("slot", { key: '97357f001b27197b8648d6158b786b153c31a7ba', name: "below-title" }), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderShortAddressCodeInput(), this.renderCustomAddressForm()));
939
+ ]) }, h("zonos-text", { key: 'c36b4ce9b63cce95664894fd8929ffe15807a22a', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("slot", { key: '661eab7074f99b6dca52d5f7f546cfbd29322fbf', name: "below-title" }), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderShortAddressCodeInput(), this.renderCustomAddressForm()));
940
940
  }
941
941
  static get is() { return "zonos-custom-address"; }
942
942
  static get encapsulation() { return "scoped"; }
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
1
  import { h, Host, } from "@stencil/core";
3
2
  import { cartStore } from "../../store/checkout/cart";
4
3
  import { stripeStore, stripeStoreOnChange, } from "../../store/checkout/stripe";
@@ -1,8 +1,8 @@
1
1
  import { getOverridenZCountry } from "../getOverridenZCountry";
2
2
  import { handleFetch } from "../handleFetch";
3
- export const getLocalization = async () => {
3
+ export const getLocalization = async ({ ignoreCountryOverride = false, } = {}) => {
4
4
  try {
5
- const zCountry = getOverridenZCountry();
5
+ const zCountry = ignoreCountryOverride ? null : getOverridenZCountry();
6
6
  const searchParams = new URLSearchParams();
7
7
  if (zCountry) {
8
8
  searchParams.set('zCountry', zCountry);
@@ -1,18 +1,16 @@
1
1
  import { localizationStore } from "../../store/hello/localization";
2
- import { zonosStore } from "../../store/zonosStore";
2
+ import { isCountryInShippingZone } from "../hello/isCountryInShippingZone";
3
3
  import { log } from "../logging/log";
4
4
  export const isShippableCountry = (showLog = true,
5
5
  /**
6
6
  * If provided, will check if the country is shippable based on the provided country code instead of the Hello selected country code
7
7
  */
8
8
  providedCountryCode) => {
9
- var _a;
10
9
  if (!localizationStore.localizationLoaded) {
11
10
  return false;
12
11
  }
13
12
  if (providedCountryCode) {
14
- const isProvidedCountryCodeShippableCountry = !!((_a = localizationStore.shippingZoneCountries) === null || _a === void 0 ? void 0 : _a[providedCountryCode]) &&
15
- !zonosStore.disabledCountries.includes(providedCountryCode);
13
+ const isProvidedCountryCodeShippableCountry = isCountryInShippingZone(providedCountryCode);
16
14
  if (showLog && !isProvidedCountryCodeShippableCountry) {
17
15
  log(`Checkout: ${providedCountryCode} is not a shippable country: ${isProvidedCountryCodeShippableCountry}`);
18
16
  }
@@ -48,6 +48,7 @@ export const watchBigcommerceDomesticCheckout = ({ domesticRedirectedBtnSelector
48
48
  localizationStoreUpdateSelectedCountryCode({
49
49
  isInitializing: false,
50
50
  newSelectedCountryCode: shippingCountry,
51
+ persistOverride: false,
51
52
  });
52
53
  // do nothing if the country is still domestic
53
54
  if (!isShippableCountry(false)) {
@@ -80,6 +80,7 @@ const checkLoggedInUserShippingAddress = async ({ onInternationalCheckoutSelecte
80
80
  localizationStoreUpdateSelectedCountryCode({
81
81
  isInitializing: false,
82
82
  newSelectedCountryCode: countryCode,
83
+ persistOverride: false,
83
84
  });
84
85
  // Save the shipping address to session storage for the international checkout
85
86
  stripeStoreSaveDomesticShippingSession({
@@ -163,6 +164,7 @@ export const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedi
163
164
  localizationStoreUpdateSelectedCountryCode({
164
165
  isInitializing: false,
165
166
  newSelectedCountryCode: shippingCountry,
167
+ persistOverride: false,
166
168
  });
167
169
  const shippingAddress = {
168
170
  address1: '',
@@ -1,6 +1,4 @@
1
- export const formatDate = ({ date,
2
- // eslint-disable-next-line sort-keys/sort-keys-fix
3
- formatOptions = {
1
+ export const formatDate = ({ date, formatOptions = {
4
2
  dateStyle: 'full',
5
3
  }, }) => {
6
4
  // format date to 'Wednesday, May 15, 2024'
@@ -1,11 +1,9 @@
1
+ import { getCountryOverrideStorage } from "./hello/countryOverrideStorage";
1
2
  import { getZCountryUrlParam } from "./hello/getZCountryUrlParam";
2
3
  /**
3
- * Retrieve the zCountry from the URL or session storage.
4
+ * Retrieve the shopper country override from the URL or remembered storage.
4
5
  */
5
6
  export const getOverridenZCountry = () => {
6
7
  const currentUrl = new URL(window.location.href);
7
- // load and use country from session storage when zCountry query param is not present
8
- const countryLoadedSession = window.sessionStorage.getItem('zonos--country');
9
- const zCountry = getZCountryUrlParam(currentUrl.searchParams) || countryLoadedSession;
10
- return zCountry;
8
+ return (getZCountryUrlParam(currentUrl.searchParams) || getCountryOverrideStorage());
11
9
  };
@@ -0,0 +1,49 @@
1
+ import { isCountryCode } from "./isCountryCode";
2
+ const COUNTRY_OVERRIDE_KEY = 'zonos--country';
3
+ const withBlockedStorage = (run) => {
4
+ try {
5
+ run();
6
+ }
7
+ catch (_a) {
8
+ // localStorage/sessionStorage can throw in blocked-storage contexts
9
+ // (Safari private mode, cross-origin iframes).
10
+ }
11
+ };
12
+ const clearSessionOverride = () => {
13
+ window.sessionStorage.removeItem(COUNTRY_OVERRIDE_KEY);
14
+ };
15
+ const readStoredCountry = (storage) => {
16
+ try {
17
+ const value = storage.getItem(COUNTRY_OVERRIDE_KEY);
18
+ if (!value || !isCountryCode(value)) {
19
+ return null;
20
+ }
21
+ return value;
22
+ }
23
+ catch (_a) {
24
+ return null;
25
+ }
26
+ };
27
+ export const getCountryOverrideStorage = () => {
28
+ var _a;
29
+ return (_a = readStoredCountry(window.localStorage)) !== null && _a !== void 0 ? _a : readStoredCountry(window.sessionStorage);
30
+ };
31
+ export const migrateCountryOverrideStorage = () => {
32
+ withBlockedStorage(() => {
33
+ if (readStoredCountry(window.localStorage)) {
34
+ clearSessionOverride();
35
+ }
36
+ });
37
+ };
38
+ export const setCountryOverrideStorage = (countryCode) => {
39
+ withBlockedStorage(() => {
40
+ window.localStorage.setItem(COUNTRY_OVERRIDE_KEY, countryCode);
41
+ clearSessionOverride();
42
+ });
43
+ };
44
+ export const clearCountryOverrideStorage = () => {
45
+ withBlockedStorage(() => {
46
+ window.localStorage.removeItem(COUNTRY_OVERRIDE_KEY);
47
+ clearSessionOverride();
48
+ });
49
+ };
@@ -1,16 +1,12 @@
1
- const validateCountryCode = (countryCode) => {
2
- // Check that the country is two characters and is upper case
3
- if (countryCode && /^[A-Z]{2}$/.test(countryCode)) {
4
- return countryCode;
5
- }
6
- return null;
7
- };
1
+ import { isCountryCode } from "./isCountryCode";
8
2
  export const getZCountryUrlParam = (urlParams) => {
9
3
  const urlSearchParams = new URLSearchParams(urlParams || window.location.search);
10
4
  const getCountryParam = (param) => {
11
5
  const country = urlSearchParams.get(param);
12
- // Check that the country is two characters and is upper case
13
- return validateCountryCode(country);
6
+ if (country && isCountryCode(country)) {
7
+ return country;
8
+ }
9
+ return null;
14
10
  };
15
11
  const zCountry = getCountryParam('zCountry');
16
12
  // Fallback to legacy 'country'
@@ -0,0 +1 @@
1
+ export const isCountryCode = (value) => /^[A-Z]{2}$/.test(value);
@@ -0,0 +1,8 @@
1
+ import { localizationStore } from "../../store/hello/localization";
2
+ import { zonosStore } from "../../store/zonosStore";
3
+ export const isCountryInShippingZone = (countryCode) => {
4
+ var _a;
5
+ return !!countryCode &&
6
+ !!((_a = localizationStore.shippingZoneCountries) === null || _a === void 0 ? void 0 : _a[countryCode]) &&
7
+ !zonosStore.disabledCountries.includes(countryCode);
8
+ };
@@ -0,0 +1,37 @@
1
+ import { getLocalization } from "../api/getLocalization";
2
+ import { clearCountryOverrideStorage, getCountryOverrideStorage, } from "./countryOverrideStorage";
3
+ import { getHelloWidgetVisibility } from "./shouldShowHelloWidget";
4
+ /**
5
+ * Drop a remembered Hello country when widgetVisibility would hide the
6
+ * widget for it, then fall back to geo.
7
+ *
8
+ * Does not mutate the localization store — the caller applies the returned
9
+ * country. Pass `geoCountry` when init already fetched IP localization so
10
+ * discard does not wait on a second round trip. Pass `urlCountryAtLoad`
11
+ * from the URL as it was at page load (before init writes `zCountry` for
12
+ * URL_PARAM merchants). Do not omit it after a live URL write — the
13
+ * default is `null`, not the current URL. Storage is cleared when geo
14
+ * succeeds, or when a load-time URL country won and the stored country
15
+ * would be hidden.
16
+ */
17
+ export const reconcileRememberedCountryOverride = async ({ geoCountry, urlCountryAtLoad = null, } = {}) => {
18
+ const storedCountry = getCountryOverrideStorage();
19
+ if (!storedCountry) {
20
+ return null;
21
+ }
22
+ if (getHelloWidgetVisibility(false, storedCountry)) {
23
+ return null;
24
+ }
25
+ if (urlCountryAtLoad) {
26
+ clearCountryOverrideStorage();
27
+ return null;
28
+ }
29
+ const country = geoCountry !== undefined
30
+ ? geoCountry
31
+ : (await getLocalization({ ignoreCountryOverride: true })).country;
32
+ if (!country) {
33
+ return null;
34
+ }
35
+ clearCountryOverrideStorage();
36
+ return country;
37
+ };