@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
@@ -2,12 +2,15 @@ import { Fragment, h, Host, } from "@stencil/core";
2
2
  import { cartStore, cartStoreClearCheckoutInterval, cartStoreNextStep, cartStoreReset, cartStoreResetTabItems, cartStoreSetCheckoutSession, cartStoreStartCheckoutInterval, cartStoreUpdateItems, cartStoreUpdateToErrorState, } from "../../store/checkout/cart";
3
3
  import { paypalInitScript, paypalStore, paypalStoreHasPaypalEnabled, } from "../../store/checkout/paypal";
4
4
  import { getCheckoutSessionBody, initStripeElements, stripeStore, stripeStoreCleanupDomesticShippingSession, stripeStoreConfirmPayment, stripeStoreGetPaymentIntent, stripeStoreHandleInventoryCheck, stripeStoreHandleInventoryRefund, stripeStoreInitCheckoutSession, stripeStorePrefetchLandedCost, stripeStoreReset, stripeStoreRetrievePayment, stripeStoreUpdateCheckoutSessionBaseCurrency, } from "../../store/checkout/stripe";
5
- import { localizationStore, localizationStoreOnUpdate, } from "../../store/hello/localization";
5
+ import { localizationStore, localizationStoreOnChange, } from "../../store/hello/localization";
6
+ import { storageStore, storageStoreSetEnabledVariantTestKeys, VARIANT_TEST_KEY_EXPIRATION, } from "../../store/storageStore";
6
7
  import { translate } from "../../store/translationStore";
7
8
  import { getZonosStoreTheme, zonosStore, } from "../../store/zonosStore";
8
9
  import { buildCartItemsByTempCart } from "../../utils/api/buildCartItemsByTempCart";
9
10
  import { isStoreDiscountEnabled } from "../../utils/api/isStoreDiscountEnabl";
11
+ import { selectVarianceTest } from "../../utils/api/selectVarianceTest";
10
12
  import { trackConversionEvent } from "../../utils/api/trackConversionEvent";
13
+ import { buildCartUrl } from "../../utils/buildCartUrl";
11
14
  import { getIsStagingMode } from "../../utils/checkout/getIsStagingMode";
12
15
  import { getIsTestMode } from "../../utils/checkout/getIsTestMode";
13
16
  import { isCheckoutMobile } from "../../utils/checkout/isCheckoutMobile";
@@ -17,6 +20,7 @@ import { watchBigcommerceDomesticCheckout } from "../../utils/checkout/watchBigc
17
20
  import { classes } from "../../utils/classes";
18
21
  import { createCustomEvent } from "../../utils/createCustomEvent";
19
22
  import { getBorderRadius } from "../../utils/getBorderRadius";
23
+ import { getLegacyQueryParams } from "../../utils/getLegacyQueryParams";
20
24
  import { handleFetch } from "../../utils/handleFetch";
21
25
  import { currencyFormat } from "../../utils/hello/currencyConversion/currencyFormat";
22
26
  import { getZCountryUrlParam } from "../../utils/hello/getZCountryUrlParam";
@@ -31,6 +35,10 @@ import { sendLoadNativeCheckoutLog } from "../../utils/logging/sendLoadNativeChe
31
35
  import { mergeConfig } from "../../utils/mergeConfig";
32
36
  import { styles } from "../../utils/styles";
33
37
  import { submitGtag } from "../../utils/submitGtag";
38
+ import { filterExpiredTests } from "../../utils/varianceTest/filterExpiredTests";
39
+ import { getSelectedTestVariant } from "../../utils/varianceTest/getSelectedTestVariant";
40
+ import { isTestEnabled } from "../../utils/varianceTest/isTestEnabl";
41
+ import { mergeTest } from "../../utils/varianceTest/mergeTest";
34
42
  import { setupCartData } from "../../../scripts/cart/_setupCartData";
35
43
  import { checkoutHiddenBtnSelector, checkoutHiddenInternationalBtnSelector, domesticRedirectedBtnSelector, } from "../../../types/checkout/CheckoutConfig";
36
44
  /** These assets need to be in relative path as https://www.npmjs.com/package/stencil-inline-svg suggested */
@@ -95,7 +103,7 @@ export class ZonosCheckout {
95
103
  log('Payment intent failed, show status from error');
96
104
  }
97
105
  this.open = true;
98
- cartStore.checkoutSessionId = zonosCheckoutSessionId;
106
+ storageStore.checkoutSessionId = zonosCheckoutSessionId;
99
107
  stripeStore.clientSecret = stripeClientSecret;
