@zonos/elements 1.3.184 → 1.3.186

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 (343) hide show
  1. package/dist/cjs/{cart-3d0c0f0b.js → cart-f9df3ac8.js} +3209 -10
  2. package/dist/cjs/debounce-3eaa4f7e.js +357 -0
  3. package/dist/cjs/{getBorderRadius-94ef609c.js → getBorderRadius-87f3b69c.js} +1 -1
  4. package/dist/cjs/getGenericSettingsOverride-c0ca32b9.js +104 -0
  5. package/dist/cjs/helpers-5bdbb68c.js +100 -0
  6. package/dist/cjs/{index-2f90486e.js → index-0993f42d.js} +15 -3
  7. package/dist/cjs/index.cjs.js +19 -8
  8. package/dist/cjs/{isDarkColor-ec4a4e7d.js → isDarkColor-d0c67c3d.js} +1 -1
  9. package/dist/cjs/loader.cjs.js +2 -2
  10. package/dist/cjs/{paypal-9eaa9196.js → paypal-5e73c8f5.js} +3 -3
  11. package/dist/cjs/zonos-address_11.cjs.entry.js +7919 -0
  12. package/dist/cjs/zonos-badge.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
  14. package/dist/cjs/zonos-button_3.cjs.entry.js +18 -7
  15. package/dist/cjs/zonos-card.cjs.entry.js +3 -3
  16. package/dist/cjs/zonos-cart-items_13.cjs.entry.js +113 -21
  17. package/dist/cjs/zonos-checkout.cjs.entry.js +9 -7
  18. package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
  19. package/dist/cjs/zonos-component.cjs.entry.js +2 -2
  20. package/dist/cjs/zonos-controller.cjs.entry.js +225 -7
  21. package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
  22. package/dist/cjs/zonos-country-select_4.cjs.entry.js +10 -10
  23. package/dist/cjs/zonos-elements.cjs.js +2 -2
  24. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +8 -8
  25. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +9 -9
  26. package/dist/cjs/zonos-hello.cjs.entry.js +7 -358
  27. package/dist/cjs/zonos-input.cjs.entry.js +3 -3
  28. package/dist/cjs/zonos-language-select_2.cjs.entry.js +5 -5
  29. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  30. package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
  31. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +3 -3
  32. package/dist/cjs/zonos-stripe-input.cjs.entry.js +31 -12
  33. package/dist/cjs/zonos-text.cjs.entry.js +2 -2
  34. package/dist/cjs/zonos-toggle.cjs.entry.js +4 -4
  35. package/dist/cjs/zonos-tooltip.cjs.entry.js +3 -3
  36. package/dist/cjs/zonos-v-stack.cjs.entry.js +4 -4
  37. package/dist/cjs/{zonosStore-3812b318.js → zonosStore-adc42868.js} +2 -1
  38. package/dist/collection/collection-manifest.json +4 -0
  39. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +3 -3
  40. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +11 -0
  41. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +22 -0
  42. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +1 -1
  43. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +162 -17
  44. package/dist/collection/components/common/zonos-button/zonos-button.js +14 -3
  45. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +5 -3
  46. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +2 -2
  47. package/dist/collection/components/common/zonos-country-select/zonos-country-select.css +0 -6
  48. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +2 -2
  49. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.css +2 -3
  50. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.js +105 -8
  51. package/dist/collection/components/common/zonos-stripe-phone-input/assets/ChevronDownIcon.svg +1 -0
  52. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.css +222 -0
  53. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +481 -0
  54. package/dist/collection/components/common/zonos-stripe-select/assets/ChevronDownIcon.svg +1 -0
  55. package/dist/collection/components/common/zonos-stripe-select/assets/RemoveLineIcon.svg +1 -0
  56. package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.css +178 -0
  57. package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.js +455 -0
  58. package/dist/collection/components/common/zonos-toggle/zonos-toggle.js +2 -2
  59. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  60. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  61. package/dist/collection/components/common/zonos-virtual-scroll/zonos-virtual-scroll.js +2 -2
  62. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  63. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  64. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +4 -4
  65. package/dist/collection/components/main/zonos-controller.js +24 -1
  66. package/dist/collection/components/paypal/zonos-paypal-payment.js +1 -1
  67. package/dist/collection/components/store/checkout/stripe.js +24 -7
  68. package/dist/collection/components/store/translationStore/strings.arabic.js +159 -0
  69. package/dist/collection/components/store/translationStore/strings.base.js +161 -0
  70. package/dist/collection/components/store/translationStore/strings.chinese.js +159 -0
  71. package/dist/collection/components/store/translationStore/strings.danish.js +159 -0
  72. package/dist/collection/components/store/translationStore/strings.dutch.js +159 -0
  73. package/dist/collection/components/store/translationStore/strings.french.js +159 -0
  74. package/dist/collection/components/store/translationStore/strings.german.js +159 -0
  75. package/dist/collection/components/store/translationStore/strings.hebrew.js +159 -0
  76. package/dist/collection/components/store/translationStore/strings.indonesian.js +159 -0
  77. package/dist/collection/components/store/translationStore/strings.italian.js +159 -0
  78. package/dist/collection/components/store/translationStore/strings.japanese.js +159 -0
  79. package/dist/collection/components/store/translationStore/strings.korean.js +159 -0
  80. package/dist/collection/components/store/translationStore/strings.norwegian.js +159 -0
  81. package/dist/collection/components/store/translationStore/strings.polish.js +159 -0
  82. package/dist/collection/components/store/translationStore/strings.portuguese.js +159 -0
  83. package/dist/collection/components/store/translationStore/strings.russian.js +159 -0
  84. package/dist/collection/components/store/translationStore/strings.spanish.js +159 -0
  85. package/dist/collection/components/store/translationStore/strings.swedish.js +159 -0
  86. package/dist/collection/components/store/translationStore/strings.turkish.js +159 -0
  87. package/dist/collection/components/store/translationStore/strings.vietnamese.js +159 -0
  88. package/dist/collection/components/store/zonosStore.js +1 -0
  89. package/dist/collection/components/stripe/zonos-address/zonos-address.js +1 -1
  90. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/assets/RemoveIcon.svg +1 -0
  91. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.css +86 -0
  92. package/dist/collection/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.js +192 -0
  93. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.css +67 -0
  94. package/dist/collection/components/stripe/zonos-custom-address/zonos-custom-address.js +980 -0
  95. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  96. package/dist/collection/components/utils/api/getGenericSettingsOverride.js +10 -0
  97. package/dist/collection/components/utils/api/getZonosSettings.js +7 -1
  98. package/dist/collection/components/utils/checkout/form/helpers.js +95 -0
  99. package/dist/collection/components/utils/checkout/form/isValidZip.js +18 -0
  100. package/dist/collection/components/utils/iframe/CheckoutAddressService.js +193 -0
  101. package/dist/collection/components/utils/iframe/IframeHelpers.js +86 -0
  102. package/dist/collection/components/utils/mergeAddress.js +5 -0
  103. package/dist/collection/constants/phone-formats.js +658 -0
  104. package/dist/collection/scripts/_getCartInfoById.js +7 -1
  105. package/dist/collection/scripts/_zonosBase.js +7 -0
  106. package/dist/collection/types/CountryFields.js +1 -0
  107. package/dist/collection/types/checkout/form/CustomAddressErrors.js +1 -0
  108. package/dist/collection/types/generated/graphql.frontend.types.js +9 -0
  109. package/dist/collection/types/generated/graphql.internal.types.js +96 -0
  110. package/dist/collection/types/index.js +0 -1
  111. package/dist/esm/{cart-3fb04f1f.js → cart-4725a63b.js} +3209 -10
  112. package/dist/esm/debounce-3cf0793c.js +355 -0
  113. package/dist/esm/{getBorderRadius-ada3ccad.js → getBorderRadius-a9a48f79.js} +1 -1
  114. package/dist/esm/getGenericSettingsOverride-0bc3e118.js +99 -0
  115. package/dist/esm/helpers-2f6955b1.js +97 -0
  116. package/dist/esm/{index-d82f06f2.js → index-a457c60c.js} +15 -3
  117. package/dist/esm/index.js +19 -8
  118. package/dist/esm/{isDarkColor-446fccb7.js → isDarkColor-62cbddb5.js} +1 -1
  119. package/dist/esm/loader.js +3 -3
  120. package/dist/esm/{paypal-1f2e863c.js → paypal-a09943f4.js} +3 -3
  121. package/dist/esm/zonos-address_11.entry.js +7905 -0
  122. package/dist/esm/zonos-badge.entry.js +2 -2
  123. package/dist/esm/zonos-banner.entry.js +2 -2
  124. package/dist/esm/zonos-button_3.entry.js +18 -7
  125. package/dist/esm/zonos-card.entry.js +3 -3
  126. package/dist/esm/zonos-cart-items_13.entry.js +113 -21
  127. package/dist/esm/zonos-checkout.entry.js +9 -7
  128. package/dist/esm/zonos-collapse.entry.js +2 -2
  129. package/dist/esm/zonos-component.entry.js +2 -2
  130. package/dist/esm/zonos-controller.entry.js +225 -7
  131. package/dist/esm/zonos-country-flag.entry.js +5 -5
  132. package/dist/esm/zonos-country-select_4.entry.js +10 -10
  133. package/dist/esm/zonos-elements.js +3 -3
  134. package/dist/esm/zonos-empty-state-payment_4.entry.js +8 -8
  135. package/dist/esm/zonos-hello-dialog.entry.js +9 -9
  136. package/dist/esm/zonos-hello.entry.js +6 -357
  137. package/dist/esm/zonos-input.entry.js +3 -3
  138. package/dist/esm/zonos-language-select_2.entry.js +5 -5
  139. package/dist/esm/zonos-link.entry.js +1 -1
  140. package/dist/esm/zonos-logo.entry.js +2 -2
  141. package/dist/esm/zonos-shipping-rich-radio.entry.js +3 -3
  142. package/dist/esm/zonos-stripe-input.entry.js +31 -12
  143. package/dist/esm/zonos-text.entry.js +2 -2
  144. package/dist/esm/zonos-toggle.entry.js +4 -4
  145. package/dist/esm/zonos-tooltip.entry.js +3 -3
  146. package/dist/esm/zonos-v-stack.entry.js +4 -4
  147. package/dist/esm/{zonosStore-d3c5a0a5.js → zonosStore-1ce34e04.js} +2 -1
  148. package/dist/esm-es5/cart-4725a63b.js +1 -0
  149. package/dist/esm-es5/debounce-3cf0793c.js +1 -0
  150. package/dist/esm-es5/{getBorderRadius-ada3ccad.js → getBorderRadius-a9a48f79.js} +1 -1
  151. package/dist/esm-es5/getGenericSettingsOverride-0bc3e118.js +1 -0
  152. package/dist/esm-es5/helpers-2f6955b1.js +1 -0
  153. package/dist/esm-es5/index-a457c60c.js +2 -0
  154. package/dist/esm-es5/index.js +1 -1
  155. package/dist/esm-es5/{isDarkColor-446fccb7.js → isDarkColor-62cbddb5.js} +1 -1
  156. package/dist/esm-es5/loader.js +1 -1
  157. package/dist/esm-es5/{paypal-1f2e863c.js → paypal-a09943f4.js} +1 -1
  158. package/dist/esm-es5/zonos-address_11.entry.js +1 -0
  159. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  160. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  161. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  162. package/dist/esm-es5/zonos-card.entry.js +1 -1
  163. package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
  164. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  165. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  166. package/dist/esm-es5/zonos-component.entry.js +1 -1
  167. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  168. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  169. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  170. package/dist/esm-es5/zonos-elements.js +1 -1
  171. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  172. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  173. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  174. package/dist/esm-es5/zonos-input.entry.js +1 -1
  175. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  176. package/dist/esm-es5/zonos-link.entry.js +1 -1
  177. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  178. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  179. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  180. package/dist/esm-es5/zonos-text.entry.js +1 -1
  181. package/dist/esm-es5/zonos-toggle.entry.js +1 -1
  182. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  183. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  184. package/dist/esm-es5/{zonosStore-d3c5a0a5.js → zonosStore-1ce34e04.js} +1 -1
  185. package/dist/scripts/index.d.ts +3985 -3371
  186. package/dist/scripts/index.js +1 -1
  187. package/dist/scripts/loadZonos.js +1 -1
  188. package/dist/scripts/zonos.js +1 -1
  189. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +4 -0
  190. package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +28 -1
  191. package/dist/types/components/common/zonos-button/zonos-button.d.ts +4 -0
  192. package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +1 -0
  193. package/dist/types/components/common/zonos-stripe-input/zonos-stripe-input.d.ts +22 -0
  194. package/dist/types/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.d.ts +88 -0
  195. package/dist/types/components/common/zonos-stripe-select/zonos-stripe-select.d.ts +86 -0
  196. package/dist/types/components/main/zonos-controller.d.ts +1 -0
  197. package/dist/types/components/store/checkout/stripe.d.ts +9 -0
  198. package/dist/types/components/store/translationStore/strings.arabic.d.ts +159 -0
  199. package/dist/types/components/store/translationStore/strings.base.d.ts +159 -0
  200. package/dist/types/components/store/translationStore/strings.chinese.d.ts +159 -0
  201. package/dist/types/components/store/translationStore/strings.danish.d.ts +159 -0
  202. package/dist/types/components/store/translationStore/strings.dutch.d.ts +159 -0
  203. package/dist/types/components/store/translationStore/strings.french.d.ts +159 -0
  204. package/dist/types/components/store/translationStore/strings.german.d.ts +159 -0
  205. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +159 -0
  206. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +159 -0
  207. package/dist/types/components/store/translationStore/strings.italian.d.ts +159 -0
  208. package/dist/types/components/store/translationStore/strings.japanese.d.ts +159 -0
  209. package/dist/types/components/store/translationStore/strings.korean.d.ts +159 -0
  210. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +159 -0
  211. package/dist/types/components/store/translationStore/strings.polish.d.ts +159 -0
  212. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +159 -0
  213. package/dist/types/components/store/translationStore/strings.russian.d.ts +159 -0
  214. package/dist/types/components/store/translationStore/strings.spanish.d.ts +159 -0
  215. package/dist/types/components/store/translationStore/strings.swedish.d.ts +159 -0
  216. package/dist/types/components/store/translationStore/strings.turkish.d.ts +159 -0
  217. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +159 -0
  218. package/dist/types/components/store/zonosStore.d.ts +6 -1
  219. package/dist/types/components/stripe/zonos-custom-address/zonos-address-suggestions/zonos-address-suggestions.d.ts +38 -0
  220. package/dist/types/components/stripe/zonos-custom-address/zonos-custom-address.d.ts +150 -0
  221. package/dist/types/components/utils/api/getGenericSettingsOverride.d.ts +5 -0
  222. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  223. package/dist/types/components/utils/api/getZonosSettings.d.ts +2 -2
  224. package/dist/types/components/utils/checkout/form/helpers.d.ts +19 -0
  225. package/dist/types/components/utils/checkout/form/isValidZip.d.ts +5 -0
  226. package/dist/types/components/utils/iframe/CheckoutAddressService.d.ts +38 -0
  227. package/dist/types/components/utils/iframe/IframeHelpers.d.ts +81 -0
  228. package/dist/types/components/utils/mergeAddress.d.ts +4 -0
  229. package/dist/types/components/utils/resetToSelectedTab.d.ts +1 -1
  230. package/dist/types/components.d.ts +472 -4
  231. package/dist/types/constants/phone-formats.d.ts +5 -0
  232. package/dist/types/environment.d.ts +1 -1
  233. package/dist/types/scripts/_zonosBase.d.ts +13 -1
  234. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +1 -0
  235. package/dist/types/types/CountryFields.d.ts +40 -0
  236. package/dist/types/types/checkout/form/CustomAddressErrors.d.ts +13 -0
  237. package/dist/types/types/generated/graphql.frontend.types.d.ts +164 -1
  238. package/dist/types/types/generated/graphql.frontend.types.ts +145 -1
  239. package/dist/types/types/generated/graphql.internal.types.d.ts +127 -0
  240. package/dist/types/types/generated/graphql.internal.types.ts +155 -0
  241. package/dist/types/types/global.d.ts +1 -0
  242. package/dist/types/types/index.d.ts +1 -1
  243. package/dist/types/types/utils/ZonosSettings.d.ts +17 -0
  244. package/dist/zonos-elements/index.esm.js +1 -1
  245. package/dist/zonos-elements/{p-4622cca6.entry.js → p-0104d3ba.entry.js} +1 -1
  246. package/dist/zonos-elements/{p-7cb87ea7.system.entry.js → p-04303b56.system.entry.js} +1 -1
  247. package/dist/zonos-elements/p-06f798ee.system.js +1 -0
  248. package/dist/zonos-elements/p-0bf6e163.system.entry.js +1 -0
  249. package/dist/zonos-elements/p-0c676de4.entry.js +1 -0
  250. package/dist/zonos-elements/{p-739014f8.system.entry.js → p-0fdd7034.system.entry.js} +1 -1
  251. package/dist/zonos-elements/{p-a1cfbd0a.js → p-17299200.js} +1 -1
  252. package/dist/zonos-elements/p-175e242e.entry.js +1 -0
  253. package/dist/zonos-elements/{p-58f660d4.system.entry.js → p-1b29bc5f.system.entry.js} +1 -1
  254. package/dist/zonos-elements/{p-fe2c27c4.entry.js → p-1e612c29.entry.js} +1 -1
  255. package/dist/zonos-elements/{p-98aa88b1.js → p-2097fae5.js} +1 -1
  256. package/dist/zonos-elements/{p-81084be5.system.entry.js → p-240ee490.system.entry.js} +1 -1
  257. package/dist/zonos-elements/p-2416aaa1.system.entry.js +1 -0
  258. package/dist/zonos-elements/{p-cedf08f0.entry.js → p-313ef896.entry.js} +1 -1
  259. package/dist/zonos-elements/{p-fa65b53d.entry.js → p-314fbfe1.entry.js} +1 -1
  260. package/dist/zonos-elements/{p-5187ba8f.system.js → p-31e90130.system.js} +1 -1
  261. package/dist/zonos-elements/{p-4ca666ea.system.entry.js → p-341f40c2.system.entry.js} +1 -1
  262. package/dist/zonos-elements/{p-d49c6a3e.system.entry.js → p-35f33601.system.entry.js} +1 -1
  263. package/dist/zonos-elements/p-4160bbc2.system.js +1 -0
  264. package/dist/zonos-elements/p-43633269.system.js +2 -0
  265. package/dist/zonos-elements/p-443b5db2.entry.js +1 -0
  266. package/dist/zonos-elements/p-46d3e378.system.entry.js +1 -0
  267. package/dist/zonos-elements/{p-3d221556.system.entry.js → p-488ad646.system.entry.js} +1 -1
  268. package/dist/zonos-elements/p-53ffdb91.js +1 -0
  269. package/dist/zonos-elements/p-56b56caa.system.entry.js +1 -0
  270. package/dist/zonos-elements/{p-3eac4b10.entry.js → p-5f896e9a.entry.js} +1 -1
  271. package/dist/zonos-elements/{p-e8c70c7d.system.entry.js → p-609c32a3.system.entry.js} +1 -1
  272. package/dist/zonos-elements/p-64ea232c.system.entry.js +1 -0
  273. package/dist/zonos-elements/{p-f378b4d3.system.entry.js → p-678ccc3f.system.entry.js} +1 -1
  274. package/dist/zonos-elements/{p-8048932d.entry.js → p-67b904c2.entry.js} +1 -1
  275. package/dist/zonos-elements/p-6b40da70.system.js +1 -0
  276. package/dist/zonos-elements/p-6fd6af48.system.entry.js +1 -0
  277. package/dist/zonos-elements/p-70d4d436.entry.js +1 -0
  278. package/dist/zonos-elements/{p-64dbc282.entry.js → p-818d6f17.entry.js} +1 -1
  279. package/dist/zonos-elements/{p-b5b9aa6c.entry.js → p-81ee1683.entry.js} +1 -1
  280. package/dist/zonos-elements/{p-236f32c8.system.entry.js → p-89fcd305.system.entry.js} +1 -1
  281. package/dist/zonos-elements/{p-c4fa8524.system.entry.js → p-94a80d93.system.entry.js} +1 -1
  282. package/dist/zonos-elements/p-961620ae.entry.js +1 -0
  283. package/dist/zonos-elements/{p-4eff2f8a.system.entry.js → p-98e4a965.system.entry.js} +1 -1
  284. package/dist/zonos-elements/{p-5bebcfc2.system.js → p-9913c186.system.js} +1 -1
  285. package/dist/zonos-elements/{p-29e8c9e8.system.entry.js → p-991c85f1.system.entry.js} +1 -1
  286. package/dist/zonos-elements/p-995761ea.system.entry.js +1 -0
  287. package/dist/zonos-elements/p-9a7a9b1c.entry.js +1 -0
  288. package/dist/zonos-elements/{p-d367c9ae.system.entry.js → p-9f7b9d66.system.entry.js} +1 -1
  289. package/dist/zonos-elements/{p-587568b5.entry.js → p-aaff5dcc.entry.js} +1 -1
  290. package/dist/zonos-elements/{p-3731e7f5.entry.js → p-abc66a0b.entry.js} +1 -1
  291. package/dist/zonos-elements/{p-eb294265.entry.js → p-aca3a2bb.entry.js} +1 -1
  292. package/dist/zonos-elements/{p-69f84611.entry.js → p-b2241919.entry.js} +1 -1
  293. package/dist/zonos-elements/p-b5edee66.system.js +1 -0
  294. package/dist/zonos-elements/p-b610f70c.system.js +1 -0
  295. package/dist/zonos-elements/{p-69255ed2.system.js → p-bbbaea3a.system.js} +1 -1
  296. package/dist/zonos-elements/p-c04b3f14.system.js +1 -0
  297. package/dist/zonos-elements/p-c137dc82.js +2 -0
  298. package/dist/zonos-elements/{p-be9e1818.system.entry.js → p-c140a0bd.system.entry.js} +1 -1
  299. package/dist/zonos-elements/{p-de221545.entry.js → p-cf6ae7dc.entry.js} +1 -1
  300. package/dist/zonos-elements/{p-90633d63.entry.js → p-d0f4b6c3.entry.js} +1 -1
  301. package/dist/zonos-elements/{p-112aecac.js → p-de462b9b.js} +2 -2
  302. package/dist/zonos-elements/{p-107b08c1.entry.js → p-e5d081d8.entry.js} +1 -1
  303. package/dist/zonos-elements/p-e7b0c156.js +1 -0
  304. package/dist/zonos-elements/{p-30fdcbee.js → p-e892fb29.js} +1 -1
  305. package/dist/zonos-elements/p-e90cb997.entry.js +1 -0
  306. package/dist/zonos-elements/{p-db3f381d.entry.js → p-e91b244c.entry.js} +1 -1
  307. package/dist/zonos-elements/{p-41dfc828.entry.js → p-e99354d5.entry.js} +1 -1
  308. package/dist/zonos-elements/p-ea6d87a1.system.js +1 -0
  309. package/dist/zonos-elements/p-eef5b0cc.js +1 -0
  310. package/dist/zonos-elements/{p-d0944cc8.system.entry.js → p-f3f27bf2.system.entry.js} +1 -1
  311. package/dist/zonos-elements/{p-0e63259c.system.entry.js → p-f4cc688e.system.entry.js} +1 -1
  312. package/dist/zonos-elements/{p-cc6d9f7d.entry.js → p-f7d3e48b.entry.js} +1 -1
  313. package/dist/zonos-elements/p-fa6de0f3.js +1 -0
  314. package/dist/zonos-elements/{p-c5c8f803.system.entry.js → p-fd348fd4.system.entry.js} +1 -1
  315. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  316. package/dist/zonos-elements/zonos-elements.js +1 -1
  317. package/package.json +3 -1
  318. package/dist/cjs/zonos-address_7.cjs.entry.js +0 -772
  319. package/dist/esm/zonos-address_7.entry.js +0 -762
  320. package/dist/esm-es5/cart-3fb04f1f.js +0 -1
  321. package/dist/esm-es5/index-d82f06f2.js +0 -2
  322. package/dist/esm-es5/zonos-address_7.entry.js +0 -1
  323. package/dist/zonos-elements/p-09041efe.entry.js +0 -1
  324. package/dist/zonos-elements/p-16e4cdb1.entry.js +0 -1
  325. package/dist/zonos-elements/p-43feb95e.entry.js +0 -1
  326. package/dist/zonos-elements/p-46f6e5e9.system.js +0 -1
  327. package/dist/zonos-elements/p-4caffd96.system.js +0 -2
  328. package/dist/zonos-elements/p-642bf613.system.entry.js +0 -1
  329. package/dist/zonos-elements/p-6c0c8722.system.entry.js +0 -1
  330. package/dist/zonos-elements/p-7decb19b.entry.js +0 -1
  331. package/dist/zonos-elements/p-829f6a40.entry.js +0 -1
  332. package/dist/zonos-elements/p-8f640b28.entry.js +0 -1
  333. package/dist/zonos-elements/p-a69dbe14.js +0 -1
  334. package/dist/zonos-elements/p-ab68ad11.js +0 -2
  335. package/dist/zonos-elements/p-b1020237.system.js +0 -1
  336. package/dist/zonos-elements/p-bc0f885e.system.entry.js +0 -1
  337. package/dist/zonos-elements/p-c6d96a42.system.js +0 -1
  338. package/dist/zonos-elements/p-ce853f8f.system.entry.js +0 -1
  339. package/dist/zonos-elements/p-d5d39db4.system.entry.js +0 -1
  340. package/dist/zonos-elements/p-e4f8114a.system.js +0 -1
  341. package/dist/zonos-elements/p-e99e75dd.system.entry.js +0 -1
  342. package/dist/zonos-elements/p-f66a5c7c.system.entry.js +0 -1
  343. package/dist/zonos-elements/p-febb90e0.entry.js +0 -1
