@zonos/elements 1.3.281 → 1.3.283

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 (345) hide show
  1. package/dist/cjs/{cart-3313cb0c.js → cart-a1c00090.js} +2 -1
  2. package/dist/cjs/{collect-2659c5af.js → collect-e61eafca.js} +2 -2
  3. package/dist/cjs/getMissingRequiredShippingFields-a6c4f625.js +50 -0
  4. package/dist/cjs/{hasInclusivePrice-d132daaa.js → hasInclusivePrice-e7b57e02.js} +1 -1
  5. package/dist/cjs/index.cjs.js +7 -7
  6. package/dist/cjs/{invoice-26f52c07.js → invoice-ead45797.js} +2 -2
  7. package/dist/cjs/loader.cjs.js +1 -1
  8. package/dist/cjs/{localization-6189080f.js → localization-783849c8.js} +242 -0
  9. package/dist/cjs/{paypal-f6a256b5.js → paypal-e1548f40.js} +2 -2
  10. package/dist/cjs/{placeTestOrder-695f2b32.js → placeTestOrder-d99b1fe2.js} +2 -2
  11. package/dist/cjs/{renderCheckoutCurrency-fe56094f.js → renderCheckoutCurrency-c942fcba.js} +2 -2
  12. package/dist/cjs/{zonos-address-display_8.cjs.entry.js → zonos-address-completion-dialog_7.cjs.entry.js} +225 -192
  13. package/dist/cjs/zonos-address-display_2.cjs.entry.js +157 -0
  14. package/dist/cjs/zonos-address_4.cjs.entry.js +73 -12
  15. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +3 -3
  16. package/dist/cjs/zonos-badge.cjs.entry.js +3 -3
  17. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  18. package/dist/cjs/zonos-card_5.cjs.entry.js +9 -9
  19. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +89 -20
  20. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +5 -5
  21. package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
  22. package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
  23. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +6 -6
  24. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +19 -19
  25. package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
  26. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  27. package/dist/cjs/zonos-controller.cjs.entry.js +3 -3
  28. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  29. package/dist/cjs/zonos-country-select_4.cjs.entry.js +10 -10
  30. package/dist/cjs/zonos-elements.cjs.js +1 -1
  31. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +6 -6
  32. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  33. package/dist/cjs/zonos-input.cjs.entry.js +4 -4
  34. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +8 -8
  35. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +14 -14
  36. package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
  37. package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -5
  38. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  39. package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
  40. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +3 -3
  41. package/dist/cjs/zonos-stripe-input.cjs.entry.js +4 -4
  42. package/dist/cjs/zonos-tooltip.cjs.entry.js +2 -2
  43. package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
  44. package/dist/collection/collection-manifest.json +1 -0
  45. package/dist/collection/components/checkout/zonos-checkout/zonos-address-completion-dialog/zonos-address-completion-dialog.css +105 -0
  46. package/dist/collection/components/checkout/zonos-checkout/zonos-address-completion-dialog/zonos-address-completion-dialog.js +341 -0
  47. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.js +11 -4
  48. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +5 -5
  49. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +3 -3
  50. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +1 -1
  51. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +4 -4
  52. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
  53. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +52 -2
  54. package/dist/collection/components/checkout/zonos-collect/zonos-collect-cart-items/zonos-collect-cart-items.js +1 -1
  55. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +2 -2
  56. package/dist/collection/components/checkout/zonos-collect/zonos-collect-footer/zonos-collect-footer.js +3 -3
  57. package/dist/collection/components/checkout/zonos-collect/zonos-collect-review/zonos-collect-review.js +3 -3
  58. package/dist/collection/components/checkout/zonos-collect/zonos-collect-subtotal/zonos-collect-subtotal.js +5 -5
  59. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-cart-items/zonos-invoice-cart-items.js +2 -2
  60. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.js +2 -2
  61. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-footer/zonos-invoice-footer.js +3 -3
  62. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-review/zonos-invoice-review.js +3 -3
  63. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-subtotal/zonos-invoice-subtotal.js +2 -2
  64. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  65. package/dist/collection/components/common/zonos-button/zonos-button.js +3 -3
  66. package/dist/collection/components/common/zonos-card/zonos-card.js +4 -4
  67. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +3 -3
  68. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +3 -3
  69. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  70. package/dist/collection/components/common/zonos-confirm-dialog/zonos-confirm-dialog.js +3 -3
  71. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +3 -3
  72. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  73. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +3 -3
  74. package/dist/collection/components/common/zonos-h-stack/zonos-h-stack.js +2 -2
  75. package/dist/collection/components/common/zonos-input/zonos-input.js +4 -4
  76. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  77. package/dist/collection/components/common/zonos-link/zonos-link.js +1 -1
  78. package/dist/collection/components/common/zonos-loading-overlay/zonos-loading-overlay.js +1 -1
  79. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  80. package/dist/collection/components/common/zonos-rest-state/zonos-rest-state.js +3 -3
  81. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  82. package/dist/collection/components/common/zonos-skeleton/zonos-skeleton.js +1 -1
  83. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +4 -4
  84. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +17 -5
  85. package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
  86. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  87. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  88. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
  89. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  90. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  91. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
  92. package/dist/collection/components/main/zonos-controller.js +1 -1
  93. package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
  94. package/dist/collection/components/store/checkout/stripe.js +1 -1
  95. package/dist/collection/components/store/hello/localization.js +2 -0
  96. package/dist/collection/components/store/translationStore/strings.arabic.js +12 -0
  97. package/dist/collection/components/store/translationStore/strings.base.js +12 -0
  98. package/dist/collection/components/store/translationStore/strings.chinese.js +12 -0
  99. package/dist/collection/components/store/translationStore/strings.danish.js +12 -0
  100. package/dist/collection/components/store/translationStore/strings.dutch.js +12 -0
  101. package/dist/collection/components/store/translationStore/strings.french.js +12 -0
  102. package/dist/collection/components/store/translationStore/strings.german.js +12 -0
  103. package/dist/collection/components/store/translationStore/strings.hebrew.js +12 -0
  104. package/dist/collection/components/store/translationStore/strings.indonesian.js +12 -0
  105. package/dist/collection/components/store/translationStore/strings.italian.js +12 -0
  106. package/dist/collection/components/store/translationStore/strings.japanese.js +12 -0
  107. package/dist/collection/components/store/translationStore/strings.korean.js +12 -0
  108. package/dist/collection/components/store/translationStore/strings.norwegian.js +12 -0
  109. package/dist/collection/components/store/translationStore/strings.polish.js +12 -0
  110. package/dist/collection/components/store/translationStore/strings.portuguese.js +12 -0
  111. package/dist/collection/components/store/translationStore/strings.russian.js +12 -0
  112. package/dist/collection/components/store/translationStore/strings.spanish.js +12 -0
  113. package/dist/collection/components/store/translationStore/strings.swedish.js +12 -0
  114. package/dist/collection/components/store/translationStore/strings.turkish.js +12 -0
  115. package/dist/collection/components/store/translationStore/strings.vietnamese.js +12 -0
  116. package/dist/collection/components/stripe/zonos-address/zonos-address.js +11 -6
  117. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +2 -2
  118. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +52 -48
  119. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  120. package/dist/collection/components/utils/checkout/applyAddressCompletion.js +23 -0
  121. package/dist/collection/components/utils/checkout/buildAddressContacts.js +57 -0
  122. package/dist/collection/components/utils/checkout/getAddressCountryOptions.js +23 -0
  123. package/dist/collection/components/utils/checkout/getMissingRequiredShippingFields.js +44 -0
  124. package/dist/esm/{cart-c66ec17e.js → cart-93c36159.js} +2 -2
  125. package/dist/esm/{collect-915fd59d.js → collect-42d4757a.js} +2 -2
  126. package/dist/esm/getMissingRequiredShippingFields-ebdccdcf.js +47 -0
  127. package/dist/esm/{hasInclusivePrice-6fd935f3.js → hasInclusivePrice-4c12548f.js} +1 -1
  128. package/dist/esm/index.js +7 -7
  129. package/dist/esm/{invoice-2a17c93c.js → invoice-71471339.js} +2 -2
  130. package/dist/esm/loader.js +1 -1
  131. package/dist/esm/{localization-6d36209f.js → localization-754e7e8b.js} +242 -0
  132. package/dist/esm/{paypal-cae1d404.js → paypal-b1410e02.js} +2 -2
  133. package/dist/esm/{placeTestOrder-955269d2.js → placeTestOrder-4267cafd.js} +2 -2
  134. package/dist/esm/{renderCheckoutCurrency-951386a5.js → renderCheckoutCurrency-9a81e41c.js} +2 -2
  135. package/dist/esm/{zonos-address-display_8.entry.js → zonos-address-completion-dialog_7.entry.js} +226 -192
  136. package/dist/esm/zonos-address-display_2.entry.js +152 -0
  137. package/dist/esm/zonos-address_4.entry.js +73 -12
  138. package/dist/esm/zonos-airwallex-payment.entry.js +3 -3
  139. package/dist/esm/zonos-badge.entry.js +3 -3
  140. package/dist/esm/zonos-button_3.entry.js +3 -3
  141. package/dist/esm/zonos-card_5.entry.js +9 -9
  142. package/dist/esm/zonos-cart-items_12.entry.js +90 -21
  143. package/dist/esm/zonos-checkbox_2.entry.js +5 -5
  144. package/dist/esm/zonos-checkout.entry.js +3 -3
  145. package/dist/esm/zonos-collapse.entry.js +2 -2
  146. package/dist/esm/zonos-collect-cart-items_3.entry.js +6 -6
  147. package/dist/esm/zonos-collect-finish_6.entry.js +19 -19
  148. package/dist/esm/zonos-collect.entry.js +4 -4
  149. package/dist/esm/zonos-component.entry.js +1 -1
  150. package/dist/esm/zonos-controller.entry.js +3 -3
  151. package/dist/esm/zonos-country-flag.entry.js +1 -1
  152. package/dist/esm/zonos-country-select_4.entry.js +10 -10
  153. package/dist/esm/zonos-elements.js +1 -1
  154. package/dist/esm/zonos-hello-dialog.entry.js +6 -6
  155. package/dist/esm/zonos-hello.entry.js +1 -1
  156. package/dist/esm/zonos-input.entry.js +4 -4
  157. package/dist/esm/zonos-invoice-cart-items_2.entry.js +8 -8
  158. package/dist/esm/zonos-invoice-finish_5.entry.js +14 -14
  159. package/dist/esm/zonos-invoice.entry.js +4 -4
  160. package/dist/esm/zonos-language-select_2.entry.js +5 -5
  161. package/dist/esm/zonos-link.entry.js +1 -1
  162. package/dist/esm/zonos-logo.entry.js +2 -2
  163. package/dist/esm/zonos-policy-consent_2.entry.js +3 -3
  164. package/dist/esm/zonos-stripe-input.entry.js +4 -4
  165. package/dist/esm/zonos-tooltip.entry.js +2 -2
  166. package/dist/esm/zonos-v-stack.entry.js +2 -2
  167. package/dist/esm-es5/{cart-c66ec17e.js → cart-93c36159.js} +1 -1
  168. package/dist/esm-es5/{collect-915fd59d.js → collect-42d4757a.js} +1 -1
  169. package/dist/esm-es5/getMissingRequiredShippingFields-ebdccdcf.js +1 -0
  170. package/dist/esm-es5/{hasInclusivePrice-6fd935f3.js → hasInclusivePrice-4c12548f.js} +1 -1
  171. package/dist/esm-es5/index.js +1 -1
  172. package/dist/esm-es5/{invoice-2a17c93c.js → invoice-71471339.js} +1 -1
  173. package/dist/esm-es5/loader.js +1 -1
  174. package/dist/esm-es5/localization-754e7e8b.js +1 -0
  175. package/dist/esm-es5/{paypal-cae1d404.js → paypal-b1410e02.js} +1 -1
  176. package/dist/esm-es5/{placeTestOrder-955269d2.js → placeTestOrder-4267cafd.js} +1 -1
  177. package/dist/esm-es5/{renderCheckoutCurrency-951386a5.js → renderCheckoutCurrency-9a81e41c.js} +1 -1
  178. package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +1 -0
  179. package/dist/esm-es5/zonos-address-display_2.entry.js +1 -0
  180. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  181. package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
  182. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  183. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  184. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  185. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  186. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
  187. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  188. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  189. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  190. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  191. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  192. package/dist/esm-es5/zonos-component.entry.js +1 -1
  193. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  194. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  195. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  196. package/dist/esm-es5/zonos-elements.js +1 -1
  197. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  198. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  199. package/dist/esm-es5/zonos-input.entry.js +1 -1
  200. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  201. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  202. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  203. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  204. package/dist/esm-es5/zonos-link.entry.js +1 -1
  205. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  206. package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
  207. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  208. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  209. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  210. package/dist/scripts/index.d.ts +123 -0
  211. package/dist/scripts/index.js +1 -1
  212. package/dist/scripts/loadZonos.js +1 -1
  213. package/dist/scripts/zonos.js +1 -1
  214. package/dist/types/components/checkout/zonos-checkout/zonos-address-completion-dialog/zonos-address-completion-dialog.d.ts +75 -0
  215. package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +16 -0
  216. package/dist/types/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.d.ts +1 -0
  217. package/dist/types/components/store/checkout/stripe.d.ts +4 -0
  218. package/dist/types/components/store/hello/localization.d.ts +7 -0
  219. package/dist/types/components/store/translationStore/strings.arabic.d.ts +12 -0
  220. package/dist/types/components/store/translationStore/strings.base.d.ts +12 -0
  221. package/dist/types/components/store/translationStore/strings.chinese.d.ts +12 -0
  222. package/dist/types/components/store/translationStore/strings.danish.d.ts +12 -0
  223. package/dist/types/components/store/translationStore/strings.dutch.d.ts +12 -0
  224. package/dist/types/components/store/translationStore/strings.french.d.ts +12 -0
  225. package/dist/types/components/store/translationStore/strings.german.d.ts +12 -0
  226. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +12 -0
  227. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +12 -0
  228. package/dist/types/components/store/translationStore/strings.italian.d.ts +12 -0
  229. package/dist/types/components/store/translationStore/strings.japanese.d.ts +12 -0
  230. package/dist/types/components/store/translationStore/strings.korean.d.ts +12 -0
  231. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +12 -0
  232. package/dist/types/components/store/translationStore/strings.polish.d.ts +12 -0
  233. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +12 -0
  234. package/dist/types/components/store/translationStore/strings.russian.d.ts +12 -0
  235. package/dist/types/components/store/translationStore/strings.spanish.d.ts +12 -0
  236. package/dist/types/components/store/translationStore/strings.swedish.d.ts +12 -0
  237. package/dist/types/components/store/translationStore/strings.turkish.d.ts +12 -0
  238. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +12 -0
  239. package/dist/types/components/stripe/zonos-custom-address/zonos-custom-address.d.ts +9 -13
  240. package/dist/types/components/utils/checkout/applyAddressCompletion.d.ts +25 -0
  241. package/dist/types/components/utils/checkout/buildAddressContacts.d.ts +21 -0
  242. package/dist/types/components/utils/checkout/getAddressCountryOptions.d.ts +29 -0
  243. package/dist/types/components/utils/checkout/getMissingRequiredShippingFields.d.ts +35 -0
  244. package/dist/types/components.d.ts +97 -0
  245. package/dist/zonos-elements/index.esm.js +1 -1
  246. package/dist/zonos-elements/{p-09da3c76.entry.js → p-007ff76a.entry.js} +1 -1
  247. package/dist/zonos-elements/{p-5aee5de5.system.entry.js → p-05cb0a0d.system.entry.js} +1 -1
  248. package/dist/zonos-elements/p-065f3f66.system.entry.js +1 -0
  249. package/dist/zonos-elements/p-07c21940.entry.js +1 -0
  250. package/dist/zonos-elements/p-0d183f19.system.js +1 -0
  251. package/dist/zonos-elements/p-1180a97c.system.entry.js +1 -0
  252. package/dist/zonos-elements/p-19bbf4b3.js +1 -0
  253. package/dist/zonos-elements/{p-ee3c7b11.system.entry.js → p-1af510ea.system.entry.js} +1 -1
  254. package/dist/zonos-elements/p-1cff471a.system.entry.js +1 -0
  255. package/dist/zonos-elements/{p-0ad6a92b.system.entry.js → p-21489ff1.system.entry.js} +1 -1
  256. package/dist/zonos-elements/{p-734d646b.entry.js → p-21f7d57b.entry.js} +1 -1
  257. package/dist/zonos-elements/p-22f7120a.system.js +1 -0
  258. package/dist/zonos-elements/{p-b5f67807.entry.js → p-26bf0c31.entry.js} +1 -1
  259. package/dist/zonos-elements/p-2837bfd2.js +1 -0
  260. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  261. package/dist/zonos-elements/{p-86d6961c.system.entry.js → p-29ca1415.system.entry.js} +1 -1
  262. package/dist/zonos-elements/p-2aebcfa8.system.entry.js +1 -0
  263. package/dist/zonos-elements/{p-8c54aaec.entry.js → p-32b53999.entry.js} +1 -1
  264. package/dist/zonos-elements/{p-c15476a1.system.entry.js → p-333f6018.system.entry.js} +1 -1
  265. package/dist/zonos-elements/p-33dd7dab.entry.js +1 -0
  266. package/dist/zonos-elements/{p-060c521b.system.entry.js → p-342b062d.system.entry.js} +1 -1
  267. package/dist/zonos-elements/{p-a5f8dc19.js → p-38881097.js} +1 -1
  268. package/dist/zonos-elements/{p-38879af9.entry.js → p-39399f67.entry.js} +1 -1
  269. package/dist/zonos-elements/{p-683ec0bf.entry.js → p-3d902845.entry.js} +1 -1
  270. package/dist/zonos-elements/{p-a6773627.entry.js → p-3dcb3794.entry.js} +1 -1
  271. package/dist/zonos-elements/p-4a5fa892.system.entry.js +1 -0
  272. package/dist/zonos-elements/{p-a34269b1.system.entry.js → p-4a73906a.system.entry.js} +1 -1
  273. package/dist/zonos-elements/{p-5677d31f.entry.js → p-4b9c7803.entry.js} +1 -1
  274. package/dist/zonos-elements/{p-54a8d4cf.system.entry.js → p-4dba0e9b.system.entry.js} +1 -1
  275. package/dist/zonos-elements/{p-1992fd91.entry.js → p-55c5977b.entry.js} +1 -1
  276. package/dist/zonos-elements/{p-179caaea.system.entry.js → p-58da55e6.system.entry.js} +1 -1
  277. package/dist/zonos-elements/p-59824ac6.entry.js +1 -0
  278. package/dist/zonos-elements/{p-f156e2e5.system.entry.js → p-59e4e0b6.system.entry.js} +1 -1
  279. package/dist/zonos-elements/{p-a44591f6.system.entry.js → p-5a37683b.system.entry.js} +1 -1
  280. package/dist/zonos-elements/{p-36b311f9.system.entry.js → p-5b11bbca.system.entry.js} +1 -1
  281. package/dist/zonos-elements/{p-717cbe90.system.js → p-5fceef56.system.js} +1 -1
  282. package/dist/zonos-elements/{p-8005e102.system.js → p-602de72d.system.js} +1 -1
  283. package/dist/zonos-elements/{p-39695a8b.system.js → p-6325ee77.system.js} +1 -1
  284. package/dist/zonos-elements/p-67251274.system.js +1 -0
  285. package/dist/zonos-elements/{p-4441c451.entry.js → p-69871ab6.entry.js} +1 -1
  286. package/dist/zonos-elements/p-6be4c473.entry.js +1 -0
  287. package/dist/zonos-elements/p-72280783.system.js +1 -0
  288. package/dist/zonos-elements/{p-746bdebe.entry.js → p-73d1a554.entry.js} +1 -1
  289. package/dist/zonos-elements/{p-e0ec0aa3.system.entry.js → p-76a75da9.system.entry.js} +1 -1
  290. package/dist/zonos-elements/{p-26ca8ce7.js → p-76cdf517.js} +1 -1
  291. package/dist/zonos-elements/{p-a3d3ce5d.system.entry.js → p-781b3345.system.entry.js} +1 -1
  292. package/dist/zonos-elements/{p-1577a739.js → p-8eaf1316.js} +1 -1
  293. package/dist/zonos-elements/{p-99e8743e.system.entry.js → p-8fa3a8f8.system.entry.js} +1 -1
  294. package/dist/zonos-elements/{p-b406bb39.entry.js → p-944282af.entry.js} +1 -1
  295. package/dist/zonos-elements/{p-3e6bbf0b.system.entry.js → p-97f15546.system.entry.js} +1 -1
  296. package/dist/zonos-elements/{p-727387ed.entry.js → p-9ceb3d1c.entry.js} +1 -1
  297. package/dist/zonos-elements/{p-3246d120.js → p-a2fe995b.js} +1 -1
  298. package/dist/zonos-elements/{p-4c3f5fda.system.entry.js → p-aa7589de.system.entry.js} +1 -1
  299. package/dist/zonos-elements/p-b0482924.entry.js +1 -0
  300. package/dist/zonos-elements/{p-ddf68916.system.js → p-b567448d.system.js} +1 -1
  301. package/dist/zonos-elements/{p-edf613ea.entry.js → p-b7a03b08.entry.js} +1 -1
  302. package/dist/zonos-elements/{p-15097876.system.entry.js → p-b93013f7.system.entry.js} +1 -1
  303. package/dist/zonos-elements/{p-3f6fe80a.system.entry.js → p-c43130a7.system.entry.js} +1 -1
  304. package/dist/zonos-elements/p-c515bc23.system.js +1 -0
  305. package/dist/zonos-elements/{p-732e7373.system.entry.js → p-c634546a.system.entry.js} +1 -1
  306. package/dist/zonos-elements/{p-6df6cb8a.entry.js → p-c8a48cce.entry.js} +1 -1
  307. package/dist/zonos-elements/{p-3e058b4e.entry.js → p-cb376f03.entry.js} +1 -1
  308. package/dist/zonos-elements/{p-8308f7d6.system.entry.js → p-cc35d5f8.system.entry.js} +1 -1
  309. package/dist/zonos-elements/{p-f314217a.system.js → p-cd5638b2.system.js} +2 -2
  310. package/dist/zonos-elements/{p-56fc3210.js → p-d68425ad.js} +1 -1
  311. package/dist/zonos-elements/{p-03fda4a8.entry.js → p-d74eda59.entry.js} +1 -1
  312. package/dist/zonos-elements/{p-30067eed.entry.js → p-d93f4837.entry.js} +1 -1
  313. package/dist/zonos-elements/{p-e7a45f6c.entry.js → p-dcf8ab79.entry.js} +1 -1
  314. package/dist/zonos-elements/{p-4efd7178.entry.js → p-e0cbc7c7.entry.js} +1 -1
  315. package/dist/zonos-elements/{p-40b96482.system.entry.js → p-e2057ab0.system.entry.js} +1 -1
  316. package/dist/zonos-elements/p-e2b8936a.js +1 -0
  317. package/dist/zonos-elements/{p-dd6da3de.entry.js → p-e3d0d8ff.entry.js} +1 -1
  318. package/dist/zonos-elements/{p-5a61c301.system.entry.js → p-e8159288.system.entry.js} +1 -1
  319. package/dist/zonos-elements/{p-5e1aad7d.entry.js → p-e8bb4f3b.entry.js} +1 -1
  320. package/dist/zonos-elements/{p-a23d3b3f.system.entry.js → p-e99654c1.system.entry.js} +1 -1
  321. package/dist/zonos-elements/{p-5d4201d5.entry.js → p-ef2c264c.entry.js} +1 -1
  322. package/dist/zonos-elements/{p-429ab545.system.entry.js → p-f1dbeb85.system.entry.js} +1 -1
  323. package/dist/zonos-elements/{p-2825431d.entry.js → p-f2431e47.entry.js} +1 -1
  324. package/dist/zonos-elements/{p-29c1703c.system.entry.js → p-f2511b86.system.entry.js} +1 -1
  325. package/dist/zonos-elements/{p-156891c5.js → p-f9f3155b.js} +1 -1
  326. package/dist/zonos-elements/{p-08e78d79.entry.js → p-fa80a973.entry.js} +1 -1
  327. package/dist/zonos-elements/{p-f59514e9.entry.js → p-fc45b3a5.entry.js} +1 -1
  328. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  329. package/package.json +1 -1
  330. package/dist/esm-es5/localization-6d36209f.js +0 -1
  331. package/dist/esm-es5/zonos-address-display_8.entry.js +0 -1
  332. package/dist/zonos-elements/p-0ac1aa87.system.js +0 -1
  333. package/dist/zonos-elements/p-1ee5f392.entry.js +0 -1
  334. package/dist/zonos-elements/p-6df034d6.entry.js +0 -1
  335. package/dist/zonos-elements/p-71cb16da.system.entry.js +0 -1
  336. package/dist/zonos-elements/p-8051403a.js +0 -1
  337. package/dist/zonos-elements/p-9448d960.js +0 -1
  338. package/dist/zonos-elements/p-a6535773.system.entry.js +0 -1
  339. package/dist/zonos-elements/p-ae30e6c0.system.entry.js +0 -1
  340. package/dist/zonos-elements/p-bf942ef0.system.js +0 -1
  341. package/dist/zonos-elements/p-c345d1f5.system.js +0 -1
  342. package/dist/zonos-elements/p-d4337686.entry.js +0 -1
  343. package/dist/zonos-elements/p-df8b8827.entry.js +0 -1
  344. package/dist/zonos-elements/p-e210edd9.system.js +0 -1
  345. package/dist/zonos-elements/p-f3e1a6a7.system.entry.js +0 -1
