@zonos/elements 1.3.11-alpha.1 → 1.3.11-alpha.3

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 (265) hide show
  1. package/dist/cjs/{cart-d9e9ecfc.js → cart-fcddc0e6.js} +71 -8
  2. package/dist/cjs/{getBorderRadius-9d619bf6.js → getBorderRadius-4fa738c3.js} +1 -1
  3. package/dist/cjs/{getContrastColor-af2386af.js → getContrastColor-c72796c6.js} +1 -1
  4. package/dist/cjs/{isDarkColor-a68274cf.js → isDarkColor-7faf0a82.js} +1 -1
  5. package/dist/cjs/loader.cjs.js +1 -1
  6. package/dist/cjs/{submitGtag-b7ef5d5b.js → submitGtag-ec6ead54.js} +15 -2
  7. package/dist/cjs/zonos-address_4.cjs.entry.js +12 -9
  8. package/dist/cjs/zonos-badge_2.cjs.entry.js +1 -1
  9. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-button_2.cjs.entry.js +5 -5
  11. package/dist/cjs/zonos-card_2.cjs.entry.js +4 -4
  12. package/dist/cjs/zonos-cart-items_10.cjs.entry.js +19 -21
  13. package/dist/cjs/zonos-checkout.cjs.entry.js +238 -13
  14. package/dist/cjs/zonos-controller.cjs.entry.js +4 -4
  15. package/dist/cjs/zonos-country-flag.cjs.entry.js +4 -4
  16. package/dist/cjs/zonos-country-select_3.cjs.entry.js +4 -4
  17. package/dist/cjs/zonos-elements.cjs.js +1 -1
  18. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
  19. package/dist/cjs/zonos-hello.cjs.entry.js +16 -4
  20. package/dist/cjs/zonos-icon.cjs.entry.js +1 -1
  21. package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
  22. package/dist/cjs/zonos-notification.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-payment.cjs.entry.js +4 -4
  24. package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +1 -1
  25. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
  26. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  27. package/dist/cjs/{zonosStore-21334303.js → zonosStore-bd2a0c59.js} +19 -1
  28. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +4 -5
  29. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +91 -9
  30. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.css +1 -1
  31. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +1 -1
  32. package/dist/collection/components/common/zonos-button/zonos-button.js +1 -1
  33. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +5 -5
  34. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.css +1 -0
  35. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +5 -4
  36. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +5 -5
  37. package/dist/collection/components/common/zonos-icon/zonos-icon.js +2 -2
  38. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +7 -7
  39. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +17 -2
  40. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +5 -5
  41. package/dist/collection/components/store/checkout/stripe.js +8 -2
  42. package/dist/collection/components/store/translationStore/strings.arabic.js +3 -0
  43. package/dist/collection/components/store/translationStore/strings.base.js +3 -0
  44. package/dist/collection/components/store/translationStore/strings.chinese.js +3 -0
  45. package/dist/collection/components/store/translationStore/strings.danish.js +3 -0
  46. package/dist/collection/components/store/translationStore/strings.dutch.js +3 -0
  47. package/dist/collection/components/store/translationStore/strings.french.js +3 -0
  48. package/dist/collection/components/store/translationStore/strings.german.js +3 -0
  49. package/dist/collection/components/store/translationStore/strings.hebrew.js +3 -0
  50. package/dist/collection/components/store/translationStore/strings.indonesian.js +3 -0
  51. package/dist/collection/components/store/translationStore/strings.italian.js +3 -0
  52. package/dist/collection/components/store/translationStore/strings.japanese.js +3 -0
  53. package/dist/collection/components/store/translationStore/strings.korean.js +3 -0
  54. package/dist/collection/components/store/translationStore/strings.norwegian.js +3 -0
  55. package/dist/collection/components/store/translationStore/strings.polish.js +3 -0
  56. package/dist/collection/components/store/translationStore/strings.portuguese.js +3 -0
  57. package/dist/collection/components/store/translationStore/strings.russian.js +3 -0
  58. package/dist/collection/components/store/translationStore/strings.spanish.js +3 -0
  59. package/dist/collection/components/store/translationStore/strings.swedish.js +3 -0
  60. package/dist/collection/components/store/translationStore/strings.turkish.js +3 -0
  61. package/dist/collection/components/store/translationStore/strings.vietnamese.js +3 -0
  62. package/dist/collection/components/store/zonosStore.js +19 -2
  63. package/dist/collection/components/stripe/zonos-address/zonos-address.js +5 -2
  64. package/dist/collection/components/utils/api/buildCartItemsByTempCart.js +24 -0
  65. package/dist/collection/components/utils/api/tempCartItem/getAttributes.js +66 -0
  66. package/dist/collection/components/utils/api/tempCartItem/getMeasurements.js +58 -0
  67. package/dist/collection/components/utils/api/trackConversionEvent.js +2 -0
  68. package/dist/collection/components/utils/checkout/isShippableCountry.js +2 -0
  69. package/dist/collection/components/utils/createCustomEvent.js +9 -0
  70. package/dist/collection/scripts/zonosBase.js +1 -0
  71. package/dist/collection/styles/stripe/addressRuleStyle.js +0 -3
  72. package/dist/collection/types/checkout/api/TempCart.js +1 -0
  73. package/dist/collection/types/generated/graphql.customer.types.js +73 -0
  74. package/dist/components/stripe.js +68 -5
  75. package/dist/components/trackConversionEvent.js +2 -0
  76. package/dist/components/zonos-address2.js +5 -2
  77. package/dist/components/zonos-button2.js +1 -1
  78. package/dist/components/zonos-checkbox2.js +3 -3
  79. package/dist/components/zonos-checkout-finish2.js +14 -6
  80. package/dist/components/zonos-checkout-progress-tabs2.js +6 -6
  81. package/dist/components/zonos-checkout.js +238 -11
  82. package/dist/components/zonos-dialog2.js +3 -3
  83. package/dist/components/zonos-hello-dialog2.js +1 -1
  84. package/dist/components/zonos-hello.js +16 -2
  85. package/dist/components/zonos-review2.js +1 -1
  86. package/dist/components/zonos-shipping-rich-radio2.js +1 -1
  87. package/dist/components/zonos-shipping2.js +1 -1
  88. package/dist/components/zonosStore.js +19 -2
  89. package/dist/esm/{cart-6cfd7560.js → cart-228e1ef7.js} +71 -8
  90. package/dist/esm/{getBorderRadius-c5fb7746.js → getBorderRadius-a89e45fb.js} +1 -1
  91. package/dist/esm/{getContrastColor-a1a6f6aa.js → getContrastColor-5fbc4746.js} +1 -1
  92. package/dist/esm/{isDarkColor-810fcaa5.js → isDarkColor-6bf71e51.js} +1 -1
  93. package/dist/esm/loader.js +1 -1
  94. package/dist/esm/{submitGtag-acca574d.js → submitGtag-c3727595.js} +15 -3
  95. package/dist/esm/zonos-address_4.entry.js +12 -9
  96. package/dist/esm/zonos-badge_2.entry.js +1 -1
  97. package/dist/esm/zonos-banner.entry.js +1 -1
  98. package/dist/esm/zonos-button_2.entry.js +5 -5
  99. package/dist/esm/zonos-card_2.entry.js +4 -4
  100. package/dist/esm/zonos-cart-items_10.entry.js +19 -21
  101. package/dist/esm/zonos-checkout.entry.js +238 -13
  102. package/dist/esm/zonos-controller.entry.js +4 -4
  103. package/dist/esm/zonos-country-flag.entry.js +4 -4
  104. package/dist/esm/zonos-country-select_3.entry.js +4 -4
  105. package/dist/esm/zonos-elements.js +1 -1
  106. package/dist/esm/zonos-hello-dialog.entry.js +5 -5
  107. package/dist/esm/zonos-hello.entry.js +16 -4
  108. package/dist/esm/zonos-icon.entry.js +1 -1
  109. package/dist/esm/zonos-logo.entry.js +1 -1
  110. package/dist/esm/zonos-notification.entry.js +1 -1
  111. package/dist/esm/zonos-payment.entry.js +4 -4
  112. package/dist/esm/zonos-select-dialog-header_2.entry.js +1 -1
  113. package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
  114. package/dist/esm/zonos-text.entry.js +1 -1
  115. package/dist/esm/{zonosStore-e5f3d4da.js → zonosStore-c4c45591.js} +19 -2
  116. package/dist/esm-es5/cart-228e1ef7.js +1 -0
  117. package/dist/esm-es5/{getBorderRadius-c5fb7746.js → getBorderRadius-a89e45fb.js} +1 -1
  118. package/dist/esm-es5/getContrastColor-5fbc4746.js +1 -0
  119. package/dist/esm-es5/{isDarkColor-810fcaa5.js → isDarkColor-6bf71e51.js} +1 -1
  120. package/dist/esm-es5/loader.js +1 -1
  121. package/dist/esm-es5/submitGtag-c3727595.js +1 -0
  122. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  123. package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
  124. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  125. package/dist/esm-es5/zonos-button_2.entry.js +1 -1
  126. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  127. package/dist/esm-es5/zonos-cart-items_10.entry.js +1 -1
  128. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  129. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  130. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  131. package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
  132. package/dist/esm-es5/zonos-elements.js +1 -1
  133. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  134. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  135. package/dist/esm-es5/zonos-icon.entry.js +1 -1
  136. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  137. package/dist/esm-es5/zonos-notification.entry.js +1 -1
  138. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  139. package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
  140. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  141. package/dist/esm-es5/zonos-text.entry.js +1 -1
  142. package/dist/esm-es5/{zonosStore-e5f3d4da.js → zonosStore-c4c45591.js} +1 -1
  143. package/dist/scripts/getTempCartById.js +1 -0
  144. package/dist/scripts/loadZonos.js +1 -1
  145. package/dist/scripts/zonos.js +1 -1
  146. package/dist/scripts/zonosBase.js +1 -1
  147. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +7 -0
  148. package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +1 -1
  149. package/dist/types/components/common/zonos-dialog/zonos-dialog.d.ts +1 -1
  150. package/dist/types/components/common/zonos-icon/zonos-icon.d.ts +1 -1
  151. package/dist/types/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.d.ts +2 -1
  152. package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +1 -0
  153. package/dist/types/components/hello/zonos-hello-dialog/zonos-hello-dialog.d.ts +2 -1
  154. package/dist/types/components/store/checkout/cart.d.ts +9 -3
  155. package/dist/types/components/store/translationStore/strings.arabic.d.ts +3 -0
  156. package/dist/types/components/store/translationStore/strings.base.d.ts +3 -0
  157. package/dist/types/components/store/translationStore/strings.chinese.d.ts +3 -0
  158. package/dist/types/components/store/translationStore/strings.danish.d.ts +3 -0
  159. package/dist/types/components/store/translationStore/strings.dutch.d.ts +3 -0
  160. package/dist/types/components/store/translationStore/strings.french.d.ts +3 -0
  161. package/dist/types/components/store/translationStore/strings.german.d.ts +3 -0
  162. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +3 -0
  163. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +3 -0
  164. package/dist/types/components/store/translationStore/strings.italian.d.ts +3 -0
  165. package/dist/types/components/store/translationStore/strings.japanese.d.ts +3 -0
  166. package/dist/types/components/store/translationStore/strings.korean.d.ts +3 -0
  167. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +3 -0
  168. package/dist/types/components/store/translationStore/strings.polish.d.ts +3 -0
  169. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +3 -0
  170. package/dist/types/components/store/translationStore/strings.russian.d.ts +3 -0
  171. package/dist/types/components/store/translationStore/strings.spanish.d.ts +3 -0
  172. package/dist/types/components/store/translationStore/strings.swedish.d.ts +3 -0
  173. package/dist/types/components/store/translationStore/strings.turkish.d.ts +3 -0
  174. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +3 -0
  175. package/dist/types/components/store/zonosStore.d.ts +11 -2
  176. package/dist/types/components/utils/api/buildCartItemsByTempCart.d.ts +7 -0
  177. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  178. package/dist/types/components/utils/api/tempCartItem/getAttributes.d.ts +11 -0
  179. package/dist/types/components/utils/api/tempCartItem/getMeasurements.d.ts +7 -0
  180. package/dist/types/components/utils/changeDeepProperty.d.ts +1 -1
  181. package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +1 -1
  182. package/dist/types/components/utils/createCustomEvent.d.ts +12 -0
  183. package/dist/types/components/utils/getBorderRadius.d.ts +1 -1
  184. package/dist/types/components/utils/handleFetch.d.ts +2 -1
  185. package/dist/types/components.d.ts +2 -4
  186. package/dist/types/scripts/zonosBase.d.ts +10 -1
  187. package/dist/types/styles/stripe/addressRuleStyle.d.ts +2 -1
  188. package/dist/types/types/checkout/CheckoutConfig.d.ts +6 -1
  189. package/dist/types/types/checkout/api/TempCart.d.ts +80 -0
  190. package/dist/types/types/generated/graphql.customer.types.d.ts +97 -0
  191. package/dist/types/types/generated/graphql.customer.types.ts +135 -1
  192. package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
  193. package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
  194. package/dist/types/types/global.d.ts +10 -0
  195. package/dist/types/types/utils/deep/IDeepKeyofAtIndex.d.ts +1 -1
  196. package/dist/zonos-elements/{p-7e00a5dc.system.entry.js → p-001518eb.system.entry.js} +1 -1
  197. package/dist/zonos-elements/p-0082c5be.system.entry.js +1 -0
  198. package/dist/zonos-elements/p-07022f11.js +1 -0
  199. package/dist/zonos-elements/{p-ff17c03b.entry.js → p-11f1b5fb.entry.js} +1 -1
  200. package/dist/zonos-elements/{p-0b51de7b.system.entry.js → p-145dd34a.system.entry.js} +1 -1
  201. package/dist/zonos-elements/{p-65a877e2.entry.js → p-14a2824f.entry.js} +1 -1
  202. package/dist/zonos-elements/{p-f8b03017.system.entry.js → p-15cd4a76.system.entry.js} +1 -1
  203. package/dist/zonos-elements/{p-c4862aab.system.entry.js → p-160cdf4e.system.entry.js} +1 -1
  204. package/dist/zonos-elements/{p-b1ee44c6.system.js → p-167b3369.system.js} +1 -1
  205. package/dist/zonos-elements/{p-59595553.entry.js → p-171eb334.entry.js} +1 -1
  206. package/dist/zonos-elements/{p-e74f27da.js → p-1bbdfae5.js} +1 -1
  207. package/dist/zonos-elements/{p-22db99c9.system.entry.js → p-1d833f22.system.entry.js} +1 -1
  208. package/dist/zonos-elements/{p-b9cde0c3.entry.js → p-215cd7ec.entry.js} +1 -1
  209. package/dist/zonos-elements/{p-6a80f7f5.entry.js → p-223d72d8.entry.js} +1 -1
  210. package/dist/zonos-elements/{p-817e7f8e.entry.js → p-30cd191f.entry.js} +1 -1
  211. package/dist/zonos-elements/{p-824b8708.system.entry.js → p-35c328ba.system.entry.js} +1 -1
  212. package/dist/zonos-elements/p-397d8268.entry.js +1 -0
  213. package/dist/zonos-elements/{p-6db032ee.system.js → p-41c2b1c5.system.js} +1 -1
  214. package/dist/zonos-elements/{p-6dc606c6.entry.js → p-4515ec7b.entry.js} +1 -1
  215. package/dist/zonos-elements/{p-ac7155d7.entry.js → p-470284a3.entry.js} +1 -1
  216. package/dist/zonos-elements/{p-fd8c50e8.system.entry.js → p-499d7f5d.system.entry.js} +1 -1
  217. package/dist/zonos-elements/{p-b76909ab.entry.js → p-4c9367f1.entry.js} +1 -1
  218. package/dist/zonos-elements/{p-9a2c3874.system.entry.js → p-4d7b27af.system.entry.js} +1 -1
  219. package/dist/zonos-elements/{p-60ac5342.system.entry.js → p-55940b5a.system.entry.js} +1 -1
  220. package/dist/zonos-elements/{p-a641dfcd.entry.js → p-5d5c0fbf.entry.js} +1 -1
  221. package/dist/zonos-elements/{p-fac20c60.system.entry.js → p-5f6f0581.system.entry.js} +1 -1
  222. package/dist/zonos-elements/p-6484bf31.system.js +1 -0
  223. package/dist/zonos-elements/{p-b2c48954.system.entry.js → p-67ff446b.system.entry.js} +1 -1
  224. package/dist/zonos-elements/{p-212992ec.system.entry.js → p-6c5c5377.system.entry.js} +1 -1
  225. package/dist/zonos-elements/p-6e81adba.system.js +1 -1
  226. package/dist/zonos-elements/{p-ff962844.entry.js → p-72c6bf0f.entry.js} +1 -1
  227. package/dist/zonos-elements/p-7575a42a.js +1 -0
  228. package/dist/zonos-elements/p-770e5b9e.js +1 -0
  229. package/dist/zonos-elements/{p-a398bc59.system.entry.js → p-7ff3a533.system.entry.js} +1 -1
  230. package/dist/zonos-elements/{p-0f414d6a.system.js → p-86034f1e.system.js} +1 -1
  231. package/dist/zonos-elements/{p-6daa64bf.entry.js → p-925ae524.entry.js} +1 -1
  232. package/dist/zonos-elements/p-93dafeea.system.entry.js +1 -0
  233. package/dist/zonos-elements/{p-ed4d8d71.system.js → p-94bbf247.system.js} +1 -1
  234. package/dist/zonos-elements/p-960e4021.system.js +1 -0
  235. package/dist/zonos-elements/{p-a1a477c9.js → p-9a90fb56.js} +1 -1
  236. package/dist/zonos-elements/{p-d96f8d89.system.entry.js → p-a144d26a.system.entry.js} +1 -1
  237. package/dist/zonos-elements/p-ac5aecca.entry.js +1 -0
  238. package/dist/zonos-elements/p-c815e8b4.system.entry.js +1 -0
  239. package/dist/zonos-elements/p-d11b2449.js +1 -0
  240. package/dist/zonos-elements/{p-26aee7a0.entry.js → p-d31e5fcc.entry.js} +1 -1
  241. package/dist/zonos-elements/p-db1adc42.entry.js +1 -0
  242. package/dist/zonos-elements/{p-b0e9226a.entry.js → p-e3de496a.entry.js} +1 -1
  243. package/dist/zonos-elements/p-e5b5cbfd.system.entry.js +1 -0
  244. package/dist/zonos-elements/{p-51c32b3d.entry.js → p-f1037168.entry.js} +1 -1
  245. package/dist/zonos-elements/{p-2d5a6a7f.system.entry.js → p-f42bffad.system.entry.js} +1 -1
  246. package/dist/zonos-elements/p-fe8de89b.entry.js +1 -0
  247. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  248. package/package.json +1 -1
  249. package/dist/esm-es5/cart-6cfd7560.js +0 -1
  250. package/dist/esm-es5/getContrastColor-a1a6f6aa.js +0 -1
  251. package/dist/esm-es5/submitGtag-acca574d.js +0 -1
  252. package/dist/zonos-elements/p-0dfd549e.system.entry.js +0 -1
  253. package/dist/zonos-elements/p-0f8acb62.js +0 -1
  254. package/dist/zonos-elements/p-2fdec8bc.system.entry.js +0 -1
  255. package/dist/zonos-elements/p-352ba771.system.js +0 -1
  256. package/dist/zonos-elements/p-4051a42d.js +0 -1
  257. package/dist/zonos-elements/p-5162f4cc.system.entry.js +0 -1
  258. package/dist/zonos-elements/p-55b8b98b.js +0 -1
  259. package/dist/zonos-elements/p-5a40684c.entry.js +0 -1
  260. package/dist/zonos-elements/p-61e08de7.system.entry.js +0 -1
  261. package/dist/zonos-elements/p-66cc1554.system.js +0 -1
  262. package/dist/zonos-elements/p-a7bfe188.entry.js +0 -1
  263. package/dist/zonos-elements/p-c6e44a9b.entry.js +0 -1
  264. package/dist/zonos-elements/p-cde25873.js +0 -1
  265. package/dist/zonos-elements/p-e2131057.entry.js +0 -1
