@zonos/elements 1.3.274 → 1.3.276

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 (355) hide show
  1. package/dist/cjs/{cart-660e115c.js → cart-65e8da66.js} +41 -15
  2. package/dist/cjs/{cleanHtmlMarkdown-31da84b7.js → cleanHtmlMarkdown-57147de7.js} +180 -356
  3. package/dist/cjs/{collect-286a9d04.js → collect-37c177ab.js} +3 -3
  4. package/dist/cjs/{debounce-7990f5ea.js → debounce-9a712c79.js} +1 -1
  5. package/dist/cjs/{getBorderRadius-fc683d94.js → getBorderRadius-4da24d7c.js} +1 -1
  6. package/dist/cjs/{getContrastColor-d5134ef3.js → getContrastColor-2fb235b8.js} +2 -2
  7. package/dist/cjs/{hasInclusivePrice-b35e81aa.js → hasInclusivePrice-798ce42d.js} +1 -1
  8. package/dist/cjs/index.cjs.js +7 -7
  9. package/dist/cjs/{invoice-f032089f.js → invoice-96f5c802.js} +3 -3
  10. package/dist/cjs/{isContrastColor-76592c92.js → isContrastColor-ef24b7aa.js} +1 -1
  11. package/dist/cjs/{isDarkColor-5d6ca405.js → isDarkColor-ebc74b4d.js} +1 -1
  12. package/dist/cjs/{localization-f4a64f6f.js → localization-90650d7d.js} +61 -1
  13. package/dist/cjs/{paypal-125259ab.js → paypal-1952f6ec.js} +5 -5
  14. package/dist/cjs/{placeTestOrder-02001a99.js → placeTestOrder-30191a8f.js} +2 -2
  15. package/dist/cjs/{renderCheckoutCurrency-cad156a7.js → renderCheckoutCurrency-fd35b4ef.js} +2 -2
  16. package/dist/cjs/{submitGtag-4906b161.js → submitGtag-74762255.js} +1 -1
  17. package/dist/cjs/{throttle-02c2e917.js → throttle-34f7abf1.js} +2 -2
  18. package/dist/cjs/{updateCheckoutSessionAttributes-47d73942.js → updateCheckoutSessionAttributes-f595319d.js} +1 -1
  19. package/dist/cjs/zonos-address-display_8.cjs.entry.js +444 -202
  20. package/dist/cjs/zonos-address_4.cjs.entry.js +7 -7
  21. package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +7 -6
  22. package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  24. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  25. package/dist/cjs/zonos-card_5.cjs.entry.js +9 -8
  26. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +83 -18
  27. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +3 -3
  28. package/dist/cjs/zonos-checkout.cjs.entry.js +11 -10
  29. package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
  30. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +7 -6
  31. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +12 -11
  32. package/dist/cjs/zonos-collect.cjs.entry.js +10 -9
  33. package/dist/cjs/zonos-controller.cjs.entry.js +7 -6
  34. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  35. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1514 -1692
  36. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
  37. package/dist/cjs/zonos-hello.cjs.entry.js +3 -3
  38. package/dist/cjs/zonos-input.cjs.entry.js +2 -2
  39. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +8 -7
  40. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +12 -11
  41. package/dist/cjs/zonos-invoice.cjs.entry.js +10 -9
  42. package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
  43. package/dist/cjs/zonos-logo.cjs.entry.js +1 -1
  44. package/dist/cjs/zonos-policy-consent_2.cjs.entry.js +7 -6
  45. package/dist/cjs/zonos-shipping-rich-radio.cjs.entry.js +5 -5
  46. package/dist/cjs/zonos-stripe-input.cjs.entry.js +3 -3
  47. package/dist/cjs/zonos-text.cjs.entry.js +1 -1
  48. package/dist/cjs/zonos-v-stack.cjs.entry.js +1 -1
  49. package/dist/collection/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.js +52 -1
  50. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +1 -1
  51. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +18 -2
  52. package/dist/collection/components/common/zonos-stripe-phone-input/zonos-stripe-phone-input.js +1 -1
  53. package/dist/collection/components/main/zonos-controller.js +1 -1
  54. package/dist/collection/components/store/checkout/cart.js +21 -11
  55. package/dist/collection/components/store/translationStore/strings.arabic.js +3 -0
  56. package/dist/collection/components/store/translationStore/strings.base.js +3 -0
  57. package/dist/collection/components/store/translationStore/strings.chinese.js +3 -0
  58. package/dist/collection/components/store/translationStore/strings.danish.js +3 -0
  59. package/dist/collection/components/store/translationStore/strings.dutch.js +3 -0
  60. package/dist/collection/components/store/translationStore/strings.french.js +3 -0
  61. package/dist/collection/components/store/translationStore/strings.german.js +3 -0
  62. package/dist/collection/components/store/translationStore/strings.hebrew.js +3 -0
  63. package/dist/collection/components/store/translationStore/strings.indonesian.js +3 -0
  64. package/dist/collection/components/store/translationStore/strings.italian.js +3 -0
  65. package/dist/collection/components/store/translationStore/strings.japanese.js +3 -0
  66. package/dist/collection/components/store/translationStore/strings.korean.js +3 -0
  67. package/dist/collection/components/store/translationStore/strings.norwegian.js +3 -0
  68. package/dist/collection/components/store/translationStore/strings.polish.js +3 -0
  69. package/dist/collection/components/store/translationStore/strings.portuguese.js +3 -0
  70. package/dist/collection/components/store/translationStore/strings.russian.js +3 -0
  71. package/dist/collection/components/store/translationStore/strings.spanish.js +3 -0
  72. package/dist/collection/components/store/translationStore/strings.swedish.js +3 -0
  73. package/dist/collection/components/store/translationStore/strings.turkish.js +3 -0
  74. package/dist/collection/components/store/translationStore/strings.vietnamese.js +3 -0
  75. package/dist/collection/components/utils/checkout/isEuDapRemittance.js +15 -0
  76. package/dist/collection/types/generated/graphql.internal.types.js +78 -0
  77. package/dist/esm/{cart-23e29950.js → cart-402dcde5.js} +41 -16
  78. package/dist/esm/{cleanHtmlMarkdown-5f7856f2.js → cleanHtmlMarkdown-87d195f6.js} +180 -356
  79. package/dist/esm/{collect-a235299d.js → collect-b88fe4ca.js} +3 -3
  80. package/dist/esm/{debounce-58e4ff3e.js → debounce-c8d67b17.js} +1 -1
  81. package/dist/esm/{getBorderRadius-d23f47a6.js → getBorderRadius-dc982fe6.js} +1 -1
  82. package/dist/esm/{getContrastColor-f0bd5b65.js → getContrastColor-af895b60.js} +2 -2
  83. package/dist/esm/{hasInclusivePrice-5e106f84.js → hasInclusivePrice-1589fef9.js} +1 -1
  84. package/dist/esm/index.js +7 -7
  85. package/dist/esm/{invoice-78f069c7.js → invoice-5eb27944.js} +3 -3
  86. package/dist/esm/{isContrastColor-fbddacb6.js → isContrastColor-089de6ac.js} +1 -1
  87. package/dist/esm/{isDarkColor-566f04c5.js → isDarkColor-039ef212.js} +1 -1
  88. package/dist/esm/{localization-17546792.js → localization-d49867ed.js} +61 -1
  89. package/dist/esm/{paypal-5bc6b0d0.js → paypal-2d4c9d01.js} +5 -5
  90. package/dist/esm/{placeTestOrder-e842854a.js → placeTestOrder-2ba7c3f2.js} +2 -2
  91. package/dist/esm/{renderCheckoutCurrency-e3953f67.js → renderCheckoutCurrency-ef71083e.js} +2 -2
  92. package/dist/esm/{submitGtag-c7ea1f2a.js → submitGtag-dc54f5b9.js} +1 -1
  93. package/dist/esm/{throttle-f09d0659.js → throttle-44bfb6b5.js} +2 -2
  94. package/dist/esm/{updateCheckoutSessionAttributes-40e301a4.js → updateCheckoutSessionAttributes-e0a282d9.js} +1 -1
  95. package/dist/esm/zonos-address-display_8.entry.js +444 -202
  96. package/dist/esm/zonos-address_4.entry.js +7 -7
  97. package/dist/esm/zonos-airwallex-payment.entry.js +7 -6
  98. package/dist/esm/zonos-badge.entry.js +1 -1
  99. package/dist/esm/zonos-banner.entry.js +1 -1
  100. package/dist/esm/zonos-button_3.entry.js +3 -3
  101. package/dist/esm/zonos-card_5.entry.js +9 -8
  102. package/dist/esm/zonos-cart-items_12.entry.js +83 -18
  103. package/dist/esm/zonos-checkbox_2.entry.js +3 -3
  104. package/dist/esm/zonos-checkout.entry.js +11 -10
  105. package/dist/esm/zonos-collapse.entry.js +1 -1
  106. package/dist/esm/zonos-collect-cart-items_3.entry.js +7 -6
  107. package/dist/esm/zonos-collect-finish_6.entry.js +12 -11
  108. package/dist/esm/zonos-collect.entry.js +10 -9
  109. package/dist/esm/zonos-controller.entry.js +7 -6
  110. package/dist/esm/zonos-country-flag.entry.js +2 -2
  111. package/dist/esm/zonos-country-select_4.entry.js +1514 -1692
  112. package/dist/esm/zonos-hello-dialog.entry.js +3 -3
  113. package/dist/esm/zonos-hello.entry.js +3 -3
  114. package/dist/esm/zonos-input.entry.js +2 -2
  115. package/dist/esm/zonos-invoice-cart-items_2.entry.js +8 -7
  116. package/dist/esm/zonos-invoice-finish_5.entry.js +12 -11
  117. package/dist/esm/zonos-invoice.entry.js +10 -9
  118. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  119. package/dist/esm/zonos-logo.entry.js +1 -1
  120. package/dist/esm/zonos-policy-consent_2.entry.js +7 -6
  121. package/dist/esm/zonos-shipping-rich-radio.entry.js +5 -5
  122. package/dist/esm/zonos-stripe-input.entry.js +3 -3
  123. package/dist/esm/zonos-text.entry.js +1 -1
  124. package/dist/esm/zonos-v-stack.entry.js +1 -1
  125. package/dist/esm-es5/cart-402dcde5.js +1 -0
  126. package/dist/esm-es5/cleanHtmlMarkdown-87d195f6.js +1 -0
  127. package/dist/esm-es5/{collect-a235299d.js → collect-b88fe4ca.js} +1 -1
  128. package/dist/esm-es5/{debounce-58e4ff3e.js → debounce-c8d67b17.js} +1 -1
  129. package/dist/esm-es5/{getBorderRadius-d23f47a6.js → getBorderRadius-dc982fe6.js} +1 -1
  130. package/dist/esm-es5/{getContrastColor-f0bd5b65.js → getContrastColor-af895b60.js} +1 -1
  131. package/dist/esm-es5/{hasInclusivePrice-5e106f84.js → hasInclusivePrice-1589fef9.js} +1 -1
  132. package/dist/esm-es5/index.js +1 -1
  133. package/dist/esm-es5/{invoice-78f069c7.js → invoice-5eb27944.js} +1 -1
  134. package/dist/esm-es5/{isContrastColor-fbddacb6.js → isContrastColor-089de6ac.js} +1 -1
  135. package/dist/esm-es5/{isDarkColor-566f04c5.js → isDarkColor-039ef212.js} +1 -1
  136. package/dist/esm-es5/localization-d49867ed.js +1 -0
  137. package/dist/esm-es5/{paypal-5bc6b0d0.js → paypal-2d4c9d01.js} +1 -1
  138. package/dist/esm-es5/{placeTestOrder-e842854a.js → placeTestOrder-2ba7c3f2.js} +1 -1
  139. package/dist/esm-es5/{renderCheckoutCurrency-e3953f67.js → renderCheckoutCurrency-ef71083e.js} +1 -1
  140. package/dist/esm-es5/{submitGtag-c7ea1f2a.js → submitGtag-dc54f5b9.js} +1 -1
  141. package/dist/esm-es5/throttle-44bfb6b5.js +1 -0
  142. package/dist/esm-es5/{updateCheckoutSessionAttributes-40e301a4.js → updateCheckoutSessionAttributes-e0a282d9.js} +1 -1
  143. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
  144. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  145. package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
  146. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  147. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  148. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  149. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  150. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  151. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
  152. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  153. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  154. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  155. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  156. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  157. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  158. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  159. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  160. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  161. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  162. package/dist/esm-es5/zonos-input.entry.js +1 -1
  163. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  164. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  165. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  166. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  167. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  168. package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -1
  169. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  170. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  171. package/dist/esm-es5/zonos-text.entry.js +1 -1
  172. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  173. package/dist/scripts/analyticsRelayOnInit.js +1 -1
  174. package/dist/scripts/blurCurrencyOnInit.js +1 -1
  175. package/dist/scripts/index.d.ts +11 -0
  176. package/dist/scripts/index.js +1 -1
  177. package/dist/scripts/loadZonos.js +1 -1
  178. package/dist/scripts/zonos.js +1 -1
  179. package/dist/types/components/checkout/zonos-checkout/zonos-cart-subtotal/zonos-cart-subtotal.d.ts +8 -0
  180. package/dist/types/components/store/checkout/cart.d.ts +2 -2
  181. package/dist/types/components/store/translationStore/strings.arabic.d.ts +3 -0
  182. package/dist/types/components/store/translationStore/strings.base.d.ts +3 -0
  183. package/dist/types/components/store/translationStore/strings.chinese.d.ts +3 -0
  184. package/dist/types/components/store/translationStore/strings.danish.d.ts +3 -0
  185. package/dist/types/components/store/translationStore/strings.dutch.d.ts +3 -0
  186. package/dist/types/components/store/translationStore/strings.french.d.ts +3 -0
  187. package/dist/types/components/store/translationStore/strings.german.d.ts +3 -0
  188. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +3 -0
  189. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +3 -0
  190. package/dist/types/components/store/translationStore/strings.italian.d.ts +3 -0
  191. package/dist/types/components/store/translationStore/strings.japanese.d.ts +3 -0
  192. package/dist/types/components/store/translationStore/strings.korean.d.ts +3 -0
  193. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +3 -0
  194. package/dist/types/components/store/translationStore/strings.polish.d.ts +3 -0
  195. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +3 -0
  196. package/dist/types/components/store/translationStore/strings.russian.d.ts +3 -0
  197. package/dist/types/components/store/translationStore/strings.spanish.d.ts +3 -0
  198. package/dist/types/components/store/translationStore/strings.swedish.d.ts +3 -0
  199. package/dist/types/components/store/translationStore/strings.turkish.d.ts +3 -0
  200. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +3 -0
  201. package/dist/types/components/utils/checkout/isEuDapRemittance.d.ts +15 -0
  202. package/dist/types/types/generated/graphql.internal.types.d.ts +94 -0
  203. package/dist/types/types/generated/graphql.internal.types.ts +114 -7
  204. package/dist/zonos-elements/index.esm.js +1 -1
  205. package/dist/zonos-elements/{p-ccd14aa5.entry.js → p-0745e440.entry.js} +1 -1
  206. package/dist/zonos-elements/{p-59b10526.entry.js → p-08e78d79.entry.js} +1 -1
  207. package/dist/zonos-elements/{p-c846a5f3.system.entry.js → p-0ad6a92b.system.entry.js} +1 -1
  208. package/dist/zonos-elements/p-0b321037.system.entry.js +1 -0
  209. package/dist/zonos-elements/{p-b59fc3fa.system.entry.js → p-0e1f13ff.system.entry.js} +1 -1
  210. package/dist/zonos-elements/p-10715fee.system.entry.js +1 -0
  211. package/dist/zonos-elements/p-144a380d.entry.js +1 -0
  212. package/dist/zonos-elements/{p-c6823974.system.entry.js → p-15097876.system.entry.js} +1 -1
  213. package/dist/zonos-elements/{p-9f5fb332.js → p-1735a69b.js} +1 -1
  214. package/dist/zonos-elements/p-18135660.entry.js +1 -0
  215. package/dist/zonos-elements/{p-055ef910.entry.js → p-1992fd91.entry.js} +1 -1
  216. package/dist/zonos-elements/p-1e4dcd29.entry.js +1 -0
  217. package/dist/zonos-elements/{p-daf57db3.system.entry.js → p-293183c1.system.entry.js} +1 -1
  218. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  219. package/dist/zonos-elements/{p-a1a05de4.system.entry.js → p-29c1703c.system.entry.js} +1 -1
  220. package/dist/zonos-elements/p-2e0d813f.system.js +1 -0
  221. package/dist/zonos-elements/{p-d25759fb.system.js → p-2ea73ca2.system.js} +1 -1
  222. package/dist/zonos-elements/p-30e9a6d7.system.js +1 -0
  223. package/dist/zonos-elements/{p-33d4be28.js → p-34d6eb83.js} +1 -1
  224. package/dist/zonos-elements/p-35fd0fdb.js +1 -0
  225. package/dist/zonos-elements/p-3b479012.js +1 -0
  226. package/dist/zonos-elements/{p-d5e66ea6.entry.js → p-3cf22558.entry.js} +1 -1
  227. package/dist/zonos-elements/p-3cfa4880.js +1 -0
  228. package/dist/zonos-elements/{p-896fb969.js → p-3d28353a.js} +1 -1
  229. package/dist/zonos-elements/{p-328fd90e.entry.js → p-3e058b4e.entry.js} +1 -1
  230. package/dist/zonos-elements/p-3feff726.entry.js +1 -0
  231. package/dist/zonos-elements/{p-0a54dae6.system.entry.js → p-429ab545.system.entry.js} +1 -1
  232. package/dist/zonos-elements/p-42ba4da5.system.entry.js +1 -0
  233. package/dist/zonos-elements/p-45535a81.js +1 -0
  234. package/dist/zonos-elements/p-48627415.system.entry.js +1 -0
  235. package/dist/zonos-elements/{p-f053975e.system.js → p-496accce.system.js} +1 -1
  236. package/dist/zonos-elements/p-4a1c9fa1.entry.js +1 -0
  237. package/dist/zonos-elements/{p-86a9f048.system.entry.js → p-4a6f9c5e.system.entry.js} +1 -1
  238. package/dist/zonos-elements/p-4b06044f.js +1 -0
  239. package/dist/zonos-elements/p-4d29dcc8.entry.js +1 -0
  240. package/dist/zonos-elements/{p-1f31f5a0.system.entry.js → p-4e6e9a3c.system.entry.js} +1 -1
  241. package/dist/zonos-elements/{p-12a05647.entry.js → p-4efd7178.entry.js} +1 -1
  242. package/dist/zonos-elements/p-521cbeea.entry.js +1 -0
  243. package/dist/zonos-elements/p-534057ad.system.entry.js +1 -0
  244. package/dist/zonos-elements/p-55195dab.entry.js +1 -0
  245. package/dist/zonos-elements/p-58b56c69.entry.js +1 -0
  246. package/dist/zonos-elements/{p-10571f94.system.entry.js → p-5aee5de5.system.entry.js} +1 -1
  247. package/dist/zonos-elements/p-5c30d04b.js +1 -0
  248. package/dist/zonos-elements/p-5ce88ef3.system.entry.js +1 -0
  249. package/dist/zonos-elements/{p-2a1247f4.system.entry.js → p-5d3ea491.system.entry.js} +1 -1
  250. package/dist/zonos-elements/{p-dcef2202.entry.js → p-5d4201d5.entry.js} +1 -1
  251. package/dist/zonos-elements/p-5e3b0ef4.entry.js +1 -0
  252. package/dist/zonos-elements/{p-80df7e0b.system.entry.js → p-6146bfaa.system.entry.js} +1 -1
  253. package/dist/zonos-elements/{p-e548b8ec.entry.js → p-62609f19.entry.js} +1 -1
  254. package/dist/zonos-elements/p-628fe742.system.entry.js +1 -0
  255. package/dist/zonos-elements/{p-91b921a4.system.js → p-647438d6.system.js} +1 -1
  256. package/dist/zonos-elements/p-67dac4e5.system.entry.js +1 -0
  257. package/dist/zonos-elements/p-684e27da.system.js +1 -0
  258. package/dist/zonos-elements/{p-14018649.system.js → p-6ad0f720.system.js} +1 -1
  259. package/dist/zonos-elements/{p-45d74be2.system.js → p-6f324051.system.js} +1 -1
  260. package/dist/zonos-elements/p-77ac8bfe.entry.js +1 -0
  261. package/dist/zonos-elements/{p-4df08fc4.js → p-7bdce9d4.js} +1 -1
  262. package/dist/zonos-elements/p-82341c15.entry.js +1 -0
  263. package/dist/zonos-elements/p-864525b4.system.entry.js +1 -0
  264. package/dist/zonos-elements/p-89befc63.system.entry.js +1 -0
  265. package/dist/zonos-elements/{p-c83bc4b3.entry.js → p-8c54aaec.entry.js} +1 -1
  266. package/dist/zonos-elements/{p-306e5499.system.entry.js → p-998f9df5.system.entry.js} +1 -1
  267. package/dist/zonos-elements/{p-3eba657b.system.entry.js → p-99e8743e.system.entry.js} +1 -1
  268. package/dist/zonos-elements/p-9fab45aa.system.js +1 -0
  269. package/dist/zonos-elements/{p-42948a52.js → p-a02ff788.js} +1 -1
  270. package/dist/zonos-elements/p-a1bd3a53.system.js +1 -0
  271. package/dist/zonos-elements/{p-e9c8a235.js → p-a3bc7e97.js} +1 -1
  272. package/dist/zonos-elements/p-a3c116d6.system.js +1 -0
  273. package/dist/zonos-elements/{p-5aa35d1c.system.entry.js → p-a3d3ce5d.system.entry.js} +1 -1
  274. package/dist/zonos-elements/{p-27e50593.system.entry.js → p-a44591f6.system.entry.js} +1 -1
  275. package/dist/zonos-elements/p-a7050d1e.system.entry.js +1 -0
  276. package/dist/zonos-elements/p-ac1b60c8.system.entry.js +1 -0
  277. package/dist/zonos-elements/{p-e8cb382e.entry.js → p-ac9b9f7d.entry.js} +1 -1
  278. package/dist/zonos-elements/{p-2197d6ab.js → p-b1c86a5b.js} +1 -1
  279. package/dist/zonos-elements/{p-cc508de8.entry.js → p-b5f67807.entry.js} +1 -1
  280. package/dist/zonos-elements/p-b7e4f1f5.entry.js +1 -0
  281. package/dist/zonos-elements/p-c209e36d.js +1 -0
  282. package/dist/zonos-elements/p-c750a2e0.system.entry.js +1 -0
  283. package/dist/zonos-elements/p-cc6ad18a.js +1 -0
  284. package/dist/zonos-elements/{p-c1463da7.entry.js → p-d1e84608.entry.js} +1 -1
  285. package/dist/zonos-elements/{p-9c3276c8.entry.js → p-d5945ddc.entry.js} +1 -1
  286. package/dist/zonos-elements/{p-5d65be06.system.js → p-d706852e.system.js} +1 -1
  287. package/dist/zonos-elements/p-d7bda14d.js +1 -0
  288. package/dist/zonos-elements/{p-df55536b.entry.js → p-daab3824.entry.js} +1 -1
  289. package/dist/zonos-elements/{p-7d9d2407.system.js → p-dab78981.system.js} +1 -1
  290. package/dist/zonos-elements/{p-990d1495.system.entry.js → p-db65c60b.system.entry.js} +1 -1
  291. package/dist/zonos-elements/{p-bc919de1.system.js → p-e977562b.system.js} +1 -1
  292. package/dist/zonos-elements/{p-abd485df.entry.js → p-ee434a71.entry.js} +1 -1
  293. package/dist/zonos-elements/{p-3dc3596b.js → p-f1aea919.js} +1 -1
  294. package/dist/zonos-elements/{p-62c68aee.system.js → p-f2768c92.system.js} +1 -1
  295. package/dist/zonos-elements/p-f29bcf8b.system.js +1 -0
  296. package/dist/zonos-elements/{p-1a4083be.system.js → p-f2d50796.system.js} +1 -1
  297. package/dist/zonos-elements/p-f3a73132.entry.js +1 -0
  298. package/dist/zonos-elements/{p-f72642de.entry.js → p-f59514e9.entry.js} +1 -1
  299. package/dist/zonos-elements/{p-52bd7be3.system.js → p-f61c0eef.system.js} +1 -1
  300. package/dist/zonos-elements/p-ffbf87c8.system.entry.js +1 -0
  301. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  302. package/package.json +12 -35
  303. package/dist/esm-es5/cart-23e29950.js +0 -1
  304. package/dist/esm-es5/cleanHtmlMarkdown-5f7856f2.js +0 -1
  305. package/dist/esm-es5/localization-17546792.js +0 -1
  306. package/dist/esm-es5/throttle-f09d0659.js +0 -1
  307. package/dist/zonos-elements/p-013575f2.entry.js +0 -1
  308. package/dist/zonos-elements/p-08b48608.entry.js +0 -1
  309. package/dist/zonos-elements/p-0b59076d.system.entry.js +0 -1
  310. package/dist/zonos-elements/p-14d6542f.system.js +0 -1
  311. package/dist/zonos-elements/p-1678d8b4.system.entry.js +0 -1
  312. package/dist/zonos-elements/p-171d0f9f.system.js +0 -1
  313. package/dist/zonos-elements/p-18af6aaa.system.js +0 -1
  314. package/dist/zonos-elements/p-1a105d6e.system.entry.js +0 -1
  315. package/dist/zonos-elements/p-31577ebd.entry.js +0 -1
  316. package/dist/zonos-elements/p-33910e8b.js +0 -1
  317. package/dist/zonos-elements/p-3b28fc76.js +0 -1
  318. package/dist/zonos-elements/p-41619f29.js +0 -1
  319. package/dist/zonos-elements/p-46e72a90.entry.js +0 -1
  320. package/dist/zonos-elements/p-49d8a10f.entry.js +0 -1
  321. package/dist/zonos-elements/p-4a960329.system.entry.js +0 -1
  322. package/dist/zonos-elements/p-4b371b65.entry.js +0 -1
  323. package/dist/zonos-elements/p-539bc46c.js +0 -1
  324. package/dist/zonos-elements/p-5dd86dd9.system.js +0 -1
  325. package/dist/zonos-elements/p-6c19310e.system.entry.js +0 -1
  326. package/dist/zonos-elements/p-7eb47eb0.entry.js +0 -1
  327. package/dist/zonos-elements/p-8af57c2a.js +0 -1
  328. package/dist/zonos-elements/p-8c4761d1.system.entry.js +0 -1
  329. package/dist/zonos-elements/p-8e77a3cd.system.entry.js +0 -1
  330. package/dist/zonos-elements/p-90d22087.system.js +0 -1
  331. package/dist/zonos-elements/p-919c5500.entry.js +0 -1
  332. package/dist/zonos-elements/p-9574695a.system.js +0 -1
  333. package/dist/zonos-elements/p-9581bffb.js +0 -1
  334. package/dist/zonos-elements/p-97917371.system.entry.js +0 -1
  335. package/dist/zonos-elements/p-9b003a15.system.entry.js +0 -1
  336. package/dist/zonos-elements/p-9cd41234.system.entry.js +0 -1
  337. package/dist/zonos-elements/p-a968ccba.entry.js +0 -1
  338. package/dist/zonos-elements/p-ac8cfdc0.js +0 -1
  339. package/dist/zonos-elements/p-ad961f5d.entry.js +0 -1
  340. package/dist/zonos-elements/p-b5c01288.system.entry.js +0 -1
  341. package/dist/zonos-elements/p-bf8c98ab.system.js +0 -1
  342. package/dist/zonos-elements/p-c13d2e3f.entry.js +0 -1
  343. package/dist/zonos-elements/p-cd34ecf2.js +0 -1
  344. package/dist/zonos-elements/p-df6fbf3f.entry.js +0 -1
  345. package/dist/zonos-elements/p-e643346a.entry.js +0 -1
  346. package/dist/zonos-elements/p-e8ec88a9.system.entry.js +0 -1
  347. package/dist/zonos-elements/p-e9afd736.system.entry.js +0 -1
  348. package/dist/zonos-elements/p-f0eb6317.system.entry.js +0 -1
  349. package/dist/zonos-elements/p-f1cc659c.js +0 -1
  350. package/dist/zonos-elements/p-f53c8a9f.entry.js +0 -1
  351. /package/dist/cjs/{zonosStore-45a87908.js → zonosStore-fee716c9.js} +0 -0
  352. /package/dist/esm/{zonosStore-8e19daff.js → zonosStore-b7d3f9b0.js} +0 -0
  353. /package/dist/esm-es5/{zonosStore-8e19daff.js → zonosStore-b7d3f9b0.js} +0 -0
  354. /package/dist/zonos-elements/{p-3e7ee89d.system.js → p-47a1d469.system.js} +0 -0
  355. /package/dist/zonos-elements/{p-701d9a7c.js → p-9a417eeb.js} +0 -0
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(e,o,t,s){function n(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,a){function r(e){try{i(s.next(e))}catch(e){a(e)}}function l(e){try{i(s["throw"](e))}catch(e){a(e)}}function i(e){e.done?t(e.value):n(e.value).then(r,l)}i((s=s.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,n,a,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(e){return function(o){return i([e,o])}}function i(l){if(s)throw new TypeError("Generator is already executing.");while(r&&(r=0,l[0]&&(t=0)),t)try{if(s=1,n&&(a=l[0]&2?n["return"]:l[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,l[1])).done)return a;if(n=0,a)l=[l[0]&2,a.value];switch(l[0]){case 0:case 1:a=l;break;case 4:t.label++;return{value:l[1],done:false};case 5:t.label++;n=l[1];l=[0];continue;case 7:l=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){t.label=l[1];break}if(l[0]===6&&t.label<a[1]){t.label=a[1];a=l;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(l);break}if(a[2])t.ops.pop();t.trys.pop();continue}l=o.call(e,t)}catch(e){l=[6,e];n=0}finally{s=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var s=0,n=o.length,a;s<n;s++){if(a||!(s in o)){if(!a)a=Array.prototype.slice.call(o,0,s);a[s]=o[s]}}return e.concat(a||Array.prototype.slice.call(o))};import{r as registerInstance,d as createEvent,h,F as Fragment,a as Host,g as getElement}from"./index-cfd394c8.js";import{b as airwallexStore,d as airwallexStoreRetrievePaymentIntent,j as airwallexStoreMessageBasedOnStatus,k as airwallexStoreReset,c as collectStore,e as airwallexStoreIsPaidStatus}from"./collect-a235299d.js";import{b as stripeStore,c as stripeStoreRetrievePayment,t as trackConversionEvent,P as stripeStoreResetPromoCode,F as stripeStoreReset,Q as stripeStoreMessageBasedOnStatus,d as cartStore,u as cartStoreNextStep,G as cartStoreOnChange}from"./cart-23e29950.js";import{s as submitAnalytics,c as paypalStoreReset,a as paypalStore,b as paypalInitScript}from"./paypal-5bc6b0d0.js";import{t as translate,s as storageStore,l as localizationStore,x as translationStoreOnChange}from"./localization-17546792.js";import{z as zonosStore}from"./zonosStore-8e19daff.js";import{h as handleFetch,s as sendErrorLog,g as getIsTestMode,i as isCheckoutMobile,a as getIsStagingMode}from"./handleFetch-a844cac1.js";import{c as createCustomEvent}from"./createCustomEvent-58159025.js";import{g as getBorderRadius}from"./getBorderRadius-d23f47a6.js";import{l as log,b as allLogs}from"./VarianceTest-572cecf5.js";import{i as isCollectMobile,a as isCollectTablet}from"./isCollectMobileTablet-111b0dd7.js";import{c as classes}from"./classes-0d95c529.js";import{l as languages}from"./ILanguage-cd6acb72.js";import{r as renderCheckoutCurrency}from"./renderCheckoutCurrency-e3953f67.js";import{p as placeTestOrder}from"./placeTestOrder-e842854a.js";import{r as renderFallback}from"./renderFallback-b250f4e9.js";import"./isDarkColor-566f04c5.js";import"./isContrastColor-fbddacb6.js";import"./submitGtag-c7ea1f2a.js";var RemoveIcon='<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-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" data-is-secondary-color="true" fill="var(--zonos-elements-red-200)" fill-rule="evenodd"></path><path clip-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" fill="currentColor" fill-rule="evenodd"></path></svg>';var SuccessIcon='<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosCollectFinishCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:24px;border-radius:var(--zonos--border-radius, 10px);gap:24px;margin-top:24px;background-color:var(--zonos-elements-gray-50);padding:48px}:host .zonos--finish-details{max-width:640px;min-width:300px;line-height:24px;width:0 auto;margin:auto}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .zonos--finish-button-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto;margin-top:48px;max-width:300px}:host .zonos--button-container{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto}:host .zonos--subtitle{text-align:center}:host .zonos--order-number{background-color:var(--zonos-elements-gray-0);border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800);border-radius:var(--zonos-elements-radius-6);padding:4px 8px}";var ZonosCollectFinishStyle0=zonosCollectFinishCss;var MAX_RETRIES=30;var ZonosCollectFinish=function(){function e(e){var o=this;registerInstance(this,e);this.closeClick=createEvent(this,"closeClick",7);this.borderRadius="ROUNDED";this.confirmationId=null;this.isLoading=true;this.notificationType="success";this.notificationTitle="";this.notificationMessages=[];this.notificationActionText=translate("Keep shopping");this.order=null;this.isWaitingToRedirect=true;this.pullOrder=function(){return __awaiter(o,void 0,void 0,(function(){var e,o,t,s,n,a,r,l;return __generator(this,(function(i){switch(i.label){case 0:t=storageStore.checkoutSessionId;s=new URLSearchParams;s.set("checkoutSessionId",t||"");return[4,handleFetch("/api/zonos-elements/get-order?".concat(s.toString()))];case 1:n=i.sent(),a=n.baseUrl,r=n.errors,l=n.json;if(r.length||!(l===null||l===void 0?void 0:l.id)){return[2,{baseUrl:a,order:null}]}return[4,(o=(e=zonosStore.checkoutSettings).onOrderSuccess)===null||o===void 0?void 0:o.call(e,{zonosApiRoute:a,zonosOrder:l})];case 2:i.sent();return[2,{baseUrl:a,order:l}]}}))}))};this.handleSuccessBehavior=function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.isLoading=false;return[4,this.getPullOrder()];case 1:e.sent();return[2]}}))}))};this.getPullOrder=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return __awaiter(o,__spreadArray([],e,true),void 0,(function(e){var o,t,s,n,a,r,l,i;if(e===void 0){e=0}return __generator(this,(function(c){switch(c.label){case 0:if(e===0){log("=== Start to poll for order info","info")}return[4,this.pullOrder()];case 1:s=c.sent(),n=s.baseUrl,a=s.order;r=!!((t=(o=a===null||a===void 0?void 0:a.references)===null||o===void 0?void 0:o.find((function(e){return(e===null||e===void 0?void 0:e.key)==="zonosOrderNumber"})))===null||t===void 0?void 0:t.value);l=storageStore.checkoutSessionId;i=parseFloat(new URLSearchParams(window.location.search).get("maxPollingRetries")||"0")||MAX_RETRIES;log("=== Polling order (".concat(e," attemps)"),"info");if(!a)return[3,2];log("=== CollectOrder info found","info");if(e>10){void sendErrorLog({endpoint:"".concat(n,"/api/zonos-elements/get-order?checkoutSessionId=").concat(l,"&orderId=").concat(a.id),errors:["Collect order found after ".concat(e," attempts")],metadata:{allLogs:allLogs,checkoutSessionId:storageStore.checkoutSessionId||"",orderId:a.id,storeId:zonosStore.storeId}})}this.order=a;return[3,6];case 2:if(!((!a||!r)&&e<i))return[3,5];return[4,new Promise((function(e){return setTimeout(e,1e3)}))];case 3:c.sent();return[4,this.getPullOrder(e+1)];case 4:c.sent();return[3,6];case 5:void sendErrorLog({endpoint:"".concat(n,"/api/zonos-elements/get-order?checkoutSessionId=").concat(l),errors:["Collect order not found after ".concat(i," attempts")],metadata:{allLogs:allLogs,checkoutSessionId:storageStore.checkoutSessionId||"",storeId:zonosStore.storeId}});c.label=6;case 6:return[2]}}))}))};this.checkStripePaymentStatus=function(){return __awaiter(o,void 0,void 0,(function(){var e,o,t,s,n,a,r,l,i;return __generator(this,(function(c){switch(c.label){case 0:e=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||stripeStore.clientSecret;if(!(e||this.storybookForceStatus))return[3,4];return[4,stripeStoreRetrievePayment({clientSecret:e,storybookForceStatus:this.storybookForceStatus})];case 1:o=c.sent(),t=o.error,s=o.messages,n=o.status;a=n==="requires_action"||t;this.notificationType=a?"error":"success";this.notificationMessages=s||[];this.notificationTitle=a?translate("Payment failed"):translate("You're all set!");log("=== Payment intent retrieve status","info",{clientSecret:e,error:t,messages:s,status:n});r=new URL(window.location.href);r.searchParams.delete("payment_intent_client_secret");r.searchParams.delete("payment_intent");r.searchParams.delete("redirect_status");r.searchParams.delete("zonosCheckoutSessionId");window.history.replaceState({},"",r.toString());if(!(t&&(s===null||s===void 0?void 0:s.length)))return[3,2];submitAnalytics({event:"zonos-checkout-payment-fail"});void sendErrorLog({endpoint:"Stripe payment failed",errors:['Payment intent "'.concat(e.split("_secret_")[0]||e,'" status: ').concat(n," - checkout session: ").concat(storageStore.checkoutSessionId)],metadata:{allLogs:allLogs,credentialToken:window.Zonos.zonosApiKey}});return[3,4];case 2:submitAnalytics({event:"zonos-checkout-success"});l=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:l,eventName:"checkout_orderCompleted"});i=createCustomEvent("zonos-checkout-success",{message:"Zonos Checkout successfully processed order"});document.dispatchEvent(i);return[4,this.handleSuccessBehavior()];case 3:c.sent();c.label=4;case 4:this.isLoading=false;stripeStoreResetPromoCode();stripeStoreReset();storageStore.checkoutSessionId=null;return[2]}}))}))};this.getAirwallexSessionInfo=function(){return __awaiter(o,void 0,void 0,(function(){var e,o,t;return __generator(this,(function(s){switch(s.label){case 0:if(airwallexStore.paymentIntentId){return[2,{isCompleted:false,paymentIntentId:airwallexStore.paymentIntentId}]}e=storageStore.checkoutSessionId;if(!e){return[2,{isCompleted:false,paymentIntentId:null}]}return[4,handleFetch("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:e},method:"POST"})];case 1:o=s.sent().json;t=o===null||o===void 0?void 0:o.checkoutSession;return[2,{isCompleted:!!((t===null||t===void 0?void 0:t.completedAt)||(t===null||t===void 0?void 0:t.order)),paymentIntentId:(t===null||t===void 0?void 0:t.paymentIntentId)||null}]}}))}))};this.checkAirwallexPaymentStatus=function(){return __awaiter(o,void 0,void 0,(function(){var e,o,t,s,n,a,r,l,i,c,d;return __generator(this,(function(h){switch(h.label){case 0:e=airwallexStore.paymentConfirmed;o=this.storybookForceStatus==="succeeded";return[4,this.getAirwallexSessionInfo()];case 1:t=h.sent(),s=t.isCompleted,n=t.paymentIntentId;if(!n)return[3,3];return[4,airwallexStoreRetrievePaymentIntent(n)];case 2:r=h.sent();return[3,4];case 3:r={status:null};h.label=4;case 4:a=r.status;l=e||o||s||airwallexStoreIsPaidStatus(a);i=(e||o||s?airwallexStoreMessageBasedOnStatus("SUCCEEDED"):airwallexStoreMessageBasedOnStatus(a)).messages;log("=== Airwallex payment intent retrieve status","info",{forcedSuccess:o,isCompleted:s,isPaid:l,paymentIntentId:n,sdkConfirmed:e,status:a});this.notificationType=l?"success":"error";this.notificationTitle=l?translate("You're all set!"):translate("Payment failed");this.notificationMessages=i;if(!l)return[3,6];submitAnalytics({event:"zonos-checkout-success"});c=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:c,eventName:"checkout_orderCompleted"});d=createCustomEvent("zonos-checkout-success",{message:"Zonos Checkout successfully processed order"});document.dispatchEvent(d);return[4,this.handleSuccessBehavior()];case 5:h.sent();return[3,7];case 6:submitAnalytics({event:"zonos-checkout-payment-fail"});void sendErrorLog({endpoint:"Airwallex payment failed",errors:['Payment intent "'.concat(n,'" status: ').concat(a," - checkout session: ").concat(storageStore.checkoutSessionId)],metadata:{allLogs:allLogs,credentialToken:window.Zonos.zonosApiKey}});h.label=7;case 7:this.isLoading=false;stripeStoreResetPromoCode();stripeStoreReset();airwallexStoreReset();storageStore.checkoutSessionId=null;return[2]}}))}))};this.checkStagingOrderStatus=function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.notificationType="success";this.notificationTitle=translate("You're all set!");this.notificationMessages=stripeStoreMessageBasedOnStatus("succeeded").messages;return[4,this.handleSuccessBehavior()];case 1:e.sent();stripeStoreResetPromoCode();stripeStoreReset();paypalStoreReset();storageStore.checkoutSessionId=null;return[2]}}))}))};this.checkPaypalPaymentStatus=function(){return __awaiter(o,void 0,void 0,(function(){var e;return __generator(this,(function(o){switch(o.label){case 0:if(paypalStore.paypalErrorMessage){this.notificationType="error";this.notificationTitle=translate("Payment failed");this.notificationMessages=[paypalStore.paypalErrorMessage];this.isLoading=false;return[2]}this.isLoading=false;if(!paypalStore.orderIdCreated)return[3,2];submitAnalytics({event:"zonos-checkout-success"});e=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:e,eventName:"checkout_orderCompleted"});this.notificationType="success";this.notificationTitle=translate("You're all set!");this.notificationMessages=stripeStoreMessageBasedOnStatus("succeeded").messages;return[4,this.handleSuccessBehavior()];case 1:o.sent();o.label=2;case 2:stripeStoreResetPromoCode();stripeStoreReset();paypalStoreReset();storageStore.checkoutSessionId=null;return[2]}}))}))};this.getReceiptUrl=function(e){var o=e.cartId;var t=new URL("".concat(window.location.origin,"/receipt"));t.searchParams.set("referenceId",o);var s=getIsTestMode();if(s){t.searchParams.set("zonosTestMode","1")}var n=new URLSearchParams(window.location.search).get("zonosQaUrl");if(n){t.searchParams.set("zonosQaUrl",n)}return t.toString()}}e.prototype.componentDidLoad=function(){if(this.overrideNotification){this.notificationType=this.overrideNotification.type;this.notificationTitle=this.overrideNotification.title;this.notificationMessages=this.overrideNotification.messages;this.isLoading=false;return}if(cartStore.isStagingMode){void this.checkStagingOrderStatus()}else if(collectStore.paymentProcessor==="AIRWALLEX"){void this.checkAirwallexPaymentStatus()}else if(paypalStore.orderIdCreated){void this.checkPaypalPaymentStatus()}else{void this.checkStripePaymentStatus()}};e.prototype.render=function(){var e=this;var o=window.Zonos.cartId;return h(Host,{key:"fe3107670230caeaacc834983d9215422a7828ae",class:"zonos--checkout-finish zonos--elements",style:{"--zonos--border-radius":getBorderRadius({overrideBorderStyle:this.borderRadius})}},!this.isLoading&&h("div",{key:"fefefedc7ec022318cbc6da23b327079afec981b",class:"zonos--finish-details"},h("div",{key:"4428271e11c3a96db732726719c5747364a18097",class:"zonos--group"},this.notificationType==="success"?h("zonos-icon",{"aria-label":"Order success",content:SuccessIcon,iconColor:"blue-800",size:50}):h("zonos-icon",{"aria-label":"Order failed",content:RemoveIcon,iconColor:"red-800",size:50}),h("zonos-text",{key:"0c3371b3bed8fd83e437075f1c35179fbb7e5e09",class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),this.confirmationId&&h("zonos-badge",{key:"dbb263f0f95a62d93ae3c5ac455625512eb1f63e",badgeColor:"gray"},this.confirmationId),h("zonos-text",{key:"07e2733ad91ced8e5260e0f8fea627610b864ebf",class:"zonos--subtitle",textColor:"gray-600"},this.notificationMessages.map((function(e){return h(Fragment,null,e,h("br",null))}))),this.order&&o&&h("div",{key:"ecb7332cb4b7c28d398f2957d3b521c6328163eb",class:"zonos--button-container"},h("zonos-button",{key:"c8303e2a61d573b6e028ab38df2427fa98471e9f",onClick:function(){window.open(e.getReceiptUrl({cartId:o}),"_blank")},size:"lg",variant:"primary"},translate("View receipt"))))))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}();ZonosCollectFinish.style=ZonosCollectFinishStyle0;var ChevronDownIcon$1='<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 Globe='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM11.4709 5.80634C11.7686 5.53723 11.9541 5.5 12 5.5C12.0459 5.5 12.2314 5.53723 12.5291 5.80634C12.8115 6.06164 13.1289 6.46913 13.4271 7.03651C13.9505 8.03191 14.3838 9.46098 14.48 11.25H9.51996C9.61624 9.46098 10.0495 8.03191 10.5729 7.03651C10.8711 6.46913 11.1885 6.06164 11.4709 5.80634ZM8.01802 11.25C8.11591 9.23031 8.60319 7.55958 9.24516 6.33849C9.29983 6.23451 9.35585 6.13335 9.41312 6.03514C7.32916 6.94017 5.81218 8.90533 5.5428 11.25H8.01802ZM5.5428 12.75H8.01802C8.11591 14.7697 8.60319 16.4404 9.24516 17.6615C9.29983 17.7655 9.35585 17.8666 9.41312 17.9649C7.32916 17.0598 5.81218 15.0947 5.5428 12.75ZM9.51996 12.75H14.48C14.3838 14.539 13.9505 15.9681 13.4271 16.9635C13.1289 17.5309 12.8115 17.9384 12.5291 18.1937C12.2314 18.4628 12.0459 18.5 12 18.5C11.9541 18.5 11.7686 18.4628 11.4709 18.1937C11.1885 17.9384 10.8711 17.5309 10.5729 16.9635C10.0495 15.9681 9.61624 14.539 9.51996 12.75ZM15.982 12.75C15.8841 14.7697 15.3968 16.4404 14.7548 17.6615C14.7002 17.7655 14.6441 17.8666 14.5869 17.9649C16.6708 17.0598 18.1878 15.0947 18.4572 12.75H15.982ZM18.4572 11.25C18.1878 8.90533 16.6708 6.94017 14.5869 6.03514C14.6441 6.13335 14.7002 6.23451 14.7548 6.33849C15.3968 7.55958 15.8841 9.23031 15.982 11.25H18.4572Z" fill="currentColor"/>\n</svg>\n';var ZonosWordmark='<svg width="43" height="10" viewBox="0 0 43 10" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.35896 0.0640869H0.30768C0.166068 0.0640869 0.0512695 0.178886 0.0512695 0.320497V1.85896C0.0512695 2.00057 0.166068 2.11537 0.30768 2.11537H4.44439C4.54964 2.11537 4.61005 2.2352 4.54745 2.31982L0.151823 8.2615C0.0865163 8.34978 0.0512695 8.45669 0.0512695 8.56649V9.67947C0.0512695 9.82108 0.166068 9.93588 0.30768 9.93588H7.35896C7.50057 9.93588 7.61537 9.82108 7.61537 9.67947V8.14101C7.61537 7.9994 7.50057 7.8846 7.35896 7.8846H3.22226C3.117 7.8846 3.05659 7.76477 3.11919 7.68015L7.51482 1.73847C7.58013 1.65019 7.61537 1.54328 7.61537 1.43348V0.320497C7.61537 0.178886 7.50057 0.0640869 7.35896 0.0640869Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M11.718 0C10.1602 0 8.89746 1.26279 8.89746 2.82051V7.17949C8.89746 8.73721 10.1602 10 11.718 10H13.6411C15.1988 10 16.4616 8.73721 16.4616 7.17949V2.82051C16.4616 1.26279 15.1988 0 13.6411 0H11.718ZM11.718 2.05128C11.2931 2.05128 10.9487 2.39568 10.9487 2.82051V7.17949C10.9487 7.60432 11.2931 7.94872 11.718 7.94872H13.6411C14.0659 7.94872 14.4103 7.60432 14.4103 7.17949V5V2.82051C14.4103 2.39568 14.0659 2.05128 13.6411 2.05128H11.718Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M17.7437 0.436316V9.71132C17.7437 9.85293 17.8585 9.96773 18.0001 9.96773H19.5385C19.6801 9.96773 19.7949 9.85293 19.7949 9.71132V3.74801C19.7949 3.44829 19.969 3.17587 20.241 3.04996L22.1641 2.15964C22.6739 1.92363 23.2565 2.29592 23.2565 2.85769V9.71132C23.2565 9.85293 23.3713 9.96773 23.5129 9.96773H25.0513C25.193 9.96773 25.3078 9.85293 25.3078 9.71132V2.85595C25.3078 0.79631 23.1718 -0.568775 21.3027 0.296257L19.9742 0.911055C19.8685 0.959946 19.7432 0.931536 19.669 0.84187L19.2748 0.365697C19.1773 0.248019 19.0325 0.179905 18.8797 0.179905H18.0001C17.8585 0.179905 17.7437 0.294704 17.7437 0.436316Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M29.4104 0C27.8526 0 26.5898 1.26279 26.5898 2.82051V7.17949C26.5898 8.73721 27.8526 10 29.4104 10H31.3334C32.8912 10 34.1539 8.73721 34.1539 7.17949V2.82051C34.1539 1.26279 32.8912 0 31.3334 0H29.4104ZM29.4104 2.05128C28.9855 2.05128 28.6411 2.39568 28.6411 2.82051V7.17949C28.6411 7.60432 28.9855 7.94872 29.4104 7.94872H31.3334C31.7583 7.94872 32.1027 7.60432 32.1027 7.17949V2.82051C32.1027 2.39568 31.7583 2.05128 31.3334 2.05128H29.4104Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M38.2085 0.0640869H40.3889C41.8309 0.0640869 42.9999 1.23306 42.9999 2.67506C42.9999 2.79477 42.9108 2.89574 42.792 2.91059L41.1732 3.11293C41.054 3.12784 40.9486 3.03485 40.9486 2.91466C40.9486 2.47322 40.5908 2.11537 40.1493 2.11537H38.3397C37.8688 2.11537 37.4871 2.49712 37.4871 2.96803C37.4871 3.3685 37.7658 3.71501 38.1569 3.80087L40.7916 4.37922C42.0811 4.66229 42.9999 5.80462 42.9999 7.12486C42.9999 8.67735 41.7414 9.93588 40.1889 9.93588H38.0468C36.6048 9.93588 35.4358 8.76691 35.4358 7.32491C35.4358 7.2052 35.5249 7.10423 35.6437 7.08938L37.2625 6.88703C37.3817 6.87213 37.4871 6.96512 37.4871 7.08531C37.4871 7.52675 37.8449 7.8846 38.2864 7.8846H40.1176C40.5765 7.8846 40.9486 7.51252 40.9486 7.05354C40.9486 6.67478 40.6925 6.34394 40.3258 6.24901L37.5136 5.52093C36.2902 5.20422 35.4358 4.10042 35.4358 2.83676C35.4358 1.30545 36.6772 0.0640869 38.2085 0.0640869Z" fill="var(--zonos-elements-gray-700)"/>\n</svg>\n';var zonosCollectFooterCss=":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:absolute;bottom:0;left:32px;right:32px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--collect-footer{gap:16px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px;padding-left:0;-ms-flex-align:center;align-items:center;width:100%}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:16px}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo a{line-height:0}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper a{text-decoration:none}:host .zonos--collect-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--collect-footer .zonos--collect-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--collect-footer .zonos--collect-locale-wrapper{gap:4px}}:host .zonos--collect-footer .zonos--collect-locale-wrapper .zonos--collect-locale-label{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;gap:4px}:host .zonos--collect-footer .zonos--collect-language-dialog{position:absolute;bottom:36px;left:var(--language-dialog-left);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);width:360px;max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:bottom left;transform-origin:bottom left;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}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar{width:10px}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--collect-footer .zonos--collect-language-dialog.zonos--collect-language-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .dot{display:-ms-inline-flexbox;display:inline-flex;background:var(--zonos-elements-gray-400);width:6px;height:6px;border-radius:50%}:host(.mobile),:host(.tablet){background-color:var(--zonos-elements-gray-0);width:100%;position:-webkit-sticky;position:sticky;bottom:0}:host(.tablet) .zonos--collect-footer{width:100%;max-width:800px;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex}:host(.mobile) .zonos--collect-locale-wrapper{display:none}:host(.mobile) .zonos--collect-footer{-ms-flex-pack:center;justify-content:center}";var ZonosCollectFooterStyle0=zonosCollectFooterCss;var ZonosCollectFooter=function(){function e(e){registerInstance(this,e);this.mobile=false;this.tablet=false;this.showLanguageDialog=false;this.isMobile=false;this.isTablet=false}e.prototype.handleGlobalClick=function(e){if(!this.el.contains(e.target)&&this.showLanguageDialog){this.showLanguageDialog=false}};e.prototype.toggleLanguageDialog=function(){this.showLanguageDialog=!this.showLanguageDialog};e.prototype.handleMobileChange=function(){this.isMobile=isCollectMobile(this.mobile)};e.prototype.handleTabletChange=function(){this.isTablet=isCollectTablet(this.tablet)};e.prototype.componentWillLoad=function(){this.isMobile=isCollectMobile(this.mobile);this.isTablet=isCollectTablet(this.tablet)};e.prototype.render=function(){var e=this;var o;var t=(o=languages.find((function(e){return e.code===localizationStore.selectedLocale})))===null||o===void 0?void 0:o.label;var s="gray-1000";return h(Host,{key:"52908f4538918641b708887436e1cfe3b643376f",class:classes(["zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},h("div",{key:"46a1c762d78396a7f993bad323c93f8e6bc71f1b",class:"zonos--collect-footer"},h("div",{key:"a6a98539cdb901ecd162f5e5b98591c9b8b7321a",class:"zonos--collect-locale-wrapper"},h("zonos-button",{key:"8a5c4a18bc1030c3e74e412ff14a59c299f59e9a",buttonColor:s,class:"zonos--collect-footer-language-button",icon:h("zonos-icon",{"aria-label":"Language select",content:Globe,iconColor:s}),onClick:function(){return e.toggleLanguageDialog()},variant:"subtle"},h("span",{key:"03bc4235862d1382cd8f0cdb007fd708bf2bfe87",class:"zonos--collect-locale-label"},t,h("zonos-icon",{key:"4b3bbcd5bcd4039f3cb1f1c4c12698cba1894308","aria-hidden":"true",class:"zonos--collect-locale-chevron",content:ChevronDownIcon$1,iconColor:s,size:18}))),h("div",{key:"5508629b0cdc334b81ad4d4d5a034ced133d6744",class:classes(["zonos--collect-language-dialog",this.showLanguageDialog&&"zonos--collect-language-dialog-open"])},h("zonos-language-select",{key:"ca4b77d72dfd9db8743290d333b7fcde15d090d6",handleOnClose:function(){return e.toggleLanguageDialog()}}))),h("div",{key:"98f0d0c35e3c6b4fde833e4b9ae334549fe46f1f",class:"zonos--collect-footer-icon-wrapper"},h("div",{key:"b3039948472d797bf04a23d3aca839472f6c6946",class:"zonos--collect-footer-logo"},h("zonos-text",{key:"75123a6fb2bcdce07e0ebe433a28d81eefaec9ea",textColor:s},"Powered by"),h("a",{key:"2a0f4e2bc5df9d383ac4b91c589d2ce7149c6b3d",href:"https://zonos.com",target:"_blank",title:"Zonos website"},h("zonos-icon",{key:"436005434f2a9d2ff1228cd36d873b8de7d339f2",autoHeight:true,content:ZonosWordmark,size:42}))),h("div",{key:"c488b5eefba54424a0e66af61415d78d8f3d46fa",class:"dot"}),h("a",{key:"d98fc7646d4877179b94bee6d3f8a7a283bbc756",href:"https://zonos.com/docs/legal/zonos-privacy-policy",target:"_blank"},h("zonos-text",{key:"54fe3d9316ee5b22f5620b7acde145627b66cbe3",textColor:s},"Privacy policy")))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{mobile:["handleMobileChange"],tablet:["handleTabletChange"]}},enumerable:false,configurable:true});return e}();ZonosCollectFooter.style=ZonosCollectFooterStyle0;var ChevronDownIcon='<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 ChevronUpIcon='<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="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosCollectOrderDetailsCss=":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{height:100%}:host *{-ms-scroll-chaining:none;overscroll-behavior:contain}:host *::-webkit-scrollbar{width:10px}:host *::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host *::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host *::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--wrapper{overflow:auto;background-color:var(--zonos-elements-gray-50);border-radius:16px;height:100%;min-height:56px}:host .zonos--order-details-header{position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--zonos-elements-gray-50);border:none;display:-ms-flexbox;display:flex;padding:16px 16px 0 16px;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host .zonos--order-details-header:focus-visible{outline:none}:host .zonos--order-details-wrapper{position:relative;padding:0 16px 16px 16px}:host .zonos--collect-order-details-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:28px}:host .zonos--collect-order-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}:host .zonos--collect-order-info .zonos--collect-order-details-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px}:host .zonos--collect-order-info .zonos--collect-order-details-row>*{-ms-flex:1 1 150px;flex:1 1 150px}:host .zonos--collect-order-info .zonos--collect-order-details-column{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--collect-order-info .zonos--collect-order-shipping-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0}";var ZonosCollectOrderDetailsStyle0=zonosCollectOrderDetailsCss;var ZonosCollectOrderDetails=function(){function e(e){registerInstance(this,e);this.collapseClicked=createEvent(this,"collapseClicked",7);this.mobile=true;this.landedCostId="";this.isMobile=false;this.collapseState=this.collapsed}e.prototype.handleCollapseChangeFromProp=function(e){this.collapseState=e};e.prototype.handleCollapseChange=function(e){this.collapseClicked.emit(e)};e.prototype.handleWindowResize=function(){this.isMobile=isCheckoutMobile(this.mobile)};e.prototype.componentWillLoad=function(){this.handleWindowResize()};e.prototype.renderShippingAddress=function(){if(collectStore.isFetchingShippingInfo){return h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},h("zonos-skeleton",{skeletonWidth:"99px"})),h("div",{class:"zonos--collect-order-shipping-info"},h("zonos-skeleton",{skeletonWidth:"152px"}),h("zonos-h-stack",{spacing:8},h("zonos-skeleton",{skeletonWidth:"75px"}),h("zonos-skeleton",{skeletonWidth:"75px"})),h("zonos-skeleton",{skeletonWidth:"50px"})))}var e=collectStore.shippingAddress;if(!e){return null}return h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},translate("Shipping address")),h("div",{class:"zonos--collect-order-shipping-info"},[[e.location.line1,e.location.line2].filter(Boolean).join(" "),[e.location.locality,e.location.administrativeAreaCode,e.location.postalCode].filter(Boolean).join(", "),e.location.countryCode].map((function(e){return h("zonos-text",null,e)}))))};e.prototype.render=function(){var e=this;var o=function(){if(e.collapseState){return h("zonos-icon",{"aria-label":"Collapse expanded section",content:ChevronDownIcon,iconColor:"gray-1200"})}return h("zonos-icon",{"aria-label":"Expand collapsed section",content:ChevronUpIcon,iconColor:"gray-1200"})};return h(Host,{class:classes(["zonos--collect-order-details zonos--elements",this.isMobile&&"mobile"])},h("div",{class:"zonos--wrapper"},h("button",{class:"zonos--order-details-header",onClick:function(){e.collapseState=!e.collapseState},type:"button"},h("zonos-text",{type:"semiBoldLabel"},translate("Shipment details")),o()),h("div",{class:"zonos--order-details-wrapper"},h("zonos-collapse",{collapsed:this.collapseState},h("div",{class:"zonos--collect-order-details-content"},h("zonos-collect-cart-items",null),h("div",{class:"zonos--collect-order-info"},h("div",{class:"zonos--collect-order-details-row"},collectStore.amountTotalPaid!==null&&h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},translate("Total paid")),h("zonos-text",null,renderCheckoutCurrency({amount:collectStore.amountTotalPaid||0,isForeign:true}))),collectStore.originCompanyName&&h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},translate("Ordered from")),h("zonos-text",null,collectStore.originCompanyName||""))),this.renderShippingAddress()))))))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{collapsed:["handleCollapseChangeFromProp"],collapseState:["handleCollapseChange"]}},enumerable:false,configurable:true});return e}();ZonosCollectOrderDetails.style=ZonosCollectOrderDetailsStyle0;var CheckmarkLineIcon='<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M15.342 10.21a.75.75 0 0 0-1.184-.92l-2.978 3.829-1.4-1.4a.75.75 0 1 0-1.06 1.061l1.8 1.8a1 1 0 0 0 1.496-.093l3.326-4.277Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>';var RemoveLineIcon='<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M14.475 10.586a.75.75 0 1 0-1.06-1.06L12 10.938l-1.414-1.414a.75.75 0 0 0-1.06 1.06L10.938 12l-1.414 1.414a.75.75 0 1 0 1.06 1.06L12 13.062l1.414 1.414a.75.75 0 0 0 1.06-1.06L13.062 12l1.414-1.414Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>';var zonosCollectPaymentCss=".sc-zonos-collect-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-payment-h *.sc-zonos-collect-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-payment-h img.sc-zonos-collect-payment{max-width:100%}.sc-zonos-collect-payment-h dl.sc-zonos-collect-payment,.sc-zonos-collect-payment-h dd.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h1.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h2.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h3.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h4.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h5.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h6.sc-zonos-collect-payment,.sc-zonos-collect-payment-h hr.sc-zonos-collect-payment,.sc-zonos-collect-payment-h figure.sc-zonos-collect-payment,.sc-zonos-collect-payment-h p.sc-zonos-collect-payment,.sc-zonos-collect-payment-h pre.sc-zonos-collect-payment{margin:0}.sc-zonos-collect-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--title.sc-zonos-collect-payment{margin-bottom:24px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment{margin-bottom:20px;overflow:visible;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--payment-error-banner.sc-zonos-collect-payment{margin-bottom:8px}.sc-zonos-collect-payment-h .zonos--error-banner.sc-zonos-collect-payment{margin-bottom:16px}.sc-zonos-collect-payment-h zonos-button.sc-zonos-collect-payment{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-collect-payment-h .zonos--pay-in-base-currency-btn.sc-zonos-collect-payment{-webkit-box-shadow:none;box-shadow:none}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:12px;bottom:-4px;padding-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-text.sc-zonos-collect-payment{text-align:center}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-button.sc-zonos-collect-payment{width:100%}.sc-zonos-collect-payment-h .zonos--test-cards.sc-zonos-collect-payment{margin-top:auto;padding-top:16px}";var ZonosCollectPaymentStyle0=zonosCollectPaymentCss;var ZonosCollectPayment=function(){function e(e){var o=this;registerInstance(this,e);this.continueClicked=createEvent(this,"continueClicked",7);this.paypalSessionFailed=createEvent(this,"paypalSessionFailed",7);this.paypalSessionDone=createEvent(this,"paypalSessionDone",7);this.airwallexPaymentDone=createEvent(this,"airwallexPaymentDone",7);this.storeUnsubscribeList=[];this.continueLoading=false;this.showErrorBanner=false;this.hasStripePaymentError=false;this.stagingOrderCreateErrorMessage="";this.internalContinueLoading=this.continueLoading;this.handleValidate=function(){var e;return!!((e=stripeStore.stripePaymentEventData)===null||e===void 0?void 0:e.complete)};this.continueClickHandler=function(e){return __awaiter(o,[e],void 0,(function(e){var o,t;var s=this;var n=e.currencyCode;return __generator(this,(function(e){if(!this.handleValidate()){void((o=stripeStore.stripeBillingAddressElement)===null||o===void 0?void 0:o.getValue());this.showErrorBanner=true;void((t=stripeStore.stripeElements)===null||t===void 0?void 0:t.submit());setTimeout((function(){var e;(e=s.ele.querySelector("zonos-banner"))===null||e===void 0?void 0:e.scrollIntoView({behavior:"smooth"})}),10);return[2]}stripeStore.checkoutSettlementCurrency=n;submitAnalytics({event:"zonos-checkout-payment-info"});this.continueClicked.emit();return[2]}))}))};this.copyCardToClipboard=function(e){return __awaiter(o,void 0,void 0,(function(){var o,t;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,navigator.clipboard.writeText(e)];case 1:s.sent();return[3,3];case 2:o=s.sent();t=document.createElement("textarea");t.style.position="fixed";t.style.left="-1000px";t.style.top="-1000px";t.style.width="1px";t.style.height="1px";t.value=e;t.id="zonos-copy-card-number";document.body.appendChild(t);t.select();document.execCommand("copy");document.body.removeChild(t);return[3,3];case 3:window.Zonos.showNotification({message:translate("Card number copied to clipboard"),timeout:4e3,type:"success"});return[2]}}))}))};this.placeTestOrder=function(){return __awaiter(o,void 0,void 0,(function(){var e;return __generator(this,(function(o){switch(o.label){case 0:this.internalContinueLoading=true;return[4,placeTestOrder()];case 1:e=o.sent().errors;if(e.length){this.stagingOrderCreateErrorMessage=e[0]||"Failed to create staging order. Please try again.";this.internalContinueLoading=false;return[2]}this.internalContinueLoading=false;cartStoreNextStep();return[2]}}))}))}}e.prototype.continueLoadingWatcher=function(){this.internalContinueLoading=this.continueLoading};e.prototype.stripePaymentErrorWatcher=function(){var e=this;if(this.hasStripePaymentError){setTimeout((function(){var o;(o=e.ele.querySelector("zonos-banner"))===null||o===void 0?void 0:o.scrollIntoView({behavior:"smooth"})}),50)}};e.prototype.componentWillLoad=function(){this.storeUnsubscribeList=[cartStoreOnChange("currency",(function(){void paypalInitScript({currency:cartStore.currency})}))];void paypalInitScript({currency:cartStore.currency})};e.prototype.disconnectedCallback=function(){this.storeUnsubscribeList.forEach((function(e){return e()}))};e.prototype.render=function(){var e=this;var o;if(collectStore.paymentProcessor==="AIRWALLEX"){return h(Host,{class:"zonos--checkout-payment zonos--elements"},h("div",{class:"zonos--group"},h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Payment method")),h("zonos-airwallex-payment",{onAirwallexPaymentSuccess:function(){return e.airwallexPaymentDone.emit()}})))}this.hasStripePaymentError=stripeStore.hasPaymentError;if(!stripeStore.stripeElements){return null}if(!stripeStore.clientSecret){return null}if(this.showErrorBanner){this.showErrorBanner=!this.handleValidate()}var t=getIsTestMode();var s=cartStore.isStagingMode||getIsStagingMode();var n=((o=stripeStore.stripePaymentEventData)===null||o===void 0?void 0:o.value.type)==="external_paypal";var a=function(){if(s){var o=zonosStore.appearance.theme;return h(Fragment,null,e.stagingOrderCreateErrorMessage&&h("zonos-banner",{class:"zonos--error-banner",intent:"error"},e.stagingOrderCreateErrorMessage),h("zonos-empty-state-payment",{emptyStateText:translate("No payment method needed for staging"),theme:o}),h("div",{class:"zonos--group-btn"},h("zonos-button",{backgroundColor:e.submitBtnColor,loading:e.internalContinueLoading,onClick:function(){void e.placeTestOrder()},size:"lg",variant:e.submitBtnType},translate("Place test order"))))}if(stripeStore.isFetchingSession||collectStore.isFetchingShippingInfo){return null}return h(Fragment,null,e.showErrorBanner&&h("zonos-banner",{class:"zonos--error-banner",intent:"error"},translate("Missing required fields. Make sure all fields are completed.")),e.hasStripePaymentError&&h("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},stripeStore.customErrorMessage||translate("We couldn't complete your payment. Please verify the payment details and try again.")),paypalStore.paypalErrorMessage&&h("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},paypalStore.paypalErrorMessage),h("zonos-payment",null),h("div",{class:"zonos--group-btn"},!n&&h(Fragment,null,h("zonos-button",{backgroundColor:e.submitBtnColor,bold:true,isDisabled:e.continueLoading&&stripeStore.checkoutSettlementCurrency==="USD",loading:e.continueLoading&&stripeStore.checkoutSettlementCurrency!=="USD",onClick:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!cartStore.checkoutSession){log("Checkout session is not found");return[2]}return[4,this.continueClickHandler({currencyCode:cartStore.checkoutSession.subtotals.presentmentCurrencyCode})];case 1:e.sent();return[2]}}))}))},size:"lg",variant:e.submitBtnType},translate("Pay [orderTotal]",{orderTotal:renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})})),stripeStore.shouldRenderPayInUsdButton&&h("zonos-button",{class:"zonos--pay-in-base-currency-btn",isDisabled:e.continueLoading&&stripeStore.checkoutSettlementCurrency!=="USD",loading:e.continueLoading&&stripeStore.checkoutSettlementCurrency==="USD",onClick:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.continueClickHandler({currencyCode:"USD"})];case 1:e.sent();return[2]}}))}))},size:"lg",variant:"subtle"},translate("Click to pay in USD"))),h("zonos-paypal-payment",{onPaypalSessionDone:function(o){var t=o.detail.orderId;e.paypalSessionDone.emit(t)},onPaypalSessionFail:function(){return e.paypalSessionFailed.emit()},style:{display:n?"block":"none"}})),t&&h("zonos-card",{backgroundColor:"gray-100",borderRadius:12,class:"zonos--test-cards"},h("zonos-v-stack",{spacing:16},h("div",null,h("zonos-text",{type:"semiBoldLabel"},translate("Test cards")),h("zonos-text",{textColor:"gray-700"},translate("Click to copy the card number. Use any future expiration date and three number CVC."))),h("zonos-button",{icon:h("zonos-icon",{content:CheckmarkLineIcon}),justifyContent:"flex-start",onClick:function(){return e.copyCardToClipboard("4242424242424242")}},translate("Success")," (****4242)"),h("zonos-button",{icon:h("zonos-icon",{content:RemoveLineIcon}),justifyContent:"flex-start",onClick:function(){return e.copyCardToClipboard("4000000000000002")}},translate("Failure")," (****0002)")),h("zonos-notification",null)))};return h(Host,{class:"zonos--checkout-payment zonos--elements"},h("div",{class:"zonos--group"},h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Payment method")),a()))};Object.defineProperty(e.prototype,"ele",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{continueLoading:["continueLoadingWatcher"],hasStripePaymentError:["stripePaymentErrorWatcher"]}},enumerable:false,configurable:true});return e}();ZonosCollectPayment.style=ZonosCollectPaymentStyle0;var zonosCollectReviewCss=':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:-webkit-sticky;position:sticky;top:0;background-color:var(--zonos-elements-gray-0);z-index:1}:host .zonos--total-pay{margin:8px 0 24px;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;gap:48px}:host .zonos--total-pay zonos-text{-ms-flex-negative:0;flex-shrink:0}:host .zonos--total-pay::after{content:"";position:relative;height:1px;width:100%;background:var(--zonos-elements-gray-200)}:host(.mobile),:host(.tablet){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;padding:4px 0;background-color:transparent;position:relative}:host(.mobile) .zonos--total-pay,:host(.tablet) .zonos--total-pay{margin:0}';var ZonosCollectReviewStyle0=zonosCollectReviewCss;var ZonosCollectReview=function(){function e(e){registerInstance(this,e);this.mobile=false;this.tablet=false;this.collapsed=false;this.isMobile=false;this.isTablet=false;this.isLoading=true}e.prototype.handleWindowResize=function(){this.isMobile=isCollectMobile(this.mobile);this.isTablet=isCollectTablet(this.tablet)};e.prototype.componentWillLoad=function(){var e=this;this.handleWindowResize();setTimeout((function(){e.isLoading=false}),1e3)};e.prototype.render=function(){var e=this.isMobile?"gray-1000":"gray-800";return h(Host,{key:"7f1709df3a42ae9917e26a86e9c90703b2243ab7",class:classes(["zonos--collect-review zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},h("div",{key:"5ed5f5c7da922a9393501b5e31da9a20b9724d9c",class:"zonos--title"},h("zonos-text",{key:"d54511663bb32405e16349b20807b9ccddb5fd03",textColor:e,type:"semiBoldLabel"},translate("Pay [organizationName] duties, taxes and fees for your shipment",{organizationName:zonosStore.organizationName}))),h("div",{key:"82967c3614ee91cf95955372bb013837f93822d1",class:"zonos--total-pay"},renderFallback({content:h("zonos-text",{type:"secondaryPageHeader"},renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"36px",skeletonWidth:"150px"})))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}();ZonosCollectReview.style=ZonosCollectReviewStyle0;var zonosCollectSubtotalCss=":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:-webkit-sticky;position:sticky;bottom:60px}:host .zonos--collect-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--collect-table .zonos--column{padding:8px 8px;vertical-align:top}:host .zonos--collect-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--collect-table .zonos--column:first-child{width:60px;max-width:100px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--collect-subtotal-price{text-align:right}:host .zonos--collect-subtotal-price zonos-text{white-space:nowrap}:host .zonos--collect-total .zonos--column{padding:16px 0}:host .zonos--collect-total-subtotal .zonos--collect-subtotal-title,:host .zonos--collect-total-subtotal .zonos--collect-subtotal-price{border-bottom:1px solid var(--zonos-elements-gray-200)}:host .zonos--collect-subtotal-price zonos-text,:host .zonos--collect-pay-total zonos-text{white-space:nowrap}";var ZonosCollectSubtotalStyle0=zonosCollectSubtotalCss;var ZonosCollectSubtotal=function(){function e(e){var o=this;registerInstance(this,e);this.storeUnsubscribeList=[];this.subtotals={};this.initSubtotalData=function(){var e;var t;var s=(t=cartStore.checkoutSession)===null||t===void 0?void 0:t.subtotals;if(!s){return}var n=translate("Duties");var a=translate("Taxes");var r=translate("Fees");var l=(e={},e[n]=0,e[r]=0,e[a]=0,e);var i=s.duties;var c=s.taxes;var d=s.fees;if(i!==undefined){l[n]||(l[n]=0);l[n]+=i}if(c!==undefined){l[a]||(l[a]=0);l[a]+=c}if(d!==undefined){l[r]||(l[r]=0);l[r]+=d}o.subtotals=l}}e.prototype.disconnectedCallback=function(){this.storeUnsubscribeList.forEach((function(e){return e()}))};e.prototype.componentWillLoad=function(){this.storeUnsubscribeList=[cartStoreOnChange("checkoutSession",this.initSubtotalData),translationStoreOnChange("translatedChunks",this.initSubtotalData)]};e.prototype.render=function(){this.initSubtotalData();return h(Host,{key:"fea37a2a4dd32592b88703c37d901fee65408bed",class:"zonos--collect-subtotal zonos--elements"},h("table",{key:"be501438b0101c4b13421450dad99ec12f7c5a0b",class:"zonos--collect-table"},!!this.subtotals[translate("Duties")]&&h("tr",{key:"2c61bf6e958a199d4b8ae3aff00b74a9889ab491",class:"zonos--row zonos--collect-duty"},h("td",{key:"d6fc30c58fcc42c282b7dfb03c83b0b7feb0dd82",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"5909abeeed4a5f90df5a79be09383842137a175c",type:"semiBoldLabel"},translate("Duties"))),h("td",{key:"68d06c4e8732363e0e5e36d77f9d4b363c0adc3c",class:"zonos--column"}),h("td",{key:"fd23e46a4ed44fadc31472e38a15f7579ebed160",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:this.subtotals[translate("Duties")]||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[translate("Taxes")]&&h("tr",{key:"3960ae24df8093e1bb7e904bba82b774dc32103c",class:"zonos--row zonos--collect-tax"},h("td",{key:"cdfb4bd23f8b3f0545170a05a3b060533db22f26",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"bbbdaade160358cc94a9347f835d2e8bc759866d",type:"semiBoldLabel"},translate("Taxes"))),h("td",{key:"032c233f3301289c89791d78a5624d9409292041",class:"zonos--column"}),h("td",{key:"b96dc16ecbff5add3adb0236c794c7a71c48800b",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:this.subtotals[translate("Taxes")]||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[translate("Fees")]&&h("tr",{key:"056890bb4d5394aea10f618c97c6d22d0ed63d3b",class:"zonos--row zonos--collect-fee"},h("td",{key:"920bbbc49538bf61a4b3a180454a904996448b22",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"3609ef98b6fe12f11d16a9176321321fa450c482",type:"semiBoldLabel"},translate("Fees"))),h("td",{key:"c7393e334a5d229f879094aa10356740676a412a",class:"zonos--column"}),h("td",{key:"799e621fbeda831fd2181a362d9ace49a39b69e4",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:this.subtotals[translate("Fees")]||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),h("tr",{key:"b9cc1a5aa049ccefb48dc5d1627bdb8093ffe29f",class:"zonos--row zonos--collect-spacing"},h("td",{key:"439b7508f723ed01efd63e499de979a84e136b21",class:"zonos--column",colSpan:3})),h("tr",{key:"6c3db4c263f849b9f1ad25a1ce1cfb23dcf03b10",class:"zonos--row zonos--collect-total zonos--collect-total-subtotal"},h("td",{key:"3fac71f137d3d5af8a40d7aaa0ad36c31a827a5b",class:"zonos--column"}),h("td",{key:"45084572c966e849b69dd4f10d065fd3f0aa5544",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"5c09a882998169f59baa30a59574d1ca919ab1c6",type:"label"},translate("Subtotal"))),h("td",{key:"d8debe70bbc2394f95581409a1db5cb8055383eb",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),h("tr",{key:"db55f0a9600bff78e582609f17ac561fb30ec85f",class:"zonos--row zonos--collect-total"},h("td",{key:"8b77eb9db155a44591bce58fd24ee46110b9a407",class:"zonos--column"}),h("td",{key:"5c1b6df053e202f60d1d3fa4ff5d8c53fb1762ce",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"393f436b62e9b49d52598896b2913f08e953987b",type:"semiBoldLabel"},translate("Customs fees total"))),h("td",{key:"c2bc51d66b8490652c6f6df8fac0194544785706",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"semiBoldLabel"},renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"})))))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}();ZonosCollectSubtotal.style=ZonosCollectSubtotalStyle0;export{ZonosCollectFinish as zonos_collect_finish,ZonosCollectFooter as zonos_collect_footer,ZonosCollectOrderDetails as zonos_collect_order_details,ZonosCollectPayment as zonos_collect_payment,ZonosCollectReview as zonos_collect_review,ZonosCollectSubtotal as zonos_collect_subtotal};
1
+ var __awaiter=this&&this.__awaiter||function(e,o,t,s){function n(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,a){function r(e){try{i(s.next(e))}catch(e){a(e)}}function l(e){try{i(s["throw"](e))}catch(e){a(e)}}function i(e){e.done?t(e.value):n(e.value).then(r,l)}i((s=s.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,n,a,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(e){return function(o){return i([e,o])}}function i(l){if(s)throw new TypeError("Generator is already executing.");while(r&&(r=0,l[0]&&(t=0)),t)try{if(s=1,n&&(a=l[0]&2?n["return"]:l[0]?n["throw"]||((a=n["return"])&&a.call(n),0):n.next)&&!(a=a.call(n,l[1])).done)return a;if(n=0,a)l=[l[0]&2,a.value];switch(l[0]){case 0:case 1:a=l;break;case 4:t.label++;return{value:l[1],done:false};case 5:t.label++;n=l[1];l=[0];continue;case 7:l=t.ops.pop();t.trys.pop();continue;default:if(!(a=t.trys,a=a.length>0&&a[a.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!a||l[1]>a[0]&&l[1]<a[3])){t.label=l[1];break}if(l[0]===6&&t.label<a[1]){t.label=a[1];a=l;break}if(a&&t.label<a[2]){t.label=a[2];t.ops.push(l);break}if(a[2])t.ops.pop();t.trys.pop();continue}l=o.call(e,t)}catch(e){l=[6,e];n=0}finally{s=a=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var s=0,n=o.length,a;s<n;s++){if(a||!(s in o)){if(!a)a=Array.prototype.slice.call(o,0,s);a[s]=o[s]}}return e.concat(a||Array.prototype.slice.call(o))};import{r as registerInstance,d as createEvent,h,F as Fragment,a as Host,g as getElement}from"./index-cfd394c8.js";import{b as airwallexStore,d as airwallexStoreRetrievePaymentIntent,j as airwallexStoreMessageBasedOnStatus,k as airwallexStoreReset,c as collectStore,e as airwallexStoreIsPaidStatus}from"./collect-b88fe4ca.js";import{b as stripeStore,c as stripeStoreRetrievePayment,t as trackConversionEvent,Q as stripeStoreResetPromoCode,F as stripeStoreReset,R as stripeStoreMessageBasedOnStatus,d as cartStore,u as cartStoreNextStep,G as cartStoreOnChange}from"./cart-402dcde5.js";import{s as submitAnalytics,c as paypalStoreReset,a as paypalStore,b as paypalInitScript}from"./paypal-2d4c9d01.js";import{t as translate,s as storageStore,l as localizationStore,x as translationStoreOnChange}from"./localization-d49867ed.js";import{z as zonosStore}from"./zonosStore-b7d3f9b0.js";import{h as handleFetch,s as sendErrorLog,g as getIsTestMode,i as isCheckoutMobile,a as getIsStagingMode}from"./handleFetch-a844cac1.js";import{c as createCustomEvent}from"./createCustomEvent-58159025.js";import{g as getBorderRadius}from"./getBorderRadius-dc982fe6.js";import{l as log,b as allLogs}from"./VarianceTest-572cecf5.js";import{i as isCollectMobile,a as isCollectTablet}from"./isCollectMobileTablet-111b0dd7.js";import{c as classes}from"./classes-0d95c529.js";import{l as languages}from"./ILanguage-cd6acb72.js";import{r as renderCheckoutCurrency}from"./renderCheckoutCurrency-ef71083e.js";import{p as placeTestOrder}from"./placeTestOrder-2ba7c3f2.js";import{r as renderFallback}from"./renderFallback-b250f4e9.js";import"./isDarkColor-039ef212.js";import"./TaxId-50d72254.js";import"./isContrastColor-089de6ac.js";import"./submitGtag-dc54f5b9.js";var RemoveIcon='<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-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" data-is-secondary-color="true" fill="var(--zonos-elements-red-200)" fill-rule="evenodd"></path><path clip-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" fill="currentColor" fill-rule="evenodd"></path></svg>';var SuccessIcon='<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosCollectFinishCss=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:24px;border-radius:var(--zonos--border-radius, 10px);gap:24px;margin-top:24px;background-color:var(--zonos-elements-gray-50);padding:48px}:host .zonos--finish-details{max-width:640px;min-width:300px;line-height:24px;width:0 auto;margin:auto}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .zonos--finish-button-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto;margin-top:48px;max-width:300px}:host .zonos--button-container{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto}:host .zonos--subtitle{text-align:center}:host .zonos--order-number{background-color:var(--zonos-elements-gray-0);border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800);border-radius:var(--zonos-elements-radius-6);padding:4px 8px}";var ZonosCollectFinishStyle0=zonosCollectFinishCss;var MAX_RETRIES=30;var ZonosCollectFinish=function(){function e(e){var o=this;registerInstance(this,e);this.closeClick=createEvent(this,"closeClick",7);this.borderRadius="ROUNDED";this.confirmationId=null;this.isLoading=true;this.notificationType="success";this.notificationTitle="";this.notificationMessages=[];this.notificationActionText=translate("Keep shopping");this.order=null;this.isWaitingToRedirect=true;this.pullOrder=function(){return __awaiter(o,void 0,void 0,(function(){var e,o,t,s,n,a,r,l;return __generator(this,(function(i){switch(i.label){case 0:t=storageStore.checkoutSessionId;s=new URLSearchParams;s.set("checkoutSessionId",t||"");return[4,handleFetch("/api/zonos-elements/get-order?".concat(s.toString()))];case 1:n=i.sent(),a=n.baseUrl,r=n.errors,l=n.json;if(r.length||!(l===null||l===void 0?void 0:l.id)){return[2,{baseUrl:a,order:null}]}return[4,(o=(e=zonosStore.checkoutSettings).onOrderSuccess)===null||o===void 0?void 0:o.call(e,{zonosApiRoute:a,zonosOrder:l})];case 2:i.sent();return[2,{baseUrl:a,order:l}]}}))}))};this.handleSuccessBehavior=function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.isLoading=false;return[4,this.getPullOrder()];case 1:e.sent();return[2]}}))}))};this.getPullOrder=function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return __awaiter(o,__spreadArray([],e,true),void 0,(function(e){var o,t,s,n,a,r,l,i;if(e===void 0){e=0}return __generator(this,(function(c){switch(c.label){case 0:if(e===0){log("=== Start to poll for order info","info")}return[4,this.pullOrder()];case 1:s=c.sent(),n=s.baseUrl,a=s.order;r=!!((t=(o=a===null||a===void 0?void 0:a.references)===null||o===void 0?void 0:o.find((function(e){return(e===null||e===void 0?void 0:e.key)==="zonosOrderNumber"})))===null||t===void 0?void 0:t.value);l=storageStore.checkoutSessionId;i=parseFloat(new URLSearchParams(window.location.search).get("maxPollingRetries")||"0")||MAX_RETRIES;log("=== Polling order (".concat(e," attemps)"),"info");if(!a)return[3,2];log("=== CollectOrder info found","info");if(e>10){void sendErrorLog({endpoint:"".concat(n,"/api/zonos-elements/get-order?checkoutSessionId=").concat(l,"&orderId=").concat(a.id),errors:["Collect order found after ".concat(e," attempts")],metadata:{allLogs:allLogs,checkoutSessionId:storageStore.checkoutSessionId||"",orderId:a.id,storeId:zonosStore.storeId}})}this.order=a;return[3,6];case 2:if(!((!a||!r)&&e<i))return[3,5];return[4,new Promise((function(e){return setTimeout(e,1e3)}))];case 3:c.sent();return[4,this.getPullOrder(e+1)];case 4:c.sent();return[3,6];case 5:void sendErrorLog({endpoint:"".concat(n,"/api/zonos-elements/get-order?checkoutSessionId=").concat(l),errors:["Collect order not found after ".concat(i," attempts")],metadata:{allLogs:allLogs,checkoutSessionId:storageStore.checkoutSessionId||"",storeId:zonosStore.storeId}});c.label=6;case 6:return[2]}}))}))};this.checkStripePaymentStatus=function(){return __awaiter(o,void 0,void 0,(function(){var e,o,t,s,n,a,r,l,i;return __generator(this,(function(c){switch(c.label){case 0:e=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||stripeStore.clientSecret;if(!(e||this.storybookForceStatus))return[3,4];return[4,stripeStoreRetrievePayment({clientSecret:e,storybookForceStatus:this.storybookForceStatus})];case 1:o=c.sent(),t=o.error,s=o.messages,n=o.status;a=n==="requires_action"||t;this.notificationType=a?"error":"success";this.notificationMessages=s||[];this.notificationTitle=a?translate("Payment failed"):translate("You're all set!");log("=== Payment intent retrieve status","info",{clientSecret:e,error:t,messages:s,status:n});r=new URL(window.location.href);r.searchParams.delete("payment_intent_client_secret");r.searchParams.delete("payment_intent");r.searchParams.delete("redirect_status");r.searchParams.delete("zonosCheckoutSessionId");window.history.replaceState({},"",r.toString());if(!(t&&(s===null||s===void 0?void 0:s.length)))return[3,2];submitAnalytics({event:"zonos-checkout-payment-fail"});void sendErrorLog({endpoint:"Stripe payment failed",errors:['Payment intent "'.concat(e.split("_secret_")[0]||e,'" status: ').concat(n," - checkout session: ").concat(storageStore.checkoutSessionId)],metadata:{allLogs:allLogs,credentialToken:window.Zonos.zonosApiKey}});return[3,4];case 2:submitAnalytics({event:"zonos-checkout-success"});l=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:l,eventName:"checkout_orderCompleted"});i=createCustomEvent("zonos-checkout-success",{message:"Zonos Checkout successfully processed order"});document.dispatchEvent(i);return[4,this.handleSuccessBehavior()];case 3:c.sent();c.label=4;case 4:this.isLoading=false;stripeStoreResetPromoCode();stripeStoreReset();storageStore.checkoutSessionId=null;return[2]}}))}))};this.getAirwallexSessionInfo=function(){return __awaiter(o,void 0,void 0,(function(){var e,o,t;return __generator(this,(function(s){switch(s.label){case 0:if(airwallexStore.paymentIntentId){return[2,{isCompleted:false,paymentIntentId:airwallexStore.paymentIntentId}]}e=storageStore.checkoutSessionId;if(!e){return[2,{isCompleted:false,paymentIntentId:null}]}return[4,handleFetch("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:e},method:"POST"})];case 1:o=s.sent().json;t=o===null||o===void 0?void 0:o.checkoutSession;return[2,{isCompleted:!!((t===null||t===void 0?void 0:t.completedAt)||(t===null||t===void 0?void 0:t.order)),paymentIntentId:(t===null||t===void 0?void 0:t.paymentIntentId)||null}]}}))}))};this.checkAirwallexPaymentStatus=function(){return __awaiter(o,void 0,void 0,(function(){var e,o,t,s,n,a,r,l,i,c,d;return __generator(this,(function(h){switch(h.label){case 0:e=airwallexStore.paymentConfirmed;o=this.storybookForceStatus==="succeeded";return[4,this.getAirwallexSessionInfo()];case 1:t=h.sent(),s=t.isCompleted,n=t.paymentIntentId;if(!n)return[3,3];return[4,airwallexStoreRetrievePaymentIntent(n)];case 2:r=h.sent();return[3,4];case 3:r={status:null};h.label=4;case 4:a=r.status;l=e||o||s||airwallexStoreIsPaidStatus(a);i=(e||o||s?airwallexStoreMessageBasedOnStatus("SUCCEEDED"):airwallexStoreMessageBasedOnStatus(a)).messages;log("=== Airwallex payment intent retrieve status","info",{forcedSuccess:o,isCompleted:s,isPaid:l,paymentIntentId:n,sdkConfirmed:e,status:a});this.notificationType=l?"success":"error";this.notificationTitle=l?translate("You're all set!"):translate("Payment failed");this.notificationMessages=i;if(!l)return[3,6];submitAnalytics({event:"zonos-checkout-success"});c=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:c,eventName:"checkout_orderCompleted"});d=createCustomEvent("zonos-checkout-success",{message:"Zonos Checkout successfully processed order"});document.dispatchEvent(d);return[4,this.handleSuccessBehavior()];case 5:h.sent();return[3,7];case 6:submitAnalytics({event:"zonos-checkout-payment-fail"});void sendErrorLog({endpoint:"Airwallex payment failed",errors:['Payment intent "'.concat(n,'" status: ').concat(a," - checkout session: ").concat(storageStore.checkoutSessionId)],metadata:{allLogs:allLogs,credentialToken:window.Zonos.zonosApiKey}});h.label=7;case 7:this.isLoading=false;stripeStoreResetPromoCode();stripeStoreReset();airwallexStoreReset();storageStore.checkoutSessionId=null;return[2]}}))}))};this.checkStagingOrderStatus=function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.notificationType="success";this.notificationTitle=translate("You're all set!");this.notificationMessages=stripeStoreMessageBasedOnStatus("succeeded").messages;return[4,this.handleSuccessBehavior()];case 1:e.sent();stripeStoreResetPromoCode();stripeStoreReset();paypalStoreReset();storageStore.checkoutSessionId=null;return[2]}}))}))};this.checkPaypalPaymentStatus=function(){return __awaiter(o,void 0,void 0,(function(){var e;return __generator(this,(function(o){switch(o.label){case 0:if(paypalStore.paypalErrorMessage){this.notificationType="error";this.notificationTitle=translate("Payment failed");this.notificationMessages=[paypalStore.paypalErrorMessage];this.isLoading=false;return[2]}this.isLoading=false;if(!paypalStore.orderIdCreated)return[3,2];submitAnalytics({event:"zonos-checkout-success"});e=storageStore.checkoutSessionId;void trackConversionEvent({checkoutSessionId:e,eventName:"checkout_orderCompleted"});this.notificationType="success";this.notificationTitle=translate("You're all set!");this.notificationMessages=stripeStoreMessageBasedOnStatus("succeeded").messages;return[4,this.handleSuccessBehavior()];case 1:o.sent();o.label=2;case 2:stripeStoreResetPromoCode();stripeStoreReset();paypalStoreReset();storageStore.checkoutSessionId=null;return[2]}}))}))};this.getReceiptUrl=function(e){var o=e.cartId;var t=new URL("".concat(window.location.origin,"/receipt"));t.searchParams.set("referenceId",o);var s=getIsTestMode();if(s){t.searchParams.set("zonosTestMode","1")}var n=new URLSearchParams(window.location.search).get("zonosQaUrl");if(n){t.searchParams.set("zonosQaUrl",n)}return t.toString()}}e.prototype.componentDidLoad=function(){if(this.overrideNotification){this.notificationType=this.overrideNotification.type;this.notificationTitle=this.overrideNotification.title;this.notificationMessages=this.overrideNotification.messages;this.isLoading=false;return}if(cartStore.isStagingMode){void this.checkStagingOrderStatus()}else if(collectStore.paymentProcessor==="AIRWALLEX"){void this.checkAirwallexPaymentStatus()}else if(paypalStore.orderIdCreated){void this.checkPaypalPaymentStatus()}else{void this.checkStripePaymentStatus()}};e.prototype.render=function(){var e=this;var o=window.Zonos.cartId;return h(Host,{key:"fe3107670230caeaacc834983d9215422a7828ae",class:"zonos--checkout-finish zonos--elements",style:{"--zonos--border-radius":getBorderRadius({overrideBorderStyle:this.borderRadius})}},!this.isLoading&&h("div",{key:"fefefedc7ec022318cbc6da23b327079afec981b",class:"zonos--finish-details"},h("div",{key:"4428271e11c3a96db732726719c5747364a18097",class:"zonos--group"},this.notificationType==="success"?h("zonos-icon",{"aria-label":"Order success",content:SuccessIcon,iconColor:"blue-800",size:50}):h("zonos-icon",{"aria-label":"Order failed",content:RemoveIcon,iconColor:"red-800",size:50}),h("zonos-text",{key:"0c3371b3bed8fd83e437075f1c35179fbb7e5e09",class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),this.confirmationId&&h("zonos-badge",{key:"dbb263f0f95a62d93ae3c5ac455625512eb1f63e",badgeColor:"gray"},this.confirmationId),h("zonos-text",{key:"07e2733ad91ced8e5260e0f8fea627610b864ebf",class:"zonos--subtitle",textColor:"gray-600"},this.notificationMessages.map((function(e){return h(Fragment,null,e,h("br",null))}))),this.order&&o&&h("div",{key:"ecb7332cb4b7c28d398f2957d3b521c6328163eb",class:"zonos--button-container"},h("zonos-button",{key:"c8303e2a61d573b6e028ab38df2427fa98471e9f",onClick:function(){window.open(e.getReceiptUrl({cartId:o}),"_blank")},size:"lg",variant:"primary"},translate("View receipt"))))))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}();ZonosCollectFinish.style=ZonosCollectFinishStyle0;var ChevronDownIcon$1='<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 Globe='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM11.4709 5.80634C11.7686 5.53723 11.9541 5.5 12 5.5C12.0459 5.5 12.2314 5.53723 12.5291 5.80634C12.8115 6.06164 13.1289 6.46913 13.4271 7.03651C13.9505 8.03191 14.3838 9.46098 14.48 11.25H9.51996C9.61624 9.46098 10.0495 8.03191 10.5729 7.03651C10.8711 6.46913 11.1885 6.06164 11.4709 5.80634ZM8.01802 11.25C8.11591 9.23031 8.60319 7.55958 9.24516 6.33849C9.29983 6.23451 9.35585 6.13335 9.41312 6.03514C7.32916 6.94017 5.81218 8.90533 5.5428 11.25H8.01802ZM5.5428 12.75H8.01802C8.11591 14.7697 8.60319 16.4404 9.24516 17.6615C9.29983 17.7655 9.35585 17.8666 9.41312 17.9649C7.32916 17.0598 5.81218 15.0947 5.5428 12.75ZM9.51996 12.75H14.48C14.3838 14.539 13.9505 15.9681 13.4271 16.9635C13.1289 17.5309 12.8115 17.9384 12.5291 18.1937C12.2314 18.4628 12.0459 18.5 12 18.5C11.9541 18.5 11.7686 18.4628 11.4709 18.1937C11.1885 17.9384 10.8711 17.5309 10.5729 16.9635C10.0495 15.9681 9.61624 14.539 9.51996 12.75ZM15.982 12.75C15.8841 14.7697 15.3968 16.4404 14.7548 17.6615C14.7002 17.7655 14.6441 17.8666 14.5869 17.9649C16.6708 17.0598 18.1878 15.0947 18.4572 12.75H15.982ZM18.4572 11.25C18.1878 8.90533 16.6708 6.94017 14.5869 6.03514C14.6441 6.13335 14.7002 6.23451 14.7548 6.33849C15.3968 7.55958 15.8841 9.23031 15.982 11.25H18.4572Z" fill="currentColor"/>\n</svg>\n';var ZonosWordmark='<svg width="43" height="10" viewBox="0 0 43 10" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.35896 0.0640869H0.30768C0.166068 0.0640869 0.0512695 0.178886 0.0512695 0.320497V1.85896C0.0512695 2.00057 0.166068 2.11537 0.30768 2.11537H4.44439C4.54964 2.11537 4.61005 2.2352 4.54745 2.31982L0.151823 8.2615C0.0865163 8.34978 0.0512695 8.45669 0.0512695 8.56649V9.67947C0.0512695 9.82108 0.166068 9.93588 0.30768 9.93588H7.35896C7.50057 9.93588 7.61537 9.82108 7.61537 9.67947V8.14101C7.61537 7.9994 7.50057 7.8846 7.35896 7.8846H3.22226C3.117 7.8846 3.05659 7.76477 3.11919 7.68015L7.51482 1.73847C7.58013 1.65019 7.61537 1.54328 7.61537 1.43348V0.320497C7.61537 0.178886 7.50057 0.0640869 7.35896 0.0640869Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M11.718 0C10.1602 0 8.89746 1.26279 8.89746 2.82051V7.17949C8.89746 8.73721 10.1602 10 11.718 10H13.6411C15.1988 10 16.4616 8.73721 16.4616 7.17949V2.82051C16.4616 1.26279 15.1988 0 13.6411 0H11.718ZM11.718 2.05128C11.2931 2.05128 10.9487 2.39568 10.9487 2.82051V7.17949C10.9487 7.60432 11.2931 7.94872 11.718 7.94872H13.6411C14.0659 7.94872 14.4103 7.60432 14.4103 7.17949V5V2.82051C14.4103 2.39568 14.0659 2.05128 13.6411 2.05128H11.718Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M17.7437 0.436316V9.71132C17.7437 9.85293 17.8585 9.96773 18.0001 9.96773H19.5385C19.6801 9.96773 19.7949 9.85293 19.7949 9.71132V3.74801C19.7949 3.44829 19.969 3.17587 20.241 3.04996L22.1641 2.15964C22.6739 1.92363 23.2565 2.29592 23.2565 2.85769V9.71132C23.2565 9.85293 23.3713 9.96773 23.5129 9.96773H25.0513C25.193 9.96773 25.3078 9.85293 25.3078 9.71132V2.85595C25.3078 0.79631 23.1718 -0.568775 21.3027 0.296257L19.9742 0.911055C19.8685 0.959946 19.7432 0.931536 19.669 0.84187L19.2748 0.365697C19.1773 0.248019 19.0325 0.179905 18.8797 0.179905H18.0001C17.8585 0.179905 17.7437 0.294704 17.7437 0.436316Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M29.4104 0C27.8526 0 26.5898 1.26279 26.5898 2.82051V7.17949C26.5898 8.73721 27.8526 10 29.4104 10H31.3334C32.8912 10 34.1539 8.73721 34.1539 7.17949V2.82051C34.1539 1.26279 32.8912 0 31.3334 0H29.4104ZM29.4104 2.05128C28.9855 2.05128 28.6411 2.39568 28.6411 2.82051V7.17949C28.6411 7.60432 28.9855 7.94872 29.4104 7.94872H31.3334C31.7583 7.94872 32.1027 7.60432 32.1027 7.17949V2.82051C32.1027 2.39568 31.7583 2.05128 31.3334 2.05128H29.4104Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M38.2085 0.0640869H40.3889C41.8309 0.0640869 42.9999 1.23306 42.9999 2.67506C42.9999 2.79477 42.9108 2.89574 42.792 2.91059L41.1732 3.11293C41.054 3.12784 40.9486 3.03485 40.9486 2.91466C40.9486 2.47322 40.5908 2.11537 40.1493 2.11537H38.3397C37.8688 2.11537 37.4871 2.49712 37.4871 2.96803C37.4871 3.3685 37.7658 3.71501 38.1569 3.80087L40.7916 4.37922C42.0811 4.66229 42.9999 5.80462 42.9999 7.12486C42.9999 8.67735 41.7414 9.93588 40.1889 9.93588H38.0468C36.6048 9.93588 35.4358 8.76691 35.4358 7.32491C35.4358 7.2052 35.5249 7.10423 35.6437 7.08938L37.2625 6.88703C37.3817 6.87213 37.4871 6.96512 37.4871 7.08531C37.4871 7.52675 37.8449 7.8846 38.2864 7.8846H40.1176C40.5765 7.8846 40.9486 7.51252 40.9486 7.05354C40.9486 6.67478 40.6925 6.34394 40.3258 6.24901L37.5136 5.52093C36.2902 5.20422 35.4358 4.10042 35.4358 2.83676C35.4358 1.30545 36.6772 0.0640869 38.2085 0.0640869Z" fill="var(--zonos-elements-gray-700)"/>\n</svg>\n';var zonosCollectFooterCss=":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:absolute;bottom:0;left:32px;right:32px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--collect-footer{gap:16px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px;padding-left:0;-ms-flex-align:center;align-items:center;width:100%}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:16px}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo a{line-height:0}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper a{text-decoration:none}:host .zonos--collect-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--collect-footer .zonos--collect-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--collect-footer .zonos--collect-locale-wrapper{gap:4px}}:host .zonos--collect-footer .zonos--collect-locale-wrapper .zonos--collect-locale-label{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;gap:4px}:host .zonos--collect-footer .zonos--collect-language-dialog{position:absolute;bottom:36px;left:var(--language-dialog-left);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);width:360px;max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:bottom left;transform-origin:bottom left;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}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar{width:10px}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--collect-footer .zonos--collect-language-dialog.zonos--collect-language-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .dot{display:-ms-inline-flexbox;display:inline-flex;background:var(--zonos-elements-gray-400);width:6px;height:6px;border-radius:50%}:host(.mobile),:host(.tablet){background-color:var(--zonos-elements-gray-0);width:100%;position:-webkit-sticky;position:sticky;bottom:0}:host(.tablet) .zonos--collect-footer{width:100%;max-width:800px;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex}:host(.mobile) .zonos--collect-locale-wrapper{display:none}:host(.mobile) .zonos--collect-footer{-ms-flex-pack:center;justify-content:center}";var ZonosCollectFooterStyle0=zonosCollectFooterCss;var ZonosCollectFooter=function(){function e(e){registerInstance(this,e);this.mobile=false;this.tablet=false;this.showLanguageDialog=false;this.isMobile=false;this.isTablet=false}e.prototype.handleGlobalClick=function(e){if(!this.el.contains(e.target)&&this.showLanguageDialog){this.showLanguageDialog=false}};e.prototype.toggleLanguageDialog=function(){this.showLanguageDialog=!this.showLanguageDialog};e.prototype.handleMobileChange=function(){this.isMobile=isCollectMobile(this.mobile)};e.prototype.handleTabletChange=function(){this.isTablet=isCollectTablet(this.tablet)};e.prototype.componentWillLoad=function(){this.isMobile=isCollectMobile(this.mobile);this.isTablet=isCollectTablet(this.tablet)};e.prototype.render=function(){var e=this;var o;var t=(o=languages.find((function(e){return e.code===localizationStore.selectedLocale})))===null||o===void 0?void 0:o.label;var s="gray-1000";return h(Host,{key:"52908f4538918641b708887436e1cfe3b643376f",class:classes(["zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},h("div",{key:"46a1c762d78396a7f993bad323c93f8e6bc71f1b",class:"zonos--collect-footer"},h("div",{key:"a6a98539cdb901ecd162f5e5b98591c9b8b7321a",class:"zonos--collect-locale-wrapper"},h("zonos-button",{key:"8a5c4a18bc1030c3e74e412ff14a59c299f59e9a",buttonColor:s,class:"zonos--collect-footer-language-button",icon:h("zonos-icon",{"aria-label":"Language select",content:Globe,iconColor:s}),onClick:function(){return e.toggleLanguageDialog()},variant:"subtle"},h("span",{key:"03bc4235862d1382cd8f0cdb007fd708bf2bfe87",class:"zonos--collect-locale-label"},t,h("zonos-icon",{key:"4b3bbcd5bcd4039f3cb1f1c4c12698cba1894308","aria-hidden":"true",class:"zonos--collect-locale-chevron",content:ChevronDownIcon$1,iconColor:s,size:18}))),h("div",{key:"5508629b0cdc334b81ad4d4d5a034ced133d6744",class:classes(["zonos--collect-language-dialog",this.showLanguageDialog&&"zonos--collect-language-dialog-open"])},h("zonos-language-select",{key:"ca4b77d72dfd9db8743290d333b7fcde15d090d6",handleOnClose:function(){return e.toggleLanguageDialog()}}))),h("div",{key:"98f0d0c35e3c6b4fde833e4b9ae334549fe46f1f",class:"zonos--collect-footer-icon-wrapper"},h("div",{key:"b3039948472d797bf04a23d3aca839472f6c6946",class:"zonos--collect-footer-logo"},h("zonos-text",{key:"75123a6fb2bcdce07e0ebe433a28d81eefaec9ea",textColor:s},"Powered by"),h("a",{key:"2a0f4e2bc5df9d383ac4b91c589d2ce7149c6b3d",href:"https://zonos.com",target:"_blank",title:"Zonos website"},h("zonos-icon",{key:"436005434f2a9d2ff1228cd36d873b8de7d339f2",autoHeight:true,content:ZonosWordmark,size:42}))),h("div",{key:"c488b5eefba54424a0e66af61415d78d8f3d46fa",class:"dot"}),h("a",{key:"d98fc7646d4877179b94bee6d3f8a7a283bbc756",href:"https://zonos.com/docs/legal/zonos-privacy-policy",target:"_blank"},h("zonos-text",{key:"54fe3d9316ee5b22f5620b7acde145627b66cbe3",textColor:s},"Privacy policy")))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{mobile:["handleMobileChange"],tablet:["handleTabletChange"]}},enumerable:false,configurable:true});return e}();ZonosCollectFooter.style=ZonosCollectFooterStyle0;var ChevronDownIcon='<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 ChevronUpIcon='<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="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var zonosCollectOrderDetailsCss=":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{height:100%}:host *{-ms-scroll-chaining:none;overscroll-behavior:contain}:host *::-webkit-scrollbar{width:10px}:host *::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host *::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host *::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--wrapper{overflow:auto;background-color:var(--zonos-elements-gray-50);border-radius:16px;height:100%;min-height:56px}:host .zonos--order-details-header{position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--zonos-elements-gray-50);border:none;display:-ms-flexbox;display:flex;padding:16px 16px 0 16px;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host .zonos--order-details-header:focus-visible{outline:none}:host .zonos--order-details-wrapper{position:relative;padding:0 16px 16px 16px}:host .zonos--collect-order-details-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:28px}:host .zonos--collect-order-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}:host .zonos--collect-order-info .zonos--collect-order-details-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px}:host .zonos--collect-order-info .zonos--collect-order-details-row>*{-ms-flex:1 1 150px;flex:1 1 150px}:host .zonos--collect-order-info .zonos--collect-order-details-column{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--collect-order-info .zonos--collect-order-shipping-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0}";var ZonosCollectOrderDetailsStyle0=zonosCollectOrderDetailsCss;var ZonosCollectOrderDetails=function(){function e(e){registerInstance(this,e);this.collapseClicked=createEvent(this,"collapseClicked",7);this.mobile=true;this.landedCostId="";this.isMobile=false;this.collapseState=this.collapsed}e.prototype.handleCollapseChangeFromProp=function(e){this.collapseState=e};e.prototype.handleCollapseChange=function(e){this.collapseClicked.emit(e)};e.prototype.handleWindowResize=function(){this.isMobile=isCheckoutMobile(this.mobile)};e.prototype.componentWillLoad=function(){this.handleWindowResize()};e.prototype.renderShippingAddress=function(){if(collectStore.isFetchingShippingInfo){return h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},h("zonos-skeleton",{skeletonWidth:"99px"})),h("div",{class:"zonos--collect-order-shipping-info"},h("zonos-skeleton",{skeletonWidth:"152px"}),h("zonos-h-stack",{spacing:8},h("zonos-skeleton",{skeletonWidth:"75px"}),h("zonos-skeleton",{skeletonWidth:"75px"})),h("zonos-skeleton",{skeletonWidth:"50px"})))}var e=collectStore.shippingAddress;if(!e){return null}return h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},translate("Shipping address")),h("div",{class:"zonos--collect-order-shipping-info"},[[e.location.line1,e.location.line2].filter(Boolean).join(" "),[e.location.locality,e.location.administrativeAreaCode,e.location.postalCode].filter(Boolean).join(", "),e.location.countryCode].map((function(e){return h("zonos-text",null,e)}))))};e.prototype.render=function(){var e=this;var o=function(){if(e.collapseState){return h("zonos-icon",{"aria-label":"Collapse expanded section",content:ChevronDownIcon,iconColor:"gray-1200"})}return h("zonos-icon",{"aria-label":"Expand collapsed section",content:ChevronUpIcon,iconColor:"gray-1200"})};return h(Host,{class:classes(["zonos--collect-order-details zonos--elements",this.isMobile&&"mobile"])},h("div",{class:"zonos--wrapper"},h("button",{class:"zonos--order-details-header",onClick:function(){e.collapseState=!e.collapseState},type:"button"},h("zonos-text",{type:"semiBoldLabel"},translate("Shipment details")),o()),h("div",{class:"zonos--order-details-wrapper"},h("zonos-collapse",{collapsed:this.collapseState},h("div",{class:"zonos--collect-order-details-content"},h("zonos-collect-cart-items",null),h("div",{class:"zonos--collect-order-info"},h("div",{class:"zonos--collect-order-details-row"},collectStore.amountTotalPaid!==null&&h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},translate("Total paid")),h("zonos-text",null,renderCheckoutCurrency({amount:collectStore.amountTotalPaid||0,isForeign:true}))),collectStore.originCompanyName&&h("div",{class:"zonos--collect-order-details-column"},h("zonos-text",{type:"smallHeader"},translate("Ordered from")),h("zonos-text",null,collectStore.originCompanyName||""))),this.renderShippingAddress()))))))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{collapsed:["handleCollapseChangeFromProp"],collapseState:["handleCollapseChange"]}},enumerable:false,configurable:true});return e}();ZonosCollectOrderDetails.style=ZonosCollectOrderDetailsStyle0;var CheckmarkLineIcon='<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M15.342 10.21a.75.75 0 0 0-1.184-.92l-2.978 3.829-1.4-1.4a.75.75 0 1 0-1.06 1.061l1.8 1.8a1 1 0 0 0 1.496-.093l3.326-4.277Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>';var RemoveLineIcon='<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M14.475 10.586a.75.75 0 1 0-1.06-1.06L12 10.938l-1.414-1.414a.75.75 0 0 0-1.06 1.06L10.938 12l-1.414 1.414a.75.75 0 1 0 1.06 1.06L12 13.062l1.414 1.414a.75.75 0 0 0 1.06-1.06L13.062 12l1.414-1.414Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>';var zonosCollectPaymentCss=".sc-zonos-collect-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-payment-h *.sc-zonos-collect-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-payment-h img.sc-zonos-collect-payment{max-width:100%}.sc-zonos-collect-payment-h dl.sc-zonos-collect-payment,.sc-zonos-collect-payment-h dd.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h1.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h2.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h3.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h4.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h5.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h6.sc-zonos-collect-payment,.sc-zonos-collect-payment-h hr.sc-zonos-collect-payment,.sc-zonos-collect-payment-h figure.sc-zonos-collect-payment,.sc-zonos-collect-payment-h p.sc-zonos-collect-payment,.sc-zonos-collect-payment-h pre.sc-zonos-collect-payment{margin:0}.sc-zonos-collect-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--title.sc-zonos-collect-payment{margin-bottom:24px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment{margin-bottom:20px;overflow:visible;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--payment-error-banner.sc-zonos-collect-payment{margin-bottom:8px}.sc-zonos-collect-payment-h .zonos--error-banner.sc-zonos-collect-payment{margin-bottom:16px}.sc-zonos-collect-payment-h zonos-button.sc-zonos-collect-payment{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-collect-payment-h .zonos--pay-in-base-currency-btn.sc-zonos-collect-payment{-webkit-box-shadow:none;box-shadow:none}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:12px;bottom:-4px;padding-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-text.sc-zonos-collect-payment{text-align:center}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-button.sc-zonos-collect-payment{width:100%}.sc-zonos-collect-payment-h .zonos--test-cards.sc-zonos-collect-payment{margin-top:auto;padding-top:16px}";var ZonosCollectPaymentStyle0=zonosCollectPaymentCss;var ZonosCollectPayment=function(){function e(e){var o=this;registerInstance(this,e);this.continueClicked=createEvent(this,"continueClicked",7);this.paypalSessionFailed=createEvent(this,"paypalSessionFailed",7);this.paypalSessionDone=createEvent(this,"paypalSessionDone",7);this.airwallexPaymentDone=createEvent(this,"airwallexPaymentDone",7);this.storeUnsubscribeList=[];this.continueLoading=false;this.showErrorBanner=false;this.hasStripePaymentError=false;this.stagingOrderCreateErrorMessage="";this.internalContinueLoading=this.continueLoading;this.handleValidate=function(){var e;return!!((e=stripeStore.stripePaymentEventData)===null||e===void 0?void 0:e.complete)};this.continueClickHandler=function(e){return __awaiter(o,[e],void 0,(function(e){var o,t;var s=this;var n=e.currencyCode;return __generator(this,(function(e){if(!this.handleValidate()){void((o=stripeStore.stripeBillingAddressElement)===null||o===void 0?void 0:o.getValue());this.showErrorBanner=true;void((t=stripeStore.stripeElements)===null||t===void 0?void 0:t.submit());setTimeout((function(){var e;(e=s.ele.querySelector("zonos-banner"))===null||e===void 0?void 0:e.scrollIntoView({behavior:"smooth"})}),10);return[2]}stripeStore.checkoutSettlementCurrency=n;submitAnalytics({event:"zonos-checkout-payment-info"});this.continueClicked.emit();return[2]}))}))};this.copyCardToClipboard=function(e){return __awaiter(o,void 0,void 0,(function(){var o,t;return __generator(this,(function(s){switch(s.label){case 0:s.trys.push([0,2,,3]);return[4,navigator.clipboard.writeText(e)];case 1:s.sent();return[3,3];case 2:o=s.sent();t=document.createElement("textarea");t.style.position="fixed";t.style.left="-1000px";t.style.top="-1000px";t.style.width="1px";t.style.height="1px";t.value=e;t.id="zonos-copy-card-number";document.body.appendChild(t);t.select();document.execCommand("copy");document.body.removeChild(t);return[3,3];case 3:window.Zonos.showNotification({message:translate("Card number copied to clipboard"),timeout:4e3,type:"success"});return[2]}}))}))};this.placeTestOrder=function(){return __awaiter(o,void 0,void 0,(function(){var e;return __generator(this,(function(o){switch(o.label){case 0:this.internalContinueLoading=true;return[4,placeTestOrder()];case 1:e=o.sent().errors;if(e.length){this.stagingOrderCreateErrorMessage=e[0]||"Failed to create staging order. Please try again.";this.internalContinueLoading=false;return[2]}this.internalContinueLoading=false;cartStoreNextStep();return[2]}}))}))}}e.prototype.continueLoadingWatcher=function(){this.internalContinueLoading=this.continueLoading};e.prototype.stripePaymentErrorWatcher=function(){var e=this;if(this.hasStripePaymentError){setTimeout((function(){var o;(o=e.ele.querySelector("zonos-banner"))===null||o===void 0?void 0:o.scrollIntoView({behavior:"smooth"})}),50)}};e.prototype.componentWillLoad=function(){this.storeUnsubscribeList=[cartStoreOnChange("currency",(function(){void paypalInitScript({currency:cartStore.currency})}))];void paypalInitScript({currency:cartStore.currency})};e.prototype.disconnectedCallback=function(){this.storeUnsubscribeList.forEach((function(e){return e()}))};e.prototype.render=function(){var e=this;var o;if(collectStore.paymentProcessor==="AIRWALLEX"){return h(Host,{class:"zonos--checkout-payment zonos--elements"},h("div",{class:"zonos--group"},h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Payment method")),h("zonos-airwallex-payment",{onAirwallexPaymentSuccess:function(){return e.airwallexPaymentDone.emit()}})))}this.hasStripePaymentError=stripeStore.hasPaymentError;if(!stripeStore.stripeElements){return null}if(!stripeStore.clientSecret){return null}if(this.showErrorBanner){this.showErrorBanner=!this.handleValidate()}var t=getIsTestMode();var s=cartStore.isStagingMode||getIsStagingMode();var n=((o=stripeStore.stripePaymentEventData)===null||o===void 0?void 0:o.value.type)==="external_paypal";var a=function(){if(s){var o=zonosStore.appearance.theme;return h(Fragment,null,e.stagingOrderCreateErrorMessage&&h("zonos-banner",{class:"zonos--error-banner",intent:"error"},e.stagingOrderCreateErrorMessage),h("zonos-empty-state-payment",{emptyStateText:translate("No payment method needed for staging"),theme:o}),h("div",{class:"zonos--group-btn"},h("zonos-button",{backgroundColor:e.submitBtnColor,loading:e.internalContinueLoading,onClick:function(){void e.placeTestOrder()},size:"lg",variant:e.submitBtnType},translate("Place test order"))))}if(stripeStore.isFetchingSession||collectStore.isFetchingShippingInfo){return null}return h(Fragment,null,e.showErrorBanner&&h("zonos-banner",{class:"zonos--error-banner",intent:"error"},translate("Missing required fields. Make sure all fields are completed.")),e.hasStripePaymentError&&h("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},stripeStore.customErrorMessage||translate("We couldn't complete your payment. Please verify the payment details and try again.")),paypalStore.paypalErrorMessage&&h("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},paypalStore.paypalErrorMessage),h("zonos-payment",null),h("div",{class:"zonos--group-btn"},!n&&h(Fragment,null,h("zonos-button",{backgroundColor:e.submitBtnColor,bold:true,isDisabled:e.continueLoading&&stripeStore.checkoutSettlementCurrency==="USD",loading:e.continueLoading&&stripeStore.checkoutSettlementCurrency!=="USD",onClick:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:if(!cartStore.checkoutSession){log("Checkout session is not found");return[2]}return[4,this.continueClickHandler({currencyCode:cartStore.checkoutSession.subtotals.presentmentCurrencyCode})];case 1:e.sent();return[2]}}))}))},size:"lg",variant:e.submitBtnType},translate("Pay [orderTotal]",{orderTotal:renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})})),stripeStore.shouldRenderPayInUsdButton&&h("zonos-button",{class:"zonos--pay-in-base-currency-btn",isDisabled:e.continueLoading&&stripeStore.checkoutSettlementCurrency!=="USD",loading:e.continueLoading&&stripeStore.checkoutSettlementCurrency==="USD",onClick:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.continueClickHandler({currencyCode:"USD"})];case 1:e.sent();return[2]}}))}))},size:"lg",variant:"subtle"},translate("Click to pay in USD"))),h("zonos-paypal-payment",{onPaypalSessionDone:function(o){var t=o.detail.orderId;e.paypalSessionDone.emit(t)},onPaypalSessionFail:function(){return e.paypalSessionFailed.emit()},style:{display:n?"block":"none"}})),t&&h("zonos-card",{backgroundColor:"gray-100",borderRadius:12,class:"zonos--test-cards"},h("zonos-v-stack",{spacing:16},h("div",null,h("zonos-text",{type:"semiBoldLabel"},translate("Test cards")),h("zonos-text",{textColor:"gray-700"},translate("Click to copy the card number. Use any future expiration date and three number CVC."))),h("zonos-button",{icon:h("zonos-icon",{content:CheckmarkLineIcon}),justifyContent:"flex-start",onClick:function(){return e.copyCardToClipboard("4242424242424242")}},translate("Success")," (****4242)"),h("zonos-button",{icon:h("zonos-icon",{content:RemoveLineIcon}),justifyContent:"flex-start",onClick:function(){return e.copyCardToClipboard("4000000000000002")}},translate("Failure")," (****0002)")),h("zonos-notification",null)))};return h(Host,{class:"zonos--checkout-payment zonos--elements"},h("div",{class:"zonos--group"},h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Payment method")),a()))};Object.defineProperty(e.prototype,"ele",{get:function(){return getElement(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{continueLoading:["continueLoadingWatcher"],hasStripePaymentError:["stripePaymentErrorWatcher"]}},enumerable:false,configurable:true});return e}();ZonosCollectPayment.style=ZonosCollectPaymentStyle0;var zonosCollectReviewCss=':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:-webkit-sticky;position:sticky;top:0;background-color:var(--zonos-elements-gray-0);z-index:1}:host .zonos--total-pay{margin:8px 0 24px;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;gap:48px}:host .zonos--total-pay zonos-text{-ms-flex-negative:0;flex-shrink:0}:host .zonos--total-pay::after{content:"";position:relative;height:1px;width:100%;background:var(--zonos-elements-gray-200)}:host(.mobile),:host(.tablet){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;padding:4px 0;background-color:transparent;position:relative}:host(.mobile) .zonos--total-pay,:host(.tablet) .zonos--total-pay{margin:0}';var ZonosCollectReviewStyle0=zonosCollectReviewCss;var ZonosCollectReview=function(){function e(e){registerInstance(this,e);this.mobile=false;this.tablet=false;this.collapsed=false;this.isMobile=false;this.isTablet=false;this.isLoading=true}e.prototype.handleWindowResize=function(){this.isMobile=isCollectMobile(this.mobile);this.isTablet=isCollectTablet(this.tablet)};e.prototype.componentWillLoad=function(){var e=this;this.handleWindowResize();setTimeout((function(){e.isLoading=false}),1e3)};e.prototype.render=function(){var e=this.isMobile?"gray-1000":"gray-800";return h(Host,{key:"7f1709df3a42ae9917e26a86e9c90703b2243ab7",class:classes(["zonos--collect-review zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},h("div",{key:"5ed5f5c7da922a9393501b5e31da9a20b9724d9c",class:"zonos--title"},h("zonos-text",{key:"d54511663bb32405e16349b20807b9ccddb5fd03",textColor:e,type:"semiBoldLabel"},translate("Pay [organizationName] duties, taxes and fees for your shipment",{organizationName:zonosStore.organizationName}))),h("div",{key:"82967c3614ee91cf95955372bb013837f93822d1",class:"zonos--total-pay"},renderFallback({content:h("zonos-text",{type:"secondaryPageHeader"},renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"36px",skeletonWidth:"150px"})))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}();ZonosCollectReview.style=ZonosCollectReviewStyle0;var zonosCollectSubtotalCss=":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:-webkit-sticky;position:sticky;bottom:60px}:host .zonos--collect-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--collect-table .zonos--column{padding:8px 8px;vertical-align:top}:host .zonos--collect-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--collect-table .zonos--column:first-child{width:60px;max-width:100px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--collect-subtotal-price{text-align:right}:host .zonos--collect-subtotal-price zonos-text{white-space:nowrap}:host .zonos--collect-total .zonos--column{padding:16px 0}:host .zonos--collect-total-subtotal .zonos--collect-subtotal-title,:host .zonos--collect-total-subtotal .zonos--collect-subtotal-price{border-bottom:1px solid var(--zonos-elements-gray-200)}:host .zonos--collect-subtotal-price zonos-text,:host .zonos--collect-pay-total zonos-text{white-space:nowrap}";var ZonosCollectSubtotalStyle0=zonosCollectSubtotalCss;var ZonosCollectSubtotal=function(){function e(e){var o=this;registerInstance(this,e);this.storeUnsubscribeList=[];this.subtotals={};this.initSubtotalData=function(){var e;var t;var s=(t=cartStore.checkoutSession)===null||t===void 0?void 0:t.subtotals;if(!s){return}var n=translate("Duties");var a=translate("Taxes");var r=translate("Fees");var l=(e={},e[n]=0,e[r]=0,e[a]=0,e);var i=s.duties;var c=s.taxes;var d=s.fees;if(i!==undefined){l[n]||(l[n]=0);l[n]+=i}if(c!==undefined){l[a]||(l[a]=0);l[a]+=c}if(d!==undefined){l[r]||(l[r]=0);l[r]+=d}o.subtotals=l}}e.prototype.disconnectedCallback=function(){this.storeUnsubscribeList.forEach((function(e){return e()}))};e.prototype.componentWillLoad=function(){this.storeUnsubscribeList=[cartStoreOnChange("checkoutSession",this.initSubtotalData),translationStoreOnChange("translatedChunks",this.initSubtotalData)]};e.prototype.render=function(){this.initSubtotalData();return h(Host,{key:"fea37a2a4dd32592b88703c37d901fee65408bed",class:"zonos--collect-subtotal zonos--elements"},h("table",{key:"be501438b0101c4b13421450dad99ec12f7c5a0b",class:"zonos--collect-table"},!!this.subtotals[translate("Duties")]&&h("tr",{key:"2c61bf6e958a199d4b8ae3aff00b74a9889ab491",class:"zonos--row zonos--collect-duty"},h("td",{key:"d6fc30c58fcc42c282b7dfb03c83b0b7feb0dd82",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"5909abeeed4a5f90df5a79be09383842137a175c",type:"semiBoldLabel"},translate("Duties"))),h("td",{key:"68d06c4e8732363e0e5e36d77f9d4b363c0adc3c",class:"zonos--column"}),h("td",{key:"fd23e46a4ed44fadc31472e38a15f7579ebed160",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:this.subtotals[translate("Duties")]||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[translate("Taxes")]&&h("tr",{key:"3960ae24df8093e1bb7e904bba82b774dc32103c",class:"zonos--row zonos--collect-tax"},h("td",{key:"cdfb4bd23f8b3f0545170a05a3b060533db22f26",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"bbbdaade160358cc94a9347f835d2e8bc759866d",type:"semiBoldLabel"},translate("Taxes"))),h("td",{key:"032c233f3301289c89791d78a5624d9409292041",class:"zonos--column"}),h("td",{key:"b96dc16ecbff5add3adb0236c794c7a71c48800b",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:this.subtotals[translate("Taxes")]||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[translate("Fees")]&&h("tr",{key:"056890bb4d5394aea10f618c97c6d22d0ed63d3b",class:"zonos--row zonos--collect-fee"},h("td",{key:"920bbbc49538bf61a4b3a180454a904996448b22",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"3609ef98b6fe12f11d16a9176321321fa450c482",type:"semiBoldLabel"},translate("Fees"))),h("td",{key:"c7393e334a5d229f879094aa10356740676a412a",class:"zonos--column"}),h("td",{key:"799e621fbeda831fd2181a362d9ace49a39b69e4",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:this.subtotals[translate("Fees")]||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),h("tr",{key:"b9cc1a5aa049ccefb48dc5d1627bdb8093ffe29f",class:"zonos--row zonos--collect-spacing"},h("td",{key:"439b7508f723ed01efd63e499de979a84e136b21",class:"zonos--column",colSpan:3})),h("tr",{key:"6c3db4c263f849b9f1ad25a1ce1cfb23dcf03b10",class:"zonos--row zonos--collect-total zonos--collect-total-subtotal"},h("td",{key:"3fac71f137d3d5af8a40d7aaa0ad36c31a827a5b",class:"zonos--column"}),h("td",{key:"45084572c966e849b69dd4f10d065fd3f0aa5544",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"5c09a882998169f59baa30a59574d1ca919ab1c6",type:"label"},translate("Subtotal"))),h("td",{key:"d8debe70bbc2394f95581409a1db5cb8055383eb",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"label"},renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),h("tr",{key:"db55f0a9600bff78e582609f17ac561fb30ec85f",class:"zonos--row zonos--collect-total"},h("td",{key:"8b77eb9db155a44591bce58fd24ee46110b9a407",class:"zonos--column"}),h("td",{key:"5c1b6df053e202f60d1d3fa4ff5d8c53fb1762ce",class:"zonos--column zonos--collect-subtotal-title"},h("zonos-text",{key:"393f436b62e9b49d52598896b2913f08e953987b",type:"semiBoldLabel"},translate("Customs fees total"))),h("td",{key:"c2bc51d66b8490652c6f6df8fac0194544785706",class:"zonos--column zonos--collect-subtotal-price"},renderFallback({content:h("zonos-text",{type:"semiBoldLabel"},renderCheckoutCurrency({amount:collectStore.amountDutyTaxFeeTotal||0,isForeign:true})),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"})))))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return e}();ZonosCollectSubtotal.style=ZonosCollectSubtotalStyle0;export{ZonosCollectFinish as zonos_collect_finish,ZonosCollectFooter as zonos_collect_footer,ZonosCollectOrderDetails as zonos_collect_order_details,ZonosCollectPayment as zonos_collect_payment,ZonosCollectReview as zonos_collect_review,ZonosCollectSubtotal as zonos_collect_subtotal};
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(o,e,t,s){function c(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,n){function l(o){try{i(s.next(o))}catch(o){n(o)}}function r(o){try{i(s["throw"](o))}catch(o){n(o)}}function i(o){o.done?t(o.value):c(o.value).then(l,r)}i((s=s.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},s,c,n,l;return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(o){return function(e){return i([o,e])}}function i(r){if(s)throw new TypeError("Generator is already executing.");while(l&&(l=0,r[0]&&(t=0)),t)try{if(s=1,c&&(n=r[0]&2?c["return"]:r[0]?c["throw"]||((n=c["return"])&&n.call(c),0):c.next)&&!(n=n.call(c,r[1])).done)return n;if(c=0,n)r=[r[0]&2,n.value];switch(r[0]){case 0:case 1:n=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;c=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(n=t.trys,n=n.length>0&&n[n.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!n||r[1]>n[0]&&r[1]<n[3])){t.label=r[1];break}if(r[0]===6&&t.label<n[1]){t.label=n[1];n=r;break}if(n&&t.label<n[2]){t.label=n[2];t.ops.push(r);break}if(n[2])t.ops.pop();t.trys.pop();continue}r=e.call(o,t)}catch(o){r=[6,o];c=0}finally{s=n=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{r as registerInstance,h,a as Host,F as Fragment}from"./index-cfd394c8.js";import{c as collectStore,a as airwallexStoreSetFromSession,b as airwallexStore,d as airwallexStoreRetrievePaymentIntent,e as airwallexStoreIsPaidStatus,f as airwallexStoreInitSdk,g as collectStoreUpdateSelectedShippingOption,h as collectStoreInitShippingInfo,i as collectStoreAsyncAddressUpdate}from"./collect-a235299d.js";import{b as stripeStore,i as initStripeElements,d as cartStore,c as stripeStoreRetrievePayment,n as cartStoreUpdateToErrorState,e as cartStoreUpdateItems,j as stripeStoreInitCheckoutSession,k as stripeStoreGetPaymentIntent,w as stripeStoreUpdateCheckoutSessionBaseCurrency,C as stripeStoreConfirmPayment,H as stripeStoreOnChange,F as stripeStoreReset,f as cartStoreReset}from"./cart-23e29950.js";import{p as paypalStoreHasPaypalEnabled,a as paypalStore}from"./paypal-5bc6b0d0.js";import{s as storageStore,t as translate,e as localizationStoreOnChange,h as currencyFormat,l as localizationStore}from"./localization-17546792.js";import{z as zonosStore}from"./zonosStore-8e19daff.js";import{b as buildCartItemsByTempCart}from"./buildCartItemsByTempCart-a117f75d.js";import{h as handleFetch,s as sendErrorLog,l as logError,g as getIsTestMode}from"./handleFetch-a844cac1.js";import{i as isCollectMobile,a as isCollectTablet}from"./isCollectMobileTablet-111b0dd7.js";import{c as classes}from"./classes-0d95c529.js";import{l as log}from"./VarianceTest-572cecf5.js";import{r as renderFallback}from"./renderFallback-b250f4e9.js";import{l as languages}from"./ILanguage-cd6acb72.js";import"./isDarkColor-566f04c5.js";import"./getBorderRadius-d23f47a6.js";import"./isContrastColor-fbddacb6.js";import"./submitGtag-c7ea1f2a.js";var ChevronDownIcon='<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 zonosCollectCss=".sc-zonos-collect-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-h *.sc-zonos-collect{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-h img.sc-zonos-collect{max-width:100%}.sc-zonos-collect-h dl.sc-zonos-collect,.sc-zonos-collect-h dd.sc-zonos-collect,.sc-zonos-collect-h h1.sc-zonos-collect,.sc-zonos-collect-h h2.sc-zonos-collect,.sc-zonos-collect-h h3.sc-zonos-collect,.sc-zonos-collect-h h4.sc-zonos-collect,.sc-zonos-collect-h h5.sc-zonos-collect,.sc-zonos-collect-h h6.sc-zonos-collect,.sc-zonos-collect-h hr.sc-zonos-collect,.sc-zonos-collect-h figure.sc-zonos-collect,.sc-zonos-collect-h p.sc-zonos-collect,.sc-zonos-collect-h pre.sc-zonos-collect{margin:0}.sc-zonos-collect-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-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-collect-h *.sc-zonos-collect{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar{width:10px}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{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-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{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-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--header.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--logo.sc-zonos-collect{margin-bottom:0}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect zonos-checkout-finish.sc-zonos-collect{-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{padding:0 8px 8px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--payment-error-banner.sc-zonos-collect{margin-top:24px}.sc-zonos-collect-h .zonos--right.sc-zonos-collect{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-collect-h .zonos--right.sc-zonos-collect .zonos--order-details-container.sc-zonos-collect{overflow:hidden}.sc-zonos-collect-h .zonos--wrapper.sc-zonos-collect{overflow:auto;max-height:100%;position:relative}.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;margin-top:32px}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect>*.sc-zonos-collect{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-collect-h .zonos--header-right.sc-zonos-collect{display:none}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect img.sc-zonos-collect{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-collect-h .zonos--collect-container.sc-zonos-collect{overflow:visible}.mobile.sc-zonos-collect-h,.tablet.sc-zonos-collect-h{min-width:auto}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{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-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding-bottom:0}}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{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-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect{margin-bottom:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect{margin-top:8px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{max-height:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:auto}.mobile.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect{margin:0}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px;padding:0 16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{overflow:visible;width:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{gap:32px}.mobile.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{margin-top:0}.mobile.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:56px;top:-56px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--header-right.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:28px;top:-28px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect{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-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar{width:10px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.zonos--collect-language-dialog-open.sc-zonos-collect{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-collect-h .zonos--content.sc-zonos-collect{-ms-scroll-chaining:chained;overscroll-behavior:auto}";var ZonosCollectStyle0=zonosCollectCss;var ZonosCollect=function(){function o(o){var e=this;registerInstance(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.collapseReview=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=stripeStore.clientSecret;this.stripeCustomerSessionClientSecret=stripeStore.stripeCustomerSessionClientSecret;this.getBaseCurrencySettlementInfo=function(){var o=cartStore.selectedLandedCost;if(!o){return null}var e=o.landedCost.amountSubtotals;if(!e){return null}var t=(e.discounts||0)+e.items+e.landedCostTotal+e.shipping;return{settlementAmount:t}};this.applyStripeTheme=function(){return __awaiter(e,void 0,void 0,(function(){var o;return __generator(this,(function(e){switch(e.label){case 0:o=zonosStore.appearance.theme;return[4,initStripeElements({overrideTheme:this.isMobile?o:undefined,paypalEnabled:paypalStoreHasPaypalEnabled()})];case 1:e.sent();return[2]}}))}))};this.fetchCheckoutSession=function(o){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,handleFetch("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"})];case 1:e=t.sent().json;return[2,e]}}))}))};this.initPaymentProcessor=function(){return __awaiter(e,void 0,void 0,(function(){var o,e,t,s,c,n;return __generator(this,(function(l){switch(l.label){case 0:e=storageStore.checkoutSessionId;if(!e)return[3,4];return[4,this.fetchCheckoutSession(e)];case 1:t=l.sent();collectStore.paymentProcessor=(t===null||t===void 0?void 0:t.checkoutSession.paymentProcessor)||null;if(!(collectStore.paymentProcessor==="AIRWALLEX"))return[3,4];if(!t||!airwallexStoreSetFromSession(t.checkoutSession)){throw new Error("Airwallex checkout session is missing a client secret")}s=t.checkoutSession;airwallexStore.currency=cartStore.currency;this.confirmationId=((o=s.landedCost)===null||o===void 0?void 0:o.shortId)||null;c=!!s.completedAt||!!s.order;if(!(!c&&s.clientSecret&&s.paymentIntentId))return[3,3];return[4,airwallexStoreRetrievePaymentIntent(s.paymentIntentId)];case 2:n=l.sent().status;c=airwallexStoreIsPaidStatus(n);l.label=3;case 3:if(c){void this.setToFinishStep();return[2]}void airwallexStoreInitSdk();return[2];case 4:void this.applyStripeTheme();return[2]}}))}))};this.checkStripePaymentIntentStatus=function(){return __awaiter(e,void 0,void 0,(function(){var o,e,t,s,c,n,l,r,i,a;return __generator(this,(function(d){switch(d.label){case 0:e=!!window.Zonos.cartData;t=new URL(window.location.href).searchParams;s=t.get("payment_intent_client_secret");c=t.get("zonosCheckoutSessionId");log("Payment intent exist, checking stripe payment intent status");if(!s){log("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:e}]}return[4,stripeStoreRetrievePayment({clientSecret:s})];case 1:n=d.sent(),l=n.error,r=n.status;i=new URLSearchParams(window.location.search).get("redirect_status");if(!(i&&c))return[3,3];if(!l){log("Payment intent is succeeded or in a good state to move forward, show success screen")}else{log("Payment intent failed, show status from error")}return[4,this.fetchCheckoutSession(c)];case 2:a=d.sent();this.confirmationId=((o=a===null||a===void 0?void 0:a.checkoutSession.landedCost)===null||o===void 0?void 0:o.shortId)||null;storageStore.checkoutSessionId=c;stripeStore.clientSecret=s;void this.setToFinishStep(r);return[2,{shouldAllowOrder:false}];case 3:if(!e){log("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}log("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))};this.recoverCompletedCollectSession=function(o){return __awaiter(e,void 0,void 0,(function(){var e,t,s,c,n,n;return __generator(this,(function(l){switch(l.label){case 0:return[4,this.fetchCheckoutSession(o)];case 1:t=l.sent();if(!t){return[2,false]}s=t.checkoutSession;this.confirmationId=((e=s.landedCost)===null||e===void 0?void 0:e.shortId)||null;collectStore.paymentProcessor=s.paymentProcessor||null;c=s.paymentProcessor==="AIRWALLEX";if(c&&s.clientSecret){airwallexStoreSetFromSession(s);airwallexStore.currency=cartStore.currency}if(s.completedAt||s.order){void this.setToFinishStep("succeeded");return[2,true]}if(!c)return[3,4];if(!(s.clientSecret&&s.paymentIntentId))return[3,3];return[4,airwallexStoreRetrievePaymentIntent(s.paymentIntentId)];case 2:n=l.sent().status;if(airwallexStoreIsPaidStatus(n)){void this.setToFinishStep();return[2,true]}l.label=3;case 3:return[3,6];case 4:if(!s.clientSecret)return[3,6];return[4,stripeStoreRetrievePayment({clientSecret:s.clientSecret})];case 5:n=l.sent().status;if(n==="processing"||n==="succeeded"){stripeStore.clientSecret=s.clientSecret;void this.setToFinishStep(n);return[2,true]}l.label=6;case 6:return[2,false]}}))}))}}o.prototype.resizeListener=function(){this.isMobile=isCollectMobile(this.mobile);this.isTablet=isCollectTablet(this.tablet)};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){stripeStore.stripe=window.Zonos.stripe;cartStore.step="finish";this.storybookPaymentStatusOverride=o;this.isOverlayLoading=false;return[2]}))}))};o.prototype.initCollectCart=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,s,c,n,l,r,i,a,d,z,h,u,f,m,p,g,b,v,S,w;return __generator(this,(function(x){switch(x.label){case 0:if(!window.Zonos.cartData){return[2]}z=(e=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.items[0])===null||e===void 0?void 0:e.currencyCode;if(z){cartStore.currency=z}h=(s=(t=window.Zonos.cartData)===null||t===void 0?void 0:t.references)===null||s===void 0?void 0:s.checkoutSessionId;u=(n=(c=window.Zonos.cartData)===null||c===void 0?void 0:c.references)===null||n===void 0?void 0:n.landedCostId;if(!u){cartStoreUpdateToErrorState({messages:[translate("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:zonosStore.organizationName})],title:translate("Invalid session")});return[2]}if(h){log("Setting checkout session id from cart reference","info",h);storageStore.checkoutSessionId=h}else{log("Clear checkout session id from storage so we start from a fresh session for the collect cart");storageStore.checkoutSessionId=null}return[4,this.checkStripePaymentIntentStatus()];case 1:f=x.sent().shouldAllowOrder;if(!f){return[2]}x.label=2;case 2:x.trys.push([2,13,,14]);m=buildCartItemsByTempCart(window.Zonos.cartData),p=m.adjustments,g=m.cartItems;return[4,cartStoreUpdateItems({adjustments:p,cartItems:g,landedCostId:u,shouldInitSessionOnFailure:false})];case 3:x.sent();if(!(!storageStore.checkoutSessionId&&!h))return[3,5];return[4,stripeStoreInitCheckoutSession()];case 4:b=x.sent();log("stripeStoreInitCheckoutSession: ".concat(b));if(!b){throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Collect quote but being used with sandbox credential")}x.label=5;case 5:if(!((!cartStore.checkoutSession||((l=cartStore.checkoutSession)===null||l===void 0?void 0:l.completedAt))&&h))return[3,7];return[4,this.recoverCompletedCollectSession(h)];case 6:v=x.sent();if(v){return[2]}void sendErrorLog({endpoint:"INVALID_COLLECT_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:h,cartId:(r=window.Zonos.cartData)===null||r===void 0?void 0:r.id,cartLandedCostId:u}});throw new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it");case 7:if(!cartStore.checkoutSession){void sendErrorLog({endpoint:"FAIL_TO_UPDATE_CREATE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this collect cart"],metadata:{cartCheckoutSessionId:h||"N/A",cartId:(i=window.Zonos.cartData)===null||i===void 0?void 0:i.id,cartLandedCostId:u||"N/A"}});throw new Error("Could not update/create checkout session for this collect cart")}collectStore.paymentProcessor=cartStore.checkoutSession.paymentProcessor;if(!(collectStore.paymentProcessor==="AIRWALLEX"))return[3,9];return[4,stripeStoreGetPaymentIntent()];case 8:x.sent();if((a=cartStore.checkoutSession)===null||a===void 0?void 0:a.clientSecret){airwallexStore.clientSecret=cartStore.checkoutSession.clientSecret;airwallexStore.currency=cartStore.currency}return[3,10];case 9:void stripeStoreGetPaymentIntent();x.label=10;case 10:S=(d=cartStore.checkoutSession)===null||d===void 0?void 0:d.landedCost;if(!S){throw new Error("Landed cost could not be found in checkout session after creating/updating them")}return[4,collectStoreUpdateSelectedShippingOption(Object.assign(Object.assign({},cartStore.checkoutSession),{id:storageStore.checkoutSessionId||""}))];case 11:x.sent();void collectStoreInitShippingInfo({landedCostId:S.id});return[4,this.initPaymentProcessor()];case 12:x.sent();return[3,14];case 13:w=x.sent();logError(w);cartStoreUpdateToErrorState({messages:[translate("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:zonosStore.organizationName})],title:translate("Invalid session")});return[3,14];case 14: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,e,t,s,c,n,l,r,i;return __generator(this,(function(a){switch(a.label){case 0:void((o=stripeStore.stripeBillingAddressElement)===null||o===void 0?void 0:o.getValue());if(!((e=stripeStore.stripeLinkEventData)===null||e===void 0?void 0:e.complete)){c=document.querySelector("zonos-link-authentication");c===null||c===void 0?void 0:c.scrollIntoView({behavior:"smooth"});return[2]}if(!((t=stripeStore.stripeBillingAddressEventData)===null||t===void 0?void 0:t.complete)){n=document.querySelector(".zonos--billing-address");n===null||n===void 0?void 0:n.scrollIntoView({behavior:"smooth"});return[2]}l=stripeStore.checkoutSettlementCurrency==="USD";if(l&&stripeStore.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;paypalStore.paypalErrorMessage=null;stripeStore.hasPaymentError=false;this.submitLoading=true;cartStore.inventoryCheckErrorMessage=null;return[4,stripeStoreUpdateCheckoutSessionBaseCurrency()];case 1:r=a.sent();if(!r){stripeStore.hasPaymentError=true;stripeStore.customErrorMessage=translate("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:stripeStore.checkoutSettlementCurrency});this.submitLoading=false;return[2]}return[4,collectStoreAsyncAddressUpdate()];case 2:a.sent();a.label=3;case 3:a.trys.push([3,5,,6]);return[4,stripeStoreConfirmPayment({noLandedCostCheck:true})];case 4:a.sent();cartStore.step="finish";this.confirmationId=collectStore.landedCostShortId||((s=cartStore.selectedLandedCost)===null||s===void 0?void 0:s.landedCostId)||null;return[2];case 5:i=a.sent();logError(i);stripeStore.hasPaymentError=true;return[3,6];case 6:this.submitLoading=false;return[2]}}))}))};o.prototype.componentWillLoad=function(){var o=this;stripeStore.stripe=window.Zonos.stripe;cartStore.step="payment";void this.initCollectCart();this.resizeListener();this.storeUnsubscribeList=[stripeStoreOnChange("clientSecret",(function(){void o.applyStripeTheme()})),localizationStoreOnChange("selectedLocale",(function(){void o.applyStripeTheme()}))];log("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){stripeStoreReset();cartStoreReset();this.onChangeLocaleListener();this.storeUnsubscribeList.forEach((function(o){return o()}))};o.prototype.render=function(){var o=this;this.clientSecret=stripeStore.clientSecret;if(stripeStore.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=stripeStore.stripeCustomerSessionClientSecret}var e=this.getBaseCurrencySettlementInfo();var t=zonosStore.appearance,s=t.logoUrl,c=t.theme;var n=collectStore.originCompanyName;var l=function(){var o;var e=collectStore.collectLogoUrl?collectStore.collectLogoUrl:((o=zonosStore.genericSettings)===null||o===void 0?void 0:o.shouldFallbackToOrganizationLogoForCollect)&&s?"".concat(s,"?timestamp=").concat(Date.now()):"";if(!e){return null}return h("div",{class:"zonos--logo"},h("img",{alt:"".concat(n||zonosStore.organizationName," logo"),src:e}))};var r=getIsTestMode();var i=function(){var e;var t=new URLSearchParams(window.location.search);var s=t.get("zonosQaUrl");var c=t.get("zonosDebug");var i=(e=languages.find((function(o){return o.code===localizationStore.selectedLocale})))===null||e===void 0?void 0:e.label;return h(Fragment,null,h("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},h("div",{class:"zonos--logo-wrapper"},l(),r&&h("zonos-badge",{badgeColor:"orange",size:"small"},translate("Test mode")),c==="1"&&h("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),s&&h("zonos-badge",{badgeColor:"purple",size:"small"},s)),h("div",{class:"zonos--header-right"},h("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:function(){return o.toggleLanguageDialog()},variant:"outline"},i,h("zonos-icon",{"aria-label":"Language select",content:ChevronDownIcon,iconColor:"gray-1200"})),h("div",{class:classes(["zonos--collect-language-dialog",o.showLanguageDialogMobile&&"zonos--collect-language-dialog-open"])},h("zonos-language-select",{handleOnClose:function(){return o.toggleLanguageDialog()}})))),renderFallback({content:h("zonos-text",{class:"zonos--header-title",type:"header"},n?translate("Customs charges for your recent purchase from [companyName] are available for payment",{companyName:n}):translate("Customs charges from your recent purchase are available for payment")),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"34px",skeletonWidth:"600px"}))};var a=function(){if(o.isOverlayLoading||stripeStore.isFetchingSession){return null}return h("div",{class:"zonos--content"},cartStore.step!=="finish"&&cartStore.step!=="error"&&h(Fragment,null,(o.isMobile||o.isTablet)&&i(),h("div",{class:"zonos--left","data-theme":c},!o.isMobile&&!o.isTablet&&i(),collectStore.paymentProcessor!=="AIRWALLEX"&&h(Fragment,null,h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Billing info")),h("zonos-v-stack",{spacing:16},h("zonos-link-authentication",{titleText:""}),h("zonos-address",{titleText:"",type:"billing"}))),h("zonos-collect-payment",{class:classes(["zonos--collect-container"]),continueLoading:o.submitLoading,onAirwallexPaymentDone:function(){var e;cartStore.step="finish";o.confirmationId=collectStore.landedCostShortId||((e=cartStore.selectedLandedCost)===null||e===void 0?void 0:e.landedCostId)||null},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]}}))}))}})),h("div",{class:"zonos--right","data-theme":c},h("zonos-collect-review",{mobile:o.isMobile,tablet:o.isTablet}),h("div",{class:"zonos--order-details-container"},h("zonos-collect-order-details",{collapsed:o.collapseReview,mobile:o.isMobile,onCollapseClicked:function(){o.collapseReview=!o.collapseReview}})),h("div",{class:"flex--wrapper"},h("zonos-v-stack",{spacing:16},h("zonos-collect-subtotal",null)),!o.isMobile&&!o.isTablet&&h("zonos-collect-footer",{"data-theme":c,mobile:o.isMobile,tablet:o.isTablet})))),(cartStore.step==="finish"||cartStore.step==="error")&&h("div",{class:"zonos--done","data-theme":c},h("div",{class:"zonos--header"},l()),h("zonos-collect-finish",{confirmationId:o.confirmationId,overrideNotification:cartStore.step==="error"&&!!cartStore.error?Object.assign(Object.assign({},cartStore.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})),(o.isMobile||o.isTablet||cartStore.step==="finish"||cartStore.step==="error")&&h("zonos-collect-footer",{"data-theme":c,mobile:o.isMobile,tablet:o.isTablet}))};return h(Host,{class:classes(["zonos--collect zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":c},a(),e&&h("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:translate("Cancel"),dialogConfirmBtnText:translate("Pay [orderTotal]",{orderTotal:currencyFormat({amount:e.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:translate("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:translate("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){o.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return o.handleStripePaymentContinue()}}),h("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCollect.style=ZonosCollectStyle0;export{ZonosCollect as zonos_collect};
1
+ var __awaiter=this&&this.__awaiter||function(o,e,t,s){function c(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,n){function l(o){try{i(s.next(o))}catch(o){n(o)}}function r(o){try{i(s["throw"](o))}catch(o){n(o)}}function i(o){o.done?t(o.value):c(o.value).then(l,r)}i((s=s.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},s,c,n,l;return l={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function r(o){return function(e){return i([o,e])}}function i(r){if(s)throw new TypeError("Generator is already executing.");while(l&&(l=0,r[0]&&(t=0)),t)try{if(s=1,c&&(n=r[0]&2?c["return"]:r[0]?c["throw"]||((n=c["return"])&&n.call(c),0):c.next)&&!(n=n.call(c,r[1])).done)return n;if(c=0,n)r=[r[0]&2,n.value];switch(r[0]){case 0:case 1:n=r;break;case 4:t.label++;return{value:r[1],done:false};case 5:t.label++;c=r[1];r=[0];continue;case 7:r=t.ops.pop();t.trys.pop();continue;default:if(!(n=t.trys,n=n.length>0&&n[n.length-1])&&(r[0]===6||r[0]===2)){t=0;continue}if(r[0]===3&&(!n||r[1]>n[0]&&r[1]<n[3])){t.label=r[1];break}if(r[0]===6&&t.label<n[1]){t.label=n[1];n=r;break}if(n&&t.label<n[2]){t.label=n[2];t.ops.push(r);break}if(n[2])t.ops.pop();t.trys.pop();continue}r=e.call(o,t)}catch(o){r=[6,o];c=0}finally{s=n=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};import{r as registerInstance,h,a as Host,F as Fragment}from"./index-cfd394c8.js";import{c as collectStore,a as airwallexStoreSetFromSession,b as airwallexStore,d as airwallexStoreRetrievePaymentIntent,e as airwallexStoreIsPaidStatus,f as airwallexStoreInitSdk,g as collectStoreUpdateSelectedShippingOption,h as collectStoreInitShippingInfo,i as collectStoreAsyncAddressUpdate}from"./collect-b88fe4ca.js";import{b as stripeStore,i as initStripeElements,d as cartStore,c as stripeStoreRetrievePayment,n as cartStoreUpdateToErrorState,e as cartStoreUpdateItems,j as stripeStoreInitCheckoutSession,k as stripeStoreGetPaymentIntent,w as stripeStoreUpdateCheckoutSessionBaseCurrency,C as stripeStoreConfirmPayment,H as stripeStoreOnChange,F as stripeStoreReset,f as cartStoreReset}from"./cart-402dcde5.js";import{p as paypalStoreHasPaypalEnabled,a as paypalStore}from"./paypal-2d4c9d01.js";import{s as storageStore,t as translate,e as localizationStoreOnChange,h as currencyFormat,l as localizationStore}from"./localization-d49867ed.js";import{z as zonosStore}from"./zonosStore-b7d3f9b0.js";import{b as buildCartItemsByTempCart}from"./buildCartItemsByTempCart-a117f75d.js";import{h as handleFetch,s as sendErrorLog,l as logError,g as getIsTestMode}from"./handleFetch-a844cac1.js";import{i as isCollectMobile,a as isCollectTablet}from"./isCollectMobileTablet-111b0dd7.js";import{c as classes}from"./classes-0d95c529.js";import{l as log}from"./VarianceTest-572cecf5.js";import{r as renderFallback}from"./renderFallback-b250f4e9.js";import{l as languages}from"./ILanguage-cd6acb72.js";import"./isDarkColor-039ef212.js";import"./getBorderRadius-dc982fe6.js";import"./TaxId-50d72254.js";import"./isContrastColor-089de6ac.js";import"./submitGtag-dc54f5b9.js";var ChevronDownIcon='<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 zonosCollectCss=".sc-zonos-collect-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-h *.sc-zonos-collect{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-h img.sc-zonos-collect{max-width:100%}.sc-zonos-collect-h dl.sc-zonos-collect,.sc-zonos-collect-h dd.sc-zonos-collect,.sc-zonos-collect-h h1.sc-zonos-collect,.sc-zonos-collect-h h2.sc-zonos-collect,.sc-zonos-collect-h h3.sc-zonos-collect,.sc-zonos-collect-h h4.sc-zonos-collect,.sc-zonos-collect-h h5.sc-zonos-collect,.sc-zonos-collect-h h6.sc-zonos-collect,.sc-zonos-collect-h hr.sc-zonos-collect,.sc-zonos-collect-h figure.sc-zonos-collect,.sc-zonos-collect-h p.sc-zonos-collect,.sc-zonos-collect-h pre.sc-zonos-collect{margin:0}.sc-zonos-collect-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-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-collect-h *.sc-zonos-collect{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar{width:10px}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{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-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{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-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--header.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--logo.sc-zonos-collect{margin-bottom:0}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect zonos-checkout-finish.sc-zonos-collect{-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{padding:0 8px 8px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--payment-error-banner.sc-zonos-collect{margin-top:24px}.sc-zonos-collect-h .zonos--right.sc-zonos-collect{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-collect-h .zonos--right.sc-zonos-collect .zonos--order-details-container.sc-zonos-collect{overflow:hidden}.sc-zonos-collect-h .zonos--wrapper.sc-zonos-collect{overflow:auto;max-height:100%;position:relative}.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;margin-top:32px}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect>*.sc-zonos-collect{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-collect-h .zonos--header-right.sc-zonos-collect{display:none}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect img.sc-zonos-collect{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-collect-h .zonos--collect-container.sc-zonos-collect{overflow:visible}.mobile.sc-zonos-collect-h,.tablet.sc-zonos-collect-h{min-width:auto}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{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-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding-bottom:0}}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{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-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect{margin-bottom:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect{margin-top:8px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{max-height:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:auto}.mobile.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect{margin:0}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px;padding:0 16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{overflow:visible;width:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{gap:32px}.mobile.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{margin-top:0}.mobile.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:56px;top:-56px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--header-right.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:28px;top:-28px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect{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-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar{width:10px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.zonos--collect-language-dialog-open.sc-zonos-collect{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-collect-h .zonos--content.sc-zonos-collect{-ms-scroll-chaining:chained;overscroll-behavior:auto}";var ZonosCollectStyle0=zonosCollectCss;var ZonosCollect=function(){function o(o){var e=this;registerInstance(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.collapseReview=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=stripeStore.clientSecret;this.stripeCustomerSessionClientSecret=stripeStore.stripeCustomerSessionClientSecret;this.getBaseCurrencySettlementInfo=function(){var o=cartStore.selectedLandedCost;if(!o){return null}var e=o.landedCost.amountSubtotals;if(!e){return null}var t=(e.discounts||0)+e.items+e.landedCostTotal+e.shipping;return{settlementAmount:t}};this.applyStripeTheme=function(){return __awaiter(e,void 0,void 0,(function(){var o;return __generator(this,(function(e){switch(e.label){case 0:o=zonosStore.appearance.theme;return[4,initStripeElements({overrideTheme:this.isMobile?o:undefined,paypalEnabled:paypalStoreHasPaypalEnabled()})];case 1:e.sent();return[2]}}))}))};this.fetchCheckoutSession=function(o){return __awaiter(e,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,handleFetch("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"})];case 1:e=t.sent().json;return[2,e]}}))}))};this.initPaymentProcessor=function(){return __awaiter(e,void 0,void 0,(function(){var o,e,t,s,c,n;return __generator(this,(function(l){switch(l.label){case 0:e=storageStore.checkoutSessionId;if(!e)return[3,4];return[4,this.fetchCheckoutSession(e)];case 1:t=l.sent();collectStore.paymentProcessor=(t===null||t===void 0?void 0:t.checkoutSession.paymentProcessor)||null;if(!(collectStore.paymentProcessor==="AIRWALLEX"))return[3,4];if(!t||!airwallexStoreSetFromSession(t.checkoutSession)){throw new Error("Airwallex checkout session is missing a client secret")}s=t.checkoutSession;airwallexStore.currency=cartStore.currency;this.confirmationId=((o=s.landedCost)===null||o===void 0?void 0:o.shortId)||null;c=!!s.completedAt||!!s.order;if(!(!c&&s.clientSecret&&s.paymentIntentId))return[3,3];return[4,airwallexStoreRetrievePaymentIntent(s.paymentIntentId)];case 2:n=l.sent().status;c=airwallexStoreIsPaidStatus(n);l.label=3;case 3:if(c){void this.setToFinishStep();return[2]}void airwallexStoreInitSdk();return[2];case 4:void this.applyStripeTheme();return[2]}}))}))};this.checkStripePaymentIntentStatus=function(){return __awaiter(e,void 0,void 0,(function(){var o,e,t,s,c,n,l,r,i,a;return __generator(this,(function(d){switch(d.label){case 0:e=!!window.Zonos.cartData;t=new URL(window.location.href).searchParams;s=t.get("payment_intent_client_secret");c=t.get("zonosCheckoutSessionId");log("Payment intent exist, checking stripe payment intent status");if(!s){log("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:e}]}return[4,stripeStoreRetrievePayment({clientSecret:s})];case 1:n=d.sent(),l=n.error,r=n.status;i=new URLSearchParams(window.location.search).get("redirect_status");if(!(i&&c))return[3,3];if(!l){log("Payment intent is succeeded or in a good state to move forward, show success screen")}else{log("Payment intent failed, show status from error")}return[4,this.fetchCheckoutSession(c)];case 2:a=d.sent();this.confirmationId=((o=a===null||a===void 0?void 0:a.checkoutSession.landedCost)===null||o===void 0?void 0:o.shortId)||null;storageStore.checkoutSessionId=c;stripeStore.clientSecret=s;void this.setToFinishStep(r);return[2,{shouldAllowOrder:false}];case 3:if(!e){log("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}log("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))};this.recoverCompletedCollectSession=function(o){return __awaiter(e,void 0,void 0,(function(){var e,t,s,c,n,n;return __generator(this,(function(l){switch(l.label){case 0:return[4,this.fetchCheckoutSession(o)];case 1:t=l.sent();if(!t){return[2,false]}s=t.checkoutSession;this.confirmationId=((e=s.landedCost)===null||e===void 0?void 0:e.shortId)||null;collectStore.paymentProcessor=s.paymentProcessor||null;c=s.paymentProcessor==="AIRWALLEX";if(c&&s.clientSecret){airwallexStoreSetFromSession(s);airwallexStore.currency=cartStore.currency}if(s.completedAt||s.order){void this.setToFinishStep("succeeded");return[2,true]}if(!c)return[3,4];if(!(s.clientSecret&&s.paymentIntentId))return[3,3];return[4,airwallexStoreRetrievePaymentIntent(s.paymentIntentId)];case 2:n=l.sent().status;if(airwallexStoreIsPaidStatus(n)){void this.setToFinishStep();return[2,true]}l.label=3;case 3:return[3,6];case 4:if(!s.clientSecret)return[3,6];return[4,stripeStoreRetrievePayment({clientSecret:s.clientSecret})];case 5:n=l.sent().status;if(n==="processing"||n==="succeeded"){stripeStore.clientSecret=s.clientSecret;void this.setToFinishStep(n);return[2,true]}l.label=6;case 6:return[2,false]}}))}))}}o.prototype.resizeListener=function(){this.isMobile=isCollectMobile(this.mobile);this.isTablet=isCollectTablet(this.tablet)};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){stripeStore.stripe=window.Zonos.stripe;cartStore.step="finish";this.storybookPaymentStatusOverride=o;this.isOverlayLoading=false;return[2]}))}))};o.prototype.initCollectCart=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,s,c,n,l,r,i,a,d,z,h,u,f,m,p,g,b,v,S,w;return __generator(this,(function(x){switch(x.label){case 0:if(!window.Zonos.cartData){return[2]}z=(e=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.items[0])===null||e===void 0?void 0:e.currencyCode;if(z){cartStore.currency=z}h=(s=(t=window.Zonos.cartData)===null||t===void 0?void 0:t.references)===null||s===void 0?void 0:s.checkoutSessionId;u=(n=(c=window.Zonos.cartData)===null||c===void 0?void 0:c.references)===null||n===void 0?void 0:n.landedCostId;if(!u){cartStoreUpdateToErrorState({messages:[translate("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:zonosStore.organizationName})],title:translate("Invalid session")});return[2]}if(h){log("Setting checkout session id from cart reference","info",h);storageStore.checkoutSessionId=h}else{log("Clear checkout session id from storage so we start from a fresh session for the collect cart");storageStore.checkoutSessionId=null}return[4,this.checkStripePaymentIntentStatus()];case 1:f=x.sent().shouldAllowOrder;if(!f){return[2]}x.label=2;case 2:x.trys.push([2,13,,14]);m=buildCartItemsByTempCart(window.Zonos.cartData),p=m.adjustments,g=m.cartItems;return[4,cartStoreUpdateItems({adjustments:p,cartItems:g,landedCostId:u,shouldInitSessionOnFailure:false})];case 3:x.sent();if(!(!storageStore.checkoutSessionId&&!h))return[3,5];return[4,stripeStoreInitCheckoutSession()];case 4:b=x.sent();log("stripeStoreInitCheckoutSession: ".concat(b));if(!b){throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Collect quote but being used with sandbox credential")}x.label=5;case 5:if(!((!cartStore.checkoutSession||((l=cartStore.checkoutSession)===null||l===void 0?void 0:l.completedAt))&&h))return[3,7];return[4,this.recoverCompletedCollectSession(h)];case 6:v=x.sent();if(v){return[2]}void sendErrorLog({endpoint:"INVALID_COLLECT_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:h,cartId:(r=window.Zonos.cartData)===null||r===void 0?void 0:r.id,cartLandedCostId:u}});throw new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it");case 7:if(!cartStore.checkoutSession){void sendErrorLog({endpoint:"FAIL_TO_UPDATE_CREATE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this collect cart"],metadata:{cartCheckoutSessionId:h||"N/A",cartId:(i=window.Zonos.cartData)===null||i===void 0?void 0:i.id,cartLandedCostId:u||"N/A"}});throw new Error("Could not update/create checkout session for this collect cart")}collectStore.paymentProcessor=cartStore.checkoutSession.paymentProcessor;if(!(collectStore.paymentProcessor==="AIRWALLEX"))return[3,9];return[4,stripeStoreGetPaymentIntent()];case 8:x.sent();if((a=cartStore.checkoutSession)===null||a===void 0?void 0:a.clientSecret){airwallexStore.clientSecret=cartStore.checkoutSession.clientSecret;airwallexStore.currency=cartStore.currency}return[3,10];case 9:void stripeStoreGetPaymentIntent();x.label=10;case 10:S=(d=cartStore.checkoutSession)===null||d===void 0?void 0:d.landedCost;if(!S){throw new Error("Landed cost could not be found in checkout session after creating/updating them")}return[4,collectStoreUpdateSelectedShippingOption(Object.assign(Object.assign({},cartStore.checkoutSession),{id:storageStore.checkoutSessionId||""}))];case 11:x.sent();void collectStoreInitShippingInfo({landedCostId:S.id});return[4,this.initPaymentProcessor()];case 12:x.sent();return[3,14];case 13:w=x.sent();logError(w);cartStoreUpdateToErrorState({messages:[translate("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:zonosStore.organizationName})],title:translate("Invalid session")});return[3,14];case 14: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,e,t,s,c,n,l,r,i;return __generator(this,(function(a){switch(a.label){case 0:void((o=stripeStore.stripeBillingAddressElement)===null||o===void 0?void 0:o.getValue());if(!((e=stripeStore.stripeLinkEventData)===null||e===void 0?void 0:e.complete)){c=document.querySelector("zonos-link-authentication");c===null||c===void 0?void 0:c.scrollIntoView({behavior:"smooth"});return[2]}if(!((t=stripeStore.stripeBillingAddressEventData)===null||t===void 0?void 0:t.complete)){n=document.querySelector(".zonos--billing-address");n===null||n===void 0?void 0:n.scrollIntoView({behavior:"smooth"});return[2]}l=stripeStore.checkoutSettlementCurrency==="USD";if(l&&stripeStore.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;paypalStore.paypalErrorMessage=null;stripeStore.hasPaymentError=false;this.submitLoading=true;cartStore.inventoryCheckErrorMessage=null;return[4,stripeStoreUpdateCheckoutSessionBaseCurrency()];case 1:r=a.sent();if(!r){stripeStore.hasPaymentError=true;stripeStore.customErrorMessage=translate("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:stripeStore.checkoutSettlementCurrency});this.submitLoading=false;return[2]}return[4,collectStoreAsyncAddressUpdate()];case 2:a.sent();a.label=3;case 3:a.trys.push([3,5,,6]);return[4,stripeStoreConfirmPayment({noLandedCostCheck:true})];case 4:a.sent();cartStore.step="finish";this.confirmationId=collectStore.landedCostShortId||((s=cartStore.selectedLandedCost)===null||s===void 0?void 0:s.landedCostId)||null;return[2];case 5:i=a.sent();logError(i);stripeStore.hasPaymentError=true;return[3,6];case 6:this.submitLoading=false;return[2]}}))}))};o.prototype.componentWillLoad=function(){var o=this;stripeStore.stripe=window.Zonos.stripe;cartStore.step="payment";void this.initCollectCart();this.resizeListener();this.storeUnsubscribeList=[stripeStoreOnChange("clientSecret",(function(){void o.applyStripeTheme()})),localizationStoreOnChange("selectedLocale",(function(){void o.applyStripeTheme()}))];log("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){stripeStoreReset();cartStoreReset();this.onChangeLocaleListener();this.storeUnsubscribeList.forEach((function(o){return o()}))};o.prototype.render=function(){var o=this;this.clientSecret=stripeStore.clientSecret;if(stripeStore.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=stripeStore.stripeCustomerSessionClientSecret}var e=this.getBaseCurrencySettlementInfo();var t=zonosStore.appearance,s=t.logoUrl,c=t.theme;var n=collectStore.originCompanyName;var l=function(){var o;var e=collectStore.collectLogoUrl?collectStore.collectLogoUrl:((o=zonosStore.genericSettings)===null||o===void 0?void 0:o.shouldFallbackToOrganizationLogoForCollect)&&s?"".concat(s,"?timestamp=").concat(Date.now()):"";if(!e){return null}return h("div",{class:"zonos--logo"},h("img",{alt:"".concat(n||zonosStore.organizationName," logo"),src:e}))};var r=getIsTestMode();var i=function(){var e;var t=new URLSearchParams(window.location.search);var s=t.get("zonosQaUrl");var c=t.get("zonosDebug");var i=(e=languages.find((function(o){return o.code===localizationStore.selectedLocale})))===null||e===void 0?void 0:e.label;return h(Fragment,null,h("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},h("div",{class:"zonos--logo-wrapper"},l(),r&&h("zonos-badge",{badgeColor:"orange",size:"small"},translate("Test mode")),c==="1"&&h("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),s&&h("zonos-badge",{badgeColor:"purple",size:"small"},s)),h("div",{class:"zonos--header-right"},h("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:function(){return o.toggleLanguageDialog()},variant:"outline"},i,h("zonos-icon",{"aria-label":"Language select",content:ChevronDownIcon,iconColor:"gray-1200"})),h("div",{class:classes(["zonos--collect-language-dialog",o.showLanguageDialogMobile&&"zonos--collect-language-dialog-open"])},h("zonos-language-select",{handleOnClose:function(){return o.toggleLanguageDialog()}})))),renderFallback({content:h("zonos-text",{class:"zonos--header-title",type:"header"},n?translate("Customs charges for your recent purchase from [companyName] are available for payment",{companyName:n}):translate("Customs charges from your recent purchase are available for payment")),isLoading:collectStore.isFetchingShippingInfo,skeletonHeight:"34px",skeletonWidth:"600px"}))};var a=function(){if(o.isOverlayLoading||stripeStore.isFetchingSession){return null}return h("div",{class:"zonos--content"},cartStore.step!=="finish"&&cartStore.step!=="error"&&h(Fragment,null,(o.isMobile||o.isTablet)&&i(),h("div",{class:"zonos--left","data-theme":c},!o.isMobile&&!o.isTablet&&i(),collectStore.paymentProcessor!=="AIRWALLEX"&&h(Fragment,null,h("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},translate("Billing info")),h("zonos-v-stack",{spacing:16},h("zonos-link-authentication",{titleText:""}),h("zonos-address",{titleText:"",type:"billing"}))),h("zonos-collect-payment",{class:classes(["zonos--collect-container"]),continueLoading:o.submitLoading,onAirwallexPaymentDone:function(){var e;cartStore.step="finish";o.confirmationId=collectStore.landedCostShortId||((e=cartStore.selectedLandedCost)===null||e===void 0?void 0:e.landedCostId)||null},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]}}))}))}})),h("div",{class:"zonos--right","data-theme":c},h("zonos-collect-review",{mobile:o.isMobile,tablet:o.isTablet}),h("div",{class:"zonos--order-details-container"},h("zonos-collect-order-details",{collapsed:o.collapseReview,mobile:o.isMobile,onCollapseClicked:function(){o.collapseReview=!o.collapseReview}})),h("div",{class:"flex--wrapper"},h("zonos-v-stack",{spacing:16},h("zonos-collect-subtotal",null)),!o.isMobile&&!o.isTablet&&h("zonos-collect-footer",{"data-theme":c,mobile:o.isMobile,tablet:o.isTablet})))),(cartStore.step==="finish"||cartStore.step==="error")&&h("div",{class:"zonos--done","data-theme":c},h("div",{class:"zonos--header"},l()),h("zonos-collect-finish",{confirmationId:o.confirmationId,overrideNotification:cartStore.step==="error"&&!!cartStore.error?Object.assign(Object.assign({},cartStore.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})),(o.isMobile||o.isTablet||cartStore.step==="finish"||cartStore.step==="error")&&h("zonos-collect-footer",{"data-theme":c,mobile:o.isMobile,tablet:o.isTablet}))};return h(Host,{class:classes(["zonos--collect zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":c},a(),e&&h("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:translate("Cancel"),dialogConfirmBtnText:translate("Pay [orderTotal]",{orderTotal:currencyFormat({amount:e.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:translate("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:translate("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){o.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return o.handleStripePaymentContinue()}}),h("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}();ZonosCollect.style=ZonosCollectStyle0;export{ZonosCollect as zonos_collect};
@@ -1 +1 @@
1
- var __extends=this&&this.__extends||function(){var t=function(e,o){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o))t[o]=e[o]};return t(e,o)};return function(e,o){if(typeof o!=="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(e,o);function n(){this.constructor=e}e.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(t,e,o,n){function i(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,r){function s(t){try{a(n.next(t))}catch(t){r(t)}}function c(t){try{a(n["throw"](t))}catch(t){r(t)}}function a(t){t.done?o(t.value):i(t.value).then(s,c)}a((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(t){return function(e){return a([t,e])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,c[0]&&(o=0)),o)try{if(n=1,i&&(r=c[0]&2?i["return"]:c[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;if(i=0,r)c=[c[0]&2,r.value];switch(c[0]){case 0:case 1:r=c;break;case 4:o.label++;return{value:c[1],done:false};case 5:o.label++;i=c[1];c=[0];continue;case 7:c=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){o=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){o.label=c[1];break}if(c[0]===6&&o.label<r[1]){o.label=r[1];r=c;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(c);break}if(r[2])o.ops.pop();o.trys.pop();continue}c=e.call(t,o)}catch(t){c=[6,t];i=0}finally{n=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,o){if(o||arguments.length===2)for(var n=0,i=e.length,r;n<i;n++){if(r||!(n in e)){if(!r)r=Array.prototype.slice.call(e,0,n);r[n]=e[n]}}return t.concat(r||Array.prototype.slice.call(e))};import{r as registerInstance,d as createEvent,h,a as Host}from"./index-cfd394c8.js";import{b as stripeStore}from"./cart-23e29950.js";import{j as getOverridenZCountry,k as isValidSelector,m as initLocalizationStore,s as storageStore,c as localizationStoreUpdateSelectedCountryCode}from"./localization-17546792.js";import{z as zonosStore,e as zonosStoreInitSetting,f as zonosStoreFontFamily}from"./zonosStore-8e19daff.js";import{g as getGenericSettingsOverride,i as iframeServices,a as injectPrivateIframe}from"./getGenericSettingsOverride-0bc3e118.js";import{h as handleFetch,l as logError}from"./handleFetch-a844cac1.js";import{l as log}from"./VarianceTest-572cecf5.js";import{a as ensureAnalyticsRelayPing}from"./submitGtag-c7ea1f2a.js";import"./isDarkColor-566f04c5.js";import"./getBorderRadius-d23f47a6.js";var getZonosSettings=function(){return __awaiter(void 0,void 0,void 0,(function(){var t,e,o,n,i,r,s;return __generator(this,(function(c){switch(c.label){case 0:if(window.Zonos.cartSettings){log("Reusing cached zonos settings");return[2,{errors:[],json:window.Zonos.cartSettings,zonosMode:window.Zonos.zonosMode}]}t=getGenericSettingsOverride();e=new URLSearchParams;if(t.overrideShouldEnabledCustomAddress){e.set("overrideShouldEnabledCustomAddress",t.overrideShouldEnabledCustomAddress)}o=getOverridenZCountry();if(o){e.set("zCountry",o)}return[4,handleFetch("/api/zonos-elements/zonos-settings?".concat(e.toString()))];case 1:n=c.sent(),i=n.errors,r=n.json,s=n.zonosMode;if(i.length){logError("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:i,json:null,zonosMode:s}]}return[2,{errors:[],json:r,zonosMode:s}]}}))}))};var injectCheckoutElement$2=function(){var t=document.querySelector("zonos-checkout");if(!t){var e=document.createElement("zonos-checkout");document.body.appendChild(e)}};var initCheckout=function(t){if(!t.placeOrderButtonSelector&&!t.alwaysTriggerInternationalCheckoutSelector&&!window.Zonos.cartData){return}if(t.placeOrderButtonSelector&&!isValidSelector(t.placeOrderButtonSelector)){logError('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}if(t.alwaysTriggerInternationalCheckoutSelector&&!isValidSelector(t.alwaysTriggerInternationalCheckoutSelector)){logError('Selector alwaysTriggerInternationalCheckoutSelector "'.concat(t.alwaysTriggerInternationalCheckoutSelector,'" is not a valid selector'));return}injectCheckoutElement$2()};var injectCheckoutElement$1=function(){var t=document.querySelector("zonos-collect");if(!t){var e=document.createElement("zonos-collect");document.body.appendChild(e)}};var initCollect=function(){if(!window.Zonos.cartData){return}injectCheckoutElement$1()};var injectCheckoutElement=function(){var t=document.querySelector("zonos-invoice");if(!t){var e=document.createElement("zonos-invoice");document.body.appendChild(e)}};var initInvoice=function(){if(!window.Zonos.cartData){return}injectCheckoutElement()};var STYLE_ID="zonos-domestic-element-hide-style";var supportsIsSelector=typeof document!=="undefined"&&function(){try{document.querySelector(":is(.zonos-is-probe)");return true}catch(t){return false}}();var splitTopLevelCommas=function(t){var e=[];var o=0;var n=0;var i="";for(var r=0;r<t.length;r++){var s=t[r];if(s==="("){o++}else if(s===")"){o--}else if(s==="["){n++}else if(s==="]"){n--}if(s===","&&o===0&&n===0){var c=i.trim();if(c){e.push(c)}i=""}else{i+=s}}var a=i.trim();if(a){e.push(a)}return e};var buildDomesticHideSelector=function(t){var e=t.merchantSelector,o=t.supportsIs;if(o){return"body.z-intl :is(".concat(e,")")}return splitTopLevelCommas(e).map((function(t){return"body.z-intl ".concat(t)})).join(", ")};var injectDomesticElementHideStyle=function(t){if(typeof document==="undefined"||!t){return}var e=buildDomesticHideSelector({merchantSelector:t,supportsIs:supportsIsSelector});try{document.querySelector(e)}catch(o){log('Skip domesticElementSelector injection: "'.concat(t,'" produced an invalid CSS selector ("').concat(e,'")'),"warn");return}if(document.getElementById(STYLE_ID)){return}var o=document.createElement("style");o.id=STYLE_ID;o.textContent="".concat(e," { display: none !important; }");(document.head||document.body).appendChild(o);log("Zonos domestic element hide style injected")};var injectHelloComponent=function(t){var e=document.querySelector(t);var o=document.querySelector("zonos-hello");if(!o&&e){var n=document.createElement("zonos-hello");e.appendChild(n);return true}return false};var convertPosition=function(t){switch(t){case"BOTTOM_RIGHT":return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right";default:return"bottom-right"}};var injectDefaultWrapper=function(t){var e=t.position,o=e===void 0?"bottom-right":e;var n=".zonos--hello-mobile-wrapper";var i=document.querySelector(n);if(i){return n}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(o==="top-right"){r.style.top="72px";r.style.right="24px"}if(o==="top-left"){r.style.top="72px";r.style.left="24px"}if(o==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(o==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483647";document.body.appendChild(r);return n};var initHello=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e,o,n,i,r;return __generator(this,(function(s){if(window.Zonos.isLegacyCheckout){log("Hello is disabled when isLegacyCheckout","info");return[2]}e=t.anchorElementSelector;o=e;if(!t.anchorElementSelector&&t.desktopLocation){n=injectDefaultWrapper({position:"bottom-right"});o=n}if(!o||!isValidSelector(o)){logError('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}log("Hello init complete");i=injectHelloComponent(o);if(!i){r=new MutationObserver((function(){var t=injectHelloComponent(o);if(t){r.disconnect()}}));r.observe(document.body,{childList:true,subtree:true});setTimeout((function(){injectHelloComponent(o)}),1e3);setTimeout((function(){if(t.notFoundElementFallback){log("Hello anchor selector ".concat(t.anchorElementSelector," not found after 3 seconds, falling back to 'notFoundElementFallback': ").concat(t.notFoundElementFallback),"info");var e=injectDefaultWrapper({position:convertPosition(t.notFoundElementFallback)});injectHelloComponent(e)}}),3e3)}return[2]}))}))};var IframeCommunicator=function(){function t(t,e){var o=this;this.targetId=t;this.allowedEvents=e;this.listeners=new Map;this.handleMessage=function(t){var e,n,i;var r=t.data;var s=((e=o.iframe)===null||e===void 0?void 0:e.contentWindow)||((i=(n=o.iframe)===null||n===void 0?void 0:n.contentDocument)===null||i===void 0?void 0:i.defaultView);if(t.source!==s){return}if(!o.isValidMessage(r)){return}var c=o.listeners.get(r.type);c===null||c===void 0?void 0:c.forEach((function(t){try{t(r.payload)}catch(t){logError("Error in event listener:",t)}}))};this.initializeEventListeners();this.iframe=document.getElementById(this.targetId)}t.prototype.initializeEventListeners=function(){window.addEventListener("message",this.handleMessage)};t.prototype.isValidMessage=function(t){if(!t||typeof t!=="object")return false;var e=t;return e.id===this.targetId&&typeof e.type==="string"&&this.allowedEvents.includes(e.type)&&e.payload!==undefined};t.prototype.on=function(t,e){var o=this;if(!this.listeners.has(t)){this.listeners.set(t,new Set)}log("[CheckoutAddressService] listening to ".concat(t),"info");var n=e;var i=this.listeners.get(t);if(i){i.add(n)}return function(){var e=o.listeners.get(t);if(e){e.delete(n)}}};t.prototype.destroy=function(){window.removeEventListener("message",this.handleMessage);this.listeners.clear()};return t}();var GooglePlacesService=function(t){__extends(e,t);function e(){log("=== [Google Places Service] Initializing","info");return t.call(this,iframeServices.GOOGLE_PLACES,["fetchAutocompleteSuggestions","initializeGooglePlacesService","placeSelected","onFetchAutocompleteSuggestions","onInitializeGooglePlacesService","onPlaceSelected"])||this}e.prototype.sendMessage=function(t,e){var o;if(!((o=this.iframe)===null||o===void 0?void 0:o.contentWindow)){return}var n={id:this.targetId,logType:window.Zonos.iframeLogType,payload:e,type:t};log("GooglePlacesService] parent --\x3e ".concat(t),"info",e);this.iframe.contentWindow.postMessage(n,"*")};e.prototype.initialize=function(){this.sendMessage("initializeGooglePlacesService",{})};e.prototype.fetchSuggestions=function(t){var e=t.country,o=t.query,n=t.type;if(!e){return}this.sendMessage("fetchAutocompleteSuggestions",{request:{includedRegionCodes:[e],input:o},type:n})};e.prototype.selectPlace=function(t){var e=t.placeId,o=t.type;this.sendMessage("placeSelected",{placeId:e,type:o})};return e}(IframeCommunicator);var CheckoutAddressService=function(){function t(){var t=this;this.googlePlaceInitialized=false;log("=== [CheckoutAddressService] Initializing","info");this.googlePlaces=new GooglePlacesService;this.googlePlaces.on("onInitializeGooglePlacesService",(function(){log("=== [CheckoutAddressService] parent <-- onInitializeGooglePlacesService","info");t.googlePlaceInitialized=true}));this.initialize()}t.prototype.initialize=function(){this.googlePlaces.initialize()};t.prototype.onInitializeGooglePlacesService=function(t){return this.googlePlaces.on("onInitializeGooglePlacesService",(function(){log("[CheckoutAddressService] parent <-- onInitializeGooglePlacesService");t()}))};t.prototype.isGooglePlaceInitialized=function(){return this.googlePlaceInitialized};t.prototype.onAddressSuggestions=function(t){this.suggestionsCallback=t;return this.googlePlaces.on("onFetchAutocompleteSuggestions",(function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}log.apply(void 0,__spreadArray(["[CheckoutAddressService] parent <-- onFetchAutocompleteSuggestions ".concat(e[0].type),"info"],e,false));t.apply(void 0,e)}))};t.prototype.onAddressSelected=function(t){this.placeSelectedCallback=t;return this.googlePlaces.on("onPlaceSelected",(function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}log.apply(void 0,__spreadArray(["[CheckoutAddressService] parent <-- onPlaceSelected ".concat(e[0].type),"info"],e,false));t.apply(void 0,e)}))};t.prototype.getAddressSuggestions=function(t){var e=t.country,o=t.query,n=t.type;if(!this.googlePlaceInitialized){return}this.googlePlaces.fetchSuggestions({country:e,query:o,type:n})};t.prototype.selectAddress=function(t){var e=t.placeId,o=t.type;this.googlePlaces.selectPlace({placeId:e,type:o})};t.prototype.destroy=function(){this.googlePlaces.destroy();if(this.suggestionsCallback){this.suggestionsCallback=undefined}if(this.placeSelectedCallback){this.placeSelectedCallback=undefined}};return t}();var zonosControllerCss=":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{visibility:hidden;opacity:0;height:0}";var ZonosControllerStyle0=zonosControllerCss;var ZonosController=function(){function t(t){registerInstance(this,t);this.paypalInitEvent=createEvent(this,"paypalInitEvent",7);this.stripeInitEvent=createEvent(this,"stripeInitEvent",7)}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!t){log("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}stripeStore.stripe=t;void initCheckout(zonosStore.checkoutSettings);log("init checkout element");return[2]}))}))};t.prototype.initCollectElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!t){log("Stripe is not loaded yet - cannot init Collect element","warn");return[2]}stripeStore.stripe=t;void initCollect();log("init Collect element");return[2]}))}))};t.prototype.initInvoiceElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!t){log("Stripe is not loaded yet - cannot init Invoice element","warn");return[2]}stripeStore.stripe=t;void initInvoice();log("init Invoice element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var e=document.createElement("zonos-notification");document.body.appendChild(e)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var e,o,n,i,r,s,c,a;return __generator(this,(function(u){switch(u.label){case 0:n=t||zonosStoreFontFamily();if(n==="Inter"){if(!t){return[2]}log("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");zonosStore.appearance=Object.assign(Object.assign({},zonosStore.appearance),{fontFamily:t})}i=new URLSearchParams;i.set("family",n);return[4,handleFetch("/api/zonos-elements/get-font-detail?".concat(i.toString()))];case 1:r=u.sent(),s=r.errors,c=r.json;if(s.length>0){log("Failed to load font ".concat(n),"warn");zonosStore.appearance=Object.assign(Object.assign({},zonosStore.appearance),{fontFamily:"Inter"});return[2]}a=c===null||c===void 0?void 0:c.fontUrl;if(a){(o=(e=window.Zonos).injectSupportGoogleFont)===null||o===void 0?void 0:o.call(e,a)}if(!t){return[2]}log("[FONT] ".concat(t," font override applied"));zonosStore.appearance=Object.assign(Object.assign({},zonosStore.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.handleLocationChange=function(){void initHello(zonosStore.helloSettings)};t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function e(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var e=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return e.apply(this,arguments)}};t.prototype.injectCustomHTML=function(t){if(!t){return}if(!window.Zonos.isLegacyCheckout||window.Zonos.isCollect||window.Zonos.isInvoice){log("=== Skip injecting custom HTML for hosted checkout","info");return}log("=== Injecting custom HTML for hosted checkout");var e=document.createElement("template");e.innerHTML=t;var o=e.content.querySelectorAll("script");o.forEach((function(t){var e=document.createElement("script");if(t.src){e.src=t.src;e.async=t.async}else{e.textContent=t.innerHTML}document.body.appendChild(e)}));ensureAnalyticsRelayPing()};t.prototype.initGooglePlacesService=function(t){return __awaiter(this,void 0,void 0,(function(){var e,o;return __generator(this,(function(n){e=t===null||t===void 0?void 0:t.genericSettings;if(!e){return[2]}o=e.signedTokenGooglePlaces;if(!o){return[2]}injectPrivateIframe({id:iframeServices.GOOGLE_PLACES,onload:function(){zonosStore.checkoutAddressService=new CheckoutAddressService},src:"".concat("https://route.elements.zonos.com","/iframe/google-maps?signedToken=").concat(o)});return[2]}))}))};t.prototype.buildBaseConfig=function(t){var e,o;var n=Object.assign(Object.assign({},this.config.checkoutSettings),{allowedSettlementCurrencies:undefined,captureDelay:undefined,subscriptionStatus:undefined});if(window.Zonos.isCollect||window.Zonos.isInvoice){return Object.assign(Object.assign({},this.config),{checkoutSettings:n,helloSettings:Object.assign(Object.assign({},this.config.helloSettings),{visibilityStatus:"DISABLED"})})}if(!this.config.checkoutSettings){return Object.assign(Object.assign({},this.config),{checkoutSettings:undefined})}var i=window.Zonos.isLegacyCheckout&&!!window.Zonos.cartData&&((e=this.config.checkoutSettings)===null||e===void 0?void 0:e.successBehavior)==="CLOSE_MODAL";return Object.assign(Object.assign({},this.config),{checkoutSettings:Object.assign(Object.assign({},n),{successBehavior:i?"ZONOS_SUCCESS_PAGE":this.config.checkoutSettings.successBehavior,successRedirectUrl:i?((o=window.Zonos.cartData)===null||o===void 0?void 0:o.storeBaseUrl)||(t===null||t===void 0?void 0:t.onlineStoreSettings.url):this.config.checkoutSettings.successRedirectUrl})})};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.initHistoryListener();zonosStore.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,e,o,n,i,r,s,c,a,u,l,d,f;var h=this;return __generator(this,(function(v){switch(v.label){case 0:return[4,getZonosSettings()];case 1:i=v.sent(),r=i.errors,s=i.json,c=i.zonosMode;if(((e=(t=r[0])===null||t===void 0?void 0:t.type)===null||e===void 0?void 0:e.toString())==="403"){log("Failed to load zonos settings. This domain may not have access","warn");return[2]}a=((o=s===null||s===void 0?void 0:s.checkoutSettings)===null||o===void 0?void 0:o.customHTML)||"";this.injectCustomHTML(a);this.initZonosNotification();u=function(){var t,e,o;if(window.Zonos.isLegacyCheckout){return((t=s===null||s===void 0?void 0:s.appearanceSettings)===null||t===void 0?void 0:t.logoUrl)||((e=h.config.appearance)===null||e===void 0?void 0:e.logoUrl)}return(o=h.config.appearance)===null||o===void 0?void 0:o.logoUrl};l=this.buildBaseConfig(s);d=Object.assign(Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:u()})}),l);zonosStoreInitSetting({overrideSettings:d,zonosSettings:s});zonosStore.zonosMode=c;injectDomesticElementHideStyle(zonosStore.checkoutSettings.domesticElementSelector);void this.setupGoogleFont();if(zonosStore.helloSettings.visibilityStatus==="DISABLED"){log("=== Hello is disabled by store owner ===","warn")}if(zonosStore.helloSettings&&zonosStore.helloSettings.visibilityStatus==="ENABLED"){log("Initializing hello");void initHello(zonosStore.helloSettings)}return[4,initLocalizationStore()];case 2:v.sent();f=((n=s===null||s===void 0?void 0:s.checkoutSettings)===null||n===void 0?void 0:n.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!f||!this.stripeInitEvent){log("Checkout failed to load -- missing publishable key","warn");return[2]}if(window.Zonos.isCollect||window.Zonos.isInvoice){this.stripeInitEvent.emit({publishableKey:f.token});void this.initGooglePlacesService(s);return[2]}if(zonosStore.checkoutSettings.subscriptionStatus==="INACTIVE"){log('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");log("zonos controller loaded");return[2]}if(zonosStore.checkoutSettings.visibilityStatus==="DISABLED"){log("=== Checkout is disabled by store owner ===","warn");log("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:f.token});void this.initGooglePlacesService(s);return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(o){e=document.querySelector("zonos-notification");if(!e){log("Failed to show notification - zonos-notification not found","warn");return[2]}void e.showNotification(t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){storageStore.checkoutSessionId=null;stripeStore.clientSecret="";return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){zonosStoreInitSetting({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){log("Override country code to ".concat(t));void localizationStoreUpdateSelectedCountryCode({isInitializing:false,newSelectedCountryCode:t});return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,zonosStore.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){zonosStore.organizationName=t;return[2]}))}))};t.prototype.render=function(){return h(Host,{key:"172f5c893940145cc2eb84c721783bc64332d3dc",class:"zonos--elements"})};return t}();ZonosController.style=ZonosControllerStyle0;export{ZonosController as zonos_controller};
1
+ var __extends=this&&this.__extends||function(){var t=function(e,o){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o))t[o]=e[o]};return t(e,o)};return function(e,o){if(typeof o!=="function"&&o!==null)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");t(e,o);function n(){this.constructor=e}e.prototype=o===null?Object.create(o):(n.prototype=o.prototype,new n)}}();var __awaiter=this&&this.__awaiter||function(t,e,o,n){function i(t){return t instanceof o?t:new o((function(e){e(t)}))}return new(o||(o=Promise))((function(o,r){function s(t){try{a(n.next(t))}catch(t){r(t)}}function c(t){try{a(n["throw"](t))}catch(t){r(t)}}function a(t){t.done?o(t.value):i(t.value).then(s,c)}a((n=n.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var o={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(t){return function(e){return a([t,e])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,c[0]&&(o=0)),o)try{if(n=1,i&&(r=c[0]&2?i["return"]:c[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,c[1])).done)return r;if(i=0,r)c=[c[0]&2,r.value];switch(c[0]){case 0:case 1:r=c;break;case 4:o.label++;return{value:c[1],done:false};case 5:o.label++;i=c[1];c=[0];continue;case 7:c=o.ops.pop();o.trys.pop();continue;default:if(!(r=o.trys,r=r.length>0&&r[r.length-1])&&(c[0]===6||c[0]===2)){o=0;continue}if(c[0]===3&&(!r||c[1]>r[0]&&c[1]<r[3])){o.label=c[1];break}if(c[0]===6&&o.label<r[1]){o.label=r[1];r=c;break}if(r&&o.label<r[2]){o.label=r[2];o.ops.push(c);break}if(r[2])o.ops.pop();o.trys.pop();continue}c=e.call(t,o)}catch(t){c=[6,t];i=0}finally{n=r=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,e,o){if(o||arguments.length===2)for(var n=0,i=e.length,r;n<i;n++){if(r||!(n in e)){if(!r)r=Array.prototype.slice.call(e,0,n);r[n]=e[n]}}return t.concat(r||Array.prototype.slice.call(e))};import{r as registerInstance,d as createEvent,h,a as Host}from"./index-cfd394c8.js";import{b as stripeStore}from"./cart-402dcde5.js";import{j as getOverridenZCountry,k as isValidSelector,m as initLocalizationStore,s as storageStore,c as localizationStoreUpdateSelectedCountryCode}from"./localization-d49867ed.js";import{z as zonosStore,e as zonosStoreInitSetting,f as zonosStoreFontFamily}from"./zonosStore-b7d3f9b0.js";import{g as getGenericSettingsOverride,i as iframeServices,a as injectPrivateIframe}from"./getGenericSettingsOverride-0bc3e118.js";import{h as handleFetch,l as logError}from"./handleFetch-a844cac1.js";import{l as log}from"./VarianceTest-572cecf5.js";import{a as ensureAnalyticsRelayPing}from"./submitGtag-dc54f5b9.js";import"./isDarkColor-039ef212.js";import"./getBorderRadius-dc982fe6.js";import"./TaxId-50d72254.js";var getZonosSettings=function(){return __awaiter(void 0,void 0,void 0,(function(){var t,e,o,n,i,r,s;return __generator(this,(function(c){switch(c.label){case 0:if(window.Zonos.cartSettings){log("Reusing cached zonos settings");return[2,{errors:[],json:window.Zonos.cartSettings,zonosMode:window.Zonos.zonosMode}]}t=getGenericSettingsOverride();e=new URLSearchParams;if(t.overrideShouldEnabledCustomAddress){e.set("overrideShouldEnabledCustomAddress",t.overrideShouldEnabledCustomAddress)}o=getOverridenZCountry();if(o){e.set("zCountry",o)}return[4,handleFetch("/api/zonos-elements/zonos-settings?".concat(e.toString()))];case 1:n=c.sent(),i=n.errors,r=n.json,s=n.zonosMode;if(i.length){logError("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:i,json:null,zonosMode:s}]}return[2,{errors:[],json:r,zonosMode:s}]}}))}))};var injectCheckoutElement$2=function(){var t=document.querySelector("zonos-checkout");if(!t){var e=document.createElement("zonos-checkout");document.body.appendChild(e)}};var initCheckout=function(t){if(!t.placeOrderButtonSelector&&!t.alwaysTriggerInternationalCheckoutSelector&&!window.Zonos.cartData){return}if(t.placeOrderButtonSelector&&!isValidSelector(t.placeOrderButtonSelector)){logError('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}if(t.alwaysTriggerInternationalCheckoutSelector&&!isValidSelector(t.alwaysTriggerInternationalCheckoutSelector)){logError('Selector alwaysTriggerInternationalCheckoutSelector "'.concat(t.alwaysTriggerInternationalCheckoutSelector,'" is not a valid selector'));return}injectCheckoutElement$2()};var injectCheckoutElement$1=function(){var t=document.querySelector("zonos-collect");if(!t){var e=document.createElement("zonos-collect");document.body.appendChild(e)}};var initCollect=function(){if(!window.Zonos.cartData){return}injectCheckoutElement$1()};var injectCheckoutElement=function(){var t=document.querySelector("zonos-invoice");if(!t){var e=document.createElement("zonos-invoice");document.body.appendChild(e)}};var initInvoice=function(){if(!window.Zonos.cartData){return}injectCheckoutElement()};var STYLE_ID="zonos-domestic-element-hide-style";var supportsIsSelector=typeof document!=="undefined"&&function(){try{document.querySelector(":is(.zonos-is-probe)");return true}catch(t){return false}}();var splitTopLevelCommas=function(t){var e=[];var o=0;var n=0;var i="";for(var r=0;r<t.length;r++){var s=t[r];if(s==="("){o++}else if(s===")"){o--}else if(s==="["){n++}else if(s==="]"){n--}if(s===","&&o===0&&n===0){var c=i.trim();if(c){e.push(c)}i=""}else{i+=s}}var a=i.trim();if(a){e.push(a)}return e};var buildDomesticHideSelector=function(t){var e=t.merchantSelector,o=t.supportsIs;if(o){return"body.z-intl :is(".concat(e,")")}return splitTopLevelCommas(e).map((function(t){return"body.z-intl ".concat(t)})).join(", ")};var injectDomesticElementHideStyle=function(t){if(typeof document==="undefined"||!t){return}var e=buildDomesticHideSelector({merchantSelector:t,supportsIs:supportsIsSelector});try{document.querySelector(e)}catch(o){log('Skip domesticElementSelector injection: "'.concat(t,'" produced an invalid CSS selector ("').concat(e,'")'),"warn");return}if(document.getElementById(STYLE_ID)){return}var o=document.createElement("style");o.id=STYLE_ID;o.textContent="".concat(e," { display: none !important; }");(document.head||document.body).appendChild(o);log("Zonos domestic element hide style injected")};var injectHelloComponent=function(t){var e=document.querySelector(t);var o=document.querySelector("zonos-hello");if(!o&&e){var n=document.createElement("zonos-hello");e.appendChild(n);return true}return false};var convertPosition=function(t){switch(t){case"BOTTOM_RIGHT":return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right";default:return"bottom-right"}};var injectDefaultWrapper=function(t){var e=t.position,o=e===void 0?"bottom-right":e;var n=".zonos--hello-mobile-wrapper";var i=document.querySelector(n);if(i){return n}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(o==="top-right"){r.style.top="72px";r.style.right="24px"}if(o==="top-left"){r.style.top="72px";r.style.left="24px"}if(o==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(o==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483647";document.body.appendChild(r);return n};var initHello=function(t){return __awaiter(void 0,void 0,void 0,(function(){var e,o,n,i,r;return __generator(this,(function(s){if(window.Zonos.isLegacyCheckout){log("Hello is disabled when isLegacyCheckout","info");return[2]}e=t.anchorElementSelector;o=e;if(!t.anchorElementSelector&&t.desktopLocation){n=injectDefaultWrapper({position:"bottom-right"});o=n}if(!o||!isValidSelector(o)){logError('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}log("Hello init complete");i=injectHelloComponent(o);if(!i){r=new MutationObserver((function(){var t=injectHelloComponent(o);if(t){r.disconnect()}}));r.observe(document.body,{childList:true,subtree:true});setTimeout((function(){injectHelloComponent(o)}),1e3);setTimeout((function(){if(t.notFoundElementFallback){log("Hello anchor selector ".concat(t.anchorElementSelector," not found after 3 seconds, falling back to 'notFoundElementFallback': ").concat(t.notFoundElementFallback),"info");var e=injectDefaultWrapper({position:convertPosition(t.notFoundElementFallback)});injectHelloComponent(e)}}),3e3)}return[2]}))}))};var IframeCommunicator=function(){function t(t,e){var o=this;this.targetId=t;this.allowedEvents=e;this.listeners=new Map;this.handleMessage=function(t){var e,n,i;var r=t.data;var s=((e=o.iframe)===null||e===void 0?void 0:e.contentWindow)||((i=(n=o.iframe)===null||n===void 0?void 0:n.contentDocument)===null||i===void 0?void 0:i.defaultView);if(t.source!==s){return}if(!o.isValidMessage(r)){return}var c=o.listeners.get(r.type);c===null||c===void 0?void 0:c.forEach((function(t){try{t(r.payload)}catch(t){logError("Error in event listener:",t)}}))};this.initializeEventListeners();this.iframe=document.getElementById(this.targetId)}t.prototype.initializeEventListeners=function(){window.addEventListener("message",this.handleMessage)};t.prototype.isValidMessage=function(t){if(!t||typeof t!=="object")return false;var e=t;return e.id===this.targetId&&typeof e.type==="string"&&this.allowedEvents.includes(e.type)&&e.payload!==undefined};t.prototype.on=function(t,e){var o=this;if(!this.listeners.has(t)){this.listeners.set(t,new Set)}log("[CheckoutAddressService] listening to ".concat(t),"info");var n=e;var i=this.listeners.get(t);if(i){i.add(n)}return function(){var e=o.listeners.get(t);if(e){e.delete(n)}}};t.prototype.destroy=function(){window.removeEventListener("message",this.handleMessage);this.listeners.clear()};return t}();var GooglePlacesService=function(t){__extends(e,t);function e(){log("=== [Google Places Service] Initializing","info");return t.call(this,iframeServices.GOOGLE_PLACES,["fetchAutocompleteSuggestions","initializeGooglePlacesService","placeSelected","onFetchAutocompleteSuggestions","onInitializeGooglePlacesService","onPlaceSelected"])||this}e.prototype.sendMessage=function(t,e){var o;if(!((o=this.iframe)===null||o===void 0?void 0:o.contentWindow)){return}var n={id:this.targetId,logType:window.Zonos.iframeLogType,payload:e,type:t};log("GooglePlacesService] parent --\x3e ".concat(t),"info",e);this.iframe.contentWindow.postMessage(n,"*")};e.prototype.initialize=function(){this.sendMessage("initializeGooglePlacesService",{})};e.prototype.fetchSuggestions=function(t){var e=t.country,o=t.query,n=t.type;if(!e){return}this.sendMessage("fetchAutocompleteSuggestions",{request:{includedRegionCodes:[e],input:o},type:n})};e.prototype.selectPlace=function(t){var e=t.placeId,o=t.type;this.sendMessage("placeSelected",{placeId:e,type:o})};return e}(IframeCommunicator);var CheckoutAddressService=function(){function t(){var t=this;this.googlePlaceInitialized=false;log("=== [CheckoutAddressService] Initializing","info");this.googlePlaces=new GooglePlacesService;this.googlePlaces.on("onInitializeGooglePlacesService",(function(){log("=== [CheckoutAddressService] parent <-- onInitializeGooglePlacesService","info");t.googlePlaceInitialized=true}));this.initialize()}t.prototype.initialize=function(){this.googlePlaces.initialize()};t.prototype.onInitializeGooglePlacesService=function(t){return this.googlePlaces.on("onInitializeGooglePlacesService",(function(){log("[CheckoutAddressService] parent <-- onInitializeGooglePlacesService");t()}))};t.prototype.isGooglePlaceInitialized=function(){return this.googlePlaceInitialized};t.prototype.onAddressSuggestions=function(t){this.suggestionsCallback=t;return this.googlePlaces.on("onFetchAutocompleteSuggestions",(function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}log.apply(void 0,__spreadArray(["[CheckoutAddressService] parent <-- onFetchAutocompleteSuggestions ".concat(e[0].type),"info"],e,false));t.apply(void 0,e)}))};t.prototype.onAddressSelected=function(t){this.placeSelectedCallback=t;return this.googlePlaces.on("onPlaceSelected",(function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}log.apply(void 0,__spreadArray(["[CheckoutAddressService] parent <-- onPlaceSelected ".concat(e[0].type),"info"],e,false));t.apply(void 0,e)}))};t.prototype.getAddressSuggestions=function(t){var e=t.country,o=t.query,n=t.type;if(!this.googlePlaceInitialized){return}this.googlePlaces.fetchSuggestions({country:e,query:o,type:n})};t.prototype.selectAddress=function(t){var e=t.placeId,o=t.type;this.googlePlaces.selectPlace({placeId:e,type:o})};t.prototype.destroy=function(){this.googlePlaces.destroy();if(this.suggestionsCallback){this.suggestionsCallback=undefined}if(this.placeSelectedCallback){this.placeSelectedCallback=undefined}};return t}();var zonosControllerCss=":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{visibility:hidden;opacity:0;height:0}";var ZonosControllerStyle0=zonosControllerCss;var ZonosController=function(){function t(t){registerInstance(this,t);this.paypalInitEvent=createEvent(this,"paypalInitEvent",7);this.stripeInitEvent=createEvent(this,"stripeInitEvent",7)}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!t){log("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}stripeStore.stripe=t;void initCheckout(zonosStore.checkoutSettings);log("init checkout element");return[2]}))}))};t.prototype.initCollectElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!t){log("Stripe is not loaded yet - cannot init Collect element","warn");return[2]}stripeStore.stripe=t;void initCollect();log("init Collect element");return[2]}))}))};t.prototype.initInvoiceElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){if(!t){log("Stripe is not loaded yet - cannot init Invoice element","warn");return[2]}stripeStore.stripe=t;void initInvoice();log("init Invoice element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var e=document.createElement("zonos-notification");document.body.appendChild(e)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var e,o,n,i,r,s,c,a;return __generator(this,(function(u){switch(u.label){case 0:n=t||zonosStoreFontFamily();if(n==="Inter"){if(!t){return[2]}log("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");zonosStore.appearance=Object.assign(Object.assign({},zonosStore.appearance),{fontFamily:t})}i=new URLSearchParams;i.set("family",n);return[4,handleFetch("/api/zonos-elements/get-font-detail?".concat(i.toString()))];case 1:r=u.sent(),s=r.errors,c=r.json;if(s.length>0){log("Failed to load font ".concat(n),"warn");zonosStore.appearance=Object.assign(Object.assign({},zonosStore.appearance),{fontFamily:"Inter"});return[2]}a=c===null||c===void 0?void 0:c.fontUrl;if(a){(o=(e=window.Zonos).injectSupportGoogleFont)===null||o===void 0?void 0:o.call(e,a)}if(!t){return[2]}log("[FONT] ".concat(t," font override applied"));zonosStore.appearance=Object.assign(Object.assign({},zonosStore.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.handleLocationChange=function(){void initHello(zonosStore.helloSettings)};t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function e(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var e=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return e.apply(this,arguments)}};t.prototype.injectCustomHTML=function(t){if(!t){return}if(!window.Zonos.isLegacyCheckout||window.Zonos.isCollect||window.Zonos.isInvoice){log("=== Skip injecting custom HTML for hosted checkout","info");return}log("=== Injecting custom HTML for hosted checkout");var e=document.createElement("template");e.innerHTML=t;var o=e.content.querySelectorAll("script");o.forEach((function(t){var e=document.createElement("script");if(t.src){e.src=t.src;e.async=t.async}else{e.textContent=t.innerHTML}document.body.appendChild(e)}));ensureAnalyticsRelayPing()};t.prototype.initGooglePlacesService=function(t){return __awaiter(this,void 0,void 0,(function(){var e,o;return __generator(this,(function(n){e=t===null||t===void 0?void 0:t.genericSettings;if(!e){return[2]}o=e.signedTokenGooglePlaces;if(!o){return[2]}injectPrivateIframe({id:iframeServices.GOOGLE_PLACES,onload:function(){zonosStore.checkoutAddressService=new CheckoutAddressService},src:"".concat("https://route.elements.zonos.com","/iframe/google-maps?signedToken=").concat(o)});return[2]}))}))};t.prototype.buildBaseConfig=function(t){var e,o;var n=Object.assign(Object.assign({},this.config.checkoutSettings),{allowedSettlementCurrencies:undefined,captureDelay:undefined,subscriptionStatus:undefined});if(window.Zonos.isCollect||window.Zonos.isInvoice){return Object.assign(Object.assign({},this.config),{checkoutSettings:n,helloSettings:Object.assign(Object.assign({},this.config.helloSettings),{visibilityStatus:"DISABLED"})})}if(!this.config.checkoutSettings){return Object.assign(Object.assign({},this.config),{checkoutSettings:undefined})}var i=window.Zonos.isLegacyCheckout&&!!window.Zonos.cartData&&((e=this.config.checkoutSettings)===null||e===void 0?void 0:e.successBehavior)==="CLOSE_MODAL";return Object.assign(Object.assign({},this.config),{checkoutSettings:Object.assign(Object.assign({},n),{successBehavior:i?"ZONOS_SUCCESS_PAGE":this.config.checkoutSettings.successBehavior,successRedirectUrl:i?((o=window.Zonos.cartData)===null||o===void 0?void 0:o.storeBaseUrl)||(t===null||t===void 0?void 0:t.onlineStoreSettings.url):this.config.checkoutSettings.successRedirectUrl})})};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(e){this.initHistoryListener();zonosStore.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,e,o,n,i,r,s,c,a,u,l,d,f;var h=this;return __generator(this,(function(v){switch(v.label){case 0:return[4,getZonosSettings()];case 1:i=v.sent(),r=i.errors,s=i.json,c=i.zonosMode;if(((e=(t=r[0])===null||t===void 0?void 0:t.type)===null||e===void 0?void 0:e.toString())==="403"){log("Failed to load zonos settings. This domain may not have access","warn");return[2]}a=((o=s===null||s===void 0?void 0:s.checkoutSettings)===null||o===void 0?void 0:o.customHTML)||"";this.injectCustomHTML(a);this.initZonosNotification();u=function(){var t,e,o;if(window.Zonos.isLegacyCheckout){return((t=s===null||s===void 0?void 0:s.appearanceSettings)===null||t===void 0?void 0:t.logoUrl)||((e=h.config.appearance)===null||e===void 0?void 0:e.logoUrl)}return(o=h.config.appearance)===null||o===void 0?void 0:o.logoUrl};l=this.buildBaseConfig(s);d=Object.assign(Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:u()})}),l);zonosStoreInitSetting({overrideSettings:d,zonosSettings:s});zonosStore.zonosMode=c;injectDomesticElementHideStyle(zonosStore.checkoutSettings.domesticElementSelector);void this.setupGoogleFont();if(zonosStore.helloSettings.visibilityStatus==="DISABLED"){log("=== Hello is disabled by store owner ===","warn")}if(zonosStore.helloSettings&&zonosStore.helloSettings.visibilityStatus==="ENABLED"){log("Initializing hello");void initHello(zonosStore.helloSettings)}return[4,initLocalizationStore()];case 2:v.sent();f=((n=s===null||s===void 0?void 0:s.checkoutSettings)===null||n===void 0?void 0:n.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!f||!this.stripeInitEvent){log("Checkout failed to load -- missing publishable key","warn");return[2]}if(window.Zonos.isCollect||window.Zonos.isInvoice){this.stripeInitEvent.emit({publishableKey:f.token});void this.initGooglePlacesService(s);return[2]}if(zonosStore.checkoutSettings.subscriptionStatus==="INACTIVE"){log('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");log("zonos controller loaded");return[2]}if(zonosStore.checkoutSettings.visibilityStatus==="DISABLED"){log("=== Checkout is disabled by store owner ===","warn");log("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:f.token});void this.initGooglePlacesService(s);return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(o){e=document.querySelector("zonos-notification");if(!e){log("Failed to show notification - zonos-notification not found","warn");return[2]}void e.showNotification(t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){storageStore.checkoutSessionId=null;stripeStore.clientSecret="";return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){zonosStoreInitSetting({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){log("Override country code to ".concat(t));void localizationStoreUpdateSelectedCountryCode({isInitializing:false,newSelectedCountryCode:t});return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,zonosStore.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){zonosStore.organizationName=t;return[2]}))}))};t.prototype.render=function(){return h(Host,{key:"172f5c893940145cc2eb84c721783bc64332d3dc",class:"zonos--elements"})};return t}();ZonosController.style=ZonosControllerStyle0;export{ZonosController as zonos_controller};