@@ -1,11 +1,12 @@
1
- import { r as registerInstance, h, a as Host, d as createEvent, g as getElement } from './index-cfd394c8.js';
2
- import { t as translate, l as localizationStore, s as storageStore, y as storageStoreOnChange } from './localization-6d36209f.js';
3
- import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
4
- import { V as extractName, b as stripeStore, u as stripeStorePrefetchLandedCost, t as trackConversionEvent } from './cart-c66ec17e.js';
1
+ import { r as registerInstance, d as createEvent, h, a as Host, g as getElement } from './index-cfd394c8.js';
2
+ import { t as translate, s as storageStore, y as storageStoreOnChange, l as localizationStore } from './localization-754e7e8b.js';
3
+ import { z as zonosStore, f as zonosStoreFontFamily } from './zonosStore-b7d3f9b0.js';
4
+ import { M as MIN_POSTAL_CODE_LENGTH } from './getMissingRequiredShippingFields-ebdccdcf.js';
5
5
  import { c as classes } from './classes-0d95c529.js';
6
+ import { U as extractName, b as stripeStore, u as stripeStorePrefetchLandedCost, t as trackConversionEvent } from './cart-93c36159.js';
7
+ import { R as RemoveIcon$1 } from './RemoveIcon-9dc5dd1a.js';
8
+ import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';
6
9
  import { g as getBorderRadius } from './getBorderRadius-dc982fe6.js';
