@zonos/elements 1.3.18-alpha.2 → 1.3.18-alpha.4

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 (341) hide show
  1. package/README.md +341 -96
  2. package/dist/cjs/{cart-941a31dd.js → cart-72b0bccc.js} +34 -85
  3. package/dist/cjs/index.cjs.js +628 -0
  4. package/dist/cjs/loader.cjs.js +1 -1
  5. package/dist/cjs/logError-4e2f2020.js +58 -0
  6. package/dist/cjs/{submitGtag-9210b4fe.js → submitGtag-b0c8de90.js} +3 -2
  7. package/dist/cjs/zonos-address_8.cjs.entry.js +13 -12
  8. package/dist/cjs/zonos-badge_2.cjs.entry.js +3 -3
  9. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  10. package/dist/cjs/zonos-card_2.cjs.entry.js +7 -6
  11. package/dist/cjs/zonos-cart-items_11.cjs.entry.js +11 -10
  12. package/dist/cjs/zonos-checkout.cjs.entry.js +20 -15
  13. package/dist/cjs/zonos-controller.cjs.entry.js +47 -20
  14. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -1
  15. package/dist/cjs/zonos-country-select_3.cjs.entry.js +6 -5
  16. package/dist/cjs/zonos-elements.cjs.js +1 -1
  17. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -1
  18. package/dist/cjs/zonos-hello.cjs.entry.js +10 -9
  19. package/dist/cjs/zonos-input.cjs.entry.js +4 -4
  20. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  21. package/dist/cjs/zonos-payment.cjs.entry.js +3 -2
  22. package/dist/collection/__mocks__/zonos-url/index.js +1 -0
  23. package/dist/collection/__tests__/build-utils/urlCheckOne.js +1 -1
  24. package/dist/collection/collection-manifest.json +1 -1
  25. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +4 -9
  26. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +8 -4
  27. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +3 -3
  28. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  29. package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
  30. package/dist/collection/components/common/zonos-card/zonos-card.js +3 -3
  31. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
  32. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
  33. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  34. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
  35. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +2 -2
  36. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  37. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  38. package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
  39. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  40. package/dist/collection/components/common/{component-template/zonos-link → zonos-link}/zonos-link.js +1 -1
  41. package/dist/collection/components/main/zonos-controller.js +41 -6
  42. package/dist/collection/components/stripe/zonos-address/zonos-address.js +3 -3
  43. package/dist/collection/components/utils/hello/setZCountryUrlParam.js +5 -1
  44. package/dist/collection/environment.js +0 -2
  45. package/dist/collection/index.js +1 -0
  46. package/dist/collection/scripts/_extractZonosQaUrl.js +26 -0
  47. package/dist/collection/scripts/_getZonosQaUrl.js +44 -0
  48. package/dist/collection/scripts/{loadStripe.js → _loadStripe.js} +1 -1
  49. package/dist/collection/scripts/{zonosBase.js → _zonosBase.js} +29 -6
  50. package/dist/collection/scripts/index.js +2 -0
  51. package/dist/collection/types/generated/graphql.customer.types.js +1 -0
  52. package/dist/collection/types/generated/graphql.frontend.types.js +1 -0
  53. package/dist/esm/{cart-cc593c2b.js → cart-1a37e002.js} +7 -56
  54. package/dist/esm/index.js +625 -0
  55. package/dist/esm/loader.js +1 -1
  56. package/dist/esm/logError-c456c092.js +55 -0
  57. package/dist/esm/{submitGtag-e50f903f.js → submitGtag-754935b4.js} +2 -1
  58. package/dist/esm/zonos-address_8.entry.js +11 -10
  59. package/dist/esm/zonos-badge_2.entry.js +3 -3
  60. package/dist/esm/zonos-button_3.entry.js +3 -3
  61. package/dist/esm/zonos-card_2.entry.js +7 -6
  62. package/dist/esm/zonos-cart-items_11.entry.js +11 -10
  63. package/dist/esm/zonos-checkout.entry.js +8 -3
  64. package/dist/esm/zonos-controller.entry.js +30 -3
  65. package/dist/esm/zonos-country-flag.entry.js +2 -1
  66. package/dist/esm/zonos-country-select_3.entry.js +6 -5
  67. package/dist/esm/zonos-elements.js +1 -1
  68. package/dist/esm/zonos-hello-dialog.entry.js +2 -1
  69. package/dist/esm/zonos-hello.entry.js +2 -1
  70. package/dist/esm/zonos-input.entry.js +4 -4
  71. package/dist/esm/zonos-link.entry.js +1 -1
  72. package/dist/esm/zonos-payment.entry.js +2 -1
  73. package/dist/esm-es5/cart-1a37e002.js +1 -0
  74. package/dist/esm-es5/index.js +1 -0
  75. package/dist/esm-es5/loader.js +1 -1
  76. package/dist/esm-es5/logError-c456c092.js +1 -0
  77. package/dist/esm-es5/submitGtag-754935b4.js +1 -0
  78. package/dist/esm-es5/zonos-address_8.entry.js +1 -1
  79. package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
  80. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  81. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  82. package/dist/esm-es5/zonos-cart-items_11.entry.js +1 -1
  83. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  84. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  85. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  86. package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
  87. package/dist/esm-es5/zonos-elements.js +1 -1
  88. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  89. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  90. package/dist/esm-es5/zonos-input.entry.js +1 -1
  91. package/dist/esm-es5/zonos-link.entry.js +1 -1
  92. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  93. package/dist/scripts/index.d.ts +3908 -0
  94. package/dist/scripts/index.js +1 -0
  95. package/dist/scripts/loadZonos.d.ts +3954 -0
  96. package/dist/scripts/loadZonos.js +1 -1
  97. package/dist/scripts/zonos.js +1 -1
  98. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +5 -7
  99. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +2 -2
  100. package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +2 -2
  101. package/dist/types/components/main/zonos-controller.d.ts +6 -1
  102. package/dist/types/components/store/checkout/stripe.d.ts +1 -1
  103. package/dist/types/components/store/zonosStore.d.ts +1 -1
  104. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +2 -2
  105. package/dist/types/components/utils/styles.d.ts +1 -0
  106. package/dist/types/components.d.ts +22 -14
  107. package/dist/types/index.d.ts +1 -0
  108. package/dist/types/scripts/_extractZonosQaUrl.d.ts +11 -0
  109. package/dist/types/scripts/_getZonosQaUrl.d.ts +4 -0
  110. package/dist/types/scripts/{loadStripe.d.ts → _loadStripe.d.ts} +1 -1
  111. package/dist/types/scripts/{zonosBase.d.ts → _zonosBase.d.ts} +36 -2
  112. package/dist/types/scripts/index.d.ts +2 -0
  113. package/dist/types/types/checkout/CheckoutConfig.d.ts +5 -0
  114. package/dist/types/types/checkout/api/CalculateLandedCostRequest.d.ts +9 -0
  115. package/dist/types/types/generated/graphql.customer.types.d.ts +1 -0
  116. package/dist/types/types/generated/graphql.customer.types.ts +3 -0
  117. package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -0
  118. package/dist/types/types/generated/graphql.frontend.types.ts +1 -0
  119. package/dist/types/types/global.d.ts +1 -1
  120. package/dist/zonos-elements/index.esm.js +1 -0
  121. package/dist/zonos-elements/p-0878369a.entry.js +1 -0
  122. package/dist/zonos-elements/p-0d1c06d7.entry.js +1 -0
  123. package/dist/zonos-elements/{p-9aab3ad7.entry.js → p-0d5b5bcc.entry.js} +1 -1
  124. package/dist/zonos-elements/p-1491717a.entry.js +1 -0
  125. package/dist/zonos-elements/p-14ff42fe.system.entry.js +1 -0
  126. package/dist/zonos-elements/p-2800c274.system.entry.js +1 -0
  127. package/dist/zonos-elements/p-2e02a76f.system.entry.js +1 -0
  128. package/dist/zonos-elements/{p-020a9b86.entry.js → p-3ba8838a.entry.js} +1 -1
  129. package/dist/zonos-elements/p-4594a125.js +1 -0
  130. package/dist/zonos-elements/p-483e1724.entry.js +1 -0
  131. package/dist/zonos-elements/{p-d0bc8902.system.entry.js → p-4f72bfee.system.entry.js} +1 -1
  132. package/dist/zonos-elements/p-58be220f.system.js +1 -0
  133. package/dist/zonos-elements/{p-9e9c318b.entry.js → p-58fc8ec1.entry.js} +1 -1
  134. package/dist/zonos-elements/p-63db40b9.system.js +1 -0
  135. package/dist/zonos-elements/p-6449c92b.js +1 -0
  136. package/dist/zonos-elements/p-6746455b.system.entry.js +1 -0
  137. package/dist/zonos-elements/{p-c20e5430.entry.js → p-6cb9812b.entry.js} +1 -1
  138. package/dist/zonos-elements/p-7487ef47.entry.js +1 -0
  139. package/dist/zonos-elements/p-7b2d367b.entry.js +1 -0
  140. package/dist/zonos-elements/p-9389cc42.system.entry.js +1 -0
  141. package/dist/zonos-elements/p-9be6c62b.system.js +1 -0
  142. package/dist/zonos-elements/p-9c242e4b.system.entry.js +1 -0
  143. package/dist/zonos-elements/p-a37796e1.entry.js +1 -0
  144. package/dist/zonos-elements/p-afb89d65.entry.js +1 -0
  145. package/dist/zonos-elements/p-bbb84165.system.entry.js +1 -0
  146. package/dist/zonos-elements/{p-96b8c9ba.system.entry.js → p-bdfa3705.system.entry.js} +1 -1
  147. package/dist/zonos-elements/p-c195e980.system.entry.js +1 -0
  148. package/dist/zonos-elements/p-c87c76d4.entry.js +1 -0
  149. package/dist/zonos-elements/p-d9011df9.entry.js +1 -0
  150. package/dist/zonos-elements/{p-3e26d7b3.system.entry.js → p-dda78e8e.system.entry.js} +1 -1
  151. package/dist/zonos-elements/p-de9e610d.system.entry.js +1 -0
  152. package/dist/zonos-elements/p-e0bf9666.system.js +1 -1
  153. package/dist/zonos-elements/p-eaa335e1.js +1 -0
  154. package/dist/zonos-elements/{p-e13bfbda.system.entry.js → p-ed3524ae.system.entry.js} +1 -1
  155. package/dist/zonos-elements/p-f5b14bab.system.js +1 -0
  156. package/dist/zonos-elements/p-f9a42a3c.system.entry.js +1 -0
  157. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  158. package/package.json +4 -2
  159. package/dist/components/ILanguage.js +0 -24
  160. package/dist/components/classes.js +0 -12
  161. package/dist/components/containsNonLatinChars.js +0 -21
  162. package/dist/components/formatCurrency.js +0 -11
  163. package/dist/components/getBorderRadius.js +0 -18
  164. package/dist/components/index.d.ts +0 -33
  165. package/dist/components/index.js +0 -1
  166. package/dist/components/isCheckoutMobile.js +0 -6
  167. package/dist/components/isColorVariable.js +0 -14
  168. package/dist/components/isDarkColor.js +0 -1199
  169. package/dist/components/stripe.js +0 -1691
  170. package/dist/components/submitGtag.js +0 -19
  171. package/dist/components/trackConversionEvent.js +0 -37
  172. package/dist/components/translationStore.js +0 -5611
  173. package/dist/components/zonos-address-display.d.ts +0 -11
  174. package/dist/components/zonos-address-display.js +0 -6
  175. package/dist/components/zonos-address-display2.js +0 -64
  176. package/dist/components/zonos-address-form.d.ts +0 -11
  177. package/dist/components/zonos-address-form.js +0 -6
  178. package/dist/components/zonos-address-form2.js +0 -84
  179. package/dist/components/zonos-address-update-dialog.d.ts +0 -11
  180. package/dist/components/zonos-address-update-dialog.js +0 -6
  181. package/dist/components/zonos-address-update-dialog2.js +0 -264
  182. package/dist/components/zonos-address.d.ts +0 -11
  183. package/dist/components/zonos-address.js +0 -6
  184. package/dist/components/zonos-address2.js +0 -176
  185. package/dist/components/zonos-badge.d.ts +0 -11
  186. package/dist/components/zonos-badge.js +0 -6
  187. package/dist/components/zonos-badge2.js +0 -61
  188. package/dist/components/zonos-banner.d.ts +0 -11
  189. package/dist/components/zonos-banner.js +0 -6
  190. package/dist/components/zonos-banner2.js +0 -95
  191. package/dist/components/zonos-button.d.ts +0 -11
  192. package/dist/components/zonos-button.js +0 -6
  193. package/dist/components/zonos-button2.js +0 -186
  194. package/dist/components/zonos-card.d.ts +0 -11
  195. package/dist/components/zonos-card.js +0 -6
  196. package/dist/components/zonos-card2.js +0 -57
  197. package/dist/components/zonos-cart-items.d.ts +0 -11
  198. package/dist/components/zonos-cart-items.js +0 -6
  199. package/dist/components/zonos-cart-items2.js +0 -57
  200. package/dist/components/zonos-cart-restricted-items.d.ts +0 -11
  201. package/dist/components/zonos-cart-restricted-items.js +0 -6
  202. package/dist/components/zonos-cart-restricted-items2.js +0 -135
  203. package/dist/components/zonos-cart-subtotal.d.ts +0 -11
  204. package/dist/components/zonos-cart-subtotal.js +0 -6
  205. package/dist/components/zonos-cart-subtotal2.js +0 -91
  206. package/dist/components/zonos-checkbox.d.ts +0 -11
  207. package/dist/components/zonos-checkbox.js +0 -6
  208. package/dist/components/zonos-checkbox2.js +0 -96
  209. package/dist/components/zonos-checkout-finish.d.ts +0 -11
  210. package/dist/components/zonos-checkout-finish.js +0 -6
  211. package/dist/components/zonos-checkout-finish2.js +0 -246
  212. package/dist/components/zonos-checkout-footer.d.ts +0 -11
  213. package/dist/components/zonos-checkout-footer.js +0 -6
  214. package/dist/components/zonos-checkout-footer2.js +0 -125
  215. package/dist/components/zonos-checkout-payment.d.ts +0 -11
  216. package/dist/components/zonos-checkout-payment.js +0 -6
  217. package/dist/components/zonos-checkout-payment2.js +0 -104
  218. package/dist/components/zonos-checkout-progress-tabs.d.ts +0 -11
  219. package/dist/components/zonos-checkout-progress-tabs.js +0 -6
  220. package/dist/components/zonos-checkout-progress-tabs2.js +0 -138
  221. package/dist/components/zonos-checkout.d.ts +0 -11
  222. package/dist/components/zonos-checkout.js +0 -1051
  223. package/dist/components/zonos-collapse.d.ts +0 -11
  224. package/dist/components/zonos-collapse.js +0 -6
  225. package/dist/components/zonos-collapse2.js +0 -78
  226. package/dist/components/zonos-component.d.ts +0 -11
  227. package/dist/components/zonos-component.js +0 -48
  228. package/dist/components/zonos-confirm-dialog.d.ts +0 -11
  229. package/dist/components/zonos-confirm-dialog.js +0 -6
  230. package/dist/components/zonos-confirm-dialog2.js +0 -161
  231. package/dist/components/zonos-controller.d.ts +0 -11
  232. package/dist/components/zonos-controller.js +0 -309
  233. package/dist/components/zonos-country-flag.d.ts +0 -11
  234. package/dist/components/zonos-country-flag.js +0 -6
  235. package/dist/components/zonos-country-flag2.js +0 -54
  236. package/dist/components/zonos-country-select.d.ts +0 -11
  237. package/dist/components/zonos-country-select.js +0 -6
  238. package/dist/components/zonos-country-select2.js +0 -1891
  239. package/dist/components/zonos-custom-message.d.ts +0 -11
  240. package/dist/components/zonos-custom-message.js +0 -6
  241. package/dist/components/zonos-custom-message2.js +0 -72
  242. package/dist/components/zonos-customer-info.d.ts +0 -11
  243. package/dist/components/zonos-customer-info.js +0 -6
  244. package/dist/components/zonos-customer-info2.js +0 -316
  245. package/dist/components/zonos-dialog.d.ts +0 -11
  246. package/dist/components/zonos-dialog.js +0 -6
  247. package/dist/components/zonos-dialog2.js +0 -136
  248. package/dist/components/zonos-hello-dialog-footer.d.ts +0 -11
  249. package/dist/components/zonos-hello-dialog-footer.js +0 -6
  250. package/dist/components/zonos-hello-dialog-footer2.js +0 -83
  251. package/dist/components/zonos-hello-dialog.d.ts +0 -11
  252. package/dist/components/zonos-hello-dialog.js +0 -6
  253. package/dist/components/zonos-hello-dialog2.js +0 -305
  254. package/dist/components/zonos-hello.d.ts +0 -11
  255. package/dist/components/zonos-hello.js +0 -879
  256. package/dist/components/zonos-icon.d.ts +0 -11
  257. package/dist/components/zonos-icon.js +0 -6
  258. package/dist/components/zonos-icon2.js +0 -55
  259. package/dist/components/zonos-input.d.ts +0 -11
  260. package/dist/components/zonos-input.js +0 -6
  261. package/dist/components/zonos-input2.js +0 -78
  262. package/dist/components/zonos-language-select.d.ts +0 -11
  263. package/dist/components/zonos-language-select.js +0 -6
  264. package/dist/components/zonos-language-select2.js +0 -88
  265. package/dist/components/zonos-link-authentication.d.ts +0 -11
  266. package/dist/components/zonos-link-authentication.js +0 -6
  267. package/dist/components/zonos-link-authentication2.js +0 -80
  268. package/dist/components/zonos-link.d.ts +0 -11
  269. package/dist/components/zonos-link.js +0 -43
  270. package/dist/components/zonos-logo.d.ts +0 -11
  271. package/dist/components/zonos-logo.js +0 -49
  272. package/dist/components/zonos-notification.d.ts +0 -11
  273. package/dist/components/zonos-notification.js +0 -6
  274. package/dist/components/zonos-notification2.js +0 -92
  275. package/dist/components/zonos-payment.d.ts +0 -11
  276. package/dist/components/zonos-payment.js +0 -6
  277. package/dist/components/zonos-payment2.js +0 -77
  278. package/dist/components/zonos-review.d.ts +0 -11
  279. package/dist/components/zonos-review.js +0 -6
  280. package/dist/components/zonos-review2.js +0 -89
  281. package/dist/components/zonos-select-dialog-header.d.ts +0 -11
  282. package/dist/components/zonos-select-dialog-header.js +0 -6
  283. package/dist/components/zonos-select-dialog-header2.js +0 -71
  284. package/dist/components/zonos-shipping-rich-radio.d.ts +0 -11
  285. package/dist/components/zonos-shipping-rich-radio.js +0 -6
  286. package/dist/components/zonos-shipping-rich-radio2.js +0 -88
  287. package/dist/components/zonos-shipping.d.ts +0 -11
  288. package/dist/components/zonos-shipping.js +0 -6
  289. package/dist/components/zonos-shipping2.js +0 -159
  290. package/dist/components/zonos-spinner.d.ts +0 -11
  291. package/dist/components/zonos-spinner.js +0 -6
  292. package/dist/components/zonos-spinner2.js +0 -43
  293. package/dist/components/zonos-text.d.ts +0 -11
  294. package/dist/components/zonos-text.js +0 -6
  295. package/dist/components/zonos-text2.js +0 -182
  296. package/dist/components/zonos-tooltip.d.ts +0 -11
  297. package/dist/components/zonos-tooltip.js +0 -6
  298. package/dist/components/zonos-tooltip2.js +0 -48
  299. package/dist/components/zonos-v-stack.d.ts +0 -11
  300. package/dist/components/zonos-v-stack.js +0 -6
  301. package/dist/components/zonos-v-stack2.js +0 -38
  302. package/dist/components/zonosStore.js +0 -2881
  303. package/dist/esm-es5/cart-cc593c2b.js +0 -1
  304. package/dist/esm-es5/submitGtag-e50f903f.js +0 -1
  305. package/dist/scripts/checkIfLoadVersionDomain.js +0 -1
  306. package/dist/scripts/extractZonosQaUrl.js +0 -1
  307. package/dist/scripts/getTempCartById.js +0 -1
  308. package/dist/scripts/loadStripe.js +0 -1
  309. package/dist/scripts/stripe.js +0 -1
  310. package/dist/scripts/zonosBase.js +0 -1
  311. package/dist/zonos-elements/p-04030a48.entry.js +0 -1
  312. package/dist/zonos-elements/p-0e892292.entry.js +0 -1
  313. package/dist/zonos-elements/p-0fac99e7.entry.js +0 -1
  314. package/dist/zonos-elements/p-1795c760.system.entry.js +0 -1
  315. package/dist/zonos-elements/p-24ac1c6f.entry.js +0 -1
  316. package/dist/zonos-elements/p-26a60a6e.entry.js +0 -1
  317. package/dist/zonos-elements/p-32744531.entry.js +0 -1
  318. package/dist/zonos-elements/p-35ac375a.system.entry.js +0 -1
  319. package/dist/zonos-elements/p-3bc88c3c.system.entry.js +0 -1
  320. package/dist/zonos-elements/p-4caaaaeb.system.entry.js +0 -1
  321. package/dist/zonos-elements/p-50ea2036.system.js +0 -1
  322. package/dist/zonos-elements/p-5e783394.entry.js +0 -1
  323. package/dist/zonos-elements/p-6366e7e3.entry.js +0 -1
  324. package/dist/zonos-elements/p-7c8ee4b9.system.entry.js +0 -1
  325. package/dist/zonos-elements/p-80ea85b8.entry.js +0 -1
  326. package/dist/zonos-elements/p-8da16d53.system.js +0 -1
  327. package/dist/zonos-elements/p-98a0b694.system.entry.js +0 -1
  328. package/dist/zonos-elements/p-b98cdf39.system.entry.js +0 -1
  329. package/dist/zonos-elements/p-d7b8c1c1.system.entry.js +0 -1
  330. package/dist/zonos-elements/p-dd0fd351.entry.js +0 -1
  331. package/dist/zonos-elements/p-e015cb0e.js +0 -1
  332. package/dist/zonos-elements/p-e1fbd05d.system.entry.js +0 -1
  333. package/dist/zonos-elements/p-e553dd19.js +0 -1
  334. package/dist/zonos-elements/p-e6fa0ebc.system.js +0 -1
  335. package/dist/zonos-elements/p-f6546bf4.system.entry.js +0 -1
  336. /package/dist/collection/components/common/{component-template/zonos-link → zonos-link}/zonos-link.css +0 -0
  337. /package/dist/collection/scripts/{checkIfLoadVersionDomain.js → _checkIfLoadVersionDomain.js} +0 -0
  338. /package/dist/collection/scripts/{stripe.js → _stripe.js} +0 -0
  339. /package/dist/types/components/common/{component-template/zonos-link → zonos-link}/zonos-link.d.ts +0 -0
  340. /package/dist/types/scripts/{checkIfLoadVersionDomain.d.ts → _checkIfLoadVersionDomain.d.ts} +0 -0
  341. /package/dist/types/scripts/{stripe.d.ts → _stripe.d.ts} +0 -0
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-7c6205ca.js');
4
+ const logError = require('./logError-4e2f2020.js');
4
5
  const isDarkColor = require('./isDarkColor-b0393089.js');