@@ -1,9 +1,9 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host, Fragment } from '@stencil/core/internal/client';
2
2
  import { a as localizationStore, b as log, d as stripeStoreGetDomesticShippingSession, e as localizationStoreUpdateSelectedCountryCode, f as stripeStoreCleanupDomesticShippingSession, l as logError, g as stripeStoreSaveDomesticShippingSession, i as initStripeElements, c as cartStore, h as cartStoreUpdateItems, j as cartStoreReset, s as stripeStore, k as stripeStoreInitCheckoutSession, m as cartStoreUpdateToErrorState, t as translate, n as stripeStorePrefetchLandedCost, o as cartStoreNextStep, p as stripeStoreConfirmPayment, q as stripeStoreReset } from './stripe.js';
3
- import { z as zonosStore, m as mergeConfig } from './zonosStore.js';
3
+ import { z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore.js';
4
4
  import { t as trackConversionEvent } from './trackConversionEvent.js';
5
5
  import { i as isCheckoutMobile } from './isCheckoutMobile.js';
6
- import { s as sendErrorLog, d as defineCustomElement$l } from './zonos-checkout-finish2.js';
6
+ import { c as createCustomEvent, s as sendErrorLog, d as defineCustomElement$l } from './zonos-checkout-finish2.js';
7
7
  import { c as classes } from './classes.js';
8
8
  import { g as getBorderRadius } from './getBorderRadius.js';
9
9
  import { i as isDarkColor } from './isDarkColor.js';
@@ -36,12 +36,162 @@ import { d as defineCustomElement$4 } from './zonos-text2.js';
36
36
  import { d as defineCustomElement$3 } from './zonos-tooltip2.js';
37
37
  import { d as defineCustomElement$2 } from './zonos-v-stack2.js';
38
38
 
39
+ /**
40
+ * This is just function to make the key typesafe to enter
41
+ * @returns
42
+ */
43
+ const objAttribute = ({ key, value, }) => value
44
+ ? {
45
+ key,
46
+ value,
47
+ }
48
+ : null;
49
+ /**
50
+ * Map legacy item attribute to dgs item attributes
51
+ * @ref https://github.com/Zonos/ShippingQuoteService/blob/f8bd4f1ff41cb34b49b9f3f435576ec28dedf906/src/main/java/com/iglobal/services/shippingquote/dto/ShippingQuoteRequestDto.java#L412
52
+ */
53
+ const getAttributes = (item) => {
54
+ return [
55
+ objAttribute({
56
+ key: 'brand',
57
+ value: item.itemBrand,
58
+ }),
59
+ objAttribute({
60
+ key: 'material',
61
+ value: item.itemMaterial,
62
+ }),
63
+ objAttribute({
64
+ key: 'category',
65
+ value: item.itemCategory,
66
+ }),
67
+ objAttribute({
68
+ key: 'color',
69
+ value: item.itemColor,
70
+ }),
71
+ objAttribute({
72
+ key: 'customization',
73
+ value: item.itemCustomization,
74
+ }),
75
+ objAttribute({
76
+ key: 'descriptionDetailed',
77
+ value: item.itemDescriptionDetailed,
78
+ }),
79
+ objAttribute({
80
+ key: 'fabricContent',
81
+ value: item.itemFabricContent,
82
+ }),
83
+ objAttribute({
84
+ key: 'ltlClass',
85
+ value: item.itemLtlClass,
86
+ }),
87
+ objAttribute({
88
+ key: 'pickingLocation',
89
+ value: item.itemPickingLocation,
90
+ }),
91
+ objAttribute({
92
+ key: 'shipFromLocation',
93
+ value: item.itemShipFromLocation,
94
+ }),
95
+ objAttribute({
96
+ key: 'size',
97
+ value: item.itemSize,
98
+ }),
99
+ objAttribute({
100
+ key: 'status',
101
+ value: item.status,
102
+ }),
103
+ ].filter(Boolean);
104
+ };
105
+
106
+ /**
107
+ * Map legacy weight units with dgs
108
+ * @ref https://github.com/Zonos/ShippingQuoteService/blob/f8bd4f1ff41cb34b49b9f3f435576ec28dedf906/src/main/java/com/iglobal/services/shippingquote/dto/ShippingQuoteRequestDto.java#L483
109
+ */
110
+ const getItemWeightUnit = (weightUnit) => {
111
+ if (!weightUnit) {
112
+ return 'POUND';
113
+ }
114
+ switch (weightUnit.toUpperCase()) {
115
+ case 'KG':
116
+ return 'KILOGRAM';
117
+ case 'OZ':
118
+ return 'OUNCE';
119
+ case 'G':
120
+ return 'GRAM';
121
+ default:
122
+ return 'POUND';
123
+ }
124
+ };
125
+ /**
126
+ * Mapping legacy measurement with dgs
127
+ * @ref https://github.com/Zonos/ShippingQuoteService/blob/f8bd4f1ff41cb34b49b9f3f435576ec28dedf906/src/main/java/com/iglobal/services/shippingquote/dto/ShippingQuoteRequestDto.java#L441
128
+ */
129
+ const getMeasurements = (item) => {
130
+ if (!item) {
131
+ return [];
132
+ }
133
+ const measurements = [];
134
+ if (item.length) {
135
+ measurements.push({
136
+ type: 'LENGTH',
137
+ unitOfMeasure: 'INCH',
138
+ value: item.length,
139
+ });
140
+ }
141
+ if (item.width) {
142
+ measurements.push({
143
+ type: 'WIDTH',
144
+ unitOfMeasure: 'INCH',
145
+ value: item.width,
146
+ });
147
+ }
148
+ if (item.weight) {
149
+ measurements.push({
150
+ type: 'WEIGHT',
151
+ unitOfMeasure: getItemWeightUnit(item.weightUnits),
152
+ value: item.weight,
153
+ });
154
+ }
155
+ if (item.height) {
156
+ measurements.push({
157
+ type: 'HEIGHT',
158
+ unitOfMeasure: 'INCH',
159
+ value: item.height,
160
+ });
161
+ }
162
+ return measurements;
163
+ };
164
+
165
+ /**
166
+ * Map the items from tempCart like how we do it in dgs
167
+ * @ref https://github.com/Zonos/ShippingQuoteService/blob/f8bd4f1ff41cb34b49b9f3f435576ec28dedf906/src/main/java/com/iglobal/services/shippingquote/dto/ShippingQuoteRequestDto.java#L393
168
+ */
169
+ const buildCartItemsByTempCart = (tempCartData) => {
170
+ var _a;
171
+ const tempCartItems = ((_a = tempCartData === null || tempCartData === void 0 ? void 0 : tempCartData.items) === null || _a === void 0 ? void 0 : _a.map(item => ({
172
+ amount: item.unitPrice || 0,
173
+ attributes: getAttributes(item),
174
+ countryOfOrigin: item.countryOfOrigin || undefined,
175
+ currencyCode: 'USD',
176
+ description: item.itemDescriptionLong || '',
177
+ imageUrl: item.imageURL || '',
178
+ itemType: 'PHYSICAL_GOOD',
179
+ measurements: getMeasurements(item),
180
+ name: item.description || '',
181
+ productId: item.productId || '',
182
+ quantity: item.quantity || 0,
183
+ sku: item.sku || '',
184
+ }))) || [];
185
+ return tempCartItems;
186
+ };
187
+
39
188
  const isShippableCountry = (showLog = true) => {
40
189
  if (!localizationStore.localizationLoaded) {
41
190
  return false;
42
191
  }
43
192
  // if localization is loaded and the localization is not a shippable country, keep the original click event
44
193
  if (!localizationStore.isShippableCountry) {
194
+ document.dispatchEvent(createCustomEvent('legacyCheckoutError', 'Unable to initiate checkout process in a country where shipping is not available'));
45
195
  if (showLog) {
46
196
  log(`Checkout: not shippable country`);
47
197
  }
@@ -208,6 +358,8 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
208
358
  this.zonosReviewRef = undefined;
209
359
  this.storybookPaymentStatusOverride = undefined;
210
360
  this.domesticRedirectedBtnSelector = '#zonos--domestic-redirected-checkout-button';
361
+ this.legacyCheckoutHiddenBtnSelector = '#legacy-checkout-hidden-button';
362
+ this.isLegacyCheckout = false;
211
363
  }
212
364
  /**
213
365
  * Init cart info handler event
@@ -230,7 +382,12 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
230
382
  cartStore.step = 'customer-info';
231
383
  }
232
384
  async buildCartAndInit() {
233
- if (zonosStore.checkoutSettings.buildCartDetail) {
385
+ // if tempCartUUID is provided, use it instead of buildCartDetail
386
+ if (window.Zonos.tempCartData) {
387
+ const tempCartData = buildCartItemsByTempCart(window.Zonos.tempCartData);
388
+ await cartStoreUpdateItems(tempCartData);
389
+ }
390
+ else if (zonosStore.checkoutSettings.buildCartDetail) {
234
391
  log('build cart detail');
235
392
  const cartItems = await zonosStore.checkoutSettings.buildCartDetail();
236
393
  await cartStoreUpdateItems(cartItems);
@@ -297,12 +454,18 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
297
454
  button.setAttribute('data-zonos-checkout-attached', 'true');
298
455
  // if this button is the hidden button, trigger the click event
299
456
  if (button.matches(this.domesticRedirectedBtnSelector)) {
300
- button.dispatchEvent(new CustomEvent('click'));
457
+ button.dispatchEvent(createCustomEvent('click'));
301
458
  // cleanup shipping session after button is clicked
302
459
  stripeStoreCleanupDomesticShippingSession();
303
460
  // remove the button after it's clicked
304
461
  button.remove();
305
462
  }
463
+ if (button.matches(this.legacyCheckoutHiddenBtnSelector)) {
464
+ this.isLegacyCheckout = true;
465
+ // trigger the click event on the button
466
+ button.dispatchEvent(createCustomEvent('click'));
467
+ button.remove();
468
+ }
306
469
  });
307
470
  }
308
471
  appearanceSettingsOverrideChanged() {
@@ -312,6 +475,45 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
312
475
  // apply theme to stripe elements
313
476
  void this.applyStripeTheme();
314
477
  }
478
+ /**
479
+ * Set default address from query param if it's valid
480
+ */
481
+ useLegacyQueryParam() {
482
+ const urlParams = new URLSearchParams(window.location.search);
483
+ const legacyShippingInfo = {
484
+ country: urlParams.get('country'),
485
+ customerAddress1: urlParams.get('customerAddress1'),
486
+ customerAddress2: urlParams.get('customerAddress2'),
487
+ customerCity: urlParams.get('customerCity'),
488
+ customerEmail: urlParams.get('customerEmail'),
489
+ customerName: urlParams.get('customerName'),
490
+ customerPhone: urlParams.get('customerPhone'),
491
+ customerState: urlParams.get('customerState'),
492
+ customerZip: urlParams.get('customerZip'),
493
+ };
494
+ // if one of the value is null, no need to preset the default address
495
+ if (!legacyShippingInfo.customerAddress1 ||
496
+ !legacyShippingInfo.customerCity ||
497
+ !legacyShippingInfo.customerName ||
498
+ !legacyShippingInfo.customerPhone ||
499
+ !legacyShippingInfo.customerState ||
500
+ !legacyShippingInfo.customerZip ||
501
+ !legacyShippingInfo.country) {
502
+ return;
503
+ }
504
+ this.defaultAddress = {
505
+ address: {
506
+ city: legacyShippingInfo.customerCity,
507
+ country: legacyShippingInfo.country,
508
+ line1: legacyShippingInfo.customerAddress1,
509
+ line2: legacyShippingInfo.customerAddress2 || '',
510
+ postal_code: legacyShippingInfo.customerZip,
511
+ state: legacyShippingInfo.customerState,
512
+ },
513
+ name: legacyShippingInfo.customerName,
514
+ phone: legacyShippingInfo.customerPhone,
515
+ };
516
+ }
315
517
  /**
316
518
  * Setup all of the event listeners for the component on first load
317
519
  */
@@ -337,6 +539,12 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
337
539
  };
338
540
  },