7
- import { z as zonosStore, f as zonosStoreFontFamily } from './zonosStore-b7d3f9b0.js';
8
- import { R as RemoveIcon$2 } from './RemoveIcon-9dc5dd1a.js';
9
10
  import { t as throttle_1 } from './throttle-44bfb6b5.js';
10
11
  import { i as isCheckoutMobile } from './handleFetch-a844cac1.js';
11
12
  import { a as shouldRenderTaxIdInput, s as shouldRenderShortAddressCodeInput } from './shouldRenderTaxIdInput-ef7b5860.js';
@@ -16,31 +17,132 @@ import { i as isDarkColor } from './isDarkColor-039ef212.js';
16
17
  import './debounce-c8d67b17.js';
17
18
  import './ShortAddressCode-7620e622.js';
18
19
 
19
- const zonosAddressDisplayCss = ":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--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:\", \";color:var(--zonos-elements-gray-1000);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}";
20
- const ZonosAddressDisplayStyle0 = zonosAddressDisplayCss;
20
+ const zonosAddressCompletionDialogCss = ":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--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:24px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding-bottom:5px;gap:20px;-ms-scroll-chaining:chained;overscroll-behavior:auto}:host .zonos--selected-address{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--completion-fields{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:16px}:host .zonos--completion-name-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--completion-name-row zonos-input{-ms-flex:1;flex:1}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--completion-name-row{-ms-flex-direction:column;flex-direction:column}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--submit-btn{-ms-flex-order:1;order:1}";
21
+ const ZonosAddressCompletionDialogStyle0 = zonosAddressCompletionDialogCss;
21
22
 
22
- const ZonosAddressDisplay = class {
23
+ const ZonosAddressCompletionDialog = class {
23
24
  constructor(hostRef) {
24
25
  registerInstance(this, hostRef);
26
+ this.closeCompletionDialog = createEvent(this, "closeCompletionDialog", 7);
27
+ this.completionSubmit = createEvent(this, "completionSubmit", 7);
28
+ /**
29
+ * Whether or not the continue button is loading
30
+ */
31
+ this.continueLoading = false;
32
+ /**
33
+ * Whether or not the dialog is open
34
+ */
35
+ this.dialogOpen = false;
36
+ /**
37
+ * Whether or not the dialog is rendered in mobile mode
38
+ */
39
+ this.isMobile = false;
40
+ /**
41
+ * The Zonos-required fields still missing from the selected address
42
+ */
43
+ this.missingFields = [];
44
+ /**
45
+ * Local values for the captured fields, keyed by the missing field key
46
+ */
47
+ this.values = {};
48
+ /**
49
+ * Whether to show validation errors (after a submit attempt with empty fields)
50
+ */
51
+ this.showError = false;
52
+ this.isFieldMissing = (key) => this.missingFields.some(field => field.key === key);
53
+ /**
54
+ * A captured field is valid when it has a value. Postal code additionally enforces the same
55
+ * minimum length as the landed-cost readiness / detection check, so the dialog can't emit a
56
+ * too-short postal code that would still be considered "missing" downstream.
57
+ */
58
+ this.isFieldValid = (key) => {
59
+ var _a, _b, _c;
60
+ if (key === 'postal_code') {
61
+ return (((_b = (_a = this.values.postal_code) === null || _a === void 0 ? void 0 : _a.trim().length) !== null && _b !== void 0 ? _b : 0) >= MIN_POSTAL_CODE_LENGTH);
62
+ }
63
+ return !!((_c = this.values[key]) === null || _c === void 0 ? void 0 : _c.trim());
64
+ };
65
+ this.getFieldError = (key) => this.showError && !this.isFieldValid(key);
66
+ this.updateValue = (key, value) => {
67
+ this.values = Object.assign(Object.assign({}, this.values), { [key]: value });
68
+ // Once the customer starts fixing the fields, re-evaluate whether errors remain
69
+ if (this.showError) {
70
+ this.showError = !this.isComplete();
71
+ }
72
+ };
73
+ this.isComplete = () => this.missingFields.every(field => {
74
+ // A missing last name also requires a first name (both are edited together).
75
+ if (field.key === 'lastName') {
76
+ return this.isFieldValid('firstName') && this.isFieldValid('lastName');
77
+ }
78
+ return this.isFieldValid(field.key);
79
+ });
80
+ this.submitHandler = () => {
81
+ if (!this.isComplete()) {
82
+ this.showError = true;
83
+ return;
84
+ }
85
+ this.completionSubmit.emit(this.values);
86
+ };
87
+ this.renderInput = ({ key, label, }) => (h("zonos-input", { class: `zonos--completion-input zonos--completion-${key}`, inputLabel: label, inputValue: this.values[key] || '', isError: this.getFieldError(key), onInputChange: (event) => this.updateValue(key, event.detail) }));
88
+ this.renderField = (key, label) => {
89
+ if (!this.isFieldMissing(key)) {
90
+ return null;
91
+ }
92
+ return this.renderInput({ key, label });
93
+ };
94
+ /**
95
+ * When the last name is missing, render both first and last name inputs so the customer can
96
+ * correct the full name together (Link's single name input often yields only a first name).
97
+ */
98
+ this.renderNameFields = () => {
99
+ if (!this.isFieldMissing('lastName')) {
100
+ return null;
101
+ }
102
+ return (h("div", { class: "zonos--completion-name-row" }, this.renderInput({
103
+ key: 'firstName',
104
+ label: translate('First name'),
105
+ }), this.renderInput({
106
+ key: 'lastName',
107
+ label: translate('Last name'),
108
+ })));
109
+ };
25
110
  }
26
- render() {
111
+ /**
112
+ * The dialog stays mounted, so clear any previously-entered values whenever it opens.
113
+ * Without this, values typed for one address could be reapplied to a different address
114
+ * the next time the dialog opens.
115
+ */
116
+ // Only reset on open, not on `shippingAddress`: the parent rebuilds that prop object on
117
+ // every render, and watching it would wipe in-progress input while the dialog is open.
118
+ async watchDialogOpen(isOpen) {
27
119
  var _a;
28
- const { city, country, email, line1, line2, name, phone, postal_code, state, } = this.currentAddress;
29
- const shippingZoneCountry = (_a = localizationStore.shippingZoneCountries) === null || _a === void 0 ? void 0 : _a[country];
30
- const renderEnteredInfoText = ({ bold, content, }) => {
31
- const textColor = isTextContainsNonLatinChars(content)
32
- ? 'red-600'
33
- : 'gray-1000';
34
- return (h("zonos-text", { textColor: textColor, type: bold ? 'boldLabel' : 'body' }, content));
35
- };
36
- return (h(Host, { class: "zonos--address-form zonos--elements" }, h("div", { class: "zonos--title" }, h("zonos-text", { textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
37
- ? translate('Shipping')
38
- : translate('Billing'))), h("div", { class: "zonos--address-group" }, name && (h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ bold: true, content: name }))), email && (h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: email }))), phone && (h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: phone }))), line1 && (h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: line1 }))), line2 && (h("div", { class: "zonos--address-line" }, renderEnteredInfoText({ content: line2 }))), h("div", { class: "zonos--address-line" }, city && renderEnteredInfoText({ content: city }), state && renderEnteredInfoText({ content: state }), postal_code && renderEnteredInfoText({ content: postal_code })), shippingZoneCountry && (h("div", { class: "zonos--address-line" }, h("zonos-country-flag", { class: "zonos--country-flag", countryCode: shippingZoneCountry.code }), ' ', renderEnteredInfoText({
39
- content: shippingZoneCountry.displayName,
40
- }))))));
120
+ if (isOpen) {
121
+ // Wait for shippingAddress prop to be updated before resetting the values
122
+ await new Promise(resolve => setTimeout(resolve, 100));
123
+ // When the last name is missing we also let the customer edit the first name, so prefill
124
+ // it from the current (often first-name-only) address value.
125
+ const { firstName } = extractName({ name: (_a = this.shippingAddress) === null || _a === void 0 ? void 0 : _a.name });
126
+ this.values = this.isFieldMissing('lastName') ? { firstName } : {};
127
+ this.showError = false;
128
+ }
41
129
  }
