@zonos/elements 1.3.255 → 1.3.257

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 (330) hide show
  1. package/dist/cjs/{cart-4ef52500.js → cart-cd0a054b.js} +4 -4
  2. package/dist/cjs/{debounce-0c75ba33.js → debounce-3e17b4e9.js} +1 -1
  3. package/dist/cjs/{getBorderRadius-27a74844.js → getBorderRadius-db55a464.js} +1 -1
  4. package/dist/cjs/{getContrastColor-cc087c53.js → getContrastColor-8ed1cb48.js} +2 -2
  5. package/dist/cjs/{hasInclusivePrice-4419d03e.js → hasInclusivePrice-3650109c.js} +1 -1
  6. package/dist/cjs/index.cjs.js +7 -7
  7. package/dist/cjs/{invoice-3494b21e.js → invoice-1cea739b.js} +3 -3
  8. package/dist/cjs/{isCollectMobileTablet-92955ce6.js → isCollectMobileTablet-65c71740.js} +3 -3
  9. package/dist/cjs/{isContrastColor-d1936a5c.js → isContrastColor-6a17f408.js} +1 -1
  10. package/dist/cjs/{isDarkColor-a68abf7a.js → isDarkColor-bfe6d1eb.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/{localization-75f4ec05.js → localization-adaab93f.js} +295 -20
  13. package/dist/cjs/{paypal-cc3a730b.js → paypal-326d7bc5.js} +5 -5
  14. package/dist/cjs/{placeTestOrder-13901275.js → placeTestOrder-53f2fe97.js} +2 -2
  15. package/dist/cjs/{renderCheckoutCurrency-0003992c.js → renderCheckoutCurrency-cf2e3b93.js} +2 -2
  16. package/dist/cjs/{submitGtag-cb4fb332.js → submitGtag-9ac5a42e.js} +1 -1
  17. package/dist/cjs/{throttle-ff483793.js → throttle-dac93461.js} +2 -2
  18. package/dist/cjs/{updateCheckoutSessionAttributes-8be63b63.js → updateCheckoutSessionAttributes-a3776bb0.js} +1 -1
  19. package/dist/cjs/zonos-address-display_8.cjs.entry.js +7 -7
  20. package/dist/cjs/zonos-address_4.cjs.entry.js +7 -7
  21. package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
  22. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  24. package/dist/cjs/zonos-card_5.cjs.entry.js +8 -8
  25. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +14 -14
  26. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +3 -3
  27. package/dist/cjs/zonos-checkout.cjs.entry.js +364 -85
  28. package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
  29. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +5 -5
  30. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +11 -11
  31. package/dist/cjs/zonos-collect.cjs.entry.js +9 -9
  32. package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
  33. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  34. package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -3
  35. package/dist/cjs/zonos-elements.cjs.js +1 -1
  36. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
  37. package/dist/cjs/zonos-hello.cjs.entry.js +38 -15
  38. package/dist/cjs/zonos-input.cjs.entry.js +2 -2
  39. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +7 -7
  40. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +11 -11
  41. package/dist/cjs/zonos-invoice.cjs.entry.js +9 -9
  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-shipping-rich-radio.cjs.entry.js +5 -5
  45. package/dist/cjs/zonos-store-credit.cjs.entry.js +6 -6
  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-f5a61112.js → zonosStore-1c517e55.js} +0 -1
  50. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +60 -2
  51. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +35 -12
  52. package/dist/collection/components/store/hello/localization.js +54 -19
  53. package/dist/collection/components/store/translationStore/strings.arabic.js +12 -0
  54. package/dist/collection/components/store/translationStore/strings.base.js +12 -0
  55. package/dist/collection/components/store/translationStore/strings.chinese.js +12 -0
  56. package/dist/collection/components/store/translationStore/strings.danish.js +12 -0
  57. package/dist/collection/components/store/translationStore/strings.dutch.js +12 -0
  58. package/dist/collection/components/store/translationStore/strings.french.js +12 -0
  59. package/dist/collection/components/store/translationStore/strings.german.js +12 -0
  60. package/dist/collection/components/store/translationStore/strings.hebrew.js +12 -0
  61. package/dist/collection/components/store/translationStore/strings.indonesian.js +12 -0
  62. package/dist/collection/components/store/translationStore/strings.italian.js +12 -0
  63. package/dist/collection/components/store/translationStore/strings.japanese.js +12 -0
  64. package/dist/collection/components/store/translationStore/strings.korean.js +12 -0
  65. package/dist/collection/components/store/translationStore/strings.norwegian.js +12 -0
  66. package/dist/collection/components/store/translationStore/strings.polish.js +12 -0
  67. package/dist/collection/components/store/translationStore/strings.portuguese.js +12 -0
  68. package/dist/collection/components/store/translationStore/strings.russian.js +12 -0
  69. package/dist/collection/components/store/translationStore/strings.spanish.js +12 -0
  70. package/dist/collection/components/store/translationStore/strings.swedish.js +12 -0
  71. package/dist/collection/components/store/translationStore/strings.turkish.js +12 -0
  72. package/dist/collection/components/store/translationStore/strings.vietnamese.js +12 -0
  73. package/dist/collection/components/store/zonosStore.js +0 -1
  74. package/dist/collection/components/utils/checkout/bigcommerceStorefrontApi.js +52 -0
  75. package/dist/collection/components/utils/checkout/buildBigcommerceRedirectUrl.js +22 -0
  76. package/dist/collection/components/utils/checkout/checkBigCommerceBypassCustomerGroup.js +122 -0
  77. package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +5 -2
  78. package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +120 -86
  79. package/dist/collection/types/generated/graphql.internal.types.js +446 -0
  80. package/dist/esm/{cart-f4e43d1a.js → cart-4cd47a1b.js} +4 -4
  81. package/dist/esm/{debounce-efc0e473.js → debounce-8faafc9f.js} +1 -1
  82. package/dist/esm/{getBorderRadius-c21a42e5.js → getBorderRadius-66de1b16.js} +1 -1
  83. package/dist/esm/{getContrastColor-98f0d1d5.js → getContrastColor-e14f95a7.js} +2 -2
  84. package/dist/esm/{hasInclusivePrice-0439b7f4.js → hasInclusivePrice-7a3dc4c3.js} +1 -1
  85. package/dist/esm/index.js +7 -7
  86. package/dist/esm/{invoice-3d8f3fa8.js → invoice-03ff7bbb.js} +3 -3
  87. package/dist/esm/{isCollectMobileTablet-0402aa32.js → isCollectMobileTablet-9eb77c9a.js} +3 -3
  88. package/dist/esm/{isContrastColor-c17e83c9.js → isContrastColor-f9e65e70.js} +1 -1
  89. package/dist/esm/{isDarkColor-3537021b.js → isDarkColor-8092a9fb.js} +1 -1
  90. package/dist/esm/loader.js +1 -1
  91. package/dist/esm/{localization-026da80b.js → localization-79e08480.js} +295 -20
  92. package/dist/esm/{paypal-07bd6b7c.js → paypal-67c86683.js} +5 -5
  93. package/dist/esm/{placeTestOrder-39de11f4.js → placeTestOrder-e81fff15.js} +2 -2
  94. package/dist/esm/{renderCheckoutCurrency-743f7c77.js → renderCheckoutCurrency-1fc00db4.js} +2 -2
  95. package/dist/esm/{submitGtag-13de9f1f.js → submitGtag-543058f9.js} +1 -1
  96. package/dist/esm/{throttle-0504ba2c.js → throttle-5a66b4fd.js} +2 -2
  97. package/dist/esm/{updateCheckoutSessionAttributes-b9f7e982.js → updateCheckoutSessionAttributes-8f3f932e.js} +1 -1
  98. package/dist/esm/zonos-address-display_8.entry.js +7 -7
  99. package/dist/esm/zonos-address_4.entry.js +7 -7
  100. package/dist/esm/zonos-badge.entry.js +1 -1
  101. package/dist/esm/zonos-banner.entry.js +1 -1
  102. package/dist/esm/zonos-button_3.entry.js +3 -3
  103. package/dist/esm/zonos-card_5.entry.js +8 -8
  104. package/dist/esm/zonos-cart-items_12.entry.js +14 -14
  105. package/dist/esm/zonos-checkbox_2.entry.js +3 -3
  106. package/dist/esm/zonos-checkout.entry.js +365 -86
  107. package/dist/esm/zonos-collapse.entry.js +1 -1
  108. package/dist/esm/zonos-collect-cart-items_3.entry.js +5 -5
  109. package/dist/esm/zonos-collect-finish_6.entry.js +11 -11
  110. package/dist/esm/zonos-collect.entry.js +9 -9
  111. package/dist/esm/zonos-controller.entry.js +6 -6
  112. package/dist/esm/zonos-country-flag.entry.js +2 -2
  113. package/dist/esm/zonos-country-select_4.entry.js +3 -3
  114. package/dist/esm/zonos-elements.js +1 -1
  115. package/dist/esm/zonos-hello-dialog.entry.js +3 -3
  116. package/dist/esm/zonos-hello.entry.js +38 -15
  117. package/dist/esm/zonos-input.entry.js +2 -2
  118. package/dist/esm/zonos-invoice-cart-items_2.entry.js +7 -7
  119. package/dist/esm/zonos-invoice-finish_5.entry.js +11 -11
  120. package/dist/esm/zonos-invoice.entry.js +9 -9
  121. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  122. package/dist/esm/zonos-logo.entry.js +1 -1
  123. package/dist/esm/zonos-shipping-rich-radio.entry.js +5 -5
  124. package/dist/esm/zonos-store-credit.entry.js +6 -6
  125. package/dist/esm/zonos-stripe-input.entry.js +3 -3
  126. package/dist/esm/zonos-text.entry.js +1 -1
  127. package/dist/esm/zonos-v-stack.entry.js +1 -1
  128. package/dist/esm/{zonosStore-5242a58d.js → zonosStore-f1d45eac.js} +0 -1
  129. package/dist/esm-es5/{cart-f4e43d1a.js → cart-4cd47a1b.js} +1 -1
  130. package/dist/esm-es5/{debounce-efc0e473.js → debounce-8faafc9f.js} +1 -1
  131. package/dist/esm-es5/{getBorderRadius-c21a42e5.js → getBorderRadius-66de1b16.js} +1 -1
  132. package/dist/esm-es5/{getContrastColor-98f0d1d5.js → getContrastColor-e14f95a7.js} +1 -1
  133. package/dist/esm-es5/{hasInclusivePrice-0439b7f4.js → hasInclusivePrice-7a3dc4c3.js} +1 -1
  134. package/dist/esm-es5/index.js +1 -1
  135. package/dist/esm-es5/{invoice-3d8f3fa8.js → invoice-03ff7bbb.js} +1 -1
  136. package/dist/esm-es5/{isCollectMobileTablet-0402aa32.js → isCollectMobileTablet-9eb77c9a.js} +1 -1
  137. package/dist/esm-es5/{isContrastColor-c17e83c9.js → isContrastColor-f9e65e70.js} +1 -1
  138. package/dist/esm-es5/{isDarkColor-3537021b.js → isDarkColor-8092a9fb.js} +1 -1
  139. package/dist/esm-es5/loader.js +1 -1
  140. package/dist/esm-es5/localization-79e08480.js +1 -0
  141. package/dist/esm-es5/{paypal-07bd6b7c.js → paypal-67c86683.js} +2 -2
  142. package/dist/esm-es5/{placeTestOrder-39de11f4.js → placeTestOrder-e81fff15.js} +1 -1
  143. package/dist/esm-es5/{renderCheckoutCurrency-743f7c77.js → renderCheckoutCurrency-1fc00db4.js} +1 -1
  144. package/dist/esm-es5/{submitGtag-13de9f1f.js → submitGtag-543058f9.js} +1 -1
  145. package/dist/esm-es5/{throttle-0504ba2c.js → throttle-5a66b4fd.js} +1 -1
  146. package/dist/esm-es5/{updateCheckoutSessionAttributes-b9f7e982.js → updateCheckoutSessionAttributes-8f3f932e.js} +1 -1
  147. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
  148. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  149. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  150. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  151. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  152. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  153. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  154. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
  155. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  156. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  157. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  158. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  159. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  160. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  161. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  162. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  163. package/dist/esm-es5/zonos-elements.js +1 -1
  164. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  165. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  166. package/dist/esm-es5/zonos-input.entry.js +1 -1
  167. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  168. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  169. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  170. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  171. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  172. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  173. package/dist/esm-es5/zonos-store-credit.entry.js +1 -1
  174. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  175. package/dist/esm-es5/zonos-text.entry.js +1 -1
  176. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  177. package/dist/esm-es5/{zonosStore-5242a58d.js → zonosStore-f1d45eac.js} +1 -1
  178. package/dist/scripts/index.d.ts +107 -8
  179. package/dist/scripts/index.js +1 -1
  180. package/dist/scripts/loadZonos.js +1 -1
  181. package/dist/scripts/zonos.js +1 -1
  182. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +13 -0
  183. package/dist/types/components/store/translationStore/strings.arabic.d.ts +12 -0
  184. package/dist/types/components/store/translationStore/strings.base.d.ts +12 -0
  185. package/dist/types/components/store/translationStore/strings.chinese.d.ts +12 -0
  186. package/dist/types/components/store/translationStore/strings.danish.d.ts +12 -0
  187. package/dist/types/components/store/translationStore/strings.dutch.d.ts +12 -0
  188. package/dist/types/components/store/translationStore/strings.french.d.ts +12 -0
  189. package/dist/types/components/store/translationStore/strings.german.d.ts +12 -0
  190. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +12 -0
  191. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +12 -0
  192. package/dist/types/components/store/translationStore/strings.italian.d.ts +12 -0
  193. package/dist/types/components/store/translationStore/strings.japanese.d.ts +12 -0
  194. package/dist/types/components/store/translationStore/strings.korean.d.ts +12 -0
  195. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +12 -0
  196. package/dist/types/components/store/translationStore/strings.polish.d.ts +12 -0
  197. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +12 -0
  198. package/dist/types/components/store/translationStore/strings.russian.d.ts +12 -0
  199. package/dist/types/components/store/translationStore/strings.spanish.d.ts +12 -0
  200. package/dist/types/components/store/translationStore/strings.swedish.d.ts +12 -0
  201. package/dist/types/components/store/translationStore/strings.turkish.d.ts +12 -0
  202. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +12 -0
  203. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  204. package/dist/types/components/utils/checkout/bigcommerceStorefrontApi.d.ts +36 -0
  205. package/dist/types/components/utils/checkout/buildBigcommerceRedirectUrl.d.ts +11 -0
  206. package/dist/types/components/utils/checkout/checkBigCommerceBypassCustomerGroup.d.ts +30 -0
  207. package/dist/types/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.d.ts +16 -1
  208. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +18 -6
  209. package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
  210. package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
  211. package/dist/types/types/generated/graphql.internal.types.d.ts +532 -11
  212. package/dist/types/types/generated/graphql.internal.types.ts +600 -11
  213. package/dist/types/types/hello/HelloConfig.d.ts +22 -3
  214. package/dist/types/types/utils/ZonosSettings.d.ts +7 -0
  215. package/dist/zonos-elements/index.esm.js +1 -1
  216. package/dist/zonos-elements/{p-568c5700.system.entry.js → p-0740f8a4.system.entry.js} +1 -1
  217. package/dist/zonos-elements/p-09307a03.js +1 -0
  218. package/dist/zonos-elements/{p-1bdac1d3.entry.js → p-0ca6ee9b.entry.js} +1 -1
  219. package/dist/zonos-elements/p-0e83d193.js +1 -0
  220. package/dist/zonos-elements/{p-9b12f023.system.entry.js → p-0f4822cc.system.entry.js} +1 -1
  221. package/dist/zonos-elements/{p-8d5f928c.system.entry.js → p-1368dce7.system.entry.js} +1 -1
  222. package/dist/zonos-elements/{p-ac30b7a8.system.js → p-15ef7644.system.js} +1 -1
  223. package/dist/zonos-elements/{p-ab25379f.system.js → p-17a8a514.system.js} +1 -1
  224. package/dist/zonos-elements/{p-0649737d.entry.js → p-21519ebe.entry.js} +1 -1
  225. package/dist/zonos-elements/{p-16a80e3c.system.js → p-22bb7836.system.js} +1 -1
  226. package/dist/zonos-elements/p-271eebd3.system.js +1 -0
  227. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  228. package/dist/zonos-elements/{p-d397560e.system.entry.js → p-2c1c6d60.system.entry.js} +1 -1
  229. package/dist/zonos-elements/{p-908f13ae.js → p-2f924331.js} +1 -1
  230. package/dist/zonos-elements/{p-4aefd668.entry.js → p-2fa41e93.entry.js} +1 -1
  231. package/dist/zonos-elements/{p-9e98a256.system.entry.js → p-3092ec40.system.entry.js} +1 -1
  232. package/dist/zonos-elements/{p-dbb3db89.system.entry.js → p-313b87f3.system.entry.js} +1 -1
  233. package/dist/zonos-elements/{p-c9d4eb42.entry.js → p-3576d900.entry.js} +1 -1
  234. package/dist/zonos-elements/{p-a6cc56ba.entry.js → p-3675766a.entry.js} +1 -1
  235. package/dist/zonos-elements/p-380143db.entry.js +1 -0
  236. package/dist/zonos-elements/{p-4f7d64f6.js → p-387f6a4d.js} +1 -1
  237. package/dist/zonos-elements/{p-d168be79.system.entry.js → p-3fc43187.system.entry.js} +1 -1
  238. package/dist/zonos-elements/{p-a1c476d6.system.entry.js → p-3ff736f7.system.entry.js} +1 -1
  239. package/dist/zonos-elements/{p-d938fb86.entry.js → p-429c1d0c.entry.js} +1 -1
  240. package/dist/zonos-elements/{p-8c6624b6.system.js → p-43a6e469.system.js} +1 -1
  241. package/dist/zonos-elements/{p-5678c5b5.system.entry.js → p-4a84387a.system.entry.js} +1 -1
  242. package/dist/zonos-elements/{p-af83f0c2.js → p-4e2262e8.js} +1 -1
  243. package/dist/zonos-elements/p-53fe581b.system.js +1 -0
  244. package/dist/zonos-elements/{p-3e03b2e8.entry.js → p-5818f4a7.entry.js} +1 -1
  245. package/dist/zonos-elements/{p-f830f800.js → p-5beab541.js} +1 -1
  246. package/dist/zonos-elements/{p-d18a2b2c.system.js → p-61be7d98.system.js} +1 -1
  247. package/dist/zonos-elements/{p-70c8a47d.system.entry.js → p-62dbc5f8.system.entry.js} +1 -1
  248. package/dist/zonos-elements/{p-6ce8374e.entry.js → p-6b83ac7f.entry.js} +1 -1
  249. package/dist/zonos-elements/p-6bcbe651.js +1 -0
  250. package/dist/zonos-elements/{p-835c0bd4.js → p-7559c494.js} +1 -1
  251. package/dist/zonos-elements/{p-8f1ab25c.system.entry.js → p-770d414a.system.entry.js} +1 -1
  252. package/dist/zonos-elements/{p-7427dd1e.entry.js → p-7a379538.entry.js} +1 -1
  253. package/dist/zonos-elements/{p-fbe22363.entry.js → p-7aeb496e.entry.js} +1 -1
  254. package/dist/zonos-elements/p-7caa75bb.js +1 -0
  255. package/dist/zonos-elements/p-7cbbf483.system.js +1 -0
  256. package/dist/zonos-elements/p-7d9bbdc8.js +1 -0
  257. package/dist/zonos-elements/{p-e12f7a97.entry.js → p-80ba5f70.entry.js} +1 -1
  258. package/dist/zonos-elements/{p-2b10f633.system.js → p-8adc0a13.system.js} +1 -1
  259. package/dist/zonos-elements/{p-b45538a7.system.entry.js → p-8b35e475.system.entry.js} +1 -1
  260. package/dist/zonos-elements/p-8bce79f4.system.js +1 -0
  261. package/dist/zonos-elements/{p-c398711f.js → p-8ed0fad5.js} +2 -2
  262. package/dist/zonos-elements/{p-18d411c3.system.entry.js → p-9161f10d.system.entry.js} +1 -1
  263. package/dist/zonos-elements/{p-f888db89.entry.js → p-91eeccaa.entry.js} +1 -1
  264. package/dist/zonos-elements/p-944bf0e7.js +1 -0
  265. package/dist/zonos-elements/{p-3730d555.system.entry.js → p-9d435f12.system.entry.js} +1 -1
  266. package/dist/zonos-elements/{p-db0b35a2.system.entry.js → p-9f3aab4e.system.entry.js} +1 -1
  267. package/dist/zonos-elements/{p-231edcca.entry.js → p-a60544cc.entry.js} +1 -1
  268. package/dist/zonos-elements/{p-33fc0c8f.entry.js → p-a7b0345b.entry.js} +1 -1
  269. package/dist/zonos-elements/{p-aabb921f.system.js → p-a90c977a.system.js} +1 -1
  270. package/dist/zonos-elements/{p-a1835bae.system.entry.js → p-aa3e3438.system.entry.js} +1 -1
  271. package/dist/zonos-elements/p-ac7b93c9.js +1 -0
  272. package/dist/zonos-elements/{p-5359ba71.entry.js → p-b3824361.entry.js} +1 -1
  273. package/dist/zonos-elements/{p-9d9792b9.system.entry.js → p-b414b484.system.entry.js} +1 -1
  274. package/dist/zonos-elements/{p-50aac43c.system.js → p-b53856bf.system.js} +1 -1
  275. package/dist/zonos-elements/{p-2aa44601.entry.js → p-bb6e7e9e.entry.js} +1 -1
  276. package/dist/zonos-elements/{p-939ba2a5.entry.js → p-bb785f33.entry.js} +1 -1
  277. package/dist/zonos-elements/{p-5f628e57.entry.js → p-bcbbe867.entry.js} +1 -1
  278. package/dist/zonos-elements/p-c2139758.entry.js +1 -0
  279. package/dist/zonos-elements/{p-3814aac3.system.entry.js → p-c23e2501.system.entry.js} +1 -1
  280. package/dist/zonos-elements/{p-2baa21b1.entry.js → p-c585d169.entry.js} +1 -1
  281. package/dist/zonos-elements/{p-ed61dedd.system.entry.js → p-c7ecef98.system.entry.js} +1 -1
  282. package/dist/zonos-elements/{p-ee217693.entry.js → p-c908a7a3.entry.js} +1 -1
  283. package/dist/zonos-elements/p-cd563d65.system.js +1 -0
  284. package/dist/zonos-elements/{p-ddcbea81.entry.js → p-cdbb50cf.entry.js} +1 -1
  285. package/dist/zonos-elements/{p-2affd4e6.entry.js → p-ce2fd652.entry.js} +1 -1
  286. package/dist/zonos-elements/{p-4e4fa1fb.system.entry.js → p-d004565d.system.entry.js} +1 -1
  287. package/dist/zonos-elements/{p-5e3e5e3e.system.js → p-d0690cdc.system.js} +1 -1
  288. package/dist/zonos-elements/{p-fe6cc354.entry.js → p-d30e8c3a.entry.js} +1 -1
  289. package/dist/zonos-elements/p-da7e1143.system.entry.js +1 -0
  290. package/dist/zonos-elements/p-ddb27b4a.entry.js +1 -0
  291. package/dist/zonos-elements/{p-234f0339.system.entry.js → p-dfb4360d.system.entry.js} +1 -1
  292. package/dist/zonos-elements/{p-66758e30.system.entry.js → p-e173fbd1.system.entry.js} +1 -1
  293. package/dist/zonos-elements/{p-3fbd9cc0.system.js → p-e25e0b4b.system.js} +1 -1
  294. package/dist/zonos-elements/{p-cc364b26.system.entry.js → p-e3f9779a.system.entry.js} +1 -1
  295. package/dist/zonos-elements/{p-0d18d94b.entry.js → p-e55bc187.entry.js} +1 -1
  296. package/dist/zonos-elements/{p-0aa1c8c2.system.js → p-e56f5954.system.js} +1 -1
  297. package/dist/zonos-elements/{p-06b4aa32.system.js → p-e5f5b086.system.js} +1 -1
  298. package/dist/zonos-elements/{p-dafafa07.js → p-e62342c3.js} +1 -1
  299. package/dist/zonos-elements/p-e6726a50.system.js +1 -0
  300. package/dist/zonos-elements/{p-274a5d11.system.entry.js → p-e6feafc1.system.entry.js} +1 -1
  301. package/dist/zonos-elements/{p-b004146f.entry.js → p-e749fb81.entry.js} +1 -1
  302. package/dist/zonos-elements/{p-27e41b44.system.entry.js → p-e80832cb.system.entry.js} +1 -1
  303. package/dist/zonos-elements/{p-12f480c9.system.entry.js → p-e9f36d6b.system.entry.js} +1 -1
  304. package/dist/zonos-elements/{p-058f6124.js → p-ed9385f4.js} +1 -1
  305. package/dist/zonos-elements/p-f68ce554.js +1 -0
  306. package/dist/zonos-elements/{p-67897a0d.js → p-f6922df5.js} +1 -1
  307. package/dist/zonos-elements/{p-f0938b51.system.entry.js → p-f7ddd288.system.entry.js} +1 -1
  308. package/dist/zonos-elements/{p-38881641.system.entry.js → p-fbc274a8.system.entry.js} +1 -1
  309. package/dist/zonos-elements/{p-d2bba4dc.entry.js → p-fed19033.entry.js} +1 -1
  310. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  311. package/package.json +1 -1
  312. package/dist/esm-es5/localization-026da80b.js +0 -1
  313. package/dist/zonos-elements/p-0d4af7e9.system.entry.js +0 -1
  314. package/dist/zonos-elements/p-1ed9ef0b.js +0 -1
  315. package/dist/zonos-elements/p-31d1b874.system.js +0 -1
  316. package/dist/zonos-elements/p-34d10122.js +0 -1
  317. package/dist/zonos-elements/p-3ac97c01.js +0 -1
  318. package/dist/zonos-elements/p-53db5f85.system.js +0 -1
  319. package/dist/zonos-elements/p-7501c637.system.js +0 -1
  320. package/dist/zonos-elements/p-768430fe.js +0 -1
  321. package/dist/zonos-elements/p-7d7ffb42.js +0 -1
  322. package/dist/zonos-elements/p-959918fe.system.js +0 -1
  323. package/dist/zonos-elements/p-9d44fef6.system.js +0 -1
  324. package/dist/zonos-elements/p-b20c7f8c.entry.js +0 -1
  325. package/dist/zonos-elements/p-b6c78f82.entry.js +0 -1
  326. package/dist/zonos-elements/p-b84be447.js +0 -1
  327. package/dist/zonos-elements/p-db993fdb.entry.js +0 -1
  328. package/dist/zonos-elements/p-def2d465.js +0 -1
  329. package/dist/zonos-elements/p-e219d011.js +0 -1
  330. package/dist/zonos-elements/p-f9705736.system.js +0 -1
