@zonos/elements 1.4.2 → 1.5.1

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 (403) hide show
  1. package/dist/cjs/{TaxId-Q6aDqqWv.js → TaxId-ChhNwG04.js} +36 -0
  2. package/dist/cjs/{cart-B6Aty-21.js → cart-CiXlehwQ.js} +88 -52
  3. package/dist/cjs/{collect-DnrvaXUI.js → collect-Drr8fY-q.js} +3 -3
  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-DI6qF1z3.js} +1 -1
  8. package/dist/cjs/{hasInclusivePrice-CPCoVeU3.js → hasInclusivePrice-84KS94yH.js} +1 -1
  9. package/dist/cjs/index.cjs.js +19 -8
  10. package/dist/cjs/{invoice-Cj8W7NW0.js → invoice-5hVfSXpb.js} +3 -3
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/{localization-BzNeXeDe.js → localization-B2mjW0Xa.js} +701 -41
  13. package/dist/cjs/{paypal-CuKshRmZ.js → paypal-pd8Nz_R_.js} +4 -4
  14. package/dist/cjs/{placeTestOrder-7czjwkjm.js → placeTestOrder-DrI8rD9o.js} +2 -2
  15. package/dist/cjs/{renderCheckoutCurrency-BH8t2b2x.js → renderCheckoutCurrency-u5q8YdUb.js} +2 -2
  16. package/dist/cjs/shouldRenderShortAddressCodeInput-gpu_bMfp.js +21 -0
  17. package/dist/cjs/{shouldShowLanguageSelect-yAbtCmd8.js → shouldShowLanguageSelect-gBg4KeTQ.js} +1 -1
  18. package/dist/cjs/{submitGtag-D79e8u6s.js → submitGtag-Rc-S3PnH.js} +1 -1
  19. package/dist/cjs/{throttle-zSVRQLC0.js → taxIdFields-BrIaPTcd.js} +57 -2
  20. package/dist/cjs/taxIdRules-BBj8kQxJ.js +58 -0
  21. package/dist/cjs/{updateCheckoutSessionAttributes-jMtfOL2m.js → updateCheckoutSessionAttributes-d0IKpwW8.js} +1 -1
  22. package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +25 -30
  23. package/dist/cjs/zonos-address-display_2.cjs.entry.js +3 -3
  24. package/dist/cjs/zonos-address_4.cjs.entry.js +27 -30
  25. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +7 -6
  26. package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
  27. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  28. package/dist/cjs/zonos-button_3.cjs.entry.js +2 -2
  29. package/dist/cjs/zonos-card_5.cjs.entry.js +8 -7
  30. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +148 -80
  31. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +2 -2
  32. package/dist/cjs/zonos-checkout.cjs.entry.js +31 -20
  33. package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
  34. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +6 -5
  35. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +12 -11
  36. package/dist/cjs/zonos-collect.cjs.entry.js +9 -8
  37. package/dist/cjs/zonos-controller.cjs.entry.js +7 -6
  38. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  39. package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -3
  40. package/dist/cjs/zonos-elements.cjs.js +1 -1
  41. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +4 -4
  42. package/dist/cjs/zonos-hello.cjs.entry.js +4 -4
  43. package/dist/cjs/zonos-input.cjs.entry.js +2 -2
  44. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +8 -7
  45. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +12 -11
  46. package/dist/cjs/zonos-invoice.cjs.entry.js +9 -8
  47. package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
  48. package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
  49. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +7 -6
  50. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +2 -2
  51. package/dist/cjs/zonos-stripe-input.cjs.entry.js +2 -2
  52. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  53. package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
  54. package/dist/cjs/{zonosStore-Bx9jK82G.js → zonosStore-CDV83QyK.js} +2 -0
  55. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.css +10 -0
  56. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +6 -2
  57. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +7 -10
  58. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +12 -4
  59. package/dist/collection/components/store/checkout/stripe.js +10 -12
  60. package/dist/collection/components/store/translationStore/strings.arabic.js +35 -2
  61. package/dist/collection/components/store/translationStore/strings.base.js +35 -2
  62. package/dist/collection/components/store/translationStore/strings.chinese.js +35 -2
  63. package/dist/collection/components/store/translationStore/strings.danish.js +35 -2
  64. package/dist/collection/components/store/translationStore/strings.dutch.js +35 -2
  65. package/dist/collection/components/store/translationStore/strings.french.js +35 -2
  66. package/dist/collection/components/store/translationStore/strings.german.js +35 -2
  67. package/dist/collection/components/store/translationStore/strings.hebrew.js +35 -2
  68. package/dist/collection/components/store/translationStore/strings.indonesian.js +35 -2
  69. package/dist/collection/components/store/translationStore/strings.italian.js +35 -2
  70. package/dist/collection/components/store/translationStore/strings.japanese.js +35 -2
  71. package/dist/collection/components/store/translationStore/strings.korean.js +35 -2
  72. package/dist/collection/components/store/translationStore/strings.norwegian.js +35 -2
  73. package/dist/collection/components/store/translationStore/strings.polish.js +35 -2
  74. package/dist/collection/components/store/translationStore/strings.portuguese.js +35 -2
  75. package/dist/collection/components/store/translationStore/strings.russian.js +35 -2
  76. package/dist/collection/components/store/translationStore/strings.spanish.js +35 -2
  77. package/dist/collection/components/store/translationStore/strings.swedish.js +35 -2
  78. package/dist/collection/components/store/translationStore/strings.turkish.js +35 -2
  79. package/dist/collection/components/store/translationStore/strings.vietnamese.js +35 -2
  80. package/dist/collection/components/store/zonosStore.js +2 -1
  81. package/dist/collection/components/stripe/zonos-address/zonos-address.css +5 -0
  82. package/dist/collection/components/stripe/zonos-address/zonos-address.js +37 -22
  83. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.css +5 -0
  84. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +34 -21
  85. package/dist/collection/components/utils/api/prepCalculateLandedCost.js +24 -35
  86. package/dist/collection/components/utils/checkout/getCheckoutTaxIdPayload.js +16 -0
  87. package/dist/collection/components/utils/checkout/getTaxIdFieldState.js +26 -0
  88. package/dist/collection/components/utils/checkout/isHostedVsNativeTestAllowed.js +13 -0
  89. package/dist/collection/components/utils/checkout/itemCustomization.js +53 -0
  90. package/dist/collection/components/utils/checkout/parseItemCustomizations.js +6 -0
  91. package/dist/collection/components/utils/checkout/resolveTaxIdSelection.js +23 -0
  92. package/dist/collection/components/utils/checkout/shouldRenderTaxIdInput.js +7 -11
  93. package/dist/collection/components/utils/checkout/taxIdFields.js +29 -0
  94. package/dist/collection/components/utils/taxId/taxIdRules.js +44 -0
  95. package/dist/collection/components/utils/taxIdValidationResult.js +57 -58
  96. package/dist/collection/index.js +1 -0
  97. package/dist/collection/types/checkout/TaxId.js +31 -0
  98. package/dist/collection/types/checkout/itemCustomization.js +1 -0
  99. package/dist/collection/types/index.js +1 -0
  100. package/dist/esm/{TaxId-Cye-evFK.js → TaxId-DMIgN_sT.js} +32 -1
  101. package/dist/esm/{cart-BoQp8Ema.js → cart-DmJkjiDE.js} +88 -53
  102. package/dist/esm/{collect-Eo4gtyql.js → collect-BV5GTPmh.js} +3 -3
  103. package/dist/esm/{debounce-BR3PaG8X.js → debounce-DHj2iHA1.js} +1 -1
  104. package/dist/esm/{debounce-CrmpwbEE.js → debounce-DWqMT4lo.js} +2 -2
  105. package/dist/esm/{getBorderRadius-DYfkeXdx.js → getBorderRadius-BiGd45jw.js} +1 -1
  106. package/dist/esm/{getMissingRequiredShippingFields-Ks6_tpjn.js → getMissingRequiredShippingFields-DljgpDZe.js} +1 -1
  107. package/dist/esm/{hasInclusivePrice-CbEfIhI5.js → hasInclusivePrice-DhGXpH2D.js} +1 -1
  108. package/dist/esm/index.js +9 -8
  109. package/dist/esm/{invoice-S1KahJ_Z.js → invoice-CO-iqlni.js} +3 -3
  110. package/dist/esm/loader.js +1 -1
  111. package/dist/esm/{localization-BIh-4pc_.js → localization-DHM91diu.js} +701 -41
  112. package/dist/esm/{paypal-DNfvnuUU.js → paypal-BfW5aLJw.js} +4 -4
  113. package/dist/esm/{placeTestOrder-CQaMKFOg.js → placeTestOrder-CyWUFhxD.js} +2 -2
  114. package/dist/esm/{renderCheckoutCurrency-C2Tw73uR.js → renderCheckoutCurrency-B31ZNkUv.js} +2 -2
  115. package/dist/esm/shouldRenderShortAddressCodeInput-Bc8k2vN0.js +19 -0
  116. package/dist/esm/{shouldShowLanguageSelect-CCD7gpSY.js → shouldShowLanguageSelect-DwSfSHar.js} +1 -1
  117. package/dist/esm/{submitGtag-df9AQ2zL.js → submitGtag-BEFrutel.js} +1 -1
  118. package/dist/esm/taxIdFields-ByEYfsO5.js +139 -0
  119. package/dist/esm/taxIdRules-xYlx7ZXW.js +47 -0
  120. package/dist/esm/{updateCheckoutSessionAttributes-4Jq6V4pO.js → updateCheckoutSessionAttributes-B0bQH0uw.js} +1 -1
  121. package/dist/esm/zonos-address-completion-dialog_7.entry.js +23 -28
  122. package/dist/esm/zonos-address-display_2.entry.js +3 -3
  123. package/dist/esm/zonos-address_4.entry.js +25 -28
  124. package/dist/esm/zonos-airwallex-payment.entry.js +7 -6
  125. package/dist/esm/zonos-badge.entry.js +1 -1
  126. package/dist/esm/zonos-banner.entry.js +1 -1
  127. package/dist/esm/zonos-button_3.entry.js +2 -2
  128. package/dist/esm/zonos-card_5.entry.js +8 -7
  129. package/dist/esm/zonos-cart-items_12.entry.js +147 -79
  130. package/dist/esm/zonos-checkbox_2.entry.js +2 -2
  131. package/dist/esm/zonos-checkout.entry.js +31 -20
  132. package/dist/esm/zonos-collapse.entry.js +1 -1
  133. package/dist/esm/zonos-collect-cart-items_3.entry.js +6 -5
  134. package/dist/esm/zonos-collect-finish_6.entry.js +12 -11
  135. package/dist/esm/zonos-collect.entry.js +9 -8
  136. package/dist/esm/zonos-controller.entry.js +7 -6
  137. package/dist/esm/zonos-country-flag.entry.js +2 -2
  138. package/dist/esm/zonos-country-select_4.entry.js +3 -3
  139. package/dist/esm/zonos-elements.js +1 -1
  140. package/dist/esm/zonos-hello-dialog.entry.js +4 -4
  141. package/dist/esm/zonos-hello.entry.js +4 -4
  142. package/dist/esm/zonos-input.entry.js +2 -2
  143. package/dist/esm/zonos-invoice-cart-items_2.entry.js +8 -7
  144. package/dist/esm/zonos-invoice-finish_5.entry.js +12 -11
  145. package/dist/esm/zonos-invoice.entry.js +9 -8
  146. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  147. package/dist/esm/zonos-logo.entry.js +1 -1
  148. package/dist/esm/zonos-policy-consent_2.entry.js +7 -6
  149. package/dist/esm/zonos-shipping-rich-radio.entry.js +2 -2
  150. package/dist/esm/zonos-stripe-input.entry.js +2 -2
  151. package/dist/esm/zonos-text.entry.js +1 -1
  152. package/dist/esm/zonos-v-stack.entry.js +1 -1
  153. package/dist/esm/{zonosStore-msUlqmSD.js → zonosStore-BXP9FvIt.js} +2 -1
  154. package/dist/esm-es5/{TaxId-Cye-evFK.js → TaxId-DMIgN_sT.js} +2 -1
  155. package/dist/esm-es5/{cart-BoQp8Ema.js → cart-DmJkjiDE.js} +64 -53
  156. package/dist/esm-es5/{collect-Eo4gtyql.js → collect-BV5GTPmh.js} +1 -1
  157. package/dist/esm-es5/{debounce-BR3PaG8X.js → debounce-DHj2iHA1.js} +7 -7
  158. package/dist/esm-es5/debounce-DWqMT4lo.js +1 -0
  159. package/dist/esm-es5/getBorderRadius-BiGd45jw.js +8 -0
  160. package/dist/esm-es5/{getMissingRequiredShippingFields-Ks6_tpjn.js → getMissingRequiredShippingFields-DljgpDZe.js} +3 -3
  161. package/dist/esm-es5/{hasInclusivePrice-CbEfIhI5.js → hasInclusivePrice-DhGXpH2D.js} +1 -1
  162. package/dist/esm-es5/index.js +11 -11
  163. package/dist/esm-es5/{invoice-S1KahJ_Z.js → invoice-CO-iqlni.js} +1 -1
  164. package/dist/esm-es5/loader.js +1 -1
  165. package/dist/esm-es5/localization-DHM91diu.js +348 -0
  166. package/dist/esm-es5/{paypal-DNfvnuUU.js → paypal-BfW5aLJw.js} +1 -1
  167. package/dist/esm-es5/{placeTestOrder-CQaMKFOg.js → placeTestOrder-CyWUFhxD.js} +1 -1
  168. package/dist/esm-es5/{renderCheckoutCurrency-C2Tw73uR.js → renderCheckoutCurrency-B31ZNkUv.js} +2 -2
  169. package/dist/esm-es5/shouldRenderShortAddressCodeInput-Bc8k2vN0.js +8 -0
  170. package/dist/esm-es5/{shouldShowLanguageSelect-CCD7gpSY.js → shouldShowLanguageSelect-DwSfSHar.js} +1 -1
  171. package/dist/esm-es5/{submitGtag-df9AQ2zL.js → submitGtag-BEFrutel.js} +1 -1
  172. package/dist/esm-es5/taxIdFields-ByEYfsO5.js +46 -0
  173. package/dist/esm-es5/taxIdRules-xYlx7ZXW.js +6 -0
  174. package/dist/esm-es5/{updateCheckoutSessionAttributes-4Jq6V4pO.js → updateCheckoutSessionAttributes-B0bQH0uw.js} +1 -1
  175. package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +253 -254
  176. package/dist/esm-es5/zonos-address-display_2.entry.js +1 -1
  177. package/dist/esm-es5/zonos-address_4.entry.js +8 -9
  178. package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
  179. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  180. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  181. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  182. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  183. package/dist/esm-es5/zonos-cart-items_12.entry.js +40 -26
  184. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
  185. package/dist/esm-es5/zonos-checkout.entry.js +7 -7
  186. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  187. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  188. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  189. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  190. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  191. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  192. package/dist/esm-es5/zonos-country-select_4.entry.js +2 -2
  193. package/dist/esm-es5/zonos-elements.js +1 -1
  194. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  195. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  196. package/dist/esm-es5/zonos-input.entry.js +1 -1
  197. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +2 -2
  198. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  199. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  200. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  201. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  202. package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
  203. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  204. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  205. package/dist/esm-es5/zonos-text.entry.js +1 -1
  206. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  207. package/dist/esm-es5/{zonosStore-msUlqmSD.js → zonosStore-BXP9FvIt.js} +1 -1
  208. package/dist/scripts/index.d.ts +97 -1
  209. package/dist/scripts/index.js +1 -1
  210. package/dist/scripts/loadZonos.js +1 -1
  211. package/dist/scripts/zonos.js +1 -1
  212. package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +4 -0
  213. package/dist/types/components/store/checkout/stripe.d.ts +9 -0
  214. package/dist/types/components/store/translationStore/strings.arabic.d.ts +34 -1
  215. package/dist/types/components/store/translationStore/strings.base.d.ts +34 -1
  216. package/dist/types/components/store/translationStore/strings.chinese.d.ts +34 -1
  217. package/dist/types/components/store/translationStore/strings.danish.d.ts +34 -1
  218. package/dist/types/components/store/translationStore/strings.dutch.d.ts +34 -1
  219. package/dist/types/components/store/translationStore/strings.french.d.ts +34 -1
  220. package/dist/types/components/store/translationStore/strings.german.d.ts +34 -1
  221. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +34 -1
  222. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +34 -1
  223. package/dist/types/components/store/translationStore/strings.italian.d.ts +34 -1
  224. package/dist/types/components/store/translationStore/strings.japanese.d.ts +34 -1
  225. package/dist/types/components/store/translationStore/strings.korean.d.ts +34 -1
  226. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +34 -1
  227. package/dist/types/components/store/translationStore/strings.polish.d.ts +34 -1
  228. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +34 -1
  229. package/dist/types/components/store/translationStore/strings.russian.d.ts +34 -1
  230. package/dist/types/components/store/translationStore/strings.spanish.d.ts +34 -1
  231. package/dist/types/components/store/translationStore/strings.swedish.d.ts +34 -1
  232. package/dist/types/components/store/translationStore/strings.turkish.d.ts +34 -1
  233. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +34 -1
  234. package/dist/types/components/store/zonosStore.d.ts +2 -1
  235. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +4 -1
  236. package/dist/types/components/stripe/zonos-custom-address/zonos-custom-address.d.ts +4 -1
  237. package/dist/types/components/utils/checkout/getCheckoutTaxIdPayload.d.ts +6 -0
  238. package/dist/types/components/utils/checkout/getTaxIdFieldState.d.ts +18 -0
  239. package/dist/types/components/utils/checkout/isHostedVsNativeTestAllowed.d.ts +11 -0
  240. package/dist/types/components/utils/checkout/itemCustomization.d.ts +23 -0
  241. package/dist/types/components/utils/checkout/parseItemCustomizations.d.ts +7 -0
  242. package/dist/types/components/utils/checkout/resolveTaxIdSelection.d.ts +12 -0
  243. package/dist/types/components/utils/checkout/shouldRenderTaxIdInput.d.ts +2 -1
  244. package/dist/types/components/utils/checkout/taxIdFields.d.ts +11 -0
  245. package/dist/types/components/utils/taxId/taxIdRules.d.ts +37 -0
  246. package/dist/types/components/utils/taxIdValidationResult.d.ts +8 -2
  247. package/dist/types/components.d.ts +22 -0
  248. package/dist/types/index.d.ts +1 -0
  249. package/dist/types/types/checkout/TaxId.d.ts +45 -0
  250. package/dist/types/types/checkout/api/CalculateLandedCost.d.ts +11 -0
  251. package/dist/types/types/checkout/api/CreateParty.d.ts +2 -0
  252. package/dist/types/types/checkout/itemCustomization.d.ts +4 -0
  253. package/dist/types/types/index.d.ts +1 -0
  254. package/dist/types/types/utils/ZonosSettings.d.ts +5 -0
  255. package/dist/zonos-elements/index.esm.js +1 -1
  256. package/dist/zonos-elements/{p-7bd99479.system.entry.js → p-064d8829.system.entry.js} +26 -26
  257. package/dist/zonos-elements/p-107f287b.entry.js +1 -0
  258. package/dist/zonos-elements/{p-51400242.system.entry.js → p-1199baef.system.entry.js} +3 -3
  259. package/dist/zonos-elements/p-12b24ebb.entry.js +1 -0
  260. package/dist/zonos-elements/{p-9c33f7ed.system.entry.js → p-189cc594.system.entry.js} +1 -1
  261. package/dist/zonos-elements/{p-d3d0656a.entry.js → p-1a5acbcd.entry.js} +1 -1
  262. package/dist/zonos-elements/{p-11defdca.system.entry.js → p-1cc42a98.system.entry.js} +18 -18
  263. package/dist/zonos-elements/p-1e6db427.entry.js +1 -0
  264. package/dist/zonos-elements/{p-5016d71b.system.entry.js → p-1fda4aec.system.entry.js} +132 -117
  265. package/dist/zonos-elements/{p-756d303f.system.entry.js → p-20eb00de.system.entry.js} +1 -1
  266. package/dist/zonos-elements/{p-5967a1c1.system.entry.js → p-216a908d.system.entry.js} +5 -5
  267. package/dist/zonos-elements/p-25eb99d4.entry.js +1 -0
  268. package/dist/zonos-elements/{p-23352709.system.entry.js → p-2b63865a.system.entry.js} +4 -4
  269. package/dist/zonos-elements/{p-6db7c0b1.system.entry.js → p-2ca826b9.system.entry.js} +2 -2
  270. package/dist/zonos-elements/{p-6c41b00c.entry.js → p-2d513aa3.entry.js} +1 -1
  271. package/dist/zonos-elements/{p-c961caaf.entry.js → p-3e705c9b.entry.js} +1 -1
  272. package/dist/zonos-elements/{p-acd50b0b.entry.js → p-4612facd.entry.js} +1 -1
  273. package/dist/zonos-elements/{p-5b80aff2.system.entry.js → p-46a839d2.system.entry.js} +24 -24
  274. package/dist/zonos-elements/p-46b9f0cf.entry.js +1 -0
  275. package/dist/zonos-elements/{p-244e0302.system.entry.js → p-4715045c.system.entry.js} +1 -1
  276. package/dist/zonos-elements/{p-d168023b.entry.js → p-4917b74d.entry.js} +1 -1
  277. package/dist/zonos-elements/{p-0b81f8b9.system.entry.js → p-53eac12f.system.entry.js} +14 -14
  278. package/dist/zonos-elements/{p-17c7ea4a.system.entry.js → p-55813e9f.system.entry.js} +3 -3
  279. package/dist/zonos-elements/{p-06030d3b.system.entry.js → p-5585db86.system.entry.js} +45 -45
  280. package/dist/zonos-elements/p-59fc32af.entry.js +1 -0
  281. package/dist/zonos-elements/{p-193d9722.entry.js → p-61312d5b.entry.js} +1 -1
  282. package/dist/zonos-elements/p-636b71d4.entry.js +1 -0
  283. package/dist/zonos-elements/{p-155ed3d3.system.entry.js → p-6410fa11.system.entry.js} +24 -24
  284. package/dist/zonos-elements/{p-0fca452b.entry.js → p-65817880.entry.js} +1 -1
  285. package/dist/zonos-elements/p-678b9214.entry.js +1 -0
  286. package/dist/zonos-elements/p-6e691736.entry.js +1 -0
  287. package/dist/zonos-elements/p-6vSUiBfr.system.js +348 -0
  288. package/dist/zonos-elements/p-74659d88.entry.js +1 -0
  289. package/dist/zonos-elements/p-7dc7f328.entry.js +1 -0
  290. package/dist/zonos-elements/{p-55916c90.entry.js → p-7f1bea9b.entry.js} +1 -1
  291. package/dist/zonos-elements/{p-1c150f26.entry.js → p-821e413a.entry.js} +1 -1
  292. package/dist/zonos-elements/{p-c403f004.system.entry.js → p-82e45d0c.system.entry.js} +1 -1
  293. package/dist/zonos-elements/p-84e76348.entry.js +1 -0
  294. package/dist/zonos-elements/{p-1409de3b.system.entry.js → p-88e20e99.system.entry.js} +1 -1
  295. package/dist/zonos-elements/{p-195f6e38.system.entry.js → p-89a3c4db.system.entry.js} +1 -1
  296. package/dist/zonos-elements/{p-4679f0ec.entry.js → p-8f9d8795.entry.js} +1 -1
  297. package/dist/zonos-elements/p-8fa6cfff.entry.js +1 -0
  298. package/dist/zonos-elements/{p-92fe9a1f.system.entry.js → p-902cca23.system.entry.js} +1 -1
  299. package/dist/zonos-elements/{p-0a4a7742.system.entry.js → p-93860183.system.entry.js} +1 -1
  300. package/dist/zonos-elements/{p-69c3e367.system.entry.js → p-941a95a1.system.entry.js} +10 -10
  301. package/dist/zonos-elements/{p-b5882fbb.system.entry.js → p-9449b4f4.system.entry.js} +1 -1
  302. package/dist/zonos-elements/{p-6abec43f.system.entry.js → p-960070d0.system.entry.js} +3 -3
  303. package/dist/zonos-elements/{p-1bac5ac1.system.entry.js → p-990fcf81.system.entry.js} +1 -1
  304. package/dist/zonos-elements/p-BD-9rD53.js +1 -0
  305. package/dist/zonos-elements/p-BMPYH-LT.js +1 -0
  306. package/dist/zonos-elements/{p-DI2vXnXc.system.js → p-BrQ8n8NS.system.js} +3 -3
  307. package/dist/zonos-elements/p-Bu9WCfUC.system.js +2 -2
  308. package/dist/zonos-elements/{p-CUaf1cEg.js → p-C70h5mKA.js} +1 -1
  309. package/dist/zonos-elements/{p-B4Ufchqh.system.js → p-C9XLkmmb.system.js} +3 -3
  310. package/dist/zonos-elements/{p-CZD8WvyY.system.js → p-CBUz18kA.system.js} +1 -1
  311. package/dist/zonos-elements/{p-kaOxUR9u.system.js → p-CGNVm52g.system.js} +6 -6
  312. package/dist/zonos-elements/p-CHKKvuiz.js +1 -0
  313. package/dist/zonos-elements/{p-0mGRBGcf.js → p-CMo3ZweU.js} +1 -1
  314. package/dist/zonos-elements/p-CTiqplrr.js +1 -0
  315. package/dist/zonos-elements/p-CYxMfUL7.system.js +1 -0
  316. package/dist/zonos-elements/{p-D4MevhAL.system.js → p-CbhN65lj.system.js} +3 -3
  317. package/dist/zonos-elements/p-Ch1w0Lr7.js +1 -0
  318. package/dist/zonos-elements/{p-W82paT5F.js → p-CqB9AfBf.js} +1 -1
  319. package/dist/zonos-elements/p-CzKlS3E-.system.js +6 -0
  320. package/dist/zonos-elements/p-D1SmY_fZ.js +1 -0
  321. package/dist/zonos-elements/{p-sz4L-ZnB.js → p-D1e9zNDA.js} +1 -1
  322. package/dist/zonos-elements/{p-c9QtIdJX.js → p-D6xXnsM_.js} +1 -1
  323. package/dist/zonos-elements/{p-8PPEbm_0.system.js → p-DIab60nK.system.js} +12 -12
  324. package/dist/zonos-elements/{p-Cye-evFK.js → p-DMIgN_sT.js} +1 -1
  325. package/dist/zonos-elements/{p-DCS8qcL6.system.js → p-DQrMfUzi.system.js} +41 -41
  326. package/dist/zonos-elements/{p-BuU_p5DP.system.js → p-DTgUqgwV.system.js} +2 -2
  327. package/dist/zonos-elements/p-DW7I0zOF.js +1 -0
  328. package/dist/zonos-elements/p-DZdkJHK9.system.js +7 -0
  329. package/dist/zonos-elements/{p-XqkqjeNV.system.js → p-DgUrB-1a.system.js} +1 -1
  330. package/dist/zonos-elements/p-DiMEP3mh.js +1 -0
  331. package/dist/zonos-elements/p-DprOoI2W.system.js +528 -0
  332. package/dist/zonos-elements/{p-7abqRc9V.js → p-DpwmHU8R.js} +2 -2
  333. package/dist/zonos-elements/p-DqVePqqx.system.js +8 -0
  334. package/dist/zonos-elements/{p-Cby4EkFu.system.js → p-DsBuZ6ob.system.js} +2 -1
  335. package/dist/zonos-elements/{p-XDxdMlQl.system.js → p-Dtu_Japy.system.js} +39 -39
  336. package/dist/zonos-elements/p-Dwg61Ft_.js +1 -0
  337. package/dist/zonos-elements/p-U33isUJG.js +1 -0
  338. package/dist/zonos-elements/{p-Be3Hpms1.system.js → p-XoQH3S7Z.system.js} +1 -1
  339. package/dist/zonos-elements/{p-474e8a92.system.entry.js → p-a1022808.system.entry.js} +1 -1
  340. package/dist/zonos-elements/{p-83aa1c8c.entry.js → p-ad04bba2.entry.js} +1 -1
  341. package/dist/zonos-elements/{p-a938c174.entry.js → p-b51010b9.entry.js} +1 -1
  342. package/dist/zonos-elements/{p-dfc87b10.system.entry.js → p-c33b8f6a.system.entry.js} +1 -1
  343. package/dist/zonos-elements/{p-a40fd99b.system.entry.js → p-cccaad60.system.entry.js} +39 -40
  344. package/dist/zonos-elements/p-d3345b2c.entry.js +1 -0
  345. package/dist/zonos-elements/{p-249c1ee1.system.entry.js → p-d8f375da.system.entry.js} +3 -3
  346. package/dist/zonos-elements/{p-2603dce0.entry.js → p-e216cc8c.entry.js} +1 -1
  347. package/dist/zonos-elements/{p-b79036fc.entry.js → p-e7fdb2c9.entry.js} +1 -1
  348. package/dist/zonos-elements/p-ebe157b5.entry.js +1 -0
  349. package/dist/zonos-elements/p-ef5344ea.entry.js +1 -0
  350. package/dist/zonos-elements/{p-be1237fc.system.entry.js → p-f3d9a380.system.entry.js} +97 -97
  351. package/dist/zonos-elements/{p-31043c2e.system.entry.js → p-f5f95990.system.entry.js} +296 -297
  352. package/dist/zonos-elements/p-fda89981.system.entry.js +13 -0
  353. package/dist/zonos-elements/{p-d4d2b39e.entry.js → p-fddf3556.entry.js} +1 -1
  354. package/dist/zonos-elements/p-iAIzUA4k.js +1 -0
  355. package/dist/zonos-elements/{p-BpDCLBwW.js → p-n5PZKz1k.js} +1 -1
  356. package/dist/zonos-elements/{p-DoEHepOc.system.js → p-ojtNq-r5.system.js} +1 -1
  357. package/dist/zonos-elements/{p-C_z9WL8a.js → p-r-YGHhLa.js} +1 -1
  358. package/dist/zonos-elements/{p-CBx5nYet.system.js → p-vTIygnHq.system.js} +1 -1
  359. package/dist/zonos-elements/{p-DQZncB2d.system.js → p-zsTASoh2.system.js} +3 -3
  360. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  361. package/item-customization.d.ts +25 -0
  362. package/item-customization.js +52 -0
  363. package/package.json +7 -4
  364. package/dist/cjs/shouldRenderTaxIdInput-TxekHCp7.js +0 -43
  365. package/dist/esm/shouldRenderTaxIdInput-CKyZ6Zni.js +0 -40
  366. package/dist/esm/throttle-Cvlvb-dm.js +0 -85
  367. package/dist/esm-es5/debounce-CrmpwbEE.js +0 -1
  368. package/dist/esm-es5/getBorderRadius-DYfkeXdx.js +0 -8
  369. package/dist/esm-es5/localization-BIh-4pc_.js +0 -348
  370. package/dist/esm-es5/shouldRenderTaxIdInput-CKyZ6Zni.js +0 -17
  371. package/dist/esm-es5/throttle-Cvlvb-dm.js +0 -46
  372. package/dist/zonos-elements/p-0457f579.entry.js +0 -1
  373. package/dist/zonos-elements/p-06fe2939.entry.js +0 -1
  374. package/dist/zonos-elements/p-24f3c547.entry.js +0 -1
  375. package/dist/zonos-elements/p-34656e6c.entry.js +0 -1
  376. package/dist/zonos-elements/p-39ee1558.entry.js +0 -1
  377. package/dist/zonos-elements/p-3a2da031.entry.js +0 -1
  378. package/dist/zonos-elements/p-4806b264.system.entry.js +0 -13
  379. package/dist/zonos-elements/p-725e29bb.entry.js +0 -1
  380. package/dist/zonos-elements/p-BGktDPwA.system.js +0 -1
  381. package/dist/zonos-elements/p-Bi-s0fp_.system.js +0 -17
  382. package/dist/zonos-elements/p-CEK_Wk6v.system.js +0 -7
  383. package/dist/zonos-elements/p-CFbfEmjN.js +0 -1
  384. package/dist/zonos-elements/p-CcJF6xhQ.js +0 -1
  385. package/dist/zonos-elements/p-Cxuiqv1I.js +0 -1
  386. package/dist/zonos-elements/p-D-bZg-Pc.js +0 -1
  387. package/dist/zonos-elements/p-DOD2I44l.system.js +0 -348
  388. package/dist/zonos-elements/p-DS-qw_qc.system.js +0 -517
  389. package/dist/zonos-elements/p-DZ2mevDK.js +0 -1
  390. package/dist/zonos-elements/p-DnjGkbEy.js +0 -1
  391. package/dist/zonos-elements/p-FRWZayxL.js +0 -1
  392. package/dist/zonos-elements/p-Mrz_lnC1.js +0 -1
  393. package/dist/zonos-elements/p-ad9ff14c.entry.js +0 -1
  394. package/dist/zonos-elements/p-bb3546c0.entry.js +0 -1
  395. package/dist/zonos-elements/p-c1cbfdba.entry.js +0 -1
  396. package/dist/zonos-elements/p-c47ce656.entry.js +0 -1
  397. package/dist/zonos-elements/p-c9d5d8f1.entry.js +0 -1
  398. package/dist/zonos-elements/p-clDfq9AL.js +0 -1
  399. package/dist/zonos-elements/p-d74bc3e8.entry.js +0 -1
  400. package/dist/zonos-elements/p-d8b312e5.entry.js +0 -1
  401. package/dist/zonos-elements/p-db87b0dd.entry.js +0 -1
  402. package/dist/zonos-elements/p-defc2d18.entry.js +0 -1
  403. package/dist/zonos-elements/p-rVp8hgWw.js +0 -1