100
108
  void this.setToFinishStep(status);
101
109
  return { shouldAllowOrder: false };
@@ -107,6 +115,121 @@ export class ZonosCheckout {
107
115
  log('Payment intent is not succeeded, proceed to order');
108
116
  return { shouldAllowOrder: true };
109
117
  };
118
+ this.initializeTestKeys = () => {
119
+ // cleanup expired test keys
120
+ storageStore.enabledVariantTestKeys = filterExpiredTests(storageStore.enabledVariantTestKeys || []);
121
+ // map existingSelection to the enabled variant test keys from database
122
+ const existingSelectionMap = zonosStore.enabledVariantTestKeys.map(testKey => {
123
+ var _a;
124
+ // We will attempt to get the enabled selection from localStorage first and only re-fetch if the testKeys are changed
125
+ const existingSelection = (_a = storageStore.enabledVariantTestKeys) === null || _a === void 0 ? void 0 : _a.find(({ testKey: key }) => key === testKey);
126
+ return {
127
+ expiresAt: (existingSelection === null || existingSelection === void 0 ? void 0 : existingSelection.expiresAt) ||
128
+ Date.now() + VARIANT_TEST_KEY_EXPIRATION,
129
+ selectedVariantKey: (existingSelection === null || existingSelection === void 0 ? void 0 : existingSelection.selectedVariantKey) || null,
130
+ testKey,
131
+ };
132
+ });
133
+ storageStoreSetEnabledVariantTestKeys(existingSelectionMap);
134
+ return {
135
+ allSelected: false,
136
+ };
137
+ };
138
+ this.shouldAllowHostedVsNativeTest = () => {
139
+ // This test is only applicable to checkout that's using createCartid callback
140
+ if (typeof zonosStore.checkoutSettings.createCartId !== 'function') {
141
+ return false;
142
+ }
143
+ const hostedVsNativeTest = zonosStore.enabledVariantTestKeys.includes('hosted_vs_native');
144
+ // Should not do anything if the test is not enabled
145
+ if (!hostedVsNativeTest) {
146
+ return false;
147
+ }
148
+ return true;
149
+ };
150
+ // Register test hosted vs native if needed to get the variant selection for this test
151
+ this.registerTestHostedVsNative = async () => {
152
+ // This test is only applicable to checkout that's using createCartid callback
153
+ const isAllowedHostedVsNativeTest = this.shouldAllowHostedVsNativeTest();
154
+ if (!isAllowedHostedVsNativeTest) {
155
+ return;
156
+ }
157
+ log(`[TEST] - Registering hosted vs native test`);
158
+ const selectedVariantKey = getSelectedTestVariant('hosted_vs_native');
159
+ // No need to request variant test for this test if the test already has variant selected
160
+ if (selectedVariantKey) {
161
+ log(`[TEST] - Hosted vs native test already has variant selected: ${selectedVariantKey}`);
162
+ return;
163
+ }
164
+ // Get variance test selection from the testKey not yet selected
165
+ const response = await selectVarianceTest({
166
+ testKeys: ['hosted_vs_native'],
167
+ });
168
+ // Do not prevent user from proceeding if the test is not enabled or failed to get selection
169
+ if (!response) {
170
+ log(`[TEST] - Failed to get selection for hosted vs native test`);
171
+ return;
172
+ }
173
+ // At this point, all test keys should already have variant selected. Update and map the selected variant to the existing test keys
174
+ const mappedEnabledVariantTestKeys = mergeTest({
175
+ baseTestObj: storageStore.enabledVariantTestKeys || [],
176
+ mergeTestObj: response,
177
+ });
178
+ // Set the selected variant to the storage store
179
+ storageStoreSetEnabledVariantTestKeys(mappedEnabledVariantTestKeys);
180
+ };
181
+ // Handle hosted vs native test
182
+ this.handleHostedVsNative = async () => {
183
+ var _a;
184
+ // This test is only applicable to checkout that's using createCartid callback
185
+ const isAllowedHostedVsNativeTest = this.shouldAllowHostedVsNativeTest();
186
+ if (!isAllowedHostedVsNativeTest) {
187
+ return {
188
+ redirected: false,
189
+ };
190
+ }
191
+ const selectedVariantTest = getSelectedTestVariant('hosted_vs_native');
192
+ log(`[TEST] - hosted_vs_native: ${selectedVariantTest}`);
193
+ // This test is only applicable to checkout that's using createCartid callback
194
+ if (typeof zonosStore.checkoutSettings.createCartId !== 'function') {
195
+ log(`[TEST] - createCartId is not provided, skipping hosted vs native test`);
196
+ return {
197
+ redirected: false,
198
+ };
199
+ }
200
+ // No need to do anything if the test is enabled for native
201
+ if (selectedVariantTest !== 'hosted') {
202
+ log(`[TEST] - Hosted vs native test is enabled for native, skipping`);
203
+ return {
204
+ redirected: false,
205
+ };
206
+ }
207
+ if (!((_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.hostedCheckoutUrl)) {
208
+ log('[TEST] - Hosted checkout URL is not provided');
209
+ return {
210
+ redirected: false,
211
+ };
212
+ }
213
+ log('"createCartId" is provided, start building cart');
214
+ const cartIdResult = await zonosStore.checkoutSettings.createCartId();
215
+ let cartId;
216
+ let shippingData = null;
217
+ if (typeof cartIdResult === 'object') {
218
+ cartId = cartIdResult.cartId;
219
+ shippingData = cartIdResult.shippingData || null;
220
+ }
221
+ else {
222
+ cartId = cartIdResult;
223
+ }
224
+ const legacyQueryParams = getLegacyQueryParams();
225
+ const cartUrl = buildCartUrl(Object.assign(Object.assign({ cartId, checkoutSessionId: storageStore.checkoutSessionId || undefined, hostedCheckoutUrl: zonosStore.genericSettings.hostedCheckoutUrl, isTestMode: getIsTestMode(), isVariantTest: true }, legacyQueryParams), shippingData));
226
+ log(`[TEST] - Redirecting to: ${cartUrl}`);
227
+ // Open new page with the cart URL
228
+ window.open(cartUrl, '_blank');
229
+ return {
230
+ redirected: true,
231
+ };
232
+ };
110
233
  this.formatDate = (timestamp) => {
111
234
  if (!timestamp) {
112
235
  return '';
@@ -167,6 +290,74 @@ export class ZonosCheckout {
167
290
  }
168
291
  return this.defaultAddressParams;
169
292
  };
293
+ /**
294
+ * Message listener from the hosted checkout tab just openned from the hosted vs native variant test
295
+ */
296
+ this.handleHostedOpenWindowCallback = (e) => {
297
+ var _a;
298
+ // check if it's from origin of hosted checkout url
299
+ const hostedCheckoutUrl = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.hostedCheckoutUrl;
300
+ // Do nothing if hosted checkout url is not set
301
+ if (!origin) {
302
+ return;
303
+ }
304
+ // Do nothing if it's not from the origin of hosted checkout url
305
+ const isDev = ['dev.checkout.elements.zonos.com'].some(dev => e.origin.includes(dev));
306
+ // Do not allow to receive message if not from origin we expected when it's not dev environment
307
+ if (e.origin !== hostedCheckoutUrl && !isDev) {
308
+ return;
309
+ }
310
+ switch (e.data.type) {
311
+ case 'zonos-checkout-session-update':
312
+ // Update and set checkout session id to storage so that if user come back to merchant site, it will persist the test variance selection
313
+ storageStore.checkoutSessionId = e.data.checkoutSessionId;
314
+ break;
315
+ default:
316
+ break;
317
+ }
318
+ };
319
+ /**
320
+ * Capture params from the url and set to the store when it's redirected from hosted checkout url for variant test
321
+ */
322
+ this.captureParamsRedirectedForVariantTest = () => {
323
+ const url = new URL(window.location.href);
324
+ const zonosVariantTest = url.searchParams.get('zonosVariantTest') === '1';
325
+ // Do nothing if the url is not loaded from hosted vs native variant test
326
+ if (!zonosVariantTest) {
327
+ return;
328
+ }
329
+ const checkoutSessionId = url.searchParams.get('zonosCheckoutSessionId');
330
+ if (checkoutSessionId) {
331
+ storageStore.checkoutSessionId = checkoutSessionId;
332
+ }
333
+ // merge variant test input from url to storageStore.enabledVariantTestKeys
334
+ const enabledVariantTestKeys = storageStore.enabledVariantTestKeys || [];
335
+ // override the selected variant key if it's not "hosted" since we are in hosted checkout tab
336
+ if (window.Zonos.isLegacyCheckout) {
337
+ const selectedVariantKey = getSelectedTestVariant('hosted_vs_native');
338
+ // Set selected variant key "hosted" to enabledVariantTestKeys if it's not in enabledVariantTestKeys already
339
+ if (!selectedVariantKey) {
340
+ enabledVariantTestKeys.push({
341
+ expiresAt: Date.now() + VARIANT_TEST_KEY_EXPIRATION,
342
+ selectedVariantKey: 'hosted',
343
+ testKey: 'hosted_vs_native',
344
+ });
345
+ storageStoreSetEnabledVariantTestKeys(enabledVariantTestKeys);
346
+ }
347
+ else {
348
+ storageStoreSetEnabledVariantTestKeys(enabledVariantTestKeys.map((x) => {
349
+ if (x.testKey === 'hosted_vs_native') {
350
+ return Object.assign(Object.assign({}, x), { selectedVariantKey: 'hosted' });
351
+ }
352
+ return x;
353
+ }));
354
+ }
355
+ }
356
+ // Remove query params from the url
357
+ url.searchParams.delete('zonosCheckoutSessionId');
358
+ url.searchParams.delete('zonosVariantTest');
359
+ window.history.replaceState({}, '', url.toString());
360
+ };
170
361
  this.appearanceSettingsOverride = undefined;
171
362
  this.preview = false;
172
363
  this.hiddenMode = false;
@@ -178,6 +369,7 @@ export class ZonosCheckout {
178
369
  this.defaultCustomerProfileAddress = [];
179
370
  this.customerProfile = null;
180
371
  this.open = this.forceDialogOpen;
372
+ this.isOverlayLoading = false;
181
373
  this.stripe = window.Zonos.stripe;
182
374
  this.submitLoading = false;
183
375
  this.collapseReviewMobile = true;
@@ -298,7 +490,7 @@ export class ZonosCheckout {
298
490
  await cartStoreUpdateItems({ adjustments, cartItems: cartItemsFiltered });
299
491
  }
300
492
  // if checkoutSessionId is not available, request a new one.
301
- if (!cartStore.checkoutSessionId) {
493
+ if (!storageStore.checkoutSessionId) {
302
494
  const success = await stripeStoreInitCheckoutSession();
303
495
  log(`stripeStoreInitCheckoutSession: ${success}`);
304
496
  if (!success) {
@@ -344,13 +536,13 @@ export class ZonosCheckout {
344
536
  confirmProceedWithOrderDuplication() {
345
537
  // Reset the placed order info
346
538
  this.placedOrderInfo = null;
347
- if (!cartStore.checkoutSessionId) {
539
+ if (!storageStore.checkoutSessionId) {
348
540
  return;
349
541
  }
350
542
  // Record the order duplication consent so we know user did see the notification and proceed with the order duplication
351
543
  void handleFetch('/api/zonos-elements/update-checkout-session-metadata', {
352
544
  body: {
353
- id: cartStore.checkoutSessionId,
545
+ id: storageStore.checkoutSessionId,
354
546
  metadata: [
355
547
  {
356
548
  key: 'orderDuplicationConsent',
@@ -415,7 +607,7 @@ export class ZonosCheckout {
415
607
  button,
416
608
  });
417
609
  button.addEventListener('click', async (e) => {
418
- var _a;
610
+ var _a, _b;
419
611
  // Start tracking load time
420
612
  const startTime = performance.now();
421
613
  const isAlwaysTriggerInternationalCheckout = alwaysTriggerInternationalCheckoutSelector &&
@@ -458,6 +650,17 @@ export class ZonosCheckout {
458
650
  void sendBulkLoadTimeApiLog();
459
651
  }, 2000);
460
652
  }
653
+ // Send request to get what kind of variant we are applying
654
+ if (isTestEnabled('hosted_vs_native')) {
655
+ this.isOverlayLoading = true;
656
+ await this.registerTestHostedVsNative();
657
+ const { redirected } = await this.handleHostedVsNative();
658
+ this.isOverlayLoading = false;
659
+ // Stop the process if the user is being redirected to the hosted checkout page
660
+ if (redirected) {
661
+ return;
662
+ }
663
+ }
461
664
  // start loading
462
665
  stripeStore.isFetchingSession = true;
463
666
  this.open = true;
@@ -467,13 +670,17 @@ export class ZonosCheckout {
467
670
  if (!result) {
468
671
  throw new Error('Error building cart');
469
672
  }
673
+ (_a = window.opener) === null || _a === void 0 ? void 0 : _a.postMessage({
674
+ checkoutSessionId: storageStore.checkoutSessionId,
675
+ type: 'zonos-checkout-session-update',
676
+ }, '*');
470
677
  // start the timer to validate the price
471
678
  cartStoreStartCheckoutInterval({
472
679
  isPreview: this.preview,
473
680
  sessionTimeout: CHECKOUT_SESSION_TIMEOUT,
474
681
  });
475
682
  submitGtag('zonos-checkout-start');
476
- const checkoutSessionId = cartStore.checkoutSessionId;
683
+ const checkoutSessionId = storageStore.checkoutSessionId;
477
684
  void trackConversionEvent({
478
685
  checkoutSessionId,
479
686
  eventName: 'checkout_open',
@@ -496,13 +703,13 @@ export class ZonosCheckout {
496
703
  const message = err.message;
497
704
  if (message === 'Cart is expired.') {
498
705
  this.isCartExpired = true;
499
- return;
500
706
  }
501
707
  }
502
708
  // stop loading
503
709
  stripeStore.isFetchingSession = false;
504
710
  logError(err);
505
711
  if (this.isCartExpired) {
712
+ stripeStore.isFetchingSession = true;
506
713
  return;
507
714
  }
508
715
  // We want to log the error anytime we fail to create a checkout session
@@ -514,7 +721,7 @@ export class ZonosCheckout {
514
721
  cartId: window.Zonos.cartId,
515
722
  checkoutSessionBody: getCheckoutSessionBody(),
516
723
  href: window.location.href,
517
- storeBaseUrl: ((_a = window.Zonos.cartData) === null || _a === void 0 ? void 0 : _a.storeBaseUrl) ||
724
+ storeBaseUrl: ((_b = window.Zonos.cartData) === null || _b === void 0 ? void 0 : _b.storeBaseUrl) ||
518
725
  zonosStore.onlineStoreSettings.url,
519
726
  },
520
727
  });
@@ -563,7 +770,7 @@ export class ZonosCheckout {
563
770
  return;
564
771
  }
565
772
  log('shipping data from createCartId result', 'info', Object.entries(prefillAddress));
566
- const { customerAddress1, customerAddress2, customerCity, customerCountry, customerEmail, customerName, customerPhone, customerState, customerZip, } = prefillAddress;
773
+ const { customerAddress1, customerAddress2, customerCity, customerCountry, customerEmail, customerFirstName, customerLastName, customerName, customerPhone, customerState, customerZip, } = prefillAddress;
567
774
  const urlParams = new URLSearchParams(window.location.search);
568
775
  const country = // fallback to selected country code if country is not provided
569
776
  customerCountry ||
@@ -575,6 +782,8 @@ export class ZonosCheckout {
575
782
  customerCity,
576
783
  customerCountry: country,
577
784
  customerEmail,
785
+ customerFirstName,
786
+ customerLastName,
578
787
  customerName,
579
788
  customerPhone,
580
789
  customerState,
@@ -623,7 +832,9 @@ export class ZonosCheckout {
623
832
  const line2 = address.customerAddress2 || '';
624
833
  const city = address.customerCity || '';
625
834
  const email = address.customerEmail || '';
626
- const name = address.customerName || '';
835
+ const name = address.customerFirstName && address.customerLastName
836
+ ? `${address.customerFirstName} ${address.customerLastName}`
837
+ : address.customerName || '';
627
838
  const phone = address.customerPhone || '';
628
839
  const postal_code = address.customerZip || '';
629
840
  const state = address.customerState || '';
@@ -774,7 +985,7 @@ export class ZonosCheckout {
774
985
  async handleCustomerInfoContinue() {
775
986
  // submit google tag when the form is complete
776
987
  submitGtag('zonos-checkout-customer-info');
777
- const checkoutSessionId = cartStore.checkoutSessionId;
988
+ const checkoutSessionId = storageStore.checkoutSessionId;
778
989
  void trackConversionEvent({
779
990
  checkoutSessionId,
780
991
  eventName: 'checkout_customerInfoCompleted',
@@ -1044,13 +1255,20 @@ export class ZonosCheckout {
1044
1255
  this.isMobile = isCheckoutMobile(this.mobile);
1045
1256
  this.isIframed = window.self !== window.top;
1046
1257
  log(`iframed: ${this.isIframed}`);
1258
+ // Set checkout session if redirect
1259
+ if (window.Zonos.isLegacyCheckout) {
1260
+ this.captureParamsRedirectedForVariantTest();
1261
+ }
1047
1262
  // update theme to browser preference theme if appearance theme is system
1048
1263
  this.handleAppearanceSettingsOverrideChange();
1049
1264
  // listen to selected locale code change
1050
- this.onChangeLocaleListener = localizationStoreOnUpdate('selectedLocale', () => {
1265
+ this.onChangeLocaleListener = localizationStoreOnChange('selectedLocale', () => {
1051
1266
  // Update stripe locale when selected country code is changed
1052
1267
  void this.applyStripeTheme();
1053
1268
  });
1269
+ // Initialize test keys
1270
+ this.initializeTestKeys();
1271
+ window.addEventListener('message', this.handleHostedOpenWindowCallback);
1054
1272
  log(`mobile: ${this.isMobile}`);
1055
1273
  }
1056
1274
  // do clean up when component is unmounted
@@ -1061,6 +1279,7 @@ export class ZonosCheckout {
1061
1279
  cartStoreReset();
1062
1280
  // cleanup onChange listener
1063
1281
  this.onChangeLocaleListener();
1282
+ window.removeEventListener('message', this.handleHostedOpenWindowCallback);
1064
1283
  }
1065
1284
  render() {
1066
1285
  var _a, _b, _c, _d;
@@ -1197,7 +1416,7 @@ export class ZonosCheckout {
1197
1416
  // If dialog is in open state, the message should not be null
1198
1417
  dialogSubtitle: translate('You are being sent back to the shop to re-add items to your cart.'), dialogTitle: translate('Shopping cart expired'), dialogType: "alert",
1199
1418
  // Mark user selected confirm to close the dialog
1200
- onConfirmClicked: () => this.handleCartExpiredDialogConfirm() })));
1419
+ onConfirmClicked: () => this.handleCartExpiredDialogConfirm() }), h("zonos-loading-overlay", { open: this.isOverlayLoading })));
1201
1420
  }
1202
1421
  static get is() { return "zonos-checkout"; }
1203
1422
  static get encapsulation() { return "scoped"; }
@@ -1372,6 +1591,7 @@ export class ZonosCheckout {
1372
1591
  "defaultCustomerProfileAddress": {},
1373
1592
  "customerProfile": {},
1374
1593
  "open": {},
1594
+ "isOverlayLoading": {},
1375
1595
  "stripe": {},
1376
1596
  "submitLoading": {},
1377
1597
  "collapseReviewMobile": {},
@@ -1461,7 +1681,7 @@ export class ZonosCheckout {
1461
1681
  "signature": "(session: CheckoutSessionDetailsFragment) => Promise<void>",
1462
1682
  "parameters": [{
1463
1683
  "name": "session",
1464
- "type": "{ cartId: string | null; clientSecret: string; customerProfile: { email: string | null; locations: { administrativeArea: string; countryCode: CountryCode; email: string | null; line1: string; line2: string | null; locality: string; name: string | null; phone: string | null; postalCode: string; }[] | null; name: string | null; } | null; customerSessionClientSecret: string | null; id: string; landedCost: { amountSubtotals: { discounts: number | null; duties: number; fees: number; items: number; landedCostTotal: number; shipping: number; taxes: number; } | null; id: string; landedCostGuaranteeCode: LandedCostGuaranteeCode; method: IncotermCode; shipmentRating: { displayName: string; }; } | null; metadata: ({ key: string; value: string; } | null)[] | null; organizationId: string; subtotals: { adjustments: number; duties: number; exchangeRate: { id: string; rate: number; sourceCurrencyCode: CurrencyCode; targetCurrencyCode: CurrencyCode; type: ExchangeRateType; }; fees: number; items: number; landedCostTotal: number; presentmentCurrencyCode: CurrencyCode; shipping: number; taxes: number; total: number; }; }",
1684
+ "type": "{ cartId: string | null; clientSecret: string; customerProfile: { email: string | null; locations: { administrativeArea: string; countryCode: CountryCode; email: string | null; line1: string; line2: string | null; locality: string; name: string | null; phone: string | null; postalCode: string; }[] | null; name: string | null; } | null; customerSessionClientSecret: string | null; id: string; landedCost: { amountSubtotals: { discounts: number | null; duties: number; fees: number; items: number; landedCostTotal: number; shipping: number; taxes: number; } | null; id: string; landedCostGuaranteeCode: LandedCostGuaranteeCode; method: IncotermCode; shipmentRating: { displayName: string; }; } | null; metadata: ({ key: string; value: string; } | null)[] | null; organizationId: string; subtotals: { adjustments: number; duties: number; exchangeRate: { id: string; rate: number; sourceCurrencyCode: CurrencyCode; targetCurrencyCode: CurrencyCode; type: ExchangeRateType; }; fees: number; items: number; landedCostTotal: number; presentmentCurrencyCode: CurrencyCode; shipping: number; taxes: number; total: number; }; varianceTestResults: { selectedVariantKey: string; testKey: string; }[] | null; }",
1465
1685
  "docs": ""
1466
1686
  }],
1467
1687
  "references": {
@@ -1,7 +1,7 @@
1
1
  import { h, Host, } from "@stencil/core";
2
- import { cartStore } from "../../../store/checkout/cart";
3
2
  import { stripeStore, stripeStoreTranslateAddressToLatin, } from "../../../store/checkout/stripe";
4
3
  import { localizationStore } from "../../../store/hello/localization";
4
+ import { storageStore } from "../../../store/storageStore";
5
5
  import { translate } from "../../../store/translationStore";
6
6
  import { getZonosStoreTheme, zonosStore, } from "../../../store/zonosStore";
7
7
  import { containsNonLatinChars } from "../../../utils/containsNonLatinChars";
@@ -218,11 +218,11 @@ export class ZonosCustomerInfo {
218
218
  !!((_b = (_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.countryCustomAddressEnabled) === null || _b === void 0 ? void 0 : _b.includes(localizationStore.selectedCountryCode));
219
219
  // Should only record the form type used once
220
220
  if (type === 'shipping' &&
221
- cartStore.checkoutSessionId &&
221
+ storageStore.checkoutSessionId &&
222
222
  !this.recordedFormTypeUsed) {
223
223
  void handleFetch('/api/zonos-elements/update-checkout-session-metadata', {
224
224
  body: {
225
- id: cartStore.checkoutSessionId,
225
+ id: storageStore.checkoutSessionId,
226
226
  metadata: [
227
227
  {
228
228
  key: 'ZONOS_FORM_TYPE_USING',
@@ -1,6 +1,7 @@
1
1
  import { Fragment, h, Host, } from "@stencil/core";
2
2
  import { cartStore, cartStoreGetShippingTransitInfo, cartStoreUpdateSelectedShippingOption, } from "../../../store/checkout/cart";
3
3
  import { stripeStore } from "../../../store/checkout/stripe";
4
+ import { storageStore } from "../../../store/storageStore";
4
5
  import { translate } from "../../../store/translationStore";
5
6
  import { trackConversionEvent } from "../../../utils/api/trackConversionEvent";
6
7
  import { renderCheckoutCurrency } from "../../../utils/checkout/renderCheckoutCurrency";
@@ -52,7 +53,7 @@ export class ZonosShipping {
52
53
  }
53
54
  // submit google tag when the form is complete
54
55
  submitGtag('zonos-checkout-shipping-info');
55
- const checkoutSessionId = cartStore.checkoutSessionId;
56
+ const checkoutSessionId = storageStore.checkoutSessionId;
56
57
  void trackConversionEvent({
57
58
  checkoutSessionId,
58
59
  eventName: 'checkout_shippingInfoCompleted',
@@ -0,0 +1,62 @@
1
+ :host {
2
+ font-family: var(--zonos--font-family, Inter), Inter;
3
+ display: block;
4
+ white-space: normal;
5
+ }
6
+ :host * {
7
+ font-family: var(--zonos--font-family, Inter), Inter;
8
+ }
9
+ :host img {
10
+ max-width: 100%;
11
+ }
12
+ :host dl,
13
+ :host dd,
14
+ :host h1,
15
+ :host h2,
16
+ :host h3,
17
+ :host h4,
18
+ :host h5,
19
+ :host h6,
20
+ :host hr,
21
+ :host figure,
22
+ :host p,
23
+ :host pre {
24
+ margin: 0;
25
+ }
26
+
27
+ /* All sets of variable are here */
28
+ /* smooth font rendering */
29
+ :host {
30
+ -moz-osx-font-smoothing: grayscale;
31
+ -webkit-font-smoothing: antialiased;
32
+ }
33
+
34
+ :host {
35
+ position: fixed;
36
+ inset: 0;
37
+ z-index: 2147483010;
38
+ pointer-events: none;
39
+ display: block;
40
+ }
41
+ :host .zonos--loading-overlay {
42
+ position: fixed;
43
+ inset: 0;
44
+ width: 100vw;
45
+ height: 100vh;
46
+ background: var(--zonos-elements-backdrop-color);
47
+ display: flex;
48
+ align-items: center;
49
+ justify-content: center;
50
+ opacity: 0;
51
+ visibility: hidden;
52
+ transition: opacity 0.3s ease, visibility 0.3s ease;
53
+ z-index: 2147483010;
54
+ }
55
+
56
+ :host(.zonos--open) {
57
+ pointer-events: auto;
58
+ }
59
+ :host(.zonos--open) .zonos--loading-overlay {
60
+ opacity: 0.65;
61
+ visibility: visible;
62
+ }
@@ -0,0 +1,90 @@
1
+ import { h, Host } from "@stencil/core";
2
+ import { classes } from "../../utils/classes";
3
+ export class ZonosLoadingOverlay {
4
+ constructor() {
5
+ this.open = false;
6
+ this.spinnerColor = undefined;
7
+ this.size = 40;
8
+ }
9
+ render() {
10
+ return (h(Host, { key: 'eff20c3fe4c4a998748ac07567cc5449efc398cd', class: classes(['zonos--elements', this.open && 'zonos--open']) }, h("div", { key: '1b37bfc1a150720e0f4f84075ac661e5395aee3b', class: "zonos--loading-overlay" }, h("zonos-spinner", { key: '42ac91e723802b23897b6e5cd99e0aea7d964da5', size: this.size, spinnerColor: this.spinnerColor }))));
11
+ }
12
+ static get is() { return "zonos-loading-overlay"; }
13
+ static get encapsulation() { return "shadow"; }
14
+ static get originalStyleUrls() {
15
+ return {
16
+ "$": ["zonos-loading-overlay.scss"]
17
+ };
18
+ }
19
+ static get styleUrls() {
20
+ return {
21
+ "$": ["zonos-loading-overlay.css"]
22
+ };
23
+ }
24
+ static get properties() {
25
+ return {
26
+ "open": {
27
+ "type": "boolean",
28
+ "mutable": false,
29
+ "complexType": {
30
+ "original": "boolean",
31
+ "resolved": "boolean",
32
+ "references": {}
33
+ },
34
+ "required": false,
35
+ "optional": false,
36
+ "docs": {
37
+ "tags": [{
38
+ "name": "default",
39
+ "text": "false"
40
+ }],
41
+ "text": "Whether or not the overlay is open"
42
+ },
43
+ "getter": false,
44
+ "setter": false,
45
+ "attribute": "open",
46
+ "reflect": false,
47
+ "defaultValue": "false"
48
+ },
49
+ "spinnerColor": {
50
+ "type": "string",
51
+ "mutable": false,
52
+ "complexType": {
53
+ "original": "| 'primary'\n | 'info'\n | 'success'\n | 'danger'\n | 'warning'\n | 'black'\n | 'white'",
54
+ "resolved": "\"black\" | \"danger\" | \"info\" | \"primary\" | \"success\" | \"warning\" | \"white\" | undefined",
55
+ "references": {}
56
+ },
57
+ "required": false,
58
+ "optional": true,
59
+ "docs": {
60
+ "tags": [],
61
+ "text": "Spinner color (optional)"
62
+ },
63
+ "getter": false,
64
+ "setter": false,
65
+ "attribute": "spinner-color",
66
+ "reflect": false
67
+ },
68
+ "size": {
69
+ "type": "number",
70
+ "mutable": false,
71
+ "complexType": {
72
+ "original": "number",
73
+ "resolved": "number",
74
+ "references": {}
75
+ },
76
+ "required": false,
77
+ "optional": false,
78
+ "docs": {
79
+ "tags": [],
80
+ "text": "Spinner size (optional, default 40)"
81
+ },
82
+ "getter": false,
83
+ "setter": false,
84
+ "attribute": "size",
85
+ "reflect": false,
86
+ "defaultValue": "40"
87
+ }
88
+ };
89
+ }
90
+ }
@@ -10,11 +10,11 @@ export class ZonosLogo {
10
10
  const filterColor = this.theme === 'DARK'
11
11
  ? 'invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)'
12
12
  : 'whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)';
13
- return (h(Host, { key: '00a2d8c27b70f329813b6a3c1547c82b2e7cf725', class: classes(['zonos--elements zonos--logo']), style: {
13
+ return (h(Host, { key: 'c41a277084d4880e1f452a1f7ca097ad3507059f', class: classes(['zonos--elements zonos--logo']), style: {
14
14
  '--zonos--filter-color': filterColor,
15
15
  '--zonos--font-family': zonosStoreFontFamily(),
16
16
  '--zonos--width': this.width,
17
- } }, h("img", { key: 'e994199d3178a1198a1f0a1b132fae75bef47ce7', alt: "Zonos Logo", src: getAssetPath('./assets/ZonosLogo.png') })));
17
+ } }, h("img", { key: '01361446c08074a8f8b4cac206a999e381d5d903', alt: "Zonos Logo", src: getAssetPath('./assets/ZonosLogo.png') })));
18
18
  }
19
19
  static get is() { return "zonos-logo"; }
20
20
  static get encapsulation() { return "shadow"; }