@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
@@ -1 +0,0 @@
1
- import{r as o,h as t,e as s,a as e}from"./p-_lt63o7c.js";import{a}from"./p-W82paT5F.js";import{c as r}from"./p-BJHSB96f.js";import"./p-BJmZPrZl.js";const i=class{constructor(t){o(this,t),this.theme="LIGHT",this.width="auto"}render(){const o="DARK"===this.theme?"invert(100%) sepia(100%) saturate(0%) hue-rotate(288deg) brightness(102%) contrast(102%)":"whiteinvert(0%) sepia(100%) saturate(32%) hue-rotate(92deg) brightness(107%) contrast(107%)";return t(e,{key:"89d856c28d227afbe76656ce217544faad91715e",class:r(["zonos--elements zonos--logo"]),style:{"--zonos--filter-color":o,"--zonos--font-family":a(),"--zonos--width":this.width}},t("img",{key:"025c97e65f2666028391f6ca2d548bf905528133",alt:"Zonos Logo",src:s("./assets/ZonosLogo.png")}))}static get assetsDirs(){return["assets"]}};i.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host img{-webkit-filter:var(--zonos--filter-color);filter:var(--zonos--filter-color);width:var(--zonos--width)}";export{i as zonos_logo}
@@ -1 +0,0 @@
1
- import{r as t,d as e,h as o,a as n}from"./p-_lt63o7c.js";import{b as i}from"./p-FRWZayxL.js";import{m as s,n as r,o as c,s as l,d as a}from"./p-clDfq9AL.js";import{z as d,a as u,b as h}from"./p-W82paT5F.js";import{g as p,i as m,a as f}from"./p-HeAZDwVW.js";import{h as w,l as v}from"./p-DE4a-QD5.js";import{l as g}from"./p-BJmZPrZl.js";import{e as y}from"./p-sz4L-ZnB.js";import"./p-YdrG78th.js";import"./p-C_z9WL8a.js";import"./p-Cye-evFK.js";const S="zonos-domestic-element-hide-style",b="undefined"!=typeof document&&(()=>{try{return document.querySelector(":is(.zonos-is-probe)"),!0}catch(t){return!1}})(),z=t=>{const e=document.querySelector(t);if(!document.querySelector("zonos-hello")&&e){const t=document.createElement("zonos-hello");return e.appendChild(t),!0}return!1},j=t=>{switch(t){case"BOTTOM_RIGHT":default:return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right"}},I=({position:t="bottom-right"})=>{const e=".zonos--hello-mobile-wrapper";if(document.querySelector(e))return e;const o=document.createElement("div");return o.className="zonos--hello-mobile-wrapper",o.style.position="fixed","top-right"===t&&(o.style.top="72px",o.style.right="24px"),"top-left"===t&&(o.style.top="72px",o.style.left="24px"),"bottom-right"===t&&(o.style.bottom="72px",o.style.right="24px"),"bottom-left"===t&&(o.style.bottom="72px",o.style.left="24px"),o.style.zIndex="2147483647",document.body.appendChild(o),e},O=async t=>{if(window.Zonos.isLegacyCheckout)return void g("Hello is disabled when isLegacyCheckout","info");const{anchorElementSelector:e}=t;let o=e;if(!t.anchorElementSelector&&t.desktopLocation){const t=I({position:"bottom-right"});o=t}if(o&&r(o)){if(g("Hello init complete"),!z(o)){const e=new MutationObserver((()=>{z(o)&&e.disconnect()}));e.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>{z(o)}),1e3),setTimeout((()=>{if(t.notFoundElementFallback){g(`Hello anchor selector ${t.anchorElementSelector} not found after 3 seconds, falling back to 'notFoundElementFallback': ${t.notFoundElementFallback}`,"info");const e=I({position:j(t.notFoundElementFallback)});z(e)}}),3e3)}}else v(`Selector anchorElementSelector "${t.anchorElementSelector}" is not a valid selector.`)};class C{constructor(t,e){this.targetId=t,this.allowedEvents=e,this.listeners=new Map,this.handleMessage=t=>{var e,o,n;const i=t.data,s=(null===(e=this.iframe)||void 0===e?void 0:e.contentWindow)||(null===(n=null===(o=this.iframe)||void 0===o?void 0:o.contentDocument)||void 0===n?void 0:n.defaultView);if(t.source!==s)return;if(!this.isValidMessage(i))return;const r=this.listeners.get(i.type);null==r||r.forEach((t=>{try{t(i.payload)}catch(t){v("Error in event listener:",t)}}))},this.initializeEventListeners(),this.iframe=document.getElementById(this.targetId)}initializeEventListeners(){window.addEventListener("message",this.handleMessage)}isValidMessage(t){if(!t||"object"!=typeof t)return!1;const e=t;return e.id===this.targetId&&"string"==typeof e.type&&this.allowedEvents.includes(e.type)&&void 0!==e.payload}on(t,e){this.listeners.has(t)||this.listeners.set(t,new Set),g(`[CheckoutAddressService] listening to ${t}`,"info");const o=e,n=this.listeners.get(t);return n&&n.add(o),()=>{const e=this.listeners.get(t);e&&e.delete(o)}}destroy(){window.removeEventListener("message",this.handleMessage),this.listeners.clear()}}class k extends C{constructor(){g("=== [Google Places Service] Initializing","info"),super(m.GOOGLE_PLACES,["fetchAutocompleteSuggestions","initializeGooglePlacesService","placeSelected","onFetchAutocompleteSuggestions","onInitializeGooglePlacesService","onPlaceSelected"])}sendMessage(t,e){var o;if(!(null===(o=this.iframe)||void 0===o?void 0:o.contentWindow))return;const n={id:this.targetId,logType:window.Zonos.iframeLogType,payload:e,type:t};g(`GooglePlacesService] parent --\x3e ${t}`,"info",e),this.iframe.contentWindow.postMessage(n,"*")}initialize(){this.sendMessage("initializeGooglePlacesService",{})}fetchSuggestions({country:t,query:e,type:o}){t&&this.sendMessage("fetchAutocompleteSuggestions",{request:{includedRegionCodes:[t],input:e},type:o})}selectPlace({placeId:t,type:e}){this.sendMessage("placeSelected",{placeId:t,type:e})}}class E{constructor(){this.googlePlaceInitialized=!1,g("=== [CheckoutAddressService] Initializing","info"),this.googlePlaces=new k,this.googlePlaces.on("onInitializeGooglePlacesService",(()=>{g("=== [CheckoutAddressService] parent <-- onInitializeGooglePlacesService","info"),this.googlePlaceInitialized=!0})),this.initialize()}initialize(){this.googlePlaces.initialize()}onInitializeGooglePlacesService(t){return this.googlePlaces.on("onInitializeGooglePlacesService",(()=>{g("[CheckoutAddressService] parent <-- onInitializeGooglePlacesService"),t()}))}isGooglePlaceInitialized(){return this.googlePlaceInitialized}onAddressSuggestions(t){return this.suggestionsCallback=t,this.googlePlaces.on("onFetchAutocompleteSuggestions",((...e)=>{g(`[CheckoutAddressService] parent <-- onFetchAutocompleteSuggestions ${e[0].type}`,"info",...e),t(...e)}))}onAddressSelected(t){return this.placeSelectedCallback=t,this.googlePlaces.on("onPlaceSelected",((...e)=>{g(`[CheckoutAddressService] parent <-- onPlaceSelected ${e[0].type}`,"info",...e),t(...e)}))}getAddressSuggestions({country:t,query:e,type:o}){this.googlePlaceInitialized&&this.googlePlaces.fetchSuggestions({country:t,query:e,type:o})}selectAddress({placeId:t,type:e}){this.googlePlaces.selectPlace({placeId:t,type:e})}destroy(){this.googlePlaces.destroy(),this.suggestionsCallback&&(this.suggestionsCallback=void 0),this.placeSelectedCallback&&(this.placeSelectedCallback=void 0)}}const A=class{constructor(o){t(this,o),this.paypalInitEvent=e(this,"paypalInitEvent",7),this.stripeInitEvent=e(this,"stripeInitEvent",7)}async initCheckoutElement(t){var e;t?(i.stripe=t,((e=d.checkoutSettings).placeOrderButtonSelector||e.alwaysTriggerInternationalCheckoutSelector||window.Zonos.cartData)&&(!e.placeOrderButtonSelector||r(e.placeOrderButtonSelector)?!e.alwaysTriggerInternationalCheckoutSelector||r(e.alwaysTriggerInternationalCheckoutSelector)?(()=>{if(!document.querySelector("zonos-checkout")){const t=document.createElement("zonos-checkout");document.body.appendChild(t)}})():v(`Selector alwaysTriggerInternationalCheckoutSelector "${e.alwaysTriggerInternationalCheckoutSelector}" is not a valid selector`):v(`Selector checkoutButtonAnchor "${e.placeOrderButtonSelector}" is not a valid selector`)),g("init checkout element")):g("Stripe is not loaded yet - cannot init checkout element","warn")}async initCollectElement(t){t?(i.stripe=t,window.Zonos.cartData&&(()=>{if(!document.querySelector("zonos-collect")){const t=document.createElement("zonos-collect");document.body.appendChild(t)}})(),g("init Collect element")):g("Stripe is not loaded yet - cannot init Collect element","warn")}async initInvoiceElement(t){t?(i.stripe=t,window.Zonos.cartData&&(()=>{if(!document.querySelector("zonos-invoice")){const t=document.createElement("zonos-invoice");document.body.appendChild(t)}})(),g("init Invoice element")):g("Stripe is not loaded yet - cannot init Invoice element","warn")}initZonosNotification(){if(document.querySelector("zonos-notification"))return;const t=document.createElement("zonos-notification");document.body.appendChild(t)}async setupGoogleFont(t){var e,o;const n=t||u();if("Inter"===n){if(!t)return;g("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn"),d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:t})}const i=new URLSearchParams;i.set("family",n);const{errors:s,json:r}=await w(`/api/zonos-elements/get-font-detail?${i.toString()}`);if(s.length>0)return g(`Failed to load font ${n}`,"warn"),void(d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:"Inter"}));const c=null==r?void 0:r.fontUrl;c&&(null===(o=(e=window.Zonos).injectSupportGoogleFont)||void 0===o||o.call(e,c)),t&&(g(`[FONT] ${t} font override applied`),d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:t}))}handleLocationChange(){O(d.helloSettings)}initHistoryListener(){const t=history.pushState;history.pushState=function(){return window.dispatchEvent(new window.Event("pushstate")),window.dispatchEvent(new window.Event("locationchange")),t.apply(this,arguments)};const e=history.replaceState;history.replaceState=function(){return window.dispatchEvent(new window.Event("replacestate")),window.dispatchEvent(new window.Event("locationchange")),e.apply(this,arguments)}}injectCustomHTML(t){if(!t)return;if(!window.Zonos.isLegacyCheckout||window.Zonos.isCollect||window.Zonos.isInvoice)return void g("=== Skip injecting custom HTML for hosted checkout","info");g("=== Injecting custom HTML for hosted checkout");const e=document.createElement("template");e.innerHTML=t,e.content.querySelectorAll("script").forEach((t=>{const e=document.createElement("script");t.src?(e.src=t.src,e.async=t.async):e.textContent=t.innerHTML,document.body.appendChild(e)})),y()}async initGooglePlacesService(t){const e=null==t?void 0:t.genericSettings;if(!e)return;const o=e.signedTokenGooglePlaces;o&&f({id:m.GOOGLE_PLACES,onload:()=>{d.checkoutAddressService=new E},src:`https://route.elements.zonos.com/iframe/google-maps?signedToken=${o}`})}buildBaseConfig(t){var e,o;const n=Object.assign(Object.assign({},this.config.checkoutSettings),{allowedSettlementCurrencies:void 0,captureDelay:void 0,subscriptionStatus:void 0});if(window.Zonos.isCollect||window.Zonos.isInvoice)return Object.assign(Object.assign({},this.config),{checkoutSettings:n,helloSettings:Object.assign(Object.assign({},this.config.helloSettings),{visibilityStatus:"DISABLED"})});if(!this.config.checkoutSettings)return Object.assign(Object.assign({},this.config),{checkoutSettings:void 0});const i=window.Zonos.isLegacyCheckout&&!!window.Zonos.cartData&&"CLOSE_MODAL"===(null===(e=this.config.checkoutSettings)||void 0===e?void 0:e.successBehavior);return Object.assign(Object.assign({},this.config),{checkoutSettings:Object.assign(Object.assign({},n),{successBehavior:i?"ZONOS_SUCCESS_PAGE":this.config.checkoutSettings.successBehavior,successRedirectUrl:i?(null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl)||(null==t?void 0:t.onlineStoreSettings.url):this.config.checkoutSettings.successRedirectUrl})})}async componentWillLoad(){this.initHistoryListener(),d.zonosApiKey=this.zonosApiKey,(async()=>{var t,e,o,n,i,r;const{errors:l,json:a,zonosMode:u}=await(async()=>{if(window.Zonos.cartSettings)return g("Reusing cached zonos settings"),{errors:[],json:window.Zonos.cartSettings,zonosMode:window.Zonos.zonosMode};const t=p(),e=new URLSearchParams;t.overrideShouldEnabledCustomAddress&&e.set("overrideShouldEnabledCustomAddress",t.overrideShouldEnabledCustomAddress);const o=s();o&&e.set("zCountry",o);const{errors:n,json:i,zonosMode:r}=await w(`/api/zonos-elements/zonos-settings?${e.toString()}`);return n.length?(v("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings"),{errors:n,json:null,zonosMode:r}):{errors:[],json:i,zonosMode:r}})();if("403"===(null===(e=null===(t=l[0])||void 0===t?void 0:t.type)||void 0===e?void 0:e.toString()))return void g("Failed to load zonos settings. This domain may not have access","warn");const m=(null===(o=null==a?void 0:a.checkoutSettings)||void 0===o?void 0:o.customHTML)||"";this.injectCustomHTML(m),this.initZonosNotification();const f=this.buildBaseConfig(a),y=Object.assign(Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:(()=>{var t,e,o;return window.Zonos.isLegacyCheckout?(null===(t=null==a?void 0:a.appearanceSettings)||void 0===t?void 0:t.logoUrl)||(null===(e=this.config.appearance)||void 0===e?void 0:e.logoUrl):null===(o=this.config.appearance)||void 0===o?void 0:o.logoUrl})()})}),f);h({overrideSettings:y,zonosSettings:a}),d.zonosMode=u,(t=>{if("undefined"==typeof document||!t)return;const e=(({merchantSelector:t,supportsIs:e})=>e?`body.z-intl :is(${t})`:(t=>{const e=[];let o=0,n=0,i="";for(let s=0;s<t.length;s++){const r=t[s];if("("===r?o++:")"===r?o--:"["===r?n++:"]"===r&&n--,","===r&&0===o&&0===n){const t=i.trim();t&&e.push(t),i=""}else i+=r}const s=i.trim();return s&&e.push(s),e})(t).map((t=>`body.z-intl ${t}`)).join(", "))({merchantSelector:t,supportsIs:b});if(e.includes("<"))return void g(`Skip domesticElementSelector injection: "${t}" contains "<"`,"warn");try{document.querySelector(e)}catch(o){return void g(`Skip domesticElementSelector injection: "${t}" produced an invalid CSS selector ("${e}")`,"warn")}if(document.getElementById(S))return;const o=document.createElement("style");o.id=S,o.textContent=`${e} { display: none !important; }`,(document.head||document.body).appendChild(o),g("Zonos domestic element hide style injected")})(d.checkoutSettings.domesticElementSelector),this.setupGoogleFont(),"DISABLED"===d.helloSettings.visibilityStatus&&g("=== Hello is disabled by store owner ===","warn"),d.helloSettings&&"ENABLED"===d.helloSettings.visibilityStatus&&(g("Initializing hello"),O(d.helloSettings)),await c();const z=(null===(n=null==a?void 0:a.checkoutSettings)||void 0===n?void 0:n.externalServiceTokens.find((t=>"STRIPE_PUBLISHABLE_TOKEN"===t.type)))||null;if(!z||!this.stripeInitEvent)return void g("Checkout failed to load -- missing publishable key","warn");if(window.Zonos.isCollect||window.Zonos.isInvoice)return this.stripeInitEvent.emit({publishableKey:z.token}),void this.initGooglePlacesService(a);if("INACTIVE"===d.checkoutSettings.subscriptionStatus)return g('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn"),void g("zonos controller loaded");if("DISABLED"===d.checkoutSettings.visibilityStatus)return g("=== Checkout is disabled by store owner ===","warn"),void g("zonos controller loaded");const j="function"==typeof(null===(i=d.checkoutSettings)||void 0===i?void 0:i.buildCartDetail)||"function"==typeof(null===(r=d.checkoutSettings)||void 0===r?void 0:r.createCartId),I=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret"),C=!(!window.Zonos.cartId||!window.Zonos.cartData)||!!I;j||C?(this.stripeInitEvent.emit({publishableKey:z.token}),this.initGooglePlacesService(a)):g("Skip loading Stripe because no cart callback (buildCartDetail/createCartId), prefetched cart, or payment client secret is present","warn")})()}async showNotification(t){const e=document.querySelector("zonos-notification");e?e.showNotification(t):g("Failed to show notification - zonos-notification not found","warn")}async reset(){l.checkoutSessionId=null,i.clientSecret=""}async overrideConfig(t){h({overrideSettings:t,zonosSettings:null})}async overrideCountry(t){g(`Override country code to ${t}`),a({isInitializing:!1,newSelectedCountryCode:t})}async getAppearanceSetting(){return d.appearance}async updateOrganizationName(t){d.organizationName=t}render(){return o(n,{key:"1714865012d806892f03e03896ee2f04aa1a729d",class:"zonos--elements"})}};A.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";export{A as zonos_controller}
@@ -1 +0,0 @@
1
- import{r as o,h as n,a as s,F as i}from"./p-_lt63o7c.js";import{b as e,i as t,c,d as a,r,e as l,k as z,l as d,z as v,E as h,J as m,H as p,f as u}from"./p-FRWZayxL.js";import{i as g,a as f,b,c as w}from"./p-c9QtIdJX.js";import{p as x,a as y}from"./p-7abqRc9V.js";import{s as k,t as C,h as I,j,k as S,l as L}from"./p-clDfq9AL.js";import{z as O}from"./p-W82paT5F.js";import{b as T}from"./p-BycjkdlE.js";import{h as E,s as U,l as _,g as D}from"./p-DE4a-QD5.js";import{i as P,a as A}from"./p-Clej0Ffe.js";import{c as N}from"./p-BJHSB96f.js";import{l as B}from"./p-BJmZPrZl.js";import"./p-YdrG78th.js";import"./p-C_z9WL8a.js";import"./p-Cye-evFK.js";import"./p-CICjAi70.js";import"./p-sz4L-ZnB.js";const F=class{constructor(n){o(this,n),this.storeUnsubscribeList=[],this.onChangeLocaleListener=()=>{},this.mobile=!1,this.tablet=!1,this.stripe=window.Zonos.stripe,this.showLanguageDialogMobile=!1,this.submitLoading=!1,this.collapseReviewMobile=!0,this.isMobile=!1,this.isTablet=!1,this.isOverlayLoading=!0,this.isCartCollected=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.confirmationId=null,this.clientSecret=e.clientSecret,this.stripeCustomerSessionClientSecret=e.stripeCustomerSessionClientSecret,this.getBaseCurrencySettlementInfo=()=>{const o=a.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:n}}=o;return n?{settlementAmount:(n.discounts||0)+n.items+n.landedCostTotal+n.shipping}:null},this.applyStripeTheme=async()=>{const o=O.appearance.theme;await t({overrideTheme:this.isMobile?o:void 0,paypalEnabled:x()})},this.fetchCheckoutSession=async o=>{const{json:n}=await E("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"});return n},this.checkStripePaymentIntentStatus=async()=>{var o;const n=!!window.Zonos.cartData,s=new URL(window.location.href).searchParams,i=s.get("payment_intent_client_secret"),t=s.get("zonosCheckoutSessionId");if(B("Payment intent exist, checking stripe payment intent status"),!i)return B("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:n};const{error:a,status:r}=await c({clientSecret:i});if(new URLSearchParams(window.location.search).get("redirect_status")&&t){B(a?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen");const n=await this.fetchCheckoutSession(t);return this.confirmationId=(null===(o=null==n?void 0:n.checkoutSession.landedCost)||void 0===o?void 0:o.shortId)||null,k.checkoutSessionId=t,e.clientSecret=i,this.setToFinishStep(r),{shouldAllowOrder:!1}}return n?(B("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(B("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})}}resizeListener(){this.isMobile=P(this.mobile),this.isTablet=A(this.tablet)}async setToFinishStep(o){e.stripe=window.Zonos.stripe,a.step="finish",this.storybookPaymentStatusOverride=o,this.isOverlayLoading=!1}async initInvoiceCart(){var o,n,s,i,e,t,v,h,m,p,u;if(!window.Zonos.cartData)return;const b=null===(n=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.items[0])||void 0===n?void 0:n.currencyCode;b&&(a.currency=b);const w=null===(i=null===(s=window.Zonos.cartData)||void 0===s?void 0:s.references)||void 0===i?void 0:i.checkoutSessionId,x=null===(t=null===(e=window.Zonos.cartData)||void 0===e?void 0:e.references)||void 0===t?void 0:t.landedCostId;if(!x)return void r({messages:[C("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:O.organizationName})],title:C("Invalid session")});w?(B("Setting checkout session id from cart reference","info",w),k.checkoutSessionId=w):(B("Clear checkout session id from storage so we start from a fresh session for the invoice cart"),k.checkoutSessionId=null);const{shouldAllowOrder:y}=await this.checkStripePaymentIntentStatus();if(y){try{const{adjustments:o,cartItems:n}=T(window.Zonos.cartData);if(await l({adjustments:o,cartItems:n,landedCostId:x,shouldInitSessionOnFailure:!1}),!k.checkoutSessionId&&!w){const o=await z();if(B(`stripeStoreInitCheckoutSession: ${o}`),!o)throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Invoice quote but being used with sandbox credential")}if((!a.checkoutSession||(null===(v=a.checkoutSession)||void 0===v?void 0:v.completedAt))&&w){const o=await this.fetchCheckoutSession(w);if(this.confirmationId=(null===(h=null==o?void 0:o.checkoutSession.landedCost)||void 0===h?void 0:h.shortId)||null,(null==o?void 0:o.checkoutSession.completedAt)&&o.checkoutSession.order)return void this.setToFinishStep("succeeded");if(null==o?void 0:o.checkoutSession.clientSecret){const{status:n}=await c({clientSecret:o.checkoutSession.clientSecret});if("processing"===n||"succeeded"===n)return void this.setToFinishStep(n)}throw U({endpoint:"INVALID_INVOICE_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:w,cartId:null===(m=window.Zonos.cartData)||void 0===m?void 0:m.id,cartLandedCostId:x}}),new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it")}if(!a.checkoutSession)throw U({endpoint:"FAIL_TO_UPDATE_CREATE_INVOICE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this invoice cart"],metadata:{cartCheckoutSessionId:w||"N/A",cartId:null===(p=window.Zonos.cartData)||void 0===p?void 0:p.id,cartLandedCostId:x||"N/A"}}),new Error("Could not update/create checkout session for this invoice cart");d();const s=null===(u=a.checkoutSession)||void 0===u?void 0:u.landedCost;if(!s)throw new Error("Landed cost could not be found in checkout session after creating/updating them");await g(Object.assign(Object.assign({},a.checkoutSession),{id:k.checkoutSessionId||""})),f({landedCostId:s.id}),this.applyStripeTheme()}catch(o){_(o),r({messages:[C("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:O.organizationName})],title:C("Invalid session")})}this.isOverlayLoading=!1}}toggleLanguageDialog(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile}async handleStripePaymentContinue(){var o,n,s,i;if(null===(o=e.stripeBillingAddressElement)||void 0===o||o.getValue(),null===(n=e.stripeLinkEventData)||void 0===n?void 0:n.complete)if(null===(s=e.stripeBillingAddressEventData)||void 0===s?void 0:s.complete)if("USD"!==e.checkoutSettlementCurrency||!e.shouldRenderPayInUsdButton||this.payInUsdConfirmDialogOpen){if(this.payInUsdConfirmDialogOpen=!1,y.paypalErrorMessage=null,e.hasPaymentError=!1,this.submitLoading=!0,a.inventoryCheckErrorMessage=null,!await v())return e.hasPaymentError=!0,e.customErrorMessage=C("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:e.checkoutSettlementCurrency}),void(this.submitLoading=!1);await b();try{return await h({noLandedCostCheck:!0}),a.step="finish",void(this.confirmationId=w.landedCostShortId||(null===(i=a.selectedLandedCost)||void 0===i?void 0:i.landedCostId)||null)}catch(o){_(o),e.hasPaymentError=!0}this.submitLoading=!1}else this.payInUsdConfirmDialogOpen=!0;else{const o=document.querySelector(".zonos--billing-address");null==o||o.scrollIntoView({behavior:"smooth"})}else{const o=document.querySelector("zonos-link-authentication");null==o||o.scrollIntoView({behavior:"smooth"})}}componentWillLoad(){e.stripe=window.Zonos.stripe,a.step="payment",this.initInvoiceCart(),this.resizeListener(),this.storeUnsubscribeList=[m("clientSecret",(()=>{this.applyStripeTheme()})),I("selectedLocale",(()=>{this.applyStripeTheme()}))],B(`mobile: ${this.isMobile}`)}disconnectedCallback(){p(),u(),this.onChangeLocaleListener(),this.storeUnsubscribeList.forEach((o=>o()))}render(){this.clientSecret=e.clientSecret,e.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=e.stripeCustomerSessionClientSecret);const o=this.getBaseCurrencySettlementInfo(),{logoUrl:t,theme:c}=O.appearance,r=()=>{const o=`${t}?timestamp=${Date.now()}`;return n("div",{class:"zonos--logo"},o&&n("img",{alt:`${O.organizationName} logo`,src:o}))},l=D(),z=()=>{var o;const s=new URLSearchParams(window.location.search),e=s.get("zonosQaUrl"),t=s.get("zonosDebug"),c=null===(o=S.find((o=>o.code===L.selectedLocale)))||void 0===o?void 0:o.label;return n(i,null,n("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},n("div",{class:"zonos--logo-wrapper"},r(),l&&n("zonos-badge",{badgeColor:"orange",size:"small"},C("Test mode")),"1"===t&&n("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),e&&n("zonos-badge",{badgeColor:"purple",size:"small"},e)),n("div",{class:"zonos--header-right"},n("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:()=>this.toggleLanguageDialog(),variant:"outline"},c,n("zonos-icon",{"aria-label":"Language select",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"})),n("div",{class:N(["zonos--invoice-language-dialog",this.showLanguageDialogMobile&&"zonos--invoice-language-dialog-open"])},n("zonos-language-select",{handleOnClose:()=>this.toggleLanguageDialog()})))))};return n(s,{class:N(["zonos--invoice zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":c},(()=>this.isOverlayLoading||e.isFetchingSession?null:n("div",{class:"zonos--content"},"finish"!==a.step&&"error"!==a.step&&n(i,null,(this.isMobile||this.isTablet)&&z(),n("div",{class:"zonos--left","data-theme":c},!this.isMobile&&!this.isTablet&&z(),n("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},C("Billing info")),n("zonos-v-stack",{spacing:16},n("zonos-link-authentication",{titleText:""}),n("zonos-address",{titleText:"",type:"billing"})),n("zonos-invoice-payment",{class:N(["zonos--invoice-container"]),continueLoading:this.submitLoading,onContinueClicked:async()=>{await this.handleStripePaymentContinue()}})),n("div",{class:"zonos--right","data-theme":c},!this.isMobile&&n("zonos-invoice-review",{mobile:this.isMobile,tablet:this.isTablet}),n("div",{class:"zonos--order-details-container"},!this.isMobile&&n("zonos-invoice-cart-items",null),this.isMobile&&n("zonos-invoice-order-details",{collapsed:this.collapseReviewMobile,mobile:this.isMobile,onCollapseClicked:()=>{this.collapseReviewMobile=!this.collapseReviewMobile}})),n("div",{class:"flex--wrapper"},!this.isMobile&&n("zonos-v-stack",{spacing:16},n("zonos-invoice-subtotal",null)),!this.isMobile&&!this.isTablet&&n("zonos-invoice-footer",{"data-theme":c,mobile:this.isMobile,tablet:this.isTablet})))),("finish"===a.step||"error"===a.step)&&n("div",{class:"zonos--done","data-theme":c},n("div",{class:"zonos--header"},r()),n("zonos-invoice-finish",{confirmationId:this.confirmationId,overrideNotification:"error"===a.step&&a.error?Object.assign(Object.assign({},a.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),(this.isMobile||this.isTablet||"finish"===a.step||"error"===a.step)&&n("zonos-invoice-footer",{"data-theme":c,mobile:this.isMobile,tablet:this.isTablet})))(),o&&n("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:C("Cancel"),dialogConfirmBtnText:C("Pay [orderTotal]",{orderTotal:j({amount:o.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:C("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:C("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),n("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}};F.style=".sc-zonos-invoice-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-invoice-h *.sc-zonos-invoice{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-invoice-h img.sc-zonos-invoice{max-width:100%}.sc-zonos-invoice-h dl.sc-zonos-invoice,.sc-zonos-invoice-h dd.sc-zonos-invoice,.sc-zonos-invoice-h h1.sc-zonos-invoice,.sc-zonos-invoice-h h2.sc-zonos-invoice,.sc-zonos-invoice-h h3.sc-zonos-invoice,.sc-zonos-invoice-h h4.sc-zonos-invoice,.sc-zonos-invoice-h h5.sc-zonos-invoice,.sc-zonos-invoice-h h6.sc-zonos-invoice,.sc-zonos-invoice-h hr.sc-zonos-invoice,.sc-zonos-invoice-h figure.sc-zonos-invoice,.sc-zonos-invoice-h p.sc-zonos-invoice,.sc-zonos-invoice-h pre.sc-zonos-invoice{margin:0}.sc-zonos-invoice-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-invoice-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-invoice-h *.sc-zonos-invoice{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar{width:10px}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{background-color:var(--zonos-elements-gray-0)}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice{width:100%;max-width:1400px;max-height:100%;height:calc(100% - 100px);overflow:hidden;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice .zonos--header.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice .zonos--logo.sc-zonos-invoice{margin-bottom:0}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice zonos-checkout-finish.sc-zonos-invoice{-ms-flex:1;flex:1}.sc-zonos-invoice-h .zonos--header-title.sc-zonos-invoice,.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{max-width:800px}.sc-zonos-invoice-h .zonos--left.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-invoice-h .zonos--left.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice{padding:0 8px 8px}.sc-zonos-invoice-h .zonos--left.sc-zonos-invoice .zonos--payment-error-banner.sc-zonos-invoice{margin-top:24px}.sc-zonos-invoice-h .zonos--right.sc-zonos-invoice{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-invoice-h .zonos--right.sc-zonos-invoice .zonos--order-details-container.sc-zonos-invoice{overflow:auto}.sc-zonos-invoice-h .zonos--wrapper.sc-zonos-invoice{overflow:auto;max-height:100%;position:relative}.sc-zonos-invoice-h .flex--wrapper.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-invoice-h .zonos--logo-wrapper.sc-zonos-invoice{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-invoice-h .zonos--logo-wrapper.sc-zonos-invoice>*.sc-zonos-invoice{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-invoice-h .zonos--header-right.sc-zonos-invoice{display:none}.sc-zonos-invoice-h .zonos--logo.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-invoice-h .zonos--logo.sc-zonos-invoice img.sc-zonos-invoice{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-invoice-h .zonos--invoice-container.sc-zonos-invoice{overflow:visible}.mobile.sc-zonos-invoice-h,.tablet.sc-zonos-invoice-h{min-width:auto}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{padding-bottom:0}}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--review.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--review.sc-zonos-invoice{margin-bottom:0}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--cart-items.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--cart-items.sc-zonos-invoice{margin-top:8px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice zonos-checkout-footer.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice zonos-checkout-footer.sc-zonos-invoice{-ms-flex-order:3;order:3}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice{max-height:100%}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--footer.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--footer.sc-zonos-invoice{-ms-flex-order:3;order:3}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice{width:auto}.mobile.sc-zonos-invoice-h .zonos--cart-subtotal.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--cart-subtotal.sc-zonos-invoice{margin:0}.mobile.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-invoice-h .zonos--header-title.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--header-title.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{max-width:800px;padding:0 16px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{overflow:visible;width:100%}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{gap:32px}.mobile.sc-zonos-invoice-h .flex--wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .flex--wrapper.sc-zonos-invoice{margin-top:0}.mobile.sc-zonos-invoice-h zonos-collect-footer.sc-zonos-invoice,.tablet.sc-zonos-invoice-h zonos-collect-footer.sc-zonos-invoice{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{padding-top:56px;top:-56px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--header-right.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{padding-top:28px;top:-28px}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar{width:10px}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.zonos--invoice-language-dialog-open.sc-zonos-invoice{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{-ms-scroll-chaining:chained;overscroll-behavior:auto}";export{F as zonos_invoice}
@@ -1 +0,0 @@
1
- import{r as s,d as t,h as o,a as e,g as n}from"./p-_lt63o7c.js";import{t as i}from"./p-CcJF6xhQ.js";import{U as a,w as r,b as l,t as d,J as h,d as c}from"./p-FRWZayxL.js";import{s as p,l as u,C as f,t as m,z}from"./p-clDfq9AL.js";import{z as v,g as y,a as b}from"./p-W82paT5F.js";import{l as g,i as k,s as x}from"./p-DE4a-QD5.js";import{a as w,s as C}from"./p-DnjGkbEy.js";import{c as I}from"./p-BJHSB96f.js";import{l as A}from"./p-BJmZPrZl.js";import{c as E,s as j}from"./p-Cye-evFK.js";import{g as S}from"./p-C_z9WL8a.js";import"./p-BpDCLBwW.js";import"./p-YdrG78th.js";import"./p-nJ6oI8-n.js";const D=s=>{var t,o,e;return[s.name,null===(t=s.address)||void 0===t?void 0:t.line1,null===(o=s.address)||void 0===o?void 0:o.postal_code,null===(e=s.address)||void 0===e?void 0:e.country].map((s=>(s||"").trim().toLowerCase())).join("|")},L=({currentEvent:s,defaultAddress:t})=>{if(!s)return t;const o=(s=>{const{firstName:t,lastName:o}=a({firstName:s.firstName,lastName:s.lastName,name:s.name});return{address:{city:s.address.city,country:s.address.country,line1:s.address.line1,line2:s.address.line2||void 0,postal_code:s.address.postal_code,state:s.address.state},name:(s.name||`${t} ${o}`).trim(),phone:s.phone||void 0}})(s.value),e=D(o);return t.some((s=>D(s)===e))?t:[o,...t]},N=class{constructor(o){s(this,o),this.invalidCharacters=t(this,"invalidCharacters",7),this.taxIdChanged=t(this,"taxIdChanged",7),this.storeUnsubscribeList=[],this.isAutoCompleteAdjusted=!1,this.defaultAddress=[],this.taxIdErrorMessage="",this.shortAddressCodeErrorMessage="",this.stripe=window.Zonos.stripe,this.isDirtyAddress=!1,this.isAddressFilled=!1,this.checkoutSessionId=p.checkoutSessionId,this.prevCountry=null,this.prevPostalCode=null,this.trackingSent=!1,this.prefetchLandedCost=i(r,1e3)}getStripeAddressInstance(){return"billing"===this.type?{stripeAddressElement:l.stripeBillingAddressElement,stripeAddressEventData:l.stripeBillingAddressEventData,stripeElements:l.stripeElementsForBillingAddress}:{stripeAddressElement:l.stripeAddressElement,stripeAddressEventData:l.stripeAddressEventData,stripeElements:l.stripeElements}}updateAddressEventData({event:s,type:t}){"billing"===t?l.stripeBillingAddressEventData=s:l.stripeAddressEventData=s,"shipping"===t&&s.value.address.line1.length&&this.prefetchLandedCost()}isAddressFilledChanged(){p.checkoutSessionId&&this.isAddressFilled&&!this.trackingSent&&"shipping"===this.type&&(this.trackingSent=!0,d({checkoutSessionId:p.checkoutSessionId,eventName:"checkout_customerInfoFilled"}))}updateAddressElement({stripeAddressElement:s,type:t}){"shipping"!==t?l.stripeBillingAddressElement=s:l.stripeAddressElement=s}async watchInitStripe(){this.stripe=window.Zonos.stripe;const{stripeAddressEventData:s,stripeElements:t}=this.getStripeAddressInstance();if(!this.stripe||!t)return void g("Stripe is not initialized. Couldn't load stripe element.");const o=this.defaultAddress.map((s=>Object.assign(Object.assign({},s),{name:s.name,phone:s.phone||void 0}))),e=u.shippingZoneCountries,n=e?Object.values(e).map((s=>s.code)):[],i=new URLSearchParams(window.location.search).has("zonosCheckoutAllCountries"),r="shipping"===this.type?n:[],l=(null==s?void 0:s.value.address.country)||f(r);A(`Stripe country code: ${l}`,"info");const d=t.create("address",{allowedCountries:i?[]:r,contacts:L({currentEvent:s,defaultAddress:o}),defaultValues:{address:Object.assign(Object.assign({},null==s?void 0:s.value.address),{country:l}),firstName:null==s?void 0:s.value.firstName,lastName:null==s?void 0:s.value.lastName,phone:null==s?void 0:s.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});d.mount(this.el.querySelector(".zonos--address-component")),(null==s?void 0:s.value.address)&&(this.prevCountry=s.value.address.country,this.prevPostalCode=s.value.address.postal_code),d.on("change",(s=>{const t=s.value;if(!this.isDirtyAddress&&t.address.line1.length>=3){if(this.isDirtyAddress=!0,!this.isAutoCompleteAdjusted){const s=this.el.querySelector('iframe[src*="autocomplete-suggestions"]');s&&(s.style.zIndex="3"),this.isAutoCompleteAdjusted=!0}setTimeout((()=>{if(k())this.el.scrollIntoView({behavior:"smooth",block:"end"});else{const s="shipping"===this.type?100:600,t=this.el.closest(".zonos--group"),o=this.el.getBoundingClientRect().top+s;null==t||t.scrollTo({behavior:"smooth",top:o})}}),600)}const{firstName:o,lastName:e}=a({firstName:t.firstName,lastName:t.lastName,name:t.name});this.updateAddressEventData({event:Object.assign(Object.assign({},s),{elementMode:this.type,elementType:"address",value:Object.assign(Object.assign({},t),{firstName:o,lastName:e})}),type:this.type})})),this.updateAddressElement({stripeAddressElement:d,type:this.type})}defaultAddressChanged(s,t){if(JSON.stringify(t)===JSON.stringify(s))return;A("Reset address element when default address property is changed","info",{defaultAddress:this.defaultAddress});const o=this.getStripeAddressInstance().stripeAddressElement;null==o||o.clear(),null==o||o.destroy(),"shipping"===this.type?l.stripeAddressEventData=null:l.stripeBillingAddressEventData=null,this.watchInitStripe()}isInTaxIdCountry(s){return E.includes(s)}renderTaxIdInput(){var s;if("billing"===this.type)return null;const t=null===(s=l.stripeAddressEventData)||void 0===s?void 0:s.value.address.country;if(!t)return null;if(!this.isInTaxIdCountry(t))return null;if(!w({companyName:l.companyName,countryCode:t}))return null;const e=j[t];return o("div",{class:"zonos--tax-id-input"},o("zonos-stripe-input",{inputLabel:m(e.friendlyName),inputPlaceholder:e.placeholder,inputValue:l.taxId||"",isError:!!this.taxIdErrorMessage,onInputChange:s=>{l.taxId=s.detail,this.taxIdChanged.emit(s.detail)}}),this.taxIdErrorMessage&&o("zonos-text",{textColor:"red-600",type:"caption"},this.taxIdErrorMessage))}renderShortAddressCodeInput(){var s;if("billing"===this.type)return null;const t=null===(s=l.stripeAddressEventData)||void 0===s?void 0:s.value.address.country;return t&&C({countryCode:t})?o("div",{class:"zonos--short-address-code-input"},o("zonos-stripe-input",{inputLabel:m("Short address code"),inputPlaceholder:"RRRD2929",inputValue:l.shortAddressCode||"",isError:!!this.shortAddressCodeErrorMessage,onInputChange:s=>{l.shortAddressCode=s.detail}}),this.shortAddressCodeErrorMessage&&o("zonos-text",{textColor:"red-600",type:"caption"},this.shortAddressCodeErrorMessage)):null}renderCompanyNameInput(){return("billing"!==this.type||window.Zonos.isCollect||window.Zonos.isInvoice)&&("ENABLED"===v.checkoutSettings.companyFieldsStatus||window.Zonos.isCollect||window.Zonos.isInvoice)?o("zonos-stripe-input",{class:"zonos--company-name-input",inputLabel:m("Company name (optional)"),inputValue:l.companyName,onInputChange:s=>{l.companyName=s.detail}}):null}disconnectedCallback(){const s=this.getStripeAddressInstance().stripeAddressElement;null==s||s.destroy();try{this.storeUnsubscribeList.forEach((s=>s()))}catch(s){}}componentDidLoad(){const s=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!s&&s.value.address.line1.length>0,this.watchInitStripe(),this.checkoutSessionId=p.checkoutSessionId,this.storeUnsubscribeList=[z("checkoutSessionId",(()=>{this.checkoutSessionId=p.checkoutSessionId})),h("stripeElements",(()=>{"shipping"===this.type&&this.watchInitStripe()})),h("stripeElementsForBillingAddress",(()=>{"billing"===this.type&&this.watchInitStripe()}))]}render(){var s;return this.checkoutSessionId=p.checkoutSessionId,(null===(s=l.stripeAddressEventData)||void 0===s?void 0:s.complete)&&(this.isAddressFilled=!0),o(e,{key:"302dafde973c4bf2d847640d8f0e064d88f350f8",class:I(["zonos--address","zonos--elements",`zonos--${this.type}-address`])},this.titleText&&o("zonos-text",{key:"706204604ad32eed710e38adbe8133b3384044eb",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("slot",{key:"0edc4c5d6c3ff965be6edbf680acaed892c71a16",name:"below-title"}),this.renderCompanyNameInput(),this.renderTaxIdInput(),this.renderShortAddressCodeInput(),o("div",{key:"6aa6e4e86a76f1081c5af1f2b5f3282dfd91f3c5",class:"zonos--address-component"}))}get el(){return n(this)}static get watchers(){return{checkoutSessionId:[{isAddressFilledChanged:0}],isAddressFilled:[{isAddressFilledChanged:0}],stripe:[{watchInitStripe:0}],defaultAddress:[{defaultAddressChanged:0}]}}};N.style=".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h .zonos--company-name-input.sc-zonos-address,.sc-zonos-address-h .zonos--tax-id-input.sc-zonos-address,.sc-zonos-address-h .zonos--short-address-code-input.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";const B=class{constructor(o){s(this,o),this.confirmClicked=t(this,"confirmClicked",7),this.cancelClicked=t(this,"cancelClicked",7),this.dialogTitle=m("Are you sure?"),this.dialogIntent="info",this.dialogSubtitle=null,this.dialogWidth=350,this.dialogType="confirm",this.isMobile=!1,this.noClickOutside=!1,this.clickOutsideDialogHandler=s=>{s.target!==s.currentTarget||this.noClickOutside||this.closeDialogHandler()}}handleKeyDown(s){"Escape"===s.key&&this.closeDialogHandler()}focusDialog(){this.dialogOpen&&setTimeout((()=>{var s,t;null===(t=null===(s=this.el.shadowRoot)||void 0===s?void 0:s.querySelector(".zonos--backdrop"))||void 0===t||t.focus()}),100)}confirmDialogHandler(){this.dialogOpen&&this.confirmClicked.emit()}closeDialogHandler(){this.dialogOpen&&this.cancelClicked.emit()}renderIcon(){switch(this.dialogIntent){case"info":return o("zonos-icon",{content:'<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-400)"></path>\n <path d="M10.25 10.25a1.75 1.75 0 1 1 2.431 1.613c-.616.26-1.431.885-1.431 1.887a.75.75 0 0 0 1.5 0c0-.053.02-.128.108-.228.092-.104.236-.205.408-.278A3.25 3.25 0 1 0 8.75 10.25a.75.75 0 0 0 1.5 0Zm2.5 5.75a.75.75 0 0 0-1.5 0v.25a.75.75 0 0 0 1.5 0V16Z" fill="currentColor"></path>\n</svg>',iconColor:"blue-800"});case"danger":return o("zonos-icon",{content:'<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-400)"></path>\n <path d="M12.75 9a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V9Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>',iconColor:"red-800"});case"warn":return o("zonos-icon",{content:'<svg color="var(--zonos-elements-orange-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M14.46 5.492c-1.014-2.027-3.906-2.027-4.92 0L4.276 16.02c-.914 1.83.416 3.98 2.46 3.98h10.528c2.044 0 3.374-2.151 2.46-3.98L14.46 5.492Z" data-is-secondary-color="true" fill="var(--zonos-elements-orange-400)"></path>\n <path d="M12.75 10a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V10Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>',iconColor:"orange-800"})}}getButtonConfirmVariant(){switch(this.dialogIntent){case"warn":return"warning";case"danger":return"danger";default:return"primary"}}render(){this.focusDialog();const s=S(),t=y(v.appearance.theme);return o(e,{key:"9ad8aff8631692fa53ef172869d98e9fbfbdc059",class:I([this.dialogOpen&&"open","zonos--elements"]),"data-dialog-type":this.dialogType,"data-theme":t,style:{"--zonos--border-radius":s,"--zonos--dialog-width":`${this.dialogWidth}px`,"--zonos--font-family":b()}},o("div",{key:"6d7c55b90bfb05890d876a0243558eb9a2e7a772",class:"zonos--backdrop",tabIndex:-1}),o("div",{key:"abf306ddd70cefd64aa6804aeccf700506c175d7",class:I(["zonos--confirm-layout",this.dialogIntent]),onClick:s=>this.clickOutsideDialogHandler(s)},o("div",{key:"dc7e9e6d501872597928603ded57d82c15c26710",class:"zonos--confirm-dialog",onBlur:()=>{this.focusDialog()}},o("div",{key:"5c1fa9ec8b59cba68ccbc5dc36e66e2fdefdeae5",class:"wrapper"},o("div",{key:"0ce48c41c78e393a181fd5e9beeac90622b5c620",class:"icon-wrapper"},this.renderIcon()),o("div",{key:"b42157f8e76de8a60190e384d7d53a36d8051c67",class:"content"},o("div",{key:"bd8eb897f15a6d095df8fbd1803f62a11b9d5d7b",class:"title"},o("zonos-text",{key:"d1c06b89d4917b2366f881dda7da9e1369722126",type:"subheader"},this.dialogTitle)),this.dialogSubtitle&&o("div",{key:"4f1269aaab5ad3965d6ddfc0949341d4f202f296",class:"subtitle"},o("zonos-text",{key:"f784b5dd86ff684e790f27a586e3eeb4ac683884",textColor:"gray-800"},this.dialogSubtitle))),o("div",{key:"e0403a968aee6ff878c9e916e9ff216e2052ab0c",class:"footer"},"confirm"===this.dialogType&&o("zonos-button",{key:"66e34a9d61f677786bfe286f377854c9ebc780ed",backgroundColor:"gray-0",class:"cancel-button",onClick:()=>this.closeDialogHandler(),size:"lg",withBoxShadow:!0},this.dialogCancelBtnText||m("Cancel")),o("zonos-button",{key:"3652507591e3055856a044e191525ea36b6042ca",class:"confirm-button",onClick:()=>this.confirmDialogHandler(),size:"lg",variant:this.getButtonConfirmVariant()},this.dialogConfirmBtnText))))))}static get assetsDirs(){return["assets"]}get el(){return n(this)}};B.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--confirm-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:opacity 0.3s, visibility 0.3s;transition:opacity 0.3s, visibility 0.3s}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--confirm-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color)}:host .zonos--confirm-dialog{position:relative;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;width:var(--zonos--dialog-width);border-radius:var(--zonos--border-radius, 10px);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;gap:24px}:host .icon-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:40px;width:40px;border-radius:50%;background:var(--zonos-elements-blue-100)}:host .warn .icon-wrapper{background:var(--zonos-elements-orange-100)}:host .danger .icon-wrapper{background:var(--zonos-elements-red-100)}:host .footer{display:-ms-flexbox;display:flex;width:100%;gap:8px}:host .footer zonos-button{-ms-flex:1;flex:1}:host .content{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .content zonos-text{text-align:center}:host(.open) .zonos--confirm-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483009;opacity:0.65}:host(.open) .zonos--confirm-layout{opacity:1;z-index:2147483010;-webkit-transform:scale(1);transform:scale(1)}";const Z=s=>/^[a-zA-Z0-9.%_+-]*@[a-zA-Z0-9][a-zA-Z0-9.-]*\.[a-zA-Z0-9]{2,}$/.test(s),_=class{constructor(o){s(this,o),this.linkAuthenticationChange=t(this,"linkAuthenticationChange",7),this.storeUnsubscribeList=[],this.defaultEmail=null,this.isEmailError=!1,this.stripe=l.stripe,this.isStagingMode=c.isStagingMode,this.clientSecret=l.clientSecret,this.retriesInitializeLink=0,this.setCustomEmailInputToLinkEvent=s=>{const t=Z(s);l.stripeLinkEventData={complete:!!t,elementType:"linkAuthentication",empty:!s,value:{email:s}}},this.handleNormalEmailInput=s=>{var t;this.setCustomEmailInputToLinkEvent(s.detail),null===(t=this.linkAuthenticationChange)||void 0===t||t.emit()}}watchIsStagingMode(){setTimeout((()=>{this.watchInitStripe()}),0)}async watchInitStripe(){if(!this.stripe||!l.stripeElements)return;if(c.isStagingMode||!this.clientSecret)return;const s=this.defaultEmail?{email:this.defaultEmail}:void 0;try{const t=l.stripeLinkElement||l.stripeElements.create("linkAuthentication",{defaultValues:s}),o=this.el.querySelector(".zonos--link-authentication-component");if(!o)return void g("Cannot find container element for linkAuthenticationElement");t.mount(o),t.on("change",(s=>{var t;l.stripeLinkEventData=s,null===(t=this.linkAuthenticationChange)||void 0===t||t.emit()})),l.stripeLinkElement=t,this.retriesInitializeLink=0,this.retriesInitializeLink>11&&(A("Stripe link element initialized","info",{retriesInitializeLink:this.retriesInitializeLink,stripe:this.stripe}),x({endpoint:"stripe-link-authentication-init-long-running",errors:["Stripe link element initialized after 20 retries - 10 seconds"],metadata:{retriesInitializeLink:this.retriesInitializeLink}}))}catch(s){s instanceof Error&&(this.retriesInitializeLink++,this.retriesInitializeLink<51&&(await new Promise((s=>setTimeout(s,500))),this.watchInitStripe()),51===this.retriesInitializeLink&&x({endpoint:"stripe-link-authentication-init-error",errors:[s.message],metadata:{retriesInitializeLink:this.retriesInitializeLink}}))}}watchDefaultEmail(s,t){var o,e;A("Default email is changed","info",{newDefaultEmail:s,oldDefaultEmail:t}),t!==s&&(s||(l.stripeLinkEventData=null),c.isStagingMode?this.setCustomEmailInputToLinkEvent(s||""):(null===(o=l.stripeLinkElement)||void 0===o||o.clear(),null===(e=l.stripeLinkElement)||void 0===e||e.destroy(),l.stripeLinkElement=null,l.stripeLinkEventData=null,A("Reset stripe link element when default email is changed","info",{defaultEmail:s}),this.watchInitStripe()))}disconnectedCallback(){try{this.storeUnsubscribeList.forEach((s=>s()))}catch(s){}}componentDidLoad(){this.storeUnsubscribeList=[h("stripeElements",(async()=>{this.watchInitStripe()})),h("clientSecret",(async()=>{this.clientSecret=l.clientSecret})),h("stripe",(async()=>{this.stripe=l.stripe}))],this.watchInitStripe(),this.defaultEmail&&this.setCustomEmailInputToLinkEvent(this.defaultEmail)}render(){return this.isStagingMode=c.isStagingMode,this.clientSecret=l.clientSecret,o(e,{class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":S()}},this.titleText&&o("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),(()=>{var s;return c.isStagingMode?o("zonos-stripe-input",{inputLabel:m("Email"),inputValue:this.defaultEmail||(null===(s=l.stripeLinkEventData)||void 0===s?void 0:s.value.email)||"",isError:this.isEmailError,onBlur:()=>{var s;const t=(null===(s=l.stripeLinkEventData)||void 0===s?void 0:s.value.email)||"";if(!t)return;const o=Z(t);this.isEmailError=!o},onInputChange:this.handleNormalEmailInput}):o("div",{class:`zonos--link-authentication-component ${this.isEmailError&&"zonos--input-invalid"}`})})(),this.isEmailError&&o("zonos-text",{textColor:"red-600"},m("Please enter a valid email address.")))}get el(){return n(this)}static get watchers(){return{isStagingMode:[{watchIsStagingMode:0}],stripe:[{watchInitStripe:0}],clientSecret:[{watchInitStripe:0}],defaultEmail:[{watchDefaultEmail:0}]}}};_.style=".sc-zonos-link-authentication-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}.sc-zonos-link-authentication-h .zonos--input-invalid.sc-zonos-link-authentication{border:2px solid var(--zonos-elements-red-600);border-radius:var(--zonos--border-radius)}";const O=class{constructor(t){s(this,t),this.open=!1,this.size=40}render(){return o(e,{key:"8cafd99b309b04da5cf1b26b0f0804f4699c06b2",class:I(["zonos--elements",this.open&&"zonos--open"])},o("div",{key:"9ce7ac9b7e6956a5f76fc2105fa7f5d05299fd36",class:"zonos--loading-overlay"},o("zonos-spinner",{key:"4be3a8d471e3aead2e4194c4ecbf66878a7a3f17",size:this.size,spinnerColor:this.spinnerColor})))}};O.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:fixed;inset:0;z-index:2147483010;pointer-events:none;display:block}:host .zonos--loading-overlay{position:fixed;inset:0;width:100vw;height:100vh;background:var(--zonos-elements-backdrop-color);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;opacity:0;visibility:hidden;-webkit-transition:opacity 0.3s ease, visibility 0.3s ease;transition:opacity 0.3s ease, visibility 0.3s ease;z-index:2147483010}:host(.zonos--open){pointer-events:auto}:host(.zonos--open) .zonos--loading-overlay{opacity:0.65;visibility:visible}";export{N as zonos_address,B as zonos_confirm_dialog,_ as zonos_link_authentication,O as zonos_loading_overlay}
@@ -1 +0,0 @@
1
- import{l as o}from"./p-clDfq9AL.js";const r="gkjqw123",l="Kq93wqw3",v=()=>{var v;return null===(v=o.inclusivePricingConfigurations)||void 0===v?void 0:v.some((o=>{var v,i;return"ENABLED"===(null===(v=o.configurations[r])||void 0===v?void 0:v.status)||"ENABLED"===(null===(i=o.configurations[l])||void 0===i?void 0:i.status)}))};export{r as D,l as T,v as h}