@zonos/elements 1.3.18-alpha.2 → 1.3.18-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 (334) hide show
  1. package/README.md +341 -96
  2. package/dist/cjs/{cart-941a31dd.js → cart-5468dfd1.js} +29 -84
  3. package/dist/cjs/index.cjs.js +624 -0
  4. package/dist/cjs/logError-4e2f2020.js +58 -0
  5. package/dist/cjs/{submitGtag-9210b4fe.js → submitGtag-127a220f.js} +3 -2
  6. package/dist/cjs/zonos-address_8.cjs.entry.js +13 -12
  7. package/dist/cjs/zonos-badge_2.cjs.entry.js +3 -3
  8. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  9. package/dist/cjs/zonos-card_2.cjs.entry.js +7 -6
  10. package/dist/cjs/zonos-cart-items_11.cjs.entry.js +11 -10
  11. package/dist/cjs/zonos-checkout.cjs.entry.js +15 -14
  12. package/dist/cjs/zonos-controller.cjs.entry.js +25 -20
  13. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -1
  14. package/dist/cjs/zonos-country-select_3.cjs.entry.js +6 -5
  15. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -1
  16. package/dist/cjs/zonos-hello.cjs.entry.js +10 -9
  17. package/dist/cjs/zonos-input.cjs.entry.js +4 -4
  18. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  19. package/dist/cjs/zonos-payment.cjs.entry.js +3 -2
  20. package/dist/collection/__mocks__/zonos-url/index.js +1 -0
  21. package/dist/collection/__tests__/build-utils/urlCheckOne.js +1 -1
  22. package/dist/collection/collection-manifest.json +1 -1
  23. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +4 -9
  24. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +3 -3
  25. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +3 -3
  26. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  27. package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
  28. package/dist/collection/components/common/zonos-card/zonos-card.js +3 -3
  29. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
  30. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
  31. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  32. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
  33. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +2 -2
  34. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  35. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  36. package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
  37. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  38. package/dist/collection/components/common/{component-template/zonos-link → zonos-link}/zonos-link.js +1 -1
  39. package/dist/collection/components/main/zonos-controller.js +10 -6
  40. package/dist/collection/components/stripe/zonos-address/zonos-address.js +3 -3
  41. package/dist/collection/environment.js +0 -2
  42. package/dist/collection/index.js +1 -0
  43. package/dist/collection/scripts/_extractZonosQaUrl.js +26 -0
  44. package/dist/collection/scripts/_getZonosQaUrl.js +40 -0
  45. package/dist/collection/scripts/{loadStripe.js → _loadStripe.js} +1 -1
  46. package/dist/collection/scripts/{zonosBase.js → _zonosBase.js} +29 -6
  47. package/dist/collection/scripts/index.js +2 -0
  48. package/dist/collection/types/generated/graphql.customer.types.js +1 -0
  49. package/dist/collection/types/generated/graphql.frontend.types.js +1 -0
  50. package/dist/esm/{cart-cc593c2b.js → cart-63d120e1.js} +2 -55
  51. package/dist/esm/index.js +621 -0
  52. package/dist/esm/logError-c456c092.js +55 -0
  53. package/dist/esm/{submitGtag-e50f903f.js → submitGtag-35bb3945.js} +2 -1
  54. package/dist/esm/zonos-address_8.entry.js +11 -10
  55. package/dist/esm/zonos-badge_2.entry.js +3 -3
  56. package/dist/esm/zonos-button_3.entry.js +3 -3
  57. package/dist/esm/zonos-card_2.entry.js +7 -6
  58. package/dist/esm/zonos-cart-items_11.entry.js +11 -10
  59. package/dist/esm/zonos-checkout.entry.js +3 -2
  60. package/dist/esm/zonos-controller.entry.js +8 -3
  61. package/dist/esm/zonos-country-flag.entry.js +2 -1
  62. package/dist/esm/zonos-country-select_3.entry.js +6 -5
  63. package/dist/esm/zonos-hello-dialog.entry.js +2 -1
  64. package/dist/esm/zonos-hello.entry.js +2 -1
  65. package/dist/esm/zonos-input.entry.js +4 -4
  66. package/dist/esm/zonos-link.entry.js +1 -1
  67. package/dist/esm/zonos-payment.entry.js +2 -1
  68. package/dist/esm-es5/cart-63d120e1.js +1 -0
  69. package/dist/esm-es5/index.js +1 -0
  70. package/dist/esm-es5/logError-c456c092.js +1 -0
  71. package/dist/esm-es5/submitGtag-35bb3945.js +1 -0
  72. package/dist/esm-es5/zonos-address_8.entry.js +1 -1
  73. package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
  74. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  75. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  76. package/dist/esm-es5/zonos-cart-items_11.entry.js +1 -1
  77. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  78. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  79. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  80. package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
  81. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  82. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  83. package/dist/esm-es5/zonos-input.entry.js +1 -1
  84. package/dist/esm-es5/zonos-link.entry.js +1 -1
  85. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  86. package/dist/scripts/index.d.ts +3908 -0
  87. package/dist/scripts/index.js +1 -0
  88. package/dist/scripts/loadZonos.d.ts +3954 -0
  89. package/dist/scripts/loadZonos.js +1 -1
  90. package/dist/scripts/zonos.js +1 -1
  91. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +5 -7
  92. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +2 -2
  93. package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +2 -2
  94. package/dist/types/components/main/zonos-controller.d.ts +1 -1
  95. package/dist/types/components/store/checkout/stripe.d.ts +1 -1
  96. package/dist/types/components/store/zonosStore.d.ts +1 -1
  97. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +2 -2
  98. package/dist/types/components/utils/styles.d.ts +1 -0
  99. package/dist/types/components.d.ts +22 -14
  100. package/dist/types/index.d.ts +1 -0
  101. package/dist/types/scripts/_extractZonosQaUrl.d.ts +11 -0
  102. package/dist/types/scripts/_getZonosQaUrl.d.ts +4 -0
  103. package/dist/types/scripts/{loadStripe.d.ts → _loadStripe.d.ts} +1 -1
  104. package/dist/types/scripts/{zonosBase.d.ts → _zonosBase.d.ts} +36 -2
  105. package/dist/types/scripts/index.d.ts +2 -0
  106. package/dist/types/types/checkout/CheckoutConfig.d.ts +5 -0
  107. package/dist/types/types/checkout/api/CalculateLandedCostRequest.d.ts +9 -0
  108. package/dist/types/types/generated/graphql.customer.types.d.ts +1 -0
  109. package/dist/types/types/generated/graphql.customer.types.ts +3 -0
  110. package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -0
  111. package/dist/types/types/generated/graphql.frontend.types.ts +1 -0
  112. package/dist/types/types/global.d.ts +1 -1
  113. package/dist/zonos-elements/index.esm.js +1 -0
  114. package/dist/zonos-elements/p-023c764c.system.entry.js +1 -0
  115. package/dist/zonos-elements/p-06b6ce37.system.entry.js +1 -0
  116. package/dist/zonos-elements/p-07c53d83.entry.js +1 -0
  117. package/dist/zonos-elements/{p-9aab3ad7.entry.js → p-0d5b5bcc.entry.js} +1 -1
  118. package/dist/zonos-elements/p-200b661c.entry.js +1 -0
  119. package/dist/zonos-elements/p-3b66df06.system.entry.js +1 -0
  120. package/dist/zonos-elements/{p-020a9b86.entry.js → p-3ba8838a.entry.js} +1 -1
  121. package/dist/zonos-elements/p-428c034a.entry.js +1 -0
  122. package/dist/zonos-elements/p-43b2d28d.system.entry.js +1 -0
  123. package/dist/zonos-elements/p-47a42a30.js +1 -0
  124. package/dist/zonos-elements/{p-d0bc8902.system.entry.js → p-4f72bfee.system.entry.js} +1 -1
  125. package/dist/zonos-elements/p-4fc1459c.entry.js +1 -0
  126. package/dist/zonos-elements/p-4fca8fd5.system.entry.js +1 -0
  127. package/dist/zonos-elements/{p-9e9c318b.entry.js → p-58fc8ec1.entry.js} +1 -1
  128. package/dist/zonos-elements/p-63db40b9.system.js +1 -0
  129. package/dist/zonos-elements/{p-c20e5430.entry.js → p-6cb9812b.entry.js} +1 -1
  130. package/dist/zonos-elements/p-6df1fc3a.system.entry.js +1 -0
  131. package/dist/zonos-elements/p-6f6f160d.entry.js +1 -0
  132. package/dist/zonos-elements/p-7c78e340.entry.js +1 -0
  133. package/dist/zonos-elements/p-808fa731.js +1 -0
  134. package/dist/zonos-elements/p-80f174b9.system.js +1 -0
  135. package/dist/zonos-elements/p-85f3d13f.system.js +1 -0
  136. package/dist/zonos-elements/p-8aeb0629.entry.js +1 -0
  137. package/dist/zonos-elements/p-9288fd21.system.entry.js +1 -0
  138. package/dist/zonos-elements/p-98ad4ab3.system.entry.js +1 -0
  139. package/dist/zonos-elements/p-b1567fa3.system.entry.js +1 -0
  140. package/dist/zonos-elements/p-b81562f5.entry.js +1 -0
  141. package/dist/zonos-elements/{p-96b8c9ba.system.entry.js → p-bdfa3705.system.entry.js} +1 -1
  142. package/dist/zonos-elements/p-cfae51c1.system.js +1 -0
  143. package/dist/zonos-elements/p-d6eb260c.entry.js +1 -0
  144. package/dist/zonos-elements/p-dc40a60c.entry.js +1 -0
  145. package/dist/zonos-elements/{p-3e26d7b3.system.entry.js → p-dda78e8e.system.entry.js} +1 -1
  146. package/dist/zonos-elements/p-de405d7e.system.entry.js +1 -0
  147. package/dist/zonos-elements/p-e0bf9666.system.js +1 -1
  148. package/dist/zonos-elements/p-eaa335e1.js +1 -0
  149. package/dist/zonos-elements/{p-e13bfbda.system.entry.js → p-ed3524ae.system.entry.js} +1 -1
  150. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  151. package/package.json +4 -2
  152. package/dist/components/ILanguage.js +0 -24
  153. package/dist/components/classes.js +0 -12
  154. package/dist/components/containsNonLatinChars.js +0 -21
  155. package/dist/components/formatCurrency.js +0 -11
  156. package/dist/components/getBorderRadius.js +0 -18
  157. package/dist/components/index.d.ts +0 -33
  158. package/dist/components/index.js +0 -1
  159. package/dist/components/isCheckoutMobile.js +0 -6
  160. package/dist/components/isColorVariable.js +0 -14
  161. package/dist/components/isDarkColor.js +0 -1199
  162. package/dist/components/stripe.js +0 -1691
  163. package/dist/components/submitGtag.js +0 -19
  164. package/dist/components/trackConversionEvent.js +0 -37
  165. package/dist/components/translationStore.js +0 -5611
  166. package/dist/components/zonos-address-display.d.ts +0 -11
  167. package/dist/components/zonos-address-display.js +0 -6
  168. package/dist/components/zonos-address-display2.js +0 -64
  169. package/dist/components/zonos-address-form.d.ts +0 -11
  170. package/dist/components/zonos-address-form.js +0 -6
  171. package/dist/components/zonos-address-form2.js +0 -84
  172. package/dist/components/zonos-address-update-dialog.d.ts +0 -11
  173. package/dist/components/zonos-address-update-dialog.js +0 -6
  174. package/dist/components/zonos-address-update-dialog2.js +0 -264
  175. package/dist/components/zonos-address.d.ts +0 -11
  176. package/dist/components/zonos-address.js +0 -6
  177. package/dist/components/zonos-address2.js +0 -176
  178. package/dist/components/zonos-badge.d.ts +0 -11
  179. package/dist/components/zonos-badge.js +0 -6
  180. package/dist/components/zonos-badge2.js +0 -61
  181. package/dist/components/zonos-banner.d.ts +0 -11
  182. package/dist/components/zonos-banner.js +0 -6
  183. package/dist/components/zonos-banner2.js +0 -95
  184. package/dist/components/zonos-button.d.ts +0 -11
  185. package/dist/components/zonos-button.js +0 -6
  186. package/dist/components/zonos-button2.js +0 -186
  187. package/dist/components/zonos-card.d.ts +0 -11
  188. package/dist/components/zonos-card.js +0 -6
  189. package/dist/components/zonos-card2.js +0 -57
  190. package/dist/components/zonos-cart-items.d.ts +0 -11
  191. package/dist/components/zonos-cart-items.js +0 -6
  192. package/dist/components/zonos-cart-items2.js +0 -57
  193. package/dist/components/zonos-cart-restricted-items.d.ts +0 -11
  194. package/dist/components/zonos-cart-restricted-items.js +0 -6
  195. package/dist/components/zonos-cart-restricted-items2.js +0 -135
  196. package/dist/components/zonos-cart-subtotal.d.ts +0 -11
  197. package/dist/components/zonos-cart-subtotal.js +0 -6
  198. package/dist/components/zonos-cart-subtotal2.js +0 -91
  199. package/dist/components/zonos-checkbox.d.ts +0 -11
  200. package/dist/components/zonos-checkbox.js +0 -6
  201. package/dist/components/zonos-checkbox2.js +0 -96
  202. package/dist/components/zonos-checkout-finish.d.ts +0 -11
  203. package/dist/components/zonos-checkout-finish.js +0 -6
  204. package/dist/components/zonos-checkout-finish2.js +0 -246
  205. package/dist/components/zonos-checkout-footer.d.ts +0 -11
  206. package/dist/components/zonos-checkout-footer.js +0 -6
  207. package/dist/components/zonos-checkout-footer2.js +0 -125
  208. package/dist/components/zonos-checkout-payment.d.ts +0 -11
  209. package/dist/components/zonos-checkout-payment.js +0 -6
  210. package/dist/components/zonos-checkout-payment2.js +0 -104
  211. package/dist/components/zonos-checkout-progress-tabs.d.ts +0 -11
  212. package/dist/components/zonos-checkout-progress-tabs.js +0 -6
  213. package/dist/components/zonos-checkout-progress-tabs2.js +0 -138
  214. package/dist/components/zonos-checkout.d.ts +0 -11
  215. package/dist/components/zonos-checkout.js +0 -1051
  216. package/dist/components/zonos-collapse.d.ts +0 -11
  217. package/dist/components/zonos-collapse.js +0 -6
  218. package/dist/components/zonos-collapse2.js +0 -78
  219. package/dist/components/zonos-component.d.ts +0 -11
  220. package/dist/components/zonos-component.js +0 -48
  221. package/dist/components/zonos-confirm-dialog.d.ts +0 -11
  222. package/dist/components/zonos-confirm-dialog.js +0 -6
  223. package/dist/components/zonos-confirm-dialog2.js +0 -161
  224. package/dist/components/zonos-controller.d.ts +0 -11
  225. package/dist/components/zonos-controller.js +0 -309
  226. package/dist/components/zonos-country-flag.d.ts +0 -11
  227. package/dist/components/zonos-country-flag.js +0 -6
  228. package/dist/components/zonos-country-flag2.js +0 -54
  229. package/dist/components/zonos-country-select.d.ts +0 -11
  230. package/dist/components/zonos-country-select.js +0 -6
  231. package/dist/components/zonos-country-select2.js +0 -1891
  232. package/dist/components/zonos-custom-message.d.ts +0 -11
  233. package/dist/components/zonos-custom-message.js +0 -6
  234. package/dist/components/zonos-custom-message2.js +0 -72
  235. package/dist/components/zonos-customer-info.d.ts +0 -11
  236. package/dist/components/zonos-customer-info.js +0 -6
  237. package/dist/components/zonos-customer-info2.js +0 -316
  238. package/dist/components/zonos-dialog.d.ts +0 -11
  239. package/dist/components/zonos-dialog.js +0 -6
  240. package/dist/components/zonos-dialog2.js +0 -136
  241. package/dist/components/zonos-hello-dialog-footer.d.ts +0 -11
  242. package/dist/components/zonos-hello-dialog-footer.js +0 -6
  243. package/dist/components/zonos-hello-dialog-footer2.js +0 -83
  244. package/dist/components/zonos-hello-dialog.d.ts +0 -11
  245. package/dist/components/zonos-hello-dialog.js +0 -6
  246. package/dist/components/zonos-hello-dialog2.js +0 -305
  247. package/dist/components/zonos-hello.d.ts +0 -11
  248. package/dist/components/zonos-hello.js +0 -879
  249. package/dist/components/zonos-icon.d.ts +0 -11
  250. package/dist/components/zonos-icon.js +0 -6
  251. package/dist/components/zonos-icon2.js +0 -55
  252. package/dist/components/zonos-input.d.ts +0 -11
  253. package/dist/components/zonos-input.js +0 -6
  254. package/dist/components/zonos-input2.js +0 -78
  255. package/dist/components/zonos-language-select.d.ts +0 -11
  256. package/dist/components/zonos-language-select.js +0 -6
  257. package/dist/components/zonos-language-select2.js +0 -88
  258. package/dist/components/zonos-link-authentication.d.ts +0 -11
  259. package/dist/components/zonos-link-authentication.js +0 -6
  260. package/dist/components/zonos-link-authentication2.js +0 -80
  261. package/dist/components/zonos-link.d.ts +0 -11
  262. package/dist/components/zonos-link.js +0 -43
  263. package/dist/components/zonos-logo.d.ts +0 -11
  264. package/dist/components/zonos-logo.js +0 -49
  265. package/dist/components/zonos-notification.d.ts +0 -11
  266. package/dist/components/zonos-notification.js +0 -6
  267. package/dist/components/zonos-notification2.js +0 -92
  268. package/dist/components/zonos-payment.d.ts +0 -11
  269. package/dist/components/zonos-payment.js +0 -6
  270. package/dist/components/zonos-payment2.js +0 -77
  271. package/dist/components/zonos-review.d.ts +0 -11
  272. package/dist/components/zonos-review.js +0 -6
  273. package/dist/components/zonos-review2.js +0 -89
  274. package/dist/components/zonos-select-dialog-header.d.ts +0 -11
  275. package/dist/components/zonos-select-dialog-header.js +0 -6
  276. package/dist/components/zonos-select-dialog-header2.js +0 -71
  277. package/dist/components/zonos-shipping-rich-radio.d.ts +0 -11
  278. package/dist/components/zonos-shipping-rich-radio.js +0 -6
  279. package/dist/components/zonos-shipping-rich-radio2.js +0 -88
  280. package/dist/components/zonos-shipping.d.ts +0 -11
  281. package/dist/components/zonos-shipping.js +0 -6
  282. package/dist/components/zonos-shipping2.js +0 -159
  283. package/dist/components/zonos-spinner.d.ts +0 -11
  284. package/dist/components/zonos-spinner.js +0 -6
  285. package/dist/components/zonos-spinner2.js +0 -43
  286. package/dist/components/zonos-text.d.ts +0 -11
  287. package/dist/components/zonos-text.js +0 -6
  288. package/dist/components/zonos-text2.js +0 -182
  289. package/dist/components/zonos-tooltip.d.ts +0 -11
  290. package/dist/components/zonos-tooltip.js +0 -6
  291. package/dist/components/zonos-tooltip2.js +0 -48
  292. package/dist/components/zonos-v-stack.d.ts +0 -11
  293. package/dist/components/zonos-v-stack.js +0 -6
  294. package/dist/components/zonos-v-stack2.js +0 -38
  295. package/dist/components/zonosStore.js +0 -2881
  296. package/dist/esm-es5/cart-cc593c2b.js +0 -1
  297. package/dist/esm-es5/submitGtag-e50f903f.js +0 -1
  298. package/dist/scripts/checkIfLoadVersionDomain.js +0 -1
  299. package/dist/scripts/extractZonosQaUrl.js +0 -1
  300. package/dist/scripts/getTempCartById.js +0 -1
  301. package/dist/scripts/loadStripe.js +0 -1
  302. package/dist/scripts/stripe.js +0 -1
  303. package/dist/scripts/zonosBase.js +0 -1
  304. package/dist/zonos-elements/p-04030a48.entry.js +0 -1
  305. package/dist/zonos-elements/p-0e892292.entry.js +0 -1
  306. package/dist/zonos-elements/p-0fac99e7.entry.js +0 -1
  307. package/dist/zonos-elements/p-1795c760.system.entry.js +0 -1
  308. package/dist/zonos-elements/p-24ac1c6f.entry.js +0 -1
  309. package/dist/zonos-elements/p-26a60a6e.entry.js +0 -1
  310. package/dist/zonos-elements/p-32744531.entry.js +0 -1
  311. package/dist/zonos-elements/p-35ac375a.system.entry.js +0 -1
  312. package/dist/zonos-elements/p-3bc88c3c.system.entry.js +0 -1
  313. package/dist/zonos-elements/p-4caaaaeb.system.entry.js +0 -1
  314. package/dist/zonos-elements/p-50ea2036.system.js +0 -1
  315. package/dist/zonos-elements/p-5e783394.entry.js +0 -1
  316. package/dist/zonos-elements/p-6366e7e3.entry.js +0 -1
  317. package/dist/zonos-elements/p-7c8ee4b9.system.entry.js +0 -1
  318. package/dist/zonos-elements/p-80ea85b8.entry.js +0 -1
  319. package/dist/zonos-elements/p-8da16d53.system.js +0 -1
  320. package/dist/zonos-elements/p-98a0b694.system.entry.js +0 -1
  321. package/dist/zonos-elements/p-b98cdf39.system.entry.js +0 -1
  322. package/dist/zonos-elements/p-d7b8c1c1.system.entry.js +0 -1
  323. package/dist/zonos-elements/p-dd0fd351.entry.js +0 -1
  324. package/dist/zonos-elements/p-e015cb0e.js +0 -1
  325. package/dist/zonos-elements/p-e1fbd05d.system.entry.js +0 -1
  326. package/dist/zonos-elements/p-e553dd19.js +0 -1
  327. package/dist/zonos-elements/p-e6fa0ebc.system.js +0 -1
  328. package/dist/zonos-elements/p-f6546bf4.system.entry.js +0 -1
  329. /package/dist/collection/components/common/{component-template/zonos-link → zonos-link}/zonos-link.css +0 -0
  330. /package/dist/collection/scripts/{checkIfLoadVersionDomain.js → _checkIfLoadVersionDomain.js} +0 -0
  331. /package/dist/collection/scripts/{stripe.js → _stripe.js} +0 -0
  332. /package/dist/types/components/common/{component-template/zonos-link → zonos-link}/zonos-link.d.ts +0 -0
  333. /package/dist/types/scripts/{checkIfLoadVersionDomain.d.ts → _checkIfLoadVersionDomain.d.ts} +0 -0
  334. /package/dist/types/scripts/{stripe.d.ts → _stripe.d.ts} +0 -0
