@zonos/elements 1.3.267 → 1.3.269

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 (348) hide show
  1. package/dist/cjs/{cart-ed2de167.js → cart-87fbbb5a.js} +129 -4
  2. package/dist/cjs/{debounce-606d1801.js → debounce-7990f5ea.js} +1 -1
  3. package/dist/cjs/{getBorderRadius-a91911e7.js → getBorderRadius-fc683d94.js} +1 -1
  4. package/dist/cjs/{getContrastColor-ce80dbe7.js → getContrastColor-d5134ef3.js} +2 -2
  5. package/dist/cjs/{hasInclusivePrice-bf31fbdb.js → hasInclusivePrice-c86ed1f5.js} +1 -1
  6. package/dist/cjs/index.cjs.js +7 -7
  7. package/dist/cjs/{invoice-542c23e7.js → invoice-952f32c4.js} +3 -3
  8. package/dist/cjs/{isCollectMobileTablet-fe8149a5.js → isCollectMobileTablet-1cb21c59.js} +3 -3
  9. package/dist/cjs/{isContrastColor-a02c4889.js → isContrastColor-76592c92.js} +1 -1
  10. package/dist/cjs/{isDarkColor-e317bb06.js → isDarkColor-5d6ca405.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/{localization-66d378ab.js → localization-a969f224.js} +660 -3
  13. package/dist/cjs/{paypal-d8282578.js → paypal-cfe1e8e9.js} +60 -18
  14. package/dist/cjs/{placeTestOrder-0a4b9dd7.js → placeTestOrder-613878fb.js} +2 -2
  15. package/dist/cjs/{renderCheckoutCurrency-ac9083d9.js → renderCheckoutCurrency-5a333d29.js} +2 -2
  16. package/dist/cjs/{submitGtag-07a3b09e.js → submitGtag-4906b161.js} +1 -1
  17. package/dist/cjs/{throttle-8aebac7d.js → throttle-02c2e917.js} +2 -2
  18. package/dist/cjs/{updateCheckoutSessionAttributes-a9a97194.js → updateCheckoutSessionAttributes-47d73942.js} +1 -1
  19. package/dist/cjs/zonos-address-display_8.cjs.entry.js +7 -7
  20. package/dist/cjs/zonos-address_4.cjs.entry.js +7 -7
  21. package/dist/cjs/zonos-badge.cjs.entry.js +1 -1
  22. package/dist/cjs/zonos-banner.cjs.entry.js +1 -1
  23. package/dist/cjs/zonos-button_3.cjs.entry.js +3 -3
  24. package/dist/cjs/zonos-card_5.cjs.entry.js +8 -8
  25. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +94 -27
  26. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +3 -3
  27. package/dist/cjs/zonos-checkout.cjs.entry.js +124 -154
  28. package/dist/cjs/zonos-collapse.cjs.entry.js +1 -1
  29. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +5 -5
  30. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +11 -11
  31. package/dist/cjs/zonos-collect.cjs.entry.js +9 -9
  32. package/dist/cjs/zonos-controller.cjs.entry.js +6 -6
  33. package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
  34. package/dist/cjs/zonos-country-select_4.cjs.entry.js +3 -3
  35. package/dist/cjs/zonos-elements.cjs.js +1 -1
  36. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +3 -3
  37. package/dist/cjs/zonos-hello.cjs.entry.js +4 -47
  38. package/dist/cjs/zonos-input.cjs.entry.js +2 -2
  39. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +7 -7
  40. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +11 -11
  41. package/dist/cjs/zonos-invoice.cjs.entry.js +9 -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-store-credit.cjs.entry.js → zonos-policy-consent_2.cjs.entry.js} +91 -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/cjs/{zonosStore-0662b95f.js → zonosStore-45a87908.js} +1 -0
  50. package/dist/collection/collection-manifest.json +1 -0
  51. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-footer/zonos-checkout-footer.js +7 -2
  52. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +66 -12
  53. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +103 -75
  54. package/dist/collection/components/checkout/zonos-checkout/zonos-policy-consent/zonos-policy-consent.css +93 -0
  55. package/dist/collection/components/checkout/zonos-checkout/zonos-policy-consent/zonos-policy-consent.js +93 -0
  56. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +2 -44
  57. package/dist/collection/components/store/checkout/paypal.js +57 -14
  58. package/dist/collection/components/store/checkout/policyConsent.js +58 -0
  59. package/dist/collection/components/store/checkout/stripe.js +66 -0
  60. package/dist/collection/components/store/hello/localization.js +12 -1
  61. package/dist/collection/components/store/translationStore/strings.arabic.js +21 -0
  62. package/dist/collection/components/store/translationStore/strings.base.js +21 -0
  63. package/dist/collection/components/store/translationStore/strings.chinese.js +21 -0
  64. package/dist/collection/components/store/translationStore/strings.danish.js +21 -0
  65. package/dist/collection/components/store/translationStore/strings.dutch.js +21 -0
  66. package/dist/collection/components/store/translationStore/strings.french.js +21 -0
  67. package/dist/collection/components/store/translationStore/strings.german.js +21 -0
  68. package/dist/collection/components/store/translationStore/strings.hebrew.js +21 -0
  69. package/dist/collection/components/store/translationStore/strings.indonesian.js +21 -0
  70. package/dist/collection/components/store/translationStore/strings.italian.js +21 -0
  71. package/dist/collection/components/store/translationStore/strings.japanese.js +21 -0
  72. package/dist/collection/components/store/translationStore/strings.korean.js +21 -0
  73. package/dist/collection/components/store/translationStore/strings.norwegian.js +21 -0
  74. package/dist/collection/components/store/translationStore/strings.polish.js +21 -0
  75. package/dist/collection/components/store/translationStore/strings.portuguese.js +21 -0
  76. package/dist/collection/components/store/translationStore/strings.russian.js +21 -0
  77. package/dist/collection/components/store/translationStore/strings.spanish.js +21 -0
  78. package/dist/collection/components/store/translationStore/strings.swedish.js +21 -0
  79. package/dist/collection/components/store/translationStore/strings.turkish.js +21 -0
  80. package/dist/collection/components/store/translationStore/strings.vietnamese.js +21 -0
  81. package/dist/collection/components/store/zonosStore.js +1 -0
  82. package/dist/collection/components/utils/checkout/bigcommerceStorefrontApi.js +28 -0
  83. package/dist/collection/components/utils/checkout/removeBigcommerceCartShipping.js +83 -0
  84. package/dist/collection/components/utils/hello/shouldShowHelloWidget.js +61 -0
  85. package/dist/collection/types/generated/graphql.internal.types.js +64 -0
  86. package/dist/collection/utils/toggleBigcommerceNativeCurrencySelector.js +2 -1
  87. package/dist/esm/{cart-49082718.js → cart-663ef7d5.js} +125 -5
  88. package/dist/esm/{debounce-ab526ca0.js → debounce-58e4ff3e.js} +1 -1
  89. package/dist/esm/{getBorderRadius-98c64be8.js → getBorderRadius-d23f47a6.js} +1 -1
  90. package/dist/esm/{getContrastColor-0aa643c1.js → getContrastColor-f0bd5b65.js} +2 -2
  91. package/dist/esm/{hasInclusivePrice-2323d514.js → hasInclusivePrice-f8bd057d.js} +1 -1
  92. package/dist/esm/index.js +7 -7
  93. package/dist/esm/{invoice-16c688e7.js → invoice-db7211a6.js} +3 -3
  94. package/dist/esm/{isCollectMobileTablet-910aea2e.js → isCollectMobileTablet-24c912b1.js} +3 -3
  95. package/dist/esm/{isContrastColor-6bad285e.js → isContrastColor-fbddacb6.js} +1 -1
  96. package/dist/esm/{isDarkColor-0a8453e7.js → isDarkColor-566f04c5.js} +1 -1
  97. package/dist/esm/loader.js +1 -1
  98. package/dist/esm/{localization-33a9f7ff.js → localization-dc19e8bb.js} +657 -4
  99. package/dist/esm/{paypal-2e9aa4ba.js → paypal-cdbe69ef.js} +60 -18
  100. package/dist/esm/{placeTestOrder-35c9b460.js → placeTestOrder-ba67e208.js} +2 -2
  101. package/dist/esm/{renderCheckoutCurrency-b84a6da7.js → renderCheckoutCurrency-fb1cbd28.js} +2 -2
  102. package/dist/esm/{submitGtag-ae9d5d91.js → submitGtag-c7ea1f2a.js} +1 -1
  103. package/dist/esm/{throttle-882b1f47.js → throttle-f09d0659.js} +2 -2
  104. package/dist/esm/{updateCheckoutSessionAttributes-da7fdd37.js → updateCheckoutSessionAttributes-40e301a4.js} +1 -1
  105. package/dist/esm/zonos-address-display_8.entry.js +7 -7
  106. package/dist/esm/zonos-address_4.entry.js +7 -7
  107. package/dist/esm/zonos-badge.entry.js +1 -1
  108. package/dist/esm/zonos-banner.entry.js +1 -1
  109. package/dist/esm/zonos-button_3.entry.js +3 -3
  110. package/dist/esm/zonos-card_5.entry.js +8 -8
  111. package/dist/esm/zonos-cart-items_12.entry.js +94 -27
  112. package/dist/esm/zonos-checkbox_2.entry.js +3 -3
  113. package/dist/esm/zonos-checkout.entry.js +113 -143
  114. package/dist/esm/zonos-collapse.entry.js +1 -1
  115. package/dist/esm/zonos-collect-cart-items_3.entry.js +5 -5
  116. package/dist/esm/zonos-collect-finish_6.entry.js +11 -11
  117. package/dist/esm/zonos-collect.entry.js +9 -9
  118. package/dist/esm/zonos-controller.entry.js +6 -6
  119. package/dist/esm/zonos-country-flag.entry.js +2 -2
  120. package/dist/esm/zonos-country-select_4.entry.js +3 -3
  121. package/dist/esm/zonos-elements.js +1 -1
  122. package/dist/esm/zonos-hello-dialog.entry.js +3 -3
  123. package/dist/esm/zonos-hello.entry.js +4 -47
  124. package/dist/esm/zonos-input.entry.js +2 -2
  125. package/dist/esm/zonos-invoice-cart-items_2.entry.js +7 -7
  126. package/dist/esm/zonos-invoice-finish_5.entry.js +11 -11
  127. package/dist/esm/zonos-invoice.entry.js +9 -9
  128. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  129. package/dist/esm/zonos-logo.entry.js +1 -1
  130. package/dist/esm/{zonos-store-credit.entry.js → zonos-policy-consent_2.entry.js} +91 -7
  131. package/dist/esm/zonos-shipping-rich-radio.entry.js +5 -5
  132. package/dist/esm/zonos-stripe-input.entry.js +3 -3
  133. package/dist/esm/zonos-text.entry.js +1 -1
  134. package/dist/esm/zonos-v-stack.entry.js +1 -1
  135. package/dist/esm/{zonosStore-9662b071.js → zonosStore-8e19daff.js} +1 -0
  136. package/dist/esm-es5/cart-663ef7d5.js +1 -0
  137. package/dist/esm-es5/{debounce-ab526ca0.js → debounce-58e4ff3e.js} +1 -1
  138. package/dist/esm-es5/{getBorderRadius-98c64be8.js → getBorderRadius-d23f47a6.js} +1 -1
  139. package/dist/esm-es5/{getContrastColor-0aa643c1.js → getContrastColor-f0bd5b65.js} +1 -1
  140. package/dist/esm-es5/{hasInclusivePrice-2323d514.js → hasInclusivePrice-f8bd057d.js} +1 -1
  141. package/dist/esm-es5/index.js +1 -1
  142. package/dist/esm-es5/{invoice-16c688e7.js → invoice-db7211a6.js} +1 -1
  143. package/dist/esm-es5/{isCollectMobileTablet-910aea2e.js → isCollectMobileTablet-24c912b1.js} +1 -1
  144. package/dist/esm-es5/{isContrastColor-6bad285e.js → isContrastColor-fbddacb6.js} +1 -1
  145. package/dist/esm-es5/{isDarkColor-0a8453e7.js → isDarkColor-566f04c5.js} +1 -1
  146. package/dist/esm-es5/loader.js +1 -1
  147. package/dist/esm-es5/localization-dc19e8bb.js +1 -0
  148. package/dist/esm-es5/{paypal-2e9aa4ba.js → paypal-cdbe69ef.js} +2 -2
  149. package/dist/esm-es5/{placeTestOrder-35c9b460.js → placeTestOrder-ba67e208.js} +1 -1
  150. package/dist/esm-es5/{renderCheckoutCurrency-b84a6da7.js → renderCheckoutCurrency-fb1cbd28.js} +1 -1
  151. package/dist/esm-es5/{submitGtag-ae9d5d91.js → submitGtag-c7ea1f2a.js} +1 -1
  152. package/dist/esm-es5/throttle-f09d0659.js +1 -0
  153. package/dist/esm-es5/{updateCheckoutSessionAttributes-da7fdd37.js → updateCheckoutSessionAttributes-40e301a4.js} +1 -1
  154. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
  155. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  156. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  157. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  158. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  159. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  160. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  161. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
  162. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  163. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  164. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  165. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  166. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  167. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  168. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  169. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  170. package/dist/esm-es5/zonos-elements.js +1 -1
  171. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  172. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  173. package/dist/esm-es5/zonos-input.entry.js +1 -1
  174. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  175. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  176. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  177. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  178. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  179. package/dist/esm-es5/zonos-policy-consent_2.entry.js +1 -0
  180. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  181. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  182. package/dist/esm-es5/zonos-text.entry.js +1 -1
  183. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  184. package/dist/esm-es5/{zonosStore-9662b071.js → zonosStore-8e19daff.js} +1 -1
  185. package/dist/scripts/index.d.ts +80 -6
  186. package/dist/scripts/index.js +1 -1
  187. package/dist/scripts/loadZonos.js +1 -1
  188. package/dist/scripts/zonos.js +1 -1
  189. package/dist/types/components/checkout/zonos-checkout/zonos-policy-consent/zonos-policy-consent.d.ts +3 -0
  190. package/dist/types/components/hello/zonos-hello/zonos-hello.d.ts +0 -1
  191. package/dist/types/components/store/checkout/policyConsent.d.ts +41 -0
  192. package/dist/types/components/store/checkout/stripe.d.ts +13 -0
  193. package/dist/types/components/store/translationStore/strings.arabic.d.ts +21 -0
  194. package/dist/types/components/store/translationStore/strings.base.d.ts +21 -0
  195. package/dist/types/components/store/translationStore/strings.chinese.d.ts +21 -0
  196. package/dist/types/components/store/translationStore/strings.danish.d.ts +21 -0
  197. package/dist/types/components/store/translationStore/strings.dutch.d.ts +21 -0
  198. package/dist/types/components/store/translationStore/strings.french.d.ts +21 -0
  199. package/dist/types/components/store/translationStore/strings.german.d.ts +21 -0
  200. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +21 -0
  201. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +21 -0
  202. package/dist/types/components/store/translationStore/strings.italian.d.ts +21 -0
  203. package/dist/types/components/store/translationStore/strings.japanese.d.ts +21 -0
  204. package/dist/types/components/store/translationStore/strings.korean.d.ts +21 -0
  205. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +21 -0
  206. package/dist/types/components/store/translationStore/strings.polish.d.ts +21 -0
  207. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +21 -0
  208. package/dist/types/components/store/translationStore/strings.russian.d.ts +21 -0
  209. package/dist/types/components/store/translationStore/strings.spanish.d.ts +21 -0
  210. package/dist/types/components/store/translationStore/strings.swedish.d.ts +21 -0
  211. package/dist/types/components/store/translationStore/strings.turkish.d.ts +21 -0
  212. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +21 -0
  213. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  214. package/dist/types/components/utils/checkout/bigcommerceStorefrontApi.d.ts +9 -0
  215. package/dist/types/components/utils/checkout/removeBigcommerceCartShipping.d.ts +18 -0
  216. package/dist/types/components/utils/hello/shouldShowHelloWidget.d.ts +16 -0
  217. package/dist/types/components.d.ts +13 -0
  218. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +23 -6
  219. package/dist/types/types/checkout/CheckoutConfig.d.ts +23 -0
  220. package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
  221. package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
  222. package/dist/types/types/generated/graphql.internal.types.d.ts +170 -23
  223. package/dist/types/types/generated/graphql.internal.types.ts +152 -23
  224. package/dist/zonos-elements/index.esm.js +1 -1
  225. package/dist/zonos-elements/{p-90c932fd.entry.js → p-049fc407.entry.js} +1 -1
  226. package/dist/zonos-elements/{p-2a8fcb71.system.entry.js → p-0581cfc9.system.entry.js} +1 -1
  227. package/dist/zonos-elements/p-097d7819.js +1 -0
  228. package/dist/zonos-elements/{p-e850e6e7.system.entry.js → p-09d32e53.system.entry.js} +1 -1
  229. package/dist/zonos-elements/{p-1325bbd6.system.entry.js → p-0daed059.system.entry.js} +1 -1
  230. package/dist/zonos-elements/{p-79e5a629.system.entry.js → p-0e36a7cf.system.entry.js} +1 -1
  231. package/dist/zonos-elements/{p-b6df4cc2.system.entry.js → p-134c5010.system.entry.js} +1 -1
  232. package/dist/zonos-elements/p-14d6542f.system.js +1 -0
  233. package/dist/zonos-elements/{p-0207c91e.system.js → p-18af6aaa.system.js} +1 -1
  234. package/dist/zonos-elements/p-1bde60d5.system.entry.js +1 -0
  235. package/dist/zonos-elements/{p-9a5a2043.js → p-243dda5f.js} +1 -1
  236. package/dist/zonos-elements/p-263d14da.system.entry.js +1 -0
  237. package/dist/zonos-elements/{p-6b6cfc59.system.entry.js → p-26ae4ee7.system.entry.js} +1 -1
  238. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  239. package/dist/zonos-elements/{p-71fb6126.entry.js → p-2afecda7.entry.js} +1 -1
  240. package/dist/zonos-elements/{p-458df669.js → p-2be4335f.js} +1 -1
  241. package/dist/zonos-elements/p-33a37c42.system.entry.js +1 -0
  242. package/dist/zonos-elements/{p-d28be518.js → p-33d4be28.js} +1 -1
  243. package/dist/zonos-elements/{p-26c85188.entry.js → p-344a1fee.entry.js} +1 -1
  244. package/dist/zonos-elements/p-3b28fc76.js +1 -0
  245. package/dist/zonos-elements/{p-db3b101a.js → p-3dc3596b.js} +1 -1
  246. package/dist/zonos-elements/{p-3689821f.system.js → p-3e7ee89d.system.js} +1 -1
  247. package/dist/zonos-elements/{p-843ced6c.js → p-44147850.js} +1 -1
  248. package/dist/zonos-elements/{p-71c7a1ff.entry.js → p-488c1af1.entry.js} +1 -1
  249. package/dist/zonos-elements/{p-3516340a.system.entry.js → p-48ec0b61.system.entry.js} +1 -1
  250. package/dist/zonos-elements/p-4af88255.entry.js +1 -0
  251. package/dist/zonos-elements/p-4b6e367d.system.js +1 -0
  252. package/dist/zonos-elements/{p-ab0b23f2.js → p-4df08fc4.js} +1 -1
  253. package/dist/zonos-elements/{p-0ed70279.entry.js → p-513e8278.entry.js} +1 -1
  254. package/dist/zonos-elements/p-52bd7be3.system.js +1 -0
  255. package/dist/zonos-elements/{p-deaf0e38.system.entry.js → p-536cbab5.system.entry.js} +1 -1
  256. package/dist/zonos-elements/p-56711a61.js +1 -0
  257. package/dist/zonos-elements/{p-01497a20.entry.js → p-57b55808.entry.js} +1 -1
  258. package/dist/zonos-elements/p-57c3c68f.entry.js +1 -0
  259. package/dist/zonos-elements/{p-a49ba3ae.system.entry.js → p-5b4e5608.system.entry.js} +1 -1
  260. package/dist/zonos-elements/{p-1bf9a1b9.system.js → p-5d65be06.system.js} +1 -1
  261. package/dist/zonos-elements/{p-1957af5a.system.entry.js → p-5f92db80.system.entry.js} +1 -1
  262. package/dist/zonos-elements/{p-2a6be4a5.entry.js → p-658ab5e2.entry.js} +1 -1
  263. package/dist/zonos-elements/{p-8f9e95c2.entry.js → p-680da401.entry.js} +1 -1
  264. package/dist/zonos-elements/{p-4f718ef9.system.js → p-699276f2.system.js} +1 -1
  265. package/dist/zonos-elements/{p-f3cfd8fa.js → p-701d9a7c.js} +1 -1
  266. package/dist/zonos-elements/{p-ce103c66.system.entry.js → p-71528303.system.entry.js} +1 -1
  267. package/dist/zonos-elements/{p-8570e88a.system.js → p-7662d32a.system.js} +1 -1
  268. package/dist/zonos-elements/{p-27061873.entry.js → p-777d396e.entry.js} +1 -1
  269. package/dist/zonos-elements/{p-46071125.entry.js → p-7aca66cd.entry.js} +1 -1
  270. package/dist/zonos-elements/{p-eb99a625.system.js → p-7d9d2407.system.js} +1 -1
  271. package/dist/zonos-elements/{p-7003d093.system.entry.js → p-80df7e0b.system.entry.js} +1 -1
  272. package/dist/zonos-elements/{p-b7e4a020.system.entry.js → p-82ce355d.system.entry.js} +1 -1
  273. package/dist/zonos-elements/{p-5e1799bc.entry.js → p-84d4f04d.entry.js} +1 -1
  274. package/dist/zonos-elements/{p-180d3e3d.entry.js → p-858103a0.entry.js} +1 -1
  275. package/dist/zonos-elements/{p-9e0cb5b3.system.entry.js → p-882fb843.system.entry.js} +1 -1
  276. package/dist/zonos-elements/{p-648f3ada.entry.js → p-889a44fc.entry.js} +1 -1
  277. package/dist/zonos-elements/{p-4c89d04a.js → p-896fb969.js} +1 -1
  278. package/dist/zonos-elements/{p-2c854197.system.entry.js → p-8a24701c.system.entry.js} +1 -1
  279. package/dist/zonos-elements/{p-cb966d16.system.entry.js → p-8f0bdb87.system.entry.js} +1 -1
  280. package/dist/zonos-elements/p-8f817a47.system.js +18 -0
  281. package/dist/zonos-elements/{p-a78bc004.entry.js → p-9092f655.entry.js} +1 -1
  282. package/dist/zonos-elements/p-90d22087.system.js +1 -0
  283. package/dist/zonos-elements/{p-1ec9b3b0.entry.js → p-9377b5c2.entry.js} +1 -1
  284. package/dist/zonos-elements/{p-a6db8883.entry.js → p-9799193c.entry.js} +1 -1
  285. package/dist/zonos-elements/{p-55fb4ea3.system.entry.js → p-98bea13e.system.entry.js} +1 -1
  286. package/dist/zonos-elements/{p-ba9e2612.system.entry.js → p-990d1495.system.entry.js} +1 -1
  287. package/dist/zonos-elements/{p-601bb27e.entry.js → p-9a509268.entry.js} +1 -1
  288. package/dist/zonos-elements/{p-a1bad0c3.system.entry.js → p-9ea67d63.system.entry.js} +1 -1
  289. package/dist/zonos-elements/p-9f5fb332.js +1 -0
  290. package/dist/zonos-elements/{p-d950b0b4.entry.js → p-a237429e.entry.js} +1 -1
  291. package/dist/zonos-elements/{p-5d823ea7.system.js → p-a3a79b2f.system.js} +1 -1
  292. package/dist/zonos-elements/p-ac8cfdc0.js +1 -0
  293. package/dist/zonos-elements/p-accccb9c.entry.js +1 -0
  294. package/dist/zonos-elements/p-b0ed0fe7.system.entry.js +1 -0
  295. package/dist/zonos-elements/{p-b4b23475.entry.js → p-b35a0b1e.entry.js} +1 -1
  296. package/dist/zonos-elements/{p-bf5c3dd7.system.entry.js → p-b59fc3fa.system.entry.js} +1 -1
  297. package/dist/zonos-elements/{p-db5f6b8c.entry.js → p-ba127f51.entry.js} +1 -1
  298. package/dist/zonos-elements/p-bbef037c.js +1 -0
  299. package/dist/zonos-elements/{p-6a195559.system.js → p-bc919de1.system.js} +1 -1
  300. package/dist/zonos-elements/p-be64a52e.entry.js +1 -0
  301. package/dist/zonos-elements/{p-665bfd4f.entry.js → p-c1463da7.entry.js} +1 -1
  302. package/dist/zonos-elements/{p-311ba000.system.js → p-c2023a08.system.js} +1 -1
  303. package/dist/zonos-elements/{p-8d5f413c.system.entry.js → p-c4ef873a.system.entry.js} +1 -1
  304. package/dist/zonos-elements/p-c5caf47b.system.js +1 -0
  305. package/dist/zonos-elements/{p-baf0b24c.system.entry.js → p-c62293d5.system.entry.js} +1 -1
  306. package/dist/zonos-elements/{p-79f3c227.system.entry.js → p-c92a5ae5.system.entry.js} +1 -1
  307. package/dist/zonos-elements/p-cd34ecf2.js +1 -0
  308. package/dist/zonos-elements/p-cd5444b0.js +17 -0
  309. package/dist/zonos-elements/{p-cfb0059f.js → p-d437bc28.js} +1 -1
  310. package/dist/zonos-elements/p-d932973f.system.js +1 -0
  311. package/dist/zonos-elements/{p-28e2ac3b.entry.js → p-dae881f2.entry.js} +1 -1
  312. package/dist/zonos-elements/{p-087520f2.system.entry.js → p-df0c8fb6.system.entry.js} +1 -1
  313. package/dist/zonos-elements/{p-8571f3ce.entry.js → p-df55536b.entry.js} +1 -1
  314. package/dist/zonos-elements/p-e05e5825.entry.js +1 -0
  315. package/dist/zonos-elements/{p-928291e5.entry.js → p-e548b8ec.entry.js} +1 -1
  316. package/dist/zonos-elements/{p-5e6f85f0.system.js → p-f053975e.system.js} +1 -1
  317. package/dist/zonos-elements/{p-175c04a4.system.js → p-f5684fc2.system.js} +1 -1
  318. package/dist/zonos-elements/{p-22ba60f6.system.entry.js → p-fc270539.system.entry.js} +1 -1
  319. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  320. package/package.json +1 -1
  321. package/dist/esm-es5/cart-49082718.js +0 -1
  322. package/dist/esm-es5/localization-33a9f7ff.js +0 -1
  323. package/dist/esm-es5/throttle-882b1f47.js +0 -1
  324. package/dist/esm-es5/zonos-store-credit.entry.js +0 -1
  325. package/dist/zonos-elements/p-029be4a8.entry.js +0 -1
  326. package/dist/zonos-elements/p-034ab928.system.entry.js +0 -1
  327. package/dist/zonos-elements/p-07a76716.system.js +0 -1
  328. package/dist/zonos-elements/p-1f256673.entry.js +0 -1
  329. package/dist/zonos-elements/p-367a72bc.js +0 -1
  330. package/dist/zonos-elements/p-3b1b3598.system.js +0 -18
  331. package/dist/zonos-elements/p-40284821.system.js +0 -1
  332. package/dist/zonos-elements/p-4980facb.js +0 -1
  333. package/dist/zonos-elements/p-6987f9c9.js +0 -1
  334. package/dist/zonos-elements/p-6d81901a.js +0 -1
  335. package/dist/zonos-elements/p-703fc360.entry.js +0 -1
  336. package/dist/zonos-elements/p-77c2e465.system.js +0 -1
  337. package/dist/zonos-elements/p-84dbf474.js +0 -17
  338. package/dist/zonos-elements/p-9b0a6fe5.system.entry.js +0 -1
  339. package/dist/zonos-elements/p-adb9827c.js +0 -1
  340. package/dist/zonos-elements/p-b2d276e1.js +0 -1
  341. package/dist/zonos-elements/p-b5a26334.system.entry.js +0 -1
  342. package/dist/zonos-elements/p-b6a36c25.system.js +0 -1
  343. package/dist/zonos-elements/p-becac995.js +0 -1
  344. package/dist/zonos-elements/p-c9c17d08.system.entry.js +0 -1
  345. package/dist/zonos-elements/p-e056ae6b.entry.js +0 -1
  346. package/dist/zonos-elements/p-e3292be8.system.js +0 -1
  347. package/dist/zonos-elements/p-e5dfccd8.system.js +0 -1
  348. package/dist/zonos-elements/p-fb712719.entry.js +0 -1