@@ -18,6 +18,10 @@ export declare class ZonosAddress {
18
18
  * Default address for stripe
19
19
  */
20
20
  defaultAddress: ContactOption[];
21
+ /**
22
+ * Which tax id control the error belongs on. Empty when there is no error.
23
+ */
24
+ taxIdErrorField: 'type' | 'value' | '';
21
25
  /**
22
26
  * Error message for tax id input
23
27
  */
@@ -64,7 +68,6 @@ export declare class ZonosAddress {
64
68
  private updateAddressElement;
65
69
  watchInitStripe(): Promise<void>;
66
70
  defaultAddressChanged(newAddress: ContactOption[], oldAddress: ContactOption[]): void;
67
- private isInTaxIdCountry;
68
71
  /**
69
72
  * Render tax id input based on ship to country code
70
73
  */
@@ -18,6 +18,10 @@ export declare class ZonosAddress {
18
18
  * Default address for stripe
19
19
  */
20
20
  defaultAddress: ContactOption[];
21
+ /**
22
+ * Which tax id control the error belongs on. Empty when there is no error.
23
+ */
24
+ taxIdErrorField: 'type' | 'value' | '';
21
25
  /**
22
26
  * Error message for tax id input
23
27
  */
@@ -133,7 +137,6 @@ export declare class ZonosAddress {
133
137
  private getIsComplete;
134
138
  private throttledGetAddressSuggestions;
135
139
  private setCustomAddressFormToStripeAddressEventData;
136
- private isInTaxIdCountry;
137
140
  /**
138
141
  * Render tax id input based on ship to country code
139
142
  */
@@ -0,0 +1,6 @@
1
+ import type { CheckoutTaxIdTypeValue } from "../../../types/checkout/TaxId";
2
+ /** Tax id to send for the destination, or null while the field is hidden. */
3
+ export declare const getCheckoutTaxIdPayload: (countryCode: string) => {
4
+ taxId: string;
5
+ taxIdType?: CheckoutTaxIdTypeValue;
6
+ } | null;
@@ -0,0 +1,18 @@
1
+ import type { TaxIdErrorField } from "../../../types/checkout/TaxId";
2
+ export type { TaxIdErrorField };
3
+ export declare const getTaxIdFieldState: ({ companyName, countryCode, errorField, errorMessage, shouldRequirePeruTaxId, taxIdType, }: {
4
+ companyName: string;
5
+ countryCode: string;
6
+ errorField: TaxIdErrorField | "";
7
+ errorMessage: string;
8
+ shouldRequirePeruTaxId: boolean;
9
+ taxIdType: string;
10
+ }) => {
11
+ inputLabel: "CURP" | "DNI" | "RFC" | "CPF/CNPJ number" | "Carné de extranjería" | "EORI number" | "Personal Customers Clearance Code" | "RFC or CURP number" | "RUC" | "Unique Labor Identification Code" | undefined;
12
+ inputPlaceholder: "00-00000000-0" | "DE123456789" | "000.000.000-00" | "000-00-00000" | "XAXX010101000" | "AAAA800101HDFRRR09" | "12345678" | "20123456789" | "001234567" | undefined;
13
+ selectedValue: string;
14
+ showValueInput: boolean;
15
+ typeError: string;
16
+ typeOptions: readonly import("src/types/checkout/TaxId").TaxIdTypeOption[] | null;
17
+ valueError: string;
18
+ } | null;
@@ -0,0 +1,11 @@
1
+ type Params = {
2
+ createCartId: unknown;
3
+ enabledTestKeys: readonly string[];
4
+ isBigCommerce: boolean;
5
+ };
6
+ /**
7
+ * BigCommerce checkout depends on storefront callbacks (clear cart, inventory).
8
+ * The hosted variant leaves the storefront, so the test does not apply there.
9
+ */
10
+ export declare const isHostedVsNativeTestAllowed: ({ createCartId, enabledTestKeys, isBigCommerce, }: Params) => boolean;
11
+ export {};
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Import-free so `scripts/buildItemCustomization.mjs` can emit one module.
3
+ * demo-app imports the generated `item-customization.js`, not this file.
4
+ */
5
+ export declare const ITEM_CUSTOMIZATION_ATTRIBUTE_KEY = "itemCustomization";
6
+ export type LooseKeyValue = {
7
+ key?: string | null;
8
+ value?: string | null;
9
+ } | null;
10
+ /** Drops an empty name, a non-string value, and the unselected value "0". */
11
+ export declare const readDisplayableItemCustomization: (value: unknown) => {
12
+ name: string;
13
+ value: string;
14
+ } | null;
15
+ export type ItemCustomizationEntry = {
16
+ choice: {
17
+ name: string;
18
+ value: string;
19
+ };
20
+ raw: Record<string, unknown>;
21
+ };
22
+ /** Selected customization entries, with the original object for extra ids. */
23
+ export declare const readItemCustomizationEntries: (attributes?: LooseKeyValue[] | null) => ItemCustomizationEntry[];
@@ -0,0 +1,7 @@
1
+ import { type LooseKeyValue } from "./itemCustomization";
2
+ import type { ItemCustomizationChoice } from "../../../types/checkout/itemCustomization";
3
+ /**
4
+ * Reads a cart row's `itemCustomization` attribute into display pairs.
5
+ * Unreadable data is an empty list.
6
+ */
7
+ export declare const parseItemCustomizations: (attributes?: LooseKeyValue[] | null) => ItemCustomizationChoice[];
@@ -0,0 +1,12 @@
1
+ /** Whether the field is showing, and which of this country's types is selected. */
2
+ export declare const resolveTaxIdSelection: ({ companyName, countryCode, shouldRequirePeruTaxId, taxIdType, }: {
3
+ companyName: string;
4
+ countryCode: string;
5
+ shouldRequirePeruTaxId: boolean;
6
+ taxIdType: string;
7
+ }) => {
8
+ rendered: boolean;
9
+ selectedType: import("../../..").TaxIdTypeOption | null;
10
+ send: boolean;
11
+ typeOptions: readonly import("../../..").TaxIdTypeOption[] | null;
12
+ };
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Checks if the tax ID input should be rendered based on the company name and country code.
3
3
  */
4
- export declare const shouldRenderTaxIdInput: ({ companyName, countryCode, }: {
4
+ export declare const shouldRenderTaxIdInput: ({ companyName, countryCode, shouldRequirePeruTaxId, }: {
5
5
  companyName: string;
6
6
  countryCode: string;
7
+ shouldRequirePeruTaxId: boolean;
7
8
  }) => boolean;
@@ -0,0 +1,11 @@
1
+ import type { TaxIdErrorField } from "../../../types/checkout/TaxId";
2
+ export declare const renderTaxIdFields: ({ companyName, countryCode, errorField, errorMessage, onTaxIdChange, shouldRequirePeruTaxId, taxId, taxIdType, }: {
3
+ companyName: string;
4
+ countryCode: string;
5
+ errorField: TaxIdErrorField | "";
6
+ errorMessage: string;
7
+ onTaxIdChange?: (value: string) => void;
8
+ shouldRequirePeruTaxId: boolean;
9
+ taxId: string;
10
+ taxIdType: string;
11
+ }) => any;
@@ -0,0 +1,37 @@
1
+ import { type CheckoutTaxIdTypeValue, type MexicoTaxIdType, type PeruTaxIdType, type TaxIdTypeOption } from "../../../types/checkout/TaxId";
2
+ export declare const stripTaxIdSeparators: (taxId: string) => string;
3
+ export declare const rfcRegex: RegExp;
4
+ export declare const curpRegex: RegExp;
5
+ export declare const isMexicoTaxIdType: (taxIdType: string) => taxIdType is MexicoTaxIdType;
6
+ export declare const isPeruTaxIdType: (taxIdType: string) => taxIdType is PeruTaxIdType;
7
+ export declare const isCheckoutTaxIdTypeValue: (taxIdType: string) => taxIdType is CheckoutTaxIdTypeValue;
8
+ /** 8 digits are a DNI, 9 a carné, 11 an RUC. Anything else is not a Peru tax id. */
9
+ export declare const peruTaxIdTypeFromValue: (taxId: string) => PeruTaxIdType | null;
10
+ export declare const isPeruTaxIdActive: ({ countryCode, shouldRequirePeruTaxId, }: {
11
+ countryCode: string;
12
+ shouldRequirePeruTaxId: boolean;
13
+ }) => boolean;
14
+ /**
15
+ * Peru stays off `countryRequireTaxId`. The API flag decides which stores see it.
16
+ * Mexico and Peru pick the kind from a dropdown instead of a regex.
17
+ */
18
+ export declare const taxIdTypeOptionsForCheckout: ({ countryCode, shouldRequirePeruTaxId, }: {
19
+ countryCode: string;
20
+ shouldRequirePeruTaxId: boolean;
21
+ }) => readonly TaxIdTypeOption[] | null;
22
+ export declare const taxIdLabelForCheckout: (countryCode: string) => {
23
+ readonly friendlyName: "Unique Labor Identification Code";
24
+ readonly placeholder: "00-00000000-0";
25
+ } | {
26
+ readonly friendlyName: "EORI number";
27
+ readonly placeholder: "DE123456789";
28
+ } | {
29
+ readonly friendlyName: "CPF/CNPJ number";
30
+ readonly placeholder: "000.000.000-00";
31
+ } | {
32
+ readonly friendlyName: "Personal Customers Clearance Code";
33
+ readonly placeholder: "000-00-00000";
34
+ } | {
35
+ readonly friendlyName: "RFC or CURP number";
36
+ readonly placeholder: "XAXX010101000";
37
+ } | null;
@@ -1,13 +1,19 @@
1
+ import { type PeruTaxIdType, type TaxIdErrorField, peruTaxIdFormatError } from "../../types/checkout/TaxId";
2
+ type TaxIdValidationError = 'Tax id is required' | 'Tax id type is required' | 'Invalid CURP format. Must be 18 uppercase letters and numbers.' | 'Invalid RFC format. Must be 12–13 uppercase letters and numbers.' | 'Invalid CUIT/CUIL format. Must contain 11 digits, with or without dashes (XX-XXXXXXXX-X).' | (typeof peruTaxIdFormatError)[PeruTaxIdType];
1
3
  type TaxIdValidationResult = {
2
- error: 'Tax id is required' | 'Invalid RFC or CURP format. Must be a 12–13 character RFC or an 18 character CURP, uppercase letters and numbers only.' | 'Invalid CUIT/CUIL format. Must contain 11 digits, with or without dashes (XX-XXXXXXXX-X).';
4
+ error: TaxIdValidationError;
5
+ field: TaxIdErrorField;
3
6
  valid: false;
4
7
  } | {
5
8
  error: null;
9
+ field: null;
6
10
  valid: true;
7
11
  };
8
- export declare const taxIdValidationResult: ({ companyName, shippingCountry, taxId, }: {
12
+ export declare const taxIdValidationResult: ({ companyName, shippingCountry, shouldRequirePeruTaxId, taxId, taxIdType, }: {
9
13
  companyName: string;
10
14
  shippingCountry: string;
15
+ shouldRequirePeruTaxId: boolean;
11
16
  taxId: string;
17
+ taxIdType: string;
12
18
  }) => TaxIdValidationResult;
13
19
  export {};
@@ -73,6 +73,11 @@ export namespace Components {
73
73
  * @default ''
74
74
  */
75
75
  "shortAddressCodeErrorMessage": string;
76
+ /**
77
+ * Which tax id control the error belongs on. Empty when there is no error.
78
+ * @default ''
79
+ */
80
+ "taxIdErrorField": 'type' | 'value' | '';
76
81
  /**
77
82
  * Error message for tax id input
78
83
  * @default ''
@@ -839,6 +844,11 @@ export namespace Components {
839
844
  * @default ''
840
845
  */
841
846
  "shortAddressCodeErrorMessage": string;
847
+ /**
848
+ * Which tax id control the error belongs on. Empty when there is no error.
849
+ * @default ''
850
+ */
851
+ "taxIdErrorField": 'type' | 'value' | '';
842
852
  /**
843
853
  * Error message for tax id input
844
854
  * @default ''
@@ -2792,6 +2802,11 @@ declare namespace LocalJSX {
2792
2802
  * @default ''
2793
2803
  */
2794
2804
  "shortAddressCodeErrorMessage"?: string;
2805
+ /**
2806
+ * Which tax id control the error belongs on. Empty when there is no error.
2807
+ * @default ''
2808
+ */
2809
+ "taxIdErrorField"?: 'type' | 'value' | '';
2795
2810
  /**
2796
2811
  * Error message for tax id input
2797
2812
  * @default ''
@@ -3593,6 +3608,11 @@ declare namespace LocalJSX {
3593
3608
  * @default ''
3594
3609
  */
3595
3610
  "shortAddressCodeErrorMessage"?: string;
3611
+ /**
3612
+ * Which tax id control the error belongs on. Empty when there is no error.
3613
+ * @default ''
3614
+ */
3615
+ "taxIdErrorField"?: 'type' | 'value' | '';
3596
3616
  /**
3597
3617
  * Error message for tax id input
3598
3618
  * @default ''
@@ -4534,6 +4554,7 @@ declare namespace LocalJSX {
4534
4554
  interface ZonosAddressAttributes {
4535
4555
  "type": 'billing' | 'shipping';
4536
4556
  "titleText": string;
4557
+ "taxIdErrorField": 'type' | 'value' | '';
4537
4558
  "taxIdErrorMessage": string;
4538
4559
  "shortAddressCodeErrorMessage": string;
4539
4560
  }
@@ -4707,6 +4728,7 @@ declare namespace LocalJSX {
4707
4728
  interface ZonosCustomAddressAttributes {
4708
4729
  "type": 'billing' | 'shipping';
4709
4730
  "titleText": string;
4731
+ "taxIdErrorField": 'type' | 'value' | '';
4710
4732
  "taxIdErrorMessage": string;
4711
4733
  "shortAddressCodeErrorMessage": string;
4712
4734
  }
@@ -1,2 +1,3 @@
1
+ export { curpRegex, isMexicoTaxIdType, isPeruTaxIdType, peruTaxIdTypeFromValue, stripTaxIdSeparators, } from './components/utils/taxId/taxIdRules';
1
2
  export { Zonos } from './scripts';
2
3
  export * from './types';
@@ -140,3 +140,48 @@ export declare const shipToTaxIdLabels: {
140
140
  readonly placeholder: "DE123456789";
141
141
  };
142
142
  };
143
+ export declare const isCountryRequireTaxId: (countryCode: string) => countryCode is CountryRequireTaxId;
144
+ export type TaxIdErrorField = 'type' | 'value';
145
+ export declare const taxIdTypeOptions: {
146
+ readonly MX: readonly [{
147
+ readonly label: "RFC";
148
+ readonly placeholder: "XAXX010101000";
149
+ readonly value: "RFC";
150
+ }, {
151
+ readonly label: "CURP";
152
+ readonly placeholder: "AAAA800101HDFRRR09";
153
+ readonly value: "CURP";
154
+ }];
155
+ readonly PE: readonly [{
156
+ readonly label: "DNI";
157
+ readonly placeholder: "12345678";
158
+ readonly value: "DNI";
159
+ }, {
160
+ readonly label: "RUC";
161
+ readonly placeholder: "20123456789";
162
+ readonly value: "RUC";
163
+ }, {
164
+ readonly label: "Carné de extranjería";
165
+ readonly placeholder: "001234567";
166
+ readonly value: "CE";
167
+ }];
168
+ };
169
+ export type TaxIdTypeOption = (typeof taxIdTypeOptions.MX)[number] | (typeof taxIdTypeOptions.PE)[number];
170
+ export type MexicoTaxIdType = (typeof taxIdTypeOptions.MX)[number]['value'];
171
+ export type PeruTaxIdType = (typeof taxIdTypeOptions.PE)[number]['value'];
172
+ declare const checkoutTaxIdTypeValueList: readonly ["CE", "CURP", "DNI", "RFC", "RUC"];
173
+ type AssertEveryCheckoutTaxIdType<T extends readonly TaxIdTypeOption['value'][]> = Exclude<TaxIdTypeOption['value'], T[number]> extends never ? T : never;
174
+ /** Every document kind checkout can send. Older clients omit the field. */
175
+ export declare const checkoutTaxIdTypeValues: AssertEveryCheckoutTaxIdType<typeof checkoutTaxIdTypeValueList>;
176
+ export type CheckoutTaxIdTypeValue = (typeof checkoutTaxIdTypeValues)[number];
177
+ export declare const peruTaxIdDigitLength: {
178
+ readonly CE: 9;
179
+ readonly DNI: 8;
180
+ readonly RUC: 11;
181
+ };
182
+ export declare const peruTaxIdFormatError: {
183
+ readonly CE: "Carné de extranjería must be 9 digits.";
184
+ readonly DNI: "DNI must be 8 digits.";
185
+ readonly RUC: "RUC must be 11 digits.";
186
+ };
187
+ export {};
@@ -1,4 +1,5 @@
1
1
  import type { CartItem } from "../../../components/store/checkout/cart";
2
+ import type { CheckoutTaxIdTypeValue } from "../TaxId";
2
3
  import type { CalculateLandedCostMutation, CartCalculateLandedCostMutation, CountryCode, CurrencyCode, LandedCostAdjustmentType } from "../../generated/graphql.internal.types";
3
4
  export type CalculateLandedCostAdjustmentInput = {
4
5
  amount: number;
@@ -67,6 +68,11 @@ export type CalculateLandedCostRequest = {
67
68
  * TaxId that the some destination countries require for the shipment.
68
69
  */
69
70
  shipToTaxId?: string;
71
+ /**
72
+ * Document kind selected in checkout. Mexico uses RFC or CURP.
73
+ * Peru uses DNI, RUC, or CE.
74
+ */
75
+ shipToTaxIdType?: CheckoutTaxIdTypeValue;
70
76
  shippingAddress: {
71
77
  addressLine1: string;
72
78
  addressLine2?: string | undefined;
@@ -124,6 +130,11 @@ export type CartCalculateLandedCostRequest = {
124
130
  * TaxId that the some destination countries require for the shipment.
125
131
  */
126
132
  shipToTaxId?: string;
133
+ /**
134
+ * Document kind selected in checkout. Mexico uses RFC or CURP.
135
+ * Peru uses DNI, RUC, or CE.
136
+ */
137
+ shipToTaxIdType?: CheckoutTaxIdTypeValue;
127
138
  shippingAddress: {
128
139
  addressLine1: string;
129
140
  addressLine2?: string | undefined;
@@ -1,3 +1,4 @@
1
+ import type { CheckoutTaxIdTypeValue } from "../TaxId";
1
2
  import type { CountryCode } from "../../generated/graphql.internal.types";
2
3
  export type CreatePartyRequest = {
3
4
  address: {
@@ -28,6 +29,7 @@ export type CreatePartyRequest = {
28
29
  rootId: string;
29
30
  shortAddressCode?: string;
30
31
  taxId?: string;
32
+ taxIdType?: CheckoutTaxIdTypeValue;
31
33
  };
32
34
  export type CreatePartyResponse = {
33
35
  billToPartyId: string;
@@ -0,0 +1,4 @@
1
+ export type ItemCustomizationChoice = {
2
+ name: string;
3
+ value: string;
4
+ };
@@ -15,6 +15,7 @@ export * from './checkout/api/StoreDiscountEnabled';
15
15
  export * from './checkout/api/ValidateAddress';
16
16
  export * from './checkout/api/VarianceTest';
17
17
  export * from './checkout/CheckoutConfig';
18
+ export * from './checkout/itemCustomization';
18
19
  export * from './checkout/ShortAddressCode';
19
20
  export * from './checkout/TaxId';
20
21
  export * from './ConversionEvent';
@@ -61,6 +61,11 @@ export type GenericZonosSettings = {
61
61
  * Whether or not Canadian shopper has to consent that they are aware of some procedures must happen after checking out otherwise the order will be returned
62
62
  */
63
63
  shouldFedExShippingConsentForCanadianShopper?: boolean;
64
+ /**
65
+ * When true, checkout requires a Peru tax id and lets the shopper pick the document type.
66
+ * The API sets this from an organization list so stores can be added without a client release.
67
+ */
68
+ shouldRequirePeruTaxId?: boolean;
64
69
  /**
65
70
  * Signed token for Google Places API iframe access.
66
71
  */
@@ -1 +1 @@
1
- import{c as n}from"./p-XQfWgQLB.js";import{g as o,I as t}from"./p-HeAZDwVW.js";import{l as r}from"./p-BJmZPrZl.js";export{a as availableTestKeys}from"./p-BJmZPrZl.js";import{g as i,a as l,h as u,l as m}from"./p-DE4a-QD5.js";import{g as p,_ as w,c as f,a as y}from"./p-D5SpFsQJ.js";export{d as domesticRedirectedBtnSelector}from"./p-D5SpFsQJ.js";export{c as countryRequireShortAddressCode}from"./p-nJ6oI8-n.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./p-Cye-evFK.js";const v=["jsdelivr","cdnjs","unpkg","vercel"],h="jsdelivr",O=e=>{const n=v.indexOf(e);return v[n+1]||null},g=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)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),o="https://v1.4.2.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;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;if("dev-elements"===n)return"https://dev.elements.zonos.com";if("worker"===n)return null;const t=`https://${n}.preview.js.zonos.com`;return r(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' 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,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),t},S="https://js.stripe.com/v3",j=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;let z=null;const b=e=>(null!==z||(z=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe)n(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${S}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&j.test(o.src))return o}return null})();t&&e?console.warn("loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used"):t||(t=(()=>{const e=document.createElement("script");e.src=`${S}`;const n=document.head||document.body;return n?(n.appendChild(e),e):(m("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==t||t.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):o(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else n(null)}))),z),N=Promise.resolve().then((()=>(()=>{var e,n;return"undefined"!=typeof window&&("function"==typeof(null===(e=window.Zonos)||void 0===e?void 0:e.createCartId)||"function"==typeof(null===(n=window.Zonos)||void 0===n?void 0:n.buildCartDetail))})()?b(null):null));let I=!1;N.catch((e=>{I||console.warn(e)}));const k=async({cartId:e,retries:n})=>{const t=i(),s=o(),c=p()||void 0,d=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&d.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:l,json:a,zonosMode:m}=await u(`/api/zonos-elements/get-cart?${d.toString()}`,{body:{isTestMode:t,renewCartExpirationToken:c,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),w=!a||l.length;return w&&n?(r("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:n}),await new Promise((e=>setTimeout(e,500))),k({cartId:e,retries:n-1})):w?null:Object.assign(Object.assign({},a),{zonosMode:m})};var Z;const R=(()=>{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","dev.assets-checkout.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})(),T=Date.now(),$="https://v1.4.2.js.zonos.com",A=R||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.4.2",L="https://fonts.googleapis.com",C=/^https:\/\/fonts\.googleapis\.com/;class U{}Z=U,U.doneInit=!1,U.cartSettings=null,U.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),U.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),U._paypalMockResponse=null,U.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,U.isBigCommerce=!1,U.releaseDate="1792599810755",U.isLegacyCheckout=!1,U.googleAnalyticId=null,U.googleAnalyticReady=!1,U.facebookPixelId=null,U.facebookPixelReady=!1,U.startLoadTime=T,U.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",U.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),U.overrideUseCustomAddressForm=!1,U.isCollect=!1,U.isInvoice=!1,U.isNpm=!0,U.zonosQaUrl=null,U.zonosQaUrlApi=null,U.trackEventLogs=[],U.version="v1.4.2",U.modeAlerted=!1,U.cartData=null,U.paypal=null,U.zonosMode=null,U.IframeService=t,U.getCurrentTimestamp=()=>(new Date).getTime(),U.zonosController=null,U.loadTimeApiInfoList=[],U.logIntervalId=null,U.init=async e=>{const{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d,storeId:a,zonosApiKey:p}=e;if(Z.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),Z.createCartId=null==o?void 0:o.createCartId,Z.buildCartDetail=null==o?void 0:o.buildCartDetail,Z.doneInit)return;if(r(`====== ZONOS DEBUG MODE: on (${Z.version}) ======`),Z.zonosApiKey=p,Z.storeId=a,"undefined"!=typeof window&&window.parent===window&&(Z.googleAnalyticReady=!0,Z.facebookPixelReady=!0),Z.isNpm){r("====== ZONOS LOADING FROM NPM ======");const n=g();if(n&&!window.isZonosPreview){r(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${n} ======`,"info");const o=document.createElement("script");return o.src=`${n}/dist/scripts/zonos.js`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=Z.isNpm,window.Zonos.isBigCommerce=Z.isBigCommerce,window.Zonos.isLegacyCheckout=Z.isLegacyCheckout,window.Zonos.zonosMode=Z.zonosMode,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${n}`)})),void(window.isZonosPreview=!0)}if(!p&&!Z.cartId)return void m("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!Z.cartData&&Z.cartId){r("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=w(e);if(!o&&!n)return m("[ZONOS - loadZonos] invalid cart id"),null;const t=await k({cartId:e,retries:5});return r("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(m("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(Z.cartId);if(!e)return void m("Failed to get cart data");Z.cartData=e.cartData,Z.zonosApiKey=e.zonosApiKey,Z.cartSettings=e.settings}const o=await(async()=>{const e=i(),n=l();if(!e&&!n||!window.Zonos.zonosApiKey)return null;if(r("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return r("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:o,json:t}=await u("/api/get-test-public-credential");if(o.length||!t)return m("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o),null;const s=t.publicCredential;return s?(r(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(m("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();o&&(Z.zonosApiKey=o)}const y=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(Z.cartId&&Z.cartData||y){r("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${f}`,document.body.appendChild(e)}r("init zonos"),Z.restoreNativeBrowserFunctions(),Z.injectCustomScriptForHostedCheckout(),Z.injectZonosCdn(),Z.injectZonosCss(),Z.injectFonts(),Z.injectCheckoutInternationalButton(),Z.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d}}),Z.doneInit=!0},U.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${y}`)){const e=document.createElement("button");e.id=y,e.style.display="none",document.body.appendChild(e)}},U.injectCustomScriptForHostedCheckout=()=>{const e=Z.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),t=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||t)){if(o){r("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(t){r("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else r("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},U.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},U.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${y}`);setTimeout((()=>{e&&e.dispatchEvent(n("click"))}),10)},U.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},U.showNotification=e=>{var n;null===(n=Z.zonosController)||void 0===n||n.showNotification(e)},U.updateOrganizationName=e=>{var n;null===(n=Z.zonosController)||void 0===n||n.updateOrganizationName(e)},U.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},U.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let o=document.querySelector(`iframe#${n}`);o||(o=document.createElement("iframe"),o.id=n,o.style.display="none",o.style.opacity="0",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.width="1px",o.style.height="1px",o.style.border="none",o.style.overflow="hidden",o.style.visibility="hidden",document.body.appendChild(o));const t=(null===(e=o.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(o)},U.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;Z.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{Z.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;Z.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{Z.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=Z.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;r("loading Stripe");const o=await(async(...e)=>{var n;I=!0;const o=Date.now();return((e,n,o)=>{if(null===e)return null;const[t,s]=n,r=Object.assign({},s),i=(e=>{if(!("version"in e))return;const{version:n}=e;return"number"==typeof n||"string"==typeof n?n:void 0})(e);"string"==typeof i&&i!==3..toString()?delete r.apiVersion:r.apiVersion="2025-02-24.acacia";const c=e(t,r);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(c,o),c})(null!==(n=await N)&&void 0!==n?n:await b(null),e,o)})(n.publishableKey);o?(window.Zonos.stripe=o,window.Zonos.isCollect?t.initCollectElement(o):window.Zonos.isInvoice?t.initInvoiceElement(o):t.initCheckoutElement(o)):m("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),Z.zonosController=t,r("Zonos controller injected!")},U.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const t=`${Z.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${t}"]`))return void r(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,i=document.createElement("script");n?i.type="module":i.noModule=!0,i.src=t,i.crossOrigin="anonymous",i.onerror=()=>{m(`Failed to load ${i.src}`);const t=O(e);t&&Z.injectScript({cdnType:t,isModule:n,theRestUrl:o})},s.appendChild(i)},U.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return A;case"unpkg":return"https://unpkg.com/@zonos/elements@1.4.2";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.4.2";case"vercel":return $}};return Z.isNpm&&g()||n()},U.injectZonosCdn=()=>{Z.injectScript({cdnType:h,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),Z.injectScript({cdnType:h,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),r("Zonos cdn script injected!")},U.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const o=Z.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${$}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${o}/${n}`,r.onerror=()=>{m(`Failed to load ${r.href}`);const o=O(e);o&&Z.injectStylesheet({cdnType:o,theRestUrl:n})},t.appendChild(r)},U.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?r("Zonos style links already injected","warn"):(Z.injectStylesheet({cdnType:h,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),r("Zonos style css injected!"))},U.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void r("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${L}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!C.test(o.href))return o}return null})())return void r("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=L,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${L}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),r("Zonos font injected!")},U.setupGoogleFont=e=>{var n;null===(n=Z.zonosController)||void 0===n||n.setupGoogleFont(e)},U.injectSupportGoogleFont=e=>{var n;r(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${L}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=L,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void r(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),r(`[FONT] ${o} font injected!`)};const E=["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"],D=["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"],P=[...E,...D];export{U as Zonos,f as checkoutHiddenBtnSelector,y as checkoutHiddenInternationalBtnSelector,P as checkoutSessionAttributeKeys,D as checkoutSessionImmutableAttributeKeys,E as checkoutSessionMutableAttributeKeys}
1
+ export{c as curpRegex,i as isMexicoTaxIdType,a as isPeruTaxIdType,p as peruTaxIdTypeFromValue,s as stripTaxIdSeparators}from"./p-Dwg61Ft_.js";import{c as o}from"./p-XQfWgQLB.js";import{g as n,I as r}from"./p-HeAZDwVW.js";import{l}from"./p-BJmZPrZl.js";export{a as availableTestKeys}from"./p-BJmZPrZl.js";import{g as u,a as m,h as w,l as f}from"./p-DE4a-QD5.js";import{g as y,_ as v,c as h,a as g}from"./p-D5SpFsQJ.js";export{d as domesticRedirectedBtnSelector}from"./p-D5SpFsQJ.js";export{c as countryRequireShortAddressCode}from"./p-nJ6oI8-n.js";export{a as checkoutTaxIdTypeValues,c as countryRequireTaxId,e as euCountryCodes,i as isCountryRequireTaxId,p as peruTaxIdDigitLength,b as peruTaxIdFormatError,s as shipToTaxIdLabels,t as taxIdTypeOptions}from"./p-DMIgN_sT.js";const O=["jsdelivr","cdnjs","unpkg","vercel"],S="jsdelivr",j=e=>{const o=O.indexOf(e);return O[o+1]||null},z=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=(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),n="https://v1.5.1.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["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(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";if("worker"===o)return null;const t=`https://${o}.preview.js.zonos.com`;return l(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,n=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",n),window.location.reload(),null})),t},I="https://js.stripe.com/v3",T=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;let N=null;const k=e=>(null!==N||(N=new Promise(((o,n)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe)o(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${I}"]`);for(let o=0;o<e.length;o++){const n=e[o];if(n&&T.test(n.src))return n}return null})();t&&e?console.warn("loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used"):t||(t=(()=>{const e=document.createElement("script");e.src=`${I}`;const o=document.head||document.body;return o?(o.appendChild(e),e):(f("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==t||t.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):n(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{n(new Error("Failed to load Stripe.js"))}))}catch(e){return void n(e)}else o(null)}))),N),Z=Promise.resolve().then((()=>(()=>{var e,o;return"undefined"!=typeof window&&("function"==typeof(null===(e=window.Zonos)||void 0===e?void 0:e.createCartId)||"function"==typeof(null===(o=window.Zonos)||void 0===o?void 0:o.buildCartDetail))})()?k(null):null));let R=!1;Z.catch((e=>{R||console.warn(e)}));const L=async({cartId:e,retries:o})=>{const t=u(),s=n(),r=y()||void 0,i=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&i.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:c,json:d,zonosMode:a}=await w(`/api/zonos-elements/get-cart?${i.toString()}`,{body:{isTestMode:t,renewCartExpirationToken:r,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),p=!d||c.length;return p&&o?(l("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),L({cartId:e,retries:o-1})):p?null:Object.assign(Object.assign({},d),{zonosMode:a})};var $;const A=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:o,isWhiteListed:n}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,n=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),t=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:t,isWhiteListed:n}})({loadScriptSrc:null==e?void 0:e.src});return n?o:null})(),C=Date.now(),E="https://v1.5.1.js.zonos.com",U=A||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.5.1",x="https://fonts.googleapis.com",D=/^https:\/\/fonts\.googleapis\.com/;class P{}$=P,P.doneInit=!1,P.cartSettings=null,P.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),P.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),P._paypalMockResponse=null,P.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,P.isBigCommerce=!1,P.releaseDate="1793041426949",P.isLegacyCheckout=!1,P.googleAnalyticId=null,P.googleAnalyticReady=!1,P.facebookPixelId=null,P.facebookPixelReady=!1,P.startLoadTime=C,P.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",P.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),P.overrideUseCustomAddressForm=!1,P.isCollect=!1,P.isInvoice=!1,P.isNpm=!0,P.zonosQaUrl=null,P.zonosQaUrlApi=null,P.trackEventLogs=[],P.version="v1.5.1",P.modeAlerted=!1,P.cartData=null,P.paypal=null,P.zonosMode=null,P.IframeService=r,P.getCurrentTimestamp=()=>(new Date).getTime(),P.zonosController=null,P.loadTimeApiInfoList=[],P.logIntervalId=null,P.init=async e=>{const{appearance:o,checkoutSettings:n,currencyConverter:t,helloSettings:s,onCountryChange:r,overrideCurrencyFormat:i,storeId:c,zonosApiKey:d}=e;if($.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),$.createCartId=null==n?void 0:n.createCartId,$.buildCartDetail=null==n?void 0:n.buildCartDetail,$.doneInit)return;if(l(`====== ZONOS DEBUG MODE: on (${$.version}) ======`),$.zonosApiKey=d,$.storeId=c,"undefined"!=typeof window&&window.parent===window&&($.googleAnalyticReady=!0,$.facebookPixelReady=!0),$.isNpm){l("====== ZONOS LOADING FROM NPM ======");const o=z();if(o&&!window.isZonosPreview){l(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${o} ======`,"info");const n=document.createElement("script");return n.src=`${o}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=$.isNpm,window.Zonos.isBigCommerce=$.isBigCommerce,window.Zonos.isLegacyCheckout=$.isLegacyCheckout,window.Zonos.zonosMode=$.zonosMode,window.Zonos.init(e)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${o}`)})),void(window.isZonosPreview=!0)}if(!d&&!$.cartId)return void f("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!$.cartData&&$.cartId){l("Initialize cart data");const e=await(async e=>{const{isDgsCartId:o,isLegacyCartId:n}=v(e);if(!n&&!o)return f("[ZONOS - loadZonos] invalid cart id"),null;const t=await L({cartId:e,retries:5});return l("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(f("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})($.cartId);if(!e)return void f("Failed to get cart data");$.cartData=e.cartData,$.zonosApiKey=e.zonosApiKey,$.cartSettings=e.settings}const n=await(async()=>{const e=u(),o=m();if(!e&&!o||!window.Zonos.zonosApiKey)return null;if(l("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return l("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:n,json:t}=await w("/api/get-test-public-credential");if(n.length||!t)return f("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",n),null;const s=t.publicCredential;return s?(l(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(f("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();n&&($.zonosApiKey=n)}const a=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if($.cartId&&$.cartData||a){l("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${h}`,document.body.appendChild(e)}l("init zonos"),$.restoreNativeBrowserFunctions(),$.injectCustomScriptForHostedCheckout(),$.injectZonosCdn(),$.injectZonosCss(),$.injectFonts(),$.injectCheckoutInternationalButton(),$.injectController({config:{appearance:o,checkoutSettings:n,currencyConverter:t,helloSettings:s,onCountryChange:r,overrideCurrencyFormat:i}}),$.doneInit=!0},P.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${g}`)){const e=document.createElement("button");e.id=g,e.style.display="none",document.body.appendChild(e)}},P.injectCustomScriptForHostedCheckout=()=>{const e=$.cartData,o=(null==e?void 0:e.metadata)||[],n=o.find((e=>"customHeaderScript"===e.key)),t=o.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(n||t)){if(n){l("Injecting custom header script");const e=document.createElement("script");e.textContent=n.value,document.head.appendChild(e)}if(t){l("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else l("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:n,isLegacyCheckout:window.Zonos.isLegacyCheckout})},P.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},P.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${g}`);setTimeout((()=>{e&&e.dispatchEvent(o("click"))}),10)},P.openHelloDialog=e=>{const o=document.querySelector("zonos-hello");o&&o.openHelloDialog(null==e||e)},P.showNotification=e=>{var o;null===(o=$.zonosController)||void 0===o||o.showNotification(e)},P.updateOrganizationName=e=>{var o;null===(o=$.zonosController)||void 0===o||o.updateOrganizationName(e)},P.disablePlaceOrderButtons=({autoEnable:e=!0,config:o,disable:n,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=o.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const o=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.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((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},P.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const o="zonos---native-browser";let n=document.querySelector(`iframe#${o}`);n||(n=document.createElement("iframe"),n.id=o,n.style.display="none",n.style.opacity="0",n.style.position="absolute",n.style.top="-9999px",n.style.left="-9999px",n.style.width="1px",n.style.height="1px",n.style.border="none",n.style.overflow="hidden",n.style.visibility="hidden",document.body.appendChild(n));const t=(null===(e=n.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(n)},P.injectController=({config:e})=>{var o,n;if(document.querySelector("zonos-controller"))return;if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const o=e.checkoutSettings.placeOrderButtonSelector;$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o}),new MutationObserver((()=>{$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.alwaysTriggerInternationalCheckoutSelector){const o=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o}),new MutationObserver((()=>{$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=$.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:o}=e;l("loading Stripe");const n=await(async(...e)=>{var o;R=!0;const n=Date.now();return((e,o,n)=>{if(null===e)return null;const[t,s]=o,r=Object.assign({},s),i=(e=>{if(!("version"in e))return;const{version:o}=e;return"number"==typeof o||"string"==typeof o?o:void 0})(e);"string"==typeof i&&i!==3..toString()?delete r.apiVersion:r.apiVersion="2025-02-24.acacia";const c=e(t,r);return((e,o)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:o})})(c,n),c})(null!==(o=await Z)&&void 0!==o?o:await k(null),e,n)})(o.publishableKey);n?(window.Zonos.stripe=n,window.Zonos.isCollect?t.initCollectElement(n):window.Zonos.isInvoice?t.initInvoiceElement(n):t.initCheckoutElement(n)):f("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),$.zonosController=t,l("Zonos controller injected!")},P.injectScript=({cdnType:e,isModule:o,theRestUrl:n})=>{const t=`${$.getZonosUrl(e)}/${n}`;if(document.querySelector(`script[src="${t}"]`))return void l(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,r=document.createElement("script");o?r.type="module":r.noModule=!0,r.src=t,r.crossOrigin="anonymous",r.onerror=()=>{f(`Failed to load ${r.src}`);const t=j(e);t&&$.injectScript({cdnType:t,isModule:o,theRestUrl:n})},s.appendChild(r)},P.getZonosUrl=e=>{const o=()=>{switch(e){case"jsdelivr":return U;case"unpkg":return"https://unpkg.com/@zonos/elements@1.5.1";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.5.1";case"vercel":return E}};return $.isNpm&&z()||o()},P.injectZonosCdn=()=>{$.injectScript({cdnType:S,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),$.injectScript({cdnType:S,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),l("Zonos cdn script injected!")},P.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const n=$.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${E}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${n}/${o}`,r.onerror=()=>{f(`Failed to load ${r.href}`);const n=j(e);n&&$.injectStylesheet({cdnType:n,theRestUrl:o})},t.appendChild(r)},P.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?l("Zonos style links already injected","warn"):($.injectStylesheet({cdnType:S,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),l("Zonos style css injected!"))},P.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void l("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${x}"]`);for(let o=0;o<e.length;o++){const n=e[o];if(n&&!D.test(n.href))return n}return null})())return void l("Inter font already injected","warn");const e=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=x,e.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${x}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(n),l("Zonos font injected!")},P.setupGoogleFont=e=>{var o;null===(o=$.zonosController)||void 0===o||o.setupGoogleFont(e)},P.injectSupportGoogleFont=e=>{var o;l(`[FONT] injecting ${e}`);const n=null===(o=e.match(/family=(.*?):/))||void 0===o?void 0:o[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${x}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=x,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void l(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),l(`[FONT] ${n} font injected!`)};const F=["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"],_=["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"],M=[...F,..._];export{P as Zonos,h as checkoutHiddenBtnSelector,g as checkoutHiddenInternationalBtnSelector,M as checkoutSessionAttributeKeys,_ as checkoutSessionImmutableAttributeKeys,F as checkoutSessionMutableAttributeKeys}