5
6
  const getBorderRadius = require('./getBorderRadius-bcb309a8.js');
6
7
 
@@ -5745,60 +5746,6 @@ const getCountries = async () => {
5745
5746
  }
5746
5747
  };
5747
5748
 
5748
- const log = (message, type, ...additionalInfo) => {
5749
- var _a, _b;
5750
- const isDebug = !!((_a = window.Zonos) === null || _a === void 0 ? void 0 : _a.debug) ||
5751
- !!window.location.search.match(/\?.*(&*)zonosDebug=1/);
5752
- // if debug is false, do not log
5753
- if (!isDebug) {
5754
- // log errors to the console if the type is error
5755
- if (type === 'error') {
5756
- // eslint-disable-next-line no-console
5757
- console.error(message, ...additionalInfo);
5758
- }
5759
- return;
5760
- }
5761
- let loggingIframe = document.querySelector('iframe#zonos---debug-logging-iframe');
5762
- if (!loggingIframe) {
5763
- // add a hidden iframe
5764
- loggingIframe = document.createElement('iframe');
5765
- loggingIframe.id = 'zonos---debug-logging-iframe';
5766
- loggingIframe.style.display = 'none';
5767
- loggingIframe.style.opacity = '0';
5768
- loggingIframe.style.position = 'absolute';
5769
- loggingIframe.style.top = '-9999px';
5770
- loggingIframe.style.left = '-9999px';
5771
- loggingIframe.style.width = '1px';
5772
- loggingIframe.style.height = '1px';
5773
- loggingIframe.style.border = 'none';
5774
- loggingIframe.style.overflow = 'hidden';
5775
- loggingIframe.style.visibility = 'hidden';
5776
- document.body.appendChild(loggingIframe);
5777
- }
5778
- // use the logging iframe's console to log just in case the console is disabled (overriden) by the site owner
5779
- const zConsole = ((_b = loggingIframe.contentWindow) === null || _b === void 0 ? void 0 : _b.window.console) || window.console;
5780
- switch (type) {
5781
- case 'warn':
5782
- zConsole.warn(message, ...additionalInfo);
5783
- break;
5784
- case 'info':
5785
- zConsole.info(message, ...additionalInfo);
5786
- break;
5787
- case 'error':
5788
- zConsole.error(message, ...additionalInfo);
5789
- break;
5790
- default:
5791
- zConsole.groupCollapsed(message, ...additionalInfo);
5792
- zConsole.trace();
5793
- zConsole.groupEnd();
5794
- break;
5795
- }
5796
- };
5797
-
5798
- const logError = (message, ...rest) => {
5799
- log(message, 'error', ...rest);
5800
- };
5801
-
5802
5749
  const getCountryLandedCost = async (countryCode) => {
5803
5750
  var _a;
5804
5751
  if (!countryCode) {
@@ -5807,7 +5754,7 @@ const getCountryLandedCost = async (countryCode) => {
5807
5754
  const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/country-landed-cost/${countryCode}`;
5808
5755
  const { errors, json } = await handleFetch(url);
5809
5756
  if (errors.length || !json) {
5810
- logError(`Error fetching country landed cost: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
5757
+ logError.logError(`Error fetching country landed cost: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
5811
5758
  return null;
5812
5759
  }
5813
5760
  return json || null;
@@ -5822,7 +5769,7 @@ const getExchangeRate = async ({ country, isGuaranteed, sourceCurrency, targetCu
5822
5769
  const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/exchange-rates?sourceCurrency=${sourceCurrency}&targetCurrency=${targetCurrency}&isGuaranteed=${isGuaranteed}&country=${country}`;
5823
5770
  const { errors, json } = await handleFetch(url);
5824
5771
  if (errors.length || !json) {
5825
- logError(`Error fetching country landed cost: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
5772
+ logError.logError(`Error fetching country landed cost: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
5826
5773
  return { exchangeRate: null, maxAge: null };
5827
5774
  }
5828
5775
  const { maxAge, rate, targetFormat } = json.exchangeRateCreate;
@@ -5839,7 +5786,7 @@ const getLocaleMessages = async ({ countryCode, localeTo, storeId, }) => {
5839
5786
  const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/locale-messages?countryCode=${countryCode}&storeId=${storeId}&localeTo=${localeTo}`;
5840
5787
  const { errors, json } = await handleFetch(url);
5841
5788
  if (errors.length || !json) {
5842
- logError('Error fetching exchange rate', (_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message);
5789
+ logError.logError('Error fetching exchange rate', (_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message);
5843
5790
  return [];
5844
5791
  }
5845
5792
  return json.locale_countryCodesPage;
@@ -5883,7 +5830,7 @@ const getShippingZones = async () => {
5883
5830
  const url = `${"https://v1.route.js.zonos.com"}/api/zonos-elements/shipping-zones`;
5884
5831
  const { errors, json } = await handleFetch(url);
5885
5832
  if (errors.length || !json) {
5886
- logError(`Error fetching shipping zones: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
5833
+ logError.logError(`Error fetching shipping zones: ${(_a = errors.find(Boolean)) === null || _a === void 0 ? void 0 : _a.message}`);
5887
5834
  return null;
5888
5835
  }
5889
5836
  const shippingZones = (_b = json === null || json === void 0 ? void 0 : json.shippingZones) === null || _b === void 0 ? void 0 : _b.flatMap(zone => zone === null || zone === void 0 ? void 0 : zone.countryCodes).filter(Boolean);
@@ -5960,12 +5907,12 @@ const isValidSelector = (selector) => {
5960
5907
  const getCurrencyElements = (selector) => {
5961
5908
  const currencySelector = selector || '.money';
5962
5909
  if (!isValidSelector(currencySelector)) {
5963
- logError(`Currency element selector "${currencySelector}" is not valid.`);
5910
+ logError.logError(`Currency element selector "${currencySelector}" is not valid.`);
5964
5911
  return null;
5965
5912
  }
5966
5913
  const currencyElements = document.querySelectorAll(currencySelector);
5967
5914
  if (!currencyElements.length) {
5968
- log(`No currency elements found with selector "${currencySelector}"`, 'warn');
5915
+ logError.log(`No currency elements found with selector "${currencySelector}"`, 'warn');
5969
5916
  return null;
5970
5917
  }
5971
5918
  // return array of currency elements instead of a NodeList
@@ -6020,7 +5967,7 @@ const defaultCurrencyConverter = () => {
6020
5967
  return;
6021
5968
  }
6022
5969
  if (!localizationStore.exchangeRate) {
6023
- logError('Could not display currency. Exchange rate and format data is not available.');
5970
+ logError.logError('Could not display currency. Exchange rate and format data is not available.');
6024
5971
  return;
6025
5972
  }
6026
5973
  currencyElements.forEach((element) => {
@@ -6063,7 +6010,11 @@ const setZCountryUrlParam = (selectedCountryCode) => {
6063
6010
  const urlSearchParams = new URLSearchParams(window.location.search);
6064
6011
  urlSearchParams.set('zCountry', selectedCountryCode);
6065
6012
  const newUrl = `${window.location.pathname}?${urlSearchParams.toString()}`;
6066
- window.history.replaceState({}, '', newUrl);
6013
+ /**
6014
+ * Setting the state to null in window.history.replaceState can cause issues with rendering when using next/link and pressing the back button.
6015
+ * @ref https://github.com/vercel/next.js/issues/33233#issuecomment-1052349396
6016
+ **/
6017
+ window.history.replaceState(window.history.state, document.title, newUrl);
6067
6018
  };
6068
6019
 
6069
6020
  const { onChange: localizationStoreOnUpdate, state: localizationStore } = zonosStore.createStore({
@@ -6105,7 +6056,7 @@ const startExchangeRateTimeout = ({ isGuaranteed, maxAge, }) => {
6105
6056
  }, maxAgeToUse * 1000);
6106
6057
  };
6107
6058
  const getNewLocalization = async () => {
6108
- log('get new localization store');
6059
+ logError.log('get new localization store');
6109
6060
  const { isShippableCountry, selectedCountryCode } = localizationStore;
6110
6061
  if (zonosStore.zonosStore.helloSettings.currencyBehavior === 'DISABLED' ||
6111
6062
  !isShippableCountry ||
@@ -6143,7 +6094,7 @@ const getOverrideLocale = () => {
6143
6094
  };
6144
6095
  const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
6145
6096
  var _a, _b;
6146
- log('update selected country code');
6097
+ logError.log('update selected country code');
6147
6098
  localizationStore.selectedCountryCode = newSelectedCountryCode;
6148
6099
  const { selectedCountryCode, shippingZoneCountries } = localizationStore;
6149
6100
  const isShippableCountry = shippingZoneCountries &&
@@ -6151,7 +6102,7 @@ const localizationStoreUpdateSelectedCountryCode = (newSelectedCountryCode) => {
6151
6102
  !!shippingZoneCountries[selectedCountryCode];
6152
6103
  // update shippable country
6153
6104
  localizationStore.isShippableCountry = !!isShippableCountry;
6154
- log(`Is shippable country: ${localizationStore.isShippableCountry}`);
6105
+ logError.log(`Is shippable country: ${localizationStore.isShippableCountry}`);
6155
6106
  if (!selectedCountryCode) {
6156
6107
  return;
6157
6108
  }
@@ -6223,7 +6174,7 @@ const updateCheckoutSessionLanguage = async () => {
6223
6174
  method: 'POST',
6224
6175
  });
6225
6176
  if (errors.length || !json) {
6226
- logError('Error occurs when updating checkout session', JSON.stringify(errors, null, 2));
6177
+ logError.logError('Error occurs when updating checkout session', JSON.stringify(errors, null, 2));
6227
6178
  return { errors, json };
6228
6179
  }
6229
6180
  return { errors: [], json };
@@ -6568,7 +6519,7 @@ const initStripeElements = async (props) => {
6568
6519
  var _a, _b;
6569
6520
  const clientSecret = stripeStore.clientSecret;
6570
6521
  if (!stripeStore.stripe) {
6571
- log('Skip. Stripe is not initialized');
6522
+ logError.log('Skip. Stripe is not initialized');
6572
6523
  return;
6573
6524
  }
6574
6525
  if (clientSecret) {
@@ -6588,11 +6539,11 @@ const initStripeElements = async (props) => {
6588
6539
  stripeStore.stripeElements = (_a = stripeStore.stripe) === null || _a === void 0 ? void 0 : _a.elements(stripeOptions);
6589
6540
  // save stripe elements options for later comparison
6590
6541
  stripeStore.stripeElementsOptions = stripeOptions;
6591
- log('Stripe elements initialized');
6542
+ logError.log('Stripe elements initialized');
6592
6543
  // init stripe elements for billing address
6593
6544
  stripeStore.stripeElementsForBillingAddress =
6594
6545
  (_b = stripeStore.stripe) === null || _b === void 0 ? void 0 : _b.elements(stripeOptions);
6595
- log('Stripe elements for billing address initialized');
6546
+ logError.log('Stripe elements for billing address initialized');
6596
6547
  return;
6597
6548
  }
6598
6549
  if (!isSameOptions) {
@@ -6603,7 +6554,7 @@ const initStripeElements = async (props) => {
6603
6554
  // save stripe elements options for later comparison
6604
6555
  stripeStore.stripeElementsOptions = stripeOptions;
6605
6556
  }
6606
- log('Stripe elements initialized');
6557
+ logError.log('Stripe elements initialized');
6607
6558
  }
6608
6559
  };
6609
6560
  const stripeStoreReset = () => {
@@ -6718,7 +6669,7 @@ const stripeStorePrefetchLandedCost = async () => {
6718
6669
  // default to empty array if we fail to fetch landed cost, so we can show the error message
6719
6670
  cartStore.landedCostData = [];
6720
6671
  cartStore.shippingData = [];
6721
- logError(err);
6672
+ logError.logError(err);
6722
6673
  }
6723
6674
  stripeStore.isFetchingLandedCost = false;
6724
6675
  }
@@ -6776,7 +6727,7 @@ const stripeStoreRetrievePayment = async ({ clientSecret: _clientSecret, storybo
6776
6727
  }
6777
6728
  const clientSecret = _clientSecret || stripeStore.clientSecret;
6778
6729
  if (!stripeStore.stripe || !clientSecret) {
6779
- logError('Failed to retrieve payment intent. Stripe is not initialized');
6730
+ logError.logError('Failed to retrieve payment intent. Stripe is not initialized');
6780
6731
  return { error: true, message: [translate('Something went wrong.')] };
6781
6732
  }
6782
6733
  const { paymentIntent } = await stripeStore.stripe.retrievePaymentIntent(clientSecret);
@@ -6829,7 +6780,7 @@ const stripeStoreInitCheckoutSession = async () => {
6829
6780
  var _a;
6830
6781
  const total = cartStore.items.reduce((amount, item) => amount + item.amount * item.quantity, 0);
6831
6782
  if (!total || !localizationStore.targetCurrency) {
6832
- logError('Fail to create checkout session - invalid total or currency');
6783
+ logError.logError('Fail to create checkout session - invalid total or currency');
6833
6784
  return false;
6834
6785
  }
6835
6786
  stripeStore.isFetchingSession = true;
@@ -6846,7 +6797,7 @@ const stripeStoreInitCheckoutSession = async () => {
6846
6797
  });
6847
6798
  stripeStore.isFetchingSession = false;
6848
6799
  if (errors.length || !json) {
6849
- logError('Error occurs when creating checkout session', JSON.stringify(errors, null, 2));
6800
+ logError.logError('Error occurs when creating checkout session', JSON.stringify(errors, null, 2));
6850
6801
  return false;
6851
6802
  }
6852
6803
  const result = json.checkoutSessionCreate;
@@ -6854,8 +6805,8 @@ const stripeStoreInitCheckoutSession = async () => {
6854
6805
  // update cart store with updated informations
6855
6806
  cartStore.checkoutSessionId = result.id;
6856
6807
  cartStoreApplySubtotals(Object.assign(Object.assign({}, result.subtotals), { landedCostTotal: 0, shipping: 0, total: result.subtotals.items }));
6857
- log('Exchange rate updated for cart items (checkout session create)', 'info', cartStore.exchangeRate);
6858
- log('done-init-checkout-session');
6808
+ logError.log('Exchange rate updated for cart items (checkout session create)', 'info', cartStore.exchangeRate);
6809
+ logError.log('done-init-checkout-session');
6859
6810
  return true;
6860
6811
  };
6861
6812
  /**
@@ -6875,7 +6826,7 @@ const stripeStoreUpdateCheckoutSession = async ({ currency, id, itemsAmount, lan
6875
6826
  method: 'POST',
6876
6827
  });
6877
6828
  if (errors.length || !json) {
6878
- logError('Error occurs when updating checkout session', JSON.stringify(errors, null, 2));
6829
+ logError.logError('Error occurs when updating checkout session', JSON.stringify(errors, null, 2));
6879
6830
  return { errors, json };
6880
6831
  }
6881
6832
  return { errors: [], json };
@@ -6969,7 +6920,7 @@ const stripeStoreTranslateAddressToLatin = async ({ addressInvalidCharactersList
6969
6920
  method: 'POST',
6970
6921
  });
6971
6922
  if (errors.length || !json) {
6972
- logError('Error occurs when translating address to latin', JSON.stringify(errors, null, 2));
6923
+ logError.logError('Error occurs when translating address to latin', JSON.stringify(errors, null, 2));
6973
6924
  // reset translated address if we fail to translate and let user manually fix it
6974
6925
  stripeStore.translatedAddress = {
6975
6926
  address: {},
@@ -7108,7 +7059,7 @@ const getMatchItem = ({ item1, item2, }) => {
7108
7059
  * Check and set restricted items in cart
7109
7060
  */
7110
7061
  const cartStoreCheckItemRestrictions = (itemsWorkflow) => {
7111
- log('Checking item restrictions');
7062
+ logError.log('Checking item restrictions');
7112
7063
  const mappedRestrictedItems = itemsWorkflow
7113
7064
  .map(item => {
7114
7065
  if (!item.restriction) {
@@ -7164,11 +7115,11 @@ const cartStoreReCalculateTotal = async ({ currency, itemsAmount, landedCostId,
7164
7115
  // update cart total right away if we have landed cost id to avoid order total flickering
7165
7116
  const subtotals = cartStore.selectedLandedCost.subtotals;
7166
7117
  cartStoreApplySubtotals(subtotals);
7167
- log('Exchange rate updated for cart items (landed cost subtotal)', 'info', cartStore.exchangeRate);
7118
+ logError.log('Exchange rate updated for cart items (landed cost subtotal)', 'info', cartStore.exchangeRate);
7168
7119
  }
7169
7120
  // update checkout session
7170
7121
  if (!cartStore.checkoutSessionId) {
7171
- logError('Could not update cart total without checkout session id');
7122
+ logError.logError('Could not update cart total without checkout session id');
7172
7123
  return false;
7173
7124
  }
7174
7125
  const { errors, json } = await stripeStoreUpdateCheckoutSession({
@@ -7180,7 +7131,7 @@ const cartStoreReCalculateTotal = async ({ currency, itemsAmount, landedCostId,
7180
7131
  });
7181
7132
  if (errors.length > 0 || !json) {
7182
7133
  // do nothing if we can't get checkout session
7183
- logError('Error occurs when updating checkout session');
7134
+ logError.logError('Error occurs when updating checkout session');
7184
7135
  cartStoreUpdateToErrorState({
7185
7136
  messages: [
7186
7137
  translate("There's been an error updating your checkout session. Please reload and try again or contact support if the error persists"),
@@ -7193,7 +7144,7 @@ const cartStoreReCalculateTotal = async ({ currency, itemsAmount, landedCostId,
7193
7144
  // This is when first open the checkout modal and we just want to get info from the old cart session.
7194
7145
  // use subtotals from checkout session to update cart total
7195
7146
  cartStoreApplySubtotals(json.checkoutSessionUpdate.subtotals);
7196
- log('Exchange rate updated for cart items (checkout session update)', 'info', cartStore.exchangeRate);
7147
+ logError.log('Exchange rate updated for cart items (checkout session update)', 'info', cartStore.exchangeRate);
7197
7148
  }
7198
7149
  return true;
7199
7150
  };
@@ -7319,8 +7270,6 @@ exports.localizationStore = localizationStore;
7319
7270
  exports.localizationStoreOnUpdate = localizationStoreOnUpdate;
7320
7271
  exports.localizationStoreUpdateSelectedCountryCode = localizationStoreUpdateSelectedCountryCode;
7321
7272
  exports.localizationStoreUpdateSelectedLocale = localizationStoreUpdateSelectedLocale;
7322
- exports.log = log;
7323
- exports.logError = logError;
7324
7273
  exports.setZCountryUrlParam = setZCountryUrlParam;
7325
7274
  exports.stripeStore = stripeStore;
7326
7275
  exports.stripeStoreCleanupDomesticShippingSession = stripeStoreCleanupDomesticShippingSession;