@zonos/elements 1.3.207 → 1.3.209

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 (239) hide show
  1. package/dist/cjs/{CheckoutConfig-4afc683b.js → CheckoutConfig-27c82f94.js} +19 -0
  2. package/dist/cjs/{cart-3d961c6e.js → cart-2ec8cac2.js} +285 -64
  3. package/dist/cjs/{debounce-0b9c0f8a.js → debounce-465a4328.js} +1 -1
  4. package/dist/cjs/{getBorderRadius-c424eb05.js → getBorderRadius-1b5e33cf.js} +1 -1
  5. package/dist/cjs/{handleFetch-969d05d8.js → handleFetch-05227713.js} +2 -6
  6. package/dist/cjs/index.cjs.js +29 -9
  7. package/dist/cjs/{isDarkColor-35e8daec.js → isDarkColor-428965f4.js} +1 -1
  8. package/dist/cjs/loader.cjs.js +1 -1
  9. package/dist/cjs/{localization-ff33875b.js → localization-9b43376c.js} +3 -2
  10. package/dist/cjs/{paypal-dee5c109.js → paypal-6449314e.js} +5 -5
  11. package/dist/cjs/updateCheckoutSessionAttributes-a31bb681.js +50 -0
  12. package/dist/cjs/zonos-address_11.cjs.entry.js +104 -84
  13. package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
  14. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  15. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  16. package/dist/cjs/zonos-card.cjs.entry.js +2 -2
  17. package/dist/cjs/zonos-cart-items_14.cjs.entry.js +98 -49
  18. package/dist/cjs/zonos-checkout.cjs.entry.js +87 -31
  19. package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
  20. package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
  21. package/dist/cjs/zonos-country-flag.cjs.entry.js +3 -3
  22. package/dist/cjs/zonos-country-select_4.cjs.entry.js +13 -9
  23. package/dist/cjs/zonos-elements.cjs.js +1 -1
  24. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +7 -7
  25. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
  26. package/dist/cjs/zonos-hello.cjs.entry.js +4 -4
  27. package/dist/cjs/zonos-input.cjs.entry.js +2 -2
  28. package/dist/cjs/zonos-language-select_2.cjs.entry.js +3 -3
  29. package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
  30. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
  31. package/dist/cjs/zonos-stripe-input.cjs.entry.js +3 -3
  32. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  33. package/dist/cjs/zonos-toggle.cjs.entry.js +1 -1
  34. package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
  35. package/dist/cjs/{zonosStore-7c1e1bc1.js → zonosStore-f8ee56aa.js} +1 -0
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +79 -24
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +71 -36
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +33 -11
  39. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +2 -2
  40. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +9 -5
  41. package/dist/collection/components/store/checkout/cart.js +9 -2
  42. package/dist/collection/components/store/checkout/stripe.js +266 -55
  43. package/dist/collection/components/store/hello/localization.js +1 -0
  44. package/dist/collection/components/stripe/zonos-address/zonos-address.css +2 -1
  45. package/dist/collection/components/stripe/zonos-address/zonos-address.js +24 -3
  46. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.css +2 -1
  47. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +7 -5
  48. package/dist/collection/components/utils/api/cartCalculateLandedCost.js +3 -2
  49. package/dist/collection/components/utils/api/prepCalculateLandedCost.js +2 -2
  50. package/dist/collection/components/utils/api/updateCheckoutSessionAttributes.js +46 -0
  51. package/dist/collection/components/utils/checkout/getAbandonedCartRenewTokenValue.js +17 -0
  52. package/dist/collection/components/utils/handleFetch.js +2 -1
  53. package/dist/collection/components/utils/logging/log.js +0 -5
  54. package/dist/collection/scripts/_getCartInfoById.js +3 -0
  55. package/dist/collection/types/checkout/api/CheckoutSession.js +14 -1
  56. package/dist/collection/types/checkout/api/CreateParty.js +1 -0
  57. package/dist/collection/types/generated/graphql.frontend.types.js +2 -0
  58. package/dist/collection/types/generated/graphql.internal.types.js +15 -0
  59. package/dist/collection/types/index.js +1 -0
  60. package/dist/esm/{CheckoutConfig-eb7d6954.js → CheckoutConfig-724d7bae.js} +19 -1
  61. package/dist/esm/{cart-5835676d.js → cart-2f84f632.js} +284 -65
  62. package/dist/esm/{debounce-eaee3a94.js → debounce-0e42da22.js} +1 -1
  63. package/dist/esm/{getBorderRadius-b18c924f.js → getBorderRadius-71b3b8ab.js} +1 -1
  64. package/dist/esm/{handleFetch-621e45bc.js → handleFetch-7dd4622b.js} +2 -6
  65. package/dist/esm/index.js +28 -11
  66. package/dist/esm/{isDarkColor-d8bb8659.js → isDarkColor-3a9d6108.js} +1 -1
  67. package/dist/esm/loader.js +1 -1
  68. package/dist/esm/{localization-4c7f64e8.js → localization-e17c211b.js} +3 -2
  69. package/dist/esm/{paypal-b4f106be.js → paypal-1cf701aa.js} +6 -6
  70. package/dist/esm/updateCheckoutSessionAttributes-5097e715.js +48 -0
  71. package/dist/esm/zonos-address_11.entry.js +104 -84
  72. package/dist/esm/zonos-badge.entry.js +1 -1
  73. package/dist/esm/zonos-banner.entry.js +1 -1
  74. package/dist/esm/zonos-button_3.entry.js +3 -3
  75. package/dist/esm/zonos-card.entry.js +2 -2
  76. package/dist/esm/zonos-cart-items_14.entry.js +98 -49
  77. package/dist/esm/zonos-checkout.entry.js +87 -31
  78. package/dist/esm/zonos-collapse.entry.js +1 -1
  79. package/dist/esm/zonos-controller.entry.js +6 -6
  80. package/dist/esm/zonos-country-flag.entry.js +3 -3
  81. package/dist/esm/zonos-country-select_4.entry.js +13 -9
  82. package/dist/esm/zonos-elements.js +1 -1
  83. package/dist/esm/zonos-empty-state-payment_4.entry.js +7 -7
  84. package/dist/esm/zonos-hello-dialog.entry.js +3 -3
  85. package/dist/esm/zonos-hello.entry.js +4 -4
  86. package/dist/esm/zonos-input.entry.js +2 -2
  87. package/dist/esm/zonos-language-select_2.entry.js +3 -3
  88. package/dist/esm/zonos-logo.entry.js +1 -1
  89. package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
  90. package/dist/esm/zonos-stripe-input.entry.js +3 -3
  91. package/dist/esm/zonos-text.entry.js +1 -1
  92. package/dist/esm/zonos-toggle.entry.js +1 -1
  93. package/dist/esm/zonos-v-stack.entry.js +1 -1
  94. package/dist/esm/{zonosStore-1e015fa5.js → zonosStore-00975763.js} +1 -1
  95. package/dist/esm-es5/CheckoutConfig-724d7bae.js +1 -0
  96. package/dist/esm-es5/cart-2f84f632.js +1 -0
  97. package/dist/esm-es5/{debounce-eaee3a94.js → debounce-0e42da22.js} +1 -1
  98. package/dist/esm-es5/{getBorderRadius-b18c924f.js → getBorderRadius-71b3b8ab.js} +1 -1
  99. package/dist/esm-es5/handleFetch-7dd4622b.js +1 -0
  100. package/dist/esm-es5/index.js +1 -1
  101. package/dist/esm-es5/{isDarkColor-d8bb8659.js → isDarkColor-3a9d6108.js} +1 -1
  102. package/dist/esm-es5/loader.js +1 -1
  103. package/dist/esm-es5/{localization-4c7f64e8.js → localization-e17c211b.js} +1 -1
  104. package/dist/esm-es5/{paypal-b4f106be.js → paypal-1cf701aa.js} +2 -2
  105. package/dist/esm-es5/updateCheckoutSessionAttributes-5097e715.js +1 -0
  106. package/dist/esm-es5/zonos-address_11.entry.js +1 -1
  107. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  108. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  109. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  110. package/dist/esm-es5/zonos-card.entry.js +1 -1
  111. package/dist/esm-es5/zonos-cart-items_14.entry.js +1 -1
  112. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  113. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  114. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  115. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  116. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  117. package/dist/esm-es5/zonos-elements.js +1 -1
  118. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  119. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  120. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  121. package/dist/esm-es5/zonos-input.entry.js +1 -1
  122. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  123. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  124. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  125. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  126. package/dist/esm-es5/zonos-text.entry.js +1 -1
  127. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  128. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  129. package/dist/esm-es5/{zonosStore-1e015fa5.js → zonosStore-00975763.js} +1 -1
  130. package/dist/scripts/index.d.ts +10 -0
  131. package/dist/scripts/index.js +1 -1
  132. package/dist/scripts/loadZonos.js +1 -1
  133. package/dist/scripts/zonos.js +1 -1
  134. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +2 -0
  135. package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +8 -4
  136. package/dist/types/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.d.ts +3 -0
  137. package/dist/types/components/common/zonos-country-select/zonos-country-select.d.ts +1 -0
  138. package/dist/types/components/store/checkout/cart.d.ts +6 -2
  139. package/dist/types/components/store/checkout/stripe.d.ts +33 -6
  140. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +6 -0
  141. package/dist/types/components/utils/api/updateCheckoutSessionAttributes.d.ts +7 -0
  142. package/dist/types/components/utils/checkout/getAbandonedCartRenewTokenValue.d.ts +1 -0
  143. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +1 -0
  144. package/dist/types/types/checkout/api/CheckoutSession.d.ts +16 -0
  145. package/dist/types/types/checkout/api/CreateParty.d.ts +34 -0
  146. package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +2 -0
  147. package/dist/types/types/generated/graphql.frontend.types.d.ts +2 -0
  148. package/dist/types/types/generated/graphql.frontend.types.ts +2 -0
  149. package/dist/types/types/generated/graphql.internal.types.d.ts +61 -5
  150. package/dist/types/types/generated/graphql.internal.types.ts +105 -3
  151. package/dist/types/types/index.d.ts +1 -0
  152. package/dist/types/types/utils/ZonosSettings.d.ts +6 -0
  153. package/dist/zonos-elements/index.esm.js +1 -1
  154. package/dist/zonos-elements/{p-4e9c8f9e.system.js → p-0751b878.system.js} +1 -1
  155. package/dist/zonos-elements/{p-abe218ab.system.entry.js → p-08b29f73.system.entry.js} +1 -1
  156. package/dist/zonos-elements/{p-74bcb5cc.entry.js → p-0ca1d6dd.entry.js} +1 -1
  157. package/dist/zonos-elements/{p-12cd9d3a.entry.js → p-144b5006.entry.js} +1 -1
  158. package/dist/zonos-elements/{p-9e9ac7a2.system.js → p-19182dc7.system.js} +1 -1
  159. package/dist/zonos-elements/{p-eca09508.system.entry.js → p-1dc78af3.system.entry.js} +1 -1
  160. package/dist/zonos-elements/{p-e337fa88.js → p-207bd04a.js} +1 -1
  161. package/dist/zonos-elements/p-20839c46.js +1 -0
  162. package/dist/zonos-elements/{p-1aa24297.system.entry.js → p-2122d2cc.system.entry.js} +1 -1
  163. package/dist/zonos-elements/{p-4fb88ebc.system.entry.js → p-239695e8.system.entry.js} +1 -1
  164. package/dist/zonos-elements/{p-3196bf98.entry.js → p-23fe7661.entry.js} +1 -1
  165. package/dist/zonos-elements/p-2652198d.js +1 -0
  166. package/dist/zonos-elements/p-30a9f802.system.entry.js +1 -0
  167. package/dist/zonos-elements/{p-c666d557.system.js → p-3633a952.system.js} +1 -1
  168. package/dist/zonos-elements/{p-9b8a5372.entry.js → p-36b686b6.entry.js} +1 -1
  169. package/dist/zonos-elements/{p-658936c9.js → p-371d91d1.js} +2 -2
  170. package/dist/zonos-elements/{p-019f8637.entry.js → p-3934b38a.entry.js} +1 -1
  171. package/dist/zonos-elements/p-3c752420.system.js +1 -0
  172. package/dist/zonos-elements/p-3ee44728.system.js +1 -1
  173. package/dist/zonos-elements/p-40a4c8a2.system.js +1 -0
  174. package/dist/zonos-elements/{p-91c996d3.system.js → p-44c0a584.system.js} +2 -2
  175. package/dist/zonos-elements/{p-eb2560b6.system.entry.js → p-45a2f9b1.system.entry.js} +1 -1
  176. package/dist/zonos-elements/{p-1327b935.system.js → p-4a1b4a2d.system.js} +1 -1
  177. package/dist/zonos-elements/p-4c70fd75.entry.js +1 -0
  178. package/dist/zonos-elements/{p-bab19e2a.entry.js → p-4d62f3de.entry.js} +1 -1
  179. package/dist/zonos-elements/{p-848e08e8.entry.js → p-4dbaa2c2.entry.js} +1 -1
  180. package/dist/zonos-elements/p-4ed73ff8.entry.js +1 -0
  181. package/dist/zonos-elements/{p-47e2cd31.entry.js → p-4f5513dc.entry.js} +1 -1
  182. package/dist/zonos-elements/p-542acc2c.js +1 -0
  183. package/dist/zonos-elements/p-5711e187.system.js +1 -0
  184. package/dist/zonos-elements/{p-41c1d7c4.entry.js → p-5956a9e0.entry.js} +1 -1
  185. package/dist/zonos-elements/{p-5616b304.entry.js → p-5b7686f8.entry.js} +1 -1
  186. package/dist/zonos-elements/{p-0c4c8d63.entry.js → p-63a4dac5.entry.js} +1 -1
  187. package/dist/zonos-elements/{p-f4d741de.system.entry.js → p-695bf400.system.entry.js} +1 -1
  188. package/dist/zonos-elements/{p-9fa17353.js → p-6aa728f2.js} +1 -1
  189. package/dist/zonos-elements/{p-ed20f2f7.js → p-71c6bdc3.js} +1 -1
  190. package/dist/zonos-elements/p-738a49c0.system.js +1 -0
  191. package/dist/zonos-elements/{p-469ccc66.system.entry.js → p-74276b82.system.entry.js} +1 -1
  192. package/dist/zonos-elements/{p-e0587eeb.entry.js → p-77e22be4.entry.js} +1 -1
  193. package/dist/zonos-elements/{p-3afc27ef.entry.js → p-78dd1c53.entry.js} +1 -1
  194. package/dist/zonos-elements/{p-620deb03.system.entry.js → p-7f9bbbb3.system.entry.js} +1 -1
  195. package/dist/zonos-elements/p-896f2358.system.entry.js +1 -0
  196. package/dist/zonos-elements/{p-719e14a8.system.entry.js → p-8f41d864.system.entry.js} +1 -1
  197. package/dist/zonos-elements/{p-4cb8b87f.system.entry.js → p-964e2587.system.entry.js} +1 -1
  198. package/dist/zonos-elements/{p-93aeba62.system.entry.js → p-97831744.system.entry.js} +1 -1
  199. package/dist/zonos-elements/{p-2866fd29.system.entry.js → p-9d95c896.system.entry.js} +1 -1
  200. package/dist/zonos-elements/{p-abc83d01.entry.js → p-a24870af.entry.js} +1 -1
  201. package/dist/zonos-elements/p-a411ce2a.system.js +1 -0
  202. package/dist/zonos-elements/{p-1bc09abe.system.entry.js → p-a4686344.system.entry.js} +1 -1
  203. package/dist/zonos-elements/{p-edcfb3a3.js → p-a6f77d44.js} +1 -1
  204. package/dist/zonos-elements/{p-b21b0330.entry.js → p-a8f421ac.entry.js} +1 -1
  205. package/dist/zonos-elements/{p-18149db1.entry.js → p-aa40d402.entry.js} +1 -1
  206. package/dist/zonos-elements/{p-536f69eb.entry.js → p-ad1e1dbc.entry.js} +1 -1
  207. package/dist/zonos-elements/p-b1bfeec9.system.entry.js +1 -0
  208. package/dist/zonos-elements/p-b2d81c98.js +1 -0
  209. package/dist/zonos-elements/{p-7777d85f.system.entry.js → p-baa88176.system.entry.js} +1 -1
  210. package/dist/zonos-elements/{p-1ad099ec.system.entry.js → p-bf9cb85f.system.entry.js} +1 -1
  211. package/dist/zonos-elements/p-bfdb4e7a.entry.js +1 -0
  212. package/dist/zonos-elements/{p-858b7908.system.entry.js → p-c345b306.system.entry.js} +1 -1
  213. package/dist/zonos-elements/{p-22cb6880.system.entry.js → p-d1697144.system.entry.js} +1 -1
  214. package/dist/zonos-elements/p-d1c0bf92.entry.js +1 -0
  215. package/dist/zonos-elements/{p-16678764.js → p-d6a53ea6.js} +1 -1
  216. package/dist/zonos-elements/{p-265af369.system.entry.js → p-db424e02.system.entry.js} +1 -1
  217. package/dist/zonos-elements/p-eb77c0bf.system.js +1 -0
  218. package/dist/zonos-elements/{p-30778fde.system.entry.js → p-ef1ccec6.system.entry.js} +1 -1
  219. package/dist/zonos-elements/{p-42a9557f.entry.js → p-fdf5b8f4.entry.js} +1 -1
  220. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  221. package/package.json +1 -1
  222. package/dist/esm-es5/CheckoutConfig-eb7d6954.js +0 -1
  223. package/dist/esm-es5/cart-5835676d.js +0 -1
  224. package/dist/esm-es5/handleFetch-621e45bc.js +0 -1
  225. package/dist/zonos-elements/p-0de2c731.system.js +0 -1
  226. package/dist/zonos-elements/p-0fc02cde.js +0 -1
  227. package/dist/zonos-elements/p-1b75aa35.system.js +0 -1
  228. package/dist/zonos-elements/p-3a50124e.entry.js +0 -1
  229. package/dist/zonos-elements/p-3f1a2d31.js +0 -1
  230. package/dist/zonos-elements/p-5e1b2654.system.js +0 -1
  231. package/dist/zonos-elements/p-666164d9.system.js +0 -1
  232. package/dist/zonos-elements/p-9f78b79e.entry.js +0 -1
  233. package/dist/zonos-elements/p-a2b55d11.entry.js +0 -1
  234. package/dist/zonos-elements/p-aafcd40f.system.entry.js +0 -1
  235. package/dist/zonos-elements/p-b922c441.system.js +0 -1
  236. package/dist/zonos-elements/p-ba027b70.system.entry.js +0 -1
  237. package/dist/zonos-elements/p-c4e0f49a.system.entry.js +0 -1
  238. package/dist/zonos-elements/p-dbd23bea.entry.js +0 -1
  239. package/dist/zonos-elements/p-f9664811.js +0 -1
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1c710d00.js');
6
- const zonosStore = require('./zonosStore-7c1e1bc1.js');
6
+ const zonosStore = require('./zonosStore-f8ee56aa.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const getBorderRadius = require('./getBorderRadius-c424eb05.js');
8
+ const getBorderRadius = require('./getBorderRadius-1b5e33cf.js');
9
9
  require('./VarianceTest-0cb1e118.js');
10
10
 
11
11
  const zonosCardCss = ":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 .styled-card{border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));padding:var(--spacing, 24px);text-align:left;background-color:var(--zonos--background-color);overflow:hidden}:host .styled-card hr{margin-left:calc(var(--spacing, 24px) * -1);margin-right:calc(var(--spacing, 24px) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, 24px);border-bottom:var(--zonos-elements-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);border-top:var(--zonos-elements-border);background:var(--zonos-elements-surface-color-secondary);margin-top:var(--spacing, 24px);border-bottom-left-radius:var(--zonos-elements-radius-8);border-bottom-right-radius:var(--zonos-elements-radius-8);height:var(--footerHeight)}";
@@ -3,20 +3,22 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1c710d00.js');
6
- const cart = require('./cart-3d961c6e.js');
7
- const localization = require('./localization-ff33875b.js');
6
+ const cart = require('./cart-2ec8cac2.js');
7
+ const localization = require('./localization-9b43376c.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
- const paypal = require('./paypal-dee5c109.js');
10
- const zonosStore = require('./zonosStore-7c1e1bc1.js');
11
- const handleFetch = require('./handleFetch-969d05d8.js');
9
+ const paypal = require('./paypal-6449314e.js');
10
+ const zonosStore = require('./zonosStore-f8ee56aa.js');
11
+ const handleFetch = require('./handleFetch-05227713.js');
12
12
  const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
13
- const getBorderRadius = require('./getBorderRadius-c424eb05.js');
13
+ const getBorderRadius = require('./getBorderRadius-1b5e33cf.js');
14
14
  const ILanguage = require('./ILanguage-98b04442.js');
15
- const isDarkColor = require('./isDarkColor-35e8daec.js');
15
+ const isDarkColor = require('./isDarkColor-428965f4.js');
16
16
  const isColorVariable = require('./isColorVariable-525dbfa7.js');
17
+ const updateCheckoutSessionAttributes = require('./updateCheckoutSessionAttributes-a31bb681.js');
17
18
  const shouldRenderTaxIdInput = require('./shouldRenderTaxIdInput-9b8a8de1.js');
18
19
  const TaxId = require('./TaxId-12acedde.js');
19
20
  require('./VarianceTest-0cb1e118.js');
21
+ require('./debounce-465a4328.js');
20
22
 
21
23
  const getDisplayCurrency = () => {
22
24
  var _a, _b;
@@ -2089,12 +2091,12 @@ const ZonosCheckoutProgressTabs = class {
2089
2091
  '--zonos--progress-percent': this.getTotalSuccessStep(),
2090
2092
  } }, index.h("div", { key: 'd173893ab0da684a189127ab511db90ba3a0985c', class: "zonos--tab-wrapper" }, Object.values(cart.cartStore.tabItems).map((tab, index$1) => {
2091
2093
  const isSelected = tab.value === selectedStep;
2092
- return (index.h("button", { class: classes.classes([
2094
+ return (index.h("button", { "aria-label": `Tab ${tab.label}`, class: classes.classes([
2093
2095
  'zonos--tab-item',
2094
2096
  tab.value === selectedStep && 'selected',
2095
2097
  tab.isDone && 'done',
2096
2098
  ]), disabled: !this.isTabClickable(tab.value), key: tab.value, onClick: () => this.setTabSelected(tab.value) }, index.h("div", { class: "zonos--tab-index" }, index.h("zonos-text", { class: "zonos--tab-index-label", textColor: isSelected ? contrastLabelColor : 'gray-1000', type: "label" }, index$1 + 1), index.h("zonos-icon", { class: "zonos--tab-index-done-icon", content: TabCheckmark, iconColor: isSelected ? contrastLabelColor : 'gray-1000' })), index.h("zonos-text", { textColor: isSelected ? contrastLabelColor : 'gray-1000', type: "label" }, localization.translate(tab.label))));
2097
- })), index.h("div", { key: '1e8dbcee0cc21837b030760250755fe5292bd261', class: "zonos--tab-progress" }, index.h("div", { key: 'a9250c1ca7b7a40f5b6d0bbbeca24f657471cda1', class: "zonos--progress-bar-fill" }))));
2099
+ })), index.h("div", { key: 'e424eda69e8338599446f71f407c76617d2b79cf', class: "zonos--tab-progress" }, index.h("div", { key: 'acccc44ce950da71c8c0ee0798dc2086d9656ed2', class: "zonos--progress-bar-fill" }))));
2098
2100
  }