@@ -0,0 +1,980 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s)
4
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ import { h, Host, } from "@stencil/core";
14
+ import throttle from "lodash/throttle";
15
+ import { cartStore } from "../../store/checkout/cart";
16
+ import { stripeStore } from "../../store/checkout/stripe";
17
+ import { localizationStore } from "../../store/hello/localization";
18
+ import { translate } from "../../store/translationStore";
19
+ import { zonosStore } from "../../store/zonosStore";
20
+ import { trackConversionEvent } from "../../utils/api/trackConversionEvent";
21
+ import { isValidZip } from "../../utils/checkout/form/isValidZip";
22
+ import { isCheckoutMobile } from "../../utils/checkout/isCheckoutMobile";
23
+ import { classes } from "../../utils/classes";
24
+ import { log } from "../../utils/logging/log";
25
+ import { mergeAddress } from "../../utils/mergeAddress";
26
+ /**
27
+ * This component is a wrapper for the stripe address element that would render default style object
28
+ */
29
+ export class ZonosAddress {
30
+ constructor() {
31
+ /**
32
+ * Whether the suggestion is clicked
33
+ */
34
+ this.suggestionClicked = false;
35
+ /**
36
+ * Check if the tracking event is sent
37
+ */
38
+ this.trackingSent = false;
39
+ /**
40
+ * Google autocomplete overlay is conflict with our button, this is to adjust z index of the autocomplete
41
+ */
42
+ this.isAutoCompleteAdjusted = false;
43
+ // Create a single throttled instance that persists
44
+ this.throttledGetAddressSuggestions = throttle(() => {
45
+ if (zonosStore.checkoutAddressService) {
46
+ zonosStore.checkoutAddressService.getAddressSuggestions({
47
+ country: this.country,
48
+ query: [this.line1, this.state, this.postalCode]
49
+ .filter(Boolean)
50
+ .join(', '),
51
+ type: this.type,
52
+ });
53
+ }
54
+ }, 1000);
55
+ // Map the custom address form to stripe address event data
56
+ this.setCustomAddressFormToStripeAddressEventData = () => {
57
+ // If the field is not shown, set it to an empty string
58
+ const cityValue = !this.countryField || this.countryField.cityShow ? this.city : '';
59
+ const stateValue = !this.countryField || this.countryField.stateShow ? this.state : '';
60
+ const postalCodeValue = !this.countryField || this.countryField.zipShow ? this.postalCode : '';
61
+ const transformedAddress = {
62
+ complete: this.getIsComplete(),
63
+ elementMode: this.type,
64
+ elementType: 'address',
65
+ empty: !this.getIsComplete(),
66
+ isNewAddress: true,
67
+ value: {
68
+ address: {
69
+ city: cityValue,
70
+ country: this.country,
71
+ line1: this.line1,
72
+ line2: this.line2,
73
+ postal_code: postalCodeValue,
74
+ state: stateValue,
75
+ },
76
+ firstName: this.firstName,
77
+ lastName: this.lastName,
78
+ name: `${this.firstName} ${this.lastName}`,
79
+ phone: this.phone,
80
+ },
81
+ };
82
+ this.updateAddressEventData({
83
+ event: transformedAddress,
84
+ type: this.type,
85
+ });
86
+ this.addressChange.emit({
87
+ errors: this.getCustomAddressErrors(),
88
+ type: this.type,
89
+ value: transformedAddress,
90
+ });
91
+ };
92
+ this.getCustomAddressErrors = () => {
93
+ return this.type === 'shipping'
94
+ ? stripeStore.customAddressErrors
95
+ : stripeStore.customBillingAddressErrors;
96
+ };
97
+ this.validate = ({ phoneValidateInfo, type, value, valueType, }) => {
98
+ var _a, _b, _c, _d, _e;
99
+ const customErrors = Object.assign({}, this.getCustomAddressErrors());
100
+ switch (valueType) {
101
+ case 'city': {
102
+ const isValid = !((_a = this.countryField) === null || _a === void 0 ? void 0 : _a.cityRequired) ||
103
+ (((_b = this.countryField) === null || _b === void 0 ? void 0 : _b.cityRequired) && !!(value === null || value === void 0 ? void 0 : value.trim()));
104
+ customErrors.city = '';
105
+ if (!isValid) {
106
+ customErrors.city = translate('The field is incomplete');
107
+ }
108
+ break;
109
+ }
110
+ case 'state': {
111
+ const isValid = !((_c = this.countryField) === null || _c === void 0 ? void 0 : _c.stateRequired) ||
112
+ (((_d = this.countryField) === null || _d === void 0 ? void 0 : _d.stateRequired) && !!(value === null || value === void 0 ? void 0 : value.trim()));
113
+ customErrors.state = '';
114
+ if (!isValid) {
115
+ customErrors.state = translate('The field is incomplete');
116
+ }
117
+ break;
118
+ }
119
+ case 'postalCode': {
120
+ const isValid = isValidZip({
121
+ countryFields: this.countryField,
122
+ zip: value || '',
123
+ });
124
+ customErrors.postalCode = '';
125
+ if (!isValid) {
126
+ customErrors.postalCode = translate('Your [zipLabel] is invalid', {
127
+ zipLabel: ((_e = this.countryField) === null || _e === void 0 ? void 0 : _e.zipLabel) || 'ZIP',
128
+ });
129
+ }
130
+ break;
131
+ }
132
+ case 'firstName': {
133
+ const isValid = !!(value === null || value === void 0 ? void 0 : value.trim());
134
+ customErrors.firstName = '';
135
+ if (!isValid) {
136
+ customErrors.firstName = translate('Please provide your first name.');
137
+ }
138
+ break;
139
+ }
140
+ case 'lastName': {
141
+ const isValid = !!(value === null || value === void 0 ? void 0 : value.trim());
142
+ customErrors.lastName = '';
143
+ if (!isValid) {
144
+ customErrors.lastName = translate('Please provide your last name.');
145
+ }
146
+ break;
147
+ }
148
+ case 'line1': {
149
+ const isValid = !!(value === null || value === void 0 ? void 0 : value.trim());
150
+ customErrors.line1 = '';
151
+ if (!isValid) {
152
+ customErrors.line1 = translate('The field is incomplete');
153
+ }
154
+ break;
155
+ }
156
+ case 'phone': {
157
+ // If the phone validate info is not provided, we need to validate the phone number
158
+ if (!phoneValidateInfo) {
159
+ const isValid = !!(value === null || value === void 0 ? void 0 : value.trim());
160
+ customErrors.phone = '';
161
+ if (!isValid) {
162
+ customErrors.phone = translate('Please provide a mobile phone number.');
163
+ }
164
+ }
165
+ else {
166
+ customErrors.phone = '';
167
+ // If the phone number is empty, set the error message
168
+ if (phoneValidateInfo.isEmpty) {
169
+ customErrors.phone = translate('Please provide a mobile phone number.');
170
+ }
171
+ else if (phoneValidateInfo.wrongFormat) {
172
+ customErrors.phone = translate('Your mobile phone number is incomplete.');
173
+ }
174
+ }
175
+ break;
176
+ }
177
+ }
178
+ if (type === 'shipping') {
179
+ stripeStore.customAddressErrors = customErrors;
180
+ }
181
+ else {
182
+ stripeStore.customBillingAddressErrors = customErrors;
183
+ }
184
+ };
185
+ this.type = undefined;
186
+ this.titleText = undefined;
187
+ this.defaultAddress = [];
188
+ this.stripe = window.Zonos.stripe;
189
+ this.isDirtyAddress = false;
190
+ this.isAddressFilled = false;
191
+ this.isAddressLine1Entered = false;
192
+ this.addressSuggestions = [];
193
+ this.countryField = null;
194
+ this.startGooglePlaceSuggestions = false;
195
+ this.shipToCountries = null;
196
+ this.shippingZones = null;
197
+ this.city = '';
198
+ this.country = '';
199
+ this.firstName = '';
200
+ this.lastName = '';
201
+ this.line1 = '';
202
+ this.line2 = null;
203
+ this.phone = '';
204
+ this.postalCode = '';
205
+ this.state = '';
206
+ this.cityError = '';
207
+ this.stateError = '';
208
+ this.postalCodeError = '';
209
+ this.phoneError = '';
210
+ this.firstNameError = '';
211
+ this.lastNameError = '';
212
+ this.isFirstInitialization = true;
213
+ this.addressService = null;
214
+ this.checkoutSessionId = cartStore.checkoutSessionId;
215
+ }
216
+ getStripeAddressInstance() {
217
+ if (this.type === 'billing') {
218
+ return {
219
+ stripeAddressElement: stripeStore.stripeBillingAddressElement,
220
+ stripeAddressEventData: stripeStore.stripeBillingAddressEventData,
221
+ stripeElements: stripeStore.stripeElementsForBillingAddress,
222
+ };
223
+ }
224
+ return {
225
+ stripeAddressElement: stripeStore.stripeAddressElement,
226
+ stripeAddressEventData: stripeStore.stripeAddressEventData,
227
+ stripeElements: stripeStore.stripeElements,
228
+ };
229
+ }
230
+ updateAddressEventData({ event, type, }) {
231
+ switch (type) {
232
+ case 'billing':
233
+ stripeStore.stripeBillingAddressEventData = event;
234
+ break;
235
+ default: {
236
+ stripeStore.stripeAddressEventData = event;
237
+ break;
238
+ }
239
+ }
240
+ }
241
+ isAddressFilledChanged() {
242
+ // Sometimes address elements is loaded with prefilled data before checkout is loaded, need to not send the event if checkout session id is not available, and send the event after checkout is loaded
243
+ if (!cartStore.checkoutSessionId) {
244
+ return;
245
+ }
246
+ // Only need to track the event if the shipping address is filled
247
+ if (this.isAddressFilled &&
248
+ !this.trackingSent &&
249
+ this.type === 'shipping') {
250
+ this.trackingSent = true;
251
+ const checkoutSessionId = cartStore.checkoutSessionId;
252
+ void trackConversionEvent({
253
+ checkoutSessionId,
254
+ eventName: 'checkout_customerInfoFilled',
255
+ });
256
+ }
257
+ }
258
+ defaultAddressChanged(newAddress, oldAddress) {
259
+ // check if stringified json of oldAddress is different from newAddress
260
+ const oldAddressString = JSON.stringify(oldAddress);
261
+ const newAddressString = JSON.stringify(newAddress);
262
+ // No need to reset address element if the default address is the same
263
+ if (oldAddressString === newAddressString) {
264
+ return;
265
+ }
266
+ log('Reset address element when default address property is changed', 'info', {
267
+ defaultAddress: this.defaultAddress,
268
+ });
269
+ // Reset stripe address event data
270
+ if (this.type === 'shipping') {
271
+ stripeStore.stripeAddressEventData = null;
272
+ }
273
+ else {
274
+ stripeStore.stripeBillingAddressEventData = null;
275
+ }
276
+ this.initDefaultCustomAddressForm();
277
+ }
278
+ getIsComplete() {
279
+ const { city, firstName, lastName, line1, phone, postalCode, state } = this.getCustomAddressErrors();
280
+ // empty field when first loaded
281
+ if (!this.line1 ||
282
+ !this.postalCode ||
283
+ !this.firstName ||
284
+ !this.lastName ||
285
+ !this.phone) {
286
+ return false;
287
+ }
288
+ // has any errors from any of the fields
289
+ const hasErrors = line1 || postalCode || state || city || firstName || lastName || phone;
290
+ return !hasErrors;
291
+ }
292
+ renderCompanyNameInput() {
293
+ var _a;
294
+ // No need to render company name for billing address
295
+ if (this.type === 'billing') {
296
+ return null;
297
+ }
298
+ // No need to render company name if it's not enabled
299
+ if (!((_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.companyNameInputEnabled)) {
300
+ // Clear the company name when it's not enabled
301
+ stripeStore.companyName = '';
302
+ return null;
303
+ }
304
+ return (h("zonos-stripe-input", { class: "zonos--company-name-input", inputLabel: translate('Company name (optional)'), inputValue: stripeStore.companyName, onInputChange: (event) => {
305
+ stripeStore.companyName = event.detail;
306
+ } }));
307
+ }
308
+ initCountryField(countryCode) {
309
+ var _a, _b, _c;
310
+ this.countryField =
311
+ ((_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.countryFields) && countryCode
312
+ ? (_c = (_b = zonosStore.genericSettings) === null || _b === void 0 ? void 0 : _b.countryFields) === null || _c === void 0 ? void 0 : _c[countryCode]
313
+ : null;
314
+ }
315
+ initDefaultCustomAddressForm() {
316
+ log('initDefaultCustomAddressForm', 'info', this.type);
317
+ const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
318
+ // Use data from Stripe address element if it's available (This may happen when user has already at shipping selection page but go back to customer page)
319
+ if (stripeAddressEventData) {
320
+ const countryCode = stripeAddressEventData.value.address.country ||
321
+ localizationStore.selectedCountryCode ||
322
+ 'US';
323
+ this.setFormValues({
324
+ city: stripeAddressEventData.value.address.city,
325
+ country: countryCode,
326
+ firstName: stripeAddressEventData.value.firstName || '',
327
+ lastName: stripeAddressEventData.value.lastName || '',
328
+ line1: stripeAddressEventData.value.address.line1,
329
+ line2: stripeAddressEventData.value.address.line2 || '',
330
+ phone: stripeAddressEventData.value.phone || '',
331
+ postal_code: stripeAddressEventData.value.address.postal_code,
332
+ state: stripeAddressEventData.value.address.state,
333
+ });
334
+ this.initCountryField(countryCode);
335
+ return;
336
+ }
337
+ // Use data from default address if it's available
338
+ const firstDefaultAddress = this.defaultAddress[0];
339
+ if (firstDefaultAddress) {
340
+ const countryCode = firstDefaultAddress.address.country ||
341
+ localizationStore.selectedCountryCode ||
342
+ 'US';
343
+ this.setFormValues({
344
+ city: firstDefaultAddress.address.city,
345
+ country: countryCode,
346
+ firstName: firstDefaultAddress.name.split(' ')[0] || '',
347
+ lastName: firstDefaultAddress.name.split(' ')[1] || '',
348
+ line1: firstDefaultAddress.address.line1,
349
+ line2: firstDefaultAddress.address.line2 || '',
350
+ phone: firstDefaultAddress.phone || '',
351
+ postal_code: firstDefaultAddress.address.postal_code,
352
+ state: firstDefaultAddress.address.state,
353
+ });
354
+ this.initCountryField(countryCode);
355
+ return;
356
+ }
357
+ const countryCode = localizationStore.selectedCountryCode || 'US';
358
+ // Set default values
359
+ this.setFormValues({
360
+ city: '',
361
+ country: countryCode,
362
+ firstName: '',
363
+ lastName: '',
364
+ line1: '',
365
+ line2: '',
366
+ phone: '',
367
+ postal_code: '',
368
+ state: '',
369
+ });
370
+ this.initCountryField(countryCode);
371
+ // Set the first initialization to false when the address element is initialized
372
+ this.isFirstInitialization = false;
373
+ }
374
+ line1Changed() {
375
+ const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
376
+ const isAddressChanged = !stripeAddressEventData ||
377
+ this.line1 !== (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.line1);
378
+ // Start requesting google place suggestions when address line 1 is more than 3 characters
379
+ if (isAddressChanged && this.line1.length > 3) {
380
+ // Turn on the suggestion when the address line 1 is changed
381
+ this.startGooglePlaceSuggestions = true;
382
+ this.isAddressLine1Entered = true;
383
+ // Turn off the suggestion when the address suggestion is clicked, but next time the address line 1 is changed, the suggestion will be turned on again
384
+ if (this.suggestionClicked) {
385
+ this.suggestionClicked = false;
386
+ this.startGooglePlaceSuggestions = false;
387
+ }
388
+ if (!this.isDirtyAddress) {
389
+ this.isDirtyAddress = true;
390
+ // stripe element started with just address line 1, so scroll bar is not yet available. Wait for a moment before scrolling
391
+ setTimeout(() => {
392
+ if (!this.isAutoCompleteAdjusted) {
393
+ if (isCheckoutMobile()) {
394
+ this.el.scrollIntoView({ behavior: 'smooth', block: 'end' });
395
+ }
396
+ else {
397
+ // scroll into the end of the page so the address placeholder won't be hidden
398
+ const yOffset = this.type === 'shipping' ? 100 : 600;
399
+ const parentWrapper = this.el.closest('.zonos--group');
400
+ const y = this.el.getBoundingClientRect().top + yOffset;
401
+ parentWrapper === null || parentWrapper === void 0 ? void 0 : parentWrapper.scrollTo({ behavior: 'smooth', top: y });
402
+ }
403
+ }
404
+ }, 600);
405
+ }
406
+ }
407
+ this.setCustomAddressFormToStripeAddressEventData();
408
+ // Start requesting google place suggestions when address line 1 is more than 3 characters (No need to request suggestions on first initialization if address is pre-filled)
409
+ if (this.startGooglePlaceSuggestions &&
410
+ zonosStore.checkoutAddressService &&
411
+ !this.isFirstInitialization) {
412
+ this.throttledGetAddressSuggestions();
413
+ }
414
+ }
415
+ formFieldsChanged() {
416
+ this.setCustomAddressFormToStripeAddressEventData();
417
+ }
418
+ addressSuggestionSelected({ placeDetails, }) {
419
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
420
+ // Set the trigger to true when the address suggestion is selected so we won't trigger the suggestion again
421
+ this.suggestionClicked = true;
422
+ this.startGooglePlaceSuggestions = false;
423
+ const addressInfo = placeDetails.addressComponents;
424
+ const addressLine1 = mergeAddress({
425
+ addresses: [
426
+ (_a = addressInfo === null || addressInfo === void 0 ? void 0 : addressInfo.find(address => address.types.includes('street_number'))) === null || _a === void 0 ? void 0 : _a.longText,
427
+ (_b = addressInfo === null || addressInfo === void 0 ? void 0 : addressInfo.find(address => address.types.includes('route'))) === null || _b === void 0 ? void 0 : _b.longText,
428
+ ],
429
+ });
430
+ const subtituteAddressLine1 = mergeAddress({
431
+ addresses: [
432
+ (_c = addressInfo === null || addressInfo === void 0 ? void 0 : addressInfo.find(address => address.types.includes('premise'))) === null || _c === void 0 ? void 0 : _c.longText,
433
+ ((_d = addressInfo === null || addressInfo === void 0 ? void 0 : addressInfo.find(address => address.types.includes('sublocality_level_2'))) === null || _d === void 0 ? void 0 : _d.longText) ||
434
+ ((_e = addressInfo === null || addressInfo === void 0 ? void 0 : addressInfo.find(address => address.types.includes('sublocality_level_3'))) === null || _e === void 0 ? void 0 : _e.longText) ||
435
+ ((_f = addressInfo === null || addressInfo === void 0 ? void 0 : addressInfo.find(address => address.types.includes('sublocality_level_4'))) === null || _f === void 0 ? void 0 : _f.longText) ||
436
+ ((_g = addressInfo === null || addressInfo === void 0 ? void 0 : addressInfo.find(address => address.types.includes('sublocality_level_5'))) === null || _g === void 0 ? void 0 : _g.longText),
437
+ ],
438
+ });
439
+ const addressLine2 = mergeAddress({
440
+ addresses: [
441
+ (_h = addressInfo === null || addressInfo === void 0 ? void 0 : addressInfo.find(address => address.types.includes('subpremise'))) === null || _h === void 0 ? void 0 : _h.longText,
442
+ (_j = addressInfo === null || addressInfo === void 0 ? void 0 : addressInfo.find(address => address.types.includes('neighborhood'))) === null || _j === void 0 ? void 0 : _j.longText,
443
+ ],
444
+ delimiter: ', ',
445
+ });
446
+ const city = mergeAddress({
447
+ addresses: [
448
+ ((_k = addressInfo === null || addressInfo === void 0 ? void 0 : addressInfo.find(address => address.types.includes('locality'))) === null || _k === void 0 ? void 0 : _k.longText) ||
449
+ ((_l = addressInfo === null || addressInfo === void 0 ? void 0 : addressInfo.find(address => address.types.includes('sublocality_level_1'))) === null || _l === void 0 ? void 0 : _l.longText) ||
450
+ ((_m = addressInfo === null || addressInfo === void 0 ? void 0 : addressInfo.find(address => address.types.includes('administrative_area_level_1'))) === null || _m === void 0 ? void 0 : _m.longText),
451
+ ],
452
+ });
453
+ const state = mergeAddress({
454
+ addresses: [
455
+ (_o = addressInfo === null || addressInfo === void 0 ? void 0 : addressInfo.find(address => address.types.includes('administrative_area_level_1'))) === null || _o === void 0 ? void 0 : _o.shortText,
456
+ ],
457
+ });
458
+ const postalCode = mergeAddress({
459
+ addresses: [
460
+ (_p = addressInfo === null || addressInfo === void 0 ? void 0 : addressInfo.find(address => address.types.includes('postal_code'))) === null || _p === void 0 ? void 0 : _p.longText,
461
+ ],
462
+ });
463
+ const country = mergeAddress({
464
+ addresses: [
465
+ (_q = addressInfo === null || addressInfo === void 0 ? void 0 : addressInfo.find(address => address.types.includes('country'))) === null || _q === void 0 ? void 0 : _q.shortText,
466
+ ],
467
+ });
468
+ this.setFormValues({
469
+ city: city,
470
+ country: country,
471
+ line1: addressLine1 || subtituteAddressLine1,
472
+ line2: addressLine2,
473
+ postal_code: postalCode,
474
+ state: state,
475
+ });
476
+ }
477
+ setFormValues(values) {
478
+ if (values.city !== undefined)
479
+ this.city = values.city;
480
+ if (values.country !== undefined)
481
+ this.country = values.country;
482
+ if (values.firstName !== undefined)
483
+ this.firstName = values.firstName;
484
+ if (values.lastName !== undefined)
485
+ this.lastName = values.lastName;
486
+ if (values.line1 !== undefined)
487
+ this.line1 = values.line1;
488
+ if (values.line2 !== undefined)
489
+ this.line2 = values.line2;
490
+ if (values.phone !== undefined)
491
+ this.phone = values.phone;
492
+ if (values.postal_code !== undefined)
493
+ this.postalCode = values.postal_code;
494
+ if (values.state !== undefined)
495
+ this.state = values.state;
496
+ }
497
+ /**
498
+ * Initialize the address suggestions
499
+ */
500
+ initAddressSuggestions() {
501
+ // Only initialize the address suggestions if the address service is not already initialized
502
+ if (!zonosStore.checkoutAddressService ||
503
+ (!!this.onAddressSuggestionsUnsubscribe &&
504
+ !!this.onAddressSelectedUnsubscribe)) {
505
+ return;
506
+ }
507
+ log('on initAddressSuggestions', 'info');
508
+ this.onAddressSuggestionsUnsubscribe =
509
+ zonosStore.checkoutAddressService.onAddressSuggestions(({ suggestions, type }) => {
510
+ // Only update the address suggestions if the type matches the current type
511
+ if (type !== this.type) {
512
+ return;
513
+ }
514
+ this.addressSuggestions = suggestions;
515
+ });
516
+ this.onAddressSelectedUnsubscribe =
517
+ zonosStore.checkoutAddressService.onAddressSelected(data => {
518
+ if (data.type !== this.type) {
519
+ return;
520
+ }
521
+ this.addressSuggestions = [];
522
+ this.addressSuggestionSelected(data);
523
+ });
524
+ this.validate({
525
+ type: this.type,
526
+ value: this.firstName,
527
+ valueType: 'firstName',
528
+ });
529
+ this.validate({
530
+ type: this.type,
531
+ value: this.lastName,
532
+ valueType: 'lastName',
533
+ });
534
+ this.validate({
535
+ type: this.type,
536
+ value: this.line1,
537
+ valueType: 'line1',
538
+ });
539
+ this.validate({
540
+ type: this.type,
541
+ value: this.phone,
542
+ valueType: 'phone',
543
+ });
544
+ this.validate({
545
+ type: this.type,
546
+ value: this.postalCode,
547
+ valueType: 'postalCode',
548
+ });
549
+ this.validate({
550
+ type: this.type,
551
+ value: this.state,
552
+ valueType: 'state',
553
+ });
554
+ this.validate({
555
+ type: this.type,
556
+ value: this.city,
557
+ valueType: 'city',
558
+ });
559
+ this.validate({
560
+ type: this.type,
561
+ value: this.phone,
562
+ valueType: 'phone',
563
+ });
564
+ }
565
+ shouldEnabledCustomAddressChanged() {
566
+ // Only initialize the address suggestions if the address service is not already initialized
567
+ this.initAddressSuggestions();
568
+ this.initDefaultCustomAddressForm();
569
+ }
570
+ shippingZonesChanged() {
571
+ this.shippingZones = localizationStore.shippingZoneCountries;
572
+ this.shipToCountries = Object.values(this.shippingZones || {})
573
+ .map(country => ({
574
+ label: country.displayName,
575
+ value: country.code,
576
+ }))
577
+ .sort((a, b) => {
578
+ return a.label.localeCompare(b.label);
579
+ });
580
+ }
581
+ renderCustomAddressForm() {
582
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
583
+ const _w = this.getCustomAddressErrors(), { showError } = _w, customAddressErrors = __rest(_w, ["showError"]);
584
+ const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
585
+ const countryCode = stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country;
586
+ this.countryField =
587
+ ((_a = zonosStore.genericSettings) === null || _a === void 0 ? void 0 : _a.countryFields) && countryCode
588
+ ? (_c = (_b = zonosStore.genericSettings) === null || _b === void 0 ? void 0 : _b.countryFields) === null || _c === void 0 ? void 0 : _c[countryCode]
589
+ : null;
590
+ const firstCountry = (_d = this.shipToCountries) === null || _d === void 0 ? void 0 : _d[0];
591
+ const stateOptions = Object.entries(((_e = this.countryField) === null || _e === void 0 ? void 0 : _e.regions) || {})
592
+ .map(([label, region]) => ({
593
+ label,
594
+ value: region.interpayCode,
595
+ }))
596
+ .sort((a, b) => a.label.localeCompare(b.label));
597
+ return (h("div", { "aria-label": `${this.type} address form`, class: "zonos--custom-address-form", role: "form" }, h("zonos-stripe-input", { "aria-required": "true", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.firstName : undefined, inputLabel: translate('First name'), inputValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName, onInputChange: (event) => {
598
+ this.validate({
599
+ type: this.type,
600
+ value: event.detail,
601
+ valueType: 'firstName',
602
+ });
603
+ /**
604
+ * Order of operations is important here:
605
+ * 1. validate() updates all input error states
606
+ * 2. Setting postalCode triggers @Watch('postalCode')
607
+ * 3. getIsComplete() checks customAddressErrors state
608
+ * Therefore, we must update the value after validation to ensure correct error state
609
+ */
610
+ this.firstName = event.detail;
611
+ }, required: true }), h("zonos-stripe-input", { "aria-required": "true", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.lastName : undefined, inputLabel: translate('Last name'), inputValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName, onInputChange: (event) => {
612
+ this.validate({
613
+ type: this.type,
614
+ value: event.detail,
615
+ valueType: 'lastName',
616
+ });
617
+ /**
618
+ * Order of operations is important here:
619
+ * 1. validate() updates all input error states
620
+ * 2. Setting postalCode triggers @Watch('postalCode')
621
+ * 3. getIsComplete() checks customAddressErrors state
622
+ * Therefore, we must update the value after validation to ensure correct error state
623
+ */
624
+ this.lastName = event.detail;
625
+ }, required: true }), h("zonos-stripe-select", { "aria-required": "true", autoComplete: "shipping country", class: "zonos--custom-address-form-input", name: `${this.type}-country`, onSelectChange: (event) => {
626
+ this.country = event.detail;
627
+ this.city = '';
628
+ this.state = '';
629
+ this.postalCode = '';
630
+ }, options: this.shipToCountries || [], required: true, selectLabel: translate('Country'), selectedValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
631
+ localizationStore.selectedCountryCode ||
632
+ (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) => {
633
+ this.validate({
634
+ type: this.type,
635
+ value: event.detail,
636
+ valueType: 'line1',
637
+ });
638
+ /**
639
+ * Order of operations is important here:
640
+ * 1. validate() updates all input error states
641
+ * 2. Setting postalCode triggers @Watch('postalCode')
642
+ * 3. getIsComplete() checks customAddressErrors state
643
+ * Therefore, we must update the value after validation to ensure correct error state
644
+ */
645
+ this.line1 = event.detail;
646
+ }, onKeyDown: event => {
647
+ // Clear the address suggestions when the user presses the escape key
648
+ if (event.key === 'Escape') {
649
+ event.preventDefault();
650
+ event.stopPropagation();
651
+ this.addressSuggestions = [];
652
+ }
653
+ }, required: true }), h("zonos-address-suggestions", { onSuggestionSelected: e => {
654
+ var _a;
655
+ const { placeId } = e.detail;
656
+ (_a = zonosStore.checkoutAddressService) === null || _a === void 0 ? void 0 : _a.selectAddress({
657
+ placeId,
658
+ type: this.type,
659
+ });
660
+ }, suggestions: this.addressSuggestions, type: this.type })), h("div", { "aria-label": "Additional address details", class: classes([
661
+ 'zonos--custom-address-form-additional-fields',
662
+ countryCode && this.isAddressLine1Entered ? 'show' : '',
663
+ ]), role: "group" }, h("zonos-stripe-input", { "aria-required": "false", autoComplete: "shipping address-line2", class: "zonos--custom-address-form-input", inputLabel: translate(((_f = this.countryField) === null || _f === void 0 ? void 0 : _f.address2Label) || 'Address line 2'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.line2) || '', onInputChange: (event) => {
664
+ this.line2 = event.detail;
665
+ } }), ((_g = this.countryField) === null || _g === void 0 ? void 0 : _g.cityShow) && (h("zonos-stripe-input", { "aria-required": ((_h = this.countryField) === null || _h === void 0 ? void 0 : _h.cityRequired) ? 'true' : 'false', autoComplete: "shipping address-level2", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.city : undefined, inputLabel: translate(((_j = this.countryField) === null || _j === void 0 ? void 0 : _j.cityLabel) || 'City'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.city) || '', name: "locality", onInputChange: (event) => {
666
+ this.validate({
667
+ type: this.type,
668
+ value: event.detail,
669
+ valueType: 'city',
670
+ });
671
+ /**
672
+ * Order of operations is important here:
673
+ * 1. validate() updates all input error states
674
+ * 2. Setting postalCode triggers @Watch('postalCode')
675
+ * 3. getIsComplete() checks customAddressErrors state
676
+ * Therefore, we must update the value after validation to ensure correct error state
677
+ */
678
+ this.city = event.detail;
679
+ }, required: (_k = this.countryField) === null || _k === void 0 ? void 0 : _k.cityRequired })), h("div", { class: "zonos--custom-address-form-state-zip-wrapper" }, ((_l = this.countryField) === null || _l === void 0 ? void 0 : _l.stateShow) && (h("zonos-stripe-select", { "aria-required": ((_m = this.countryField) === null || _m === void 0 ? void 0 : _m.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) => {
680
+ this.validate({
681
+ type: this.type,
682
+ value: event.detail,
683
+ valueType: 'state',
684
+ });
685
+ /**
686
+ * Order of operations is important here:
687
+ * 1. validate() updates all input error states
688
+ * 2. Setting postalCode triggers @Watch('postalCode')
689
+ * 3. getIsComplete() checks customAddressErrors state
690
+ * Therefore, we must update the value after validation to ensure correct error state
691
+ */
692
+ this.state = event.detail;
693
+ }, options: stateOptions, required: (_o = this.countryField) === null || _o === void 0 ? void 0 : _o.stateRequired, selectLabel: translate(((_p = this.countryField) === null || _p === void 0 ? void 0 : _p.stateLabel) || 'State'), selectedValue: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.state, title: `${this.type} state` })), ((_q = this.countryField) === null || _q === void 0 ? void 0 : _q.zipShow) && (h("zonos-stripe-input", { "aria-describedby": ((_r = this.countryField) === null || _r === void 0 ? void 0 : _r.zipFormat)
694
+ ? `zip-format-${this.type}`
695
+ : undefined, "aria-required": ((_s = this.countryField) === null || _s === void 0 ? void 0 : _s.zipRequired) ? 'true' : 'false', autoComplete: "shipping postal-code", class: "zonos--custom-address-form-input", error: showError ? customAddressErrors.postalCode : undefined, inputLabel: translate(((_t = this.countryField) === null || _t === void 0 ? void 0 : _t.zipLabel) || 'Zip'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.postal_code) || '', onInputChange: (event) => {
696
+ this.validate({
697
+ type: this.type,
698
+ value: event.detail,
699
+ valueType: 'postalCode',
700
+ });
701
+ /**
702
+ * Order of operations is important here:
703
+ * 1. validate() updates all input error states
704
+ * 2. Setting postalCode triggers @Watch('postalCode')
705
+ * 3. getIsComplete() checks customAddressErrors state
706
+ * Therefore, we must update the value after validation to ensure correct error state
707
+ */
708
+ this.postalCode = event.detail;
709
+ }, required: (_u = this.countryField) === null || _u === void 0 ? void 0 : _u.zipRequired }))), 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: (_v = zonosStore.genericSettings) === null || _v === void 0 ? void 0 : _v.countryFields, error: showError ? customAddressErrors.phone : undefined, inputLabel: translate('Phone number'), inputValue: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone) || '', onInputValueChange: event => {
710
+ const { isEmpty, phoneNumber, valid, wrongFormat } = event.detail;
711
+ // Validate the phone number
712
+ this.validate({
713
+ phoneValidateInfo: {
714
+ isEmpty,
715
+ isValid: valid,
716
+ wrongFormat,
717
+ },
718
+ type: this.type,
719
+ value: phoneNumber,
720
+ valueType: 'phone',
721
+ });
722
+ /**
723
+ * Order of operations is important here:
724
+ * 1. validate() updates all input error states
725
+ * 2. Setting postalCode triggers @Watch('postalCode')
726
+ * 3. getIsComplete() checks customAddressErrors state
727
+ * Therefore, we must update the value after validation to ensure correct error state
728
+ */
729
+ this.phone = phoneNumber;
730
+ } }))));
731
+ }
732
+ disconnectedCallback() {
733
+ var _a, _b;
734
+ // destroy the stripe element when this component is removed from the DOM, so that we can re-create the new one with previous value
735
+ const stripeElement = this.getStripeAddressInstance().stripeAddressElement;
736
+ stripeElement === null || stripeElement === void 0 ? void 0 : stripeElement.destroy();
737
+ // unsubscribe from address suggestions when this component is removed from the DOM
738
+ (_a = this.onAddressSuggestionsUnsubscribe) === null || _a === void 0 ? void 0 : _a.call(this);
739
+ (_b = this.onAddressSelectedUnsubscribe) === null || _b === void 0 ? void 0 : _b.call(this);
740
+ }
741
+ componentWillLoad() {
742
+ if (zonosStore.checkoutAddressService) {
743
+ this.initDefaultCustomAddressForm();
744
+ }
745
+ }
746
+ componentDidLoad() {
747
+ const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
748
+ this.shipToCountries = Object.values(localizationStore.shippingZoneCountries || {})
749
+ .map(country => ({
750
+ label: country.displayName,
751
+ value: country.code,
752
+ }))
753
+ .sort((a, b) => {
754
+ return a.label.localeCompare(b.label);
755
+ });
756
+ this.isDirtyAddress =
757
+ !!stripeAddressEventData &&
758
+ stripeAddressEventData.value.address.line1.length > 0;
759
+ // @Watch doesn't get trigger on initial load
760
+ this.initAddressSuggestions();
761
+ this.isFirstInitialization = false;
762
+ }
763
+ render() {
764
+ var _a;
765
+ this.shippingZones = localizationStore.shippingZoneCountries;
766
+ this.addressService = zonosStore.checkoutAddressService;
767
+ this.checkoutSessionId = cartStore.checkoutSessionId;
768
+ if ((_a = stripeStore.stripeAddressEventData) === null || _a === void 0 ? void 0 : _a.complete) {
769
+ this.isAddressFilled = true;
770
+ }
771
+ // Only set country if custom address form is enabled
772
+ if (!this.country && localizationStore.selectedCountryCode) {
773
+ this.country = localizationStore.selectedCountryCode;
774
+ }
775
+ // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
776
+ return (h(Host, { key: '95789d8a050c6fd7461152b0053db0702c53698b', class: classes([
777
+ 'zonos--address zonos--elements',
778
+ `zonos--${this.type}-address`,
779
+ ]) }, h("zonos-text", { key: '4d8a9a52a6059be4003f231eec12bd4fa9e2428c', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), this.renderCompanyNameInput(), this.renderCustomAddressForm()));
780
+ }
781
+ static get is() { return "zonos-custom-address"; }
782
+ static get encapsulation() { return "scoped"; }
783
+ static get originalStyleUrls() {
784
+ return {
785
+ "$": ["zonos-custom-address.scss"]
786
+ };
787
+ }
788
+ static get styleUrls() {
789
+ return {
790
+ "$": ["zonos-custom-address.css"]
791
+ };
792
+ }
793
+ static get properties() {
794
+ return {
795
+ "type": {
796
+ "type": "string",
797
+ "mutable": false,
798
+ "complexType": {
799
+ "original": "'billing' | 'shipping'",
800
+ "resolved": "\"billing\" | \"shipping\"",
801
+ "references": {}
802
+ },
803
+ "required": true,
804
+ "optional": false,
805
+ "docs": {
806
+ "tags": [],
807
+ "text": "The type of address element to render"
808
+ },
809
+ "getter": false,
810
+ "setter": false,
811
+ "attribute": "type",
812
+ "reflect": false
813
+ },
814
+ "titleText": {
815
+ "type": "string",
816
+ "mutable": false,
817
+ "complexType": {
818
+ "original": "string",
819
+ "resolved": "string",
820
+ "references": {}
821
+ },
822
+ "required": true,
823
+ "optional": false,
824
+ "docs": {
825
+ "tags": [],
826
+ "text": "The title text for the address element"
827
+ },
828
+ "getter": false,
829
+ "setter": false,
830
+ "attribute": "title-text",
831
+ "reflect": false
832
+ },
833
+ "defaultAddress": {
834
+ "type": "unknown",
835
+ "mutable": false,
836
+ "complexType": {
837
+ "original": "ContactOption[]",
838
+ "resolved": "ContactOption[]",
839
+ "references": {
840
+ "ContactOption": {
841
+ "location": "import",
842
+ "path": "@stripe/stripe-js",
843
+ "id": "node_modules::ContactOption"
844
+ }
845
+ }
846
+ },
847
+ "required": false,
848
+ "optional": false,
849
+ "docs": {
850
+ "tags": [],
851
+ "text": "Default address for stripe"
852
+ },
853
+ "getter": false,
854
+ "setter": false,
855
+ "defaultValue": "[]"
856
+ }
857
+ };
858
+ }
859
+ static get states() {
860
+ return {
861
+ "stripe": {},
862
+ "isDirtyAddress": {},
863
+ "isAddressFilled": {},
864
+ "isAddressLine1Entered": {},
865
+ "addressSuggestions": {},
866
+ "countryField": {},
867
+ "startGooglePlaceSuggestions": {},
868
+ "shipToCountries": {},
869
+ "shippingZones": {},
870
+ "city": {},
871
+ "country": {},
872
+ "firstName": {},
873
+ "lastName": {},
874
+ "line1": {},
875
+ "line2": {},
876
+ "phone": {},
877
+ "postalCode": {},
878
+ "state": {},
879
+ "cityError": {},
880
+ "stateError": {},
881
+ "postalCodeError": {},
882
+ "phoneError": {},
883
+ "firstNameError": {},
884
+ "lastNameError": {},
885
+ "isFirstInitialization": {},
886
+ "addressService": {},
887
+ "checkoutSessionId": {}
888
+ };
889
+ }
890
+ static get events() {
891
+ return [{
892
+ "method": "invalidCharacters",
893
+ "name": "invalidCharacters",
894
+ "bubbles": true,
895
+ "cancelable": true,
896
+ "composed": true,
897
+ "docs": {
898
+ "tags": [],
899
+ "text": "Event to emit when address is not containing allowed character sets"
900
+ },
901
+ "complexType": {
902
+ "original": "boolean",
903
+ "resolved": "boolean",
904
+ "references": {}
905
+ }
906
+ }, {
907
+ "method": "addressChange",
908
+ "name": "addressChange",
909
+ "bubbles": true,
910
+ "cancelable": true,
911
+ "composed": true,
912
+ "docs": {
913
+ "tags": [],
914
+ "text": "Event to emit when address is changed"
915
+ },
916
+ "complexType": {
917
+ "original": "{\n errors: CustomAddressErrors;\n type: 'billing' | 'shipping';\n value: StripeAddressElementChangeEvent;\n }",
918
+ "resolved": "{ errors: CustomAddressErrors; type: \"billing\" | \"shipping\"; value: StripeAddressElementChangeEvent; }",
919
+ "references": {
920
+ "CustomAddressErrors": {
921
+ "location": "import",
922
+ "path": "src/types/checkout/form/CustomAddressErrors",
923
+ "id": "src/types/checkout/form/CustomAddressErrors.ts::CustomAddressErrors"
924
+ },
925
+ "StripeAddressElementChangeEvent": {
926
+ "location": "import",
927
+ "path": "@stripe/stripe-js",
928
+ "id": "node_modules::StripeAddressElementChangeEvent"
929
+ }
930
+ }
931
+ }
932
+ }];
933
+ }
934
+ static get elementRef() { return "el"; }
935
+ static get watchers() {
936
+ return [{
937
+ "propName": "checkoutSessionId",
938
+ "methodName": "isAddressFilledChanged"
939
+ }, {
940
+ "propName": "isAddressFilled",
941
+ "methodName": "isAddressFilledChanged"
942
+ }, {
943
+ "propName": "defaultAddress",
944
+ "methodName": "defaultAddressChanged"
945
+ }, {
946
+ "propName": "line1",
947
+ "methodName": "line1Changed"
948
+ }, {
949
+ "propName": "city",
950
+ "methodName": "formFieldsChanged"
951
+ }, {
952
+ "propName": "country",
953
+ "methodName": "formFieldsChanged"
954
+ }, {
955
+ "propName": "firstName",
956
+ "methodName": "formFieldsChanged"
957
+ }, {
958
+ "propName": "lastName",
959
+ "methodName": "formFieldsChanged"
960
+ }, {
961
+ "propName": "line2",
962
+ "methodName": "formFieldsChanged"
963
+ }, {
964
+ "propName": "phone",
965
+ "methodName": "formFieldsChanged"
966
+ }, {
967
+ "propName": "postalCode",
968
+ "methodName": "formFieldsChanged"
969
+ }, {
970
+ "propName": "state",
971
+ "methodName": "formFieldsChanged"
972
+ }, {
973
+ "propName": "addressService",
974
+ "methodName": "shouldEnabledCustomAddressChanged"
975
+ }, {
976
+ "propName": "shippingZones",
977
+ "methodName": "shippingZonesChanged"
978
+ }];
979
+ }
980
+ }