@@ -3,24 +3,24 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const cart = require('./cart-4ef52500.js');
7
- const paypal = require('./paypal-cc3a730b.js');
8
- const localization = require('./localization-75f4ec05.js');
9
- const zonosStore = require('./zonosStore-f5a61112.js');
6
+ const cart = require('./cart-cd0a054b.js');
7
+ const paypal = require('./paypal-326d7bc5.js');
8
+ const localization = require('./localization-adaab93f.js');
9
+ const zonosStore = require('./zonosStore-1c517e55.js');
10
10
  const buildCartItemsByTempCart = require('./buildCartItemsByTempCart-edddbf4b.js');
11
11
  const handleFetch = require('./handleFetch-954f30e1.js');
12
- const updateCheckoutSessionAttributes = require('./updateCheckoutSessionAttributes-8be63b63.js');
13
- const CheckoutConfig = require('./CheckoutConfig-27c82f94.js');
12
+ const updateCheckoutSessionAttributes = require('./updateCheckoutSessionAttributes-a3776bb0.js');
14
13
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
14
+ const CheckoutConfig = require('./CheckoutConfig-27c82f94.js');
15
15
  const classes = require('./classes-b7918f56.js');
16
16
  const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
17
- const getBorderRadius = require('./getBorderRadius-27a74844.js');
18
- const isDarkColor = require('./isDarkColor-a68abf7a.js');
17
+ const getBorderRadius = require('./getBorderRadius-db55a464.js');
18
+ const isDarkColor = require('./isDarkColor-bfe6d1eb.js');
19
19
  const styles = require('./styles-d1e64fb9.js');