130
+ render() {
131
+ const submitBtnColor = this.submitBtnColor || zonosStore.appearance.colorSecondary;
132
+ // dialog background is white, so a white button needs an outline to stay visible
133
+ const submitBtnType = submitBtnColor === '#ffffff'
134
+ ? 'outline'
135
+ : this.submitBtnType || 'standard';
136
+ return (h(Host, { key: '9a89376022ebd8f5793882fb13a3502deca001f8', class: classes([
137
+ 'zonos--address-completion-dialog zonos--elements',
138
+ this.isMobile && 'mobile',
139
+ ]) }, h("zonos-dialog", { key: '00ff3912a7bf8d021441440f0de2825b49f7b78e', isLoading: false, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeCompletionDialog.emit(), open: this.dialogOpen, width: "568px" }, h("div", { key: '1ba1cd333bd1f362a77f1f114ac50c309ed5ccd6', class: "zonos--body" }, h("div", { key: 'ccf9f54ff4b26e5443ff5c8276e5c5d36aac332b', class: "zonos--dialog-header" }, h("div", { key: '01e073aa559c4040a6599aefb3bf8cb967928929', class: "zonos--dialog-title" }, h("zonos-text", { key: '8472a72f6274646bb87d150c82722f93c861ae72', type: "title" }, translate('Complete your shipping address')), h("zonos-button", { key: 'e9a6c2cbc3d64bf87e94850c1126119687f75e7d', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon$1 }), noBackground: true, onClick: () => this.closeCompletionDialog.emit(), title: "Close checkout dialog" })), h("zonos-text", { key: 'c9ff785b746810f0c266071ee9a3f433ad645a2b' }, translate('This saved address is missing information required to ship internationally. Please add the details below.'))), h("div", { key: '86e2b0da7dbcd1370b80fc8c53e8a7de4c11ed74', class: "zonos--group" }, h("div", { key: '1542bb7f0b9df16f5ce36d38dc9408a1b3e836a7', class: "zonos--selected-address" }, h("zonos-text", { key: '2572e3e44a9c81f6694e4939de39951ec659c8fa', class: "zonos--selected-label", type: "semiBoldLabel" }, translate('Selected address')), h("zonos-address-display", { key: '8781622b3d057cfbdba59e13d5fabf76f3a7a7dd', addressType: "shipping", currentAddress: this.shippingAddress })), h("div", { key: 'ac3a5f6566c2179045a784b661b7e82c7b371a3f', class: "zonos--completion-fields" }, this.renderNameFields(), this.renderField('state', translate('State/Province')), this.renderField('postal_code', translate('Postal code')))), h("div", { key: '1007d7f6c671fbd94dd3027332d2d7ac1edeef6e', class: "zonos--group-btn" }, h("div", { key: '22fe2c8d03d7b3c680eea2b4afebf1868b5b6c0b', class: "zonos--button-wrapper" }, h("zonos-button", { key: 'dbcf1aa175992bff762ecc36108bf94090b7df0e', class: "zonos--cancel-btn", onClick: () => this.closeCompletionDialog.emit(), variant: "subtle" }, translate('Cancel')), h("zonos-button", { key: '63b0f966565e86ea9bac640b2fa690287c94b11f', backgroundColor: this.submitBtnColor, class: "zonos--submit-btn", loading: this.continueLoading, onClick: () => this.submitHandler(), size: "sm", variant: submitBtnType }, translate('Save and continue'))))))));
140
+ }
141
+ static get watchers() { return {
142
+ "dialogOpen": ["watchDialogOpen"]
143
+ }; }
42
144
  };
43
- ZonosAddressDisplay.style = ZonosAddressDisplayStyle0;
145
+ ZonosAddressCompletionDialog.style = ZonosAddressCompletionDialogStyle0;
44
146
 
45
147
  const zonosAddressFormCss = ":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--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";
46
148
  const ZonosAddressFormStyle0 = zonosAddressFormCss;
