@zonos/elements 1.5.0 → 1.5.2

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 (428) hide show
  1. package/dist/cjs/{TaxId-Q6aDqqWv.js → TaxId-ChhNwG04.js} +36 -0
  2. package/dist/cjs/{cart-B6Aty-21.js → cart-BJpqPdFU.js} +100 -64
  3. package/dist/cjs/{collect-DnrvaXUI.js → collect-CyUttsvB.js} +4 -4
  4. package/dist/cjs/{debounce-Cd2emZPn.js → debounce-BhgA8_3W.js} +2 -2
  5. package/dist/cjs/{debounce-vY0QYT6o.js → debounce-DRPMxNew.js} +1 -1
  6. package/dist/cjs/{getBorderRadius-CyYZw4qq.js → getBorderRadius-CJ_95w3o.js} +1 -1
  7. package/dist/cjs/{getMissingRequiredShippingFields-D03ICqss.js → getMissingRequiredShippingFields-DEbNbRAZ.js} +1 -1
  8. package/dist/cjs/{handleFetch-DQLhurnE.js → handleFetch-DVfjFTYO.js} +181 -71
  9. package/dist/cjs/{hasInclusivePrice-CPCoVeU3.js → hasInclusivePrice-CEPf3_FG.js} +1 -1
  10. package/dist/cjs/index.cjs.js +116 -13
  11. package/dist/cjs/{invoice-Cj8W7NW0.js → invoice-DzRkkpLu.js} +4 -4
  12. package/dist/cjs/loader.cjs.js +1 -1
  13. package/dist/cjs/{localization-BzNeXeDe.js → localization-BhNVhLZs.js} +725 -89
  14. package/dist/cjs/{paypal-CuKshRmZ.js → paypal-DCSqbdjW.js} +5 -5
  15. package/dist/cjs/{placeTestOrder-7czjwkjm.js → placeTestOrder-Bkip4PUT.js} +3 -3
  16. package/dist/cjs/{renderCheckoutCurrency-BH8t2b2x.js → renderCheckoutCurrency-BDvEZ3Hv.js} +2 -2
  17. package/dist/cjs/shouldRenderShortAddressCodeInput-gpu_bMfp.js +21 -0
  18. package/dist/cjs/{shouldShowLanguageSelect-yAbtCmd8.js → shouldShowLanguageSelect-NOVWOU53.js} +1 -1
  19. package/dist/cjs/{submitGtag-D79e8u6s.js → submitGtag-D4sB7w4z.js} +2 -2
  20. package/dist/cjs/{throttle-zSVRQLC0.js → taxIdFields-e4OCgr8K.js} +57 -2
  21. package/dist/cjs/taxIdRules-BBj8kQxJ.js +58 -0
  22. package/dist/cjs/{updateCheckoutSessionAttributes-jMtfOL2m.js → updateCheckoutSessionAttributes-KxwcsKhM.js} +2 -2
  23. package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +26 -31
  24. package/dist/cjs/zonos-address-display_2.cjs.entry.js +4 -4
  25. package/dist/cjs/zonos-address_4.cjs.entry.js +28 -31
  26. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +8 -7
  27. package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
  28. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  29. package/dist/cjs/zonos-button_3.cjs.entry.js +2 -2
  30. package/dist/cjs/zonos-card_5.cjs.entry.js +9 -8
  31. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +91 -86
  32. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +2 -2
  33. package/dist/cjs/zonos-checkout.cjs.entry.js +15 -14
  34. package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
  35. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +7 -6
  36. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +13 -12
  37. package/dist/cjs/zonos-collect.cjs.entry.js +10 -9
  38. package/dist/cjs/zonos-controller.cjs.entry.js +10 -9
  39. package/dist/cjs/zonos-country-flag.cjs.entry.js +3 -3
  40. package/dist/cjs/zonos-country-select_4.cjs.entry.js +4 -4
  41. package/dist/cjs/zonos-elements.cjs.js +1 -1
  42. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +5 -5
  43. package/dist/cjs/zonos-hello.cjs.entry.js +5 -5
  44. package/dist/cjs/zonos-input.cjs.entry.js +2 -2
  45. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +9 -8
  46. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +13 -12
  47. package/dist/cjs/zonos-invoice.cjs.entry.js +10 -9
  48. package/dist/cjs/zonos-language-select_2.cjs.entry.js +3 -3
  49. package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
  50. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +8 -7
  51. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
  52. package/dist/cjs/zonos-stripe-input.cjs.entry.js +2 -2
  53. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  54. package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
  55. package/dist/cjs/{zonosStore-Bx9jK82G.js → zonosStore-CDV83QyK.js} +2 -0
  56. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +8 -7
  57. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +4 -3
  58. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +12 -4
  59. package/dist/collection/components/main/zonos-controller.js +3 -2
  60. package/dist/collection/components/store/checkout/cart.js +3 -2
  61. package/dist/collection/components/store/checkout/stripe.js +20 -21
  62. package/dist/collection/components/store/storageStore.js +7 -6
  63. package/dist/collection/components/store/translationStore/strings.arabic.js +35 -2
  64. package/dist/collection/components/store/translationStore/strings.base.js +35 -2
  65. package/dist/collection/components/store/translationStore/strings.chinese.js +35 -2
  66. package/dist/collection/components/store/translationStore/strings.danish.js +35 -2
  67. package/dist/collection/components/store/translationStore/strings.dutch.js +35 -2
  68. package/dist/collection/components/store/translationStore/strings.french.js +35 -2
  69. package/dist/collection/components/store/translationStore/strings.german.js +35 -2
  70. package/dist/collection/components/store/translationStore/strings.hebrew.js +35 -2
  71. package/dist/collection/components/store/translationStore/strings.indonesian.js +35 -2
  72. package/dist/collection/components/store/translationStore/strings.italian.js +35 -2
  73. package/dist/collection/components/store/translationStore/strings.japanese.js +35 -2
  74. package/dist/collection/components/store/translationStore/strings.korean.js +35 -2
  75. package/dist/collection/components/store/translationStore/strings.norwegian.js +35 -2
  76. package/dist/collection/components/store/translationStore/strings.polish.js +35 -2
  77. package/dist/collection/components/store/translationStore/strings.portuguese.js +35 -2
  78. package/dist/collection/components/store/translationStore/strings.russian.js +35 -2
  79. package/dist/collection/components/store/translationStore/strings.spanish.js +35 -2
  80. package/dist/collection/components/store/translationStore/strings.swedish.js +35 -2
  81. package/dist/collection/components/store/translationStore/strings.turkish.js +35 -2
  82. package/dist/collection/components/store/translationStore/strings.vietnamese.js +35 -2
  83. package/dist/collection/components/store/zonosStore.js +2 -1
  84. package/dist/collection/components/stripe/zonos-address/zonos-address.css +5 -0
  85. package/dist/collection/components/stripe/zonos-address/zonos-address.js +37 -22
  86. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.css +5 -0
  87. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +34 -21
  88. package/dist/collection/components/utils/__tests__/helpers/blockStorage.js +24 -0
  89. package/dist/collection/components/utils/api/getExchangeRate.js +2 -1
  90. package/dist/collection/components/utils/api/prepCalculateLandedCost.js +24 -35
  91. package/dist/collection/components/utils/checkout/getCheckoutTaxIdPayload.js +16 -0
  92. package/dist/collection/components/utils/checkout/getTaxIdFieldState.js +26 -0
  93. package/dist/collection/components/utils/checkout/resolveTaxIdSelection.js +23 -0
  94. package/dist/collection/components/utils/checkout/shouldRenderTaxIdInput.js +7 -11
  95. package/dist/collection/components/utils/checkout/taxIdFields.js +29 -0
  96. package/dist/collection/components/utils/handleFetch.js +19 -9
  97. package/dist/collection/components/utils/hello/countryOverrideStorage.js +17 -40
  98. package/dist/collection/components/utils/logging/installConstructorCapture.js +58 -0
  99. package/dist/collection/components/utils/logging/reportBlockedStorage.js +34 -0
  100. package/dist/collection/components/utils/logging/sendErrorLog.js +8 -1
  101. package/dist/collection/components/utils/logging/startZonosInit.js +35 -0
  102. package/dist/collection/components/utils/logging/thrownMessage.js +16 -0
  103. package/dist/collection/components/utils/safeStorage.js +39 -0
  104. package/dist/collection/components/utils/taxId/taxIdRules.js +44 -0
  105. package/dist/collection/components/utils/taxIdValidationResult.js +57 -58
  106. package/dist/collection/index.js +1 -0
  107. package/dist/collection/scripts/_getZonosQaUrl.js +3 -2
  108. package/dist/collection/scripts/_zonosBase.js +6 -2
  109. package/dist/collection/types/checkout/TaxId.js +31 -0
  110. package/dist/collection/types/generated/graphql.frontend.types.js +0 -16
  111. package/dist/collection/types/generated/graphql.internal.types.js +215 -1
  112. package/dist/esm/{TaxId-Cye-evFK.js → TaxId-DMIgN_sT.js} +32 -1
  113. package/dist/esm/{cart-BoQp8Ema.js → cart-BS5mSI8x.js} +100 -65
  114. package/dist/esm/{collect-Eo4gtyql.js → collect-B9ZxDDl7.js} +4 -4
  115. package/dist/esm/{debounce-BR3PaG8X.js → debounce-DHj2iHA1.js} +1 -1
  116. package/dist/esm/{debounce-CrmpwbEE.js → debounce-DWqMT4lo.js} +2 -2
  117. package/dist/esm/{getBorderRadius-DYfkeXdx.js → getBorderRadius-BiGd45jw.js} +1 -1
  118. package/dist/esm/{getMissingRequiredShippingFields-Ks6_tpjn.js → getMissingRequiredShippingFields-BkEV865q.js} +1 -1
  119. package/dist/esm/{handleFetch-D5GYDF-O.js → handleFetch-BFVO7oAR.js} +178 -72
  120. package/dist/esm/{hasInclusivePrice-CbEfIhI5.js → hasInclusivePrice-zSvDReDb.js} +1 -1
  121. package/dist/esm/index.js +106 -13
  122. package/dist/esm/{invoice-S1KahJ_Z.js → invoice-6iTuS6ek.js} +4 -4
  123. package/dist/esm/loader.js +1 -1
  124. package/dist/esm/{localization-BIh-4pc_.js → localization-CXHiWcJp.js} +725 -89
  125. package/dist/esm/{paypal-DNfvnuUU.js → paypal-BE_NVBoy.js} +5 -5
  126. package/dist/esm/{placeTestOrder-CQaMKFOg.js → placeTestOrder-BXA9K9Iy.js} +3 -3
  127. package/dist/esm/{renderCheckoutCurrency-C2Tw73uR.js → renderCheckoutCurrency-KMa4HlAf.js} +2 -2
  128. package/dist/esm/shouldRenderShortAddressCodeInput-Bc8k2vN0.js +19 -0
  129. package/dist/esm/{shouldShowLanguageSelect-CCD7gpSY.js → shouldShowLanguageSelect-BI_ApEsQ.js} +1 -1
  130. package/dist/esm/{submitGtag-df9AQ2zL.js → submitGtag-C5xzFHjG.js} +2 -2
  131. package/dist/esm/taxIdFields-BUKnHMaL.js +139 -0
  132. package/dist/esm/taxIdRules-xYlx7ZXW.js +47 -0
  133. package/dist/esm/{updateCheckoutSessionAttributes-4Jq6V4pO.js → updateCheckoutSessionAttributes-C9bMKTjz.js} +2 -2
  134. package/dist/esm/zonos-address-completion-dialog_7.entry.js +24 -29
  135. package/dist/esm/zonos-address-display_2.entry.js +4 -4
  136. package/dist/esm/zonos-address_4.entry.js +26 -29
  137. package/dist/esm/zonos-airwallex-payment.entry.js +8 -7
  138. package/dist/esm/zonos-badge.entry.js +1 -1
  139. package/dist/esm/zonos-banner.entry.js +1 -1
  140. package/dist/esm/zonos-button_3.entry.js +2 -2
  141. package/dist/esm/zonos-card_5.entry.js +9 -8
  142. package/dist/esm/zonos-cart-items_12.entry.js +90 -85
  143. package/dist/esm/zonos-checkbox_2.entry.js +2 -2
  144. package/dist/esm/zonos-checkout.entry.js +15 -14
  145. package/dist/esm/zonos-collapse.entry.js +1 -1
  146. package/dist/esm/zonos-collect-cart-items_3.entry.js +7 -6
  147. package/dist/esm/zonos-collect-finish_6.entry.js +13 -12
  148. package/dist/esm/zonos-collect.entry.js +10 -9
  149. package/dist/esm/zonos-controller.entry.js +10 -9
  150. package/dist/esm/zonos-country-flag.entry.js +3 -3
  151. package/dist/esm/zonos-country-select_4.entry.js +4 -4
  152. package/dist/esm/zonos-elements.js +1 -1
  153. package/dist/esm/zonos-hello-dialog.entry.js +5 -5
  154. package/dist/esm/zonos-hello.entry.js +5 -5
  155. package/dist/esm/zonos-input.entry.js +2 -2
  156. package/dist/esm/zonos-invoice-cart-items_2.entry.js +9 -8
  157. package/dist/esm/zonos-invoice-finish_5.entry.js +13 -12
  158. package/dist/esm/zonos-invoice.entry.js +10 -9
  159. package/dist/esm/zonos-language-select_2.entry.js +3 -3
  160. package/dist/esm/zonos-logo.entry.js +1 -1
  161. package/dist/esm/zonos-policy-consent_2.entry.js +8 -7
  162. package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
  163. package/dist/esm/zonos-stripe-input.entry.js +2 -2
  164. package/dist/esm/zonos-text.entry.js +1 -1
  165. package/dist/esm/zonos-v-stack.entry.js +1 -1
  166. package/dist/esm/{zonosStore-msUlqmSD.js → zonosStore-BXP9FvIt.js} +2 -1
  167. package/dist/esm-es5/{TaxId-Cye-evFK.js → TaxId-DMIgN_sT.js} +2 -1
  168. package/dist/esm-es5/{cart-BoQp8Ema.js → cart-BS5mSI8x.js} +42 -31
  169. package/dist/esm-es5/{collect-Eo4gtyql.js → collect-B9ZxDDl7.js} +1 -1
  170. package/dist/esm-es5/{debounce-BR3PaG8X.js → debounce-DHj2iHA1.js} +7 -7
  171. package/dist/esm-es5/debounce-DWqMT4lo.js +1 -0
  172. package/dist/esm-es5/getBorderRadius-BiGd45jw.js +8 -0
  173. package/dist/esm-es5/{getMissingRequiredShippingFields-Ks6_tpjn.js → getMissingRequiredShippingFields-BkEV865q.js} +3 -3
  174. package/dist/esm-es5/handleFetch-BFVO7oAR.js +73 -0
  175. package/dist/esm-es5/{hasInclusivePrice-CbEfIhI5.js → hasInclusivePrice-zSvDReDb.js} +1 -1
  176. package/dist/esm-es5/index.js +30 -12
  177. package/dist/esm-es5/{invoice-S1KahJ_Z.js → invoice-6iTuS6ek.js} +1 -1
  178. package/dist/esm-es5/loader.js +1 -1
  179. package/dist/esm-es5/localization-CXHiWcJp.js +345 -0
  180. package/dist/esm-es5/{paypal-DNfvnuUU.js → paypal-BE_NVBoy.js} +1 -1
  181. package/dist/esm-es5/{placeTestOrder-CQaMKFOg.js → placeTestOrder-BXA9K9Iy.js} +1 -1
  182. package/dist/esm-es5/{renderCheckoutCurrency-C2Tw73uR.js → renderCheckoutCurrency-KMa4HlAf.js} +1 -1
  183. package/dist/esm-es5/shouldRenderShortAddressCodeInput-Bc8k2vN0.js +8 -0
  184. package/dist/esm-es5/{shouldShowLanguageSelect-CCD7gpSY.js → shouldShowLanguageSelect-BI_ApEsQ.js} +1 -1
  185. package/dist/esm-es5/{submitGtag-df9AQ2zL.js → submitGtag-C5xzFHjG.js} +1 -1
  186. package/dist/esm-es5/taxIdFields-BUKnHMaL.js +46 -0
  187. package/dist/esm-es5/taxIdRules-xYlx7ZXW.js +6 -0
  188. package/dist/esm-es5/{updateCheckoutSessionAttributes-4Jq6V4pO.js → updateCheckoutSessionAttributes-C9bMKTjz.js} +1 -1
  189. package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +253 -254
  190. package/dist/esm-es5/zonos-address-display_2.entry.js +1 -1
  191. package/dist/esm-es5/zonos-address_4.entry.js +8 -9
  192. package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
  193. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  194. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  195. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  196. package/dist/esm-es5/zonos-card_5.entry.js +6 -6
  197. package/dist/esm-es5/zonos-cart-items_12.entry.js +137 -136
  198. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
  199. package/dist/esm-es5/zonos-checkout.entry.js +3 -3
  200. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  201. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  202. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  203. package/dist/esm-es5/zonos-collect.entry.js +6 -6
  204. package/dist/esm-es5/zonos-controller.entry.js +5 -5
  205. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  206. package/dist/esm-es5/zonos-country-select_4.entry.js +2 -2
  207. package/dist/esm-es5/zonos-elements.js +1 -1
  208. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  209. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  210. package/dist/esm-es5/zonos-input.entry.js +1 -1
  211. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +2 -2
  212. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  213. package/dist/esm-es5/zonos-invoice.entry.js +3 -3
  214. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  215. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  216. package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
  217. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  218. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  219. package/dist/esm-es5/zonos-text.entry.js +1 -1
  220. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  221. package/dist/esm-es5/{zonosStore-msUlqmSD.js → zonosStore-BXP9FvIt.js} +1 -1
  222. package/dist/scripts/index.d.ts +103 -1
  223. package/dist/scripts/index.js +1 -1
  224. package/dist/scripts/loadZonos.js +1 -1
  225. package/dist/scripts/zonos.js +1 -1
  226. package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +4 -0
  227. package/dist/types/components/store/checkout/stripe.d.ts +9 -0
  228. package/dist/types/components/store/translationStore/strings.arabic.d.ts +34 -1
  229. package/dist/types/components/store/translationStore/strings.base.d.ts +34 -1
  230. package/dist/types/components/store/translationStore/strings.chinese.d.ts +34 -1
  231. package/dist/types/components/store/translationStore/strings.danish.d.ts +34 -1
  232. package/dist/types/components/store/translationStore/strings.dutch.d.ts +34 -1
  233. package/dist/types/components/store/translationStore/strings.french.d.ts +34 -1
  234. package/dist/types/components/store/translationStore/strings.german.d.ts +34 -1
  235. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +34 -1
  236. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +34 -1
  237. package/dist/types/components/store/translationStore/strings.italian.d.ts +34 -1
  238. package/dist/types/components/store/translationStore/strings.japanese.d.ts +34 -1
  239. package/dist/types/components/store/translationStore/strings.korean.d.ts +34 -1
  240. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +34 -1
  241. package/dist/types/components/store/translationStore/strings.polish.d.ts +34 -1
  242. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +34 -1
  243. package/dist/types/components/store/translationStore/strings.russian.d.ts +34 -1
  244. package/dist/types/components/store/translationStore/strings.spanish.d.ts +34 -1
  245. package/dist/types/components/store/translationStore/strings.swedish.d.ts +34 -1
  246. package/dist/types/components/store/translationStore/strings.turkish.d.ts +34 -1
  247. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +34 -1
  248. package/dist/types/components/store/zonosStore.d.ts +2 -1
  249. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +4 -1
  250. package/dist/types/components/stripe/zonos-custom-address/zonos-custom-address.d.ts +4 -1
  251. package/dist/types/components/utils/__tests__/helpers/blockStorage.d.ts +3 -0
  252. package/dist/types/components/utils/checkout/getCheckoutTaxIdPayload.d.ts +6 -0
  253. package/dist/types/components/utils/checkout/getTaxIdFieldState.d.ts +18 -0
  254. package/dist/types/components/utils/checkout/resolveTaxIdSelection.d.ts +12 -0
  255. package/dist/types/components/utils/checkout/shouldRenderTaxIdInput.d.ts +2 -1
  256. package/dist/types/components/utils/checkout/taxIdFields.d.ts +11 -0
  257. package/dist/types/components/utils/logging/installConstructorCapture.d.ts +20 -0
  258. package/dist/types/components/utils/logging/reportBlockedStorage.d.ts +16 -0
  259. package/dist/types/components/utils/logging/startZonosInit.d.ts +5 -0
  260. package/dist/types/components/utils/logging/thrownMessage.d.ts +1 -0
  261. package/dist/types/components/utils/safeStorage.d.ts +4 -0
  262. package/dist/types/components/utils/taxId/taxIdRules.d.ts +37 -0
  263. package/dist/types/components/utils/taxIdValidationResult.d.ts +8 -2
  264. package/dist/types/components.d.ts +22 -0
  265. package/dist/types/index.d.ts +1 -0
  266. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +5 -0
  267. package/dist/types/types/checkout/TaxId.d.ts +45 -0
  268. package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +11 -0
  269. package/dist/types/types/checkout/api/CreateParty.d.ts +2 -0
  270. package/dist/types/types/generated/graphql.frontend.types.d.ts +0 -22
  271. package/dist/types/types/generated/graphql.frontend.types.ts +0 -51
  272. package/dist/types/types/generated/graphql.internal.types.d.ts +270 -1
  273. package/dist/types/types/generated/graphql.internal.types.ts +341 -1
  274. package/dist/types/types/utils/ZonosSettings.d.ts +5 -0
  275. package/dist/zonos-elements/index.esm.js +1 -1
  276. package/dist/zonos-elements/p-08b01c96.entry.js +1 -0
  277. package/dist/zonos-elements/{p-c961caaf.entry.js → p-0909ef77.entry.js} +1 -1
  278. package/dist/zonos-elements/{p-23352709.system.entry.js → p-13015d34.system.entry.js} +4 -4
  279. package/dist/zonos-elements/{p-6c41b00c.entry.js → p-13d5b2f9.entry.js} +1 -1
  280. package/dist/zonos-elements/{p-5b80aff2.system.entry.js → p-150047b3.system.entry.js} +25 -25
  281. package/dist/zonos-elements/p-1986cc37.entry.js +1 -0
  282. package/dist/zonos-elements/{p-CBx5nYet.system.js → p-1OG3IJgY.system.js} +1 -1
  283. package/dist/zonos-elements/{p-d3d0656a.entry.js → p-1a5acbcd.entry.js} +1 -1
  284. package/dist/zonos-elements/{p-756d303f.system.entry.js → p-20eb00de.system.entry.js} +1 -1
  285. package/dist/zonos-elements/{p-9c33f7ed.system.entry.js → p-30bf4700.system.entry.js} +1 -1
  286. package/dist/zonos-elements/{p-d168023b.entry.js → p-3466bcba.entry.js} +1 -1
  287. package/dist/zonos-elements/p-383343c7.entry.js +1 -0
  288. package/dist/zonos-elements/{p-06030d3b.system.entry.js → p-3a506614.system.entry.js} +54 -54
  289. package/dist/zonos-elements/p-43c0ebe9.entry.js +1 -0
  290. package/dist/zonos-elements/{p-acd50b0b.entry.js → p-4612facd.entry.js} +1 -1
  291. package/dist/zonos-elements/{p-244e0302.system.entry.js → p-4715045c.system.entry.js} +1 -1
  292. package/dist/zonos-elements/p-4b65f192.entry.js +1 -0
  293. package/dist/zonos-elements/{p-5967a1c1.system.entry.js → p-573a4e7c.system.entry.js} +6 -6
  294. package/dist/zonos-elements/p-59fc32af.entry.js +1 -0
  295. package/dist/zonos-elements/{p-d82fd8a9.system.entry.js → p-5a296dbc.system.entry.js} +117 -116
  296. package/dist/zonos-elements/{p-193d9722.entry.js → p-61312d5b.entry.js} +1 -1
  297. package/dist/zonos-elements/{p-6abec43f.system.entry.js → p-68325c5a.system.entry.js} +4 -4
  298. package/dist/zonos-elements/{p-0b81f8b9.system.entry.js → p-6db7317a.system.entry.js} +6 -6
  299. package/dist/zonos-elements/{p-51400242.system.entry.js → p-709d1561.system.entry.js} +3 -3
  300. package/dist/zonos-elements/p-71d29603.entry.js +1 -0
  301. package/dist/zonos-elements/{p-7bd99479.system.entry.js → p-7214c953.system.entry.js} +21 -21
  302. package/dist/zonos-elements/p-74659d88.entry.js +1 -0
  303. package/dist/zonos-elements/{p-55916c90.entry.js → p-7f1bea9b.entry.js} +1 -1
  304. package/dist/zonos-elements/{p-0fca452b.entry.js → p-7fe83919.entry.js} +1 -1
  305. package/dist/zonos-elements/{p-1c150f26.entry.js → p-821e413a.entry.js} +1 -1
  306. package/dist/zonos-elements/{p-c403f004.system.entry.js → p-82e45d0c.system.entry.js} +1 -1
  307. package/dist/zonos-elements/{p-1409de3b.system.entry.js → p-88e20e99.system.entry.js} +1 -1
  308. package/dist/zonos-elements/{p-195f6e38.system.entry.js → p-89a3c4db.system.entry.js} +1 -1
  309. package/dist/zonos-elements/p-8ac26831.entry.js +1 -0
  310. package/dist/zonos-elements/{p-a40fd99b.system.entry.js → p-8f9f859f.system.entry.js} +39 -40
  311. package/dist/zonos-elements/{p-92fe9a1f.system.entry.js → p-902cca23.system.entry.js} +1 -1
  312. package/dist/zonos-elements/{p-0a4a7742.system.entry.js → p-93860183.system.entry.js} +1 -1
  313. package/dist/zonos-elements/{p-b5882fbb.system.entry.js → p-9449b4f4.system.entry.js} +1 -1
  314. package/dist/zonos-elements/{p-31043c2e.system.entry.js → p-96b250d8.system.entry.js} +298 -299
  315. package/dist/zonos-elements/p-97729873.entry.js +1 -0
  316. package/dist/zonos-elements/{p-1bac5ac1.system.entry.js → p-990fcf81.system.entry.js} +1 -1
  317. package/dist/zonos-elements/{p-7f031592.system.entry.js → p-9b3668a4.system.entry.js} +155 -155
  318. package/dist/zonos-elements/{p-249c1ee1.system.entry.js → p-9df31243.system.entry.js} +3 -3
  319. package/dist/zonos-elements/p-BD-9rD53.js +1 -0
  320. package/dist/zonos-elements/p-BI6VAB5B.js +1 -0
  321. package/dist/zonos-elements/p-BJFa5RwX.js +1 -0
  322. package/dist/zonos-elements/p-BJ_kE5rM.js +1 -0
  323. package/dist/zonos-elements/{p-Be3Hpms1.system.js → p-BKUlQxBd.system.js} +1 -1
  324. package/dist/zonos-elements/p-BUfCTQXY.system.js +528 -0
  325. package/dist/zonos-elements/{p-CZD8WvyY.system.js → p-BnQyot7Y.system.js} +23 -23
  326. package/dist/zonos-elements/p-Bu9WCfUC.system.js +2 -2
  327. package/dist/zonos-elements/{p-0mGRBGcf.js → p-C-zdj7MK.js} +1 -1
  328. package/dist/zonos-elements/p-C5fs3rIR.js +1 -0
  329. package/dist/zonos-elements/{p-sz4L-ZnB.js → p-CJmWr75U.js} +1 -1
  330. package/dist/zonos-elements/{p-XDxdMlQl.system.js → p-CMneHjck.system.js} +15 -15
  331. package/dist/zonos-elements/p-CP7KnfR3.system.js +245 -0
  332. package/dist/zonos-elements/p-CVRbGFV3.js +1 -0
  333. package/dist/zonos-elements/p-CYxMfUL7.system.js +1 -0
  334. package/dist/zonos-elements/p-Cl5yV0ak.js +1 -0
  335. package/dist/zonos-elements/{p-kaOxUR9u.system.js → p-Cp1IAJvW.system.js} +5 -5
  336. package/dist/zonos-elements/{p-W82paT5F.js → p-CqB9AfBf.js} +1 -1
  337. package/dist/zonos-elements/p-CzKlS3E-.system.js +6 -0
  338. package/dist/zonos-elements/p-D-Lnf8mS.system.js +345 -0
  339. package/dist/zonos-elements/p-D0DkOoAw.system.js +73 -0
  340. package/dist/zonos-elements/{p-c9QtIdJX.js → p-D4xpkSsK.js} +1 -1
  341. package/dist/zonos-elements/p-DATNIakn.js +1 -0
  342. package/dist/zonos-elements/{p-D4MevhAL.system.js → p-DC1OPJDq.system.js} +3 -3
  343. package/dist/zonos-elements/{p-8PPEbm_0.system.js → p-DIab60nK.system.js} +12 -12
  344. package/dist/zonos-elements/p-DKnphvmJ.js +1 -0
  345. package/dist/zonos-elements/{p-Cye-evFK.js → p-DMIgN_sT.js} +1 -1
  346. package/dist/zonos-elements/{p-BuU_p5DP.system.js → p-DTgUqgwV.system.js} +2 -2
  347. package/dist/zonos-elements/p-DW7I0zOF.js +1 -0
  348. package/dist/zonos-elements/{p-DoEHepOc.system.js → p-DXlojp_Y.system.js} +1 -1
  349. package/dist/zonos-elements/p-DqVePqqx.system.js +8 -0
  350. package/dist/zonos-elements/{p-B4Ufchqh.system.js → p-DrS-0mk7.system.js} +3 -3
  351. package/dist/zonos-elements/{p-7abqRc9V.js → p-DrbN3rPL.js} +2 -2
  352. package/dist/zonos-elements/{p-Cby4EkFu.system.js → p-DsBuZ6ob.system.js} +2 -1
  353. package/dist/zonos-elements/{p-DI2vXnXc.system.js → p-Dv5a-V6w.system.js} +1 -1
  354. package/dist/zonos-elements/p-Dwg61Ft_.js +1 -0
  355. package/dist/zonos-elements/{p-474e8a92.system.entry.js → p-a1022808.system.entry.js} +1 -1
  356. package/dist/zonos-elements/{p-17c7ea4a.system.entry.js → p-a3c147d2.system.entry.js} +3 -3
  357. package/dist/zonos-elements/p-aK18R41t.js +1 -0
  358. package/dist/zonos-elements/{p-83aa1c8c.entry.js → p-ad04bba2.entry.js} +1 -1
  359. package/dist/zonos-elements/p-af4ad54b.entry.js +1 -0
  360. package/dist/zonos-elements/p-af741506.entry.js +1 -0
  361. package/dist/zonos-elements/{p-a938c174.entry.js → p-b51010b9.entry.js} +1 -1
  362. package/dist/zonos-elements/{p-6db7c0b1.system.entry.js → p-b540c636.system.entry.js} +2 -2
  363. package/dist/zonos-elements/p-bac94956.entry.js +1 -0
  364. package/dist/zonos-elements/{p-69c3e367.system.entry.js → p-bb1b414a.system.entry.js} +9 -9
  365. package/dist/zonos-elements/{p-b79036fc.entry.js → p-bfa9e32a.entry.js} +1 -1
  366. package/dist/zonos-elements/{p-dfc87b10.system.entry.js → p-c33b8f6a.system.entry.js} +1 -1
  367. package/dist/zonos-elements/p-cf6bf7a4.entry.js +1 -0
  368. package/dist/zonos-elements/{p-CEK_Wk6v.system.js → p-dJcbnNlE.system.js} +1 -1
  369. package/dist/zonos-elements/p-db40b9c3.entry.js +1 -0
  370. package/dist/zonos-elements/p-dd003161.entry.js +1 -0
  371. package/dist/zonos-elements/{p-2603dce0.entry.js → p-e216cc8c.entry.js} +1 -1
  372. package/dist/zonos-elements/p-e374aaa4.entry.js +1 -0
  373. package/dist/zonos-elements/{p-155ed3d3.system.entry.js → p-e43470f7.system.entry.js} +21 -21
  374. package/dist/zonos-elements/p-ebc7ea54.system.entry.js +13 -0
  375. package/dist/zonos-elements/{p-11defdca.system.entry.js → p-f2ed52bc.system.entry.js} +8 -8
  376. package/dist/zonos-elements/{p-d4d2b39e.entry.js → p-fddf3556.entry.js} +1 -1
  377. package/dist/zonos-elements/p-gEViRqvf.js +1 -0
  378. package/dist/zonos-elements/{p-BpDCLBwW.js → p-n5PZKz1k.js} +1 -1
  379. package/dist/zonos-elements/{p-C_z9WL8a.js → p-r-YGHhLa.js} +1 -1
  380. package/dist/zonos-elements/{p-XqkqjeNV.system.js → p-yv7ekcdG.system.js} +2 -2
  381. package/dist/zonos-elements/{p-DQZncB2d.system.js → p-zsTASoh2.system.js} +3 -3
  382. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  383. package/package.json +1 -1
  384. package/dist/cjs/shouldRenderTaxIdInput-TxekHCp7.js +0 -43
  385. package/dist/esm/shouldRenderTaxIdInput-CKyZ6Zni.js +0 -40
  386. package/dist/esm/throttle-Cvlvb-dm.js +0 -85
  387. package/dist/esm-es5/debounce-CrmpwbEE.js +0 -1
  388. package/dist/esm-es5/getBorderRadius-DYfkeXdx.js +0 -8
  389. package/dist/esm-es5/handleFetch-D5GYDF-O.js +0 -60
  390. package/dist/esm-es5/localization-BIh-4pc_.js +0 -348
  391. package/dist/esm-es5/shouldRenderTaxIdInput-CKyZ6Zni.js +0 -17
  392. package/dist/esm-es5/throttle-Cvlvb-dm.js +0 -46
  393. package/dist/zonos-elements/p-06fe2939.entry.js +0 -1
  394. package/dist/zonos-elements/p-24f3c547.entry.js +0 -1
  395. package/dist/zonos-elements/p-30b3c9d3.entry.js +0 -1
  396. package/dist/zonos-elements/p-39ee1558.entry.js +0 -1
  397. package/dist/zonos-elements/p-3a2da031.entry.js +0 -1
  398. package/dist/zonos-elements/p-4679f0ec.entry.js +0 -1
  399. package/dist/zonos-elements/p-4806b264.system.entry.js +0 -13
  400. package/dist/zonos-elements/p-5873ab8e.entry.js +0 -1
  401. package/dist/zonos-elements/p-725e29bb.entry.js +0 -1
  402. package/dist/zonos-elements/p-BGktDPwA.system.js +0 -1
  403. package/dist/zonos-elements/p-Bi-s0fp_.system.js +0 -17
  404. package/dist/zonos-elements/p-CFbfEmjN.js +0 -1
  405. package/dist/zonos-elements/p-CUaf1cEg.js +0 -1
  406. package/dist/zonos-elements/p-CXxvn4GX.system.js +0 -227
  407. package/dist/zonos-elements/p-CcJF6xhQ.js +0 -1
  408. package/dist/zonos-elements/p-Cxuiqv1I.js +0 -1
  409. package/dist/zonos-elements/p-D-bZg-Pc.js +0 -1
  410. package/dist/zonos-elements/p-DE4a-QD5.js +0 -1
  411. package/dist/zonos-elements/p-DOD2I44l.system.js +0 -348
  412. package/dist/zonos-elements/p-DS-qw_qc.system.js +0 -517
  413. package/dist/zonos-elements/p-DZ2mevDK.js +0 -1
  414. package/dist/zonos-elements/p-DnjGkbEy.js +0 -1
  415. package/dist/zonos-elements/p-FRWZayxL.js +0 -1
  416. package/dist/zonos-elements/p-Mrz_lnC1.js +0 -1
  417. package/dist/zonos-elements/p-ad9ff14c.entry.js +0 -1
  418. package/dist/zonos-elements/p-bb3546c0.entry.js +0 -1
  419. package/dist/zonos-elements/p-c1cbfdba.entry.js +0 -1
  420. package/dist/zonos-elements/p-c47ce656.entry.js +0 -1
  421. package/dist/zonos-elements/p-c9d5d8f1.entry.js +0 -1
  422. package/dist/zonos-elements/p-clDfq9AL.js +0 -1
  423. package/dist/zonos-elements/p-d74bc3e8.entry.js +0 -1
  424. package/dist/zonos-elements/p-d8b312e5.entry.js +0 -1
  425. package/dist/zonos-elements/p-db87b0dd.entry.js +0 -1
  426. package/dist/zonos-elements/p-defc2d18.entry.js +0 -1
  427. package/dist/zonos-elements/p-rVp8hgWw.js +0 -1
  428. package/dist/zonos-elements/p-zVLAvre1.system.js +0 -60
