@zonos/elements 1.3.200 → 1.3.202

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 (308) hide show
  1. package/dist/cjs/VarianceTest-0cb1e118.js +12 -0
  2. package/dist/cjs/cart-637ba3d0.js +1943 -0
  3. package/dist/cjs/{debounce-d393fafe.js → debounce-94e1b7ff.js} +1 -1
  4. package/dist/cjs/{getBorderRadius-3d0a563e.js → getBorderRadius-8d3b1049.js} +1 -1
  5. package/dist/cjs/index.cjs.js +10 -8
  6. package/dist/cjs/{isDarkColor-92a10a85.js → isDarkColor-bcf49625.js} +1 -1
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{cart-add8fe50.js → localization-2f17c95f.js} +74 -1926
  9. package/dist/cjs/{paypal-afc19dec.js → paypal-0eceff03.js} +10 -9
  10. package/dist/cjs/zonos-address_11.cjs.entry.js +98 -72
  11. package/dist/cjs/zonos-badge.cjs.entry.js +2 -1
  12. package/dist/cjs/zonos-banner.cjs.entry.js +2 -1
  13. package/dist/cjs/zonos-button_3.cjs.entry.js +4 -3
  14. package/dist/cjs/zonos-card.cjs.entry.js +3 -2
  15. package/dist/cjs/{zonos-cart-items_13.cjs.entry.js → zonos-cart-items_14.cjs.entry.js} +99 -80
  16. package/dist/cjs/zonos-checkout.cjs.entry.js +395 -50
  17. package/dist/cjs/zonos-collapse.cjs.entry.js +2 -1
  18. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  19. package/dist/cjs/zonos-controller.cjs.entry.js +13 -11
  20. package/dist/cjs/zonos-country-flag.cjs.entry.js +4 -5
  21. package/dist/cjs/zonos-country-select_4.cjs.entry.js +13 -13
  22. package/dist/cjs/zonos-elements.cjs.js +1 -1
  23. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +10 -8
  24. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +41 -42
  25. package/dist/cjs/zonos-hello.cjs.entry.js +30 -31
  26. package/dist/cjs/zonos-input.cjs.entry.js +3 -2
  27. package/dist/cjs/zonos-language-select_2.cjs.entry.js +8 -9
  28. package/dist/cjs/zonos-logo.cjs.entry.js +4 -3
  29. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -2
  30. package/dist/cjs/zonos-stripe-input.cjs.entry.js +8 -7
  31. package/dist/cjs/zonos-text.cjs.entry.js +2 -1
  32. package/dist/cjs/zonos-toggle.cjs.entry.js +4 -3
  33. package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
  34. package/dist/cjs/zonos-v-stack.cjs.entry.js +4 -3
  35. package/dist/cjs/{zonosStore-c466b127.js → zonosStore-9264749e.js} +15 -5
  36. package/dist/collection/collection-manifest.json +1 -0
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +18 -17
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +235 -15
  39. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +3 -3
  40. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +2 -1
  41. package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.css +62 -0
  42. package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +90 -0
  43. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  44. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
  45. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  46. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +4 -4
  47. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +5 -5
  48. package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +5 -5
  49. package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
  50. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  51. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  52. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
  53. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  54. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  55. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
  56. package/dist/collection/components/main/zonos-controller.js +3 -3
  57. package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
  58. package/dist/collection/components/store/checkout/cart.js +15 -16
  59. package/dist/collection/components/store/checkout/paypal.js +2 -1
  60. package/dist/collection/components/store/checkout/stripe.js +33 -13
  61. package/dist/collection/components/store/hello/localization.js +5 -5
  62. package/dist/collection/components/store/storageStore.js +32 -0
  63. package/dist/collection/components/store/zonosStore.js +12 -6
  64. package/dist/collection/components/stripe/zonos-address/zonos-address.js +18 -6
  65. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -2
  66. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +19 -7
  67. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +3 -3
  68. package/dist/collection/components/utils/api/getCheckoutSession.js +3 -3
  69. package/dist/collection/components/utils/api/placeTestOrder.js +2 -1
  70. package/dist/collection/components/utils/api/prepCalculateLandedCost.js +3 -2
  71. package/dist/collection/components/utils/api/selectVarianceTest.js +20 -0
  72. package/dist/collection/components/utils/buildCartUrl.js +44 -0
  73. package/dist/collection/components/utils/getLegacyQueryParams.js +42 -0
  74. package/dist/collection/components/utils/varianceTest/filterExpiredTests.js +6 -0
  75. package/dist/collection/components/utils/varianceTest/filterValidTests.js +23 -0
  76. package/dist/collection/components/utils/varianceTest/getSelectedTestVariant.js +6 -0
  77. package/dist/collection/components/utils/varianceTest/hasAtLeastOneAvailableTestKey.js +14 -0
  78. package/dist/collection/components/utils/varianceTest/isInAvailableTestKey.js +4 -0
  79. package/dist/collection/components/utils/varianceTest/isTestEnabled.js +4 -0
  80. package/dist/collection/components/utils/varianceTest/isTestKeysAllVariantSelected.js +6 -0
  81. package/dist/collection/components/utils/varianceTest/mergeTest.js +13 -0
  82. package/dist/collection/scripts/_getZonosQaUrl.js +2 -2
  83. package/dist/collection/types/checkout/api/VarianceTest.js +8 -0
  84. package/dist/collection/types/generated/graphql.internal.types.js +12 -0
  85. package/dist/collection/types/index.js +1 -0
  86. package/dist/esm/VarianceTest-fef2d958.js +10 -0
  87. package/dist/esm/cart-b7c15b61.js +1907 -0
  88. package/dist/esm/{debounce-a2121722.js → debounce-3a9f27a0.js} +1 -1
  89. package/dist/esm/{getBorderRadius-413e97eb.js → getBorderRadius-78b28b4d.js} +1 -1
  90. package/dist/esm/index.js +9 -8
  91. package/dist/esm/{isDarkColor-4c7b2ffc.js → isDarkColor-31dd7dff.js} +1 -1
  92. package/dist/esm/loader.js +1 -1
  93. package/dist/esm/{cart-e03d615e.js → localization-bf7224aa.js} +70 -1892
  94. package/dist/esm/{paypal-23dd5023.js → paypal-932fd3dd.js} +5 -4
  95. package/dist/esm/zonos-address_11.entry.js +54 -28
  96. package/dist/esm/zonos-badge.entry.js +2 -1
  97. package/dist/esm/zonos-banner.entry.js +2 -1
  98. package/dist/esm/zonos-button_3.entry.js +4 -3
  99. package/dist/esm/zonos-card.entry.js +3 -2
  100. package/dist/esm/{zonos-cart-items_13.entry.js → zonos-cart-items_14.entry.js} +48 -30
  101. package/dist/esm/zonos-checkout.entry.js +363 -18
  102. package/dist/esm/zonos-collapse.entry.js +2 -1
  103. package/dist/esm/zonos-component.entry.js +1 -1
  104. package/dist/esm/zonos-controller.entry.js +8 -6
  105. package/dist/esm/zonos-country-flag.entry.js +3 -4
  106. package/dist/esm/zonos-country-select_4.entry.js +8 -8
  107. package/dist/esm/zonos-elements.js +1 -1
  108. package/dist/esm/zonos-empty-state-payment_4.entry.js +10 -8
  109. package/dist/esm/zonos-hello-dialog.entry.js +7 -8
  110. package/dist/esm/zonos-hello.entry.js +4 -5
  111. package/dist/esm/zonos-input.entry.js +3 -2
  112. package/dist/esm/zonos-language-select_2.entry.js +5 -6
  113. package/dist/esm/zonos-logo.entry.js +4 -3
  114. package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -2
  115. package/dist/esm/zonos-stripe-input.entry.js +8 -7
  116. package/dist/esm/zonos-text.entry.js +2 -1
  117. package/dist/esm/zonos-toggle.entry.js +4 -3
  118. package/dist/esm/zonos-tooltip.entry.js +2 -2
  119. package/dist/esm/zonos-v-stack.entry.js +4 -3
  120. package/dist/esm/{zonosStore-cdabc848.js → zonosStore-d10a829f.js} +15 -5
  121. package/dist/esm-es5/VarianceTest-fef2d958.js +1 -0
  122. package/dist/esm-es5/cart-b7c15b61.js +1 -0
  123. package/dist/esm-es5/{debounce-a2121722.js → debounce-3a9f27a0.js} +1 -1
  124. package/dist/esm-es5/{getBorderRadius-413e97eb.js → getBorderRadius-78b28b4d.js} +1 -1
  125. package/dist/esm-es5/index.js +1 -1
  126. package/dist/esm-es5/{isDarkColor-4c7b2ffc.js → isDarkColor-31dd7dff.js} +1 -1
  127. package/dist/esm-es5/loader.js +1 -1
  128. package/dist/esm-es5/localization-bf7224aa.js +1 -0
  129. package/dist/esm-es5/{paypal-23dd5023.js → paypal-932fd3dd.js} +2 -2
  130. package/dist/esm-es5/zonos-address_11.entry.js +1 -1
  131. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  132. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  133. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  134. package/dist/esm-es5/zonos-card.entry.js +1 -1
  135. package/dist/esm-es5/zonos-cart-items_14.entry.js +1 -0
  136. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  137. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  138. package/dist/esm-es5/zonos-component.entry.js +1 -1
  139. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  140. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  141. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  142. package/dist/esm-es5/zonos-elements.js +1 -1
  143. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  144. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  145. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  146. package/dist/esm-es5/zonos-input.entry.js +1 -1
  147. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  148. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  149. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  150. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  151. package/dist/esm-es5/zonos-text.entry.js +1 -1
  152. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  153. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  154. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  155. package/dist/esm-es5/zonosStore-d10a829f.js +1 -0
  156. package/dist/scripts/index.d.ts +839 -765
  157. package/dist/scripts/index.js +1 -1
  158. package/dist/scripts/loadZonos.js +1 -1
  159. package/dist/scripts/zonos.js +1 -1
  160. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +16 -0
  161. package/dist/types/components/common/zonos-loading-overlay/zonos-loading-overlay.d.ts +16 -0
  162. package/dist/types/components/store/checkout/cart.d.ts +0 -1
  163. package/dist/types/components/store/checkout/stripe.d.ts +2 -2
  164. package/dist/types/components/store/hello/localization.d.ts +2 -2
  165. package/dist/types/components/store/storageStore.d.ts +13 -0
  166. package/dist/types/components/store/zonosStore.d.ts +7 -2
  167. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +2 -0
  168. package/dist/types/components/stripe/zonos-custom-address/zonos-custom-address.d.ts +2 -0
  169. package/dist/types/components/utils/api/selectVarianceTest.d.ts +6 -0
  170. package/dist/types/components/utils/buildCartUrl.d.ts +10 -0
  171. package/dist/types/components/utils/getLegacyQueryParams.d.ts +2 -0
  172. package/dist/types/components/utils/varianceTest/filterExpiredTests.d.ts +2 -0
  173. package/dist/types/components/utils/varianceTest/filterValidTests.d.ts +9 -0
  174. package/dist/types/components/utils/varianceTest/getSelectedTestVariant.d.ts +2 -0
  175. package/dist/types/components/utils/varianceTest/hasAtLeastOneAvailableTestKey.d.ts +8 -0
  176. package/dist/types/components/utils/varianceTest/isInAvailableTestKey.d.ts +2 -0
  177. package/dist/types/components/utils/varianceTest/isTestEnabled.d.ts +2 -0
  178. package/dist/types/components/utils/varianceTest/isTestKeysAllVariantSelected.d.ts +9 -0
  179. package/dist/types/components/utils/varianceTest/mergeTest.d.ts +5 -0
  180. package/dist/types/components.d.ts +51 -0
  181. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +7 -0
  182. package/dist/types/types/checkout/CheckoutConfig.d.ts +13 -1
  183. package/dist/types/types/checkout/api/CheckoutSession.d.ts +7 -0
  184. package/dist/types/types/checkout/api/VarianceTest.d.ts +30 -0
  185. package/dist/types/types/generated/graphql.internal.types.d.ts +163 -0
  186. package/dist/types/types/generated/graphql.internal.types.ts +199 -0
  187. package/dist/types/types/index.d.ts +1 -0
  188. package/dist/types/types/utils/ZonosSettings.d.ts +7 -6
  189. package/dist/zonos-elements/index.esm.js +1 -1
  190. package/dist/zonos-elements/{p-609c32a3.system.entry.js → p-01987cb2.system.entry.js} +1 -1
  191. package/dist/zonos-elements/p-04a01cb1.js +1 -0
  192. package/dist/zonos-elements/p-04b43dd5.entry.js +1 -0
  193. package/dist/zonos-elements/p-0f77d087.system.entry.js +1 -0
  194. package/dist/zonos-elements/{p-329efa8c.system.entry.js → p-1dcdb65f.system.entry.js} +1 -1
  195. package/dist/zonos-elements/p-26a634a5.system.entry.js +1 -0
  196. package/dist/zonos-elements/p-27987298.system.entry.js +1 -0
  197. package/dist/zonos-elements/p-2af2eb6f.system.entry.js +1 -0
  198. package/dist/zonos-elements/p-2b8f787a.entry.js +1 -0
  199. package/dist/zonos-elements/p-30cfa524.entry.js +1 -0
  200. package/dist/zonos-elements/p-32320d9a.system.js +1 -0
  201. package/dist/zonos-elements/p-3284f459.system.entry.js +1 -0
  202. package/dist/zonos-elements/{p-13796f98.js → p-3d82a352.js} +1 -1
  203. package/dist/zonos-elements/p-452070af.system.entry.js +1 -0
  204. package/dist/zonos-elements/p-45ebc788.entry.js +1 -0
  205. package/dist/zonos-elements/p-4c81112f.entry.js +1 -0
  206. package/dist/zonos-elements/p-4efa8187.js +1 -0
  207. package/dist/zonos-elements/p-5170bc41.entry.js +1 -0
  208. package/dist/zonos-elements/p-5a2dd041.system.js +1 -0
  209. package/dist/zonos-elements/p-5c74e5c9.system.entry.js +1 -0
  210. package/dist/zonos-elements/p-5d0f7364.system.js +1 -0
  211. package/dist/zonos-elements/p-6a52a2bc.system.entry.js +1 -0
  212. package/dist/zonos-elements/p-715d0f59.system.entry.js +1 -0
  213. package/dist/zonos-elements/{p-b8d87932.js → p-72f37935.js} +1 -1
  214. package/dist/zonos-elements/p-7ae5cd60.entry.js +1 -0
  215. package/dist/zonos-elements/p-80bbd9c0.system.entry.js +1 -0
  216. package/dist/zonos-elements/p-851c642e.system.entry.js +1 -0
  217. package/dist/zonos-elements/{p-623a30aa.entry.js → p-8d870d4c.entry.js} +1 -1
  218. package/dist/zonos-elements/p-98b65387.entry.js +1 -0
  219. package/dist/zonos-elements/p-9af5e93a.entry.js +1 -0
  220. package/dist/zonos-elements/p-aa1193bc.entry.js +1 -0
  221. package/dist/zonos-elements/{p-8fc08673.js → p-aae60057.js} +2 -2
  222. package/dist/zonos-elements/p-ab176281.system.entry.js +1 -0
  223. package/dist/zonos-elements/p-b52aba52.entry.js +1 -0
  224. package/dist/zonos-elements/p-bc220d35.system.js +1 -0
  225. package/dist/zonos-elements/p-bc8bda92.entry.js +1 -0
  226. package/dist/zonos-elements/p-be5afc91.system.entry.js +1 -0
  227. package/dist/zonos-elements/p-bec2a3ce.entry.js +1 -0
  228. package/dist/zonos-elements/p-c291bac1.entry.js +1 -0
  229. package/dist/zonos-elements/p-c3d2422e.entry.js +1 -0
  230. package/dist/zonos-elements/{p-f28eb1dd.system.js → p-c50b3100.system.js} +1 -1
  231. package/dist/zonos-elements/p-c58acd4c.system.entry.js +1 -0
  232. package/dist/zonos-elements/p-c5fcbc92.system.entry.js +1 -0
  233. package/dist/zonos-elements/p-c767242b.entry.js +1 -0
  234. package/dist/zonos-elements/p-c9aa902e.system.entry.js +1 -0
  235. package/dist/zonos-elements/p-cb823c4d.system.js +1 -0
  236. package/dist/zonos-elements/{p-24554580.system.js → p-d2466fbd.system.js} +2 -2
  237. package/dist/zonos-elements/{p-d422ad1d.system.js → p-d42dfd32.system.js} +1 -1
  238. package/dist/zonos-elements/p-d46349d3.system.entry.js +1 -0
  239. package/dist/zonos-elements/p-d60ca44b.system.entry.js +1 -0
  240. package/dist/zonos-elements/{p-b2241919.entry.js → p-d6a10007.entry.js} +1 -1
  241. package/dist/zonos-elements/p-db025dfc.system.entry.js +1 -0
  242. package/dist/zonos-elements/p-db3968a2.js +1 -0
  243. package/dist/zonos-elements/p-dcd6acd4.system.entry.js +1 -0
  244. package/dist/zonos-elements/p-dd1cfa74.entry.js +1 -0
  245. package/dist/zonos-elements/p-df4c46a6.entry.js +1 -0
  246. package/dist/zonos-elements/{p-4593324c.js → p-e26c9e83.js} +1 -1
  247. package/dist/zonos-elements/p-e68d5219.entry.js +1 -0
  248. package/dist/zonos-elements/p-ea6d87a1.system.js +1 -1
  249. package/dist/zonos-elements/p-ef3e05e5.system.js +1 -0
  250. package/dist/zonos-elements/p-f255e822.js +1 -0
  251. package/dist/zonos-elements/p-f655ec36.entry.js +1 -0
  252. package/dist/zonos-elements/{p-e91b244c.entry.js → p-f891d470.entry.js} +1 -1
  253. package/dist/zonos-elements/p-f8d0d488.system.entry.js +1 -0
  254. package/dist/zonos-elements/{p-240ee490.system.entry.js → p-fbe36bc8.system.entry.js} +1 -1
  255. package/dist/zonos-elements/p-fcc2e712.entry.js +1 -0
  256. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  257. package/package.json +1 -1
  258. package/dist/esm-es5/cart-e03d615e.js +0 -1
  259. package/dist/esm-es5/zonos-cart-items_13.entry.js +0 -1
  260. package/dist/esm-es5/zonosStore-cdabc848.js +0 -1
  261. package/dist/zonos-elements/p-06ed3582.system.js +0 -1
  262. package/dist/zonos-elements/p-0a2101d4.system.js +0 -1
  263. package/dist/zonos-elements/p-0aa20875.system.entry.js +0 -1
  264. package/dist/zonos-elements/p-0bfd23da.entry.js +0 -1
  265. package/dist/zonos-elements/p-0f3568a7.entry.js +0 -1
  266. package/dist/zonos-elements/p-147ca395.entry.js +0 -1
  267. package/dist/zonos-elements/p-190398dd.entry.js +0 -1
  268. package/dist/zonos-elements/p-1eddec23.entry.js +0 -1
  269. package/dist/zonos-elements/p-1f2c3f5c.system.entry.js +0 -1
  270. package/dist/zonos-elements/p-24a2e899.system.entry.js +0 -1
  271. package/dist/zonos-elements/p-2882b9f4.entry.js +0 -1
  272. package/dist/zonos-elements/p-28ba5a6b.system.entry.js +0 -1
  273. package/dist/zonos-elements/p-33488109.system.entry.js +0 -1
  274. package/dist/zonos-elements/p-337fab4e.js +0 -1
  275. package/dist/zonos-elements/p-35573f66.entry.js +0 -1
  276. package/dist/zonos-elements/p-394d468f.system.js +0 -1
  277. package/dist/zonos-elements/p-3ddecaa4.system.entry.js +0 -1
  278. package/dist/zonos-elements/p-48f70043.system.entry.js +0 -1
  279. package/dist/zonos-elements/p-55711b80.system.entry.js +0 -1
  280. package/dist/zonos-elements/p-578bf5d7.entry.js +0 -1
  281. package/dist/zonos-elements/p-5b8e5d1a.entry.js +0 -1
  282. package/dist/zonos-elements/p-5c061a35.entry.js +0 -1
  283. package/dist/zonos-elements/p-6096c1c5.entry.js +0 -1
  284. package/dist/zonos-elements/p-6adc6e27.entry.js +0 -1
  285. package/dist/zonos-elements/p-7bb9c330.entry.js +0 -1
  286. package/dist/zonos-elements/p-7c6b8d3f.entry.js +0 -1
  287. package/dist/zonos-elements/p-85270076.system.entry.js +0 -1
  288. package/dist/zonos-elements/p-8a9d4605.system.entry.js +0 -1
  289. package/dist/zonos-elements/p-94e3e50d.system.entry.js +0 -1
  290. package/dist/zonos-elements/p-9f272e8e.system.entry.js +0 -1
  291. package/dist/zonos-elements/p-9f6dd86a.entry.js +0 -1
  292. package/dist/zonos-elements/p-a64ab131.system.entry.js +0 -1
  293. package/dist/zonos-elements/p-aac95779.system.entry.js +0 -1
  294. package/dist/zonos-elements/p-ad3c5358.entry.js +0 -1
  295. package/dist/zonos-elements/p-ad8a0584.entry.js +0 -1
  296. package/dist/zonos-elements/p-aeaba33e.system.entry.js +0 -1
  297. package/dist/zonos-elements/p-af6af82e.system.js +0 -1
  298. package/dist/zonos-elements/p-b2e76636.system.entry.js +0 -1
  299. package/dist/zonos-elements/p-b6afcf3f.system.entry.js +0 -1
  300. package/dist/zonos-elements/p-b8d91f99.entry.js +0 -1
  301. package/dist/zonos-elements/p-be8fa9a5.system.entry.js +0 -1
  302. package/dist/zonos-elements/p-c770044a.system.entry.js +0 -1
  303. package/dist/zonos-elements/p-d4842d10.system.entry.js +0 -1
  304. package/dist/zonos-elements/p-e390725f.js +0 -1
  305. package/dist/zonos-elements/p-eb85f0b6.system.entry.js +0 -1
  306. package/dist/zonos-elements/p-ef3d0394.entry.js +0 -1
  307. package/dist/zonos-elements/p-f6e587bb.entry.js +0 -1
  308. package/dist/zonos-elements/p-ff23980c.entry.js +0 -1