339
541
  });
542
+ /**
543
+ * When temp cart data is available, set default address if exist
544
+ */
545
+ if (window.Zonos.tempCartData) {
546
+ this.useLegacyQueryParam();
547
+ }
340
548
  const hideInternationalOrderInterval = setInterval(() => {
341
549
  const internationalSelector = window.Zonos.internationalHideSelector;
342
550
  if (!internationalSelector) {
@@ -455,6 +663,12 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
455
663
  }
456
664
  // reset cart store
457
665
  cartStoreReset();
666
+ // redirect to vendor store url if this is legacy checkout.
667
+ if (this.isLegacyCheckout && window.Zonos.tempCartData) {
668
+ const contShoppingUrl = window.Zonos.tempCartData.contShoppingURL;
669
+ window.location.href = contShoppingUrl;
670
+ return;
671
+ }
458
672
  // reset url
459
673
  const url = window.location.href;
460
674
  // Remove query parameters
@@ -477,9 +691,18 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
477
691
  void this.applyStripeTheme();
478
692
  log(`mobile: ${this.isMobile}`);
479
693
  }
694
+ handleAppearanceSettingsOverrideChange() {
695
+ var _a;
696
+ if ((_a = this.appearanceSettingsOverride) === null || _a === void 0 ? void 0 : _a.theme) {
697
+ // update theme to browser preference theme if appearance theme is system
698
+ this.appearanceSettingsOverride.theme = getZonosStoreTheme(this.appearanceSettingsOverride.theme);
699
+ }
700
+ }
480
701
  componentWillLoad() {
481
702
  void this.init();
482
703
  this.isMobile = isCheckoutMobile(this.mobile);
704
+ // update theme to browser preference theme if appearance theme is system
705
+ this.handleAppearanceSettingsOverrideChange();
483
706
  log(`mobile: ${this.isMobile}`);
484
707
  }
485
708
  // do clean up when component is unmounted
@@ -512,15 +735,17 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
512
735
  const localePageEnum = this.getCurrentLocalePageEnum();
513
736
  const filteredMessages = customMessages.filter(x => x.pageName === localePageEnum);
514
737
  const renderLogo = () => (h("div", { class: "zonos--logo" }, logoUrl && (h("img", { alt: `${zonosStore.organizationName} logo`, src: logoUrl, width: 100 }))));
515
- const renderTopHeader = () => (h("zonos-v-stack", null, renderLogo(), h("zonos-checkout-progress-tabs", { backgroundColor:
516
- // only use different contrast color when the secondary color is too off with the background in mobile
517
- this.isMobile ? '--amino-gray-0' : null }), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))));
738
+ const renderTopHeader = () => {
739
+ return (h("zonos-v-stack", null, renderLogo(), h("zonos-checkout-progress-tabs", { backgroundColor:
740
+ // only use different contrast color when the secondary color is too off with the background in mobile
741
+ this.isMobile ? '--amino-gray-0' : null }), filteredMessages.map(x => (h("zonos-custom-message", { icon: MessageIcon, message: x.message })))));
742
+ };
518
743
  const renderContent = () => {
519
744
  return (h("div", { class: 'zonos--content', style: {
520
745
  '--border-radius': getBorderRadius(style),
521
746
  } }, cartStore.step !== 'finish' && cartStore.step !== 'error' && (h(Fragment, null, h("div", { class: "zonos--left", "data-theme": leftSideTheme, style: {
522
747
  '--primary-color': !this.isMobile ? colorPrimary : '',
523
- } }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleCheckoutPaymentContinue(), paymentError: this.paymentError, submitBtnColor: submitButtonColor }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() }), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-review", { collapsed: this.collapseReviewMobile, mobile: this.isMobile, onClick: () => {
748
+ } }, !this.isMobile && renderTopHeader(), cartStore.step === 'customer-info' && (h("zonos-customer-info", { continueLoading: this.submitLoading, defaultAddress: this.defaultAddress, onContinueClicked: () => this.handleCustomerInfoContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'shipping' && (h("zonos-shipping", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleShippingContinue(), submitBtnColor: submitButtonColor })), cartStore.step === 'payment' && (h("zonos-checkout-payment", { continueLoading: this.submitLoading, onContinueClicked: () => this.handleCheckoutPaymentContinue(), paymentError: this.paymentError, submitBtnColor: submitButtonColor }))), h("div", { class: "zonos--right", "data-theme": rightSideTheme }, this.isMobile && renderTopHeader(), !this.isLegacyCheckout && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon }), noBackground: true, onClick: () => this.closeDialogHandler() })), h("div", { class: "flex--wrapper" }, h("div", { class: "zonos--wrapper" }, h("zonos-review", { collapsed: this.collapseReviewMobile, mobile: this.isMobile, onClick: () => {
524
749
  // do nothing if it's not mobile
525
750
  if (!this.isMobile) {
526
751
  return;
@@ -543,11 +768,11 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
543
768
  hasFooter && 'has-footer',
544
769
  this.preview && 'preview',
545
770
  this.isMobile && 'mobile',
546
- ]) }, this.preview ? (renderContent()) : (h("zonos-dialog", { borderStyle: style, "data-theme": rightSideTheme, height: "980px", isLoading: dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeDialogHandler(), open: this.open, width: "1200px" }, renderContent()))));
771
+ ]) }, this.preview ? (renderContent()) : (h("zonos-dialog", { borderStyle: style, height: "980px", isLoading: dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeDialogHandler(), open: this.open, width: "1200px" }, renderContent()))));
547
772
  }