@@ -1 +0,0 @@
1
- import{d as debounce_1}from"./debounce-ab526ca0.js";import{d as isObject_1}from"./zonosStore-9662b071.js";var debounce=debounce_1,isObject=isObject_1;var FUNC_ERROR_TEXT="Expected a function";function throttle(t,e,r){var o=true,i=true;if(typeof t!="function"){throw new TypeError(FUNC_ERROR_TEXT)}if(isObject(r)){o="leading"in r?!!r.leading:o;i="trailing"in r?!!r.trailing:i}return debounce(t,e,{leading:o,maxWait:e,trailing:i})}var throttle_1=throttle;export{throttle_1 as t};
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(e,o,t,r){function s(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,n){function i(e){try{l(r.next(e))}catch(e){n(e)}}function a(e){try{l(r["throw"](e))}catch(e){n(e)}}function l(e){e.done?t(e.value):s(e.value).then(i,a)}l((r=r.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},r,s,n,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(o){return l([e,o])}}function l(a){if(r)throw new TypeError("Generator is already executing.");while(i&&(i=0,a[0]&&(t=0)),t)try{if(r=1,s&&(n=a[0]&2?s["return"]:a[0]?s["throw"]||((n=s["return"])&&n.call(s),0):s.next)&&!(n=n.call(s,a[1])).done)return n;if(s=0,n)a=[a[0]&2,n.value];switch(a[0]){case 0:case 1:n=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;s=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(n=t.trys,n=n.length>0&&n[n.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!n||a[1]>n[0]&&a[1]<n[3])){t.label=a[1];break}if(a[0]===6&&t.label<n[1]){t.label=n[1];n=a;break}if(n&&t.label<n[2]){t.label=n[2];t.ops.push(a);break}if(n[2])t.ops.pop();t.trys.pop();continue}a=o.call(e,t)}catch(e){a=[6,e];s=0}finally{r=n=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};import{r as registerInstance,h,F as Fragment,a as Host,g as getElement}from"./index-cfd394c8.js";import{V as storeCreditStoreSetEnabled,W as storeCreditStoreSetUseFullBalance,X as cartStoreUpdateStoreCredit,N as storeCreditStore,Y as storeCreditStoreSetAmount,Z as storeCreditStoreRefreshBalance,F as storeCreditStoreGetEffectiveAmount}from"./cart-49082718.js";import{t as translate}from"./localization-33a9f7ff.js";import{f as zonosStoreFontFamily,z as zonosStore}from"./zonosStore-9662b071.js";import{r as renderCheckoutCurrency}from"./renderCheckoutCurrency-b84a6da7.js";import{g as getBorderRadius}from"./getBorderRadius-98c64be8.js";import"./VarianceTest-572cecf5.js";import"./handleFetch-a844cac1.js";import"./isDarkColor-0a8453e7.js";var StoreCreditIcon='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true">\n <path fill="currentColor" fill-rule="evenodd" d="M4 5a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h16a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3H4Zm16 2H4a1 1 0 0 0-1 1v1h18V8a1 1 0 0 0-1-1ZM2 11h20v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-3Zm6 4.5a1 1 0 0 1 1-1h2a1 1 0 0 1 0 2H9a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>\n</svg>\n';var zonosStoreCreditCss=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:block;margin-bottom:var(--zonos-elements-font-size-xl)}:host .zonos--store-credit-container{background:-webkit-gradient(linear, left top, left bottom, from(var(--zonos-elements-gray-0)), to(var(--zonos-elements-gray-50)));background:linear-gradient(180deg, var(--zonos-elements-gray-0) 0%, var(--zonos-elements-gray-50) 100%);border:1px solid var(--zonos-elements-gray-200);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-8));-webkit-box-shadow:var(--zonos-elements-v3-shadow-base);box-shadow:var(--zonos-elements-v3-shadow-base);overflow:hidden;padding:0;position:relative}:host .zonos--store-credit-container::before{background:var(--zonos--primary-color, var(--zonos-elements-gray-400));content:"";height:3px;left:0;position:absolute;right:0;top:0}:host .zonos--store-credit-header{padding:var(--zonos-elements-radius-12) var(--zonos-elements-font-size-l) 0}:host .zonos--store-credit-title-row{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .zonos--store-credit-title-left{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-title-icon{-ms-flex-align:center;align-items:center;background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 14%, transparent);border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.75);display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;height:22px;-ms-flex-pack:center;justify-content:center;width:22px}:host .zonos--store-credit-balance-badge{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 8%, var(--zonos-elements-gray-50));border:1px solid color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 22%, var(--zonos-elements-gray-200));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:2px var(--zonos-elements-font-size-s)}:host .zonos--store-credit-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-s) var(--zonos-elements-font-size-l) var(--zonos-elements-radius-12)}:host .zonos--store-credit-checkbox{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex}:host .zonos--store-credit-options{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-toggle-row{display:-ms-flexbox;display:flex}:host .zonos--store-credit-custom-amount{max-width:240px}:host .zonos--store-credit-custom-amount-row{-ms-flex-align:end;align-items:flex-end;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-custom-amount-row zonos-input{-ms-flex:1;flex:1}:host .zonos--store-credit-error{margin-top:2px}:host .zonos--store-credit-summary{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 6%, var(--zonos-elements-gray-50));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:var(--zonos-elements-radius-10) var(--zonos-elements-font-size-s)}:host .zonos--store-credit-empty{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-xl) var(--zonos-elements-font-size-l) 22px;text-align:center}:host .zonos--store-credit-empty-icon{-ms-flex-align:center;align-items:center;background:var(--zonos-elements-gray-100);border-radius:50%;display:-ms-flexbox;display:flex;height:52px;-ms-flex-pack:center;justify-content:center;opacity:0.95;width:52px}';var ZonosStoreCreditStyle0=zonosStoreCreditCss;var AMOUNT_MODE_FULL="full";var AMOUNT_MODE_CUSTOM="custom";var ZonosStoreCredit=function(){function e(e){var o=this;registerInstance(this,e);this.enabled=true;this.customAmountInput="";this.handleUseStoreCreditChange=function(e){storeCreditStoreSetEnabled(e);if(e){storeCreditStoreSetUseFullBalance(true)}void cartStoreUpdateStoreCredit()};this.handleAmountModeChange=function(e){var t=e===AMOUNT_MODE_FULL;storeCreditStoreSetUseFullBalance(t);if(!t){o.customAmountInput=""}void cartStoreUpdateStoreCredit()};this.handleCustomAmountChange=function(e){o.customAmountInput=e;storeCreditStore.error=null};this.handleApplyCustomAmount=function(){var e=parseFloat(o.customAmountInput);if(!isNaN(e)&&e>0){storeCreditStoreSetAmount(e)}else{storeCreditStoreSetAmount(null)}if(!storeCreditStore.error){void cartStoreUpdateStoreCredit()}}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,storeCreditStoreRefreshBalance()];case 1:e.sent();return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.enabled){return null}var o=zonosStore.appearance.colorPrimary;var t=getBorderRadius({});var r=storeCreditStore.availableBalance;var s=r!==null&&r>0;var n=storeCreditStore.isEnabled;var i=storeCreditStore.useFullBalance;var a=storeCreditStore.error;var l=storeCreditStoreGetEffectiveAmount();var c=renderCheckoutCurrency({amount:r!==null&&r!==void 0?r:0,isForeign:true});return h(Host,{class:"zonos--elements zonos--store-credit",style:{"--zonos--border-radius":t,"--zonos--font-family":zonosStoreFontFamily(),"--zonos--primary-color":o}},h("div",{class:"zonos--store-credit-container"},h("div",{class:"zonos--store-credit-header"},h("div",{class:"zonos--store-credit-title-row"},h("div",{class:"zonos--store-credit-title-left"},h("div",{"aria-hidden":"true",class:"zonos--store-credit-title-icon"},h("zonos-icon",{content:StoreCreditIcon,iconColor:"gray-500",size:22})),h("zonos-text",{type:"semiBoldLabel"},translate("Store credit"))),s&&h("div",{class:"zonos--store-credit-balance-badge"},h("zonos-text",{textColor:"gray-600",type:"caption"},c)))),h(Fragment,null,s?h("div",{class:"zonos--store-credit-content"},h("div",{class:"zonos--store-credit-checkbox"},h("zonos-checkbox",{isChecked:n,label:translate("Use store credit"),onCheckboxSelected:function(o){return e.handleUseStoreCreditChange(o.detail)},size:16})),n&&h("div",{class:"zonos--store-credit-options"},h("div",{class:"zonos--store-credit-toggle-row"},h("zonos-toggle",{onToggleChanged:function(o){return e.handleAmountModeChange(o.detail)},options:[{label:translate("Apply full balance"),value:AMOUNT_MODE_FULL},{label:translate("Enter amount"),value:AMOUNT_MODE_CUSTOM}],value:i?AMOUNT_MODE_FULL:AMOUNT_MODE_CUSTOM})),!i&&h("div",{class:"zonos--store-credit-custom-amount"},h("div",{class:"zonos--store-credit-custom-amount-row"},h("zonos-input",{inputLabel:translate("Enter amount"),inputValue:this.customAmountInput,isError:!!a,onInputChange:function(o){return e.handleCustomAmountChange(o.detail)}}),h("zonos-button",{onClick:this.handleApplyCustomAmount,size:"sm",variant:"primary"},translate("Apply")))),a&&h("div",{class:"zonos--store-credit-error"},h("zonos-text",{textColor:"red-600",type:"caption"},a)),h("div",{class:"zonos--store-credit-summary"},h("zonos-text",{textColor:"gray-800",type:"semiBoldLabel"},translate("Amount to apply: [amount]",{amount:renderCheckoutCurrency({amount:l,isForeign:true})}))))):h("div",{class:"zonos--store-credit-empty"},h("div",{"aria-hidden":"true",class:"zonos--store-credit-empty-icon"},h("zonos-icon",{content:StoreCreditIcon,iconColor:"gray-500",size:28})),h("zonos-text",{textColor:"gray-600",type:"caption"},translate("No store credit available"))))))};Object.defineProperty(e.prototype,"el",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();ZonosStoreCredit.style=ZonosStoreCreditStyle0;export{ZonosStoreCredit as zonos_store_credit};
@@ -1 +0,0 @@
1
- import{r as t,d as e,h as o,a as i}from"./p-ce75b047.js";import{b as n}from"./p-6987f9c9.js";import{e as s,i as c,h as r,s as l,a}from"./p-adb9827c.js";import{z as d,e as u,f as h}from"./p-f3cfd8fa.js";import{g as m,i as p,a as f}from"./p-e7b0c156.js";import{h as w,l as v}from"./p-41dd1cb8.js";import{l as g}from"./p-0a377722.js";import{a as y}from"./p-4c89d04a.js";import"./p-d28be518.js";import"./p-db3b101a.js";const S="zonos-domestic-element-hide-style",b="undefined"!=typeof document&&(()=>{try{return document.querySelector(":is(.zonos-is-probe)"),!0}catch(t){return!1}})(),z=t=>{const e=document.querySelector(t);if(!document.querySelector("zonos-hello")&&e){const t=document.createElement("zonos-hello");return e.appendChild(t),!0}return!1},j=t=>{switch(t){case"BOTTOM_RIGHT":default:return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right"}},I=({position:t="bottom-right"})=>{const e=".zonos--hello-mobile-wrapper";if(document.querySelector(e))return e;const o=document.createElement("div");return o.className="zonos--hello-mobile-wrapper",o.style.position="fixed","top-right"===t&&(o.style.top="72px",o.style.right="24px"),"top-left"===t&&(o.style.top="72px",o.style.left="24px"),"bottom-right"===t&&(o.style.bottom="72px",o.style.right="24px"),"bottom-left"===t&&(o.style.bottom="72px",o.style.left="24px"),o.style.zIndex="2147483647",document.body.appendChild(o),e},O=async t=>{if(window.Zonos.isLegacyCheckout)return void g("Hello is disabled when isLegacyCheckout","info");const{anchorElementSelector:e}=t;let o=e;if(!t.anchorElementSelector&&t.desktopLocation){const t=I({position:"bottom-right"});o=t}if(o&&c(o)){if(g("Hello init complete"),!z(o)){const e=new MutationObserver((()=>{z(o)&&e.disconnect()}));e.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>{z(o)}),1e3),setTimeout((()=>{if(t.notFoundElementFallback){g(`Hello anchor selector ${t.anchorElementSelector} not found after 3 seconds, falling back to 'notFoundElementFallback': ${t.notFoundElementFallback}`,"info");const e=I({position:j(t.notFoundElementFallback)});z(e)}}),3e3)}}else v(`Selector anchorElementSelector "${t.anchorElementSelector}" is not a valid selector.`)};class C{constructor(t,e){this.targetId=t,this.allowedEvents=e,this.listeners=new Map,this.handleMessage=t=>{var e,o,i;const n=t.data,s=(null===(e=this.iframe)||void 0===e?void 0:e.contentWindow)||(null===(i=null===(o=this.iframe)||void 0===o?void 0:o.contentDocument)||void 0===i?void 0:i.defaultView);if(t.source!==s)return;if(!this.isValidMessage(n))return;const c=this.listeners.get(n.type);null==c||c.forEach((t=>{try{t(n.payload)}catch(t){v("Error in event listener:",t)}}))},this.initializeEventListeners(),this.iframe=document.getElementById(this.targetId)}initializeEventListeners(){window.addEventListener("message",this.handleMessage)}isValidMessage(t){if(!t||"object"!=typeof t)return!1;const e=t;return e.id===this.targetId&&"string"==typeof e.type&&this.allowedEvents.includes(e.type)&&void 0!==e.payload}on(t,e){this.listeners.has(t)||this.listeners.set(t,new Set),g(`[CheckoutAddressService] listening to ${t}`,"info");const o=e,i=this.listeners.get(t);return i&&i.add(o),()=>{const e=this.listeners.get(t);e&&e.delete(o)}}destroy(){window.removeEventListener("message",this.handleMessage),this.listeners.clear()}}class k extends C{constructor(){g("=== [Google Places Service] Initializing","info"),super(p.GOOGLE_PLACES,["fetchAutocompleteSuggestions","initializeGooglePlacesService","placeSelected","onFetchAutocompleteSuggestions","onInitializeGooglePlacesService","onPlaceSelected"])}sendMessage(t,e){var o;if(!(null===(o=this.iframe)||void 0===o?void 0:o.contentWindow))return;const i={id:this.targetId,logType:window.Zonos.iframeLogType,payload:e,type:t};g(`GooglePlacesService] parent --\x3e ${t}`,"info",e),this.iframe.contentWindow.postMessage(i,"*")}initialize(){this.sendMessage("initializeGooglePlacesService",{})}fetchSuggestions({country:t,query:e,type:o}){t&&this.sendMessage("fetchAutocompleteSuggestions",{request:{includedRegionCodes:[t],input:e},type:o})}selectPlace({placeId:t,type:e}){this.sendMessage("placeSelected",{placeId:t,type:e})}}class E{constructor(){this.googlePlaceInitialized=!1,g("=== [CheckoutAddressService] Initializing","info"),this.googlePlaces=new k,this.googlePlaces.on("onInitializeGooglePlacesService",(()=>{g("=== [CheckoutAddressService] parent <-- onInitializeGooglePlacesService","info"),this.googlePlaceInitialized=!0})),this.initialize()}initialize(){this.googlePlaces.initialize()}onInitializeGooglePlacesService(t){return this.googlePlaces.on("onInitializeGooglePlacesService",(()=>{g("[CheckoutAddressService] parent <-- onInitializeGooglePlacesService"),t()}))}isGooglePlaceInitialized(){return this.googlePlaceInitialized}onAddressSuggestions(t){return this.suggestionsCallback=t,this.googlePlaces.on("onFetchAutocompleteSuggestions",((...e)=>{g(`[CheckoutAddressService] parent <-- onFetchAutocompleteSuggestions ${e[0].type}`,"info",...e),t(...e)}))}onAddressSelected(t){return this.placeSelectedCallback=t,this.googlePlaces.on("onPlaceSelected",((...e)=>{g(`[CheckoutAddressService] parent <-- onPlaceSelected ${e[0].type}`,"info",...e),t(...e)}))}getAddressSuggestions({country:t,query:e,type:o}){this.googlePlaceInitialized&&this.googlePlaces.fetchSuggestions({country:t,query:e,type:o})}selectAddress({placeId:t,type:e}){this.googlePlaces.selectPlace({placeId:t,type:e})}destroy(){this.googlePlaces.destroy(),this.suggestionsCallback&&(this.suggestionsCallback=void 0),this.placeSelectedCallback&&(this.placeSelectedCallback=void 0)}}const A=class{constructor(o){t(this,o),this.paypalInitEvent=e(this,"paypalInitEvent",7),this.stripeInitEvent=e(this,"stripeInitEvent",7)}async initCheckoutElement(t){var e;t?(n.stripe=t,((e=d.checkoutSettings).placeOrderButtonSelector||e.alwaysTriggerInternationalCheckoutSelector||window.Zonos.cartData)&&(!e.placeOrderButtonSelector||c(e.placeOrderButtonSelector)?!e.alwaysTriggerInternationalCheckoutSelector||c(e.alwaysTriggerInternationalCheckoutSelector)?(()=>{if(!document.querySelector("zonos-checkout")){const t=document.createElement("zonos-checkout");document.body.appendChild(t)}})():v(`Selector alwaysTriggerInternationalCheckoutSelector "${e.alwaysTriggerInternationalCheckoutSelector}" is not a valid selector`):v(`Selector checkoutButtonAnchor "${e.placeOrderButtonSelector}" is not a valid selector`)),g("init checkout element")):g("Stripe is not loaded yet - cannot init checkout element","warn")}async initCollectElement(t){t?(n.stripe=t,window.Zonos.cartData&&(()=>{if(!document.querySelector("zonos-collect")){const t=document.createElement("zonos-collect");document.body.appendChild(t)}})(),g("init Collect element")):g("Stripe is not loaded yet - cannot init Collect element","warn")}async initInvoiceElement(t){t?(n.stripe=t,window.Zonos.cartData&&(()=>{if(!document.querySelector("zonos-invoice")){const t=document.createElement("zonos-invoice");document.body.appendChild(t)}})(),g("init Invoice element")):g("Stripe is not loaded yet - cannot init Invoice element","warn")}initZonosNotification(){if(document.querySelector("zonos-notification"))return;const t=document.createElement("zonos-notification");document.body.appendChild(t)}async setupGoogleFont(t){var e,o;const i=t||h();if("Inter"===i){if(!t)return;g("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn"),d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:t})}const n=new URLSearchParams;n.set("family",i);const{errors:s,json:c}=await w(`/api/zonos-elements/get-font-detail?${n.toString()}`);if(s.length>0)return g(`Failed to load font ${i}`,"warn"),void(d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:"Inter"}));const r=null==c?void 0:c.fontUrl;r&&(null===(o=(e=window.Zonos).injectSupportGoogleFont)||void 0===o||o.call(e,r)),t&&(g(`[FONT] ${t} font override applied`),d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:t}))}handleLocationChange(){O(d.helloSettings)}initHistoryListener(){const t=history.pushState;history.pushState=function(){return window.dispatchEvent(new window.Event("pushstate")),window.dispatchEvent(new window.Event("locationchange")),t.apply(this,arguments)};const e=history.replaceState;history.replaceState=function(){return window.dispatchEvent(new window.Event("replacestate")),window.dispatchEvent(new window.Event("locationchange")),e.apply(this,arguments)}}injectCustomHTML(t){if(!t)return;if(!window.Zonos.isLegacyCheckout||window.Zonos.isCollect||window.Zonos.isInvoice)return void g("=== Skip injecting custom HTML for hosted checkout","info");g("=== Injecting custom HTML for hosted checkout");const e=document.createElement("template");e.innerHTML=t,e.content.querySelectorAll("script").forEach((t=>{const e=document.createElement("script");t.src?(e.src=t.src,e.async=t.async):e.textContent=t.innerHTML,document.body.appendChild(e)})),y()}async initGooglePlacesService(t){const e=null==t?void 0:t.genericSettings;if(!e)return;const o=e.signedTokenGooglePlaces;o&&f({id:p.GOOGLE_PLACES,onload:()=>{d.checkoutAddressService=new E},src:`https://route.elements.zonos.com/iframe/google-maps?signedToken=${o}`})}buildBaseConfig(t){var e,o;const i=Object.assign(Object.assign({},this.config.checkoutSettings),{allowedSettlementCurrencies:void 0,captureDelay:void 0,subscriptionStatus:void 0});if(window.Zonos.isCollect||window.Zonos.isInvoice)return Object.assign(Object.assign({},this.config),{checkoutSettings:i,helloSettings:Object.assign(Object.assign({},this.config.helloSettings),{visibilityStatus:"DISABLED"})});if(!this.config.checkoutSettings)return Object.assign(Object.assign({},this.config),{checkoutSettings:void 0});const n=window.Zonos.isLegacyCheckout&&!!window.Zonos.cartData&&"CLOSE_MODAL"===(null===(e=this.config.checkoutSettings)||void 0===e?void 0:e.successBehavior);return Object.assign(Object.assign({},this.config),{checkoutSettings:Object.assign(Object.assign({},i),{successBehavior:n?"ZONOS_SUCCESS_PAGE":this.config.checkoutSettings.successBehavior,successRedirectUrl:n?(null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl)||(null==t?void 0:t.onlineStoreSettings.url):this.config.checkoutSettings.successRedirectUrl})})}async componentWillLoad(){this.initHistoryListener(),d.zonosApiKey=this.zonosApiKey,(async()=>{var t,e,o,i;const{errors:n,json:c,zonosMode:l}=await(async()=>{if(window.Zonos.cartSettings)return g("Reusing cached zonos settings"),{errors:[],json:window.Zonos.cartSettings,zonosMode:window.Zonos.zonosMode};const t=m(),e=new URLSearchParams;t.overrideShouldEnabledCustomAddress&&e.set("overrideShouldEnabledCustomAddress",t.overrideShouldEnabledCustomAddress);const o=s();o&&e.set("zCountry",o);const{errors:i,json:n,zonosMode:c}=await w(`/api/zonos-elements/zonos-settings?${e.toString()}`);return i.length?(v("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings"),{errors:i,json:null,zonosMode:c}):{errors:[],json:n,zonosMode:c}})();if("403"===(null===(e=null===(t=n[0])||void 0===t?void 0:t.type)||void 0===e?void 0:e.toString()))return void g("Failed to load zonos settings. This domain may not have access","warn");const a=(null===(o=null==c?void 0:c.checkoutSettings)||void 0===o?void 0:o.customHTML)||"";this.injectCustomHTML(a),this.initZonosNotification();const h=this.buildBaseConfig(c),p=Object.assign(Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:(()=>{var t,e,o;return window.Zonos.isLegacyCheckout?(null===(t=null==c?void 0:c.appearanceSettings)||void 0===t?void 0:t.logoUrl)||(null===(e=this.config.appearance)||void 0===e?void 0:e.logoUrl):null===(o=this.config.appearance)||void 0===o?void 0:o.logoUrl})()})}),h);u({overrideSettings:p,zonosSettings:c}),d.zonosMode=l,(t=>{if("undefined"==typeof document||!t)return;const e=(({merchantSelector:t,supportsIs:e})=>e?`body.z-intl :is(${t})`:(t=>{const e=[];let o=0,i=0,n="";for(let s=0;s<t.length;s++){const c=t[s];if("("===c?o++:")"===c?o--:"["===c?i++:"]"===c&&i--,","===c&&0===o&&0===i){const t=n.trim();t&&e.push(t),n=""}else n+=c}const s=n.trim();return s&&e.push(s),e})(t).map((t=>`body.z-intl ${t}`)).join(", "))({merchantSelector:t,supportsIs:b});try{document.querySelector(e)}catch(o){return void g(`Skip domesticElementSelector injection: "${t}" produced an invalid CSS selector ("${e}")`,"warn")}if(document.getElementById(S))return;const o=document.createElement("style");o.id=S,o.textContent=`${e} { display: none !important; }`,(document.head||document.body).appendChild(o),g("Zonos domestic element hide style injected")})(d.checkoutSettings.domesticElementSelector),this.setupGoogleFont(),"DISABLED"===d.helloSettings.visibilityStatus&&g("=== Hello is disabled by store owner ===","warn"),d.helloSettings&&"ENABLED"===d.helloSettings.visibilityStatus&&(g("Initializing hello"),O(d.helloSettings)),await r();const f=(null===(i=null==c?void 0:c.checkoutSettings)||void 0===i?void 0:i.externalServiceTokens.find((t=>"STRIPE_PUBLISHABLE_TOKEN"===t.type)))||null;if(f&&this.stripeInitEvent){if(window.Zonos.isCollect||window.Zonos.isInvoice)return this.stripeInitEvent.emit({publishableKey:f.token}),void this.initGooglePlacesService(c);if("INACTIVE"===d.checkoutSettings.subscriptionStatus)return g('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn"),void g("zonos controller loaded");if("DISABLED"===d.checkoutSettings.visibilityStatus)return g("=== Checkout is disabled by store owner ===","warn"),void g("zonos controller loaded");this.stripeInitEvent.emit({publishableKey:f.token}),this.initGooglePlacesService(c)}else g("Checkout failed to load -- missing publishable key","warn")})()}async showNotification(t){const e=document.querySelector("zonos-notification");e?e.showNotification(t):g("Failed to show notification - zonos-notification not found","warn")}async reset(){l.checkoutSessionId=null,n.clientSecret=""}async overrideConfig(t){u({overrideSettings:t,zonosSettings:null})}async overrideCountry(t){g(`Override country code to ${t}`),a({isInitializing:!1,newSelectedCountryCode:t})}async getAppearanceSetting(){return d.appearance}async updateOrganizationName(t){d.organizationName=t}render(){return o(i,{key:"fe1f262a2bfbf4f6f39c0f23783c132bde8d2dd7",class:"zonos--elements"})}};A.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";export{A as zonos_controller}
@@ -1 +0,0 @@
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,r){function i(e){try{l(s.next(e))}catch(e){r(e)}}function a(e){try{l(s["throw"](e))}catch(e){r(e)}}function l(e){e.done?t(e.value):n(e.value).then(i,a)}l((s=s.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},s,n,r,i;return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(e){return function(o){return l([e,o])}}function l(a){if(s)throw new TypeError("Generator is already executing.");while(i&&(i=0,a[0]&&(t=0)),t)try{if(s=1,n&&(r=a[0]&2?n["return"]:a[0]?n["throw"]||((r=n["return"])&&r.call(n),0):n.next)&&!(r=r.call(n,a[1])).done)return r;if(n=0,r)a=[a[0]&2,r.value];switch(a[0]){case 0:case 1:r=a;break;case 4:t.label++;return{value:a[1],done:false};case 5:t.label++;n=a[1];a=[0];continue;case 7:a=t.ops.pop();t.trys.pop();continue;default:if(!(r=t.trys,r=r.length>0&&r[r.length-1])&&(a[0]===6||a[0]===2)){t=0;continue}if(a[0]===3&&(!r||a[1]>r[0]&&a[1]<r[3])){t.label=a[1];break}if(a[0]===6&&t.label<r[1]){t.label=r[1];r=a;break}if(r&&t.label<r[2]){t.label=r[2];t.ops.push(a);break}if(r[2])t.ops.pop();t.trys.pop();continue}a=o.call(e,t)}catch(e){a=[6,e];n=0}finally{s=r=0}if(a[0]&5)throw a[1];return{value:a[0]?a[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-b6a36c25.system.js","./p-77c2e465.system.js","./p-3689821f.system.js","./p-4f718ef9.system.js","./p-e5dfccd8.system.js","./p-d938f42f.system.js","./p-01174496.system.js","./p-eb99a625.system.js"],(function(e){"use strict";var o,t,s,n,r,i,a,l,c,d,u,f,m,z,v,h,p;return{setters:[function(e){o=e.r;t=e.h;s=e.F;n=e.a;r=e.g},function(e){i=e.V;a=e.W;l=e.X;c=e.N;d=e.Y;u=e.Z;f=e.F},function(e){m=e.t},function(e){z=e.f;v=e.z},function(e){h=e.r},function(e){p=e.g},function(){},function(){},function(){}],execute:function(){var g='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" aria-hidden="true">\n <path fill="currentColor" fill-rule="evenodd" d="M4 5a3 3 0 0 0-3 3v8a3 3 0 0 0 3 3h16a3 3 0 0 0 3-3V8a3 3 0 0 0-3-3H4Zm16 2H4a1 1 0 0 0-1 1v1h18V8a1 1 0 0 0-1-1ZM2 11h20v3a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1v-3Zm6 4.5a1 1 0 0 1 1-1h2a1 1 0 0 1 0 2H9a1 1 0 0 1-1-1Z" clip-rule="evenodd"/>\n</svg>\n';var y=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:block;margin-bottom:var(--zonos-elements-font-size-xl)}:host .zonos--store-credit-container{background:-webkit-gradient(linear, left top, left bottom, from(var(--zonos-elements-gray-0)), to(var(--zonos-elements-gray-50)));background:linear-gradient(180deg, var(--zonos-elements-gray-0) 0%, var(--zonos-elements-gray-50) 100%);border:1px solid var(--zonos-elements-gray-200);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-8));-webkit-box-shadow:var(--zonos-elements-v3-shadow-base);box-shadow:var(--zonos-elements-v3-shadow-base);overflow:hidden;padding:0;position:relative}:host .zonos--store-credit-container::before{background:var(--zonos--primary-color, var(--zonos-elements-gray-400));content:"";height:3px;left:0;position:absolute;right:0;top:0}:host .zonos--store-credit-header{padding:var(--zonos-elements-radius-12) var(--zonos-elements-font-size-l) 0}:host .zonos--store-credit-title-row{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .zonos--store-credit-title-left{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-title-icon{-ms-flex-align:center;align-items:center;background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 14%, transparent);border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.75);display:-ms-flexbox;display:flex;-ms-flex-negative:0;flex-shrink:0;height:22px;-ms-flex-pack:center;justify-content:center;width:22px}:host .zonos--store-credit-balance-badge{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 8%, var(--zonos-elements-gray-50));border:1px solid color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 22%, var(--zonos-elements-gray-200));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:2px var(--zonos-elements-font-size-s)}:host .zonos--store-credit-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-s) var(--zonos-elements-font-size-l) var(--zonos-elements-radius-12)}:host .zonos--store-credit-checkbox{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex}:host .zonos--store-credit-options{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-toggle-row{display:-ms-flexbox;display:flex}:host .zonos--store-credit-custom-amount{max-width:240px}:host .zonos--store-credit-custom-amount-row{-ms-flex-align:end;align-items:flex-end;display:-ms-flexbox;display:flex;gap:var(--zonos-elements-font-size-s)}:host .zonos--store-credit-custom-amount-row zonos-input{-ms-flex:1;flex:1}:host .zonos--store-credit-error{margin-top:2px}:host .zonos--store-credit-summary{background:color-mix(in srgb, var(--zonos--primary-color, var(--zonos-elements-gray-400)) 6%, var(--zonos-elements-gray-50));border-radius:calc(var(--zonos--border-radius, var(--zonos-elements-radius-8)) * 0.65);padding:var(--zonos-elements-radius-10) var(--zonos-elements-font-size-s)}:host .zonos--store-credit-empty{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--zonos-elements-font-size-s);padding:var(--zonos-elements-font-size-xl) var(--zonos-elements-font-size-l) 22px;text-align:center}:host .zonos--store-credit-empty-icon{-ms-flex-align:center;align-items:center;background:var(--zonos-elements-gray-100);border-radius:50%;display:-ms-flexbox;display:flex;height:52px;-ms-flex-pack:center;justify-content:center;opacity:0.95;width:52px}';var x=y;var b="full";var w="custom";var k=e("zonos_store_credit",function(){function e(e){var t=this;o(this,e);this.enabled=true;this.customAmountInput="";this.handleUseStoreCreditChange=function(e){i(e);if(e){a(true)}void l()};this.handleAmountModeChange=function(e){var o=e===b;a(o);if(!o){t.customAmountInput=""}void l()};this.handleCustomAmountChange=function(e){t.customAmountInput=e;c.error=null};this.handleApplyCustomAmount=function(){var e=parseFloat(t.customAmountInput);if(!isNaN(e)&&e>0){d(e)}else{d(null)}if(!c.error){void l()}}}e.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,u()];case 1:e.sent();return[2]}}))}))};e.prototype.render=function(){var e=this;if(!this.enabled){return null}var o=v.appearance.colorPrimary;var r=p({});var i=c.availableBalance;var a=i!==null&&i>0;var l=c.isEnabled;var d=c.useFullBalance;var u=c.error;var y=f();var x=h({amount:i!==null&&i!==void 0?i:0,isForeign:true});return t(n,{class:"zonos--elements zonos--store-credit",style:{"--zonos--border-radius":r,"--zonos--font-family":z(),"--zonos--primary-color":o}},t("div",{class:"zonos--store-credit-container"},t("div",{class:"zonos--store-credit-header"},t("div",{class:"zonos--store-credit-title-row"},t("div",{class:"zonos--store-credit-title-left"},t("div",{"aria-hidden":"true",class:"zonos--store-credit-title-icon"},t("zonos-icon",{content:g,iconColor:"gray-500",size:22})),t("zonos-text",{type:"semiBoldLabel"},m("Store credit"))),a&&t("div",{class:"zonos--store-credit-balance-badge"},t("zonos-text",{textColor:"gray-600",type:"caption"},x)))),t(s,null,a?t("div",{class:"zonos--store-credit-content"},t("div",{class:"zonos--store-credit-checkbox"},t("zonos-checkbox",{isChecked:l,label:m("Use store credit"),onCheckboxSelected:function(o){return e.handleUseStoreCreditChange(o.detail)},size:16})),l&&t("div",{class:"zonos--store-credit-options"},t("div",{class:"zonos--store-credit-toggle-row"},t("zonos-toggle",{onToggleChanged:function(o){return e.handleAmountModeChange(o.detail)},options:[{label:m("Apply full balance"),value:b},{label:m("Enter amount"),value:w}],value:d?b:w})),!d&&t("div",{class:"zonos--store-credit-custom-amount"},t("div",{class:"zonos--store-credit-custom-amount-row"},t("zonos-input",{inputLabel:m("Enter amount"),inputValue:this.customAmountInput,isError:!!u,onInputChange:function(o){return e.handleCustomAmountChange(o.detail)}}),t("zonos-button",{onClick:this.handleApplyCustomAmount,size:"sm",variant:"primary"},m("Apply")))),u&&t("div",{class:"zonos--store-credit-error"},t("zonos-text",{textColor:"red-600",type:"caption"},u)),t("div",{class:"zonos--store-credit-summary"},t("zonos-text",{textColor:"gray-800",type:"semiBoldLabel"},m("Amount to apply: [amount]",{amount:h({amount:y,isForeign:true})}))))):t("div",{class:"zonos--store-credit-empty"},t("div",{"aria-hidden":"true",class:"zonos--store-credit-empty-icon"},t("zonos-icon",{content:g,iconColor:"gray-500",size:28})),t("zonos-text",{textColor:"gray-600",type:"caption"},m("No store credit available"))))))};Object.defineProperty(e.prototype,"el",{get:function(){return r(this)},enumerable:false,configurable:true});return e}());k.style=x}}}));
@@ -1 +0,0 @@
1
- System.register(["./p-77c2e465.system.js"],(function(n){"use strict";var t;return{setters:[function(n){t=n.l}],execute:function(){var r=n("D","gkjqw123");var u=n("T","Kq93wqw3");var e=n("h",(function(){var n;return(n=t.inclusivePricingConfigurations)===null||n===void 0?void 0:n.some((function(n){var t,e;return((t=n.configurations[r])===null||t===void 0?void 0:t.status)==="ENABLED"||((e=n.configurations[u])===null||e===void 0?void 0:e.status)==="ENABLED"}))}))}}}));
@@ -1 +0,0 @@
1
- import{r as o,e as s,h as t,a as e,F as n,d as i,g as a}from"./p-ce75b047.js";import{d as r,I as l,J as c,K as d,b as h,C as p,c as u,t as m,L as f,M as z,N as g,O as b,x as y,r as x,P as v,Q as k,D as w,R as C,H as L,S,T as I,U as _}from"./p-6987f9c9.js";import{t as D,l as B,s as A,c as j}from"./p-adb9827c.js";import{r as M}from"./p-cfb0059f.js";import{c as O}from"./p-9581bffb.js";import{c as T}from"./p-b4b7f705.js";import{z as E,h as N,g as P,f as $}from"./p-f3cfd8fa.js";import{D as R,T as Z,h as U}from"./p-becac995.js";import{s as F,c as H,a as V}from"./p-84dbf474.js";import{h as X,s as G,j as Y,g as W,i as q,a as K}from"./p-41dd1cb8.js";import{c as J}from"./p-595f5dd2.js";import{g as Q}from"./p-db3b101a.js";import{l as oo,b as so}from"./p-0a377722.js";import{l as to}from"./p-97aceb11.js";import{p as eo}from"./p-458df669.js";import{i as no}from"./p-d28be518.js";import{g as io}from"./p-b2d276e1.js";import{i as ao}from"./p-ae393255.js";import{u as ro}from"./p-367a72bc.js";import{c as lo}from"./p-0c64dbbb.js";import{s as co,a as ho}from"./p-63a383f4.js";import{e as po}from"./p-6b361d2b.js";import"./p-6d81901a.js";import"./p-4c89d04a.js";import"./p-ab0b23f2.js";import"./p-1d42cd20.js";const uo=class{constructor(s){o(this,s),this.errorImages=[]}render(){const o=s("./assets/empty-item.jpeg"),n=r.items.filter((o=>!o.isRestricted));return t(e,{key:"0533f9858716c5084f2f7d454038918dcea3f1d0",class:"zonos--cart-items zonos--elements"},t("table",{key:"9819698277a5c597528364d19b7c5c7c3161fdd7",class:"zonos--cart-table"},t("tbody",{key:"59493dfb49143a56f2addaf0c9eb1e8ce014dc1f"},n.map((s=>{const e=s.imageUrl,n=O(s.name),i=s.amount*s.quantity;return t("tr",{class:"zonos--cart-item"},t("td",{class:"zonos--column zonos--cart-item-image"},e&&!this.errorImages.includes(e)?t("img",{alt:s.name,onError:()=>{this.errorImages=[...this.errorImages,e]},src:s.imageUrl,style:{"min-width":"40px"},width:40}):t("img",{alt:s.name,src:o,width:40})),t("td",{class:"zonos--column zonos--cart-item-name"},t("div",null,n.map((o=>t("zonos-text",{type:"label"},o)))),t("zonos-text",{textColor:"gray-600",type:"caption"},D("Quantity"),": ",s.quantity)),t("td",{class:"zonos--column zonos--cart-item-price"},t("zonos-text",{type:"semiBoldLabel",weight:600},M({amount:i,isForeign:!1}))))})))))}static get assetsDirs(){return["assets"]}};uo.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column{padding:8px;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host .zonos--cart-table td{vertical-align:top}:host .zonos--cart-item-name{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:12px}:host .zonos--cart-item-name .zonos--cart-item-quantity>*{display:inline-block}:host .zonos--cart-item-price zonos-text{white-space:nowrap}:host img{min-width:40px;margin-top:6px}";const mo=class{constructor(s){o(this,s),this.hide=!1,this.errorImages=[],this.internalCollapsed=!0,this.firstRender=!0}componentDidLoad(){this.firstRender=!0}render(){var o;const n=s("./assets/empty-item.jpeg"),i=(null===(o=r.exchangeRate)||void 0===o?void 0:o.rate)||1,a=r.restrictedItems.length;return this.hide||0===a?null:(this.firstRender&&(this.internalCollapsed=l(),this.firstRender=!1),t(e,{class:T(["zonos--cart-restricted-items","zonos--elements",this.internalCollapsed&&"collapsed"])},t("button",{class:T(["zonos--cart-title-collapse-trigger",this.internalCollapsed&&"collapsed"]),onClick:()=>{this.internalCollapsed=!this.internalCollapsed}},t("div",{class:"zonos--title-wrapper"},t("zonos-text",{textColor:"red-600",type:"label"},`${D(this.internalCollapsed?"Show":"Hide")} ${a} ${D("restricted items")}`),t("zonos-icon",{content:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#filter0_dd_2052_3658)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M7.46967 14.5303C7.76256 14.8232 8.23744 14.8232 8.53033 14.5303L12.5 10.5607L16.4697 14.5303C16.7626 14.8232 17.2374 14.8232 17.5303 14.5303C17.8232 14.2374 17.8232 13.7626 17.5303 13.4697L13.0303 8.96967C12.7374 8.67678 12.2626 8.67678 11.9697 8.96967L7.46967 13.4697C7.17678 13.7626 7.17678 14.2374 7.46967 14.5303Z" fill="currentColor"/>\n</g>\n<defs>\n<filter id="filter0_dd_2052_3658" x="-3.5" y="-2" width="32" height="32" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="2"/>\n<feGaussianBlur stdDeviation="2"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2052_3658"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="1"/>\n<feGaussianBlur stdDeviation="1"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0"/>\n<feBlend mode="normal" in2="effect1_dropShadow_2052_3658" result="effect2_dropShadow_2052_3658"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_2052_3658" result="shape"/>\n</filter>\n</defs>\n</svg>\n',iconColor:"red-600"}))),t("zonos-collapse",{collapsed:this.internalCollapsed},t("zonos-banner",{bannerTitle:D("The following items are unable to be shipped to your country and are not included in your cart total."),intent:"error"}),t("table",{class:"zonos--cart-table"},t("tbody",null,r.restrictedItems.map(((o,s)=>{var e,a;const r=o.imageUrl;return t("tr",{class:"zonos--cart-item"},t("td",{class:"zonos--column zonos--cart-item-image"},r&&!this.errorImages.includes(r)?t("img",{alt:(null===(e=o.matchedItem)||void 0===e?void 0:e.name)||o.name||`Restricted item ${s+1}`,onError:()=>{this.errorImages=[...this.errorImages,r]},src:r,style:{"min-width":"40px"},width:40}):t("img",{alt:o.name||`Restricted item ${s+1}`,src:n,width:40})),t("td",{class:"zonos--column zonos--cart-item-name"},t("zonos-text",{type:"label"},(null===(a=o.matchedItem)||void 0===a?void 0:a.name)||o.name),t("zonos-text",{type:"caption"},o.restriction.reason)),t("td",{class:"zonos--column zonos--cart-item-price"},t("zonos-text",{type:"semiBoldLabel"},M({amount:o.amount*o.quantity*i,isForeign:!1}))))})))))))}static get assetsDirs(){return["assets"]}};mo.style=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{overflow:auto;position:relative}:host zonos-banner{margin-bottom:12px}:host .zonos--cart-title-collapse-trigger{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:24px;-ms-flex-align:center;align-items:center;background:var(--zonos-elements-gray-0);width:100%;border:none;cursor:pointer;margin-bottom:16px;position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-transition:0.5s all ease;transition:0.5s all ease}:host .zonos--cart-title-collapse-trigger zonos-icon{-webkit-transition:-webkit-transform 0.3s ease;transition:-webkit-transform 0.3s ease;transition:transform 0.3s ease;transition:transform 0.3s ease, -webkit-transform 0.3s ease}:host .zonos--cart-title-collapse-trigger.collapsed{margin-bottom:0}:host .zonos--cart-title-collapse-trigger.collapsed zonos-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host .zonos--cart-title-collapse-trigger::before,:host .zonos--cart-title-collapse-trigger::after{content:"";display:block;width:80%;height:1px;background-color:var(--zonos-elements-border-color);-ms-flex-negative:1;flex-shrink:1}:host .zonos--cart-title-collapse-trigger .zonos--title-wrapper{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:row;flex-direction:row;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--cart-table{opacity:0.5;width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column{padding:8px;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host img{min-width:40px}:host(.collapsed){-ms-flex-negative:0;flex-shrink:0}';const fo=/\[([^\]]+)\]\((https?:\/\/(?:[^\s()]|\([^\s()]*\))+)\)|(https?:\/\/[^\s]+)/g,zo=/[.,;:!?\]}"']+$/,go=class{constructor(s){o(this,s),this.loading=!1,this.getInclusivePriceType=()=>{var o,s;const t=B.inclusivePricingConfigurations.find(Boolean),e="ENABLED"===(null===(o=null==t?void 0:t.configurations[R])||void 0===o?void 0:o.status),n="ENABLED"===(null===(s=null==t?void 0:t.configurations[Z])||void 0===s?void 0:s.status);return e&&n?"DUTY_TAX_AND_FEE":e?"DUTY_AND_FEE":n?"TAX":null},this.renderMessageLine=o=>(o=>{var s,t;const e=[];fo.lastIndex=0;let n,i=0;for(;null!==(n=fo.exec(o));){n.index>i&&e.push({type:"text",value:o.slice(i,n.index)});const[,a,r,l]=n;if(r&&a)e.push({href:r,text:a,type:"link"});else if(l){const o=null!==(t=null===(s=l.match(zo))||void 0===s?void 0:s[0])&&void 0!==t?t:"",n=o?l.slice(0,l.length-o.length):l;e.push({href:n,text:n,type:"link"}),o&&e.push({type:"text",value:o})}i=fo.lastIndex}return i<o.length&&e.push({type:"text",value:o.slice(i)}),e})(o).map((o=>"link"===o.type?t("zonos-link",{href:o.href,rel:"noopener noreferrer",target:"_blank"},o.text):o.value)),this.renderCustomMessage=()=>{const o=r.customMessage.filter((o=>!!o.trim()));return o.length?t("tr",{class:"zonos--row zonos--cart-custom-message"},t("td",{class:"zonos--column"}),t("td",{class:"zonos--column",colSpan:2},t("zonos-banner",{intent:"info"},t("zonos-text",{type:"boldLabel"},o.map(((o,s)=>t(n,null,s>0&&t("br",null),this.renderMessageLine(o)))))))):null},this.getCartSubtotalSubtitle=()=>{const o=this.getInclusivePriceType();return"DUTY_AND_FEE"===o?t("zonos-text",{class:"zonos--caption",type:"caption"},D("Duties and fees included")):"TAX"===o?t("zonos-text",{class:"zonos--caption",type:"caption"},D("Taxes included")):null}}render(){var o,s,i,a,p;const u="customer-info"===r.step?r.subtotal+r.adjustmentTotal:r.total,m="payment"===r.step||"shipping"===r.step,f=l()?u:0,z=l()?r.subtotal:0,g=!r.shouldHideDiscountInput&&"customer-info"!==r.step,b=null===(p=null===(a=null===(i=null===(s=null===(o=r.landedCostData)||void 0===o?void 0:o.find(Boolean))||void 0===s?void 0:s.landedCost.appliedAdjustments)||void 0===i?void 0:i.find((o=>{var s;return"PROMO_CODE"===(null===(s=o.adjustment)||void 0===s?void 0:s.source)})))||void 0===a?void 0:a.adjustment)||void 0===p?void 0:p.name,y=async()=>{r.promoCodeApplied=!0,r.promoCodeError=!1,this.loading=!0,await c(),this.loading=!1},x=async()=>{r.promoCodeError=!1,this.loading=!0,await d(),this.loading=!1};return t(e,{class:"zonos--cart-subtotal zonos--elements"},t("table",{class:"zonos--cart-table"},t("tr",{class:"zonos--row zonos--cart-subtotal"},t("td",{class:"zonos--column"}),t("td",{class:"zonos--column zonos--cart-subtotal-title"},t("zonos-text",{type:"semiBoldLabel"},D("Cart subtotal")),t("zonos-text",{class:"zonos--caption",type:"caption"},this.getCartSubtotalSubtitle())),t("td",{class:"zonos--column zonos--cart-subtotal-price"},t("zonos-text",{type:"semiBoldLabel"},M({amount:z,isForeign:!0})))),t("tr",{class:"zonos--row zonos--cart-shipping"},t("td",{class:"zonos--column"}),t("td",{class:"zonos--column zonos--cart-subtotal-title"},r.selectedShippingOption&&"customer-info"!==r.step?t(n,null,t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},r.selectedShippingOption.displayName),r.selectedShippingOptionTransitTime&&t("zonos-text",{class:"zonos--caption",type:"caption"},r.selectedShippingOptionTransitTime)):t(n,null,t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},D("Shipping")),t("zonos-text",{class:"zonos--caption",type:"caption"},D("No shipping method selected")))),t("td",{class:"zonos--column zonos--cart-subtotal-price"},r.shipping?M({amount:r.shipping,isForeign:!0}):"-")),m&&t("tr",{class:"zonos--row zonos--cart-duties"},t("td",{class:"zonos--column"}),(()=>{var o,s,e;if(U()){const o=this.getInclusivePriceType();return o?"TAX"===o?t(n,null,t("td",{class:"zonos--column zonos--cart-subtotal-title zonos--landed-cost"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},D("Duties and fees")),t("zonos-text",{class:"zonos--caption",type:"caption"},D("Nothing due at the door"))),t("td",{class:"zonos--column zonos--cart-subtotal-price zonos--landed-cost"},t("div",{class:"zonos--cart-duty-tax-price"},null!==r.dutiesTaxesFees?M({amount:r.dutiesTaxesFees,isForeign:!0}):"-"))):"DUTY_AND_FEE"===o?t(n,null,t("td",{class:"zonos--column zonos--cart-subtotal-title zonos--landed-cost"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},D("Taxes"))),t("td",{class:"zonos--column zonos--cart-subtotal-price zonos--landed-cost"},t("div",{class:"zonos--cart-duty-tax-price"},null!==r.dutiesTaxesFees?M({amount:r.dutiesTaxesFees,isForeign:!0}):"-"))):t(n,null,t("td",{class:"zonos--column zonos--cart-subtotal-title zonos--landed-cost"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},D("Duties, taxes, and fees")),t("zonos-text",{class:"zonos--caption",type:"caption"},D("The purchase price covers duties, taxes and fees."))),t("td",{class:"zonos--column zonos--cart-subtotal-price zonos--landed-cost"},t("div",{class:"zonos--cart-duty-tax-price"},"-"))):null}return(null===(s=null===(o=E.genericSettings)||void 0===o?void 0:o.domesticCountries)||void 0===s?void 0:s.includes((null===(e=h.stripeAddressEventData)||void 0===e?void 0:e.value.address.country)||"US"))?t(n,null,t("td",{class:"zonos--column zonos--cart-subtotal-title zonos--landed-cost"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},D("Taxes and fees"))),t("td",{class:"zonos--column zonos--cart-subtotal-price zonos--landed-cost"},t("div",{class:"zonos--cart-duty-tax-price"},null!==r.dutiesTaxesFees||null!==r.dutiesTaxesFeesEstimate?M({amount:r.dutiesTaxesFees||r.dutiesTaxesFeesEstimate||0,isForeign:!0}):"-"))):"DAP"===r.landedCostMethod?t(n,null,t("td",{class:"zonos--column zonos--cart-subtotal-title zonos--landed-cost"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},D("Duties, taxes, and fees")),null!==r.dutiesTaxesFeesEstimate?`${D("Estimated [amount]",{amount:M({amount:r.dutiesTaxesFeesEstimate,isForeign:!0})})}`:"-"),t("td",{class:"zonos--column zonos--cart-subtotal-price zonos--landed-cost"},t("div",{class:"zonos--cart-duty-tax-price"},D("Due at delivery")))):t(n,null,t("td",{class:"zonos--column zonos--cart-subtotal-title zonos--landed-cost"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},D("Duties, taxes, and fees")),t("zonos-text",{class:"zonos--caption",type:"caption"},D("Nothing due at the door"))),t("td",{class:"zonos--column zonos--cart-subtotal-price zonos--landed-cost"},t("div",{class:"zonos--cart-duty-tax-price"},null!==r.dutiesTaxesFees?M({amount:r.dutiesTaxesFees,isForeign:!0}):"-")))})()),g&&t("tr",{class:"zonos--row zonos--cart-promo-code"},t("td",{class:"zonos--column"}),b?t(n,null,t("td",{class:"zonos--column zonos--cart-promo-code-col"},this.loading?t("zonos-spinner",{size:16}):t("zonos-badge",{dismissHandler:()=>x()},r.promoCode)),t("td",{class:"zonos--column zonos--cart-promo-code-col"})):t("td",{class:"zonos--column zonos--cart-promo-code-col",colSpan:2},t("div",{class:"zonos--cart-promo-code-input-wrapper"},t("zonos-input",{class:"zonos--cart-promo-code-input",inputLabel:D("Add promotional code"),inputValue:r.promoCode,isError:r.promoCodeError,onInputChange:o=>r.promoCode=o.detail.trim(),onKeyDown:o=>{"Enter"===o.key&&y()}}),t("zonos-button",{loading:this.loading,onClick:()=>y(),variant:"primary"},D("Apply"))))),!!r.adjustmentTotal&&t("tr",{class:"zonos--row zonos--cart-discount"},t("td",{class:"zonos--column"}),t("td",{class:"zonos--column zonos--cart-subtotal-title"},t("div",{class:"zonos--title-with-icon"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},D("Discounts")))),t("td",{class:"zonos--column zonos--cart-subtotal-price"},t("zonos-text",{type:"semiBoldLabel"},M({amount:r.adjustmentTotal,isForeign:!0})))),!!r.storeCredit&&t("tr",{class:"zonos--row zonos--cart-store-credit"},t("td",{class:"zonos--column"}),t("td",{class:"zonos--column zonos--cart-subtotal-title"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},D("Store credit"))),t("td",{class:"zonos--column zonos--cart-subtotal-price"},t("zonos-text",{textColor:"green-600",type:"semiBoldLabel"},"-",M({amount:r.storeCredit,isForeign:!0})))),t("tr",{class:"zonos--row zonos--cart-pay-total"},t("td",{class:"zonos--column"}),t("td",{class:"zonos--column"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},D("Order total"))),t("td",{class:"zonos--column zonos--cart-total-price"},t("zonos-text",{type:"semiBoldLabel"},M({amount:f,isForeign:!0})))),this.renderCustomMessage()))}static get assetsDirs(){return["assets"]}};go.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column{padding:20px 8px;vertical-align:top}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--cart-subtotal-title,:host .zonos--cart-subtotal-price,:host .zonos--cart-promo-code-col{border-bottom:1px solid var(--zonos-elements-gray-200)}:host .zonos--cart-duty-tax-price{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:flex-end;gap:5px}:host .zonos--cart-subtotal-price{text-align:right}:host .zonos--cart-subtotal-price zonos-text{white-space:nowrap}:host .zonos--cart-subtotal-price zonos-text,:host .zonos--cart-pay-total zonos-text{white-space:nowrap}:host .zonos--cart-promo-code-input-wrapper{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}:host .zonos--cart-promo-code-input{-ms-flex:1;flex:1}:host .zonos--cart-custom-message .zonos--column:last-child{padding:0 8px;width:auto;text-align:left}:host .zonos--cart-custom-message zonos-banner{padding:12px;border-radius:var(--zonos-elements-radius-6)}";const bo=class{constructor(s){o(this,s),this.closeClick=i(this,"closeClick",7),this.borderRadius="ROUNDED",this.isLoading=!0,this.notificationType="success",this.notificationTitle="",this.notificationMessages=[],this.notificationActionText=D("Keep shopping"),this.order=null,this.isWaitingToRedirect=!0,this.isImmediateRedirecting=!1,this.pullOrder=async()=>{var o,s;const t=A.checkoutSessionId,e=new URLSearchParams;e.set("checkoutSessionId",t||"");const{baseUrl:n,errors:i,json:a}=await X(`/api/zonos-elements/get-order?${e.toString()}`);return i.length||!(null==a?void 0:a.id)?{baseUrl:n,order:null}:(await(null===(s=(o=E.checkoutSettings).onOrderSuccess)||void 0===s?void 0:s.call(o,{zonosApiRoute:n,zonosOrder:a})),{baseUrl:n,order:a})},this.buildPurchaseMetadata=({checkoutSessionId:o,currency:s})=>{var t,e,n,i,a,l;const c=r.items.filter((o=>o.amount>=0)).map((o=>({item_id:o.sku||o.productId||o.name,item_name:o.name,price:o.amount,quantity:o.quantity}))),d=(null===(t=r.checkoutSession)||void 0===t?void 0:t.subtotals.items)||(null===(e=this.order)||void 0===e?void 0:e.amountSubtotals.items),h=(null===(n=r.checkoutSession)||void 0===n?void 0:n.subtotals.presentmentCurrencyCode)||(null===(i=this.order)||void 0===i?void 0:i.currencyCode)||(null==s?void 0:s.toUpperCase()),p=c.reduce(((o,s)=>o+s.price*s.quantity),0),u=null===(a=r.items.find(Boolean))||void 0===a?void 0:a.currencyCode,m=(null===(l=this.order)||void 0===l?void 0:l.id)||o||(new Date).getTime().toString();return h&&d?{currency:h,items:c,transaction_id:m,value:d}:u&&p?{currency:u,items:c,transaction_id:m,value:p}:{currency:void 0,items:c,transaction_id:m,value:void 0}},this.redirectToUrl=o=>{p(),A.checkoutSessionId=null,window.parent&&(window.parent.location.href=o),window.location.href=o},this.isRedirectBehavior=()=>{const{successBehavior:o,successRedirectUrl:s}=E.checkoutSettings;return"REDIRECT_TO_SUCCESS_PAGE"===o||"CLOSE_MODAL"===o&&!!s||!!r.externalConfirmationPageURL},this.shouldRenderKeepShoppingButton=()=>!this.isRedirectBehavior()&&"success"===this.notificationType,this.shouldRenderCloseButtonForRedirectBehavior=()=>this.isRedirectBehavior()||"error"===this.notificationType,this.redirectToMerchantSuccessPage=()=>{var o,s,t,e;const n=r.externalConfirmationPageURL||E.checkoutSettings.successRedirectUrl,i=new URLSearchParams,a=null===(o=this.order)||void 0===o?void 0:o.id,l=(null===(e=null===(t=null===(s=this.order)||void 0===s?void 0:s.references)||void 0===t?void 0:t.find((o=>"zonosOrderNumber"===(null==o?void 0:o.key))))||void 0===e?void 0:e.value)||null;a&&i.set("zOrderNumber",a),l&&i.set("orderId",l);const c=i.toString(),d=n.includes("?");this.isWaitingToRedirect=!0,this.redirectToUrl(c?`${n}${d?"&":"?"}${c}`:n)},this.redirectToCloseModalSuccessPage=()=>{const o=E.checkoutSettings.successRedirectUrl,s=A.checkoutSessionId;if(this.isWaitingToRedirect=!0,s)try{const t=new URL(o);t.searchParams.set("zonosCheckoutSessionId",s),this.redirectToUrl(t.toString())}catch(t){const e=o.indexOf("#"),n=-1===e?o:o.slice(0,e),i=-1===e?"":o.slice(e),a=n.includes("?")?"&":"?",r=`zonosCheckoutSessionId=${encodeURIComponent(s)}`;this.redirectToUrl(`${n}${a}${r}${i}`)}else this.redirectToUrl(o)},this.handleSuccessBehavior=async()=>{this.saveOrderIdForDuplicationIssue();const{successBehavior:o,successRedirectUrl:s}=E.checkoutSettings;switch(!0){case"CLOSE_MODAL"===o&&!!s&&!r.externalConfirmationPageURL:this.isWaitingToRedirect=!0,this.isImmediateRedirecting=!0,this.redirectToCloseModalSuccessPage();break;case"REDIRECT_TO_SUCCESS_PAGE"===o:case!!r.externalConfirmationPageURL:if(this.notificationTitle=D("Order complete!"),this.notificationMessages=[D("Your order has been successfully placed."),D("You will be redirected back to the merchant's site in a few seconds.")],this.isLoading=!1,this.isWaitingToRedirect=!0,this.useOverrideSuccessNotification(),await this.getPullOrder(),!this.order)return oo("=== Order info not found, not redirecting, hide spinner for close button","error"),void(this.isWaitingToRedirect=!1);this.isWaitingToRedirect=!1,this.redirectToMerchantSuccessPage();break;default:this.useOverrideSuccessNotification(),this.isLoading=!1,"function"==typeof E.checkoutSettings.onOrderSuccess&&await this.getPullOrder()}},this.getPullOrder=async(o=0)=>{var s,t;0===o&&oo("=== Start to poll for order info","info");const{baseUrl:e,order:n}=await this.pullOrder(),{isLegacyCheckout:i}=window.Zonos,a=!!(null===(t=null===(s=null==n?void 0:n.references)||void 0===s?void 0:s.find((o=>"zonosOrderNumber"===(null==o?void 0:o.key))))||void 0===t?void 0:t.value),r=A.checkoutSessionId,l=parseFloat(new URLSearchParams(window.location.search).get("maxPollingRetries")||"0")||30;if(oo(`=== Polling order (${o} attemps)`,"info"),n&&!i||n&&o>=l||a){if(oo("=== Order info found","info"),i&&n&&!a)return void G({endpoint:`${e}/api/zonos-elements/get-order?checkoutSessionId=${r}&orderId=${n.id}`,errors:[`Order found but legacy order number doesn't exist after ${l} attempts`],metadata:{allLogs:so,checkoutSessionId:A.checkoutSessionId||"",orderId:n.id,storeId:E.storeId}});o>10&&G({endpoint:`${e}/api/zonos-elements/get-order?checkoutSessionId=${r}&orderId=${n.id}`,errors:[`Order found after ${o} attempts`],metadata:{allLogs:so,checkoutSessionId:A.checkoutSessionId||"",orderId:n.id,storeId:E.storeId}}),this.order=n}else n&&a||!(o<l)?G({endpoint:`${e}/api/zonos-elements/get-order?checkoutSessionId=${r}`,errors:[`Order not found after ${l} attempts`],metadata:{allLogs:so,checkoutSessionId:A.checkoutSessionId||"",storeId:E.storeId}}):(await new Promise((o=>setTimeout(o,1e3))),await this.getPullOrder(o+1))},this.useOverrideSuccessNotification=()=>{const{successPageSubtitleText:o,successPageTitleText:s}=E.checkoutSettings;s&&(this.notificationTitle=s),o&&(this.notificationMessages=o)},this.checkStripePaymentStatus=async()=>{const o=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||h.clientSecret;if(o||this.storybookForceStatus){const{currency:s,error:t,messages:e,status:n}=await u({clientSecret:o,storybookForceStatus:this.storybookForceStatus}),i="requires_action"===n||t;this.notificationType=i?"error":"success",this.notificationMessages=e||[],this.notificationTitle=D(i?"Payment failed":"You're all set!"),oo("=== Payment intent retrieve status","info",{clientSecret:o,error:t,messages:e,status:n});const a=new URL(window.location.href);if(a.searchParams.delete("payment_intent_client_secret"),a.searchParams.delete("payment_intent"),a.searchParams.delete("redirect_status"),a.searchParams.delete("zonosCheckoutSessionId"),window.history.replaceState({},"",a.toString()),t&&(null==e?void 0:e.length))F({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:A.checkoutSessionId}}),G({endpoint:"Stripe payment failed",errors:[`Payment intent "${o.split("_secret_")[0]}" status: ${n} - checkout session: ${A.checkoutSessionId}`],metadata:{allLogs:so,credentialToken:window.Zonos.zonosApiKey}});else{this.saveOrderIdForDuplicationIssue();const o=A.checkoutSessionId;F({event:"zonos-checkout-success",metadata:this.buildPurchaseMetadata({checkoutSessionId:o||"",currency:null==s?void 0:s.toUpperCase()})}),F({event:"purchase",metadata:this.buildPurchaseMetadata({checkoutSessionId:o||"",currency:null==s?void 0:s.toUpperCase()})}),m({checkoutSessionId:o,eventName:"checkout_orderCompleted"});const t=J("zonos-checkout-success",{message:"Zonos Checkout successfully processed order"});document.dispatchEvent(t),await this.handleSuccessBehavior()}}this.isLoading=!1,f(),p(),A.checkoutSessionId=null},this.checkStagingOrderStatus=async()=>{this.notificationType="success",this.notificationTitle=D("You're all set!"),this.notificationMessages=z("succeeded").messages,this.useOverrideSuccessNotification(),await this.handleSuccessBehavior(),f(),p(),H(),A.checkoutSessionId=null},this.checkPaypalPaymentStatus=async()=>{if(V.paypalErrorMessage)return this.notificationType="error",this.notificationTitle=D("Payment failed"),this.notificationMessages=[V.paypalErrorMessage],void(this.isLoading=!1);this.isLoading=!1,V.orderIdCreated&&(F({event:"zonos-checkout-success",metadata:this.buildPurchaseMetadata({checkoutSessionId:A.checkoutSessionId||""})}),F({event:"purchase",metadata:this.buildPurchaseMetadata({checkoutSessionId:A.checkoutSessionId||""})}),m({checkoutSessionId:A.checkoutSessionId,eventName:"checkout_orderCompleted"}),this.notificationType="success",this.notificationTitle=D("You're all set!"),this.notificationMessages=z("succeeded").messages,this.useOverrideSuccessNotification(),await this.handleSuccessBehavior()),f(),p(),H(),A.checkoutSessionId=null},this.checkStoreCreditOrderStatus=async()=>{if(this.isLoading=!1,g.orderIdCreated){const o=A.checkoutSessionId;F({event:"zonos-checkout-success",metadata:this.buildPurchaseMetadata({checkoutSessionId:o||""})}),F({event:"purchase",metadata:this.buildPurchaseMetadata({checkoutSessionId:o||""})}),m({checkoutSessionId:o,eventName:"checkout_orderCompleted"}),this.notificationType="success",this.notificationTitle=D("You're all set!"),this.notificationMessages=z("succeeded").messages,this.useOverrideSuccessNotification();const s=J("zonos-checkout-success",{message:"Zonos Checkout successfully processed order"});document.dispatchEvent(s),await this.handleSuccessBehavior()}f(),p(),H(),b(),A.checkoutSessionId=null},this.closeClickHandler=()=>{this.closeClick.emit()},this.saveOrderIdForDuplicationIssue=()=>{var o,s,t,e;const n=Y(localStorage.getItem("zonos--placed-order-info")),i={cartId:window.Zonos.cartId||null,checkoutSessionId:(null==n?void 0:n.checkoutSessionId)||A.checkoutSessionId||"",orderId:(null===(o=this.order)||void 0===o?void 0:o.id)||null,time:(null==n?void 0:n.time)||Date.now(),zonosOrderNumber:(null===(e=null===(t=null===(s=this.order)||void 0===s?void 0:s.references)||void 0===t?void 0:t.find((o=>"zonosOrderNumber"===o.key)))||void 0===e?void 0:e.value)||null};localStorage.setItem("zonos--placed-order-info",JSON.stringify(i))}}componentDidLoad(){if(localStorage.removeItem("zonos--placed-order-info"),this.overrideNotification)return this.notificationType=this.overrideNotification.type,this.notificationTitle=this.overrideNotification.title,this.notificationMessages=this.overrideNotification.messages,void(this.isLoading=!1);r.isStagingMode?this.checkStagingOrderStatus():g.orderIdCreated?this.checkStoreCreditOrderStatus():V.orderIdCreated?this.checkPaypalPaymentStatus():this.checkStripePaymentStatus()}render(){const o=W();return t(e,{key:"3df50a75327f2dd1d7eea538aed0501c96504f2d",class:"zonos--checkout-finish zonos--elements",style:{"--zonos--border-radius":Q({overrideBorderStyle:this.borderRadius})}},this.isImmediateRedirecting&&t("div",{key:"6031b9b4d5847bb46a201ccf7f6b1cd036b3e3df",class:"loading-wrapper"},t("zonos-spinner",{key:"e816086c5efdfe8c1b40ce0bad935ef829a8f88d",size:48})),!this.isLoading&&!this.isImmediateRedirecting&&t("div",{key:"c787a355834af35a53f09f51f97c6796fa25c345",class:"zonos--finish-details"},t("div",{key:"a2a4bd3caee1cbffd514dcd69927a0f8a4e20af1",class:"zonos--group"},t("zonos-icon","success"===this.notificationType?{"aria-label":"Order success",content:'<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>',iconColor:"blue-800",size:50}:{"aria-label":"Order failed",content:'<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>',iconColor:"red-800",size:50}),t("zonos-text",{key:"894069f110eab9cb02fe4dfa814d7c285dadf7cb",class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),t("zonos-text",{key:"95bee491e9ac903a594569c911a81c63ebfab691",class:"zonos--subtitle",textColor:"gray-600"},this.notificationMessages.map((o=>t(n,null,o,t("br",null))))),this.shouldRenderCloseButtonForRedirectBehavior()&&t("zonos-button",{key:"cf10c1bdfe95c5a13a2714fc7d64042fa7ef49ac",loading:this.isWaitingToRedirect&&"error"!==this.notificationType,onClick:()=>{var o;(null===(o=this.order)||void 0===o?void 0:o.id)?this.redirectToMerchantSuccessPage():this.closeClickHandler()},size:"md",variant:"primary"},D("Close")),!window.Zonos.isLegacyCheckout&&this.shouldRenderKeepShoppingButton()&&t("zonos-button",{key:"cc9da3752636dbf9ecd3446fb787074cb1fa725b",onClick:()=>this.closeClickHandler(),size:"md",variant:"primary"},this.notificationActionText)),o&&"finish"===r.step&&"success"===this.notificationType&&t("div",{key:"f61fedefbfcf3650377bfd2e1a86d7feb4129b12",class:"zonos--finish-button-wrapper"},t("zonos-button",{key:"fa794be3da7f480bc3682a2e932ee1f876ac5bb2",backgroundColor:"gray-0",buttonColor:"gray-1000",onClick:()=>this.closeClickHandler(),size:"lg",variant:"outline"},"New test cart"),t("zonos-button",{key:"5bbff8ed5b5c585dd1a4ca8e2d206d48fb080f39",onClick:()=>{const o=window.location.hostname.includes("dashboard.zonos.com");this.redirectToUrl(o?"/orders/all":"https://dashboard.zonos.com/orders/all")},size:"lg",variant:"primary"},"View order in Dashboard"))))}static get assetsDirs(){return["assets"]}};bo.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}: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:20px}:host .zonos--finish-details{max-width:536px;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--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}";const yo=class{constructor(s){o(this,s),this.mobile=!1,this.showLanguageDialog=!1,this.isMobile=!1}handleGlobalClick(o){!this.el.contains(o.target)&&this.showLanguageDialog&&(this.showLanguageDialog=!1)}toggleLanguageDialog(){this.showLanguageDialog=!this.showLanguageDialog}handleMobileChange(){this.isMobile=q(this.mobile)}componentWillLoad(){this.isMobile=q(this.mobile)}render(){var o;const s=null===(o=to.find((o=>o.code===B.selectedLocale)))||void 0===o?void 0:o.label,n="LIGHT"!==this.dataTheme||this.mobile?"gray-1000":"gray-0";return t(e,{key:"ec472ed419e634f96630332398ff6e814dcd0391",class:T(["zonos--elements",this.isMobile&&"mobile"])},t("div",{key:"d29154eb86046ddd440460343b3b115d3e23c87d",class:"zonos--checkout-footer"},t("div",{key:"b0bb0fed3cc0b228fb1a80c6b27a3aaa84081b95",class:"zonos--checkout-locale-wrapper"},t("zonos-button",{key:"d6ef4aa2d32a04a5d27c8085471a85970a24dbed",buttonColor:n,class:"zonos--checkout-footer-language-button",icon:t("zonos-icon",{"aria-label":"Language select",content:'<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',iconColor:n}),onClick:()=>this.toggleLanguageDialog(),variant:"subtle"},t("span",{key:"6e7d935c324465ad501a28388d71ad73fba9c74f",class:"zonos--checkout-locale-label"},s,t("zonos-icon",{key:"5041eee50cd91210e6c1d4257f66b63e76ce9e4a","aria-hidden":"true",class:"zonos--checkout-locale-chevron",content:'<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>',iconColor:n,size:18}))),t("div",{key:"87b4b4b6fe789592d61dd7e69944b433c0bc0cf2",class:T(["zonos--checkout-footer-dialog",this.showLanguageDialog&&"zonos--checkout-footer-dialog-open"])},t("zonos-language-select",{key:"de8bd0ba1085564c2fe40c2d261e74ec9f67da90",handleOnClose:()=>this.toggleLanguageDialog()}))),t("div",{key:"7c3954550c4512b2d83fbafe05b57a44f0501991",class:"zonos--checkout-footer-icon-wrapper"},t("a",{key:"7bf2b74683ee81e8aa5ed5c0175ba22b8e8b5d6e",href:"https://zonos.com/docs/legal/zonos-privacy-policy",target:"_blank"},t("zonos-text",{key:"c39c00e77f47dbc1d47f69003cdb5c5f17c7a4e4",textColor:n},"Privacy policy")),t("div",{key:"567940865a03b6dce5273d70fb85860c042f9068",class:"zonos--checkout-footer-logo"},t("zonos-text",{key:"e3a0727029aa676e68c2a9a174c64188f7ab029e",textColor:n},"Powered by"),t("a",{key:"5a7f20a70efee92be700365818004f86827cc373",href:"https://zonos.com",target:"_blank",title:"Zonos website"},t("zonos-icon",{key:"c4a61b660e474064c35626744cad44e598206179",autoHeight:!0,content:'<svg width="408" height="112" viewBox="0 0 408 112" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M185.6 25.2H141.6C140.716 25.2 140 25.9164 140 26.8V36.4C140 37.2837 140.716 38 141.6 38H167.413C168.07 38 168.447 38.7478 168.056 39.2758L140.627 76.3519C140.22 76.9028 140 77.5699 140 78.2551V85.2001C140 86.0837 140.716 86.8 141.6 86.8H185.6C186.484 86.8 187.2 86.0837 187.2 85.2001V75.6C187.2 74.7164 186.484 74 185.6 74H159.787C159.13 74 158.753 73.2523 159.144 72.7243L186.573 35.6482C186.98 35.0973 187.2 34.4302 187.2 33.745V26.8C187.2 25.9164 186.484 25.2 185.6 25.2Z" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M212.8 24.8C203.08 24.8 195.2 32.6798 195.2 42.4V69.6C195.2 79.3203 203.08 87.2001 212.8 87.2001H224.8C234.52 87.2001 242.4 79.3203 242.4 69.6V42.4001C242.4 32.6798 234.52 24.8 224.8 24.8H212.8ZM212.8 37.6C210.149 37.6 208 39.7491 208 42.4001V69.6C208 72.251 210.149 74.4001 212.8 74.4001H224.8C227.451 74.4001 229.6 72.251 229.6 69.6V42.4C229.6 39.7491 227.451 37.6 224.8 37.6H212.8Z" fill="white"/>\n<path d="M250.4 27.5223V85.3983C250.4 86.282 251.116 86.9983 252 86.9983H261.6C262.484 86.9983 263.2 86.282 263.2 85.3983V48.1873C263.2 46.3171 264.286 44.6172 265.983 43.8314L277.983 38.2759C281.164 36.8032 284.8 39.1263 284.8 42.6317V85.3983C284.8 86.282 285.516 86.9983 286.4 86.9983H296C296.884 86.9983 297.6 86.282 297.6 85.3983V42.6209C297.6 29.7687 284.272 21.2506 272.608 26.6484L264.318 30.4847C263.659 30.7898 262.877 30.6125 262.414 30.053L259.954 27.0817C259.346 26.3474 258.443 25.9223 257.489 25.9223H252C251.116 25.9223 250.4 26.6387 250.4 27.5223Z" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M323.2 24.8C313.48 24.8 305.6 32.6798 305.6 42.4V69.6C305.6 79.3203 313.48 87.2001 323.2 87.2001H335.2C344.92 87.2001 352.8 79.3203 352.8 69.6V42.4001C352.8 32.6798 344.92 24.8 335.2 24.8H323.2ZM323.2 37.6C320.549 37.6 318.4 39.7491 318.4 42.4001V69.6C318.4 72.251 320.549 74.4001 323.2 74.4001H335.2C337.851 74.4001 340 72.251 340 69.6V42.4C340 39.7491 337.851 37.6 335.2 37.6H323.2Z" fill="white"/>\n<path d="M378.101 25.2H391.708C400.706 25.2 408 32.4944 408 41.4925C408 42.2395 407.444 42.8696 406.703 42.9622L396.602 44.2249C395.857 44.3179 395.2 43.7376 395.2 42.9876C395.2 40.2331 392.967 38 390.212 38H378.921C375.982 38 373.6 40.3822 373.6 43.3207C373.6 45.8196 375.339 47.9818 377.78 48.5176L394.22 52.1264C402.267 53.8928 408 61.021 408 69.2593C408 78.9468 400.147 86.8 390.459 86.8H377.092C368.094 86.8 360.8 79.5057 360.8 70.5076C360.8 69.7606 361.356 69.1305 362.097 69.0379L372.198 67.7752C372.943 67.6822 373.6 68.2625 373.6 69.0125C373.6 71.767 375.833 74 378.588 74H390.014C392.878 74 395.2 71.6783 395.2 68.8143C395.2 66.4508 393.602 64.3863 391.314 63.794L373.765 59.2508C366.132 57.2745 360.8 50.3868 360.8 42.5015C360.8 32.9462 368.546 25.2 378.101 25.2Z" fill="white"/>\n<path d="M8.8 58C8.8 31.9322 29.9322 10.8 56 10.8C82.0678 10.8 103.2 31.9322 103.2 58C103.2 74.868 94.3524 89.6734 81.0342 98.022C80.6447 98.2662 80.1318 98.123 79.9175 97.7162L78.7941 95.5842C78.5971 95.2104 78.7255 94.7484 79.0825 94.5224C91.1684 86.8682 99.2 73.374 99.2 58C99.2 45.1582 93.5931 33.6223 84.7029 25.7135L83.8042 24.914C83.1429 24.3257 82.1296 24.3861 81.5428 25.0488L76.655 30.5694C76.3787 30.8815 75.9095 30.9282 75.5707 30.6852C70.0598 26.7304 63.2996 24.4 56 24.4C37.4432 24.4 22.4 39.4432 22.4 58C22.4 70.9369 29.7121 82.1614 40.4157 87.7744L41.4783 88.3315C42.2607 88.7419 43.2277 88.4403 43.6381 87.6579L47.1029 81.0544C47.2912 80.6954 47.7178 80.5354 48.1006 80.6688C50.5764 81.5315 53.2355 82 56 82C69.2548 82 80 71.2548 80 58C80 44.7452 69.2548 34 56 34H54.8C53.9163 34 53.2 34.7163 53.2 35.6V43.2143C53.2 43.5965 52.9289 43.923 52.5577 44.014C46.267 45.5571 41.6 51.2335 41.6 58C41.6 62.3276 43.5125 66.2118 46.529 68.8473C49.059 71.0578 52.3762 72.4 56 72.4C63.9529 72.4 70.4 65.9529 70.4 58C70.4 51.2335 65.733 45.5571 59.4423 44.014C59.0711 43.923 58.8 43.5965 58.8 43.2143V40.7431C58.8 40.2532 59.2372 39.8772 59.7171 39.9756C68.0973 41.6948 74.4 49.1114 74.4 58C74.4 68.162 66.162 76.4 56 76.4C52.9185 76.4 50.0216 75.6447 47.4764 74.3116L46.4142 73.7552C45.6318 73.3454 44.6653 73.6471 44.255 74.4292L41.0133 80.6075C40.7934 81.0267 40.2589 81.165 39.8722 80.8921C32.6864 75.8202 28 67.4556 28 58C28 42.536 40.536 30 56 30C63.1489 30 69.6662 32.6755 74.6156 37.0841L75.5144 37.8846C76.1757 38.4736 77.1895 38.4135 77.7765 37.7505L82.4362 32.4876C82.745 32.1388 83.2861 32.1262 83.6026 32.4681C89.8104 39.1755 93.6 48.1438 93.6 58C93.6 72.4821 85.4133 85.0566 73.4023 91.3398C68.2018 94.0603 62.2848 95.6 56 95.6C39.9975 95.6 26.3233 85.602 20.8962 71.502L20.467 70.3868C20.1505 69.5646 19.229 69.1529 18.4054 69.4659L11.7892 71.9802C11.3597 72.1434 10.8807 71.9123 10.7497 71.4719C9.48157 67.2056 8.8 62.6844 8.8 58Z" fill="white"/>\n<path d="M47.2 58C47.2 53.1399 51.1399 49.2 56 49.2C60.8601 49.2 64.8 53.1399 64.8 58C64.8 62.8601 60.8601 66.8 56 66.8C53.7822 66.8 51.7621 65.9832 50.2135 64.6302C48.3624 63.0129 47.2 60.6439 47.2 58Z" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M15.5314 80.7132C15.335 80.3641 14.9136 80.2069 14.5392 80.3492L7.33942 83.0853C6.51543 83.3984 5.59337 82.9861 5.27738 82.1632L3.70554 78.0698C1.30997 71.8314 0 65.0616 0 58C0 27.0721 25.0721 2 56 2C86.9279 2 112 27.0721 112 58C112 79.5691 99.8043 98.2795 81.9611 107.63L78.0725 109.668C77.291 110.078 76.3256 109.777 75.9143 108.997L72.3255 102.186C72.1387 101.831 71.7185 101.67 71.3402 101.803C66.5332 103.486 61.3687 104.4 56 104.4C38.6169 104.4 23.4779 94.8422 15.5314 80.7132ZM73.8305 98.177C73.6343 97.8047 73.1837 97.6488 72.7961 97.8125C67.6303 99.9943 61.9532 101.2 56 101.2C38.8594 101.2 24.0562 91.2184 17.0752 76.7588C16.8924 76.3802 16.4515 76.1992 16.0585 76.3485L9.18358 78.9612C8.35959 79.2743 7.43754 78.862 7.12154 78.0391L6.69286 76.9227C4.43567 71.0446 3.2 64.6633 3.2 58C3.2 28.8394 26.8394 5.2 56 5.2C85.1606 5.2 108.8 28.8394 108.8 58C108.8 78.3323 97.3067 95.9756 80.4757 104.796L79.4152 105.352C78.6338 105.761 77.6683 105.461 77.257 104.68L73.8305 98.177Z" fill="white"/>\n</svg>\n',size:108}))))))}get el(){return a(this)}static get watchers(){return{mobile:["handleMobileChange"]}}};yo.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:absolute;bottom:-50px;left:0;right:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--checkout-footer{width:calc(90vw - 22px);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}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:24px}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper .zonos--checkout-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper .zonos--checkout-footer-logo a{line-height:0}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper a{text-decoration:none}:host .zonos--checkout-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--checkout-footer .zonos--checkout-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--checkout-footer .zonos--checkout-locale-wrapper{gap:4px}}:host .zonos--checkout-footer .zonos--checkout-locale-wrapper .zonos--checkout-locale-label{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;gap:4px}:host .zonos--checkout-footer .zonos--checkout-footer-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--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar{width:10px}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--checkout-footer .zonos--checkout-footer-dialog.zonos--checkout-footer-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host(.mobile){-ms-flex-direction:column;flex-direction:column;gap:32px;background:var(--zonos-elements-gray-0);position:relative;padding-top:24px;bottom:0}:host(.mobile) .zonos--checkout-footer{-ms-flex-direction:column;flex-direction:column;gap:4px}:host(.mobile) .zonos--checkout-locale-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.mobile) .zonos--checkout-footer-icon-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.mobile) .zonos--checkout-footer-dialog{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw}";const xo=class{constructor(s){o(this,s),this.continueClicked=i(this,"continueClicked",7),this.paypalSessionFailed=i(this,"paypalSessionFailed",7),this.paypalSessionDone=i(this,"paypalSessionDone",7),this.continueLoading=!1,this.isMobile=!1,this.showErrorBanner=!1,this.hasStripePaymentError=!1,this.stagingOrderCreateErrorMessage="",this.internalContinueLoading=this.continueLoading,this.handleValidate=()=>{var o;return!!(null===(o=h.stripePaymentEventData)||void 0===o?void 0:o.complete)},this.continueClickHandler=async({currencyCode:o})=>{var s,t;if(!y()&&!this.handleValidate())return this.showErrorBanner=!0,null===(s=h.stripeElements)||void 0===s||s.submit(),void setTimeout((()=>{var o;null===(o=this.ele.querySelector("zonos-banner"))||void 0===o||o.scrollIntoView({behavior:"smooth"})}),10);h.checkoutSettlementCurrency=o,F({event:"zonos-checkout-payment-info",metadata:{checkoutSessionId:A.checkoutSessionId,paymentMethod:null===(t=h.stripePaymentEventData)||void 0===t?void 0:t.value.type}}),this.continueClicked.emit()},this.copyCardToClipboard=async o=>{try{await navigator.clipboard.writeText(o)}catch(s){const 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=o,t.id="zonos-copy-card-number",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}window.Zonos.showNotification({message:D("Card number copied to clipboard"),timeout:4e3,type:"success"})},this.placeTestOrder=async()=>{this.internalContinueLoading=!0;const{errors:o}=await eo();if(o.length)return this.stagingOrderCreateErrorMessage=o[0]||"Failed to create staging order. Please try again.",void(this.internalContinueLoading=!1);this.internalContinueLoading=!1,x()}}continueLoadingWatcher(){this.internalContinueLoading=this.continueLoading}stripePaymentErrorWatcher(){this.hasStripePaymentError&&setTimeout((()=>{var o;null===(o=this.ele.querySelector("zonos-banner"))||void 0===o||o.scrollIntoView({behavior:"smooth"})}),50)}render(){var o;if(this.hasStripePaymentError=h.hasPaymentError,!h.stripeElements)return null;this.showErrorBanner&&(this.showErrorBanner=!this.handleValidate());const s=W(),i=r.isStagingMode||K(),a="external_paypal"===(null===(o=h.stripePaymentEventData)||void 0===o?void 0:o.value.type),l=y();return t(e,{class:T(["zonos--checkout-payment zonos--elements",this.isMobile&&"mobile"])},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},D("Payment method")),(()=>{if(i){const{colorPrimary:o}=E.appearance,s=o&&no(o)?"DARK":"LIGHT",e=this.isMobile?E.appearance.theme:s;return t(n,null,this.stagingOrderCreateErrorMessage&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},this.stagingOrderCreateErrorMessage),t("zonos-empty-state-payment",{emptyStateText:D("No payment method needed for staging"),theme:e}),t("div",{class:"zonos--group-btn"},t("zonos-button",{backgroundColor:this.submitBtnColor,loading:this.internalContinueLoading,onClick:()=>{this.placeTestOrder()},size:"lg",variant:this.submitBtnType},D("Place test order"))))}return t(n,null,this.showErrorBanner&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},D("Missing required fields. Make sure all fields are completed.")),this.hasStripePaymentError&&t("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},h.customErrorMessage||D("We couldn't complete your payment. Please verify the payment details and try again.")),V.paypalErrorMessage&&t("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},V.paypalErrorMessage),r.customerAuthenticationToken&&null!=g.availableBalance&&g.availableBalance>0&&t("zonos-store-credit",null),l?t("zonos-banner",{intent:"info"},D("Store credit covers your full order")):t("zonos-payment",null),t("div",{class:"zonos--group-btn"},(!a||l)&&t(n,null,t("zonos-button",{backgroundColor:this.submitBtnColor,bold:!0,isDisabled:this.continueLoading&&"USD"===h.checkoutSettlementCurrency,loading:this.continueLoading&&"USD"!==h.checkoutSettlementCurrency,onClick:async()=>{r.checkoutSession?await this.continueClickHandler({currencyCode:r.checkoutSession.subtotals.presentmentCurrencyCode}):oo("Checkout session is not found")},size:"lg",variant:this.submitBtnType},l?D("Place order"):D("Pay [orderTotal]",{orderTotal:M({amount:r.total,isForeign:!0})})),!l&&h.shouldRenderPayInUsdButton&&t("zonos-button",{class:"zonos--pay-in-base-currency-btn",isDisabled:this.continueLoading&&"USD"!==h.checkoutSettlementCurrency,loading:this.continueLoading&&"USD"===h.checkoutSettlementCurrency,onClick:async()=>{await this.continueClickHandler({currencyCode:"USD"})},size:"lg",variant:"subtle"},D("Click to pay in USD"))),!l&&t("zonos-paypal-payment",{onPaypalSessionDone:({detail:{orderId:o}})=>{this.paypalSessionDone.emit(o)},onPaypalSessionFail:()=>this.paypalSessionFailed.emit(),style:{display:a?"block":"none"}})),s&&t("zonos-card",{backgroundColor:"gray-100",borderRadius:12,class:"zonos--test-cards"},t("zonos-v-stack",{spacing:16},t("div",null,t("zonos-text",{type:"semiBoldLabel"},D("Test cards")),t("zonos-text",{textColor:"gray-700"},D("Click to copy the card number. Use any future expiration date and three number CVC."))),t("zonos-button",{icon:t("zonos-icon",{content:'<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>'}),justifyContent:"flex-start",onClick:()=>this.copyCardToClipboard("4242424242424242")},D("Success")," (****4242)"),t("zonos-button",{icon:t("zonos-icon",{content:'<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>'}),justifyContent:"flex-start",onClick:()=>this.copyCardToClipboard("4000000000000002")},D("Failure")," (****0002)")),t("zonos-notification",null)))})()))}get ele(){return a(this)}static get watchers(){return{continueLoading:["continueLoadingWatcher"],hasStripePaymentError:["stripePaymentErrorWatcher"]}}};xo.style=".sc-zonos-checkout-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-payment-h *.sc-zonos-checkout-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-payment-h img.sc-zonos-checkout-payment{max-width:100%}.sc-zonos-checkout-payment-h dl.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h dd.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h1.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h2.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h3.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h4.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h5.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h6.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h hr.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h figure.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h p.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h pre.sc-zonos-checkout-payment{margin:0}.sc-zonos-checkout-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-checkout-payment-h .zonos--title.sc-zonos-checkout-payment{margin-bottom:24px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar{width:10px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-payment-h .zonos--payment-error-banner.sc-zonos-checkout-payment{margin-bottom:8px}.sc-zonos-checkout-payment-h .zonos--error-banner.sc-zonos-checkout-payment{margin-bottom:16px}.sc-zonos-checkout-payment-h zonos-button.sc-zonos-checkout-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-checkout-payment-h .zonos--pay-in-base-currency-btn.sc-zonos-checkout-payment{-webkit-box-shadow:none;box-shadow:none}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-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-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment zonos-text.sc-zonos-checkout-payment{text-align:center}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment zonos-button.sc-zonos-checkout-payment{width:100%}.sc-zonos-checkout-payment-h .zonos--test-cards.sc-zonos-checkout-payment{margin-top:auto;padding-top:16px}.mobile.mobile.sc-zonos-checkout-payment-h{-ms-scroll-chaining:chained;overscroll-behavior:auto}.mobile.mobile.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment{-ms-scroll-chaining:chained;overscroll-behavior:auto}";const vo=class{constructor(s){o(this,s),this.tabColor=null,this.backgroundColor=null,this.getTotalSuccessStep=()=>(Object.values(r.tabItems).filter((o=>o.isDone)).length+1)/4*100+"%",this.isTabClickable=o=>{const s=r.tabItems[o];return!!s&&(!!s.isDone||Object.values(r.tabItems).slice(0,s.index-1).every((o=>o.isDone)))}}async setTabItems(o){r.tabItems=o}async setTabSelected(o){if(this.isTabClickable(o)){r.step=o;const s=(({selectedTab:o,tabList:s})=>{const t=s[o].index,e=Object.values(s).slice(t-1,Object.keys(s).length).map((o=>o.value)),n=Object.assign({},s);return Object.values(n).forEach((o=>{e.includes(o.value)&&(o.isDone=!1)})),n})({selectedTab:o,tabList:r.tabItems});r.tabItems=s}}render(){const o=r.step,s=this.tabColor||E.appearance.colorSecondary,n=this.backgroundColor||E.appearance.colorPrimary||"",i=n&&s?io({backgroundColor:ao(n)?window.getComputedStyle(this.ele).getPropertyValue(`--zonos-elements-${n.replace("--zonos-elements-","")}`):n,color:s}):s;return t(e,{key:"2bc73268f4413887abe526ab1ac01471627e9fbc",class:"zonos--elements",style:{"--zonos--color":i,"--zonos--progress-percent":this.getTotalSuccessStep()}},t("div",{key:"fb812b9d4e6ba72f26b4f31ccf8444500a72f277",class:"zonos--tab-wrapper"},Object.values(r.tabItems).map(((s,e)=>{const n=s.value===o;return t("button",{"aria-label":`Tab ${s.label}`,class:T(["zonos--tab-item",s.value===o&&"selected",s.isDone&&"done"]),disabled:!this.isTabClickable(s.value),key:s.value,onClick:()=>this.setTabSelected(s.value)},t("div",{class:"zonos--tab-index"},t("zonos-text",{class:"zonos--tab-index-label",textColor:n?i:"gray-1000",type:"label"},e+1),t("zonos-icon",{class:"zonos--tab-index-done-icon",content:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M18.289 7.40424C18.618 7.65585 18.6808 8.12656 18.4291 8.4556L11.9291 16.9556C11.7978 17.1273 11.5988 17.234 11.383 17.2484C11.1673 17.2627 10.9559 17.1832 10.803 17.0303L6.80304 13.0303C6.51015 12.7374 6.51015 12.2626 6.80304 11.9697C7.09594 11.6768 7.57081 11.6768 7.8637 11.9697L11.258 15.3639L17.2376 7.54442C17.4892 7.21539 17.9599 7.15263 18.289 7.40424Z" fill="currentColor"/>\n</svg>\n',iconColor:n?i:"gray-1000"})),t("zonos-text",{textColor:n?i:"gray-1000",type:"label"},D(s.label)))}))),t("div",{key:"0dcaeb8d709f06df00b965c7aa081294a060120e",class:"zonos--tab-progress"},t("div",{key:"8faef8257c4a0244e1ee5f3ac5752904ecd63d96",class:"zonos--progress-bar-fill"})))}static get assetsDirs(){return["assets"]}get ele(){return a(this)}};vo.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{margin-bottom:32px}:host .zonos--tab-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:distribute;justify-content:space-around}:host .zonos--tab-index{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-size:13px;width:24px;height:24px;font-weight:bold}:host .zonos--tab-index .zonos--tab-index-label,:host .zonos--tab-index .zonos--tab-index-done-icon{position:absolute;top:0;width:24px;height:24px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:top 0.5s ease-in-out, opacity 0.5s ease-in-out;transition:top 0.5s ease-in-out, opacity 0.5s ease-in-out}:host .zonos--tab-index .zonos--tab-index-done-icon{top:-50%;opacity:0}:host .zonos--tab-item{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;background:transparent;border:0;cursor:pointer}:host .zonos--tab-item:disabled{cursor:not-allowed}:host .zonos--tab-item.done .zonos--tab-index-done-icon{top:0;opacity:1}:host .zonos--tab-item.done .zonos--tab-index-label{opacity:0;top:50%}:host .zonos--tab-item.selected zonos-text{color:var(--zonos--color)}:host .zonos--tab-progress{width:100%;background-color:transparent;border-radius:10px;-webkit-box-shadow:inset 0 0 5px rgba(0, 0, 0, 0.4);box-shadow:inset 0 0 5px rgba(0, 0, 0, 0.4);overflow:hidden;position:relative;padding:1px;height:8px}:host .zonos--tab-progress .zonos--progress-bar-fill{border-radius:10px;background-color:var(--zonos--color);height:100%;width:var(--zonos--progress-percent);-webkit-transition:width 0.5s ease-in-out;transition:width 0.5s ease-in-out}";const ko=class{constructor(s){o(this,s),this.errorImages=[]}async handleToggleChanged(o){var s;const t=null===(s=r.exchangeRate)||void 0===s?void 0:s.targetCurrencyCode;r.displayBaseCurrency=t!==o}render(){const{exchangeRate:o}=r,s=o&&o.sourceCurrencyCode!==o.targetCurrencyCode?[{label:o.sourceCurrencyCode,value:o.sourceCurrencyCode},{label:o.targetCurrencyCode,value:o.targetCurrencyCode}]:[];return s.length?t(e,{class:"zonos--currency-toggle zonos--elements"},t("zonos-toggle",{onToggleChanged:o=>this.handleToggleChanged(o.detail),options:s,value:r.displayBaseCurrency?s[0].value:s[1].value})):null}static get assetsDirs(){return["assets"]}},wo=35,Co=class{constructor(s){o(this,s),this.continueClicked=i(this,"continueClicked",7),this.testContinueClicked=i(this,"testContinueClicked",7),this.storeUnsubscribeList=[],this.continueLoading=!1,this.isMobile=!1,this.defaultAddress=[],this.shouldUseCustomAddressFormOverride=!1,this.showErrorBanner=!1,this.shippingCountry="",this.isCheckingForRestrictedItems=!1,this.isValidatingAddress=!1,this.taxIdErrorMessage="",this.shortAddressCodeErrorMessage="",this.invalidShippingCharacterList=null,this.invalidBillingCharacterList=null,this.openAddressValidationDialog=!1,this.isEmailError=!1,this.recordedFormTypeUsed=!1,this.selectedCountryCode=B.selectedCountryCode,this.genericSettings=E.genericSettings,this.addressFormRenderType=r.addressFormRenderType,this.exceededCharacterLimitErrorFieldList=[],this.handleInvalidCharacters=async()=>{if("ALL"===E.checkoutSettings.allowedCharacterSets)return{hasInvalidCharacters:!1};this.invalidShippingCharacterList=h.stripeAddressEventData?this.checkInvalidCharacters(h.stripeAddressEventData):null,this.invalidBillingCharacterList=h.stripeShippingSameAsBilling?null:this.checkInvalidCharacters(h.stripeBillingAddressEventData);const o=!!this.invalidShippingCharacterList||!!this.invalidBillingCharacterList;return o&&(this.openAddressValidationDialog=!0,this.isValidatingAddress=!0,await v({addressInvalidCharactersList:this.invalidShippingCharacterList,billingAddressInvalidCharactersList:this.invalidBillingCharacterList}),this.isValidatingAddress=!1),{hasInvalidCharacters:o}},this.transformTranslatedAddressToStripeEvent=({submitData:o,type:s})=>{const t="shippingAddress"===s?h.stripeAddressEventData:h.stripeBillingAddressEventData,e=o[s];if(!t||!e)return;const{firstName:n,lastName:i}=k({name:e.name}),a=Object.assign(Object.assign({},t),{complete:!0,value:Object.assign(Object.assign({},null==t?void 0:t.value),{address:Object.assign(Object.assign({},null==t?void 0:t.value.address),{city:e.city||(null==t?void 0:t.value.address.city)||"",line1:e.line1,line2:e.line2,postal_code:e.postal_code,state:e.state}),firstName:n,lastName:i,name:e.name})});"shippingAddress"===s?h.stripeAddressEventData=a:h.stripeBillingAddressEventData=a},this.continueClickHandler=async()=>{var o;if(null===(o=this.testContinueClicked)||void 0===o||o.emit({billingAddress:h.stripeBillingAddressEventData,sameAsBilling:h.stripeShippingSameAsBilling,shippingAddress:h.stripeAddressEventData}),!this.handleValidate())return setTimeout((()=>{var o;null===(o=this.el.querySelector("zonos-banner.zonos--error-banner"))||void 0===o||o.scrollIntoView({behavior:"smooth",block:"center"})}),50),void(this.showErrorBanner=!0);this.showErrorBanner=!1;const{hasInvalidCharacters:s}=await this.handleInvalidCharacters();s||this.continueClicked.emit({billingAddress:h.stripeBillingAddressEventData,sameAsBilling:h.stripeShippingSameAsBilling,shippingAddress:h.stripeAddressEventData})},this.validateCustomAddressForm=o=>{const s=h.stripeShippingSameAsBilling||"shipping"===o,t=s?h.customAddressErrors:h.customBillingAddressErrors,{city:e,firstName:n,lastName:i,line1:a,phone:r,postalCode:l,state:c}=t;let d=!1;return(e||n||i||a||r||l||c)&&(d=!0),s?h.customAddressErrors=Object.assign(Object.assign({},t),{showError:d}):h.customBillingAddressErrors=Object.assign(Object.assign({},t),{showError:d}),{isValid:!d}},this.validateAddressLength=({address:o,type:s})=>{if(!o)return[];const{city:t,line1:e,postal_code:n,state:i}=o.value.address,{firstName:a,lastName:r,name:l}=o.value,{firstName:c,lastName:d}=k({firstName:a,lastName:r,name:l}),h=e.length,p=n.length,u=i.length,m=c.length,f=d.length,z="shipping"===s?"shipping":"billing",g=[];return t.length>wo&&g.push({addressType:z,fieldLabel:"City",value:t}),h>wo&&g.push({addressType:z,fieldLabel:"Address line 1",value:e}),p>wo&&g.push({addressType:z,fieldLabel:"Zip",value:n}),u>wo&&g.push({addressType:z,fieldLabel:"State/Province/Region/Prefecture",value:i}),m>wo&&g.push({addressType:z,fieldLabel:"First name",value:c}),f>wo&&g.push({addressType:z,fieldLabel:"Last name",value:d}),g},this.handleValidate=()=>{var o,s;const t=h.stripeAddressEventData,e=h.stripeBillingAddressEventData,n=h.stripeLinkEventData,i=h.stripeShippingSameAsBilling?!!(null==t?void 0:t.complete):!!(null==e?void 0:e.complete),a=!!(null==t?void 0:t.complete),r=!!(null==n?void 0:n.complete);null===(o=h.stripeAddressElement)||void 0===o||o.getValue(),null===(s=h.stripeBillingAddressElement)||void 0===s||s.getValue();const l="zonos"===this.addressFormRenderType?this.validateCustomAddressForm("billing").isValid:i,c="zonos"===this.addressFormRenderType?this.validateCustomAddressForm("shipping").isValid:a;!r&&(null==n?void 0:n.empty)&&(this.isEmailError=!0),oo("==> isValidBilling","info",l,{address:h.stripeBillingAddressEventData,errors:h.customBillingAddressErrors}),oo("==> isValidShipping","info",c,{address:h.stripeAddressEventData,errors:h.customAddressErrors}),oo("==> isValidLink","info",r);const{error:d,valid:p}=(({companyName:o,shippingCountry:s,taxId:t})=>{if(!ho({companyName:o,countryCode:s}))return{error:null,valid:!0};return(o=>["MX","AR",...po].includes(o))(s)?po.includes(s)?o.trim()?t?{error:null,valid:!0}:{error:"Tax id is required",valid:!1}:{error:null,valid:!0}:t?"AR"===s?/^[0-9]{2}-?[0-9]{8}-?[0-9]$/.test(t)?{error:null,valid:!0}:{error:"Invalid CUIT/CUIL format. Must contain 11 digits, with or without dashes (XX-XXXXXXXX-X).",valid:!1}:"MX"===s?/^[A-ZÑ]{3,4}[0-9]{6}[A-Z0-9]{3}$/.test(t)?{error:null,valid:!0}:{error:"Invalid RFC format. Must be 12–13 uppercase letters and numbers only.",valid:!1}:{error:null,valid:!0}:{error:"Tax id is required",valid:!1}:{error:null,valid:!0}})({companyName:h.companyName,shippingCountry:this.shippingCountry,taxId:h.taxId}),{error:u,valid:m}=(({shippingCountry:o,shortAddressCode:s})=>co({countryCode:o})?s?"SA"!==o||/^[A-Za-z]{4}\s*[0-9]{4}$/.test(s)?{error:null,valid:!0}:{error:"Invalid short address code format. Must be 4 letters and 4 numbers.",valid:!1}:{error:"Short address code is required.",valid:!1}:{error:null,valid:!0})({shippingCountry:this.shippingCountry,shortAddressCode:h.shortAddressCode});this.taxIdErrorMessage=p?"":D(d),this.shortAddressCodeErrorMessage=m?"":D(u);const f=this.validateAddressLength({address:h.stripeAddressEventData,type:"shipping"}),z=this.validateAddressLength({address:h.stripeBillingAddressEventData,type:"billing"});return this.exceededCharacterLimitErrorFieldList=[...f,...z],!(!(l&&c&&r&&p&&m)||this.exceededCharacterLimitErrorFieldList.length>0)},this.handleEmailValidation=()=>{var o;this.isEmailError&&((null===(o=h.stripeLinkEventData)||void 0===o?void 0:o.empty)||(this.isEmailError=!1))},this.prepareAddressObject=o=>{var s;const t=o.value;return{city:t.address.city||"",country:t.address.country,email:(null===(s=h.stripeLinkEventData)||void 0===s?void 0:s.value.email)||"",line1:t.address.line1||"",line2:t.address.line2||"",name:t.name||"",phone:t.phone||"",postal_code:t.address.postal_code||"",state:t.address.state||""}},this.renderExceededCharacterLimitError=o=>{const s=this.exceededCharacterLimitErrorFieldList.filter((({addressType:s})=>s===o));return s.length?t("zonos-banner",{class:"zonos--error-banner",intent:"error",slot:"below-title"},t("ul",null,s.map((({fieldLabel:o,value:s})=>t("li",{key:o},D("Address line 1"===o?"[fieldLabel] is [currentLength] characters. Please shorten to [maxLength] or less or move the rest to address line 2.":"[fieldLabel] is [currentLength] characters. Please shorten to [maxLength] or less.",{currentLength:s.length,fieldLabel:o,maxLength:wo})))))):null},this.renderAddressComponent=o=>{this.selectedCountryCode||G({endpoint:"NO_COUNTRY_SELECTED_WHEN_RENDERING_ADDRESS_COMPONENT",errors:["No country selected when rendering address component"],metadata:{type:o},shouldPostReleaseErrorReporting:!0});const s="shipping"===o?this.defaultAddress:[];return"shipping"===o&&A.checkoutSessionId&&!this.recordedFormTypeUsed&&(ro({attributes:[{key:"ZONOS_FORM_TYPE_USING",value:"zonos"===this.addressFormRenderType?"custom":"stripe"}],checkoutSessionId:A.checkoutSessionId}),this.recordedFormTypeUsed=!0),t("zonos"===this.addressFormRenderType?"zonos-custom-address":"zonos-address",{defaultAddress:s,shortAddressCodeErrorMessage:this.shortAddressCodeErrorMessage,taxIdErrorMessage:this.taxIdErrorMessage,titleText:D("shipping"===o?"Shipping address":"Billing address"),type:o},this.renderExceededCharacterLimitError(o))}}watchShowErrorBanner(){this.showErrorBanner&&(this.showErrorBanner=!this.handleValidate())}checkInvalidCharacters(o){if(!o)return null;if(!o.complete||"ALL"===E.checkoutSettings.allowedCharacterSets)return null;const{address:s,firstName:t,lastName:e,name:n}=o.value,{city:i,country:a,line1:r,line2:l,postal_code:c,state:d}=s,h=lo({city:i,country:a,line1:r,line2:l||"",name:n||`${t} ${e}`,postal_code:c,state:d});return Object.keys(h).length?h:null}watchShouldEnabledCustomAddress(){var o,s,t;const e=this.shouldUseCustomAddressFormOverride||!!(null===(o=this.genericSettings)||void 0===o?void 0:o.shouldEnabledCustomAddress),n=!!this.selectedCountryCode&&e&&!!(null===(t=null===(s=this.genericSettings)||void 0===s?void 0:s.countryCustomAddressEnabled)||void 0===t?void 0:t.includes(this.selectedCountryCode));r.addressFormRenderType=n?"zonos":"stripe"}disconnectedCallback(){try{this.storeUnsubscribeList.forEach((o=>o()))}catch(o){}}componentWillLoad(){this.storeUnsubscribeList=[N("genericSettings",(()=>{this.genericSettings=E.genericSettings})),j("selectedCountryCode",(()=>{this.selectedCountryCode=B.selectedCountryCode})),w("addressFormRenderType",(()=>{this.addressFormRenderType=r.addressFormRenderType}))],this.watchShouldEnabledCustomAddress()}render(){var o,s,n,i,a,r;if(!h.stripeElements)return null;!this.shippingCountry&&h.stripeAddressEventData&&(this.shippingCountry=null===(o=h.stripeAddressEventData)||void 0===o?void 0:o.value.address.country),h.stripeAddressEventData&&this.shippingCountry!==h.stripeAddressEventData.value.address.country&&(this.shippingCountry=h.stripeAddressEventData.value.address.country);const l=!h.stripeShippingSameAsBilling,c=P(E.appearance.theme),d=(null===(s=this.defaultAddress.find(Boolean))||void 0===s?void 0:s.email)||(null===(a=null===(i=null===(n=h.customerProfile)||void 0===n?void 0:n.locations)||void 0===i?void 0:i.find(Boolean))||void 0===a?void 0:a.email)||(null===(r=h.customerProfile)||void 0===r?void 0:r.email);return t(e,{class:T(["zonos--customer-info zonos--elements",this.isMobile&&"mobile"])},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},D("Customer information")),this.showErrorBanner&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},D("Missing required fields. Make sure all fields are completed.")),t("zonos-link-authentication",{defaultEmail:d,isEmailError:this.isEmailError,onLinkAuthenticationChange:this.handleEmailValidation,titleText:D("Contact")}),this.renderAddressComponent("shipping"),t("zonos-checkbox",{class:"zonos--shipping-same-as-billing-cbx",isChecked:h.stripeShippingSameAsBilling,label:D("Shipping address same as billing"),onCheckboxSelected:o=>{h.stripeShippingSameAsBilling=o.detail}}),t("zonos-collapse",{collapsed:!l},this.renderAddressComponent("billing")),t("div",{class:"zonos--group-btn"},t("zonos-button",{backgroundColor:this.submitBtnColor,bold:!0,loading:this.continueLoading,onClick:()=>this.continueClickHandler(),size:"lg",variant:this.submitBtnType},D("Continue to shipping")))),h.stripeAddressEventData&&t("zonos-address-update-dialog",{billingAddress:!h.stripeShippingSameAsBilling&&h.stripeBillingAddressEventData?this.prepareAddressObject(h.stripeBillingAddressEventData):null,"data-theme":c,dialogLoading:this.isValidatingAddress,dialogOpen:this.openAddressValidationDialog,isMobile:this.isMobile,onCloseUpdateDialog:()=>this.openAddressValidationDialog=!1,onContinueClicked:o=>{const s=o.detail;this.transformTranslatedAddressToStripeEvent({submitData:s,type:"shippingAddress"}),this.transformTranslatedAddressToStripeEvent({submitData:s,type:"billingAddress"})},shippingAddress:this.prepareAddressObject(h.stripeAddressEventData),translatedBillingAddress:h.translatedAddress.billingAddress,translatedShippingAddress:h.translatedAddress.address}))}get el(){return a(this)}static get watchers(){return{showErrorBanner:["watchShowErrorBanner"],shouldUseCustomAddressFormOverride:["watchShouldEnabledCustomAddress"],genericSettings:["watchShouldEnabledCustomAddress"],selectedCountryCode:["watchShouldEnabledCustomAddress"]}}};Co.style=".sc-zonos-customer-info-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-customer-info-h *.sc-zonos-customer-info{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-customer-info-h img.sc-zonos-customer-info{max-width:100%}.sc-zonos-customer-info-h dl.sc-zonos-customer-info,.sc-zonos-customer-info-h dd.sc-zonos-customer-info,.sc-zonos-customer-info-h h1.sc-zonos-customer-info,.sc-zonos-customer-info-h h2.sc-zonos-customer-info,.sc-zonos-customer-info-h h3.sc-zonos-customer-info,.sc-zonos-customer-info-h h4.sc-zonos-customer-info,.sc-zonos-customer-info-h h5.sc-zonos-customer-info,.sc-zonos-customer-info-h h6.sc-zonos-customer-info,.sc-zonos-customer-info-h hr.sc-zonos-customer-info,.sc-zonos-customer-info-h figure.sc-zonos-customer-info,.sc-zonos-customer-info-h p.sc-zonos-customer-info,.sc-zonos-customer-info-h pre.sc-zonos-customer-info{margin:0}.sc-zonos-customer-info-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-customer-info-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%}.sc-zonos-customer-info-h .zonos--title.sc-zonos-customer-info{margin-bottom:20px}.sc-zonos-customer-info-h .zonos--link-authentication.sc-zonos-customer-info{margin-bottom:32px}.sc-zonos-customer-info-h .zonos--address.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info+.zonos--address.sc-zonos-customer-info{margin-bottom:0}.sc-zonos-customer-info-h zonos-button.sc-zonos-customer-info{-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-customer-info-h .zonos--error-banner.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--tax-id-input.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{margin-bottom:20px;overflow:auto;padding:5px;height:100%;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar{width:10px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-customer-info-h .zonos--error-banner.sc-zonos-customer-info ul.sc-zonos-customer-info{list-style:disc;padding-left:8px}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:-4px;padding-top:8px;margin-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0));z-index:2}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info zonos-button.sc-zonos-customer-info{width:100%}.mobile.mobile.sc-zonos-customer-info-h{-ms-scroll-chaining:chained;overscroll-behavior:auto}.mobile.mobile.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{-ms-scroll-chaining:chained;overscroll-behavior:auto}";const Lo=class{constructor(t){o(this,t),this.isErrorImageLoad=!1,this.getImageRestState=()=>s(`./assets/${this.restStateType}.png`)}render(){const o=this.getImageRestState();return t(e,{key:"c8ad36ee240e6c623cfd950a9cd2eebc89e1d264",class:T(["zonos--elements zonos--restState"]),style:{"--zonos--font-family":$()}},t("div",{key:"c1f45b4dfc584bd492f36cd678699aec372d0b41",class:"zonos--restState-image"},t("img",{key:"dbbcbfcdfb849c8f31c17eba4f99d2fbf1f9f05d",alt:this.restStateType,onError:()=>{this.isErrorImageLoad=!0},src:o})),t("div",{key:"a3f92d7c4b7c3d6b27b310024b60659903901300",class:"content"},t("zonos-text",{key:"c3f6af9cc17b95f988d848e18e3afbdb711c5ddd",class:"title",type:"boldSubheader"},this.restStateTitle),t("zonos-text",{key:"656d089910ca5aa79b762d6c36b9b14ef093b706",class:"subtitle"},this.restStateSubtitle)),t("div",{key:"e44d6b8bdf04cc1bc31a3ed427260c08ab05781b",class:"action"},t("slot",{key:"662fcf9da75d402dbfdd4ec8135c5112c5cc7527"})))}static get assetsDirs(){return["assets"]}};Lo.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{height:100%;width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;gap:20px}:host .zonos--restState-image{width:124px;height:124px;margin-bottom:15px}:host .content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;gap:8px}";const So=class{constructor(s){o(this,s),this.mobile=!1,this.collapsed=!1,this.isMobile=!1}handleWindowResize(){this.isMobile=q(this.mobile)}componentWillLoad(){this.isMobile=q(this.mobile)}render(){const o="customer-info"===r.step?r.subtotal+r.adjustmentTotal:r.total,s=l()?o:0,n=this.isMobile?"boldSubheader":"semiBoldLabel",i=this.isMobile?"boldSubheader":"secondaryPageHeader",a=this.isMobile?"gray-1000":"gray-800";return t(e,{class:T(["zonos--review zonos--elements",this.isMobile&&"mobile"])},t("div",{class:"zonos--title"},t("zonos-text",{textColor:a,type:n},D("Pay [organizationName]",{organizationName:E.organizationName})),(()=>this.isMobile?t("zonos-icon",this.collapsed?{"aria-label":"Expand collapsed section",content:'<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>',iconColor:"gray-1200"}:{"aria-label":"Collapse expanded section",content:'<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>',iconColor:"gray-1200"}):null)()),t("div",{class:"zonos--total-pay"},t("zonos-text",{type:i},M({amount:s,isForeign:!0}))))}static get assetsDirs(){return["assets"]}};So.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{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}:host(.mobile){display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:24px;-ms-flex-pack:justify;justify-content:space-between;padding:4px 0;margin-bottom:8px;background-color:transparent}:host(.mobile) .zonos--title{display:-ms-flexbox;display:flex;-ms-flex-item-align:center;align-self:center;gap:8px}:host(.mobile) .zonos--total-pay{margin:0}";const Io=class{constructor(s){o(this,s),this.continueClicked=i(this,"continueClicked",7),this.storeUnsubscribeList=[],this.continueLoading=!1,this.selectedShippingMethod=null,this.collapsedDAPOptions=!0,this.isSelecting=!1,this.showErrorBanner=!1,this.serviceLevelsDDP=[],this.serviceLevelsDAP=[],this.serviceLevelsOther=[],this.serviceLevelsAll=[],this.displayBaseCurrency=!1,this.shippingData=[],this.handleRadioSelected=async o=>{var s;if(this.selectedShippingMethod=o.detail,!this.selectedShippingMethod)return;const t=(null===(s=r.shippingData)||void 0===s?void 0:s.find((o=>{var s;return o.id===(null===(s=this.selectedShippingMethod)||void 0===s?void 0:s.shipmentRatingId)})))||null;t&&(this.isSelecting=!0,await C(),await L({applySubtotalsOnly:!1,landedCostId:o.detail.landedCostId,selectedShippingOption:t}),this.isSelecting=!1)},this.handleValidate=()=>!!this.selectedShippingMethod,this.isOutdatedShippingData=()=>{var o;return!!(null===(o=r.shippingData)||void 0===o?void 0:o.some((o=>{var s;if(!(null===(s=this.serviceLevelsAll)||void 0===s?void 0:s.find((s=>s.shipmentRatingId===o.id))))return!0})))},this.continueClickHandler=()=>{var o,s;this.handleValidate()?(F({event:"zonos-checkout-shipping-info",metadata:{checkoutSessionId:A.checkoutSessionId,serviceLevelId:null===(o=this.selectedShippingMethod)||void 0===o?void 0:o.value}}),m({checkoutSessionId:A.checkoutSessionId,eventName:"checkout_shippingInfoCompleted",metadata:{serviceLevelId:null===(s=this.selectedShippingMethod)||void 0===s?void 0:s.value}}),this.showErrorBanner=!1,this.continueClicked.emit()):this.showErrorBanner=!0},this.getLandedCostMethodLabelSuffix=o=>{var s,t,e;return 1==("DAP"===o&&!(null===(t=null===(s=E.genericSettings)||void 0===s?void 0:s.domesticCountries)||void 0===t?void 0:t.includes((null===(e=h.stripeAddressEventData)||void 0===e?void 0:e.value.address.country)||"US")))?D(" (Duties due at door)"):""},this.initServiceLevels=()=>{var o;this.collapsedDAPOptions=!0;const s=(null===(o=r.shippingData)||void 0===o?void 0:o.flatMap((o=>{var s;const t=S(o),e=t?`${t.minTransit}-${t.maxTransit} ${t.unit}`:"",n=null===(s=r.landedCostData)||void 0===s?void 0:s.filter((s=>{var t;return(null===(t=s.landedCost)||void 0===t?void 0:t.shipmentRating.id)===o.id}));return(null==n?void 0:n.map((s=>{const t=s.subtotals.shipping,n=I(s.landedCost);return{amount:t,label:`${o.displayName}${this.getLandedCostMethodLabelSuffix(n)}`,landedCostId:s.landedCostId,method:n,price:M({amount:t,isForeign:!0}),shipmentRatingId:o.id,sublabel:e,value:s.landedCostId}})))||[]})))||[],t=s.filter((o=>"DDP"===o.method)),e=s.filter((o=>"DAP"===o.method)),n=s.filter((o=>"DAP"!==o.method&&"DDP"!==o.method));this.serviceLevelsDDP=_(t),this.serviceLevelsDAP=_(e),this.serviceLevelsOther=_(n),this.serviceLevelsAll=[...this.serviceLevelsDDP,...this.serviceLevelsDAP,...this.serviceLevelsOther],[...this.serviceLevelsDDP,...this.serviceLevelsOther].length||(this.collapsedDAPOptions=!1)},this.isCurrencyToggled=()=>this.displayBaseCurrency!==r.displayBaseCurrency&&(this.displayBaseCurrency=r.displayBaseCurrency,!0),this.preselectFirstShippingMethod=async()=>{this.initServiceLevels();const o=this.serviceLevelsAll.find((o=>{var s;return o.shipmentRatingId===(null===(s=r.selectedShippingOption)||void 0===s?void 0:s.id)}))||null;if(o)return void this.handleRadioSelected({detail:o});const s=this.serviceLevelsAll.find(Boolean);s&&this.handleRadioSelected({detail:s})}}disconnectedCallback(){this.storeUnsubscribeList.forEach((o=>o()))}componentWillLoad(){this.storeUnsubscribeList=[w("shippingData",(()=>{this.isOutdatedShippingData()&&this.preselectFirstShippingMethod()})),w("landedCostData",(()=>{this.isOutdatedShippingData()&&this.preselectFirstShippingMethod()}))],this.preselectFirstShippingMethod()}render(){this.isCurrencyToggled()&&this.initServiceLevels();const o=[...this.serviceLevelsDDP,...this.serviceLevelsOther];return this.showErrorBanner&&(this.showErrorBanner=!this.handleValidate()),t(e,{class:T(["zonos--shipping zonos--elements",this.isMobile&&"mobile"])},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},D("Delivery options")),this.showErrorBanner&&!!this.serviceLevelsAll.length&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},D("No shipping method selected")),t("zonos-text",{class:"zonos--shipping-method-title",type:"semiBoldLabel"},D("Shipping method")),this.serviceLevelsAll.length?t("div",{class:"zonos--shipping-options-wrapper"},(()=>{var s;return"US"===(null===(s=h.stripeAddressEventData)||void 0===s?void 0:s.value.address.country)?t("zonos-shipping-rich-radio",{isMobile:this.isMobile,items:this.serviceLevelsAll,onRadioSelected:o=>this.handleRadioSelected(o),selectedItem:this.selectedShippingMethod}):t(n,null,t("zonos-shipping-rich-radio",{isMobile:this.isMobile,items:o,onRadioSelected:o=>this.handleRadioSelected(o),selectedItem:this.selectedShippingMethod}),!!o.length&&!!this.serviceLevelsDAP.length&&t("button",{class:T(["zonos--shipping-options-collapse-trigger",this.collapsedDAPOptions&&"collapsed"]),onClick:()=>{this.collapsedDAPOptions=!this.collapsedDAPOptions}},t("div",{class:"zonos--title-wrapper"},t("zonos-text",{type:"label"},`${D(this.collapsedDAPOptions?"Show non-prepaid options":"Hide non-prepaid options")} `),t("zonos-icon",{content:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#filter0_dd_2052_3658)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M7.46967 14.5303C7.76256 14.8232 8.23744 14.8232 8.53033 14.5303L12.5 10.5607L16.4697 14.5303C16.7626 14.8232 17.2374 14.8232 17.5303 14.5303C17.8232 14.2374 17.8232 13.7626 17.5303 13.4697L13.0303 8.96967C12.7374 8.67678 12.2626 8.67678 11.9697 8.96967L7.46967 13.4697C7.17678 13.7626 7.17678 14.2374 7.46967 14.5303Z" fill="currentColor"/>\n</g>\n<defs>\n<filter id="filter0_dd_2052_3658" x="-3.5" y="-2" width="32" height="32" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="2"/>\n<feGaussianBlur stdDeviation="2"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2052_3658"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="1"/>\n<feGaussianBlur stdDeviation="1"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0"/>\n<feBlend mode="normal" in2="effect1_dropShadow_2052_3658" result="effect2_dropShadow_2052_3658"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_2052_3658" result="shape"/>\n</filter>\n</defs>\n</svg>\n'}))),t("zonos-collapse",{collapsed:this.collapsedDAPOptions},t("div",{class:"zonos--dap-wrapper"},t("zonos-banner",{bannerTitle:D("Duties and taxes will be charged upon delivery."),intent:"warning"},D("You may incur additional fees from the shipping carrier by not prepaying.")),t("zonos-shipping-rich-radio",{isMobile:this.isMobile,items:this.serviceLevelsDAP,onRadioSelected:o=>this.handleRadioSelected(o),selectedItem:this.selectedShippingMethod}))))})()):t("zonos-banner",{bannerTitle:r.customQuotingError?r.customQuotingError:D('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'),class:"zonos--shipping-method-error",intent:"error"}),t("div",{class:"zonos--group-btn"},t("zonos-button",{backgroundColor:this.submitBtnColor,bold:!0,loading:this.continueLoading||this.isSelecting,onClick:()=>this.continueClickHandler(),size:"lg",variant:this.submitBtnType},D("Go to payment")))))}};Io.style='.sc-zonos-shipping-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-shipping-h *.sc-zonos-shipping{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:-16px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h .zonos--error-banner.sc-zonos-shipping{margin-bottom:16px}.sc-zonos-shipping-h .zonos--shipping-method-error.sc-zonos-shipping{margin-top:24px}.sc-zonos-shipping-h zonos-button.sc-zonos-shipping{-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-shipping-h .zonos--group-btn.sc-zonos-shipping{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;z-index:1;margin-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:100%}.sc-zonos-shipping-h .zonos--shipping-options-wrapper.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:24px;-ms-flex-align:center;align-items:center;background:transparent;width:100%;border:none;cursor:pointer;position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-transition:0.5s all ease;transition:0.5s all ease}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping zonos-icon.sc-zonos-shipping{-webkit-transition:-webkit-transform 0.3s ease;transition:-webkit-transform 0.3s ease;transition:transform 0.3s ease;transition:transform 0.3s ease, -webkit-transform 0.3s ease}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.collapsed.sc-zonos-shipping{margin-bottom:0}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.collapsed.sc-zonos-shipping zonos-icon.sc-zonos-shipping{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping::before,.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping::after{content:"";display:block;width:80%;height:1px;background-color:var(--zonos-elements-border-color);-ms-flex-negative:1;flex-shrink:1}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping .zonos--title-wrapper.sc-zonos-shipping{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:row;flex-direction:row;gap:8px;-ms-flex-align:center;align-items:center}.sc-zonos-shipping-h .zonos--dap-wrapper.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}.mobile.mobile.sc-zonos-shipping-h{-ms-scroll-chaining:chained;overscroll-behavior:auto}.mobile.mobile.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{-ms-scroll-chaining:chained;overscroll-behavior:auto}';export{uo as zonos_cart_items,mo as zonos_cart_restricted_items,go as zonos_cart_subtotal,bo as zonos_checkout_finish,yo as zonos_checkout_footer,xo as zonos_checkout_payment,vo as zonos_checkout_progress_tabs,ko as zonos_currency_toggle,Co as zonos_customer_info,Lo as zonos_rest_state,So as zonos_review,Io as zonos_shipping}
@@ -1 +0,0 @@
1
- import{d as s}from"./p-ab0b23f2.js";import{h as t,l as e}from"./p-41dd1cb8.js";const o={},a={},r=async({attributes:r,checkoutSessionId:i})=>{var u;if(o[i]||(o[i]=new Map),r.forEach((s=>{var t;s.value&&(null===(t=o[i])||void 0===t||t.set(s.key,s.value))})),r.length)return a[i]||(a[i]=(u=i,s((async()=>{var s,a;const r=Array.from((null===(s=o[u])||void 0===s?void 0:s.entries())||[]).map((([s,t])=>({key:s,value:t}))),{errors:i,json:n}=await t("/api/zonos-elements/update-checkout-session-attributes",{body:{attributes:r,id:u},method:"POST"});return i.length?(e("Error updating checkout session attributes",i),{success:!1}):(null===(a=o[u])||void 0===a||a.clear(),{success:!!(null==n?void 0:n.success)})}),1e3,{maxWait:5e3}))),a[i]()};export{r as u}
@@ -1,18 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(n,r,e,t){function o(n){return n instanceof e?n:new e((function(r){r(n)}))}return new(e||(e=Promise))((function(e,i){function a(n){try{c(t.next(n))}catch(n){i(n)}}function u(n){try{c(t["throw"](n))}catch(n){i(n)}}function c(n){n.done?e(n.value):o(n.value).then(a,u)}c((t=t.apply(n,r||[])).next())}))};var __generator=this&&this.__generator||function(n,r){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,o,i,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(n){return function(r){return c([n,r])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(e=0)),e)try{if(t=1,o&&(i=u[0]&2?o["return"]:u[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;if(o=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;o=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1];i=u;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(u);break}if(i[2])e.ops.pop();e.trys.pop();continue}u=r.call(n,e)}catch(n){u=[6,n];o=0}finally{t=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-3689821f.system.js","./p-b6a36c25.system.js","./p-77c2e465.system.js","./p-01174496.system.js","./p-1bf9a1b9.system.js","./p-d938f42f.system.js","./p-6a195559.system.js"],(function(n){"use strict";var r,e,t,o,i,a,u,c,s,f,d,l,v,p,y,h,b,w,m,_,j,P,k,g;return{setters:[function(n){r=n.z;e=n.c},function(n){t=n.t;o=n.y;i=n.b;a=n.d;u=n.v;c=n.w;s=n.x;f=n.z;d=n.r;l=n.h;v=n.F},function(n){p=n.t;y=n.s},function(n){h=n.h;b=n.g;w=n.l;m=n.j},function(n){_=n.i},function(n){j=n.l},function(n){P=n.i;k=n.e;g=n.s}],execute:function(){
2
- /*!
3
- * paypal-js v8.4.2 (2025-09-04T17:21:30.135Z)
4
- * Copyright 2020-present, PayPal, Inc. All rights reserved.
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- var E=this;function O(n,r){var e={};for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&r.indexOf(t)<0)e[t]=n[t];if(n!=null&&typeof Object.getOwnPropertySymbols==="function")for(var o=0,t=Object.getOwnPropertySymbols(n);o<t.length;o++){if(r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(n,t[o]))e[t[o]]=n[t[o]]}return e}typeof SuppressedError==="function"?SuppressedError:function(n,r,e){var t=new Error(e);return t.name="SuppressedError",t.error=n,t.suppressed=r,t};function I(n,r){var e=document.querySelector('script[src="'.concat(n,'"]'));if(e===null)return null;var t=C(n,r);var o=e.cloneNode();delete o.dataset.uidAuto;if(Object.keys(o.dataset).length!==Object.keys(t.dataset).length){return null}var i=true;Object.keys(o.dataset).forEach((function(n){if(o.dataset[n]!==t.dataset[n]){i=false}}));return i?e:null}function S(n){var r=n.url,e=n.attributes,t=n.onSuccess,o=n.onError;var i=C(r,e);i.onerror=o;i.onload=t;document.head.insertBefore(i,document.head.firstElementChild)}function A(n){var r=n.sdkBaseUrl,e=n.environment,t=O(n,["sdkBaseUrl","environment"]);var o=r||T(e);var i=t;var a=Object.keys(i).filter((function(n){return typeof i[n]!=="undefined"&&i[n]!==null&&i[n]!==""})).reduce((function(n,r){var e=i[r].toString();r=x(r);if(r.substring(0,4)==="data"||r==="crossorigin"){n.attributes[r]=e}else{n.queryParams[r]=e}return n}),{queryParams:{},attributes:{}}),u=a.queryParams,c=a.attributes;if(u["merchant-id"]&&u["merchant-id"].indexOf(",")!==-1){c["data-merchant-id"]=u["merchant-id"];u["merchant-id"]="*"}return{url:"".concat(o,"?").concat(B(u)),attributes:c}}function x(n){var r=function(n,r){return(r?"-":"")+n.toLowerCase()};return n.replace(/[A-Z]+(?![a-z])|[A-Z]/g,r)}function B(n){var r="";Object.keys(n).forEach((function(e){if(r.length!==0)r+="&";r+=e+"="+n[e]}));return r}function T(n){return n==="sandbox"?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"}function C(n,r){if(r===void 0){r={}}var e=document.createElement("script");e.src=n;Object.keys(r).forEach((function(n){e.setAttribute(n,r[n]);if(n==="data-csp-nonce"){e.setAttribute("nonce",r["data-csp-nonce"])}}));return e}function L(n,r){if(r===void 0){r=Promise}F(n,r);if(typeof document==="undefined")return r.resolve(null);var e=A(n),t=e.url,o=e.attributes;var i=o["data-namespace"]||"paypal";var a=M(i);if(!o["data-js-sdk-library"]){o["data-js-sdk-library"]="paypal-js"}if(I(t,o)&&a){return r.resolve(a)}return z({url:t,attributes:o},r).then((function(){var n=M(i);if(n){return n}throw new Error("The window.".concat(i," global variable is not available."))}))}function z(n,r){if(r===void 0){r=Promise}F(n,r);var e=n.url,t=n.attributes;if(typeof e!=="string"||e.length===0){throw new Error("Invalid url.")}if(typeof t!=="undefined"&&typeof t!=="object"){throw new Error("Expected attributes to be an object.")}return new r((function(n,r){if(typeof document==="undefined")return n();S({url:e,attributes:t,onSuccess:function(){return n()},onError:function(){var n=new Error('The script "'.concat(e,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return r(n)}})}))}function M(n){return window[n]}function F(n,r){if(typeof n!=="object"||n===null){throw new Error("Expected an options object.")}var e=n.environment;if(e&&e!=="production"&&e!=="sandbox"){throw new Error('The `environment` option must be either "production" or "sandbox".')}if(typeof r!=="undefined"&&typeof r!=="function"){throw new Error("Expected PromisePonyfill to be a function.")}}var q=function(n){return __awaiter(E,[n],void 0,(function(n){var r,e,t;var o=n.checkoutSessionId,i=n.paypalMockResponse;return __generator(this,(function(n){switch(n.label){case 0:return[4,h("/api/zonos-elements/capture-paypal-order",{body:{checkoutSessionId:o,paypalMockResponse:i},method:"POST"})];case 1:r=n.sent(),e=r.errors,t=r.json;return[2,{errors:e,json:t}]}}))}))};var D=function(n){return __awaiter(E,[n],void 0,(function(n){var r,e,t;var o=n.checkoutSessionId,i=n.intent;return __generator(this,(function(n){switch(n.label){case 0:return[4,h("/api/zonos-elements/create-paypal-order",{body:{checkoutSessionId:o,intent:i},method:"POST"})];case 1:r=n.sent(),e=r.errors,t=r.json;return[2,{errors:e,json:t}]}}))}))};var N=undefined&&undefined.__rest||function(n,r){var e={};for(var t in n)if(Object.prototype.hasOwnProperty.call(n,t)&&r.indexOf(t)<0)e[t]=n[t];if(n!=null&&typeof Object.getOwnPropertySymbols==="function")for(var o=0,t=Object.getOwnPropertySymbols(n);o<t.length;o++){if(r.indexOf(t[o])<0&&Object.prototype.propertyIsEnumerable.call(n,t[o]))e[t[o]]=n[t[o]]}return e};var R={purchase:"Purchase","zonos-checkout-payment-info":"AddPaymentInfo","zonos-checkout-start":"InitiateCheckout"};var U=function(n){var r;return(r=R[n])!==null&&r!==void 0?r:null};var Y=function(n){if(!n)return false;return Array.isArray(n.items)};var Z=function(n){if(!n)return{};if(!Y(n)){return Object.assign({},n)}var r=n.currency,e=n.items,t=n.transaction_id,o=n.value,i=N(n,["currency","items","transaction_id","value"]);var a=e.map((function(n){return{id:n.item_id,item_price:n.price,quantity:n.quantity}}));var u=e.map((function(n){return n.item_id}));var c=e.reduce((function(n,r){return n+r.quantity}),0);var s=Object.assign(Object.assign({},i),{content_ids:u,content_type:"product",contents:a,num_items:c});if(t){s.order_id=t}if(r!==undefined){s.currency=r}if(o!==undefined){s.value=o}return s};var H=function(){var n=r.checkoutSettings.analyticsProviders.find((function(n){return n.type==="FACEBOOK_PIXEL"}));return!!n&&n.status==="ENABLED"};var G=function(n,r,e){if(P()){k({event:r,fbqMode:n,payload:e,provider:"fbq"});return}if(typeof window.fbq==="function"){j("Zonos submits fbq event","log","".concat(n,":").concat(r));window.fbq(n,r,e)}};var K=function(n){var r=n.event,e=n.metadata;if(!H()){return}var t=b();var o=Z(e);var i=Object.assign(Object.assign({},o),t&&{isTestMode:true});var a=Object.fromEntries(Object.entries(i).filter((function(n){var r=n[0],e=n[1];return e!==null})));G("trackCustom",r,a);var u=U(r);if(u&&u!==r){G("track",u,a)}};var V=n("s",(function(n){g(n);K(n)}));var X=e((function(){return{intent:"capture",orderIdCreated:null,paypal:null,paypalButtons:[],paypalClientId:"",paypalErrorMessage:null}})),J=X.onChange,Q=X.reset,W=X.state;n({e:J,c:Q,a:W});var $=function(n){return __awaiter(E,[n],void 0,(function(n){var r,e,t,o,i,a,u;var c=n.checkoutSessionId;return __generator(this,(function(n){switch(n.label){case 0:t=W.intent.toUpperCase();return[4,D({checkoutSessionId:c,intent:t})];case 1:o=n.sent(),i=o.errors,a=o.json;u=(r=a===null||a===void 0?void 0:a.paypalOrderCreate)===null||r===void 0?void 0:r.paypalOrderId;if(i.length||!u){throw new Error(((e=i.find(Boolean))===null||e===void 0?void 0:e.message)||"An unexpected error occurred when creating paypal order.")}return[2,u]}}))}))};var nn=function(n){return __awaiter(E,[n],void 0,(function(n){var r,e,t,o,i,a;var u=n.checkoutSessionId,c=n.paypalMockResponse;return __generator(this,(function(n){switch(n.label){case 0:return[4,q({checkoutSessionId:u,paypalMockResponse:c})];case 1:t=n.sent(),o=t.errors,i=t.json;a=(r=i===null||i===void 0?void 0:i.paypalOrderCapture.order)===null||r===void 0?void 0:r.id;if(o.length||!a){throw new Error(((e=o.find(Boolean))===null||e===void 0?void 0:e.message)||p("An unexpected error occurred when processing PayPal order."))}return[2,a]}}))}))};var rn=function(n){var r=n.error;var e;var t=m(r.message);var o=(e=t===null||t===void 0?void 0:t.errors.find(Boolean))===null||e===void 0?void 0:e.message;var i=(o===null||o===void 0?void 0:o.match(/\[(.*?)\] (.*)/i))||[];if(!i){W.paypalErrorMessage=p("An unexpected error occurred when processing PayPal order.")}var a=i[2]||p("An unexpected error occurred when processing PayPal order.");W.paypalErrorMessage=a};var en=function(n){var e=n.checkoutSessionId,y=n.onPaypalFail,h=n.onPaypalSessionDone,b=n.overrideBorderRaidus,m=n.overridePrimaryColor;var j=m||r.appearance.colorPrimary;var P="#ffc33a";var k=_({backgroundColor1:P,backgroundColor2:j||""});return{createOrder:function(){return __awaiter(E,void 0,void 0,(function(){var n,r,b,m,_,j,P,k;return __generator(this,(function(g){switch(g.label){case 0:void t({checkoutSessionId:e,eventName:"checkout_paymentInfoCompleted",metadata:{paymentMethod:"paypal"}});return[4,o()];case 1:n=g.sent();if(!n.valid){W.paypalErrorMessage=n.errorMessage;i.hasPaymentError=false;i.customErrorMessage=null;V({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:e}});y===null||y===void 0?void 0:y();return[2,""]}g.label=2;case 2:g.trys.push([2,12,,13]);W.paypalErrorMessage=null;a.inventoryCheckErrorMessage=null;g.label=3;case 3:g.trys.push([3,5,,6]);r=a;return[4,u()];case 4:r.inventoryCheckErrorMessage=g.sent();return[3,6];case 5:b=g.sent();a.inventoryCheckErrorMessage=p("Unable to check inventory. Please try again.");return[3,6];case 6:if(a.inventoryCheckErrorMessage){return[2,""]}m=v();if(!(m>0))return[3,8];return[4,c()];case 7:_=g.sent();if(!_.success){W.paypalErrorMessage=_.error||p("Unable to apply store credit. Please try again.");y===null||y===void 0?void 0:y();return[2,""]}g.label=8;case 8:if(!s())return[3,10];return[4,f()];case 9:j=g.sent();if(!j.success){W.paypalErrorMessage=j.error||p("Unable to place order with store credit. Please try again.");y===null||y===void 0?void 0:y();return[2,""]}h===null||h===void 0?void 0:h({orderId:j.orderId||""});d();l();return[2,""];case 10:return[4,$({checkoutSessionId:e})];case 11:P=g.sent();return[2,P];case 12:k=g.sent();w("Failed to create paypal order",k);W.paypalErrorMessage=p("Failed to create PayPal order. Please try again, or consider using an alternative method.");i.hasPaymentError=false;i.customErrorMessage=null;V({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:e}});y===null||y===void 0?void 0:y();return[2,""];case 13:return[2]}}))}))},onApprove:function(n,r){return __awaiter(E,void 0,void 0,(function(){var n,r;return __generator(this,(function(t){switch(t.label){case 0:t.trys.push([0,2,,3]);W.paypalErrorMessage=null;V({event:"zonos-checkout-payment-info",metadata:{checkoutSessionId:e,paymentMethod:"paypal"}});return[4,nn({checkoutSessionId:e,paypalMockResponse:window.Zonos._paypalMockResponse})];case 1:n=t.sent();W.orderIdCreated=n;h===null||h===void 0?void 0:h({orderId:n});d();l();return[3,3];case 2:r=t.sent();w("==== Failed to capture paypal order",r);if(r instanceof Error){return[2,rn({error:r})]}y===null||y===void 0?void 0:y();return[3,3];case 3:return[2]}}))}))},style:{borderRadius:b==="SHARP"?0:10,color:k?"gold":"blue",shape:"rect"}}};var tn=function(){if(!W.paypalButtons.length){return}W.paypalButtons.forEach((function(n){return __awaiter(E,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return[4,n.close()];case 1:r.sent();return[2]}}))}))}));W.paypalButtons=[]};var on=n("b",(function(n){return __awaiter(E,[n],void 0,(function(n){var e,t,o,i,a,u;var c=n.currency;return __generator(this,(function(n){switch(n.label){case 0:t=!!((e=r.checkoutSettings.externalPaymentMethods)===null||e===void 0?void 0:e.find((function(n){return n.type==="PAYPAL"&&n.status==="ENABLED"})));if(!t){j("=== Paypal is disabled for this store","warn");return[2]}o=r.checkoutSettings.externalServiceTokens.find((function(n){return n.type==="PAYPAL_CLIENT_ID"}));if(!o){j("Failed to load paypal -- missing paypal publishable key","warn");return[2]}i=(!r.zonosMode||r.zonosMode==="production")&&r.checkoutSettings.mode==="LIVE"?"production":"sandbox";a=r.checkoutSettings.captureDelay&&r.checkoutSettings.captureDelay>0;W.intent=a?"authorize":"capture";j("==== Paypal order intent","info",W.intent);u=window.Zonos;return[4,L({clientId:o.token,currency:c,environment:i,intent:W.intent})];case 1:u.paypal=n.sent();W.paypal=window.Zonos.paypal;j("==== Paypal script loaded");return[2]}}))}))}));var an=n("d",(function(n){var r;var e=window.Zonos.paypal;if(!e){j("Paypal is not available");return null}var t=y.checkoutSessionId;if(!t){j("Paypal is not available due to checkoutSessionId is not available");return null}j("==== Loading Paypal buttons");tn();var o=[(r=e.FUNDING)===null||r===void 0?void 0:r.PAYPAL].filter(Boolean);W.paypalButtons=o.map((function(r){var o;var i=null;try{i=((o=e.Buttons)===null||o===void 0?void 0:o.call(e,Object.assign(Object.assign({},en(Object.assign({checkoutSessionId:t,fundingSource:r},n))),{fundingSource:r})))||null}catch(n){j("===== Failed to load paypal's \"".concat(r,'" button'),"warn",n)}if(i===null||i===void 0?void 0:i.isEligible()){j("==== Paypal button ".concat(r," loaded"));return i}return null})).filter(Boolean);return W.paypalButtons}));var un=n("p",(function(){var n,e;var t=((e=(n=r.checkoutSettings.externalPaymentMethods)===null||n===void 0?void 0:n.find((function(n){return n.type==="PAYPAL"})))===null||e===void 0?void 0:e.status)==="ENABLED";return t||!!W.paypalButtons.length}))}}}));
@@ -1 +0,0 @@
1
- System.register(["./p-eb99a625.system.js","./p-1bf9a1b9.system.js"],(function(r){"use strict";var f,n,t;return{setters:[function(r){f=r.i;n=r.t},function(r){t=r.i}],execute:function(){var o=r("g",(function(r){var o=r.backgroundColor,u=r.color;if(o===u){if(f(u)){var a=n(u).lighten(40).toHexString();return a}var e=n(u).darken(40).toHexString();return e}var c=t({backgroundColor1:o,backgroundColor2:u});if(c){return u}var v=[25,50,70];for(var i=0,s=v;i<s.length;i++){var b=s[i];var g=[n(u).darken(b).toHexString(),n(u).lighten(b).toHexString()];g.sort((function(r,f){return n.readability(o,f)-n.readability(o,r)}));for(var d=0,k=g;d<k.length;d++){var l=k[d];if(t({backgroundColor1:o,backgroundColor2:l})){return l}}}return n.readability(o,"#000000")>=n.readability(o,"#ffffff")?"#000000":"#ffffff"}))}}}));
@@ -1 +0,0 @@
1
- import{d as i}from"./p-ab0b23f2.js";import{d as r}from"./p-f3cfd8fa.js";var a=i,n=r,t=function(i,r,t){var f=!0,o=!0;if("function"!=typeof i)throw new TypeError("Expected a function");return n(t)&&(f="leading"in t?!!t.leading:f,o="trailing"in t?!!t.trailing:o),a(i,r,{leading:f,maxWait:r,trailing:o})};export{t}
@@ -1 +0,0 @@
1
- import{c as e,z as t}from"./p-f3cfd8fa.js";import{s as o,l as n,e as r,t as s,f as i,b as a}from"./p-adb9827c.js";import{l as d,b as l}from"./p-0a377722.js";import{h as c,l as u,f as m,g as v,a as p,s as h,j as y}from"./p-41dd1cb8.js";import{i as f}from"./p-d28be518.js";import{g as w}from"./p-db3b101a.js";const g=async()=>{if(!o.checkoutSessionId)return{errors:[{message:"No checkout session id found"}],json:null};const e=new URLSearchParams;e.set("checkoutSessionId",o.checkoutSessionId);const{errors:t,json:n}=await c(`/api/zonos-elements/get-checkout-session?${e.toString()}`);return{errors:t,json:n}},{reset:b,state:S}=e((()=>({amountToApply:null,appliedAmount:null,availableBalance:null,error:null,isApplying:!1,isEnabled:!1,orderIdCreated:null,remainingBalance:null,useFullBalance:!0}))),C=()=>{b()},O=e=>{d("Store credit balance from session","info",e),S.availableBalance=e},A=async()=>{var e,t;const{errors:o,json:n}=await g();if(o.length||!n)return void u("Failed to refresh store credit balance");const r=null!==(t=null===(e=n.checkoutSession.customerProfile)||void 0===e?void 0:e.storeCreditBalance)&&void 0!==t?t:null;O(r)},I=async()=>{var e;const t=o.checkoutSessionId;if(!t){const e="No checkout session found";return u(e),S.error=e,{error:e,success:!1}}d("Applying store credit","info",{checkoutSessionId:t}),S.isApplying=!0,S.error=null;try{const{errors:o,json:n}=await c("/api/zonos-elements/store-credit/apply",{body:{checkoutSessionId:t},method:"POST"});if(o.length>0||!n){const t=(null===(e=o[0])||void 0===e?void 0:e.message)||"Failed to apply store credit";return u(t),S.error=t,S.isApplying=!1,{error:t,success:!1}}return S.appliedAmount=n.amountApplied,S.remainingBalance=n.remainingBalance,S.isApplying=!1,d("Store credit applied","info",{amountApplied:n.amountApplied,remainingBalance:n.remainingBalance}),{error:null,success:!0}}catch(e){const t=e instanceof Error?e.message:"Failed to apply store credit";return u(t),S.error=t,S.isApplying=!1,{error:t,success:!1}}},k=e=>{S.isEnabled=e,S.error=null,e||(S.amountToApply=null)},N=e=>{if(null===e)return S.amountToApply=null,void(S.error=null);e<=0?S.error="Amount must be greater than zero":null!==S.availableBalance&&e>S.availableBalance?S.error="Amount exceeds available balance":e>we.total+(we.storeCredit||0)?S.error="Amount exceeds order total":(S.error=null,S.amountToApply=e)},T=e=>{if(S.useFullBalance=e,S.error=null,e&&null!==S.availableBalance){const e=Math.min(S.availableBalance,we.total+(we.storeCredit||0));S.amountToApply=e}else e||(S.amountToApply=null)},j=()=>S.isEnabled&&null!==S.availableBalance?S.useFullBalance?Math.min(S.availableBalance,we.total+(we.storeCredit||0)):S.amountToApply||0:0,E=()=>null!==S.amountToApply&&S.amountToApply>0&&we.storeCredit>0&&we.total<=0,P=async()=>{var e,t,n;const r=o.checkoutSessionId;if(!r){const e="No checkout session found";return u(e),S.error=e,{error:e,orderId:null,success:!1}}d("Creating store credit order","info",{checkoutSessionId:r});try{const{errors:o,json:s}=await c("/api/zonos-elements/store-credit/order-create",{body:{checkoutSessionId:r},method:"POST"});if(o.length>0||!s){const t=(null===(e=o[0])||void 0===e?void 0:e.message)||"Failed to create store credit order";return u(t),S.error=t,{error:t,orderId:null,success:!1}}const i=(null===(n=null===(t=s.checkoutSessionStoreCreditOrderCreate)||void 0===t?void 0:t.order)||void 0===n?void 0:n.id)||null;return S.orderIdCreated=i,d("Store credit order created","info",{orderId:i}),{error:null,orderId:i,success:!0}}catch(e){const t=e instanceof Error?e.message:"Failed to create store credit order";return u(t),S.error=t,{error:t,orderId:null,success:!1}}},D=({firstName:e,lastName:t,name:o})=>{var n;if(!o&&!e&&!t)return{firstName:"",lastName:""};const r=(null==o?void 0:o.split(/\s+/))||[];return{firstName:(null==e?void 0:e.trim())||(null===(n=r[0])||void 0===n?void 0:n.trim())||"",lastName:(null==t?void 0:t.trim())||r.slice(1).join(" ").trim()||""}},L=({currentAddress:e,translatedAddress:t})=>{var o,n,r,s,i,a;const{city:d,country:l,line1:c,line2:u,postal_code:m,state:v}=e.value.address,p=e.value.name||[e.value.firstName,e.value.lastName].join(" ");return{city:(null===(o=t.city)||void 0===o?void 0:o[d])||d,country:l,line1:(null===(n=t.line1)||void 0===n?void 0:n[c])||c,line2:(null===(r=t.line2)||void 0===r?void 0:r[u||""])||u||"",name:(null===(s=t.name)||void 0===s?void 0:s[p])||p,phone:e.value.phone||"",postal_code:(null===(i=t.postal_code)||void 0===i?void 0:i[m])||m,state:(null===(a=t.state)||void 0===a?void 0:a[v])||v}},x=e=>{var t;const s="1"===new URLSearchParams(window.location.search).get("zonosE2ETest"),i=q.stripeLinkEventData,a=q.stripeAddressEventData,d=q.stripeShippingSameAsBilling?q.stripeAddressEventData:q.stripeBillingAddressEventData;if(!a||!d)throw new Error("Missing stripe address data");const l=L({currentAddress:a,translatedAddress:q.translatedAddress.address}),{firstName:c,lastName:u}=D({name:l.name}),m=L({currentAddress:d,translatedAddress:q.translatedAddress.address}),{firstName:v,lastName:p}=D({name:m.name}),h=r()||"US";return{billingAddress:{addressLine1:m.line1,addressLine2:m.line2||"",city:m.city,country:m.country,postalCode:m.postal_code,state:m.state},billingContact:{firstName:v,lastName:p,phone:m.phone},cartCurrencyCode:null===(t=we.items[0])||void 0===t?void 0:t.currencyCode,cartId:e,checkoutSessionCountry:h||n.selectedCountryCode||void 0,checkoutSessionId:o.checkoutSessionId||"",contact:{companyName:q.companyName,email:null==i?void 0:i.value.email,firstName:c,lastName:u,phone:l.phone},isTest:!!s,landedCostAdjustments:we.promoCode?[{amount:0,productId:null,promoCode:we.promoCode,sku:null,type:"PROMO_CODE"}]:[],shipToShortAddressCode:q.shortAddressCode,shipToTaxId:q.taxId,shippingAddress:{addressLine1:l.line1,addressLine2:l.line2,city:l.city,country:l.country,postalCode:l.postal_code,state:l.state}}},R=()=>{const e="1"===new URLSearchParams(window.location.search).get("zonosE2ETest"),t=q.stripeLinkEventData,n=q.stripeAddressEventData,r=q.stripeShippingSameAsBilling?q.stripeAddressEventData:q.stripeBillingAddressEventData;if(d({stripeAddressData:n,stripeBillingAddressData:r},"info"),!n||!r)throw new Error("Missing stripe address data");const s=L({currentAddress:n,translatedAddress:q.translatedAddress.address}),{firstName:i,lastName:a}=D({name:s.name}),l=L({currentAddress:r,translatedAddress:q.translatedAddress.address}),{firstName:c,lastName:u}=D({name:l.name}),m=we.adjustments.map((e=>({amount:e.amount,name:e.description||null,productId:e.productId,sku:e.sku,type:e.type}))),v=we.promoCode?[{amount:0,productId:null,promoCode:we.promoCode,sku:null,type:"PROMO_CODE"},...m]:m;return{billingAddress:{addressLine1:l.line1,addressLine2:l.line2||"",city:l.city,country:l.country,postalCode:l.postal_code,state:l.state},billingContact:{firstName:c,lastName:u,phone:l.phone},checkoutSessionId:o.checkoutSessionId||"",contact:{companyName:q.companyName,email:null==t?void 0:t.value.email,firstName:i,lastName:a,phone:s.phone},isTest:e,items:we.items,landedCostAdjustments:v,shipToShortAddressCode:q.shortAddressCode,shipToTaxId:q.taxId,shippingAddress:{addressLine1:s.line1,addressLine2:s.line2,city:s.city,country:s.country,postalCode:s.postal_code,state:s.state}}};const z=async e=>{const o=window.Zonos.cartId;if(!o)return await(async e=>{var o;const n=t.checkoutSettings.buildLandedCost;if(n){const e=await(async e=>{var t,o,n,r,s;const i=R(),a=await e({billingAddress:i.billingAddress,billingContact:i.billingContact,checkoutSessionId:i.checkoutSessionId,contact:i.contact,landedCostAdjustments:i.landedCostAdjustments,publicCredential:window.Zonos.zonosApiKey||"",shippingAddress:i.shippingAddress,zonosApiRoute:m.vercel},{promoCode:we.promoCode});if(!a||!(null===(t=a.checkoutSessionWorkflow)||void 0===t?void 0:t.length)&&(null===(o=a.errors)||void 0===o?void 0:o.length))throw new Error(`Failed to build landed cost: ${(null===(r=null===(n=null==a?void 0:a.errors)||void 0===n?void 0:n[0])||void 0===r?void 0:r.message)||"Unknown error"}`);const{errors:d,json:l}=await c("/api/zonos-elements/validate-landed-cost",{body:a,headers:{"Content-Type":"application/json"},method:"POST"});if(!l||d.length)throw new Error(`Invalid landed cost object: ${(null===(s=d.find(Boolean))||void 0===s?void 0:s.message)||"Unknown error"}`);return a})(n);return e}const{errors:r,json:s}=await c("/api/zonos-elements/calculate-landed-cost",{body:R(),method:"POST",signal:null==e?void 0:e.signal});if(r.length||!s){if("The user aborted a request."===(null===(o=r[0])||void 0===o?void 0:o.message))throw new Error("The landed cost calculation request was aborted to initiate a new one.");if(r.forEach((e=>{console.warn(`Error calculating landed cost: ${e.message}`)})),!s)throw new Error("Failed to calculate landed cost");return s}return s})(e);const n=await(async({abortController:e,cartId:t})=>{var o,n,r,s,i;const{errors:a,json:d}=await c("/api/zonos-elements/cart-calculate-landed-cost",{body:x(t),method:"POST",signal:null==e?void 0:e.signal});if(a.length||!d){const e="string"==typeof(null===(o=a[0])||void 0===o?void 0:o.message)&&("The user aborted a request."===(null===(n=a[0])||void 0===n?void 0:n.message)||(null===(r=a[0])||void 0===r?void 0:r.message.includes("signal is aborted"))||(null===(s=a[0])||void 0===s?void 0:s.message.includes("The operation was aborted"))||(null===(i=a[0])||void 0===i?void 0:i.message.includes("Fetch is aborted")));throw new Error(e?"The landed cost calculation request was aborted to initiate a new one.":"Failed to calculate landed cost")}return d})({abortController:e,cartId:o}),{cartWorkflow:r}=n,s=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(o[n[r]]=e[n[r]])}return o}(n,["cartWorkflow"]);return Object.assign(Object.assign({},s),{itemCreateWorkflow:r.items})},U=async({checkoutSessionId:e,eventName:o,metadata:r})=>{var s,i;const a=Date.now(),d=[...window.Zonos.trackEventLogs];window.Zonos.trackEventLogs.push({checkoutSessionId:e,eventCreated:a,eventName:o});const u=window.location.href.includes("zonos.com")&&!window.location.href.includes("checkout.zonos.com")||!!(null===(s=window.Zonos)||void 0===s?void 0:s.zonosQaUrl)||!!(null===(i=window.Zonos)||void 0===i?void 0:i.debug);if((v()||p()||u)&&!window.Zonos.zonosConversionTest)return;const m=n.selectedCountryCode,y=t.organizationId;if(!e)return void h({endpoint:"trackConversionEventMetric",errors:[`Event "${o}" - No checkout session id found`],metadata:{allLogs:l,checkoutSessionId:e,eventName:o,metadata:r,organizationId:y,trackEventLogs:d}});y||h({endpoint:"trackConversionEventMetric",errors:[`Event "${o}" - No organization id found`],metadata:{allLogs:l,checkoutSessionId:e,eventName:o,metadata:r,organizationId:y,trackEventLogs:d}});const f={checkoutSessionId:e,countryCode:m,eventCreated:a,eventName:o,metadata:Object.assign(Object.assign({},r),{trackEventLogs:d}),organizationId:y};await c("/api/zonos-elements/track-conversion-event",{body:f,method:"POST"})},_=({address:e,invalidAdddressList:t})=>{if(!e)return;if(!t)return;const o={};return t.city&&(o.city=e.city),t.line1&&(o.line1=e.line1),t.line2&&(o.line2=e.line2),t.postal_code&&(o.postal_code=e.postal_code),t.state&&(o.state=e.state),t.name&&(o.name=e.name),Object.keys(o).length?o:void 0},B=e=>e.sort(((e,t)=>e.amount-t.amount)),F=async()=>{var e;const{errors:t,json:o}=await g();return t.length||!o?(u("Failed to retrieve checkout session info before confirming payment ",t),h({endpoint:"validateCheckoutSession",errors:t.map((e=>e.message)),metadata:{allLogs:l}}),{errorMessage:s("Unable to retrieve the checkout session at the moment. Please try again or contact our support team."),valid:!1}):(null===(e=o.checkoutSession.landedCost)||void 0===e?void 0:e.id)?{errorMessage:"",valid:!0}:(u("Landed cost is not found in the checkout session before confirming payment."),h({endpoint:"validateCheckoutSession",errors:["No landed cost found before confirming payment"],metadata:{allLogs:l}}),{errorMessage:s('No shipment rating selected. Please go back to the "Shipping" step and select a shipment rating to proceed.'),valid:!1})},J=({theme:e})=>{const o={".AccordionItem":{color:"var(--colorText)"},".AccordionItem--selected":{color:"var(--colorText)"},".Action":{color:"var(--colorText)"},".Input":{boxShadow:"none",fontSize:t.appearance.fontSizeInputValue?`${t.appearance.fontSizeInputValue}px`:void 0,padding:"0",paddingBottom:"8px",paddingLeft:"16px",paddingRight:"8px",paddingTop:"6px"},".Label--resting":{fontSize:t.appearance.fontSizeInputLabel?`${t.appearance.fontSizeInputLabel}px`:void 0},".PickerItem--highlight":{boxShadow:"0 0 0 2px var(--colorBackground)"},".PickerItem--highlight:hover":{backgroundColor:"var(--colorBackground)",boxShadow:"none"},".PickerItem--new":{color:"var(--colorText)"},".Tab--selected":{borderStyle:"solid",borderWidth:"1px"}};return"DARK"===e?Object.assign(Object.assign({},o),{".Action":Object.assign(Object.assign({},o[".Action"]),{color:"white"}),".PickerItem--new":Object.assign(Object.assign({},o[".PickerItem--new"]),{color:"white"})}):o},M=({borderStyle:e,theme:t})=>"DARK"===t?{borderRadius:w({overrideBorderStyle:e}),colorBackground:"#101117",colorBackgroundText:"#C5C6CA",colorText:"#C5C6CA",colorTextPlaceholder:"#C5C6CA"}:{borderRadius:w({overrideBorderStyle:e}),iconMenuColor:"var(--colorText)",iconMenuHoverColor:"var(--colorText)"},{onChange:W,reset:$,state:q}=e((()=>({checkoutSettlementCurrency:"USD",clientSecret:sessionStorage.getItem("zonos--client-secret")||"",companyName:"",companyNameUsedWhenAsyncAddressUpdate:"",customAddressErrors:{city:"",firstName:"",lastName:"",line1:"",phone:"",postalCode:"",showError:!1,state:""},customBillingAddressErrors:{city:"",firstName:"",lastName:"",line1:"",phone:"",postalCode:"",showError:!1,state:""},customErrorMessage:null,customerProfile:null,fetchingLandedCostAbortController:null,hasPaymentError:!1,isFetchingLandedCost:!1,isFetchingSession:!1,partyBillingId:null,partyShippingId:null,shortAddressCode:"",shouldInventoryRefund:!1,shouldRenderPayInUsdButton:!1,skipPaymentIntent:"0"!==new URLSearchParams(window.location.search).get("skipPaymentIntent"),stripe:null,stripeAddressElement:null,stripeAddressEventData:null,stripeAddressUsedWhenAsyncAddressUpdate:null,stripeAddressUsedWhenFetchingLC:null,stripeAddressUsedWhenValidatingAddress:null,stripeBillingAddressElement:null,stripeBillingAddressEventData:null,stripeBillingAddressUsedWhenAsyncAddressUpdate:null,stripeBillingAddressUsedWhenFetchingLC:null,stripeBillingAddressUsedWhenValidatingAddress:null,stripeCustomerSessionClientSecret:null,stripeElements:null,stripeElementsForBillingAddress:null,stripeElementsOptions:null,stripeLinkElement:null,stripeLinkEventData:null,stripeLinkUsedWhenFetchingLC:null,stripePaymentElement:null,stripePaymentEventData:null,stripeShippingSameAsBilling:!0,taxId:"",taxIdUsedWhenAsyncAddressUpdate:"",translatedAddress:{address:{},billingAddress:{},firstName:{},lastName:{},name:{}}}))),Y=()=>{window.sessionStorage.removeItem("zonos--bigcommerce-domestic-checkout-shipping")},H=e=>{window.sessionStorage.setItem("zonos--bigcommerce-domestic-checkout-shipping",JSON.stringify(e))},K=()=>{const e=window.sessionStorage.getItem("zonos--bigcommerce-domestic-checkout-shipping");return y(e)},G=async e=>{var o,r;const s=q.clientSecret;if(!q.stripe)return void d("Skip. Stripe is not initialized");const i=(({clientSecret:e,overrideBorderRadius:o,overridePrimaryColor:r,overrideSecondaryColor:s,overrideTheme:i,paypalEnabled:a})=>{const d=r||t.appearance.colorPrimary,l=s||t.appearance.colorSecondary,c=(window.Zonos.isCollect||window.Zonos.isInvoice?"DARK"===t.appearance.theme:d&&f(d))?"night":"flat",u="DARK"===i?"night":"flat",m=a?["external_paypal"]:[];return{appearance:{labels:"floating",rules:Object.assign({},J({theme:i||"LIGHT"})),theme:i?u:c,variables:Object.assign(Object.assign({},M({borderStyle:o,theme:"LIGHT"})),{colorPrimary:l})},clientSecret:e||void 0,customerSessionClientSecret:q.stripeCustomerSessionClientSecret||void 0,externalPaymentMethodTypes:[...m],locale:n.selectedLocale}})({clientSecret:s,overrideBorderRadius:null==e?void 0:e.overrideBorderRadius,overridePrimaryColor:null==e?void 0:e.overridePrimaryColor,overrideSecondaryColor:null==e?void 0:e.overrideSecondaryColor,overrideTheme:null==e?void 0:e.overrideTheme,paypalEnabled:null==e?void 0:e.paypalEnabled}),a=JSON.stringify(i)===JSON.stringify(q.stripeElementsOptions);if(!q.stripeElements||!q.stripeElementsForBillingAddress)return q.stripeElementsForBillingAddress=null===(o=q.stripe)||void 0===o?void 0:o.elements(i),d("Stripe elements for billing address initialized"),q.stripeElements=null===(r=q.stripe)||void 0===r?void 0:r.elements(i),q.stripeElementsOptions=i,void d("Stripe elements initialized");a||(q.stripeElements.update(i),q.stripeElementsForBillingAddress.update(i),q.stripeElementsOptions=i,q.stripeElements.fetchUpdates()),d("Stripe elements updated")},V=()=>{sessionStorage.removeItem("zonos--client-secret"),$(),q.stripe=window.Zonos.stripe},Z=({address:e,firstName:t,lastName:n,name:r,phone:s})=>{const{firstName:i,lastName:a}=D({firstName:t,lastName:n,name:r});return i&&a||h({endpoint:"PARTY_CREATE_NO_NAME_FOUND",errors:["No name found"],metadata:{allLogs:l,cartId:window.Zonos.cartId,checkoutSessionId:o.checkoutSessionId,firstName:t,lastName:n,name:r}}),s||h({endpoint:"PARTY_CREATE_NO_PHONE_FOUND",errors:["No phone found"],metadata:{allLogs:l,cartId:window.Zonos.cartId,checkoutSessionId:o.checkoutSessionId,phone:s}}),{city:e.city,country:e.country,firstName:i,lastName:a,line1:e.line1,line2:e.line2,phone:s||"",postal_code:e.postal_code,state:e.state}},Q=async()=>{var e,t,n,r;if(!(null===(e=q.stripeAddressEventData)||void 0===e?void 0:e.complete)||!q.stripeShippingSameAsBilling&&!(null===(t=q.stripeBillingAddressEventData)||void 0===t?void 0:t.complete)||!q.stripeBillingAddressEventData)return{partiesCreated:!1};if(!we.landedCostData)return{partiesCreated:!1};const s=null===(n=we.landedCostData.find(Boolean))||void 0===n?void 0:n.landedCost.rootId;if(!s)return h({endpoint:"PF_NO_SELECTED_LANDED_COST",errors:["No selected landed cost"],metadata:{allLogs:l,cartId:window.Zonos.cartId,checkoutSessionId:o.checkoutSessionId}}),{partiesCreated:!1};const i=(()=>{var e,t,o,n,r,s,i,a;const d=null===(e=we.partiesData.find((e=>"DESTINATION"===e.type)))||void 0===e?void 0:e.id,l=null===(t=we.partiesData.find((e=>"PAYOR"===e.type)))||void 0===t?void 0:t.id;if(!d||!l)return!1;if(q.partyShippingId!==d||q.partyBillingId!==l)return!0;const c=JSON.stringify(null===(o=q.stripeLinkUsedWhenFetchingLC)||void 0===o?void 0:o.value)!==JSON.stringify(null===(n=q.stripeLinkEventData)||void 0===n?void 0:n.value),u=JSON.stringify(null===(r=q.stripeAddressUsedWhenAsyncAddressUpdate)||void 0===r?void 0:r.value)!==JSON.stringify(null===(s=q.stripeAddressEventData)||void 0===s?void 0:s.value),m=!q.stripeShippingSameAsBilling&&JSON.stringify(null===(i=q.stripeBillingAddressUsedWhenAsyncAddressUpdate)||void 0===i?void 0:i.value)!==JSON.stringify(null===(a=q.stripeBillingAddressEventData)||void 0===a?void 0:a.value);return c||u||m||q.taxIdUsedWhenAsyncAddressUpdate!==q.taxId||q.companyNameUsedWhenAsyncAddressUpdate!==q.companyName})();if(!i)return{partiesCreated:!1};const a=Z({address:q.stripeAddressEventData.value.address,firstName:q.stripeAddressEventData.value.firstName,lastName:q.stripeAddressEventData.value.lastName,name:q.stripeAddressEventData.value.name,phone:q.stripeAddressEventData.value.phone}),d=q.stripeShippingSameAsBilling?a:Z({address:q.stripeBillingAddressEventData.value.address,firstName:q.stripeBillingAddressEventData.value.firstName,lastName:q.stripeBillingAddressEventData.value.lastName,name:q.stripeBillingAddressEventData.value.name,phone:q.stripeBillingAddressEventData.value.phone}),m="1"===new URLSearchParams(window.location.search).get("zonosE2ETest"),{errors:v,json:p}=await c("/api/zonos-elements/create-parties",{body:{address:a,billingAddress:d,companyName:q.companyName,email:(null===(r=q.stripeLinkEventData)||void 0===r?void 0:r.value.email)||"",isTest:m,rootId:s,shortAddressCode:q.shortAddressCode,taxId:q.taxId},method:"POST"});return v.length||!p?(u("Error occurs when creating parties",JSON.stringify(v,null,2)),h({endpoint:"PF_PARTY_CREATE_FAILED",errors:["Failed to create parties"],metadata:{allLogs:l,cartId:window.Zonos.cartId,checkoutSessionId:o.checkoutSessionId,errors:v,json:p}}),{partiesCreated:!1}):(q.companyNameUsedWhenAsyncAddressUpdate=q.companyName,q.stripeAddressUsedWhenAsyncAddressUpdate=q.stripeAddressEventData,q.stripeBillingAddressUsedWhenAsyncAddressUpdate=q.stripeBillingAddressEventData,q.taxIdUsedWhenAsyncAddressUpdate=q.taxId,q.partyBillingId=p.billToPartyId,q.partyShippingId=p.shipToPartyId,we.partiesData=we.partiesData.map((e=>"DESTINATION"===e.type&&e.id!==p.shipToPartyId?Object.assign(Object.assign({},e),{id:p.shipToPartyId}):"PAYOR"===e.type&&e.id!==p.billToPartyId?Object.assign(Object.assign({},e),{id:p.billToPartyId}):e)),{partiesCreated:!0})},X=e=>({countryCode:e.address.country,postalCode:e.address.postal_code,state:e.address.state}),ee=async e=>{var n,r,s,i;const a=(null==e?void 0:e.retries)||0,l=!!(null==e?void 0:e.applyingPromocode),c=(()=>{var e;const t=we.landedCostData&&(null===(e=we.landedCostData.find(Boolean))||void 0===e?void 0:e.subtotals.items)!==we.subtotal,o=(()=>{var e,t;const o=JSON.stringify(null===(e=q.stripeLinkUsedWhenFetchingLC)||void 0===e?void 0:e.value)!==JSON.stringify(null===(t=q.stripeLinkEventData)||void 0===t?void 0:t.value),n=q.stripeAddressEventData&&JSON.stringify(X(q.stripeAddressEventData.value))!==JSON.stringify(q.stripeAddressUsedWhenFetchingLC),r=!q.stripeShippingSameAsBilling&&q.stripeBillingAddressEventData&&JSON.stringify(X(q.stripeBillingAddressEventData.value))!==JSON.stringify(q.stripeBillingAddressUsedWhenFetchingLC);return o||n||r})();return d("isPrefetchInfoOutdated","info",{isAddressOutdated:o}),!we.landedCostData&&!q.isFetchingLandedCost||o||t})();if(!(()=>{var e,o,n,r;const s=!!(null===(e=q.stripeLinkEventData)||void 0===e?void 0:e.complete),i=!!(null===(o=q.stripeAddressEventData)||void 0===o?void 0:o.complete),a=q.stripeShippingSameAsBilling?i:!!(null===(n=q.stripeBillingAddressEventData)||void 0===n?void 0:n.complete),d=(e=>{var o,n;const r=null===(o=t.genericSettings)||void 0===o?void 0:o.countryFields,s=null===(n=t.genericSettings)||void 0===n?void 0:n.stripeCountryFieldLabels;return"stripe"===we.addressFormRenderType&&(s&&e in s?s[e]:null)||(r&&e in r?r[e]:null)})((null===(r=q.stripeAddressEventData)||void 0===r?void 0:r.value.address.country)||"US");return!!(i&&a&&s)||(d&&q.stripeAddressEventData?s&&q.stripeAddressEventData.value.firstName&&q.stripeAddressEventData.value.lastName&&q.stripeAddressEventData.value.address.line1.length>0&&(!d.stateRequired||d.stateRequired&&q.stripeAddressEventData.value.address.state.length>0)&&(!d.zipRequired||d.zipRequired&&q.stripeAddressEventData.value.address.postal_code.length>=3)&&q.stripeAddressEventData.value.phone&&q.stripeAddressEventData.value.phone.length>0:i&&a&&s)})())return{isRequestNotReady:!0};if(c&&(null===(n=q.fetchingLandedCostAbortController)||void 0===n||n.abort(),q.fetchingLandedCostAbortController=null),!c&&!l)return{isRequestNotReady:!1};a?(q.isFetchingLandedCost=!1,setTimeout((()=>{q.isFetchingLandedCost=!0}),300)):q.isFetchingLandedCost=!0,q.stripeAddressEventData&&(q.stripeAddressUsedWhenFetchingLC={countryCode:q.stripeAddressEventData.value.address.country,postalCode:q.stripeAddressEventData.value.address.postal_code,state:q.stripeAddressEventData.value.address.state}),q.stripeBillingAddressEventData&&(q.stripeBillingAddressUsedWhenFetchingLC={countryCode:q.stripeBillingAddressEventData.value.address.country,postalCode:q.stripeBillingAddressEventData.value.address.postal_code,state:q.stripeBillingAddressEventData.value.address.state}),q.stripeLinkEventData&&(q.stripeLinkUsedWhenFetchingLC=Object.assign({},q.stripeLinkEventData));try{xe(),await(async()=>{var e;const t=new AbortController;q.fetchingLandedCostAbortController=t,xe();const{checkoutSessionWorkflow:n,errors:r,itemCreateWorkflow:s,landedCostCalculateWorkflow:i,partyCreateWorkflow:a,shipmentRatingCalculateWorkflow:d}=await z(t);we.customQuotingError=(null===(e=null==r?void 0:r.find((e=>{var t;return"CUSTOM"===(null===(t=e.extensions)||void 0===t?void 0:t.ruleMessageType)})))||void 0===e?void 0:e.message)||null,we.shippingData=B((null==d?void 0:d.filter(Boolean))||[]),Ce(s),q.fetchingLandedCostAbortController=null,we.partiesData=(null==a?void 0:a.filter(Boolean))||[],we.landedCostData=(null==n?void 0:n.map((e=>{const t=null==i?void 0:i.find((t=>(null==t?void 0:t.id)===e.landedCostId));return t?Object.assign(Object.assign({},e),{landedCost:t}):null})).filter(Boolean))||[],(null==n?void 0:n.length)&&U({checkoutSessionId:o.checkoutSessionId,eventName:"checkout_quoteReceived"});const l=we.promoCodeApplied&&!we.landedCostData.find((e=>{var t;return null===(t=e.landedCost.appliedAdjustments)||void 0===t?void 0:t.find((e=>"PROMO_CODE"===e.type))}));we.promoCodeError=l,l||sessionStorage.setItem("zonos--promo-code",we.promoCode)})();const e=null===(r=we.shippingData)||void 0===r?void 0:r.find(Boolean),t=null===(s=we.landedCostData)||void 0===s?void 0:s.find((t=>t.landedCost.shipmentRating.id===(null==e?void 0:e.id))),n=t?t.subtotals:null;n&&ke({method:(null==t?void 0:t.landedCost.method)||"DDP",subtotals:n})}catch(t){if(we.landedCostData=[],we.shippingData=[],t instanceof Error&&t.message&&!["The landed cost calculation request was aborted to initiate a new one."].includes(t.message)){if(a<1)return await ee(Object.assign(Object.assign({},e),{retries:(a||0)+1})),{isRequestNotReady:!1};const o=null===(i=q.stripeAddressEventData)||void 0===i?void 0:i.value;h({endpoint:`Failed to fetch landed cost (${a} retries)`,errors:[t.message],metadata:{cartId:window.Zonos.cartId,shipToAddress:o}})}u(t)}return q.isFetchingLandedCost=!1,{isRequestNotReady:!1}},te=async()=>{var e,t;await ee({applyingPromocode:!0}),"payment"===we.step&&ze(),await Q();const o=null===(e=we.shippingData)||void 0===e?void 0:e.find(Boolean),n=null===(t=we.landedCostData)||void 0===t?void 0:t.find((e=>e.landedCost.id===(null==o?void 0:o.id)));o&&n&&await Pe({applySubtotalsOnly:!1,landedCostId:n.landedCostId,selectedShippingOption:o})},oe=()=>{we.promoCode="",sessionStorage.removeItem("zonos--promo-code"),we.promoCodeError=!1,we.promoCodeApplied=!1},ne=async()=>{"payment"===we.step&&ze(),oe(),await te()},re=e=>{let t=[],o=!0;const n=window.Zonos.isCollect,r=window.Zonos.isInvoice;switch(e){case"succeeded":t=[s("Your payment went through successfully! Thank you for shopping with us! We hope you had an enjoyable experience and your support means the world to us."),"",s("We've sent an email confirmation of the order details for your review. And our team is carefully preparing your order so it arrives on time.")],(n||r)&&(t=[s("Thank you for submitting your payment. We appreciate your prompt attention."),"",s("A confirmation email with your payment details has been sent for your records. If you have any questions or need support, our team is here to help.")]),o=!1;break;case"requires_capture":case"processing":t=[s("Payment processing. We'll update you when payment is received.")],o=!1;break;case"requires_payment_method":t=[s("Payment failed. Please try another payment method.")],n&&(t=[s("Payment failed. Please reload the page and try another payment method.")]);break;case"requires_action":o=!1,t=[s("Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction.")];default:t=[s("Something went wrong.")]}return{isError:o,messages:t}},se=async()=>{var e,o;const{onInventoryCheck:n}=t.checkoutSettings,r=!!(null===(o=null===(e=window.Zonos.cartData)||void 0===e?void 0:e.metadata.find((e=>"referenceId"===e.key)))||void 0===o?void 0:o.value);if(window.Zonos.isLegacyCheckout&&window.Zonos.cartData&&r){const{errors:e,json:t}=await c("/api/zonos-elements/legacy/inventory-check",{body:{cartData:window.Zonos.cartData},method:"POST"});return e.length||!t?(u("Error occurs when handling inventory refund","warn",JSON.stringify(e)),null):t.available&&204!==t.status?t.available||200===t.status?(q.shouldInventoryRefund=!0,null):null:s("The item you're looking for is currently unavailable in our inventory. Please check back later or contact support for assistance with availability.")}if("function"!=typeof n)return null;try{return await n({items:we.items},{translate:s,zonosApiRoute:m.vercel})}catch(e){const t=e instanceof Error?e.message:"Unknown error";throw h({endpoint:"onInventoryCheck",errors:[`cartId: ${window.Zonos.cartId} - ${t}`],metadata:{cartId:window.Zonos.cartId,href:window.location.href,items:we.items}}),e}},ie=async()=>{var e,t;const o=!!(null===(t=null===(e=window.Zonos.cartData)||void 0===e?void 0:e.metadata.find((e=>"referenceId"===e.key)))||void 0===t?void 0:t.value);window.Zonos.isLegacyCheckout&&window.Zonos.cartData&&o&&await c("/api/zonos-elements/legacy/inventory-refund",{body:{cartData:window.Zonos.cartData},method:"POST"})},ae=async({clientSecret:e,storybookForceStatus:t})=>{if(t){const{isError:e,messages:o}=re(t);return{error:e,messages:o}}const o=e||q.clientSecret;if(!q.stripe||!o)return u("Failed to retrieve payment intent. Stripe is not initialized"),{error:!0,message:[s("Something went wrong.")]};const{paymentIntent:n}=await q.stripe.retrievePaymentIntent(o),r=null==n?void 0:n.status,{isError:i,messages:a}=re(r);return{amount:null==n?void 0:n.amount,currency:null==n?void 0:n.currency,error:i,messages:a,paymentIntentId:null==n?void 0:n.id,paymentMethod:null==n?void 0:n.payment_method,status:r}},de=async e=>{var t,n;const r=!!(null===(t=q.stripePaymentEventData)||void 0===t?void 0:t.complete),i=q.stripeElements,a=q.stripe,l=q.clientSecret;if(q.customErrorMessage=null,!(null===(n=we.selectedLandedCost)||void 0===n?void 0:n.landedCost.id)&&!(null==e?void 0:e.noLandedCostCheck))throw new Error("Attempted to confirm the payment when no landed cost is found in store");const c=await F();if(!c.valid)throw q.customErrorMessage=c.errorMessage,new Error(c.errorMessage);const u=o.checkoutSessionId;if(a&&i&&r&&l&&u){const e=new URL(window.location.href);e.searchParams.set("payment_intent_client_secret",l),e.searchParams.set("zonosCheckoutSessionId",u),U({checkoutSessionId:u,eventName:"checkout_paymentInfoCompleted"});const{error:t,paymentIntent:o}=await a.confirmPayment({confirmParams:{return_url:e.toString()},elements:i,redirect:"if_required"});if(d("Payment intent confirmed","info",{error:t,paymentIntent:o}),"requires_action"===(null==o?void 0:o.status))throw new Error(s("Your selected payment method requires additional verification. Please follow the instructions provided by your payment provider to complete the transaction."));if(t){if("card_error"===t.type||"validation_error"===t.type)throw new Error(t.message);if("invalid_request_error"===t.type&&"payment_intent_unexpected_state"===t.code)return;throw new Error("An unexpected error occurred.")}if("requires_payment_method"===o.status)throw new Error(s("Payment failed. Please try another payment method."))}},le=()=>{var e;const t=we.items.reduce(((e,t)=>e+t.amount*t.quantity),0),r=o.enabledVariantTestKeys||[];return{adjustmentsAmount:we.adjustments.reduce(((e,t)=>e+t.amount),0),cartId:window.Zonos.cartId,currency:(null===(e=we.items.find(Boolean))||void 0===e?void 0:e.currencyCode)||"",customerAuthenticationToken:we.customerAuthenticationToken||void 0,isCollect:!!window.Zonos.isCollect,isInvoice:!!window.Zonos.isInvoice,itemsAmount:t,metadata:[{key:"language",value:n.selectedLocale}],presentmentCountryCode:n.selectedCountryCode,skipPaymentIntent:q.skipPaymentIntent,varianceTestInput:r}},ce=async()=>{var e;if(!o.checkoutSessionId)return h({endpoint:"Error creating payment intent",errors:["No checkout session id found when retrieving payment intent"],metadata:{allLogs:l,cartId:window.Zonos.cartId}}),void Ie({messages:[s("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:s("Error creating Checkout")});const{errors:t,json:n}=await c("/api/zonos-elements/create-payment-intent",{body:{checkoutSessionId:o.checkoutSessionId},method:"POST"}),r=null===(e=null==n?void 0:n.checkoutSessionPaymentIntentCreate)||void 0===e?void 0:e.clientSecret;if(t.length||!r)return u("Error occurs when getting payment intent",JSON.stringify(t,null,2)),h({endpoint:"Error creating payment intent",errors:t.map((e=>e.message)),metadata:{allLogs:l,cartId:window.Zonos.cartId,checkoutSessionId:o.checkoutSessionId,clientSecret:r}}),void Ie({messages:[s("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:s("Error creating Checkout")});Te(n.checkoutSessionPaymentIntentCreate)},ue=async()=>{var e,t;if(!n.targetCurrency)return u("Failed to create checkout session - missing localizationStore.targetCurrency"),!1;q.isFetchingSession=!0;const o=le();d("Checkout session body","info",o);const{errors:r,json:s}=await c("/api/zonos-elements/create-checkout-session",{body:o,method:"POST"});if(q.isFetchingSession=!1,r.length||!s){const t=null===(e=r.find((e=>e.message)))||void 0===e?void 0:e.message;if(Array.isArray(t)&&t.some((e=>"Cart is expired."===e.message)))throw new Error("Cart is expired.");return u("Error occurred when creating checkout session",JSON.stringify(r,null,2)),!1}const i=s.checkoutSessionCreate;return Te(i),ke({method:(null===(t=i.landedCost)||void 0===t?void 0:t.method)||"DDP",subtotals:i.subtotals}),d("Exchange rate updated for cart items (checkout session create)","info",we.exchangeRate),d("done-init-checkout-session"),!0},me=async()=>{const e=o.checkoutSessionId;if(!e)return u("Failed to update checkout session base currency"),!1;if("LOCAL"===t.checkoutSettings.allowedSettlementCurrencies)return d('allowedSettlementCurrencies: "LOCAL". Skip updating checkout session base currency'),!0;const{json:n}=await c("/api/zonos-elements/update-checkout-session-base-currency",{body:{checkoutSessionId:e,currencyCode:q.checkoutSettlementCurrency},method:"POST"}),r=null==n?void 0:n.checkoutSessionBaseCurrencyUpdate.subtotals.presentmentCurrencyCode;return n&&r===q.checkoutSettlementCurrency?(d(`Updated checkout session to settlement currency "${r}".`),!0):(u("Failed to update checkout session base currency"),!1)},ve=async({adjustmentsAmount:e,cartId:t,currency:r,id:s,itemsAmount:i,landedCostId:a,presentmentCountryCode:d,storeCreditApplication:l})=>{const m=o.enabledVariantTestKeys||[],{errors:v,json:p}=await c("/api/zonos-elements/update-checkout-session",{body:{adjustmentsAmount:e,billToPartyId:q.partyBillingId,cartId:t,currency:r,customerAuthenticationToken:we.customerAuthenticationToken||void 0,id:s,itemsAmount:i,landedCostId:a,metadata:[{key:"language",value:n.selectedLocale}],presentmentCountryCode:d,shipToPartyId:q.partyShippingId,skipPaymentIntent:q.skipPaymentIntent,storeCreditApplication:l,varianceTestInput:m},method:"POST"});return v.length||!p?(u("Error occurs when updating checkout session",JSON.stringify(v,null,2)),{errors:v,json:p}):{errors:[],json:p}},pe=({currentAddress:e,translatedAddressResult:t})=>{const o={};if(!t)return o;const{city:n,line1:r,line2:s,name:i,postal_code:a,state:d}=t;return e.city&&n&&(o.city={[e.city]:n}),e.line1&&r&&(o.line1={[e.line1]:r}),e.line2&&s&&(o.line2={[e.line2]:s}),e.postal_code&&a&&(o.postal_code={[e.postal_code]:a}),e.state&&d&&(o.state={[e.state]:d}),e.name&&i&&(o.name={[e.name]:i}),o},he=async({addressInvalidCharactersList:e,billingAddressInvalidCharactersList:t})=>{var o,n,r,s;const i=(({addressInvalidCharactersList:e,billingAddressInvalidCharactersList:t,stripeAddressEventData:o,stripeBillingAddressEventData:n,stripeShippingSameAsBilling:r})=>{const s=!!(null==o?void 0:o.complete);if(!s||!(r?s:null==n?void 0:n.complete))return null;if(!e&&!t)return null;const i=o.value,a=(null==n?void 0:n.value)||null,{firstName:d,lastName:l}=D({firstName:i.firstName,lastName:i.lastName,name:i.name}),c=`${d} ${l}`,{firstName:u,lastName:m}=D({firstName:null==a?void 0:a.firstName,lastName:null==a?void 0:a.lastName,name:(null==a?void 0:a.name)||""}),v=u&&m?`${u} ${m}`:"",p=i.address,h=null==a?void 0:a.address;return{address:_({address:Object.assign(Object.assign({},p),{name:c}),invalidAdddressList:e}),billingAddress:r?void 0:_({address:h?Object.assign(Object.assign({},h),{name:v}):null,invalidAdddressList:t}),destinationCountry:p.country}})({addressInvalidCharactersList:e,billingAddressInvalidCharactersList:t,stripeAddressEventData:q.stripeAddressEventData,stripeBillingAddressEventData:q.stripeBillingAddressEventData,stripeShippingSameAsBilling:q.stripeShippingSameAsBilling});if(!i)return void(q.translatedAddress={address:{},billingAddress:{}});const a=(()=>{var e,t,o,n;const r=JSON.stringify(null===(e=q.stripeAddressUsedWhenValidatingAddress)||void 0===e?void 0:e.value)!==JSON.stringify(null===(t=q.stripeAddressEventData)||void 0===t?void 0:t.value),s=!q.stripeShippingSameAsBilling&&JSON.stringify(null===(o=q.stripeBillingAddressEventData)||void 0===o?void 0:o.value)!==JSON.stringify(null===(n=q.stripeBillingAddressUsedWhenValidatingAddress)||void 0===n?void 0:n.value);return r||s})();if(!a)return;const{errors:d,json:l}=await c("/api/zonos-elements/validate-address",{body:i,method:"POST"});if(d.length||!l)return u("Error occurs when translating address to latin",JSON.stringify(d,null,2)),void(q.translatedAddress={address:{},billingAddress:{}});q.stripeAddressUsedWhenValidatingAddress=q.stripeAddressEventData,q.stripeBillingAddressUsedWhenValidatingAddress=q.stripeBillingAddressEventData;const m=null===(o=q.stripeAddressEventData)||void 0===o?void 0:o.value.address,v=null===(n=q.stripeBillingAddressEventData)||void 0===n?void 0:n.value.address;q.translatedAddress={address:m?pe({currentAddress:Object.assign(Object.assign({},m),{name:null===(r=q.stripeAddressEventData)||void 0===r?void 0:r.value.name}),translatedAddressResult:l.address||null}):{},billingAddress:q.stripeShippingSameAsBilling?{}:pe({currentAddress:Object.assign(Object.assign({},v),{name:null===(s=q.stripeBillingAddressEventData)||void 0===s?void 0:s.value.name}),translatedAddressResult:l.billingAddress||null})}};W("clientSecret",(e=>{e&&q.stripe&&sessionStorage.setItem("zonos--client-secret",e),e||sessionStorage.removeItem("zonos--client-secret")}));const{onChange:ye,reset:fe,state:we}=e((()=>({addressFormRenderType:"stripe",adjustmentTotal:0,adjustments:[],checkoutSession:null,checkoutSessionTimeoutShow:!1,checkoutTimeoutInterval:null,currency:"USD",customMessage:[],customQuotingError:null,customerAuthenticationToken:null,displayBaseCurrency:!1,dutiesTaxesFees:null,dutiesTaxesFeesEstimate:null,error:null,exchangeRate:null,externalConfirmationPageURL:null,inventoryCheckErrorMessage:null,isSelectedShippingAboveDeminimis:!1,isSelectedShippingGuarantee:!1,isStagingMode:p(),items:[],landedCostData:null,landedCostMethod:"DDP",partiesData:[],promoCode:sessionStorage.getItem("zonos--promo-code")||"",promoCodeApplied:!!sessionStorage.getItem("zonos--promo-code"),promoCodeError:!1,restrictedItems:[],selectedLandedCost:null,selectedShippingOption:null,selectedShippingOptionExpectedDate:"",selectedShippingOptionTransitTime:"",shipping:0,shippingData:null,shouldHideDiscountInput:!1,step:"customer-info",storeCredit:0,subtotal:0,tabItems:{"customer-info":{index:1,isDone:!1,label:"Customer",value:"customer-info"},shipping:{index:2,isDone:!1,label:"Shipping",value:"shipping"},payment:{index:3,isDone:!1,label:"Payment",value:"payment"}},total:0}))),ge=e=>{switch(e){case"DAYS":return s("days");case"WEEKS":return s("weeks");default:return s("business days")}},be=e=>{var t;const o=null===(t=e.shippingProfile)||void 0===t?void 0:t.transitTime;return(null==o?void 0:o.min)&&(null==o?void 0:o.max)&&(null==o?void 0:o.type)?{maxTransit:o.max,minTransit:o.min,unit:ge(o.type)}:null},Se=({item1:e,item2:t})=>!(!e||!t)&&(t.sku&&e.sku&&e.sku===t.sku||t.description&&e.description&&e.description===t.description||e.name&&t.name&&e.name===t.name),Ce=e=>{d("Checking item restrictions");const t=e.map((e=>{if(!e.restriction)return null;const{restriction:t}=e,o=we.items.find((t=>Se({item1:t,item2:e})));return Object.assign(Object.assign({matchedItem:o},e),{restriction:t})})).filter(Boolean);return we.restrictedItems=t,we.items=we.items.map((e=>Object.assign(Object.assign({},e),{isRestricted:!!t.find((t=>Se({item1:t,item2:e})))}))),{cartItems:we.items,restrictedItems:t}};let Oe=null;const Ae=()=>{o.checkoutSessionId=null,Oe&&(clearTimeout(Oe),Oe=null),C(),fe()},Ie=({messages:e,title:t})=>{Ae(),V(),we.step="error",we.error={messages:e,title:t}},ke=({dutiesTaxesFeesEstimate:e,method:t,subtotals:o})=>{var n;we.exchangeRate=o.exchangeRate,we.adjustmentTotal=o.adjustments,we.dutiesTaxesFees="DAP"===t?null:o.landedCostTotal,we.storeCredit=null!==(n=o.storeCredit)&&void 0!==n?n:0,we.subtotal=o.items,we.total=o.total,we.currency=o.presentmentCurrencyCode,we.dutiesTaxesFeesEstimate=e||null},Ne=()=>!!we.items.filter((e=>e.amount>0)).find((e=>!e.isRestricted)),Te=e=>{var t,n,r,s,c,u,m;q.clientSecret=e.clientSecret,q.stripeCustomerSessionClientSecret=e.customerSessionClientSecret,q.customerProfile=e.customerProfile,we.checkoutSession=e,O(null!==(n=null===(t=e.customerProfile)||void 0===t?void 0:t.storeCreditBalance)&&void 0!==n?n:null),e.id||h({endpoint:"cartStoreSetCheckoutSession",errors:["Missing checkout session id in checkout session"],metadata:{allLogs:l,checkoutSession:e}}),e.id&&(o.checkoutSessionId=e.id);const v=i(e.varianceTestResults||[]);a(v);const p=(null===(c=null===(s=null===(r=we.checkoutSession)||void 0===r?void 0:r.metadata)||void 0===s?void 0:s.find((e=>"externalConfirmationPageURL"===(null==e?void 0:e.key))))||void 0===c?void 0:c.value)||(null===(m=null===(u=window.Zonos.cartData)||void 0===u?void 0:u.metadata.find((e=>"externalConfirmationPageURL"===(null==e?void 0:e.key))))||void 0===m?void 0:m.value)||null;p&&(d(`Found externalConfirmationPageURL: ${p}`),we.externalConfirmationPageURL=p)},je=async({adjustmentsAmount:e,cartId:t,currency:r,dutiesTaxesFeesEstimate:i,itemsAmount:a,landedCostId:l,shouldInitSessionOnFailure:c})=>{var m;if(l&&we.selectedLandedCost&&(ke({dutiesTaxesFeesEstimate:i,method:we.landedCostMethod,subtotals:we.selectedLandedCost.subtotals}),d("Exchange rate updated for cart items (landed cost subtotal)","info",we.exchangeRate)),!o.checkoutSessionId)return d("Could not update cart total without checkout session id","info"),!1;const{errors:v,json:p}=await ve({adjustmentsAmount:e,billToPartyId:q.partyBillingId,cartId:t,currency:r,id:o.checkoutSessionId,itemsAmount:a,landedCostId:l,presentmentCountryCode:n.selectedCountryCode,shipToPartyId:q.partyShippingId,varianceTestInput:o.enabledVariantTestKeys||[]});if(v.length>0||!p){if(u("Error occurs when updating checkout session."),c){d("Initiating checkout session on failure","info");const e=await ue();return d(`stripeStoreInitCheckoutSession: ${e}`),!!e||(Ie({messages:[s("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:s("Error creating Checkout")}),!1)}return!1}return l||(ke({method:(null===(m=p.checkoutSessionUpdate.landedCost)||void 0===m?void 0:m.method)||"DDP",subtotals:p.checkoutSessionUpdate.subtotals}),d("Exchange rate updated for cart items (checkout session update)","info",we.exchangeRate)),Te(p.checkoutSessionUpdate),!0},Ee=e=>{var o,n,r;return"DAP"===e.method&&(null===(n=null===(o=t.genericSettings)||void 0===o?void 0:o.domesticCountries)||void 0===n?void 0:n.includes((null===(r=q.stripeAddressEventData)||void 0===r?void 0:r.value.address.country)||"US"))||"DAP"===e.method&&e.remittance.length&&"ZONOS"===e.landedCostGuaranteeCode?"DDP":e.method},Pe=async({applySubtotalsOnly:e,landedCostId:n,selectedShippingOption:r})=>{var s,i,a,l,c,u,m,v,p,h,y;d("Updating selected shipping option","info",{landedCostId:n,selectedShippingOption:r}),we.selectedShippingOption=r;const f=be(we.selectedShippingOption);if(f){const{maxTransit:e,minTransit:t,unit:o}=f;we.selectedShippingOptionTransitTime=`${t}-${e} ${o}`}else we.selectedShippingOptionTransitTime="";const w=null===(s=we.landedCostData)||void 0===s?void 0:s.find((e=>e.landedCostId===n));if(we.selectedLandedCost=w||null,!w)return!1;const g=((null===(i=w.landedCost.amountSubtotals)||void 0===i?void 0:i.landedCostTotal)||0)*w.subtotals.exchangeRate.rate;g&&d(`DAP quote, using estimate: ${g}`,"info"),we.landedCostMethod=Ee(w.landedCost),we.shipping=w.subtotals.shipping;const b="ZONOS"===(null===(a=null==w?void 0:w.landedCost)||void 0===a?void 0:a.landedCostGuaranteeCode),S=!!(null===(c=null===(l=null==w?void 0:w.landedCost)||void 0===l?void 0:l.deMinimis)||void 0===c?void 0:c.find((e=>["DUTY","TAX"].includes(e.type)&&"ABOVE"===e.threshold)));we.isSelectedShippingAboveDeminimis=S,we.isSelectedShippingGuarantee=b;let C=!1;e?(ke({dutiesTaxesFeesEstimate:g,method:we.landedCostMethod,subtotals:w.subtotals}),d("Exchange rate updated for cart items (landed cost subtotal)","info",we.exchangeRate),C=!0):C=await je({adjustmentsAmount:we.adjustmentTotal,billToPartyId:q.partyBillingId,cartId:window.Zonos.cartId,dutiesTaxesFeesEstimate:g,landedCostId:null===(u=w.landedCost)||void 0===u?void 0:u.id,shipToPartyId:q.partyShippingId,varianceTestInput:o.enabledVariantTestKeys||[]});const O=null===(m=we.items.find(Boolean))||void 0===m?void 0:m.currencyCode,A=(null===(v=q.stripeAddressEventData)||void 0===v?void 0:v.value.address.country)||"US";return q.shouldRenderPayInUsdButton="USD"===O&&"LOCAL_AND_USD"===t.checkoutSettings.allowedSettlementCurrencies&&"USD"!==(null===(p=we.checkoutSession)||void 0===p?void 0:p.subtotals.presentmentCurrencyCode)&&!!(null===(y=null===(h=t.genericSettings)||void 0===h?void 0:h.usdSettlementCountryEnabled)||void 0===y?void 0:y.includes(A)),C},De=({isPreview:e,sessionTimeout:t})=>{if(e)return;const o=new URLSearchParams(window.location.search).get("zonosCheckoutTimeout"),n=o&&!isNaN(parseInt(o,10))?parseInt(o,10):t;d(`==START CHECKOUT TIMEOUT - ${n}==`),we.checkoutTimeoutInterval=setTimeout((()=>{we.checkoutSessionTimeoutShow=!0}),n)},Le=()=>{we.checkoutTimeoutInterval&&(clearTimeout(we.checkoutTimeoutInterval),we.checkoutTimeoutInterval=null)},xe=()=>{we.items=we.items.map((e=>Object.assign(Object.assign({},e),{isRestricted:!1}))),we.restrictedItems=[]},Re=async({adjustments:e,cartItems:t,landedCostId:n,shouldInitSessionOnFailure:r=!0})=>{var s;we.adjustments=e,we.items=t.map((e=>Object.assign(Object.assign({},e),{isRestricted:!1})));const i=null===(s=t.find(Boolean))||void 0===s?void 0:s.currencyCode,a=t.reduce(((e,t)=>e+t.amount*t.quantity),0),d=e.reduce(((e,t)=>e+t.amount),0);i&&a&&(we.currency=i,q.isFetchingSession=!0,await je({adjustmentsAmount:d,billToPartyId:q.partyBillingId,cartId:window.Zonos.cartId,currency:i,dutiesTaxesFeesEstimate:0,itemsAmount:a,landedCostId:n,shipToPartyId:q.partyShippingId,shouldInitSessionOnFailure:r,varianceTestInput:o.enabledVariantTestKeys||[]}),q.isFetchingSession=!1)},ze=()=>{"shipping"===we.step?(we.step="customer-info",we.tabItems=Object.assign(Object.assign({},we.tabItems),{"customer-info":Object.assign(Object.assign({},we.tabItems.shipping),{isDone:!1})})):"payment"===we.step?(we.step="shipping",we.tabItems=Object.assign(Object.assign({},we.tabItems),{shipping:Object.assign(Object.assign({},we.tabItems.shipping),{isDone:!1})})):"finish"===we.step&&(we.step="payment",we.tabItems=Object.assign(Object.assign({},we.tabItems),{payment:Object.assign(Object.assign({},we.tabItems.payment),{isDone:!1})}))},Ue=()=>{"customer-info"===we.step?(we.step="shipping",we.tabItems=Object.assign(Object.assign({},we.tabItems),{"customer-info":Object.assign(Object.assign({},we.tabItems["customer-info"]),{isDone:!0})})):"shipping"===we.step?(we.step="payment",we.tabItems=Object.assign(Object.assign({},we.tabItems),{shipping:Object.assign(Object.assign({},we.tabItems.shipping),{isDone:!0})})):"payment"===we.step&&(we.step="finish")},_e=()=>{we.step="customer-info",we.tabItems=Object.assign(Object.assign({},we.tabItems),{"customer-info":Object.assign(Object.assign({},we.tabItems["customer-info"]),{isDone:!1}),payment:Object.assign(Object.assign({},we.tabItems.payment),{isDone:!1}),shipping:Object.assign(Object.assign({},we.tabItems.shipping),{isDone:!1})}),we.selectedShippingOption=null,we.isSelectedShippingAboveDeminimis=!1,we.isSelectedShippingGuarantee=!1,we.selectedShippingOptionTransitTime="",we.dutiesTaxesFees=0,we.dutiesTaxesFeesEstimate=0,we.shipping=0,we.total=we.subtotal},Be=()=>{Oe&&clearTimeout(Oe),Oe=setTimeout((()=>{Oe=null,(async()=>{var e,t;if(!o.checkoutSessionId)return void d("Could not update store credit without checkout session id","info");const r=we.selectedLandedCost,s=we.currency||(null===(e=we.items.find(Boolean))||void 0===e?void 0:e.currencyCode)||"",i=we.adjustments.reduce(((e,t)=>e+t.amount),0),a=we.items.reduce(((e,t)=>e+t.amount*t.quantity),0),{errors:l,json:c}=await ve({adjustmentsAmount:i,cartId:window.Zonos.cartId,currency:s,id:o.checkoutSessionId,itemsAmount:a,landedCostId:null==r?void 0:r.landedCostId,presentmentCountryCode:n.selectedCountryCode,storeCreditApplication:S.isEnabled&&null!==S.amountToApply?S.useFullBalance?{mode:"FULL"}:{amount:S.amountToApply,mode:"PARTIAL"}:{mode:"NONE"}});l.length>0||!c?u("Error updating checkout session with store credit"):(ke({method:(null===(t=c.checkoutSessionUpdate.landedCost)||void 0===t?void 0:t.method)||"DDP",subtotals:c.checkoutSessionUpdate.subtotals}),Te(c.checkoutSessionUpdate))})()}),300)};export{de as A,ie as B,V as C,ye as D,W as E,j as F,Z as G,Pe as H,Ne as I,te as J,ne as K,oe as L,re as M,S as N,C as O,he as P,D as Q,Q as R,be as S,Ee as T,B as U,k as V,T as W,Be as X,N as Y,A as Z,H as a,q as b,ae as c,we as d,Re as e,Ae as f,_e as g,Le as h,G as i,ue as j,ce as k,De as l,le as m,Ie as n,Y as o,Te as p,ee as q,Ue as r,K as s,U as t,me as u,se as v,I as w,E as x,F as y,P as z}
@@ -1 +0,0 @@
1
- import{t as o}from"./p-d28be518.js";const r=({backgroundColor1:r,backgroundColor2:a})=>o.readability(r,a)>2.5;export{r as i}