@@ -72,15 +174,15 @@ const ZonosAddressForm = class {
72
174
  const { firstName, lastName } = extractName({
73
175
  name,
74
176
  });
75
- return (h(Host, { key: '45d9837eb2fa1799686031aae55b7a5b56683f44', class: "zonos--address-form zonos--elements" }, h("div", { key: '021635c62ccf3956099fbc4111a7cccacf87e6a1', class: "zonos--title" }, h("zonos-text", { key: 'f8a7f4423c3e1fe85d99f7a4baadfd8ec92c5e91', textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
177
+ return (h(Host, { key: '44edb799473e427b08e17d6d20f08a028a3cc688', class: "zonos--address-form zonos--elements" }, h("div", { key: '99c2d5b58464bebd7bb3e5c2a4ac3aa04d80b47f', class: "zonos--title" }, h("zonos-text", { key: '5a86048c7d768b795db1416182e2b22458924601', textColor: "gray-700", type: "smallHeader" }, this.addressType === 'shipping'
76
178
  ? translate('Shipping')
77
- : translate('Billing'))), h("div", { key: '3989feba67adc4921dc27f4b245391c933065d78', class: "zonos--address-group" }, h("div", { key: '909ef4b8f44902a16334051fb8cde1edd4f87f8b', class: "zonos--contact" }, h("zonos-text", { key: '301eb71e15a331a7423d547486b668009ce19bd0', type: "label" }, translate('Contact')), h("zonos-input", { key: '473f22469d0628db079298abb02a18f908225350', class: "zonos--form-email", inputLabel: translate('Email'), inputValue: this.currentAddress.email, isDisabled: true }), h("div", { key: 'eaa32450d028bfd8a197a3b1172a1316d6080962', class: "zonos--name zonos--address-row" }, h("zonos-input", { key: '82b3b902539cd2eb67bddfccc9146f91f7061538', class: "zonos--form-first-name", inputLabel: translate('First name'), inputValue: firstName, isError: isTextContainsNonLatinChars(firstName), onInputChange: e => this.onInputChange({
179
+ : translate('Billing'))), h("div", { key: 'a907058d970cb6674b403f79c0946e36a0e61f69', class: "zonos--address-group" }, h("div", { key: 'fad2f71614c6963015f95e74e297c58a4adee95b', class: "zonos--contact" }, h("zonos-text", { key: '0c661050b1b95da56af1046fac39c7fa6de18685', type: "label" }, translate('Contact')), h("zonos-input", { key: '3e35a5f9d4bca373ef9403da0de53ea895aca61f', class: "zonos--form-email", inputLabel: translate('Email'), inputValue: this.currentAddress.email, isDisabled: true }), h("div", { key: '093cdcc771b4ade381a392a1023d9d037d4e3e35', class: "zonos--name zonos--address-row" }, h("zonos-input", { key: 'e9d957551070a855179b78da655beaf3b4e731e2', class: "zonos--form-first-name", inputLabel: translate('First name'), inputValue: firstName, isError: isTextContainsNonLatinChars(firstName), onInputChange: e => this.onInputChange({
78
180
  key: 'name',
79
181
  value: `${e.detail} ${lastName}`,
80
- }) }), h("zonos-input", { key: 'cf32104d4d575eb9d5843cf5d8701aebb02c4e3c', class: "zonos--form-last-name", inputLabel: translate('Last name'), inputValue: lastName, isError: isTextContainsNonLatinChars(lastName), onInputChange: e => this.onInputChange({
182
+ }) }), h("zonos-input", { key: '0b86805e872607d367446f5e6ef074974f9840c2', class: "zonos--form-last-name", inputLabel: translate('Last name'), inputValue: lastName, isError: isTextContainsNonLatinChars(lastName), onInputChange: e => this.onInputChange({
81
183
  key: 'name',
82
184
  value: `${firstName} ${e.detail}`,
83
- }) }))), h("div", { key: 'd570f7e1849bcc9a8e1bc13a15195bb5ee9bf8f2', class: "zonos--address" }, h("zonos-text", { key: 'dec7847247e97ffa3dde6d04a1ccd17347d9e8c1', type: "label" }, translate('Address')), h("zonos-input", { key: '595f540e7feb57dada3ebcf93202a75492ff447f', class: "zonos--form-country", inputLabel: translate('Country'), inputValue: country, isDisabled: true }), h("zonos-input", { key: 'c7fa3e7736ceee4c23195179f9e50b9cd43aa25a', class: "zonos--form-line1", inputLabel: translate('Address line 1'), inputValue: line1, isError: isTextContainsNonLatinChars(line1), onInputChange: e => this.onInputChange({ key: 'line1', value: e.detail }) }), h("zonos-input", { key: 'e455495f96667f7228a5ed51fc67d080df0b7991', class: "zonos--form-line2", inputLabel: translate('Address line 2'), inputValue: line2, isError: isTextContainsNonLatinChars(line2), onInputChange: e => this.onInputChange({ key: 'line2', value: e.detail }) }), h("div", { key: '5312af811975d9a2e2809896d51ce992317af54d', class: "zonos--address-row" }, h("zonos-input", { key: '49537f098a054787550266d6a7698e6fe102cad6', class: "zonos--form-city", inputLabel: translate('City'), inputValue: city, isError: isTextContainsNonLatinChars(city), onInputChange: e => this.onInputChange({ key: 'city', value: e.detail }) }), this.currentAddress.state && (h("zonos-input", { key: '06d1c8c2e21300c300ddfbdaa4abaffef006793d', class: "zonos--form-state", inputLabel: translate('State/Province'), inputValue: state, isError: isTextContainsNonLatinChars(state), onInputChange: e => this.onInputChange({ key: 'state', value: e.detail }) }))), h("zonos-input", { key: '94081e11a3184e86eef1add3eee392c3e3afb11a', class: "zonos--form-postal-code", inputLabel: translate('Postal code'), inputValue: postal_code, isError: isTextContainsNonLatinChars(postal_code), onInputChange: e => this.onInputChange({ key: 'postal_code', value: e.detail }) }), h("zonos-input", { key: '00ce7f0931179ff2c86e2da0fc82eed71cd6af19', class: "zonos--form-phone", inputLabel: translate('Phone number'), inputValue: phone, onInputChange: e => this.onInputChange({ key: 'phone', value: e.detail }) })))));
185
+ }) }))), h("div", { key: '6447f55e8d173d18cd46cba829527c4d487631a2', class: "zonos--address" }, h("zonos-text", { key: '18ef146cc44f658524c6535e851281b62249fa26', type: "label" }, translate('Address')), h("zonos-input", { key: '95cfb115c4304e8a142ab2e952fc8c4bfbe39e43', class: "zonos--form-country", inputLabel: translate('Country'), inputValue: country, isDisabled: true }), h("zonos-input", { key: 'e3774713ec0b0e861981aa9f2c62f6749125e174', class: "zonos--form-line1", inputLabel: translate('Address line 1'), inputValue: line1, isError: isTextContainsNonLatinChars(line1), onInputChange: e => this.onInputChange({ key: 'line1', value: e.detail }) }), h("zonos-input", { key: '0d1fce85ad42e42b266ad411d4e3a96e4b8b8bf3', class: "zonos--form-line2", inputLabel: translate('Address line 2'), inputValue: line2, isError: isTextContainsNonLatinChars(line2), onInputChange: e => this.onInputChange({ key: 'line2', value: e.detail }) }), h("div", { key: '5d5e740b711ff65a0366a6c4891f22684f32c74b', class: "zonos--address-row" }, h("zonos-input", { key: '8f124a91865c59096ba5c624ec229a3d1545c985', class: "zonos--form-city", inputLabel: translate('City'), inputValue: city, isError: isTextContainsNonLatinChars(city), onInputChange: e => this.onInputChange({ key: 'city', value: e.detail }) }), this.currentAddress.state && (h("zonos-input", { key: '50e852953ba88573929a200bce4c67fab2146245', class: "zonos--form-state", inputLabel: translate('State/Province'), inputValue: state, isError: isTextContainsNonLatinChars(state), onInputChange: e => this.onInputChange({ key: 'state', value: e.detail }) }))), h("zonos-input", { key: '74c17f1d1a77af3f90100a6832b2c8fe7bdca24e', class: "zonos--form-postal-code", inputLabel: translate('Postal code'), inputValue: postal_code, isError: isTextContainsNonLatinChars(postal_code), onInputChange: e => this.onInputChange({ key: 'postal_code', value: e.detail }) }), h("zonos-input", { key: '20775c4a944fe9305446898109637e5b38229a1d', class: "zonos--form-phone", inputLabel: translate('Phone number'), inputValue: phone, onInputChange: e => this.onInputChange({ key: 'phone', value: e.detail }) })))));
84
186
  }
85
187
  static get watchers() { return {
86
188
  "translatedAddress": ["watchCurrentAddress"]
@@ -88,7 +190,7 @@ const ZonosAddressForm = class {
88
190
  };
89
191
  ZonosAddressForm.style = ZonosAddressFormStyle0;
90
192
 
91
- const RemoveIcon$1 = `<svg color="var(--zonos-elements-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--zonos-elements-gray-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
193
+ const RemoveIcon = `<svg color="var(--zonos-elements-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--zonos-elements-gray-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>`;
92
194
 
93
195
  const zonosAddressSuggestionsCss = ":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:relative}:host .wrapper{position:absolute;margin-top:4px;top:100%;left:0;right:0;z-index:3;max-height:300px;overflow-y:auto;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));-webkit-box-shadow:var(--zonos-elements-shadow-select-active);box-shadow:var(--zonos-elements-shadow-select-active);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;list-style:none;padding:0;background-color:var(--zonos-elements-surface-color)}:host .wrapper .option{padding:8px;background-color:var(--zonos-elements-surface-color);outline:none;border:none;text-align:left}:host .wrapper .option.last-hovered{background-color:var(--zonos-elements-gray-100)}:host .wrapper .option .highlight{font-weight:600;color:var(--zonos-elements-gray-1000)}:host .wrapper>.powered-by{padding:8px;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center}:host .wrapper>.powered-by .powered-by-container{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;gap:5px;-ms-flex:1;flex:1}:host .wrapper>.suggestion{cursor:pointer}:host .wrapper>.suggestion:hover{background-color:var(--zonos-elements-gray-100)}";
94
196
  const ZonosAddressSuggestionsStyle0 = zonosAddressSuggestionsCss;
@@ -166,9 +268,9 @@ const ZonosAddressSuggestions = class {
166
268
  return segments;
167
269
  }
168
270
  render() {
169
- return (h(Host, { key: '93cce2d783f3b0eba378027d2450d13451e6ce18', class: "zonos--address-suggestions", role: "group", style: {
271
+ return (h(Host, { key: '20e095515d18016bd1f538bd345ed58aafe8518f', class: "zonos--address-suggestions", role: "group", style: {
170
272
  '--zonos--border-radius': getBorderRadius(),
171
- } }, h("ul", { key: 'e577d8dea6fb9a225f8361e5ba48601a74b8614d', "aria-label": "Suggestions", class: "wrapper", role: "listbox" }, !!this.localSuggestions.length && (h("li", { key: '8f4c74b030f50ed03133a443e4b9a41869c18571', "aria-selected": false, class: "powered-by option", role: "option" }, h("div", { key: '0288a70a89c25ce227e918ad91db0b77efa42a82', class: "powered-by-container" }, h("zonos-text", { key: '2d2fe2711d2b72a4077a417ed37d9b6897184525', type: "caption" }, "Suggestions powered by"), h("zonos-text", { key: 'a7ef3f738fc67a03fa2c935c128666945ad838a0', type: "semiBoldLabel" }, "Google")), h("zonos-button", { key: 'ebe5ccc2e0315867c4dbe3c030cf4e44312d691c', "aria-label": "Clear suggestions", icon: h("zonos-icon", { content: RemoveIcon$1 }), noBackground: true, onClick: () => {
273
+ } }, h("ul", { key: 'f43e0820d29fc5ef96ab42402e370dc6ce381e66', "aria-label": "Suggestions", class: "wrapper", role: "listbox" }, !!this.localSuggestions.length && (h("li", { key: 'd8ff4f7b53ea5fac8f42f1c13b2255ca2ea5d5e8', "aria-selected": false, class: "powered-by option", role: "option" }, h("div", { key: '2431de3e4e5241e5d74f552051a5d3d4954624a5', class: "powered-by-container" }, h("zonos-text", { key: '48de6d435ffef45f60ebb4ef6c4b2eaf5bdee821', type: "caption" }, "Suggestions powered by"), h("zonos-text", { key: 'b0e8f2986d4f85daa2fd53b7ea812d296d28a164', type: "semiBoldLabel" }, "Google")), h("zonos-button", { key: 'e62245b99bcdc192a4ee98511c8a4a0efad6ea92', "aria-label": "Clear suggestions", icon: h("zonos-icon", { content: RemoveIcon }), noBackground: true, onClick: () => {
172
274
  this.localSuggestions = [];
173
275
  } }))), this.localSuggestions.map(suggestion => (
174
276
  // eslint-disable-next-line jsx-a11y/click-events-have-key-events
@@ -351,7 +453,7 @@ const ZonosAddressUpdateDialog = class {
351
453
  return (h(Host, { key: '655845cef04f4af526b1a1c4e49243c4f2b4c7f6', class: classes([
352
454
  'zonos--address-update-dialog zonos--elements',
353
455
  this.isMobile && 'mobile',
354
- ]) }, h("zonos-dialog", { key: 'eab429bb78ce6f05ba463d8748d7edd5499402fa', isLoading: this.dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeUpdateDialog.emit(), open: this.dialogOpen, width: "568px" }, h("div", { key: '08f0400e62addfcaffd91bf5200999d29bbd2da9', class: "zonos--body" }, h("div", { key: '8699df5e2f823e19066fbb552ba2a66c127c05e9', class: "zonos--dialog-header" }, h("div", { key: '92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3', class: "zonos--dialog-title" }, h("zonos-text", { key: 'aaac3375526bddb319ce7c8f49bde30da7210264', type: "title" }, translate('Update your address')), h("zonos-button", { key: '474cc2421cd3150daa46bfe215da6ae7df9c6087', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon$2 }), noBackground: true, onClick: () => this.closeUpdateDialogHandler(), title: "Close checkout dialog" })), h("zonos-text", { key: '6d019250cce57e8b30dd790a184df7273bdb234f' }, translate('To ensure delivery all address details must be in Latin characters.'))), h("div", { key: '80ee681844f4f4f43fce69d977b634b1fbc3d5f5', class: "zonos--group" }, h("zonos-text", { key: '940e510eceec156a74f32de84cf58ffebd796435', class: "zonos--what-you-entered", type: "semiBoldLabel" }, translate('What you entered')), h("div", { key: 'f626127f5c399c29ab1022deb66aaee8f8a49601', class: "zonos--address-display-group" }, h("zonos-address-display", { key: '9dfcba1037325c3a1f9e82b8e4797e7872dd7e3f', addressType: "shipping", currentAddress: shipping }), billing && (h("zonos-address-display", { key: 'fee8ae2c6786d735133c2a0a42f3e3d40d7f9ea9', addressType: "billing", currentAddress: billing }))), h("div", { key: '5a82195018ff8cdfd1126f4424062a26c25ee757', class: "zonos--address-form-section" }, h("zonos-text", { key: 'f694dfad166697e4c034cea51057133b69b1c144', type: "semiBoldLabel" }, translate('Translated address')), h("zonos-address-form", { key: '4a99c841cf4800de43c612cce3d56d956d02c22f', addressType: "shipping", class: "zonos--shipping-address-form", currentAddress: shipping, onAddressChange: e => {
456
+ ]) }, h("zonos-dialog", { key: 'eab429bb78ce6f05ba463d8748d7edd5499402fa', isLoading: this.dialogLoading, mobile: this.isMobile, noBodyPadding: true, noBorder: true, noClickOutside: true, noCloseButton: true, onCloseDialog: () => this.closeUpdateDialog.emit(), open: this.dialogOpen, width: "568px" }, h("div", { key: '08f0400e62addfcaffd91bf5200999d29bbd2da9', class: "zonos--body" }, h("div", { key: '8699df5e2f823e19066fbb552ba2a66c127c05e9', class: "zonos--dialog-header" }, h("div", { key: '92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3', class: "zonos--dialog-title" }, h("zonos-text", { key: 'aaac3375526bddb319ce7c8f49bde30da7210264', type: "title" }, translate('Update your address')), h("zonos-button", { key: '474cc2421cd3150daa46bfe215da6ae7df9c6087', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close checkout dialog", content: RemoveIcon$1 }), noBackground: true, onClick: () => this.closeUpdateDialogHandler(), title: "Close checkout dialog" })), h("zonos-text", { key: '6d019250cce57e8b30dd790a184df7273bdb234f' }, translate('To ensure delivery all address details must be in Latin characters.'))), h("div", { key: '80ee681844f4f4f43fce69d977b634b1fbc3d5f5', class: "zonos--group" }, h("zonos-text", { key: '940e510eceec156a74f32de84cf58ffebd796435', class: "zonos--what-you-entered", type: "semiBoldLabel" }, translate('What you entered')), h("div", { key: 'f626127f5c399c29ab1022deb66aaee8f8a49601', class: "zonos--address-display-group" }, h("zonos-address-display", { key: '9dfcba1037325c3a1f9e82b8e4797e7872dd7e3f', addressType: "shipping", currentAddress: shipping }), billing && (h("zonos-address-display", { key: 'fee8ae2c6786d735133c2a0a42f3e3d40d7f9ea9', addressType: "billing", currentAddress: billing }))), h("div", { key: '5a82195018ff8cdfd1126f4424062a26c25ee757', class: "zonos--address-form-section" }, h("zonos-text", { key: 'f694dfad166697e4c034cea51057133b69b1c144', type: "semiBoldLabel" }, translate('Translated address')), h("zonos-address-form", { key: '4a99c841cf4800de43c612cce3d56d956d02c22f', addressType: "shipping", class: "zonos--shipping-address-form", currentAddress: shipping, onAddressChange: e => {
355
457
  const address = e.detail;
356
458
  this.translatedShippingAddressState =
357
459
  this.buildTranslateAddressState({
@@ -394,6 +496,30 @@ const isValidZip = ({ countryFields, zip, }) => {
394
496
  return countryFields.zipRequired && !!zip;
395
497
  };
396
498
 
499
+ const hasCountries = (countries) => !!countries && Object.keys(countries).length > 0;
500
+ /**
501
+ * Builds the country options for an address form's country dropdown.
502
+ *
503
+ * Shipping addresses are restricted to the merchant's shipping zone, since we
504
+ * can only fulfill orders to those countries. Billing addresses are not — a
505
+ * shopper's card can be billed to any country, so restricting the billing
506
+ * country prevents them from checking out at all (05CHECK-915).
507
+ *
508
+ * When the full country list is unavailable we fall back to the shipping zone
509
+ * so the dropdown is never empty.
510
+ */
511
+ const getAddressCountryOptions = ({ allCountries, shippingZoneCountries, type, }) => {
512
+ const countries = type === 'billing' && hasCountries(allCountries)
513
+ ? allCountries
514
+ : shippingZoneCountries;
515
+ return Object.values(countries || {})
516
+ .map(country => ({
517
+ label: country.displayName,
518
+ value: country.code,
519
+ }))
520
+ .sort((a, b) => a.label.localeCompare(b.label));
521
+ };
522
+
397
523
  const mergeAddress = ({ addresses, delimiter = ' ', }) => {
398
524
  // Remove duplicate addresses
399
525
  const addressSet = new Set(addresses.filter(Boolean));
@@ -458,14 +584,6 @@ const ZonosAddress = class {
458
584
  * Whether to start google place suggestions
459
585
  */
460
586
  this.startGooglePlaceSuggestions = false;
461
- /**
462
- * List of countries to show in the address element
463
- */
464
- this.shipToCountries = null;
465
- /**
466
- * Shipping zones from localization
467
- */
468
- this.shippingZones = null;
469
587
  this.city = '';
470
588
  this.country = '';
471
589
  this.firstName = '';
@@ -505,6 +623,14 @@ const ZonosAddress = class {
505
623
  * Google autocomplete overlay is conflict with our button, this is to adjust z index of the autocomplete
506
624
  */
507
625
  this.isAutoCompleteAdjusted = false;
626
+ /**
627
+ * Memoized country options, keyed on the store references they derive from.
628
+ * `render()` runs on every keystroke, and rebuilding the list each time would
629
+ * re-sort ~244 countries and hand `zonos-stripe-select` a new array identity,
630
+ * re-rendering it needlessly. `@stencil/store` replaces these references
631
+ * wholesale rather than mutating them, so reference equality is a safe key.
632
+ */
633
+ this.countryOptionsCache = null;
508
634
  // Create a single throttled instance that persists
509
635
  this.throttledGetAddressSuggestions = throttle_1(() => {
510
636
  if (zonosStore.checkoutAddressService) {
@@ -656,6 +782,28 @@ const ZonosAddress = class {
656
782
  this.onStoreCheckoutSessionIdChangedSubscription = storageStoreOnChange('checkoutSessionId', onCheckoutSessionIdChange);
657
783
  };
658
784
  }
785
+ getCountryOptions() {
786
+ const { allCountries, shippingZoneCountries } = localizationStore;
787
+ const cache = this.countryOptionsCache;
788
+ if (cache &&
789
+ cache.allCountries === allCountries &&
790
+ cache.shippingZoneCountries === shippingZoneCountries &&
791
+ cache.type === this.type) {
792
+ return cache.options;
793
+ }
794
+ const options = getAddressCountryOptions({
795
+ allCountries,
796
+ shippingZoneCountries,
797
+ type: this.type,
798
+ });
799
+ this.countryOptionsCache = {
800
+ allCountries,
801
+ options,
802
+ shippingZoneCountries,
803
+ type: this.type,
804
+ };
805
+ return options;
806
+ }
659
807
  getStripeAddressInstance() {
660
808
  if (this.type === 'billing') {
661
809
  return {
@@ -1082,24 +1230,19 @@ const ZonosAddress = class {
1082
1230
  this.initAddressSuggestions();
1083
1231
  this.initDefaultCustomAddressForm();
1084
1232
  }
1085
- shippingZonesChanged() {
1086
- this.shippingZones = localizationStore.shippingZoneCountries;
1087
- this.shipToCountries = Object.values(this.shippingZones || {})
1088
- .map(country => ({
1089
- label: country.displayName,
1090
- value: country.code,
1091
- }))
1092
- .sort((a, b) => {
1093
- return a.label.localeCompare(b.label);
1094
- });
1095
- }
1096
1233
  renderCustomAddressForm() {
1097
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
1098
- const _t = this.getCustomAddressErrors(), { showError } = _t, customAddressErrors = __rest(_t, ["showError"]);
1234
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
1235
+ const _s = this.getCustomAddressErrors(), { showError } = _s, customAddressErrors = __rest(_s, ["showError"]);
1099
1236
  const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
1100
1237
  const countryCode = stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country;
1101
- const firstCountry = (_a = this.shipToCountries) === null || _a === void 0 ? void 0 : _a[0];
1102
- const stateOptions = Object.entries(((_b = this.countryField) === null || _b === void 0 ? void 0 : _b.regions) || {})
1238
+ /**
1239
+ * Billing addresses are not limited to the shipping zone: a shopper's card
1240
+ * can be billed to any country, so restricting it would block them from
1241
+ * checking out entirely (05CHECK-915).
1242
+ */
1243
+ const countryOptions = this.getCountryOptions();
1244
+ const firstCountry = countryOptions[0];
1245
+ const stateOptions = Object.entries(((_a = this.countryField) === null || _a === void 0 ? void 0 : _a.regions) || {})
1103
1246
  .map(([label, region]) => ({
1104
1247
  label,
1105
1248
  value: region.interpayCode,
@@ -1133,7 +1276,7 @@ const ZonosAddress = class {
1133
1276
  * Therefore, we must update the value after validation to ensure correct error state
1134
1277
  */
1135
1278
  this.lastName = event.detail;
1136
- }, required: true }), h("zonos-stripe-select", { "aria-required": "true", autoComplete: "shipping country", class: "zonos--custom-address-form-input", name: `${this.type}-country`, onSelectChange: (event) => {
1279
+ }, required: true }), h("zonos-stripe-select", { "aria-required": "true", autoComplete: `${this.type} country`, class: "zonos--custom-address-form-input", name: `${this.type}-country`, onSelectChange: (event) => {
1137
1280
  this.countryChanged(event.detail);
1138
1281
  // revalidate the postal code since with empty value so it would reset the customAddressErrors
1139
1282
  this.validate({
@@ -1162,9 +1305,9 @@ const ZonosAddress = class {
1162
1305
  this.city = '';
1163
1306
  this.state = '';
1164
1307
  this.postalCode = '';
1165
- }, options: this.shipToCountries || [], required: true, selectLabel: translate('Country'), selectedValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
1308
+ }, options: countryOptions, required: true, selectLabel: translate('Country'), selectedValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
1166
1309
  localizationStore.selectedCountryCode ||
1167
- (firstCountry === null || firstCountry === void 0 ? void 0 : firstCountry.value), title: `${this.type} country` }), h("div", { class: "zonos--custom-address-form-line1-wrapper" }, h("zonos-stripe-input", { "aria-autocomplete": "list", "aria-controls": "autocomplete-search", "aria-required": "true", autoComplete: "shipping address-line1", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.line1 : undefined, inputLabel: translate('Address line 1'), inputValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.line1, name: "address-line1", onInputChange: (event) => {
1310
+ (firstCountry === null || firstCountry === void 0 ? void 0 : firstCountry.value), title: `${this.type} country` }), h("div", { class: "zonos--custom-address-form-line1-wrapper" }, h("zonos-stripe-input", { "aria-autocomplete": "list", "aria-controls": "autocomplete-search", "aria-required": "true", autoComplete: `${this.type} address-line1`, class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.line1 : undefined, inputLabel: translate('Address line 1'), inputValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.line1, name: "address-line1", onInputChange: (event) => {
1168
1311
  this.validate({
1169
1312
  type: this.type,
1170
1313
  value: event.detail,
@@ -1195,9 +1338,9 @@ const ZonosAddress = class {
1195
1338
  }, suggestions: this.addressSuggestions, type: this.type })), h("div", { "aria-label": "Additional address details", class: classes([
1196
1339
  'zonos--custom-address-form-additional-fields',
1197
1340
  countryCode && this.isAddressLine1Entered ? 'zonos--show' : '',
1198
- ]), role: "group" }, h("zonos-stripe-input", { "aria-required": "false", autoComplete: "shipping address-line2", class: "zonos--custom-address-form-input", inputLabel: translate(((_c = this.countryField) === null || _c === void 0 ? void 0 : _c.address2Label) || 'Address line 2'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.line2) || '', onInputChange: (event) => {
1341
+ ]), role: "group" }, h("zonos-stripe-input", { "aria-required": "false", autoComplete: `${this.type} address-line2`, class: "zonos--custom-address-form-input", inputLabel: translate(((_b = this.countryField) === null || _b === void 0 ? void 0 : _b.address2Label) || 'Address line 2'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.line2) || '', onInputChange: (event) => {
1199
1342
  this.line2 = event.detail;
1200
- } }), ((_d = this.countryField) === null || _d === void 0 ? void 0 : _d.cityShow) && (h("zonos-stripe-input", { "aria-required": ((_e = this.countryField) === null || _e === void 0 ? void 0 : _e.cityRequired) ? 'true' : 'false', autoComplete: "shipping address-level2", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.city : undefined, inputLabel: translate(((_f = this.countryField) === null || _f === void 0 ? void 0 : _f.cityLabel) || 'City'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.city) || '', name: "locality", onInputChange: (event) => {
1343
+ } }), ((_c = this.countryField) === null || _c === void 0 ? void 0 : _c.cityShow) && (h("zonos-stripe-input", { "aria-required": ((_d = this.countryField) === null || _d === void 0 ? void 0 : _d.cityRequired) ? 'true' : 'false', autoComplete: `${this.type} address-level2`, class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.city : undefined, inputLabel: translate(((_e = this.countryField) === null || _e === void 0 ? void 0 : _e.cityLabel) || 'City'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.city) || '', name: "locality", onInputChange: (event) => {
1201
1344
  this.validate({
1202
1345
  type: this.type,
1203
1346
  value: event.detail,
@@ -1211,7 +1354,7 @@ const ZonosAddress = class {
1211
1354
  * Therefore, we must update the value after validation to ensure correct error state
1212
1355
  */
1213
1356
  this.city = event.detail;
1214
- }, required: (_g = this.countryField) === null || _g === void 0 ? void 0 : _g.cityRequired })), h("div", { class: "zonos--custom-address-form-state-zip-wrapper" }, ((_h = this.countryField) === null || _h === void 0 ? void 0 : _h.stateShow) && (h("zonos-stripe-select", { "aria-required": ((_j = this.countryField) === null || _j === void 0 ? void 0 : _j.stateRequired) ? 'true' : 'false', autoComplete: "shipping address-level1", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.state : undefined, isError: showError && !!customAddressErrors.state, name: `${this.type}-state`, onSelectChange: (event) => {
1357
+ }, required: (_f = this.countryField) === null || _f === void 0 ? void 0 : _f.cityRequired })), h("div", { class: "zonos--custom-address-form-state-zip-wrapper" }, ((_g = this.countryField) === null || _g === void 0 ? void 0 : _g.stateShow) && (h("zonos-stripe-select", { "aria-required": ((_h = this.countryField) === null || _h === void 0 ? void 0 : _h.stateRequired) ? 'true' : 'false', autoComplete: `${this.type} address-level1`, class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.state : undefined, isError: showError && !!customAddressErrors.state, name: `${this.type}-state`, onSelectChange: (event) => {
1215
1358
  this.validate({
1216
1359
  type: this.type,
1217
1360
  value: event.detail,
@@ -1225,9 +1368,9 @@ const ZonosAddress = class {
1225
1368
  * Therefore, we must update the value after validation to ensure correct error state
1226
1369
  */
1227
1370
  this.state = event.detail;
1228
- }, options: stateOptions, required: (_k = this.countryField) === null || _k === void 0 ? void 0 : _k.stateRequired, selectLabel: translate(((_l = this.countryField) === null || _l === void 0 ? void 0 : _l.stateLabel) || 'State'), selectedValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.state, title: `${this.type} state` })), ((_m = this.countryField) === null || _m === void 0 ? void 0 : _m.zipShow) && (h("zonos-stripe-input", { "aria-describedby": ((_o = this.countryField) === null || _o === void 0 ? void 0 : _o.zipFormat)
1371
+ }, options: stateOptions, required: (_j = this.countryField) === null || _j === void 0 ? void 0 : _j.stateRequired, selectLabel: translate(((_k = this.countryField) === null || _k === void 0 ? void 0 : _k.stateLabel) || 'State'), selectedValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.state, title: `${this.type} state` })), ((_l = this.countryField) === null || _l === void 0 ? void 0 : _l.zipShow) && (h("zonos-stripe-input", { "aria-describedby": ((_m = this.countryField) === null || _m === void 0 ? void 0 : _m.zipFormat)
1229
1372
  ? `zip-format-${this.type}`
1230
- : undefined, "aria-required": ((_p = this.countryField) === null || _p === void 0 ? void 0 : _p.zipRequired) ? 'true' : 'false', autoComplete: "shipping postal-code", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.postalCode : undefined, inputLabel: translate(((_q = this.countryField) === null || _q === void 0 ? void 0 : _q.zipLabel) || 'Zip'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.postal_code) || '', name: "postalCode", onInputChange: (event) => {
1373
+ : undefined, "aria-required": ((_o = this.countryField) === null || _o === void 0 ? void 0 : _o.zipRequired) ? 'true' : 'false', autoComplete: `${this.type} postal-code`, class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.postalCode : undefined, inputLabel: translate(((_p = this.countryField) === null || _p === void 0 ? void 0 : _p.zipLabel) || 'Zip'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.postal_code) || '', name: "postalCode", onInputChange: (event) => {
1231
1374
  this.validate({
1232
1375
  type: this.type,
1233
1376
  value: event.detail,
@@ -1241,7 +1384,7 @@ const ZonosAddress = class {
1241
1384
  * Therefore, we must update the value after validation to ensure correct error state
1242
1385
  */
1243
1386
  this.postalCode = event.detail;
1244
- }, required: (_r = this.countryField) === null || _r === void 0 ? void 0 : _r.zipRequired, title: `${this.type} zip code` }))), h("zonos-stripe-phone-input", { autoComplete: "shipping tel", class: "zonos--custom-address-form-input", countryCode: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country, countryOptions: (_s = zonosStore.genericSettings) === null || _s === void 0 ? void 0 : _s.countryFields, error: showError ? customAddressErrors.phone : undefined, inputLabel: translate('Phone number'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone) || '', onInputValueChange: event => {
1387
+ }, required: (_q = this.countryField) === null || _q === void 0 ? void 0 : _q.zipRequired, title: `${this.type} zip code` }))), h("zonos-stripe-phone-input", { autoComplete: `${this.type} tel`, class: "zonos--custom-address-form-input", countryCode: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country, countryOptions: (_r = zonosStore.genericSettings) === null || _r === void 0 ? void 0 : _r.countryFields, error: showError ? customAddressErrors.phone : undefined, inputLabel: translate('Phone number'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone) || '', onInputValueChange: event => {
1245
1388
  const { isEmpty, phoneNumber, valid, wrongFormat } = event.detail;
1246
1389
  // Validate the phone number
1247
1390
  this.validate({
@@ -1282,14 +1425,6 @@ const ZonosAddress = class {
1282
1425
  }
1283
1426
  componentDidLoad() {
1284
1427
  const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
1285
- this.shipToCountries = Object.values(localizationStore.shippingZoneCountries || {})
1286
- .map(country => ({
1287
- label: country.displayName,
1288
- value: country.code,
1289
- }))
1290
- .sort((a, b) => {
1291
- return a.label.localeCompare(b.label);
1292
- });
1293
1428
  this.isDirtyAddress =
1294
1429
  !!stripeAddressEventData &&
1295
1430
  stripeAddressEventData.value.address.line1.length > 0;
@@ -1302,7 +1437,6 @@ const ZonosAddress = class {
1302
1437
  }
1303
1438
  render() {
1304
1439
  var _a;
1305
- this.shippingZones = localizationStore.shippingZoneCountries;
1306
1440
  this.addressService = zonosStore.checkoutAddressService;
1307
1441
  if ((_a = stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.complete) {
1308
1442
  this.isAddressFilled = true;
@@ -1312,10 +1446,10 @@ const ZonosAddress = class {
1312
1446
  this.country = localizationStore.selectedCountryCode;
1313
1447
  }
1314
1448
  // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
1315
- return (h(Host, { key: 'dae45101b0b661fb0f392507cbc2642c65e72499', class: classes([
1449
+ return (h(Host, { key: '5baf00df63a693613f493a84c906898080dcbfa2', class: classes([
1316
1450
  'zonos--address zonos--elements',
1317
1451
  `zonos--${this.type}-address`,
1318
- ]) }, h("zonos-text", { key: '73081aa1f08f5617bc10fcd57f057abd3efd0c35', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("slot", { key: '4cfd89cca3254564b51f45a4a29d1f8a13bf03d1', name: "below-title" }), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderShortAddressCodeInput(), this.renderCustomAddressForm()));
1452
+ ]) }, h("zonos-text", { key: 'f5079e30a1eadceffaac7fef5aa5296b1f9f480b', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), h("slot", { key: 'fcbd1bac9e06e91c9e4a229d63852df9fea08c58', name: "below-title" }), this.renderCompanyNameInput(), this.renderTaxIdInput(), this.renderShortAddressCodeInput(), this.renderCustomAddressForm()));
1319
1453
  }
1320
1454
  get el() { return getElement(this); }
1321
1455
  static get watchers() { return {
@@ -1331,121 +1465,11 @@ const ZonosAddress = class {
1331
1465
  "phone": ["formFieldsChanged"],
1332
1466
  "postalCode": ["formFieldsChanged"],
1333
1467
  "state": ["formFieldsChanged"],
1334
- "addressService": ["shouldEnabledCustomAddressChanged"],
1335
- "shippingZones": ["shippingZonesChanged"]
1468
+ "addressService": ["shouldEnabledCustomAddressChanged"]
1336
1469
  }; }
1337
1470
  };
1338
1471
  ZonosAddress.style = ZonosCustomAddressStyle0;
1339
1472
 
1340
- const RemoveIcon = `<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>`;
1341
-
1342
- const zonosDialogCss = ":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--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--loading{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:4px;z-index:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}:host .zonos--loading-text,:host .zonos--loading-title{max-width:100%;padding:0 32px;text-align:center}:host .zonos--dialog-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);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--zonos--min-height, auto);height:var(--zonos--height, auto);width:var(--zonos--width, auto);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));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 .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";
1343
- const ZonosDialogStyle0 = zonosDialogCss;
1344
-
1345
- const ZonosDialog = class {
1346
- constructor(hostRef) {
1347
- registerInstance(this, hostRef);
1348
- this.closeDialog = createEvent(this, "closeDialog", 3);
1349
- /**
1350
- * Whether or not the dialog is open
1351
- * @default false
1352
- */
1353
- this.open = false;
1354
- /**
1355
- * The header text for the dialog
1356
- */
1357
- this.headerText = '';
1358
- /**
1359
- * The width of the dialog
1360
- * @default 460px
1361
- */
1362
- this.width = '460px';
1363
- /**
1364
- * Whether or not to show the header
1365
- * @default false
1366
- */
1367
- this.noHeader = false;
1368
- /**
1369
- * Whether or not to have body padding
1370
- * @default false
1371
- */
1372
- this.noBodyPadding = false;
1373
- /**
1374
- * Whether or not to have body padding
1375
- * @default false
1376
- */
1377
- this.noBorder = false;
1378
- /**
1379
- * Whether or not to show the close button
1380
- * @default false
1381
- */
1382
- this.noCloseButton = false;
1383
- /**
1384
- * Whether or not to close the dialog when clicking outside of it
1385
- * @default false
1386
- */
1387
- this.noClickOutside = false;
1388
- /**
1389
- * Flag to determine if the checkout is on mobile
1390
- */
1391
- this.mobile = false;
1392
- /**
1393
- * Load loading spinner for the dialog or not
1394
- */
1395
- this.isLoading = true;
1396
- this.isMobile = false;
1397
- this.isMobileMode = () => {
1398
- return this.mobile || window.innerWidth <= 768;
1399
- };
1400
- this.closeButtonHandler = () => {
1401
- // Only do the action if the dialog is open
1402
- if (!this.open) {
1403
- return;
1404
- }
1405
- this.closeDialog.emit();
1406
- };
1407
- this.clickOutsideDialogHandler = (event) => {
1408
- if (event.target === event.currentTarget && !this.noClickOutside) {
1409
- this.closeDialog.emit();
1410
- }
1411
- };
1412
- }
1413
- handleWindowResize() {
1414
- this.isMobile = this.isMobileMode();
1415
- }
1416
- handleKeyDown(ev) {
1417
- if (ev.key === 'Escape') {
1418
- this.closeButtonHandler();
1419
- }
1420
- }
1421
- componentDidLoad() {
1422
- this.isMobile = this.isMobileMode();
1423
- }
1424
- render() {
1425
- const borderStyle = getBorderRadius({
1426
- overrideBorderStyle: this.borderStyle,
1427
- });
1428
- return (h(Host, { key: '75ec5025b26d1c68daa95198bfe4defa9b4fccbb', class: classes([
1429
- 'zonos--elements',
1430
- this.open && 'open',
1431
- this.isLoading && 'is-loading',
1432
- this.noBorder && 'no-border',
1433
- this.isMobile && 'mobile',
1434
- ]), style: {
1435
- '--zonos--border-radius': borderStyle,
1436
- '--zonos--font-family': zonosStoreFontFamily(),
1437
- '--zonos--height': this.height || 'initial',
1438
- '--zonos--min-height': this.minHeight || '500px',
1439
- '--zonos--width': this.width,
1440
- } }, h("div", { key: '5d10176ce2b772fb8fd29f43ff45eb8ec0e4f891', class: "zonos--backdrop" }), h("div", { key: '2aa211aebf328b30d69cc32030964c68d9114380', class: "zonos--dialog-layout", inert: !this.open, onClick: this.clickOutsideDialogHandler }, h("div", { key: 'ae077f398158ca708065bf3f2cc60c36730e16df', class: "zonos--dialog" }, this.isLoading && (h("div", { key: 'b11ef43cb4a663495bfd5dfe636df98fb692f2e3', class: "zonos--loading" }, h("zonos-spinner", { key: 'df7b43c923a59ab16d56c56034f19e2ebf367c68', size: 30 }), this.loadingTitle && (h("zonos-text", { key: 'c2a9c49f41272ae535a2dfc3f6c97d91552729a2', class: "zonos--loading-title", size: "l", weight: 700 }, this.loadingTitle)), this.loadingText && (h("zonos-text", { key: 'c5a4be389ec0c5c8b9e7b126d69f39b334bd9c7c', class: "zonos--loading-text" }, this.loadingText)))), (this.headerText || !this.noCloseButton) && (h("div", { key: '21884f1a119c2b1d241b746ae27f9ebe68795b94', class: "zonos--header" }, this.headerText && (h("h3", { key: '77036606a70a57f250facdd1b95726c35807c151', class: "zonos--header-text" }, this.headerText)), !this.noCloseButton && (h("zonos-button", { key: '93eafa70b68ebbc0be89b6cec54aadba9bdb91ef', class: "zonos--close-button", icon: h("zonos-icon", { "aria-label": "Close dialog", content: RemoveIcon }), noBackground: true, onClick: this.closeButtonHandler, title: "Close dialog", variant: "subtle" })))), h("div", { key: '182ed04b1a14981aa5b679da8a1a556fcc413137', class: classes([
1441
- 'zonos--body',
1442
- this.noBodyPadding && 'zonos--no-body-padding',
1443
- ]) }, h("slot", { key: '65ad39c50b318b39e585301de2aeea6ef61db487' })), h("slot", { key: 'a60bb6eeee719852350584d6ff983d699f6ae84e', name: "dialog-footer" })))));
1444
- }
1445
- static get assetsDirs() { return ["assets"]; }
1446
- };
1447
- ZonosDialog.style = ZonosDialogStyle0;
1448
-
1449
1473
  // This file is a workaround for a bug in web browsers' "native"
1450
1474
  // ES6 importing system which is uncapable of importing "*.json" files.
1451
1475
  // https://github.com/catamphetamine/libphonenumber-js/issues/239
@@ -7339,6 +7363,15 @@ const ZonosStripePhoneInput = class {
7339
7363
  this.updatePhoneFormatter();
7340
7364
  };
7341
7365
  }
7366
+ onCountryCodeChange() {
7367
+ /**
7368
+ * Re-derive the dial code when the address country changes, otherwise a
7369
+ * shopper who changes country keeps the previous country's dial code — for
7370
+ * example a US billing address on a Mexico shipment would send a US phone
7371
+ * number prefixed with +52 (05CHECK-915).
7372
+ */
7373
+ this.initPhoneNumberValue();
7374
+ }
7342
7375
  onCountryOptionsChange() {
7343
7376
  // Re-initialize the phone number value when the country options change
7344
7377
  this.initPhoneNumberValue();
@@ -7418,27 +7451,28 @@ const ZonosStripePhoneInput = class {
7418
7451
  .filter(Boolean)
7419
7452
  .sort((a, b) => a.displayName.localeCompare(b.displayName))
7420
7453
  : [];
7421
- return (h(Host, { key: 'e1bde9efe262f4605448b6ae6f9e18070090e6c8', class: classes([
7454
+ return (h(Host, { key: '14478c1db0acc4651d9433f71fefa8bd18b28a61', class: classes([
7422
7455
  'zonos--phone-input zonos--elements',
7423
7456
  isDark && 'dark',
7424
- ]), "data-theme": isDark ? 'DARK' : 'LIGHT', style: Object.assign({ '--zonos--border-radius': getBorderRadius(), '--zonos--font-family': zonosStoreFontFamily(), '--zonos--font-size': `${fontSize}px`, '--zonos--primary-color': secondaryColor }, (this.minWidth ? { '--zonos--min-width': this.minWidth } : {})) }, h("div", { key: '17b929a5e37d86964c23f2954bf1aed3ca3e0b4f', class: classes([
7457
+ ]), "data-theme": isDark ? 'DARK' : 'LIGHT', style: Object.assign({ '--zonos--border-radius': getBorderRadius(), '--zonos--font-family': zonosStoreFontFamily(), '--zonos--font-size': `${fontSize}px`, '--zonos--primary-color': secondaryColor }, (this.minWidth ? { '--zonos--min-width': this.minWidth } : {})) }, h("div", { key: 'cdc9f75fa9a8fd81ab565614729d33b3b54b1ba9', class: classes([
7425
7458
  'zonos--label-wrapper',
7426
7459
  this.disabled && 'disabled',
7427
7460
  this.isFocused && 'focused',
7428
7461
  hasContent && 'has-content',
7429
7462
  this.error && 'has-error',
7430
7463
  this.inputLabel && 'has-label',
7431
- ]) }, h("select", { key: '75f827c7fa3bec95a441d75b04f815736f63d075', class: "zonos--select", disabled: this.disabled, onBlur: this.handleBlur, onChange: this.handleCountryChange, onFocus: this.handleFocus }, countryOptionsList.map(option => {
7464
+ ]) }, h("select", { key: 'a34d728be2b100874a2fb2a91e12b77988602b3a', class: "zonos--select", disabled: this.disabled, onBlur: this.handleBlur, onChange: this.handleCountryChange, onFocus: this.handleFocus }, countryOptionsList.map(option => {
7432
7465
  var _a;
7433
7466
  return (h("option", { key: option.countryCode, selected: option.countryCode === ((_a = this.selectedCountry) === null || _a === void 0 ? void 0 : _a.countryCode), value: option.countryCode }, option.displayName, " (+", option.phoneCode, ")"));
7434
- })), h("div", { key: '7299389121bb37f5444c8feecc349fc7663fd645', class: "zonos--input-group" }, h("div", { key: 'ffd81d520f2ffeeb0473606ffe529704d0539999', class: "zonos--select-wrapper" }, h("div", { key: '66a8c7b1fc41c8ced6ebe2b5d87d93d3fb34283a', class: "zonos--country-select" }, h("div", { key: 'e938804c0e0aa9e52810b8d07cb0d7948c451eb5', class: "zonos--country-select-content" }, this.selectedCountry && (h("div", { key: '1883e18a2318bf871e061c744a095dd8e5a905cc', class: "zonos--country-select-selected" }, h("div", { key: 'ae46b163ef58d71398c317ed5ceba1844fc52edc', class: "zonos--country-flag-wrapper" }, h("zonos-country-flag", { key: 'f4d18cf60a089675852f8f0fca82055fa879a7b7', class: "zonos--country-flag", countryCode: this.selectedCountry.countryCode })), h("div", { key: '1724ccaef84c39504ee9f2fb364d38c2b979185d', class: "zonos--country-code" }, "+", this.selectedCountry.phoneCode))), h("div", { key: 'e5c45c7d4ca3fd5244803f083e6fae502e4253fa', class: "zonos--select-chevron-wrapper" }, h("zonos-icon", { key: '9cfb2da1d454c6b9e0a64b4327ce515cf6aa72da', "aria-label": "Expand collapsed section", class: "zonos--select-chevron", content: ChevronDownIcon$1, iconColor: "gray-800" }))))), h("div", { key: '8324ec965cf0b637d4d7151728217407307b8707', class: classes([
7467
+ })), h("div", { key: 'c8d76a0a1e9ca245f03a853440a691e1bb478093', class: "zonos--input-group" }, h("div", { key: '51ccfb533bb4560061c63aaed368fb6488cf9d87', class: "zonos--select-wrapper" }, h("div", { key: 'cd50bc9c8f2fd407f47e5bfd3eba18a3f8fe721f', class: "zonos--country-select" }, h("div", { key: '05581057f31568b3d50b054e9c7fbbad5be7c27a', class: "zonos--country-select-content" }, this.selectedCountry && (h("div", { key: '04c5abdc6fdf7e71585896b426ec1ab00dc11f66', class: "zonos--country-select-selected" }, h("div", { key: '6750556068dbad185fadfba36268417974a43865', class: "zonos--country-flag-wrapper" }, h("zonos-country-flag", { key: 'a611a41490d68f2763ae43ad0fd5c0c498d16bfe', class: "zonos--country-flag", countryCode: this.selectedCountry.countryCode })), h("div", { key: 'eab8a6353cd865cffb1576f14fee6edd5dbd3383', class: "zonos--country-code" }, "+", this.selectedCountry.phoneCode))), h("div", { key: 'b3b4b8c407ed68305b467590921bc57925077acd', class: "zonos--select-chevron-wrapper" }, h("zonos-icon", { key: '7bc52fdcaf76bf6416d33442e844057b8d6e8121', "aria-label": "Expand collapsed section", class: "zonos--select-chevron", content: ChevronDownIcon$1, iconColor: "gray-800" }))))), h("div", { key: 'd0ad07b902ef0ff675a515c07ec6597c0d0b0aa2', class: classes([
7435
7468
  'zonos--input-container',
7436
7469
  this.inputLabel && 'has-label',
7437
7470
  hasContent && 'has-content',
7438
- ]) }, h("input", Object.assign({ key: 'eace24d4a50271012b8bb95609842edcc7f8926f' }, this.inheritedAttributes, { autoComplete: this.autoComplete, class: "zonos--floated-input", disabled: this.disabled, id: this.inputId, onBlur: this.handleBlur, onFocus: this.handleFocus, onInput: this.handlePhoneChange, placeholder: ((_a = this.selectedCountry) === null || _a === void 0 ? void 0 : _a.phonePlaceholder) || '', ref: el => (this.inputRef = el), type: "tel" })), this.inputLabel && (h("div", { key: '9c1b5249fa2a9041e8c3ed9adbf3de8af4e1f29f', class: "zonos--floated-label" }, h("label", { key: '6535de344f98dc6148ef17ffdcb6354f1e1014e1', htmlFor: this.inputId }, this.inputLabel || translate('Phone number'))))))), this.error && (h("zonos-text", { key: '0d696d74191e3738ceb94e6adb018589fa4ad9f3', textColor: "red-600" }, this.error))));
7471
+ ]) }, h("input", Object.assign({ key: '5b12c7a228bf9736856c9ebf8ff7898cf0fc1889' }, this.inheritedAttributes, { autoComplete: this.autoComplete, class: "zonos--floated-input", disabled: this.disabled, id: this.inputId, onBlur: this.handleBlur, onFocus: this.handleFocus, onInput: this.handlePhoneChange, placeholder: ((_a = this.selectedCountry) === null || _a === void 0 ? void 0 : _a.phonePlaceholder) || '', ref: el => (this.inputRef = el), type: "tel" })), this.inputLabel && (h("div", { key: '04482f4bc210fb7ee6047972043f6b1942b25142', class: "zonos--floated-label" }, h("label", { key: '345c8e9d7ebc4aa8891c86a77a51f9bbd0088044', htmlFor: this.inputId }, this.inputLabel || translate('Phone number'))))))), this.error && (h("zonos-text", { key: 'cd8805f31cc6b2c9d6052f4c11190dba1f242945', textColor: "red-600" }, this.error))));
7439
7472
  }
7440
7473
  get el() { return getElement(this); }
7441
7474
  static get watchers() { return {
7475
+ "countryCode": ["onCountryCodeChange"],
7442
7476
  "countryOptions": ["onCountryOptionsChange"],
7443
7477
  "selectedCountry": ["onSelectedCountryChange"],
7444
7478
  "inputValue": ["onPhoneNumberChange"]
@@ -7581,4 +7615,4 @@ const ZonosStripeSelect = class {
7581
7615
  };
7582
7616
  ZonosStripeSelect.style = ZonosStripeSelectStyle0;
7583
7617
 
7584
- export { ZonosAddressDisplay as zonos_address_display, ZonosAddressForm as zonos_address_form, ZonosAddressSuggestions as zonos_address_suggestions, ZonosAddressUpdateDialog as zonos_address_update_dialog, ZonosAddress as zonos_custom_address, ZonosDialog as zonos_dialog, ZonosStripePhoneInput as zonos_stripe_phone_input, ZonosStripeSelect as zonos_stripe_select };
7618
+ export { ZonosAddressCompletionDialog as zonos_address_completion_dialog, ZonosAddressForm as zonos_address_form, ZonosAddressSuggestions as zonos_address_suggestions, ZonosAddressUpdateDialog as zonos_address_update_dialog, ZonosAddress as zonos_custom_address, ZonosStripePhoneInput as zonos_stripe_phone_input, ZonosStripeSelect as zonos_stripe_select };