548
773
  static get assetsDirs() { return ["assets"]; }
549
774
  static get watchers() { return {
550
- "appearanceSettingsOverride": ["appearanceSettingsOverrideChanged"],
775
+ "appearanceSettingsOverride": ["appearanceSettingsOverrideChanged", "handleAppearanceSettingsOverrideChange"],
551
776
  "mobile": ["handleMobileChange"]
552
777
  }; }
553
778
  static get style() { return ZonosCheckoutStyle0; }
@@ -567,11 +792,13 @@ const ZonosCheckout$1 = /*@__PURE__*/ proxyCustomElement(class ZonosCheckout ext
567
792
  "zonosReviewRef": [32],
568
793
  "storybookPaymentStatusOverride": [32],
569
794
  "domesticRedirectedBtnSelector": [32],
795
+ "legacyCheckoutHiddenBtnSelector": [32],
796
+ "isLegacyCheckout": [32],
570
797
  "closeDialogHandler": [64],
571
798
  "init": [64],
572
799
  "setToFinishStep": [64]
573
800
  }, [[16, "zonos--init-cart-info", "initCartInfoHandler"], [9, "resize", "handleWindowResize"]], {
574
- "appearanceSettingsOverride": ["appearanceSettingsOverrideChanged"],
801
+ "appearanceSettingsOverride": ["appearanceSettingsOverrideChanged", "handleAppearanceSettingsOverrideChange"],
575
802
  "mobile": ["handleMobileChange"]
576
803
  }]);