@@ -1 +1 @@
1
- (function(){"use strict";"function"==typeof SuppressedError&&SuppressedError;const e=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{return await e.json()}catch(e){if(t)throw e;return o&&console.error(e),null}};const o=async(o,t)=>{const r=(function(e,o){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)o.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(t[r[n]]=e[r[n]])}return t})(t||{},[]),n=r.body?JSON.stringify(r.body):void 0,s=r.method||"GET",i=new URL(o);i.searchParams.set("zToken",(function(e){try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(window.location.hostname));const a=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},r.headers),c=Object.assign(Object.assign({},r),{body:"GET"===s?void 0:n,headers:a,method:s});return(async(o,t)=>{let r;try{r=await fetch(o,t)}catch(e){return e instanceof Error?{errors:[{message:e.message,type:"unknown"}],json:null,response:null}:{errors:[{message:"Fail to fetch",type:"unknown"}],json:null,response:null}}const n=r.headers.get("Zonos-Mode"),s=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&n&&s&&("production"===n&&alert("Please be aware that you are currently operating in the production environment. Any interactions with the customer store, including payments, will be processed as real transactions!"),"test"===n&&alert("For testing payments, you can utilize the test payment information provided at this link: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-test-the-integration"),window.Zonos.modeAlerted=!0),r.ok)return{errors:[],json:await e({response:r}),response:r};const i=r.status.toString();try{const o=await e({response:r,shouldThrow:!0});return{errors:[{message:`${i}: ${JSON.stringify(o)}`,type:i}],json:null,response:r}}catch(e){return{errors:[{message:`${i}: Unknown error`,type:i}],json:null,response:null}}})(i.toString(),c)},t=(e,o,...t)=>{var r,n;if(!(!!(null===(r=window.Zonos)||void 0===r?void 0:r.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===o&&console.error(e,...t));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(n=s.contentWindow)||void 0===n?void 0:n.window.console)||window.console;switch(o){case"warn":i.warn(e,...t);break;case"info":i.info(e,...t);break;case"error":i.error(e,...t);break;default:i.groupCollapsed(e,...t),i.trace(),i.groupEnd()}},r=(e,...o)=>{t(e,"error",...o)},n=async({endpoint:e,errors:t,metadata:r})=>{const n="userAgentData"in window.navigator?window.navigator.userAgentData:null,s={endpoint:e,errors:t,metadata:Object.assign({href:window.location.href,userAgent:n&&n.brands.length>0?n:window.navigator.userAgent},r)};o("https://v1.route.js.zonos.com/api/zonos-elements/log-error",{body:s,method:"POST"})};var s;const i=(()=>{const e=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href);if(!e)return null;if("dev-elements"===e)return"https://dev.elements.zonos.com";const o=`https://${e}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${o}' for loading script`,"warn"),fetch(o).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${o}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:t}=window.location,r=`${t}?${e.toString()}`;return window.history.replaceState({},"",r),window.location.reload(),null})),o})();class a{}s=a,a.isBigCommerce=!1,a.requested=!1,a.internationalHideSelector="",a.zonosQaUrl=null,a.tempCartData=null,a.zonosApiKey=null,a.isLegacyCheckout=!1,a.legacyStoreLogo=null,a.legacyStoreFavicon=null,a.parallelLoadTimes=[],a.paralellLoadState="off",a.loadScriptLogHandler=async({cdnLoadTime:e,fallbackLoadTime:o,isError:t,metadata:r,scriptLoadUrl:n,storeId:s,type:i})=>{try{const e=window.performance.getEntriesByType("resource").find((e=>{const o=e;return o.name.includes(n)&&"script"===o.initiatorType}));null==e||e.transferSize;(async e=>{})((e&&(null==e?void 0:e.duration)>0?parseFloat(e.duration.toFixed(2)):parseFloat(o.toFixed(2)),Object.assign({decodedBodySize:null==e?void 0:e.decodedBodySize,encodedBodySize:null==e?void 0:e.encodedBodySize,fallbackLoadTime:o,isError:!!t},r)))}catch(e){}},a.loadScriptLogParallelHandler=async e=>{try{if(s.parallelLoadTimes.push(e),2===s.parallelLoadTimes.length){const e=s.parallelLoadTimes.find((e=>"vercel"===e.type)),o=s.parallelLoadTimes.find((e=>"jsdelivr"===e.type));if(!e||!o)return;if(e.isError&&o.isError)return void n({endpoint:`<${e.scriptLoadUrl}> <${o.scriptLoadUrl}>`,errors:["Failed to fetch both Vercel and jsdelivr CDN. Perhaps network issue on customer site."],metadata:{cdnLoadTime:o.fallbackLoadTime,cdnType:o.type,vercelLoadTime:e.fallbackLoadTime}});s.loadScriptLogHandler({cdnLoadTime:o.fallbackLoadTime,fallbackLoadTime:e.fallbackLoadTime,isError:e.isError,metadata:{cdnScriptFallbackTime:o.fallbackLoadTime,cdnScriptIsError:!!o.isError,cdnScriptLoadUrl:o.scriptLoadUrl,cdnScriptType:o.type},scriptLoadUrl:e.scriptLoadUrl,storeId:e.storeId,type:e.type})}}catch(e){}},a.legacyCheckoutErrorHandler=({message:e,tempCartUUID:o})=>{r(`[ZONOS - loadZonos] ${e}`),n({endpoint:"LegacyCheckoutInit",errors:[e],metadata:{tempCartUUID:o}}),document.dispatchEvent(new CustomEvent("legacyCheckoutError",{detail:e}))},a.injectZonos=({initConfig:e,isGithubCdn:o=!1,parallelLoaded:r,url:a,version:c})=>{var l;const d=()=>{const e="https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.18-alpha.2";return c?e.replace(/@zonos\/elements@(.+)/,`@zonos/elements@${c}`):e},p=i||a,m=p.replace("https://","").replace("http://",""),u=document.createElement("script"),g=c&&c<"1.2.5"?"loadZonos.js":"zonos.js";u.src=`https://${m}/dist/scripts/${g}`,t(`[ZONOS - loadZonos] Injecting "${g}" from "${m}"`,"info");const w="4g"===(null===(l=(()=>{const e="connection"in window.navigator?window.navigator.connection:null,o="mozConnection"in window.navigator?window.navigator.mozConnection:null,t="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;return e||o||t})())||void 0===l?void 0:l.effectiveType),y=["dev.elements.zonos.com","zonos.com"].some((e=>window.location.href.includes(e))),h="on"===s.paralellLoadState&&w&&!o&&!y;if(h){const o=d();s.injectZonos({initConfig:e,isGithubCdn:!0,parallelLoaded:!0,url:o,version:c})}const f=performance.now();u.addEventListener("load",(()=>{if(h||r?s.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-f,scriptLoadUrl:u.src,storeId:s.storeId,type:o?"jsdelivr":"vercel"}):s.loadScriptLogHandler({fallbackLoadTime:performance.now()-f,scriptLoadUrl:u.src,storeId:s.storeId,type:o?"jsdelivr":"vercel"}),s.isBigCommerce||(s.isBigCommerce=!!window.stencilBootstrap||!!window.bcConfig||!!document.querySelector('script[src*="bigcommerce.com"]')),window.Zonos.zonosQaUrl=i,window.Zonos.internationalHideSelector=s.internationalHideSelector,window.Zonos.isBigCommerce=s.isBigCommerce,s.isLegacyCheckout){if(!s.zonosApiKey)throw s.legacyCheckoutErrorHandler({message:"zonosApiKey is required for legacy checkout",tempCartUUID:e.tempCartUUID}),new Error("zonosApiKey is required for legacy checkout");if(!s.tempCartData)throw s.legacyCheckoutErrorHandler({message:"tempCartData is required for legacy checkout",tempCartUUID:e.tempCartUUID}),new Error("zonosApiKey is required for legacy checkout");if(s.legacyStoreFavicon){const e=document.createElement("link");e.rel="shortcut icon",e.type="image/x-icon",e.href=s.legacyStoreFavicon,document.head.appendChild(e)}window.Zonos.tempCartData=s.tempCartData;const o=Object.assign(Object.assign({},e),{appearance:Object.assign(Object.assign({},e.appearance),{logoUrl:s.legacyStoreLogo||""}),checkoutSettings:Object.assign(Object.assign({},e.checkoutSettings),{successBehavior:"ZONOS_SUCCESS_PAGE",successRedirectUrl:s.tempCartData.contShoppingURL}),zonosApiKey:s.zonosApiKey});e=o}window.Zonos.version&&(t(`[ZONOS - loadZonos] Execute "Zonos.init" from "${g}" from "${m}"`,"info"),window.Zonos.init(e))})),u.addEventListener("error",(async()=>{if(!h&&!r){const o=d();s.injectZonos({initConfig:e,isGithubCdn:!0,url:o,version:c})}["localhost",".zonos.com"].some((e=>window.location.href.includes(e)))||i||(h||r?s.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-f,isError:!0,scriptLoadUrl:u.src,storeId:s.storeId,type:o?"jsdelivr":"vercel"}):n(o?{endpoint:u.src,errors:["zonos.js - Failed to fetch github CDN."],metadata:{cdnLoadTime:performance.now()-f,cdnType:"jsdelivr",loadUrl:p,version:c}}:{endpoint:u.src,errors:["[Info] Using alternative CDN. Failed to fetch script"],metadata:{vercelLoadTime:performance.now()-f}}))})),document.head.appendChild(u)},a.setupCartData=async e=>{const n=await(async e=>{const{errors:t,json:r}=await o("https://v1.route.js.zonos.com/api/bigcommerce/legacy-migration/get-temp-cart",{body:{tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"});return!r||t.length?null:r})(e);if(t("[ZONOS - loadZonos] getting temp cart data","info",n),!n)throw r("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),s.legacyCheckoutErrorHandler({message:"Error getting temp cart data",tempCartUUID:e}),new Error("Error getting temp cart data");return s.tempCartData=n.tempCart,s.legacyStoreLogo=n.storeLogoUrl,s.legacyStoreFavicon=n.storeFaviconUrl,{storeId:n.tempCart.storeId,zonosApiKey:n.zonosApiKey}},a.init=async e=>{var n;const i="https://v1.3.18-alpha.2.js.zonos.com",a=null===(n=document.querySelector("script[src*='/loadZonos.js']"))||void 0===n?void 0:n.src,c=document.querySelector('script[src*="/zonos.js"]'),l=null==a?void 0:a.includes("timestamp=");if(!a||!l)return void r("[ZONOS - loadZonos] A timestamp is required as a query parameter in the loadZonos.js script source. This timestamp ensures that you are loading the most recent version of the script, avoiding any cached versions.");if(c||!a||s.requested)return void t("[ZONOS - loadZonos] script is already loaded or requested","info");s.requested=!0;let d=e.storeId;if(e.tempCartUUID){const o=await s.setupCartData(e.tempCartUUID);d=o.storeId,s.zonosApiKey=o.zonosApiKey,s.isLegacyCheckout=!0}if(!d)return t("[ZONOS - loadZonos] loading latest script since storeId is not provided."),void s.injectZonos({initConfig:e,url:i,version:null});s.storeId=d;const p=new URL("https://v1.route.js.zonos.com/api/get-store-version");p.searchParams.set("storeId",e.storeId.toString());const{errors:m,json:u}=await o(p.toString());if(m.length||!u)return t("[ZONOS - loadZonos] Error getting store version, loadding the latest version.","error"),void s.injectZonos({initConfig:e,url:i,version:null});const{version:g}=u;if(!c){const{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:n}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),r=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:t}})({loadScriptSrc:a}),i=n&&!r?o:`${"alpha"===g?"alpha":`v${g}`}.js.zonos.com`,c=n&&!r?null:g;t("[ZONOS - loadZonos] injecting zonos script","info",{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:n,loadUrl:i,loadVersion:c,version:g}),s.injectZonos({initConfig:e,url:i,version:c})}},void 0===window.Zonos&&(window.Zonos=a)})();
1
+ (function(){"use strict";"function"==typeof SuppressedError&&SuppressedError;const e=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{return await e.json()}catch(e){if(t)throw e;return o&&console.error(e),null}};const o=async(o,t)=>{const r=(function(e,o){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(r=Object.getOwnPropertySymbols(e);n<r.length;n++)o.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(t[r[n]]=e[r[n]])}return t})(t||{},[]),n=r.body?JSON.stringify(r.body):void 0,s=r.method||"GET",i=new URL(o);i.searchParams.set("zToken",(function(e){try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(window.location.hostname));const a=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},r.headers),c=Object.assign(Object.assign({},r),{body:"GET"===s?void 0:n,headers:a,method:s});return(async(o,t)=>{let r;try{r=await fetch(o,t)}catch(e){return e instanceof Error?{errors:[{message:e.message,type:"unknown"}],json:null,response:null}:{errors:[{message:"Fail to fetch",type:"unknown"}],json:null,response:null}}const n=r.headers.get("Zonos-Mode"),s=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&n&&s&&("production"===n&&alert("Please be aware that you are currently operating in the production environment. Any interactions with the customer store, including payments, will be processed as real transactions!"),"test"===n&&alert("For testing payments, you can utilize the test payment information provided at this link: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-test-the-integration"),window.Zonos.modeAlerted=!0),r.ok)return{errors:[],json:await e({response:r}),response:r};const i=r.status.toString();try{const o=await e({response:r,shouldThrow:!0});return{errors:[{message:`${i}: ${JSON.stringify(o)}`,type:i}],json:null,response:r}}catch(e){return{errors:[{message:`${i}: Unknown error`,type:i}],json:null,response:null}}})(i.toString(),c)},t=(e,o,...t)=>{var r,n;if(!(!!(null===(r=window.Zonos)||void 0===r?void 0:r.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===o&&console.error(e,...t));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(n=s.contentWindow)||void 0===n?void 0:n.window.console)||window.console;switch(o){case"warn":i.warn(e,...t);break;case"info":i.info(e,...t);break;case"error":i.error(e,...t);break;default:i.groupCollapsed(e,...t),i.trace(),i.groupEnd()}},r=(e,...o)=>{t(e,"error",...o)},n=async({endpoint:e,errors:t,metadata:r})=>{const n="userAgentData"in window.navigator?window.navigator.userAgentData:null,s={endpoint:e,errors:t,metadata:Object.assign({href:window.location.href,userAgent:n&&n.brands.length>0?n:window.navigator.userAgent},r)};o("https://v1.route.js.zonos.com/api/zonos-elements/log-error",{body:s,method:"POST"})};var s;const i=(()=>{if("undefined"==typeof window)return null;const e=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href);if(!e)return null;if("dev-elements"===e)return"https://dev.elements.zonos.com";const o=`https://${e}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${o}' for loading script`,"warn"),fetch(o).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${o}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:t}=window.location,r=`${t}?${e.toString()}`;return window.history.replaceState({},"",r),window.location.reload(),null})),o})();class a{static get isNpm(){return!1}}s=a,a.isBigCommerce=!1,a.requested=!1,a.internationalHideSelector="",a.zonosQaUrl=null,a.tempCartData=null,a.zonosApiKey=null,a.isLegacyCheckout=!1,a.legacyStoreLogo=null,a.legacyStoreFavicon=null,a.parallelLoadTimes=[],a.paralellLoadState="off",a.loadScriptLogHandler=async({cdnLoadTime:e,fallbackLoadTime:o,isError:t,metadata:r,scriptLoadUrl:n,storeId:s,type:i})=>{try{const e=window.performance.getEntriesByType("resource").find((e=>{const o=e;return o.name.includes(n)&&"script"===o.initiatorType}));null==e||e.transferSize;(async e=>{})((e&&(null==e?void 0:e.duration)>0?parseFloat(e.duration.toFixed(2)):parseFloat(o.toFixed(2)),Object.assign({decodedBodySize:null==e?void 0:e.decodedBodySize,encodedBodySize:null==e?void 0:e.encodedBodySize,fallbackLoadTime:o,isError:!!t},r)))}catch(e){}},a.loadScriptLogParallelHandler=async e=>{try{if(s.parallelLoadTimes.push(e),2===s.parallelLoadTimes.length){const e=s.parallelLoadTimes.find((e=>"vercel"===e.type)),o=s.parallelLoadTimes.find((e=>"jsdelivr"===e.type));if(!e||!o)return;if(e.isError&&o.isError)return void n({endpoint:`<${e.scriptLoadUrl}> <${o.scriptLoadUrl}>`,errors:["Failed to fetch both Vercel and jsdelivr CDN. Perhaps network issue on customer site."],metadata:{cdnLoadTime:o.fallbackLoadTime,cdnType:o.type,vercelLoadTime:e.fallbackLoadTime}});s.loadScriptLogHandler({cdnLoadTime:o.fallbackLoadTime,fallbackLoadTime:e.fallbackLoadTime,isError:e.isError,metadata:{cdnScriptFallbackTime:o.fallbackLoadTime,cdnScriptIsError:!!o.isError,cdnScriptLoadUrl:o.scriptLoadUrl,cdnScriptType:o.type},scriptLoadUrl:e.scriptLoadUrl,storeId:e.storeId,type:e.type})}}catch(e){}},a.legacyCheckoutErrorHandler=({message:e,tempCartUUID:o})=>{r(`[ZONOS - loadZonos] ${e}`),n({endpoint:"LegacyCheckoutInit",errors:[e],metadata:{tempCartUUID:o}}),document.dispatchEvent(new CustomEvent("legacyCheckoutError",{detail:e}))},a.injectZonos=({initConfig:e,isGithubCdn:o=!1,parallelLoaded:r,url:a,version:c})=>{var l;const d=()=>{const e="https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.18-alpha.3";return c?e.replace(/@zonos\/elements@(.+)/,`@zonos/elements@${c}`):e},p=i||a,m=p.replace("https://","").replace("http://",""),u=document.createElement("script"),g=c&&c<"1.2.5"?"loadZonos.js":"zonos.js";u.src=`https://${m}/dist/scripts/${g}`,t(`[ZONOS - loadZonos] Injecting "${g}" from "${m}"`,"info");const w="4g"===(null===(l=(()=>{const e="connection"in window.navigator?window.navigator.connection:null,o="mozConnection"in window.navigator?window.navigator.mozConnection:null,t="webkitConnection"in window.navigator?window.navigator.webkitConnection:null;return e||o||t})())||void 0===l?void 0:l.effectiveType),y=["dev.elements.zonos.com","zonos.com"].some((e=>window.location.href.includes(e))),h="on"===s.paralellLoadState&&w&&!o&&!y;if(h){const o=d();s.injectZonos({initConfig:e,isGithubCdn:!0,parallelLoaded:!0,url:o,version:c})}const f=performance.now();u.addEventListener("load",(()=>{if(h||r?s.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-f,scriptLoadUrl:u.src,storeId:s.storeId,type:o?"jsdelivr":"vercel"}):s.loadScriptLogHandler({fallbackLoadTime:performance.now()-f,scriptLoadUrl:u.src,storeId:s.storeId,type:o?"jsdelivr":"vercel"}),s.isBigCommerce||(s.isBigCommerce=!!window.stencilBootstrap||!!window.bcConfig||!!document.querySelector('script[src*="bigcommerce.com"]')),window.Zonos.isNpm=!1,window.Zonos.zonosQaUrl=i,window.Zonos.internationalHideSelector=s.internationalHideSelector,window.Zonos.isBigCommerce=s.isBigCommerce,s.isLegacyCheckout){if(!s.zonosApiKey)throw s.legacyCheckoutErrorHandler({message:"zonosApiKey is required for legacy checkout",tempCartUUID:e.tempCartUUID}),new Error("zonosApiKey is required for legacy checkout");if(!s.tempCartData)throw s.legacyCheckoutErrorHandler({message:"tempCartData is required for legacy checkout",tempCartUUID:e.tempCartUUID}),new Error("zonosApiKey is required for legacy checkout");if(s.legacyStoreFavicon){const e=document.createElement("link");e.rel="shortcut icon",e.type="image/x-icon",e.href=s.legacyStoreFavicon,document.head.appendChild(e)}window.Zonos.tempCartData=s.tempCartData;const o=Object.assign(Object.assign({},e),{appearance:Object.assign(Object.assign({},e.appearance),{logoUrl:s.legacyStoreLogo||""}),checkoutSettings:Object.assign(Object.assign({},e.checkoutSettings),{successBehavior:"ZONOS_SUCCESS_PAGE",successRedirectUrl:s.tempCartData.contShoppingURL}),zonosApiKey:s.zonosApiKey});e=o}window.Zonos.version&&(t(`[ZONOS - loadZonos] Execute "Zonos.init" from "${g}" from "${m}"`,"info"),window.Zonos.init(e))})),u.addEventListener("error",(async()=>{if(!h&&!r){const o=d();s.injectZonos({initConfig:e,isGithubCdn:!0,url:o,version:c})}["localhost",".zonos.com"].some((e=>window.location.href.includes(e)))||i||(h||r?s.loadScriptLogParallelHandler({fallbackLoadTime:performance.now()-f,isError:!0,scriptLoadUrl:u.src,storeId:s.storeId,type:o?"jsdelivr":"vercel"}):n(o?{endpoint:u.src,errors:["zonos.js - Failed to fetch github CDN."],metadata:{cdnLoadTime:performance.now()-f,cdnType:"jsdelivr",loadUrl:p,version:c}}:{endpoint:u.src,errors:["[Info] Using alternative CDN. Failed to fetch script"],metadata:{vercelLoadTime:performance.now()-f}}))})),document.head.appendChild(u)},a.setupCartData=async e=>{const n=await(async e=>{const{errors:t,json:r}=await o("https://v1.route.js.zonos.com/api/bigcommerce/legacy-migration/get-temp-cart",{body:{tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"});return!r||t.length?null:r})(e);if(t("[ZONOS - loadZonos] getting temp cart data","info",n),!n)throw r("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),s.legacyCheckoutErrorHandler({message:"Error getting temp cart data",tempCartUUID:e}),new Error("Error getting temp cart data");return s.tempCartData=n.tempCart,s.legacyStoreLogo=n.storeLogoUrl,s.legacyStoreFavicon=n.storeFaviconUrl,{storeId:n.tempCart.storeId,zonosApiKey:n.zonosApiKey}},a.init=async e=>{var n;const i="https://v1.3.18-alpha.3.js.zonos.com",a=document.querySelector('script[src*="/zonos.js"]'),c=null===(n=document.querySelector("script[src*='/loadZonos.js']"))||void 0===n?void 0:n.src,l=null==c?void 0:c.includes("timestamp=");if(!(s.isNpm||c&&l))return void r("[ZONOS - loadZonos] A timestamp is required as a query parameter in the loadZonos.js script source. This timestamp ensures that you are loading the most recent version of the script, avoiding any cached versions.");if(a||!c||s.requested)return void t("[ZONOS - loadZonos] script is already loaded or requested","info");s.requested=!0;let d=e.storeId;if(e.tempCartUUID){const o=await s.setupCartData(e.tempCartUUID);d=o.storeId,s.zonosApiKey=o.zonosApiKey,s.isLegacyCheckout=!0}if(!d)return t("[ZONOS - loadZonos] loading latest script since storeId is not provided."),void s.injectZonos({initConfig:e,url:i,version:null});s.storeId=d;const p=new URL("https://v1.route.js.zonos.com/api/get-store-version");p.searchParams.set("storeId",e.storeId.toString());const{errors:m,json:u}=await o(p.toString());if(m.length||!u)return t("[ZONOS - loadZonos] Error getting store version, loadding the latest version.","error"),void s.injectZonos({initConfig:e,url:i,version:null});const{version:g}=u;if(!a){const{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:n}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),r=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:t}})({loadScriptSrc:c}),i=n&&!r?o:`${"alpha"===g?"alpha":`v${g}`}.js.zonos.com`,a=n&&!r?null:g;t("[ZONOS - loadZonos] injecting zonos script","info",{currentLoadScriptUrl:o,isForceLoadVersionDomain:r,isWhiteListed:n,loadUrl:i,loadVersion:a,version:g}),s.injectZonos({initConfig:e,url:i,version:a})}},void 0===window.Zonos&&(window.Zonos=a),exports.Zonos=a})();
@@ -1 +1 @@
1
- (function(){"use strict";const e=(e,t,...o)=>{var n,r;if(!(!!(null===(n=window.Zonos)||void 0===n?void 0:n.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===t&&console.error(e,...o));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(r=s.contentWindow)||void 0===r?void 0:r.window.console)||window.console;switch(t){case"warn":i.warn(e,...o);break;case"info":i.info(e,...o);break;case"error":i.error(e,...o);break;default:i.groupCollapsed(e,...o),i.trace(),i.groupEnd()}},t=(t,...o)=>{e(t,"error",...o)},o="https://js.stripe.com/v3",n=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,r="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let s=null;const i=e=>(null!==s||(s=new Promise(((s,i)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(r),window.Stripe)s(window.Stripe);else try{let l=(()=>{const e=document.querySelectorAll(`script[src^="${o}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&n.test(o.src))return o}return null})();l&&e?console.warn(r):l||(l=(e=>{const n=document.createElement("script");n.src=`${o}`;const r=document.head||document.body;return r?(r.appendChild(n),n):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==l||l.addEventListener("load",(()=>{window.Stripe?s(window.Stripe):i(new Error("Stripe.js not available"))})),null==l||l.addEventListener("error",(()=>{i(new Error("Failed to load Stripe.js"))}))}catch(e){return void i(e)}else s(null)}))),s),l=Promise.resolve().then((()=>i(null)));let c=!1;l.catch((e=>{c||console.warn(e)}));var d;const a=(()=>{const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:t,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const t=new URL(e).origin,o=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>t.includes(e))),n=["qa.js.zonos.com"].some((e=>t.includes(e)));return{currentLoadScriptUrl:t,isForceLoadVersionDomain:n,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?t:null})()||"https://v1.3.18-alpha.2.js.zonos.com",u="https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.18-alpha.2",m="https://rsms.me",p="https://fonts.googleapis.com",h=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class y{}d=y,y.doneInit=!1,y.debug=!!window.location.search.match(/\?.*(&*)zonosDebug=1/),y.zonosConversionTest=!!window.location.search.match(/\?.*(&*)zonosConversionTest/),y.isBigCommerce=!1,y.internationalHideSelector="",y.zonosQaUrl=null,y.version="v1.3.18-alpha.2",y.modeAlerted=!1,y.tempCartData=null,y.getCurrentTimestamp=()=>(new Date).getTime(),y.zonosController=null,y.init=async({appearance:o,checkoutSettings:n,currencyConverter:r,helloSettings:s,onCountryChange:i,storeId:l,zonosApiKey:c})=>{d.doneInit||(e(`====== ZONOS DEBUG MODE: on (${d.version}) ======`),c?(d.zonosApiKey=c,d.storeId=l,e("init zonos"),d.injectSentryScript(),d.injectZonosCdn(),d.injectZonosCss(),d.injectFonts(),d.injectController({config:{appearance:o,checkoutSettings:n,currencyConverter:r,helloSettings:s,onCountryChange:i},zonosApiKey:c}),d.doneInit=!0):t("Missing Zonos API key"))},y.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},y.openHelloDialog=e=>{const t=document.querySelector("zonos-hello");t&&t.openHelloDialog(null==e||e)},y.showNotification=e=>{var t;null===(t=d.zonosController)||void 0===t||t.showNotification(e)},y.updateOrganizationName=e=>{var t;null===(t=d.zonosController)||void 0===t||t.updateOrganizationName(e)},y.disablePlaceOrderButtons=({autoEnable:e=!0,disable:t,placeOrderButtonSelector:o})=>{if(o){const n=document.querySelectorAll(o),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},y.injectController=({config:o,zonosApiKey:n})=>{var r;if(document.querySelector("zonos-controller"))return;if(null===(r=o.checkoutSettings)||void 0===r?void 0:r.placeOrderButtonSelector){const e=o.checkoutSettings.placeOrderButtonSelector;d.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e});new MutationObserver((()=>{d.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=o,s.zonosApiKey=n,s.addEventListener("stripeInitEvent",(async o=>{const{detail:n}=o;e("loading Stripe");const r=await(async(...e)=>{c=!0;const t=Date.now();return l.then((o=>((e,t,o)=>{if(null===e)return null;const n=e.apply(void 0,t);return((e,t)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:t})})(n,o),n})(o,e,t)))})(n.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):t("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),d.zonosController=s,e("Zonos controller injected!")},y.injectSentryScript=()=>{const o="https://browser.sentry-cdn.com/7.88.0/bundle.tracing.min.js";if(document.querySelector(`script[src="${o}"]`))return void e("Sentry script already exists in the document","warn");const n=document.head||document.body,r=document.createElement("script");r.crossOrigin="anonymous",r.src=o,r.integrity="sha384-z/aQww1Fr6Mes0MO/2wlzQd2nXBCdDcKPXDTsMDMNPgTGRPqii3a4bzH79I+Vo8l",r.setAttribute("data-lazy","no"),r.onerror=()=>{t(`Failed to load ${r.src}`)},r.onload=()=>{var e;null===(e=window.Sentry)||void 0===e||e.init({beforeSend(e){var t,o,n,r,s,i;const l=null===(i=null===(s=null===(r=null===(n=null===(o=null===(t=e.exception)||void 0===t?void 0:t.values)||void 0===o?void 0:o[0])||void 0===n?void 0:n.stacktrace)||void 0===r?void 0:r.frames)||void 0===s?void 0:s[0])||void 0===i?void 0:i.filename,c=(null==l?void 0:l.includes("js.zonos.com"))||(null==l?void 0:l.includes("@zonos/elements")),d=window.location.href.includes("dev.elements")||window.location.href.includes("route.js.zonos.com");return c&&!d?e:null},dsn:"https://19168bd05af0e2e0e7520ad58953e4f2@o446983.ingest.sentry.io/4506400622837760",ignoreErrors:["Failed to load Stripe.js"],release:`zonos-elements@${d.version}`,tracesSampler:()=>.01})},n.appendChild(r)},y.injectScript=({fallBackDomain:o,isModule:n,scriptDomain:r,theRestUrl:s})=>{const i=`${r}/${s}`;if(document.querySelector(`script[src="${i}"]`))return void e(`Zonos script "${i}" already exists in the document`,"warn");const l=document.head||document.body,c=document.createElement("script");n?c.type="module":c.noModule=!0,c.src=i,c.crossOrigin="anonymous",c.onerror=()=>{/\/\/v\d+\./g.test(r)?(o&&d.injectScript({isModule:n,scriptDomain:o,theRestUrl:s}),t(`Failed to load ${c.src}`)):e("No need to fallback since this is not a versioned domain","warn")},l.appendChild(c)},y.injectZonosCdn=()=>{d.injectScript({fallBackDomain:u,isModule:!0,scriptDomain:a,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),d.injectScript({fallBackDomain:u,isModule:!1,scriptDomain:a,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},y.injectStylesheet=({fallBackDomain:o,stylesheetDomain:n,theRestUrl:r})=>{const s=document.head||document.body,i=document.createElement("link");i.rel="preconnect",i.href=`${a}/`,s.appendChild(i);const l=document.createElement("link");l.rel="stylesheet",l.href=`${n}/${r}`,l.onerror=()=>{const s=/\/\/v\d+\./g.test(n);s?(o&&s&&d.injectStylesheet({stylesheetDomain:o,theRestUrl:r}),t(`Failed to load ${l.href}`)):e("No need to fallback since this is not a versioned domain","warn")},s.appendChild(l)},y.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(d.injectStylesheet({fallBackDomain:u,stylesheetDomain:a,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},y.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${m}"]`);for(let t=0;t<e.length;t++){const o=e[t];if(o&&!h.test(o.href))return o}return null})())return void e("Inter font already injected","warn");const t=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=m,t.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${m}/inter/inter.css`,t.appendChild(n),e("Zonos font injected!")},y.setupGoogleFont=e=>{var t;null===(t=d.zonosController)||void 0===t||t.setupGoogleFont(e)},y.injectSupportGoogleFont=t=>{var o;e(`[FONT] injecting ${t}`);const n=null===(o=t.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${p}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=p,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=t,r.appendChild(s),e(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=y)})();
1
+ (function(){"use strict";const e=(e,t,...n)=>{var o,r;if(!(!!(null===(o=window.Zonos)||void 0===o?void 0:o.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===t&&console.error(e,...n));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const i=(null===(r=s.contentWindow)||void 0===r?void 0:r.window.console)||window.console;switch(t){case"warn":i.warn(e,...n);break;case"info":i.info(e,...n);break;case"error":i.error(e,...n);break;default:i.groupCollapsed(e,...n),i.trace(),i.groupEnd()}},t=(t,...n)=>{e(t,"error",...n)},n=()=>{if("undefined"==typeof window)return null;const t=(e=>{if(!e)return null;const t=new URL(e).searchParams.get("zonosQaUrl");return t?/[^a-zA-Z0-9-_]+/.test(t)?null:t:null})(window.location.href);if(!t)return null;if("dev-elements"===t)return"https://dev.elements.zonos.com";const n=`https://${t}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${n}' for loading script`,"warn"),fetch(n).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${n}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:t}=window.location,o=`${t}?${e.toString()}`;return window.history.replaceState({},"",o),window.location.reload(),null})),n},o="https://js.stripe.com/v3",r=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,s="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let i=null;const l=e=>(null!==i||(i=new Promise(((n,i)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(s),window.Stripe)n(window.Stripe);else try{let l=(()=>{const e=document.querySelectorAll(`script[src^="${o}"]`);for(let t=0;t<e.length;t++){const n=e[t];if(n&&r.test(n.src))return n}return null})();l&&e?console.warn(s):l||(l=(e=>{const n=document.createElement("script");n.src=`${o}`;const r=document.head||document.body;return r?(r.appendChild(n),n):(t("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==l||l.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):i(new Error("Stripe.js not available"))})),null==l||l.addEventListener("error",(()=>{i(new Error("Failed to load Stripe.js"))}))}catch(e){return void i(e)}else n(null)}))),i),c=Promise.resolve().then((()=>l(null)));let d=!1;c.catch((e=>{d||console.warn(e)}));var a;const u=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:t,isWhiteListed:n}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const t=new URL(e).origin,n=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>t.includes(e))),o=["qa.js.zonos.com"].some((e=>t.includes(e)));return{currentLoadScriptUrl:t,isForceLoadVersionDomain:o,isWhiteListed:n}})({loadScriptSrc:null==e?void 0:e.src});return n?t:null})()||"https://v1.3.18-alpha.3.js.zonos.com",m="https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.18-alpha.3",p="https://rsms.me",h="https://fonts.googleapis.com",y=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class w{}a=w,w.doneInit=!1,w.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),w.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),w.isBigCommerce=!1,w.isNpm=!0,w.internationalHideSelector="",w.zonosQaUrl=null,w.version="v1.3.18-alpha.3",w.modeAlerted=!1,w.tempCartData=null,w.getCurrentTimestamp=()=>(new Date).getTime(),w.zonosController=null,w.init=async({appearance:n,checkoutSettings:o,currencyConverter:r,helloSettings:s,onCountryChange:i,storeId:l,zonosApiKey:c})=>{a.doneInit||(e(`====== ZONOS DEBUG MODE: on (${a.version}) ======`),c?(a.zonosApiKey=c,a.storeId=l,e("init zonos"),a.injectSentryScript(),a.injectZonosCdn(),a.injectZonosCss(),a.injectFonts(),a.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:r,helloSettings:s,onCountryChange:i},zonosApiKey:c}),a.doneInit=!0):t("Missing Zonos API key"))},w.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},w.openHelloDialog=e=>{const t=document.querySelector("zonos-hello");t&&t.openHelloDialog(null==e||e)},w.showNotification=e=>{var t;null===(t=a.zonosController)||void 0===t||t.showNotification(e)},w.updateOrganizationName=e=>{var t;null===(t=a.zonosController)||void 0===t||t.updateOrganizationName(e)},w.disablePlaceOrderButtons=({autoEnable:e=!0,disable:t,placeOrderButtonSelector:n})=>{if(n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},w.injectController=({config:n,zonosApiKey:o})=>{var r;if(document.querySelector("zonos-controller"))return;if(null===(r=n.checkoutSettings)||void 0===r?void 0:r.placeOrderButtonSelector){const e=n.checkoutSettings.placeOrderButtonSelector;a.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e});new MutationObserver((()=>{a.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=n,s.zonosApiKey=o,s.addEventListener("stripeInitEvent",(async n=>{const{detail:o}=n;e("loading Stripe");const r=await(async(...e)=>{d=!0;const t=Date.now();return c.then((n=>((e,t,n)=>{if(null===e)return null;const o=e.apply(void 0,t);return((e,t)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:t})})(o,n),o})(n,e,t)))})(o.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):t("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),a.zonosController=s,e("Zonos controller injected!")},w.injectSentryScript=()=>{const n="https://browser.sentry-cdn.com/7.88.0/bundle.tracing.min.js";if(document.querySelector(`script[src="${n}"]`))return void e("Sentry script already exists in the document","warn");const o=document.head||document.body,r=document.createElement("script");r.crossOrigin="anonymous",r.src=n,r.integrity="sha384-z/aQww1Fr6Mes0MO/2wlzQd2nXBCdDcKPXDTsMDMNPgTGRPqii3a4bzH79I+Vo8l",r.setAttribute("data-lazy","no"),r.onerror=()=>{t(`Failed to load ${r.src}`)},r.onload=()=>{var e;null===(e=window.Sentry)||void 0===e||e.init({beforeSend(e){var t,n,o,r,s,i;const l=null===(i=null===(s=null===(r=null===(o=null===(n=null===(t=e.exception)||void 0===t?void 0:t.values)||void 0===n?void 0:n[0])||void 0===o?void 0:o.stacktrace)||void 0===r?void 0:r.frames)||void 0===s?void 0:s[0])||void 0===i?void 0:i.filename,c=(null==l?void 0:l.includes("js.zonos.com"))||(null==l?void 0:l.includes("@zonos/elements")),d=window.location.href.includes("dev.elements")||window.location.href.includes("route.js.zonos.com");return c&&!d?e:null},dsn:"https://19168bd05af0e2e0e7520ad58953e4f2@o446983.ingest.sentry.io/4506400622837760",ignoreErrors:["Failed to load Stripe.js"],release:`zonos-elements@${a.version}`,tracesSampler:()=>.01})},o.appendChild(r)},w.injectScript=({fallBackDomain:n,isModule:o,scriptDomain:r,theRestUrl:s})=>{const i=`${r}/${s}`;if(document.querySelector(`script[src="${i}"]`))return void e(`Zonos script "${i}" already exists in the document`,"warn");const l=document.head||document.body,c=document.createElement("script");o?c.type="module":c.noModule=!0,c.src=i,c.crossOrigin="anonymous",c.onerror=()=>{/\/\/v\d+\./g.test(r)?(n&&a.injectScript({isModule:o,scriptDomain:n,theRestUrl:s}),t(`Failed to load ${c.src}`)):e("No need to fallback since this is not a versioned domain","warn")},l.appendChild(c)},w.getZonosUrl=()=>{if(a.isNpm){return n()||u}return u},w.injectZonosCdn=()=>{const t=a.getZonosUrl();a.injectScript({fallBackDomain:m,isModule:!0,scriptDomain:t,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),a.injectScript({fallBackDomain:m,isModule:!1,scriptDomain:t,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},w.injectStylesheet=({fallBackDomain:n,stylesheetDomain:o,theRestUrl:r})=>{const s=document.head||document.body,i=document.createElement("link");i.rel="preconnect",i.href=`${u}/`,s.appendChild(i);const l=document.createElement("link");l.rel="stylesheet",l.href=`${o}/${r}`,l.onerror=()=>{const s=/\/\/v\d+\./g.test(o);s?(n&&s&&a.injectStylesheet({stylesheetDomain:n,theRestUrl:r}),t(`Failed to load ${l.href}`)):e("No need to fallback since this is not a versioned domain","warn")},s.appendChild(l)},w.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(a.injectStylesheet({fallBackDomain:m,stylesheetDomain:u,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},w.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${p}"]`);for(let t=0;t<e.length;t++){const n=e[t];if(n&&!y.test(n.href))return n}return null})())return void e("Inter font already injected","warn");const t=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=p,t.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${p}/inter/inter.css`,t.appendChild(o),e("Zonos font injected!")},w.setupGoogleFont=e=>{var t;null===(t=a.zonosController)||void 0===t||t.setupGoogleFont(e)},w.injectSupportGoogleFont=t=>{var n;e(`[FONT] injecting ${t}`);const o=null===(n=t.match(/family=(.*?):/))||void 0===n?void 0:n[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${h}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=h,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${t}"]`))return void e(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=t,r.appendChild(s),e(`[FONT] ${o} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=w)})();
@@ -2,11 +2,6 @@ import { type EventEmitter } from '../../../../stencil-public-runtime';
2
2
  import type { PaymentIntent } from '@stripe/stripe-js';
3
3
  import type { ZonosOrder } from "../../../../types/checkout/CheckoutConfig";
4
4
  import type { ElementsUiStyle } from "../../../../types/generated/graphql.customer.types";
5
- type OverrideNotification = {
6
- messages: string[];
7
- title: string;
8
- type: 'success' | 'error';
9
- };
10
5
  export declare class ZonosCheckoutFinish {
11
6
  /**
12
7
  * The border radius style of the dialog
@@ -20,7 +15,11 @@ export declare class ZonosCheckoutFinish {
20
15
  * Override the notification message and title, bypass checking stripe payment status
21
16
  *
22
17
  */
23
- overrideNotification?: OverrideNotification;
18
+ overrideNotification?: {
19
+ messages: string[];
20
+ title: string;
21
+ type: 'success' | 'error';
22
+ };
24
23
  /**
25
24
  * Event to emit when the continue button is clicked
26
25
  */
@@ -38,4 +37,3 @@ export declare class ZonosCheckoutFinish {
38
37
  componentDidLoad(): void;
39
38
  render(): any;
40
39
  }
41
- export {};
@@ -1,6 +1,6 @@
1
1
  import type { PaymentIntent, Stripe } from '@stripe/stripe-js';
2
2
  import { type CartItem } from "../../store/checkout/cart";
3
- import { type ContactOption } from "../../store/checkout/stripe";
3
+ import { type StripeStoreContactOption } from "../../store/checkout/stripe";
4
4
  import { type AppearanceConfig } from "../../store/zonosStore";
5
5
  export declare class ZonosCheckout {
6
6
  /**
@@ -22,7 +22,7 @@ export declare class ZonosCheckout {
22
22
  /**
23
23
  * Default address to use for the checkout (preview mode)
24
24
  */
25
- defaultAddress: ContactOption | null;
25
+ defaultAddress: StripeStoreContactOption | null;
26
26
  /**
27
27
  * Force dialog to be open
28
28
  */
@@ -1,5 +1,5 @@
1
1
  import { type EventEmitter } from '../../../../stencil-public-runtime';
2
- import { type ContactOption } from "../../../store/checkout/stripe";
2
+ import { type StripeStoreContactOption } from "../../../store/checkout/stripe";
3
3
  import { containsNonLatinChars } from "../../../utils/containsNonLatinChars";
4
4
  export declare class ZonosCustomerInfo {
5
5
  el: HTMLZonosCustomerInfoElement;
@@ -22,7 +22,7 @@ export declare class ZonosCustomerInfo {
22
22
  /**
23
23
  * Default address to use for the checkout (preview mode)
24
24
  */
25
- defaultAddress: ContactOption | null;
25
+ defaultAddress: StripeStoreContactOption | null;
26
26
  /**
27
27
  * Event to emit when the continue button is clicked
28
28
  */
@@ -2,7 +2,7 @@ import { type EventEmitter } from '../../stencil-public-runtime';
2
2
  import type { Stripe } from '@stripe/stripe-js';
3
3
  import type { NotificationInit } from "../common/zonos-notification/zonos-notification";
4
4
  import { type AppearanceConfig } from "../store/zonosStore";
5
- import type { LoadZonosParamsConfig } from "../../scripts/zonosBase";
5
+ import type { LoadZonosParamsConfig } from "../../scripts/_zonosBase";
6
6
  import type { CountryCode } from "../../types/generated/graphql.customer.types";
7
7
  export declare class ZonosController {
8
8
  /**
@@ -2,7 +2,7 @@ import type { PaymentIntent, Stripe, StripeAddressElement, StripeAddressElementC
2
2
  import type { containsNonLatinChars } from "../../utils/containsNonLatinChars";
3
3
  import type { TranslatedAddressObject } from "../../../types/checkout/TranslatedText";
4
4
  import type { CheckoutSessionUpdateMutation, CountryCode, ElementsUiStyle, ElementsUiTheme } from "../../../types/generated/graphql.customer.types";
5
- export type ContactOption = {
5
+ export type StripeStoreContactOption = {
6
6
  address: {
7
7
  city: string;
8
8
  country: string;
@@ -1,4 +1,4 @@
1
- import type { CurrencyConverter, LoadZonosParamsConfig } from "../../scripts/zonosBase";
1
+ import type { CurrencyConverter, LoadZonosParamsConfig } from "../../scripts/_zonosBase";
2
2
  import type { CheckoutConfig } from "../../types/checkout/CheckoutConfig";
3
3
  import type { ElementsUiStyle, ElementsUiTheme, ZonosAttribution, ZonosSettingsQuery } from "../../types/generated/graphql.customer.types";
4
4
  import type { HelloConfig } from "../../types/hello/HelloConfig";
@@ -1,5 +1,5 @@
1
1
  import type { EventEmitter } from '../../../stencil-public-runtime';
2
- import type { ContactOption as StripeContactOption, Stripe } from '@stripe/stripe-js';
2
+ import type { ContactOption, Stripe } from '@stripe/stripe-js';
3
3
  export declare class ZonosAddress {
4
4
  /**
5
5
  * The type of address element to render
@@ -12,7 +12,7 @@ export declare class ZonosAddress {
12
12
  /**
13
13
  * Default address for stripe
14
14
  */
15
- defaultAddress: StripeContactOption | null;
15
+ defaultAddress: ContactOption | null;
16
16
  /**
17
17
  * Event to emit when address is not containing allowed character sets
18
18
  */
@@ -1,3 +1,4 @@
1
+ import type React from 'react';
1
2
  /**
2
3
  * Filter out all of the undefined values from the object so we don't have undefined css variable values
3
4
  */
@@ -5,7 +5,7 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
- import { PaymentIntent, Stripe, StripeContactOption } from "@stripe/stripe-js";
8
+ import { ContactOption, PaymentIntent, Stripe } from "@stripe/stripe-js";
9
9
  import { EnteredInfo, TranslatedAddressObject } from "./types/checkout/TranslatedText";
10
10
  import { SubmitEventData } from "./components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog";
11
11
  import { CheckboxColorPrefix, Color, ColorPrefix } from "./types/styles/Color";
@@ -13,16 +13,16 @@ import { BannerIntent } from "./components/common/zonos-banner/zonos-banner";
13
13
  import { CountryCode, ElementsUiStyle, ElementsUiTheme, HelloMobileLocation } from "./types/generated/graphql.customer.types";
14
14
  import { FontWeight, Size, Type } from "./types/styles/Text";
15
15
  import { AppearanceConfig } from "./components/store/zonosStore";
16
- import { ContactOption } from "./components/store/checkout/stripe";
16
+ import { StripeStoreContactOption } from "./components/store/checkout/stripe";
17
17
  import { TabItem, TabItems } from "./components/store/checkout/cart";
18
- import { LoadZonosParamsConfig } from "./scripts/zonosBase";
18
+ import { LoadZonosParamsConfig } from "./scripts/_zonosBase";
19
19
  import { NotificationInit } from "./components/common/zonos-notification/zonos-notification";
20
20
  import { RestrictedItem } from "./types/hello/RestrictedItem";
21
21
  import { AppearanceConfig as AppearanceConfig1 } from "./components.d";
22
22
  import { ShippingRichRadioItem } from "./components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio";
23
23
  import { SpinnerColor } from "./components/common/zonos-spinner/zonos-spinner";
24
24
  import { GridSpacing } from "./types/styles/GridSpacing";
25
- export { PaymentIntent, Stripe, StripeContactOption } from "@stripe/stripe-js";
25
+ export { ContactOption, PaymentIntent, Stripe } from "@stripe/stripe-js";
26
26
  export { EnteredInfo, TranslatedAddressObject } from "./types/checkout/TranslatedText";
27
27
  export { SubmitEventData } from "./components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog";
28
28
  export { CheckboxColorPrefix, Color, ColorPrefix } from "./types/styles/Color";
@@ -30,9 +30,9 @@ export { BannerIntent } from "./components/common/zonos-banner/zonos-banner";
30
30
  export { CountryCode, ElementsUiStyle, ElementsUiTheme, HelloMobileLocation } from "./types/generated/graphql.customer.types";
31
31
  export { FontWeight, Size, Type } from "./types/styles/Text";
32
32
  export { AppearanceConfig } from "./components/store/zonosStore";
33
- export { ContactOption } from "./components/store/checkout/stripe";
33
+ export { StripeStoreContactOption } from "./components/store/checkout/stripe";
34
34
  export { TabItem, TabItems } from "./components/store/checkout/cart";
35
- export { LoadZonosParamsConfig } from "./scripts/zonosBase";
35
+ export { LoadZonosParamsConfig } from "./scripts/_zonosBase";
36
36
  export { NotificationInit } from "./components/common/zonos-notification/zonos-notification";
37
37
  export { RestrictedItem } from "./types/hello/RestrictedItem";
38
38
  export { AppearanceConfig as AppearanceConfig1 } from "./components.d";
@@ -44,7 +44,7 @@ export namespace Components {
44
44
  /**
45
45
  * Default address for stripe
46
46
  */
47
- "defaultAddress": StripeContactOption | null;
47
+ "defaultAddress": ContactOption | null;
48
48
  /**
49
49
  * The title text for the address element
50
50
  */
@@ -317,7 +317,7 @@ export namespace Components {
317
317
  /**
318
318
  * Default address to use for the checkout (preview mode)
319
319
  */
320
- "defaultAddress": ContactOption | null;
320
+ "defaultAddress": StripeStoreContactOption | null;
321
321
  /**
322
322
  * Force dialog to be open
323
323
  */
@@ -347,7 +347,11 @@ export namespace Components {
347
347
  /**
348
348
  * Override the notification message and title, bypass checking stripe payment status
349
349
  */
350
- "overrideNotification"?: OverrideNotification;
350
+ "overrideNotification"?: {
351
+ messages: string[];
352
+ title: string;
353
+ type: 'success' | 'error';
354
+ };
351
355
  /**
352
356
  * Force status to test the UI for storybook
353
357
  */
@@ -541,7 +545,7 @@ export namespace Components {
541
545
  /**
542
546
  * Default address to use for the checkout (preview mode)
543
547
  */
544
- "defaultAddress": ContactOption | null;
548
+ "defaultAddress": StripeStoreContactOption | null;
545
549
  /**
546
550
  * Whether or not the dialog is open
547
551
  */
@@ -1453,7 +1457,7 @@ declare namespace LocalJSX {
1453
1457
  /**
1454
1458
  * Default address for stripe
1455
1459
  */
1456
- "defaultAddress"?: StripeContactOption | null;
1460
+ "defaultAddress"?: ContactOption | null;
1457
1461
  /**
1458
1462
  * Event to emit when address is not containing allowed character sets
1459
1463
  */
@@ -1742,7 +1746,7 @@ declare namespace LocalJSX {
1742
1746
  /**
1743
1747
  * Default address to use for the checkout (preview mode)
1744
1748
  */
1745
- "defaultAddress"?: ContactOption | null;
1749
+ "defaultAddress"?: StripeStoreContactOption | null;
1746
1750
  /**
1747
1751
  * Force dialog to be open
1748
1752
  */
@@ -1768,7 +1772,11 @@ declare namespace LocalJSX {
1768
1772
  /**
1769
1773
  * Override the notification message and title, bypass checking stripe payment status
1770
1774
  */
1771
- "overrideNotification"?: OverrideNotification;
1775
+ "overrideNotification"?: {
1776
+ messages: string[];
1777
+ title: string;
1778
+ type: 'success' | 'error';
1779
+ };
1772
1780
  /**
1773
1781
  * Force status to test the UI for storybook
1774
1782
  */
@@ -1941,7 +1949,7 @@ declare namespace LocalJSX {
1941
1949
  /**
1942
1950
  * Default address to use for the checkout (preview mode)
1943
1951
  */
1944
- "defaultAddress"?: ContactOption | null;
1952
+ "defaultAddress"?: StripeStoreContactOption | null;
1945
1953
  /**
1946
1954
  * Whether or not the dialog is open
1947
1955
  */
@@ -1 +1,2 @@
1
+ export { Zonos } from './scripts';
1
2
  export * from './types';
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Extracts the zonosQaUrl from the url
3
+ *
4
+ * @param url - url to extract zonosQaUrl from
5
+ *
6
+ * **NOTE**: value of zonosQaUrl param should be without protocol, allowed characters are: a-z, A-Z, 0-9, -, _
7
+ * @example
8
+ * valid: https://www.zonos.com/?zonosQaUrl=some-feature-v988
9
+ * invalid: https://www.zonos.com/?zonosQaUrl=https://zonos-something
10
+ */
11
+ export declare const extractZonosQaUrl: (url: string | undefined) => string | null;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Get the Zonos QA URL and return it. Will remove `zonosQaUrl` from the url query if it doesn't exists.
3
+ */
4
+ export declare const getZonosQaUrl: () => string | null;
@@ -1,2 +1,2 @@
1
- import { type LoadStripe } from "./stripe";
1
+ import { type LoadStripe } from "./_stripe";
2
2
  export declare const zonosLoadStripe: LoadStripe;
@@ -5,10 +5,34 @@ import type { TempCart } from "../types/checkout/api/TempCart";
5
5
  import type { CheckoutConfig } from "../types/checkout/CheckoutConfig";
6
6
  import type { CountryCode, CurrencyCode } from "../types/generated/graphql.customer.types";
7
7
  import type { HelloConfig } from "../types/hello/HelloConfig";
8
- export type CurrencyConverter = (prop: {
8
+ export type CurrencyConverter = (props: {
9
9
  selector?: string;
10
+ /**
11
+ * Convert the amount to the target currency in Hello (no locale format)
12
+ * @param convert amount
13
+ * @return number
14
+ * @example
15
+ * const price = 100; // in USD
16
+ * convert(100) // return 136.5 when selected country in Hello is Canada
17
+ */
10
18
  convert: (amount: number) => number;
19
+ /**
20
+ * Convert the amount to the target currency and format it in Hello with locale formatting
21
+ * @param amount
22
+ * @returns string - CA$136.50
23
+ * @example
24
+ * const price = 100;
25
+ * convertAndFormat(100) // return CA$136.50 when selected country in Hello is Canada
26
+ */
11
27
  convertAndFormat: (amount: number) => string;
28
+ /**
29
+ * Format the given amount to locale format
30
+ * @param amount
31
+ * @returns string - CA$100.00
32
+ * @example
33
+ * const price = 100
34
+ * format(100) // return CA$100.00 when selected country in Hello is Canada
35
+ */
12
36
  format: (amount: number) => string;
13
37
  }) => void;
14
38
  export type LoadZonosParamsConfig = {
@@ -33,7 +57,8 @@ export type LoadZonosParamsConfig = {
33
57
  export type LoadZonosParams = LoadZonosParamsConfig & {
34
58
  storeId: number;
35
59
  /**
36
- * Temporary cart UUID to be used for zonos checkout, if this is provided, no need to configure `buildCartDetail`, `buildLandedCost` callback, zonosApiKey or storeId
60
+ * Temporary cart UUID to be used for legacy zonos checkout. If this is provided, no need to configure `buildCartDetail`, `buildLandedCost` callback, zonosApiKey or storeId
61
+ * @note This would be deprecated in the future when we fully migrate to new zonos checkout
37
62
  */
38
63
  tempCartUUID?: string;
39
64
  zonosApiKey: string;
@@ -47,6 +72,7 @@ export interface Zonos {
47
72
  doneInit: boolean;
48
73
  internationalHideSelector: string;
49
74
  isBigCommerce: boolean;
75
+ isNpm: boolean;
50
76
  /** Flag if already alerted when preview domain is defined and it's connecting production environment */
51
77
  modeAlerted: boolean;
52
78
  storeId: number;
@@ -77,6 +103,10 @@ export declare abstract class Zonos {
77
103
  static debug: boolean;
78
104
  static zonosConversionTest: boolean;
79
105
  static isBigCommerce: boolean;
106
+ /**
107
+ * By default, the package will load from npm
108
+ */
109
+ static isNpm: boolean;
80
110
  static internationalHideSelector: string;
81
111
  static zonosQaUrl: string | null;
82
112
  static version: string;
@@ -93,6 +123,10 @@ export declare abstract class Zonos {
93
123
  private static injectController;
94
124
  private static injectSentryScript;
95
125
  private static injectScript;
126
+ /**
127
+ * We now support loading Zonos via npm. For clients using npm, `zonosBase` will always load from the server side. Therefore, the `zonosLoadUrl` defined earlier won't work since it lacks access to client-side APIs such as `window` and `document`.
128
+ */
129
+ private static getZonosUrl;
96
130
  private static injectZonosCdn;
97
131
  private static injectStylesheet;
98
132
  private static injectZonosCss;
@@ -0,0 +1,2 @@
1
+ import { Zonos } from "./_zonosBase";
2
+ export { Zonos };
@@ -36,6 +36,11 @@ export type CheckoutConfig = {
36
36
  };
37
37
  organization: string;
38
38
  placeOrderButtonSelector: string | null;
39
+ /**
40
+ * @param subscriptionStatus subscription status for checkout, checkout only available if subscription status is ENABLED and visibility status is ENABLED
41
+ *
42
+ * **NOTE: this value can't be overridden in Zonos.init**
43
+ */
39
44
  subscriptionStatus: CheckoutSubscriptionStatus;
40
45
  successBehavior: CheckoutSuccessBehavior;
41
46
  successRedirectUrl: string;
@@ -1,4 +1,5 @@
1
1
  import type { CartItem } from "../../../components/store/checkout/cart";
2
+ import type { LandedCostAdjustmentType } from "../../generated/graphql.customer.types";
2
3
  export type CalculateLandedCostRequest = {
3
4
  billingAddress: {
4
5
  addressLine1: string;
@@ -21,6 +22,14 @@ export type CalculateLandedCostRequest = {
21
22
  phone: string;
22
23
  };
23
24
  items: CartItem[];
25
+ landedCostAdjustments?: {
26
+ amount: number;
27
+ type: LandedCostAdjustmentType;
28
+ }[];
29
+ metadata?: {
30
+ key: string;
31
+ value: string;
32
+ }[];
24
33
  shippingAddress: {
25
34
  addressLine1: string;
26
35
  addressLine2?: string | undefined;
@@ -1452,6 +1452,7 @@ export declare const invoiceCarrier: {
1452
1452
  readonly Apc: "APC";
1453
1453
  readonly Asendia: "ASENDIA";
1454
1454
  readonly BoxC: "BOX_C";
1455
+ readonly BroadReach: "BROAD_REACH";
1455
1456
  readonly Dhl: "DHL";
1456
1457
  readonly DhlEcom: "DHL_ECOM";
1457
1458
  readonly Epost: "EPOST";
@@ -1608,6 +1608,7 @@ export const imageSlot = {
1608
1608
  } as const;
1609
1609
 
1610
1610
  export type ImageSlot = (typeof imageSlot)[keyof typeof imageSlot];
1611
+
1611
1612
  export const inclusivePriceCalculateJobStatus = {
1612
1613
  Completed: 'COMPLETED',
1613
1614
  Failed: 'FAILED',
@@ -1640,6 +1641,7 @@ export const inclusivePriceCatalogValidationJobComplianceStatus = {
1640
1641
 
1641
1642
  export type InclusivePriceCatalogValidationJobComplianceStatus =
1642
1643
  (typeof inclusivePriceCatalogValidationJobComplianceStatus)[keyof typeof inclusivePriceCatalogValidationJobComplianceStatus];
1644
+
1643
1645
  export const inclusivePriceHistoryCsvJobStatus = {
1644
1646
  Error: 'ERROR',
1645
1647
  Processed: 'PROCESSED',
@@ -1696,6 +1698,7 @@ export const invoiceCarrier = {
1696
1698
  Apc: 'APC',
1697
1699
  Asendia: 'ASENDIA',
1698
1700
  BoxC: 'BOX_C',
1701
+ BroadReach: 'BROAD_REACH',
1699
1702
  Dhl: 'DHL',
1700
1703
  DhlEcom: 'DHL_ECOM',
1701
1704
  Epost: 'EPOST',
@@ -115,6 +115,7 @@ export declare const featureAudienceNameEnum: {
115
115
  readonly I18nSales: "i18n_sales";
116
116
  readonly ItHead: "it_head";
117
117
  readonly NewCheckoutMerchant: "new_checkout_merchant";
118
+ readonly NewPayoutReportMerchant: "new_payout_report_merchant";
118
119
  readonly Onboarding: "onboarding";
119
120
  readonly PrincipalEngineer: "principal_engineer";
120
121
  readonly ProServeHead: "pro_serve_head";
@@ -96,6 +96,7 @@ export const featureAudienceNameEnum = {
96
96
  I18nSales: 'i18n_sales',
97
97
  ItHead: 'it_head',
98
98
  NewCheckoutMerchant: 'new_checkout_merchant',
99
+ NewPayoutReportMerchant: 'new_payout_report_merchant',
99
100
  Onboarding: 'onboarding',
100
101
  PrincipalEngineer: 'principal_engineer',
101
102
  ProServeHead: 'pro_serve_head',
@@ -5,7 +5,7 @@ import type { StripeConstructor } from '@stripe/stripe-js';
5
5
  /** Need to use relative path so that this declaration file can be correctly bundled */
6
6
  import type { CustomEventMap } from '../components/utils/createCustomEvent';
7
7
  import type { Env } from '../environment';
8
- import type { Zonos } from '../scripts/zonosBase';
8
+ import type { Zonos } from '../scripts/_zonosBase';
9
9
  declare global {
10
10
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions
11
11
  interface Document {
@@ -0,0 +1 @@
1
+ import{l as e,a as n}from"./p-eaa335e1.js";const o="https://js.stripe.com/v3",t=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,s="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let i=null;const l=Promise.resolve().then((()=>{return e=null,null!==i||(i=new Promise(((i,l)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(s),window.Stripe)i(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${o}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&t.test(o.src))return o}return null})();r&&e?console.warn(s):r||(r=(e=>{const t=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",s=document.createElement("script");s.src=`${o}${t}`;const i=document.head||document.body;return i?(i.appendChild(s),s):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==r||r.addEventListener("load",(()=>{window.Stripe?i(window.Stripe):l(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{l(new Error("Failed to load Stripe.js"))}))}catch(e){return void l(e)}else i(null)}))),i;var e}));let r=!1;var c;l.catch((e=>{r||console.warn(e)}));const d=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})()||"https://v1.3.18-alpha.3.js.zonos.com",a="https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.18-alpha.3",u="https://rsms.me",m="https://fonts.googleapis.com",p=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class w{}c=w,w.doneInit=!1,w.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),w.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),w.isBigCommerce=!1,w.isNpm=!0,w.internationalHideSelector="",w.zonosQaUrl=null,w.version="v1.3.18-alpha.3",w.modeAlerted=!1,w.tempCartData=null,w.getCurrentTimestamp=()=>(new Date).getTime(),w.zonosController=null,w.init=async({appearance:o,checkoutSettings:t,currencyConverter:s,helloSettings:i,onCountryChange:l,storeId:r,zonosApiKey:d})=>{c.doneInit||(e(`====== ZONOS DEBUG MODE: on (${c.version}) ======`),d?(c.zonosApiKey=d,c.storeId=r,e("init zonos"),c.injectSentryScript(),c.injectZonosCdn(),c.injectZonosCss(),c.injectFonts(),c.injectController({config:{appearance:o,checkoutSettings:t,currencyConverter:s,helloSettings:i,onCountryChange:l},zonosApiKey:d}),c.doneInit=!0):n("Missing Zonos API key"))},w.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},w.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},w.showNotification=e=>{var n;null===(n=c.zonosController)||void 0===n||n.showNotification(e)},w.updateOrganizationName=e=>{var n;null===(n=c.zonosController)||void 0===n||n.updateOrganizationName(e)},w.disablePlaceOrderButtons=({autoEnable:e=!0,disable:n,placeOrderButtonSelector:o})=>{if(o){const t=document.querySelectorAll(o),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};t.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(n?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&n&&setTimeout((()=>{t.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},w.injectController=({config:o,zonosApiKey:t})=>{var s;if(document.querySelector("zonos-controller"))return;if(null===(s=o.checkoutSettings)||void 0===s?void 0:s.placeOrderButtonSelector){const e=o.checkoutSettings.placeOrderButtonSelector;c.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e}),new MutationObserver((()=>{c.disablePlaceOrderButtons({disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const i=document.createElement("zonos-controller");i.config=o,i.zonosApiKey=t,i.addEventListener("stripeInitEvent",(async o=>{const{detail:t}=o;e("loading Stripe");const s=await(async(...e)=>{r=!0;const n=Date.now();return l.then((o=>((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(o,e,n)))})(t.publishableKey);s?(window.Zonos.stripe=s,i.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(i),c.zonosController=i,e("Zonos controller injected!")},w.injectSentryScript=()=>{const o="https://browser.sentry-cdn.com/7.88.0/bundle.tracing.min.js";if(document.querySelector(`script[src="${o}"]`))return void e("Sentry script already exists in the document","warn");const t=document.head||document.body,s=document.createElement("script");s.crossOrigin="anonymous",s.src=o,s.integrity="sha384-z/aQww1Fr6Mes0MO/2wlzQd2nXBCdDcKPXDTsMDMNPgTGRPqii3a4bzH79I+Vo8l",s.setAttribute("data-lazy","no"),s.onerror=()=>{n(`Failed to load ${s.src}`)},s.onload=()=>{var e;null===(e=window.Sentry)||void 0===e||e.init({beforeSend(e){var n,o,t,s,i,l;const r=null===(l=null===(i=null===(s=null===(t=null===(o=null===(n=e.exception)||void 0===n?void 0:n.values)||void 0===o?void 0:o[0])||void 0===t?void 0:t.stacktrace)||void 0===s?void 0:s.frames)||void 0===i?void 0:i[0])||void 0===l?void 0:l.filename,c=(null==r?void 0:r.includes("js.zonos.com"))||(null==r?void 0:r.includes("@zonos/elements")),d=window.location.href.includes("dev.elements")||window.location.href.includes("route.js.zonos.com");return c&&!d?e:null},dsn:"https://19168bd05af0e2e0e7520ad58953e4f2@o446983.ingest.sentry.io/4506400622837760",ignoreErrors:["Failed to load Stripe.js"],release:`zonos-elements@${c.version}`,tracesSampler:()=>.01})},t.appendChild(s)},w.injectScript=({fallBackDomain:o,isModule:t,scriptDomain:s,theRestUrl:i})=>{const l=`${s}/${i}`;if(document.querySelector(`script[src="${l}"]`))return void e(`Zonos script "${l}" already exists in the document`,"warn");const r=document.head||document.body,d=document.createElement("script");t?d.type="module":d.noModule=!0,d.src=l,d.crossOrigin="anonymous",d.onerror=()=>{/\/\/v\d+\./g.test(s)?(o&&c.injectScript({isModule:t,scriptDomain:o,theRestUrl:i}),n(`Failed to load ${d.src}`)):e("No need to fallback since this is not a versioned domain","warn")},r.appendChild(d)},w.getZonosUrl=()=>c.isNpm&&(()=>{if("undefined"==typeof window)return null;const n=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href);if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const o=`https://${n}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${o}' for loading script`,"warn"),fetch(o).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${o}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,t=`${n}?${e.toString()}`;return window.history.replaceState({},"",t),window.location.reload(),null})),o})()||d,w.injectZonosCdn=()=>{const n=c.getZonosUrl();c.injectScript({fallBackDomain:a,isModule:!0,scriptDomain:n,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),c.injectScript({fallBackDomain:a,isModule:!1,scriptDomain:n,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},w.injectStylesheet=({fallBackDomain:o,stylesheetDomain:t,theRestUrl:s})=>{const i=document.head||document.body,l=document.createElement("link");l.rel="preconnect",l.href=`${d}/`,i.appendChild(l);const r=document.createElement("link");r.rel="stylesheet",r.href=`${t}/${s}`,r.onerror=()=>{const i=/\/\/v\d+\./g.test(t);i?(o&&i&&c.injectStylesheet({stylesheetDomain:o,theRestUrl:s}),n(`Failed to load ${r.href}`)):e("No need to fallback since this is not a versioned domain","warn")},i.appendChild(r)},w.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(c.injectStylesheet({fallBackDomain:a,stylesheetDomain:d,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},w.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${u}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!p.test(o.href))return o}return null})())return void e("Inter font already injected","warn");const n=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=u,n.appendChild(o);const t=document.createElement("link");t.rel="stylesheet",t.href=`${u}/inter/inter.css`,n.appendChild(t),e("Zonos font injected!")},w.setupGoogleFont=e=>{var n;null===(n=c.zonosController)||void 0===n||n.setupGoogleFont(e)},w.injectSupportGoogleFont=n=>{var o;e(`[FONT] injecting ${n}`);const t=null===(o=n.match(/family=(.*?):/))||void 0===o?void 0:o[1],s=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${m}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=m,s.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${n}"]`))return void e(`[FONT] ${t} font already injected`,"warn");const i=document.createElement("link");i.rel="stylesheet",i.href=n,s.appendChild(i),e(`[FONT] ${t} font injected!`)};export{w as Zonos}
@@ -0,0 +1 @@
1
+ System.register(["./p-d99232c5.system.js","./p-62ecfbcc.system.js","./p-23e7c655.system.js","./p-80f174b9.system.js","./p-abe7524f.system.js","./p-63db40b9.system.js","./p-1b9442f6.system.js","./p-58e730b6.system.js"],(function(e){"use strict";var t,s,a,n,o,i,r,c,l;return{setters:[function(e){t=e.r;s=e.h;a=e.H},function(e){n=e.d},function(e){o=e.c},function(e){i=e.H;r=e.t;c=e.l},function(e){l=e.l},function(){},function(){},function(){}],execute:function(){var d=":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 .styled-card{border:var(--zonos-elements-border);border-radius:var(--zonos-elements-radius-6);padding:var(--spacing, 24px);text-align:left}:host .styled-card hr{margin-left:calc(var(--spacing, 24px) * -1);margin-right:calc(var(--spacing, 24px) * -1)}:host .styled-card .card-header{margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;margin-bottom:var(--spacing, 24px);border-bottom:var(--zonos-elements-border);height:65px;line-height:65px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host .styled-card .card-header h5{margin-bottom:0;-ms-flex:1;flex:1}:host .styled-card .card-footer{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;margin:calc(var(--spacing, 24px) * -1);padding:var(--spacing, 24px);border-top:var(--zonos-elements-border);background:var(--zonos-elements-surface-color-secondary);margin-top:var(--spacing, 24px);border-bottom-left-radius:var(--zonos-elements-radius-8);border-bottom-right-radius:var(--zonos-elements-radius-8);height:var(--footerHeight)}";var h=d;var f=e("zonos_card",function(){function e(e){t(this,e);this.actions=undefined;this.footerActions=undefined;this.footerContent=undefined;this.footerHeight=undefined;this.label=undefined;this.spacing="24px"}e.prototype.render=function(){return s(a,{key:"0e52ca31db6c2f956da1910d6e0a222b588c1bcc",style:{"--font-family":n()}},s("div",{key:"69f391d821f88cbee4b0c586a8323b1dd68d7fd3",class:o(["styled-card"]),style:{padding:this.spacing}},this.label&&s("header",{key:"4568a1d7c354830e6e65e31b20b38140aaab9d01",class:"card-header",style:{padding:this.spacing}},s("zonos-text",{key:"e0a6b7a3776916f8208c27373878041807d91960",type:"subheader"},this.label),s("h-stack",{key:"c5f8d01b2f477b16ab9387081987eae64b156e76",spacing:8},this.actions)),s("slot",{key:"6001acfaae8ba37456a7c23bae5c44a91da074f9"}),(this.footerActions||this.footerContent)&&s("footer",{key:"78b926a323a5f1375c8120d5aa8b1ab2a4f3fa4a",class:"card-footer",style:{height:this.footerHeight?"".concat(this.footerHeight,"px"):"auto",padding:this.spacing}},s("div",{key:"2bd0c86b75096c2ee786d4a9b16a3d6e385fbbf1"},this.footerContent),s("h-stack",{key:"7a3f840ac9678a905338a99b8327115bc8199789",spacing:8},this.footerActions))))};return e}());f.style=h;var g='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.99996 2.6665C5.05444 2.6665 2.66663 5.05432 2.66663 7.99984C2.66663 10.9454 5.05444 13.3332 7.99996 13.3332C10.9455 13.3332 13.3333 10.9454 13.3333 7.99984C13.3333 5.05432 10.9455 2.6665 7.99996 2.6665Z" fill="#AFF8C3"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.1403 6.10535C10.3582 6.27488 10.3975 6.58902 10.228 6.80699L8.01055 9.65797C7.76436 9.97449 7.29646 10.0036 7.01291 9.72008L5.81307 8.52024C5.61781 8.32498 5.61781 8.0084 5.81307 7.81314C6.00833 7.61787 6.32492 7.61787 6.52018 7.81314L7.45301 8.74597L9.43862 6.19305C9.60815 5.97508 9.92229 5.93581 10.1403 6.10535Z" fill="#246627"/>\n</svg>\n';var u=":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 .zonos--language-select{width:100%}:host .zonos--language-select .zonos--language-select-content{display:grid;grid-template-columns:repeat(3, minmax(-webkit-max-content, 1fr));grid-template-columns:repeat(3, minmax(max-content, 1fr));padding:16px;padding-top:0px}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button{display:-ms-flexbox;display:flex;padding:8px;gap:4px;-ms-flex-align:center;align-items:center;border-radius:var(--zonos-elements-radius-4);cursor:pointer;width:100%;border:none;background:none}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button:hover{background:var(--zonos-elements-gray-100)}@media (max-width: 400px){:host .zonos--language-select .zonos--language-select-content{grid-template-columns:1fr 1fr}}";var m=u;var b=e("zonos_language_select",function(){function e(e){var s=this;t(this,e);this.languageSelected=function(e){void i(e);s.handleOnClose()};this.handleOnClose=function(){}}e.prototype.render=function(){var e=this;var t=c.selectedLocale;return s(a,{key:"34580123b768ce983c0c9c6fa309bdb1d6756a5a",class:"zonos--elements",style:{"--font-family":n()}},s("div",{key:"6e86352a45b5d9ad0e5ed5dac330367a49a6c6fe",class:"zonos--language-select"},s("zonos-select-dialog-header",{key:"d5b55cbb2858a2c0a6aa6ce0ea0d50eecc7360e8",handleOnClose:function(){return e.handleOnClose()},label:r("Select a language")}),s("div",{key:"c9aeb075428357c4cb15d9a2b09df7c8d6b01b11",class:"zonos--language-select-content"},l.map((function(a){return s("button",{class:"zonos--language-select-button",onClick:function(){return e.languageSelected(a.code)}},s("zonos-text",{textColor:"gray-800"},a.translatedLabel),a.code===t&&s("zonos-icon",{content:g,size:16}))})))))};return e}());b.style=m}}}));