2099
2101
  static get assetsDirs() { return ["assets"]; }
2100
2102
  get ele() { return index.getElement(this); }
@@ -2348,6 +2350,7 @@ const ZonosCustomerInfo = class {
2348
2350
  index.registerInstance(this, hostRef);
2349
2351
  this.continueClicked = index.createEvent(this, "continueClicked", 7);
2350
2352
  this.testContinueClicked = index.createEvent(this, "testContinueClicked", 7);
2353
+ this.storeUnsubscribeList = [];
2351
2354
  /**
2352
2355
  * Whether or not the continue button is loading
2353
2356
  */
@@ -2390,10 +2393,6 @@ const ZonosCustomerInfo = class {
2390
2393
  * Handler for the dialog close button
2391
2394
  */
2392
2395
  this.openAddressValidationDialog = false;
2393
- /**
2394
- * Whether or not the custom address form is enabled
2395
- */
2396
- this.shouldEnabledCustomAddress = false;
2397
2396
  /**
2398
2397
  * Handler for the email error state
2399
2398
  */
@@ -2402,6 +2401,9 @@ const ZonosCustomerInfo = class {
2402
2401
  * Whether or not the custom address form is used
2403
2402
  */
2404
2403
  this.recordedFormTypeUsed = false;
2404
+ this.selectedCountryCode = localization.localizationStore.selectedCountryCode;
2405
+ this.genericSettings = zonosStore.zonosStore.genericSettings;
2406
+ this.addressFormRenderType = cart.cartStore.addressFormRenderType;
2405
2407
  /**
2406
2408
  * Handler for invalid characters in the address
2407
2409
  */
@@ -2521,7 +2523,7 @@ const ZonosCustomerInfo = class {
2521
2523
  };
2522
2524
  };
2523
2525
  this.handleValidate = () => {
2524
- var _a, _b, _c, _d;
2526
+ var _a, _b;
2525
2527
  const stripeShippingAddressEventData = cart.stripeStore.stripeAddressEventData;
2526
2528
  const stripeBillingAddressEventData = cart.stripeStore.stripeBillingAddressEventData;
2527
2529
  const stripeLinkEventData = cart.stripeStore.stripeLinkEventData;
@@ -2535,11 +2537,11 @@ const ZonosCustomerInfo = class {
2535
2537
  void ((_a = cart.stripeStore.stripeAddressElement) === null || _a === void 0 ? void 0 : _a.getValue());
2536
2538
  void ((_b = cart.stripeStore.stripeBillingAddressElement) === null || _b === void 0 ? void 0 : _b.getValue());
2537
2539
  // if the custom address form is enabled, use the custom address form validation result, otherwise use the stripe validation result
2538
- const isValidBilling = ((_c = zonosStore.zonosStore.genericSettings) === null || _c === void 0 ? void 0 : _c.shouldEnabledCustomAddress)
2540
+ const isValidBilling = this.addressFormRenderType === 'zonos'
2539
2541
  ? this.validateCustomAddressForm('billing').isValid
2540
2542
  : isValidStripeBilling;
2541
2543
  // if the custom address form is enabled, use the custom address form validation result, otherwise use the stripe validation result
2542
- const isValidShipping = ((_d = zonosStore.zonosStore.genericSettings) === null || _d === void 0 ? void 0 : _d.shouldEnabledCustomAddress)
2544
+ const isValidShipping = this.addressFormRenderType === 'zonos'
2543
2545
  ? this.validateCustomAddressForm('shipping').isValid
2544
2546
  : isValidStripeShipping;
2545
2547
  if (!isValidLink && (stripeLinkEventData === null || stripeLinkEventData === void 0 ? void 0 : stripeLinkEventData.empty)) {
@@ -2591,8 +2593,7 @@ const ZonosCustomerInfo = class {
2591
2593
  };
2592
2594
  };
2593
2595
  this.renderAddressComponent = (type) => {
2594
- var _a, _b;
2595
- if (!localization.localizationStore.selectedCountryCode) {
2596
+ if (!this.selectedCountryCode) {
2596
2597
  void handleFetch.sendErrorLog({
2597
2598
  endpoint: 'NO_COUNTRY_SELECTED_WHEN_RENDERING_ADDRESS_COMPONENT',
2598
2599
  errors: ['No country selected when rendering address component'],
@@ -2604,29 +2605,23 @@ const ZonosCustomerInfo = class {
2604
2605
  }
2605
2606
  // Only use the default address for shipping address
2606
2607
  const defaultAddress = type === 'shipping' ? this.defaultAddress : [];
2607
- const shouldUseCustomAddressForm = !!localization.localizationStore.selectedCountryCode &&
2608
- this.shouldEnabledCustomAddress &&
2609
- !!((_b = (_a = zonosStore.zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.countryCustomAddressEnabled) === null || _b === void 0 ? void 0 : _b.includes(localization.localizationStore.selectedCountryCode));
2610
2608
  // Should only record the form type used once
2611
2609
  if (type === 'shipping' &&
2612
2610
  localization.storageStore.checkoutSessionId &&
2613
2611
  !this.recordedFormTypeUsed) {
2614
- void handleFetch.handleFetch('/api/zonos-elements/update-checkout-session-metadata', {
2615
- body: {
2616
- id: localization.storageStore.checkoutSessionId,
2617
- metadata: [
2618
- {
2619
- key: 'ZONOS_FORM_TYPE_USING',
2620
- value: shouldUseCustomAddressForm ? 'custom' : 'stripe',
2621
- },
2622
- ],
2623
- },
2624
- method: 'POST',
2612
+ void updateCheckoutSessionAttributes.updateCheckoutSessionAttributes({
2613
+ attributes: [
2614
+ {
2615
+ key: 'ZONOS_FORM_TYPE_USING',
2616
+ value: this.addressFormRenderType === 'zonos' ? 'custom' : 'stripe',
2617
+ },
2618
+ ],
2619
+ checkoutSessionId: localization.storageStore.checkoutSessionId,
2625
2620
  });
2626
2621
  this.recordedFormTypeUsed = true;
2627
2622
  }
2628
2623
  // Render custom address component if the custom address form is enabled
2629
- if (shouldUseCustomAddressForm) {
2624
+ if (this.addressFormRenderType === 'zonos') {
2630
2625
  return (index.h("zonos-custom-address", { defaultAddress: defaultAddress, taxIdErrorMessage: this.taxIdErrorMessage, titleText: localization.translate(type === 'shipping' ? 'Shipping address' : 'Billing address'), type: type }));
2631
2626
  }
2632
2627
  // Render Stripe address component by default
@@ -2664,8 +2659,41 @@ const ZonosCustomerInfo = class {
2664
2659
  }
2665
2660
  return invalidList;
2666
2661
  }
2662
+ watchShouldEnabledCustomAddress() {
2663
+ var _a, _b, _c;
2664
+ const shouldEnabledCustomAddress = this.shouldUseCustomAddressFormOverride ||
2665
+ !!((_a = this.genericSettings) === null || _a === void 0 ? void 0 : _a.shouldEnabledCustomAddress);
2666
+ const shouldUseCustomAddressForm = !!this.selectedCountryCode &&
2667
+ shouldEnabledCustomAddress &&
2668
+ !!((_c = (_b = this.genericSettings) === null || _b === void 0 ? void 0 : _b.countryCustomAddressEnabled) === null || _c === void 0 ? void 0 : _c.includes(this.selectedCountryCode));
2669
+ // Update the address form render type in the cart store
2670
+ cart.cartStore.addressFormRenderType = shouldUseCustomAddressForm
2671
+ ? 'zonos'
2672
+ : 'stripe';
2673
+ }
2674
+ disconnectedCallback() {
2675
+ // unsubscribe from store subscriptions
2676
+ try {
2677
+ this.storeUnsubscribeList.forEach(subscription => subscription());
2678
+ }
2679
+ catch (_a) { }
2680
+ }
2681
+ componentWillLoad() {
2682
+ this.watchShouldEnabledCustomAddress();
2683
+ this.storeUnsubscribeList = [
2684
+ zonosStore.zonosStoreOnChange('genericSettings', () => {
2685
+ this.genericSettings = zonosStore.zonosStore.genericSettings;
2686
+ }),
2687
+ localization.localizationStoreOnChange('selectedCountryCode', () => {
2688
+ this.selectedCountryCode = localization.localizationStore.selectedCountryCode;
2689
+ }),
2690
+ cart.cartStoreOnChange('addressFormRenderType', () => {
2691
+ this.addressFormRenderType = cart.cartStore.addressFormRenderType;
2692
+ }),
2693
+ ];
2694
+ }
2667
2695
  render() {
2668
- var _a, _b, _c, _d, _e, _f, _g;
2696
+ var _a, _b, _c, _d, _e, _f;
2669
2697
  if (!cart.stripeStore.stripeElements) {
2670
2698
  return null;
2671
2699
  }
@@ -2681,16 +2709,13 @@ const ZonosCustomerInfo = class {
2681
2709
  this.shippingCountry =
2682
2710
  cart.stripeStore.stripeAddressEventData.value.address.country;
2683
2711
  }
2684
- this.shouldEnabledCustomAddress =
2685
- this.shouldUseCustomAddressFormOverride ||
2686
- !!((_b = zonosStore.zonosStore.genericSettings) === null || _b === void 0 ? void 0 : _b.shouldEnabledCustomAddress);
2687
2712
  const showBilling = !cart.stripeStore.stripeShippingSameAsBilling;
2688
2713
  // Get theme for the update dialog, inherit from the theme, no from this component theme
2689
2714
  const theme = zonosStore.getZonosStoreTheme(zonosStore.zonosStore.appearance.theme);
2690
2715
  // Attempt to get the email from email from customer profile's locations, if not provided, just use the email from root customer profile
2691
- const defaultEmail = ((_c = this.defaultAddress.find(Boolean)) === null || _c === void 0 ? void 0 : _c.email) ||
2692
- ((_f = (_e = (_d = cart.stripeStore.customerProfile) === null || _d === void 0 ? void 0 : _d.locations) === null || _e === void 0 ? void 0 : _e.find(Boolean)) === null || _f === void 0 ? void 0 : _f.email) ||
2693
- ((_g = cart.stripeStore.customerProfile) === null || _g === void 0 ? void 0 : _g.email);
2716
+ const defaultEmail = ((_b = this.defaultAddress.find(Boolean)) === null || _b === void 0 ? void 0 : _b.email) ||
2717
+ ((_e = (_d = (_c = cart.stripeStore.customerProfile) === null || _c === void 0 ? void 0 : _c.locations) === null || _d === void 0 ? void 0 : _d.find(Boolean)) === null || _e === void 0 ? void 0 : _e.email) ||
2718
+ ((_f = cart.stripeStore.customerProfile) === null || _f === void 0 ? void 0 : _f.email);
2694
2719
  return (index.h(index.Host, { class: "zonos--customer-info zonos--elements" }, index.h("div", { class: "zonos--group" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, localization.translate('Customer information')), this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, localization.translate('Missing required fields. Make sure all fields are completed.'))), index.h("zonos-link-authentication", { defaultEmail: defaultEmail, isEmailError: this.isEmailError, onLinkAuthenticationChange: this.handleEmailValidation, titleText: localization.translate('Contact') }), this.renderAddressComponent('shipping'), index.h("zonos-checkbox", { class: "zonos--shipping-same-as-billing-cbx", isChecked: cart.stripeStore.stripeShippingSameAsBilling, label: localization.translate('Shipping address same as billing'), onCheckboxSelected: e => {
2695
2720
  cart.stripeStore.stripeShippingSameAsBilling = e.detail;
2696
2721
  } }), index.h("zonos-collapse", { collapsed: !showBilling }, this.renderAddressComponent('billing')), index.h("div", { class: "zonos--group-btn" }, index.h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, loading: this.continueLoading, onClick: () => this.continueClickHandler(), size: "lg",
@@ -2712,7 +2737,10 @@ const ZonosCustomerInfo = class {
2712
2737
  }
2713
2738
  get el() { return index.getElement(this); }
2714
2739
  static get watchers() { return {
2715
- "showErrorBanner": ["watchShowErrorBanner"]
2740
+ "showErrorBanner": ["watchShowErrorBanner"],
2741
+ "shouldUseCustomAddressFormOverride": ["watchShouldEnabledCustomAddress"],
2742
+ "genericSettings": ["watchShouldEnabledCustomAddress"],
2743
+ "selectedCountryCode": ["watchShouldEnabledCustomAddress"]
2716
2744
  }; }
2717
2745
  };
2718
2746
  ZonosCustomerInfo.style = ZonosCustomerInfoStyle0;
@@ -2857,6 +2885,7 @@ const ZonosShipping = class {
2857
2885
  constructor(hostRef) {
2858
2886
  index.registerInstance(this, hostRef);
2859
2887
  this.continueClicked = index.createEvent(this, "continueClicked", 7);
2888
+ this.storeUnsubscribeList = [];
2860
2889
  /**
2861
2890
  * Whether or not the continue button is loading
2862
2891
  */
@@ -2877,6 +2906,7 @@ const ZonosShipping = class {
2877
2906
  this.serviceLevelsOther = [];
2878
2907
  this.serviceLevelsAll = [];
2879
2908
  this.displayBaseCurrency = false;
2909
+ this.shippingData = [];
2880
2910
  this.handleRadioSelected = async (e) => {
2881
2911
  var _a;
2882
2912
  this.selectedShippingMethod = e.detail;
@@ -2888,6 +2918,8 @@ const ZonosShipping = class {
2888
2918
  return;
2889
2919
  }
2890
2920
  this.isSelecting = true;
2921
+ // update the address async if we already got landed cost data
2922
+ await cart.stripeStoreAsyncAddressUpdate();
2891
2923
  // save selected shipping option to store
2892
2924
  await cart.cartStoreUpdateSelectedShippingOption(selectedShippingOption, e.detail.landedCostId);
2893
2925
  this.isSelecting = false;
@@ -2942,6 +2974,7 @@ const ZonosShipping = class {
2942
2974
  };
2943
2975
  this.initServiceLevels = () => {
2944
2976
  var _a;
2977
+ this.collapsedDAPOptions = true;
2945
2978
  const serviceLevels = ((_a = cart.cartStore.shippingData) === null || _a === void 0 ? void 0 : _a.flatMap(item => {
2946
2979
  var _a;
2947
2980
  const transitData = cart.cartStoreGetShippingTransitInfo(item);
@@ -2999,12 +3032,14 @@ const ZonosShipping = class {
2999
3032
  }
3000
3033
  return false;
3001
3034
  };
3002
- this.preselectFirstShippingMethod = () => {
3035
+ this.preselectFirstShippingMethod = async () => {
3003
3036
  this.initServiceLevels();
3004
3037
  const selectedServiceLevel = this.serviceLevelsAll.find(item => { var _a; return item.shipmentRatingId === ((_a = cart.cartStore.selectedShippingOption) === null || _a === void 0 ? void 0 : _a.id); }) || null;
3005
3038
  if (selectedServiceLevel) {
3006
3039
  // keep the selected shipping method
3007
- this.selectedShippingMethod = selectedServiceLevel;
3040
+ void this.handleRadioSelected({
3041
+ detail: selectedServiceLevel,
3042
+ });
3008
3043
  return;
3009
3044
  }
3010
3045
  const firstServiceLevel = this.serviceLevelsAll.find(Boolean);
@@ -3016,16 +3051,30 @@ const ZonosShipping = class {
3016
3051
  }
3017
3052
  };
3018
3053
  }
3054
+ disconnectedCallback() {
3055
+ // unsubscribe from store subscriptions
3056
+ this.storeUnsubscribeList.forEach(subscription => subscription());
3057
+ }
3019
3058
  componentWillLoad() {
3020
- this.preselectFirstShippingMethod();
3059
+ void this.preselectFirstShippingMethod();
3060
+ this.storeUnsubscribeList = [
3061
+ cart.cartStoreOnChange('shippingData', () => {
3062
+ if (this.isOutdatedShippingData()) {
3063
+ // re-init service levels if the shipping data is outdated (promo code applied)
3064
+ void this.preselectFirstShippingMethod();
3065
+ }
3066
+ }),
3067
+ cart.cartStoreOnChange('landedCostData', () => {
3068
+ if (this.isOutdatedShippingData()) {
3069
+ // re-init service levels if the shipping data is outdated (promo code applied)
3070
+ void this.preselectFirstShippingMethod();
3071
+ }
3072
+ }),
3073
+ ];
3021
3074
  }
3022
3075
  render() {
3023
- if (this.isOutdatedShippingData()) {
3024
- // re-init service levels if the shipping data is outdated (promo code applied)
3025
- this.preselectFirstShippingMethod();
3026
- }
3027
3076
  // re-init service levels if the currency is toggled
3028
- else if (this.isCurrencyToggled()) {
3077
+ if (this.isCurrencyToggled()) {
3029
3078
  this.initServiceLevels();
3030
3079
  }
3031
3080
  const defaultShownServiceLevels = [
@@ -3,19 +3,21 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1c710d00.js');
6
- const cart = require('./cart-3d961c6e.js');
7
- const paypal = require('./paypal-dee5c109.js');
8
- const localization = require('./localization-ff33875b.js');
9
- const zonosStore = require('./zonosStore-7c1e1bc1.js');
10
- const handleFetch = require('./handleFetch-969d05d8.js');
6
+ const cart = require('./cart-2ec8cac2.js');
7
+ const paypal = require('./paypal-6449314e.js');
8
+ const localization = require('./localization-9b43376c.js');
9
+ const zonosStore = require('./zonosStore-f8ee56aa.js');
10
+ const handleFetch = require('./handleFetch-05227713.js');
11
+ const updateCheckoutSessionAttributes = require('./updateCheckoutSessionAttributes-a31bb681.js');
12
+ const CheckoutConfig = require('./CheckoutConfig-27c82f94.js');
11
13
  const classes = require('./classes-b7918f56.js');
12
14
  const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
13
- const getBorderRadius = require('./getBorderRadius-c424eb05.js');
14
- const isDarkColor = require('./isDarkColor-35e8daec.js');
15
+ const getBorderRadius = require('./getBorderRadius-1b5e33cf.js');
16
+ const isDarkColor = require('./isDarkColor-428965f4.js');
15
17
  const styles = require('./styles-d1e64fb9.js');
16
- const CheckoutConfig = require('./CheckoutConfig-4afc683b.js');
17
18
  const RemoveIcon = require('./RemoveIcon-081ac073.js');
18
19
  require('./VarianceTest-0cb1e118.js');
20
+ require('./debounce-465a4328.js');
19
21
 
20
22
  /**
21
23
  * Map the items from tempCart like how we do it in dgs
@@ -989,6 +991,29 @@ const ZonosCheckout = class {
989
991
  this.placedOrderInfo = existingPlacedOrderInfo;
990
992
  handleFetch.log('=== Showing order duplication confirmation', 'warn');
991
993
  }
994
+ recordCheckoutInfo() {
995
+ if (!localization.storageStore.checkoutSessionId) {
996
+ return;
997
+ }
998
+ // Record the order duplication consent so we know user did see the notification and proceed with the order duplication
999
+ void updateCheckoutSessionAttributes.updateCheckoutSessionAttributes({
1000
+ attributes: [
1001
+ {
1002
+ key: 'APP_VERSION',
1003
+ value: window.Zonos.version,
1004
+ },
1005
+ {
1006
+ key: 'APP_VERSION_NPM_INTEGRATION',
1007
+ value: window.Zonos.isNpm ? '1' : '0',
1008
+ },
1009
+ {
1010
+ key: 'LEGACY_CHECKOUT_FACADE',
1011
+ value: window.Zonos.isLegacyCheckout ? '1' : '0',
1012
+ },
1013
+ ],
1014
+ checkoutSessionId: localization.storageStore.checkoutSessionId,
1015
+ });
1016
+ }
992
1017
  confirmProceedWithOrderDuplication() {
993
1018
  // Reset the placed order info
994
1019
  this.placedOrderInfo = null;
@@ -996,17 +1021,18 @@ const ZonosCheckout = class {
996
1021
  return;
997
1022
  }
998
1023
  // Record the order duplication consent so we know user did see the notification and proceed with the order duplication
999
- void handleFetch.handleFetch('/api/zonos-elements/update-checkout-session-metadata', {
1000
- body: {
1001
- id: localization.storageStore.checkoutSessionId,
1002
- metadata: [
1003
- {
1004
- key: 'orderDuplicationConsent',
1005
- value: '1',
1006
- },
1007
- ],
1008
- },
1009
- method: 'POST',
1024
+ void updateCheckoutSessionAttributes.updateCheckoutSessionAttributes({
1025
+ attributes: [{ key: 'ORDER_DUPLICATION_CONSENT', value: '1' }],
1026
+ checkoutSessionId: localization.storageStore.checkoutSessionId,
1027
+ });
1028
+ }
1029
+ markTheSessionAsAbandonedCart() {
1030
+ if (!localization.storageStore.checkoutSessionId) {
1031
+ return;
1032
+ }
1033
+ void updateCheckoutSessionAttributes.updateCheckoutSessionAttributes({
1034
+ attributes: [{ key: 'WITH_ABANDONED_CART_TOKEN', value: '1' }],
1035
+ checkoutSessionId: localization.storageStore.checkoutSessionId,
1010
1036
  });
1011
1037
  }
1012
1038
  handleCancelOrderDuplication() {
@@ -1153,6 +1179,12 @@ const ZonosCheckout = class {
1153
1179
  const loadTime = endTime - startTime;
1154
1180
  void sendLoadNativeCheckoutLog({ loadTime });
1155
1181
  }
1182
+ this.recordCheckoutInfo();
1183
+ // update checkout session attribute to know the current cart is abandoned
1184
+ const isAbandonedCart = !!CheckoutConfig.getAbandonedCartRenewTokenValue();
1185
+ if (isAbandonedCart) {
1186
+ this.markTheSessionAsAbandonedCart();
1187
+ }
1156
1188
  }
1157
1189
  catch (err) {
1158
1190
  if (err instanceof Error) {
@@ -1439,6 +1471,7 @@ const ZonosCheckout = class {
1439
1471
  }
1440
1472
  }
1441
1473
  async handleCustomerInfoContinue() {
1474
+ var _a, _b, _c, _d;
1442
1475
  // submit google tag when the form is complete
1443
1476
  paypal.submitGtag('zonos-checkout-customer-info');
1444
1477
  const checkoutSessionId = localization.storageStore.checkoutSessionId;
@@ -1448,10 +1481,26 @@ const ZonosCheckout = class {
1448
1481
  });
1449
1482
  this.submitLoading = true;
1450
1483
  // fetch landed cost data if we not fetching.
1451
- await cart.stripeStorePrefetchLandedCost();
1452
- // keep checking landed cost data until it's ready to move to next screen
1453
- const interval = setInterval(() => {
1454
- if (cart.cartStore.landedCostData || !cart.stripeStore.isFetchingLandedCost) {
1484
+ const { isRequestNotReady } = await cart.stripeStorePrefetchLandedCost();
1485
+ // If the request is not ready at the time user click Continue, logging it out so we can investigate the issue
1486
+ if (isRequestNotReady && cart.cartStore.addressFormRenderType === 'stripe') {
1487
+ void handleFetch.sendErrorLog({
1488
+ endpoint: 'ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE',
1489
+ errors: ['Address not ready at customer info continue'],
1490
+ metadata: {
1491
+ address: (_b = (_a = cart.stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.address,
1492
+ billingAddress: (_d = (_c = cart.stripeStore.stripeBillingAddressEventData) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.address,
1493
+ cartId: window.Zonos.cartId,
1494
+ },
1495
+ });
1496
+ }
1497
+ const moveToNextStep = (interval) => {
1498
+ if (cart.cartStore.step !== 'customer-info') {
1499
+ // stop interval if the step is not customer-info
1500
+ clearInterval(interval);
1501
+ return;
1502
+ }
1503
+ if (!cart.stripeStore.isFetchingLandedCost) {
1455
1504
  if (cart.cartStore.landedCostData) {
1456
1505
  // start init paypal with the presentment currency when landed cost is fetched
1457
1506
  void paypal.paypalInitScript({
@@ -1461,17 +1510,24 @@ const ZonosCheckout = class {
1461
1510
  cart.cartStoreNextStep();
1462
1511
  }
1463
1512
  this.submitLoading = false;
1464
- clearInterval(interval);
1513
+ if (interval) {
1514
+ clearInterval(interval);
1515
+ }
1465
1516
  }
1466
- }, 500);
1517
+ };
1518
+ // Immediately move to the next step
1519
+ moveToNextStep();
1520
+ // keep checking landed cost data until it's ready to move to next screen
1521
+ const interval = setInterval(() => {
1522
+ moveToNextStep(interval);
1523
+ }, 20);
1524
+ // cleanup interval if no data is fetched after 10 seconds
1525
+ setTimeout(() => {
1526
+ clearInterval(interval);
1527
+ }, 10000);
1467
1528
  }
1468
1529
  async handleShippingContinue() {
1469
- this.submitLoading = true;
1470
- // show loading for the button for a bit
1471
- setTimeout(() => {
1472
- cart.cartStoreNextStep();
1473
- this.submitLoading = false;
1474
- }, 500);
1530
+ cart.cartStoreNextStep();
1475
1531
  }
1476
1532
  handleInventoryCheckDialogConfirm() {
1477
1533
  // reset inventory check message to close the inventory check alert
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1c710d00.js');
6
- const zonosStore = require('./zonosStore-7c1e1bc1.js');
6
+ const zonosStore = require('./zonosStore-f8ee56aa.js');
7
7
  require('./VarianceTest-0cb1e118.js');
8
8
 
9
9
  const zonosCollapseCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1c710d00.js');
6
- const cart = require('./cart-3d961c6e.js');
7
- const localization = require('./localization-ff33875b.js');
8
- const zonosStore = require('./zonosStore-7c1e1bc1.js');
6
+ const cart = require('./cart-2ec8cac2.js');
7
+ const localization = require('./localization-9b43376c.js');
8
+ const zonosStore = require('./zonosStore-f8ee56aa.js');
9
9
  const getGenericSettingsOverride = require('./getGenericSettingsOverride-c0ca32b9.js');
10
- const handleFetch = require('./handleFetch-969d05d8.js');
11
- require('./isDarkColor-35e8daec.js');
12
- require('./getBorderRadius-c424eb05.js');
10
+ const handleFetch = require('./handleFetch-05227713.js');
11
+ require('./isDarkColor-428965f4.js');
12
+ require('./getBorderRadius-1b5e33cf.js');
13
13
  require('./VarianceTest-0cb1e118.js');
14
14
 
15
15
  const getZonosSettings = async () => {
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1c710d00.js');
6
- const localization = require('./localization-ff33875b.js');
7
- const zonosStore = require('./zonosStore-7c1e1bc1.js');
6
+ const localization = require('./localization-9b43376c.js');
7
+ const zonosStore = require('./zonosStore-f8ee56aa.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
- require('./handleFetch-969d05d8.js');
9
+ require('./handleFetch-05227713.js');
10
10
  require('./VarianceTest-0cb1e118.js');
11
11
 
12
12
  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}";
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-1c710d00.js');
6
- const localization = require('./localization-ff33875b.js');
7
- const zonosStore = require('./zonosStore-7c1e1bc1.js');
6
+ const localization = require('./localization-9b43376c.js');
7
+ const zonosStore = require('./zonosStore-f8ee56aa.js');
8
8
  const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
9
- const isDarkColor = require('./isDarkColor-35e8daec.js');
9
+ const isDarkColor = require('./isDarkColor-428965f4.js');
10
10
  const ILanguage = require('./ILanguage-98b04442.js');
11
11
  const classes = require('./classes-b7918f56.js');
12
- require('./handleFetch-969d05d8.js');
12
+ require('./handleFetch-05227713.js');
13
13
  require('./VarianceTest-0cb1e118.js');
14
14
 
15
15
  /**
@@ -1841,9 +1841,9 @@ const ZonosCountrySelect = class {
1841
1841
  };
1842
1842
  }
1843
1843
  componentDidRender() {
1844
- var _a, _b;
1845
- // focus the input on render
1846
- (_b = (_a = this.ele.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('.zonos--country-filter-input')) === null || _b === void 0 ? void 0 : _b.focus();
1844
+ var _a;
1845
+ this.inputRef.autocomplete = 'off';
1846
+ (_a = this.inputRef) === null || _a === void 0 ? void 0 : _a.focus();
1847
1847
  }
1848
1848
  render() {
1849
1849
  const { helloCountryList } = localization.localizationStore;
@@ -1858,9 +1858,13 @@ const ZonosCountrySelect = class {
1858
1858
  ? fuseObject.map(country => country.item)
1859
1859
  : countries.sort((a, b) => a.displayName.localeCompare(b.displayName));
1860
1860
  const isEmpty = !filteredCountries.length;
1861
- return (index.h(index.Host, { key: '25c360767efe1c48edde5401a6c0929ceb7bd47c', class: "zonos--elements", style: {
1861
+ return (index.h(index.Host, { key: '83c9005b99e1dc8d3b4a4d50e6edbed0f17ce6e0', class: "zonos--elements", style: {
1862
1862
  '--zonos--font-family': zonosStore.zonosStoreFontFamily(),
1863
- } }, index.h("div", { key: 'ee63b18e0504ffe1d6a6a50fdfea00e8cf808211', class: "zonos--country-select" }, index.h("zonos-v-stack", { key: '448a30acc483e5b945435a5650c222180a3159d4', class: "zonos--country-select-header", spacing: 8 }, index.h("zonos-select-dialog-header", { key: 'f4ed039f14059db21ad325372f300e742191588c', handleOnClose: () => this.handleOnClose(), label: localization.translate('Select a country') }, index.h("input", { key: '40f772868810c96b27dfa8bab56a01d5c9385599', autocomplete: "off", autofocus: "autofocus", class: "zonos--country-select-input", onInput: this.handleInputChange, placeholder: localization.translate('Search countries'), value: this.inputValue }))), index.h("div", { key: 'f752f5426257f0538041597e2a76f92c6754835f', class: "zonos--country-select-content" }, isEmpty && (index.h("zonos-text", { key: 'febbe41e09b452430e1a03d33732c9cc3710701b', class: "no-country", textColor: "gray-800" }, localization.translate('No countries found'))), index.h("zonos-virtual-scroll", { key: 'afec99a75a3a0cd3450a539154670508aed8c57e', class: "zonos--country-filter-content", fallbackItemHeight: 34, itemHeights: filteredCountries.map(() => 34), renderItem: index$1 => {
1863
+ } }, index.h("div", { key: '173d6c9d1808e80cdcb808b6418a9e3928e6a971', class: "zonos--country-select" }, index.h("zonos-v-stack", { key: '47118836d03e8505f9bd87e795387ea19cf67843', class: "zonos--country-select-header", spacing: 8 }, index.h("zonos-select-dialog-header", { key: 'c5be83953dd01e47dbe814cbe83a114d700de830', handleOnClose: () => this.handleOnClose(), label: localization.translate('Select a country') }, index.h("input", { key: '2afe5eed1f156b8923a10564cf2b96d2cd6eb9bb', autoComplete: "off", class: "zonos--country-select-input", onInput: this.handleInputChange, placeholder: localization.translate('Search countries'), ref: el => {
1864
+ if (el) {
1865
+ this.inputRef = el;
1866
+ }
1867
+ }, type: "text", value: this.inputValue }))), index.h("div", { key: '4d64a4d3c08292ae1f574973c09aa9ec42b48c37', class: "zonos--country-select-content" }, isEmpty && (index.h("zonos-text", { key: 'dc30685daa60063cb9e6c6e7730f54cc5a25249b', class: "no-country", textColor: "gray-800" }, localization.translate('No countries found'))), index.h("zonos-virtual-scroll", { key: '69f6d39cf40abd951857542d734424623cbd7031', class: "zonos--country-filter-content", fallbackItemHeight: 34, itemHeights: filteredCountries.map(() => 34), renderItem: index$1 => {
1864
1868
  const country = filteredCountries[index$1];
1865
1869
  if (!country) {
1866
1870
  return null;