20
- const submitGtag = require('./submitGtag-cb4fb332.js');
20
+ const submitGtag = require('./submitGtag-9ac5a42e.js');
21
21
  const RemoveIcon = require('./RemoveIcon-081ac073.js');
22
- require('./isContrastColor-d1936a5c.js');
23
- require('./debounce-0c75ba33.js');
22
+ require('./isContrastColor-6a17f408.js');
23
+ require('./debounce-3e17b4e9.js');
24
24
 
25
25
  /**
26
26
  * Check if store discount is enabled
@@ -97,47 +97,28 @@ const buildCartUrl = ({ cartId, checkoutSessionId, customerAddress1, customerAdd
97
97
  return `${hostedCheckoutUrl}?${urlParams.toString()}`;
98
98
  };
99
99
 
100
- const isDisabledCountry = (showLog = true) => {
101
- if (!localization.localizationStore.localizationLoaded) {
102
- return true;
103
- }
104
- if (localization.localizationStore.isDisabledCountry) {
105
- if (showLog) {
106
- VarianceTest.log(`Checkout: disabled country`);
107
- }
108
- return true;
109
- }
110
- return false;
111
- };
112
-
113
- const isShippableCountry = (showLog = true,
114
100
  /**
115
- * If provided, will check if the country is shippable based on the provided country code instead of the Hello selected country code
101
+ * Build an absolute redirect URL used by the BigCommerce checkout flows to
102
+ * navigate between the BC native `/checkout` page and the Zonos international
103
+ * checkout at `/`.
104
+ *
105
+ * Carries over the `zonosQaUrl` query param from the current URL (when
106
+ * present) so the preview Zonos elements build keeps loading after the
107
+ * redirect, and sets `zonosTestMode=1` when test mode is active so the
108
+ * destination page continues to use the test credentials.
116
109
  */
