@zonos/elements 1.3.248 → 1.3.250

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 (404) hide show
  1. package/dist/cjs/{cart-28310848.js → cart-fcd1359c.js} +321 -22
  2. package/dist/cjs/{cleanHtmlMarkdown-577d0a77.js → cleanHtmlMarkdown-31da84b7.js} +9 -7
  3. package/dist/cjs/{debounce-815d1517.js → debounce-0c75ba33.js} +1 -1
  4. package/dist/cjs/{getBorderRadius-2ef1170d.js → getBorderRadius-27a74844.js} +1 -1
  5. package/dist/cjs/{getContrastColor-30848800.js → getContrastColor-cc087c53.js} +2 -2
  6. package/dist/cjs/{hasInclusivePrice-134b0250.js → hasInclusivePrice-745a8f29.js} +1 -1
  7. package/dist/cjs/index-b1f95d96.js +4065 -0
  8. package/dist/cjs/index.cjs.js +7 -7
  9. package/dist/cjs/{invoice-2e8e5879.js → invoice-f040e147.js} +3 -3
  10. package/dist/cjs/{isCollectMobileTablet-bd0f4556.js → isCollectMobileTablet-cf92852e.js} +3 -3
  11. package/dist/cjs/{isContrastColor-09f5924a.js → isContrastColor-d1936a5c.js} +1 -1
  12. package/dist/cjs/{isDarkColor-878e600e.js → isDarkColor-a68abf7a.js} +1 -1
  13. package/dist/cjs/loader.cjs.js +2 -2
  14. package/dist/cjs/{localization-00e73920.js → localization-523b793a.js} +661 -1
  15. package/dist/cjs/{paypal-3019ae94.js → paypal-8c98c0a1.js} +79 -21
  16. package/dist/cjs/{placeTestOrder-b0369cfd.js → placeTestOrder-9b1e09f0.js} +2 -2
  17. package/dist/cjs/{renderCheckoutCurrency-9e919b9f.js → renderCheckoutCurrency-94b6e51d.js} +2 -2
  18. package/dist/cjs/{renderFallback-78b54537.js → renderFallback-bc20ee20.js} +1 -1
  19. package/dist/cjs/{submitGtag-a50ab32e.js → submitGtag-cb4fb332.js} +1 -1
  20. package/dist/cjs/{throttle-7dd64984.js → throttle-ff483793.js} +2 -2
  21. package/dist/cjs/{updateCheckoutSessionAttributes-3a1db9de.js → updateCheckoutSessionAttributes-8be63b63.js} +1 -1
  22. package/dist/cjs/{zonos-address-display_9.cjs.entry.js → zonos-address-display_8.cjs.entry.js} +1294 -1664
  23. package/dist/cjs/zonos-address_4.cjs.entry.js +8 -8
  24. package/dist/cjs/zonos-badge.cjs.entry.js +2 -2
  25. package/dist/cjs/zonos-banner.cjs.entry.js +2 -2
  26. package/dist/cjs/zonos-button_3.cjs.entry.js +5 -5
  27. package/dist/cjs/zonos-card_5.cjs.entry.js +9 -9
  28. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +84 -30
  29. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +113 -0
  30. package/dist/cjs/zonos-checkout.cjs.entry.js +60 -11
  31. package/dist/cjs/zonos-collapse.cjs.entry.js +2 -2
  32. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +7 -7
  33. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +13 -13
  34. package/dist/cjs/zonos-collect.cjs.entry.js +11 -11
  35. package/dist/cjs/zonos-component.cjs.entry.js +1 -1
  36. package/dist/cjs/zonos-controller.cjs.entry.js +7 -7
  37. package/dist/cjs/zonos-country-flag.cjs.entry.js +3 -3
  38. package/dist/cjs/zonos-country-select_4.cjs.entry.js +4 -4
  39. package/dist/cjs/zonos-elements.cjs.js +30 -3
  40. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +4 -4
  41. package/dist/cjs/zonos-hello.cjs.entry.js +4 -4
  42. package/dist/cjs/zonos-input.cjs.entry.js +4 -4
  43. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +9 -9
  44. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +13 -13
  45. package/dist/cjs/zonos-invoice.cjs.entry.js +10 -10
  46. package/dist/cjs/zonos-language-select_2.cjs.entry.js +3 -3
  47. package/dist/cjs/zonos-link.cjs.entry.js +1 -1
  48. package/dist/cjs/zonos-logo.cjs.entry.js +2 -2
  49. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +6 -6
  50. package/dist/cjs/zonos-store-credit.cjs.entry.js +113 -0
  51. package/dist/cjs/zonos-stripe-input.cjs.entry.js +4 -4
  52. package/dist/cjs/zonos-text.cjs.entry.js +2 -2
  53. package/dist/cjs/zonos-tooltip.cjs.entry.js +1 -1
  54. package/dist/cjs/zonos-v-stack.cjs.entry.js +2 -2
  55. package/dist/cjs/{zonosStore-37a4b4f4.js → zonosStore-f5a61112.js} +110 -25
  56. package/dist/collection/collection-manifest.json +1 -0
  57. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +3 -0
  58. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +49 -4
  59. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +18 -10
  60. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/assets/StoreCreditIcon.svg +3 -0
  61. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.css +139 -0
  62. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.js +137 -0
  63. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +52 -1
  64. package/dist/collection/components/common/zonos-button/zonos-button.css +3 -1
  65. package/dist/collection/components/common/zonos-input/zonos-input.css +3 -1
  66. package/dist/collection/components/common/zonos-stripe-input/zonos-stripe-input.css +3 -1
  67. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +1 -1
  68. package/dist/collection/components/common/zonos-stripe-select/zonos-stripe-select.css +3 -1
  69. package/dist/collection/components/main/zonos-controller.js +1 -1
  70. package/dist/collection/components/store/checkout/cart.js +62 -4
  71. package/dist/collection/components/store/checkout/paypal.js +28 -0
  72. package/dist/collection/components/store/checkout/storeCredit.js +237 -0
  73. package/dist/collection/components/store/checkout/stripe.js +2 -1
  74. package/dist/collection/components/store/translationStore/strings.arabic.js +33 -0
  75. package/dist/collection/components/store/translationStore/strings.base.js +33 -0
  76. package/dist/collection/components/store/translationStore/strings.chinese.js +33 -0
  77. package/dist/collection/components/store/translationStore/strings.danish.js +33 -0
  78. package/dist/collection/components/store/translationStore/strings.dutch.js +33 -0
  79. package/dist/collection/components/store/translationStore/strings.french.js +33 -0
  80. package/dist/collection/components/store/translationStore/strings.german.js +33 -0
  81. package/dist/collection/components/store/translationStore/strings.hebrew.js +33 -0
  82. package/dist/collection/components/store/translationStore/strings.indonesian.js +33 -0
  83. package/dist/collection/components/store/translationStore/strings.italian.js +33 -0
  84. package/dist/collection/components/store/translationStore/strings.japanese.js +33 -0
  85. package/dist/collection/components/store/translationStore/strings.korean.js +33 -0
  86. package/dist/collection/components/store/translationStore/strings.norwegian.js +33 -0
  87. package/dist/collection/components/store/translationStore/strings.polish.js +33 -0
  88. package/dist/collection/components/store/translationStore/strings.portuguese.js +33 -0
  89. package/dist/collection/components/store/translationStore/strings.russian.js +33 -0
  90. package/dist/collection/components/store/translationStore/strings.spanish.js +33 -0
  91. package/dist/collection/components/store/translationStore/strings.swedish.js +33 -0
  92. package/dist/collection/components/store/translationStore/strings.turkish.js +33 -0
  93. package/dist/collection/components/store/translationStore/strings.vietnamese.js +33 -0
  94. package/dist/collection/types/generated/graphql.internal.types.js +589 -0
  95. package/dist/esm/{cart-ba8f3890.js → cart-6e465f7b.js} +311 -23
  96. package/dist/esm/{cleanHtmlMarkdown-b5b18743.js → cleanHtmlMarkdown-5f7856f2.js} +9 -7
  97. package/dist/esm/{debounce-c4785346.js → debounce-efc0e473.js} +1 -1
  98. package/dist/esm/{getBorderRadius-877f6389.js → getBorderRadius-c21a42e5.js} +1 -1
  99. package/dist/esm/{getContrastColor-28c18704.js → getContrastColor-98f0d1d5.js} +2 -2
  100. package/dist/esm/{hasInclusivePrice-6fcc712f.js → hasInclusivePrice-c49d384d.js} +1 -1
  101. package/dist/esm/index-cfd394c8.js +4028 -0
  102. package/dist/esm/index.js +7 -7
  103. package/dist/esm/{invoice-055bb6e5.js → invoice-d416ba65.js} +3 -3
  104. package/dist/esm/{isCollectMobileTablet-797cea8b.js → isCollectMobileTablet-48040572.js} +3 -3
  105. package/dist/esm/{isContrastColor-69778cea.js → isContrastColor-c17e83c9.js} +1 -1
  106. package/dist/esm/{isDarkColor-9ddd90cc.js → isDarkColor-3537021b.js} +1 -1
  107. package/dist/esm/loader.js +3 -3
  108. package/dist/esm/{localization-853b48a9.js → localization-f4a7fb5a.js} +661 -1
  109. package/dist/esm/{paypal-8d8518c0.js → paypal-6af6b978.js} +79 -21
  110. package/dist/esm/{placeTestOrder-0a74923e.js → placeTestOrder-d19ac166.js} +2 -2
  111. package/dist/esm/{renderCheckoutCurrency-bd059ecf.js → renderCheckoutCurrency-c8aa8e7e.js} +2 -2
  112. package/dist/esm/{renderFallback-3f010b48.js → renderFallback-b250f4e9.js} +1 -1
  113. package/dist/esm/{submitGtag-89d6e9cb.js → submitGtag-13de9f1f.js} +1 -1
  114. package/dist/esm/{throttle-ce2432ab.js → throttle-0504ba2c.js} +2 -2
  115. package/dist/esm/{updateCheckoutSessionAttributes-047a6cd4.js → updateCheckoutSessionAttributes-b9f7e982.js} +1 -1
  116. package/dist/esm/{zonos-address-display_9.entry.js → zonos-address-display_8.entry.js} +1295 -1664
  117. package/dist/esm/zonos-address_4.entry.js +8 -8
  118. package/dist/esm/zonos-badge.entry.js +2 -2
  119. package/dist/esm/zonos-banner.entry.js +2 -2
  120. package/dist/esm/zonos-button_3.entry.js +5 -5
  121. package/dist/esm/zonos-card_5.entry.js +9 -9
  122. package/dist/esm/zonos-cart-items_12.entry.js +84 -30
  123. package/dist/esm/zonos-checkbox_2.entry.js +108 -0
  124. package/dist/esm/zonos-checkout.entry.js +60 -11
  125. package/dist/esm/zonos-collapse.entry.js +2 -2
  126. package/dist/esm/zonos-collect-cart-items_3.entry.js +7 -7
  127. package/dist/esm/zonos-collect-finish_6.entry.js +13 -13
  128. package/dist/esm/zonos-collect.entry.js +11 -11
  129. package/dist/esm/zonos-component.entry.js +1 -1
  130. package/dist/esm/zonos-controller.entry.js +7 -7
  131. package/dist/esm/zonos-country-flag.entry.js +3 -3
  132. package/dist/esm/zonos-country-select_4.entry.js +4 -4
  133. package/dist/esm/zonos-elements.js +31 -4
  134. package/dist/esm/zonos-hello-dialog.entry.js +4 -4
  135. package/dist/esm/zonos-hello.entry.js +4 -4
  136. package/dist/esm/zonos-input.entry.js +4 -4
  137. package/dist/esm/zonos-invoice-cart-items_2.entry.js +9 -9
  138. package/dist/esm/zonos-invoice-finish_5.entry.js +13 -13
  139. package/dist/esm/zonos-invoice.entry.js +10 -10
  140. package/dist/esm/zonos-language-select_2.entry.js +3 -3
  141. package/dist/esm/zonos-link.entry.js +1 -1
  142. package/dist/esm/zonos-logo.entry.js +2 -2
  143. package/dist/esm/zonos-shipping-rich-radio.entry.js +6 -6
  144. package/dist/esm/zonos-store-credit.entry.js +109 -0
  145. package/dist/esm/zonos-stripe-input.entry.js +4 -4
  146. package/dist/esm/zonos-text.entry.js +2 -2
  147. package/dist/esm/zonos-tooltip.entry.js +1 -1
  148. package/dist/esm/zonos-v-stack.entry.js +2 -2
  149. package/dist/esm/{zonosStore-b434e436.js → zonosStore-5242a58d.js} +110 -25
  150. package/dist/esm-es5/cart-6e465f7b.js +1 -0
  151. package/dist/esm-es5/cleanHtmlMarkdown-5f7856f2.js +1 -0
  152. package/dist/esm-es5/{debounce-c4785346.js → debounce-efc0e473.js} +1 -1
  153. package/dist/esm-es5/{getBorderRadius-877f6389.js → getBorderRadius-c21a42e5.js} +1 -1
  154. package/dist/esm-es5/{getContrastColor-28c18704.js → getContrastColor-98f0d1d5.js} +1 -1
  155. package/dist/esm-es5/hasInclusivePrice-c49d384d.js +1 -0
  156. package/dist/esm-es5/index-cfd394c8.js +13 -0
  157. package/dist/esm-es5/index.js +1 -1
  158. package/dist/esm-es5/{invoice-055bb6e5.js → invoice-d416ba65.js} +1 -1
  159. package/dist/esm-es5/{isCollectMobileTablet-797cea8b.js → isCollectMobileTablet-48040572.js} +1 -1
  160. package/dist/esm-es5/{isContrastColor-69778cea.js → isContrastColor-c17e83c9.js} +1 -1
  161. package/dist/esm-es5/{isDarkColor-9ddd90cc.js → isDarkColor-3537021b.js} +1 -1
  162. package/dist/esm-es5/loader.js +1 -1
  163. package/dist/esm-es5/localization-f4a7fb5a.js +1 -0
  164. package/dist/esm-es5/paypal-6af6b978.js +17 -0
  165. package/dist/esm-es5/{placeTestOrder-0a74923e.js → placeTestOrder-d19ac166.js} +1 -1
  166. package/dist/esm-es5/{renderCheckoutCurrency-bd059ecf.js → renderCheckoutCurrency-c8aa8e7e.js} +1 -1
  167. package/dist/esm-es5/{renderFallback-3f010b48.js → renderFallback-b250f4e9.js} +1 -1
  168. package/dist/esm-es5/{submitGtag-89d6e9cb.js → submitGtag-13de9f1f.js} +1 -1
  169. package/dist/esm-es5/{throttle-ce2432ab.js → throttle-0504ba2c.js} +1 -1
  170. package/dist/esm-es5/{updateCheckoutSessionAttributes-047a6cd4.js → updateCheckoutSessionAttributes-b9f7e982.js} +1 -1
  171. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -0
  172. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  173. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  174. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  175. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  176. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  177. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  178. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -0
  179. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  180. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  181. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  182. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  183. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  184. package/dist/esm-es5/zonos-component.entry.js +1 -1
  185. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  186. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  187. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  188. package/dist/esm-es5/zonos-elements.js +1 -1
  189. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  190. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  191. package/dist/esm-es5/zonos-input.entry.js +1 -1
  192. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  193. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  194. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  195. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  196. package/dist/esm-es5/zonos-link.entry.js +1 -1
  197. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  198. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  199. package/dist/esm-es5/zonos-store-credit.entry.js +1 -0
  200. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  201. package/dist/esm-es5/zonos-text.entry.js +1 -1
  202. package/dist/esm-es5/zonos-tooltip.entry.js +1 -1
  203. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  204. package/dist/esm-es5/zonosStore-5242a58d.js +1 -0
  205. package/dist/scripts/index.d.ts +60 -3
  206. package/dist/scripts/index.js +1 -1
  207. package/dist/scripts/loadZonos.js +1 -1
  208. package/dist/scripts/zonos.js +1 -1
  209. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +1 -0
  210. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.d.ts +17 -0
  211. package/dist/types/components/store/checkout/cart.d.ts +8 -1
  212. package/dist/types/components/store/checkout/storeCredit.d.ts +111 -0
  213. package/dist/types/components/store/checkout/stripe.d.ts +1 -1
  214. package/dist/types/components/store/translationStore/strings.arabic.d.ts +33 -0
  215. package/dist/types/components/store/translationStore/strings.base.d.ts +33 -0
  216. package/dist/types/components/store/translationStore/strings.chinese.d.ts +33 -0
  217. package/dist/types/components/store/translationStore/strings.danish.d.ts +33 -0
  218. package/dist/types/components/store/translationStore/strings.dutch.d.ts +33 -0
  219. package/dist/types/components/store/translationStore/strings.french.d.ts +33 -0
  220. package/dist/types/components/store/translationStore/strings.german.d.ts +33 -0
  221. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +33 -0
  222. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +33 -0
  223. package/dist/types/components/store/translationStore/strings.italian.d.ts +33 -0
  224. package/dist/types/components/store/translationStore/strings.japanese.d.ts +33 -0
  225. package/dist/types/components/store/translationStore/strings.korean.d.ts +33 -0
  226. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +33 -0
  227. package/dist/types/components/store/translationStore/strings.polish.d.ts +33 -0
  228. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +33 -0
  229. package/dist/types/components/store/translationStore/strings.russian.d.ts +33 -0
  230. package/dist/types/components/store/translationStore/strings.spanish.d.ts +33 -0
  231. package/dist/types/components/store/translationStore/strings.swedish.d.ts +33 -0
  232. package/dist/types/components/store/translationStore/strings.turkish.d.ts +33 -0
  233. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +33 -0
  234. package/dist/types/components.d.ts +21 -0
  235. package/dist/types/environment.d.ts +2 -2
  236. package/dist/types/types/checkout/api/CheckoutSession.d.ts +9 -1
  237. package/dist/types/types/generated/graphql.internal.types.d.ts +713 -4
  238. package/dist/types/types/generated/graphql.internal.types.ts +956 -4
  239. package/dist/types/types/global.d.ts +2 -0
  240. package/dist/zonos-elements/index.esm.js +1 -1
  241. package/dist/zonos-elements/p-058f6124.js +1 -0
  242. package/dist/zonos-elements/{p-7aa50ef2.entry.js → p-0d18d94b.entry.js} +1 -1
  243. package/dist/zonos-elements/{p-c01f86b4.entry.js → p-12459b59.entry.js} +1 -1
  244. package/dist/zonos-elements/{p-de8899bc.js → p-13ed3789.js} +1 -1
  245. package/dist/zonos-elements/{p-8205ae87.system.entry.js → p-17fbfda0.system.entry.js} +1 -1
  246. package/dist/zonos-elements/p-18d411c3.system.entry.js +1 -0
  247. package/dist/zonos-elements/{p-69b9b711.entry.js → p-1b56814d.entry.js} +1 -1
  248. package/dist/zonos-elements/p-1b8771bb.js +1 -0
  249. package/dist/zonos-elements/{p-eea7ac64.js → p-1e6509d7.js} +1 -1
  250. package/dist/zonos-elements/{p-c7311ce5.system.entry.js → p-1f63615f.system.entry.js} +1 -1
  251. package/dist/zonos-elements/{p-5062dcf3.system.entry.js → p-234f0339.system.entry.js} +1 -1
  252. package/dist/zonos-elements/p-2435f196.entry.js +1 -0
  253. package/dist/zonos-elements/p-26848428.entry.js +1 -0
  254. package/dist/zonos-elements/p-28d62fc8.system.entry.js +1 -0
  255. package/dist/zonos-elements/p-29b60bf3.system.js +1 -0
  256. package/dist/zonos-elements/{p-1c4d12f0.entry.js → p-2aa44601.entry.js} +1 -1
  257. package/dist/zonos-elements/p-2b7ef406.system.js +18 -0
  258. package/dist/zonos-elements/p-34d10122.js +1 -0
  259. package/dist/zonos-elements/{p-e17bbcee.entry.js → p-3827041d.entry.js} +1 -1
  260. package/dist/zonos-elements/{p-14c920b2.system.entry.js → p-38881641.system.entry.js} +1 -1
  261. package/dist/zonos-elements/{p-c6e3d747.system.js → p-3fbd9cc0.system.js} +1 -1
  262. package/dist/zonos-elements/p-45bd8072.system.js +1 -0
  263. package/dist/zonos-elements/{p-bc4bfa06.js → p-48228d76.js} +1 -1
  264. package/dist/zonos-elements/{p-9c49daa4.entry.js → p-4aefd668.entry.js} +1 -1
  265. package/dist/zonos-elements/p-4d5932ac.system.entry.js +1 -0
  266. package/dist/zonos-elements/{p-a359e0a2.system.entry.js → p-4e4fa1fb.system.entry.js} +1 -1
  267. package/dist/zonos-elements/{p-c36696f9.js → p-4f7d64f6.js} +1 -1
  268. package/dist/zonos-elements/p-53db5f85.system.js +1 -0
  269. package/dist/zonos-elements/{p-403b9fca.entry.js → p-59fe8416.entry.js} +1 -1
  270. package/dist/zonos-elements/{p-7b400b5f.system.entry.js → p-5ca50862.system.entry.js} +1 -1
  271. package/dist/zonos-elements/p-5dd86dd9.system.js +1 -0
  272. package/dist/zonos-elements/p-5f628e57.entry.js +1 -0
  273. package/dist/zonos-elements/{p-b54a95ea.system.entry.js → p-5fceccc3.system.entry.js} +1 -1
  274. package/dist/zonos-elements/p-64ad0854.entry.js +1 -0
  275. package/dist/zonos-elements/{p-942358eb.system.js → p-65892fa7.system.js} +1 -1
  276. package/dist/zonos-elements/{p-aa028d91.entry.js → p-66d72216.entry.js} +1 -1
  277. package/dist/zonos-elements/{p-58248f03.entry.js → p-66e1dc55.entry.js} +1 -1
  278. package/dist/zonos-elements/{p-57fa64d7.js → p-67897a0d.js} +1 -1
  279. package/dist/zonos-elements/{p-917f714c.system.entry.js → p-6f19845a.system.entry.js} +1 -1
  280. package/dist/zonos-elements/{p-291f7ccb.system.entry.js → p-7042c6da.system.entry.js} +1 -1
  281. package/dist/zonos-elements/{p-232b0fb5.system.entry.js → p-70c8a47d.system.entry.js} +1 -1
  282. package/dist/zonos-elements/p-7261e245.system.js +13 -0
  283. package/dist/zonos-elements/p-741e07e1.system.entry.js +1 -0
  284. package/dist/zonos-elements/{p-3e67ca05.entry.js → p-7427dd1e.entry.js} +1 -1
  285. package/dist/zonos-elements/{p-23d497e3.system.js → p-7501c637.system.js} +1 -1
  286. package/dist/zonos-elements/p-77113201.system.js +1 -0
  287. package/dist/zonos-elements/{p-a12cb7ce.entry.js → p-77c0a02b.entry.js} +1 -1
  288. package/dist/zonos-elements/p-7d7ffb42.js +1 -0
  289. package/dist/zonos-elements/{p-1acf0a71.system.entry.js → p-85529818.system.entry.js} +1 -1
  290. package/dist/zonos-elements/{p-cfb9b847.system.entry.js → p-87d89870.system.entry.js} +1 -1
  291. package/dist/zonos-elements/{p-443e1f30.system.js → p-8c6624b6.system.js} +1 -1
  292. package/dist/zonos-elements/{p-57cee1b5.system.entry.js → p-8d5f928c.system.entry.js} +1 -1
  293. package/dist/zonos-elements/p-8f1ab25c.system.entry.js +1 -0
  294. package/dist/zonos-elements/{p-5762e217.js → p-908f13ae.js} +1 -1
  295. package/dist/zonos-elements/{p-63a3d3b9.system.js → p-90b8c428.system.js} +1 -1
  296. package/dist/zonos-elements/{p-8f0f6449.entry.js → p-939ba2a5.entry.js} +1 -1
  297. package/dist/zonos-elements/p-9581bffb.js +1 -0
  298. package/dist/zonos-elements/p-959918fe.system.js +1 -0
  299. package/dist/zonos-elements/p-997b7eef.js +1 -0
  300. package/dist/zonos-elements/{p-0792688d.system.entry.js → p-9bc5e944.system.entry.js} +1 -1
  301. package/dist/zonos-elements/p-9c6917ab.system.js +1 -0
  302. package/dist/zonos-elements/{p-f8d56ba9.system.js → p-9d44fef6.system.js} +1 -1
  303. package/dist/zonos-elements/p-9d64783a.entry.js +1 -0
  304. package/dist/zonos-elements/{p-71a8d971.system.entry.js → p-9f49e35a.system.entry.js} +1 -1
  305. package/dist/zonos-elements/{p-2f55895c.system.entry.js → p-a026b5ad.system.entry.js} +1 -1
  306. package/dist/zonos-elements/{p-85e59f3a.system.entry.js → p-a1a3657e.system.entry.js} +1 -1
  307. package/dist/zonos-elements/{p-c2f34b10.system.entry.js → p-a1b0e9a5.system.entry.js} +1 -1
  308. package/dist/zonos-elements/{p-fb9fb873.system.entry.js → p-a1c476d6.system.entry.js} +1 -1
  309. package/dist/zonos-elements/p-a6a401e5.system.entry.js +1 -0
  310. package/dist/zonos-elements/{p-5edef7c3.system.js → p-ab25379f.system.js} +1 -1
  311. package/dist/zonos-elements/p-ac30b7a8.system.js +1 -0
  312. package/dist/zonos-elements/{p-37bb5f2d.entry.js → p-b004146f.entry.js} +1 -1
  313. package/dist/zonos-elements/{p-3908f78d.system.entry.js → p-b07da3e8.system.entry.js} +1 -1
  314. package/dist/zonos-elements/{p-71f10bf0.entry.js → p-b08bf843.entry.js} +1 -1
  315. package/dist/zonos-elements/p-b334c76c.entry.js +1 -0
  316. package/dist/zonos-elements/{p-69212d0f.entry.js → p-b9581a92.entry.js} +1 -1
  317. package/dist/zonos-elements/{p-84cf1a90.system.entry.js → p-bdaf94a4.system.entry.js} +1 -1
  318. package/dist/zonos-elements/{p-231baaf8.entry.js → p-c1ab70d2.entry.js} +1 -1
  319. package/dist/zonos-elements/p-c30a155e.js +1 -0
  320. package/dist/zonos-elements/{p-aedd3911.entry.js → p-c9d4eb42.entry.js} +1 -1
  321. package/dist/zonos-elements/{p-3e85b9f5.system.entry.js → p-cad67b10.system.entry.js} +1 -1
  322. package/dist/zonos-elements/p-cc78c9d4.js +17 -0
  323. package/dist/zonos-elements/p-ce75b047.js +2 -0
  324. package/dist/zonos-elements/{p-909e2bc3.system.js → p-d18a2b2c.system.js} +1 -1
  325. package/dist/zonos-elements/{p-83377e23.entry.js → p-d2301d8a.entry.js} +1 -1
  326. package/dist/zonos-elements/p-d46484aa.entry.js +1 -0
  327. package/dist/zonos-elements/{p-3972663a.system.entry.js → p-d634f954.system.entry.js} +1 -1
  328. package/dist/zonos-elements/{p-14735e9a.system.entry.js → p-dbb3db89.system.entry.js} +1 -1
  329. package/dist/zonos-elements/{p-4592ae49.entry.js → p-ddcbea81.entry.js} +1 -1
  330. package/dist/zonos-elements/p-def2d465.js +1 -0
  331. package/dist/zonos-elements/p-df316670.system.js +1 -0
  332. package/dist/zonos-elements/p-e219d011.js +1 -0
  333. package/dist/zonos-elements/p-e331a235.js +1 -0
  334. package/dist/zonos-elements/p-e4d58bd7.js +1 -0
  335. package/dist/zonos-elements/{p-48475755.entry.js → p-e9ca4447.entry.js} +1 -1
  336. package/dist/zonos-elements/{p-6adfb3af.system.entry.js → p-ed61dedd.system.entry.js} +1 -1
  337. package/dist/zonos-elements/p-ee217693.entry.js +1 -0
  338. package/dist/zonos-elements/{p-ae16dda9.system.js → p-f0855df3.system.js} +1 -1
  339. package/dist/zonos-elements/p-f0938b51.system.entry.js +1 -0
  340. package/dist/zonos-elements/{p-d5b7d3c3.entry.js → p-f25e7f5a.entry.js} +1 -1
  341. package/dist/zonos-elements/{p-0ff93ca6.entry.js → p-f4cc124f.entry.js} +1 -1
  342. package/dist/zonos-elements/p-f830f800.js +1 -0
  343. package/dist/zonos-elements/p-fa0139c3.system.js +1 -0
  344. package/dist/zonos-elements/p-fa5767c3.system.js +1 -0
  345. package/dist/zonos-elements/{p-39fa55c7.entry.js → p-fbfaa4f9.entry.js} +1 -1
  346. package/dist/zonos-elements/p-fe6cc354.entry.js +1 -0
  347. package/dist/zonos-elements/zonos-elements.css +1 -1
  348. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  349. package/dist/zonos-elements/zonos-elements.js +1 -1
  350. package/package.json +70 -52
  351. package/dist/cjs/index-69fa8852.js +0 -1961
  352. package/dist/cjs/zonos-toggle.cjs.entry.js +0 -35
  353. package/dist/esm/index-0bbe9693.js +0 -1928
  354. package/dist/esm/zonos-toggle.entry.js +0 -31
  355. package/dist/esm-es5/cart-ba8f3890.js +0 -1
  356. package/dist/esm-es5/cleanHtmlMarkdown-b5b18743.js +0 -1
  357. package/dist/esm-es5/hasInclusivePrice-6fcc712f.js +0 -1
  358. package/dist/esm-es5/index-0bbe9693.js +0 -2
  359. package/dist/esm-es5/localization-853b48a9.js +0 -1
  360. package/dist/esm-es5/paypal-8d8518c0.js +0 -17
  361. package/dist/esm-es5/zonos-address-display_9.entry.js +0 -1
  362. package/dist/esm-es5/zonos-toggle.entry.js +0 -1
  363. package/dist/esm-es5/zonosStore-b434e436.js +0 -1
  364. package/dist/zonos-elements/p-002e45f9.system.js +0 -17
  365. package/dist/zonos-elements/p-01dada4e.js +0 -1
  366. package/dist/zonos-elements/p-09aabce0.js +0 -1
  367. package/dist/zonos-elements/p-0b7beb16.system.entry.js +0 -1
  368. package/dist/zonos-elements/p-0ef2a242.js +0 -1
  369. package/dist/zonos-elements/p-0f787f5d.entry.js +0 -1
  370. package/dist/zonos-elements/p-1dbeeab2.entry.js +0 -1
  371. package/dist/zonos-elements/p-1f894984.js +0 -1
  372. package/dist/zonos-elements/p-27f6930b.js +0 -1
  373. package/dist/zonos-elements/p-2c2a1339.system.entry.js +0 -1
  374. package/dist/zonos-elements/p-3bec13dd.system.js +0 -1
  375. package/dist/zonos-elements/p-41299ffb.js +0 -1
  376. package/dist/zonos-elements/p-43a22d85.entry.js +0 -1
  377. package/dist/zonos-elements/p-4ffbb0d6.system.js +0 -1
  378. package/dist/zonos-elements/p-64661dd1.js +0 -1
  379. package/dist/zonos-elements/p-719403e0.system.js +0 -1
  380. package/dist/zonos-elements/p-71d855b8.system.entry.js +0 -1
  381. package/dist/zonos-elements/p-72ff005c.entry.js +0 -1
  382. package/dist/zonos-elements/p-786d1c24.js +0 -1
  383. package/dist/zonos-elements/p-7dba5f23.system.js +0 -1
  384. package/dist/zonos-elements/p-866afec1.js +0 -1
  385. package/dist/zonos-elements/p-94c5fbfc.system.entry.js +0 -1
  386. package/dist/zonos-elements/p-989d3af9.system.js +0 -2
  387. package/dist/zonos-elements/p-9fa90292.system.entry.js +0 -1
  388. package/dist/zonos-elements/p-ab41bab5.js +0 -2
  389. package/dist/zonos-elements/p-abf38ed6.js +0 -1
  390. package/dist/zonos-elements/p-ae26aec5.system.js +0 -1
  391. package/dist/zonos-elements/p-af85846e.system.js +0 -1
  392. package/dist/zonos-elements/p-b2a0ab4a.js +0 -1
  393. package/dist/zonos-elements/p-b2ae8eb7.system.js +0 -1
  394. package/dist/zonos-elements/p-bf5e47e2.entry.js +0 -1
  395. package/dist/zonos-elements/p-c027a832.system.js +0 -1
  396. package/dist/zonos-elements/p-c1fb3a2d.entry.js +0 -1
  397. package/dist/zonos-elements/p-c2442878.system.js +0 -1
  398. package/dist/zonos-elements/p-d45285aa.system.js +0 -1
  399. package/dist/zonos-elements/p-dcf999d8.entry.js +0 -1
  400. package/dist/zonos-elements/p-e9e6bea7.system.entry.js +0 -1
  401. package/dist/zonos-elements/p-f6c2c743.entry.js +0 -1
  402. package/dist/zonos-elements/p-fc776473.js +0 -1
  403. package/dist/zonos-elements/p-fe06c9ea.js +0 -17
  404. package/dist/zonos-elements/p-fe96e239.system.js +0 -1