577
804
  function defineCustomElement$1() {
@@ -57,7 +57,7 @@ const ZonosDialog = /*@__PURE__*/ proxyCustomElement(class ZonosDialog extends H
57
57
  document.body.style.overflow = 'auto';
58
58
  }
59
59
  const borderStyle = getBorderRadius(this.borderStyle);
60
- return (h(Host, { key: '6bda73bd75e6bc31e73ad53849a51752396ee42d', class: classes([
60
+ return (h(Host, { key: 'f0aee4766d2c62f3f4feff18c99dba62ea97ca06', class: classes([
61
61
  'zonos--elements',
62
62
  this.open && 'open',
63
63
  this.isLoading && 'is-loading',
@@ -68,10 +68,10 @@ const ZonosDialog = /*@__PURE__*/ proxyCustomElement(class ZonosDialog extends H
68
68
  '--font-family': zonosStoreFontFamily(),
69
69
  '--height': this.height || 'initial',
70
70
  '--width': this.width,
71
- } }, h("div", { key: 'cd3ff21820f95faee3f16e23a272e080bd7930c8', class: "zonos--backdrop" }), h("div", { key: '85af066de976e3b29505c8804e544ca0a1f8a012', "aria-hidden": "true", class: "zonos--dialog-layout", onClick: this.clickOutsideDialogHandler }, h("div", { key: '389491715fcb12f9c86b744e2e9c20930a2a9f25', class: "zonos--dialog" }, this.isLoading && (h("div", { class: "zonos--loading" }, h("zonos-spinner", { size: 30 }))), (this.headerText || !this.noCloseButton) && (h("div", { class: "zonos--header" }, this.headerText && (h("h3", { class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler })))), h("div", { key: 'a28ad12faab02ef30769a3234b24e749b38c46b4', class: classes([
71
+ } }, h("div", { key: '42e8afd7ddc94ab9ec4951f4221e32729256694e', class: "zonos--backdrop" }), h("div", { key: '035c21c65ae5cabc12b41b6ad1684fa4dbc5b92e', "aria-hidden": "true", class: "zonos--dialog-layout", onClick: this.clickOutsideDialogHandler }, h("div", { key: 'b9a3299c9fb920f9af5783506b0489122b2eae11', class: "zonos--dialog" }, this.isLoading && (h("div", { class: "zonos--loading" }, h("zonos-spinner", { size: 30 }))), (this.headerText || !this.noCloseButton) && (h("div", { class: "zonos--header" }, this.headerText && (h("h3", { class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler })))), h("div", { key: 'f5e5a75782ca6acd4a2c004756b800f3c2558129', class: classes([
72
72
  'zonos--body',
73
73
  this.noBodyPadding && 'zonos--no-body-padding',
74
- ]) }, h("slot", { key: '7da31d739197a17ae94df1909c93f70c1282da95' })), h("slot", { key: 'fe02670713895b786dfa6b0c30ad6553c32796cd', name: "dialog-footer" })))));
74
+ ]) }, h("slot", { key: '3fe4ec47852e99f1dc5b6a7a84a8b918594b8b7f' })), h("slot", { key: '5515f4109274b178249c05c6e6c91fdc30ce528a', name: "dialog-footer" })))));
75
75
  }
76
76
  static get assetsDirs() { return ["assets"]; }
77
77
  static get style() { return ZonosDialogStyle0; }
@@ -136,7 +136,7 @@ const ZonosHelloDialog = /*@__PURE__*/ proxyCustomElement(class ZonosHelloDialog
136
136
  const defaultMessage = formatStringWithLinks(defaultMessageStr);
137
137
  const currentPage = this.getCurrentPageEnum();
138
138
  const filteredMessages = customMessages.filter(x => x.pageName === currentPage);
139
- return (h(Host, { key: 'a9e9d5946604f86ea0680af79ece9e079d4d00d7', class: "zonos--elements" }, h("div", { key: '47ed38de794c10b5689778257d134006c109c101', "aria-hidden": "true", class: classes([
139
+ return (h(Host, { key: 'dcd4c055999375785e289cc273c37e50c358d594', class: "zonos--elements" }, h("div", { key: 'a8921afb921ee0b4c0adb31dca0da646c91bdecc', "aria-hidden": "true", class: classes([
140
140
  'zonos--hello-dialog',
141
141
  animateLeft && 'zonos--hello-dialog-animate-from-left',
142
142
  animateFromBottom && 'zonos--hello-dialog-animate-from-bottom',
@@ -1,5 +1,5 @@
1
1
  import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
- import { _ as _root, e as _baseGetTag, i as isObjectLike_1, f as isObject_1, z as zonosStore, m as mergeConfig } from './zonosStore.js';
2
+ import { _ as _root, e as _baseGetTag, i as isObjectLike_1, f as isObject_1, z as zonosStore, g as getZonosStoreTheme, m as mergeConfig } from './zonosStore.js';
3
3
  import { r as handleFetch, l as logError, a as localizationStore, y as isValidSelector, t as translate, A as getZCountryUrlParam, B as setZCountryUrlParam, b as log, C as currencyDisplay, D as currencyConvertAndFormat, E as currencyConvert, F as currencyFormat } from './stripe.js';
4
4
  import { c as classes } from './classes.js';
5
5
  import { g as getHasMoreSpaceOnRight, d as defineCustomElement$9 } from './zonos-hello-dialog2.js';
@@ -670,6 +670,8 @@ const ZonosHello$1 = /*@__PURE__*/ proxyCustomElement(class ZonosHello extends H
670
670
  this.helloRef.setAttribute('data-zonos-hello-loaded', '');
671
671
  this.updateHelloOnPageChange();
672
672
  this.watchPriceChange();
673
+ // update theme to browser preference theme if appearance theme is system
674
+ this.handleAppearanceSettingsOverrideChange();
673
675
  clearInterval(initInterval);
674
676
  }
675
677
  }, 100);
@@ -716,6 +718,13 @@ const ZonosHello$1 = /*@__PURE__*/ proxyCustomElement(class ZonosHello extends H
716
718
  handleResize() {
717
719
  debounce_1(this.render.bind(this), RESIZE_DEBOUNCE_DELAY_MS);
718
720
  }
721
+ handleAppearanceSettingsOverrideChange() {
722
+ var _a;
723
+ if ((_a = this.appearanceSettingsOverride) === null || _a === void 0 ? void 0 : _a.theme) {
724
+ // update theme to browser preference theme if appearance theme is system
725
+ this.appearanceSettingsOverride.theme = getZonosStoreTheme(this.appearanceSettingsOverride.theme);
726
+ }
727
+ }
719
728
  render() {
720
729
  var _a, _b;
721
730
  const isExcludedUrl = (_a = zonosStore.helloSettings.excludedUrlPatterns) === null || _a === void 0 ? void 0 : _a.some(pattern => new RegExp(pattern).test(window.location.href));
@@ -755,6 +764,9 @@ const ZonosHello$1 = /*@__PURE__*/ proxyCustomElement(class ZonosHello extends H
755
764
  'zonos--hello-dialog-wrapper-mobile-override',
756
765
  ]), style: { height: this.showDialog ? 'fit-content' : '0px' } }, h("zonos-hello-dialog", { animateFromLeftOverride: this.animateFromLeftOverride, appearanceSettings: appearanceSettings, isOpen: this.showDialog, mobileLocationOverride: this.mobileLocationOverride, restrictedItems: restrictedItemsOnPage, setIsOpen: this.changeShowDialog }))))));
757
766
  }
767
+ static get watchers() { return {
768
+ "appearanceSettingsOverride": ["handleAppearanceSettingsOverrideChange"]
769
+ }; }
758
770
  static get style() { return ZonosHelloStyle0; }
759
771
  }, [1, "zonos-hello", {
760
772
  "mobileLocationOverride": [1, "mobile-location-override"],
@@ -773,7 +785,9 @@ const ZonosHello$1 = /*@__PURE__*/ proxyCustomElement(class ZonosHello extends H
773
785
  "convert": [64],
774
786
  "format": [64],
775
787
  "openHelloDialog": [64]
776
- }, [[9, "resize", "handleResize"]]]);
788
+ }, [[9, "resize", "handleResize"]], {
789
+ "appearanceSettingsOverride": ["handleAppearanceSettingsOverrideChange"]
790
+ }]);
777
791
  function defineCustomElement$1() {
778
792
  if (typeof customElements === "undefined") {
779
793
  return;
@@ -11,7 +11,7 @@ const ChevronDownIcon = `<svg color="var(--amino-gray-400)" fill="none" height="
11
11
 
12
12
  const ChevronUpIcon = `<svg color="var(--amino-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
13
13
 
14
- const zonosReviewCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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{position:-webkit-sticky;position:sticky;top:0;background-color:var(--amino-gray-0);z-index:1}:host .zonos--total-pay{margin:var(--amino-space-8) 0 var(--amino-space-32)}:host(.mobile){display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:var(--amino-space-24);-ms-flex-pack:justify;justify-content:space-between;padding:var(--amino-space-4) 0;margin-bottom:var(--amino-space-8);background-color:transparent}:host(.mobile) .zonos--title{display:-ms-flexbox;display:flex;-ms-flex-item-align:center;align-self:center;gap:var(--amino-space-8)}:host(.mobile) .zonos--total-pay{margin:0}";
14
+ const zonosReviewCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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{position:-webkit-sticky;position:sticky;top:0;background-color:var(--amino-gray-0);z-index:1}:host .zonos--total-pay{margin:var(--amino-space-8) 0 var(--amino-space-24)}:host(.mobile){display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:var(--amino-space-24);-ms-flex-pack:justify;justify-content:space-between;padding:var(--amino-space-4) 0;margin-bottom:var(--amino-space-8);background-color:transparent}:host(.mobile) .zonos--title{display:-ms-flexbox;display:flex;-ms-flex-item-align:center;align-self:center;gap:var(--amino-space-8)}:host(.mobile) .zonos--total-pay{margin:0}";
15
15
  const ZonosReviewStyle0 = zonosReviewCss;
16
16
 
17
17
  const ZonosReview = /*@__PURE__*/ proxyCustomElement(class ZonosReview extends HTMLElement {
@@ -46,7 +46,7 @@ const ZonosShippingRichRadio = /*@__PURE__*/ proxyCustomElement(class ZonosShipp
46
46
  }
47
47
  render() {
48
48
  var _a;
49
- return (h(Host, { key: '3633e3be9f679c54647d475c9d1831428410302b', class: "zonos--shipping-rich-radio zonos--elements", "data-theme": this.theme, style: Object.assign(Object.assign({}, this.getRadioItemStyleVariables()), { '--font-family': zonosStoreFontFamily() }) }, (_a = this.items) === null || _a === void 0 ? void 0 : _a.map(item => {
49
+ return (h(Host, { key: 'a1c2ace211e4d0b9d63a784028cc725bab7229e7', class: "zonos--shipping-rich-radio zonos--elements", "data-theme": this.theme, style: Object.assign(Object.assign({}, this.getRadioItemStyleVariables()), { '--font-family': zonosStoreFontFamily() }) }, (_a = this.items) === null || _a === void 0 ? void 0 : _a.map(item => {
50
50
  var _a;
51
51
  const selected = ((_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.value) === item.value;
52
52
  return (h("div", { "aria-hidden": "true", class: classes([
@@ -96,7 +96,7 @@ const ZonosShipping = /*@__PURE__*/ proxyCustomElement(class ZonosShipping exten
96
96
  }
97
97
  render() {
98
98
  var _a, _b;
99
- return (h(Host, { key: 'ab881bdb575ac0177154ffa8a2d84d668151c46d', class: "zonos--shipping zonos--elements" }, h("div", { key: 'b8738e0fb5c32b329ae03ccd2cb2d1a178a05aa8', class: "zonos--group" }, h("zonos-text", { key: 'd942ab3f4e77631145a0a38dae95999454a92b56', class: "zonos--title", type: "semiBoldSubheader" }, translate('Shipping information')), h("zonos-text", { key: '6855f44cf3458891776b3c215417bec329de89dc', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !((_a = this.serviceLevels) === null || _a === void 0 ? void 0 : _a.length) ? (h("zonos-banner", { bannerTitle: "No shipping methods found - try editing your address or contacting support if the error persists", intent: "error" })) : (h("zonos-shipping-rich-radio", { initialSelectedValue: (_b = this.selectedShippingMethod) === null || _b === void 0 ? void 0 : _b.value, items: this.serviceLevels, onRadioSelected: e => this.handleRadioSelected(e) })), h("div", { key: '9f2c00c948230679d96ac44940c1dee45e751ded', class: "zonos--group-btn" }, h("zonos-button", { key: '8bab3848d596fef19bc7245fc87a525cf59a15c5', backgroundColor: this.submitBtnColor, isDisabled: this.disabled, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
99
+ return (h(Host, { key: 'ab881bdb575ac0177154ffa8a2d84d668151c46d', class: "zonos--shipping zonos--elements" }, h("div", { key: 'b8738e0fb5c32b329ae03ccd2cb2d1a178a05aa8', class: "zonos--group" }, h("zonos-text", { key: 'd942ab3f4e77631145a0a38dae95999454a92b56', class: "zonos--title", type: "semiBoldSubheader" }, translate('Shipping information')), h("zonos-text", { key: '6855f44cf3458891776b3c215417bec329de89dc', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !((_a = this.serviceLevels) === null || _a === void 0 ? void 0 : _a.length) ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), intent: "error" })) : (h("zonos-shipping-rich-radio", { initialSelectedValue: (_b = this.selectedShippingMethod) === null || _b === void 0 ? void 0 : _b.value, items: this.serviceLevels, onRadioSelected: e => this.handleRadioSelected(e) })), h("div", { key: 'f6398edeecd18c603680ad6c7c8e1aa5f5cebe4a', class: "zonos--group-btn" }, h("zonos-button", { key: 'a548fb385ed341308ff86e615d9088e7cd4ec34d', backgroundColor: this.submitBtnColor, isDisabled: this.disabled, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
100
100
  // use primary type when on mobile mode
101
101
  variant: this.submitBtnType }, translate('Go to payment'))))));
102
102
  }
@@ -2831,6 +2831,17 @@ const { reset, state: zonosStore } = createStore(() => ({
2831
2831
  zonosApiKey: '',
2832
2832
  }));
2833
2833
  let savedZonosSettings = null;
2834
+ /**
2835
+ * Get theme from media query if theme is SYSTEM, otherwise return the theme
2836
+ */
2837
+ const getZonosStoreTheme = (theme) => {
2838
+ if (theme === 'SYSTEM') {
2839
+ return window.matchMedia('(prefers-color-scheme: dark)').matches
2840
+ ? 'DARK'
2841
+ : 'LIGHT';
2842
+ }
2843
+ return theme;
2844
+ };
2834
2845
  /**
2835
2846
  * Init setting from zonos setting
2836
2847
  */
@@ -2841,9 +2852,15 @@ const zonosStoreInitSetting = ({ overrideSettings, zonosSettings, }) => {
2841
2852
  // save zonos settings to be used later
2842
2853
  savedZonosSettings = zonosSettings;
2843
2854
  }
2844
- zonosStore.appearance = mergeConfig(zonosStore.appearance, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.appearanceSettings) ||
2855
+ const mergedAppearanceConfig = mergeConfig(zonosStore.appearance, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.appearanceSettings) ||
2845
2856
  (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.appearanceSettings) ||
2846
2857
  null, overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.appearance);
2858
+ // override the theme to user browser preferences if it is set to SYSTEM
2859
+ if (mergedAppearanceConfig.theme === 'SYSTEM') {
2860
+ // update theme to user browser preferences
2861
+ mergedAppearanceConfig.theme = getZonosStoreTheme(mergedAppearanceConfig.theme);
2862
+ }
2863
+ zonosStore.appearance = mergedAppearanceConfig;
2847
2864
  zonosStore.checkoutSettings = mergeConfig(zonosStore.checkoutSettings, (savedZonosSettings === null || savedZonosSettings === void 0 ? void 0 : savedZonosSettings.checkoutSettings) ||
2848
2865
  (zonosSettings === null || zonosSettings === void 0 ? void 0 : zonosSettings.checkoutSettings) ||
2849
2866
  null, overrideSettings === null || overrideSettings === void 0 ? void 0 : overrideSettings.checkoutSettings);
@@ -2860,4 +2877,4 @@ const zonosStoreFontFamily = () => {
2860
2877
  return fontFamily;
2861
2878
  };
2862
2879
 
2863
- export { _root as _, zonosStoreFontFamily as a, commonjsGlobal as b, createStore as c, zonosStoreInitSetting as d, _baseGetTag as e, isObject_1 as f, isObjectLike_1 as i, mergeConfig as m, zonosStore as z };
2880
+ export { _root as _, zonosStoreFontFamily as a, commonjsGlobal as b, createStore as c, zonosStoreInitSetting as d, _baseGetTag as e, isObject_1 as f, getZonosStoreTheme as g, isObjectLike_1 as i, mergeConfig as m, zonosStore as z };