117
- providedCountryCode) => {
118
- var _a;
119
- if (!localization.localizationStore.localizationLoaded) {
120
- return false;
121
- }
122
- if (providedCountryCode) {
123
- const isProvidedCountryCodeShippableCountry = !!((_a = localization.localizationStore.shippingZoneCountries) === null || _a === void 0 ? void 0 : _a[providedCountryCode]) &&
124
- !zonosStore.zonosStore.disabledCountries.includes(providedCountryCode);
125
- if (showLog && !isProvidedCountryCodeShippableCountry) {
126
- VarianceTest.log(`Checkout: ${providedCountryCode} is not a shippable country: ${isProvidedCountryCodeShippableCountry}`);
127
- }
128
- return isProvidedCountryCodeShippableCountry;
110
+ const buildBigcommerceRedirectUrl = (pathname) => {
111
+ const url = new URL(pathname, window.location.origin);
112
+ const zonosQaUrl = new URLSearchParams(window.location.search).get('zonosQaUrl');
113
+ if (zonosQaUrl) {
114
+ url.searchParams.set('zonosQaUrl', zonosQaUrl);
129
115
  }
130
- // if localization is loaded and the localization is not a shippable country, keep the original click event
131
- if (!localization.localizationStore.isShippableCountry) {
132
- if (showLog) {
133
- VarianceTest.log(`Checkout: not shippable country`);
134
- }
135
- return false;
116
+ if (handleFetch.getIsTestMode()) {
117
+ url.searchParams.set('zonosTestMode', '1');
136
118
  }
137
- return true;
119
+ return url.toString();
138
120
  };
139
121
 
140
- const FALLBACK_SHIP_TO_COUNTRY_SELECTOR = 'select[name="shippingAddress.countryCode"]';
141
122
  /**
142
123
  * Fetch the checkout/cart ID from the BigCommerce Storefront Cart API.
143
124
  * The `/checkout` page URL does not include the checkout ID, so we
@@ -170,7 +151,7 @@ const fetchCheckoutId = async () => {
170
151
  */
171
152
  const fetchBigCommerceCheckout = async (checkoutId) => {
172
153
  try {
173
- const response = await fetch(`/api/storefront/checkouts/${checkoutId}`, {
154
+ const response = await fetch(`/api/storefront/checkouts/${checkoutId}?include=customer.customerGroup`, {
174
155
  credentials: 'same-origin',
175
156
  headers: {
176
157
  Accept: 'application/json',
@@ -188,27 +169,211 @@ const fetchBigCommerceCheckout = async (checkoutId) => {
188
169
  return null;
189
170
  }
190
171
  };
172
+
173
+ const DEFAULT_RESULT = {
174
+ customerGroupId: null,
175
+ shouldBypass: false,
176
+ };
177
+ /**
178
+ * Performs the actual fetch logic to determine if the customer
179
+ * belongs to a bypass group.
180
+ */
181
+ const fetchBypassOutcome = async () => {
182
+ var _a, _b, _c, _d;
183
+ // Only relevant for BigCommerce stores — permanent no-op on other platforms
184
+ if (!window.Zonos.isBigCommerce) {
185
+ return { conclusive: true, result: DEFAULT_RESULT };
186
+ }
187
+ const bypassGroupIds = (_a = zonosStore.zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.bigcommerceBypassCustomerGroupIds;
188
+ if (!(bypassGroupIds === null || bypassGroupIds === void 0 ? void 0 : bypassGroupIds.length)) {
189
+ if (zonosStore.zonosStore.loadedConfig) {
190
+ // Settings have finished loading and there are no bypass groups
191
+ // configured — this is a permanent "bypass not configured" answer.
192
+ return { conclusive: true, result: DEFAULT_RESULT };
193
+ }
194
+ // Settings haven't loaded yet — the empty list may be transient.
195
+ // Mark as inconclusive so a later caller retries after config loads.
196
+ return { conclusive: false, result: DEFAULT_RESULT };
197
+ }
198
+ // Fetch customer group from BigCommerce Storefront API
199
+ const checkoutId = await fetchCheckoutId();
200
+ if (!checkoutId) {
201
+ // No active cart yet — inconclusive. Common on fresh sessions where
202
+ // `initBigCommerceBypassCheck` runs before the user has added anything
203
+ // to their cart; once the cart exists we need to re-fetch.
204
+ VarianceTest.log('BigCommerce bypass check: no active cart yet, will retry on next call', 'info');
205
+ return { conclusive: false, result: DEFAULT_RESULT };
206
+ }
207
+ const checkout = await fetchBigCommerceCheckout(checkoutId);
208
+ if (!checkout) {
209
+ // API call failed (network error, non-200, etc.) — inconclusive.
210
+ // Caching this would permanently disable bypass for the session if
211
+ // the logged-in user is actually a reseller.
212
+ VarianceTest.log('BigCommerce bypass check: failed to fetch checkout data, will retry', 'info');
213
+ return { conclusive: false, result: DEFAULT_RESULT };
214
+ }
215
+ const customerGroupId = (_d = (_c = (_b = checkout.customer) === null || _b === void 0 ? void 0 : _b.customerGroup) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : null;
216
+ if (customerGroupId === null) {
217
+ VarianceTest.log('BigCommerce bypass check: no customer group found (guest user)', 'info');
218
+ // Guest user with an active cart — a definitive "no bypass" answer.
219
+ return { conclusive: true, result: DEFAULT_RESULT };
220
+ }
221
+ const shouldBypass = bypassGroupIds.includes(customerGroupId);
222
+ const result = { customerGroupId, shouldBypass };
223
+ if (shouldBypass) {
224
+ VarianceTest.log(`BigCommerce bypass check: customer group ${String(customerGroupId)} is in bypass list; caller should keep the user on BC native checkout`, 'info');
225
+ }
226
+ else {
227
+ VarianceTest.log(`BigCommerce bypass check: customer group ${String(customerGroupId)} is not in bypass list`, 'info');
228
+ }
229
+ return { conclusive: true, result };
230
+ };
231
+ /**
232
+ * Module-level promise that holds the in-flight or resolved bypass check.
233
+ * Set by `initBigCommerceBypassCheck` on page load so the result is ready
234
+ * by the time checkout opens or the watcher fires.
235
+ *
236
+ * Automatically invalidated when a fetch resolves to an inconclusive outcome,
237
+ * so subsequent callers retry (e.g. after the user adds an item to their
238
+ * cart or after settings finish loading).
239
+ */
240
+ let bypassCheckPromise = null;
241
+ const startBypassCheck = () => {
242
+ const outcomePromise = fetchBypassOutcome();
243
+ const resultPromise = outcomePromise.then(({ conclusive, result }) => {
244
+ if (!conclusive && bypassCheckPromise === resultPromise) {
245
+ // Invalidate cache so the next caller performs a fresh fetch.
246
+ bypassCheckPromise = null;
247
+ }
248
+ return result;
249
+ });
250
+ bypassCheckPromise = resultPromise;
251
+ return resultPromise;
252
+ };
253
+ /**
254
+ * Start fetching the BigCommerce customer group on page load.
255
+ * Call this once during initialization (e.g. in `zonos-checkout.init()`).
256
+ * The fetch runs in the background; `checkBigCommerceBypassCustomerGroup`
257
+ * will await the result when needed.
258
+ */
259
+ const initBigCommerceBypassCheck = () => {
260
+ var _a;
261
+ if (!window.Zonos.isBigCommerce) {
262
+ return;
263
+ }
264
+ const bypassGroupIds = (_a = zonosStore.zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.bigcommerceBypassCustomerGroupIds;
265
+ if (!(bypassGroupIds === null || bypassGroupIds === void 0 ? void 0 : bypassGroupIds.length)) {
266
+ return;
267
+ }
268
+ // Fire the fetch immediately; consumers will await the same promise
269
+ void startBypassCheck();
270
+ };
271
+ /**
272
+ * Check if the current BigCommerce customer belongs to a customer group
273
+ * that should bypass Zonos Checkout.
274
+ *
275
+ * If `initBigCommerceBypassCheck` was called on page load and the resulting
276
+ * outcome was conclusive, this returns the already-resolved (or in-flight)
277
+ * result without making additional API calls. If the previous outcome was
278
+ * inconclusive (no cart, settings not loaded), the cache was invalidated
279
+ * automatically and this triggers a fresh fetch.
280
+ *
281
+ * @param options.forceRefresh - When true, bypasses any cached result and
282
+ * always fetches fresh BigCommerce checkout data. Use this on the
283
+ * BigCommerce domestic checkout page when the shipping country changes,
284
+ * to ensure the customer group reflects the current checkout state.
285
+ */
286
+ const checkBigCommerceBypassCustomerGroup = async (options = {}) => {
287
+ if (options.forceRefresh || !bypassCheckPromise) {
288
+ return startBypassCheck();
289
+ }
290
+ return bypassCheckPromise;
291
+ };
292
+
293
+ const isDisabledCountry = (showLog = true) => {
294
+ if (!localization.localizationStore.localizationLoaded) {
295
+ return true;
296
+ }
297
+ if (localization.localizationStore.isDisabledCountry) {
298
+ if (showLog) {
299
+ VarianceTest.log(`Checkout: disabled country`);
300
+ }
301
+ return true;
302
+ }
303
+ return false;
304
+ };
305
+
306
+ const isShippableCountry = (showLog = true,
307
+ /**
308
+ * If provided, will check if the country is shippable based on the provided country code instead of the Hello selected country code
309
+ */
310
+ providedCountryCode) => {
311
+ var _a;
312
+ if (!localization.localizationStore.localizationLoaded) {
313
+ return false;
314
+ }
315
+ if (providedCountryCode) {
316
+ const isProvidedCountryCodeShippableCountry = !!((_a = localization.localizationStore.shippingZoneCountries) === null || _a === void 0 ? void 0 : _a[providedCountryCode]) &&
317
+ !zonosStore.zonosStore.disabledCountries.includes(providedCountryCode);
318
+ if (showLog && !isProvidedCountryCodeShippableCountry) {
319
+ VarianceTest.log(`Checkout: ${providedCountryCode} is not a shippable country: ${isProvidedCountryCodeShippableCountry}`);
320
+ }
321
+ return isProvidedCountryCodeShippableCountry;
322
+ }
323
+ // if localization is loaded and the localization is not a shippable country, keep the original click event
324
+ if (!localization.localizationStore.isShippableCountry) {
325
+ if (showLog) {
326
+ VarianceTest.log(`Checkout: not shippable country`);
327
+ }
328
+ return false;
329
+ }
330
+ return true;
331
+ };
332
+
333
+ const FALLBACK_SHIP_TO_COUNTRY_SELECTOR = 'select[name="shippingAddress.countryCode"]';
191
334
  /**
192
335
  * Check if the logged-in user already has a shipping address on the checkout
193
- * that is internationally shippable. If so, save the address to session
194
- * and redirect to the home page to open the international checkout.
336
+ * that is internationally shippable. If so, optionally prompt the user to
337
+ * confirm before saving the address to session and redirecting to the home
338
+ * page to open the international checkout.
195
339
  */
196
- const checkLoggedInUserShippingAddress = async ({ onInternationalCheckoutSelected, }) => {
340
+ const checkLoggedInUserShippingAddress = async ({ onInternationalCheckoutSelected, onLoggedInInternationalAddressDetected, }) => {
197
341
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
342
+ // Check if the customer belongs to a bypass group (e.g. resellers) before
343
+ // redirecting them away from BigCommerce native checkout. This delegates to
344
+ // the shared helper so the bypass decision has a single source of truth and
345
+ // reuses the cached promise warmed by `initBigCommerceBypassCheck`.
346
+ const { shouldBypass } = await checkBigCommerceBypassCustomerGroup();
347
+ if (shouldBypass) {
348
+ return 'noAction';
349
+ }
198
350
  const checkoutId = await fetchCheckoutId();
199
351
  if (!checkoutId) {
200
- return false;
352
+ return 'noAction';
201
353
  }
202
354
  const checkout = await fetchBigCommerceCheckout(checkoutId);
203
355
  const shippingAddress = (_b = (_a = checkout === null || checkout === void 0 ? void 0 : checkout.consignments) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.shippingAddress;
204
356
  if (!(shippingAddress === null || shippingAddress === void 0 ? void 0 : shippingAddress.countryCode)) {
205
- return false;
357
+ return 'noAction';
206
358
  }
207
359
  const countryCode = shippingAddress.countryCode;
208
360
  if (!isShippableCountry(false, countryCode)) {
209
- return false;
361
+ return 'noAction';
362
+ }
363
+ VarianceTest.log(onLoggedInInternationalAddressDetected
364
+ ? `Logged-in user has international shipping address: ${countryCode}, prompting user to choose checkout`
365
+ : `Logged-in user has international shipping address: ${countryCode}, redirecting automatically (legacy behavior)`, 'info');
366
+ // Ask the consumer (zonos-checkout) whether to redirect or stay on BC.
367
+ // Without this prompt the user can get stuck in a redirect loop when their
368
+ // saved default address is international but they want to use a different
369
+ // (domestic) saved address in BigCommerce native checkout.
370
+ if (onLoggedInInternationalAddressDetected) {
371
+ const action = await onLoggedInInternationalAddressDetected();
372
+ if (action === 'stay') {
373
+ VarianceTest.log('User opted to stay on BigCommerce native checkout despite international default address', 'info');
374
+ return 'optedOut';
375
+ }
210
376
  }
211
- VarianceTest.log(`Logged-in user has international shipping address: ${countryCode}, redirecting`, 'info');
212
377
  if (onInternationalCheckoutSelected) {
213
378
  await onInternationalCheckoutSelected();
214
379
  }
@@ -230,20 +395,24 @@ const checkLoggedInUserShippingAddress = async ({ onInternationalCheckoutSelecte
230
395
  state: (_k = shippingAddress.stateOrProvince) !== null && _k !== void 0 ? _k : '',
231
396
  });
232
397
  // Redirect to home page — the home page will open the international checkout
233
- // when it detects the domestic shipping session
234
- window.location.href = '/';
235
- return true;
398
+ // when it detects the domestic shipping session. Carry over zonosQaUrl /
399
+ // zonosTestMode so the destination page keeps using the same build/env.
400
+ window.location.href = buildBigcommerceRedirectUrl('/');
401
+ return 'redirected';
236
402
  };
237
403
  /**
238
404
  * Watch for changes in domestic checkout step. Redirects user to home page to open international checkout when user selects a country in the international shipping zone.
239
405
  * @note Only works on default bigcommerce checkout page
240
406
  */
241
- const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedBtnSelector, onInternationalCheckoutSelected, onShippingAddressSessionFound, }) => {
407
+ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedBtnSelector, onInternationalCheckoutSelected, onLoggedInInternationalAddressDetected, onShippingAddressSessionFound, }) => {
242
408
  if (!window.Zonos.isBigCommerce) {
243
409
  return;
244
410
  }
245
411
  /**
246
- * Keep checking
412
+ * Keep checking.
413
+ * @returns `true` if the caller should stop polling — either because the user
414
+ * is being redirected to Zonos international checkout, or because the
415
+ * logged-in customer is in a bypass group and should stay on BC checkout.
247
416
  */
248
417
  const handleInternationalCheckoutSelected = async (overrideShippingCountry) => {
249
418
  var _a;
@@ -259,6 +428,19 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
259
428
  // do nothing if shipping country is not shippable
260
429
  return false;
261
430
  }
431
+ // Only check bypass after confirming the country is shippable (i.e. user is
432
+ // about to be redirected to Zonos international checkout). Force-refresh so
433
+ // we re-fetch BigCommerce checkout data every time the ship-to country
434
+ // changes — prevents stale customer-group data from a cached fetch.
435
+ const { shouldBypass } = await checkBigCommerceBypassCustomerGroup({
436
+ forceRefresh: true,
437
+ });
438
+ if (shouldBypass) {
439
+ // Logged-in customer is in a bypass group — keep them on BC native
440
+ // checkout and stop polling / fetching further.
441
+ VarianceTest.log('Bypass customer group detected on BC checkout, stopping interval', 'info');
442
+ return true;
443
+ }
262
444
  if (onInternationalCheckoutSelected) {
263
445
  await onInternationalCheckoutSelected();
264
446
  }
@@ -290,13 +472,40 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
290
472
  postalCode: shippingAddress.postalCode,
291
473
  state: shippingAddress.stateOrProvince,
292
474
  });
293
- // redirect to home page, home page then will open the checkout dialog if having domestic shipping session
294
- window.location.href = '/';
475
+ // redirect to home page, home page then will open the checkout dialog if
476
+ // having domestic shipping session. Carry over zonosQaUrl / zonosTestMode
477
+ // so the destination page keeps using the same build/env.
478
+ window.location.href = buildBigcommerceRedirectUrl('/');
295
479
  return true;
296
480
  };
297
481
  let isProcessing = false;
298
482
  let intervalCreated = false;
299
483
  let isCheckingLoggedInUserShippingAddress = false;
484
+ /**
485
+ * Set to `true` once the logged-in user has been prompted about a detected
486
+ * international default address and chose to stay on the BigCommerce native
487
+ * checkout. Prevents the observer from re-prompting on subsequent DOM
488
+ * mutations.
489
+ */
490
+ let loggedInAddressCheckSkipped = false;
491
+ /**
492
+ * Set to `true` while the logged-in international-address confirmation
493
+ * dialog is open and we are awaiting the user's response. While this
494
+ * flag is set the polling interval must not call
495
+ * `handleInternationalCheckoutSelected` — otherwise the interval would
496
+ * detect the pre-filled international country, show the loading dialog,
497
+ * and redirect before the user has responded to the confirm prompt.
498
+ */
499
+ let isAwaitingLoggedInConfirmation = false;
500
+ // NOTE: We intentionally do NOT await `checkBigCommerceBypassCustomerGroup()`
501
+ // here before attaching the MutationObserver. The bypass check involves two
502
+ // Storefront API round-trips, and awaiting it synchronously would delay
503
+ // observer registration — on fast-rendering BC pages that window can cause
504
+ // us to miss the initial DOM mutations and never trigger the redirect.
505
+ // Bypass is already enforced inside `checkLoggedInUserShippingAddress` and
506
+ // `handleInternationalCheckoutSelected` (both consult the helper), so the
507
+ // top-level gate is redundant. `initBigCommerceBypassCheck()` is called on
508
+ // page load so those inner calls typically resolve against a warm cache.
300
509
  const observer = new MutationObserver(async () => {
301
510
  var _a;
302
511
  const domesticRedirectedButton = document.querySelector(domesticRedirectedBtnSelector);
@@ -323,24 +532,35 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
323
532
  // For logged-in users, check if their saved address on the checkout is international
324
533
  // before the shipping form is even rendered.
325
534
  // Guard against repeated calls — the observer fires on every DOM mutation.
326
- if (isCheckingLoggedInUserShippingAddress) {
327
- return;
328
- }
329
- isCheckingLoggedInUserShippingAddress = true;
330
- try {
331
- const redirected = await checkLoggedInUserShippingAddress({
332
- onInternationalCheckoutSelected,
333
- });
334
- if (redirected) {
335
- observer.disconnect();
336
- return;
535
+ // Also skip if the user already chose to stay on BC native checkout.
536
+ if (!loggedInAddressCheckSkipped &&
537
+ !isCheckingLoggedInUserShippingAddress) {
538
+ isCheckingLoggedInUserShippingAddress = true;
539
+ isAwaitingLoggedInConfirmation = true;
540
+ try {
541
+ const result = await checkLoggedInUserShippingAddress({
542
+ onInternationalCheckoutSelected,
543
+ onLoggedInInternationalAddressDetected,
544
+ });
545
+ if (result === 'redirected') {
546
+ observer.disconnect();
547
+ return;
548
+ }
549
+ if (result === 'optedOut') {
550
+ // User elected to stay on BC native checkout — don't prompt again
551
+ // for the rest of this session. Continue with the rest of the
552
+ // observer logic so the country-change watcher still fires when
553
+ // the user manually picks an international country in BC's UI.
554
+ loggedInAddressCheckSkipped = true;
555
+ }
556
+ }
557
+ catch (error) {
558
+ handleFetch.logError('Error checking logged-in user shipping address', error);
559
+ }
560
+ finally {
561
+ isCheckingLoggedInUserShippingAddress = false;
562
+ isAwaitingLoggedInConfirmation = false;
337
563
  }
338
- }
339
- catch (error) {
340
- handleFetch.logError('Error checking logged-in user shipping address', error);
341
- }
342
- finally {
343
- isCheckingLoggedInUserShippingAddress = false;
344
564
  }
345
565
  const shipToCountryElement = document.querySelector(((_a = zonosStore.zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.bigcommerceDomesticCheckoutCountrySelector) ||
346
566
  FALLBACK_SHIP_TO_COUNTRY_SELECTOR);
@@ -360,14 +580,18 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
360
580
  // disconnect the observer after we know that's bigcommerce domestic checkout page
361
581
  observer.disconnect();
362
582
  const interval = setInterval(async () => {
363
- if (isProcessing) {
583
+ // Don't redirect while the logged-in international-address confirm
584
+ // dialog is open — the user hasn't made their choice yet.
585
+ if (isProcessing || isAwaitingLoggedInConfirmation) {
364
586
  return;
365
587
  }
366
588
  isProcessing = true;
367
589
  try {
368
- const isInternationalCountrySelected = await handleInternationalCheckoutSelected();
369
- // When isInternationalCountrySelected is true, user will be redirected shortly, so we can stop the checking interval here
370
- if (isInternationalCountrySelected) {
590
+ const shouldStopPolling = await handleInternationalCheckoutSelected();
591
+ // Stop the interval once either:
592
+ // - the user is being redirected to Zonos international checkout
593
+ // - the logged-in customer is in a bypass group (stay on BC checkout)
594
+ if (shouldStopPolling) {
371
595
  clearInterval(interval);
372
596
  return;
373
597
  }
@@ -391,7 +615,7 @@ const watchImmediateBigcommerceDomesticCheckoutRedirect = ({ domesticRedirectedB
391
615
  clearInterval(stripeBcListenerInterval);
392
616
  addressElement.on('change', event => {
393
617
  const shippingCountry = event.value.address.country;
394
- if (shippingCountry) {
618
+ if (shippingCountry && !isAwaitingLoggedInConfirmation) {
395
619
  void handleInternationalCheckoutSelected(shippingCountry);
396
620
  }
397
621
  });
@@ -699,6 +923,19 @@ const ZonosCheckout = class {
699
923
  * This is for BigCommerce stores when the user selects a domestic country in the international checkout.
700
924
  */
701
925
  this.redirectToDomesticCheckoutDialogOpen = false;
926
+ /**
927
+ * Whether or not the confirm dialog for a logged-in BigCommerce user with a
928
+ * detected international default shipping address is shown. The user must
929
+ * choose to either continue to the international checkout or stay on the
930
+ * BigCommerce native checkout (and select a domestic address there).
931
+ */
932
+ this.loggedInIntlAddressConfirmDialogOpen = false;
933
+ /**
934
+ * Resolver for the promise returned to
935
+ * `watchImmediateBigcommerceDomesticCheckoutRedirect` while we wait for
936
+ * the user's choice in `loggedInIntlAddressConfirmDialogOpen`.
937
+ */
938
+ this.loggedInIntlAddressResolver = null;
702
939
  /**
703
940
  * Client secret value
704
941
  */
@@ -1311,6 +1548,23 @@ const ZonosCheckout = class {
1311
1548
  return;
1312
1549
  }
1313
1550
  }
1551
+ // For BigCommerce stores: check if the customer belongs to a bypass
1552
+ // group (e.g. resellers) and redirect them to BigCommerce native
1553
+ // checkout instead. This must happen *before* we flip any UI state
1554
+ // (opening the dialog, setting the fetching-session flag) so bypass
1555
+ // users never see the Zonos checkout dialog flash.
1556
+ // `initBigCommerceBypassCheck` was called on page load so this
1557
+ // typically resolves against the cached promise.
1558
+ if (window.Zonos.isBigCommerce) {
1559
+ const { shouldBypass } = await checkBigCommerceBypassCustomerGroup();
1560
+ if (shouldBypass) {
1561
+ VarianceTest.log('Bypass customer group detected, redirecting to BigCommerce native checkout', 'info');
1562
+ // Carry over zonosQaUrl / zonosTestMode so the BC native
1563
+ // checkout keeps loading the same Zonos elements build/env.
1564
+ window.location.href = buildBigcommerceRedirectUrl('/checkout');
1565
+ return;
1566
+ }
1567
+ }
1314
1568
  // start loading
1315
1569
  cart.stripeStore.isFetchingSession = true;
1316
1570
  this.open = true;
@@ -1559,6 +1813,9 @@ const ZonosCheckout = class {
1559
1813
  if (typeof this.overrideStagingMode !== 'undefined') {
1560
1814
  cart.cartStore.isStagingMode = this.overrideStagingMode;
1561
1815
  }
1816
+ // Start fetching BigCommerce customer group on page load so the bypass
1817
+ // result is ready by the time checkout opens or the BC watcher fires
1818
+ initBigCommerceBypassCheck();
1562
1819
  // check if bigcommerce, if user enters the shipping address that's in the shipping zone at bigcommerce checkout
1563
1820
  watchImmediateBigcommerceDomesticCheckoutRedirect({
1564
1821
  domesticRedirectedBtnSelector: CheckoutConfig.domesticRedirectedBtnSelector,
@@ -1567,6 +1824,16 @@ const ZonosCheckout = class {
1567
1824
  // wait for 2 secs
1568
1825
  await new Promise(resolve => setTimeout(resolve, 2000));
1569
1826
  },
1827
+ // Logged-in user is on the BC native /checkout page with a saved
1828
+ // international default address. Ask the user whether to continue to
1829
+ // the Zonos international checkout or stay on BC and pick a different
1830
+ // (domestic) saved address. This avoids the redirect loop where a user
1831
+ // who wants to checkout domestically gets bounced back to international
1832
+ // every time they land on /checkout.
1833
+ onLoggedInInternationalAddressDetected: () => new Promise(resolve => {
1834
+ this.loggedInIntlAddressResolver = resolve;
1835
+ this.loggedInIntlAddressConfirmDialogOpen = true;
1836
+ }),
1570
1837
  onShippingAddressSessionFound: shippingAddressSession => {
1571
1838
  // prefilled the default address if shipping address session is found for checkout on open
1572
1839
  this.defaultAddress = [
@@ -2056,7 +2323,9 @@ const ZonosCheckout = class {
2056
2323
  this.redirectToDomesticCheckoutDialogOpen = true;
2057
2324
  VarianceTest.log(`Domestic country ${shippingCountry} selected in international checkout, redirecting to BigCommerce domestic checkout`, 'info');
2058
2325
  setTimeout(() => {
2059
- window.location.href = '/checkout';
2326
+ // Carry over zonosQaUrl / zonosTestMode so the BC native checkout
2327
+ // keeps loading the same Zonos elements build/env.
2328
+ window.location.href = buildBigcommerceRedirectUrl('/checkout');
2060
2329
  }, 2000);
2061
2330
  }
2062
2331
  }),
@@ -2167,7 +2436,17 @@ const ZonosCheckout = class {
2167
2436
  this.isMobile && 'mobile',
2168
2437
  this.isIframed && 'iframed',
2169
2438
  this.hiddenMode && 'hidden-mode',
2170
- ]) }, this.preview ? (renderContent()) : (index.h("zonos-dialog", { borderStyle: style, class: "zonos--checkout-dialog", "data-theme": rightSideTheme, height: "980px", isLoading: dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeDialogHandler(), open: this.open, width: "1200px" }, renderContent())), index.h("zonos-dialog", { isLoading: true, loadingText: localization.translate('You will be redirected to international checkout shortly.'), loadingTitle: localization.translate('We detected that you are shipping to an international address.'), noClickOutside: true, noCloseButton: true, open: this.detectedDomesticCheckoutDialogOpen, width: "450px" }), index.h("zonos-dialog", { isLoading: true, loadingText: localization.translate('You will be redirected to domestic checkout shortly.'), loadingTitle: localization.translate('We detected that you are shipping to a domestic address.'), noClickOutside: true, noCloseButton: true, open: this.redirectToDomesticCheckoutDialogOpen, width: "450px" }), index.h("zonos-confirm-dialog", { class: "zonos--close-confirm-dialog", dialogCancelBtnText: localization.translate("Don't close"), dialogConfirmBtnText: localization.translate('Close'), dialogIntent: "warn", dialogOpen: this.confirmDialogOpen, dialogSubtitle: localization.translate('Would you like to close checkout and return to the site?'), dialogTitle: localization.translate('Are you sure?'), onCancelClicked: () => {
2439
+ ]) }, this.preview ? (renderContent()) : (index.h("zonos-dialog", { borderStyle: style, class: "zonos--checkout-dialog", "data-theme": rightSideTheme, height: "980px", isLoading: dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeDialogHandler(), open: this.open, width: "1200px" }, renderContent())), index.h("zonos-dialog", { isLoading: true, loadingText: localization.translate('You will be redirected to international checkout shortly.'), loadingTitle: localization.translate('We detected that you are shipping to an international address.'), noClickOutside: true, noCloseButton: true, open: this.detectedDomesticCheckoutDialogOpen, width: "450px" }), index.h("zonos-dialog", { isLoading: true, loadingText: localization.translate('You will be redirected to domestic checkout shortly.'), loadingTitle: localization.translate('We detected that you are shipping to a domestic address.'), noClickOutside: true, noCloseButton: true, open: this.redirectToDomesticCheckoutDialogOpen, width: "450px" }), index.h("zonos-confirm-dialog", { class: "zonos--logged-in-intl-address-dialog", dialogCancelBtnText: localization.translate('Stay on this page'), dialogConfirmBtnText: localization.translate('Continue to international checkout'), dialogIntent: "info", dialogOpen: this.loggedInIntlAddressConfirmDialogOpen, dialogSubtitle: localization.translate('Your saved default address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?'), dialogTitle: localization.translate('International shipping address detected'), dialogWidth: 480, onCancelClicked: () => {
2440
+ var _a;
2441
+ this.loggedInIntlAddressConfirmDialogOpen = false;
2442
+ (_a = this.loggedInIntlAddressResolver) === null || _a === void 0 ? void 0 : _a.call(this, 'stay');
2443
+ this.loggedInIntlAddressResolver = null;
2444
+ }, onConfirmClicked: () => {
2445
+ var _a;
2446
+ this.loggedInIntlAddressConfirmDialogOpen = false;
2447
+ (_a = this.loggedInIntlAddressResolver) === null || _a === void 0 ? void 0 : _a.call(this, 'redirect');
2448
+ this.loggedInIntlAddressResolver = null;
2449
+ } }), index.h("zonos-confirm-dialog", { class: "zonos--close-confirm-dialog", dialogCancelBtnText: localization.translate("Don't close"), dialogConfirmBtnText: localization.translate('Close'), dialogIntent: "warn", dialogOpen: this.confirmDialogOpen, dialogSubtitle: localization.translate('Would you like to close checkout and return to the site?'), dialogTitle: localization.translate('Are you sure?'), onCancelClicked: () => {
2171
2450
  this.confirmDialogOpen = false;
2172
2451
  },
2173
2452
  // Mark user selected confirm to close the dialog
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const zonosStore = require('./zonosStore-f5a61112.js');
6
+ const zonosStore = require('./zonosStore-1c517e55.js');
7
7
  require('./VarianceTest-bec00ea8.js');
8
8
 
9
9
  const zonosCollapseCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";
@@ -3,16 +3,16 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const cart = require('./cart-4ef52500.js');
6
+ const cart = require('./cart-cd0a054b.js');
7
7
  const cleanHtmlMarkdown = require('./cleanHtmlMarkdown-31da84b7.js');
8
- const zonosStore = require('./zonosStore-f5a61112.js');
8
+ const zonosStore = require('./zonosStore-1c517e55.js');
9
9
  const classes = require('./classes-b7918f56.js');
10
10
  const styles = require('./styles-d1e64fb9.js');
11
- require('./localization-75f4ec05.js');
11
+ require('./localization-adaab93f.js');
12
12
  require('./handleFetch-954f30e1.js');
13
13
  require('./VarianceTest-bec00ea8.js');
14
- require('./isDarkColor-a68abf7a.js');
15
- require('./getBorderRadius-27a74844.js');
14
+ require('./isDarkColor-bfe6d1eb.js');
15
+ require('./getBorderRadius-db55a464.js');
16
16
 
17
17
  const zonosCollectCartItemsCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column{padding:8px;padding-left:0;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column:first-child{width:48px}:host .zonos--cart-table td{vertical-align:middle}:host .zonos--cart-item-price zonos-text{white-space:nowrap}:host img{min-width:40px;margin-top:6px;-webkit-box-shadow:0 0 0 1px rgba(110, 110, 120, 0.1), 0 1px 2px 0 rgba(10, 10, 11, 0.06), 0 1px 3px 0 rgba(10, 10, 11, 0.1);box-shadow:0 0 0 1px rgba(110, 110, 120, 0.1), 0 1px 2px 0 rgba(10, 10, 11, 0.06), 0 1px 3px 0 rgba(10, 10, 11, 0.1);border-radius:10px}";
18
18
  const ZonosCollectCartItemsStyle0 = zonosCollectCartItemsCss;