@@ -1,15 +1,17 @@
1
1
  import { r as registerInstance, h, H as Host, F as Fragment } from './index-a457c60c.js';
2
- import { l as localizationStore, s as stripeStoreGetDomesticShippingSession, a as localizationStoreUpdateSelectedCountryCode, b as stripeStoreCleanupDomesticShippingSession, c as stripeStoreSaveDomesticShippingSession, i as initStripeElements, d as stripeStoreRetrievePayment, e as cartStore, f as stripeStore, g as cartStoreUpdateItems, h as cartStoreReset, j as cartStoreResetTabItems, k as cartStoreClearCheckoutInterval, m as stripeStoreInitCheckoutSession, n as stripeStoreGetPaymentIntent, o as cartStoreStartCheckoutInterval, t as trackConversionEvent, p as getCheckoutSessionBody, q as cartStoreUpdateToErrorState, r as translate, u as getZCountryUrlParam, v as cartStoreSetCheckoutSession, w as stripeStorePrefetchLandedCost, x as cartStoreNextStep, y as stripeStoreUpdateCheckoutSessionBaseCurrency, z as stripeStoreHandleInventoryCheck, A as stripeStoreConfirmPayment, B as stripeStoreHandleInventoryRefund, C as stripeStoreReset, D as localizationStoreOnUpdate, E as currencyFormat } from './cart-e03d615e.js';
3
- import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript, b as paypalStore } from './paypal-23dd5023.js';
4
- import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-cdabc848.js';
2
+ import { s as stripeStoreGetDomesticShippingSession, a as stripeStoreCleanupDomesticShippingSession, b as stripeStoreSaveDomesticShippingSession, i as initStripeElements, c as stripeStoreRetrievePayment, d as stripeStore, e as cartStore, f as cartStoreUpdateItems, g as cartStoreReset, h as cartStoreResetTabItems, j as cartStoreClearCheckoutInterval, k as stripeStoreInitCheckoutSession, l as stripeStoreGetPaymentIntent, m as cartStoreStartCheckoutInterval, t as trackConversionEvent, n as getCheckoutSessionBody, o as cartStoreUpdateToErrorState, p as cartStoreSetCheckoutSession, q as stripeStorePrefetchLandedCost, r as cartStoreNextStep, u as stripeStoreUpdateCheckoutSessionBaseCurrency, v as stripeStoreHandleInventoryCheck, w as stripeStoreConfirmPayment, x as stripeStoreHandleInventoryRefund, y as stripeStoreReset } from './cart-b7c15b61.js';
3
+ import { p as paypalStoreHasPaypalEnabled, s as submitGtag, a as paypalInitScript, b as paypalStore } from './paypal-932fd3dd.js';
4
+ import { f as filterValidTests, l as localizationStore, a as localizationStoreUpdateSelectedCountryCode, g as getZCountryUrlParam, s as storageStore, V as VARIANT_TEST_KEY_EXPIRATION, b as storageStoreSetEnabledVariantTestKeys, t as translate, c as localizationStoreOnChange, d as currencyFormat } from './localization-bf7224aa.js';
5
+ import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore-d10a829f.js';
5
6
  import { h as handleFetch, l as log, b as logError, s as sendErrorLog, c as getElapsedTime, d as allLogs, e as getAdditionalLogMetadata, g as getIsTestMode, j as jsonParse, a as getIsStagingMode, i as isCheckoutMobile } from './handleFetch-621e45bc.js';