@@ -0,0 +1,113 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-b1f95d96.js');
6
+ const cart = require('./cart-fcd1359c.js');
7
+ const localization = require('./localization-523b793a.js');
8
+ const zonosStore = require('./zonosStore-f5a61112.js');
9
+ const renderCheckoutCurrency = require('./renderCheckoutCurrency-94b6e51d.js');
10
+ const getBorderRadius = require('./getBorderRadius-27a74844.js');
11
+ require('./VarianceTest-bec00ea8.js');
12
+ require('./handleFetch-954f30e1.js');
13
+ require('./isDarkColor-a68abf7a.js');
14
+
15
+ const StoreCreditIcon = `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true">
16
+ <path fill="currentColor" fill-rule="evenodd" d="M4 5a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h16a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3H4Zm16 2H4a1 1 0 0 0-1 1v1h18V8a1 1 0 0 0-1-1ZM2 11h20v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-3Zm6 4.5a1 1 0 0 1 1-1h2a1 1 0 0 1 0 2H9a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>
17
+ </svg>
18
+ `;
19
+
20
+ const zonosStoreCreditCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:block;margin-bottom:var(--zonos-elements-font-size-xl)}:host .zonos--store-credit-container{background:-webkit-gradient(linear, left top, left bottom, from(var(--zonos-elements-gray-0)), to(var(--zonos-elements-gray-50)));background:linear-gradient(180deg, var(--zonos-elements-gray-0) 0%, var(--zonos-elements-gray-50) 100%);border:1px solid var(--zonos-elements-gray-200);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-8));-webkit-box-shadow:var(--zonos-elements-v3-shadow-base);box-shadow:var(--zonos-elements-v3-shadow-base);overflow:hidden;padding:0;position:relative}:host .zonos--store-credit-container::before{background:var(--zonos--primary-color, var(--zonos-elements-gray-400));content:\"\";height:3px;left:0;position:absolute;right:0;top:0}:host .zonos--store-credit-header{padding:var(--zonos-elements-radius-12) var(--zonos-elements-font-size-l) 0}:host .zonos--store-credit-title-row{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .zonos--store-credit-title-left{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-title-icon{-ms-flex-align:center;align-items:center;background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 14%, transparent);border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.75);display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;height:22px;-ms-flex-pack:center;justify-content:center;width:22px}:host .zonos--store-credit-balance-badge{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 8%, var(--zonos-elements-gray-50));border:1px solid color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 22%, var(--zonos-elements-gray-200));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:2px var(--zonos-elements-font-size-s)}:host .zonos--store-credit-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-s) var(--zonos-elements-font-size-l) var(--zonos-elements-radius-12)}:host .zonos--store-credit-checkbox{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex}:host .zonos--store-credit-options{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-toggle-row{display:-ms-flexbox;display:flex}:host .zonos--store-credit-custom-amount{max-width:240px}:host .zonos--store-credit-custom-amount-row{-ms-flex-align:end;align-items:flex-end;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-custom-amount-row zonos-input{-ms-flex:1;flex:1}:host .zonos--store-credit-error{margin-top:2px}:host .zonos--store-credit-summary{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 6%, var(--zonos-elements-gray-50));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:var(--zonos-elements-radius-10) var(--zonos-elements-font-size-s)}:host .zonos--store-credit-empty{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-xl) var(--zonos-elements-font-size-l) 22px;text-align:center}:host .zonos--store-credit-empty-icon{-ms-flex-align:center;align-items:center;background:var(--zonos-elements-gray-100);border-radius:50%;display:-ms-flexbox;display:flex;height:52px;-ms-flex-pack:center;justify-content:center;opacity:0.95;width:52px}";
21
+ const ZonosStoreCreditStyle0 = zonosStoreCreditCss;
22
+
23
+ const AMOUNT_MODE_FULL = 'full';
24
+ const AMOUNT_MODE_CUSTOM = 'custom';
25
+ const ZonosStoreCredit = class {
26
+ constructor(hostRef) {
27
+ index.registerInstance(this, hostRef);
28
+ /**
29
+ * Whether the component is enabled
30
+ */
31
+ this.enabled = true;
32
+ /**
33
+ * Local state for custom amount input
34
+ */
35
+ this.customAmountInput = '';
36
+ this.handleUseStoreCreditChange = (checked) => {
37
+ cart.storeCreditStoreSetEnabled(checked);
38
+ if (checked) {
39
+ // Enable store credit usage with full balance by default
40
+ cart.storeCreditStoreSetUseFullBalance(true);
41
+ }
42
+ void cart.cartStoreUpdateStoreCredit();
43
+ };
44
+ this.handleAmountModeChange = (mode) => {
45
+ const isFullBalance = mode === AMOUNT_MODE_FULL;
46
+ cart.storeCreditStoreSetUseFullBalance(isFullBalance);
47
+ if (!isFullBalance) {
48
+ this.customAmountInput = '';
49
+ }
50
+ void cart.cartStoreUpdateStoreCredit();
51
+ };
52
+ this.handleCustomAmountChange = (value) => {
53
+ this.customAmountInput = value;
54
+ // Clear error when user types
55
+ cart.storeCreditStore.error = null;
56
+ };
57
+ this.handleApplyCustomAmount = () => {
58
+ const amount = parseFloat(this.customAmountInput);
59
+ if (!isNaN(amount) && amount > 0) {
60
+ cart.storeCreditStoreSetAmount(amount);
61
+ }
62
+ else {
63
+ cart.storeCreditStoreSetAmount(null);
64
+ }
65
+ if (!cart.storeCreditStore.error) {
66
+ void cart.cartStoreUpdateStoreCredit();
67
+ }
68
+ };
69
+ }
70
+ async componentWillLoad() {
71
+ await cart.storeCreditStoreRefreshBalance();
72
+ }
73
+ render() {
74
+ if (!this.enabled) {
75
+ return null;
76
+ }
77
+ const { colorPrimary } = zonosStore.zonosStore.appearance;
78
+ const borderRadius = getBorderRadius.getBorderRadius({});
79
+ const availableBalance = cart.storeCreditStore.availableBalance;
80
+ const hasBalance = availableBalance !== null && availableBalance > 0;
81
+ const isUsingStoreCredit = cart.storeCreditStore.isEnabled;
82
+ const useFullBalance = cart.storeCreditStore.useFullBalance;
83
+ const error = cart.storeCreditStore.error;
84
+ const effectiveAmount = cart.storeCreditStoreGetEffectiveAmount();
85
+ const formattedBalance = renderCheckoutCurrency.renderCheckoutCurrency({
86
+ amount: availableBalance !== null && availableBalance !== void 0 ? availableBalance : 0,
87
+ isForeign: true,
88
+ });
89
+ return (index.h(index.Host, { class: "zonos--elements zonos--store-credit", style: {
90
+ '--zonos--border-radius': borderRadius,
91
+ '--zonos--font-family': zonosStore.zonosStoreFontFamily(),
92
+ '--zonos--primary-color': colorPrimary,
93
+ } }, index.h("div", { class: "zonos--store-credit-container" }, index.h("div", { class: "zonos--store-credit-header" }, index.h("div", { class: "zonos--store-credit-title-row" }, index.h("div", { class: "zonos--store-credit-title-left" }, index.h("div", { "aria-hidden": "true", class: "zonos--store-credit-title-icon" }, index.h("zonos-icon", { content: StoreCreditIcon, iconColor: 'gray-500', size: 22 })), index.h("zonos-text", { type: "semiBoldLabel" }, localization.translate('Store credit'))), hasBalance && (index.h("div", { class: "zonos--store-credit-balance-badge" }, index.h("zonos-text", { textColor: "gray-600", type: "caption" }, formattedBalance))))), index.h(index.Fragment, null, hasBalance ? (index.h("div", { class: "zonos--store-credit-content" }, index.h("div", { class: "zonos--store-credit-checkbox" }, index.h("zonos-checkbox", { isChecked: isUsingStoreCredit, label: localization.translate('Use store credit'), onCheckboxSelected: e => this.handleUseStoreCreditChange(e.detail), size: 16 })), isUsingStoreCredit && (index.h("div", { class: "zonos--store-credit-options" }, index.h("div", { class: "zonos--store-credit-toggle-row" }, index.h("zonos-toggle", { onToggleChanged: e => this.handleAmountModeChange(e.detail), options: [
94
+ {
95
+ label: localization.translate('Apply full balance'),
96
+ value: AMOUNT_MODE_FULL,
97
+ },
98
+ {
99
+ label: localization.translate('Enter amount'),
100
+ value: AMOUNT_MODE_CUSTOM,
101
+ },
102
+ ], value: useFullBalance ? AMOUNT_MODE_FULL : AMOUNT_MODE_CUSTOM })), !useFullBalance && (index.h("div", { class: "zonos--store-credit-custom-amount" }, index.h("div", { class: "zonos--store-credit-custom-amount-row" }, index.h("zonos-input", { inputLabel: localization.translate('Enter amount'), inputValue: this.customAmountInput, isError: !!error, onInputChange: e => this.handleCustomAmountChange(e.detail) }), index.h("zonos-button", { onClick: this.handleApplyCustomAmount, size: "sm", variant: "primary" }, localization.translate('Apply'))))), error && (index.h("div", { class: "zonos--store-credit-error" }, index.h("zonos-text", { textColor: "red-600", type: "caption" }, error))), index.h("div", { class: "zonos--store-credit-summary" }, index.h("zonos-text", { textColor: "gray-800", type: "semiBoldLabel" }, localization.translate('Amount to apply: [amount]', {
103
+ amount: renderCheckoutCurrency.renderCheckoutCurrency({
104
+ amount: effectiveAmount,
105
+ isForeign: true,
106
+ }),
107
+ }))))))) : (index.h("div", { class: "zonos--store-credit-empty" }, index.h("div", { "aria-hidden": "true", class: "zonos--store-credit-empty-icon" }, index.h("zonos-icon", { content: StoreCreditIcon, iconColor: "gray-500", size: 28 })), index.h("zonos-text", { textColor: "gray-600", type: "caption" }, localization.translate('No store credit available'))))))));
108
+ }
109
+ get el() { return index.getElement(this); }
110
+ };
111
+ ZonosStoreCredit.style = ZonosStoreCreditStyle0;
112
+
113
+ exports.zonos_store_credit = ZonosStoreCredit;
@@ -2,12 +2,12 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-69fa8852.js');
6
- const zonosStore = require('./zonosStore-37a4b4f4.js');
5
+ const index = require('./index-b1f95d96.js');
6
+ const zonosStore = require('./zonosStore-f5a61112.js');
7
7
  const helpers = require('./helpers-5bdbb68c.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
- const getBorderRadius = require('./getBorderRadius-2ef1170d.js');
10
- const isDarkColor = require('./isDarkColor-878e600e.js');
9
+ const getBorderRadius = require('./getBorderRadius-27a74844.js');
10
+ const isDarkColor = require('./isDarkColor-a68abf7a.js');
11
11
  require('./VarianceTest-bec00ea8.js');
12
12
 
13
13
  const zonosStripeInputCss = ".sc-zonos-stripe-input-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-stripe-input-h *.sc-zonos-stripe-input{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-stripe-input-h img.sc-zonos-stripe-input{max-width:100%}.sc-zonos-stripe-input-h dl.sc-zonos-stripe-input,.sc-zonos-stripe-input-h dd.sc-zonos-stripe-input,.sc-zonos-stripe-input-h h1.sc-zonos-stripe-input,.sc-zonos-stripe-input-h h2.sc-zonos-stripe-input,.sc-zonos-stripe-input-h h3.sc-zonos-stripe-input,.sc-zonos-stripe-input-h h4.sc-zonos-stripe-input,.sc-zonos-stripe-input-h h5.sc-zonos-stripe-input,.sc-zonos-stripe-input-h h6.sc-zonos-stripe-input,.sc-zonos-stripe-input-h hr.sc-zonos-stripe-input,.sc-zonos-stripe-input-h figure.sc-zonos-stripe-input,.sc-zonos-stripe-input-h p.sc-zonos-stripe-input,.sc-zonos-stripe-input-h pre.sc-zonos-stripe-input{margin:0}.sc-zonos-stripe-input-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-stripe-input-h{--zonos--background-color:#f1f1f1;--zonos--local-glowing-color:0 0 0 3px hsla(0, 0%, 100%, 25%),\n 0 0 0 1px var(--zonos--primary-color);--zonos--border:1px solid #e8e8e8}.dark.sc-zonos-stripe-input-h{color-scheme:dark;--zonos--background-color:#30313d;--zonos--local-glowing-color:0px 2px 4px rgba(0, 0, 0, 0.5),\n 0px 1px 6px rgba(0, 0, 0, 0.25), 0 0 0 3px hsla(0, 0%, 100%, 25%),\n 0 1px 1px 0 rgba(255, 255, 255, 0.12);--zonos--border:1px solid var(--zonos--primary-color)}.sc-zonos-stripe-input-h{margin:1px}.sc-zonos-stripe-input-h .zonos--label-wrapper.sc-zonos-stripe-input{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;width:100%;background:var(--zonos--background-color);border-radius:var(--zonos--border-radius);border:var(--zonos--border);outline-offset:0;outline-width:2px;height:calc(var(--zonos-elements-size-xl) - 2px)}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input{-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;padding:0 16px;outline:none;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);width:100%;border-radius:var(--zonos--border-radius);background:var(--zonos--background-color);border:var(--zonos--border);-ms-flex-order:2;order:2;font-weight:400;font-size:var(--zonos--font-size);color:var(--zonos-elements-text-color);height:auto}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input .sc-zonos-stripe-input:-internal-autofill-selected{border-radius:var(--zonos-elements-radius-6) 0 0 var(--zonos-elements-radius-6)}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input .sc-zonos-stripe-input:-internal-autofill-selected+label.sc-zonos-stripe-input+div.sc-zonos-stripe-input{background-color:#e8f0fe}.sc-zonos-stripe-input-h .zonos--floated-input.has-label.sc-zonos-stripe-input{padding:24px 4px 2px 16px}.sc-zonos-stripe-input-h .zonos--floated-input.has-label.has-input-prefix.sc-zonos-stripe-input{padding-left:0}.sc-zonos-stripe-input-h .zonos--floated-input.has-label.has-input-prefix.sc-zonos-stripe-input~.zonos--floated-label.sc-zonos-stripe-input label.sc-zonos-stripe-input{margin-left:0}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:not(.has-label)::-webkit-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:not(.has-label)::-moz-placeholder{opacity:var(--zonos-elements-opacity-disabled)}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:not(.has-label):-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:not(.has-label)::-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:not(.has-label)::placeholder{opacity:var(--zonos-elements-opacity-disabled)}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input::-webkit-input-placeholder{-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input::-moz-placeholder{-moz-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:-ms-input-placeholder{-ms-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input::-ms-input-placeholder{-ms-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input::placeholder{-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);opacity:0}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:focus{outline:none;border:var(--zonos--border)}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:focus~.zonos--floated-label.sc-zonos-stripe-input::after{-webkit-box-shadow:var(--zonos--glowing-color, var(--zonos--local-glowing-color));box-shadow:var(--zonos--glowing-color, var(--zonos--local-glowing-color))}.sc-zonos-stripe-input-h .zonos--floated-input.has-error.sc-zonos-stripe-input~.zonos--floated-label.sc-zonos-stripe-input::after{-webkit-box-shadow:0 0 0 2px #df1b41;box-shadow:0 0 0 2px #df1b41}.sc-zonos-stripe-input-h .zonos--floated-input.has-content.sc-zonos-stripe-input::-webkit-input-placeholder,.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:focus::-webkit-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}.sc-zonos-stripe-input-h .zonos--floated-input.has-content.sc-zonos-stripe-input::-moz-placeholder,.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:focus::-moz-placeholder{opacity:var(--zonos-elements-opacity-disabled)}.sc-zonos-stripe-input-h .zonos--floated-input.has-content.sc-zonos-stripe-input:-ms-input-placeholder,.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:focus:-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}.sc-zonos-stripe-input-h .zonos--floated-input.has-content.sc-zonos-stripe-input::-ms-input-placeholder,.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:focus::-ms-input-placeholder{opacity:var(--zonos-elements-opacity-disabled)}.sc-zonos-stripe-input-h .zonos--floated-input.has-content.sc-zonos-stripe-input::placeholder,.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:focus::placeholder{opacity:var(--zonos-elements-opacity-disabled)}.sc-zonos-stripe-input-h .zonos--floated-input.has-content.sc-zonos-stripe-input~.zonos--floated-label.sc-zonos-stripe-input label.sc-zonos-stripe-input,.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:focus~.zonos--floated-label.sc-zonos-stripe-input label.sc-zonos-stripe-input{top:11px;-webkit-transform:scale(0.8);transform:scale(0.8)}.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:-webkit-autofill,.sc-zonos-stripe-input-h .zonos--floated-input.sc-zonos-stripe-input:-moz-autofill{background-color:var(--zonos-elements-input-background);color:var(--zonos-elements-text-color)}.sc-zonos-stripe-input-h .zonos--floated-label.sc-zonos-stripe-input{display:block;max-height:0;pointer-events:none;-ms-flex-order:1;order:1}.sc-zonos-stripe-input-h .zonos--floated-label.sc-zonos-stripe-input label.sc-zonos-stripe-input{color:var(--zonos-elements-gray-800);position:absolute;font-size:16px;line-height:16px;display:inline-block;-webkit-filter:blur(0);filter:blur(0);-webkit-transform-origin:left top;transform-origin:left top;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);margin-left:16px;top:calc(50% - 8px);z-index:1}.sc-zonos-stripe-input-h .zonos--floated-label.sc-zonos-stripe-input::after{content:\"\";position:absolute;left:0;right:0;top:0;bottom:0;border-radius:var(--zonos--border-radius)}.sc-zonos-stripe-input-h .disabled.sc-zonos-stripe-input .zonos--floated-label.sc-zonos-stripe-input{pointer-events:inherit}.sc-zonos-stripe-input-h .disabled.sc-zonos-stripe-input .zonos--floated-label.sc-zonos-stripe-input::after{cursor:not-allowed;z-index:1}.dark.sc-zonos-stripe-input-h .zonos--label-wrapper.sc-zonos-stripe-input{background:#30313d}";
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-69fa8852.js');
6
- const zonosStore = require('./zonosStore-37a4b4f4.js');
5
+ const index = require('./index-b1f95d96.js');
6
+ const zonosStore = require('./zonosStore-f5a61112.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
  const isColorVariable = require('./isColorVariable-525dbfa7.js');
9
9
  const styles = require('./styles-d1e64fb9.js');
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-69fa8852.js');
5
+ const index = require('./index-b1f95d96.js');
6
6
  const classes = require('./classes-b7918f56.js');
7
7
 
8
8
  const zonosTooltipCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--tooltip{position:relative}:host .zonos--tooltip .zonos--tooltip-content{position:absolute;bottom:100%;left:0;width:-webkit-max-content;width:-moz-max-content;width:max-content;padding:12px;background-color:var(--zonos-elements-gray-1000);opacity:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transition:all 0.2s ease-in-out;transition:all 0.2s ease-in-out;-webkit-transform-origin:bottom left;transform-origin:bottom left;border-radius:var(--zonos-elements-radius-4);z-index:100;-webkit-box-shadow:var(--zonos-elements-v3-shadow-large);box-shadow:var(--zonos-elements-v3-shadow-large)}:host .zonos--tooltip .zonos--tooltip-content.zonos--show-tooltip{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-69fa8852.js');
6
- const zonosStore = require('./zonosStore-37a4b4f4.js');
5
+ const index = require('./index-b1f95d96.js');
6
+ const zonosStore = require('./zonosStore-f5a61112.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
  require('./VarianceTest-bec00ea8.js');
9
9
 
@@ -1,15 +1,16 @@
1
1
  'use strict';
2
2
 
3
- const index = require('./index-69fa8852.js');
3
+ const index = require('./index-b1f95d96.js');
4
4
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
5
5
 
6
6
  const appendToMap = (map, propName, value) => {
7
- const items = map.get(propName);
8
- if (!items) {
9
- map.set(propName, [value]);
7
+ let refs = map.get(propName);
8
+ if (!refs) {
9
+ refs = [];
10
+ map.set(propName, refs);
10
11
  }
11
- else if (!items.includes(value)) {
12
- items.push(value);
12
+ if (!refs.some((ref) => ref.deref() === value)) {
13
+ refs.push(new WeakRef(value));
13
14
  }
14
15
  };
15
16
  const debounce = (fn, ms) => {
@@ -37,33 +38,54 @@ const debounce = (fn, ms) => {
37
38
  const isConnected = (maybeElement) => !('isConnected' in maybeElement) || maybeElement.isConnected;
38
39
  const cleanupElements = debounce((map) => {
39
40
  for (let key of map.keys()) {
40
- map.set(key, map.get(key).filter(isConnected));
41
+ const refs = map.get(key).filter((ref) => {
42
+ const elm = ref.deref();
43
+ return elm && isConnected(elm);
44
+ });
45
+ map.set(key, refs);
41
46
  }
42
47
  }, 2_000);
48
+ const core = index.StencilCore;
49
+ const forceUpdate = core.forceUpdate;
50
+ const getRenderingRef = core.getRenderingRef;
43
51
  const stencilSubscription = () => {
44
- if (typeof index.getRenderingRef !== 'function') {
52
+ if (typeof getRenderingRef !== 'function' || typeof forceUpdate !== 'function') {
45
53
  // If we are not in a stencil project, we do nothing.
46
54
  // This function is not really exported by @stencil/core.
47
55
  return {};
48
56
  }
57
+ const ensureForceUpdate = forceUpdate;
58
+ const ensureGetRenderingRef = getRenderingRef;
49
59
  const elmsToUpdate = new Map();
50
60
  return {
51
61
  dispose: () => elmsToUpdate.clear(),
52
62
  get: (propName) => {
53
- const elm = index.getRenderingRef();
63
+ const elm = ensureGetRenderingRef();
54
64
  if (elm) {
55
65
  appendToMap(elmsToUpdate, propName, elm);
56
66
  }
57
67
  },
58
68
  set: (propName) => {
59
- const elements = elmsToUpdate.get(propName);
60
- if (elements) {
61
- elmsToUpdate.set(propName, elements.filter(index.forceUpdate));
69
+ const refs = elmsToUpdate.get(propName);
70
+ if (refs) {
71
+ const nextRefs = refs.filter((ref) => {
72
+ const elm = ref.deref();
73
+ if (!elm)
74
+ return false;
75
+ return ensureForceUpdate(elm);
76
+ });
77
+ elmsToUpdate.set(propName, nextRefs);
62
78
  }
63
79
  cleanupElements(elmsToUpdate);
64
80
  },
65
81
  reset: () => {
66
- elmsToUpdate.forEach((elms) => elms.forEach(index.forceUpdate));
82
+ elmsToUpdate.forEach((refs) => {
83
+ refs.forEach((ref) => {
84
+ const elm = ref.deref();
85
+ if (elm)
86
+ ensureForceUpdate(elm);
87
+ });
88
+ });
67
89
  cleanupElements(elmsToUpdate);
68
90
  },
69
91
  };
@@ -71,18 +93,26 @@ const stencilSubscription = () => {
71
93
 
72
94
  const unwrap = (val) => (typeof val === 'function' ? val() : val);
73
95
  const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) => {
74
- const unwrappedState = unwrap(defaultState);
75
- let states = new Map(Object.entries(unwrappedState ?? {}));
96
+ const resolveDefaultState = () => (unwrap(defaultState) ?? {});
97
+ const initialState = resolveDefaultState();
98
+ let states = new Map(Object.entries(initialState));
99
+ const proxyAvailable = typeof Proxy !== 'undefined';
100
+ const plainState = proxyAvailable ? null : {};
76
101
  const handlers = {
77
102
  dispose: [],
78
103
  get: [],
79
104
  set: [],
80
105
  reset: [],
81
106
  };
107
+ // Track onChange listeners to enable removeListener functionality
108
+ const changeListeners = new Map();
82
109
  const reset = () => {
83
110
  // When resetting the state, the default state may be a function - unwrap it to invoke it.
84
111
  // otherwise, the state won't be properly reset
85
- states = new Map(Object.entries(unwrap(defaultState) ?? {}));
112
+ states = new Map(Object.entries(resolveDefaultState()));
113
+ if (!proxyAvailable) {
114
+ syncPlainStateKeys();
115
+ }
86
116
  handlers.reset.forEach((cb) => cb());
87
117
  };
88
118
  const dispose = () => {
@@ -99,12 +129,14 @@ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) =>
99
129
  const oldValue = states.get(propName);
100
130
  if (shouldUpdate(value, oldValue, propName)) {
101
131
  states.set(propName, value);
132
+ if (!proxyAvailable) {
133
+ ensurePlainProperty(propName);
134
+ }
102
135
  handlers.set.forEach((cb) => cb(propName, value, oldValue));
103
136
  }
104
137
  };
105
- const state = (typeof Proxy === 'undefined'
106
- ? {}
107
- : new Proxy(unwrappedState, {
138
+ const state = (proxyAvailable
139
+ ? new Proxy(initialState, {
108
140
  get(_, propName) {
109
141
  return get(propName);
110
142
  },
@@ -124,7 +156,11 @@ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) =>
124
156
  set(propName, value);
125
157
  return true;
126
158
  },
127
- }));
159
+ })
160
+ : (() => {
161
+ syncPlainStateKeys();
162
+ return plainState;
163
+ })());
128
164
  const on = (eventName, callback) => {
129
165
  handlers[eventName].push(callback);
130
166
  return () => {
@@ -132,17 +168,24 @@ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) =>
132
168
  };
133
169
  };
134
170
  const onChange = (propName, cb) => {
135
- const unSet = on('set', (key, newValue) => {
171
+ const setHandler = (key, newValue) => {
136
172
  if (key === propName) {
137
173
  cb(newValue);
138
174
  }
139
- });
140
- // We need to unwrap the defaultState because it might be a function.
141
- // Otherwise we might not be sending the right reset value.
142
- const unReset = on('reset', () => cb(unwrap(defaultState)[propName]));
175
+ };
176
+ const resetHandler = () => {
177
+ const snapshot = resolveDefaultState();
178
+ cb(snapshot[propName]);
179
+ };
180
+ // Register the handlers
181
+ const unSet = on('set', setHandler);
182
+ const unReset = on('reset', resetHandler);
183
+ // Track the relationship between the user callback and internal handlers
184
+ changeListeners.set(cb, { setHandler, resetHandler, propName });
143
185
  return () => {
144
186
  unSet();
145
187
  unReset();
188
+ changeListeners.delete(cb);
146
189
  };
147
190
  };
148
191
  const use = (...subscriptions) => {
@@ -167,6 +210,47 @@ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) =>
167
210
  const oldValue = states.get(key);
168
211
  handlers.set.forEach((cb) => cb(key, oldValue, oldValue));
169
212
  };
213
+ const removeListener = (propName, listener) => {
214
+ const listenerInfo = changeListeners.get(listener);
215
+ if (listenerInfo && listenerInfo.propName === propName) {
216
+ // Remove the specific handlers that were created for this listener
217
+ removeFromArray(handlers.set, listenerInfo.setHandler);
218
+ removeFromArray(handlers.reset, listenerInfo.resetHandler);
219
+ changeListeners.delete(listener);
220
+ }
221
+ };
222
+ function ensurePlainProperty(key) {
223
+ if (proxyAvailable || !plainState) {
224
+ return;
225
+ }
226
+ if (Object.prototype.hasOwnProperty.call(plainState, key)) {
227
+ return;
228
+ }
229
+ Object.defineProperty(plainState, key, {
230
+ configurable: true,
231
+ enumerable: true,
232
+ get() {
233
+ return get(key);
234
+ },
235
+ set(value) {
236
+ set(key, value);
237
+ },
238
+ });
239
+ }
240
+ function syncPlainStateKeys() {
241
+ if (proxyAvailable || !plainState) {
242
+ return;
243
+ }
244
+ const knownKeys = new Set(states.keys());
245
+ for (const key of Object.keys(plainState)) {
246
+ if (!knownKeys.has(key)) {
247
+ delete plainState[key];
248
+ }
249
+ }
250
+ for (const key of knownKeys) {
251
+ ensurePlainProperty(key);
252
+ }
253
+ }
170
254
  return {
171
255
  state,
172
256
  get,
@@ -177,6 +261,7 @@ const createObservableMap = (defaultState, shouldUpdate = (a, b) => a !== b) =>
177
261
  dispose,
178
262
  reset,
179
263
  forceUpdate,
264
+ removeListener,
180
265
  };
181
266
  };
182
267
  const removeFromArray = (array, item) => {
@@ -15,6 +15,7 @@
15
15
  "components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js",
16
16
  "components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js",
17
17
  "components/checkout/zonos-checkout/zonos-checkout-payment/zonos-empty-state-payment/zonos-empty-state-payment.js",
18
+ "components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.js",
18
19
  "components/checkout/zonos-checkout/zonos-currency-toggle/zonos-currency-toggle.js",
19
20
  "components/checkout/zonos-checkout/zonos-customer-info/zonos-customer-info.js",
20
21
  "components/checkout/zonos-checkout/zonos-review/zonos-review.js",
@@ -155,6 +155,9 @@ export class ZonosCartSubtotal {
155
155
  } }), h("zonos-button", { loading: this.loading, onClick: () => applyPromoCode(), variant: "primary" }, translate('Apply'))))))), !!cartStore.adjustmentTotal && (h("tr", { class: "zonos--row zonos--cart-discount" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("div", { class: "zonos--title-with-icon" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Discounts')))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("zonos-text", { type: "semiBoldLabel" }, renderCheckoutCurrency({
156
156
  amount: cartStore.adjustmentTotal,
157
157
  isForeign: true,
158
+ }))))), !!cartStore.storeCredit && (h("tr", { class: "zonos--row zonos--cart-store-credit" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column zonos--cart-subtotal-title" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Store credit'))), h("td", { class: "zonos--column zonos--cart-subtotal-price" }, h("zonos-text", { textColor: "green-600", type: "semiBoldLabel" }, "-", renderCheckoutCurrency({
159
+ amount: cartStore.storeCredit,
160
+ isForeign: true,
158
161
  }))))), h("tr", { class: "zonos--row zonos--cart-pay-total" }, h("td", { class: "zonos--column" }), h("td", { class: "zonos--column" }, h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, translate('Order total'))), h("td", { class: "zonos--column zonos--cart-total-price" }, h("zonos-text", { type: "semiBoldLabel" }, renderCheckoutCurrency({
159
162
  amount: total,
160
163
  isForeign: true,
@@ -1,6 +1,7 @@
1
1
  import { Fragment, h, Host, } from "@stencil/core";
2
2
  import { cartStore } from "../../../store/checkout/cart";
3
3
  import { paypalStore, paypalStoreReset, } from "../../../store/checkout/paypal";
4
+ import { storeCreditStore, storeCreditStoreReset, } from "../../../store/checkout/storeCredit";
4
5
  import { stripeStore, stripeStoreMessageBasedOnStatus, stripeStoreReset, stripeStoreResetPromoCode, stripeStoreRetrievePayment, } from "../../../store/checkout/stripe";
5
6
  import { storageStore } from "../../../store/storageStore";
6
7
  import { translate } from "../../../store/translationStore";
@@ -431,6 +432,47 @@ export class ZonosCheckoutFinish {
431
432
  paypalStoreReset();
432
433
  storageStore.checkoutSessionId = null;
433
434
  };
435
+ this.checkStoreCreditOrderStatus = async () => {
436
+ // show success message right away when order id is already created
437
+ this.isLoading = false;
438
+ if (storeCreditStore.orderIdCreated) {
439
+ const checkoutSessionId = storageStore.checkoutSessionId;
440
+ submitGtag({
441
+ event: 'zonos-checkout-success',
442
+ metadata: this.buildPurchaseMetadata({
443
+ checkoutSessionId: checkoutSessionId || '',
444
+ }),
445
+ });
446
+ submitGtag({
447
+ event: 'purchase',
448
+ metadata: this.buildPurchaseMetadata({
449
+ checkoutSessionId: checkoutSessionId || '',
450
+ }),
451
+ });
452
+ void trackConversionEvent({
453
+ checkoutSessionId,
454
+ eventName: 'checkout_orderCompleted',
455
+ });
456
+ this.notificationType = 'success';
457
+ this.notificationTitle = translate("You're all set!");
458
+ this.notificationMessages =
459
+ stripeStoreMessageBasedOnStatus('succeeded').messages;
460
+ // override title if notification type is success
461
+ this.useOverrideSuccessNotification();
462
+ const successEvent = createCustomEvent('zonos-checkout-success', {
463
+ message: 'Zonos Checkout successfully processed order',
464
+ });
465
+ document.dispatchEvent(successEvent);
466
+ // wait this to finish before resetting store and checkout session id
467
+ await this.handleSuccessBehavior();
468
+ }
469
+ // reset stores when checkout is finished
470
+ stripeStoreResetPromoCode();
471
+ stripeStoreReset();
472
+ paypalStoreReset();
473
+ storeCreditStoreReset();
474
+ storageStore.checkoutSessionId = null;
475
+ };
434
476
  this.closeClickHandler = () => {
435
477
  this.closeClick.emit();
436
478
  };
@@ -463,6 +505,9 @@ export class ZonosCheckoutFinish {
463
505
  if (cartStore.isStagingMode) {
464
506
  void this.checkStagingOrderStatus();
465
507
  }
508
+ else if (storeCreditStore.orderIdCreated) {
509
+ void this.checkStoreCreditOrderStatus();
510
+ }
466
511
  else if (paypalStore.orderIdCreated) {
467
512
  void this.checkPaypalPaymentStatus();
468
513
  }
@@ -472,11 +517,11 @@ export class ZonosCheckoutFinish {
472
517
  }
473
518
  render() {
474
519
  const isTestMode = getIsTestMode();
475
- return (h(Host, { key: '80a543fca5dbc63dde41806702b2f6dd4fa849ab', class: "zonos--checkout-finish zonos--elements", style: {
520
+ return (h(Host, { key: 'c74f250bac797f8c000bac4892bc5ab56c0867bb', class: "zonos--checkout-finish zonos--elements", style: {
476
521
  '--zonos--border-radius': getBorderRadius({
477
522
  overrideBorderStyle: this.borderRadius,
478
523
  }),
479
- } }, !this.isLoading && (h("div", { key: '6cab293041902e156563f37db6f0e77caaeeaaf9', class: "zonos--finish-details" }, h("div", { key: '6bf32844fa9d38eae6e9f337e56b7918e49bf793', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: 'bf13e59b7bc2380609ffba879fa2b1d8c5d9a9e0', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", { key: 'c246affb94a9799e0c556affb73b2ebfb69a9c7f', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (h("zonos-button", { key: '61fa4fa0e09c0ce2905281b2696f42172c7a2bcd',
524
+ } }, !this.isLoading && (h("div", { key: '5ee705381b0246f5035f512c9d19beba6dc33d4f', class: "zonos--finish-details" }, h("div", { key: '1d1a54d8f73535aaada32601c5e771c9fd381104', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: '68c898ee87166d08bd52702ae8f9bfe51c393076', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), h("zonos-text", { key: '98b6eaff782fe34a8dbd258e4c7d0c81c3577bcc', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (h("zonos-button", { key: 'ccc5e7973b2e962e22ac56dcad6e33b048621036',
480
525
  // Only show loading spinner if it's not an error notification
481
526
  loading: this.isWaitingToRedirect &&
482
527
  this.notificationType !== 'error', onClick: () => {
@@ -488,9 +533,9 @@ export class ZonosCheckoutFinish {
488
533
  }
489
534
  this.closeClickHandler();
490
535
  }, size: "md", variant: "primary" }, translate('Close'))), !window.Zonos.isLegacyCheckout &&
491
- this.shouldRenderKeepShoppingButton() && (h("zonos-button", { key: '9227d7832ed477be556cb6d59c644a74c293c740', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode &&
536
+ this.shouldRenderKeepShoppingButton() && (h("zonos-button", { key: 'cd30bc010f2a3e935d9b80e56389581a9150b021', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode &&
492
537
  cartStore.step === 'finish' &&
493
- this.notificationType === 'success' && (h("div", { key: '9107be1ef7895b0a5e3fe0a985036a11de7011d3', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: 'b0de8743bea8dd9ac7099bd5b77811f80d80a380', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: 'f90749b9af4c17eac554efb6d3d12cc41ac6e3c8', onClick: () => {
538
+ this.notificationType === 'success' && (h("div", { key: '458809f316ac5129efbc7fe90d1549c042d477af', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: 'dcf0c595cb119a731c34c1aff09960db8a1fb251', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: '76d55870370b4906970b3e2109617ba2230eee7e', onClick: () => {
494
539
  const isZonosDashboard = window.location.hostname.includes('dashboard.zonos.com');
495
540
  this.redirectToUrl(isZonosDashboard
496
541
  ? '/orders/all'
@@ -1,6 +1,7 @@
1
1
  import { Fragment, h, Host, } from "@stencil/core";
2
2
  import { cartStore, cartStoreNextStep, } from "../../../store/checkout/cart";
3
3
  import { paypalStore } from "../../../store/checkout/paypal";
4
+ import { storeCreditStore, storeCreditStoreCoversFullAmount, } from "../../../store/checkout/storeCredit";
4
5
  import { stripeStore } from "../../../store/checkout/stripe";
5
6
  import { storageStore } from "../../../store/storageStore";
6
7
  import { translate } from "../../../store/translationStore";
@@ -52,7 +53,8 @@ export class ZonosCheckoutPayment {
52
53
  */
53
54
  this.continueClickHandler = async ({ currencyCode, }) => {
54
55
  var _a, _b;
55
- if (!this.handleValidate()) {
56
+ // Skip Stripe payment validation when store credit covers the full order
57
+ if (!storeCreditStoreCoversFullAmount() && !this.handleValidate()) {
56
58
  this.showErrorBanner = true;
57
59
  // Attempt to submit the form so the missing input error will be shown in Stripe
58
60
  void ((_a = stripeStore.stripeElements) === null || _a === void 0 ? void 0 : _a.submit());
@@ -143,6 +145,7 @@ export class ZonosCheckoutPayment {
143
145
  const isTestMode = getIsTestMode();
144
146
  const isStagingMode = cartStore.isStagingMode || getIsStagingMode();
145
147
  const isPaypalTabSelected = ((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
148
+ const storeCreditCoversFullOrder = storeCreditStoreCoversFullAmount();
146
149
  const renderPayment = () => {
147
150
  if (isStagingMode) {
148
151
  const { colorPrimary } = zonosStore.appearance;
@@ -158,7 +161,9 @@ export class ZonosCheckoutPayment {
158
161
  variant: this.submitBtnType }, translate('Place test order')))));
159
162
  }
160
163
  return (h(Fragment, null, this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), this.hasStripePaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, stripeStore.customErrorMessage ||
161
- translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), h("zonos-payment", null), h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (h(Fragment, null, h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
164
+ translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), cartStore.customerAuthenticationToken &&
165
+ storeCreditStore.availableBalance != null &&
166
+ storeCreditStore.availableBalance > 0 && (h("zonos-store-credit", null)), storeCreditCoversFullOrder ? (h("zonos-banner", { intent: "info" }, translate('Store credit covers your full order'))) : (h("zonos-payment", null)), h("div", { class: "zonos--group-btn" }, (!isPaypalTabSelected || storeCreditCoversFullOrder) && (h(Fragment, null, h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
162
167
  stripeStore.checkoutSettlementCurrency === 'USD', loading: this.continueLoading &&
163
168
  stripeStore.checkoutSettlementCurrency !== 'USD', onClick: async () => {
164
169
  if (!cartStore.checkoutSession) {
@@ -171,22 +176,25 @@ export class ZonosCheckoutPayment {
171
176
  });
172
177
  }, size: "lg",
173
178
  // use primary type when on mobile mode
174
- variant: this.submitBtnType }, translate('Pay [orderTotal]', {
175
- orderTotal: renderCheckoutCurrency({
176
- amount: cartStore.total,
177
- isForeign: true,
178
- }),
179
- })), stripeStore.shouldRenderPayInUsdButton && (h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
179
+ variant: this.submitBtnType }, storeCreditCoversFullOrder
180
+ ? translate('Place order')
181
+ : translate('Pay [orderTotal]', {
182
+ orderTotal: renderCheckoutCurrency({
183
+ amount: cartStore.total,
184
+ isForeign: true,
185
+ }),
186
+ })), !storeCreditCoversFullOrder &&
187
+ stripeStore.shouldRenderPayInUsdButton && (h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
180
188
  stripeStore.checkoutSettlementCurrency !== 'USD', loading: this.continueLoading &&
181
189
  stripeStore.checkoutSettlementCurrency === 'USD', onClick: async () => {
182
190
  await this.continueClickHandler({
183
191
  currencyCode: 'USD',
184
192
  });
185
- }, size: "lg", variant: "subtle" }, translate('Click to pay in USD'))))), h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
193
+ }, size: "lg", variant: "subtle" }, translate('Click to pay in USD'))))), !storeCreditCoversFullOrder && (h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
186
194
  this.paypalSessionDone.emit(orderId);
187
195
  }, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
188
196
  display: isPaypalTabSelected ? 'block' : 'none',
189
- } })), isTestMode && (h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, h("zonos-v-stack", { spacing: 16 }, h("div", null, h("zonos-text", { type: "semiBoldLabel" }, translate('Test cards')), h("zonos-text", { textColor: "gray-700" }, translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), h("zonos-button", { icon: h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, translate('Success'), " (****4242)"), h("zonos-button", { icon: h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, translate('Failure'), " (****0002)")), h("zonos-notification", null)))));
197
+ } }))), isTestMode && (h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, h("zonos-v-stack", { spacing: 16 }, h("div", null, h("zonos-text", { type: "semiBoldLabel" }, translate('Test cards')), h("zonos-text", { textColor: "gray-700" }, translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), h("zonos-button", { icon: h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, translate('Success'), " (****4242)"), h("zonos-button", { icon: h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, translate('Failure'), " (****0002)")), h("zonos-notification", null)))));
190
198
  };
191
199
  return (h(Host, { class: "zonos--checkout-payment zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Payment method')), renderPayment())));
192
200
  }
@@ -0,0 +1,3 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true">
2
+ <path fill="currentColor" fill-rule="evenodd" d="M4 5a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h16a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3H4Zm16 2H4a1 1 0 0 0-1 1v1h18V8a1 1 0 0 0-1-1ZM2 11h20v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-3Zm6 4.5a1 1 0 0 1 1-1h2a1 1 0 0 1 0 2H9a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>
3
+ </svg>