@zonos/elements 1.3.249 → 1.3.251

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 (244) hide show
  1. package/dist/cjs/{cart-eca56521.js → cart-77640463.js} +318 -19
  2. package/dist/cjs/{hasInclusivePrice-e7d67b45.js → hasInclusivePrice-e93c64fd.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{invoice-918f2c2b.js → invoice-211ef96c.js} +2 -2
  5. package/dist/cjs/{isCollectMobileTablet-89911215.js → isCollectMobileTablet-14fb5ab4.js} +2 -2
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{localization-878ef681.js → localization-be7afc1b.js} +780 -0
  8. package/dist/cjs/{paypal-6acca678.js → paypal-c61ef042.js} +29 -2
  9. package/dist/cjs/{placeTestOrder-f1c1e939.js → placeTestOrder-0f7477c8.js} +2 -2
  10. package/dist/cjs/{renderCheckoutCurrency-d9590e81.js → renderCheckoutCurrency-1ac02803.js} +2 -2
  11. package/dist/cjs/{zonos-address-display_9.cjs.entry.js → zonos-address-display_8.cjs.entry.js} +3 -79
  12. package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-card_5.cjs.entry.js +3 -3
  14. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +74 -20
  15. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +113 -0
  16. package/dist/cjs/zonos-checkout.cjs.entry.js +79 -4
  17. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +2 -2
  18. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
  19. package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
  20. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  21. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  22. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-elements.cjs.js +1 -1
  24. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  25. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  26. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
  27. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +6 -6
  28. package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
  29. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  30. package/dist/cjs/zonos-store-credit.cjs.entry.js +113 -0
  31. package/dist/collection/collection-manifest.json +1 -0
  32. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +3 -0
  33. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +49 -4
  34. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +18 -10
  35. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/assets/StoreCreditIcon.svg +3 -0
  36. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.css +139 -0
  37. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.js +137 -0
  38. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +81 -3
  39. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +1 -1
  40. package/dist/collection/components/main/zonos-controller.js +1 -1
  41. package/dist/collection/components/store/checkout/cart.js +62 -4
  42. package/dist/collection/components/store/checkout/paypal.js +28 -0
  43. package/dist/collection/components/store/checkout/storeCredit.js +237 -0
  44. package/dist/collection/components/store/checkout/stripe.js +2 -1
  45. package/dist/collection/components/store/translationStore/strings.arabic.js +39 -0
  46. package/dist/collection/components/store/translationStore/strings.base.js +39 -0
  47. package/dist/collection/components/store/translationStore/strings.chinese.js +39 -0
  48. package/dist/collection/components/store/translationStore/strings.danish.js +39 -0
  49. package/dist/collection/components/store/translationStore/strings.dutch.js +39 -0
  50. package/dist/collection/components/store/translationStore/strings.french.js +39 -0
  51. package/dist/collection/components/store/translationStore/strings.german.js +39 -0
  52. package/dist/collection/components/store/translationStore/strings.hebrew.js +39 -0
  53. package/dist/collection/components/store/translationStore/strings.indonesian.js +39 -0
  54. package/dist/collection/components/store/translationStore/strings.italian.js +39 -0
  55. package/dist/collection/components/store/translationStore/strings.japanese.js +39 -0
  56. package/dist/collection/components/store/translationStore/strings.korean.js +39 -0
  57. package/dist/collection/components/store/translationStore/strings.norwegian.js +39 -0
  58. package/dist/collection/components/store/translationStore/strings.polish.js +39 -0
  59. package/dist/collection/components/store/translationStore/strings.portuguese.js +39 -0
  60. package/dist/collection/components/store/translationStore/strings.russian.js +39 -0
  61. package/dist/collection/components/store/translationStore/strings.spanish.js +39 -0
  62. package/dist/collection/components/store/translationStore/strings.swedish.js +39 -0
  63. package/dist/collection/components/store/translationStore/strings.turkish.js +39 -0
  64. package/dist/collection/components/store/translationStore/strings.vietnamese.js +39 -0
  65. package/dist/collection/types/generated/graphql.internal.types.js +589 -0
  66. package/dist/esm/{cart-efb30253.js → cart-394c9ddb.js} +309 -21
  67. package/dist/esm/{hasInclusivePrice-565ddbe5.js → hasInclusivePrice-f0322e1c.js} +1 -1
  68. package/dist/esm/index.js +7 -7
  69. package/dist/esm/{invoice-0e462fcc.js → invoice-5ae81ae5.js} +2 -2
  70. package/dist/esm/{isCollectMobileTablet-0bcba25a.js → isCollectMobileTablet-15b668d6.js} +2 -2
  71. package/dist/esm/loader.js +1 -1
  72. package/dist/esm/{localization-c1aff677.js → localization-0ebc8356.js} +780 -0
  73. package/dist/esm/{paypal-06b67be0.js → paypal-b6fa3ec3.js} +29 -2
  74. package/dist/esm/{placeTestOrder-6c9a6c8a.js → placeTestOrder-5756cbc3.js} +2 -2
  75. package/dist/esm/{renderCheckoutCurrency-910fea67.js → renderCheckoutCurrency-5f3e06ea.js} +2 -2
  76. package/dist/esm/{zonos-address-display_9.entry.js → zonos-address-display_8.entry.js} +4 -79
  77. package/dist/esm/zonos-address_4.entry.js +2 -2
  78. package/dist/esm/zonos-card_5.entry.js +3 -3
  79. package/dist/esm/zonos-cart-items_12.entry.js +74 -20
  80. package/dist/esm/zonos-checkbox_2.entry.js +108 -0
  81. package/dist/esm/zonos-checkout.entry.js +79 -4
  82. package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
  83. package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
  84. package/dist/esm/zonos-collect.entry.js +4 -4
  85. package/dist/esm/zonos-controller.entry.js +2 -2
  86. package/dist/esm/zonos-country-flag.entry.js +1 -1
  87. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  88. package/dist/esm/zonos-elements.js +1 -1
  89. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  90. package/dist/esm/zonos-hello.entry.js +1 -1
  91. package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
  92. package/dist/esm/zonos-invoice-finish_5.entry.js +6 -6
  93. package/dist/esm/zonos-invoice.entry.js +4 -4
  94. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  95. package/dist/esm/zonos-store-credit.entry.js +109 -0
  96. package/dist/esm-es5/cart-394c9ddb.js +1 -0
  97. package/dist/esm-es5/{hasInclusivePrice-565ddbe5.js → hasInclusivePrice-f0322e1c.js} +1 -1
  98. package/dist/esm-es5/index.js +1 -1
  99. package/dist/esm-es5/{invoice-0e462fcc.js → invoice-5ae81ae5.js} +1 -1
  100. package/dist/esm-es5/{isCollectMobileTablet-0bcba25a.js → isCollectMobileTablet-15b668d6.js} +1 -1
  101. package/dist/esm-es5/loader.js +1 -1
  102. package/dist/esm-es5/localization-0ebc8356.js +1 -0
  103. package/dist/esm-es5/{paypal-06b67be0.js → paypal-b6fa3ec3.js} +2 -2
  104. package/dist/esm-es5/{placeTestOrder-6c9a6c8a.js → placeTestOrder-5756cbc3.js} +1 -1
  105. package/dist/esm-es5/{renderCheckoutCurrency-910fea67.js → renderCheckoutCurrency-5f3e06ea.js} +1 -1
  106. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -0
  107. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  108. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  109. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  110. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -0
  111. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  112. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  113. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  114. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  115. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  116. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  117. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  118. package/dist/esm-es5/zonos-elements.js +1 -1
  119. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  120. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  121. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  122. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  123. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  124. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  125. package/dist/esm-es5/zonos-store-credit.entry.js +1 -0
  126. package/dist/scripts/index.d.ts +68 -1
  127. package/dist/scripts/index.js +1 -1
  128. package/dist/scripts/loadZonos.js +1 -1
  129. package/dist/scripts/zonos.js +1 -1
  130. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +1 -0
  131. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-store-credit/zonos-store-credit.d.ts +17 -0
  132. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +5 -0
  133. package/dist/types/components/store/checkout/cart.d.ts +8 -1
  134. package/dist/types/components/store/checkout/storeCredit.d.ts +111 -0
  135. package/dist/types/components/store/checkout/stripe.d.ts +1 -1
  136. package/dist/types/components/store/translationStore/strings.arabic.d.ts +39 -0
  137. package/dist/types/components/store/translationStore/strings.base.d.ts +39 -0
  138. package/dist/types/components/store/translationStore/strings.chinese.d.ts +39 -0
  139. package/dist/types/components/store/translationStore/strings.danish.d.ts +39 -0
  140. package/dist/types/components/store/translationStore/strings.dutch.d.ts +39 -0
  141. package/dist/types/components/store/translationStore/strings.french.d.ts +39 -0
  142. package/dist/types/components/store/translationStore/strings.german.d.ts +39 -0
  143. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +39 -0
  144. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +39 -0
  145. package/dist/types/components/store/translationStore/strings.italian.d.ts +39 -0
  146. package/dist/types/components/store/translationStore/strings.japanese.d.ts +39 -0
  147. package/dist/types/components/store/translationStore/strings.korean.d.ts +39 -0
  148. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +39 -0
  149. package/dist/types/components/store/translationStore/strings.polish.d.ts +39 -0
  150. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +39 -0
  151. package/dist/types/components/store/translationStore/strings.russian.d.ts +39 -0
  152. package/dist/types/components/store/translationStore/strings.spanish.d.ts +39 -0
  153. package/dist/types/components/store/translationStore/strings.swedish.d.ts +39 -0
  154. package/dist/types/components/store/translationStore/strings.turkish.d.ts +39 -0
  155. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +39 -0
  156. package/dist/types/components.d.ts +21 -0
  157. package/dist/types/types/checkout/api/CheckoutSession.d.ts +9 -1
  158. package/dist/types/types/generated/graphql.internal.types.d.ts +713 -4
  159. package/dist/types/types/generated/graphql.internal.types.ts +956 -4
  160. package/dist/types/types/utils/ZonosSettings.d.ts +4 -0
  161. package/dist/zonos-elements/index.esm.js +1 -1
  162. package/dist/zonos-elements/{p-1f1bf95c.system.entry.js → p-07ca3347.system.entry.js} +1 -1
  163. package/dist/zonos-elements/p-09d7a5cb.system.js +18 -0
  164. package/dist/zonos-elements/p-0af96b5b.system.entry.js +1 -0
  165. package/dist/zonos-elements/{p-9c64ca98.system.entry.js → p-0da3cc62.system.entry.js} +1 -1
  166. package/dist/zonos-elements/p-0dd5a4b8.system.js +1 -0
  167. package/dist/zonos-elements/{p-4d4b7faa.entry.js → p-1162b685.entry.js} +1 -1
  168. package/dist/zonos-elements/{p-4d081ce8.entry.js → p-11d6de1a.entry.js} +1 -1
  169. package/dist/zonos-elements/p-1282495f.system.js +1 -0
  170. package/dist/zonos-elements/p-13041752.js +1 -0
  171. package/dist/zonos-elements/{p-1b5f89d5.system.js → p-27fad55a.system.js} +1 -1
  172. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  173. package/dist/zonos-elements/p-29f7950c.js +17 -0
  174. package/dist/zonos-elements/p-2b118454.js +1 -0
  175. package/dist/zonos-elements/{p-26718a78.entry.js → p-2bdc2206.entry.js} +1 -1
  176. package/dist/zonos-elements/{p-b360ee5b.entry.js → p-2c2e5ee6.entry.js} +1 -1
  177. package/dist/zonos-elements/{p-bd004403.system.js → p-2c9c750e.system.js} +1 -1
  178. package/dist/zonos-elements/{p-c9e3bc98.system.js → p-321e7920.system.js} +1 -1
  179. package/dist/zonos-elements/p-3d757163.entry.js +1 -0
  180. package/dist/zonos-elements/{p-456c0e52.js → p-4f23732f.js} +1 -1
  181. package/dist/zonos-elements/{p-321d2963.js → p-57b27c60.js} +1 -1
  182. package/dist/zonos-elements/{p-6d37f669.entry.js → p-615b5d13.entry.js} +1 -1
  183. package/dist/zonos-elements/p-620ba943.js +1 -0
  184. package/dist/zonos-elements/p-785111e7.entry.js +1 -0
  185. package/dist/zonos-elements/p-7b294762.system.entry.js +1 -0
  186. package/dist/zonos-elements/p-7fde2d8a.entry.js +1 -0
  187. package/dist/zonos-elements/p-8abeab5a.entry.js +1 -0
  188. package/dist/zonos-elements/{p-4a395eea.system.entry.js → p-8dfa0bb8.system.entry.js} +1 -1
  189. package/dist/zonos-elements/{p-06e2bc14.entry.js → p-8efb79ab.entry.js} +1 -1
  190. package/dist/zonos-elements/p-8f1ab25c.system.entry.js +1 -0
  191. package/dist/zonos-elements/{p-358dfb9e.entry.js → p-920d9189.entry.js} +1 -1
  192. package/dist/zonos-elements/p-92d91395.system.entry.js +1 -0
  193. package/dist/zonos-elements/{p-b9a4430c.entry.js → p-95f7f2a0.entry.js} +1 -1
  194. package/dist/zonos-elements/{p-f31fbbf0.entry.js → p-97fb5ad5.entry.js} +1 -1
  195. package/dist/zonos-elements/{p-bc6b33fa.entry.js → p-9ff90151.entry.js} +1 -1
  196. package/dist/zonos-elements/{p-4c087a8e.system.entry.js → p-a0ac3ca2.system.entry.js} +1 -1
  197. package/dist/zonos-elements/{p-09110bb7.system.entry.js → p-a1e23675.system.entry.js} +1 -1
  198. package/dist/zonos-elements/{p-36bea5d5.system.entry.js → p-a5adc047.system.entry.js} +1 -1
  199. package/dist/zonos-elements/{p-101226f3.system.entry.js → p-a5fb864a.system.entry.js} +1 -1
  200. package/dist/zonos-elements/{p-54c95926.entry.js → p-a95ac160.entry.js} +1 -1
  201. package/dist/zonos-elements/p-ac353826.js +1 -0
  202. package/dist/zonos-elements/{p-b589f621.system.entry.js → p-b37a85f0.system.entry.js} +1 -1
  203. package/dist/zonos-elements/{p-302b7105.system.entry.js → p-b49b8da4.system.entry.js} +1 -1
  204. package/dist/zonos-elements/{p-8d1efd7b.entry.js → p-bdaf2a38.entry.js} +1 -1
  205. package/dist/zonos-elements/{p-3ad2a9a3.system.entry.js → p-c1ae7391.system.entry.js} +1 -1
  206. package/dist/zonos-elements/{p-a75b3efc.system.entry.js → p-c2121663.system.entry.js} +1 -1
  207. package/dist/zonos-elements/{p-c87d3d50.system.js → p-c52b917b.system.js} +1 -1
  208. package/dist/zonos-elements/{p-0a2abbab.system.entry.js → p-c6047442.system.entry.js} +1 -1
  209. package/dist/zonos-elements/p-ca19a10a.js +1 -0
  210. package/dist/zonos-elements/p-cf69bcc4.system.js +1 -0
  211. package/dist/zonos-elements/{p-3ece0f96.system.entry.js → p-d65cfa9b.system.entry.js} +1 -1
  212. package/dist/zonos-elements/{p-5eaa0de1.entry.js → p-d8610393.entry.js} +1 -1
  213. package/dist/zonos-elements/p-daaaa8f1.system.entry.js +1 -0
  214. package/dist/zonos-elements/{p-8a424412.entry.js → p-efa69c89.entry.js} +1 -1
  215. package/dist/zonos-elements/p-fbccfa3e.system.js +1 -0
  216. package/dist/zonos-elements/{p-079bc009.system.entry.js → p-fce715f1.system.entry.js} +1 -1
  217. package/dist/zonos-elements/p-fe6cc354.entry.js +1 -0
  218. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  219. package/package.json +1 -1
  220. package/dist/cjs/zonos-toggle.cjs.entry.js +0 -35
  221. package/dist/esm/zonos-toggle.entry.js +0 -31
  222. package/dist/esm-es5/cart-efb30253.js +0 -1
  223. package/dist/esm-es5/localization-c1aff677.js +0 -1
  224. package/dist/esm-es5/zonos-address-display_9.entry.js +0 -1
  225. package/dist/esm-es5/zonos-toggle.entry.js +0 -1
  226. package/dist/zonos-elements/p-096182f0.system.js +0 -1
  227. package/dist/zonos-elements/p-0aeba2c7.system.js +0 -1
  228. package/dist/zonos-elements/p-127e0395.js +0 -17
  229. package/dist/zonos-elements/p-197d9b23.system.entry.js +0 -1
  230. package/dist/zonos-elements/p-25dd58f8.system.entry.js +0 -1
  231. package/dist/zonos-elements/p-445072f8.js +0 -1
  232. package/dist/zonos-elements/p-507f00d2.js +0 -1
  233. package/dist/zonos-elements/p-5fd0cd66.system.js +0 -1
  234. package/dist/zonos-elements/p-661cd4ce.system.entry.js +0 -1
  235. package/dist/zonos-elements/p-777e0a81.entry.js +0 -1
  236. package/dist/zonos-elements/p-7e77b055.system.entry.js +0 -1
  237. package/dist/zonos-elements/p-80524eac.entry.js +0 -1
  238. package/dist/zonos-elements/p-8b206982.system.js +0 -1
  239. package/dist/zonos-elements/p-9eea270b.entry.js +0 -1
  240. package/dist/zonos-elements/p-c4e358f2.js +0 -1
  241. package/dist/zonos-elements/p-cda52300.js +0 -1
  242. package/dist/zonos-elements/p-d233ef0d.entry.js +0 -1
  243. package/dist/zonos-elements/p-f8f7d491.js +0 -1
  244. package/dist/zonos-elements/p-fc0aa91e.system.js +0 -18
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-f5a61112.js');
4
- const cart = require('./cart-eca56521.js');
5
- const localization = require('./localization-878ef681.js');
4
+ const cart = require('./cart-77640463.js');
5
+ const localization = require('./localization-be7afc1b.js');
6
6
  const handleFetch = require('./handleFetch-954f30e1.js');
7
7
  const isContrastColor = require('./isContrastColor-d1936a5c.js');
8
8
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
@@ -365,6 +365,33 @@ const paypalButtonOptions = ({ checkoutSessionId, onPaypalFail, onPaypalSessionD
365
365
  if (cart.cartStore.inventoryCheckErrorMessage) {
366
366
  return '';
367
367
  }
368
+ // Apply store credit if customer has selected an amount
369
+ const storeCreditAmount = cart.storeCreditStoreGetEffectiveAmount();
370
+ if (storeCreditAmount > 0) {
371
+ const storeCreditResult = await cart.storeCreditStoreApplyCredit();
372
+ if (!storeCreditResult.success) {
373
+ paypalStore.paypalErrorMessage =
374
+ storeCreditResult.error ||
375
+ localization.translate('Unable to apply store credit. Please try again.');
376
+ onPaypalFail === null || onPaypalFail === void 0 ? void 0 : onPaypalFail();
377
+ return '';
378
+ }
379
+ }
380
+ // If store credit covers the full order, create order directly
381
+ if (cart.storeCreditStoreCoversFullAmount()) {
382
+ const orderResult = await cart.storeCreditStoreCreateOrder();
383
+ if (!orderResult.success) {
384
+ paypalStore.paypalErrorMessage =
385
+ orderResult.error ||
386
+ localization.translate('Unable to place order with store credit. Please try again.');
387
+ onPaypalFail === null || onPaypalFail === void 0 ? void 0 : onPaypalFail();
388
+ return '';
389
+ }
390
+ onPaypalSessionDone === null || onPaypalSessionDone === void 0 ? void 0 : onPaypalSessionDone({ orderId: orderResult.orderId || '' });
391
+ cart.cartStoreNextStep();
392
+ cart.cartStoreClearCheckoutInterval();
393
+ return '';
394
+ }
368
395
  const paypalOrderId = await paypalStoreCreaterOrder({
369
396
  checkoutSessionId,
370
397
  });
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const cart = require('./cart-eca56521.js');
4
- const localization = require('./localization-878ef681.js');
3
+ const cart = require('./cart-77640463.js');
4
+ const localization = require('./localization-be7afc1b.js');
5
5
  const handleFetch = require('./handleFetch-954f30e1.js');
6
6
 
7
7
  const placeTestOrder = async () => {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const cart = require('./cart-eca56521.js');
4
- const localization = require('./localization-878ef681.js');
3
+ const cart = require('./cart-77640463.js');
4
+ const localization = require('./localization-be7afc1b.js');
5
5
 
6
6
  const getDisplayCurrency = () => {
7
7
  var _a, _b;
@@ -3,20 +3,20 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const localization = require('./localization-878ef681.js');
6
+ const localization = require('./localization-be7afc1b.js');
7
7
  const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
8
- const cart = require('./cart-eca56521.js');
8
+ const cart = require('./cart-77640463.js');
9
9
  const classes = require('./classes-b7918f56.js');
10
10
  const getBorderRadius = require('./getBorderRadius-27a74844.js');
11
11
  const zonosStore = require('./zonosStore-f5a61112.js');
12
12
  const RemoveIcon$2 = require('./RemoveIcon-081ac073.js');
13
- const isDarkColor = require('./isDarkColor-a68abf7a.js');
14
13
  const throttle = require('./throttle-ff483793.js');
15
14
  const handleFetch = require('./handleFetch-954f30e1.js');
16
15
  const shouldRenderTaxIdInput = require('./shouldRenderTaxIdInput-b8abf6de.js');
17
16
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
18
17
  const TaxId = require('./TaxId-12acedde.js');
19
18
  const helpers = require('./helpers-5bdbb68c.js');
19
+ const isDarkColor = require('./isDarkColor-a68abf7a.js');
20
20
  require('./debounce-0c75ba33.js');
21
21
  require('./ShortAddressCode-bec338b0.js');
22
22
 
@@ -379,81 +379,6 @@ const ZonosAddressUpdateDialog = class {
379
379
  };
380
380
  ZonosAddressUpdateDialog.style = ZonosAddressUpdateDialogStyle0;
381
381
 
382
- const colorPrefixes = [
383
- 'blue',
384
- 'cyan',
385
- 'green',
386
- 'orange',
387
- 'purple',
388
- 'red',
389
- 'gray',
390
- 'glass',
391
- ];
392
-
393
- const zonosCheckboxCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}: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(--zonos--size);width:var(--zonos--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--zonos--border-radius, var(--zonos-elements-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(--zonos--background-color);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";
394
- const ZonosCheckboxStyle0 = zonosCheckboxCss;
395
-
396
- let inputId$1 = 0;
397
- const ZonosCheckbox = class {
398
- constructor(hostRef) {
399
- index.registerInstance(this, hostRef);
400
- this.checkboxSelected = index.createEvent(this, "checkboxSelected", 7);
401
- this.inputId = `zonos--checkbox-${++inputId$1}`;
402
- /**
403
- * background color of the checkbox
404
- */
405
- this.backgroundColor = 'blue';
406
- /**
407
- * Whether or not the checkbox is checked
408
- */
409
- this.isChecked = false;
410
- /**
411
- * Whether or not the checkbox is disabled
412
- */
413
- this.isDisabled = false;
414
- /**
415
- * Size of the checkbox
416
- */
417
- this.size = 12;
418
- /**
419
- * Font size of the checkbox text
420
- */
421
- this.fontSize = 'base';
422
- }
423
- onClick() {
424
- if (this.isDisabled) {
425
- return;
426
- }
427
- this.checkboxSelected.emit(!this.isChecked);
428
- }
429
- render() {
430
- const isBackgroundVariable = colorPrefixes.includes(this.backgroundColor);
431
- const backgroundColor = isBackgroundVariable
432
- ? `var(--zonos-elements-${this.backgroundColor}-600)`
433
- : this.backgroundColor;
434
- const checkmarkColor = isBackgroundVariable
435
- ? // use lighter color if the color is amino variable
436
- `var(--zonos-elements-${this.backgroundColor}-200)`
437
- : // if it's not an amino variable, use white if the background is dark, and dark if the background is light
438
- !isDarkColor.isDarkColor(backgroundColor)
439
- ? 'var(--zonos-elements-gray-800)'
440
- : 'var(--zonos-elements-gray-0)';
441
- const borderStyle = getBorderRadius.getBorderRadius({
442
- customRoundRadius: '4px',
443
- overrideBorderStyle: this.borderStyle,
444
- });
445
- return (index.h(index.Host, { key: 'c2a9023becafd6d19ad769d449383924c85c641f', class: classes.classes(['zonos--elements zonos--checkbox']), style: {
446
- '--zonos--background-color': backgroundColor,
447
- '--zonos--border-radius': borderStyle,
448
- '--zonos--font-family': zonosStore.zonosStoreFontFamily(),
449
- '--zonos--size': `${this.size}px`,
450
- } }, index.h("label", { key: '352e8bda93f1ac9a7a55ba7038e922626c3a9594', class: classes.classes([this.isDisabled && 'disabled']), htmlFor: this.inputId }, index.h("input", { key: '71d664f9d83345ad4c143f71209bdb0a2cb16745', checked: this.isChecked, disabled: this.isDisabled, hidden: true, id: this.inputId, onChange: e => {
451
- this.checkboxSelected.emit(e.target.checked);
452
- }, type: "checkbox" }), index.h("span", { key: 'c772c4e8dbbbef8035874616a0254fb4114a97c8', class: "checkmark-container" }, index.h("svg", { key: 'd497191975edeca268cc014431535f4befdd7b2c', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '15b26fdf72a058e81d4472d0c757a725c04e3f47', "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: '2d6015d16eda08dc39eff677f4858d2aed620891', size: this.fontSize }, this.label)))));
453
- }
454
- };
455
- ZonosCheckbox.style = ZonosCheckboxStyle0;
456
-
457
382
  const isValidZip = ({ countryFields, zip, }) => {
458
383
  if (!countryFields) {
459
384
  return true;
@@ -7422,7 +7347,6 @@ exports.zonos_address_display = ZonosAddressDisplay;
7422
7347
  exports.zonos_address_form = ZonosAddressForm;
7423
7348
  exports.zonos_address_suggestions = ZonosAddressSuggestions;
7424
7349
  exports.zonos_address_update_dialog = ZonosAddressUpdateDialog;
7425
- exports.zonos_checkbox = ZonosCheckbox;
7426
7350
  exports.zonos_custom_address = ZonosAddress;
7427
7351
  exports.zonos_dialog = ZonosDialog;
7428
7352
  exports.zonos_stripe_phone_input = ZonosStripePhoneInput;
@@ -4,8 +4,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
6
  const throttle = require('./throttle-ff483793.js');
7
- const cart = require('./cart-eca56521.js');
8
- const localization = require('./localization-878ef681.js');
7
+ const cart = require('./cart-77640463.js');
8
+ const localization = require('./localization-be7afc1b.js');
9
9
  const zonosStore = require('./zonosStore-f5a61112.js');
10
10
  const handleFetch = require('./handleFetch-954f30e1.js');
11
11
  const shouldRenderTaxIdInput = require('./shouldRenderTaxIdInput-b8abf6de.js');
@@ -6,10 +6,10 @@ const index = require('./index-b1f95d96.js');
6
6
  const zonosStore = require('./zonosStore-f5a61112.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
8
  const getBorderRadius = require('./getBorderRadius-27a74844.js');
9
- const cart = require('./cart-eca56521.js');
10
- const localization = require('./localization-878ef681.js');
9
+ const cart = require('./cart-77640463.js');
10
+ const localization = require('./localization-be7afc1b.js');
11
11
  const handleFetch = require('./handleFetch-954f30e1.js');
12
- const paypal = require('./paypal-6acca678.js');
12
+ const paypal = require('./paypal-c61ef042.js');
13
13
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
14
14
  require('./isDarkColor-a68abf7a.js');
15
15
  require('./isContrastColor-d1936a5c.js');
@@ -3,21 +3,21 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-b1f95d96.js');
6
- const cart = require('./cart-eca56521.js');
7
- const localization = require('./localization-878ef681.js');
8
- const renderCheckoutCurrency = require('./renderCheckoutCurrency-d9590e81.js');
6
+ const cart = require('./cart-77640463.js');
7
+ const localization = require('./localization-be7afc1b.js');
8
+ const renderCheckoutCurrency = require('./renderCheckoutCurrency-1ac02803.js');
9
9
  const cleanHtmlMarkdown = require('./cleanHtmlMarkdown-31da84b7.js');
10
10
  const classes = require('./classes-b7918f56.js');
11
11
  const zonosStore = require('./zonosStore-f5a61112.js');
12
- const hasInclusivePrice = require('./hasInclusivePrice-e7d67b45.js');
13
- const paypal = require('./paypal-6acca678.js');
12
+ const hasInclusivePrice = require('./hasInclusivePrice-e93c64fd.js');
13
+ const paypal = require('./paypal-c61ef042.js');
14
14
  const handleFetch = require('./handleFetch-954f30e1.js');
15
15
  const createCustomEvent = require('./createCustomEvent-7b6fad95.js');
16
16
  const getBorderRadius = require('./getBorderRadius-27a74844.js');
17
17
  const VarianceTest = require('./VarianceTest-bec00ea8.js');
18
18
  const submitGtag = require('./submitGtag-cb4fb332.js');
19
19
  const ILanguage = require('./ILanguage-98b04442.js');
20
- const placeTestOrder = require('./placeTestOrder-f1c1e939.js');
20
+ const placeTestOrder = require('./placeTestOrder-0f7477c8.js');
21
21
  const isDarkColor = require('./isDarkColor-a68abf7a.js');
22
22
  const getContrastColor = require('./getContrastColor-cc087c53.js');
23
23
  const isColorVariable = require('./isColorVariable-525dbfa7.js');
@@ -300,6 +300,9 @@ const ZonosCartSubtotal = class {
300
300
  } }), index.h("zonos-button", { loading: this.loading, onClick: () => applyPromoCode(), variant: "primary" }, localization.translate('Apply'))))))), !!cart.cartStore.adjustmentTotal && (index.h("tr", { class: "zonos--row zonos--cart-discount" }, index.h("td", { class: "zonos--column" }), index.h("td", { class: "zonos--column zonos--cart-subtotal-title" }, index.h("div", { class: "zonos--title-with-icon" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, localization.translate('Discounts')))), index.h("td", { class: "zonos--column zonos--cart-subtotal-price" }, index.h("zonos-text", { type: "semiBoldLabel" }, renderCheckoutCurrency.renderCheckoutCurrency({
301
301
  amount: cart.cartStore.adjustmentTotal,
302
302
  isForeign: true,
303
+ }))))), !!cart.cartStore.storeCredit && (index.h("tr", { class: "zonos--row zonos--cart-store-credit" }, index.h("td", { class: "zonos--column" }), index.h("td", { class: "zonos--column zonos--cart-subtotal-title" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, localization.translate('Store credit'))), index.h("td", { class: "zonos--column zonos--cart-subtotal-price" }, index.h("zonos-text", { textColor: "green-600", type: "semiBoldLabel" }, "-", renderCheckoutCurrency.renderCheckoutCurrency({
304
+ amount: cart.cartStore.storeCredit,
305
+ isForeign: true,
303
306
  }))))), index.h("tr", { class: "zonos--row zonos--cart-pay-total" }, index.h("td", { class: "zonos--column" }), index.h("td", { class: "zonos--column" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldLabel" }, localization.translate('Order total'))), index.h("td", { class: "zonos--column zonos--cart-total-price" }, index.h("zonos-text", { type: "semiBoldLabel" }, renderCheckoutCurrency.renderCheckoutCurrency({
304
307
  amount: total,
305
308
  isForeign: true,
@@ -730,6 +733,47 @@ const ZonosCheckoutFinish = class {
730
733
  paypal.paypalStoreReset();
731
734
  localization.storageStore.checkoutSessionId = null;
732
735
  };
736
+ this.checkStoreCreditOrderStatus = async () => {
737
+ // show success message right away when order id is already created
738
+ this.isLoading = false;
739
+ if (cart.storeCreditStore.orderIdCreated) {
740
+ const checkoutSessionId = localization.storageStore.checkoutSessionId;
741
+ submitGtag.submitGtag({
742
+ event: 'zonos-checkout-success',
743
+ metadata: this.buildPurchaseMetadata({
744
+ checkoutSessionId: checkoutSessionId || '',
745
+ }),
746
+ });
747
+ submitGtag.submitGtag({
748
+ event: 'purchase',
749
+ metadata: this.buildPurchaseMetadata({
750
+ checkoutSessionId: checkoutSessionId || '',
751
+ }),
752
+ });
753
+ void cart.trackConversionEvent({
754
+ checkoutSessionId,
755
+ eventName: 'checkout_orderCompleted',
756
+ });
757
+ this.notificationType = 'success';
758
+ this.notificationTitle = localization.translate("You're all set!");
759
+ this.notificationMessages =
760
+ cart.stripeStoreMessageBasedOnStatus('succeeded').messages;
761
+ // override title if notification type is success
762
+ this.useOverrideSuccessNotification();
763
+ const successEvent = createCustomEvent.createCustomEvent('zonos-checkout-success', {
764
+ message: 'Zonos Checkout successfully processed order',
765
+ });
766
+ document.dispatchEvent(successEvent);
767
+ // wait this to finish before resetting store and checkout session id
768
+ await this.handleSuccessBehavior();
769
+ }
770
+ // reset stores when checkout is finished
771
+ cart.stripeStoreResetPromoCode();
772
+ cart.stripeStoreReset();
773
+ paypal.paypalStoreReset();
774
+ cart.storeCreditStoreReset();
775
+ localization.storageStore.checkoutSessionId = null;
776
+ };
733
777
  this.closeClickHandler = () => {
734
778
  this.closeClick.emit();
735
779
  };
@@ -762,6 +806,9 @@ const ZonosCheckoutFinish = class {
762
806
  if (cart.cartStore.isStagingMode) {
763
807
  void this.checkStagingOrderStatus();
764
808
  }
809
+ else if (cart.storeCreditStore.orderIdCreated) {
810
+ void this.checkStoreCreditOrderStatus();
811
+ }
765
812
  else if (paypal.paypalStore.orderIdCreated) {
766
813
  void this.checkPaypalPaymentStatus();
767
814
  }
@@ -771,11 +818,11 @@ const ZonosCheckoutFinish = class {
771
818
  }
772
819
  render() {
773
820
  const isTestMode = handleFetch.getIsTestMode();
774
- return (index.h(index.Host, { key: '80a543fca5dbc63dde41806702b2f6dd4fa849ab', class: "zonos--checkout-finish zonos--elements", style: {
821
+ return (index.h(index.Host, { key: 'c74f250bac797f8c000bac4892bc5ab56c0867bb', class: "zonos--checkout-finish zonos--elements", style: {
775
822
  '--zonos--border-radius': getBorderRadius.getBorderRadius({
776
823
  overrideBorderStyle: this.borderRadius,
777
824
  }),
778
- } }, !this.isLoading && (index.h("div", { key: '6cab293041902e156563f37db6f0e77caaeeaaf9', class: "zonos--finish-details" }, index.h("div", { key: '6bf32844fa9d38eae6e9f337e56b7918e49bf793', class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (index.h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), index.h("zonos-text", { key: 'bf13e59b7bc2380609ffba879fa2b1d8c5d9a9e0', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), index.h("zonos-text", { key: 'c246affb94a9799e0c556affb73b2ebfb69a9c7f', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (index.h("zonos-button", { key: '61fa4fa0e09c0ce2905281b2696f42172c7a2bcd',
825
+ } }, !this.isLoading && (index.h("div", { key: '5ee705381b0246f5035f512c9d19beba6dc33d4f', class: "zonos--finish-details" }, index.h("div", { key: '1d1a54d8f73535aaada32601c5e771c9fd381104', class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (index.h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), index.h("zonos-text", { key: '68c898ee87166d08bd52702ae8f9bfe51c393076', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), index.h("zonos-text", { key: '98b6eaff782fe34a8dbd258e4c7d0c81c3577bcc', class: "zonos--subtitle", textColor: "gray-600" }, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), this.shouldRenderCloseButtonForRedirectBehavior() && (index.h("zonos-button", { key: 'ccc5e7973b2e962e22ac56dcad6e33b048621036',
779
826
  // Only show loading spinner if it's not an error notification
780
827
  loading: this.isWaitingToRedirect &&
781
828
  this.notificationType !== 'error', onClick: () => {
@@ -787,9 +834,9 @@ const ZonosCheckoutFinish = class {
787
834
  }
788
835
  this.closeClickHandler();
789
836
  }, size: "md", variant: "primary" }, localization.translate('Close'))), !window.Zonos.isLegacyCheckout &&
790
- this.shouldRenderKeepShoppingButton() && (index.h("zonos-button", { key: '9227d7832ed477be556cb6d59c644a74c293c740', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode &&
837
+ this.shouldRenderKeepShoppingButton() && (index.h("zonos-button", { key: 'cd30bc010f2a3e935d9b80e56389581a9150b021', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText))), isTestMode &&
791
838
  cart.cartStore.step === 'finish' &&
792
- this.notificationType === 'success' && (index.h("div", { key: '9107be1ef7895b0a5e3fe0a985036a11de7011d3', class: "zonos--finish-button-wrapper" }, index.h("zonos-button", { key: 'b0de8743bea8dd9ac7099bd5b77811f80d80a380', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), index.h("zonos-button", { key: 'f90749b9af4c17eac554efb6d3d12cc41ac6e3c8', onClick: () => {
839
+ this.notificationType === 'success' && (index.h("div", { key: '458809f316ac5129efbc7fe90d1549c042d477af', class: "zonos--finish-button-wrapper" }, index.h("zonos-button", { key: 'dcf0c595cb119a731c34c1aff09960db8a1fb251', backgroundColor: "gray-0", buttonColor: "gray-1000", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), index.h("zonos-button", { key: '76d55870370b4906970b3e2109617ba2230eee7e', onClick: () => {
793
840
  const isZonosDashboard = window.location.hostname.includes('dashboard.zonos.com');
794
841
  this.redirectToUrl(isZonosDashboard
795
842
  ? '/orders/all'
@@ -908,7 +955,8 @@ const ZonosCheckoutPayment = class {
908
955
  */
909
956
  this.continueClickHandler = async ({ currencyCode, }) => {
910
957
  var _a, _b;
911
- if (!this.handleValidate()) {
958
+ // Skip Stripe payment validation when store credit covers the full order
959
+ if (!cart.storeCreditStoreCoversFullAmount() && !this.handleValidate()) {
912
960
  this.showErrorBanner = true;
913
961
  // Attempt to submit the form so the missing input error will be shown in Stripe
914
962
  void ((_a = cart.stripeStore.stripeElements) === null || _a === void 0 ? void 0 : _a.submit());
@@ -999,6 +1047,7 @@ const ZonosCheckoutPayment = class {
999
1047
  const isTestMode = handleFetch.getIsTestMode();
1000
1048
  const isStagingMode = cart.cartStore.isStagingMode || handleFetch.getIsStagingMode();
1001
1049
  const isPaypalTabSelected = ((_a = cart.stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
1050
+ const storeCreditCoversFullOrder = cart.storeCreditStoreCoversFullAmount();
1002
1051
  const renderPayment = () => {
1003
1052
  if (isStagingMode) {
1004
1053
  const { colorPrimary } = zonosStore.zonosStore.appearance;
@@ -1014,7 +1063,9 @@ const ZonosCheckoutPayment = class {
1014
1063
  variant: this.submitBtnType }, localization.translate('Place test order')))));
1015
1064
  }
1016
1065
  return (index.h(index.Fragment, null, this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, localization.translate('Missing required fields. Make sure all fields are completed.'))), this.hasStripePaymentError && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, cart.stripeStore.customErrorMessage ||
1017
- localization.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), index.h("zonos-payment", null), index.h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (index.h(index.Fragment, null, index.h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
1066
+ localization.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), cart.cartStore.customerAuthenticationToken &&
1067
+ cart.storeCreditStore.availableBalance != null &&
1068
+ cart.storeCreditStore.availableBalance > 0 && (index.h("zonos-store-credit", null)), storeCreditCoversFullOrder ? (index.h("zonos-banner", { intent: "info" }, localization.translate('Store credit covers your full order'))) : (index.h("zonos-payment", null)), index.h("div", { class: "zonos--group-btn" }, (!isPaypalTabSelected || storeCreditCoversFullOrder) && (index.h(index.Fragment, null, index.h("zonos-button", { backgroundColor: this.submitBtnColor, bold: true, isDisabled: this.continueLoading &&
1018
1069
  cart.stripeStore.checkoutSettlementCurrency === 'USD', loading: this.continueLoading &&
1019
1070
  cart.stripeStore.checkoutSettlementCurrency !== 'USD', onClick: async () => {
1020
1071
  if (!cart.cartStore.checkoutSession) {
@@ -1027,22 +1078,25 @@ const ZonosCheckoutPayment = class {
1027
1078
  });
1028
1079
  }, size: "lg",
1029
1080
  // use primary type when on mobile mode
1030
- variant: this.submitBtnType }, localization.translate('Pay [orderTotal]', {
1031
- orderTotal: renderCheckoutCurrency.renderCheckoutCurrency({
1032
- amount: cart.cartStore.total,
1033
- isForeign: true,
1034
- }),
1035
- })), cart.stripeStore.shouldRenderPayInUsdButton && (index.h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
1081
+ variant: this.submitBtnType }, storeCreditCoversFullOrder
1082
+ ? localization.translate('Place order')
1083
+ : localization.translate('Pay [orderTotal]', {
1084
+ orderTotal: renderCheckoutCurrency.renderCheckoutCurrency({
1085
+ amount: cart.cartStore.total,
1086
+ isForeign: true,
1087
+ }),
1088
+ })), !storeCreditCoversFullOrder &&
1089
+ cart.stripeStore.shouldRenderPayInUsdButton && (index.h("zonos-button", { class: "zonos--pay-in-base-currency-btn", isDisabled: this.continueLoading &&
1036
1090
  cart.stripeStore.checkoutSettlementCurrency !== 'USD', loading: this.continueLoading &&
1037
1091
  cart.stripeStore.checkoutSettlementCurrency === 'USD', onClick: async () => {
1038
1092
  await this.continueClickHandler({
1039
1093
  currencyCode: 'USD',
1040
1094
  });
1041
- }, size: "lg", variant: "subtle" }, localization.translate('Click to pay in USD'))))), index.h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
1095
+ }, size: "lg", variant: "subtle" }, localization.translate('Click to pay in USD'))))), !storeCreditCoversFullOrder && (index.h("zonos-paypal-payment", { onPaypalSessionDone: ({ detail: { orderId } }) => {
1042
1096
  this.paypalSessionDone.emit(orderId);
1043
1097
  }, onPaypalSessionFail: () => this.paypalSessionFailed.emit(), style: {
1044
1098
  display: isPaypalTabSelected ? 'block' : 'none',
1045
- } })), isTestMode && (index.h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, index.h("zonos-v-stack", { spacing: 16 }, index.h("div", null, index.h("zonos-text", { type: "semiBoldLabel" }, localization.translate('Test cards')), index.h("zonos-text", { textColor: "gray-700" }, localization.translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), index.h("zonos-button", { icon: index.h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, localization.translate('Success'), " (****4242)"), index.h("zonos-button", { icon: index.h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, localization.translate('Failure'), " (****0002)")), index.h("zonos-notification", null)))));
1099
+ } }))), isTestMode && (index.h("zonos-card", { backgroundColor: "gray-100", borderRadius: 12, class: "zonos--test-cards" }, index.h("zonos-v-stack", { spacing: 16 }, index.h("div", null, index.h("zonos-text", { type: "semiBoldLabel" }, localization.translate('Test cards')), index.h("zonos-text", { textColor: "gray-700" }, localization.translate('Click to copy the card number. Use any future expiration date and three number CVC.'))), index.h("zonos-button", { icon: index.h("zonos-icon", { content: CheckmarkLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4242424242424242') }, localization.translate('Success'), " (****4242)"), index.h("zonos-button", { icon: index.h("zonos-icon", { content: RemoveLineIcon }), justifyContent: "flex-start", onClick: () => this.copyCardToClipboard('4000000000000002') }, localization.translate('Failure'), " (****0002)")), index.h("zonos-notification", null)))));
1046
1100
  };
1047
1101
  return (index.h(index.Host, { class: "zonos--checkout-payment zonos--elements" }, index.h("div", { class: "zonos--group" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, localization.translate('Payment method')), renderPayment())));
1048
1102
  }
@@ -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 zonosStore = require('./zonosStore-f5a61112.js');
7
+ const classes = require('./classes-b7918f56.js');
8
+ const getBorderRadius = require('./getBorderRadius-27a74844.js');
9
+ const isDarkColor = require('./isDarkColor-a68abf7a.js');
10
+ require('./VarianceTest-bec00ea8.js');
11
+
12
+ const colorPrefixes = [
13
+ 'blue',
14
+ 'cyan',
15
+ 'green',
16
+ 'orange',
17
+ 'purple',
18
+ 'red',
19
+ 'gray',
20
+ 'glass',
21
+ ];
22
+
23
+ const zonosCheckboxCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}: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(--zonos--size);width:var(--zonos--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--zonos--border-radius, var(--zonos-elements-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(--zonos--background-color);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";
24
+ const ZonosCheckboxStyle0 = zonosCheckboxCss;
25
+
26
+ let inputId = 0;
27
+ const ZonosCheckbox = class {
28
+ constructor(hostRef) {
29
+ index.registerInstance(this, hostRef);
30
+ this.checkboxSelected = index.createEvent(this, "checkboxSelected", 7);
31
+ this.inputId = `zonos--checkbox-${++inputId}`;
32
+ /**
33
+ * background color of the checkbox
34
+ */
35
+ this.backgroundColor = 'blue';
36
+ /**
37
+ * Whether or not the checkbox is checked
38
+ */
39
+ this.isChecked = false;
40
+ /**
41
+ * Whether or not the checkbox is disabled
42
+ */
43
+ this.isDisabled = false;
44
+ /**
45
+ * Size of the checkbox
46
+ */
47
+ this.size = 12;
48
+ /**
49
+ * Font size of the checkbox text
50
+ */
51
+ this.fontSize = 'base';
52
+ }
53
+ onClick() {
54
+ if (this.isDisabled) {
55
+ return;
56
+ }
57
+ this.checkboxSelected.emit(!this.isChecked);
58
+ }
59
+ render() {
60
+ const isBackgroundVariable = colorPrefixes.includes(this.backgroundColor);
61
+ const backgroundColor = isBackgroundVariable
62
+ ? `var(--zonos-elements-${this.backgroundColor}-600)`
63
+ : this.backgroundColor;
64
+ const checkmarkColor = isBackgroundVariable
65
+ ? // use lighter color if the color is amino variable
66
+ `var(--zonos-elements-${this.backgroundColor}-200)`
67
+ : // if it's not an amino variable, use white if the background is dark, and dark if the background is light
68
+ !isDarkColor.isDarkColor(backgroundColor)
69
+ ? 'var(--zonos-elements-gray-800)'
70
+ : 'var(--zonos-elements-gray-0)';
71
+ const borderStyle = getBorderRadius.getBorderRadius({
72
+ customRoundRadius: '4px',
73
+ overrideBorderStyle: this.borderStyle,
74
+ });
75
+ return (index.h(index.Host, { key: 'c2a9023becafd6d19ad769d449383924c85c641f', class: classes.classes(['zonos--elements zonos--checkbox']), style: {
76
+ '--zonos--background-color': backgroundColor,
77
+ '--zonos--border-radius': borderStyle,
78
+ '--zonos--font-family': zonosStore.zonosStoreFontFamily(),
79
+ '--zonos--size': `${this.size}px`,
80
+ } }, index.h("label", { key: '352e8bda93f1ac9a7a55ba7038e922626c3a9594', class: classes.classes([this.isDisabled && 'disabled']), htmlFor: this.inputId }, index.h("input", { key: '71d664f9d83345ad4c143f71209bdb0a2cb16745', checked: this.isChecked, disabled: this.isDisabled, hidden: true, id: this.inputId, onChange: e => {
81
+ this.checkboxSelected.emit(e.target.checked);
82
+ }, type: "checkbox" }), index.h("span", { key: 'c772c4e8dbbbef8035874616a0254fb4114a97c8', class: "checkmark-container" }, index.h("svg", { key: 'd497191975edeca268cc014431535f4befdd7b2c', class: "checkmark", color: checkmarkColor, fill: "none", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { key: '15b26fdf72a058e81d4472d0c757a725c04e3f47', "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: '2d6015d16eda08dc39eff677f4858d2aed620891', size: this.fontSize }, this.label)))));
83
+ }
84
+ };
85
+ ZonosCheckbox.style = ZonosCheckboxStyle0;
86
+
87
+ const zonosToggleCss = ":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .wrapper{position:relative;border-radius:6px;background-color:var(--zonos-elements-gray-50);display:-ms-flexbox;display:flex}:host .zonos--toggle-selected-slider{z-index:1;position:absolute;background-color:var(--zonos-elements-raised-surface-color);height:100%;-webkit-box-shadow:var(--zonos-elements-shadow-button-standard);box-shadow:var(--zonos-elements-shadow-button-standard);border-radius:6px;-webkit-animation:translate 0.3s ease-in-out;animation:translate 0.3s ease-in-out}:host .zonos--option{background:transparent;border:0;z-index:2;cursor:pointer;padding:4px 12px;border-radius:6px;-webkit-transition:var(--zonos-elements-transition);transition:var(--zonos-elements-transition);font-size:var(--zonos-elements-font-size-base);font-weight:500;color:var(--zonos-elements-text-color-secondary)}:host .zonos--option:focus{outline:none}:host .zonos--option:hover:not(.selected){color:var(--zonos-elements-text-color)}:host .zonos--option.selected{color:var(--zonos-elements-text-color);background-color:var(--zonos-elements-raised-surface-color);height:100%;-webkit-box-shadow:var(--zonos-elements-shadow-button-standard);box-shadow:var(--zonos-elements-shadow-button-standard);border-radius:6px;-webkit-animation:translate 0.3s ease-in-out;animation:translate 0.3s ease-in-out}";
88
+ const ZonosToggleStyle0 = zonosToggleCss;
89
+
90
+ const ZonosToggle = class {
91
+ constructor(hostRef) {
92
+ index.registerInstance(this, hostRef);
93
+ this.toggleChanged = index.createEvent(this, "toggleChanged", 7);
94
+ /**
95
+ * Options for the toggle
96
+ */
97
+ this.options = [];
98
+ }
99
+ render() {
100
+ return (index.h(index.Host, { key: 'e6be1b38ea1fd978a231a1c3dc85a92c1d86a24b', class: classes.classes(['zonos--elements zonos--toggle']), style: {
101
+ '--zonos--font-family': zonosStore.zonosStoreFontFamily(),
102
+ } }, index.h("div", { key: 'e9ccac29c3f653e3e9d81d336089d6aaea6bbf6c', class: "wrapper" }, this.options.map(option => {
103
+ const selected = option.value === this.value;
104
+ return (index.h("button", { class: classes.classes(['zonos--option', selected && 'selected']), key: option.value, onClick: () => {
105
+ this.toggleChanged.emit(option.value);
106
+ } }, option.label));
107
+ }))));
108
+ }
109
+ };
110
+ ZonosToggle.style = ZonosToggleStyle0;
111
+
112
+ exports.zonos_checkbox = ZonosCheckbox;
113
+ exports.zonos_toggle = ZonosToggle;