6
7
  import { c as classes } from './classes-0d95c529.js';
7
8
  import { c as createCustomEvent } from './createCustomEvent-58159025.js';
8
- import { g as getBorderRadius } from './getBorderRadius-413e97eb.js';
9
- import { i as isDarkColor } from './isDarkColor-4c7b2ffc.js';
9
+ import { g as getBorderRadius } from './getBorderRadius-78b28b4d.js';
10
+ import { i as isDarkColor } from './isDarkColor-31dd7dff.js';
10
11
  import { s as styles } from './styles-6fc2fad9.js';
11
12
  import { _ as _getIsValidCartId, c as checkoutHiddenBtnSelector, a as checkoutHiddenInternationalBtnSelector, d as domesticRedirectedBtnSelector } from './CheckoutConfig-eb7d6954.js';
12
13
  import { R as RemoveIcon } from './RemoveIcon-9dc5dd1a.js';
14
+ import './VarianceTest-fef2d958.js';
13
15
 
14
16
  /**
15
17
  * Map the items from tempCart like how we do it in dgs
@@ -47,6 +49,70 @@ const isStoreDiscountEnabled = async () => {
47
49
  return { enabled: true };
48
50
  };
49
51
 
52
+ const selectVarianceTest = async ({ testKeys }) => {
53
+ // Do nothing if no test keys are provided
54
+ if (testKeys.length === 0) {
55
+ return null;
56
+ }
57
+ const { errors, json } = await handleFetch('/api/zonos-elements/select-variance-test', {
58
+ body: {
59
+ testKeys,
60
+ },
61
+ method: 'POST',
62
+ });
63
+ if (errors.length || !json) {
64
+ return null;
65
+ }
66
+ const filteredAvailableTestKeys = filterValidTests(json);
67
+ // Filter the response to only include test keys that we support
68
+ return filteredAvailableTestKeys;
69
+ };
70
+
71
+ const buildCartUrl = ({ cartId, checkoutSessionId, customerAddress1, customerAddress2, customerCity, customerCountry, customerEmail, customerFirstName, customerLastName, customerPhone, customerState, customerZip, hostedCheckoutUrl, isTestMode, isVariantTest, }) => {
72
+ const urlParams = new URLSearchParams();
73
+ urlParams.set('tempCartUUID', cartId);
74
+ if (customerFirstName) {
75
+ urlParams.set('customerFirstName', customerFirstName);
76
+ }
77
+ if (customerLastName) {
78
+ urlParams.set('customerLastName', customerLastName);
79
+ }
80
+ if (customerEmail) {
81
+ urlParams.set('customerEmail', customerEmail);
82
+ }
83
+ if (customerPhone) {
84
+ urlParams.set('customerPhone', customerPhone);
85
+ }
86
+ if (customerZip) {
87
+ urlParams.set('customerZip', customerZip);
88
+ }
89
+ if (customerCity) {
90
+ urlParams.set('customerCity', customerCity);
91
+ }
92
+ if (customerState) {
93
+ urlParams.set('customerState', customerState);
94
+ }
95
+ if (customerCountry) {
96
+ urlParams.set('zCountry', customerCountry);
97
+ }
98
+ if (customerAddress1) {
99
+ urlParams.set('customerAddress1', customerAddress1);
100
+ }
101
+ if (customerAddress2) {
102
+ urlParams.set('customerAddress2', customerAddress2);
103
+ }
104
+ if (isTestMode) {
105
+ urlParams.set('zonosTestMode', '1');
106
+ }
107
+ if (checkoutSessionId) {
108
+ urlParams.set('zonosCheckoutSessionId', checkoutSessionId);
109
+ }
110
+ if (isVariantTest) {
111
+ urlParams.set('zonosVariantTest', '1');
112
+ }
113
+ return `${hostedCheckoutUrl}?${urlParams.toString()}`;
114
+ };
115
+
50
116
  const isDisabledCountry = (showLog = true) => {
51
117
  if (!localizationStore.localizationLoaded) {
52
118
  return true;
@@ -179,6 +245,46 @@ const watchBigcommerceDomesticCheckout = ({ domesticRedirectedBtnSelector, onShi
179
245
  });
180
246
  };
181
247
 
248
+ const getLegacyQueryParams = () => {
249
+ const urlParams = new URLSearchParams(window.location.search);
250
+ log('legacy urlParams', 'info', Object.fromEntries(urlParams.entries()));
251
+ const getParam = (param) => {
252
+ const value = urlParams.get(param);
253
+ if (!value || value === 'undefined') {
254
+ return '';
255
+ }
256
+ return value;
257
+ };
258
+ const customerCountry =
259
+ // fallback to selected country code if country is not provided
260
+ getZCountryUrlParam(urlParams) ||
261
+ localizationStore.selectedCountryCode ||
262
+ 'US';
263
+ const customerCity = getParam('customerCity');
264
+ const customerEmail = getParam('customerEmail');
265
+ const customerAddress1 = getParam('customerAddress1');
266
+ const customerAddress2 = getParam('customerAddress2');
267
+ const customerName = getParam('customerName');
268
+ const customerPhone = getParam('customerPhone');
269
+ const customerZip = getParam('customerZip');
270
+ const customerState = getParam('customerState');
271
+ const customerFirstName = getParam('customerFirstName');
272
+ const customerLastName = getParam('customerLastName');
273
+ return {
274
+ customerAddress1,
275
+ customerAddress2,
276
+ customerCity,
277
+ customerCountry,
278
+ customerEmail,
279
+ customerFirstName,
280
+ customerLastName,
281
+ customerName,
282
+ customerPhone,
283
+ customerState,
284
+ customerZip,
285
+ };
286
+ };
287
+
182
288
  let numberOfFailures = 0;
183
289
  const sendBulkLoadTimeApiLog = async () => {
184
290
  // Don't send the log if there are no API calls to send
@@ -246,6 +352,36 @@ const sendLoadNativeCheckoutLog = async ({ loadTime, }) => {
246
352
  });
247
353
  };
248
354
 
355
+ const filterExpiredTests = (testKeys) => (testKeys === null || testKeys === void 0 ? void 0 : testKeys.filter(v => {
356
+ if ((v.expiresAt && v.expiresAt < Date.now()) || !v.expiresAt) {
357
+ return false;
358
+ }
359
+ return true;
360
+ })) || [];
361
+
362
+ const getSelectedTestVariant = (testKey) => {
363
+ var _a;
364
+ const currentTest = (_a = storageStore.enabledVariantTestKeys) === null || _a === void 0 ? void 0 : _a.find(v => v.testKey === testKey);
365
+ return (currentTest === null || currentTest === void 0 ? void 0 : currentTest.selectedVariantKey) || null;
366
+ };
367
+
368
+ const isTestEnabled = (testKey) => {
369
+ return zonosStore.enabledVariantTestKeys.includes(testKey);
370
+ };
371
+
372
+ const mergeTest = ({ baseTestObj, mergeTestObj, }) => {
373
+ return baseTestObj.map(({ testKey }) => {
374
+ // We will attempt to get the enabled selection from localStorage first and only re-fetch if the testKeys are changed
375
+ const existingSelection = mergeTestObj.find(({ testKey: key }) => key === testKey);
376
+ return {
377
+ expiresAt: (existingSelection === null || existingSelection === void 0 ? void 0 : existingSelection.expiresAt) ||
378
+ Date.now() + VARIANT_TEST_KEY_EXPIRATION,
379
+ selectedVariantKey: (existingSelection === null || existingSelection === void 0 ? void 0 : existingSelection.selectedVariantKey) || null,
380
+ testKey,
381
+ };
382
+ });
383
+ };
384
+
249
385
  const getTempCartById = async ({ cartId, retries, }) => {
250
386
  const isTestMode = getIsTestMode();
251
387
  const { errors, json } = await handleFetch('/api/zonos-elements/get-temp-cart', {
@@ -365,7 +501,7 @@ const ZonosCheckout = class {
365
501
  log('Payment intent failed, show status from error');
366
502
  }
367
503
  this.open = true;
368
- cartStore.checkoutSessionId = zonosCheckoutSessionId;
504
+ storageStore.checkoutSessionId = zonosCheckoutSessionId;
369
505
  stripeStore.clientSecret = stripeClientSecret;
370
506
  void this.setToFinishStep(status);
371
507
  return { shouldAllowOrder: false };
@@ -377,6 +513,121 @@ const ZonosCheckout = class {
377
513
  log('Payment intent is not succeeded, proceed to order');
378
514
  return { shouldAllowOrder: true };
379
515
  };
516
+ this.initializeTestKeys = () => {
517
+ // cleanup expired test keys
518
+ storageStore.enabledVariantTestKeys = filterExpiredTests(storageStore.enabledVariantTestKeys || []);
519
+ // map existingSelection to the enabled variant test keys from database
520
+ const existingSelectionMap = zonosStore.enabledVariantTestKeys.map(testKey => {
521
+ var _a;
522
+ // We will attempt to get the enabled selection from localStorage first and only re-fetch if the testKeys are changed
523
+ const existingSelection = (_a = storageStore.enabledVariantTestKeys) === null || _a === void 0 ? void 0 : _a.find(({ testKey: key }) => key === testKey);
524
+ return {
525
+ expiresAt: (existingSelection === null || existingSelection === void 0 ? void 0 : existingSelection.expiresAt) ||
526
+ Date.now() + VARIANT_TEST_KEY_EXPIRATION,
527
+ selectedVariantKey: (existingSelection === null || existingSelection === void 0 ? void 0 : existingSelection.selectedVariantKey) || null,
528
+ testKey,
529
+ };
530
+ });
531
+ storageStoreSetEnabledVariantTestKeys(existingSelectionMap);
532
+ return {
533
+ allSelected: false,
534
+ };
535
+ };
536
+ this.shouldAllowHostedVsNativeTest = () => {
537
+ // This test is only applicable to checkout that's using createCartid callback
538
+ if (typeof zonosStore.checkoutSettings.createCartId !== 'function') {
539
+ return false;
540
+ }
541
+ const hostedVsNativeTest = zonosStore.enabledVariantTestKeys.includes('hosted_vs_native');
542
+ // Should not do anything if the test is not enabled
543
+ if (!hostedVsNativeTest) {
544
+ return false;
545
+ }
546
+ return true;
547
+ };
548
+ // Register test hosted vs native if needed to get the variant selection for this test
549
+ this.registerTestHostedVsNative = async () => {
550
+ // This test is only applicable to checkout that's using createCartid callback
551
+ const isAllowedHostedVsNativeTest = this.shouldAllowHostedVsNativeTest();
552
+ if (!isAllowedHostedVsNativeTest) {
553
+ return;
554
+ }
555
+ log(`[TEST] - Registering hosted vs native test`);
556
+ const selectedVariantKey = getSelectedTestVariant('hosted_vs_native');
557
+ // No need to request variant test for this test if the test already has variant selected
558
+ if (selectedVariantKey) {
559
+ log(`[TEST] - Hosted vs native test already has variant selected: ${selectedVariantKey}`);
560
+ return;
561
+ }
562
+ // Get variance test selection from the testKey not yet selected
563
+ const response = await selectVarianceTest({
564
+ testKeys: ['hosted_vs_native'],
565
+ });
566
+ // Do not prevent user from proceeding if the test is not enabled or failed to get selection
567
+ if (!response) {
568
+ log(`[TEST] - Failed to get selection for hosted vs native test`);
569
+ return;
570
+ }
571
+ // At this point, all test keys should already have variant selected. Update and map the selected variant to the existing test keys
572
+ const mappedEnabledVariantTestKeys = mergeTest({
573
+ baseTestObj: storageStore.enabledVariantTestKeys || [],
574
+ mergeTestObj: response,
575
+ });
576
+ // Set the selected variant to the storage store
577
+ storageStoreSetEnabledVariantTestKeys(mappedEnabledVariantTestKeys);
578
+ };
579
+ // Handle hosted vs native test
580
+ this.handleHostedVsNative = async () => {
581
+ var _a;
582
+ // This test is only applicable to checkout that's using createCartid callback
583
+ const isAllowedHostedVsNativeTest = this.shouldAllowHostedVsNativeTest();
584
+ if (!isAllowedHostedVsNativeTest) {
585
+ return {
586
+ redirected: false,
587
+ };
588
+ }
589
+ const selectedVariantTest = getSelectedTestVariant('hosted_vs_native');
590
+ log(`[TEST] - hosted_vs_native: ${selectedVariantTest}`);
591
+ // This test is only applicable to checkout that's using createCartid callback
592
+ if (typeof zonosStore.checkoutSettings.createCartId !== 'function') {
593
+ log(`[TEST] - createCartId is not provided, skipping hosted vs native test`);
594
+ return {
595
+ redirected: false,
596
+ };
597
+ }
598
+ // No need to do anything if the test is enabled for native
599
+ if (selectedVariantTest !== 'hosted') {
600
+ log(`[TEST] - Hosted vs native test is enabled for native, skipping`);
601
+ return {
602
+ redirected: false,
603
+ };
604
+ }
605
+ if (!((_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.hostedCheckoutUrl)) {
606
+ log('[TEST] - Hosted checkout URL is not provided');
607
+ return {
608
+ redirected: false,
609
+ };
610
+ }
611
+ log('"createCartId" is provided, start building cart');
612
+ const cartIdResult = await zonosStore.checkoutSettings.createCartId();
613
+ let cartId;
614
+ let shippingData = null;
615
+ if (typeof cartIdResult === 'object') {
616
+ cartId = cartIdResult.cartId;
617
+ shippingData = cartIdResult.shippingData || null;
618
+ }
619
+ else {
620
+ cartId = cartIdResult;
621
+ }
622
+ const legacyQueryParams = getLegacyQueryParams();
623
+ const cartUrl = buildCartUrl(Object.assign(Object.assign({ cartId, checkoutSessionId: storageStore.checkoutSessionId || undefined, hostedCheckoutUrl: zonosStore.genericSettings.hostedCheckoutUrl, isTestMode: getIsTestMode(), isVariantTest: true }, legacyQueryParams), shippingData));
624
+ log(`[TEST] - Redirecting to: ${cartUrl}`);
625
+ // Open new page with the cart URL
626
+ window.open(cartUrl, '_blank');
627
+ return {
628
+ redirected: true,
629
+ };
630
+ };
380
631
  this.formatDate = (timestamp) => {
381
632
  if (!timestamp) {
382
633
  return '';
@@ -437,6 +688,72 @@ const ZonosCheckout = class {
437
688
  }
438
689
  return this.defaultAddressParams;
439
690
  };
691
+ /**
692
+ * Message listener from the hosted checkout tab just openned from the hosted vs native variant test
693
+ */
694
+ this.handleHostedOpenWindowCallback = (e) => {
695
+ var _a;
696
+ // check if it's from origin of hosted checkout url
697
+ const hostedCheckoutUrl = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.hostedCheckoutUrl;
698
+ // Do nothing if hosted checkout url is not set
699
+ if (!origin) {
700
+ return;
701
+ }
702
+ // Do nothing if it's not from the origin of hosted checkout url
703
+ const isDev = ['dev.checkout.elements.zonos.com'].some(dev => e.origin.includes(dev));
704
+ // Do not allow to receive message if not from origin we expected when it's not dev environment
705
+ if (e.origin !== hostedCheckoutUrl && !isDev) {
706
+ return;
707
+ }
708
+ switch (e.data.type) {
709
+ case 'zonos-checkout-session-update':
710
+ // Update and set checkout session id to storage so that if user come back to merchant site, it will persist the test variance selection
711
+ storageStore.checkoutSessionId = e.data.checkoutSessionId;
712
+ break;
713
+ }
714
+ };
715
+ /**
716
+ * Capture params from the url and set to the store when it's redirected from hosted checkout url for variant test
717
+ */
718
+ this.captureParamsRedirectedForVariantTest = () => {
719
+ const url = new URL(window.location.href);
720
+ const zonosVariantTest = url.searchParams.get('zonosVariantTest') === '1';
721
+ // Do nothing if the url is not loaded from hosted vs native variant test
722
+ if (!zonosVariantTest) {
723
+ return;
724
+ }
725
+ const checkoutSessionId = url.searchParams.get('zonosCheckoutSessionId');
726
+ if (checkoutSessionId) {
727
+ storageStore.checkoutSessionId = checkoutSessionId;
728
+ }
729
+ // merge variant test input from url to storageStore.enabledVariantTestKeys
730
+ const enabledVariantTestKeys = storageStore.enabledVariantTestKeys || [];
731
+ // override the selected variant key if it's not "hosted" since we are in hosted checkout tab
732
+ if (window.Zonos.isLegacyCheckout) {
733
+ const selectedVariantKey = getSelectedTestVariant('hosted_vs_native');
734
+ // Set selected variant key "hosted" to enabledVariantTestKeys if it's not in enabledVariantTestKeys already
735
+ if (!selectedVariantKey) {
736
+ enabledVariantTestKeys.push({
737
+ expiresAt: Date.now() + VARIANT_TEST_KEY_EXPIRATION,
738
+ selectedVariantKey: 'hosted',
739
+ testKey: 'hosted_vs_native',
740
+ });
741
+ storageStoreSetEnabledVariantTestKeys(enabledVariantTestKeys);
742
+ }
743
+ else {
744
+ storageStoreSetEnabledVariantTestKeys(enabledVariantTestKeys.map((x) => {
745
+ if (x.testKey === 'hosted_vs_native') {
746
+ return Object.assign(Object.assign({}, x), { selectedVariantKey: 'hosted' });
747
+ }
748
+ return x;
749
+ }));
750
+ }
751
+ }
752
+ // Remove query params from the url
753
+ url.searchParams.delete('zonosCheckoutSessionId');
754
+ url.searchParams.delete('zonosVariantTest');
755
+ window.history.replaceState({}, '', url.toString());
756
+ };
440
757
  this.appearanceSettingsOverride = undefined;