@@ -0,0 +1,245 @@
1
+ var __awaiter=this&&this.__awaiter||function(e,n,t,r){function o(e){return e instanceof t?e:new t((function(n){n(e)}))}return new(t||(t=Promise))((function(t,i){function u(e){try{s(r.next(e))}catch(e){i(e)}}function a(e){try{s(r["throw"](e))}catch(e){i(e)}}function s(e){e.done?t(e.value):o(e.value).then(u,a)}s((r=r.apply(e,n||[])).next())}))};var __generator=this&&this.__generator||function(e,n){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,u=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return u.next=a(0),u["throw"]=a(1),u["return"]=a(2),typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function a(e){return function(n){return s([e,n])}}function s(a){if(r)throw new TypeError("Generator is already executing.");while(u&&(u=0,a[0]&&(t=0)),t)try{if(r=1,o&&(i=a[0]&2?o["return"]:a[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,a[1])).done)return i;if(o=0,i)a=[a[0]&2,i.value];switch(a[0]){case 0:case 1:i=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;o=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!i||a[1]>i[0]&&a[1]<i[3])){t.label=a[1];break}if(a[0]===6&&t.label<i[1]){t.label=i[1];i=a;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(a);break}if(i[2])t.ops.pop();t.trys.pop();continue}a=n.call(e,t)}catch(e){a=[6,e];o=0}finally{r=i=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,n,t){if(t||arguments.length===2)for(var r=0,o=n.length,i;r<o;r++){if(i||!(r in n)){if(!i)i=Array.prototype.slice.call(n,0,r);i[r]=n[r]}}return e.concat(i||Array.prototype.slice.call(n))};System.register(["./p-CzKlS3E-.system.js","./p-DBOI98r5.system.js","./p-CKhl__Kc.system.js","./p-D0DkOoAw.system.js","./p-BbgqQIHv.system.js","./p-smUku7Ku.system.js","./p-C29tlYn0.system.js","./p-DsBuZ6ob.system.js"],(function(e){"use strict";var n,t,r,o,i,u,a,s,c,d,l,f,v,w,m,p;return{setters:[function(n){e({curpRegex:n.c,isMexicoTaxIdType:n.i,isPeruTaxIdType:n.a,peruTaxIdTypeFromValue:n.p,stripTaxIdSeparators:n.s})},function(e){n=e.c},function(e){t=e.g;r=e.I},function(e){o=e.t;i=e.s;u=e.g;a=e.a;s=e.h;c=e.l;d=e.b;l=e.c},function(n){f=n.l;e("availableTestKeys",n.a)},function(n){v=n.g;w=n._;m=n.c;p=n.a;e({checkoutHiddenBtnSelector:n.c,checkoutHiddenInternationalBtnSelector:n.a,domesticRedirectedBtnSelector:n.d})},function(n){e("countryRequireShortAddressCode",n.c)},function(n){e({checkoutTaxIdTypeValues:n.a,countryRequireTaxId:n.c,euCountryCodes:n.e,isCountryRequireTaxId:n.i,peruTaxIdDigitLength:n.p,peruTaxIdFormatError:n.b,shipToTaxIdLabels:n.s,taxIdTypeOptions:n.t})}],execute:function(){var h=this;var y=/^Constructor for .+ was not found/;var O=/^Constructor for "?([^#"]+)#/;var g=function(e){var n;var t=o(e,"");if(!t||!y.test(t)){return}if(typeof window.Zonos==="undefined"){return}var r=window.__zonosConstructorCapture;if(!r){return}var u=O.exec(t);var a=(n=u===null||u===void 0?void 0:u[1])!==null&&n!==void 0?n:"";if(r.reported.has(a)){return}r.reported.add(a);void i({endpoint:"stencil://constructor",errors:[t],metadata:{shape:"constructor-not-found",tag:a}})};
2
+ /**
3
+ * Copy a missing-constructor failure onto the existing error log.
4
+ * Stencil catches `Constructor for "tag#mode" was not found` and passes that
5
+ * Error to `console.error`. One report is sent per tag, then the original
6
+ * console.error still runs. This does not request the chunk again.
7
+ */var S=function(){if(window.__zonosConstructorCapture){return}var e=function(e){g(e.reason)};window.__zonosConstructorCapture={listener:e,reported:new Set};window.addEventListener("unhandledrejection",e);
8
+ // eslint-disable-next-line no-console -- Stencil reports the missing constructor here
9
+ var n=console.error.bind(console);
10
+ // eslint-disable-next-line no-console -- record the Stencil diagnostic, then forward it
11
+ console.error=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}g(e[0]);n.apply(void 0,e)}};var b=function(e){
12
+ // sendErrorLog prints only when zonosDebug is on. Keep the failure in the
13
+ // merchant console without leaving an unhandled rejection.
14
+ // eslint-disable-next-line no-console -- the page console is the support signal
15
+ console.error(e);if(typeof window.Zonos==="undefined"){return}void i({endpoint:"zonos://init",errors:[o(e,"Unknown init rejection")],metadata:{shape:"init-rejection"}})};
16
+ /**
17
+ * Run an init that the caller is not waiting on. The rejection is recorded
18
+ * and not rethrown, so startup does not become an unhandled rejection.
19
+ */var _=function(e){var n;try{n=e()}catch(e){b(e);return}void n.catch((function(e){b(e)}))};
20
+ /**
21
+ * Get the load version and url based on the loadScriptSrc and version
22
+ * @returns
23
+ */var j=function(e){var n=e.loadScriptSrc;if(!n){return{currentLoadScriptUrl:"",isForceLoadVersionDomain:false,isWhiteListed:false}}var t=[
24
+ // local domain
25
+ "dev.elements.zonos.com","dev.assets-checkout.zonos.com",
26
+ // any domain with prefix , no need to version it
27
+ ".js.zonos.com",
28
+ // vercel git domain
29
+ "zonos-elements-test-git","zonos-elements-git"];var r=[
30
+ // force load version for qa domain, this is to test the load version behavior
31
+ "qa.js.zonos.com"];
32
+ // get the domain that's used to load the loadZonos.js
33
+ var o=new URL(n).origin;var i=t.some((function(e){
34
+ // check if the current domain is in the white listed domains
35
+ return o.includes(e)}));var u=r.some((function(e){
36
+ // check if the current domain is in the force load version domains list
37
+ return o.includes(e)}));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:u,isWhiteListed:i}};var z=["jsdelivr","cdnjs","unpkg","vercel"];var k="jsdelivr";
38
+ /**
39
+ * Get the next cdn type in the fallback list
40
+ * @param currentCdnType The current cdn type that want to get the next fallback url
41
+ */var I=function(e){
42
+ // get current index of the current fail cdn type in the fallback list
43
+ var n=z.indexOf(e);
44
+ // get the next fallback cdn type
45
+ var t=z[n+1];return t||null};
46
+ /**
47
+ * Attempt to get test public credential to window.Zonos.zonosApiKey if needed
48
+ */var T=function(){return __awaiter(h,void 0,void 0,(function(){var e,n,t,r,o,i;return __generator(this,(function(d){switch(d.label){case 0:e=u();n=a();
49
+ // Do nothing if the test mode is not enabled or the public credential
50
+ if(!e&&!n||!window.Zonos.zonosApiKey){return[2/*return*/,null]}f("[ZONOS - loadZonos] Attempt test public credential","info");
51
+ // Try to get the test public credential if the test mode is enabled and the public credential key is not a test key
52
+ if(!!window.Zonos.zonosApiKey.includes("credential_test")){f("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info");return[2/*return*/,null]}return[4/*yield*/,s("/api/get-test-public-credential")];case 1:t=d.sent(),r=t.errors,o=t.json;if(r.length||!o){c("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",r);return[2/*return*/,null]}i=o.publicCredential;if(!i){c("[ZONOS - loadZonos] No test public key credential. Keep using production key");return[2/*return*/,null]}
53
+ // Set the test public credential to the window object
54
+ f("[ZONOS - loadZonos] Retrieve new test public token ".concat(i),"info");return[2/*return*/,i]}}))}))};
55
+ /**
56
+ * Extracts the zonosQaUrl from the url
57
+ *
58
+ * @param url - url to extract zonosQaUrl from
59
+ *
60
+ * **NOTE**: value of zonosQaUrl param should be without protocol, allowed characters are: a-z, A-Z, 0-9, -, _
61
+ * @example
62
+ * valid: https://www.zonos.com/?zonosQaUrl=some-feature-v988
63
+ * invalid: https://www.zonos.com/?zonosQaUrl=https://zonos-something
64
+ */var N=function(e){if(!e){return null}
65
+ // get params from url
66
+ var n=new URL(e).searchParams;var t=n.get("zonosQaUrl");if(!t){return null}var r=/[^a-zA-Z0-9-_]+/.test(t);if(!!r){return null}return t};
67
+ /**
68
+ * Get the Zonos QA URL and return it. Will remove `zonosQaUrl` from the url query if it doesn't exists.
69
+ */var A=function(){
70
+ /**
71
+ * This is flag to force load cdn for testing purpose
72
+ * When developing, if the script load is from `dev.elements.zonos.com`,
73
+ * it would load script from that same domain instead of loading from cdn
74
+ */
75
+ var e=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||e){return null}var n=N(window.location.href);var t="https://v1.5.2.js.zonos.com";
76
+ // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
77
+ if(!n&&(t.includes("test.")||
78
+ // Vercel git domain
79
+ t.includes("test-"))){return t}
80
+ // when local demo app is running, it needs to use the local dev script unless the qaUrl is set
81
+ if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com","dev.storybook.elements.zonos.com"].includes(window.location.hostname)){return"https://dev.elements.zonos.com"}if(!n){return null}
82
+ // If the qaUrl, use the dev-elements domain to forward the request to the dev server to quickly debug the issue
83
+ if(n==="dev-elements"){return"https://dev.elements.zonos.com"}
84
+ // The worker alias selects the API host only. Scripts stay on the normal CDN.
85
+ if(n==="worker"){return null}var r="preview.js.zonos.com";var o="https://".concat(n,".").concat(r);f("[ZONOS-WARNING] using '".concat(o,"' for loading elements script"),"warn");
86
+ // request to the url and check if the request has an error
87
+ void fetch(o).then((function(){
88
+ // cleanup checkout session to avoid using the prod session in preview domain
89
+ d("session","zonos--checkout-session-id");d("session","zonos--client-secret")})).catch((function(){alert("[ZONOS-WARNING] '".concat(o,"' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE"));
90
+ // remove the zonosQaUrl param from url
91
+ var e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");var n=window.location.pathname;var t="".concat(n,"?").concat(e.toString());
92
+ /**
93
+ * Setting the state to null in window.history.replaceState can cause issues with rendering when using next/link and pressing the back button.
94
+ * @ref https://github.com/vercel/next.js/issues/33233#issuecomment-1052349396
95
+ **/window.history.replaceState(window.history.state,"",t);window.location.reload();return null}));return o};
96
+ /* eslint-disable no-console */
97
+ /** Loading stripe script extracted from stripe.js repository */var R="2025-02-24.acacia";var Z="https://js.stripe.com/v3";var E=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var C=3;var U="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";var L=function(){var e=document.querySelectorAll('script[src^="'.concat(Z,'"]'));for(var n=0;n<e.length;n++){var t=e[n];if(!t){continue}if(!E.test(t.src)){continue}return t}return null};var x=null;var P=function(e){var n="";var t=document.createElement("script");t.src="".concat(Z).concat(n);var r=document.head||document.body;if(!r){c("Expected document.body not to be null. Stripe.js requires a <body> element.");return null}r.appendChild(t);return t};var D=function(e){
98
+ // Ensure that we only attempt to load Stripe.js at most once
99
+ if(x!==null){return x}x=new Promise((function(n,t){if(typeof window==="undefined"||typeof document==="undefined"){
100
+ // Resolve to null when imported server side. This makes the module
101
+ // safe to import in an isomorphic code base.
102
+ n(null);return}if(window.Stripe){n(window.Stripe);return}try{var r=L();if(r&&e){console.warn(U)}else if(!r){r=P()}r===null||r===void 0?void 0:r.addEventListener("load",(function(){if(window.Stripe){n(window.Stripe)}else{t(new Error("Stripe.js not available"))}}));r===null||r===void 0?void 0:r.addEventListener("error",(function(){t(new Error("Failed to load Stripe.js"))}))}catch(e){t(e);return}}));return x};var F=function(e,n){if(!e||!e._registerWrapper){return}e._registerWrapper({name:"stripe-js",startTime:n})};var M=function(e){if(!("version"in e)){return}var n=e.version;return typeof n==="number"||typeof n==="string"?n:undefined};var B=function(e,n,t){if(e===null){return null}var r=n[0],o=n[1];var i=Object.assign({},o);var u=M(e);var a=typeof u==="string"&&u!==C.toString();if(a){delete i.apiVersion}else{i.apiVersion=R}var s=e(r,i);F(s,t);return s};
103
+ // Execute our own script injection after a tick to give users time to do their
104
+ // own script injection.
105
+ var K=function(){var e,n;return typeof window!=="undefined"&&(typeof((e=window.Zonos)===null||e===void 0?void 0:e.createCartId)==="function"||typeof((n=window.Zonos)===null||n===void 0?void 0:n.buildCartDetail)==="function")};var G=Promise.resolve().then((function(){
106
+ // Skip eagerly loading Stripe when no checkout cart callback is configured
107
+ // (e.g. a Hello-only integration). Stripe is loaded on demand instead.
108
+ if(!K()){return null}return D(null)}));var V=false;G.catch((function(e){if(!V){
109
+ // eslint-disable-next-line no-console
110
+ console.warn(e)}}));var q=function(){var e=[];for(var n=0;n<arguments.length;n++){e[n]=arguments[n]}return __awaiter(h,void 0,void 0,(function(){var n,t,r,o;return __generator(this,(function(i){switch(i.label){case 0:V=true;t=Date.now();return[4/*yield*/,G];case 1:if(!((n=i.sent())!==null&&n!==void 0))return[3/*break*/,2];o=n;return[3/*break*/,4];case 2:return[4/*yield*/,D(null)];case 3:o=i.sent();i.label=4;case 4:r=o;return[2/*return*/,B(r,e,t)]}}))}))};var H="tempCartUUID";
111
+ /**
112
+ * Simple function to get the cart id from the query param.
113
+ */var W=function(){var e=new URLSearchParams(window.location.search);var n=e.get(H);return n};var Q=function(e){return __awaiter(h,[e],void 0,(function(e){var n,r,o,i,a,c,d,l,w;var m=e.cartId,p=e.retries;return __generator(this,(function(e){switch(e.label){case 0:n=u();r=t();o=v()||undefined;i=new URLSearchParams;if(r.overrideShouldEnabledCustomAddress){i.set("overrideShouldEnabledCustomAddress",r.overrideShouldEnabledCustomAddress)}return[4/*yield*/,s("/api/zonos-elements/get-cart?".concat(i.toString()),{body:{isTestMode:n,renewCartExpirationToken:o,tempCartUUID:m},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:a=e.sent(),c=a.errors,d=a.json,l=a.zonosMode;w=!d||c.length;if(!(w&&p))return[3/*break*/,3];f("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:p});
114
+ // wait 1 second before retrying
115
+ return[4/*yield*/,new Promise((function(e){return setTimeout(e,500)}))];case 2:
116
+ // wait 1 second before retrying
117
+ e.sent();return[2/*return*/,Q({cartId:m,retries:p-1})];case 3:if(w){return[2/*return*/,null]}return[2/*return*/,Object.assign(Object.assign({},d),{zonosMode:l})]}}))}))};var Y=function(e){return __awaiter(h,void 0,void 0,(function(){var n,t,r,o;return __generator(this,(function(i){switch(i.label){case 0:n=w(e),t=n.isDgsCartId,r=n.isLegacyCartId;if(!r&&!t){c("[ZONOS - loadZonos] invalid cart id");return[2/*return*/,null]}return[4/*yield*/,Q({cartId:e,retries:5})];case 1:o=i.sent();f("[ZONOS - loadZonos] getting temp cart data","info",o);if(!o){c("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2/*return*/,null]}window.Zonos.storeId=o.cartData.storeId;window.Zonos.zonosApiKey=o.cartData.credentialToken;window.Zonos.zonosMode=o.zonosMode;return[2/*return*/,{cartData:o.cartData,settings:o.settings,storeFavicon:o.storeFaviconUrl,storeId:o.cartData.storeId,storeLogo:o.storeLogoUrl,zonosApiKey:o.cartData.credentialToken}]}}))}))};var J;
118
+ /**
119
+ * Get the load version and url based on the loadScriptSrc, if the domain that used to load `zonos.js` is in white listed domains, use currentLoadScriptUrl as the load url instead, if zonosQaUrl exists, it would also fall under the white listed domain
120
+ */var $=function(){if(typeof document==="undefined"){return null}var e=document.querySelector('script[src*="/zonos.js"]');var n=j({loadScriptSrc:e===null||e===void 0?void 0:e.src}),t=n.currentLoadScriptUrl,r=n.isWhiteListed;if(r){return t}return null}();var X=Date.now();var ee="https://v1.5.2.js.zonos.com";var ne=$||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.5.2";var te="https://unpkg.com/@zonos/elements@1.5.2";var re="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.5.2";var oe="https://fonts.googleapis.com";var ie=/^https:\/\/fonts\.googleapis\.com/;var ue=/** @class */function(){function e(){}return e}();e("Zonos",ue);J=ue;ue.doneInit=false;ue.cartSettings=null;
121
+ // if query 'zonosDebug=1' param from url, debug mode is on
122
+ ue.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);ue.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);ue._paypalMockResponse=null;ue.iframeLogType=typeof window!=="undefined"?new URLSearchParams(window.location.search).get("iframeLogType"):null;ue.isBigCommerce=false;ue.releaseDate="1793899893283";ue.isLegacyCheckout=false;ue.googleAnalyticId=null;ue.googleAnalyticReady=false;ue.facebookPixelId=null;ue.facebookPixelReady=false;ue.startLoadTime=X;ue.domain=typeof window!=="undefined"?// domain that embeds the iframe
123
+ window.location!=window.parent.location&&document.referrer||
124
+ // current domain
125
+ document.location.hostname:"";ue.showBaseForeign=typeof window!=="undefined"&&window.location.search.includes("zonosShowBaseForeign");ue.overrideUseCustomAddressForm=false;ue.isCollect=false;ue.isInvoice=false;
126
+ /**
127
+ * By default, the package will load from npm
128
+ */ue.isNpm=true;ue.zonosQaUrl=null;ue.zonosQaUrlApi=null;ue.trackEventLogs=[];ue.version="v".concat("1.5.2");ue.modeAlerted=false;ue.cartData=null;ue.paypal=null;ue.zonosMode=null;ue.IframeService=r;ue.getCurrentTimestamp=function(){return(new Date).getTime()};ue.zonosController=null;ue.loadTimeApiInfoList=[];ue.logIntervalId=null;ue.init=function(e){return __awaiter(h,void 0,void 0,(function(){var n,t,r,o,i,u,a,s,d,v,w,p,h,y,O;return __generator(this,(function(g){switch(g.label){case 0:S();n=e.appearance,t=e.checkoutSettings,r=e.currencyConverter,o=e.helloSettings,i=e.onCountryChange,u=e.overrideCurrencyFormat,a=e.storeId,s=e.zonosApiKey;J.cartId=W();
129
+ // Expose the checkout cart callbacks on the global so Stripe loading can be
130
+ // gated on whether at least one of them is configured.
131
+ J.createCartId=t===null||t===void 0?void 0:t.createCartId;
132
+ // eslint-disable-next-line @typescript-eslint/no-deprecated -- intentionally mirror the (deprecated) callback so Stripe loading can be gated on it
133
+ J.buildCartDetail=t===null||t===void 0?void 0:t.buildCartDetail;if(J.doneInit){
134
+ // do nothing if zonos is already initialized
135
+ return[2/*return*/]}f("====== ZONOS DEBUG MODE: on (".concat(J.version,") ======"));J.zonosApiKey=s;J.storeId=a;
136
+ // When not in iframe, providers are ready (gtag/fbq work directly). When in iframe, relay sets these after parent configures.
137
+ if(typeof window!=="undefined"&&window.parent===window){J.googleAnalyticReady=true;J.facebookPixelReady=true}if(!J.isNpm)return[3/*break*/,4];f("====== ZONOS LOADING FROM NPM ======");d=A();
138
+ // if zonosQaUrl is available, inject the script from the zonosQaUrl and then call init again
139
+ if(d&&!window.isZonosPreview){f('====== RE-INJECT "zonos.js" FROM PRVIEW: '.concat(d," ======"),"info");v=document.createElement("script");v.src="".concat(d,"/dist/scripts/zonos.js");document.head.appendChild(v);v.addEventListener("load",(function(){window.Zonos.isNpm=J.isNpm;window.Zonos.isBigCommerce=J.isBigCommerce;window.Zonos.isLegacyCheckout=J.isLegacyCheckout;window.Zonos.zonosMode=J.zonosMode;
140
+ // call init again after the script is loaded
141
+ _((function(){return window.Zonos.init(e)}))}));v.addEventListener("error",(function(){alert('[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: '.concat(d))}));
142
+ // Set so won't inject the preview script again
143
+ window.isZonosPreview=true;return[2/*return*/]}
144
+ // zonosApiKey is required if tempCartUUID in query params are not provided
145
+ if(!s&&!J.cartId){c("Zonos API key is required unless `tempCartUUID` is provided in url query params.");return[2/*return*/]}if(!(!J.cartData&&J.cartId))return[3/*break*/,2];f("Initialize cart data");return[4/*yield*/,Y(J.cartId)];case 1:w=g.sent();if(!w){c("Failed to get cart data");return[2/*return*/]}J.cartData=w.cartData;J.zonosApiKey=w.zonosApiKey;J.cartSettings=w.settings;g.label=2;case 2:return[4/*yield*/,T()];case 3:p=g.sent();if(p){J.zonosApiKey=p}g.label=4;case 4:h=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||l("session","zonos--client-secret");y=J.cartId&&J.cartData||!!h;
146
+ // inject hidden button to body to trigger checkout right away if we have cartData or stripe client secret
147
+ if(y){f("Cart data or stripe client secret is available, inject hidden button and trigger checkout");O=document.createElement("button");O.style.display="none";O.id="".concat(m);document.body.appendChild(O)}f("init zonos");J.restoreNativeBrowserFunctions();
148
+ // inject custom script for hosted checkout if can find it in metadata
149
+ J.injectCustomScriptForHostedCheckout();
150
+ // inject zonos cdn
151
+ J.injectZonosCdn();
152
+ // inject css for zonos elements
153
+ J.injectZonosCss();
154
+ // inject fonts for zonos elements
155
+ J.injectFonts();
156
+ // inject checkout international button
157
+ J.injectCheckoutInternationalButton();
158
+ // init zonos controller
159
+ J.injectController({config:{appearance:n,checkoutSettings:t,currencyConverter:r,helloSettings:o,onCountryChange:i,overrideCurrencyFormat:u}});J.doneInit=true;return[2/*return*/]}}))}))};
160
+ /**
161
+ * Inject the hidden international checkout button to trigger checkout regardless of shipping zones
162
+ */ue.injectCheckoutInternationalButton=function(){if(!document.querySelector("#".concat(p))){
163
+ // inject the hidden international checkout button
164
+ var e=document.createElement("button");e.id=p;e.style.display="none";document.body.appendChild(e)}};ue.injectCustomScriptForHostedCheckout=function(){var e=J.cartData;var n=(e===null||e===void 0?void 0:e.metadata)||[];var t=n.find((function(e){return e.key==="customHeaderScript"}));var r=n.find((function(e){return e.key==="customFooterScript"}));
165
+ // googleAnalyticId / facebookPixelId are set by customHTML in checkoutSettings (e.g. <script>window.Zonos.googleAnalyticId = "G-XXX"; window.Zonos.facebookPixelId = "1234567890";<\/script>), injected by zonos-controller
166
+ // Only inject the script if checkout is on Zonos hosted checkout and custom script is available
167
+ if(!window.Zonos.isLegacyCheckout||!t&&!r){f("Skip injecting custom script for hosted checkout","info",{footerScript:r,headerScript:t,isLegacyCheckout:window.Zonos.isLegacyCheckout});return}if(t){f("Injecting custom header script");var o=document.createElement("script");o.textContent=t.value;document.head.appendChild(o)}if(r){f("Injecting custom footer script");var o=document.createElement("script");o.textContent=r.value;document.body.appendChild(o)}};ue.displayCurrency=function(){var e=document.querySelector("zonos-hello");if(e){void e.displayCurrency()}};ue.triggerCheckoutInternational=function(){return __awaiter(h,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.querySelector("#".concat(p));setTimeout((function(){if(e){e.dispatchEvent(n("click"))}}),10);return[2/*return*/]}))}))};
168
+ // Called openHelloDialog because the main use case is to simply open the dialog
169
+ ue.openHelloDialog=function(e){var n=document.querySelector("zonos-hello");if(n){void n.openHelloDialog(e!==null&&e!==void 0?e:true)}};ue.showNotification=function(e){var n;void((n=J.zonosController)===null||n===void 0?void 0:n.showNotification(e))};ue.updateOrganizationName=function(e){var n;void((n=J.zonosController)===null||n===void 0?void 0:n.updateOrganizationName(e))};ue.disablePlaceOrderButtons=function(e){var n=e.autoEnable,t=n===void 0?true:n,r=e.config,o=e.disable,i=e.placeOrderButtonSelector;var u;
170
+ // if disablePlaceOrderButtonActivation is true, do nothing
171
+ if((u=r.checkoutSettings)===null||u===void 0?void 0:u.disablePlaceOrderButtonActivation){return}
172
+ // if placeOrderAnchor is passed in the config for checkoutSettings, disable the place order button until zonos is initialized
173
+ if(i){var a=document.querySelectorAll(i);var s=function(e){var n=e.target;
174
+ // prevent default and propagation when the item has disabled attribute
175
+ if(n.getAttribute("disabled")){e.preventDefault();e.stopPropagation()}};a.forEach((function(e){var n=e.getAttribute("data-zonos-checkout-attached");if(n){
176
+ // do nothing if event is already attached
177
+ return}if(o){e.setAttribute("disabled","true");
178
+ // prevent the selector to perform default action when it's disabled
179
+ e.addEventListener("click",s)}else{e.removeAttribute("disabled");
180
+ // clean up the event listener
181
+ e.removeEventListener("click",s)}}));
182
+ // only auto enable if autoEnable is true and we are setting button disable
183
+ if(t&&o){setTimeout((function(){
184
+ // release it if zonos is not initialized after 5 seconds (this is to prevent the place order button from being disabled forever due to api)
185
+ a.forEach((function(e){e.removeAttribute("disabled");
186
+ // clean up the event listener if exists
187
+ e.removeEventListener("click",s)}))}),5e3)}}};
188
+ /**
189
+ * Zonos elements and its dependencies are using the native browser functions.
190
+ * This function will restore the native browser functions that are overridden by the merchant's polyfills.
191
+ * If the URL parameter `useMerchantPolyfill=1` is present, keep the merchant's polyfills instead of restoring native browser functions. This allows testing checkout compatibility with merchant polyfills.
192
+ */ue.restoreNativeBrowserFunctions=function(){var e;
193
+ // If the URL parameter `useMerchantPolyfill=1` is present, keep the merchant's polyfills instead of restoring native browser functions.
194
+ var n=new URL(window.location.href).searchParams.get("useMerchantPolyfill")==="1";if(n){return}var t="zonos---native-browser";var r=document.querySelector("iframe#".concat(t));if(!r){
195
+ // add a hidden iframe
196
+ r=document.createElement("iframe");r.id=t;r.style.display="none";r.style.opacity="0";r.style.position="absolute";r.style.top="-9999px";r.style.left="-9999px";r.style.width="1px";r.style.height="1px";r.style.border="none";r.style.overflow="hidden";r.style.visibility="hidden";document.body.appendChild(r)}
197
+ /**
198
+ * Override Array.from if the site is using the obsolete prototype.js (last updated 2015).
199
+ * If old browser is being used and Array.from is not available, just use Array from the prototype.js polyfill
200
+ */var o=((e=r.contentWindow)===null||e===void 0?void 0:e.window.Array.from)||Array.from;Array.from=o;document.body.removeChild(r)};ue.injectController=function(e){var n=e.config;var t,r;if(document.querySelector("zonos-controller")){return}
201
+ // if placeOrderAnchor is passed in the config for checkoutSettings, disable the place order button until zonos is initialized
202
+ if((t=n.checkoutSettings)===null||t===void 0?void 0:t.placeOrderButtonSelector){var o=n.checkoutSettings.placeOrderButtonSelector;J.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:o});
203
+ // create a mutation observer to see if any new elements that match our selector is added to the DOM
204
+ var i=new MutationObserver((function(){J.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:o})}));i.observe(document.body,{childList:true,subtree:true})}
205
+ // if alwaysTriggerInternationalCheckoutSelector is passed in the config for checkoutSettings, disable the place order button until zonos is initialized
206
+ if((r=n.checkoutSettings)===null||r===void 0?void 0:r.alwaysTriggerInternationalCheckoutSelector){var u=n.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;J.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:u});
207
+ // create a mutation observer to see if any new elements that match our selector is added to the DOM
208
+ var i=new MutationObserver((function(){J.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:u})}));i.observe(document.body,{childList:true,subtree:true})}var a=document.createElement("zonos-controller");a.config=n;a.zonosApiKey=J.zonosApiKey||"";a.addEventListener("stripeInitEvent",(function(e){return __awaiter(h,void 0,void 0,(function(){var n,t;return __generator(this,(function(r){switch(r.label){case 0:n=e.detail;f("loading Stripe");return[4/*yield*/,q(n.publishableKey)];case 1:t=r.sent();if(!t){c("API seems to be invalid or missing. Failed to load Stripe");return[2/*return*/]}window.Zonos.stripe=t;if(window.Zonos.isCollect){void a.initCollectElement(t)}else if(window.Zonos.isInvoice){void a.initInvoiceElement(t)}else{void a.initCheckoutElement(t)}return[2/*return*/]}}))}))}));document.body.appendChild(a);
209
+ // set zonos controller to be global
210
+ J.zonosController=a;f("Zonos controller injected!")};ue.injectScript=function(e){var n=e.cdnType,t=e.isModule,r=e.theRestUrl;var o=J.getZonosUrl(n);var i="".concat(o,"/").concat(r);var u=function(){var e=document.querySelector('script[src="'.concat(i,'"]'));return!!e};if(u()){f('Zonos script "'.concat(i,'" already exists in the document'),"warn");return}var a=document.head||document.body;
211
+ // init zonos elements when the zonosKey is valid
212
+ // inject esmodule cdn for zonos elements
213
+ var s=document.createElement("script");if(!!t){s.type="module"}else{s.noModule=true}s.src=i;s.crossOrigin="anonymous";s.onerror=function(){c("Failed to load ".concat(s.src));var e=I(n);
214
+ // if next fallback cdn type exists, inject the script with the next fallback cdn type
215
+ if(!e){return}J.injectScript({cdnType:e,isModule:t,theRestUrl:r})};a.appendChild(s)};
216
+ /**
217
+ * 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`.
218
+ */ue.getZonosUrl=function(e){var n=function(){switch(e){case"jsdelivr":return ne;case"unpkg":return te;case"cdnjs":return re;case"vercel":return ee}};
219
+ // To ensure that sites using zonos-elements load the script from a specific domain when using npm, we need to check for zonosQaUrl and use it if available. Otherwise it will always load from the compiled versioned domain
220
+ if(J.isNpm){var t=A();
221
+ // Default to hard coded domain if zonosQaUrl is not available
222
+ return t||n()}return n()};ue.injectZonosCdn=function(){
223
+ // init zonos elements when the zonosKey is valid
224
+ // inject esmodule cdn for zonos elements
225
+ J.injectScript({cdnType:k,isModule:true,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"});
226
+ // inject non module cdn for zonos elements
227
+ J.injectScript({cdnType:k,isModule:false,theRestUrl:"dist/zonos-elements/zonos-elements.js"});f("Zonos cdn script injected!")};ue.injectStylesheet=function(e){var n=e.cdnType,t=e.theRestUrl;var r=J.getZonosUrl(n);var o=document.head||document.body;
228
+ // inject preconnect css for zonos elements
229
+ var i=document.createElement("link");i.rel="preconnect";i.href="".concat(ee,"/");o.appendChild(i);
230
+ // inject css for zonos elements
231
+ var u=document.createElement("link");u.rel="stylesheet";u.href="".concat(r,"/").concat(t);u.onerror=function(){c("Failed to load ".concat(u.href));var e=I(n);
232
+ // if the css failed to load, try to load the next fallback cdn if exists
233
+ if(!e){return}J.injectStylesheet({cdnType:e,theRestUrl:t})};o.appendChild(u)};ue.injectZonosCss=function(){var e=function(){return!!document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')};if(e()){f("Zonos style links already injected","warn");return}
234
+ // inject css for zonos elements
235
+ J.injectStylesheet({cdnType:k,theRestUrl:"dist/zonos-elements/zonos-elements.css"});f("Zonos style css injected!")};ue.injectFonts=function(){var e=function(){var e=document.fonts.check("1em Inter");if(e){f("Inter font already loaded","warn");return}var n=document.querySelectorAll('link[rel="stylesheet"][href^="'.concat(oe,'"]'));for(var t=0;t<n.length;t++){var r=n[t];if(!r){continue}if(ie.test(r.href)){continue}return r}return null};if(e()){f("Inter font already injected","warn");return}var n=document.head||document.body;
236
+ // inject font css for zonos elements
237
+ var t=document.createElement("link");t.rel="preconnect";t.href=oe;n.appendChild(t);
238
+ // inject font css for zonos elements
239
+ var r=document.createElement("link");r.rel="stylesheet";r.href="".concat(oe,"/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");n.appendChild(r);f("Zonos font injected!")};
240
+ // apply font for zonos elements and inject font if needed
241
+ ue.setupGoogleFont=function(e){var n;void((n=J.zonosController)===null||n===void 0?void 0:n.setupGoogleFont(e))};
242
+ // this function is to inject google font to the browser, not apply the font for zonos elements, to apply the font and inject font if needed, use `setupGoogleFont` instead
243
+ ue.injectSupportGoogleFont=function(e){var n;f("[FONT] injecting ".concat(e));var t=(n=e.match(/family=(.*?):/))===null||n===void 0?void 0:n[1];var r=document.head||document.body;
244
+ // inject font css for zonos elements
245
+ if(!document.querySelector('link[rel="preconnect"][href^="'.concat(oe,'"]'))){var o=document.createElement("link");o.rel="preconnect";o.href=oe;r.appendChild(o)}if(document.querySelector('link[rel="stylesheet"][href="'.concat(e,'"]'))){f("[FONT] ".concat(t," font already injected"),"warn");return}var i=document.createElement("link");i.rel="stylesheet";i.href=e;r.appendChild(i);f("[FONT] ".concat(t," font injected!"))};var ae=e("checkoutSessionMutableAttributeKeys",["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"]);var se=e("checkoutSessionImmutableAttributeKeys",["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"]);var ce=e("checkoutSessionAttributeKeys",__spreadArray(__spreadArray([],ae,true),se,true))}}}));