@zonos/elements 1.3.249 → 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 (242) hide show
  1. package/dist/cjs/{cart-eca56521.js → cart-fcd1359c.js} +318 -19
  2. package/dist/cjs/{hasInclusivePrice-e7d67b45.js → hasInclusivePrice-745a8f29.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{invoice-918f2c2b.js → invoice-f040e147.js} +2 -2
  5. package/dist/cjs/{isCollectMobileTablet-89911215.js → isCollectMobileTablet-cf92852e.js} +2 -2
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{localization-878ef681.js → localization-523b793a.js} +660 -0
  8. package/dist/cjs/{paypal-6acca678.js → paypal-8c98c0a1.js} +29 -2
  9. package/dist/cjs/{placeTestOrder-f1c1e939.js → placeTestOrder-9b1e09f0.js} +2 -2
  10. package/dist/cjs/{renderCheckoutCurrency-d9590e81.js → renderCheckoutCurrency-94b6e51d.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 +52 -3
  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 +52 -1
  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 +33 -0
  46. package/dist/collection/components/store/translationStore/strings.base.js +33 -0
  47. package/dist/collection/components/store/translationStore/strings.chinese.js +33 -0
  48. package/dist/collection/components/store/translationStore/strings.danish.js +33 -0
  49. package/dist/collection/components/store/translationStore/strings.dutch.js +33 -0
  50. package/dist/collection/components/store/translationStore/strings.french.js +33 -0
  51. package/dist/collection/components/store/translationStore/strings.german.js +33 -0
  52. package/dist/collection/components/store/translationStore/strings.hebrew.js +33 -0
  53. package/dist/collection/components/store/translationStore/strings.indonesian.js +33 -0
  54. package/dist/collection/components/store/translationStore/strings.italian.js +33 -0
  55. package/dist/collection/components/store/translationStore/strings.japanese.js +33 -0
  56. package/dist/collection/components/store/translationStore/strings.korean.js +33 -0
  57. package/dist/collection/components/store/translationStore/strings.norwegian.js +33 -0
  58. package/dist/collection/components/store/translationStore/strings.polish.js +33 -0
  59. package/dist/collection/components/store/translationStore/strings.portuguese.js +33 -0
  60. package/dist/collection/components/store/translationStore/strings.russian.js +33 -0
  61. package/dist/collection/components/store/translationStore/strings.spanish.js +33 -0
  62. package/dist/collection/components/store/translationStore/strings.swedish.js +33 -0
  63. package/dist/collection/components/store/translationStore/strings.turkish.js +33 -0
  64. package/dist/collection/components/store/translationStore/strings.vietnamese.js +33 -0
  65. package/dist/collection/types/generated/graphql.internal.types.js +589 -0
  66. package/dist/esm/{cart-efb30253.js → cart-6e465f7b.js} +309 -21
  67. package/dist/esm/{hasInclusivePrice-565ddbe5.js → hasInclusivePrice-c49d384d.js} +1 -1
  68. package/dist/esm/index.js +7 -7
  69. package/dist/esm/{invoice-0e462fcc.js → invoice-d416ba65.js} +2 -2
  70. package/dist/esm/{isCollectMobileTablet-0bcba25a.js → isCollectMobileTablet-48040572.js} +2 -2
  71. package/dist/esm/loader.js +1 -1
  72. package/dist/esm/{localization-c1aff677.js → localization-f4a7fb5a.js} +660 -0
  73. package/dist/esm/{paypal-06b67be0.js → paypal-6af6b978.js} +29 -2
  74. package/dist/esm/{placeTestOrder-6c9a6c8a.js → placeTestOrder-d19ac166.js} +2 -2
  75. package/dist/esm/{renderCheckoutCurrency-910fea67.js → renderCheckoutCurrency-c8aa8e7e.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 +52 -3
  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-6e465f7b.js +1 -0
  97. package/dist/esm-es5/hasInclusivePrice-c49d384d.js +1 -0
  98. package/dist/esm-es5/index.js +1 -1
  99. package/dist/esm-es5/{invoice-0e462fcc.js → invoice-d416ba65.js} +1 -1
  100. package/dist/esm-es5/{isCollectMobileTablet-0bcba25a.js → isCollectMobileTablet-48040572.js} +1 -1
  101. package/dist/esm-es5/loader.js +1 -1
  102. package/dist/esm-es5/localization-f4a7fb5a.js +1 -0
  103. package/dist/esm-es5/paypal-6af6b978.js +17 -0
  104. package/dist/esm-es5/{placeTestOrder-6c9a6c8a.js → placeTestOrder-d19ac166.js} +1 -1
  105. package/dist/esm-es5/{renderCheckoutCurrency-910fea67.js → renderCheckoutCurrency-c8aa8e7e.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 +58 -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/store/checkout/cart.d.ts +8 -1
  133. package/dist/types/components/store/checkout/storeCredit.d.ts +111 -0
  134. package/dist/types/components/store/checkout/stripe.d.ts +1 -1
  135. package/dist/types/components/store/translationStore/strings.arabic.d.ts +33 -0
  136. package/dist/types/components/store/translationStore/strings.base.d.ts +33 -0
  137. package/dist/types/components/store/translationStore/strings.chinese.d.ts +33 -0
  138. package/dist/types/components/store/translationStore/strings.danish.d.ts +33 -0
  139. package/dist/types/components/store/translationStore/strings.dutch.d.ts +33 -0
  140. package/dist/types/components/store/translationStore/strings.french.d.ts +33 -0
  141. package/dist/types/components/store/translationStore/strings.german.d.ts +33 -0
  142. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +33 -0
  143. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +33 -0
  144. package/dist/types/components/store/translationStore/strings.italian.d.ts +33 -0
  145. package/dist/types/components/store/translationStore/strings.japanese.d.ts +33 -0
  146. package/dist/types/components/store/translationStore/strings.korean.d.ts +33 -0
  147. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +33 -0
  148. package/dist/types/components/store/translationStore/strings.polish.d.ts +33 -0
  149. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +33 -0
  150. package/dist/types/components/store/translationStore/strings.russian.d.ts +33 -0
  151. package/dist/types/components/store/translationStore/strings.spanish.d.ts +33 -0
  152. package/dist/types/components/store/translationStore/strings.swedish.d.ts +33 -0
  153. package/dist/types/components/store/translationStore/strings.turkish.d.ts +33 -0
  154. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +33 -0
  155. package/dist/types/components.d.ts +21 -0
  156. package/dist/types/types/checkout/api/CheckoutSession.d.ts +9 -1
  157. package/dist/types/types/generated/graphql.internal.types.d.ts +713 -4
  158. package/dist/types/types/generated/graphql.internal.types.ts +956 -4
  159. package/dist/zonos-elements/index.esm.js +1 -1
  160. package/dist/zonos-elements/{p-456c0e52.js → p-13ed3789.js} +1 -1
  161. package/dist/zonos-elements/{p-0a2abbab.system.entry.js → p-17fbfda0.system.entry.js} +1 -1
  162. package/dist/zonos-elements/{p-8a424412.entry.js → p-1b56814d.entry.js} +1 -1
  163. package/dist/zonos-elements/p-1e6509d7.js +1 -0
  164. package/dist/zonos-elements/{p-3ad2a9a3.system.entry.js → p-1f63615f.system.entry.js} +1 -1
  165. package/dist/zonos-elements/p-2435f196.entry.js +1 -0
  166. package/dist/zonos-elements/{p-4d4b7faa.entry.js → p-26848428.entry.js} +1 -1
  167. package/dist/zonos-elements/p-28d62fc8.system.entry.js +1 -0
  168. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  169. package/dist/zonos-elements/p-2b7ef406.system.js +18 -0
  170. package/dist/zonos-elements/{p-54c95926.entry.js → p-3827041d.entry.js} +1 -1
  171. package/dist/zonos-elements/{p-321d2963.js → p-48228d76.js} +1 -1
  172. package/dist/zonos-elements/p-4d5932ac.system.entry.js +1 -0
  173. package/dist/zonos-elements/{p-4d081ce8.entry.js → p-59fe8416.entry.js} +1 -1
  174. package/dist/zonos-elements/{p-101226f3.system.entry.js → p-5ca50862.system.entry.js} +1 -1
  175. package/dist/zonos-elements/{p-36bea5d5.system.entry.js → p-5fceccc3.system.entry.js} +1 -1
  176. package/dist/zonos-elements/p-64ad0854.entry.js +1 -0
  177. package/dist/zonos-elements/{p-c87d3d50.system.js → p-65892fa7.system.js} +1 -1
  178. package/dist/zonos-elements/{p-b9a4430c.entry.js → p-66e1dc55.entry.js} +1 -1
  179. package/dist/zonos-elements/{p-09110bb7.system.entry.js → p-7042c6da.system.entry.js} +1 -1
  180. package/dist/zonos-elements/p-741e07e1.system.entry.js +1 -0
  181. package/dist/zonos-elements/{p-0aeba2c7.system.js → p-77113201.system.js} +1 -1
  182. package/dist/zonos-elements/{p-6d37f669.entry.js → p-77c0a02b.entry.js} +1 -1
  183. package/dist/zonos-elements/{p-a75b3efc.system.entry.js → p-85529818.system.entry.js} +1 -1
  184. package/dist/zonos-elements/p-8f1ab25c.system.entry.js +1 -0
  185. package/dist/zonos-elements/{p-1b5f89d5.system.js → p-90b8c428.system.js} +1 -1
  186. package/dist/zonos-elements/p-997b7eef.js +1 -0
  187. package/dist/zonos-elements/{p-4c087a8e.system.entry.js → p-9bc5e944.system.entry.js} +1 -1
  188. package/dist/zonos-elements/p-9c6917ab.system.js +1 -0
  189. package/dist/zonos-elements/{p-358dfb9e.entry.js → p-9d64783a.entry.js} +1 -1
  190. package/dist/zonos-elements/{p-1f1bf95c.system.entry.js → p-9f49e35a.system.entry.js} +1 -1
  191. package/dist/zonos-elements/{p-3ece0f96.system.entry.js → p-a026b5ad.system.entry.js} +1 -1
  192. package/dist/zonos-elements/{p-4a395eea.system.entry.js → p-a1a3657e.system.entry.js} +1 -1
  193. package/dist/zonos-elements/{p-079bc009.system.entry.js → p-a1b0e9a5.system.entry.js} +1 -1
  194. package/dist/zonos-elements/p-a6a401e5.system.entry.js +1 -0
  195. package/dist/zonos-elements/{p-302b7105.system.entry.js → p-b07da3e8.system.entry.js} +1 -1
  196. package/dist/zonos-elements/{p-f31fbbf0.entry.js → p-b08bf843.entry.js} +1 -1
  197. package/dist/zonos-elements/p-b334c76c.entry.js +1 -0
  198. package/dist/zonos-elements/{p-bc6b33fa.entry.js → p-b9581a92.entry.js} +1 -1
  199. package/dist/zonos-elements/p-c30a155e.js +1 -0
  200. package/dist/zonos-elements/{p-9c64ca98.system.entry.js → p-cad67b10.system.entry.js} +1 -1
  201. package/dist/zonos-elements/p-cc78c9d4.js +17 -0
  202. package/dist/zonos-elements/{p-5eaa0de1.entry.js → p-d2301d8a.entry.js} +1 -1
  203. package/dist/zonos-elements/p-d46484aa.entry.js +1 -0
  204. package/dist/zonos-elements/{p-b589f621.system.entry.js → p-d634f954.system.entry.js} +1 -1
  205. package/dist/zonos-elements/p-df316670.system.js +1 -0
  206. package/dist/zonos-elements/p-e331a235.js +1 -0
  207. package/dist/zonos-elements/p-e4d58bd7.js +1 -0
  208. package/dist/zonos-elements/{p-8d1efd7b.entry.js → p-e9ca4447.entry.js} +1 -1
  209. package/dist/zonos-elements/{p-c9e3bc98.system.js → p-f0855df3.system.js} +1 -1
  210. package/dist/zonos-elements/{p-06e2bc14.entry.js → p-f25e7f5a.entry.js} +1 -1
  211. package/dist/zonos-elements/{p-b360ee5b.entry.js → p-f4cc124f.entry.js} +1 -1
  212. package/dist/zonos-elements/{p-bd004403.system.js → p-fa0139c3.system.js} +1 -1
  213. package/dist/zonos-elements/{p-8b206982.system.js → p-fa5767c3.system.js} +1 -1
  214. package/dist/zonos-elements/{p-26718a78.entry.js → p-fbfaa4f9.entry.js} +1 -1
  215. package/dist/zonos-elements/p-fe6cc354.entry.js +1 -0
  216. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  217. package/package.json +1 -1
  218. package/dist/cjs/zonos-toggle.cjs.entry.js +0 -35
  219. package/dist/esm/zonos-toggle.entry.js +0 -31
  220. package/dist/esm-es5/cart-efb30253.js +0 -1
  221. package/dist/esm-es5/hasInclusivePrice-565ddbe5.js +0 -1
  222. package/dist/esm-es5/localization-c1aff677.js +0 -1
  223. package/dist/esm-es5/paypal-06b67be0.js +0 -17
  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-127e0395.js +0 -17
  228. package/dist/zonos-elements/p-197d9b23.system.entry.js +0 -1
  229. package/dist/zonos-elements/p-25dd58f8.system.entry.js +0 -1
  230. package/dist/zonos-elements/p-445072f8.js +0 -1
  231. package/dist/zonos-elements/p-507f00d2.js +0 -1
  232. package/dist/zonos-elements/p-5fd0cd66.system.js +0 -1
  233. package/dist/zonos-elements/p-661cd4ce.system.entry.js +0 -1
  234. package/dist/zonos-elements/p-777e0a81.entry.js +0 -1
  235. package/dist/zonos-elements/p-7e77b055.system.entry.js +0 -1
  236. package/dist/zonos-elements/p-80524eac.entry.js +0 -1
  237. package/dist/zonos-elements/p-9eea270b.entry.js +0 -1
  238. package/dist/zonos-elements/p-c4e358f2.js +0 -1
  239. package/dist/zonos-elements/p-cda52300.js +0 -1
  240. package/dist/zonos-elements/p-d233ef0d.entry.js +0 -1
  241. package/dist/zonos-elements/p-f8f7d491.js +0 -1
  242. package/dist/zonos-elements/p-fc0aa91e.system.js +0 -18
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,n,i,e){function o(t){return t instanceof i?t:new i((function(n){n(t)}))}return new(i||(i=Promise))((function(i,s){function a(t){try{c(e.next(t))}catch(t){s(t)}}function r(t){try{c(e["throw"](t))}catch(t){s(t)}}function c(t){t.done?i(t.value):o(t.value).then(a,r)}c((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},e,o,s,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(t){return function(n){return c([t,n])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(i=0)),i)try{if(e=1,o&&(s=r[0]&2?o["return"]:r[0]?o["throw"]||((s=o["return"])&&s.call(o),0):o.next)&&!(s=s.call(o,r[1])).done)return s;if(o=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;o=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){i.label=r[1];break}if(r[0]===6&&i.label<s[1]){i.label=s[1];s=r;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(r);break}if(s[2])i.ops.pop();i.trys.pop();continue}r=n.call(t,i)}catch(t){r=[6,t];o=0}finally{e=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-959918fe.system.js","./p-096182f0.system.js","./p-5fd0cd66.system.js","./p-ac30b7a8.system.js","./p-01174496.system.js","./p-48d55793.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js","./p-2b8345d8.system.js","./p-7501c637.system.js","./p-3fbd9cc0.system.js","./p-d18a2b2c.system.js","./p-655ec440.system.js"],(function(t){"use strict";var n,i,e,o,s,a,r,c,l,d,h,u,f,p,v,m,z,b,y,g,k,w,x,C,j,I,_,E,A,S;return{setters:[function(t){n=t.r;i=t.d;e=t.h;o=t.a;s=t.g},function(t){a=t.t},function(t){r=t.b;c=t.t;l=t.K;d=t.B;h=t.q;u=t.d},function(t){f=t.s;p=t.r;v=t.t;m=t.q;z=t.l},function(t){b=t.z;y=t.g;g=t.f},function(t){k=t.l;w=t.i;x=t.s},function(t){C=t.a;j=t.s},function(t){I=t.c},function(t){_=t.l},function(t){E=t.c;A=t.s},function(t){S=t.g},function(){},function(){},function(){}],execute:function(){var O=".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h .zonos--company-name-input.sc-zonos-address,.sc-zonos-address-h .zonos--tax-id-input.sc-zonos-address,.sc-zonos-address-h .zonos--short-address-code-input.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";var L=O;var Z=t("zonos_address",function(){function t(t){n(this,t);this.invalidCharacters=i(this,"invalidCharacters",7);this.taxIdChanged=i(this,"taxIdChanged",7);this.storeUnsubscribeList=[];this.isAutoCompleteAdjusted=false;this.defaultAddress=[];this.taxIdErrorMessage="";this.shortAddressCodeErrorMessage="";this.stripe=window.Zonos.stripe;this.isDirtyAddress=false;this.isAddressFilled=false;this.checkoutSessionId=f.checkoutSessionId;this.prevCountry=null;this.prevPostalCode=null;this.trackingSent=false;this.prefetchLandedCost=a(h,1e3)}t.prototype.getStripeAddressInstance=function(){if(this.type==="billing"){return{stripeAddressElement:r.stripeBillingAddressElement,stripeAddressEventData:r.stripeBillingAddressEventData,stripeElements:r.stripeElementsForBillingAddress}}return{stripeAddressElement:r.stripeAddressElement,stripeAddressEventData:r.stripeAddressEventData,stripeElements:r.stripeElements}};t.prototype.updateAddressEventData=function(t){var n=t.event,i=t.type;switch(i){case"billing":r.stripeBillingAddressEventData=n;break;default:{r.stripeAddressEventData=n;break}}if(i==="shipping"){if(n.value.address.line1.length){void this.prefetchLandedCost()}}};t.prototype.isAddressFilledChanged=function(){if(!f.checkoutSessionId){return}if(this.isAddressFilled&&!this.trackingSent&&this.type==="shipping"){this.trackingSent=true;var t=f.checkoutSessionId;void c({checkoutSessionId:t,eventName:"checkout_customerInfoFilled"})}};t.prototype.updateAddressElement=function(t){var n=t.stripeAddressElement,i=t.type;if(i==="shipping"){r.stripeAddressElement=n;return}r.stripeBillingAddressElement=n};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,i,e,o,s,a,r,c,d;var h=this;return __generator(this,(function(u){this.stripe=window.Zonos.stripe;t=this.getStripeAddressInstance(),n=t.stripeAddressEventData,i=t.stripeElements;if(!this.stripe||!i){k("Stripe is not initialized. Couldn't load stripe element.");return[2]}e=this.defaultAddress.map((function(t){return Object.assign(Object.assign({},t),{name:t.name,phone:t.phone||undefined})}));o=z.shippingZoneCountries;s=o?Object.values(o).map((function(t){return t.code})):[];a=new URLSearchParams(window.location.search).has("zonosCheckoutAllCountries");r=this.type==="shipping"?s:[];c=(n===null||n===void 0?void 0:n.value.address.country)||p(r);_("Stripe country code: ".concat(c),"info");d=i.create("address",{allowedCountries:a?[]:r,contacts:e.length&&!n?this.defaultAddress:[],defaultValues:{address:Object.assign(Object.assign({},n===null||n===void 0?void 0:n.value.address),{country:c}),firstName:n===null||n===void 0?void 0:n.value.firstName,lastName:n===null||n===void 0?void 0:n.value.lastName,phone:n===null||n===void 0?void 0:n.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});d.mount(this.el.querySelector(".zonos--address-component"));if(n===null||n===void 0?void 0:n.value.address){this.prevCountry=n.value.address.country;this.prevPostalCode=n.value.address.postal_code}d.on("change",(function(t){var n=t.value;if(!h.isDirtyAddress&&n.address.line1.length>=3){h.isDirtyAddress=true;if(!h.isAutoCompleteAdjusted){var i=h.el.querySelector('iframe[src*="autocomplete-suggestions"]');if(i){i.style.zIndex="3"}h.isAutoCompleteAdjusted=true}setTimeout((function(){if(w()){h.el.scrollIntoView({behavior:"smooth",block:"end"})}else{var t=h.type==="shipping"?100:600;var n=h.el.closest(".zonos--group");var i=h.el.getBoundingClientRect().top+t;n===null||n===void 0?void 0:n.scrollTo({behavior:"smooth",top:i})}}),600)}var e=l({firstName:n.firstName,lastName:n.lastName,name:n.name}),o=e.firstName,s=e.lastName;h.updateAddressEventData({event:Object.assign(Object.assign({},t),{elementMode:h.type,elementType:"address",value:Object.assign(Object.assign({},n),{firstName:o,lastName:s})}),type:h.type})}));this.updateAddressElement({stripeAddressElement:d,type:this.type});return[2]}))}))};t.prototype.defaultAddressChanged=function(t,n){var i=JSON.stringify(n);var e=JSON.stringify(t);if(i===e){return}_("Reset address element when default address property is changed","info",{defaultAddress:this.defaultAddress});var o=this.getStripeAddressInstance().stripeAddressElement;o===null||o===void 0?void 0:o.clear();o===null||o===void 0?void 0:o.destroy();if(this.type==="shipping"){r.stripeAddressEventData=null}else{r.stripeBillingAddressEventData=null}void this.watchInitStripe()};t.prototype.isInTaxIdCountry=function(t){return E.includes(t)};t.prototype.renderTaxIdInput=function(){var t=this;var n;if(this.type==="billing"){return null}var i=(n=r.stripeAddressEventData)===null||n===void 0?void 0:n.value.address.country;if(!i){return null}if(!this.isInTaxIdCountry(i)){return null}var o=C({companyName:r.companyName,countryCode:i});if(!o){return null}var s=A[i];return e("div",{class:"zonos--tax-id-input"},e("zonos-stripe-input",{inputLabel:v(s.friendlyName),inputPlaceholder:s.placeholder,inputValue:r.taxId||"",isError:!!this.taxIdErrorMessage,onInputChange:function(n){r.taxId=n.detail;t.taxIdChanged.emit(n.detail)}}),this.taxIdErrorMessage&&e("zonos-text",{textColor:"red-600",type:"caption"},this.taxIdErrorMessage))};t.prototype.renderShortAddressCodeInput=function(){var t;if(this.type==="billing"){return null}var n=(t=r.stripeAddressEventData)===null||t===void 0?void 0:t.value.address.country;if(!n){return null}var i=j({countryCode:n});if(!i){return null}return e("div",{class:"zonos--short-address-code-input"},e("zonos-stripe-input",{inputLabel:v("Short address code"),inputPlaceholder:"RRRD2929",inputValue:r.shortAddressCode||"",isError:!!this.shortAddressCodeErrorMessage,onInputChange:function(t){r.shortAddressCode=t.detail}}),this.shortAddressCodeErrorMessage&&e("zonos-text",{textColor:"red-600",type:"caption"},this.shortAddressCodeErrorMessage))};t.prototype.renderCompanyNameInput=function(){if(this.type==="billing"&&!window.Zonos.isCollect&&!window.Zonos.isInvoice){return null}var t=b.checkoutSettings.companyFieldsStatus==="ENABLED"||!!window.Zonos.isCollect||!!window.Zonos.isInvoice;if(!t){return null}return e("zonos-stripe-input",{class:"zonos--company-name-input",inputLabel:v("Company name (optional)"),inputValue:r.companyName,onInputChange:function(t){r.companyName=t.detail}})};t.prototype.disconnectedCallback=function(){var t=this.getStripeAddressInstance().stripeAddressElement;t===null||t===void 0?void 0:t.destroy();try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;var n=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!n&&n.value.address.line1.length>0;void this.watchInitStripe();this.checkoutSessionId=f.checkoutSessionId;this.storeUnsubscribeList=[m("checkoutSessionId",(function(){t.checkoutSessionId=f.checkoutSessionId})),d("stripeElements",(function(){if(t.type==="shipping"){void t.watchInitStripe()}})),d("stripeElementsForBillingAddress",(function(){if(t.type==="billing"){void t.watchInitStripe()}}))]};t.prototype.render=function(){var t;this.checkoutSessionId=f.checkoutSessionId;if((t=r.stripeAddressEventData)===null||t===void 0?void 0:t.complete){this.isAddressFilled=true}return e(o,{key:"5dc571d7c5e706ae9cb90de70deee22847e5ba7e",class:I(["zonos--address","zonos--elements","zonos--".concat(this.type,"-address")])},this.titleText&&e("zonos-text",{key:"a7c9f730bc9b64aa2c6e8cc24701e638481eac19",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("slot",{key:"3078529c201c7947ffc833485d46184bc79ab1d1",name:"below-title"}),this.renderCompanyNameInput(),this.renderTaxIdInput(),this.renderShortAddressCodeInput(),e("div",{key:"b4a9850ac30ad9c483e05743ff41b7de9756d826",class:"zonos--address-component"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{checkoutSessionId:["isAddressFilledChanged"],isAddressFilled:["isAddressFilledChanged"],stripe:["watchInitStripe"],defaultAddress:["defaultAddressChanged"]}},enumerable:false,configurable:true});return t}());Z.style=L;var N='<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-400)"></path>\n <path d="M12.75 9a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V9Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var B='<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-400)"></path>\n <path d="M10.25 10.25a1.75 1.75 0 1 1 2.431 1.613c-.616.26-1.431.885-1.431 1.887a.75.75 0 0 0 1.5 0c0-.053.02-.128.108-.228.092-.104.236-.205.408-.278A3.25 3.25 0 1 0 8.75 10.25a.75.75 0 0 0 1.5 0Zm2.5 5.75a.75.75 0 0 0-1.5 0v.25a.75.75 0 0 0 1.5 0V16Z" fill="currentColor"></path>\n</svg>';var D='<svg color="var(--zonos-elements-orange-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M14.46 5.492c-1.014-2.027-3.906-2.027-4.92 0L4.276 16.02c-.914 1.83.416 3.98 2.46 3.98h10.528c2.044 0 3.374-2.151 2.46-3.98L14.46 5.492Z" data-is-secondary-color="true" fill="var(--zonos-elements-orange-400)"></path>\n <path d="M12.75 10a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V10Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var M=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--confirm-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:opacity 0.3s, visibility 0.3s;transition:opacity 0.3s, visibility 0.3s}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--confirm-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color)}:host .zonos--confirm-dialog{position:relative;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;width:var(--zonos--dialog-width);border-radius:var(--zonos--border-radius, 10px);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;gap:24px}:host .icon-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:40px;width:40px;border-radius:50%;background:var(--zonos-elements-blue-100)}:host .warn .icon-wrapper{background:var(--zonos-elements-orange-100)}:host .danger .icon-wrapper{background:var(--zonos-elements-red-100)}:host .footer{display:-ms-flexbox;display:flex;width:100%;gap:8px}:host .footer zonos-button{-ms-flex:1;flex:1}:host .content{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .content zonos-text{text-align:center}:host(.open) .zonos--confirm-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483009;opacity:0.65}:host(.open) .zonos--confirm-layout{opacity:1;z-index:2147483010;-webkit-transform:scale(1);transform:scale(1)}";var V=M;var T=t("zonos_confirm_dialog",function(){function t(t){var e=this;n(this,t);this.confirmClicked=i(this,"confirmClicked",7);this.cancelClicked=i(this,"cancelClicked",7);this.dialogTitle=v("Are you sure?");this.dialogIntent="info";this.dialogSubtitle=null;this.dialogWidth=350;this.dialogType="confirm";this.isMobile=false;this.noClickOutside=false;this.clickOutsideDialogHandler=function(t){if(t.target===t.currentTarget&&!e.noClickOutside){e.closeDialogHandler()}}}t.prototype.handleKeyDown=function(t){if(t.key==="Escape"){this.closeDialogHandler()}};t.prototype.focusDialog=function(){var t=this;if(this.dialogOpen){setTimeout((function(){var n,i;(i=(n=t.el.shadowRoot)===null||n===void 0?void 0:n.querySelector(".zonos--backdrop"))===null||i===void 0?void 0:i.focus()}),100)}};t.prototype.confirmDialogHandler=function(){if(!this.dialogOpen){return}this.confirmClicked.emit()};t.prototype.closeDialogHandler=function(){if(!this.dialogOpen){return}this.cancelClicked.emit()};t.prototype.renderIcon=function(){switch(this.dialogIntent){case"info":return e("zonos-icon",{content:B,iconColor:"blue-800"});case"danger":return e("zonos-icon",{content:N,iconColor:"red-800"});case"warn":return e("zonos-icon",{content:D,iconColor:"orange-800"})}};t.prototype.getButtonConfirmVariant=function(){switch(this.dialogIntent){case"warn":return"warning";case"danger":return"danger";default:return"primary"}};t.prototype.render=function(){var t=this;this.focusDialog();var n=S();var i=y(b.appearance.theme);return e(o,{key:"db0bfe0b8a125e806a97c9382faa938078000349",class:I([this.dialogOpen&&"open","zonos--elements"]),"data-dialog-type":this.dialogType,"data-theme":i,style:{"--zonos--border-radius":n,"--zonos--dialog-width":"".concat(this.dialogWidth,"px"),"--zonos--font-family":g()}},e("div",{key:"1676defad54705df4e9282bda6b5734592d0fb60",class:"zonos--backdrop",tabIndex:-1}),e("div",{key:"2a6ec6b5df7ea30304cfed5276e55618b40add93",class:I(["zonos--confirm-layout",this.dialogIntent]),onClick:function(n){return t.clickOutsideDialogHandler(n)}},e("div",{key:"d1c8358c3fd98c27a469fe7443d1983c1c134a7c",class:"zonos--confirm-dialog",onBlur:function(){t.focusDialog()}},e("div",{key:"137e9659aa7aec2e4604acf80809b35bce69ca79",class:"wrapper"},e("div",{key:"9c1057857ea095e7e88c8950469add2bc4c1318e",class:"icon-wrapper"},this.renderIcon()),e("div",{key:"48f0e0cd9ce62b425bae831d1387261bbd4162a1",class:"content"},e("div",{key:"0d3e681f350e5db547181beadf5c6bcf49a8bbd2",class:"title"},e("zonos-text",{key:"f16a43d2b3c9504911b1e36ba573873f80093c47",type:"subheader"},this.dialogTitle)),this.dialogSubtitle&&e("div",{key:"fd570f98bc736a68c16fedee72b1417dc6906fa6",class:"subtitle"},e("zonos-text",{key:"6785aa19dd44cf7f6fae7317e3924be6c6ee8af3",textColor:"gray-800"},this.dialogSubtitle))),e("div",{key:"4206cad3dcff0055fc5f3ea8e7c217ae33c63263",class:"footer"},this.dialogType==="confirm"&&e("zonos-button",{key:"72d1a216641d482bdbeae384963dcdff1cfc3f45",backgroundColor:"gray-0",class:"cancel-button",onClick:function(){return t.closeDialogHandler()},size:"lg",withBoxShadow:true},this.dialogCancelBtnText||v("Cancel")),e("zonos-button",{key:"a6a206eff11d1f42c33ef9113cc393d727c60f89",class:"confirm-button",onClick:function(){return t.confirmDialogHandler()},size:"lg",variant:this.getButtonConfirmVariant()},this.dialogConfirmBtnText))))))};Object.defineProperty(t,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());T.style=V;var P=function(t){var n=/^[a-zA-Z0-9.%_+-]*@[a-zA-Z0-9][a-zA-Z0-9.-]*\.[a-zA-Z0-9]{2,}$/;return n.test(t)};var R=".sc-zonos-link-authentication-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}.sc-zonos-link-authentication-h .zonos--input-invalid.sc-zonos-link-authentication{border:2px solid var(--zonos-elements-red-600);border-radius:var(--zonos--border-radius)}";var F=R;var J=51;var q=t("zonos_link_authentication",function(){function t(t){var e=this;n(this,t);this.linkAuthenticationChange=i(this,"linkAuthenticationChange",7);this.storeUnsubscribeList=[];this.defaultEmail=null;this.isEmailError=false;this.stripe=r.stripe;this.isStagingMode=u.isStagingMode;this.clientSecret=r.clientSecret;this.retriesInitializeLink=0;this.setCustomEmailInputToLinkEvent=function(t){var n=P(t);var i={complete:!!n,elementType:"linkAuthentication",empty:!t,value:{email:t}};r.stripeLinkEventData=i};this.handleNormalEmailInput=function(t){var n;var i=t.detail;e.setCustomEmailInputToLinkEvent(i);(n=e.linkAuthenticationChange)===null||n===void 0?void 0:n.emit()}}t.prototype.watchIsStagingMode=function(){var t=this;setTimeout((function(){void t.watchInitStripe()}),0)};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,i,e;var o=this;return __generator(this,(function(s){switch(s.label){case 0:if(!this.stripe||!r.stripeElements){return[2]}if(u.isStagingMode||!this.clientSecret){return[2]}t=this.defaultEmail?{email:this.defaultEmail}:undefined;s.label=1;case 1:s.trys.push([1,2,,6]);n=r.stripeLinkElement||r.stripeElements.create("linkAuthentication",{defaultValues:t});i=this.el.querySelector(".zonos--link-authentication-component");if(!i){k("Cannot find container element for linkAuthenticationElement");return[2]}n.mount(i);n.on("change",(function(t){var n;r.stripeLinkEventData=t;(n=o.linkAuthenticationChange)===null||n===void 0?void 0:n.emit()}));r.stripeLinkElement=n;this.retriesInitializeLink=0;if(this.retriesInitializeLink>11){_("Stripe link element initialized","info",{retriesInitializeLink:this.retriesInitializeLink,stripe:this.stripe});void x({endpoint:"stripe-link-authentication-init-long-running",errors:["Stripe link element initialized after 20 retries - 10 seconds"],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}return[3,6];case 2:e=s.sent();if(!(e instanceof Error))return[3,5];this.retriesInitializeLink++;if(!(this.retriesInitializeLink<J))return[3,4];return[4,new Promise((function(t){return setTimeout(t,500)}))];case 3:s.sent();void this.watchInitStripe();s.label=4;case 4:if(this.retriesInitializeLink===J){void x({endpoint:"stripe-link-authentication-init-error",errors:[e.message],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}s.label=5;case 5:return[3,6];case 6:return[2]}}))}))};t.prototype.watchDefaultEmail=function(t,n){var i,e;_("Default email is changed","info",{newDefaultEmail:t,oldDefaultEmail:n});if(n===t){return}if(!t){r.stripeLinkEventData=null}if(u.isStagingMode){this.setCustomEmailInputToLinkEvent(t||"");return}(i=r.stripeLinkElement)===null||i===void 0?void 0:i.clear();(e=r.stripeLinkElement)===null||e===void 0?void 0:e.destroy();r.stripeLinkElement=null;r.stripeLinkEventData=null;_("Reset stripe link element when default email is changed","info",{defaultEmail:t});void this.watchInitStripe()};t.prototype.disconnectedCallback=function(){try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;this.storeUnsubscribeList=[d("stripeElements",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){void this.watchInitStripe();return[2]}))}))})),d("clientSecret",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.clientSecret=r.clientSecret;return[2]}))}))})),d("stripe",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.stripe=r.stripe;return[2]}))}))}))];void this.watchInitStripe();if(!this.defaultEmail){return}this.setCustomEmailInputToLinkEvent(this.defaultEmail)};t.prototype.render=function(){var t=this;this.isStagingMode=u.isStagingMode;this.clientSecret=r.clientSecret;var n=function(){var n;if(u.isStagingMode){return e("zonos-stripe-input",{inputLabel:v("Email"),inputValue:t.defaultEmail||((n=r.stripeLinkEventData)===null||n===void 0?void 0:n.value.email)||"",isError:t.isEmailError,onBlur:function(){var n;var i=((n=r.stripeLinkEventData)===null||n===void 0?void 0:n.value.email)||"";if(!i){return}var e=P(i);t.isEmailError=!e},onInputChange:t.handleNormalEmailInput})}return e("div",{class:"zonos--link-authentication-component ".concat(t.isEmailError&&"zonos--input-invalid")})};return e(o,{class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":S()}},this.titleText&&e("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),n(),this.isEmailError&&e("zonos-text",{textColor:"red-600"},v("Please enter a valid email address.")))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isStagingMode:["watchIsStagingMode"],stripe:["watchInitStripe"],clientSecret:["watchInitStripe"],defaultEmail:["watchDefaultEmail"]}},enumerable:false,configurable:true});return t}());q.style=F;var G=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:fixed;inset:0;z-index:2147483010;pointer-events:none;display:block}:host .zonos--loading-overlay{position:fixed;inset:0;width:100vw;height:100vh;background:var(--zonos-elements-backdrop-color);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;opacity:0;visibility:hidden;-webkit-transition:opacity 0.3s ease, visibility 0.3s ease;transition:opacity 0.3s ease, visibility 0.3s ease;z-index:2147483010}:host(.zonos--open){pointer-events:auto}:host(.zonos--open) .zonos--loading-overlay{opacity:0.65;visibility:visible}";var U=G;var $=t("zonos_loading_overlay",function(){function t(t){n(this,t);this.open=false;this.size=40}t.prototype.render=function(){return e(o,{key:"13154a3c9250f15d8dca292f0673c6465bfb15e0",class:I(["zonos--elements",this.open&&"zonos--open"])},e("div",{key:"4470fccd21e58bd7959ef3e20c8775ac637cace0",class:"zonos--loading-overlay"},e("zonos-spinner",{key:"5b32b821cea982866da56176eeaafd5d8958f25d",size:this.size,spinnerColor:this.spinnerColor})))};return t}());$.style=U}}}));
1
+ var __awaiter=this&&this.__awaiter||function(t,n,i,e){function o(t){return t instanceof i?t:new i((function(n){n(t)}))}return new(i||(i=Promise))((function(i,s){function a(t){try{c(e.next(t))}catch(t){s(t)}}function r(t){try{c(e["throw"](t))}catch(t){s(t)}}function c(t){t.done?i(t.value):o(t.value).then(a,r)}c((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var i={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},e,o,s,a;return a={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function r(t){return function(n){return c([t,n])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(a&&(a=0,r[0]&&(i=0)),i)try{if(e=1,o&&(s=r[0]&2?o["return"]:r[0]?o["throw"]||((s=o["return"])&&s.call(o),0):o.next)&&!(s=s.call(o,r[1])).done)return s;if(o=0,s)r=[r[0]&2,s.value];switch(r[0]){case 0:case 1:s=r;break;case 4:i.label++;return{value:r[1],done:false};case 5:i.label++;o=r[1];r=[0];continue;case 7:r=i.ops.pop();i.trys.pop();continue;default:if(!(s=i.trys,s=s.length>0&&s[s.length-1])&&(r[0]===6||r[0]===2)){i=0;continue}if(r[0]===3&&(!s||r[1]>s[0]&&r[1]<s[3])){i.label=r[1];break}if(r[0]===6&&i.label<s[1]){i.label=s[1];s=r;break}if(s&&i.label<s[2]){i.label=s[2];i.ops.push(r);break}if(s[2])i.ops.pop();i.trys.pop();continue}r=n.call(t,i)}catch(t){r=[6,t];o=0}finally{e=s=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-959918fe.system.js","./p-df316670.system.js","./p-9c6917ab.system.js","./p-ac30b7a8.system.js","./p-01174496.system.js","./p-48d55793.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js","./p-2b8345d8.system.js","./p-7501c637.system.js","./p-3fbd9cc0.system.js","./p-d18a2b2c.system.js","./p-655ec440.system.js"],(function(t){"use strict";var n,i,e,o,s,a,r,c,l,d,h,u,f,p,v,m,z,b,y,g,k,w,x,C,j,I,_,E,A,S;return{setters:[function(t){n=t.r;i=t.d;e=t.h;o=t.a;s=t.g},function(t){a=t.t},function(t){r=t.b;c=t.t;l=t.Q;d=t.F;h=t.q;u=t.d},function(t){f=t.s;p=t.r;v=t.t;m=t.q;z=t.l},function(t){b=t.z;y=t.g;g=t.f},function(t){k=t.l;w=t.i;x=t.s},function(t){C=t.a;j=t.s},function(t){I=t.c},function(t){_=t.l},function(t){E=t.c;A=t.s},function(t){S=t.g},function(){},function(){},function(){}],execute:function(){var O=".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h .zonos--company-name-input.sc-zonos-address,.sc-zonos-address-h .zonos--tax-id-input.sc-zonos-address,.sc-zonos-address-h .zonos--short-address-code-input.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";var L=O;var Z=t("zonos_address",function(){function t(t){n(this,t);this.invalidCharacters=i(this,"invalidCharacters",7);this.taxIdChanged=i(this,"taxIdChanged",7);this.storeUnsubscribeList=[];this.isAutoCompleteAdjusted=false;this.defaultAddress=[];this.taxIdErrorMessage="";this.shortAddressCodeErrorMessage="";this.stripe=window.Zonos.stripe;this.isDirtyAddress=false;this.isAddressFilled=false;this.checkoutSessionId=f.checkoutSessionId;this.prevCountry=null;this.prevPostalCode=null;this.trackingSent=false;this.prefetchLandedCost=a(h,1e3)}t.prototype.getStripeAddressInstance=function(){if(this.type==="billing"){return{stripeAddressElement:r.stripeBillingAddressElement,stripeAddressEventData:r.stripeBillingAddressEventData,stripeElements:r.stripeElementsForBillingAddress}}return{stripeAddressElement:r.stripeAddressElement,stripeAddressEventData:r.stripeAddressEventData,stripeElements:r.stripeElements}};t.prototype.updateAddressEventData=function(t){var n=t.event,i=t.type;switch(i){case"billing":r.stripeBillingAddressEventData=n;break;default:{r.stripeAddressEventData=n;break}}if(i==="shipping"){if(n.value.address.line1.length){void this.prefetchLandedCost()}}};t.prototype.isAddressFilledChanged=function(){if(!f.checkoutSessionId){return}if(this.isAddressFilled&&!this.trackingSent&&this.type==="shipping"){this.trackingSent=true;var t=f.checkoutSessionId;void c({checkoutSessionId:t,eventName:"checkout_customerInfoFilled"})}};t.prototype.updateAddressElement=function(t){var n=t.stripeAddressElement,i=t.type;if(i==="shipping"){r.stripeAddressElement=n;return}r.stripeBillingAddressElement=n};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,i,e,o,s,a,r,c,d;var h=this;return __generator(this,(function(u){this.stripe=window.Zonos.stripe;t=this.getStripeAddressInstance(),n=t.stripeAddressEventData,i=t.stripeElements;if(!this.stripe||!i){k("Stripe is not initialized. Couldn't load stripe element.");return[2]}e=this.defaultAddress.map((function(t){return Object.assign(Object.assign({},t),{name:t.name,phone:t.phone||undefined})}));o=z.shippingZoneCountries;s=o?Object.values(o).map((function(t){return t.code})):[];a=new URLSearchParams(window.location.search).has("zonosCheckoutAllCountries");r=this.type==="shipping"?s:[];c=(n===null||n===void 0?void 0:n.value.address.country)||p(r);_("Stripe country code: ".concat(c),"info");d=i.create("address",{allowedCountries:a?[]:r,contacts:e.length&&!n?this.defaultAddress:[],defaultValues:{address:Object.assign(Object.assign({},n===null||n===void 0?void 0:n.value.address),{country:c}),firstName:n===null||n===void 0?void 0:n.value.firstName,lastName:n===null||n===void 0?void 0:n.value.lastName,phone:n===null||n===void 0?void 0:n.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});d.mount(this.el.querySelector(".zonos--address-component"));if(n===null||n===void 0?void 0:n.value.address){this.prevCountry=n.value.address.country;this.prevPostalCode=n.value.address.postal_code}d.on("change",(function(t){var n=t.value;if(!h.isDirtyAddress&&n.address.line1.length>=3){h.isDirtyAddress=true;if(!h.isAutoCompleteAdjusted){var i=h.el.querySelector('iframe[src*="autocomplete-suggestions"]');if(i){i.style.zIndex="3"}h.isAutoCompleteAdjusted=true}setTimeout((function(){if(w()){h.el.scrollIntoView({behavior:"smooth",block:"end"})}else{var t=h.type==="shipping"?100:600;var n=h.el.closest(".zonos--group");var i=h.el.getBoundingClientRect().top+t;n===null||n===void 0?void 0:n.scrollTo({behavior:"smooth",top:i})}}),600)}var e=l({firstName:n.firstName,lastName:n.lastName,name:n.name}),o=e.firstName,s=e.lastName;h.updateAddressEventData({event:Object.assign(Object.assign({},t),{elementMode:h.type,elementType:"address",value:Object.assign(Object.assign({},n),{firstName:o,lastName:s})}),type:h.type})}));this.updateAddressElement({stripeAddressElement:d,type:this.type});return[2]}))}))};t.prototype.defaultAddressChanged=function(t,n){var i=JSON.stringify(n);var e=JSON.stringify(t);if(i===e){return}_("Reset address element when default address property is changed","info",{defaultAddress:this.defaultAddress});var o=this.getStripeAddressInstance().stripeAddressElement;o===null||o===void 0?void 0:o.clear();o===null||o===void 0?void 0:o.destroy();if(this.type==="shipping"){r.stripeAddressEventData=null}else{r.stripeBillingAddressEventData=null}void this.watchInitStripe()};t.prototype.isInTaxIdCountry=function(t){return E.includes(t)};t.prototype.renderTaxIdInput=function(){var t=this;var n;if(this.type==="billing"){return null}var i=(n=r.stripeAddressEventData)===null||n===void 0?void 0:n.value.address.country;if(!i){return null}if(!this.isInTaxIdCountry(i)){return null}var o=C({companyName:r.companyName,countryCode:i});if(!o){return null}var s=A[i];return e("div",{class:"zonos--tax-id-input"},e("zonos-stripe-input",{inputLabel:v(s.friendlyName),inputPlaceholder:s.placeholder,inputValue:r.taxId||"",isError:!!this.taxIdErrorMessage,onInputChange:function(n){r.taxId=n.detail;t.taxIdChanged.emit(n.detail)}}),this.taxIdErrorMessage&&e("zonos-text",{textColor:"red-600",type:"caption"},this.taxIdErrorMessage))};t.prototype.renderShortAddressCodeInput=function(){var t;if(this.type==="billing"){return null}var n=(t=r.stripeAddressEventData)===null||t===void 0?void 0:t.value.address.country;if(!n){return null}var i=j({countryCode:n});if(!i){return null}return e("div",{class:"zonos--short-address-code-input"},e("zonos-stripe-input",{inputLabel:v("Short address code"),inputPlaceholder:"RRRD2929",inputValue:r.shortAddressCode||"",isError:!!this.shortAddressCodeErrorMessage,onInputChange:function(t){r.shortAddressCode=t.detail}}),this.shortAddressCodeErrorMessage&&e("zonos-text",{textColor:"red-600",type:"caption"},this.shortAddressCodeErrorMessage))};t.prototype.renderCompanyNameInput=function(){if(this.type==="billing"&&!window.Zonos.isCollect&&!window.Zonos.isInvoice){return null}var t=b.checkoutSettings.companyFieldsStatus==="ENABLED"||!!window.Zonos.isCollect||!!window.Zonos.isInvoice;if(!t){return null}return e("zonos-stripe-input",{class:"zonos--company-name-input",inputLabel:v("Company name (optional)"),inputValue:r.companyName,onInputChange:function(t){r.companyName=t.detail}})};t.prototype.disconnectedCallback=function(){var t=this.getStripeAddressInstance().stripeAddressElement;t===null||t===void 0?void 0:t.destroy();try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;var n=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!n&&n.value.address.line1.length>0;void this.watchInitStripe();this.checkoutSessionId=f.checkoutSessionId;this.storeUnsubscribeList=[m("checkoutSessionId",(function(){t.checkoutSessionId=f.checkoutSessionId})),d("stripeElements",(function(){if(t.type==="shipping"){void t.watchInitStripe()}})),d("stripeElementsForBillingAddress",(function(){if(t.type==="billing"){void t.watchInitStripe()}}))]};t.prototype.render=function(){var t;this.checkoutSessionId=f.checkoutSessionId;if((t=r.stripeAddressEventData)===null||t===void 0?void 0:t.complete){this.isAddressFilled=true}return e(o,{key:"5dc571d7c5e706ae9cb90de70deee22847e5ba7e",class:I(["zonos--address","zonos--elements","zonos--".concat(this.type,"-address")])},this.titleText&&e("zonos-text",{key:"a7c9f730bc9b64aa2c6e8cc24701e638481eac19",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("slot",{key:"3078529c201c7947ffc833485d46184bc79ab1d1",name:"below-title"}),this.renderCompanyNameInput(),this.renderTaxIdInput(),this.renderShortAddressCodeInput(),e("div",{key:"b4a9850ac30ad9c483e05743ff41b7de9756d826",class:"zonos--address-component"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{checkoutSessionId:["isAddressFilledChanged"],isAddressFilled:["isAddressFilledChanged"],stripe:["watchInitStripe"],defaultAddress:["defaultAddressChanged"]}},enumerable:false,configurable:true});return t}());Z.style=L;var N='<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-400)"></path>\n <path d="M12.75 9a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V9Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var B='<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-400)"></path>\n <path d="M10.25 10.25a1.75 1.75 0 1 1 2.431 1.613c-.616.26-1.431.885-1.431 1.887a.75.75 0 0 0 1.5 0c0-.053.02-.128.108-.228.092-.104.236-.205.408-.278A3.25 3.25 0 1 0 8.75 10.25a.75.75 0 0 0 1.5 0Zm2.5 5.75a.75.75 0 0 0-1.5 0v.25a.75.75 0 0 0 1.5 0V16Z" fill="currentColor"></path>\n</svg>';var D='<svg color="var(--zonos-elements-orange-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M14.46 5.492c-1.014-2.027-3.906-2.027-4.92 0L4.276 16.02c-.914 1.83.416 3.98 2.46 3.98h10.528c2.044 0 3.374-2.151 2.46-3.98L14.46 5.492Z" data-is-secondary-color="true" fill="var(--zonos-elements-orange-400)"></path>\n <path d="M12.75 10a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V10Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>';var M=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--confirm-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:opacity 0.3s, visibility 0.3s;transition:opacity 0.3s, visibility 0.3s}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--confirm-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color)}:host .zonos--confirm-dialog{position:relative;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;width:var(--zonos--dialog-width);border-radius:var(--zonos--border-radius, 10px);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;gap:24px}:host .icon-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:40px;width:40px;border-radius:50%;background:var(--zonos-elements-blue-100)}:host .warn .icon-wrapper{background:var(--zonos-elements-orange-100)}:host .danger .icon-wrapper{background:var(--zonos-elements-red-100)}:host .footer{display:-ms-flexbox;display:flex;width:100%;gap:8px}:host .footer zonos-button{-ms-flex:1;flex:1}:host .content{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .content zonos-text{text-align:center}:host(.open) .zonos--confirm-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483009;opacity:0.65}:host(.open) .zonos--confirm-layout{opacity:1;z-index:2147483010;-webkit-transform:scale(1);transform:scale(1)}";var V=M;var T=t("zonos_confirm_dialog",function(){function t(t){var e=this;n(this,t);this.confirmClicked=i(this,"confirmClicked",7);this.cancelClicked=i(this,"cancelClicked",7);this.dialogTitle=v("Are you sure?");this.dialogIntent="info";this.dialogSubtitle=null;this.dialogWidth=350;this.dialogType="confirm";this.isMobile=false;this.noClickOutside=false;this.clickOutsideDialogHandler=function(t){if(t.target===t.currentTarget&&!e.noClickOutside){e.closeDialogHandler()}}}t.prototype.handleKeyDown=function(t){if(t.key==="Escape"){this.closeDialogHandler()}};t.prototype.focusDialog=function(){var t=this;if(this.dialogOpen){setTimeout((function(){var n,i;(i=(n=t.el.shadowRoot)===null||n===void 0?void 0:n.querySelector(".zonos--backdrop"))===null||i===void 0?void 0:i.focus()}),100)}};t.prototype.confirmDialogHandler=function(){if(!this.dialogOpen){return}this.confirmClicked.emit()};t.prototype.closeDialogHandler=function(){if(!this.dialogOpen){return}this.cancelClicked.emit()};t.prototype.renderIcon=function(){switch(this.dialogIntent){case"info":return e("zonos-icon",{content:B,iconColor:"blue-800"});case"danger":return e("zonos-icon",{content:N,iconColor:"red-800"});case"warn":return e("zonos-icon",{content:D,iconColor:"orange-800"})}};t.prototype.getButtonConfirmVariant=function(){switch(this.dialogIntent){case"warn":return"warning";case"danger":return"danger";default:return"primary"}};t.prototype.render=function(){var t=this;this.focusDialog();var n=S();var i=y(b.appearance.theme);return e(o,{key:"db0bfe0b8a125e806a97c9382faa938078000349",class:I([this.dialogOpen&&"open","zonos--elements"]),"data-dialog-type":this.dialogType,"data-theme":i,style:{"--zonos--border-radius":n,"--zonos--dialog-width":"".concat(this.dialogWidth,"px"),"--zonos--font-family":g()}},e("div",{key:"1676defad54705df4e9282bda6b5734592d0fb60",class:"zonos--backdrop",tabIndex:-1}),e("div",{key:"2a6ec6b5df7ea30304cfed5276e55618b40add93",class:I(["zonos--confirm-layout",this.dialogIntent]),onClick:function(n){return t.clickOutsideDialogHandler(n)}},e("div",{key:"d1c8358c3fd98c27a469fe7443d1983c1c134a7c",class:"zonos--confirm-dialog",onBlur:function(){t.focusDialog()}},e("div",{key:"137e9659aa7aec2e4604acf80809b35bce69ca79",class:"wrapper"},e("div",{key:"9c1057857ea095e7e88c8950469add2bc4c1318e",class:"icon-wrapper"},this.renderIcon()),e("div",{key:"48f0e0cd9ce62b425bae831d1387261bbd4162a1",class:"content"},e("div",{key:"0d3e681f350e5db547181beadf5c6bcf49a8bbd2",class:"title"},e("zonos-text",{key:"f16a43d2b3c9504911b1e36ba573873f80093c47",type:"subheader"},this.dialogTitle)),this.dialogSubtitle&&e("div",{key:"fd570f98bc736a68c16fedee72b1417dc6906fa6",class:"subtitle"},e("zonos-text",{key:"6785aa19dd44cf7f6fae7317e3924be6c6ee8af3",textColor:"gray-800"},this.dialogSubtitle))),e("div",{key:"4206cad3dcff0055fc5f3ea8e7c217ae33c63263",class:"footer"},this.dialogType==="confirm"&&e("zonos-button",{key:"72d1a216641d482bdbeae384963dcdff1cfc3f45",backgroundColor:"gray-0",class:"cancel-button",onClick:function(){return t.closeDialogHandler()},size:"lg",withBoxShadow:true},this.dialogCancelBtnText||v("Cancel")),e("zonos-button",{key:"a6a206eff11d1f42c33ef9113cc393d727c60f89",class:"confirm-button",onClick:function(){return t.confirmDialogHandler()},size:"lg",variant:this.getButtonConfirmVariant()},this.dialogConfirmBtnText))))))};Object.defineProperty(t,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());T.style=V;var P=function(t){var n=/^[a-zA-Z0-9.%_+-]*@[a-zA-Z0-9][a-zA-Z0-9.-]*\.[a-zA-Z0-9]{2,}$/;return n.test(t)};var R=".sc-zonos-link-authentication-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}.sc-zonos-link-authentication-h .zonos--input-invalid.sc-zonos-link-authentication{border:2px solid var(--zonos-elements-red-600);border-radius:var(--zonos--border-radius)}";var F=R;var J=51;var q=t("zonos_link_authentication",function(){function t(t){var e=this;n(this,t);this.linkAuthenticationChange=i(this,"linkAuthenticationChange",7);this.storeUnsubscribeList=[];this.defaultEmail=null;this.isEmailError=false;this.stripe=r.stripe;this.isStagingMode=u.isStagingMode;this.clientSecret=r.clientSecret;this.retriesInitializeLink=0;this.setCustomEmailInputToLinkEvent=function(t){var n=P(t);var i={complete:!!n,elementType:"linkAuthentication",empty:!t,value:{email:t}};r.stripeLinkEventData=i};this.handleNormalEmailInput=function(t){var n;var i=t.detail;e.setCustomEmailInputToLinkEvent(i);(n=e.linkAuthenticationChange)===null||n===void 0?void 0:n.emit()}}t.prototype.watchIsStagingMode=function(){var t=this;setTimeout((function(){void t.watchInitStripe()}),0)};t.prototype.watchInitStripe=function(){return __awaiter(this,void 0,void 0,(function(){var t,n,i,e;var o=this;return __generator(this,(function(s){switch(s.label){case 0:if(!this.stripe||!r.stripeElements){return[2]}if(u.isStagingMode||!this.clientSecret){return[2]}t=this.defaultEmail?{email:this.defaultEmail}:undefined;s.label=1;case 1:s.trys.push([1,2,,6]);n=r.stripeLinkElement||r.stripeElements.create("linkAuthentication",{defaultValues:t});i=this.el.querySelector(".zonos--link-authentication-component");if(!i){k("Cannot find container element for linkAuthenticationElement");return[2]}n.mount(i);n.on("change",(function(t){var n;r.stripeLinkEventData=t;(n=o.linkAuthenticationChange)===null||n===void 0?void 0:n.emit()}));r.stripeLinkElement=n;this.retriesInitializeLink=0;if(this.retriesInitializeLink>11){_("Stripe link element initialized","info",{retriesInitializeLink:this.retriesInitializeLink,stripe:this.stripe});void x({endpoint:"stripe-link-authentication-init-long-running",errors:["Stripe link element initialized after 20 retries - 10 seconds"],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}return[3,6];case 2:e=s.sent();if(!(e instanceof Error))return[3,5];this.retriesInitializeLink++;if(!(this.retriesInitializeLink<J))return[3,4];return[4,new Promise((function(t){return setTimeout(t,500)}))];case 3:s.sent();void this.watchInitStripe();s.label=4;case 4:if(this.retriesInitializeLink===J){void x({endpoint:"stripe-link-authentication-init-error",errors:[e.message],metadata:{retriesInitializeLink:this.retriesInitializeLink}})}s.label=5;case 5:return[3,6];case 6:return[2]}}))}))};t.prototype.watchDefaultEmail=function(t,n){var i,e;_("Default email is changed","info",{newDefaultEmail:t,oldDefaultEmail:n});if(n===t){return}if(!t){r.stripeLinkEventData=null}if(u.isStagingMode){this.setCustomEmailInputToLinkEvent(t||"");return}(i=r.stripeLinkElement)===null||i===void 0?void 0:i.clear();(e=r.stripeLinkElement)===null||e===void 0?void 0:e.destroy();r.stripeLinkElement=null;r.stripeLinkEventData=null;_("Reset stripe link element when default email is changed","info",{defaultEmail:t});void this.watchInitStripe()};t.prototype.disconnectedCallback=function(){try{this.storeUnsubscribeList.forEach((function(t){return t()}))}catch(t){}};t.prototype.componentDidLoad=function(){var t=this;this.storeUnsubscribeList=[d("stripeElements",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){void this.watchInitStripe();return[2]}))}))})),d("clientSecret",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.clientSecret=r.clientSecret;return[2]}))}))})),d("stripe",(function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(t){this.stripe=r.stripe;return[2]}))}))}))];void this.watchInitStripe();if(!this.defaultEmail){return}this.setCustomEmailInputToLinkEvent(this.defaultEmail)};t.prototype.render=function(){var t=this;this.isStagingMode=u.isStagingMode;this.clientSecret=r.clientSecret;var n=function(){var n;if(u.isStagingMode){return e("zonos-stripe-input",{inputLabel:v("Email"),inputValue:t.defaultEmail||((n=r.stripeLinkEventData)===null||n===void 0?void 0:n.value.email)||"",isError:t.isEmailError,onBlur:function(){var n;var i=((n=r.stripeLinkEventData)===null||n===void 0?void 0:n.value.email)||"";if(!i){return}var e=P(i);t.isEmailError=!e},onInputChange:t.handleNormalEmailInput})}return e("div",{class:"zonos--link-authentication-component ".concat(t.isEmailError&&"zonos--input-invalid")})};return e(o,{class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":S()}},this.titleText&&e("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),n(),this.isEmailError&&e("zonos-text",{textColor:"red-600"},v("Please enter a valid email address.")))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isStagingMode:["watchIsStagingMode"],stripe:["watchInitStripe"],clientSecret:["watchInitStripe"],defaultEmail:["watchDefaultEmail"]}},enumerable:false,configurable:true});return t}());q.style=F;var G=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:fixed;inset:0;z-index:2147483010;pointer-events:none;display:block}:host .zonos--loading-overlay{position:fixed;inset:0;width:100vw;height:100vh;background:var(--zonos-elements-backdrop-color);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;opacity:0;visibility:hidden;-webkit-transition:opacity 0.3s ease, visibility 0.3s ease;transition:opacity 0.3s ease, visibility 0.3s ease;z-index:2147483010}:host(.zonos--open){pointer-events:auto}:host(.zonos--open) .zonos--loading-overlay{opacity:0.65;visibility:visible}";var U=G;var $=t("zonos_loading_overlay",function(){function t(t){n(this,t);this.open=false;this.size=40}t.prototype.render=function(){return e(o,{key:"13154a3c9250f15d8dca292f0673c6465bfb15e0",class:I(["zonos--elements",this.open&&"zonos--open"])},e("div",{key:"4470fccd21e58bd7959ef3e20c8775ac637cace0",class:"zonos--loading-overlay"},e("zonos-spinner",{key:"5b32b821cea982866da56176eeaafd5d8958f25d",size:this.size,spinnerColor:this.spinnerColor})))};return t}());$.style=U}}}));
@@ -0,0 +1,17 @@
1
+ import{c as e,z as o}from"./p-058f6124.js";import{t as n,y as r,b as t,d as a,v as i,w as s,x as c,z as l,r as u,h as d,E as p}from"./p-e331a235.js";import{t as f,s as y}from"./p-e4d58bd7.js";import{h as v,l as h,j as w}from"./p-41dd1cb8.js";import{i as b}from"./p-def2d465.js";import{l as m}from"./p-0a377722.js";import{s as P}from"./p-4f7d64f6.js";
2
+ /*!
3
+ * paypal-js v8.4.2 (2025-09-04T17:21:30.135Z)
4
+ * Copyright 2020-present, PayPal, Inc. All rights reserved.
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */function j(e,o){void 0===o&&(o={});var n=document.createElement("script");return n.src=e,Object.keys(o).forEach((function(e){n.setAttribute(e,o[e]),"data-csp-nonce"===e&&n.setAttribute("nonce",o["data-csp-nonce"])})),n}function k(e,o){if(void 0===o&&(o=Promise),S(e,o),"undefined"==typeof document)return o.resolve(null);var n=function(e){var o,n,r=e.sdkBaseUrl,t=e.environment,a=function(e,o){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)o.indexOf(r[t])<0&&Object.prototype.propertyIsEnumerable.call(e,r[t])&&(n[r[t]]=e[r[t]])}return n}(e,["sdkBaseUrl","environment"]),i=r||function(e){return"sandbox"===e?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"}(t),s=a,c=Object.keys(s).filter((function(e){return null!=s[e]&&""!==s[e]})).reduce((function(e,o){var n=s[o].toString();return"data"===(o=o.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,o){return(o?"-":"")+e.toLowerCase()}))).substring(0,4)||"crossorigin"===o?e.attributes[o]=n:e.queryParams[o]=n,e}),{queryParams:{},attributes:{}}),l=c.queryParams,u=c.attributes;return l["merchant-id"]&&-1!==l["merchant-id"].indexOf(",")&&(u["data-merchant-id"]=l["merchant-id"],l["merchant-id"]="*"),{url:"".concat(i,"?").concat((o=l,n="",Object.keys(o).forEach((function(e){0!==n.length&&(n+="&"),n+=e+"="+o[e]})),n)),attributes:u}}(e),r=n.url,t=n.attributes,a=t["data-namespace"]||"paypal",i=I(a);return t["data-js-sdk-library"]||(t["data-js-sdk-library"]="paypal-js"),function(e,o){var n=document.querySelector('script[src="'.concat(e,'"]'));if(null===n)return null;var r=j(e,o),t=n.cloneNode();if(delete t.dataset.uidAuto,Object.keys(t.dataset).length!==Object.keys(r.dataset).length)return null;var a=!0;return Object.keys(t.dataset).forEach((function(e){t.dataset[e]!==r.dataset[e]&&(a=!1)})),a?n:null}(r,t)&&i?o.resolve(i):function(e,o){void 0===o&&(o=Promise),S(e,o);var n=e.url,r=e.attributes;if("string"!=typeof n||0===n.length)throw new Error("Invalid url.");if(void 0!==r&&"object"!=typeof r)throw new Error("Expected attributes to be an object.");return new o((function(e,o){if("undefined"==typeof document)return e();!function(e){var o=e.onSuccess,n=e.onError,r=j(e.url,e.attributes);r.onerror=n,r.onload=o,document.head.insertBefore(r,document.head.firstElementChild)}({url:n,attributes:r,onSuccess:function(){return e()},onError:function(){var e=new Error('The script "'.concat(n,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return o(e)}})}))}({url:r,attributes:t},o).then((function(){var e=I(a);if(e)return e;throw new Error("The window.".concat(a," global variable is not available."))}))}function I(e){return window[e]}function S(e,o){if("object"!=typeof e||null===e)throw new Error("Expected an options object.");var n=e.environment;if(n&&"production"!==n&&"sandbox"!==n)throw new Error('The `environment` option must be either "production" or "sandbox".');if(void 0!==o&&"function"!=typeof o)throw new Error("Expected PromisePonyfill to be a function.")}"function"==typeof SuppressedError&&SuppressedError;const{onChange:E,reset:g,state:A}=e((()=>({intent:"capture",orderIdCreated:null,paypal:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}))),O=({checkoutSessionId:e,onPaypalFail:y,onPaypalSessionDone:m,overrideBorderRaidus:j,overridePrimaryColor:k})=>({createOrder:async()=>{n({checkoutSessionId:e,eventName:"checkout_paymentInfoCompleted",metadata:{paymentMethod:"paypal"}});const o=await r();if(!o.valid)return A.paypalErrorMessage=o.errorMessage,t.hasPaymentError=!1,t.customErrorMessage=null,P({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:e}}),null==y||y(),"";try{A.paypalErrorMessage=null,a.inventoryCheckErrorMessage=null;try{a.inventoryCheckErrorMessage=await i()}catch(e){a.inventoryCheckErrorMessage=f("Unable to check inventory. Please try again.")}if(a.inventoryCheckErrorMessage)return"";if(p()>0){const e=await s();if(!e.success)return A.paypalErrorMessage=e.error||f("Unable to apply store credit. Please try again."),null==y||y(),""}if(c()){const e=await l();return e.success?(null==m||m({orderId:e.orderId||""}),u(),d(),""):(A.paypalErrorMessage=e.error||f("Unable to place order with store credit. Please try again."),null==y||y(),"")}return await(async({checkoutSessionId:e})=>{var o,n;const r=A.intent.toUpperCase(),{errors:t,json:a}=await(async({checkoutSessionId:e,intent:o})=>{const{errors:n,json:r}=await v("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:e,intent:o},method:"POST"});return{errors:n,json:r}})({checkoutSessionId:e,intent:r}),i=null===(o=null==a?void 0:a.paypalOrderCreate)||void 0===o?void 0:o.paypalOrderId;if(t.length||!i)throw new Error((null===(n=t.find(Boolean))||void 0===n?void 0:n.message)||"An unexpected error occurred when creating paypal order.");return i})({checkoutSessionId:e})}catch(o){return h("Failed to create paypal order",o),A.paypalErrorMessage=f("Failed to create PayPal order. Please try again, or consider using an alternative method."),t.hasPaymentError=!1,t.customErrorMessage=null,P({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:e}}),null==y||y(),""}},onApprove:async()=>{try{A.paypalErrorMessage=null,P({event:"zonos-checkout-payment-info",metadata:{checkoutSessionId:e,paymentMethod:"paypal"}});const o=await(async({checkoutSessionId:e,paypalMockResponse:o})=>{var n,r;const{errors:t,json:a}=await(async({checkoutSessionId:e,paypalMockResponse:o})=>{const{errors:n,json:r}=await v("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:e,paypalMockResponse:o},method:"POST"});return{errors:n,json:r}})({checkoutSessionId:e,paypalMockResponse:o}),i=null===(n=null==a?void 0:a.paypalOrderCapture.order)||void 0===n?void 0:n.id;if(t.length||!i)throw new Error((null===(r=t.find(Boolean))||void 0===r?void 0:r.message)||f("An unexpected error occurred when processing PayPal order."));return i})({checkoutSessionId:e,paypalMockResponse:window.Zonos._paypalMockResponse});A.orderIdCreated=o,null==m||m({orderId:o}),u(),d()}catch(e){if(h("==== Failed to capture paypal order",e),e instanceof Error)return(({error:e})=>{var o;const n=w(e.message),r=null===(o=null==n?void 0:n.errors.find(Boolean))||void 0===o?void 0:o.message,t=(null==r?void 0:r.match(/\[(.*?)\] (.*)/i))||[];t||(A.paypalErrorMessage=f("An unexpected error occurred when processing PayPal order."));const a=t[2]||f("An unexpected error occurred when processing PayPal order.");A.paypalErrorMessage=a})({error:e});null==y||y()}},style:{borderRadius:"SHARP"===j?0:10,color:b({backgroundColor1:"#ffc33a",backgroundColor2:k||o.appearance.colorPrimary||""})?"gold":"blue",shape:"rect"}}),x=async({currency:e})=>{var n;if(!(null===(n=o.checkoutSettings.externalPaymentMethods)||void 0===n?void 0:n.find((e=>"PAYPAL"===e.type&&"ENABLED"===e.status))))return void m("=== Paypal is disabled for this store","warn");const r=o.checkoutSettings.externalServiceTokens.find((e=>"PAYPAL_CLIENT_ID"===e.type));if(!r)return void m("Failed to load paypal -- missing paypal publishable key","warn");const t=o.zonosMode&&"production"!==o.zonosMode||"LIVE"!==o.checkoutSettings.mode?"sandbox":"production";A.intent=o.checkoutSettings.captureDelay&&o.checkoutSettings.captureDelay>0?"authorize":"capture",m("==== Paypal order intent","info",A.intent),window.Zonos.paypal=await k({clientId:r.token,currency:e,environment:t,intent:A.intent}),A.paypal=window.Zonos.paypal,m("==== Paypal script loaded")},B=e=>{var o;const n=window.Zonos.paypal;if(!n)return m("Paypal is not available"),null;const r=y.checkoutSessionId;if(!r)return m("Paypal is not available due to checkoutSessionId is not available"),null;m("==== Loading Paypal buttons"),A.paypalButtons.length&&(A.paypalButtons.forEach((async e=>{await e.close()})),A.paypalButtons=[]);const t=[null===(o=n.FUNDING)||void 0===o?void 0:o.PAYPAL].filter(Boolean);return A.paypalButtons=t.map((o=>{var t;let a=null;try{a=(null===(t=n.Buttons)||void 0===t?void 0:t.call(n,Object.assign(Object.assign({},O(Object.assign({checkoutSessionId:r,fundingSource:o},e))),{fundingSource:o})))||null}catch(e){m(`===== Failed to load paypal's "${o}" button`,"warn",e)}return(null==a?void 0:a.isEligible())?(m(`==== Paypal button ${o} loaded`),a):null})).filter(Boolean),A.paypalButtons},z=()=>{var e,n;return"ENABLED"===(null===(n=null===(e=o.checkoutSettings.externalPaymentMethods)||void 0===e?void 0:e.find((e=>"PAYPAL"===e.type)))||void 0===n?void 0:n.status)||!!A.paypalButtons.length};export{A as a,x as b,g as c,B as d,E as e,z as p}
@@ -1 +1 @@
1
- import{r as o,d as e,h as t,F as s,a as i}from"./p-ce75b047.js";import{l as n,t as a,d as l}from"./p-507f00d2.js";import{z as r}from"./p-058f6124.js";import{c as d}from"./p-b4b7f705.js";import{f as h}from"./p-a87561b8.js";import{h as c,T as m,D as g}from"./p-f8f7d491.js";import{g as f}from"./p-5883217a.js";import{e as u}from"./p-6b361d2b.js";import"./p-41dd1cb8.js";import"./p-0a377722.js";const b=({href:o,text:e})=>`<zonos-link href="${o}" target="_blank" rel="noopener noreferrer">${e}</zonos-link>`,p='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.35028 11.5744C9.05738 11.2815 8.58251 11.2815 8.28962 11.5744C7.99672 11.8673 7.99672 12.3422 8.28962 12.635L11.2917 15.6372C11.6823 16.0277 12.3154 16.0277 12.7059 15.6372L15.708 12.6351C16.0009 12.3422 16.0009 11.8674 15.708 11.5745C15.4151 11.2816 14.9402 11.2816 14.6473 11.5745L12.7488 13.4729V4.68005C12.7488 4.26584 12.413 3.93005 11.9988 3.93005C11.5846 3.93005 11.2488 4.26584 11.2488 4.68005L11.2488 13.4729L9.35028 11.5744Z" fill="#4D505A"/>\n<path d="M20 14C20 13.5858 19.6642 13.25 19.25 13.25C18.8358 13.25 18.5 13.5858 18.5 14L18.5 17.25C18.5 17.9404 17.9404 18.5 17.25 18.5L6.75 18.5C6.05964 18.5 5.5 17.9404 5.5 17.25L5.5 14C5.5 13.5858 5.16421 13.25 4.75 13.25C4.33579 13.25 4 13.5858 4 14V17.25C4 18.7688 5.23122 20 6.75 20H17.25C18.7688 20 20 18.7688 20 17.25L20 14Z" fill="#4D505A"/>\n</svg>\n',z='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M4.04505 6.64123C2.19006 8.49622 2.19006 11.5038 4.04505 13.3587L11.2929 20.6066C11.6834 20.9971 12.3166 20.9971 12.7071 20.6066L19.955 13.3587C21.8099 11.5038 21.8099 8.49622 19.955 6.64123L17.8336 4.51991C17.4431 4.12939 16.8099 4.12939 16.4194 4.51991L13.5241 7.41527C12.5864 6.86157 11.4136 6.86157 10.4759 7.41527L7.58059 4.51991C7.19006 4.12939 6.5569 4.12939 6.16637 4.51991L4.04505 6.64123ZM5.10571 12.2981C3.83651 11.0289 3.83651 8.9711 5.10571 7.70189L6.87348 5.93413L9.70191 8.76255C10.1056 9.16622 10.6991 9.12 11.0641 8.82749C11.6091 8.39083 12.3909 8.39082 12.9359 8.82749C13.301 9.12 13.8944 9.16622 14.2981 8.76255L17.1265 5.93413L18.8943 7.70189C20.1635 8.9711 20.1635 11.0289 18.8943 12.2981L12 19.1924L5.10571 12.2981Z"\n fill="#0F1015" />\n <path\n d="M10.0333 3.28075C9.63566 3.39679 9.40739 3.8132 9.52343 4.21083C9.63947 4.60846 10.0559 4.83673 10.4535 4.72069C11.4618 4.42644 12.5383 4.42644 13.5466 4.72069C13.9442 4.83673 14.3606 4.60846 14.4766 4.21083C14.5927 3.81321 14.3644 3.39679 13.9668 3.28075C12.6841 2.90642 11.316 2.90642 10.0333 3.28075Z"\n fill="#0F1015" />\n</svg>',w='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.16666 5.83301C2.16666 4.4523 3.28594 3.33301 4.66666 3.33301H16.3333C17.714 3.33301 18.8333 4.4523 18.8333 5.83301V14.1663C18.8333 15.5471 17.714 16.6663 16.3333 16.6663H4.66666C3.28594 16.6663 2.16666 15.5471 2.16666 14.1663V5.83301ZM4.66666 4.99967C4.20642 4.99967 3.83332 5.37277 3.83332 5.83301V14.1663C3.83332 14.6266 4.20642 14.9997 4.66666 14.9997H16.3333C16.7936 14.9997 17.1667 14.6266 17.1667 14.1663V5.83301C17.1667 5.37277 16.7936 4.99967 16.3333 4.99967H4.66666ZM6.33332 8.33301C6.79356 8.33301 7.16666 8.7061 7.16666 9.16634V10.833C7.16666 11.2932 6.79356 11.6663 6.33332 11.6663C5.87309 11.6663 5.49999 11.2932 5.49999 10.833V9.16634C5.49999 8.7061 5.87309 8.33301 6.33332 8.33301ZM8.83332 9.99967C8.83332 9.0792 9.57952 8.33301 10.5 8.33301C11.4205 8.33301 12.1667 9.0792 12.1667 9.99967C12.1667 10.9201 11.4205 11.6663 10.5 11.6663C9.57952 11.6663 8.83332 10.9201 8.83332 9.99967ZM14.6667 8.33301C15.1269 8.33301 15.5 8.7061 15.5 9.16634V10.833C15.5 11.2932 15.1269 11.6663 14.6667 11.6663C14.2064 11.6663 13.8333 11.2932 13.8333 10.833V9.16634C13.8333 8.7061 14.2064 8.33301 14.6667 8.33301Z" fill="#4D505A"/>\n</svg>\n',x=class{constructor(i){o(this,i),this.closeDialog=e(this,"closeDialog",7),this.isOpen=!1,this.setIsOpen=()=>{},this.restrictedItems=[],this.welcomeMessage="Welcome to our Demo App!",this.showCountrySelect=!1,this.showLanguageSelect=!1,this.clickOutsideDialogHandler=o=>{!o.composedPath().includes(this.dialogRef)&&this.isOpen&&this.setIsOpen(!1)},this.getCurrentPageEnum=()=>{switch(r.currentHelloPage){case"home":return"hello_homepage";case"cart":return"hello_cart";case"productList":return"hello_item_list";case"productDetail":return"hello_item_details";default:return null}},this.setShowCountrySelect=async o=>{this.showCountrySelect=o},this.setShowLanguageSelect=async o=>{this.showLanguageSelect=o},this.hasTaxId=()=>{var o;return null===(o=n.countryLandedCost)||void 0===o?void 0:o.hasTaxId},this.isNoThresholdCountry=o=>!(!o||!this.hasTaxId())&&["AU","NZ","GB","NO","SG",...u].includes(o),this.getDutyMessage=()=>{const o=n.countryLandedCost;if(!(null==o?void 0:o.allowLowValueOrders)&&"GB"===(null==o?void 0:o.countryCode))return a("Duties will apply to all orders.");const e=(null==o?void 0:o.dutyDeminimus)?l({amount:o.dutyDeminimus}):null;return e?a("Spend up to [threshold] duty free.",{threshold:e}):a("Duties will apply to all orders.")},this.getTaxMessage=()=>{const{countryLandedCost:o}=n;if(!(null==o?void 0:o.allowLowValueOrders)&&"GB"===(null==o?void 0:o.countryCode))return a("Taxes will apply to all orders.");const e=(null==o?void 0:o.vatTaxDeminimus)?l({amount:o.vatTaxDeminimus}):null;return e&&!this.isNoThresholdCountry(null==o?void 0:o.countryCode)?a("Spend up to [threshold] tax free.",{threshold:e}):a("Taxes will apply to all orders.")},this.getEuDutyTaxMessage=o=>[`${a("Due to the IOSS tax law, all orders will be assessed at [percentage] VAT regardless of order total.",{percentage:100*o.vatTaxRate+"%"})} ${b({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/european-ioss",text:a("Learn more.")})}`],this.getUkDutyTaxMessage=o=>o.allowLowValueOrders?[`${a("Due to the UK tax law, all orders will be assessed at [percentage] VAT regardless of order total.",{percentage:100*o.vatTaxRate+"%"})} ${b({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/european-ioss",text:a("Learn more.")})}`]:[a("Orders to [countryName] must be over [threshold] to ship.",{countryName:"United Kingdom",threshold:l({amount:o.dutyDeminimus})})],this.getAustraliaDutyTaxMessage=o=>c()?[]:[`${a("Due to the Australia tax law, all orders will be assessed at [percentage] GST regardless of order total.",{percentage:100*o.vatTaxRate+"%"})} ${b({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/australia-gst",text:a("Learn more.")})}`],this.getNewZealandDutyTaxMessge=o=>c()?null:[`${a("Due to the New Zealand tax law, all orders will be assessed at [percentage] GST regardless of order total.",{percentage:100*o.vatTaxRate+"%"})} ${b({href:"https://zonos.com/docs/guides/country-guides/new-zealand/new-zealand-import-taxes",text:a("Learn more.")})}`],this.getNorwayDutyTaxMessage=o=>c()?null:[`${a("Due to the VOEC tax law, all orders will be assessed at [percentage] VAT regardless of order total.",{percentage:100*o.vatTaxRate+"%"})} ${b({href:"https://zonos.com/docs/guides/country-guides/norway-voec-scheme",text:a("Learn more.")})}`],this.getSingaporeDutyTaxMessage=o=>c()?null:[`${a("Due to the Singapore tax law, all orders will be assessed at [percentage] GST regardless of order total.",{percentage:100*o.vatTaxRate+"%"})} ${b({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/singapore-gst-settings",text:a("Learn more.")})}`],this.getInclusivePriceMessage=()=>{const o=n.inclusivePricingConfigurations,e=null==o?void 0:o.find(Boolean),t=null==e?void 0:e.configurations[m],s=null==e?void 0:e.configurations[g];return"DISABLED"===(null==t?void 0:t.status)&&"DISABLED"===(null==s?void 0:s.status)?null:"ENABLED"===(null==s?void 0:s.status)&&"ENABLED"===(null==t?void 0:t.status)?{inclusiveType:"DUTIES_TAXES_AND_FEES",message:a("Product prices already include duties, taxes and fees. No additional duties, taxes, or fees will be added at checkout.")}:"ENABLED"===(null==s?void 0:s.status)?{inclusiveType:"DUTIES_FEES",message:a("Product prices already include duties and fees. No additional duties or fees will be added at checkout.")}:"ENABLED"===(null==t?void 0:t.status)?{inclusiveType:"TAXES",message:a("Product prices already include taxes. No additional taxes will be added at checkout.")}:null},this.renderHelloMessage=()=>{const o=this.getDutyMessage(),e=this.getTaxMessage(),i=this.getInclusivePriceMessage();if(c()&&i)switch(i.inclusiveType){case"DUTIES_FEES":return t(s,null,i.message&&t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty inclusive pricing icon",content:z}),t("zonos-text",{"aria-label":"Duty inclusive pricing message"},i.message)),e&&t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Tax de minimis icon",content:w}),t("zonos-text",{"aria-label":"Tax de minimis message"},e)));case"TAXES":return t(s,null,i.message&&t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Tax inclusive pricing icon",content:z}),t("zonos-text",{"aria-label":"Tax inclusive pricing message"},i.message)),o&&t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty de minimis icon",content:p}),t("zonos-text",{"aria-label":"Duty de minimis message"},o)));default:return t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty de minimis",content:z}),t("zonos-text",null,i.message))}return t(s,null,o&&t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty de minimis icon",content:p}),t("zonos-text",{"aria-label":"Duty de minimis message"},o)),e&&t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Tax de minimis icon",content:w}),t("zonos-text",{"aria-label":"Tax de minimis message"},e)))},this.getAdditionalDutyTaxMessage=()=>{if(!n.countryLandedCost)return null;if(!this.hasTaxId())return null;switch(n.countryLandedCost.countryCode){case"GB":return this.getUkDutyTaxMessage(n.countryLandedCost);case"AU":return this.getAustraliaDutyTaxMessage(n.countryLandedCost);case"NZ":return this.getNewZealandDutyTaxMessge(n.countryLandedCost);case"NO":return this.getNorwayDutyTaxMessage(n.countryLandedCost);case"SG":return this.getSingaporeDutyTaxMessage(n.countryLandedCost);default:return u.includes(n.countryLandedCost.countryCode)?this.getEuDutyTaxMessage(n.countryLandedCost):null}}}globalClickHandler(o){this.clickOutsideDialogHandler(o)}isOpenHandler(o){o||(this.setShowCountrySelect(!1),this.setShowLanguageSelect(!1))}render(){var o;const{selectedCountryCode:e}=n,s=this.getAdditionalDutyTaxMessage(),l=this.animateFromLeftOverride||this.dialogRef&&f(this.dialogRef),c=this.dialogRef&&(()=>{const o=this.dialogRef.getBoundingClientRect();return o.top>=window.innerHeight-o.bottom})(),{customMessages:m}=n,g=a("Welcome to [storeName]",{storeName:r.organizationName}),u=(null===(o=m.find((o=>"hello_default"===o.pageName)))||void 0===o?void 0:o.message)||a("Know about duties and taxes before you buy. Shop with confidence!"),b=h(u),p=this.getCurrentPageEnum(),z=m.filter((o=>o.pageName===p));return t(i,{key:"9012938ffc3ab002bac78479cbcf4063526cf562",class:"zonos--elements"},t("div",{key:"ec6c5429694e4d18abf240c5de950b0da33ca846",class:d(["zonos--hello-dialog",l&&"zonos--hello-dialog-animate-from-left",c&&"zonos--hello-dialog-animate-from-bottom",!!this.mobileLocationOverride&&"zonos--hello-dialog-mobile-override",this.isOpen&&"zonos--hello-dialog-open"]),inert:!this.isOpen,ref:o=>o&&(this.dialogRef=o)},!this.showCountrySelect&&!this.showLanguageSelect&&t("div",{key:"cb64ca4f4474e06f728eec751f3c7c7fae578d26"},t("div",{key:"c062c2482ef59df6ef60e7ccfb1716cc0cf2a19d",class:"zonos--hello-dialog-content"},t("zonos-button",{key:"c36de505068bd2c4b520a20ca7110a7bd46e749d",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close Zonos Hello dialog",content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>'}),noBackground:!0,onClick:()=>this.setIsOpen(!1)}),t("zonos-v-stack",{key:"85d246bab229099324507799eb8f771795ea92e0",spacing:24},t("zonos-country-flag",{key:"602b68614bdee4120900ed184941adc4ffa40619",class:"zonos--hello-country-flag",countryCode:e}),t("zonos-v-stack",{key:"3994f7ec81cfe691f6b5f8ce83391922966a7700",class:"zonos--hello-dialog-header",spacing:4},t("zonos-text",{key:"48c7e9bf22dd30eb089b7b25a99d908dbed5966f",type:"boldSubheader"},g),t("zonos-text",{key:"d590b3ed499b456134720ef73a965a5a552da80f",innerHTML:b,textColor:"gray-800"})),t("zonos-v-stack",{key:"8bce397c8522031d46b8e6efc38986af5645c3ee",spacing:8},this.restrictedItems.map((o=>{var e;return o&&t("zonos-banner",{bannerTitle:o.name,intent:"error"},null===(e=o.itemRestrictions)||void 0===e?void 0:e.map((o=>t("zonos-text",{textColor:"red-800"},null==o?void 0:o.note))))})),t("zonos-card",{key:"0772e7dc4499423f3a379a2cfc0b28dd23ec137e",spacing:"12px"},t("zonos-v-stack",{key:"ea421af6bc847eaece471f557d2d0ee1815d14bf",spacing:12},this.renderHelloMessage(),null==s?void 0:s.map((o=>t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Additional information for buying goods from selected country icon",content:'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>\n</svg>\n'}),t("zonos-text",{"aria-label":"Additional information for buying goods from selected country message",innerHTML:o})))))),z.map((o=>t("zonos-custom-message",{icon:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n',message:o.message})))))),t("zonos-hello-dialog-footer",{key:"6eed9e71407e1351053abd4a2e1b4aae75b12044",appearanceSettings:this.appearanceSettings,setShowCountrySelect:o=>this.setShowCountrySelect(o),setShowLanguageSelect:o=>this.setShowLanguageSelect(o)})),this.showCountrySelect&&t("div",{key:"cb9d77a61c481100fe21714bec8d062ffaa8f974"},t("zonos-country-select",{key:"d76ad3cdc005561e19d64502d4c2f02173929c22",handleOnClose:()=>this.setShowCountrySelect(!1)})),this.showLanguageSelect&&t("div",{key:"f9bbf877aba822b04676039d07ebb752d07fd362"},t("zonos-language-select",{key:"3d96dd6902003adf96a2ce73f0405e112a04b380",handleOnClose:()=>this.setShowLanguageSelect(!1)}))))}static get assetsDirs(){return["assets"]}static get watchers(){return{isOpen:["isOpenHandler"]}}};x.style=":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--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-dialog{position:absolute;background:var(--zonos-elements-surface-color);width:100vw;max-width:430px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-height:600px;border-radius:var(--zonos-elements-radius-12);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);overflow-y:auto;top:-2px;right:-2px;opacity:0;-webkit-transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:top right;transform-origin:top right;z-index:2147483647}:host .zonos--hello-dialog .zonos--hello-dialog-header{text-align:center}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:top left;transform-origin:top left;right:unset;left:-2px}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom{-webkit-transform-origin:bottom right;transform-origin:bottom right;bottom:0;top:unset}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom left;transform-origin:bottom left}:host .zonos--hello-dialog::-webkit-scrollbar{width:12px;height:12px}:host .zonos--hello-dialog::-webkit-scrollbar-track{background:#f5f5f5;border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--hello-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#ccc;border:4px solid transparent;background-clip:content-box}:host .zonos--hello-dialog::-webkit-scrollbar-thumb:hover{background:#999}:host .zonos--hello-dialog .zonos--animate-content{opacity:0;height:0;-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}:host .zonos--hello-dialog .zonos--show-animate-content{opacity:1;height:100%}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .zonos--hello-dialog .zonos--close-button{position:absolute;right:8px;top:8px;width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;z-index:10}:host .zonos--hello-dialog .zonos--close-button:hover{background:var(--zonos-elements-hover-color);border-radius:var(--zonos-elements-radius-6)}:host .zonos--hello-dialog .zonos--hello-dialog-content{padding:16px}:host .zonos--hello-dialog .zonos--hello-dialog-content .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:32px;height:24px}:host .zonos--hello-dialog .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:12px}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}@media (max-height: 600px){:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{max-height:80vh}}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}@media (max-width: 768px){:host .zonos--hello-dialog{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px) and (max-height: 600px){:host .zonos--hello-dialog{max-height:80vh}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}";export{x as zonos_hello_dialog}
1
+ import{r as o,d as e,h as t,F as s,a as i}from"./p-ce75b047.js";import{l as n,t as a,d as l}from"./p-e4d58bd7.js";import{z as r}from"./p-058f6124.js";import{c as d}from"./p-b4b7f705.js";import{f as h}from"./p-a87561b8.js";import{h as c,T as m,D as g}from"./p-1e6509d7.js";import{g as u}from"./p-5883217a.js";import{e as f}from"./p-6b361d2b.js";import"./p-41dd1cb8.js";import"./p-0a377722.js";const b=({href:o,text:e})=>`<zonos-link href="${o}" target="_blank" rel="noopener noreferrer">${e}</zonos-link>`,p='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.35028 11.5744C9.05738 11.2815 8.58251 11.2815 8.28962 11.5744C7.99672 11.8673 7.99672 12.3422 8.28962 12.635L11.2917 15.6372C11.6823 16.0277 12.3154 16.0277 12.7059 15.6372L15.708 12.6351C16.0009 12.3422 16.0009 11.8674 15.708 11.5745C15.4151 11.2816 14.9402 11.2816 14.6473 11.5745L12.7488 13.4729V4.68005C12.7488 4.26584 12.413 3.93005 11.9988 3.93005C11.5846 3.93005 11.2488 4.26584 11.2488 4.68005L11.2488 13.4729L9.35028 11.5744Z" fill="#4D505A"/>\n<path d="M20 14C20 13.5858 19.6642 13.25 19.25 13.25C18.8358 13.25 18.5 13.5858 18.5 14L18.5 17.25C18.5 17.9404 17.9404 18.5 17.25 18.5L6.75 18.5C6.05964 18.5 5.5 17.9404 5.5 17.25L5.5 14C5.5 13.5858 5.16421 13.25 4.75 13.25C4.33579 13.25 4 13.5858 4 14V17.25C4 18.7688 5.23122 20 6.75 20H17.25C18.7688 20 20 18.7688 20 17.25L20 14Z" fill="#4D505A"/>\n</svg>\n',z='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M4.04505 6.64123C2.19006 8.49622 2.19006 11.5038 4.04505 13.3587L11.2929 20.6066C11.6834 20.9971 12.3166 20.9971 12.7071 20.6066L19.955 13.3587C21.8099 11.5038 21.8099 8.49622 19.955 6.64123L17.8336 4.51991C17.4431 4.12939 16.8099 4.12939 16.4194 4.51991L13.5241 7.41527C12.5864 6.86157 11.4136 6.86157 10.4759 7.41527L7.58059 4.51991C7.19006 4.12939 6.5569 4.12939 6.16637 4.51991L4.04505 6.64123ZM5.10571 12.2981C3.83651 11.0289 3.83651 8.9711 5.10571 7.70189L6.87348 5.93413L9.70191 8.76255C10.1056 9.16622 10.6991 9.12 11.0641 8.82749C11.6091 8.39083 12.3909 8.39082 12.9359 8.82749C13.301 9.12 13.8944 9.16622 14.2981 8.76255L17.1265 5.93413L18.8943 7.70189C20.1635 8.9711 20.1635 11.0289 18.8943 12.2981L12 19.1924L5.10571 12.2981Z"\n fill="#0F1015" />\n <path\n d="M10.0333 3.28075C9.63566 3.39679 9.40739 3.8132 9.52343 4.21083C9.63947 4.60846 10.0559 4.83673 10.4535 4.72069C11.4618 4.42644 12.5383 4.42644 13.5466 4.72069C13.9442 4.83673 14.3606 4.60846 14.4766 4.21083C14.5927 3.81321 14.3644 3.39679 13.9668 3.28075C12.6841 2.90642 11.316 2.90642 10.0333 3.28075Z"\n fill="#0F1015" />\n</svg>',w='<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.16666 5.83301C2.16666 4.4523 3.28594 3.33301 4.66666 3.33301H16.3333C17.714 3.33301 18.8333 4.4523 18.8333 5.83301V14.1663C18.8333 15.5471 17.714 16.6663 16.3333 16.6663H4.66666C3.28594 16.6663 2.16666 15.5471 2.16666 14.1663V5.83301ZM4.66666 4.99967C4.20642 4.99967 3.83332 5.37277 3.83332 5.83301V14.1663C3.83332 14.6266 4.20642 14.9997 4.66666 14.9997H16.3333C16.7936 14.9997 17.1667 14.6266 17.1667 14.1663V5.83301C17.1667 5.37277 16.7936 4.99967 16.3333 4.99967H4.66666ZM6.33332 8.33301C6.79356 8.33301 7.16666 8.7061 7.16666 9.16634V10.833C7.16666 11.2932 6.79356 11.6663 6.33332 11.6663C5.87309 11.6663 5.49999 11.2932 5.49999 10.833V9.16634C5.49999 8.7061 5.87309 8.33301 6.33332 8.33301ZM8.83332 9.99967C8.83332 9.0792 9.57952 8.33301 10.5 8.33301C11.4205 8.33301 12.1667 9.0792 12.1667 9.99967C12.1667 10.9201 11.4205 11.6663 10.5 11.6663C9.57952 11.6663 8.83332 10.9201 8.83332 9.99967ZM14.6667 8.33301C15.1269 8.33301 15.5 8.7061 15.5 9.16634V10.833C15.5 11.2932 15.1269 11.6663 14.6667 11.6663C14.2064 11.6663 13.8333 11.2932 13.8333 10.833V9.16634C13.8333 8.7061 14.2064 8.33301 14.6667 8.33301Z" fill="#4D505A"/>\n</svg>\n',x=class{constructor(i){o(this,i),this.closeDialog=e(this,"closeDialog",7),this.isOpen=!1,this.setIsOpen=()=>{},this.restrictedItems=[],this.welcomeMessage="Welcome to our Demo App!",this.showCountrySelect=!1,this.showLanguageSelect=!1,this.clickOutsideDialogHandler=o=>{!o.composedPath().includes(this.dialogRef)&&this.isOpen&&this.setIsOpen(!1)},this.getCurrentPageEnum=()=>{switch(r.currentHelloPage){case"home":return"hello_homepage";case"cart":return"hello_cart";case"productList":return"hello_item_list";case"productDetail":return"hello_item_details";default:return null}},this.setShowCountrySelect=async o=>{this.showCountrySelect=o},this.setShowLanguageSelect=async o=>{this.showLanguageSelect=o},this.hasTaxId=()=>{var o;return null===(o=n.countryLandedCost)||void 0===o?void 0:o.hasTaxId},this.isNoThresholdCountry=o=>!(!o||!this.hasTaxId())&&["AU","NZ","GB","NO","SG",...f].includes(o),this.getDutyMessage=()=>{const o=n.countryLandedCost;if(!(null==o?void 0:o.allowLowValueOrders)&&"GB"===(null==o?void 0:o.countryCode))return a("Duties will apply to all orders.");const e=(null==o?void 0:o.dutyDeminimus)?l({amount:o.dutyDeminimus}):null;return e?a("Spend up to [threshold] duty free.",{threshold:e}):a("Duties will apply to all orders.")},this.getTaxMessage=()=>{const{countryLandedCost:o}=n;if(!(null==o?void 0:o.allowLowValueOrders)&&"GB"===(null==o?void 0:o.countryCode))return a("Taxes will apply to all orders.");const e=(null==o?void 0:o.vatTaxDeminimus)?l({amount:o.vatTaxDeminimus}):null;return e&&!this.isNoThresholdCountry(null==o?void 0:o.countryCode)?a("Spend up to [threshold] tax free.",{threshold:e}):a("Taxes will apply to all orders.")},this.getEuDutyTaxMessage=o=>[`${a("Due to the IOSS tax law, all orders will be assessed at [percentage] VAT regardless of order total.",{percentage:100*o.vatTaxRate+"%"})} ${b({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/european-ioss",text:a("Learn more.")})}`],this.getUkDutyTaxMessage=o=>o.allowLowValueOrders?[`${a("Due to the UK tax law, all orders will be assessed at [percentage] VAT regardless of order total.",{percentage:100*o.vatTaxRate+"%"})} ${b({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/european-ioss",text:a("Learn more.")})}`]:[a("Orders to [countryName] must be over [threshold] to ship.",{countryName:"United Kingdom",threshold:l({amount:o.dutyDeminimus})})],this.getAustraliaDutyTaxMessage=o=>c()?[]:[`${a("Due to the Australia tax law, all orders will be assessed at [percentage] GST regardless of order total.",{percentage:100*o.vatTaxRate+"%"})} ${b({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/australia-gst",text:a("Learn more.")})}`],this.getNewZealandDutyTaxMessge=o=>c()?null:[`${a("Due to the New Zealand tax law, all orders will be assessed at [percentage] GST regardless of order total.",{percentage:100*o.vatTaxRate+"%"})} ${b({href:"https://zonos.com/docs/guides/country-guides/new-zealand/new-zealand-import-taxes",text:a("Learn more.")})}`],this.getNorwayDutyTaxMessage=o=>c()?null:[`${a("Due to the VOEC tax law, all orders will be assessed at [percentage] VAT regardless of order total.",{percentage:100*o.vatTaxRate+"%"})} ${b({href:"https://zonos.com/docs/guides/country-guides/norway-voec-scheme",text:a("Learn more.")})}`],this.getSingaporeDutyTaxMessage=o=>c()?null:[`${a("Due to the Singapore tax law, all orders will be assessed at [percentage] GST regardless of order total.",{percentage:100*o.vatTaxRate+"%"})} ${b({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/singapore-gst-settings",text:a("Learn more.")})}`],this.getInclusivePriceMessage=()=>{const o=n.inclusivePricingConfigurations,e=null==o?void 0:o.find(Boolean),t=null==e?void 0:e.configurations[m],s=null==e?void 0:e.configurations[g];return"DISABLED"===(null==t?void 0:t.status)&&"DISABLED"===(null==s?void 0:s.status)?null:"ENABLED"===(null==s?void 0:s.status)&&"ENABLED"===(null==t?void 0:t.status)?{inclusiveType:"DUTIES_TAXES_AND_FEES",message:a("Product prices already include duties, taxes and fees. No additional duties, taxes, or fees will be added at checkout.")}:"ENABLED"===(null==s?void 0:s.status)?{inclusiveType:"DUTIES_FEES",message:a("Product prices already include duties and fees. No additional duties or fees will be added at checkout.")}:"ENABLED"===(null==t?void 0:t.status)?{inclusiveType:"TAXES",message:a("Product prices already include taxes. No additional taxes will be added at checkout.")}:null},this.renderHelloMessage=()=>{const o=this.getDutyMessage(),e=this.getTaxMessage(),i=this.getInclusivePriceMessage();if(c()&&i)switch(i.inclusiveType){case"DUTIES_FEES":return t(s,null,i.message&&t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty inclusive pricing icon",content:z}),t("zonos-text",{"aria-label":"Duty inclusive pricing message"},i.message)),e&&t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Tax de minimis icon",content:w}),t("zonos-text",{"aria-label":"Tax de minimis message"},e)));case"TAXES":return t(s,null,i.message&&t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Tax inclusive pricing icon",content:z}),t("zonos-text",{"aria-label":"Tax inclusive pricing message"},i.message)),o&&t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty de minimis icon",content:p}),t("zonos-text",{"aria-label":"Duty de minimis message"},o)));default:return t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty de minimis",content:z}),t("zonos-text",null,i.message))}return t(s,null,o&&t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty de minimis icon",content:p}),t("zonos-text",{"aria-label":"Duty de minimis message"},o)),e&&t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Tax de minimis icon",content:w}),t("zonos-text",{"aria-label":"Tax de minimis message"},e)))},this.getAdditionalDutyTaxMessage=()=>{if(!n.countryLandedCost)return null;if(!this.hasTaxId())return null;switch(n.countryLandedCost.countryCode){case"GB":return this.getUkDutyTaxMessage(n.countryLandedCost);case"AU":return this.getAustraliaDutyTaxMessage(n.countryLandedCost);case"NZ":return this.getNewZealandDutyTaxMessge(n.countryLandedCost);case"NO":return this.getNorwayDutyTaxMessage(n.countryLandedCost);case"SG":return this.getSingaporeDutyTaxMessage(n.countryLandedCost);default:return f.includes(n.countryLandedCost.countryCode)?this.getEuDutyTaxMessage(n.countryLandedCost):null}}}globalClickHandler(o){this.clickOutsideDialogHandler(o)}isOpenHandler(o){o||(this.setShowCountrySelect(!1),this.setShowLanguageSelect(!1))}render(){var o;const{selectedCountryCode:e}=n,s=this.getAdditionalDutyTaxMessage(),l=this.animateFromLeftOverride||this.dialogRef&&u(this.dialogRef),c=this.dialogRef&&(()=>{const o=this.dialogRef.getBoundingClientRect();return o.top>=window.innerHeight-o.bottom})(),{customMessages:m}=n,g=a("Welcome to [storeName]",{storeName:r.organizationName}),f=(null===(o=m.find((o=>"hello_default"===o.pageName)))||void 0===o?void 0:o.message)||a("Know about duties and taxes before you buy. Shop with confidence!"),b=h(f),p=this.getCurrentPageEnum(),z=m.filter((o=>o.pageName===p));return t(i,{key:"9012938ffc3ab002bac78479cbcf4063526cf562",class:"zonos--elements"},t("div",{key:"ec6c5429694e4d18abf240c5de950b0da33ca846",class:d(["zonos--hello-dialog",l&&"zonos--hello-dialog-animate-from-left",c&&"zonos--hello-dialog-animate-from-bottom",!!this.mobileLocationOverride&&"zonos--hello-dialog-mobile-override",this.isOpen&&"zonos--hello-dialog-open"]),inert:!this.isOpen,ref:o=>o&&(this.dialogRef=o)},!this.showCountrySelect&&!this.showLanguageSelect&&t("div",{key:"cb64ca4f4474e06f728eec751f3c7c7fae578d26"},t("div",{key:"c062c2482ef59df6ef60e7ccfb1716cc0cf2a19d",class:"zonos--hello-dialog-content"},t("zonos-button",{key:"c36de505068bd2c4b520a20ca7110a7bd46e749d",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close Zonos Hello dialog",content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>'}),noBackground:!0,onClick:()=>this.setIsOpen(!1)}),t("zonos-v-stack",{key:"85d246bab229099324507799eb8f771795ea92e0",spacing:24},t("zonos-country-flag",{key:"602b68614bdee4120900ed184941adc4ffa40619",class:"zonos--hello-country-flag",countryCode:e}),t("zonos-v-stack",{key:"3994f7ec81cfe691f6b5f8ce83391922966a7700",class:"zonos--hello-dialog-header",spacing:4},t("zonos-text",{key:"48c7e9bf22dd30eb089b7b25a99d908dbed5966f",type:"boldSubheader"},g),t("zonos-text",{key:"d590b3ed499b456134720ef73a965a5a552da80f",innerHTML:b,textColor:"gray-800"})),t("zonos-v-stack",{key:"8bce397c8522031d46b8e6efc38986af5645c3ee",spacing:8},this.restrictedItems.map((o=>{var e;return o&&t("zonos-banner",{bannerTitle:o.name,intent:"error"},null===(e=o.itemRestrictions)||void 0===e?void 0:e.map((o=>t("zonos-text",{textColor:"red-800"},null==o?void 0:o.note))))})),t("zonos-card",{key:"0772e7dc4499423f3a379a2cfc0b28dd23ec137e",spacing:"12px"},t("zonos-v-stack",{key:"ea421af6bc847eaece471f557d2d0ee1815d14bf",spacing:12},this.renderHelloMessage(),null==s?void 0:s.map((o=>t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Additional information for buying goods from selected country icon",content:'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>\n</svg>\n'}),t("zonos-text",{"aria-label":"Additional information for buying goods from selected country message",innerHTML:o})))))),z.map((o=>t("zonos-custom-message",{icon:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n',message:o.message})))))),t("zonos-hello-dialog-footer",{key:"6eed9e71407e1351053abd4a2e1b4aae75b12044",appearanceSettings:this.appearanceSettings,setShowCountrySelect:o=>this.setShowCountrySelect(o),setShowLanguageSelect:o=>this.setShowLanguageSelect(o)})),this.showCountrySelect&&t("div",{key:"cb9d77a61c481100fe21714bec8d062ffaa8f974"},t("zonos-country-select",{key:"d76ad3cdc005561e19d64502d4c2f02173929c22",handleOnClose:()=>this.setShowCountrySelect(!1)})),this.showLanguageSelect&&t("div",{key:"f9bbf877aba822b04676039d07ebb752d07fd362"},t("zonos-language-select",{key:"3d96dd6902003adf96a2ce73f0405e112a04b380",handleOnClose:()=>this.setShowLanguageSelect(!1)}))))}static get assetsDirs(){return["assets"]}static get watchers(){return{isOpen:["isOpenHandler"]}}};x.style=":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--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-dialog{position:absolute;background:var(--zonos-elements-surface-color);width:100vw;max-width:430px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-height:600px;border-radius:var(--zonos-elements-radius-12);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);overflow-y:auto;top:-2px;right:-2px;opacity:0;-webkit-transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:top right;transform-origin:top right;z-index:2147483647}:host .zonos--hello-dialog .zonos--hello-dialog-header{text-align:center}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:top left;transform-origin:top left;right:unset;left:-2px}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom{-webkit-transform-origin:bottom right;transform-origin:bottom right;bottom:0;top:unset}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom left;transform-origin:bottom left}:host .zonos--hello-dialog::-webkit-scrollbar{width:12px;height:12px}:host .zonos--hello-dialog::-webkit-scrollbar-track{background:#f5f5f5;border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--hello-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#ccc;border:4px solid transparent;background-clip:content-box}:host .zonos--hello-dialog::-webkit-scrollbar-thumb:hover{background:#999}:host .zonos--hello-dialog .zonos--animate-content{opacity:0;height:0;-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}:host .zonos--hello-dialog .zonos--show-animate-content{opacity:1;height:100%}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .zonos--hello-dialog .zonos--close-button{position:absolute;right:8px;top:8px;width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;z-index:10}:host .zonos--hello-dialog .zonos--close-button:hover{background:var(--zonos-elements-hover-color);border-radius:var(--zonos-elements-radius-6)}:host .zonos--hello-dialog .zonos--hello-dialog-content{padding:16px}:host .zonos--hello-dialog .zonos--hello-dialog-content .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:32px;height:24px}:host .zonos--hello-dialog .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:12px}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}@media (max-height: 600px){:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{max-height:80vh}}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}@media (max-width: 768px){:host .zonos--hello-dialog{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px) and (max-height: 600px){:host .zonos--hello-dialog{max-height:80vh}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}";export{x as zonos_hello_dialog}
@@ -0,0 +1 @@
1
+ import{r as o,h as e,F as t,a as s}from"./p-ce75b047.js";import{s as n,a as i,b as c,i as r,c as a,d,e as l,f as h,g as u,h as m,j as p,k as z,l as g,t as f,m as k,n as w,o as v,p as y,q as b,r as C,u as x,v as S,w as T,x as I,y as A,z as O,A as _,B as E,C as P,D as N,E as j}from"./p-e331a235.js";import{p as D,a as L,b as U}from"./p-cc78c9d4.js";import{f as R,l as $,a as B,g as F,s as M,V as K,b as Z,t as H,c as V,d as G}from"./p-e4d58bd7.js";import{z as W,g as q,m as Y}from"./p-058f6124.js";import{b as Q}from"./p-83666056.js";import{h as J,b as X,g as oo,l as eo,j as to,s as so,a as no,i as io}from"./p-41dd1cb8.js";import{u as co}from"./p-34d10122.js";import{_ as ro,c as ao,a as lo,d as ho,g as uo}from"./p-b2d81c98.js";import{l as mo,g as po,b as zo}from"./p-0a377722.js";import{c as go}from"./p-b4b7f705.js";import{c as fo}from"./p-595f5dd2.js";import{g as ko}from"./p-f830f800.js";import{i as wo}from"./p-67897a0d.js";import{s as vo}from"./p-96d77739.js";import{s as yo}from"./p-4f7d64f6.js";import{R as bo}from"./p-08e7107d.js";import"./p-def2d465.js";import"./p-908f13ae.js";const Co=(o=!0,e)=>{var t;if(!$.localizationLoaded)return!1;if(e){const s=!!(null===(t=$.shippingZoneCountries)||void 0===t?void 0:t[e])&&!W.disabledCountries.includes(e);return o&&!s&&mo(`Checkout: ${e} is not a shippable country: ${s}`),s}return!!$.isShippableCountry||(o&&mo("Checkout: not shippable country"),!1)},xo='select[name="shippingAddress.countryCode"]';let So=0;const To=o=>{var e;const t=null===(e=M.enabledVariantTestKeys)||void 0===e?void 0:e.find((e=>e.testKey===o));return(null==t?void 0:t.selectedVariantKey)||null},Io=async({cartId:o,retries:e})=>{const t=oo(),{errors:s,json:n}=await J("/api/zonos-elements/get-temp-cart",{body:{isTestMode:t,options:{noOnlineStoreSettings:!0},tempCartUUID:o},headers:{"Content-Type":"application/json"},method:"POST"}),i=!n||s.length;return i&&e?(mo("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:e}),await new Promise((o=>setTimeout(o,500))),Io({cartId:o,retries:e-1})):i?null:n},Ao='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n',Oo=class{constructor(e){o(this,e),this.storeUnsubscribeList=[],this.isRedirectAfterOrder=!1,this.preview=!1,this.hiddenMode=!1,this.mobile=!1,this.defaultAddress=[],this.forceDialogOpen=!1,this.defaultAddressParams=[],this.defaultCustomerProfileAddress=[],this.customerProfile=null,this.open=this.forceDialogOpen,this.isOverlayLoading=!1,this.stripe=window.Zonos.stripe,this.submitLoading=!1,this.collapseReviewMobile=!0,this.isAttachError=!1,this.isMobile=!1,this.isIframed=!1,this.isLegacyCheckout=window.Zonos.isLegacyCheckout,this.confirmDialogOpen=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.placedOrderInfo=null,this.shouldShowFedexShippingConsentDialog=!1,this.detectedDomesticCheckoutDialogOpen=!1,this.clientSecret=c.clientSecret,this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret,this.applyStripeTheme=async()=>{var o,e,t,s;const n=(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)||W.appearance.theme;await r({overrideBorderRadius:null===(e=this.appearanceSettingsOverride)||void 0===e?void 0:e.style,overridePrimaryColor:null===(t=this.appearanceSettingsOverride)||void 0===t?void 0:t.colorPrimary,overrideSecondaryColor:null===(s=this.appearanceSettingsOverride)||void 0===s?void 0:s.colorSecondary,overrideTheme:this.isMobile?n:void 0,paypalEnabled:D()})},this.checkStripePaymentIntentStatus=async({triggeredButton:o})=>{const e=null==o?void 0:o.matches(`#${ao}`),t=!!window.Zonos.cartData,s=new URL(window.location.href).searchParams,n=s.get("payment_intent_client_secret"),i=s.get("zonosCheckoutSessionId");if(!e)return mo("Checkout is triggered by user, no need to check stripe payment intent status"),{shouldAllowOrder:!0};if(mo("Payment intent exist, checking stripe payment intent status"),!n)return mo("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:t};const{error:r,status:d}=await a({clientSecret:n});return new URLSearchParams(window.location.search).get("redirect_status")?(mo(r?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen"),this.open=!0,M.checkoutSessionId=i,c.clientSecret=n,this.setToFinishStep(d),{shouldAllowOrder:!1}):t?(mo("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(mo("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})},this.initializeTestKeys=()=>{var o;M.enabledVariantTestKeys=(null==(o=M.enabledVariantTestKeys||[])?void 0:o.filter((o=>!(o.expiresAt&&o.expiresAt<Date.now()||!o.expiresAt))))||[];const e=W.enabledVariantTestKeys.map((o=>{var e;const t=null===(e=M.enabledVariantTestKeys)||void 0===e?void 0:e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+K,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}}));return Z(e),{allSelected:!1}},this.shouldAllowHostedVsNativeTest=()=>"function"==typeof W.checkoutSettings.createCartId&&!!W.enabledVariantTestKeys.includes("hosted_vs_native"),this.registerTestHostedVsNative=async()=>{if(!this.shouldAllowHostedVsNativeTest())return;mo("[TEST] - Registering hosted vs native test");const o=To("hosted_vs_native");if(o)return void mo(`[TEST] - Hosted vs native test already has variant selected: ${o}`);const e=await(async({testKeys:o})=>{if(0===o.length)return null;const{errors:e,json:t}=await J("/api/zonos-elements/select-variance-test",{body:{testKeys:o},method:"POST"});return e.length||!t?null:R(t)})({testKeys:["hosted_vs_native"]});if(!e)return void mo("[TEST] - Failed to get selection for hosted vs native test");const t=(({baseTestObj:o,mergeTestObj:e})=>o.map((({testKey:o})=>{const t=e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+K,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}})))({baseTestObj:M.enabledVariantTestKeys||[],mergeTestObj:e});Z(t)},this.handleHostedVsNative=async()=>{var o;if(!this.shouldAllowHostedVsNativeTest())return{redirected:!1};const e=To("hosted_vs_native");if(mo(`[TEST] - hosted_vs_native: ${e}`),"function"!=typeof W.checkoutSettings.createCartId)return mo("[TEST] - createCartId is not provided, skipping hosted vs native test"),{redirected:!1};if("hosted"!==e)return mo("[TEST] - Hosted vs native test is enabled for native, skipping"),{redirected:!1};if(!(null===(o=W.genericSettings)||void 0===o?void 0:o.hostedCheckoutUrl))return mo("[TEST] - Hosted checkout URL is not provided"),{redirected:!1};mo('"createCartId" is provided, start building cart');const t=await W.checkoutSettings.createCartId();let s,n=null;"object"==typeof t?(s=t.cartId,n=t.shippingData||null):s=t;const i=(()=>{const o=new URLSearchParams(window.location.search);mo("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:""},t=F(o)||$.selectedCountryCode||"US",s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerPhone"),d=e("customerZip"),l=e("customerState");return{customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:e("customerFirstName"),customerLastName:e("customerLastName"),customerName:r,customerPhone:a,customerState:l,customerZip:d}})(),c=(({cartId:o,checkoutSessionId:e,customerAddress1:t,customerAddress2:s,customerCity:n,customerCountry:i,customerEmail:c,customerFirstName:r,customerLastName:a,customerPhone:d,customerState:l,customerZip:h,hostedCheckoutUrl:u,isTestMode:m,isVariantTest:p})=>{const z=new URLSearchParams;return z.set("tempCartUUID",o),r&&z.set("customerFirstName",r),a&&z.set("customerLastName",a),c&&z.set("customerEmail",c),d&&z.set("customerPhone",d),h&&z.set("customerZip",h),n&&z.set("customerCity",n),l&&z.set("customerState",l),i&&z.set("zCountry",i),t&&z.set("customerAddress1",t),s&&z.set("customerAddress2",s),m&&z.set("zonosTestMode","1"),e&&z.set("zonosCheckoutSessionId",e),p&&z.set("zonosVariantTest","1"),`${u}?${z.toString()}`})(Object.assign(Object.assign({cartId:s,checkoutSessionId:M.checkoutSessionId||void 0,hostedCheckoutUrl:W.genericSettings.hostedCheckoutUrl,isTestMode:oo(),isVariantTest:!0},i),n));return mo(`[TEST] - Redirecting to: ${c}`),window.open(c,"_blank"),{redirected:!0}},this.formatDate=o=>o?new Date(o).toLocaleDateString():"",this.formatTime=o=>o?new Date(o).toLocaleTimeString():"",this.getCurrentLocalePageEnum=()=>{switch(d.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}},this.getBaseCurrencySettlementInfo=()=>{const o=d.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:e}}=o;return e?{settlementAmount:(e.discounts||0)+e.items+e.landedCostTotal+e.shipping}:null},this.getDefaultAddress=()=>this.defaultCustomerProfileAddress.length?this.defaultCustomerProfileAddress:Array.isArray(this.defaultAddress)&&this.defaultAddress.length?this.defaultAddress:Array.isArray(this.defaultAddress)||"object"!=typeof this.defaultAddress?this.defaultAddressParams:[this.defaultAddress],this.handleHostedOpenWindowCallback=o=>{var e;const t=null===(e=W.genericSettings)||void 0===e?void 0:e.hostedCheckoutUrl;if(!origin)return;const s=["dev.checkout.elements.zonos.com"].some((e=>o.origin.includes(e)));o.origin!==t&&!s||"zonos-checkout-session-update"!==o.data.type||(M.checkoutSessionId=o.data.checkoutSessionId)},this.captureParamsRedirectedForVariantTest=()=>{const o=new URL(window.location.href);if("1"!==o.searchParams.get("zonosVariantTest"))return;const e=o.searchParams.get("zonosCheckoutSessionId");e&&(M.checkoutSessionId=e);const t=M.enabledVariantTestKeys||[];window.Zonos.isLegacyCheckout&&(To("hosted_vs_native")?Z(t.map((o=>"hosted_vs_native"===o.testKey?Object.assign(Object.assign({},o),{selectedVariantKey:"hosted"}):o))):(t.push({expiresAt:Date.now()+K,selectedVariantKey:"hosted",testKey:"hosted_vs_native"}),Z(t))),o.searchParams.delete("zonosCheckoutSessionId"),o.searchParams.delete("zonosVariantTest"),window.history.replaceState({},"",o.toString())}}async initCartInfoHandler(o){l({adjustments:d.adjustments,cartItems:o.detail})}async handleKeyPress(o){"Escape"===o.key&&this.closeDialogHandler()}async closeDialogHandler(o){var e,t;this.open&&((null==o?void 0:o.confirmed)?(this.confirmDialogOpen=!1,yo({event:"zonos-checkout-close",metadata:{checkoutSessionId:M.checkoutSessionId}}),this.open=this.forceDialogOpen||!1,this.preview||"finish"!==d.step||h(),d.step="customer-info",u(),m(),null===(t=(e=W.checkoutSettings).onClose)||void 0===t||t.call(e)):this.confirmDialogOpen=!0)}async buildCartAndInit(){if("function"==typeof W.checkoutSettings.createCartId){mo('"createCartId" is provided, start building cart');const o=await W.checkoutSettings.createCartId();let e;"object"==typeof o?(mo("object detected, use cartId and prefill address from createCartId","info",o),e=o.cartId,this.useShippingDataFromCreateCartId(o.shippingData),d.customerAuthenticationToken=o.customerAuthenticationToken||null):e=o,window.Zonos.cartId=e;const t=await(async o=>{const{isDgsCartId:e,isLegacyCartId:t}=ro(o);if(!t&&!e)return eo("[ZONOS - loadZonos] invalid cart id"),null;const s=await Io({cartId:o,retries:5});return mo("[ZONOS - loadZonos] getting temp cart data","info",s),s?(window.Zonos.storeId=s.cartData.storeId,window.Zonos.zonosApiKey=s.cartData.credentialToken,{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}):(eo("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(e),s=null==t?void 0:t.cartData;if(!s)return eo("Failed to build cart, please try again."),!1;window.Zonos.cartData=s;const{adjustments:n,cartItems:i}=Q(s);await l({adjustments:n,cartItems:i})}else if(window.Zonos.cartData){mo("tempCartUUID is provided, start building cart");const{adjustments:o,cartItems:e}=Q(window.Zonos.cartData);await l({adjustments:o,cartItems:e})}else if(W.checkoutSettings.buildCartDetail&&$.selectedCountryCode){mo("build cart detail");const o=await W.checkoutSettings.buildCartDetail({countryCode:$.selectedCountryCode,currencyCode:$.targetCurrency}),e=o.filter((o=>o.amount>=0)),t=o.filter((o=>o.amount<0));mo("cartItems","info",{cartItems:o});const s=t.map((o=>({amount:o.amount,currencyCode:o.currencyCode,description:o.name||o.description||"",productId:o.productId||null,sku:o.sku||null,type:"CART_TOTAL"})));await l({adjustments:s,cartItems:e})}if(!M.checkoutSessionId){const o=await p();if(mo(`stripeStoreInitCheckoutSession: ${o}`),!o)return!1}return d.isStagingMode||z(),await this.applyStripeTheme(),this.isRedirectAfterOrder="REDIRECT_TO_SUCCESS_PAGE"===W.checkoutSettings.successBehavior||!!d.externalConfirmationPageURL,!0}reloadCheckoutSession(){window.location.reload()}handleOrderDuplication(){const o=to(localStorage.getItem("zonos--placed-order-info"));if(!o)return void localStorage.removeItem("zonos--placed-order-info");const e=Date.now()-o.time;mo(`=== Existing placed order info: ${o.orderId} - ${this.formatDate(o.time)} - elapsed in hh:ss format: ${new Date(e).toISOString().substring(11,8)}`,"warn");const t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||216e5;if(e>t)return mo(`=== Existing placed order info is older than ${t}ms, cleaning localStorage`,"warn"),void localStorage.removeItem("zonos--placed-order-info");this.placedOrderInfo=o,mo("=== Showing order duplication confirmation","warn")}recordCheckoutInfo(){M.checkoutSessionId&&co({attributes:[{key:"APP_VERSION",value:window.Zonos.version},{key:"APP_VERSION_NPM_INTEGRATION",value:window.Zonos.isNpm?"1":"0"},{key:"LEGACY_CHECKOUT_FACADE",value:window.Zonos.isLegacyCheckout?"1":"0"}],checkoutSessionId:M.checkoutSessionId})}confirmProceedWithOrderDuplication(){this.placedOrderInfo=null,M.checkoutSessionId&&co({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:M.checkoutSessionId})}markTheSessionAsAbandonedCart(){M.checkoutSessionId&&co({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:M.checkoutSessionId})}handleCancelOrderDuplication(){var o;if(this.placedOrderInfo=null,this.isLegacyCheckout){const e=(null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl)||W.onlineStoreSettings.url;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}this.closeDialogHandler({confirmed:!0})}attachCheckout(){const o=W.checkoutSettings.placeOrderButtonSelector,e=W.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;if(mo(`attach checkout ${o}`),mo(`attach checkout to always trigger international checkout selector: ${e}`),!o&&!e&&!window.Zonos.cartData)return;const t=[o,e,`#${ho}`,`#${ao}`,`#${lo}`].filter(Boolean);document.querySelectorAll(t.join(",")).forEach((t=>{t.getAttribute("data-zonos-checkout-attached")||(mo(`attached event to button ${o}`,"info",{button:t}),t.addEventListener("click",(async o=>{var s,n;const i=performance.now(),r=e&&t.matches(e),a=t.matches(`#${lo}`),l=t.matches(`#${ho}`)||t.matches(`#${ao}`);if(!window.Zonos.isLegacyCheckout&&(!Co()||((o=!0)=>!$.localizationLoaded||!!$.isDisabledCountry&&(o&&mo("Checkout: disabled country"),!0))())&&!r&&!a&&!l)return;o.preventDefault(),o.stopPropagation(),mo("zonos checkout button clicked");const{shouldAllowOrder:h}=await this.checkStripePaymentIntentStatus({triggeredButton:o.target});if(h){if(window.Zonos.logIntervalId||(window.Zonos.logIntervalId=setInterval((()=>{(async()=>{if(0===window.Zonos.loadTimeApiInfoList.length)return;mo("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});const o={data:[...window.Zonos.loadTimeApiInfoList],storeId:window.Zonos.storeId||0};window.Zonos.loadTimeApiInfoList.length=0;const{errors:e}=await J("/api/zonos-elements/log-bulk-load-data",{body:o,method:"POST"});e.length&&(window.Zonos.loadTimeApiInfoList.push(...o.data),So++,So>5&&window.Zonos.logIntervalId&&clearInterval(window.Zonos.logIntervalId))})()}),2e3)),W.enabledVariantTestKeys.includes("hosted_vs_native")){this.isOverlayLoading=!0,await this.registerTestHostedVsNative();const{redirected:o}=await this.handleHostedVsNative();if(this.isOverlayLoading=!1,o)return}c.isFetchingSession=!0,this.open=!0;try{if(!await this.buildCartAndInit())throw new Error("Error building cart");null===(s=window.opener)||void 0===s||s.postMessage({checkoutSessionId:M.checkoutSessionId,type:"zonos-checkout-session-update"},"*"),g({isPreview:this.preview,sessionTimeout:54e5}),yo({event:"zonos-checkout-start",metadata:{checkoutSessionId:M.checkoutSessionId}}),f({checkoutSessionId:M.checkoutSessionId,eventName:"checkout_open"});const{enabled:o}=await(async()=>{const{errors:o,json:e}=await J("/api/zonos-elements/get-store-discount-enabled-status");return o.length||!(null==e?void 0:e.enabled)?{enabled:!1}:{enabled:!0}})();if(d.shouldHideDiscountInput=!o,this.handleOrderDuplication(),window.Zonos.isLegacyCheckout)(async()=>{const{elapsedTime:o}=po(),e={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:zo},X()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};J("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})();else{(async({loadTime:o})=>{const e={cache:"miss",eventName:"jsdelivr",flag:"LOG_NATIVE_CHECKOUT_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:zo},X()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};J("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})({loadTime:performance.now()-i})}this.recordCheckoutInfo(),uo()&&this.markTheSessionAsAbandonedCart()}catch(o){if(o instanceof Error&&"Cart is expired."===o.message&&(this.isCartExpired=!0),c.isFetchingSession=!1,eo(o),this.isCartExpired)return void(c.isFetchingSession=!0);so({endpoint:"Error creating Checkout",errors:[o instanceof Error?o.toString():"Unknown error"],metadata:{allLogs:zo,cartId:window.Zonos.cartId,checkoutSessionBody:k(),href:window.location.href,storeBaseUrl:(null===(n=window.Zonos.cartData)||void 0===n?void 0:n.storeBaseUrl)||W.onlineStoreSettings.url}}),w({messages:[H("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:H("Error creating Checkout")})}}}),{capture:!0,passive:!1}),W.checkoutSettings.disablePlaceOrderButtonActivation||t.removeAttribute("disabled"),t.setAttribute("data-zonos-checkout-attached","true"),t.matches(`#${ho}`)&&(t.dispatchEvent(fo("click")),v(),t.remove()),t.matches(`#${ao}`)&&(t.dispatchEvent(fo("click")),t.remove()))}))}appearanceSettingsOverrideChanged(){this.appearanceSettingsOverride&&this.applyStripeTheme()}useShippingDataFromCreateCartId(o){if(!o)return;mo("shipping data from createCartId result","info",Object.entries(o));const{customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:n,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:h}=o,u=new URLSearchParams(window.location.search),m=n||F(u)||$.selectedCountryCode;this.applyPrefillAddress({customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:m,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:h})}useLegacyQueryParams(){const o=new URLSearchParams(window.location.search);mo("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:null},t=F(o)||$.selectedCountryCode,s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerFirstName"),d=e("customerLastName"),l=e("customerPhone"),h=e("customerZip"),u=e("customerState");this.applyPrefillAddress({customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:a,customerLastName:d,customerName:r,customerPhone:l,customerState:u,customerZip:h})}applyPrefillAddress(o){const e=o.customerAddress1||"",t=o.customerCountry||"",s=o.customerAddress2||"",n=o.customerCity||"",i=o.customerEmail||"",c=o.customerFirstName&&o.customerLastName?`${o.customerFirstName} ${o.customerLastName}`:o.customerName||"",r=o.customerPhone||"",a=o.customerZip||"",d=o.customerState||"";e&&c&&r&&t?t&&$.shippingZoneCountries&&!(t in $.shippingZoneCountries)?mo(`Country "${t}" is not in the shipping zone, so it can not be prefilled`,"warn"):(this.defaultAddressParams=[{address:{city:n||"",country:t,line1:e,line2:s,postal_code:a,state:d},email:i,name:c,phone:r}],mo("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:o})):mo("Missing required query params so it can not be prefilled","info",[!e&&"line1",!c&&"name",!r&&"phone",!t&&"country"].filter(Boolean).join(", "))}overrideStagingModeChanged(){d.isStagingMode=!!this.overrideStagingMode}async init(){c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,d.isStagingMode=no(),void 0!==this.overrideStagingMode&&(d.isStagingMode=this.overrideStagingMode),(({domesticRedirectedBtnSelector:o,onInternationalCheckoutSelected:e,onShippingAddressSessionFound:t})=>{if(!window.Zonos.isBigCommerce)return;const s=async o=>{var t;const s=document.querySelector((null===(t=W.genericSettings)||void 0===t?void 0:t.bigcommerceDomesticCheckoutCountrySelector)||xo),n=(null==s?void 0:s.value)||o;if(!n)return!1;if(!Co(!1,n))return!1;e&&await e(),B({isInitializing:!1,newSelectedCountryCode:n});const c={address1:"",address2:"",city:"",countryCode:n,firstName:"",lastName:"",phone:"",postalCode:"",stateOrProvince:""};return i({address1:c.address1,address2:c.address2,city:c.city,countryCode:c.countryCode,firstName:c.firstName,lastName:c.lastName,phone:c.phone,postalCode:c.postalCode,state:c.stateOrProvince}),window.location.href="/",!0};let c=!1,r=!1;const a=new MutationObserver((()=>{var e;const i=document.querySelector(o),d=n();if(!i&&d){const o=document.createElement("button");return o.style.display="none",o.id="zonos--domestic-redirected-checkout-button",document.body.appendChild(o),null==t||t(d),void a.disconnect()}const l=window.location.pathname.includes("/checkout")&&window.Zonos.isBigCommerce,h=document.querySelector((null===(e=W.genericSettings)||void 0===e?void 0:e.bigcommerceDomesticCheckoutCountrySelector)||xo);if(!l)return void a.disconnect();if(!h)return;if(mo("Domestic checkout found - Listening for shipping country change","info",{value:h.value}),r)return;r=!0,a.disconnect();const u=setInterval((async()=>{if(!c){c=!0;try{if(await s())return void clearInterval(u);c=!1}catch(o){c=!1}}}),1e3),m=setInterval((()=>{var o;if(!window.bcStripeElements)return void clearInterval(m);const e=null===(o=window.bcStripeElements)||void 0===o?void 0:o.getElement("address");e&&(clearInterval(m),e.on("change",(o=>{const e=o.value.address.country;e&&s(e)})))}),500)}));a.observe(document.body,{childList:!0,subtree:!0})})({domesticRedirectedBtnSelector:ho,onInternationalCheckoutSelected:async()=>{this.detectedDomesticCheckoutDialogOpen=!0,await new Promise((o=>setTimeout(o,2e3)))},onShippingAddressSessionFound:o=>{this.defaultAddress=[{address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:`${o.firstName} ${o.lastName}`,phone:o.phone}]}}),window.Zonos&&this.useLegacyQueryParams();const o=setInterval((()=>{c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,this.stripe?(this.storybookPaymentStatusOverride||(mo("init checkout"),this.preview||this.forceDialogOpen?this.buildCartAndInit():window.Zonos.isLegacyCheckout?this.attachCheckout():window&&(this.attachCheckout(),new MutationObserver((()=>{this.attachCheckout()})).observe(document.body,{childList:!0,subtree:!0}))),clearInterval(o)):mo("waiting for stripe to be loaded")}),50);setTimeout((()=>{clearInterval(o)}),1e4)}async setToFinishStep(o){d.step="finish",this.storybookPaymentStatusOverride=o}async mockCheckoutSession(o){y(o)}async triggerCheckoutInternational(){const o=document.querySelector(`#${lo}`);o&&o.dispatchEvent(fo("click"))}async handleCustomerInfoContinue(){var o,e,t,s;yo({event:"zonos-checkout-customer-info",metadata:{checkoutSessionId:M.checkoutSessionId}}),f({checkoutSessionId:M.checkoutSessionId,eventName:"checkout_customerInfoCompleted"}),this.submitLoading=!0;const{isRequestNotReady:n}=await b();n&&"stripe"===d.addressFormRenderType&&so({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:null===(e=null===(o=c.stripeAddressEventData)||void 0===o?void 0:o.value)||void 0===e?void 0:e.address,billingAddress:null===(s=null===(t=c.stripeBillingAddressEventData)||void 0===t?void 0:t.value)||void 0===s?void 0:s.address,cartId:window.Zonos.cartId}});const i=o=>{"customer-info"===d.step?c.isFetchingLandedCost||(d.landedCostData&&(U({currency:d.currency}),C()),this.submitLoading=!1,o&&clearInterval(o)):clearInterval(o)};i();const r=setInterval((()=>{i(r)}),20);setTimeout((()=>{clearInterval(r)}),1e4)}async handleShippingContinue(){C()}handleInventoryCheckDialogConfirm(){d.inventoryCheckErrorMessage=null,this.isLegacyCheckout||this.closeDialogHandler({confirmed:!0})}handleCartExpiredDialogConfirm(){var o;if(this.isCartExpired=!1,this.isLegacyCheckout){const e=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}window.parent&&(window.parent.location.href=window.location.href),window.location.reload()}async handleStripePaymentContinue(){if("USD"!==c.checkoutSettlementCurrency||!c.shouldRenderPayInUsdButton||this.payInUsdConfirmDialogOpen){if(this.payInUsdConfirmDialogOpen=!1,L.paypalErrorMessage=null,c.hasPaymentError=!1,this.submitLoading=!0,d.inventoryCheckErrorMessage=null,!await x())return c.hasPaymentError=!0,c.customErrorMessage=H("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:c.checkoutSettlementCurrency}),void(this.submitLoading=!1);try{d.inventoryCheckErrorMessage=await S()}catch(o){d.inventoryCheckErrorMessage=H("Unable to check inventory. Please try again.")}if(d.inventoryCheckErrorMessage)this.submitLoading=!1;else{if(j()>0){const o=await T();if(!o.success)return c.hasPaymentError=!0,c.customErrorMessage=o.error||H("Unable to apply store credit. Please try again."),void(this.submitLoading=!1)}if(I()){try{const o=await A();if(!o.valid)return c.hasPaymentError=!0,c.customErrorMessage=o.errorMessage,void(this.submitLoading=!1);const e=await O();if(!e.success)return c.hasPaymentError=!0,c.customErrorMessage=e.error||H("Unable to place order with store credit. Please try again."),void(this.submitLoading=!1);C(),m()}catch(o){eo(o),yo({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:M.checkoutSessionId}}),c.hasPaymentError=!0}this.submitLoading=!1}else{try{await _(),C(),m()}catch(o){eo(o),yo({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:M.checkoutSessionId}}),c.hasPaymentError=!0,c.shouldInventoryRefund&&(E(),c.shouldInventoryRefund=!1)}this.submitLoading=!1}}}else this.payInUsdConfirmDialogOpen=!0}async handleFinishClick(){if(P(),this.preview)return d.step="customer-info",void await this.init();if(h(),window.Zonos.isLegacyCheckout&&window.Zonos.cartData){const o=window.Zonos.cartData.storeBaseUrl||W.onlineStoreSettings.url;return window.parent&&(window.parent.location.href=o),void(window.location.href=o)}const o=window.location.href.split("?")[0];this.open=!1,window.location.hostname.includes("dashboard.zonos.com")||(window.history.replaceState(window.history.state,document.title,o),window.location.reload())}handleWindowResize(){this.isMobile=io(this.mobile),this.applyStripeTheme(),mo(`mobile: ${this.isMobile}`)}handleMobileChange(){this.isMobile=io(this.mobile),this.applyStripeTheme(),mo(`mobile: ${this.isMobile}`)}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=q(this.appearanceSettingsOverride.theme))}handleAddressChange(){P()}handleCustomerProfileChange(){var o,e;if(!this.customerProfile)return mo("No customer profile","info"),void(this.defaultCustomerProfileAddress=[]);mo("Customer profile found","info",{customerProfile:this.customerProfile}),this.defaultCustomerProfileAddress=(null===(e=null===(o=c.customerProfile)||void 0===o?void 0:o.locations)||void 0===e?void 0:e.map((o=>{var e;return{address:{city:o.locality,country:o.countryCode,line1:o.line1,line2:o.line2||"",postal_code:o.postalCode,state:o.administrativeArea},email:o.email||(null===(e=c.customerProfile)||void 0===e?void 0:e.email)||"",name:o.name||"",phone:o.phone||""}})))||[]}handleClientSecretChange(){mo("==== Client secret changed","info",{clientSecret:this.clientSecret,stripeCustomerSessionClientSecret:this.stripeCustomerSessionClientSecret}),this.applyStripeTheme()}handleOpenChange(){const o="data-zonos-overflow-origin",e=document.body,t=document.documentElement;if(this.open)window.Zonos.openHelloDialog(!1),e.style.overflow&&e.setAttribute(o,e.style.overflow),e.style.overflow="hidden",t.style.overflow&&t.setAttribute(o,t.style.overflow),t.style.overflow="hidden";else{this.stripeCustomerSessionClientSecret=null;const s=e.getAttribute(o),n=t.getAttribute(o);s?(e.removeAttribute(o),e.style.overflow=s):e.style.removeProperty("overflow"),n?(t.removeAttribute(o),t.style.overflow=n):t.style.removeProperty("overflow")}}componentWillLoad(){this.init(),this.isMobile=io(this.mobile),this.isIframed=window.self!==window.top,mo(`iframed: ${this.isIframed}`),window.Zonos.isLegacyCheckout&&this.captureParamsRedirectedForVariantTest(),this.handleAppearanceSettingsOverrideChange(),this.storeUnsubscribeList=[V("selectedLocale",(()=>{this.applyStripeTheme()})),N("selectedShippingOption",(()=>{var o,e,t,s;const n=d.selectedShippingOption;(null===(o=W.genericSettings)||void 0===o?void 0:o.shouldFedExShippingConsentForCanadianShopper)&&(null===(t=null===(e=null==n?void 0:n.shippingProfile)||void 0===e?void 0:e.serviceLevel.code)||void 0===t?void 0:t.toLowerCase().startsWith("fedex."))&&"CA"===(null===(s=c.stripeAddressEventData)||void 0===s?void 0:s.value.address.country)&&(this.shouldShowFedexShippingConsentDialog=!0)}))],this.initializeTestKeys(),window.addEventListener("message",this.handleHostedOpenWindowCallback),mo(`mobile: ${this.isMobile}`)}disconnectedCallback(){P(),h(),this.storeUnsubscribeList.forEach((o=>o())),window.removeEventListener("message",this.handleHostedOpenWindowCallback)}render(){var o,n,i,r;this.customerProfile=c.customerProfile,this.clientSecret=c.clientSecret,c.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret);const a="finish"!==d.step&&"error"!==d.step&&!c.stripeElements||c.isFetchingSession,{colorPrimary:l,colorSecondary:h,logoUrl:u,style:m}=Y(W.appearance,this.appearanceSettingsOverride||null),p="ENABLED"===W.appearance.zonosAttribution,z=W.appearance.theme,g=l&&wo(l)?"DARK":"LIGHT",f=this.isMobile?z:g,k=this.isMobile?void 0:h,{customMessages:w}=$,v=null===(o=w.find((o=>"checkout_default"===o.pageName)))||void 0===o?void 0:o.message,y=this.getCurrentLocalePageEnum(),b=w.filter((o=>o.pageName===y)),C=this.getBaseCurrencySettlementInfo(),x=()=>{const o=this.preview?`${u}?timestamp=${Date.now()}`:u;return e("div",{class:"zonos--logo"},o&&e("img",{alt:`${W.organizationName} logo`,src:o}))},S=oo(),T=()=>{const o=new URLSearchParams(window.location.search),t=o.get("zonosQaUrl"),s=o.get("zonosDebug"),n=o.get("zonosE2ETest"),i=this.overrideStagingMode||no();return e("zonos-v-stack",null,e("div",{class:"zonos--logo-wrapper"},x(),S&&e("zonos-badge",{badgeColor:"orange",size:"small"},H("Test mode")),i&&e("zonos-badge",{badgeColor:"red",size:"small"},H("Staging mode")),"1"===s&&e("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&e("zonos-badge",{badgeColor:"purple",size:"small"},t),n&&e("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),e("zonos-checkout-progress-tabs",{backgroundColor:this.isMobile?"--zonos-elements-gray-0":null}),b.map((o=>e("zonos-custom-message",{icon:Ao,message:o.message}))))},I=()=>d.checkoutSessionTimeoutShow?e("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:H("Your checkout session has expired. Please reload the page to continue."),restStateTitle:H("Session timed out"),restStateType:"Warning"},e("zonos-button",{onClick:()=>this.reloadCheckoutSession(),variant:"primary"},H("Reload"))):e("div",{class:"zonos--content",style:{"--zonos--border-radius":ko({overrideBorderStyle:m})}},"finish"!==d.step&&"error"!==d.step&&e(t,null,e("div",{class:"zonos--left","data-theme":f,style:vo({"--zonos--primary-color":this.isMobile?void 0:l})},!this.isMobile&&T(),"customer-info"===d.step&&e("zonos-customer-info",{continueLoading:this.submitLoading,defaultAddress:this.getDefaultAddress(),isMobile:this.isMobile,onContinueClicked:()=>this.handleCustomerInfoContinue(),submitBtnColor:k}),"shipping"===d.step&&e("zonos-shipping",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:()=>this.handleShippingContinue(),submitBtnColor:k}),"payment"===d.step&&e("zonos-checkout-payment",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:async()=>{await this.handleStripePaymentContinue()},submitBtnColor:k})),e("div",{class:"zonos--right","data-theme":z},this.isMobile&&T(),e("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&e("zonos-currency-toggle",null),!this.isLegacyCheckout&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:bo}),noBackground:!0,onClick:()=>this.closeDialogHandler()})),e("div",{class:"flex--wrapper"},e("div",{class:"zonos--wrapper"},e("zonos-review",{collapsed:this.collapseReviewMobile,mobile:this.isMobile,onClick:()=>{this.isMobile&&(this.collapseReviewMobile=!this.collapseReviewMobile)}}),e("zonos-collapse",{collapsed:this.collapseReviewMobile&&this.isMobile},e("zonos-cart-items",null),this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",{submitBtnColor:k}),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Ao,message:v})))),e("zonos-cart-restricted-items",null),!this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",null),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Ao,message:v}))))),("finish"===d.step||"error"===d.step)&&e("div",{class:"zonos--done","data-theme":z},e("div",{class:"zonos--header"},x(),!this.isRedirectAfterOrder&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:bo}),noBackground:!0,onClick:()=>this.handleFinishClick(),theme:z})),e("zonos-checkout-finish",{borderRadius:m,onCloseClick:()=>this.handleFinishClick(),overrideNotification:"error"===d.step&&d.error?Object.assign(Object.assign({},d.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),e("zonos-checkout-footer",{"data-theme":z,mobile:this.isMobile,slot:this.isMobile?void 0:"dialog-footer"}));return e(s,{class:go(["zonos--checkout zonos--elements","payment"===d.step&&"zonos--processing-payment",p&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?I():e("zonos-dialog",{borderStyle:m,class:"zonos--checkout-dialog","data-theme":z,height:"980px",isLoading:a,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeDialogHandler(),open:this.open,width:"1200px"},I()),e("zonos-dialog",{isLoading:!0,loadingText:H("You will be redirected to international checkout shortly."),loadingTitle:H("We detected that you are shipping to an international address."),noClickOutside:!0,noCloseButton:!0,open:this.detectedDomesticCheckoutDialogOpen,width:"450px"}),e("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:H("Don't close"),dialogConfirmBtnText:H("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:H("Would you like to close checkout and return to the site?"),dialogTitle:H("Are you sure?"),onCancelClicked:()=>{this.confirmDialogOpen=!1},onConfirmClicked:()=>this.closeDialogHandler({confirmed:!0})}),e("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:H("Return to merchant site"),dialogConfirmBtnText:H("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:(null===(n=this.placedOrderInfo)||void 0===n?void 0:n.zonosOrderNumber)?H("It looks like you placed an order recently ([date] at [time]) under order number #[orderNumber]. Check your email for the order confirmation. Are you sure you want to place another order?",{date:this.formatDate(this.placedOrderInfo.time),orderNumber:this.placedOrderInfo.zonosOrderNumber,time:this.formatTime(this.placedOrderInfo.time)}):H("It looks like you placed an order recently ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?",{date:this.formatDate((null===(i=this.placedOrderInfo)||void 0===i?void 0:i.time)||null),time:this.formatTime((null===(r=this.placedOrderInfo)||void 0===r?void 0:r.time)||null)}),dialogTitle:H("Are you sure?"),dialogWidth:530,onCancelClicked:()=>{this.handleCancelOrderDuplication()},onConfirmClicked:()=>{this.confirmProceedWithOrderDuplication()}}),e("zonos-confirm-dialog",{class:"zonos--fedex-shipping-dialog",dialogConfirmBtnText:H("Confirm"),dialogIntent:"info",dialogOpen:!!this.shouldShowFedexShippingConsentDialog,dialogSubtitle:e(t,null,H("If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request."),e("zonos-link",{href:"https://ftn.fedex.com/us/assets/docs/One-Time_GAA.pdf",target:"_blank"},H("View GAA Form."))),dialogTitle:H("Fedex Shipping Procedure"),dialogType:"alert",dialogWidth:500,onConfirmClicked:()=>this.shouldShowFedexShippingConsentDialog=!1}),e("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:H("Return to cart"),dialogIntent:"danger",dialogOpen:!!d.inventoryCheckErrorMessage,dialogSubtitle:d.inventoryCheckErrorMessage,dialogTitle:H("Couldn't place order"),dialogType:"alert",onConfirmClicked:()=>this.handleInventoryCheckDialogConfirm()}),C&&e("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:H("Cancel"),dialogConfirmBtnText:H("Pay [orderTotal]",{orderTotal:G({amount:C.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:H("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:H("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),e("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:H("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:H("You are being sent back to the shop to re-add items to your cart."),dialogTitle:H("Shopping cart expired"),dialogType:"alert",onConfirmClicked:()=>this.handleCartExpiredDialogConfirm()}),e("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}static get watchers(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],overrideStagingMode:["overrideStagingModeChanged"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"],customerProfile:["handleCustomerProfileChange"],clientSecret:["handleClientSecretChange"],stripeCustomerSessionClientSecret:["handleClientSecretChange"],open:["handleOpenChange"]}}};Oo.style=".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h{z-index:2147483647;position:fixed}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto;position:relative}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.hidden-mode.sc-zonos-checkout-h{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0;z-index:-1}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}.zonos--processing-payment.sc-zonos-checkout-h{z-index:2147483646}";export{Oo as zonos_checkout}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(o,n,e,i){function s(o){return o instanceof e?o:new e((function(n){n(o)}))}return new(e||(e=Promise))((function(e,t){function c(o){try{a(i.next(o))}catch(o){t(o)}}function r(o){try{a(i["throw"](o))}catch(o){t(o)}}function a(o){o.done?e(o.value):s(o.value).then(c,r)}a((i=i.apply(o,n||[])).next())}))};var __generator=this&&this.__generator||function(o,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},i,s,t,c;return c={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function r(o){return function(n){return a([o,n])}}function a(r){if(i)throw new TypeError("Generator is already executing.");while(c&&(c=0,r[0]&&(e=0)),e)try{if(i=1,s&&(t=r[0]&2?s["return"]:r[0]?s["throw"]||((t=s["return"])&&t.call(s),0):s.next)&&!(t=t.call(s,r[1])).done)return t;if(s=0,t)r=[r[0]&2,t.value];switch(r[0]){case 0:case 1:t=r;break;case 4:e.label++;return{value:r[1],done:false};case 5:e.label++;s=r[1];r=[0];continue;case 7:r=e.ops.pop();e.trys.pop();continue;default:if(!(t=e.trys,t=t.length>0&&t[t.length-1])&&(r[0]===6||r[0]===2)){e=0;continue}if(r[0]===3&&(!t||r[1]>t[0]&&r[1]<t[3])){e.label=r[1];break}if(r[0]===6&&e.label<t[1]){e.label=t[1];t=r;break}if(t&&e.label<t[2]){e.label=t[2];e.ops.push(r);break}if(t[2])e.ops.pop();e.trys.pop();continue}r=n.call(o,e)}catch(o){r=[6,o];s=0}finally{i=t=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-096182f0.system.js","./p-1b5f89d5.system.js","./p-fc0aa91e.system.js","./p-5fd0cd66.system.js","./p-ac30b7a8.system.js","./p-398d9022.system.js","./p-01174496.system.js","./p-6f23a26a.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js","./p-c9e433c0.system.js","./p-d18a2b2c.system.js","./p-7501c637.system.js","./p-8c6624b6.system.js","./p-ab25379f.system.js"],(function(o){"use strict";var n,e,i,s,t,c,r,a,l,v,z,d,h,u,f,m,p,g,b,w,x,y,k,_,C,I,S,j,O,T,E,L,U,P,N,A,D,B,R;return{setters:[function(o){n=o.r;e=o.h;i=o.a;s=o.F},function(o){t=o.b;c=o.i;r=o.c;a=o.d;l=o.n;v=o.e;z=o.j;d=o.k;h=o.u;u=o.w;f=o.B;m=o.y;p=o.f},function(o){g=o.i;b=o.a;w=o.b;x=o.c},function(o){y=o.p;k=o.a},function(o){_=o.s;C=o.t;I=o.c;S=o.d;j=o.l},function(o){O=o.z},function(o){T=o.b},function(o){E=o.h;L=o.s;U=o.l;P=o.g},function(o){N=o.i;A=o.a},function(o){D=o.c},function(o){B=o.l},function(o){R=o.l},function(){},function(){},function(){},function(){}],execute:function(){var F='<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var V=".sc-zonos-invoice-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-invoice-h *.sc-zonos-invoice{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-invoice-h img.sc-zonos-invoice{max-width:100%}.sc-zonos-invoice-h dl.sc-zonos-invoice,.sc-zonos-invoice-h dd.sc-zonos-invoice,.sc-zonos-invoice-h h1.sc-zonos-invoice,.sc-zonos-invoice-h h2.sc-zonos-invoice,.sc-zonos-invoice-h h3.sc-zonos-invoice,.sc-zonos-invoice-h h4.sc-zonos-invoice,.sc-zonos-invoice-h h5.sc-zonos-invoice,.sc-zonos-invoice-h h6.sc-zonos-invoice,.sc-zonos-invoice-h hr.sc-zonos-invoice,.sc-zonos-invoice-h figure.sc-zonos-invoice,.sc-zonos-invoice-h p.sc-zonos-invoice,.sc-zonos-invoice-h pre.sc-zonos-invoice{margin:0}.sc-zonos-invoice-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-invoice-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-invoice-h *.sc-zonos-invoice{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar{width:10px}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{background-color:var(--zonos-elements-gray-0)}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice{width:100%;max-width:1400px;max-height:100%;height:calc(100% - 100px);overflow:hidden;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice .zonos--header.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice .zonos--logo.sc-zonos-invoice{margin-bottom:0}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice zonos-checkout-finish.sc-zonos-invoice{-ms-flex:1;flex:1}.sc-zonos-invoice-h .zonos--header-title.sc-zonos-invoice,.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{max-width:800px}.sc-zonos-invoice-h .zonos--left.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-invoice-h .zonos--left.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice{padding:0 8px 8px}.sc-zonos-invoice-h .zonos--left.sc-zonos-invoice .zonos--payment-error-banner.sc-zonos-invoice{margin-top:24px}.sc-zonos-invoice-h .zonos--right.sc-zonos-invoice{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-invoice-h .zonos--right.sc-zonos-invoice .zonos--order-details-container.sc-zonos-invoice{overflow:auto}.sc-zonos-invoice-h .zonos--wrapper.sc-zonos-invoice{overflow:auto;max-height:100%;position:relative}.sc-zonos-invoice-h .flex--wrapper.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-invoice-h .zonos--logo-wrapper.sc-zonos-invoice{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-invoice-h .zonos--logo-wrapper.sc-zonos-invoice>*.sc-zonos-invoice{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-invoice-h .zonos--header-right.sc-zonos-invoice{display:none}.sc-zonos-invoice-h .zonos--logo.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-invoice-h .zonos--logo.sc-zonos-invoice img.sc-zonos-invoice{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-invoice-h .zonos--invoice-container.sc-zonos-invoice{overflow:visible}.mobile.sc-zonos-invoice-h,.tablet.sc-zonos-invoice-h{min-width:auto}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{padding-bottom:0}}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--review.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--review.sc-zonos-invoice{margin-bottom:0}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--cart-items.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--cart-items.sc-zonos-invoice{margin-top:8px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice zonos-checkout-footer.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice zonos-checkout-footer.sc-zonos-invoice{-ms-flex-order:3;order:3}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice{max-height:100%}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--footer.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--footer.sc-zonos-invoice{-ms-flex-order:3;order:3}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice{width:auto}.mobile.sc-zonos-invoice-h .zonos--cart-subtotal.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--cart-subtotal.sc-zonos-invoice{margin:0}.mobile.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-invoice-h .zonos--header-title.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--header-title.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{max-width:800px;padding:0 16px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{overflow:visible;width:100%}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{gap:32px}.mobile.sc-zonos-invoice-h .flex--wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .flex--wrapper.sc-zonos-invoice{margin-top:0}.mobile.sc-zonos-invoice-h zonos-collect-footer.sc-zonos-invoice,.tablet.sc-zonos-invoice-h zonos-collect-footer.sc-zonos-invoice{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{padding-top:56px;top:-56px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--header-right.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{padding-top:28px;top:-28px}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar{width:10px}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.zonos--invoice-language-dialog-open.sc-zonos-invoice{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{-ms-scroll-chaining:chained;overscroll-behavior:auto}";var H=V;var K=o("zonos_invoice",function(){function o(o){var e=this;n(this,o);this.storeUnsubscribeList=[];this.onChangeLocaleListener=function(){};this.mobile=false;this.tablet=false;this.stripe=window.Zonos.stripe;this.showLanguageDialogMobile=false;this.submitLoading=false;this.collapseReviewMobile=true;this.isMobile=false;this.isTablet=false;this.isOverlayLoading=true;this.isCartCollected=false;this.isCartExpired=false;this.payInUsdConfirmDialogOpen=false;this.inventoryCheckErrorMessage=null;this.confirmationId=null;this.clientSecret=t.clientSecret;this.stripeCustomerSessionClientSecret=t.stripeCustomerSessionClientSecret;this.getBaseCurrencySettlementInfo=function(){var o=a.selectedLandedCost;if(!o){return null}var n=o.landedCost.amountSubtotals;if(!n){return null}var e=(n.discounts||0)+n.items+n.landedCostTotal+n.shipping;return{settlementAmount:e}};this.applyStripeTheme=function(){return __awaiter(e,void 0,void 0,(function(){var o;return __generator(this,(function(n){switch(n.label){case 0:o=O.appearance.theme;return[4,c({overrideTheme:this.isMobile?o:undefined,paypalEnabled:y()})];case 1:n.sent();return[2]}}))}))};this.fetchCheckoutSession=function(o){return __awaiter(e,void 0,void 0,(function(){var n;return __generator(this,(function(e){switch(e.label){case 0:return[4,E("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"})];case 1:n=e.sent().json;return[2,n]}}))}))};this.checkStripePaymentIntentStatus=function(){return __awaiter(e,void 0,void 0,(function(){var o,n,e,i,s,c,a,l,v,z;return __generator(this,(function(d){switch(d.label){case 0:n=!!window.Zonos.cartData;e=new URL(window.location.href).searchParams;i=e.get("payment_intent_client_secret");s=e.get("zonosCheckoutSessionId");B("Payment intent exist, checking stripe payment intent status");if(!i){B("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:n}]}return[4,r({clientSecret:i})];case 1:c=d.sent(),a=c.error,l=c.status;v=new URLSearchParams(window.location.search).get("redirect_status");if(!(v&&s))return[3,3];if(!a){B("Payment intent is succeeded or in a good state to move forward, show success screen")}else{B("Payment intent failed, show status from error")}return[4,this.fetchCheckoutSession(s)];case 2:z=d.sent();this.confirmationId=((o=z===null||z===void 0?void 0:z.checkoutSession.landedCost)===null||o===void 0?void 0:o.shortId)||null;_.checkoutSessionId=s;t.clientSecret=i;void this.setToFinishStep(l);return[2,{shouldAllowOrder:false}];case 3:if(!n){B("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}B("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))}}o.prototype.resizeListener=function(){this.isMobile=N(this.mobile);this.isTablet=A(this.tablet)};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){t.stripe=window.Zonos.stripe;a.step="finish";this.storybookPaymentStatusOverride=o;this.isOverlayLoading=false;return[2]}))}))};o.prototype.initInvoiceCart=function(){return __awaiter(this,void 0,void 0,(function(){var o,n,e,i,s,t,c,h,u,f,m,p,w,x,y,k,I,S,j,E,P,N,A;return __generator(this,(function(D){switch(D.label){case 0:if(!window.Zonos.cartData){return[2]}p=(n=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.items[0])===null||n===void 0?void 0:n.currencyCode;if(p){a.currency=p}w=(i=(e=window.Zonos.cartData)===null||e===void 0?void 0:e.references)===null||i===void 0?void 0:i.checkoutSessionId;x=(t=(s=window.Zonos.cartData)===null||s===void 0?void 0:s.references)===null||t===void 0?void 0:t.landedCostId;if(!x){l({messages:[C("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:O.organizationName})],title:C("Invalid session")});return[2]}if(w){B("Setting checkout session id from cart reference","info",w);_.checkoutSessionId=w}else{B("Clear checkout session id from storage so we start from a fresh session for the invoice cart");_.checkoutSessionId=null}return[4,this.checkStripePaymentIntentStatus()];case 1:y=D.sent().shouldAllowOrder;if(!y){return[2]}D.label=2;case 2:D.trys.push([2,11,,12]);k=T(window.Zonos.cartData),I=k.adjustments,S=k.cartItems;return[4,v({adjustments:I,cartItems:S,landedCostId:x,shouldInitSessionOnFailure:false})];case 3:D.sent();if(!(!_.checkoutSessionId&&!w))return[3,5];return[4,z()];case 4:j=D.sent();B("stripeStoreInitCheckoutSession: ".concat(j));if(!j){throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Invoice quote but being used with sandbox credential")}D.label=5;case 5:if(!((!a.checkoutSession||((c=a.checkoutSession)===null||c===void 0?void 0:c.completedAt))&&w))return[3,9];return[4,this.fetchCheckoutSession(w)];case 6:E=D.sent();this.confirmationId=((h=E===null||E===void 0?void 0:E.checkoutSession.landedCost)===null||h===void 0?void 0:h.shortId)||null;if(!!(E===null||E===void 0?void 0:E.checkoutSession.completedAt)&&!!E.checkoutSession.order){void this.setToFinishStep("succeeded");return[2]}if(!(E===null||E===void 0?void 0:E.checkoutSession.clientSecret))return[3,8];return[4,r({clientSecret:E.checkoutSession.clientSecret})];case 7:P=D.sent().status;if(P==="processing"||P==="succeeded"){void this.setToFinishStep(P);return[2]}D.label=8;case 8:void L({endpoint:"INVALID_INVOICE_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:w,cartId:(u=window.Zonos.cartData)===null||u===void 0?void 0:u.id,cartLandedCostId:x}});throw new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it");case 9:if(!a.checkoutSession){void L({endpoint:"FAIL_TO_UPDATE_CREATE_INVOICE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this invoice cart"],metadata:{cartCheckoutSessionId:w||"N/A",cartId:(f=window.Zonos.cartData)===null||f===void 0?void 0:f.id,cartLandedCostId:x||"N/A"}});throw new Error("Could not update/create checkout session for this invoice cart")}void d();N=(m=a.checkoutSession)===null||m===void 0?void 0:m.landedCost;if(!N){throw new Error("Landed cost could not be found in checkout session after creating/updating them")}return[4,g(Object.assign(Object.assign({},a.checkoutSession),{id:_.checkoutSessionId||""}))];case 10:D.sent();void b({landedCostId:N.id});void this.applyStripeTheme();return[3,12];case 11:A=D.sent();U(A);l({messages:[C("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:O.organizationName})],title:C("Invalid session")});return[3,12];case 12:this.isOverlayLoading=false;return[2]}}))}))};o.prototype.toggleLanguageDialog=function(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile};o.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o,n,e,i,s,c,r,l,v;return __generator(this,(function(z){switch(z.label){case 0:void((o=t.stripeBillingAddressElement)===null||o===void 0?void 0:o.getValue());if(!((n=t.stripeLinkEventData)===null||n===void 0?void 0:n.complete)){s=document.querySelector("zonos-link-authentication");s===null||s===void 0?void 0:s.scrollIntoView({behavior:"smooth"});return[2]}if(!((e=t.stripeBillingAddressEventData)===null||e===void 0?void 0:e.complete)){c=document.querySelector(".zonos--billing-address");c===null||c===void 0?void 0:c.scrollIntoView({behavior:"smooth"});return[2]}r=t.checkoutSettlementCurrency==="USD";if(r&&t.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;k.paypalErrorMessage=null;t.hasPaymentError=false;this.submitLoading=true;a.inventoryCheckErrorMessage=null;return[4,h()];case 1:l=z.sent();if(!l){t.hasPaymentError=true;t.customErrorMessage=C("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:t.checkoutSettlementCurrency});this.submitLoading=false;return[2]}return[4,w()];case 2:z.sent();z.label=3;case 3:z.trys.push([3,5,,6]);return[4,u({noLandedCostCheck:true})];case 4:z.sent();a.step="finish";this.confirmationId=x.landedCostShortId||((i=a.selectedLandedCost)===null||i===void 0?void 0:i.landedCostId)||null;return[2];case 5:v=z.sent();U(v);t.hasPaymentError=true;return[3,6];case 6:this.submitLoading=false;return[2]}}))}))};o.prototype.componentWillLoad=function(){var o=this;t.stripe=window.Zonos.stripe;a.step="payment";void this.initInvoiceCart();this.resizeListener();this.storeUnsubscribeList=[f("clientSecret",(function(){void o.applyStripeTheme()})),I("selectedLocale",(function(){void o.applyStripeTheme()}))];B("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){m();p();this.onChangeLocaleListener();this.storeUnsubscribeList.forEach((function(o){return o()}))};o.prototype.render=function(){var o=this;this.clientSecret=t.clientSecret;if(t.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=t.stripeCustomerSessionClientSecret}var n=this.getBaseCurrencySettlementInfo();var c=O.appearance,r=c.logoUrl,l=c.theme;var v=function(){var o="".concat(r,"?timestamp=").concat(Date.now());return e("div",{class:"zonos--logo"},o&&e("img",{alt:"".concat(O.organizationName," logo"),src:o}))};var z=P();var d=function(){var n;var i=new URLSearchParams(window.location.search);var t=i.get("zonosQaUrl");var c=i.get("zonosDebug");var r=(n=R.find((function(o){return o.code===j.selectedLocale})))===null||n===void 0?void 0:n.label;return e(s,null,e("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},e("div",{class:"zonos--logo-wrapper"},v(),z&&e("zonos-badge",{badgeColor:"orange",size:"small"},C("Test mode")),c==="1"&&e("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&e("zonos-badge",{badgeColor:"purple",size:"small"},t)),e("div",{class:"zonos--header-right"},e("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:function(){return o.toggleLanguageDialog()},variant:"outline"},r,e("zonos-icon",{"aria-label":"Language select",content:F,iconColor:"gray-1200"})),e("div",{class:D(["zonos--invoice-language-dialog",o.showLanguageDialogMobile&&"zonos--invoice-language-dialog-open"])},e("zonos-language-select",{handleOnClose:function(){return o.toggleLanguageDialog()}})))))};var h=function(){if(o.isOverlayLoading||t.isFetchingSession){return null}return e("div",{class:"zonos--content"},a.step!=="finish"&&a.step!=="error"&&e(s,null,(o.isMobile||o.isTablet)&&d(),e("div",{class:"zonos--left","data-theme":l},!o.isMobile&&!o.isTablet&&d(),e("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},C("Billing info")),e("zonos-v-stack",{spacing:16},e("zonos-link-authentication",{titleText:""}),e("zonos-address",{titleText:"",type:"billing"})),e("zonos-invoice-payment",{class:D(["zonos--invoice-container"]),continueLoading:o.submitLoading,onContinueClicked:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleStripePaymentContinue()];case 1:o.sent();return[2]}}))}))}})),e("div",{class:"zonos--right","data-theme":l},!o.isMobile&&e("zonos-invoice-review",{mobile:o.isMobile,tablet:o.isTablet}),e("div",{class:"zonos--order-details-container"},!o.isMobile&&e("zonos-invoice-cart-items",null),o.isMobile&&e("zonos-invoice-order-details",{collapsed:o.collapseReviewMobile,mobile:o.isMobile,onCollapseClicked:function(){o.collapseReviewMobile=!o.collapseReviewMobile}})),e("div",{class:"flex--wrapper"},!o.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-invoice-subtotal",null)),!o.isMobile&&!o.isTablet&&e("zonos-invoice-footer",{"data-theme":l,mobile:o.isMobile,tablet:o.isTablet})))),(a.step==="finish"||a.step==="error")&&e("div",{class:"zonos--done","data-theme":l},e("div",{class:"zonos--header"},v()),e("zonos-invoice-finish",{confirmationId:o.confirmationId,overrideNotification:a.step==="error"&&!!a.error?Object.assign(Object.assign({},a.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})),(o.isMobile||o.isTablet||a.step==="finish"||a.step==="error")&&e("zonos-invoice-footer",{"data-theme":l,mobile:o.isMobile,tablet:o.isTablet}))};return e(i,{class:D(["zonos--invoice zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":l},h(),n&&e("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:C("Cancel"),dialogConfirmBtnText:C("Pay [orderTotal]",{orderTotal:S({amount:n.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:C("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:C("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){o.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return o.handleStripePaymentContinue()}}),e("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());K.style=H}}}));
1
+ var __awaiter=this&&this.__awaiter||function(o,n,e,i){function s(o){return o instanceof e?o:new e((function(n){n(o)}))}return new(e||(e=Promise))((function(e,t){function c(o){try{a(i.next(o))}catch(o){t(o)}}function r(o){try{a(i["throw"](o))}catch(o){t(o)}}function a(o){o.done?e(o.value):s(o.value).then(c,r)}a((i=i.apply(o,n||[])).next())}))};var __generator=this&&this.__generator||function(o,n){var e={label:0,sent:function(){if(t[0]&1)throw t[1];return t[1]},trys:[],ops:[]},i,s,t,c;return c={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(c[Symbol.iterator]=function(){return this}),c;function r(o){return function(n){return a([o,n])}}function a(r){if(i)throw new TypeError("Generator is already executing.");while(c&&(c=0,r[0]&&(e=0)),e)try{if(i=1,s&&(t=r[0]&2?s["return"]:r[0]?s["throw"]||((t=s["return"])&&t.call(s),0):s.next)&&!(t=t.call(s,r[1])).done)return t;if(s=0,t)r=[r[0]&2,t.value];switch(r[0]){case 0:case 1:t=r;break;case 4:e.label++;return{value:r[1],done:false};case 5:e.label++;s=r[1];r=[0];continue;case 7:r=e.ops.pop();e.trys.pop();continue;default:if(!(t=e.trys,t=t.length>0&&t[t.length-1])&&(r[0]===6||r[0]===2)){e=0;continue}if(r[0]===3&&(!t||r[1]>t[0]&&r[1]<t[3])){e.label=r[1];break}if(r[0]===6&&e.label<t[1]){e.label=t[1];t=r;break}if(t&&e.label<t[2]){e.label=t[2];e.ops.push(r);break}if(t[2])e.ops.pop();e.trys.pop();continue}r=n.call(o,e)}catch(o){r=[6,o];s=0}finally{i=t=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-df316670.system.js","./p-90b8c428.system.js","./p-2b7ef406.system.js","./p-9c6917ab.system.js","./p-ac30b7a8.system.js","./p-398d9022.system.js","./p-01174496.system.js","./p-6f23a26a.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js","./p-c9e433c0.system.js","./p-d18a2b2c.system.js","./p-7501c637.system.js","./p-8c6624b6.system.js","./p-ab25379f.system.js"],(function(o){"use strict";var n,e,i,s,t,c,r,a,l,v,z,d,h,u,f,m,p,g,b,w,x,y,k,_,C,I,S,j,O,T,E,L,U,P,N,A,D,B,R;return{setters:[function(o){n=o.r;e=o.h;i=o.a;s=o.F},function(o){t=o.b;c=o.i;r=o.c;a=o.d;l=o.n;v=o.e;z=o.j;d=o.k;h=o.u;u=o.A;f=o.F;m=o.C;p=o.f},function(o){g=o.i;b=o.a;w=o.b;x=o.c},function(o){y=o.p;k=o.a},function(o){_=o.s;C=o.t;I=o.c;S=o.d;j=o.l},function(o){O=o.z},function(o){T=o.b},function(o){E=o.h;L=o.s;U=o.l;P=o.g},function(o){N=o.i;A=o.a},function(o){D=o.c},function(o){B=o.l},function(o){R=o.l},function(){},function(){},function(){},function(){}],execute:function(){var F='<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var V=".sc-zonos-invoice-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-invoice-h *.sc-zonos-invoice{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-invoice-h img.sc-zonos-invoice{max-width:100%}.sc-zonos-invoice-h dl.sc-zonos-invoice,.sc-zonos-invoice-h dd.sc-zonos-invoice,.sc-zonos-invoice-h h1.sc-zonos-invoice,.sc-zonos-invoice-h h2.sc-zonos-invoice,.sc-zonos-invoice-h h3.sc-zonos-invoice,.sc-zonos-invoice-h h4.sc-zonos-invoice,.sc-zonos-invoice-h h5.sc-zonos-invoice,.sc-zonos-invoice-h h6.sc-zonos-invoice,.sc-zonos-invoice-h hr.sc-zonos-invoice,.sc-zonos-invoice-h figure.sc-zonos-invoice,.sc-zonos-invoice-h p.sc-zonos-invoice,.sc-zonos-invoice-h pre.sc-zonos-invoice{margin:0}.sc-zonos-invoice-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-invoice-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-invoice-h *.sc-zonos-invoice{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar{width:10px}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-invoice-h *.sc-zonos-invoice::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{background-color:var(--zonos-elements-gray-0)}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice{width:100%;max-width:1400px;max-height:100%;height:calc(100% - 100px);overflow:hidden;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice .zonos--header.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice .zonos--logo.sc-zonos-invoice{margin-bottom:0}.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice zonos-checkout-finish.sc-zonos-invoice{-ms-flex:1;flex:1}.sc-zonos-invoice-h .zonos--header-title.sc-zonos-invoice,.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{max-width:800px}.sc-zonos-invoice-h .zonos--left.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-invoice-h .zonos--left.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice{padding:0 8px 8px}.sc-zonos-invoice-h .zonos--left.sc-zonos-invoice .zonos--payment-error-banner.sc-zonos-invoice{margin-top:24px}.sc-zonos-invoice-h .zonos--right.sc-zonos-invoice{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-invoice-h .zonos--right.sc-zonos-invoice .zonos--order-details-container.sc-zonos-invoice{overflow:auto}.sc-zonos-invoice-h .zonos--wrapper.sc-zonos-invoice{overflow:auto;max-height:100%;position:relative}.sc-zonos-invoice-h .flex--wrapper.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-invoice-h .zonos--logo-wrapper.sc-zonos-invoice{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-invoice-h .zonos--logo-wrapper.sc-zonos-invoice>*.sc-zonos-invoice{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-invoice-h .zonos--header-right.sc-zonos-invoice{display:none}.sc-zonos-invoice-h .zonos--logo.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-invoice-h .zonos--logo.sc-zonos-invoice img.sc-zonos-invoice{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-invoice-h .zonos--invoice-container.sc-zonos-invoice{overflow:visible}.mobile.sc-zonos-invoice-h,.tablet.sc-zonos-invoice-h{min-width:auto}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{padding-bottom:0}}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--review.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--review.sc-zonos-invoice{margin-bottom:0}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--cart-items.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice .zonos--cart-items.sc-zonos-invoice{margin-top:8px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice zonos-checkout-footer.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice zonos-checkout-footer.sc-zonos-invoice{-ms-flex-order:3;order:3}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--wrapper.sc-zonos-invoice{max-height:100%}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--footer.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--footer.sc-zonos-invoice{-ms-flex-order:3;order:3}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--done.sc-zonos-invoice{width:auto}.mobile.sc-zonos-invoice-h .zonos--cart-subtotal.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--cart-subtotal.sc-zonos-invoice{margin:0}.mobile.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-invoice-h .zonos--header-title.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--header-title.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{max-width:800px;padding:0 16px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--left.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{overflow:visible;width:100%}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--right.sc-zonos-invoice{gap:32px}.mobile.sc-zonos-invoice-h .flex--wrapper.sc-zonos-invoice,.tablet.sc-zonos-invoice-h .flex--wrapper.sc-zonos-invoice{margin-top:0}.mobile.sc-zonos-invoice-h zonos-collect-footer.sc-zonos-invoice,.tablet.sc-zonos-invoice-h zonos-collect-footer.sc-zonos-invoice{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{padding-top:56px;top:-56px}.mobile.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice .zonos--header-right.sc-zonos-invoice{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-invoice-h .zonos--header-wrapper.sc-zonos-invoice{padding-top:28px;top:-28px}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar{width:10px}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.sc-zonos-invoice::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-invoice-h .zonos--invoice-language-dialog.zonos--invoice-language-dialog-open.sc-zonos-invoice{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-invoice-h .zonos--content.sc-zonos-invoice{-ms-scroll-chaining:chained;overscroll-behavior:auto}";var H=V;var K=o("zonos_invoice",function(){function o(o){var e=this;n(this,o);this.storeUnsubscribeList=[];this.onChangeLocaleListener=function(){};this.mobile=false;this.tablet=false;this.stripe=window.Zonos.stripe;this.showLanguageDialogMobile=false;this.submitLoading=false;this.collapseReviewMobile=true;this.isMobile=false;this.isTablet=false;this.isOverlayLoading=true;this.isCartCollected=false;this.isCartExpired=false;this.payInUsdConfirmDialogOpen=false;this.inventoryCheckErrorMessage=null;this.confirmationId=null;this.clientSecret=t.clientSecret;this.stripeCustomerSessionClientSecret=t.stripeCustomerSessionClientSecret;this.getBaseCurrencySettlementInfo=function(){var o=a.selectedLandedCost;if(!o){return null}var n=o.landedCost.amountSubtotals;if(!n){return null}var e=(n.discounts||0)+n.items+n.landedCostTotal+n.shipping;return{settlementAmount:e}};this.applyStripeTheme=function(){return __awaiter(e,void 0,void 0,(function(){var o;return __generator(this,(function(n){switch(n.label){case 0:o=O.appearance.theme;return[4,c({overrideTheme:this.isMobile?o:undefined,paypalEnabled:y()})];case 1:n.sent();return[2]}}))}))};this.fetchCheckoutSession=function(o){return __awaiter(e,void 0,void 0,(function(){var n;return __generator(this,(function(e){switch(e.label){case 0:return[4,E("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"})];case 1:n=e.sent().json;return[2,n]}}))}))};this.checkStripePaymentIntentStatus=function(){return __awaiter(e,void 0,void 0,(function(){var o,n,e,i,s,c,a,l,v,z;return __generator(this,(function(d){switch(d.label){case 0:n=!!window.Zonos.cartData;e=new URL(window.location.href).searchParams;i=e.get("payment_intent_client_secret");s=e.get("zonosCheckoutSessionId");B("Payment intent exist, checking stripe payment intent status");if(!i){B("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:n}]}return[4,r({clientSecret:i})];case 1:c=d.sent(),a=c.error,l=c.status;v=new URLSearchParams(window.location.search).get("redirect_status");if(!(v&&s))return[3,3];if(!a){B("Payment intent is succeeded or in a good state to move forward, show success screen")}else{B("Payment intent failed, show status from error")}return[4,this.fetchCheckoutSession(s)];case 2:z=d.sent();this.confirmationId=((o=z===null||z===void 0?void 0:z.checkoutSession.landedCost)===null||o===void 0?void 0:o.shortId)||null;_.checkoutSessionId=s;t.clientSecret=i;void this.setToFinishStep(l);return[2,{shouldAllowOrder:false}];case 3:if(!n){B("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}B("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))}}o.prototype.resizeListener=function(){this.isMobile=N(this.mobile);this.isTablet=A(this.tablet)};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){t.stripe=window.Zonos.stripe;a.step="finish";this.storybookPaymentStatusOverride=o;this.isOverlayLoading=false;return[2]}))}))};o.prototype.initInvoiceCart=function(){return __awaiter(this,void 0,void 0,(function(){var o,n,e,i,s,t,c,h,u,f,m,p,w,x,y,k,I,S,j,E,P,N,A;return __generator(this,(function(D){switch(D.label){case 0:if(!window.Zonos.cartData){return[2]}p=(n=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.items[0])===null||n===void 0?void 0:n.currencyCode;if(p){a.currency=p}w=(i=(e=window.Zonos.cartData)===null||e===void 0?void 0:e.references)===null||i===void 0?void 0:i.checkoutSessionId;x=(t=(s=window.Zonos.cartData)===null||s===void 0?void 0:s.references)===null||t===void 0?void 0:t.landedCostId;if(!x){l({messages:[C("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:O.organizationName})],title:C("Invalid session")});return[2]}if(w){B("Setting checkout session id from cart reference","info",w);_.checkoutSessionId=w}else{B("Clear checkout session id from storage so we start from a fresh session for the invoice cart");_.checkoutSessionId=null}return[4,this.checkStripePaymentIntentStatus()];case 1:y=D.sent().shouldAllowOrder;if(!y){return[2]}D.label=2;case 2:D.trys.push([2,11,,12]);k=T(window.Zonos.cartData),I=k.adjustments,S=k.cartItems;return[4,v({adjustments:I,cartItems:S,landedCostId:x,shouldInitSessionOnFailure:false})];case 3:D.sent();if(!(!_.checkoutSessionId&&!w))return[3,5];return[4,z()];case 4:j=D.sent();B("stripeStoreInitCheckoutSession: ".concat(j));if(!j){throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Invoice quote but being used with sandbox credential")}D.label=5;case 5:if(!((!a.checkoutSession||((c=a.checkoutSession)===null||c===void 0?void 0:c.completedAt))&&w))return[3,9];return[4,this.fetchCheckoutSession(w)];case 6:E=D.sent();this.confirmationId=((h=E===null||E===void 0?void 0:E.checkoutSession.landedCost)===null||h===void 0?void 0:h.shortId)||null;if(!!(E===null||E===void 0?void 0:E.checkoutSession.completedAt)&&!!E.checkoutSession.order){void this.setToFinishStep("succeeded");return[2]}if(!(E===null||E===void 0?void 0:E.checkoutSession.clientSecret))return[3,8];return[4,r({clientSecret:E.checkoutSession.clientSecret})];case 7:P=D.sent().status;if(P==="processing"||P==="succeeded"){void this.setToFinishStep(P);return[2]}D.label=8;case 8:void L({endpoint:"INVALID_INVOICE_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:w,cartId:(u=window.Zonos.cartData)===null||u===void 0?void 0:u.id,cartLandedCostId:x}});throw new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it");case 9:if(!a.checkoutSession){void L({endpoint:"FAIL_TO_UPDATE_CREATE_INVOICE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this invoice cart"],metadata:{cartCheckoutSessionId:w||"N/A",cartId:(f=window.Zonos.cartData)===null||f===void 0?void 0:f.id,cartLandedCostId:x||"N/A"}});throw new Error("Could not update/create checkout session for this invoice cart")}void d();N=(m=a.checkoutSession)===null||m===void 0?void 0:m.landedCost;if(!N){throw new Error("Landed cost could not be found in checkout session after creating/updating them")}return[4,g(Object.assign(Object.assign({},a.checkoutSession),{id:_.checkoutSessionId||""}))];case 10:D.sent();void b({landedCostId:N.id});void this.applyStripeTheme();return[3,12];case 11:A=D.sent();U(A);l({messages:[C("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:O.organizationName})],title:C("Invalid session")});return[3,12];case 12:this.isOverlayLoading=false;return[2]}}))}))};o.prototype.toggleLanguageDialog=function(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile};o.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o,n,e,i,s,c,r,l,v;return __generator(this,(function(z){switch(z.label){case 0:void((o=t.stripeBillingAddressElement)===null||o===void 0?void 0:o.getValue());if(!((n=t.stripeLinkEventData)===null||n===void 0?void 0:n.complete)){s=document.querySelector("zonos-link-authentication");s===null||s===void 0?void 0:s.scrollIntoView({behavior:"smooth"});return[2]}if(!((e=t.stripeBillingAddressEventData)===null||e===void 0?void 0:e.complete)){c=document.querySelector(".zonos--billing-address");c===null||c===void 0?void 0:c.scrollIntoView({behavior:"smooth"});return[2]}r=t.checkoutSettlementCurrency==="USD";if(r&&t.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;k.paypalErrorMessage=null;t.hasPaymentError=false;this.submitLoading=true;a.inventoryCheckErrorMessage=null;return[4,h()];case 1:l=z.sent();if(!l){t.hasPaymentError=true;t.customErrorMessage=C("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:t.checkoutSettlementCurrency});this.submitLoading=false;return[2]}return[4,w()];case 2:z.sent();z.label=3;case 3:z.trys.push([3,5,,6]);return[4,u({noLandedCostCheck:true})];case 4:z.sent();a.step="finish";this.confirmationId=x.landedCostShortId||((i=a.selectedLandedCost)===null||i===void 0?void 0:i.landedCostId)||null;return[2];case 5:v=z.sent();U(v);t.hasPaymentError=true;return[3,6];case 6:this.submitLoading=false;return[2]}}))}))};o.prototype.componentWillLoad=function(){var o=this;t.stripe=window.Zonos.stripe;a.step="payment";void this.initInvoiceCart();this.resizeListener();this.storeUnsubscribeList=[f("clientSecret",(function(){void o.applyStripeTheme()})),I("selectedLocale",(function(){void o.applyStripeTheme()}))];B("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){m();p();this.onChangeLocaleListener();this.storeUnsubscribeList.forEach((function(o){return o()}))};o.prototype.render=function(){var o=this;this.clientSecret=t.clientSecret;if(t.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=t.stripeCustomerSessionClientSecret}var n=this.getBaseCurrencySettlementInfo();var c=O.appearance,r=c.logoUrl,l=c.theme;var v=function(){var o="".concat(r,"?timestamp=").concat(Date.now());return e("div",{class:"zonos--logo"},o&&e("img",{alt:"".concat(O.organizationName," logo"),src:o}))};var z=P();var d=function(){var n;var i=new URLSearchParams(window.location.search);var t=i.get("zonosQaUrl");var c=i.get("zonosDebug");var r=(n=R.find((function(o){return o.code===j.selectedLocale})))===null||n===void 0?void 0:n.label;return e(s,null,e("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},e("div",{class:"zonos--logo-wrapper"},v(),z&&e("zonos-badge",{badgeColor:"orange",size:"small"},C("Test mode")),c==="1"&&e("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&e("zonos-badge",{badgeColor:"purple",size:"small"},t)),e("div",{class:"zonos--header-right"},e("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:function(){return o.toggleLanguageDialog()},variant:"outline"},r,e("zonos-icon",{"aria-label":"Language select",content:F,iconColor:"gray-1200"})),e("div",{class:D(["zonos--invoice-language-dialog",o.showLanguageDialogMobile&&"zonos--invoice-language-dialog-open"])},e("zonos-language-select",{handleOnClose:function(){return o.toggleLanguageDialog()}})))))};var h=function(){if(o.isOverlayLoading||t.isFetchingSession){return null}return e("div",{class:"zonos--content"},a.step!=="finish"&&a.step!=="error"&&e(s,null,(o.isMobile||o.isTablet)&&d(),e("div",{class:"zonos--left","data-theme":l},!o.isMobile&&!o.isTablet&&d(),e("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},C("Billing info")),e("zonos-v-stack",{spacing:16},e("zonos-link-authentication",{titleText:""}),e("zonos-address",{titleText:"",type:"billing"})),e("zonos-invoice-payment",{class:D(["zonos--invoice-container"]),continueLoading:o.submitLoading,onContinueClicked:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleStripePaymentContinue()];case 1:o.sent();return[2]}}))}))}})),e("div",{class:"zonos--right","data-theme":l},!o.isMobile&&e("zonos-invoice-review",{mobile:o.isMobile,tablet:o.isTablet}),e("div",{class:"zonos--order-details-container"},!o.isMobile&&e("zonos-invoice-cart-items",null),o.isMobile&&e("zonos-invoice-order-details",{collapsed:o.collapseReviewMobile,mobile:o.isMobile,onCollapseClicked:function(){o.collapseReviewMobile=!o.collapseReviewMobile}})),e("div",{class:"flex--wrapper"},!o.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-invoice-subtotal",null)),!o.isMobile&&!o.isTablet&&e("zonos-invoice-footer",{"data-theme":l,mobile:o.isMobile,tablet:o.isTablet})))),(a.step==="finish"||a.step==="error")&&e("div",{class:"zonos--done","data-theme":l},e("div",{class:"zonos--header"},v()),e("zonos-invoice-finish",{confirmationId:o.confirmationId,overrideNotification:a.step==="error"&&!!a.error?Object.assign(Object.assign({},a.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})),(o.isMobile||o.isTablet||a.step==="finish"||a.step==="error")&&e("zonos-invoice-footer",{"data-theme":l,mobile:o.isMobile,tablet:o.isTablet}))};return e(i,{class:D(["zonos--invoice zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":l},h(),n&&e("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:C("Cancel"),dialogConfirmBtnText:C("Pay [orderTotal]",{orderTotal:S({amount:n.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:C("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:C("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){o.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return o.handleStripePaymentContinue()}}),e("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());K.style=H}}}));