441
758
  this.preview = false;
442
759
  this.hiddenMode = false;
@@ -448,6 +765,7 @@ const ZonosCheckout = class {
448
765
  this.defaultCustomerProfileAddress = [];
449
766
  this.customerProfile = null;
450
767
  this.open = this.forceDialogOpen;
768
+ this.isOverlayLoading = false;
451
769
  this.stripe = window.Zonos.stripe;
452
770
  this.submitLoading = false;
453
771
  this.collapseReviewMobile = true;
@@ -568,7 +886,7 @@ const ZonosCheckout = class {
568
886
  await cartStoreUpdateItems({ adjustments, cartItems: cartItemsFiltered });
569
887
  }
570
888
  // if checkoutSessionId is not available, request a new one.
571
- if (!cartStore.checkoutSessionId) {
889
+ if (!storageStore.checkoutSessionId) {
572
890
  const success = await stripeStoreInitCheckoutSession();
573
891
  log(`stripeStoreInitCheckoutSession: ${success}`);
574
892
  if (!success) {
@@ -614,13 +932,13 @@ const ZonosCheckout = class {
614
932
  confirmProceedWithOrderDuplication() {
615
933
  // Reset the placed order info
616
934
  this.placedOrderInfo = null;
617
- if (!cartStore.checkoutSessionId) {
935
+ if (!storageStore.checkoutSessionId) {
618
936
  return;
619
937
  }
620
938
  // Record the order duplication consent so we know user did see the notification and proceed with the order duplication
621
939
  void handleFetch('/api/zonos-elements/update-checkout-session-metadata', {
622
940
  body: {
623
- id: cartStore.checkoutSessionId,
941
+ id: storageStore.checkoutSessionId,
624
942
  metadata: [
625
943
  {
626
944
  key: 'orderDuplicationConsent',
@@ -685,7 +1003,7 @@ const ZonosCheckout = class {
685
1003
  button,
686
1004
  });
687
1005
  button.addEventListener('click', async (e) => {
688
- var _a;
1006
+ var _a, _b;
689
1007
  // Start tracking load time
690
1008
  const startTime = performance.now();
691
1009
  const isAlwaysTriggerInternationalCheckout = alwaysTriggerInternationalCheckoutSelector &&
@@ -728,6 +1046,17 @@ const ZonosCheckout = class {
728
1046
  void sendBulkLoadTimeApiLog();
729
1047
  }, 2000);
730
1048
  }
1049
+ // Send request to get what kind of variant we are applying
1050
+ if (isTestEnabled('hosted_vs_native')) {
1051
+ this.isOverlayLoading = true;
1052
+ await this.registerTestHostedVsNative();
1053
+ const { redirected } = await this.handleHostedVsNative();
1054
+ this.isOverlayLoading = false;
1055
+ // Stop the process if the user is being redirected to the hosted checkout page
1056
+ if (redirected) {
1057
+ return;
1058
+ }
1059
+ }
731
1060
  // start loading
732
1061
  stripeStore.isFetchingSession = true;
733
1062
  this.open = true;
@@ -737,13 +1066,17 @@ const ZonosCheckout = class {
737
1066
  if (!result) {
738
1067
  throw new Error('Error building cart');
739
1068
  }
1069
+ (_a = window.opener) === null || _a === void 0 ? void 0 : _a.postMessage({
1070
+ checkoutSessionId: storageStore.checkoutSessionId,
1071
+ type: 'zonos-checkout-session-update',
1072
+ }, '*');
740
1073
  // start the timer to validate the price
741
1074
  cartStoreStartCheckoutInterval({
742
1075
  isPreview: this.preview,
743
1076
  sessionTimeout: CHECKOUT_SESSION_TIMEOUT,
744
1077
  });
745
1078
  submitGtag('zonos-checkout-start');
746
- const checkoutSessionId = cartStore.checkoutSessionId;
1079
+ const checkoutSessionId = storageStore.checkoutSessionId;
747
1080
  void trackConversionEvent({
748
1081
  checkoutSessionId,
749
1082
  eventName: 'checkout_open',
@@ -766,13 +1099,13 @@ const ZonosCheckout = class {
766
1099
  const message = err.message;
767
1100
  if (message === 'Cart is expired.') {
768
1101
  this.isCartExpired = true;
769
- return;
770
1102
  }
771
1103
  }
772
1104
  // stop loading
773
1105
  stripeStore.isFetchingSession = false;
774
1106
  logError(err);
775
1107
  if (this.isCartExpired) {
1108
+ stripeStore.isFetchingSession = true;
776
1109
  return;
777
1110
  }
778
1111
  // We want to log the error anytime we fail to create a checkout session
@@ -784,7 +1117,7 @@ const ZonosCheckout = class {
784
1117
  cartId: window.Zonos.cartId,
785
1118
  checkoutSessionBody: getCheckoutSessionBody(),
786
1119
  href: window.location.href,
787
- storeBaseUrl: ((_a = window.Zonos.cartData) === null || _a === void 0 ? void 0 : _a.storeBaseUrl) ||
1120
+ storeBaseUrl: ((_b = window.Zonos.cartData) === null || _b === void 0 ? void 0 : _b.storeBaseUrl) ||
788
1121
  zonosStore.onlineStoreSettings.url,
789
1122
  },
790
1123
  });
@@ -833,7 +1166,7 @@ const ZonosCheckout = class {
833
1166
  return;
834
1167
  }
835
1168
  log('shipping data from createCartId result', 'info', Object.entries(prefillAddress));
836
- const { customerAddress1, customerAddress2, customerCity, customerCountry, customerEmail, customerName, customerPhone, customerState, customerZip, } = prefillAddress;
1169
+ const { customerAddress1, customerAddress2, customerCity, customerCountry, customerEmail, customerFirstName, customerLastName, customerName, customerPhone, customerState, customerZip, } = prefillAddress;
837
1170
  const urlParams = new URLSearchParams(window.location.search);
838
1171
  const country = // fallback to selected country code if country is not provided
839
1172
  customerCountry ||
@@ -845,6 +1178,8 @@ const ZonosCheckout = class {
845
1178
  customerCity,
846
1179
  customerCountry: country,
847
1180
  customerEmail,
1181
+ customerFirstName,
1182
+ customerLastName,
848
1183
  customerName,
849
1184
  customerPhone,
850
1185
  customerState,
@@ -893,7 +1228,9 @@ const ZonosCheckout = class {
893
1228
  const line2 = address.customerAddress2 || '';
894
1229
  const city = address.customerCity || '';
895
1230
  const email = address.customerEmail || '';
896
- const name = address.customerName || '';
1231
+ const name = address.customerFirstName && address.customerLastName
1232
+ ? `${address.customerFirstName} ${address.customerLastName}`
1233
+ : address.customerName || '';
897
1234
  const phone = address.customerPhone || '';
898
1235
  const postal_code = address.customerZip || '';
899
1236
  const state = address.customerState || '';
@@ -1044,7 +1381,7 @@ const ZonosCheckout = class {
1044
1381
  async handleCustomerInfoContinue() {
1045
1382
  // submit google tag when the form is complete
1046
1383
  submitGtag('zonos-checkout-customer-info');
1047
- const checkoutSessionId = cartStore.checkoutSessionId;
1384
+ const checkoutSessionId = storageStore.checkoutSessionId;
1048
1385
  void trackConversionEvent({
1049
1386
  checkoutSessionId,
1050
1387
  eventName: 'checkout_customerInfoCompleted',
@@ -1314,13 +1651,20 @@ const ZonosCheckout = class {
1314
1651
  this.isMobile = isCheckoutMobile(this.mobile);
1315
1652
  this.isIframed = window.self !== window.top;
1316
1653
  log(`iframed: ${this.isIframed}`);
1654
+ // Set checkout session if redirect
1655
+ if (window.Zonos.isLegacyCheckout) {
1656
+ this.captureParamsRedirectedForVariantTest();
1657
+ }
1317
1658
  // update theme to browser preference theme if appearance theme is system
1318
1659
  this.handleAppearanceSettingsOverrideChange();
1319
1660
  // listen to selected locale code change
1320
- this.onChangeLocaleListener = localizationStoreOnUpdate('selectedLocale', () => {
1661
+ this.onChangeLocaleListener = localizationStoreOnChange('selectedLocale', () => {
1321
1662
  // Update stripe locale when selected country code is changed
1322
1663
  void this.applyStripeTheme();
1323
1664
  });
1665
+ // Initialize test keys
1666
+ this.initializeTestKeys();
1667
+ window.addEventListener('message', this.handleHostedOpenWindowCallback);
1324
1668
  log(`mobile: ${this.isMobile}`);
1325
1669
  }
1326
1670
  // do clean up when component is unmounted
@@ -1331,6 +1675,7 @@ const ZonosCheckout = class {
1331
1675
  cartStoreReset();
1332
1676
  // cleanup onChange listener
1333
1677
  this.onChangeLocaleListener();
1678
+ window.removeEventListener('message', this.handleHostedOpenWindowCallback);
1334
1679
  }
1335
1680
  render() {
1336
1681
  var _a, _b, _c, _d;
@@ -1467,7 +1812,7 @@ const ZonosCheckout = class {
1467
1812
  // If dialog is in open state, the message should not be null
1468
1813
  dialogSubtitle: translate('You are being sent back to the shop to re-add items to your cart.'), dialogTitle: translate('Shopping cart expired'), dialogType: "alert",
1469
1814
  // Mark user selected confirm to close the dialog
1470
- onConfirmClicked: () => this.handleCartExpiredDialogConfirm() })));
1815
+ onConfirmClicked: () => this.handleCartExpiredDialogConfirm() }), h("zonos-loading-overlay", { open: this.isOverlayLoading })));
1471
1816
  }
1472
1817
  static get assetsDirs() { return ["assets"]; }
1473
1818
  static get watchers() { return {
@@ -1,5 +1,6 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-a457c60c.js';
2
- import { d as zonosStoreFontFamily } from './zonosStore-cdabc848.js';
2
+ import { d as zonosStoreFontFamily } from './zonosStore-d10a829f.js';
3
+ import './VarianceTest-fef2d958.js';
3
4
 
4
5
  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}";
5
6
  const ZonosCollapseStyle0 = zonosCollapseCss;
@@ -18,7 +18,7 @@ const ZonosComponent = class {
18
18
  return format(this.first, this.middle, this.last);
19
19
  }
20
20
  render() {
21
- return h("div", { key: 'c35d0331d2d3724792e82b1d0a22d096fbbcddb7' }, "Hello, World! I'm ", this.getText());
21
+ return h("div", { key: '725c727348687e663e6225837a2a135d177b6d4a' }, "Hello, World! I'm ", this.getText());
22
22
  }
23
23
  };
24
24
  ZonosComponent.style = ZonosComponentStyle0;
@@ -1,10 +1,12 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host } from './index-a457c60c.js';
2
- import { G as isValidSelector, f as stripeStore, H as initLocalizationStore, e as cartStore, a as localizationStoreUpdateSelectedCountryCode } from './cart-e03d615e.js';
3
- import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-cdabc848.js';
2
+ import { d as stripeStore } from './cart-b7c15b61.js';
3
+ import { i as isValidSelector, e as initLocalizationStore, s as storageStore, a as localizationStoreUpdateSelectedCountryCode } from './localization-bf7224aa.js';
4
+ import { z as zonosStore, b as zonosStoreInitSetting, d as zonosStoreFontFamily } from './zonosStore-d10a829f.js';
4
5
  import { g as getGenericSettingsOverride, i as iframeServices, a as injectPrivateIframe } from './getGenericSettingsOverride-0bc3e118.js';
5
6
  import { h as handleFetch, b as logError, l as log } from './handleFetch-621e45bc.js';
6
- import './isDarkColor-4c7b2ffc.js';
7
- import './getBorderRadius-413e97eb.js';
7
+ import './isDarkColor-31dd7dff.js';
8
+ import './getBorderRadius-78b28b4d.js';
9
+ import './VarianceTest-fef2d958.js';
8
10
 
9
11
  const getZonosSettings = async () => {
10
12
  if (window.Zonos.cartSettings) {
@@ -597,7 +599,7 @@ const ZonosController = class {
597
599
  * Reset the Checkout session id and client secret (required for dashboard store switching)
598
600
  */
599
601
  async reset() {
600
- cartStore.checkoutSessionId = null;
602
+ storageStore.checkoutSessionId = null;
601
603
  stripeStore.clientSecret = '';
602
604
  }
603
605
  /**
@@ -630,7 +632,7 @@ const ZonosController = class {
630
632
  zonosStore.organizationName = organizationName;
631
633
  }
632
634
  render() {
633
- return h(Host, { key: '525180de311aea6ffaf2ecaa3fc35befd6bd9142', class: "zonos--elements" });
635
+ return h(Host, { key: '62c0b3079d64f05800da24daa19e0e1e3a890bca', class: "zonos--elements" });
634
636
  }
635
637
  };
636
638
  ZonosController.style = ZonosControllerStyle0;
@@ -1,10 +1,9 @@
1
1
  import { r as registerInstance, h, H as Host, d as getElement } from './index-a457c60c.js';
2
- import { l as localizationStore } from './cart-e03d615e.js';
3
- import { d as zonosStoreFontFamily } from './zonosStore-cdabc848.js';
2
+ import { l as localizationStore } from './localization-bf7224aa.js';
3
+ import { d as zonosStoreFontFamily } from './zonosStore-d10a829f.js';
4
4
  import { c as classes } from './classes-0d95c529.js';
5
5
  import './handleFetch-621e45bc.js';
6
- import './isDarkColor-4c7b2ffc.js';
7
- import './getBorderRadius-413e97eb.js';
6
+ import './VarianceTest-fef2d958.js';
8
7
 
9
8
  const zonosCountryFlagCss = ":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{display:-ms-inline-flexbox;display:inline-flex}:host .flag-container{position:relative;overflow:hidden;width:100%;height:100%}:host .flag-icon{position:absolute;top:0;left:0;width:100%;height:100%;background-position:center;background-repeat:no-repeat;background-size:cover}";
10
9
  const ZonosCountryFlagStyle0 = zonosCountryFlagCss;