@zonos/elements 1.3.15-alpha.3 → 1.3.16-alpha.0

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 (452) hide show
  1. package/dist/cjs/RemoveIcon-081ac073.js +5 -0
  2. package/dist/cjs/{cart-1b1d39af.js → cart-db549f04.js} +976 -138
  3. package/dist/cjs/containsNonLatinChars-2be5129b.js +24 -0
  4. package/dist/cjs/{getBorderRadius-c8cc2bb3.js → getBorderRadius-44b3eca1.js} +4 -6
  5. package/dist/cjs/index-654a6001.js +1361 -0
  6. package/dist/cjs/isCheckoutMobile-f491ca7c.js +8 -0
  7. package/dist/cjs/{isColorVariable-fff5e469.js → isColorVariable-6f5a9608.js} +2 -2
  8. package/dist/cjs/{isDarkColor-f5473002.js → isDarkColor-01f45d3f.js} +1 -1
  9. package/dist/cjs/loader.cjs.js +2 -2
  10. package/dist/cjs/{submitGtag-ab287a34.js → submitGtag-fd8acad5.js} +21 -2
  11. package/dist/cjs/zonos-address_8.cjs.entry.js +642 -0
  12. package/dist/cjs/zonos-badge_2.cjs.entry.js +9 -9
  13. package/dist/cjs/zonos-banner.cjs.entry.js +5 -5
  14. package/dist/cjs/zonos-button_3.cjs.entry.js +192 -0
  15. package/dist/cjs/zonos-card_2.cjs.entry.js +12 -12
  16. package/dist/cjs/{zonos-cart-items_10.cjs.entry.js → zonos-cart-items_9.cjs.entry.js} +150 -124
  17. package/dist/cjs/zonos-checkout.cjs.entry.js +20 -19
  18. package/dist/cjs/zonos-component.cjs.entry.js +2 -2
  19. package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
  20. package/dist/cjs/zonos-country-flag.cjs.entry.js +5 -5
  21. package/dist/cjs/zonos-country-select_3.cjs.entry.js +16 -16
  22. package/dist/cjs/zonos-elements.cjs.js +10 -10
  23. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +9 -9
  24. package/dist/cjs/zonos-hello.cjs.entry.js +6 -6
  25. package/dist/cjs/zonos-input.cjs.entry.js +57 -0
  26. package/dist/cjs/zonos-link.cjs.entry.js +3 -3
  27. package/dist/cjs/zonos-logo.cjs.entry.js +4 -4
  28. package/dist/cjs/zonos-notification.cjs.entry.js +5 -5
  29. package/dist/cjs/zonos-payment.cjs.entry.js +6 -6
  30. package/dist/cjs/zonos-select-dialog-header_2.cjs.entry.js +7 -7
  31. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +10 -8
  32. package/dist/cjs/zonos-text.cjs.entry.js +6 -5
  33. package/dist/cjs/{zonosStore-aee974e0.js → zonosStore-d8bb0bda.js} +1 -1
  34. package/dist/collection/__mocks__/vercel-app/zonos-hello.entry.js +1 -1
  35. package/dist/collection/__mocks__/zonos-url/zonos-hello.entry.js +1 -1
  36. package/dist/collection/collection-manifest.json +5 -1
  37. package/dist/collection/components/checkout/zonos-checkout/assets/LeftArrow.svg +1 -1
  38. package/dist/collection/components/checkout/zonos-checkout/assets/RemoveIcon.svg +1 -1
  39. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.css +62 -0
  40. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.js +80 -0
  41. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.css +59 -0
  42. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.js +148 -0
  43. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.css +115 -0
  44. package/dist/collection/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.js +429 -0
  45. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.css +2 -2
  46. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-items/zonos-cart-items.js +1 -1
  47. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.css +2 -2
  48. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/assets/RemoveIcon.svg +1 -1
  49. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/assets/SuccessIcon.svg +1 -1
  50. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.css +1 -1
  51. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +5 -3
  52. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/assets/chevronDownIcon.svg +1 -1
  53. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/assets/globe.svg +1 -1
  54. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/assets/zonosIcon.svg +1 -1
  55. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.css +8 -8
  56. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +2 -2
  57. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.css +3 -3
  58. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.css +10 -10
  59. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +7 -5
  60. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.css +3 -3
  61. package/dist/collection/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js +135 -20
  62. package/dist/collection/components/checkout/zonos-checkout/zonos-review/assets/ChevronDownIcon.svg +1 -1
  63. package/dist/collection/components/checkout/zonos-checkout/zonos-review/assets/ChevronUpIcon.svg +1 -1
  64. package/dist/collection/components/checkout/zonos-checkout/zonos-review/zonos-review.css +1 -1
  65. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.css +3 -3
  66. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +1 -1
  67. package/dist/collection/components/common/component-template/zonos-link/zonos-link.css +4 -4
  68. package/dist/collection/components/common/component-template/zonos-link/zonos-link.js +1 -1
  69. package/dist/collection/components/common/zonos-badge/zonos-badge.css +30 -30
  70. package/dist/collection/components/common/zonos-badge/zonos-badge.js +3 -3
  71. package/dist/collection/components/common/zonos-banner/zonos-banner.css +10 -10
  72. package/dist/collection/components/common/zonos-banner/zonos-banner.js +2 -2
  73. package/dist/collection/components/common/zonos-button/zonos-button.css +63 -62
  74. package/dist/collection/components/common/zonos-button/zonos-button.js +17 -8
  75. package/dist/collection/components/common/zonos-card/zonos-card.css +7 -7
  76. package/dist/collection/components/common/zonos-card/zonos-card.js +3 -3
  77. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.css +4 -3
  78. package/dist/collection/components/common/zonos-checkbox/zonos-checkbox.js +26 -8
  79. package/dist/collection/components/common/zonos-checkout-progress-tabs/zonos-checkout-progress-tabs.js +4 -4
  80. package/dist/collection/components/common/zonos-collapse/zonos-collapse.js +2 -2
  81. package/dist/collection/components/common/zonos-country-select/zonos-country-select.css +8 -8
  82. package/dist/collection/components/common/zonos-country-select/zonos-country-select.js +2 -2
  83. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.css +2 -2
  84. package/dist/collection/components/common/zonos-custom-message/zonos-custom-message.js +2 -2
  85. package/dist/collection/components/common/zonos-dialog/zonos-dialog.css +14 -14
  86. package/dist/collection/components/common/zonos-dialog/zonos-dialog.js +6 -4
  87. package/dist/collection/components/common/zonos-icon/zonos-icon.js +1 -1
  88. package/dist/collection/components/common/zonos-input/zonos-input.css +176 -0
  89. package/dist/collection/components/common/zonos-input/zonos-input.js +193 -0
  90. package/dist/collection/components/common/zonos-language-select/zonos-language-select.css +2 -2
  91. package/dist/collection/components/common/zonos-language-select/zonos-language-select.js +2 -2
  92. package/dist/collection/components/common/zonos-logo/zonos-logo.js +2 -2
  93. package/dist/collection/components/common/zonos-notification/zonos-notification.css +4 -4
  94. package/dist/collection/components/common/zonos-notification/zonos-notification.js +2 -2
  95. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.css +1 -1
  96. package/dist/collection/components/common/zonos-select-dialog-header/zonos-select-dialog-header.js +2 -2
  97. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.css +7 -7
  98. package/dist/collection/components/common/zonos-shipping-rich-radio/zonos-shipping-rich-radio.js +5 -3
  99. package/dist/collection/components/common/zonos-spinner/zonos-spinner.css +14 -14
  100. package/dist/collection/components/common/zonos-text/zonos-text.css +7 -7
  101. package/dist/collection/components/common/zonos-text/zonos-text.js +2 -1
  102. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.css +3 -3
  103. package/dist/collection/components/common/zonos-tooltip/zonos-tooltip.js +2 -2
  104. package/dist/collection/components/common/zonos-v-stack/zonos-v-stack.js +2 -2
  105. package/dist/collection/components/component-template/zonos-component/zonos-component.js +1 -1
  106. package/dist/collection/components/hello/zonos-hello/zonos-hello.css +30 -30
  107. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/chevronDownIcon.svg +1 -1
  108. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/globe.svg +1 -1
  109. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/assets/zonosIcon.svg +1 -1
  110. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.css +385 -378
  111. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog-footer/zonos-hello-dialog-footer.js +2 -2
  112. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.css +11 -11
  113. package/dist/collection/components/hello/zonos-hello-dialog/zonos-hello-dialog.js +3 -3
  114. package/dist/collection/components/main/zonos-controller.js +2 -2
  115. package/dist/collection/components/store/checkout/stripe.js +153 -14
  116. package/dist/collection/components/store/translationStore/strings.arabic.js +36 -6
  117. package/dist/collection/components/store/translationStore/strings.base.js +36 -6
  118. package/dist/collection/components/store/translationStore/strings.chinese.js +36 -6
  119. package/dist/collection/components/store/translationStore/strings.danish.js +36 -6
  120. package/dist/collection/components/store/translationStore/strings.dutch.js +36 -6
  121. package/dist/collection/components/store/translationStore/strings.french.js +36 -6
  122. package/dist/collection/components/store/translationStore/strings.german.js +36 -6
  123. package/dist/collection/components/store/translationStore/strings.hebrew.js +36 -6
  124. package/dist/collection/components/store/translationStore/strings.indonesian.js +36 -6
  125. package/dist/collection/components/store/translationStore/strings.italian.js +36 -6
  126. package/dist/collection/components/store/translationStore/strings.japanese.js +36 -6
  127. package/dist/collection/components/store/translationStore/strings.korean.js +36 -6
  128. package/dist/collection/components/store/translationStore/strings.norwegian.js +36 -6
  129. package/dist/collection/components/store/translationStore/strings.polish.js +36 -6
  130. package/dist/collection/components/store/translationStore/strings.portuguese.js +36 -6
  131. package/dist/collection/components/store/translationStore/strings.russian.js +36 -6
  132. package/dist/collection/components/store/translationStore/strings.spanish.js +36 -6
  133. package/dist/collection/components/store/translationStore/strings.swedish.js +36 -6
  134. package/dist/collection/components/store/translationStore/strings.turkish.js +36 -6
  135. package/dist/collection/components/store/translationStore/strings.vietnamese.js +36 -6
  136. package/dist/collection/components/stripe/zonos-address/zonos-address.js +3 -71
  137. package/dist/collection/components/stripe/zonos-link-authentication/zonos-link-authentication.js +29 -5
  138. package/dist/collection/components/stripe/zonos-payment/zonos-payment.js +1 -1
  139. package/dist/collection/components/utils/checkout/buildTranslateRequestBody.js +98 -0
  140. package/dist/collection/components/utils/containsNonLatinChars.js +10 -8
  141. package/dist/collection/components/utils/getBorderRadius.js +3 -5
  142. package/dist/collection/components/utils/getButtonTheme.js +1 -1
  143. package/dist/collection/components/utils/isColorVariable.js +2 -2
  144. package/dist/collection/styles/stripe/defaultVariable.js +2 -2
  145. package/dist/collection/types/checkout/TranslatedText.js +1 -0
  146. package/dist/collection/types/checkout/api/ValidateAddressRequest.js +1 -0
  147. package/dist/components/containsNonLatinChars.js +21 -0
  148. package/dist/components/getBorderRadius.js +3 -5
  149. package/dist/components/isColorVariable.js +2 -2
  150. package/dist/components/stripe.js +255 -4545
  151. package/dist/components/trackConversionEvent.js +1 -1
  152. package/dist/components/translationStore.js +5131 -0
  153. package/dist/components/zonos-address-display.d.ts +11 -0
  154. package/dist/components/zonos-address-display.js +6 -0
  155. package/dist/components/zonos-address-display2.js +64 -0
  156. package/dist/components/zonos-address-form.d.ts +11 -0
  157. package/dist/components/zonos-address-form.js +6 -0
  158. package/dist/components/zonos-address-form2.js +84 -0
  159. package/dist/components/zonos-address-update-dialog.d.ts +11 -0
  160. package/dist/components/zonos-address-update-dialog.js +6 -0
  161. package/dist/components/zonos-address-update-dialog2.js +264 -0
  162. package/dist/components/zonos-address2.js +3 -93
  163. package/dist/components/zonos-badge2.js +4 -4
  164. package/dist/components/zonos-banner2.js +3 -3
  165. package/dist/components/zonos-button2.js +19 -10
  166. package/dist/components/zonos-card2.js +4 -4
  167. package/dist/components/zonos-cart-items2.js +2 -2
  168. package/dist/components/zonos-cart-subtotal2.js +3 -2
  169. package/dist/components/zonos-checkbox2.js +19 -10
  170. package/dist/components/zonos-checkout-finish2.js +29 -9
  171. package/dist/components/zonos-checkout-footer2.js +5 -5
  172. package/dist/components/zonos-checkout-payment2.js +3 -2
  173. package/dist/components/zonos-checkout-progress-tabs2.js +6 -5
  174. package/dist/components/zonos-checkout.js +73 -43
  175. package/dist/components/zonos-collapse2.js +2 -2
  176. package/dist/components/zonos-component.js +1 -1
  177. package/dist/components/zonos-controller.js +2 -2
  178. package/dist/components/zonos-country-select2.js +3 -3
  179. package/dist/components/zonos-custom-message2.js +3 -3
  180. package/dist/components/zonos-customer-info2.js +171 -30
  181. package/dist/components/zonos-dialog2.js +7 -5
  182. package/dist/components/zonos-hello-dialog-footer2.js +5 -5
  183. package/dist/components/zonos-hello-dialog2.js +6 -5
  184. package/dist/components/zonos-hello.js +3 -2
  185. package/dist/components/zonos-icon2.js +1 -1
  186. package/dist/components/zonos-input.d.ts +11 -0
  187. package/dist/components/zonos-input.js +6 -0
  188. package/dist/components/zonos-input2.js +78 -0
  189. package/dist/components/zonos-language-select2.js +5 -4
  190. package/dist/components/zonos-link-authentication2.js +12 -5
  191. package/dist/components/zonos-link.js +2 -2
  192. package/dist/components/zonos-logo.js +2 -2
  193. package/dist/components/zonos-notification2.js +3 -3
  194. package/dist/components/zonos-payment2.js +1 -1
  195. package/dist/components/zonos-review2.js +5 -4
  196. package/dist/components/zonos-select-dialog-header2.js +3 -3
  197. package/dist/components/zonos-shipping-rich-radio2.js +6 -4
  198. package/dist/components/zonos-shipping2.js +4 -3
  199. package/dist/components/zonos-spinner2.js +1 -1
  200. package/dist/components/zonos-text2.js +3 -2
  201. package/dist/components/zonos-tooltip2.js +3 -3
  202. package/dist/components/zonos-v-stack2.js +2 -2
  203. package/dist/esm/RemoveIcon-9dc5dd1a.js +3 -0
  204. package/dist/esm/{cart-10bcd2e0.js → cart-462e89a6.js} +976 -139
  205. package/dist/esm/containsNonLatinChars-2d8810c3.js +21 -0
  206. package/dist/esm/{getBorderRadius-8129b0cb.js → getBorderRadius-567f1786.js} +4 -6
  207. package/dist/esm/index-e063389c.js +1328 -0
  208. package/dist/esm/isCheckoutMobile-8846dccb.js +6 -0
  209. package/dist/esm/{isColorVariable-fbf2d80d.js → isColorVariable-82457bef.js} +2 -2
  210. package/dist/esm/{isDarkColor-7a6d2d14.js → isDarkColor-7f62035a.js} +1 -1
  211. package/dist/esm/loader.js +3 -3
  212. package/dist/esm/{submitGtag-84886899.js → submitGtag-ac7c3c89.js} +21 -3
  213. package/dist/esm/zonos-address_8.entry.js +631 -0
  214. package/dist/esm/zonos-badge_2.entry.js +9 -9
  215. package/dist/esm/zonos-banner.entry.js +5 -5
  216. package/dist/esm/zonos-button_3.entry.js +186 -0
  217. package/dist/esm/zonos-card_2.entry.js +12 -12
  218. package/dist/esm/{zonos-cart-items_10.entry.js → zonos-cart-items_9.entry.js} +146 -119
  219. package/dist/esm/zonos-checkout.entry.js +15 -14
  220. package/dist/esm/zonos-component.entry.js +2 -2
  221. package/dist/esm/zonos-controller.entry.js +6 -6
  222. package/dist/esm/zonos-country-flag.entry.js +5 -5
  223. package/dist/esm/zonos-country-select_3.entry.js +16 -16
  224. package/dist/esm/zonos-elements.js +11 -11
  225. package/dist/esm/zonos-hello-dialog.entry.js +9 -9
  226. package/dist/esm/zonos-hello.entry.js +6 -6
  227. package/dist/esm/zonos-input.entry.js +53 -0
  228. package/dist/esm/zonos-link.entry.js +3 -3
  229. package/dist/esm/zonos-logo.entry.js +4 -4
  230. package/dist/esm/zonos-notification.entry.js +5 -5
  231. package/dist/esm/zonos-payment.entry.js +6 -6
  232. package/dist/esm/zonos-select-dialog-header_2.entry.js +7 -7
  233. package/dist/esm/zonos-shipping-rich-radio.entry.js +10 -8
  234. package/dist/esm/zonos-text.entry.js +6 -5
  235. package/dist/esm/{zonosStore-f3eef64b.js → zonosStore-33ff08ff.js} +1 -1
  236. package/dist/esm-es5/RemoveIcon-9dc5dd1a.js +1 -0
  237. package/dist/esm-es5/cart-462e89a6.js +1 -0
  238. package/dist/esm-es5/containsNonLatinChars-2d8810c3.js +1 -0
  239. package/dist/esm-es5/getBorderRadius-567f1786.js +1 -0
  240. package/dist/esm-es5/index-e063389c.js +2 -0
  241. package/dist/esm-es5/isCheckoutMobile-8846dccb.js +1 -0
  242. package/dist/esm-es5/isColorVariable-82457bef.js +1 -0
  243. package/dist/esm-es5/{isDarkColor-7a6d2d14.js → isDarkColor-7f62035a.js} +1 -1
  244. package/dist/esm-es5/loader.js +1 -1
  245. package/dist/esm-es5/submitGtag-ac7c3c89.js +1 -0
  246. package/dist/esm-es5/zonos-address_8.entry.js +1 -0
  247. package/dist/esm-es5/zonos-badge_2.entry.js +1 -1
  248. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  249. package/dist/esm-es5/zonos-button_3.entry.js +1 -0
  250. package/dist/esm-es5/zonos-card_2.entry.js +1 -1
  251. package/dist/esm-es5/zonos-cart-items_9.entry.js +1 -0
  252. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  253. package/dist/esm-es5/zonos-component.entry.js +1 -1
  254. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  255. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  256. package/dist/esm-es5/zonos-country-select_3.entry.js +1 -1
  257. package/dist/esm-es5/zonos-elements.js +1 -1
  258. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  259. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  260. package/dist/esm-es5/zonos-input.entry.js +1 -0
  261. package/dist/esm-es5/zonos-link.entry.js +1 -1
  262. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  263. package/dist/esm-es5/zonos-notification.entry.js +1 -1
  264. package/dist/esm-es5/zonos-payment.entry.js +1 -1
  265. package/dist/esm-es5/zonos-select-dialog-header_2.entry.js +1 -1
  266. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  267. package/dist/esm-es5/zonos-text.entry.js +1 -1
  268. package/dist/esm-es5/{zonosStore-f3eef64b.js → zonosStore-33ff08ff.js} +1 -1
  269. package/dist/scripts/loadStripe.js +1 -1
  270. package/dist/scripts/loadZonos.js +1 -1
  271. package/dist/scripts/stripe.js +1 -1
  272. package/dist/scripts/zonos.js +1 -1
  273. package/dist/scripts/zonosBase.js +1 -1
  274. package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-display/zonos-address-display.d.ts +12 -0
  275. package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-form/zonos-address-form.d.ts +28 -0
  276. package/dist/types/components/checkout/zonos-checkout/zonos-address-update-dialog/zonos-address-update-dialog.d.ts +96 -0
  277. package/dist/types/components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.d.ts +22 -2
  278. package/dist/types/components/common/zonos-checkbox/zonos-checkbox.d.ts +1 -0
  279. package/dist/types/components/common/zonos-dialog/zonos-dialog.d.ts +0 -3
  280. package/dist/types/components/common/zonos-input/zonos-input.d.ts +35 -0
  281. package/dist/types/components/store/checkout/stripe.d.ts +25 -1
  282. package/dist/types/components/store/translationStore/strings.arabic.d.ts +35 -5
  283. package/dist/types/components/store/translationStore/strings.base.d.ts +35 -5
  284. package/dist/types/components/store/translationStore/strings.chinese.d.ts +35 -5
  285. package/dist/types/components/store/translationStore/strings.danish.d.ts +35 -5
  286. package/dist/types/components/store/translationStore/strings.dutch.d.ts +35 -5
  287. package/dist/types/components/store/translationStore/strings.french.d.ts +35 -5
  288. package/dist/types/components/store/translationStore/strings.german.d.ts +35 -5
  289. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +35 -5
  290. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +35 -5
  291. package/dist/types/components/store/translationStore/strings.italian.d.ts +35 -5
  292. package/dist/types/components/store/translationStore/strings.japanese.d.ts +35 -5
  293. package/dist/types/components/store/translationStore/strings.korean.d.ts +35 -5
  294. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +35 -5
  295. package/dist/types/components/store/translationStore/strings.polish.d.ts +35 -5
  296. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +35 -5
  297. package/dist/types/components/store/translationStore/strings.russian.d.ts +35 -5
  298. package/dist/types/components/store/translationStore/strings.spanish.d.ts +35 -5
  299. package/dist/types/components/store/translationStore/strings.swedish.d.ts +35 -5
  300. package/dist/types/components/store/translationStore/strings.turkish.d.ts +35 -5
  301. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +35 -5
  302. package/dist/types/components/store/translationStore.d.ts +1 -1
  303. package/dist/types/components/stripe/zonos-address/zonos-address.d.ts +2 -10
  304. package/dist/types/components/stripe/zonos-link-authentication/zonos-link-authentication.d.ts +4 -0
  305. package/dist/types/components/utils/changeDeepProperty.d.ts +1 -1
  306. package/dist/types/components/utils/changeDeepPropertyAtIndex.d.ts +1 -1
  307. package/dist/types/components/utils/checkout/buildTranslateRequestBody.d.ts +26 -0
  308. package/dist/types/components/utils/containsNonLatinChars.d.ts +1 -0
  309. package/dist/types/components/utils/getBorderRadius.d.ts +7 -1
  310. package/dist/types/components.d.ts +308 -6
  311. package/dist/types/types/checkout/TranslatedText.d.ts +23 -0
  312. package/dist/types/types/checkout/api/ValidateAddressRequest.d.ts +20 -0
  313. package/dist/types/types/generated/graphql.customer.types.d.ts +2 -0
  314. package/dist/types/types/generated/graphql.customer.types.ts +2 -0
  315. package/dist/zonos-elements/assets/ChevronDownIcon.svg +1 -1
  316. package/dist/zonos-elements/assets/ChevronUpIcon.svg +1 -1
  317. package/dist/zonos-elements/assets/LeftArrow.svg +1 -1
  318. package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
  319. package/dist/zonos-elements/assets/SuccessIcon.svg +1 -1
  320. package/dist/zonos-elements/p-04df7975.entry.js +1 -0
  321. package/dist/zonos-elements/p-08e7107d.js +1 -0
  322. package/dist/zonos-elements/p-0c64dbbb.js +1 -0
  323. package/dist/zonos-elements/{p-bc3a0f7c.entry.js → p-11f1b78c.entry.js} +1 -1
  324. package/dist/zonos-elements/p-13ddaf31.js +2 -0
  325. package/dist/zonos-elements/p-154aaf95.system.js +1 -0
  326. package/dist/zonos-elements/p-163ff5b5.system.js +2 -0
  327. package/dist/zonos-elements/p-17e265c3.system.entry.js +1 -0
  328. package/dist/zonos-elements/p-2670438c.system.js +1 -0
  329. package/dist/zonos-elements/p-2770ba48.system.js +1 -0
  330. package/dist/zonos-elements/p-305f27c7.entry.js +1 -0
  331. package/dist/zonos-elements/p-34d0ef7a.system.entry.js +1 -0
  332. package/dist/zonos-elements/p-3638e2ed.entry.js +1 -0
  333. package/dist/zonos-elements/p-36a461a6.system.entry.js +1 -0
  334. package/dist/zonos-elements/{p-1a5f8df7.entry.js → p-3d8667a7.entry.js} +1 -1
  335. package/dist/zonos-elements/p-4a107b6f.system.js +1 -0
  336. package/dist/zonos-elements/p-4dca5484.system.entry.js +1 -0
  337. package/dist/zonos-elements/p-5120a57c.entry.js +1 -0
  338. package/dist/zonos-elements/p-54004793.system.entry.js +1 -0
  339. package/dist/zonos-elements/p-578f0aad.system.js +1 -0
  340. package/dist/zonos-elements/p-582d8b27.entry.js +1 -0
  341. package/dist/zonos-elements/p-5d993965.js +1 -0
  342. package/dist/zonos-elements/{p-262b8e1e.system.entry.js → p-5f9c066d.system.entry.js} +1 -1
  343. package/dist/zonos-elements/p-66eb66d1.js +1 -0
  344. package/dist/zonos-elements/{p-95c864ca.system.entry.js → p-679877b1.system.entry.js} +1 -1
  345. package/dist/zonos-elements/p-6e9b72e4.entry.js +1 -0
  346. package/dist/zonos-elements/p-726e2268.system.entry.js +1 -0
  347. package/dist/zonos-elements/{p-fc4da55c.system.js → p-771fbeb3.system.js} +1 -1
  348. package/dist/zonos-elements/p-79f3c4f5.system.js +1 -0
  349. package/dist/zonos-elements/p-81a54668.js +1 -0
  350. package/dist/zonos-elements/p-835c8928.entry.js +1 -0
  351. package/dist/zonos-elements/p-83cc2936.js +1 -0
  352. package/dist/zonos-elements/p-83fecb2a.entry.js +1 -0
  353. package/dist/zonos-elements/{p-520e8e63.system.js → p-87badea9.system.js} +1 -1
  354. package/dist/zonos-elements/{p-d01576d7.js → p-909a331c.js} +1 -1
  355. package/dist/zonos-elements/p-94d6af4b.system.entry.js +1 -0
  356. package/dist/zonos-elements/{p-5ee8a685.entry.js → p-9b8ae241.entry.js} +1 -1
  357. package/dist/zonos-elements/p-9ea84657.system.entry.js +1 -0
  358. package/dist/zonos-elements/{p-24fee841.entry.js → p-9ec93319.entry.js} +1 -1
  359. package/dist/zonos-elements/p-a6d7ac46.js +1 -0
  360. package/dist/zonos-elements/{p-2a99c8b5.system.entry.js → p-a6eeb4bd.system.entry.js} +1 -1
  361. package/dist/zonos-elements/p-a889c1bc.entry.js +1 -0
  362. package/dist/zonos-elements/p-ab7ac0db.system.entry.js +1 -0
  363. package/dist/zonos-elements/p-ad088d46.system.entry.js +1 -0
  364. package/dist/zonos-elements/p-aed0098c.system.js +1 -0
  365. package/dist/zonos-elements/p-b98bdbcc.system.entry.js +1 -0
  366. package/dist/zonos-elements/{p-d3772fd3.entry.js → p-baee62a4.entry.js} +1 -1
  367. package/dist/zonos-elements/{p-eff12c31.system.entry.js → p-bf32179a.system.entry.js} +1 -1
  368. package/dist/zonos-elements/p-ca71b681.system.entry.js +1 -0
  369. package/dist/zonos-elements/p-d7acc81c.entry.js +1 -0
  370. package/dist/zonos-elements/p-dbdebdae.entry.js +1 -0
  371. package/dist/zonos-elements/p-df192668.system.js +1 -0
  372. package/dist/zonos-elements/{p-70ede197.system.entry.js → p-df24d548.system.entry.js} +1 -1
  373. package/dist/zonos-elements/p-df64afdd.entry.js +1 -0
  374. package/dist/zonos-elements/p-e108e5ed.system.entry.js +1 -0
  375. package/dist/zonos-elements/p-e1b2b610.entry.js +1 -0
  376. package/dist/zonos-elements/{p-6743734f.entry.js → p-e7b4b756.entry.js} +1 -1
  377. package/dist/zonos-elements/{p-d41b5762.js → p-f1962041.js} +1 -1
  378. package/dist/zonos-elements/p-f71489e5.system.entry.js +1 -0
  379. package/dist/zonos-elements/p-fd49d864.entry.js +1 -0
  380. package/dist/zonos-elements/p-fd5d2fc3.system.entry.js +1 -0
  381. package/dist/zonos-elements/p-fe246229.system.entry.js +1 -0
  382. package/dist/zonos-elements/p-ff403840.entry.js +1 -0
  383. package/dist/zonos-elements/zonos-elements.css +17 -9
  384. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  385. package/dist/zonos-elements/zonos-elements.js +1 -1
  386. package/package.json +3 -2
  387. package/dist/cjs/index-3b4816ef.js +0 -2088
  388. package/dist/cjs/sendErrorLog-29e50f7e.js +0 -29
  389. package/dist/cjs/zonos-address_4.cjs.entry.js +0 -388
  390. package/dist/cjs/zonos-button_2.cjs.entry.js +0 -152
  391. package/dist/cjs/zonos-icon.cjs.entry.js +0 -39
  392. package/dist/components/sendErrorLog.js +0 -21
  393. package/dist/esm/index-0e31d804.js +0 -2055
  394. package/dist/esm/sendErrorLog-8642e94a.js +0 -26
  395. package/dist/esm/zonos-address_4.entry.js +0 -381
  396. package/dist/esm/zonos-button_2.entry.js +0 -147
  397. package/dist/esm/zonos-icon.entry.js +0 -35
  398. package/dist/esm-es5/cart-10bcd2e0.js +0 -1
  399. package/dist/esm-es5/getBorderRadius-8129b0cb.js +0 -1
  400. package/dist/esm-es5/index-0e31d804.js +0 -2
  401. package/dist/esm-es5/isColorVariable-fbf2d80d.js +0 -1
  402. package/dist/esm-es5/sendErrorLog-8642e94a.js +0 -1
  403. package/dist/esm-es5/submitGtag-84886899.js +0 -1
  404. package/dist/esm-es5/zonos-address_4.entry.js +0 -1
  405. package/dist/esm-es5/zonos-button_2.entry.js +0 -1
  406. package/dist/esm-es5/zonos-cart-items_10.entry.js +0 -1
  407. package/dist/esm-es5/zonos-icon.entry.js +0 -1
  408. package/dist/scripts/insertTranslations.js +0 -1
  409. package/dist/zonos-elements/p-0253aeae.entry.js +0 -1
  410. package/dist/zonos-elements/p-031086ba.system.entry.js +0 -1
  411. package/dist/zonos-elements/p-1264b362.entry.js +0 -1
  412. package/dist/zonos-elements/p-1950dda7.entry.js +0 -1
  413. package/dist/zonos-elements/p-2244534c.js +0 -2
  414. package/dist/zonos-elements/p-2825570c.system.js +0 -2
  415. package/dist/zonos-elements/p-33abdb30.js +0 -1
  416. package/dist/zonos-elements/p-376bdf70.entry.js +0 -1
  417. package/dist/zonos-elements/p-3e417d7c.entry.js +0 -1
  418. package/dist/zonos-elements/p-450942a3.system.js +0 -1
  419. package/dist/zonos-elements/p-46f9c93e.system.entry.js +0 -1
  420. package/dist/zonos-elements/p-48a2b8b0.entry.js +0 -1
  421. package/dist/zonos-elements/p-49120f0e.system.entry.js +0 -1
  422. package/dist/zonos-elements/p-593948b5.system.entry.js +0 -1
  423. package/dist/zonos-elements/p-5ca09163.entry.js +0 -1
  424. package/dist/zonos-elements/p-5ff27485.js +0 -1
  425. package/dist/zonos-elements/p-6d9dbecb.system.entry.js +0 -1
  426. package/dist/zonos-elements/p-6e8d43de.entry.js +0 -1
  427. package/dist/zonos-elements/p-6f5761e8.js +0 -1
  428. package/dist/zonos-elements/p-7891f8d2.entry.js +0 -1
  429. package/dist/zonos-elements/p-78d22069.system.entry.js +0 -1
  430. package/dist/zonos-elements/p-8b44e558.system.js +0 -1
  431. package/dist/zonos-elements/p-8bc0e56a.system.entry.js +0 -1
  432. package/dist/zonos-elements/p-92446677.entry.js +0 -1
  433. package/dist/zonos-elements/p-9350d19f.entry.js +0 -1
  434. package/dist/zonos-elements/p-9768840a.system.entry.js +0 -1
  435. package/dist/zonos-elements/p-9db2f9d1.system.js +0 -1
  436. package/dist/zonos-elements/p-9e8f1065.system.entry.js +0 -1
  437. package/dist/zonos-elements/p-a0abc499.system.entry.js +0 -1
  438. package/dist/zonos-elements/p-a6bbf6de.system.entry.js +0 -1
  439. package/dist/zonos-elements/p-ae4a4634.system.entry.js +0 -1
  440. package/dist/zonos-elements/p-af8391bb.entry.js +0 -1
  441. package/dist/zonos-elements/p-b8e8330b.system.js +0 -1
  442. package/dist/zonos-elements/p-be022d8e.entry.js +0 -1
  443. package/dist/zonos-elements/p-bfa8d9a4.system.entry.js +0 -1
  444. package/dist/zonos-elements/p-c6170bec.system.js +0 -1
  445. package/dist/zonos-elements/p-d149bc5d.system.entry.js +0 -1
  446. package/dist/zonos-elements/p-e1ac5b2a.system.entry.js +0 -1
  447. package/dist/zonos-elements/p-e28ed57c.js +0 -1
  448. package/dist/zonos-elements/p-e705c44c.entry.js +0 -1
  449. package/dist/zonos-elements/p-e9fafda6.entry.js +0 -1
  450. package/dist/zonos-elements/p-ed2e94d2.js +0 -1
  451. package/dist/zonos-elements/p-f4c38bfc.system.js +0 -1
  452. package/dist/zonos-elements/p-fc35d717.system.entry.js +0 -1
@@ -1,29 +0,0 @@
1
- 'use strict';
2
-
3
- const cart = require('./cart-1b1d39af.js');
4
-
5
- const checkoutBreakpoint = 890;
6
- const isCheckoutMobile = (isMobile) => {
7
- return isMobile || window.innerWidth < checkoutBreakpoint;
8
- };
9
-
10
- const sendErrorLog = async ({ endpoint, errors, metadata }) => {
11
- const userAgentData = 'userAgentData' in window.navigator
12
- ? // userAgentData is not yet supported in all browsers
13
- window.navigator.userAgentData
14
- : null;
15
- const errorObject = {
16
- endpoint,
17
- errors,
18
- metadata: Object.assign({ href: window.location.href, userAgent: userAgentData && userAgentData.brands.length > 0
19
- ? userAgentData
20
- : window.navigator.userAgent }, metadata),
21
- };
22
- void cart.handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/log-error`, {
23
- body: errorObject,
24
- method: 'POST',
25
- });
26
- };
27
-
28
- exports.isCheckoutMobile = isCheckoutMobile;
29
- exports.sendErrorLog = sendErrorLog;
@@ -1,388 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-3b4816ef.js');
6
- const cart = require('./cart-1b1d39af.js');
7
- const zonosStore = require('./zonosStore-aee974e0.js');
8
- const sendErrorLog = require('./sendErrorLog-29e50f7e.js');
9
- const classes = require('./classes-b7918f56.js');
10
- const getBorderRadius = require('./getBorderRadius-c8cc2bb3.js');
11
- const isDarkColor = require('./isDarkColor-f5473002.js');
12
-
13
- /**
14
- * Check if the given address object contains non-latin characters
15
- * @returns an object with the same keys as the input object, and a boolean value indicating if the value contains non-latin characters
16
- */
17
- const containsNonLatinChars = (params) => {
18
- const specialCharacters = /[ʼˮ՚ߴߵ']{1}/u;
19
- /**
20
- * This regex matches any character that is not a latin character, punctuation, symbol, number, separator, control, or mark
21
- * I limited the character found to 1 in the regex, so that we can return early if we find any non-latin character
22
- **/
23
- const nonLatinRegex = /[^\p{Script=Latin}\p{P}\p{S}\p{N}\p{Z}\p{C}\p{M}]{1}/u;
24
- const nonLatinValueList = Object.entries(params).reduce((prev, [key, value]) => nonLatinRegex.test(value) &&
25
- // allow special characters like web apostrophe and quotation mark
26
- !specialCharacters.test(value)
27
- ? Object.assign(Object.assign({}, prev), { [key]: true }) : prev, {});
28
- return nonLatinValueList;
29
- };
30
-
31
- const zonosAddressCss = ".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";
32
- const ZonosAddressStyle0 = zonosAddressCss;
33
-
34
- const mappedFields = {
35
- city: 'City',
36
- country: 'Country',
37
- line1: 'Address line 1',
38
- line2: 'Address line 2',
39
- name: 'Name',
40
- postal_code: 'Postal code',
41
- state: 'State',
42
- };
43
- const ZonosAddress = class {
44
- constructor(hostRef) {
45
- index.registerInstance(this, hostRef);
46
- this.invalidCharacters = index.createEvent(this, "invalidCharacters", 7);
47
- this.type = undefined;
48
- this.titleText = undefined;
49
- this.defaultAddress = null;
50
- this.stripe = window.Zonos.stripe;
51
- this.reportedInvalidCharacters = false;
52
- this.invalidCharacterList = null;
53
- this.isDirtyAddress = false;
54
- }
55
- getStripeAddressInstance() {
56
- if (this.type === 'billing') {
57
- return {
58
- stripeAddressElement: cart.stripeStore.stripeBillingAddressElement,
59
- stripeAddressEventData: cart.stripeStore.stripeBillingAddressEventData,
60
- stripeElements: cart.stripeStore.stripeElementsForBillingAddress,
61
- };
62
- }
63
- return {
64
- stripeAddressElement: cart.stripeStore.stripeAddressElement,
65
- stripeAddressEventData: cart.stripeStore.stripeAddressEventData,
66
- stripeElements: cart.stripeStore.stripeElements,
67
- };
68
- }
69
- updateAddressEventData({ event, type, }) {
70
- switch (type) {
71
- case 'billing':
72
- cart.stripeStore.stripeBillingAddressEventData = event;
73
- break;
74
- default:
75
- cart.stripeStore.stripeAddressEventData = event;
76
- break;
77
- }
78
- const invalidCharacterList = this.checkInvalidCharacters(event);
79
- this.invalidCharacterList = invalidCharacterList;
80
- this.invalidCharacters.emit(!!invalidCharacterList);
81
- }
82
- updateAddressElement({ stripeAddressElement, type, }) {
83
- if (type === 'shipping') {
84
- cart.stripeStore.stripeAddressElement = stripeAddressElement;
85
- return;
86
- }
87
- cart.stripeStore.stripeBillingAddressElement = stripeAddressElement;
88
- }
89
- checkInvalidCharacters(address) {
90
- // Do nothing if the allowed character sets is ALL or the address is incomplete
91
- if (!address.complete ||
92
- zonosStore.zonosStore.checkoutSettings.allowedCharacterSets === 'ALL') {
93
- return null;
94
- }
95
- const { address: addressValue, firstName, lastName, name } = address.value;
96
- const { city, country, line1, line2, postal_code, state } = addressValue;
97
- const invalidList = containsNonLatinChars({
98
- city,
99
- country,
100
- line1,
101
- line2: line2 || '',
102
- name: name || `${firstName} ${lastName}`,
103
- postal_code,
104
- state,
105
- });
106
- if (!Object.keys(invalidList).length) {
107
- return null;
108
- }
109
- // send error event only once so we know what value is invalid
110
- if (!this.reportedInvalidCharacters) {
111
- this.reportedInvalidCharacters = true;
112
- void sendErrorLog.sendErrorLog({
113
- endpoint: 'NonLatinInput',
114
- errors: Object.keys(invalidList).map(fieldName => {
115
- var _a;
116
- if (fieldName !== 'name') {
117
- // trim all number so we don't send sensitive information
118
- const trimmedAddress = (_a = addressValue[fieldName]) === null || _a === void 0 ? void 0 : _a.replace(/[\d\w]+/g, '');
119
- return `Invalid character found ${fieldName}: "${trimmedAddress}"`;
120
- }
121
- const customerName = name || `${firstName} ${lastName}`;
122
- const trimmedName = customerName.replace(/[\d\w]+/g, '');
123
- return `Invalid character found ${fieldName}: "${trimmedName}"`;
124
- }),
125
- metadata: {},
126
- });
127
- }
128
- return invalidList;
129
- }
130
- async watchInitStripe() {
131
- var _a, _b;
132
- this.stripe = window.Zonos.stripe;
133
- const { stripeAddressEventData, stripeElements } = this.getStripeAddressInstance();
134
- if (!this.stripe || !stripeElements) {
135
- cart.logError("Stripe is not initialized. Couldn't load stripe element.");
136
- return;
137
- }
138
- const phone = (_a = this.defaultAddress) === null || _a === void 0 ? void 0 : _a.phone;
139
- if (!phone) {
140
- // remove phone from default address if it's not provided, stripe
141
- // will throw error if key phone exist and its value is empty or 'undefined'.
142
- (_b = this.defaultAddress) === null || _b === void 0 ? true : delete _b.phone;
143
- }
144
- const shippableCountries = cart.localizationStore.shippingZoneCountries;
145
- const shippingZone = shippableCountries
146
- ? Object.values(shippableCountries).map(country => country.code)
147
- : [];
148
- const addressElement = stripeElements.create('address', {
149
- allowedCountries: this.type === 'shipping' ? shippingZone : [],
150
- // only show the default address if stripeAddressEventData is not provided
151
- contacts: this.defaultAddress && !stripeAddressEventData
152
- ? [this.defaultAddress]
153
- : [],
154
- defaultValues: {
155
- address: Object.assign(Object.assign({}, stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address), { country: (stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.address.country) ||
156
- cart.localizationStore.selectedCountryCode ||
157
- 'AL' }),
158
- firstName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.firstName,
159
- lastName: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.lastName,
160
- phone: stripeAddressEventData === null || stripeAddressEventData === void 0 ? void 0 : stripeAddressEventData.value.phone,
161
- },
162
- display: {
163
- name: 'split',
164
- },
165
- fields: {
166
- phone: 'always',
167
- },
168
- mode: this.type,
169
- validation: {
170
- phone: {
171
- required: 'always',
172
- },
173
- },
174
- });
175
- addressElement.mount(this.el.querySelector('.zonos--address-component'));
176
- addressElement.on('change', event => {
177
- const eventValue = event.value;
178
- if (!this.isDirtyAddress && eventValue.address.line1.length >= 3) {
179
- this.isDirtyAddress = true;
180
- // stripe element started with just address line 1, so scroll bar is not yet available. Wait for a moment before scrolling
181
- setTimeout(() => {
182
- // scroll directly into view if it's mobile
183
- if (sendErrorLog.isCheckoutMobile()) {
184
- this.el.scrollIntoView({ behavior: 'smooth', block: 'end' });
185
- }
186
- else {
187
- // scroll into the end of the page so the address placeholder won't be hidden
188
- const yOffset = this.type === 'shipping' ? 100 : 600;
189
- const parentWrapper = this.el.closest('.zonos--group');
190
- const y = this.el.getBoundingClientRect().top + yOffset;
191
- parentWrapper === null || parentWrapper === void 0 ? void 0 : parentWrapper.scrollTo({ behavior: 'smooth', top: y });
192
- }
193
- }, 600);
194
- }
195
- this.updateAddressEventData({
196
- event: Object.assign(Object.assign({}, event), { elementMode: this.type, elementType: 'address', value: Object.assign(Object.assign({}, eventValue), { firstName: eventValue.firstName || eventValue.name.split(' ')[0], lastName: eventValue.lastName || eventValue.name.split(' ')[1] }) }),
197
- type: this.type,
198
- });
199
- });
200
- this.updateAddressElement({
201
- stripeAddressElement: addressElement,
202
- type: this.type,
203
- });
204
- }
205
- disconnectedCallback() {
206
- // destroy the stripe element when this component is removed from the DOM, so that we can re-create the new one with previous value
207
- const stripeElement = this.getStripeAddressInstance().stripeAddressElement;
208
- stripeElement === null || stripeElement === void 0 ? void 0 : stripeElement.destroy();
209
- }
210
- componentDidLoad() {
211
- const stripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
212
- this.isDirtyAddress =
213
- !!stripeAddressEventData &&
214
- stripeAddressEventData.value.address.line1.length > 0;
215
- // @Watch doesn't get trigger on initial load
216
- void this.watchInitStripe();
217
- setTimeout(() => {
218
- // check if the address contains invalid characters after address is loaded
219
- const newStripeAddressEventData = this.getStripeAddressInstance().stripeAddressEventData;
220
- if (newStripeAddressEventData) {
221
- this.checkInvalidCharacters(newStripeAddressEventData);
222
- }
223
- }, 500);
224
- }
225
- render() {
226
- // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
227
- return (index.h(index.Host, { key: 'd5100d824d84c5e5b238f4877d489ca1b3f7b886', class: "zonos--address zonos--elements" }, index.h("zonos-text", { key: '0fd51ddf9b08b4f62aa75a5f2e919d40e52f6fc3', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), index.h("div", { key: '3a53ec2a36e96639ec5437b928d4be4b84fb3aff', class: "zonos--address-component" }), this.invalidCharacterList && (index.h("zonos-banner", { key: '1141be407cff5b6741a40a06712a71e881d3a082', bannerTitle: cart.translate('Please resolve the following errors:'), intent: "error" }, Object.keys(this.invalidCharacterList).map(fieldName => (index.h("zonos-text", null, `- ${cart.translate(mappedFields[fieldName])}: ${cart.translate('only supports Latin characters (A-Z, a-z)')}`)))))));
228
- }
229
- get el() { return index.getElement(this); }
230
- static get watchers() { return {
231
- "stripe": ["watchInitStripe"]
232
- }; }
233
- };
234
- ZonosAddress.style = ZonosAddressStyle0;
235
-
236
- const colorPrefixes = [
237
- 'blue',
238
- 'cyan',
239
- 'green',
240
- 'orange',
241
- 'purple',
242
- 'red',
243
- 'gray',
244
- 'glass',
245
- ];
246
-
247
- const zonosCheckboxCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--size);width:var(--size);background-color:transparent;border:1.5px solid var(--amino-gray-400);position:relative;border-radius:var(--border-radius, var(--amino-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--background-color);border-radius:var(--border-radius, var(--amino-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";
248
- const ZonosCheckboxStyle0 = zonosCheckboxCss;
249
-
250
- const ZonosCheckbox = class {
251
- constructor(hostRef) {
252
- index.registerInstance(this, hostRef);
253
- this.checkboxSelected = index.createEvent(this, "checkboxSelected", 7);
254
- this.backgroundColor = 'blue';
255
- this.label = undefined;
256
- this.isChecked = false;
257
- this.isDisabled = false;
258
- this.size = 12;
259
- this.fontSize = 'base';
260
- this.borderStyle = undefined;
261
- }
262
- render() {
263
- const isBackgroundVariable = colorPrefixes.includes(this.backgroundColor);
264
- const backgroundColor = isBackgroundVariable
265
- ? `var(--amino-${this.backgroundColor}-600)`
266
- : this.backgroundColor;
267
- const checkmarkColor = isBackgroundVariable
268
- ? // use lighter color if the color is amino variable
269
- `var(--amino-${this.backgroundColor}-200)`
270
- : // if it's not an amino variable, use white if the background is dark, and dark if the background is light
271
- !isDarkColor.isDarkColor(backgroundColor)
272
- ? 'var(--amino-gray-800)'
273
- : 'var(--amino-gray-0)';
274
- const borderStyle = getBorderRadius.getBorderRadius(this.borderStyle, '4px');
275
- return (index.h(index.Host, { key: '1383262a5cca00ede5154fbdf37bbabb8cbcd501', class: classes.classes(['zonos--elements zonos--checkbox']), style: {
276
- '--background-color': backgroundColor,
277
- '--border-radius': borderStyle,
278
- '--font-family': zonosStore.zonosStoreFontFamily(),
279
- '--size': `${this.size}px`,
280
- } }, index.h("label", { key: 'aa01d0b1eebb53587f8d2d344e3b1d01a6a7a683', class: classes.classes([this.isDisabled && 'disabled']) }, index.h("input", { key: '166eef6010570137110f8548c9eb76f32e5616e9', checked: this.isChecked, disabled: this.isDisabled, hidden: true, onChange: e => {
281
- this.checkboxSelected.emit(e.target.checked);
282
- }, type: "checkbox" }), index.h("span", { key: 'd98289266cd4e78dd1e5c9b89019d0dd4927e4d0', class: "checkmark-container" }, index.h("svg", { key: 'e179fe12a77e0c7f1f48bc943ff472d0a75e05d5', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '147acf112b6d28fa30af8e8c7fe8d7f998a507ab', "clip-rule": "evenodd", d: "M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z", fill: "currentColor", "fill-rule": "evenodd" }))), this.label && (index.h("zonos-text", { key: 'b83bb5bb1881580be3d0ab3ed83157a0c0ce3f8e', size: this.fontSize }, this.label)))));
283
- }
284
- };
285
- ZonosCheckbox.style = ZonosCheckboxStyle0;
286
-
287
- const zonosCollapseCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";
288
- const ZonosCollapseStyle0 = zonosCollapseCss;
289
-
290
- const ZonosCollapse = class {
291
- constructor(hostRef) {
292
- index.registerInstance(this, hostRef);
293
- this.collapsed = false;
294
- this.collapseSize = 0;
295
- this.height = this.el.scrollHeight;
296
- this.iframe = null;
297
- }
298
- getElementHeight() {
299
- const fullHeight = `${this.height}px`;
300
- const collapsedHeight = `${this.collapseSize}px`;
301
- return this.collapsed ? collapsedHeight : fullHeight;
302
- }
303
- componentDidLoad() {
304
- this.height = this.el.scrollHeight;
305
- }
306
- componentDidRender() {
307
- var _a, _b, _c;
308
- this.iframe =
309
- ((_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('iframe')) || null;
310
- (_c = (_b = this.iframe) === null || _b === void 0 ? void 0 : _b.contentWindow) === null || _c === void 0 ? void 0 : _c.addEventListener('resize', () => {
311
- if (!this.iframe) {
312
- // this should never happen since it's inside of resize callback
313
- return;
314
- }
315
- this.height = parseFloat(getComputedStyle(this.iframe).height);
316
- });
317
- }
318
- render() {
319
- if (!this.collapsed) {
320
- // wait for the collapse animation to finish, then set overflow to visible
321
- setTimeout(() => {
322
- // if the element collapsed state is still not changed, set overflow to visible
323
- if (!this.collapsed) {
324
- this.el.style.overflow = 'visible';
325
- }
326
- }, 300);
327
- }
328
- else {
329
- // set overflow to hidden to prevent content from showing when collapsed
330
- this.el.style.overflow = 'hidden';
331
- }
332
- return (index.h(index.Host, { key: 'ec163c2c73f38e479ba22bb3bea5dbe2f156170b', class: 'zonos--elements zonos--collapse', style: {
333
- '--font-family': zonosStore.zonosStoreFontFamily(),
334
- height: this.getElementHeight(),
335
- } }, index.h("div", { key: 'ab8b73ff44968d8e2f3dcf75439b09da36fdfb22' }, index.h("iframe", { key: '0b6d3518382c4c17a6eacb07c1617e84c7301c39', class: "height-change-listener", tabindex: "-1", title: "collapse-height-change-listener" }), index.h("slot", { key: '752d9054dadf8905e22cfcca81bb966c2d3ce8d3' }))));
336
- }
337
- get el() { return index.getElement(this); }
338
- };
339
- ZonosCollapse.style = ZonosCollapseStyle0;
340
-
341
- const zonosLinkAuthenticationCss = ".sc-zonos-link-authentication-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}";
342
- const ZonosLinkAuthenticationStyle0 = zonosLinkAuthenticationCss;
343
-
344
- const ZonosLinkAuthentication = class {
345
- constructor(hostRef) {
346
- index.registerInstance(this, hostRef);
347
- this.titleText = undefined;
348
- this.stripe = cart.stripeStore.stripe;
349
- }
350
- watchInitStripe() {
351
- if (!this.stripe || !cart.stripeStore.stripeElements) {
352
- return;
353
- }
354
- // Create and mount the Authentication Element in ${type} mode
355
- const linkAuthenticationElement = cart.stripeStore.stripeLinkElement ||
356
- cart.stripeStore.stripeElements.create('linkAuthentication');
357
- const linkAuthenticationElementContainer = this.el.querySelector('.zonos--link-authentication-component');
358
- if (!linkAuthenticationElementContainer) {
359
- cart.logError('Cannot find container element for linkAuthenticationElement');
360
- return;
361
- }
362
- linkAuthenticationElement.mount(linkAuthenticationElementContainer);
363
- linkAuthenticationElement.on('change', event => {
364
- cart.stripeStore.stripeLinkEventData = event;
365
- // run prefetch landed cost when address is changed
366
- void cart.stripeStorePrefetchLandedCost();
367
- });
368
- cart.stripeStore.stripeLinkElement = linkAuthenticationElement;
369
- }
370
- componentDidLoad() {
371
- // @Watch doesn't get trigger on initial load
372
- this.watchInitStripe();
373
- }
374
- render() {
375
- // this component loads iframe from the stripe elements and puts here, so we don't need to do anything here
376
- return (index.h(index.Host, { key: '97c3c388d1a035e6a46ecdbd3bc66d80a589b19f', class: "zonos--link-authentication zonos--elements" }, index.h("zonos-text", { key: 'e799af821045b2c1792d2971843afa0c7d3ece5b', class: "zonos--title", type: "semiBoldLabel" }, this.titleText), index.h("div", { key: 'eaf9be27a11d279c13f261e1312ee8a46e4620f7', class: "zonos--link-authentication-component" })));
377
- }
378
- get el() { return index.getElement(this); }
379
- static get watchers() { return {
380
- "stripe": ["watchInitStripe"]
381
- }; }
382
- };
383
- ZonosLinkAuthentication.style = ZonosLinkAuthenticationStyle0;
384
-
385
- exports.zonos_address = ZonosAddress;
386
- exports.zonos_checkbox = ZonosCheckbox;
387
- exports.zonos_collapse = ZonosCollapse;
388
- exports.zonos_link_authentication = ZonosLinkAuthentication;
@@ -1,152 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-3b4816ef.js');
6
- const zonosStore = require('./zonosStore-aee974e0.js');
7
- const classes = require('./classes-b7918f56.js');
8
- const getBorderRadius = require('./getBorderRadius-c8cc2bb3.js');
9
- const isColorVariable = require('./isColorVariable-fff5e469.js');
10
- const isDarkColor = require('./isDarkColor-f5473002.js');
11
-
12
- /**
13
- * Get theme for button text based on background color
14
- */
15
- const getButtonTheme = (overrideBackground) => {
16
- // use override background if it exists, otherwise use color from setting
17
- const background = overrideBackground || zonosStore.zonosStore.appearance.colorSecondary;
18
- const backgroundColor = background && isColorVariable.isColorVariable(background)
19
- ? `var(--amino-${background})`
20
- : background;
21
- // determine theme based on background color (to change button text color if needed)
22
- const buttonTheme = backgroundColor && isDarkColor.isDarkColor(backgroundColor) ? 'DARK' : 'LIGHT';
23
- return buttonTheme;
24
- };
25
-
26
- /**
27
- * Filter out all of the undefined values from the object so we don't have undefined css variable values
28
- */
29
- const styles = (props) => {
30
- // loop through the object and filter out all of the underfined values
31
- return Object.entries(props).reduce((acc, [key, value]) => {
32
- if (value) {
33
- acc[key] = value;
34
- }
35
- return acc;
36
- }, {});
37
- };
38
-
39
- const zonosButtonCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;border-radius:var(--border-radius, var(--amino-radius-10))}:host .zonos--spinner-wrapper{position:absolute;top:0;left:0;right:0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;background-color:var(--amino-surface-color);-ms-flex-pack:center;justify-content:center;border-radius:var(--amino-radius-10);gap:8px}:host button{width:100%;position:relative;font-size:14px;-webkit-box-sizing:border-box;box-sizing:border-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;background-color:var(--amino-surface-color);border:none;outline:1px solid var(--amino-surface-color);border-radius:var(--border-radius, var(--amino-radius-10));-webkit-transition:var(--amino-transition);transition:var(--amino-transition);font-weight:500;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;font-family:var(--font-family, Inter), Inter;letter-spacing:normal;cursor:pointer;white-space:nowrap;padding:8px 24px;color:var(--color, var(--amino-gray-1200));margin:1px;}:host button.sm.no-background,:host button.md.no-background,:host button.lg.no-background{background:none;outline:none}:host button.sm.no-padding-left,:host button.md.no-padding-left,:host button.lg.no-padding-left{padding-left:0}:host button.sm.no-padding-right,:host button.md.no-padding-right,:host button.lg.no-padding-right{padding-right:0}:host button[disabled]{cursor:not-allowed;background-color:var(--background-color, var(--amino-gray-200))}:host button[disabled] .zonos--spinner-wrapper{background-color:var(--background-color, var(--amino-gray-200))}:host button:active{-webkit-transform:scale(0.99);transform:scale(0.99)}:host button.sm{height:var(--amino-size-sm);line-height:var(--amino-size-sm);padding:4px 8px}:host button.sm:not(.has-content).has-icon{padding:0 4px}:host button.md{height:var(--amino-size-md);line-height:var(--amino-size-md);padding:8px 16px}:host button.md:not(.has-content).has-icon{padding:0 8px}:host button.lg{height:var(--amino-size-lg);line-height:var(--amino-size-lg);padding:12px 24px}:host button.lg:not(.has-content).has-icon{padding:0 16px}:host button:not(.only-icon).has-icon{gap:8px}@media (max-width: 400px){:host button:not(.only-icon).has-icon{font-size:var(--amino-font-size-s)}}:host button.override-background{background-color:var(--background-color, var(--amino-gray-0));color:var(--color, var(--amino-gray-1200));outline:1px solid var(--background-color, var(--amino-gray-0))}:host button.override-background:disabled{opacity:0.8}:host button.override-background:not(:disabled):hover{opacity:0.9}:host button:not(.override-background){}:host button:not(.override-background).primary{background:var(--amino-blue-600);outline:1px solid var(--amino-blue-600);color:var(--amino-gray-0)}:host button:not(.override-background).primary:not([disabled]):hover{background-image:var(--amino-button-primary-hover)}:host button:not(.override-background).primary:not([disabled]):active{background:var(--amino-blue-700)}:host button:not(.override-background).primary:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).primary[disabled]{background:var(--amino-blue-400)}:host button:not(.override-background).primary[disabled] .zonos--spinner-wrapper{background-color:var(--amino-blue-400)}:host button:not(.override-background).primary .zonos--spinner-wrapper{background-color:var(--amino-blue-600)}:host button:not(.override-background).success{background:var(--amino-green-600);outline:1px solid var(--amino-green-600);color:var(--amino-gray-0)}:host button:not(.override-background).success:not([disabled]):hover{background-image:var(--amino-button-success-hover)}:host button:not(.override-background).success:not([disabled]):active{background:var(--amino-green-700)}:host button:not(.override-background).success:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).success[disabled]{background:var(--amino-green-400)}:host button:not(.override-background).success[disabled] .zonos--spinner-wrapper{background-color:var(--amino-green-400)}:host button:not(.override-background).danger{background:var(--amino-red-600);outline:1px solid var(--amino-red-600);color:var(--amino-gray-0)}:host button:not(.override-background).danger:not([disabled]):hover{background-image:var(--amino-button-danger-hover)}:host button:not(.override-background).danger:not([disabled]):active{background:var(--amino-red-700)}:host button:not(.override-background).danger:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).danger[disabled]{background:var(--amino-red-400)}:host button:not(.override-background).danger[disabled] .zonos--spinner-wrapper{background-color:var(--amino-red-400)}:host button:not(.override-background).warning{background:var(--amino-orange-600);outline:1px solid var(--amino-orange-600);color:var(--amino-gray-0)}:host button:not(.override-background).warning:not([disabled]):hover{background-image:var(--amino-button-warning-hover)}:host button:not(.override-background).warning:not([disabled]):active{background:var(--amino-orange-700)}:host button:not(.override-background).warning:not([disabled]):focus{-webkit-box-shadow:var(--amino-focus-button);box-shadow:var(--amino-focus-button)}:host button:not(.override-background).warning[disabled]{background:var(--amino-orange-400)}:host button:not(.override-background).warning[disabled] .zonos--spinner-wrapper{background-color:var(--amino-orange-400)}:host button:not(.override-background).subtle{background:transparent;color:var(--color);outline:none}:host button:not(.override-background).subtle:not([disabled]):hover{background:var(--amino-gray-500)}:host button:not(.override-background).subtle:not([disabled]):active{background:var(--amino-gray-200)}:host button:not(.override-background).subtle:focus{-webkit-box-shadow:var(--amino-button-focus-ring);box-shadow:var(--amino-button-focus-ring)}:host button:not(.override-background).subtle[disabled] .content{opacity:0.6}:host button:not(.override-background).subtle[disabled] .zonos--spinner-wrapper{background-color:var(--amino-gray-0)}:host button:not(.override-background).outline{background:transparent;outline:1px solid var(--amino-gray-700)}:host button:not(.override-background).outline:not([disabled]):hover{background-color:var(--amino-gray-100)}:host button:not(.override-background).outline:not([disabled]):active{background:var(--amino-gray-200)}:host .zonos--footer-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--amino-v3-shadow-medium);box-shadow:var(--amino-v3-shadow-medium);z-index:10;justify-self:center;border-radius:var(--amino-radius-4);width:24px}";
40
- const ZonosButtonStyle0 = zonosButtonCss;
41
-
42
- const ZonosButton = class {
43
- constructor(hostRef) {
44
- index.registerInstance(this, hostRef);
45
- /**
46
- * Detect if the button has an content
47
- */
48
- this.handleSlotChange = () => {
49
- this.hasContent = true;
50
- };
51
- this.buttonColor = undefined;
52
- this.backgroundColor = undefined;
53
- this.borderStyle = undefined;
54
- this.isDisabled = false;
55
- this.icon = null;
56
- this.iconRight = false;
57
- this.size = 'sm';
58
- this.variant = 'standard';
59
- this.noBackground = false;
60
- this.noPaddingLeft = false;
61
- this.noPaddingRight = false;
62
- this.loading = false;
63
- this.theme = undefined;
64
- this.hasIcon = !!this.icon;
65
- this.hasContent = false;
66
- }
67
- /**
68
- * Detect if the icon changes and update the state accordingly
69
- */
70
- iconChangeHandler() {
71
- this.hasIcon = !!this.icon;
72
- }
73
- clickHandler(event) {
74
- if (this.loading || this.isDisabled) {
75
- event.preventDefault();
76
- event.stopPropagation();
77
- }
78
- }
79
- componentWillLoad() {
80
- this.iconChangeHandler();
81
- }
82
- render() {
83
- const disabled = this.loading || this.isDisabled;
84
- /**
85
- * If the parent component pass in the variant prop with `undefined` value, it would not re-assign the `undefined` value with the default value.
86
- * So need to re-assign the variant prop with the default value if the value is `undefined` here.
87
- */
88
- const variant = this.variant || 'standard';
89
- const color = this.buttonColor && isColorVariable.isColorVariable(this.buttonColor)
90
- ? `var(--amino-${this.buttonColor})`
91
- : this.buttonColor;
92
- // use override background if it exists, otherwise use color from setting
93
- const overrideBackground = this.backgroundColor || zonosStore.zonosStore.appearance.colorSecondary;
94
- // only set theme for button to change text color if variant is standard and override background is set
95
- const buttonTheme = variant === 'standard' ? getButtonTheme(overrideBackground) : undefined;
96
- const borderStyle = getBorderRadius.getBorderRadius(this.borderStyle);
97
- const backgroundActualColor = isColorVariable.isColorVariable(overrideBackground) && overrideBackground
98
- ? window.getComputedStyle(this.ele).getPropertyValue(overrideBackground)
99
- : overrideBackground;
100
- const spinnerColor = backgroundActualColor && isDarkColor.isDarkColor(backgroundActualColor)
101
- ? 'white'
102
- : 'black';
103
- return (index.h(index.Host, { key: '105badc02dbdcd9c782942e2b71719cd0ae7444e', class: classes.classes(['zonos--elements']), "data-theme": this.theme || buttonTheme, disabled: disabled, style: styles({
104
- '--background-color': overrideBackground,
105
- '--border-radius': borderStyle,
106
- '--color': color,
107
- '--font-family': zonosStore.zonosStoreFontFamily(),
108
- }) }, index.h("button", { key: 'c817b0eec6a0649e48155f284965412beb89a5f6', class: classes.classes([
109
- this.hasIcon && 'has-icon',
110
- this.hasContent && 'has-content',
111
- this.noBackground && 'no-background',
112
- this.noPaddingLeft && 'no-padding-left',
113
- this.noPaddingRight && 'no-padding-right',
114
- this.iconRight && 'icon-right',
115
- variant,
116
- this.size,
117
- // only override background if variant is set to standard
118
- overrideBackground &&
119
- variant === 'standard' &&
120
- 'override-background',
121
- ]), disabled: disabled }, this.loading && (index.h("div", { key: '85d6175e728b87276b95e831560530a3f7424a7c', class: "zonos--spinner-wrapper" }, index.h("zonos-spinner", { key: 'c65d771ca5182ac27da1769884dd8a4060037a1b', size: 16, spinnerColor: spinnerColor }))), !this.loading && !this.iconRight && this.icon, index.h("slot", { key: 'e3c6b155c4eb0f22aa9378586563face84ef8c2d', onSlotchange: this.handleSlotChange }), !this.loading && this.iconRight && this.icon)));
122
- }
123
- get ele() { return index.getElement(this); }
124
- static get watchers() { return {
125
- "icon": ["iconChangeHandler"]
126
- }; }
127
- };
128
- ZonosButton.style = ZonosButtonStyle0;
129
-
130
- const zonosSpinnerCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--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;overflow:hidden;width:var(--size);height:var(--size);display:-ms-inline-flexbox;display:inline-flex}:host svg{width:var(--size);height:var(--size);stroke:var(--amino-blue-600);-webkit-animation:rotate 2s linear infinite;animation:rotate 2s linear infinite}:host circle.track{stroke:var(--amino-gray-200)}@-webkit-keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate{100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@-webkit-keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}@keyframes dash{0%{stroke-dasharray:1, 150;stroke-dashoffset:0}50%{stroke-dasharray:90, 150;stroke-dashoffset:-35}100%{stroke-dasharray:90, 150;stroke-dashoffset:-124}}:host circle:not(.track){stroke-linecap:round;-webkit-animation:dash 1.5s ease-in-out infinite;animation:dash 1.5s ease-in-out infinite}:host(.black) circle{stroke:var(--amino-spinner-stroke-black)}:host(.black) circle.track{stroke:var(--amino-spinner-track-black)}:host(.white) circle{stroke:var(--amino-spinner-stroke-white)}:host(.white) circle.track{stroke:var(--amino-spinner-track-white)}:host(.info) circle{stroke:var(--amino-blue-600)}:host(.info) circle.track{stroke:var(--amino-blue-100)}:host(.success) circle{stroke:var(--amino-green-600)}:host(.success) circle.track{stroke:var(--amino-green-100)}:host(.danger) circle{stroke:var(--amino-red-600)}:host(.danger) circle.track{stroke:var(--amino-red-100)}:host(.warning) circle{stroke:var(--amino-orange-600)}:host(.warning) circle.track{stroke:var(--amino-orange-100)}";
131
- const ZonosSpinnerStyle0 = zonosSpinnerCss;
132
-
133
- const ZonosSpinner = class {
134
- constructor(hostRef) {
135
- index.registerInstance(this, hostRef);
136
- this.size = 32;
137
- this.spinnerColor = undefined;
138
- }
139
- render() {
140
- if (!this.el.shadowRoot) {
141
- return null;
142
- }
143
- return (index.h(index.Host, { class: classes.classes(['zonos--elements', this.spinnerColor]), style: {
144
- '--size': `${this.size}px`,
145
- } }, index.h("svg", { viewBox: "0 0 50 50" }, index.h("circle", { class: "track", cx: "25", cy: "25", fill: "none", id: "loading-spinner-circle", r: "20", "stroke-width": "5" }), index.h("circle", { cx: "25", cy: "25", fill: "none", id: "loading-spinner-circle", r: "20", "stroke-width": "5" }))));
146
- }
147
- get el() { return index.getElement(this); }
148
- };
149
- ZonosSpinner.style = ZonosSpinnerStyle0;
150
-
151
- exports.zonos_button = ZonosButton;
152
- exports.zonos_spinner = ZonosSpinner;
@@ -1,39 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-3b4816ef.js');
6
- const zonosStore = require('./zonosStore-aee974e0.js');
7
- const isColorVariable = require('./isColorVariable-fff5e469.js');
8
-
9
- const zonosIconCss = ":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host svg{width:var(--width);height:var(--height);fill:var(--color);color:var(--color)}";
10
- const ZonosIconStyle0 = zonosIconCss;
11
-
12
- const ZonosIcon = class {
13
- constructor(hostRef) {
14
- index.registerInstance(this, hostRef);
15
- this.autoHeight = false;
16
- this.iconColor = 'gray-1200';
17
- this.content = undefined;
18
- this.size = 24;
19
- }
20
- render() {
21
- if (!this.content || !this.el.shadowRoot) {
22
- return null;
23
- }
24
- const iconColor = isColorVariable.isColorVariable(this.iconColor)
25
- ? `var(--amino-${this.iconColor})`
26
- : this.iconColor;
27
- this.el.shadowRoot.innerHTML = this.content;
28
- return (index.h(index.Host, { class: "zonos--elements", style: {
29
- '--color': iconColor,
30
- '--font-family': zonosStore.zonosStoreFontFamily(),
31
- '--height': `${this.autoHeight ? 'auto' : `${this.size}px`}`,
32
- '--width': `${this.size}px`,
33
- } }));
34
- }
35
- get el() { return index.getElement(this); }
36
- };
37
- ZonosIcon.style = ZonosIconStyle0;
38
-
39
- exports.zonos_icon = ZonosIcon;
@@ -1,21 +0,0 @@
1
- import { h as handleFetch } from './stripe.js';
2
-
3
- const sendErrorLog = async ({ endpoint, errors, metadata }) => {
4
- const userAgentData = 'userAgentData' in window.navigator
5
- ? // userAgentData is not yet supported in all browsers
6
- window.navigator.userAgentData
7
- : null;
8
- const errorObject = {
9
- endpoint,
10
- errors,
11
- metadata: Object.assign({ href: window.location.href, userAgent: userAgentData && userAgentData.brands.length > 0
12
- ? userAgentData
13
- : window.navigator.userAgent }, metadata),
14
- };
15
- void handleFetch(`${"https://v1.route.js.zonos.com"}/api/zonos-elements/log-error`, {
16
- body: errorObject,
17
- method: 'POST',
18
- });
19
- };
20
-
21
- export { sendErrorLog as s };