@zonos/elements 1.3.255 → 1.3.257

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 (330) hide show
  1. package/dist/cjs/{cart-4ef52500.js → cart-cd0a054b.js} +4 -4
  2. package/dist/cjs/{debounce-0c75ba33.js → debounce-3e17b4e9.js} +1 -1
  3. package/dist/cjs/{getBorderRadius-27a74844.js → getBorderRadius-db55a464.js} +1 -1
  4. package/dist/cjs/{getContrastColor-cc087c53.js → getContrastColor-8ed1cb48.js} +2 -2
  5. package/dist/cjs/{hasInclusivePrice-4419d03e.js → hasInclusivePrice-3650109c.js} +1 -1
  6. package/dist/cjs/index.cjs.js +7 -7
  7. package/dist/cjs/{invoice-3494b21e.js → invoice-1cea739b.js} +3 -3
  8. package/dist/cjs/{isCollectMobileTablet-92955ce6.js → isCollectMobileTablet-65c71740.js} +3 -3
  9. package/dist/cjs/{isContrastColor-d1936a5c.js → isContrastColor-6a17f408.js} +1 -1
  10. package/dist/cjs/{isDarkColor-a68abf7a.js → isDarkColor-bfe6d1eb.js} +1 -1
  11. package/dist/cjs/loader.cjs.js +1 -1
  12. package/dist/cjs/{localization-75f4ec05.js → localization-adaab93f.js} +295 -20
  13. package/dist/cjs/{paypal-cc3a730b.js → paypal-326d7bc5.js} +5 -5
  14. package/dist/cjs/{placeTestOrder-13901275.js → placeTestOrder-53f2fe97.js} +2 -2
  15. package/dist/cjs/{renderCheckoutCurrency-0003992c.js → renderCheckoutCurrency-cf2e3b93.js} +2 -2
  16. package/dist/cjs/{submitGtag-cb4fb332.js → submitGtag-9ac5a42e.js} +1 -1
  17. package/dist/cjs/{throttle-ff483793.js → throttle-dac93461.js} +2 -2
  18. package/dist/cjs/{updateCheckoutSessionAttributes-8be63b63.js → updateCheckoutSessionAttributes-a3776bb0.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 +14 -14
  26. package/dist/cjs/zonos-checkbox_2.cjs.entry.js +3 -3
  27. package/dist/cjs/zonos-checkout.cjs.entry.js +364 -85
  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 +38 -15
  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-shipping-rich-radio.cjs.entry.js +5 -5
  45. package/dist/cjs/zonos-store-credit.cjs.entry.js +6 -6
  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-f5a61112.js → zonosStore-1c517e55.js} +0 -1
  50. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +60 -2
  51. package/dist/collection/components/hello/zonos-hello/zonos-hello.js +35 -12
  52. package/dist/collection/components/store/hello/localization.js +54 -19
  53. package/dist/collection/components/store/translationStore/strings.arabic.js +12 -0
  54. package/dist/collection/components/store/translationStore/strings.base.js +12 -0
  55. package/dist/collection/components/store/translationStore/strings.chinese.js +12 -0
  56. package/dist/collection/components/store/translationStore/strings.danish.js +12 -0
  57. package/dist/collection/components/store/translationStore/strings.dutch.js +12 -0
  58. package/dist/collection/components/store/translationStore/strings.french.js +12 -0
  59. package/dist/collection/components/store/translationStore/strings.german.js +12 -0
  60. package/dist/collection/components/store/translationStore/strings.hebrew.js +12 -0
  61. package/dist/collection/components/store/translationStore/strings.indonesian.js +12 -0
  62. package/dist/collection/components/store/translationStore/strings.italian.js +12 -0
  63. package/dist/collection/components/store/translationStore/strings.japanese.js +12 -0
  64. package/dist/collection/components/store/translationStore/strings.korean.js +12 -0
  65. package/dist/collection/components/store/translationStore/strings.norwegian.js +12 -0
  66. package/dist/collection/components/store/translationStore/strings.polish.js +12 -0
  67. package/dist/collection/components/store/translationStore/strings.portuguese.js +12 -0
  68. package/dist/collection/components/store/translationStore/strings.russian.js +12 -0
  69. package/dist/collection/components/store/translationStore/strings.spanish.js +12 -0
  70. package/dist/collection/components/store/translationStore/strings.swedish.js +12 -0
  71. package/dist/collection/components/store/translationStore/strings.turkish.js +12 -0
  72. package/dist/collection/components/store/translationStore/strings.vietnamese.js +12 -0
  73. package/dist/collection/components/store/zonosStore.js +0 -1
  74. package/dist/collection/components/utils/checkout/bigcommerceStorefrontApi.js +52 -0
  75. package/dist/collection/components/utils/checkout/buildBigcommerceRedirectUrl.js +22 -0
  76. package/dist/collection/components/utils/checkout/checkBigCommerceBypassCustomerGroup.js +122 -0
  77. package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +5 -2
  78. package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +120 -86
  79. package/dist/collection/types/generated/graphql.internal.types.js +446 -0
  80. package/dist/esm/{cart-f4e43d1a.js → cart-4cd47a1b.js} +4 -4
  81. package/dist/esm/{debounce-efc0e473.js → debounce-8faafc9f.js} +1 -1
  82. package/dist/esm/{getBorderRadius-c21a42e5.js → getBorderRadius-66de1b16.js} +1 -1
  83. package/dist/esm/{getContrastColor-98f0d1d5.js → getContrastColor-e14f95a7.js} +2 -2
  84. package/dist/esm/{hasInclusivePrice-0439b7f4.js → hasInclusivePrice-7a3dc4c3.js} +1 -1
  85. package/dist/esm/index.js +7 -7
  86. package/dist/esm/{invoice-3d8f3fa8.js → invoice-03ff7bbb.js} +3 -3
  87. package/dist/esm/{isCollectMobileTablet-0402aa32.js → isCollectMobileTablet-9eb77c9a.js} +3 -3
  88. package/dist/esm/{isContrastColor-c17e83c9.js → isContrastColor-f9e65e70.js} +1 -1
  89. package/dist/esm/{isDarkColor-3537021b.js → isDarkColor-8092a9fb.js} +1 -1
  90. package/dist/esm/loader.js +1 -1
  91. package/dist/esm/{localization-026da80b.js → localization-79e08480.js} +295 -20
  92. package/dist/esm/{paypal-07bd6b7c.js → paypal-67c86683.js} +5 -5
  93. package/dist/esm/{placeTestOrder-39de11f4.js → placeTestOrder-e81fff15.js} +2 -2
  94. package/dist/esm/{renderCheckoutCurrency-743f7c77.js → renderCheckoutCurrency-1fc00db4.js} +2 -2
  95. package/dist/esm/{submitGtag-13de9f1f.js → submitGtag-543058f9.js} +1 -1
  96. package/dist/esm/{throttle-0504ba2c.js → throttle-5a66b4fd.js} +2 -2
  97. package/dist/esm/{updateCheckoutSessionAttributes-b9f7e982.js → updateCheckoutSessionAttributes-8f3f932e.js} +1 -1
  98. package/dist/esm/zonos-address-display_8.entry.js +7 -7
  99. package/dist/esm/zonos-address_4.entry.js +7 -7
  100. package/dist/esm/zonos-badge.entry.js +1 -1
  101. package/dist/esm/zonos-banner.entry.js +1 -1
  102. package/dist/esm/zonos-button_3.entry.js +3 -3
  103. package/dist/esm/zonos-card_5.entry.js +8 -8
  104. package/dist/esm/zonos-cart-items_12.entry.js +14 -14
  105. package/dist/esm/zonos-checkbox_2.entry.js +3 -3
  106. package/dist/esm/zonos-checkout.entry.js +365 -86
  107. package/dist/esm/zonos-collapse.entry.js +1 -1
  108. package/dist/esm/zonos-collect-cart-items_3.entry.js +5 -5
  109. package/dist/esm/zonos-collect-finish_6.entry.js +11 -11
  110. package/dist/esm/zonos-collect.entry.js +9 -9
  111. package/dist/esm/zonos-controller.entry.js +6 -6
  112. package/dist/esm/zonos-country-flag.entry.js +2 -2
  113. package/dist/esm/zonos-country-select_4.entry.js +3 -3
  114. package/dist/esm/zonos-elements.js +1 -1
  115. package/dist/esm/zonos-hello-dialog.entry.js +3 -3
  116. package/dist/esm/zonos-hello.entry.js +38 -15
  117. package/dist/esm/zonos-input.entry.js +2 -2
  118. package/dist/esm/zonos-invoice-cart-items_2.entry.js +7 -7
  119. package/dist/esm/zonos-invoice-finish_5.entry.js +11 -11
  120. package/dist/esm/zonos-invoice.entry.js +9 -9
  121. package/dist/esm/zonos-language-select_2.entry.js +2 -2
  122. package/dist/esm/zonos-logo.entry.js +1 -1
  123. package/dist/esm/zonos-shipping-rich-radio.entry.js +5 -5
  124. package/dist/esm/zonos-store-credit.entry.js +6 -6
  125. package/dist/esm/zonos-stripe-input.entry.js +3 -3
  126. package/dist/esm/zonos-text.entry.js +1 -1
  127. package/dist/esm/zonos-v-stack.entry.js +1 -1
  128. package/dist/esm/{zonosStore-5242a58d.js → zonosStore-f1d45eac.js} +0 -1
  129. package/dist/esm-es5/{cart-f4e43d1a.js → cart-4cd47a1b.js} +1 -1
  130. package/dist/esm-es5/{debounce-efc0e473.js → debounce-8faafc9f.js} +1 -1
  131. package/dist/esm-es5/{getBorderRadius-c21a42e5.js → getBorderRadius-66de1b16.js} +1 -1
  132. package/dist/esm-es5/{getContrastColor-98f0d1d5.js → getContrastColor-e14f95a7.js} +1 -1
  133. package/dist/esm-es5/{hasInclusivePrice-0439b7f4.js → hasInclusivePrice-7a3dc4c3.js} +1 -1
  134. package/dist/esm-es5/index.js +1 -1
  135. package/dist/esm-es5/{invoice-3d8f3fa8.js → invoice-03ff7bbb.js} +1 -1
  136. package/dist/esm-es5/{isCollectMobileTablet-0402aa32.js → isCollectMobileTablet-9eb77c9a.js} +1 -1
  137. package/dist/esm-es5/{isContrastColor-c17e83c9.js → isContrastColor-f9e65e70.js} +1 -1
  138. package/dist/esm-es5/{isDarkColor-3537021b.js → isDarkColor-8092a9fb.js} +1 -1
  139. package/dist/esm-es5/loader.js +1 -1
  140. package/dist/esm-es5/localization-79e08480.js +1 -0
  141. package/dist/esm-es5/{paypal-07bd6b7c.js → paypal-67c86683.js} +2 -2
  142. package/dist/esm-es5/{placeTestOrder-39de11f4.js → placeTestOrder-e81fff15.js} +1 -1
  143. package/dist/esm-es5/{renderCheckoutCurrency-743f7c77.js → renderCheckoutCurrency-1fc00db4.js} +1 -1
  144. package/dist/esm-es5/{submitGtag-13de9f1f.js → submitGtag-543058f9.js} +1 -1
  145. package/dist/esm-es5/{throttle-0504ba2c.js → throttle-5a66b4fd.js} +1 -1
  146. package/dist/esm-es5/{updateCheckoutSessionAttributes-b9f7e982.js → updateCheckoutSessionAttributes-8f3f932e.js} +1 -1
  147. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
  148. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  149. package/dist/esm-es5/zonos-badge.entry.js +1 -1
  150. package/dist/esm-es5/zonos-banner.entry.js +1 -1
  151. package/dist/esm-es5/zonos-button_3.entry.js +1 -1
  152. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  153. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  154. package/dist/esm-es5/zonos-checkbox_2.entry.js +1 -1
  155. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  156. package/dist/esm-es5/zonos-collapse.entry.js +1 -1
  157. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  158. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  159. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  160. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  161. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  162. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  163. package/dist/esm-es5/zonos-elements.js +1 -1
  164. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  165. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  166. package/dist/esm-es5/zonos-input.entry.js +1 -1
  167. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  168. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  169. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  170. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  171. package/dist/esm-es5/zonos-logo.entry.js +1 -1
  172. package/dist/esm-es5/zonos-shipping-rich-radio.entry.js +1 -1
  173. package/dist/esm-es5/zonos-store-credit.entry.js +1 -1
  174. package/dist/esm-es5/zonos-stripe-input.entry.js +1 -1
  175. package/dist/esm-es5/zonos-text.entry.js +1 -1
  176. package/dist/esm-es5/zonos-v-stack.entry.js +1 -1
  177. package/dist/esm-es5/{zonosStore-5242a58d.js → zonosStore-f1d45eac.js} +1 -1
  178. package/dist/scripts/index.d.ts +107 -8
  179. package/dist/scripts/index.js +1 -1
  180. package/dist/scripts/loadZonos.js +1 -1
  181. package/dist/scripts/zonos.js +1 -1
  182. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +13 -0
  183. package/dist/types/components/store/translationStore/strings.arabic.d.ts +12 -0
  184. package/dist/types/components/store/translationStore/strings.base.d.ts +12 -0
  185. package/dist/types/components/store/translationStore/strings.chinese.d.ts +12 -0
  186. package/dist/types/components/store/translationStore/strings.danish.d.ts +12 -0
  187. package/dist/types/components/store/translationStore/strings.dutch.d.ts +12 -0
  188. package/dist/types/components/store/translationStore/strings.french.d.ts +12 -0
  189. package/dist/types/components/store/translationStore/strings.german.d.ts +12 -0
  190. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +12 -0
  191. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +12 -0
  192. package/dist/types/components/store/translationStore/strings.italian.d.ts +12 -0
  193. package/dist/types/components/store/translationStore/strings.japanese.d.ts +12 -0
  194. package/dist/types/components/store/translationStore/strings.korean.d.ts +12 -0
  195. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +12 -0
  196. package/dist/types/components/store/translationStore/strings.polish.d.ts +12 -0
  197. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +12 -0
  198. package/dist/types/components/store/translationStore/strings.russian.d.ts +12 -0
  199. package/dist/types/components/store/translationStore/strings.spanish.d.ts +12 -0
  200. package/dist/types/components/store/translationStore/strings.swedish.d.ts +12 -0
  201. package/dist/types/components/store/translationStore/strings.turkish.d.ts +12 -0
  202. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +12 -0
  203. package/dist/types/components/utils/api/getLocaleMessages.d.ts +1 -1
  204. package/dist/types/components/utils/checkout/bigcommerceStorefrontApi.d.ts +36 -0
  205. package/dist/types/components/utils/checkout/buildBigcommerceRedirectUrl.d.ts +11 -0
  206. package/dist/types/components/utils/checkout/checkBigCommerceBypassCustomerGroup.d.ts +30 -0
  207. package/dist/types/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.d.ts +16 -1
  208. package/dist/types/scripts/cart/_setupCartDataWithSettings.d.ts +18 -6
  209. package/dist/types/types/generated/graphql.frontend.types.d.ts +1 -1
  210. package/dist/types/types/generated/graphql.frontend.types.ts +1 -1
  211. package/dist/types/types/generated/graphql.internal.types.d.ts +532 -11
  212. package/dist/types/types/generated/graphql.internal.types.ts +600 -11
  213. package/dist/types/types/hello/HelloConfig.d.ts +22 -3
  214. package/dist/types/types/utils/ZonosSettings.d.ts +7 -0
  215. package/dist/zonos-elements/index.esm.js +1 -1
  216. package/dist/zonos-elements/{p-568c5700.system.entry.js → p-0740f8a4.system.entry.js} +1 -1
  217. package/dist/zonos-elements/p-09307a03.js +1 -0
  218. package/dist/zonos-elements/{p-1bdac1d3.entry.js → p-0ca6ee9b.entry.js} +1 -1
  219. package/dist/zonos-elements/p-0e83d193.js +1 -0
  220. package/dist/zonos-elements/{p-9b12f023.system.entry.js → p-0f4822cc.system.entry.js} +1 -1
  221. package/dist/zonos-elements/{p-8d5f928c.system.entry.js → p-1368dce7.system.entry.js} +1 -1
  222. package/dist/zonos-elements/{p-ac30b7a8.system.js → p-15ef7644.system.js} +1 -1
  223. package/dist/zonos-elements/{p-ab25379f.system.js → p-17a8a514.system.js} +1 -1
  224. package/dist/zonos-elements/{p-0649737d.entry.js → p-21519ebe.entry.js} +1 -1
  225. package/dist/zonos-elements/{p-16a80e3c.system.js → p-22bb7836.system.js} +1 -1
  226. package/dist/zonos-elements/p-271eebd3.system.js +1 -0
  227. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  228. package/dist/zonos-elements/{p-d397560e.system.entry.js → p-2c1c6d60.system.entry.js} +1 -1
  229. package/dist/zonos-elements/{p-908f13ae.js → p-2f924331.js} +1 -1
  230. package/dist/zonos-elements/{p-4aefd668.entry.js → p-2fa41e93.entry.js} +1 -1
  231. package/dist/zonos-elements/{p-9e98a256.system.entry.js → p-3092ec40.system.entry.js} +1 -1
  232. package/dist/zonos-elements/{p-dbb3db89.system.entry.js → p-313b87f3.system.entry.js} +1 -1
  233. package/dist/zonos-elements/{p-c9d4eb42.entry.js → p-3576d900.entry.js} +1 -1
  234. package/dist/zonos-elements/{p-a6cc56ba.entry.js → p-3675766a.entry.js} +1 -1
  235. package/dist/zonos-elements/p-380143db.entry.js +1 -0
  236. package/dist/zonos-elements/{p-4f7d64f6.js → p-387f6a4d.js} +1 -1
  237. package/dist/zonos-elements/{p-d168be79.system.entry.js → p-3fc43187.system.entry.js} +1 -1
  238. package/dist/zonos-elements/{p-a1c476d6.system.entry.js → p-3ff736f7.system.entry.js} +1 -1
  239. package/dist/zonos-elements/{p-d938fb86.entry.js → p-429c1d0c.entry.js} +1 -1
  240. package/dist/zonos-elements/{p-8c6624b6.system.js → p-43a6e469.system.js} +1 -1
  241. package/dist/zonos-elements/{p-5678c5b5.system.entry.js → p-4a84387a.system.entry.js} +1 -1
  242. package/dist/zonos-elements/{p-af83f0c2.js → p-4e2262e8.js} +1 -1
  243. package/dist/zonos-elements/p-53fe581b.system.js +1 -0
  244. package/dist/zonos-elements/{p-3e03b2e8.entry.js → p-5818f4a7.entry.js} +1 -1
  245. package/dist/zonos-elements/{p-f830f800.js → p-5beab541.js} +1 -1
  246. package/dist/zonos-elements/{p-d18a2b2c.system.js → p-61be7d98.system.js} +1 -1
  247. package/dist/zonos-elements/{p-70c8a47d.system.entry.js → p-62dbc5f8.system.entry.js} +1 -1
  248. package/dist/zonos-elements/{p-6ce8374e.entry.js → p-6b83ac7f.entry.js} +1 -1
  249. package/dist/zonos-elements/p-6bcbe651.js +1 -0
  250. package/dist/zonos-elements/{p-835c0bd4.js → p-7559c494.js} +1 -1
  251. package/dist/zonos-elements/{p-8f1ab25c.system.entry.js → p-770d414a.system.entry.js} +1 -1
  252. package/dist/zonos-elements/{p-7427dd1e.entry.js → p-7a379538.entry.js} +1 -1
  253. package/dist/zonos-elements/{p-fbe22363.entry.js → p-7aeb496e.entry.js} +1 -1
  254. package/dist/zonos-elements/p-7caa75bb.js +1 -0
  255. package/dist/zonos-elements/p-7cbbf483.system.js +1 -0
  256. package/dist/zonos-elements/p-7d9bbdc8.js +1 -0
  257. package/dist/zonos-elements/{p-e12f7a97.entry.js → p-80ba5f70.entry.js} +1 -1
  258. package/dist/zonos-elements/{p-2b10f633.system.js → p-8adc0a13.system.js} +1 -1
  259. package/dist/zonos-elements/{p-b45538a7.system.entry.js → p-8b35e475.system.entry.js} +1 -1
  260. package/dist/zonos-elements/p-8bce79f4.system.js +1 -0
  261. package/dist/zonos-elements/{p-c398711f.js → p-8ed0fad5.js} +2 -2
  262. package/dist/zonos-elements/{p-18d411c3.system.entry.js → p-9161f10d.system.entry.js} +1 -1
  263. package/dist/zonos-elements/{p-f888db89.entry.js → p-91eeccaa.entry.js} +1 -1
  264. package/dist/zonos-elements/p-944bf0e7.js +1 -0
  265. package/dist/zonos-elements/{p-3730d555.system.entry.js → p-9d435f12.system.entry.js} +1 -1
  266. package/dist/zonos-elements/{p-db0b35a2.system.entry.js → p-9f3aab4e.system.entry.js} +1 -1
  267. package/dist/zonos-elements/{p-231edcca.entry.js → p-a60544cc.entry.js} +1 -1
  268. package/dist/zonos-elements/{p-33fc0c8f.entry.js → p-a7b0345b.entry.js} +1 -1
  269. package/dist/zonos-elements/{p-aabb921f.system.js → p-a90c977a.system.js} +1 -1
  270. package/dist/zonos-elements/{p-a1835bae.system.entry.js → p-aa3e3438.system.entry.js} +1 -1
  271. package/dist/zonos-elements/p-ac7b93c9.js +1 -0
  272. package/dist/zonos-elements/{p-5359ba71.entry.js → p-b3824361.entry.js} +1 -1
  273. package/dist/zonos-elements/{p-9d9792b9.system.entry.js → p-b414b484.system.entry.js} +1 -1
  274. package/dist/zonos-elements/{p-50aac43c.system.js → p-b53856bf.system.js} +1 -1
  275. package/dist/zonos-elements/{p-2aa44601.entry.js → p-bb6e7e9e.entry.js} +1 -1
  276. package/dist/zonos-elements/{p-939ba2a5.entry.js → p-bb785f33.entry.js} +1 -1
  277. package/dist/zonos-elements/{p-5f628e57.entry.js → p-bcbbe867.entry.js} +1 -1
  278. package/dist/zonos-elements/p-c2139758.entry.js +1 -0
  279. package/dist/zonos-elements/{p-3814aac3.system.entry.js → p-c23e2501.system.entry.js} +1 -1
  280. package/dist/zonos-elements/{p-2baa21b1.entry.js → p-c585d169.entry.js} +1 -1
  281. package/dist/zonos-elements/{p-ed61dedd.system.entry.js → p-c7ecef98.system.entry.js} +1 -1
  282. package/dist/zonos-elements/{p-ee217693.entry.js → p-c908a7a3.entry.js} +1 -1
  283. package/dist/zonos-elements/p-cd563d65.system.js +1 -0
  284. package/dist/zonos-elements/{p-ddcbea81.entry.js → p-cdbb50cf.entry.js} +1 -1
  285. package/dist/zonos-elements/{p-2affd4e6.entry.js → p-ce2fd652.entry.js} +1 -1
  286. package/dist/zonos-elements/{p-4e4fa1fb.system.entry.js → p-d004565d.system.entry.js} +1 -1
  287. package/dist/zonos-elements/{p-5e3e5e3e.system.js → p-d0690cdc.system.js} +1 -1
  288. package/dist/zonos-elements/{p-fe6cc354.entry.js → p-d30e8c3a.entry.js} +1 -1
  289. package/dist/zonos-elements/p-da7e1143.system.entry.js +1 -0
  290. package/dist/zonos-elements/p-ddb27b4a.entry.js +1 -0
  291. package/dist/zonos-elements/{p-234f0339.system.entry.js → p-dfb4360d.system.entry.js} +1 -1
  292. package/dist/zonos-elements/{p-66758e30.system.entry.js → p-e173fbd1.system.entry.js} +1 -1
  293. package/dist/zonos-elements/{p-3fbd9cc0.system.js → p-e25e0b4b.system.js} +1 -1
  294. package/dist/zonos-elements/{p-cc364b26.system.entry.js → p-e3f9779a.system.entry.js} +1 -1
  295. package/dist/zonos-elements/{p-0d18d94b.entry.js → p-e55bc187.entry.js} +1 -1
  296. package/dist/zonos-elements/{p-0aa1c8c2.system.js → p-e56f5954.system.js} +1 -1
  297. package/dist/zonos-elements/{p-06b4aa32.system.js → p-e5f5b086.system.js} +1 -1
  298. package/dist/zonos-elements/{p-dafafa07.js → p-e62342c3.js} +1 -1
  299. package/dist/zonos-elements/p-e6726a50.system.js +1 -0
  300. package/dist/zonos-elements/{p-274a5d11.system.entry.js → p-e6feafc1.system.entry.js} +1 -1
  301. package/dist/zonos-elements/{p-b004146f.entry.js → p-e749fb81.entry.js} +1 -1
  302. package/dist/zonos-elements/{p-27e41b44.system.entry.js → p-e80832cb.system.entry.js} +1 -1
  303. package/dist/zonos-elements/{p-12f480c9.system.entry.js → p-e9f36d6b.system.entry.js} +1 -1
  304. package/dist/zonos-elements/{p-058f6124.js → p-ed9385f4.js} +1 -1
  305. package/dist/zonos-elements/p-f68ce554.js +1 -0
  306. package/dist/zonos-elements/{p-67897a0d.js → p-f6922df5.js} +1 -1
  307. package/dist/zonos-elements/{p-f0938b51.system.entry.js → p-f7ddd288.system.entry.js} +1 -1
  308. package/dist/zonos-elements/{p-38881641.system.entry.js → p-fbc274a8.system.entry.js} +1 -1
  309. package/dist/zonos-elements/{p-d2bba4dc.entry.js → p-fed19033.entry.js} +1 -1
  310. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  311. package/package.json +1 -1
  312. package/dist/esm-es5/localization-026da80b.js +0 -1
  313. package/dist/zonos-elements/p-0d4af7e9.system.entry.js +0 -1
  314. package/dist/zonos-elements/p-1ed9ef0b.js +0 -1
  315. package/dist/zonos-elements/p-31d1b874.system.js +0 -1
  316. package/dist/zonos-elements/p-34d10122.js +0 -1
  317. package/dist/zonos-elements/p-3ac97c01.js +0 -1
  318. package/dist/zonos-elements/p-53db5f85.system.js +0 -1
  319. package/dist/zonos-elements/p-7501c637.system.js +0 -1
  320. package/dist/zonos-elements/p-768430fe.js +0 -1
  321. package/dist/zonos-elements/p-7d7ffb42.js +0 -1
  322. package/dist/zonos-elements/p-959918fe.system.js +0 -1
  323. package/dist/zonos-elements/p-9d44fef6.system.js +0 -1
  324. package/dist/zonos-elements/p-b20c7f8c.entry.js +0 -1
  325. package/dist/zonos-elements/p-b6c78f82.entry.js +0 -1
  326. package/dist/zonos-elements/p-b84be447.js +0 -1
  327. package/dist/zonos-elements/p-db993fdb.entry.js +0 -1
  328. package/dist/zonos-elements/p-def2d465.js +0 -1
  329. package/dist/zonos-elements/p-e219d011.js +0 -1
  330. package/dist/zonos-elements/p-f9705736.system.js +0 -1
@@ -1,10 +1,27 @@
1
- import type { CountryCode, CurrencyCode, HelloCurrencyBehavior, HelloDesktopLocation, HelloMobileLocation, HelloPeekMessageBehavior, HelloRestrictionBehavior, Mode } from "../generated/graphql.internal.types";
1
+ import type { CountryCode, CurrencyCode, HelloCurrencyBehavior, HelloDesktopLocation, HelloMobileLocation, HelloPeekMessageBehavior, HelloRestrictionBehavior, HelloSettingFragment, Mode } from "../generated/graphql.internal.types";
2
2
  export type CountryOverrideBehavior = 'URL_PARAM' | 'SESSION';
3
+ /**
4
+ * @deprecated Use `countryDisplayRules.widgetVisibility.behavior` instead.
5
+ * Can still be set to override `countryDisplayRules.widgetVisibility.behavior`.
6
+ */
3
7
  export type ShowForCountries = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
8
+ /**
9
+ * @deprecated Use `countryDisplayRules.countrySelector.behavior` instead.
10
+ * Can still be set to override `countryDisplayRules.countrySelector.behavior`.
11
+ */
4
12
  export type ShowCountryList = 'ALL' | 'ONLY_SHIPPABLE' | CountryCode[];
13
+ export type CountryDisplayRules = HelloSettingFragment['countryDisplayRules'];
14
+ export type CountrySelectorRules = CountryDisplayRules['countrySelector'];
15
+ export type WidgetVisibilityRules = CountryDisplayRules['widgetVisibility'];
5
16
  export type HelloConfig = {
6
17
  anchorElementSelector: string;
7
18
  cartUrlPattern: string | null;
19
+ /**
20
+ * Rules for controlling country display in the Hello widget.
21
+ * Provides fine-grained control over which countries appear in the country selector dropdown
22
+ * and which countries the widget is visible for, with include/exclude lists.
23
+ */
24
+ countryDisplayRules?: CountryDisplayRules;
8
25
  /**
9
26
  * The behavior to use when determining the country to use for the user.
10
27
  * @default 'URL_PARAM'
@@ -35,12 +52,14 @@ export type HelloConfig = {
35
52
  productTitleElementSelector: string | null;
36
53
  restrictionBehavior: HelloRestrictionBehavior;
37
54
  /**
38
- * The countries to include in the country list dropdown of the Hello widget.
55
+ * @deprecated Use `countryDisplayRules.countrySelector` instead.
56
+ * When set, overrides `countryDisplayRules.countrySelector.behavior`.
39
57
  * @default ONLY_SHIPPABLE
40
58
  */
41
59
  showCountryList?: ShowCountryList;
42
60
  /**
43
- * The countries to show the widget for.
61
+ * @deprecated Use `countryDisplayRules.widgetVisibility` instead.
62
+ * When set, overrides `countryDisplayRules.widgetVisibility.behavior`.
44
63
  * @default ONLY_SHIPPABLE
45
64
  */
46
65
  showForCountries?: ShowForCountries;
@@ -2,6 +2,13 @@ import type { CountryFields } from "../CountryFields";
2
2
  import type { AppearanceSettingsQuery, CheckoutSettingsQuery, CountryCode, HelloSettingsQuery, LandedCostSettingsQuery, OnlineStoreSettingsQuery, OrganizationQuery, ShippingZonesQuery } from "../generated/graphql.internal.types";
3
3
  import type { InclusivePriceConfigurationResponse } from "../InclusivePricing";
4
4
  export type GenericZonosSettings = {
5
+ /**
6
+ * BigCommerce customer group IDs that should bypass Zonos Checkout.
7
+ * @description When a logged-in BigCommerce customer belongs to one of these groups
8
+ * (e.g. resellers), they will be redirected to BigCommerce's native checkout
9
+ * instead of going through Zonos international checkout.
10
+ */
11
+ bigcommerceBypassCustomerGroupIds?: number[];
5
12
  /**
6
13
  * Bigcommerce domestic checkout country selector.
7
14
  * @description This is the field selector for the country select element in the bigcommerce domestic checkout page. All themes might have different selectors, so we need to allow this to be configured.
@@ -1 +1 @@
1
- import{c as n}from"./p-595f5dd2.js";import{g as o,I as t}from"./p-e7b0c156.js";import{l as r}from"./p-0a377722.js";export{a as availableTestKeys}from"./p-0a377722.js";import{g as i,a as l,h as u,l as m}from"./p-41dd1cb8.js";import{g as p,_ as w,c as f,a as h}from"./p-b2d81c98.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./p-b2d81c98.js";export{c as countryRequireShortAddressCode}from"./p-1d42cd20.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./p-6b361d2b.js";const y=["jsdelivr","cdnjs","unpkg","vercel"],v="jsdelivr",O=e=>{const n=y.indexOf(e);return y[n+1]||null},S=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.255.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com","dev.storybook.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const t=`https://${n}.preview.js.zonos.com`;return r(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),t},g="https://js.stripe.com/v3",j=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,z="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let b=null;const N=Promise.resolve().then((()=>{return e=null,null!==b||(b=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(z),window.Stripe)n(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${g}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&j.test(o.src))return o}return null})();t&&e?console.warn(z):t||(t=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${g}${n}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(m("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==t||t.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):o(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else n(null)}))),b;var e}));let I=!1;N.catch((e=>{I||console.warn(e)}));const k=async({cartId:e,retries:n})=>{const t=i(),s=o(),c=p()||void 0,d=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&d.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:l,json:a,zonosMode:m}=await u(`/api/zonos-elements/get-cart?${d.toString()}`,{body:{isTestMode:t,renewCartExpirationToken:c,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),w=!a||l.length;return w&&n?(r("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:n}),await new Promise((e=>setTimeout(e,500))),k({cartId:e,retries:n-1})):w?null:Object.assign(Object.assign({},a),{zonosMode:m})};var R;const T=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),$=Date.now(),Z="https://v1.3.255.js.zonos.com",A=T||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.255",L="https://fonts.googleapis.com",U=/^https:\/\/fonts\.googleapis\.com/;class C{}R=C,C.doneInit=!1,C.cartSettings=null,C.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),C.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),C._paypalMockResponse=null,C.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,C.isBigCommerce=!1,C.releaseDate="1776282443962",C.isLegacyCheckout=!1,C.googleAnalyticId=null,C.googleAnalyticReady=!1,C.startLoadTime=$,C.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",C.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),C.overrideUseCustomAddressForm=!1,C.isCollect=!1,C.isInvoice=!1,C.isNpm=!0,C.zonosQaUrl=null,C.zonosQaUrlApi=null,C.trackEventLogs=[],C.version="v1.3.255",C.modeAlerted=!1,C.cartData=null,C.paypal=null,C.zonosMode=null,C.IframeService=t,C.getCurrentTimestamp=()=>(new Date).getTime(),C.zonosController=null,C.loadTimeApiInfoList=[],C.logIntervalId=null,C.init=async e=>{const{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d,storeId:a,zonosApiKey:p}=e;if(R.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),R.doneInit)return;if(r(`====== ZONOS DEBUG MODE: on (${R.version}) ======`),R.zonosApiKey=p,R.storeId=a,"undefined"!=typeof window&&window.parent===window&&(R.googleAnalyticReady=!0),R.isNpm){r("====== ZONOS LOADING FROM NPM ======");const n=S();if(n&&!window.isZonosPreview){r(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${n} ======`,"info");const o=document.createElement("script");return o.src=`${n}/dist/scripts/zonos.js`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=R.isNpm,window.Zonos.isBigCommerce=R.isBigCommerce,window.Zonos.isLegacyCheckout=R.isLegacyCheckout,window.Zonos.zonosMode=R.zonosMode,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${n}`)})),void(window.isZonosPreview=!0)}if(!p&&!R.cartId)return void m("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!R.cartData&&R.cartId){r("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=w(e);if(!o&&!n)return m("[ZONOS - loadZonos] invalid cart id"),null;const t=await k({cartId:e,retries:5});return r("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(m("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(R.cartId);if(!e)return void m("Failed to get cart data");R.cartData=e.cartData,R.zonosApiKey=e.zonosApiKey,R.cartSettings=e.settings}const o=await(async()=>{const e=i(),n=l();if(!e&&!n||!window.Zonos.zonosApiKey)return null;if(r("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return r("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:o,json:t}=await u("/api/get-test-public-credential");if(o.length||!t)return m("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o),null;const s=t.publicCredential;return s?(r(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(m("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();o&&(R.zonosApiKey=o)}const h=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(R.cartId&&R.cartData||h){r("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${f}`,document.body.appendChild(e)}r("init zonos"),R.restoreNativeBrowserFunctions(),R.injectCustomScriptForHostedCheckout(),R.injectZonosCdn(),R.injectZonosCss(),R.injectFonts(),R.injectCheckoutInternationalButton(),R.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d}}),R.doneInit=!0},C.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${h}`)){const e=document.createElement("button");e.id=h,e.style.display="none",document.body.appendChild(e)}},C.injectCustomScriptForHostedCheckout=()=>{const e=R.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),t=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||t)){if(o){r("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(t){r("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else r("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},C.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},C.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${h}`);setTimeout((()=>{e&&e.dispatchEvent(n("click"))}),10)},C.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},C.showNotification=e=>{var n;null===(n=R.zonosController)||void 0===n||n.showNotification(e)},C.updateOrganizationName=e=>{var n;null===(n=R.zonosController)||void 0===n||n.updateOrganizationName(e)},C.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},C.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let o=document.querySelector(`iframe#${n}`);o||(o=document.createElement("iframe"),o.id=n,o.style.display="none",o.style.opacity="0",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.width="1px",o.style.height="1px",o.style.border="none",o.style.overflow="hidden",o.style.visibility="hidden",document.body.appendChild(o));const t=(null===(e=o.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(o)},C.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=R.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;r("loading Stripe");const o=await(async(...e)=>{I=!0;const n=Date.now();return N.then((o=>((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(o,e,n)))})(n.publishableKey);o?(window.Zonos.stripe=o,window.Zonos.isCollect?t.initCollectElement(o):window.Zonos.isInvoice?t.initInvoiceElement(o):t.initCheckoutElement(o)):m("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),R.zonosController=t,r("Zonos controller injected!")},C.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const t=`${R.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${t}"]`))return void r(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,i=document.createElement("script");n?i.type="module":i.noModule=!0,i.src=t,i.crossOrigin="anonymous",i.onerror=()=>{m(`Failed to load ${i.src}`);const t=O(e);t&&R.injectScript({cdnType:t,isModule:n,theRestUrl:o})},s.appendChild(i)},C.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return A;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.255";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.255";case"vercel":return Z}};return R.isNpm&&S()||n()},C.injectZonosCdn=()=>{R.injectScript({cdnType:v,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),R.injectScript({cdnType:v,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),r("Zonos cdn script injected!")},C.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const o=R.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${Z}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${o}/${n}`,r.onerror=()=>{m(`Failed to load ${r.href}`);const o=O(e);o&&R.injectStylesheet({cdnType:o,theRestUrl:n})},t.appendChild(r)},C.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?r("Zonos style links already injected","warn"):(R.injectStylesheet({cdnType:v,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),r("Zonos style css injected!"))},C.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void r("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${L}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!U.test(o.href))return o}return null})())return void r("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=L,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${L}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),r("Zonos font injected!")},C.setupGoogleFont=e=>{var n;null===(n=R.zonosController)||void 0===n||n.setupGoogleFont(e)},C.injectSupportGoogleFont=e=>{var n;r(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${L}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=L,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void r(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),r(`[FONT] ${o} font injected!`)};const E=["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"],P=["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"],F=[...E,...P];export{C as Zonos,F as checkoutSessionAttributeKeys,P as checkoutSessionImmutableAttributeKeys,E as checkoutSessionMutableAttributeKeys}
1
+ import{c as n}from"./p-595f5dd2.js";import{g as o,I as t}from"./p-e7b0c156.js";import{l as r}from"./p-0a377722.js";export{a as availableTestKeys}from"./p-0a377722.js";import{g as i,a as l,h as u,l as m}from"./p-41dd1cb8.js";import{g as p,_ as w,c as f,a as h}from"./p-b2d81c98.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./p-b2d81c98.js";export{c as countryRequireShortAddressCode}from"./p-1d42cd20.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./p-6b361d2b.js";const y=["jsdelivr","cdnjs","unpkg","vercel"],v="jsdelivr",O=e=>{const n=y.indexOf(e);return y[n+1]||null},S=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),o="https://v1.3.257.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com","dev.storybook.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const t=`https://${n}.preview.js.zonos.com`;return r(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),t},g="https://js.stripe.com/v3",j=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,z="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let b=null;const N=Promise.resolve().then((()=>{return e=null,null!==b||(b=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(z),window.Stripe)n(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${g}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&j.test(o.src))return o}return null})();t&&e?console.warn(z):t||(t=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${g}${n}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(m("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==t||t.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):o(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else n(null)}))),b;var e}));let I=!1;N.catch((e=>{I||console.warn(e)}));const k=async({cartId:e,retries:n})=>{const t=i(),s=o(),c=p()||void 0,d=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&d.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:l,json:a,zonosMode:m}=await u(`/api/zonos-elements/get-cart?${d.toString()}`,{body:{isTestMode:t,renewCartExpirationToken:c,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),w=!a||l.length;return w&&n?(r("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:n}),await new Promise((e=>setTimeout(e,500))),k({cartId:e,retries:n-1})):w?null:Object.assign(Object.assign({},a),{zonosMode:m})};var R;const T=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),$=Date.now(),Z="https://v1.3.257.js.zonos.com",A=T||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.257",L="https://fonts.googleapis.com",U=/^https:\/\/fonts\.googleapis\.com/;class C{}R=C,C.doneInit=!1,C.cartSettings=null,C.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),C.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),C._paypalMockResponse=null,C.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,C.isBigCommerce=!1,C.releaseDate="1776719353822",C.isLegacyCheckout=!1,C.googleAnalyticId=null,C.googleAnalyticReady=!1,C.startLoadTime=$,C.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",C.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),C.overrideUseCustomAddressForm=!1,C.isCollect=!1,C.isInvoice=!1,C.isNpm=!0,C.zonosQaUrl=null,C.zonosQaUrlApi=null,C.trackEventLogs=[],C.version="v1.3.257",C.modeAlerted=!1,C.cartData=null,C.paypal=null,C.zonosMode=null,C.IframeService=t,C.getCurrentTimestamp=()=>(new Date).getTime(),C.zonosController=null,C.loadTimeApiInfoList=[],C.logIntervalId=null,C.init=async e=>{const{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d,storeId:a,zonosApiKey:p}=e;if(R.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),R.doneInit)return;if(r(`====== ZONOS DEBUG MODE: on (${R.version}) ======`),R.zonosApiKey=p,R.storeId=a,"undefined"!=typeof window&&window.parent===window&&(R.googleAnalyticReady=!0),R.isNpm){r("====== ZONOS LOADING FROM NPM ======");const n=S();if(n&&!window.isZonosPreview){r(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${n} ======`,"info");const o=document.createElement("script");return o.src=`${n}/dist/scripts/zonos.js`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=R.isNpm,window.Zonos.isBigCommerce=R.isBigCommerce,window.Zonos.isLegacyCheckout=R.isLegacyCheckout,window.Zonos.zonosMode=R.zonosMode,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${n}`)})),void(window.isZonosPreview=!0)}if(!p&&!R.cartId)return void m("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!R.cartData&&R.cartId){r("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=w(e);if(!o&&!n)return m("[ZONOS - loadZonos] invalid cart id"),null;const t=await k({cartId:e,retries:5});return r("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(m("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(R.cartId);if(!e)return void m("Failed to get cart data");R.cartData=e.cartData,R.zonosApiKey=e.zonosApiKey,R.cartSettings=e.settings}const o=await(async()=>{const e=i(),n=l();if(!e&&!n||!window.Zonos.zonosApiKey)return null;if(r("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return r("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:o,json:t}=await u("/api/get-test-public-credential");if(o.length||!t)return m("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o),null;const s=t.publicCredential;return s?(r(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(m("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();o&&(R.zonosApiKey=o)}const h=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(R.cartId&&R.cartData||h){r("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${f}`,document.body.appendChild(e)}r("init zonos"),R.restoreNativeBrowserFunctions(),R.injectCustomScriptForHostedCheckout(),R.injectZonosCdn(),R.injectZonosCss(),R.injectFonts(),R.injectCheckoutInternationalButton(),R.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d}}),R.doneInit=!0},C.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${h}`)){const e=document.createElement("button");e.id=h,e.style.display="none",document.body.appendChild(e)}},C.injectCustomScriptForHostedCheckout=()=>{const e=R.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),t=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||t)){if(o){r("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(t){r("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else r("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},C.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},C.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${h}`);setTimeout((()=>{e&&e.dispatchEvent(n("click"))}),10)},C.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},C.showNotification=e=>{var n;null===(n=R.zonosController)||void 0===n||n.showNotification(e)},C.updateOrganizationName=e=>{var n;null===(n=R.zonosController)||void 0===n||n.updateOrganizationName(e)},C.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},C.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let o=document.querySelector(`iframe#${n}`);o||(o=document.createElement("iframe"),o.id=n,o.style.display="none",o.style.opacity="0",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.width="1px",o.style.height="1px",o.style.border="none",o.style.overflow="hidden",o.style.visibility="hidden",document.body.appendChild(o));const t=(null===(e=o.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(o)},C.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{R.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=R.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;r("loading Stripe");const o=await(async(...e)=>{I=!0;const n=Date.now();return N.then((o=>((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(o,e,n)))})(n.publishableKey);o?(window.Zonos.stripe=o,window.Zonos.isCollect?t.initCollectElement(o):window.Zonos.isInvoice?t.initInvoiceElement(o):t.initCheckoutElement(o)):m("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),R.zonosController=t,r("Zonos controller injected!")},C.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const t=`${R.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${t}"]`))return void r(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,i=document.createElement("script");n?i.type="module":i.noModule=!0,i.src=t,i.crossOrigin="anonymous",i.onerror=()=>{m(`Failed to load ${i.src}`);const t=O(e);t&&R.injectScript({cdnType:t,isModule:n,theRestUrl:o})},s.appendChild(i)},C.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return A;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.257";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.257";case"vercel":return Z}};return R.isNpm&&S()||n()},C.injectZonosCdn=()=>{R.injectScript({cdnType:v,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),R.injectScript({cdnType:v,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),r("Zonos cdn script injected!")},C.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const o=R.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${Z}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${o}/${n}`,r.onerror=()=>{m(`Failed to load ${r.href}`);const o=O(e);o&&R.injectStylesheet({cdnType:o,theRestUrl:n})},t.appendChild(r)},C.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?r("Zonos style links already injected","warn"):(R.injectStylesheet({cdnType:v,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),r("Zonos style css injected!"))},C.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void r("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${L}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!U.test(o.href))return o}return null})())return void r("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=L,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${L}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),r("Zonos font injected!")},C.setupGoogleFont=e=>{var n;null===(n=R.zonosController)||void 0===n||n.setupGoogleFont(e)},C.injectSupportGoogleFont=e=>{var n;r(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${L}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=L,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void r(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),r(`[FONT] ${o} font injected!`)};const E=["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"],P=["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"],F=[...E,...P];export{C as Zonos,F as checkoutSessionAttributeKeys,P as checkoutSessionImmutableAttributeKeys,E as checkoutSessionMutableAttributeKeys}
@@ -1 +1 @@
1
- System.register(["./p-7261e245.system.js","./p-31d1b874.system.js","./p-ac30b7a8.system.js","./p-c9e433c0.system.js","./p-01174496.system.js","./p-d938f42f.system.js"],(function(e){"use strict";var o,t,n,s,a,l,i,c;return{setters:[function(e){o=e.r;t=e.h;n=e.a},function(e){s=e.u;a=e.t;l=e.l},function(e){i=e.f},function(e){c=e.l},function(){},function(){}],execute:function(){var r='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.99996 2.6665C5.05444 2.6665 2.66663 5.05432 2.66663 7.99984C2.66663 10.9454 5.05444 13.3332 7.99996 13.3332C10.9455 13.3332 13.3333 10.9454 13.3333 7.99984C13.3333 5.05432 10.9455 2.6665 7.99996 2.6665Z" fill="#AFF8C3"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.1403 6.10535C10.3582 6.27488 10.3975 6.58902 10.228 6.80699L8.01055 9.65797C7.76436 9.97449 7.29646 10.0036 7.01291 9.72008L5.81307 8.52024C5.61781 8.32498 5.61781 8.0084 5.81307 7.81314C6.00833 7.61787 6.32492 7.61787 6.52018 7.81314L7.45301 8.74597L9.43862 6.19305C9.60815 5.97508 9.92229 5.93581 10.1403 6.10535Z" fill="#246627"/>\n</svg>\n';var d=":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--language-select{width:100%}:host .zonos--language-select .zonos--language-select-content{display:grid;grid-template-columns:repeat(3, minmax(-webkit-max-content, 1fr));grid-template-columns:repeat(3, minmax(max-content, 1fr));padding:16px;padding-top:0px}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button{display:-ms-flexbox;display:flex;padding:8px;gap:4px;-ms-flex-align:center;align-items:center;border-radius:var(--zonos-elements-radius-4);cursor:pointer;width:100%;border:none;background:none}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button:hover{background:var(--zonos-elements-gray-100)}@media (max-width: 400px){:host .zonos--language-select .zonos--language-select-content{grid-template-columns:1fr 1fr}}";var f=d;var h=e("zonos_language_select",function(){function e(e){var t=this;o(this,e);this.handleOnClose=function(){};this.languageSelected=function(e){void s(e);t.handleOnClose()}}e.prototype.render=function(){var e=this;var o=l.selectedLocale;return t(n,{key:"748efbe1de696c0e1f52cef03d86f211c1e5f505",class:"zonos--elements",style:{"--zonos--font-family":i()}},t("div",{key:"97dd3f26dd5aff625b26a08125737f915bfbd112",class:"zonos--language-select"},t("zonos-select-dialog-header",{key:"8c00e1cf6d7addf5b817e07c1fb1b492cfb5775f",handleOnClose:function(){return e.handleOnClose()},label:a("Select a language")}),t("div",{key:"0260631e4303d5cee5035f31667203e4e3417a76",class:"zonos--language-select-content"},c.map((function(n){return t("button",{class:"zonos--language-select-button",onClick:function(){return e.languageSelected(n.code)}},t("zonos-text",{textColor:"gray-800"},n.translatedLabel),n.code===o&&t("zonos-icon",{content:r,size:16}))})))))};return e}());h.style=f;var g='<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var u=":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--select-dialog-header-wrapper{position:-webkit-sticky;position:sticky;top:0;background:var(--zonos-elements-surface-color);padding:16px}:host .zonos--select-dialog-header-wrapper .zonos--select-dialog-header{position:relative;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}";var p=u;var m=e("zonos_select_dialog_header",function(){function e(e){o(this,e);this.handleOnClose=function(){};this.label=""}e.prototype.render=function(){var e=this;return t(n,{key:"a1b9179c608e89ae29416a7c1cb93a5e15c9b029",class:"zonos--elements",style:{"--zonos--font-family":i()}},t("zonos-v-stack",{key:"736354e40352c79c5b1d27207c424fc6ee82f7f4",class:"zonos--select-dialog-header-wrapper",spacing:8},t("div",{key:"700c0321bb2ea565ff861b833f51f3418ad61e4f",class:"zonos--select-dialog-header"},t("zonos-text",{key:"a45fb7507453949a1f3c687ae73635bb8b3f9282",type:"boldLabel"},this.label),t("zonos-button",{key:"a6b210caedc6248d8ab112bb10d888455d6fc6da",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close select dialog",content:g,size:20}),noBackground:true,onClick:function(){return e.handleOnClose()}})),t("slot",{key:"3bfbcd7c5bab9f11e4ed936dcd3b99da553709a0"})))};return e}());m.style=p}}}));
1
+ System.register(["./p-7261e245.system.js","./p-271eebd3.system.js","./p-15ef7644.system.js","./p-c9e433c0.system.js","./p-01174496.system.js","./p-d938f42f.system.js"],(function(e){"use strict";var o,t,n,s,a,l,i,c;return{setters:[function(e){o=e.r;t=e.h;n=e.a},function(e){s=e.u;a=e.t;l=e.l},function(e){i=e.f},function(e){c=e.l},function(){},function(){}],execute:function(){var r='<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.99996 2.6665C5.05444 2.6665 2.66663 5.05432 2.66663 7.99984C2.66663 10.9454 5.05444 13.3332 7.99996 13.3332C10.9455 13.3332 13.3333 10.9454 13.3333 7.99984C13.3333 5.05432 10.9455 2.6665 7.99996 2.6665Z" fill="#AFF8C3"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.1403 6.10535C10.3582 6.27488 10.3975 6.58902 10.228 6.80699L8.01055 9.65797C7.76436 9.97449 7.29646 10.0036 7.01291 9.72008L5.81307 8.52024C5.61781 8.32498 5.61781 8.0084 5.81307 7.81314C6.00833 7.61787 6.32492 7.61787 6.52018 7.81314L7.45301 8.74597L9.43862 6.19305C9.60815 5.97508 9.92229 5.93581 10.1403 6.10535Z" fill="#246627"/>\n</svg>\n';var d=":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--language-select{width:100%}:host .zonos--language-select .zonos--language-select-content{display:grid;grid-template-columns:repeat(3, minmax(-webkit-max-content, 1fr));grid-template-columns:repeat(3, minmax(max-content, 1fr));padding:16px;padding-top:0px}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button{display:-ms-flexbox;display:flex;padding:8px;gap:4px;-ms-flex-align:center;align-items:center;border-radius:var(--zonos-elements-radius-4);cursor:pointer;width:100%;border:none;background:none}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button:hover{background:var(--zonos-elements-gray-100)}@media (max-width: 400px){:host .zonos--language-select .zonos--language-select-content{grid-template-columns:1fr 1fr}}";var f=d;var h=e("zonos_language_select",function(){function e(e){var t=this;o(this,e);this.handleOnClose=function(){};this.languageSelected=function(e){void s(e);t.handleOnClose()}}e.prototype.render=function(){var e=this;var o=l.selectedLocale;return t(n,{key:"748efbe1de696c0e1f52cef03d86f211c1e5f505",class:"zonos--elements",style:{"--zonos--font-family":i()}},t("div",{key:"97dd3f26dd5aff625b26a08125737f915bfbd112",class:"zonos--language-select"},t("zonos-select-dialog-header",{key:"8c00e1cf6d7addf5b817e07c1fb1b492cfb5775f",handleOnClose:function(){return e.handleOnClose()},label:a("Select a language")}),t("div",{key:"0260631e4303d5cee5035f31667203e4e3417a76",class:"zonos--language-select-content"},c.map((function(n){return t("button",{class:"zonos--language-select-button",onClick:function(){return e.languageSelected(n.code)}},t("zonos-text",{textColor:"gray-800"},n.translatedLabel),n.code===o&&t("zonos-icon",{content:r,size:16}))})))))};return e}());h.style=f;var g='<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>';var u=":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--select-dialog-header-wrapper{position:-webkit-sticky;position:sticky;top:0;background:var(--zonos-elements-surface-color);padding:16px}:host .zonos--select-dialog-header-wrapper .zonos--select-dialog-header{position:relative;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}";var p=u;var m=e("zonos_select_dialog_header",function(){function e(e){o(this,e);this.handleOnClose=function(){};this.label=""}e.prototype.render=function(){var e=this;return t(n,{key:"a1b9179c608e89ae29416a7c1cb93a5e15c9b029",class:"zonos--elements",style:{"--zonos--font-family":i()}},t("zonos-v-stack",{key:"736354e40352c79c5b1d27207c424fc6ee82f7f4",class:"zonos--select-dialog-header-wrapper",spacing:8},t("div",{key:"700c0321bb2ea565ff861b833f51f3418ad61e4f",class:"zonos--select-dialog-header"},t("zonos-text",{key:"a45fb7507453949a1f3c687ae73635bb8b3f9282",type:"boldLabel"},this.label),t("zonos-button",{key:"a6b210caedc6248d8ab112bb10d888455d6fc6da",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close select dialog",content:g,size:20}),noBackground:true,onClick:function(){return e.handleOnClose()}})),t("slot",{key:"3bfbcd7c5bab9f11e4ed936dcd3b99da553709a0"})))};return e}());m.style=p}}}));
@@ -0,0 +1 @@
1
+ import{d as s}from"./p-2f924331.js";import{h as t,l as e}from"./p-41dd1cb8.js";const o={},r={},a=async({attributes:a,checkoutSessionId:i})=>{var u;if(o[i]||(o[i]=new Map),a.forEach((s=>{var t;s.value&&(null===(t=o[i])||void 0===t||t.set(s.key,s.value))})),a.length)return r[i]||(r[i]=(u=i,s((async()=>{var s,r;const a=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:a,id:u},method:"POST"});return i.length?(e("Error updating checkout session attributes",i),{success:!1}):(null===(r=o[u])||void 0===r||r.clear(),{success:!!(null==n?void 0:n.success)})}),1e3,{maxWait:5e3}))),r[i]()};export{a as u}
@@ -1 +1 @@
1
- import{r as o,d as e,h as t,F as s,a as n,g as l}from"./p-ce75b047.js";import{b as a,c as i,t as c,L as r,C as d,M as h,d as p,r as m,D as f}from"./p-dafafa07.js";import{c as b,a as u,b as z}from"./p-c398711f.js";import{t as y,s as g,l as x,p as v}from"./p-3ac97c01.js";import{z as w}from"./p-058f6124.js";import{h as k,s as C,g as L,i as S,a as I}from"./p-41dd1cb8.js";import{c as H}from"./p-595f5dd2.js";import{g as j}from"./p-f830f800.js";import{l as M,b as _}from"./p-0a377722.js";import{s as Z}from"./p-4f7d64f6.js";import{i as P,a as D,e as W}from"./p-835c0bd4.js";import{c as B}from"./p-b4b7f705.js";import{l as F}from"./p-97aceb11.js";import{r as U}from"./p-768430fe.js";import{p as V}from"./p-b84be447.js";import{r as T}from"./p-1b8771bb.js";import"./p-67897a0d.js";import"./p-def2d465.js";const $=class{constructor(t){o(this,t),this.closeClick=e(this,"closeClick",7),this.borderRadius="ROUNDED",this.confirmationId=null,this.isLoading=!0,this.notificationType="success",this.notificationTitle="",this.notificationMessages=[],this.notificationActionText=y("Keep shopping"),this.order=null,this.isWaitingToRedirect=!0,this.pullOrder=async()=>{var o,e;const t=g.checkoutSessionId,s=new URLSearchParams;s.set("checkoutSessionId",t||"");const{baseUrl:n,errors:l,json:a}=await k(`/api/zonos-elements/get-order?${s.toString()}`);return l.length||!(null==a?void 0:a.id)?{baseUrl:n,order:null}:(await(null===(e=(o=w.checkoutSettings).onOrderSuccess)||void 0===e?void 0:e.call(o,{zonosApiRoute:n,zonosOrder:a})),{baseUrl:n,order:a})},this.handleSuccessBehavior=async()=>{this.isLoading=!1,await this.getPullOrder()},this.getPullOrder=async(o=0)=>{var e,t;0===o&&M("=== Start to poll for order info","info");const{baseUrl:s,order:n}=await this.pullOrder(),l=!!(null===(t=null===(e=null==n?void 0:n.references)||void 0===e?void 0:e.find((o=>"zonosOrderNumber"===(null==o?void 0:o.key))))||void 0===t?void 0:t.value),a=g.checkoutSessionId,i=parseFloat(new URLSearchParams(window.location.search).get("maxPollingRetries")||"0")||30;M(`=== Polling order (${o} attemps)`,"info"),n?(M("=== CollectOrder info found","info"),o>10&&C({endpoint:`${s}/api/zonos-elements/get-order?checkoutSessionId=${a}&orderId=${n.id}`,errors:[`Collect order found after ${o} attempts`],metadata:{allLogs:_,checkoutSessionId:g.checkoutSessionId||"",orderId:n.id,storeId:w.storeId}}),this.order=n):n&&l||!(o<i)?C({endpoint:`${s}/api/zonos-elements/get-order?checkoutSessionId=${a}`,errors:[`Collect order not found after ${i} attempts`],metadata:{allLogs:_,checkoutSessionId:g.checkoutSessionId||"",storeId:w.storeId}}):(await new Promise((o=>setTimeout(o,1e3))),await this.getPullOrder(o+1))},this.checkStripePaymentStatus=async()=>{const o=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||a.clientSecret;if(o||this.storybookForceStatus){const{error:e,messages:t,status:s}=await i({clientSecret:o,storybookForceStatus:this.storybookForceStatus}),n="requires_action"===s||e;this.notificationType=n?"error":"success",this.notificationMessages=t||[],this.notificationTitle=y(n?"Payment failed":"You're all set!"),M("=== Payment intent retrieve status","info",{clientSecret:o,error:e,messages:t,status:s});const l=new URL(window.location.href);if(l.searchParams.delete("payment_intent_client_secret"),l.searchParams.delete("payment_intent"),l.searchParams.delete("redirect_status"),l.searchParams.delete("zonosCheckoutSessionId"),window.history.replaceState({},"",l.toString()),e&&(null==t?void 0:t.length))Z({event:"zonos-checkout-payment-fail"}),C({endpoint:"Stripe payment failed",errors:[`Payment intent "${o.split("_secret_")[0]||o}" status: ${s} - checkout session: ${g.checkoutSessionId}`],metadata:{allLogs:_,credentialToken:window.Zonos.zonosApiKey}});else{Z({event:"zonos-checkout-success"}),c({checkoutSessionId:g.checkoutSessionId,eventName:"checkout_orderCompleted"});const o=H("zonos-checkout-success",{message:"Zonos Checkout successfully processed order"});document.dispatchEvent(o),await this.handleSuccessBehavior()}}this.isLoading=!1,r(),d(),g.checkoutSessionId=null},this.checkStagingOrderStatus=async()=>{this.notificationType="success",this.notificationTitle=y("You're all set!"),this.notificationMessages=h("succeeded").messages,await this.handleSuccessBehavior(),r(),d(),b(),g.checkoutSessionId=null},this.checkPaypalPaymentStatus=async()=>{if(u.paypalErrorMessage)return this.notificationType="error",this.notificationTitle=y("Payment failed"),this.notificationMessages=[u.paypalErrorMessage],void(this.isLoading=!1);this.isLoading=!1,u.orderIdCreated&&(Z({event:"zonos-checkout-success"}),c({checkoutSessionId:g.checkoutSessionId,eventName:"checkout_orderCompleted"}),this.notificationType="success",this.notificationTitle=y("You're all set!"),this.notificationMessages=h("succeeded").messages,await this.handleSuccessBehavior()),r(),d(),b(),g.checkoutSessionId=null},this.getReceiptUrl=({cartId:o})=>{const e=new URL(`${window.location.origin}/receipt`);e.searchParams.set("referenceId",o),L()&&e.searchParams.set("zonosTestMode","1");const t=new URLSearchParams(window.location.search).get("zonosQaUrl");return t&&e.searchParams.set("zonosQaUrl",t),e.toString()}}componentDidLoad(){if(this.overrideNotification)return this.notificationType=this.overrideNotification.type,this.notificationTitle=this.overrideNotification.title,this.notificationMessages=this.overrideNotification.messages,void(this.isLoading=!1);p.isStagingMode?this.checkStagingOrderStatus():u.orderIdCreated?this.checkPaypalPaymentStatus():this.checkStripePaymentStatus()}render(){const o=window.Zonos.cartId;return t(n,{key:"c085862ecf1f50752634fb44f99b5cb5d82a9e24",class:"zonos--checkout-finish zonos--elements",style:{"--zonos--border-radius":j({overrideBorderStyle:this.borderRadius})}},!this.isLoading&&t("div",{key:"9b30b12c817c3422b355a2f544bbf2908f736c80",class:"zonos--finish-details"},t("div",{key:"697fff3258a6e74d99500ec25f5d3923f8c7cfc2",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:"8457c0c9b22c2fb6374b60e492099981026d2690",class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),this.confirmationId&&t("zonos-badge",{key:"21ab18878abb37a2c37d873c494d71aee3d4ed71",badgeColor:"gray"},this.confirmationId),t("zonos-text",{key:"389918dd57e6ce5744b7192baa3c06c6db3f70cd",class:"zonos--subtitle",textColor:"gray-600"},this.notificationMessages.map((o=>t(s,null,o,t("br",null))))),this.order&&o&&t("div",{key:"cca6b625a6bea62b788cf8dd6bb9e03e6505d81c",class:"zonos--button-container"},t("zonos-button",{key:"0f45987515ae99045e5b449b5b1aaae11d70d9fb",onClick:()=>{window.open(this.getReceiptUrl({cartId:o}),"_blank")},size:"lg",variant:"primary"},y("View receipt"))))))}static get assetsDirs(){return["assets"]}};$.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;height:100%}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:24px;border-radius:var(--zonos--border-radius, 10px);gap:24px;margin-top:24px;background-color:var(--zonos-elements-gray-50);padding:48px}:host .zonos--finish-details{max-width:640px;min-width:300px;line-height:24px;width:0 auto;margin:auto}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .zonos--finish-button-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto;margin-top:48px;max-width:300px}:host .zonos--button-container{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto}:host .zonos--subtitle{text-align:center}:host .zonos--order-number{background-color:var(--zonos-elements-gray-0);border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800);border-radius:var(--zonos-elements-radius-6);padding:4px 8px}";const R=class{constructor(e){o(this,e),this.mobile=!1,this.tablet=!1,this.showLanguageDialog=!1,this.isMobile=!1,this.isTablet=!1}handleGlobalClick(o){!this.el.contains(o.target)&&this.showLanguageDialog&&(this.showLanguageDialog=!1)}toggleLanguageDialog(){this.showLanguageDialog=!this.showLanguageDialog}handleMobileChange(){this.isMobile=P(this.mobile)}handleTabletChange(){this.isTablet=D(this.tablet)}componentWillLoad(){this.isMobile=P(this.mobile),this.isTablet=D(this.tablet)}render(){var o;const e=null===(o=F.find((o=>o.code===x.selectedLocale)))||void 0===o?void 0:o.label,s="gray-1000";return t(n,{key:"9509e7325ad0153d2f5c9ba3b5689fdb3ad6313e",class:B(["zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},t("div",{key:"250716798bf30901678b16e1ac159810f1d7a6ad",class:"zonos--collect-footer"},t("div",{key:"ab61803d4b5348b8978e7dfcb16a5733cca5dd29",class:"zonos--collect-locale-wrapper"},t("zonos-button",{key:"6c5dcd25d5ef73b2098269d840e291343d30cb81",buttonColor:s,class:"zonos--collect-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:s}),onClick:()=>this.toggleLanguageDialog(),variant:"subtle"},e),t("div",{key:"d1a367cd19b36f1a0f49ccfe78e750218b50a03e",class:B(["zonos--collect-language-dialog",this.showLanguageDialog&&"zonos--collect-language-dialog-open"])},t("zonos-language-select",{key:"02f446b8f4e3dc875f78d5ac2f0b9aa6dd071f1c",handleOnClose:()=>this.toggleLanguageDialog()}))),t("div",{key:"b713a78cbd3d3f131c6c473bb1d979899d40b13b",class:"zonos--collect-footer-icon-wrapper"},t("div",{key:"97eab5909d556f13fa2acc0628d583d49f13d3a2",class:"zonos--collect-footer-logo"},t("zonos-text",{key:"a6488e084f153305eed8d6f65341d7ab00297adb",textColor:s},"Powered by"),t("a",{key:"c63a6e1064dbd733add1cc3b1df1456484e2f103",href:"https://zonos.com",target:"_blank",title:"Zonos website"},t("zonos-icon",{key:"081cae2c34e58478a8c20f0f9a9f20dc0b47c9b7",autoHeight:!0,content:'<svg width="43" height="10" viewBox="0 0 43 10" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.35896 0.0640869H0.30768C0.166068 0.0640869 0.0512695 0.178886 0.0512695 0.320497V1.85896C0.0512695 2.00057 0.166068 2.11537 0.30768 2.11537H4.44439C4.54964 2.11537 4.61005 2.2352 4.54745 2.31982L0.151823 8.2615C0.0865163 8.34978 0.0512695 8.45669 0.0512695 8.56649V9.67947C0.0512695 9.82108 0.166068 9.93588 0.30768 9.93588H7.35896C7.50057 9.93588 7.61537 9.82108 7.61537 9.67947V8.14101C7.61537 7.9994 7.50057 7.8846 7.35896 7.8846H3.22226C3.117 7.8846 3.05659 7.76477 3.11919 7.68015L7.51482 1.73847C7.58013 1.65019 7.61537 1.54328 7.61537 1.43348V0.320497C7.61537 0.178886 7.50057 0.0640869 7.35896 0.0640869Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M11.718 0C10.1602 0 8.89746 1.26279 8.89746 2.82051V7.17949C8.89746 8.73721 10.1602 10 11.718 10H13.6411C15.1988 10 16.4616 8.73721 16.4616 7.17949V2.82051C16.4616 1.26279 15.1988 0 13.6411 0H11.718ZM11.718 2.05128C11.2931 2.05128 10.9487 2.39568 10.9487 2.82051V7.17949C10.9487 7.60432 11.2931 7.94872 11.718 7.94872H13.6411C14.0659 7.94872 14.4103 7.60432 14.4103 7.17949V5V2.82051C14.4103 2.39568 14.0659 2.05128 13.6411 2.05128H11.718Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M17.7437 0.436316V9.71132C17.7437 9.85293 17.8585 9.96773 18.0001 9.96773H19.5385C19.6801 9.96773 19.7949 9.85293 19.7949 9.71132V3.74801C19.7949 3.44829 19.969 3.17587 20.241 3.04996L22.1641 2.15964C22.6739 1.92363 23.2565 2.29592 23.2565 2.85769V9.71132C23.2565 9.85293 23.3713 9.96773 23.5129 9.96773H25.0513C25.193 9.96773 25.3078 9.85293 25.3078 9.71132V2.85595C25.3078 0.79631 23.1718 -0.568775 21.3027 0.296257L19.9742 0.911055C19.8685 0.959946 19.7432 0.931536 19.669 0.84187L19.2748 0.365697C19.1773 0.248019 19.0325 0.179905 18.8797 0.179905H18.0001C17.8585 0.179905 17.7437 0.294704 17.7437 0.436316Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M29.4104 0C27.8526 0 26.5898 1.26279 26.5898 2.82051V7.17949C26.5898 8.73721 27.8526 10 29.4104 10H31.3334C32.8912 10 34.1539 8.73721 34.1539 7.17949V2.82051C34.1539 1.26279 32.8912 0 31.3334 0H29.4104ZM29.4104 2.05128C28.9855 2.05128 28.6411 2.39568 28.6411 2.82051V7.17949C28.6411 7.60432 28.9855 7.94872 29.4104 7.94872H31.3334C31.7583 7.94872 32.1027 7.60432 32.1027 7.17949V2.82051C32.1027 2.39568 31.7583 2.05128 31.3334 2.05128H29.4104Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M38.2085 0.0640869H40.3889C41.8309 0.0640869 42.9999 1.23306 42.9999 2.67506C42.9999 2.79477 42.9108 2.89574 42.792 2.91059L41.1732 3.11293C41.054 3.12784 40.9486 3.03485 40.9486 2.91466C40.9486 2.47322 40.5908 2.11537 40.1493 2.11537H38.3397C37.8688 2.11537 37.4871 2.49712 37.4871 2.96803C37.4871 3.3685 37.7658 3.71501 38.1569 3.80087L40.7916 4.37922C42.0811 4.66229 42.9999 5.80462 42.9999 7.12486C42.9999 8.67735 41.7414 9.93588 40.1889 9.93588H38.0468C36.6048 9.93588 35.4358 8.76691 35.4358 7.32491C35.4358 7.2052 35.5249 7.10423 35.6437 7.08938L37.2625 6.88703C37.3817 6.87213 37.4871 6.96512 37.4871 7.08531C37.4871 7.52675 37.8449 7.8846 38.2864 7.8846H40.1176C40.5765 7.8846 40.9486 7.51252 40.9486 7.05354C40.9486 6.67478 40.6925 6.34394 40.3258 6.24901L37.5136 5.52093C36.2902 5.20422 35.4358 4.10042 35.4358 2.83676C35.4358 1.30545 36.6772 0.0640869 38.2085 0.0640869Z" fill="var(--zonos-elements-gray-700)"/>\n</svg>\n',size:42}))),t("div",{key:"0862a11838e62f425d38066230b01f445999d751",class:"dot"}),t("a",{key:"b13f3af014b5d970e45f88cbb0ef669a0f9aa2ac",href:"https://zonos.com/docs/legal/zonos-privacy-policy",target:"_blank"},t("zonos-text",{key:"a675218a36da83427c2ce517a15b1ed5ea5910d6",textColor:s},"Privacy policy")))))}get el(){return l(this)}static get watchers(){return{mobile:["handleMobileChange"],tablet:["handleTabletChange"]}}};R.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:0;left:32px;right:32px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--collect-footer{gap:16px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px;padding-left:0;-ms-flex-align:center;align-items:center;width:100%}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:16px}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo a{line-height:0}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper a{text-decoration:none}:host .zonos--collect-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--collect-footer .zonos--collect-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--collect-footer .zonos--collect-locale-wrapper{gap:4px}}:host .zonos--collect-footer .zonos--collect-language-dialog{position:absolute;bottom:36px;left:var(--language-dialog-left);background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);width:360px;max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:bottom left;transform-origin:bottom left;opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar{width:10px}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--collect-footer .zonos--collect-language-dialog.zonos--collect-language-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .dot{display:-ms-inline-flexbox;display:inline-flex;background:var(--zonos-elements-gray-400);width:6px;height:6px;border-radius:50%}:host(.mobile),:host(.tablet){background-color:var(--zonos-elements-gray-0);width:100%;position:-webkit-sticky;position:sticky;bottom:0}:host(.tablet) .zonos--collect-footer{width:100%;max-width:800px;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex}:host(.mobile) .zonos--collect-locale-wrapper{display:none}:host(.mobile) .zonos--collect-footer{-ms-flex-pack:center;justify-content:center}";const O=class{constructor(t){o(this,t),this.collapseClicked=e(this,"collapseClicked",7),this.mobile=!0,this.landedCostId="",this.isMobile=!1,this.collapseState=this.collapsed}handleCollapseChangeFromProp(o){this.collapseState=o}handleCollapseChange(o){this.collapseClicked.emit(o)}handleWindowResize(){this.isMobile=S(this.mobile)}componentWillLoad(){this.handleWindowResize()}renderShippingAddress(){if(W.isFetchingShippingInfo)return t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},t("zonos-skeleton",{skeletonWidth:"99px"})),t("div",{class:"zonos--collect-order-shipping-info"},t("zonos-skeleton",{skeletonWidth:"152px"}),t("zonos-h-stack",{spacing:8},t("zonos-skeleton",{skeletonWidth:"75px"}),t("zonos-skeleton",{skeletonWidth:"75px"})),t("zonos-skeleton",{skeletonWidth:"50px"})));const o=W.shippingAddress;return o?t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},y("Shipping address")),t("div",{class:"zonos--collect-order-shipping-info"},[[o.location.line1,o.location.line2].filter(Boolean).join(" "),[o.location.locality,o.location.administrativeAreaCode,o.location.postalCode].filter(Boolean).join(", "),o.location.countryCode].map((o=>t("zonos-text",null,o))))):null}render(){return t(n,{class:B(["zonos--collect-order-details zonos--elements",this.isMobile&&"mobile"])},t("div",{class:"zonos--wrapper"},t("button",{class:"zonos--order-details-header",onClick:()=>{this.collapseState=!this.collapseState},type:"button"},t("zonos-text",{type:"semiBoldLabel"},y("Order details")),(()=>t("zonos-icon",this.collapseState?{"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"}:{"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"}))()),t("div",{class:"zonos--order-details-wrapper"},t("zonos-collapse",{collapsed:this.collapseState},t("div",{class:"zonos--collect-order-details-content"},t("zonos-collect-cart-items",null),t("div",{class:"zonos--collect-order-info"},t("div",{class:"zonos--collect-order-details-row"},null!==W.amountTotalPaid&&t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},y("Total paid")),t("zonos-text",null,U({amount:W.amountTotalPaid||0,isForeign:!0}))),W.originCompanyName&&t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},y("Ordered from")),t("zonos-text",null,W.originCompanyName||""))),this.renderShippingAddress()))))))}static get assetsDirs(){return["assets"]}static get watchers(){return{collapsed:["handleCollapseChangeFromProp"],collapseState:["handleCollapseChange"]}}};O.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%}:host *{-ms-scroll-chaining:none;overscroll-behavior:contain}:host *::-webkit-scrollbar{width:10px}:host *::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host *::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host *::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--wrapper{overflow:auto;background-color:var(--zonos-elements-gray-50);border-radius:16px;height:100%;min-height:56px}:host .zonos--order-details-header{position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--zonos-elements-gray-50);border:none;display:-ms-flexbox;display:flex;padding:16px 16px 0 16px;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host .zonos--order-details-header:focus-visible{outline:none}:host .zonos--order-details-wrapper{position:relative;padding:0 16px 16px 16px}:host .zonos--collect-order-details-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:28px}:host .zonos--collect-order-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}:host .zonos--collect-order-info .zonos--collect-order-details-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px}:host .zonos--collect-order-info .zonos--collect-order-details-row>*{-ms-flex:1 1 150px;flex:1 1 150px}:host .zonos--collect-order-info .zonos--collect-order-details-column{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--collect-order-info .zonos--collect-order-shipping-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0}";const N=class{constructor(t){o(this,t),this.continueClicked=e(this,"continueClicked",7),this.paypalSessionFailed=e(this,"paypalSessionFailed",7),this.paypalSessionDone=e(this,"paypalSessionDone",7),this.storeUnsubscribeList=[],this.continueLoading=!1,this.showErrorBanner=!1,this.hasStripePaymentError=!1,this.stagingOrderCreateErrorMessage="",this.internalContinueLoading=this.continueLoading,this.handleValidate=()=>{var o;return!!(null===(o=a.stripePaymentEventData)||void 0===o?void 0:o.complete)},this.continueClickHandler=async({currencyCode:o})=>{var e,t;if(!this.handleValidate())return null===(e=a.stripeBillingAddressElement)||void 0===e||e.getValue(),this.showErrorBanner=!0,null===(t=a.stripeElements)||void 0===t||t.submit(),void setTimeout((()=>{var o;null===(o=this.ele.querySelector("zonos-banner"))||void 0===o||o.scrollIntoView({behavior:"smooth"})}),10);a.checkoutSettlementCurrency=o,Z({event:"zonos-checkout-payment-info"}),this.continueClicked.emit()},this.copyCardToClipboard=async o=>{try{await navigator.clipboard.writeText(o)}catch(e){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:y("Card number copied to clipboard"),timeout:4e3,type:"success"})},this.placeTestOrder=async()=>{this.internalContinueLoading=!0;const{errors:o}=await V();if(o.length)return this.stagingOrderCreateErrorMessage=o[0]||"Failed to create staging order. Please try again.",void(this.internalContinueLoading=!1);this.internalContinueLoading=!1,m()}}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)}componentWillLoad(){this.storeUnsubscribeList=[f("currency",(()=>{z({currency:p.currency})}))],z({currency:p.currency})}disconnectedCallback(){this.storeUnsubscribeList.forEach((o=>o()))}render(){var o;if(this.hasStripePaymentError=a.hasPaymentError,!a.stripeElements)return null;if(!a.clientSecret)return null;this.showErrorBanner&&(this.showErrorBanner=!this.handleValidate());const e=L(),l=p.isStagingMode||I(),i="external_paypal"===(null===(o=a.stripePaymentEventData)||void 0===o?void 0:o.value.type);return t(n,{class:"zonos--checkout-payment zonos--elements"},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},y("Payment method")),(()=>{if(l){const o=w.appearance.theme;return t(s,null,this.stagingOrderCreateErrorMessage&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},this.stagingOrderCreateErrorMessage),t("zonos-empty-state-payment",{emptyStateText:y("No payment method needed for staging"),theme:o}),t("div",{class:"zonos--group-btn"},t("zonos-button",{backgroundColor:this.submitBtnColor,loading:this.internalContinueLoading,onClick:()=>{this.placeTestOrder()},size:"lg",variant:this.submitBtnType},y("Place test order"))))}return a.isFetchingSession||W.isFetchingShippingInfo?null:t(s,null,this.showErrorBanner&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},y("Missing required fields. Make sure all fields are completed.")),this.hasStripePaymentError&&t("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},a.customErrorMessage||y("We couldn't complete your payment. Please verify the payment details and try again.")),u.paypalErrorMessage&&t("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},u.paypalErrorMessage),t("zonos-payment",null),t("div",{class:"zonos--group-btn"},!i&&t(s,null,t("zonos-button",{backgroundColor:this.submitBtnColor,bold:!0,isDisabled:this.continueLoading&&"USD"===a.checkoutSettlementCurrency,loading:this.continueLoading&&"USD"!==a.checkoutSettlementCurrency,onClick:async()=>{p.checkoutSession?await this.continueClickHandler({currencyCode:p.checkoutSession.subtotals.presentmentCurrencyCode}):M("Checkout session is not found")},size:"lg",variant:this.submitBtnType},y("Pay [orderTotal]",{orderTotal:U({amount:W.amountDutyTaxFeeTotal||0,isForeign:!0})})),a.shouldRenderPayInUsdButton&&t("zonos-button",{class:"zonos--pay-in-base-currency-btn",isDisabled:this.continueLoading&&"USD"!==a.checkoutSettlementCurrency,loading:this.continueLoading&&"USD"===a.checkoutSettlementCurrency,onClick:async()=>{await this.continueClickHandler({currencyCode:"USD"})},size:"lg",variant:"subtle"},y("Click to pay in USD"))),t("zonos-paypal-payment",{onPaypalSessionDone:({detail:{orderId:o}})=>{this.paypalSessionDone.emit(o)},onPaypalSessionFail:()=>this.paypalSessionFailed.emit(),style:{display:i?"block":"none"}})),e&&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"},y("Test cards")),t("zonos-text",{textColor:"gray-700"},y("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")},y("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")},y("Failure")," (****0002)")),t("zonos-notification",null)))})()))}get ele(){return l(this)}static get watchers(){return{continueLoading:["continueLoadingWatcher"],hasStripePaymentError:["stripePaymentErrorWatcher"]}}};N.style=".sc-zonos-collect-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-payment-h *.sc-zonos-collect-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-payment-h img.sc-zonos-collect-payment{max-width:100%}.sc-zonos-collect-payment-h dl.sc-zonos-collect-payment,.sc-zonos-collect-payment-h dd.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h1.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h2.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h3.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h4.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h5.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h6.sc-zonos-collect-payment,.sc-zonos-collect-payment-h hr.sc-zonos-collect-payment,.sc-zonos-collect-payment-h figure.sc-zonos-collect-payment,.sc-zonos-collect-payment-h p.sc-zonos-collect-payment,.sc-zonos-collect-payment-h pre.sc-zonos-collect-payment{margin:0}.sc-zonos-collect-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--title.sc-zonos-collect-payment{margin-bottom:24px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment{margin-bottom:20px;overflow: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-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar{width:10px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-payment-h .zonos--payment-error-banner.sc-zonos-collect-payment{margin-bottom:8px}.sc-zonos-collect-payment-h .zonos--error-banner.sc-zonos-collect-payment{margin-bottom:16px}.sc-zonos-collect-payment-h zonos-button.sc-zonos-collect-payment{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-collect-payment-h .zonos--pay-in-base-currency-btn.sc-zonos-collect-payment{-webkit-box-shadow:none;box-shadow:none}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:12px;bottom:-4px;padding-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-text.sc-zonos-collect-payment{text-align:center}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-button.sc-zonos-collect-payment{width:100%}.sc-zonos-collect-payment-h .zonos--test-cards.sc-zonos-collect-payment{margin-top:auto;padding-top:16px}";const E=class{constructor(e){o(this,e),this.mobile=!1,this.tablet=!1,this.collapsed=!1,this.isMobile=!1,this.isTablet=!1,this.isLoading=!0}handleWindowResize(){this.isMobile=P(this.mobile),this.isTablet=D(this.tablet)}componentWillLoad(){this.handleWindowResize(),setTimeout((()=>{this.isLoading=!1}),1e3)}render(){const o=this.isMobile?"gray-1000":"gray-800";return t(n,{key:"6432c5dd5afd628e33ba26385ecfecb470f1757e",class:B(["zonos--collect-review zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},t("div",{key:"e4d113ff1268c36119e1f80164b6cfd702c67f75",class:"zonos--title"},t("zonos-text",{key:"aad9ad9b526ac65d97a88df516e8e7b34fc3d2b1",textColor:o,type:"semiBoldLabel"},y("Pay [organizationName]",{organizationName:w.organizationName}))),t("div",{key:"fcdaebc734a270742fbe21ff932550994e522ea6",class:"zonos--total-pay"},T({content:t("zonos-text",{type:"secondaryPageHeader"},U({amount:W.amountDutyTaxFeeTotal||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"36px",skeletonWidth:"150px"})))}static get assetsDirs(){return["assets"]}};E.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;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;gap:48px}:host .zonos--total-pay zonos-text{-ms-flex-negative:0;flex-shrink:0}:host .zonos--total-pay::after{content:"";position:relative;height:1px;width:100%;background:var(--zonos-elements-gray-200)}:host(.mobile),:host(.tablet){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;padding:4px 0;background-color:transparent;position:relative}:host(.mobile) .zonos--total-pay,:host(.tablet) .zonos--total-pay{margin:0}';const Y=class{constructor(e){o(this,e),this.storeUnsubscribeList=[],this.subtotals={},this.initSubtotalData=()=>{var o;const e=null===(o=p.checkoutSession)||void 0===o?void 0:o.subtotals;if(!e)return;const t=y("Duties"),s=y("Taxes"),n=y("Fees"),l={[t]:0,[n]:0,[s]:0},a=e.duties,i=e.taxes,c=e.fees;void 0!==a&&(l[t]||(l[t]=0),l[t]+=a),void 0!==i&&(l[s]||(l[s]=0),l[s]+=i),void 0!==c&&(l[n]||(l[n]=0),l[n]+=c),this.subtotals=l}}disconnectedCallback(){this.storeUnsubscribeList.forEach((o=>o()))}componentWillLoad(){this.storeUnsubscribeList=[f("checkoutSession",this.initSubtotalData),v("translatedChunks",this.initSubtotalData)]}render(){return this.initSubtotalData(),t(n,{key:"ab687a6e1ec67f6609081036a75e9905ff34c6b1",class:"zonos--collect-subtotal zonos--elements"},t("table",{key:"303b8c49983e9f7aea4d31400fed53d858eb078d",class:"zonos--collect-table"},!!this.subtotals[y("Duties")]&&t("tr",{key:"a60fa4f1f1afacef0144b86c054f44572576f7af",class:"zonos--row zonos--collect-duty"},t("td",{key:"aeaf798e26bbd482196d7208eb05657a1d15dad8",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"835d817709ae3b7e2d888d618e0856fb2e637e4d",type:"semiBoldLabel"},y("Duties"))),t("td",{key:"5bb47a115ea61fa897a3f48bbd10c5f78af3703e",class:"zonos--column"}),t("td",{key:"32632c4beb855ca687c615f5e6c63c82e2e05c80",class:"zonos--column zonos--collect-subtotal-price"},T({content:t("zonos-text",{type:"label"},U({amount:this.subtotals[y("Duties")]||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[y("Taxes")]&&t("tr",{key:"055bb237dafaea8de18b127641c8fd7e1ece563b",class:"zonos--row zonos--collect-tax"},t("td",{key:"1e73b140c2c9090ccfb91ce4efca483e8fb56e9e",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"a3375ecd77460c78c7c5f59bf7b9b8612cd53e41",type:"semiBoldLabel"},y("Taxes"))),t("td",{key:"20685646be29873967c2f335c775046068248ad3",class:"zonos--column"}),t("td",{key:"2e2c6af2c1a7840df03351178ddf3107fcc36494",class:"zonos--column zonos--collect-subtotal-price"},T({content:t("zonos-text",{type:"label"},U({amount:this.subtotals[y("Taxes")]||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[y("Fees")]&&t("tr",{key:"8157aba5c6a23680b0bc681adc127747f01a2973",class:"zonos--row zonos--collect-fee"},t("td",{key:"8266654f9e65003f297222bb935013a8b9b3b430",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"8399000a5f61e4737764b68b89799b409dce6034",type:"semiBoldLabel"},y("Fees"))),t("td",{key:"2a9763f2401967ea1bdfa2c17514d18e2a4e0db6",class:"zonos--column"}),t("td",{key:"ac2f275312c2ba69888e6e57dde8b4b451839b86",class:"zonos--column zonos--collect-subtotal-price"},T({content:t("zonos-text",{type:"label"},U({amount:this.subtotals[y("Fees")]||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),t("tr",{key:"a293d1b9342251f7326c1ac68e2bab83eae2ed80",class:"zonos--row zonos--collect-spacing"},t("td",{key:"c136b1b807f32dc21c131326d70500d2e2c64efe",class:"zonos--column",colSpan:3})),t("tr",{key:"59747101f1a9ef7c8fad60e90ea5b8c31015438c",class:"zonos--row zonos--collect-total zonos--collect-total-subtotal"},t("td",{key:"96d201ba6f3e571adac265127229c94cdc96be2a",class:"zonos--column"}),t("td",{key:"f2f4cb751e35fc0ebaa803659f26a2314d8bf639",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"b4f89ea1e523af8a5aead4ef007a6f0dc7e7f441",type:"label"},y("Subtotal"))),t("td",{key:"28b6aea6363b2bef1d072ad77f409ae77976305c",class:"zonos--column zonos--collect-subtotal-price"},T({content:t("zonos-text",{type:"label"},U({amount:W.amountDutyTaxFeeTotal||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),t("tr",{key:"f0072cdd200e8483421265af39a90fb655fb2ef0",class:"zonos--row zonos--collect-total"},t("td",{key:"88a007048d33c919a6c5f87cf7cd071f83e7448b",class:"zonos--column"}),t("td",{key:"24bba9e9b81ff443dd5ca4832c3169e3605a93b8",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"594d4e96bec3a2153f6622c6842970ebee5bb463",type:"semiBoldLabel"},y("Customs fees total"))),t("td",{key:"b3ffd6dcae747dd2ed68ae16fb60d9655f7669dc",class:"zonos--column zonos--collect-subtotal-price"},T({content:t("zonos-text",{type:"semiBoldLabel"},U({amount:W.amountDutyTaxFeeTotal||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"})))))}static get assetsDirs(){return["assets"]}};Y.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;bottom:60px}:host .zonos--collect-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--collect-table .zonos--column{padding:8px 8px;vertical-align:top}:host .zonos--collect-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--collect-table .zonos--column:first-child{width:60px;max-width:100px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--collect-subtotal-price{text-align:right}:host .zonos--collect-subtotal-price zonos-text{white-space:nowrap}:host .zonos--collect-total .zonos--column{padding:16px 0}:host .zonos--collect-total-subtotal .zonos--collect-subtotal-title,:host .zonos--collect-total-subtotal .zonos--collect-subtotal-price{border-bottom:1px solid var(--zonos-elements-gray-200)}:host .zonos--collect-subtotal-price zonos-text,:host .zonos--collect-pay-total zonos-text{white-space:nowrap}";export{$ as zonos_collect_finish,R as zonos_collect_footer,O as zonos_collect_order_details,N as zonos_collect_payment,E as zonos_collect_review,Y as zonos_collect_subtotal}
1
+ import{r as o,d as e,h as t,F as s,a as n,g as l}from"./p-ce75b047.js";import{b as a,c as i,t as c,L as r,C as d,M as h,d as p,r as m,D as f}from"./p-e62342c3.js";import{c as b,a as u,b as z}from"./p-8ed0fad5.js";import{t as y,s as g,l as x,p as v}from"./p-7caa75bb.js";import{z as w}from"./p-ed9385f4.js";import{h as k,s as C,g as L,i as S,a as I}from"./p-41dd1cb8.js";import{c as H}from"./p-595f5dd2.js";import{g as j}from"./p-5beab541.js";import{l as M,b as _}from"./p-0a377722.js";import{s as Z}from"./p-387f6a4d.js";import{i as P,a as D,e as W}from"./p-7559c494.js";import{c as B}from"./p-b4b7f705.js";import{l as F}from"./p-97aceb11.js";import{r as U}from"./p-0e83d193.js";import{p as V}from"./p-ac7b93c9.js";import{r as T}from"./p-1b8771bb.js";import"./p-f6922df5.js";import"./p-7d9bbdc8.js";const $=class{constructor(t){o(this,t),this.closeClick=e(this,"closeClick",7),this.borderRadius="ROUNDED",this.confirmationId=null,this.isLoading=!0,this.notificationType="success",this.notificationTitle="",this.notificationMessages=[],this.notificationActionText=y("Keep shopping"),this.order=null,this.isWaitingToRedirect=!0,this.pullOrder=async()=>{var o,e;const t=g.checkoutSessionId,s=new URLSearchParams;s.set("checkoutSessionId",t||"");const{baseUrl:n,errors:l,json:a}=await k(`/api/zonos-elements/get-order?${s.toString()}`);return l.length||!(null==a?void 0:a.id)?{baseUrl:n,order:null}:(await(null===(e=(o=w.checkoutSettings).onOrderSuccess)||void 0===e?void 0:e.call(o,{zonosApiRoute:n,zonosOrder:a})),{baseUrl:n,order:a})},this.handleSuccessBehavior=async()=>{this.isLoading=!1,await this.getPullOrder()},this.getPullOrder=async(o=0)=>{var e,t;0===o&&M("=== Start to poll for order info","info");const{baseUrl:s,order:n}=await this.pullOrder(),l=!!(null===(t=null===(e=null==n?void 0:n.references)||void 0===e?void 0:e.find((o=>"zonosOrderNumber"===(null==o?void 0:o.key))))||void 0===t?void 0:t.value),a=g.checkoutSessionId,i=parseFloat(new URLSearchParams(window.location.search).get("maxPollingRetries")||"0")||30;M(`=== Polling order (${o} attemps)`,"info"),n?(M("=== CollectOrder info found","info"),o>10&&C({endpoint:`${s}/api/zonos-elements/get-order?checkoutSessionId=${a}&orderId=${n.id}`,errors:[`Collect order found after ${o} attempts`],metadata:{allLogs:_,checkoutSessionId:g.checkoutSessionId||"",orderId:n.id,storeId:w.storeId}}),this.order=n):n&&l||!(o<i)?C({endpoint:`${s}/api/zonos-elements/get-order?checkoutSessionId=${a}`,errors:[`Collect order not found after ${i} attempts`],metadata:{allLogs:_,checkoutSessionId:g.checkoutSessionId||"",storeId:w.storeId}}):(await new Promise((o=>setTimeout(o,1e3))),await this.getPullOrder(o+1))},this.checkStripePaymentStatus=async()=>{const o=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||a.clientSecret;if(o||this.storybookForceStatus){const{error:e,messages:t,status:s}=await i({clientSecret:o,storybookForceStatus:this.storybookForceStatus}),n="requires_action"===s||e;this.notificationType=n?"error":"success",this.notificationMessages=t||[],this.notificationTitle=y(n?"Payment failed":"You're all set!"),M("=== Payment intent retrieve status","info",{clientSecret:o,error:e,messages:t,status:s});const l=new URL(window.location.href);if(l.searchParams.delete("payment_intent_client_secret"),l.searchParams.delete("payment_intent"),l.searchParams.delete("redirect_status"),l.searchParams.delete("zonosCheckoutSessionId"),window.history.replaceState({},"",l.toString()),e&&(null==t?void 0:t.length))Z({event:"zonos-checkout-payment-fail"}),C({endpoint:"Stripe payment failed",errors:[`Payment intent "${o.split("_secret_")[0]||o}" status: ${s} - checkout session: ${g.checkoutSessionId}`],metadata:{allLogs:_,credentialToken:window.Zonos.zonosApiKey}});else{Z({event:"zonos-checkout-success"}),c({checkoutSessionId:g.checkoutSessionId,eventName:"checkout_orderCompleted"});const o=H("zonos-checkout-success",{message:"Zonos Checkout successfully processed order"});document.dispatchEvent(o),await this.handleSuccessBehavior()}}this.isLoading=!1,r(),d(),g.checkoutSessionId=null},this.checkStagingOrderStatus=async()=>{this.notificationType="success",this.notificationTitle=y("You're all set!"),this.notificationMessages=h("succeeded").messages,await this.handleSuccessBehavior(),r(),d(),b(),g.checkoutSessionId=null},this.checkPaypalPaymentStatus=async()=>{if(u.paypalErrorMessage)return this.notificationType="error",this.notificationTitle=y("Payment failed"),this.notificationMessages=[u.paypalErrorMessage],void(this.isLoading=!1);this.isLoading=!1,u.orderIdCreated&&(Z({event:"zonos-checkout-success"}),c({checkoutSessionId:g.checkoutSessionId,eventName:"checkout_orderCompleted"}),this.notificationType="success",this.notificationTitle=y("You're all set!"),this.notificationMessages=h("succeeded").messages,await this.handleSuccessBehavior()),r(),d(),b(),g.checkoutSessionId=null},this.getReceiptUrl=({cartId:o})=>{const e=new URL(`${window.location.origin}/receipt`);e.searchParams.set("referenceId",o),L()&&e.searchParams.set("zonosTestMode","1");const t=new URLSearchParams(window.location.search).get("zonosQaUrl");return t&&e.searchParams.set("zonosQaUrl",t),e.toString()}}componentDidLoad(){if(this.overrideNotification)return this.notificationType=this.overrideNotification.type,this.notificationTitle=this.overrideNotification.title,this.notificationMessages=this.overrideNotification.messages,void(this.isLoading=!1);p.isStagingMode?this.checkStagingOrderStatus():u.orderIdCreated?this.checkPaypalPaymentStatus():this.checkStripePaymentStatus()}render(){const o=window.Zonos.cartId;return t(n,{key:"c085862ecf1f50752634fb44f99b5cb5d82a9e24",class:"zonos--checkout-finish zonos--elements",style:{"--zonos--border-radius":j({overrideBorderStyle:this.borderRadius})}},!this.isLoading&&t("div",{key:"9b30b12c817c3422b355a2f544bbf2908f736c80",class:"zonos--finish-details"},t("div",{key:"697fff3258a6e74d99500ec25f5d3923f8c7cfc2",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:"8457c0c9b22c2fb6374b60e492099981026d2690",class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),this.confirmationId&&t("zonos-badge",{key:"21ab18878abb37a2c37d873c494d71aee3d4ed71",badgeColor:"gray"},this.confirmationId),t("zonos-text",{key:"389918dd57e6ce5744b7192baa3c06c6db3f70cd",class:"zonos--subtitle",textColor:"gray-600"},this.notificationMessages.map((o=>t(s,null,o,t("br",null))))),this.order&&o&&t("div",{key:"cca6b625a6bea62b788cf8dd6bb9e03e6505d81c",class:"zonos--button-container"},t("zonos-button",{key:"0f45987515ae99045e5b449b5b1aaae11d70d9fb",onClick:()=>{window.open(this.getReceiptUrl({cartId:o}),"_blank")},size:"lg",variant:"primary"},y("View receipt"))))))}static get assetsDirs(){return["assets"]}};$.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;height:100%}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:24px;border-radius:var(--zonos--border-radius, 10px);gap:24px;margin-top:24px;background-color:var(--zonos-elements-gray-50);padding:48px}:host .zonos--finish-details{max-width:640px;min-width:300px;line-height:24px;width:0 auto;margin:auto}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .zonos--finish-button-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto;margin-top:48px;max-width:300px}:host .zonos--button-container{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto}:host .zonos--subtitle{text-align:center}:host .zonos--order-number{background-color:var(--zonos-elements-gray-0);border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800);border-radius:var(--zonos-elements-radius-6);padding:4px 8px}";const R=class{constructor(e){o(this,e),this.mobile=!1,this.tablet=!1,this.showLanguageDialog=!1,this.isMobile=!1,this.isTablet=!1}handleGlobalClick(o){!this.el.contains(o.target)&&this.showLanguageDialog&&(this.showLanguageDialog=!1)}toggleLanguageDialog(){this.showLanguageDialog=!this.showLanguageDialog}handleMobileChange(){this.isMobile=P(this.mobile)}handleTabletChange(){this.isTablet=D(this.tablet)}componentWillLoad(){this.isMobile=P(this.mobile),this.isTablet=D(this.tablet)}render(){var o;const e=null===(o=F.find((o=>o.code===x.selectedLocale)))||void 0===o?void 0:o.label,s="gray-1000";return t(n,{key:"9509e7325ad0153d2f5c9ba3b5689fdb3ad6313e",class:B(["zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},t("div",{key:"250716798bf30901678b16e1ac159810f1d7a6ad",class:"zonos--collect-footer"},t("div",{key:"ab61803d4b5348b8978e7dfcb16a5733cca5dd29",class:"zonos--collect-locale-wrapper"},t("zonos-button",{key:"6c5dcd25d5ef73b2098269d840e291343d30cb81",buttonColor:s,class:"zonos--collect-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:s}),onClick:()=>this.toggleLanguageDialog(),variant:"subtle"},e),t("div",{key:"d1a367cd19b36f1a0f49ccfe78e750218b50a03e",class:B(["zonos--collect-language-dialog",this.showLanguageDialog&&"zonos--collect-language-dialog-open"])},t("zonos-language-select",{key:"02f446b8f4e3dc875f78d5ac2f0b9aa6dd071f1c",handleOnClose:()=>this.toggleLanguageDialog()}))),t("div",{key:"b713a78cbd3d3f131c6c473bb1d979899d40b13b",class:"zonos--collect-footer-icon-wrapper"},t("div",{key:"97eab5909d556f13fa2acc0628d583d49f13d3a2",class:"zonos--collect-footer-logo"},t("zonos-text",{key:"a6488e084f153305eed8d6f65341d7ab00297adb",textColor:s},"Powered by"),t("a",{key:"c63a6e1064dbd733add1cc3b1df1456484e2f103",href:"https://zonos.com",target:"_blank",title:"Zonos website"},t("zonos-icon",{key:"081cae2c34e58478a8c20f0f9a9f20dc0b47c9b7",autoHeight:!0,content:'<svg width="43" height="10" viewBox="0 0 43 10" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.35896 0.0640869H0.30768C0.166068 0.0640869 0.0512695 0.178886 0.0512695 0.320497V1.85896C0.0512695 2.00057 0.166068 2.11537 0.30768 2.11537H4.44439C4.54964 2.11537 4.61005 2.2352 4.54745 2.31982L0.151823 8.2615C0.0865163 8.34978 0.0512695 8.45669 0.0512695 8.56649V9.67947C0.0512695 9.82108 0.166068 9.93588 0.30768 9.93588H7.35896C7.50057 9.93588 7.61537 9.82108 7.61537 9.67947V8.14101C7.61537 7.9994 7.50057 7.8846 7.35896 7.8846H3.22226C3.117 7.8846 3.05659 7.76477 3.11919 7.68015L7.51482 1.73847C7.58013 1.65019 7.61537 1.54328 7.61537 1.43348V0.320497C7.61537 0.178886 7.50057 0.0640869 7.35896 0.0640869Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M11.718 0C10.1602 0 8.89746 1.26279 8.89746 2.82051V7.17949C8.89746 8.73721 10.1602 10 11.718 10H13.6411C15.1988 10 16.4616 8.73721 16.4616 7.17949V2.82051C16.4616 1.26279 15.1988 0 13.6411 0H11.718ZM11.718 2.05128C11.2931 2.05128 10.9487 2.39568 10.9487 2.82051V7.17949C10.9487 7.60432 11.2931 7.94872 11.718 7.94872H13.6411C14.0659 7.94872 14.4103 7.60432 14.4103 7.17949V5V2.82051C14.4103 2.39568 14.0659 2.05128 13.6411 2.05128H11.718Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M17.7437 0.436316V9.71132C17.7437 9.85293 17.8585 9.96773 18.0001 9.96773H19.5385C19.6801 9.96773 19.7949 9.85293 19.7949 9.71132V3.74801C19.7949 3.44829 19.969 3.17587 20.241 3.04996L22.1641 2.15964C22.6739 1.92363 23.2565 2.29592 23.2565 2.85769V9.71132C23.2565 9.85293 23.3713 9.96773 23.5129 9.96773H25.0513C25.193 9.96773 25.3078 9.85293 25.3078 9.71132V2.85595C25.3078 0.79631 23.1718 -0.568775 21.3027 0.296257L19.9742 0.911055C19.8685 0.959946 19.7432 0.931536 19.669 0.84187L19.2748 0.365697C19.1773 0.248019 19.0325 0.179905 18.8797 0.179905H18.0001C17.8585 0.179905 17.7437 0.294704 17.7437 0.436316Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M29.4104 0C27.8526 0 26.5898 1.26279 26.5898 2.82051V7.17949C26.5898 8.73721 27.8526 10 29.4104 10H31.3334C32.8912 10 34.1539 8.73721 34.1539 7.17949V2.82051C34.1539 1.26279 32.8912 0 31.3334 0H29.4104ZM29.4104 2.05128C28.9855 2.05128 28.6411 2.39568 28.6411 2.82051V7.17949C28.6411 7.60432 28.9855 7.94872 29.4104 7.94872H31.3334C31.7583 7.94872 32.1027 7.60432 32.1027 7.17949V2.82051C32.1027 2.39568 31.7583 2.05128 31.3334 2.05128H29.4104Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M38.2085 0.0640869H40.3889C41.8309 0.0640869 42.9999 1.23306 42.9999 2.67506C42.9999 2.79477 42.9108 2.89574 42.792 2.91059L41.1732 3.11293C41.054 3.12784 40.9486 3.03485 40.9486 2.91466C40.9486 2.47322 40.5908 2.11537 40.1493 2.11537H38.3397C37.8688 2.11537 37.4871 2.49712 37.4871 2.96803C37.4871 3.3685 37.7658 3.71501 38.1569 3.80087L40.7916 4.37922C42.0811 4.66229 42.9999 5.80462 42.9999 7.12486C42.9999 8.67735 41.7414 9.93588 40.1889 9.93588H38.0468C36.6048 9.93588 35.4358 8.76691 35.4358 7.32491C35.4358 7.2052 35.5249 7.10423 35.6437 7.08938L37.2625 6.88703C37.3817 6.87213 37.4871 6.96512 37.4871 7.08531C37.4871 7.52675 37.8449 7.8846 38.2864 7.8846H40.1176C40.5765 7.8846 40.9486 7.51252 40.9486 7.05354C40.9486 6.67478 40.6925 6.34394 40.3258 6.24901L37.5136 5.52093C36.2902 5.20422 35.4358 4.10042 35.4358 2.83676C35.4358 1.30545 36.6772 0.0640869 38.2085 0.0640869Z" fill="var(--zonos-elements-gray-700)"/>\n</svg>\n',size:42}))),t("div",{key:"0862a11838e62f425d38066230b01f445999d751",class:"dot"}),t("a",{key:"b13f3af014b5d970e45f88cbb0ef669a0f9aa2ac",href:"https://zonos.com/docs/legal/zonos-privacy-policy",target:"_blank"},t("zonos-text",{key:"a675218a36da83427c2ce517a15b1ed5ea5910d6",textColor:s},"Privacy policy")))))}get el(){return l(this)}static get watchers(){return{mobile:["handleMobileChange"],tablet:["handleTabletChange"]}}};R.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:0;left:32px;right:32px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--collect-footer{gap:16px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px;padding-left:0;-ms-flex-align:center;align-items:center;width:100%}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:16px}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo a{line-height:0}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper a{text-decoration:none}:host .zonos--collect-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--collect-footer .zonos--collect-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--collect-footer .zonos--collect-locale-wrapper{gap:4px}}:host .zonos--collect-footer .zonos--collect-language-dialog{position:absolute;bottom:36px;left:var(--language-dialog-left);background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);width:360px;max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:bottom left;transform-origin:bottom left;opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar{width:10px}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--collect-footer .zonos--collect-language-dialog.zonos--collect-language-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .dot{display:-ms-inline-flexbox;display:inline-flex;background:var(--zonos-elements-gray-400);width:6px;height:6px;border-radius:50%}:host(.mobile),:host(.tablet){background-color:var(--zonos-elements-gray-0);width:100%;position:-webkit-sticky;position:sticky;bottom:0}:host(.tablet) .zonos--collect-footer{width:100%;max-width:800px;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex}:host(.mobile) .zonos--collect-locale-wrapper{display:none}:host(.mobile) .zonos--collect-footer{-ms-flex-pack:center;justify-content:center}";const O=class{constructor(t){o(this,t),this.collapseClicked=e(this,"collapseClicked",7),this.mobile=!0,this.landedCostId="",this.isMobile=!1,this.collapseState=this.collapsed}handleCollapseChangeFromProp(o){this.collapseState=o}handleCollapseChange(o){this.collapseClicked.emit(o)}handleWindowResize(){this.isMobile=S(this.mobile)}componentWillLoad(){this.handleWindowResize()}renderShippingAddress(){if(W.isFetchingShippingInfo)return t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},t("zonos-skeleton",{skeletonWidth:"99px"})),t("div",{class:"zonos--collect-order-shipping-info"},t("zonos-skeleton",{skeletonWidth:"152px"}),t("zonos-h-stack",{spacing:8},t("zonos-skeleton",{skeletonWidth:"75px"}),t("zonos-skeleton",{skeletonWidth:"75px"})),t("zonos-skeleton",{skeletonWidth:"50px"})));const o=W.shippingAddress;return o?t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},y("Shipping address")),t("div",{class:"zonos--collect-order-shipping-info"},[[o.location.line1,o.location.line2].filter(Boolean).join(" "),[o.location.locality,o.location.administrativeAreaCode,o.location.postalCode].filter(Boolean).join(", "),o.location.countryCode].map((o=>t("zonos-text",null,o))))):null}render(){return t(n,{class:B(["zonos--collect-order-details zonos--elements",this.isMobile&&"mobile"])},t("div",{class:"zonos--wrapper"},t("button",{class:"zonos--order-details-header",onClick:()=>{this.collapseState=!this.collapseState},type:"button"},t("zonos-text",{type:"semiBoldLabel"},y("Order details")),(()=>t("zonos-icon",this.collapseState?{"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"}:{"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"}))()),t("div",{class:"zonos--order-details-wrapper"},t("zonos-collapse",{collapsed:this.collapseState},t("div",{class:"zonos--collect-order-details-content"},t("zonos-collect-cart-items",null),t("div",{class:"zonos--collect-order-info"},t("div",{class:"zonos--collect-order-details-row"},null!==W.amountTotalPaid&&t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},y("Total paid")),t("zonos-text",null,U({amount:W.amountTotalPaid||0,isForeign:!0}))),W.originCompanyName&&t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},y("Ordered from")),t("zonos-text",null,W.originCompanyName||""))),this.renderShippingAddress()))))))}static get assetsDirs(){return["assets"]}static get watchers(){return{collapsed:["handleCollapseChangeFromProp"],collapseState:["handleCollapseChange"]}}};O.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%}:host *{-ms-scroll-chaining:none;overscroll-behavior:contain}:host *::-webkit-scrollbar{width:10px}:host *::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host *::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host *::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--wrapper{overflow:auto;background-color:var(--zonos-elements-gray-50);border-radius:16px;height:100%;min-height:56px}:host .zonos--order-details-header{position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--zonos-elements-gray-50);border:none;display:-ms-flexbox;display:flex;padding:16px 16px 0 16px;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host .zonos--order-details-header:focus-visible{outline:none}:host .zonos--order-details-wrapper{position:relative;padding:0 16px 16px 16px}:host .zonos--collect-order-details-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:28px}:host .zonos--collect-order-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}:host .zonos--collect-order-info .zonos--collect-order-details-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px}:host .zonos--collect-order-info .zonos--collect-order-details-row>*{-ms-flex:1 1 150px;flex:1 1 150px}:host .zonos--collect-order-info .zonos--collect-order-details-column{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--collect-order-info .zonos--collect-order-shipping-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0}";const N=class{constructor(t){o(this,t),this.continueClicked=e(this,"continueClicked",7),this.paypalSessionFailed=e(this,"paypalSessionFailed",7),this.paypalSessionDone=e(this,"paypalSessionDone",7),this.storeUnsubscribeList=[],this.continueLoading=!1,this.showErrorBanner=!1,this.hasStripePaymentError=!1,this.stagingOrderCreateErrorMessage="",this.internalContinueLoading=this.continueLoading,this.handleValidate=()=>{var o;return!!(null===(o=a.stripePaymentEventData)||void 0===o?void 0:o.complete)},this.continueClickHandler=async({currencyCode:o})=>{var e,t;if(!this.handleValidate())return null===(e=a.stripeBillingAddressElement)||void 0===e||e.getValue(),this.showErrorBanner=!0,null===(t=a.stripeElements)||void 0===t||t.submit(),void setTimeout((()=>{var o;null===(o=this.ele.querySelector("zonos-banner"))||void 0===o||o.scrollIntoView({behavior:"smooth"})}),10);a.checkoutSettlementCurrency=o,Z({event:"zonos-checkout-payment-info"}),this.continueClicked.emit()},this.copyCardToClipboard=async o=>{try{await navigator.clipboard.writeText(o)}catch(e){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:y("Card number copied to clipboard"),timeout:4e3,type:"success"})},this.placeTestOrder=async()=>{this.internalContinueLoading=!0;const{errors:o}=await V();if(o.length)return this.stagingOrderCreateErrorMessage=o[0]||"Failed to create staging order. Please try again.",void(this.internalContinueLoading=!1);this.internalContinueLoading=!1,m()}}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)}componentWillLoad(){this.storeUnsubscribeList=[f("currency",(()=>{z({currency:p.currency})}))],z({currency:p.currency})}disconnectedCallback(){this.storeUnsubscribeList.forEach((o=>o()))}render(){var o;if(this.hasStripePaymentError=a.hasPaymentError,!a.stripeElements)return null;if(!a.clientSecret)return null;this.showErrorBanner&&(this.showErrorBanner=!this.handleValidate());const e=L(),l=p.isStagingMode||I(),i="external_paypal"===(null===(o=a.stripePaymentEventData)||void 0===o?void 0:o.value.type);return t(n,{class:"zonos--checkout-payment zonos--elements"},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},y("Payment method")),(()=>{if(l){const o=w.appearance.theme;return t(s,null,this.stagingOrderCreateErrorMessage&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},this.stagingOrderCreateErrorMessage),t("zonos-empty-state-payment",{emptyStateText:y("No payment method needed for staging"),theme:o}),t("div",{class:"zonos--group-btn"},t("zonos-button",{backgroundColor:this.submitBtnColor,loading:this.internalContinueLoading,onClick:()=>{this.placeTestOrder()},size:"lg",variant:this.submitBtnType},y("Place test order"))))}return a.isFetchingSession||W.isFetchingShippingInfo?null:t(s,null,this.showErrorBanner&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},y("Missing required fields. Make sure all fields are completed.")),this.hasStripePaymentError&&t("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},a.customErrorMessage||y("We couldn't complete your payment. Please verify the payment details and try again.")),u.paypalErrorMessage&&t("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},u.paypalErrorMessage),t("zonos-payment",null),t("div",{class:"zonos--group-btn"},!i&&t(s,null,t("zonos-button",{backgroundColor:this.submitBtnColor,bold:!0,isDisabled:this.continueLoading&&"USD"===a.checkoutSettlementCurrency,loading:this.continueLoading&&"USD"!==a.checkoutSettlementCurrency,onClick:async()=>{p.checkoutSession?await this.continueClickHandler({currencyCode:p.checkoutSession.subtotals.presentmentCurrencyCode}):M("Checkout session is not found")},size:"lg",variant:this.submitBtnType},y("Pay [orderTotal]",{orderTotal:U({amount:W.amountDutyTaxFeeTotal||0,isForeign:!0})})),a.shouldRenderPayInUsdButton&&t("zonos-button",{class:"zonos--pay-in-base-currency-btn",isDisabled:this.continueLoading&&"USD"!==a.checkoutSettlementCurrency,loading:this.continueLoading&&"USD"===a.checkoutSettlementCurrency,onClick:async()=>{await this.continueClickHandler({currencyCode:"USD"})},size:"lg",variant:"subtle"},y("Click to pay in USD"))),t("zonos-paypal-payment",{onPaypalSessionDone:({detail:{orderId:o}})=>{this.paypalSessionDone.emit(o)},onPaypalSessionFail:()=>this.paypalSessionFailed.emit(),style:{display:i?"block":"none"}})),e&&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"},y("Test cards")),t("zonos-text",{textColor:"gray-700"},y("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")},y("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")},y("Failure")," (****0002)")),t("zonos-notification",null)))})()))}get ele(){return l(this)}static get watchers(){return{continueLoading:["continueLoadingWatcher"],hasStripePaymentError:["stripePaymentErrorWatcher"]}}};N.style=".sc-zonos-collect-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-payment-h *.sc-zonos-collect-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-payment-h img.sc-zonos-collect-payment{max-width:100%}.sc-zonos-collect-payment-h dl.sc-zonos-collect-payment,.sc-zonos-collect-payment-h dd.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h1.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h2.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h3.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h4.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h5.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h6.sc-zonos-collect-payment,.sc-zonos-collect-payment-h hr.sc-zonos-collect-payment,.sc-zonos-collect-payment-h figure.sc-zonos-collect-payment,.sc-zonos-collect-payment-h p.sc-zonos-collect-payment,.sc-zonos-collect-payment-h pre.sc-zonos-collect-payment{margin:0}.sc-zonos-collect-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--title.sc-zonos-collect-payment{margin-bottom:24px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment{margin-bottom:20px;overflow: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-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar{width:10px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-payment-h .zonos--payment-error-banner.sc-zonos-collect-payment{margin-bottom:8px}.sc-zonos-collect-payment-h .zonos--error-banner.sc-zonos-collect-payment{margin-bottom:16px}.sc-zonos-collect-payment-h zonos-button.sc-zonos-collect-payment{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-collect-payment-h .zonos--pay-in-base-currency-btn.sc-zonos-collect-payment{-webkit-box-shadow:none;box-shadow:none}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:12px;bottom:-4px;padding-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-text.sc-zonos-collect-payment{text-align:center}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-button.sc-zonos-collect-payment{width:100%}.sc-zonos-collect-payment-h .zonos--test-cards.sc-zonos-collect-payment{margin-top:auto;padding-top:16px}";const E=class{constructor(e){o(this,e),this.mobile=!1,this.tablet=!1,this.collapsed=!1,this.isMobile=!1,this.isTablet=!1,this.isLoading=!0}handleWindowResize(){this.isMobile=P(this.mobile),this.isTablet=D(this.tablet)}componentWillLoad(){this.handleWindowResize(),setTimeout((()=>{this.isLoading=!1}),1e3)}render(){const o=this.isMobile?"gray-1000":"gray-800";return t(n,{key:"6432c5dd5afd628e33ba26385ecfecb470f1757e",class:B(["zonos--collect-review zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},t("div",{key:"e4d113ff1268c36119e1f80164b6cfd702c67f75",class:"zonos--title"},t("zonos-text",{key:"aad9ad9b526ac65d97a88df516e8e7b34fc3d2b1",textColor:o,type:"semiBoldLabel"},y("Pay [organizationName]",{organizationName:w.organizationName}))),t("div",{key:"fcdaebc734a270742fbe21ff932550994e522ea6",class:"zonos--total-pay"},T({content:t("zonos-text",{type:"secondaryPageHeader"},U({amount:W.amountDutyTaxFeeTotal||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"36px",skeletonWidth:"150px"})))}static get assetsDirs(){return["assets"]}};E.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;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;gap:48px}:host .zonos--total-pay zonos-text{-ms-flex-negative:0;flex-shrink:0}:host .zonos--total-pay::after{content:"";position:relative;height:1px;width:100%;background:var(--zonos-elements-gray-200)}:host(.mobile),:host(.tablet){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;padding:4px 0;background-color:transparent;position:relative}:host(.mobile) .zonos--total-pay,:host(.tablet) .zonos--total-pay{margin:0}';const Y=class{constructor(e){o(this,e),this.storeUnsubscribeList=[],this.subtotals={},this.initSubtotalData=()=>{var o;const e=null===(o=p.checkoutSession)||void 0===o?void 0:o.subtotals;if(!e)return;const t=y("Duties"),s=y("Taxes"),n=y("Fees"),l={[t]:0,[n]:0,[s]:0},a=e.duties,i=e.taxes,c=e.fees;void 0!==a&&(l[t]||(l[t]=0),l[t]+=a),void 0!==i&&(l[s]||(l[s]=0),l[s]+=i),void 0!==c&&(l[n]||(l[n]=0),l[n]+=c),this.subtotals=l}}disconnectedCallback(){this.storeUnsubscribeList.forEach((o=>o()))}componentWillLoad(){this.storeUnsubscribeList=[f("checkoutSession",this.initSubtotalData),v("translatedChunks",this.initSubtotalData)]}render(){return this.initSubtotalData(),t(n,{key:"ab687a6e1ec67f6609081036a75e9905ff34c6b1",class:"zonos--collect-subtotal zonos--elements"},t("table",{key:"303b8c49983e9f7aea4d31400fed53d858eb078d",class:"zonos--collect-table"},!!this.subtotals[y("Duties")]&&t("tr",{key:"a60fa4f1f1afacef0144b86c054f44572576f7af",class:"zonos--row zonos--collect-duty"},t("td",{key:"aeaf798e26bbd482196d7208eb05657a1d15dad8",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"835d817709ae3b7e2d888d618e0856fb2e637e4d",type:"semiBoldLabel"},y("Duties"))),t("td",{key:"5bb47a115ea61fa897a3f48bbd10c5f78af3703e",class:"zonos--column"}),t("td",{key:"32632c4beb855ca687c615f5e6c63c82e2e05c80",class:"zonos--column zonos--collect-subtotal-price"},T({content:t("zonos-text",{type:"label"},U({amount:this.subtotals[y("Duties")]||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[y("Taxes")]&&t("tr",{key:"055bb237dafaea8de18b127641c8fd7e1ece563b",class:"zonos--row zonos--collect-tax"},t("td",{key:"1e73b140c2c9090ccfb91ce4efca483e8fb56e9e",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"a3375ecd77460c78c7c5f59bf7b9b8612cd53e41",type:"semiBoldLabel"},y("Taxes"))),t("td",{key:"20685646be29873967c2f335c775046068248ad3",class:"zonos--column"}),t("td",{key:"2e2c6af2c1a7840df03351178ddf3107fcc36494",class:"zonos--column zonos--collect-subtotal-price"},T({content:t("zonos-text",{type:"label"},U({amount:this.subtotals[y("Taxes")]||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[y("Fees")]&&t("tr",{key:"8157aba5c6a23680b0bc681adc127747f01a2973",class:"zonos--row zonos--collect-fee"},t("td",{key:"8266654f9e65003f297222bb935013a8b9b3b430",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"8399000a5f61e4737764b68b89799b409dce6034",type:"semiBoldLabel"},y("Fees"))),t("td",{key:"2a9763f2401967ea1bdfa2c17514d18e2a4e0db6",class:"zonos--column"}),t("td",{key:"ac2f275312c2ba69888e6e57dde8b4b451839b86",class:"zonos--column zonos--collect-subtotal-price"},T({content:t("zonos-text",{type:"label"},U({amount:this.subtotals[y("Fees")]||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),t("tr",{key:"a293d1b9342251f7326c1ac68e2bab83eae2ed80",class:"zonos--row zonos--collect-spacing"},t("td",{key:"c136b1b807f32dc21c131326d70500d2e2c64efe",class:"zonos--column",colSpan:3})),t("tr",{key:"59747101f1a9ef7c8fad60e90ea5b8c31015438c",class:"zonos--row zonos--collect-total zonos--collect-total-subtotal"},t("td",{key:"96d201ba6f3e571adac265127229c94cdc96be2a",class:"zonos--column"}),t("td",{key:"f2f4cb751e35fc0ebaa803659f26a2314d8bf639",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"b4f89ea1e523af8a5aead4ef007a6f0dc7e7f441",type:"label"},y("Subtotal"))),t("td",{key:"28b6aea6363b2bef1d072ad77f409ae77976305c",class:"zonos--column zonos--collect-subtotal-price"},T({content:t("zonos-text",{type:"label"},U({amount:W.amountDutyTaxFeeTotal||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),t("tr",{key:"f0072cdd200e8483421265af39a90fb655fb2ef0",class:"zonos--row zonos--collect-total"},t("td",{key:"88a007048d33c919a6c5f87cf7cd071f83e7448b",class:"zonos--column"}),t("td",{key:"24bba9e9b81ff443dd5ca4832c3169e3605a93b8",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"594d4e96bec3a2153f6622c6842970ebee5bb463",type:"semiBoldLabel"},y("Customs fees total"))),t("td",{key:"b3ffd6dcae747dd2ed68ae16fb60d9655f7669dc",class:"zonos--column zonos--collect-subtotal-price"},T({content:t("zonos-text",{type:"semiBoldLabel"},U({amount:W.amountDutyTaxFeeTotal||0,isForeign:!0})),isLoading:W.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"})))))}static get assetsDirs(){return["assets"]}};Y.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;bottom:60px}:host .zonos--collect-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--collect-table .zonos--column{padding:8px 8px;vertical-align:top}:host .zonos--collect-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--collect-table .zonos--column:first-child{width:60px;max-width:100px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--collect-subtotal-price{text-align:right}:host .zonos--collect-subtotal-price zonos-text{white-space:nowrap}:host .zonos--collect-total .zonos--column{padding:16px 0}:host .zonos--collect-total-subtotal .zonos--collect-subtotal-title,:host .zonos--collect-total-subtotal .zonos--collect-subtotal-price{border-bottom:1px solid var(--zonos-elements-gray-200)}:host .zonos--collect-subtotal-price zonos-text,:host .zonos--collect-pay-total zonos-text{white-space:nowrap}";export{$ as zonos_collect_finish,R as zonos_collect_footer,O as zonos_collect_order_details,N as zonos_collect_payment,E as zonos_collect_review,Y as zonos_collect_subtotal}
@@ -0,0 +1 @@
1
+ import{d as o}from"./p-e62342c3.js";import{o as r,d as n}from"./p-7caa75bb.js";const u=({amount:u,isForeign:i})=>{var t,a;const c=(null===(t=o.exchangeRate)||void 0===t?void 0:t.rate)||1,d=i?u:r(u),s=o.currency;if((null===(a=o.items[0])||void 0===a?void 0:a.currencyCode)===s)return n({amount:d,currency:s});const v=o.displayBaseCurrency,e=(()=>{var r,n;return o.displayBaseCurrency&&(null===(r=o.exchangeRate)||void 0===r?void 0:r.sourceCurrencyCode)?null===(n=o.exchangeRate)||void 0===n?void 0:n.sourceCurrencyCode:o.currency})();return n(i?{amount:v?d/c:d,currency:e}:{amount:v?d:d*c,currency:e})};export{u as r}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(o,e,t,n){function i(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,r){function s(o){try{a(n.next(o))}catch(o){r(o)}}function l(o){try{a(n["throw"](o))}catch(o){r(o)}}function a(o){o.done?t(o.value):i(o.value).then(s,l)}a((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(e){return a([o,e])}}function a(l){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(t=0)),t)try{if(n=1,i&&(r=l[0]&2?i["return"]:l[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,l[1])).done)return r;if(i=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:t.label++;return{value:l[1],done:false};case 5:t.label++;i=l[1];l=[0];continue;case 7:l=t.ops.pop();t.trys.pop();continue;default:if(!(r=t.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){t.label=l[1];break}if(l[0]===6&&t.label<r[1]){t.label=r[1];r=l;break}if(r&&t.label<r[2]){t.label=r[2];t.ops.push(l);break}if(r[2])t.ops.pop();t.trys.pop();continue}l=e.call(o,t)}catch(o){l=[6,o];i=0}finally{n=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-3fbd9cc0.system.js","./p-31d1b874.system.js","./p-ac30b7a8.system.js","./p-23e7c655.system.js","./p-01174496.system.js","./p-bc7bf53e.system.js","./p-d938f42f.system.js"],(function(o){"use strict";var e,t,n,i,r,s,l,a,h,d,u,f,c,w,g,v,m,p,z,b,x,y;return{setters:[function(o){e=o.r;t=o.h;n=o.a;i=o.g},function(o){r=o.d},function(o){s=o.l;l=o.i;a=o.t;h=o.g;d=o.j;u=o.k;f=o.m;c=o.n;w=o.d},function(o){g=o.z;v=o.g;m=o.m},function(o){p=o.c},function(o){z=o.h;b=o.l},function(o){x=o.g},function(o){y=o.l}],execute:function(){var k=this;var _=function(o){return __awaiter(k,[o],void 0,(function(o){var e,t,n,i,r;var s=o.items,l=o.shipFrom,a=o.shipTo;return __generator(this,(function(o){switch(o.label){case 0:t={items:s,shipFrom:l,shipTo:a};return[4,z("/api/zonos-elements/check-item-restrictions",{body:t,method:"POST"})];case 1:n=o.sent(),i=n.errors,r=n.json;if(i.length||!r){b("Error fetching item restrictions: ".concat((e=i.find(Boolean))===null||e===void 0?void 0:e.message));return[2,[]]}return[2,r.filter(Boolean)]}}))}))};var L=function(o){return __awaiter(k,void 0,void 0,(function(){var e,t,n,i;return __generator(this,(function(r){switch(r.label){case 0:if(!o.length){return[2,[]]}e=s.selectedCountryCode;if(!e){b("Hello could not check item restrictions - No country code selected");return[2,[]]}t=o.map((function(o){return{description:o.description,name:o.title}}));return[4,_({items:t,shipFrom:"AD",shipTo:e})];case 1:n=r.sent();i=n.map((function(o){var e;var n=((e=t.filter((function(e){return e.description===o.itemDescription})).find(Boolean))===null||e===void 0?void 0:e.name)||"";return Object.assign(Object.assign({},o),{name:n})}));return[2,i]}}))}))};var O=function(o){var e=o===null||o===void 0?void 0:o.replace("www.","").replace("https://","");return e&&new RegExp(e).test(window.location.href)};var T=function(){var o=g.helloSettings,e=o.cartUrlPattern,t=o.homepageUrlPattern,n=o.productDetailUrlPattern,i=o.productListUrlPattern;if(O(e)){return"cart"}if(O(n)){return"productDetail"}if(O(i)){return"productList"}if(O(t)){return"home"}return""};var E=function(){var o,e;var t=g.helloSettings,n=t.productAddToCartElementSelector,i=t.productDescriptionElementSelector,r=t.productTitleElementSelector,s=t.restrictionBehavior;if(!r||!i){y("Hello could not check item restrictions - must provide title and description selectors.")}var a=r&&l(r)&&document.querySelectorAll(r)||[];var h=i&&l(i)&&document.querySelectorAll(i)||[];if(a.length!==h.length){y("Hello could not check item restrictions - Title and description selectors do not match");return[]}var d=s==="RESTRICT_AND_BLOCK";var u=d&&n&&l(n)&&document.querySelectorAll(n)||[];if(d&&u.length!==h.length){y('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match')}var f=[];for(var c=0;c<a.length;c++){var w=a[c];var v=h[c];var m=u[c];if(w&&v){var p={cartButtonNode:m||null,description:((o=v.textContent)===null||o===void 0?void 0:o.trim())||"",title:((e=w.textContent)===null||e===void 0?void 0:e.trim())||""};f.push(p)}}return f};var j=":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:inline-block}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}@media screen and (min-width: 769px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px;width:auto;height:auto;z-index:1001}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:6px;border-radius:30px;background:var(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:30px;border-bottom-left-radius:30px;left:0;-webkit-transform:translateX(calc(-100% + 16px));transform:translateX(calc(-100% + 16px));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 6px;padding-right:16px;border:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{border-left:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:16px;padding-right:6px;border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - 16px));transform:translateX(calc(100% - 16px));right:0;left:auto;border-top-right-radius:30px;border-bottom-right-radius:30px}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}";var D=j;var S=3e3;var I=o("zonos_hello",function(){function o(o){var t=this;e(this,o);this.showPeekMessage=false;this.zonosStoreHelloSettings=g.helloSettings;this.showDialog=false;this.peekMessage="";this.initialUrl="";this.allRestrictedItems=[];this.allFoundProducts=[];this.productsOnPage=[];this.isHelloWidgetRendered=false;this.isMobile=false;this.getHelloPeekMessage=function(o){var e=g.currentHelloPage==="productDetail"||g.currentHelloPage==="productList";if(e&&t.allRestrictedItems.length){var n=a("click to learn more");var i=g.currentHelloPage==="productDetail"?a("Restricted item"):a("Restricted items found");return"".concat(i," - ").concat(n)}switch(g.currentHelloPage){case"cart":return a("Prepay duties and taxes at checkout");case"productList":case"productDetail":return a("See duty and tax thresholds");default:return a("Welcome to [storeName]",{storeName:o})}};this.enableShowPeekMessage=function(){if(t.peekMessage){t.showPeekMessage=true}};this.getNewItemRestrictions=function(o){return __awaiter(t,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:e=g.currentHelloPage==="productDetail"||g.currentHelloPage==="productList";if(!e||g.helloSettings.restrictionBehavior==="DISABLED"){return[2,[]]}return[4,L(o)];case 1:t=n.sent();return[2,t]}}))}))};this.triggerShowPeekMessage=function(){t.peekMessage=t.getHelloPeekMessage(g.organizationName);var o=g.helloSettings,e=o.peekMessageBehavior,n=o.peekMessageDelay;var i=n*1e3;if(e==="ENABLED"){setTimeout((function(){t.enableShowPeekMessage();var o=t.allRestrictedItems.some((function(o){return t.productsOnPage.some((function(e){return e.description===o.itemDescription}))}));if(!o){setTimeout((function(){t.showPeekMessage=false}),S)}}),i)}};this.disableAddToCartButtons=function(){if(t.productsOnPage.length){t.productsOnPage.forEach((function(o){var e,n;var i=t.allRestrictedItems.some((function(e){return e.itemDescription===o.description}));if(i){(e=o.cartButtonNode)===null||e===void 0?void 0:e.setAttribute("disabled","disabled")}else{(n=o.cartButtonNode)===null||n===void 0?void 0:n.removeAttribute("disabled")}}))}};this.handleItemRestrictions=function(){return __awaiter(t,void 0,void 0,(function(){var o,e;var t,n;var i=this;return __generator(this,(function(r){switch(r.label){case 0:this.productsOnPage=E();o=this.productsOnPage.filter((function(o){return!i.allFoundProducts.some((function(e){return e.title===o.title}))}));return[4,this.getNewItemRestrictions(o)];case 1:e=r.sent();(t=this.allRestrictedItems).push.apply(t,e);(n=this.allFoundProducts).push.apply(n,o);this.disableAddToCartButtons();return[2]}}))}))};this.reloadHelloData=function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleItemRestrictions()];case 1:o.sent();this.triggerShowPeekMessage();return[2]}}))}))};this.handleProductCountChange=r((function(){var o=g.helloSettings.productTitleElementSelector;if(o){var e=E();if(t.allFoundProducts.length!==e.length&&window.location.href===t.initialUrl){if(!t.allFoundProducts.length){return}void t.reloadHelloData()}}}),1e3);this.watchProductCountChange=function(){var o;var e=new MutationObserver(t.handleProductCountChange);e.observe(document.body,{childList:true,subtree:true});(o=t.observerWatcher)===null||o===void 0?void 0:o.push(e)};this.watchPriceChange=function(){var o;var e=new MutationObserver((function(){return void t.displayCurrency()}));e.observe(document.body,{attributes:true,childList:true,subtree:true});(o=t.observerWatcher)===null||o===void 0?void 0:o.push(e)};this.updateHelloOnPageChange=function(){t.watchProductCountChange();setInterval((function(){if(window.location.href!==t.initialUrl){var o=t.initialUrl&&new URL(t.initialUrl);var e=o&&h(o.searchParams);if(e!==s.selectedCountryCode){t.allFoundProducts=[];t.allRestrictedItems=[];t.productsOnPage=[]}t.initialUrl=window.location.href;g.currentHelloPage=T();var n=new URL(window.location.href);var i=h(n.searchParams);if(!i){d(s.selectedCountryCode);return}void t.reloadHelloData()}}),1e3)};this.changeShowDialog=function(o){t.showDialog=o};this.shouldAnimateLeftDesktop=function(){var o=t.helloRef&&getComputedStyle(t.helloRef).position;if(t.helloRef&&o==="relative"){var e=x(t.helloRef);return e}};this.shouldRenderHello=function(o){if(o===void 0){o=true}if(!s.localizationLoaded){return false}var e=g.helloSettings.showForCountries;if(o){if(!s.isShippableCountry){y("Hello: not shippable country - Show for countries: ".concat(e))}}if(e==="ONLY_SHIPPABLE"){return s.isShippableCountry}if(e==="ALL"){return true}return e===null||e===void 0?void 0:e.includes(s.selectedCountryCode||"")}}o.prototype.showDialogHandler=function(o){var e;if(o){var t=(e=this.helloElement)===null||e===void 0?void 0:e.parentElement;if(t&&t.parentElement===document.body){t.style.zIndex="2147483647";document.body.appendChild(t)}}};o.prototype.getCountryList=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,s.helloCountryList]}))}))};o.prototype.componentWillLoad=function(){var o=this;var e=setInterval((function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){if(!this.helloRef){return[2]}if(g.loadedConfig){this.helloRef.setAttribute("data-zonos-hello-loaded","");this.updateHelloOnPageChange();this.watchPriceChange();this.handleAppearanceSettingsOverrideChange();clearInterval(e)}return[2]}))}))}),100)};o.prototype.disconnectedCallback=function(){var o;(o=this.observerWatcher)===null||o===void 0?void 0:o.forEach((function(o){return o.disconnect()}))};o.prototype.displayCurrency=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){if(g.helloSettings.currencyBehavior==="DISABLED"){return[2]}if(!s.exchangeRate){y("Could not display currency. Exchange rate and format data is not available.","warn");return[2]}u();return[2]}))}))};o.prototype.convertAndFormat=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,f(o)]}))}))};o.prototype.convert=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,c(o)]}))}))};o.prototype.format=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,w({amount:o})]}))}))};o.prototype.openHelloDialog=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.changeShowDialog(o);return[2]}))}))};o.prototype.handleResize=function(){this.isMobile=window.innerWidth<=768};o.prototype.handleHelloWidgetInitializedState=function(o){var e=o.countryCode,t=o.currencyCode;var n,i;if(this.isHelloWidgetRendered){return}if(s.selectedCountryCode&&typeof g.helloSettings.onInitSuccess==="function"){this.isHelloWidgetRendered=true;void((i=(n=g.helloSettings).onInitSuccess)===null||i===void 0?void 0:i.call(n,{countryCode:e,currencyCode:t}))}};o.prototype.getHelloLocation=function(){var o=this.mobileLocationOverride||g.helloSettings.mobileLocation;var e=g.helloSettings.desktopLocation;var t=this.isMobile;switch(true){case t:{var n=this.animateFromLeftOverride||(o===null||o===void 0?void 0:o.includes("LEFT"));var i=o===null||o===void 0?void 0:o.includes("TOP");return{isMobileWindow:t,isOnLeft:n,isOnTop:i,shouldFloat:!!o}}default:case!t:{var r=!g.helloSettings.anchorElementSelector&&!!e;var n=this.animateFromLeftOverride||(e===null||e===void 0?void 0:e.includes("LEFT"))||this.shouldAnimateLeftDesktop();var i=e===null||e===void 0?void 0:e.includes("TOP");return{isMobileWindow:t,isOnLeft:n,isOnTop:i,shouldFloat:r}}}};o.prototype.handleAppearanceSettingsOverrideChange=function(){var o;if((o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.theme){this.appearanceSettingsOverride.theme=v(this.appearanceSettingsOverride.theme)}};o.prototype.componentDidLoad=function(){this.isMobile=window.innerWidth<=768};o.prototype.render=function(){var o=this;var e,i;var r=(e=g.helloSettings.excludedUrlPatterns)===null||e===void 0?void 0:e.some((function(o){return o&&new RegExp(o).test(window.location.href)}));if(r){y("Hello is excluded on this url","warn");return null}var l=s.selectedCountryCode,a=s.targetCurrency;var h=this.getHelloLocation(),d=h.isOnLeft,u=h.isOnTop,f=h.shouldFloat;var c=m(g.appearance,this.appearanceSettingsOverride||null);var w=c.theme;var v=(i=this.allRestrictedItems)===null||i===void 0?void 0:i.filter((function(e){return o.productsOnPage.some((function(o){return o.description===e.itemDescription}))}));this.peekMessage=this.getHelloPeekMessage(g.organizationName);var z=this.shouldRenderHello()&&!!l;if(z&&!this.isHelloWidgetRendered){this.handleHelloWidgetInitializedState({countryCode:l,currencyCode:a})}return t(n,{class:"zonos--hello zonos--elements","data-theme":w},z&&t("div",{class:p(["zonos--hello-wrapper",f&&"zonos--hello-widget-float"])},t("button",{class:p(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",d&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",u&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions",f&&"zonos--hello-widget-float"]),onClick:function(){void o.changeShowDialog(!o.showDialog)},onMouseEnter:function(){return o.enableShowPeekMessage()},onMouseLeave:function(){return o.showPeekMessage=false},ref:function(e){return e&&(o.helloRef=e)},type:"button"},t("zonos-text",{class:"zonos--hello-message"},this.peekMessage),l&&t("div",{class:"zonos--hello-country-flag-wrapper"},t("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:l}))),t("div",{class:p(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override",d&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",u&&"zonos--hello-widget-top",f&&"zonos--hello-widget-float"]),style:{height:this.showDialog?"fit-content":"0px"}},t("zonos-hello-dialog",{animateFromLeftOverride:this.animateFromLeftOverride,appearanceSettings:c,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:v,setIsOpen:this.changeShowDialog}))))};Object.defineProperty(o.prototype,"helloElement",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{showDialog:["showDialogHandler"],appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}},enumerable:false,configurable:true});return o}());I.style=D}}}));
1
+ var __awaiter=this&&this.__awaiter||function(o,e,t,n){function i(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,r){function s(o){try{a(n.next(o))}catch(o){r(o)}}function l(o){try{a(n["throw"](o))}catch(o){r(o)}}function a(o){o.done?t(o.value):i(o.value).then(s,l)}a((n=n.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},n,i,r,s;return s={next:l(0),throw:l(1),return:l(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(o){return function(e){return a([o,e])}}function a(l){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,l[0]&&(t=0)),t)try{if(n=1,i&&(r=l[0]&2?i["return"]:l[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,l[1])).done)return r;if(i=0,r)l=[l[0]&2,r.value];switch(l[0]){case 0:case 1:r=l;break;case 4:t.label++;return{value:l[1],done:false};case 5:t.label++;i=l[1];l=[0];continue;case 7:l=t.ops.pop();t.trys.pop();continue;default:if(!(r=t.trys,r=r.length>0&&r[r.length-1])&&(l[0]===6||l[0]===2)){t=0;continue}if(l[0]===3&&(!r||l[1]>r[0]&&l[1]<r[3])){t.label=l[1];break}if(l[0]===6&&t.label<r[1]){t.label=r[1];r=l;break}if(r&&t.label<r[2]){t.label=r[2];t.ops.push(l);break}if(r[2])t.ops.pop();t.trys.pop();continue}l=e.call(o,t)}catch(o){l=[6,o];i=0}finally{n=r=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:true}}};System.register(["./p-7261e245.system.js","./p-e25e0b4b.system.js","./p-271eebd3.system.js","./p-15ef7644.system.js","./p-23e7c655.system.js","./p-01174496.system.js","./p-bc7bf53e.system.js","./p-d938f42f.system.js"],(function(o){"use strict";var e,t,n,i,r,s,l,a,h,d,u,f,c,w,v,g,m,p,z,b,x,y;return{setters:[function(o){e=o.r;t=o.h;n=o.a;i=o.g},function(o){r=o.d},function(o){s=o.l;l=o.i;a=o.t;h=o.g;d=o.j;u=o.k;f=o.m;c=o.n;w=o.d},function(o){v=o.z;g=o.g;m=o.m},function(o){p=o.c},function(o){z=o.h;b=o.l},function(o){x=o.g},function(o){y=o.l}],execute:function(){var k=this;var _=function(o){return __awaiter(k,[o],void 0,(function(o){var e,t,n,i,r;var s=o.items,l=o.shipFrom,a=o.shipTo;return __generator(this,(function(o){switch(o.label){case 0:t={items:s,shipFrom:l,shipTo:a};return[4,z("/api/zonos-elements/check-item-restrictions",{body:t,method:"POST"})];case 1:n=o.sent(),i=n.errors,r=n.json;if(i.length||!r){b("Error fetching item restrictions: ".concat((e=i.find(Boolean))===null||e===void 0?void 0:e.message));return[2,[]]}return[2,r.filter(Boolean)]}}))}))};var L=function(o){return __awaiter(k,void 0,void 0,(function(){var e,t,n,i;return __generator(this,(function(r){switch(r.label){case 0:if(!o.length){return[2,[]]}e=s.selectedCountryCode;if(!e){b("Hello could not check item restrictions - No country code selected");return[2,[]]}t=o.map((function(o){return{description:o.description,name:o.title}}));return[4,_({items:t,shipFrom:"AD",shipTo:e})];case 1:n=r.sent();i=n.map((function(o){var e;var n=((e=t.filter((function(e){return e.description===o.itemDescription})).find(Boolean))===null||e===void 0?void 0:e.name)||"";return Object.assign(Object.assign({},o),{name:n})}));return[2,i]}}))}))};var O=function(o){var e=o===null||o===void 0?void 0:o.replace("www.","").replace("https://","");return e&&new RegExp(e).test(window.location.href)};var T=function(){var o=v.helloSettings,e=o.cartUrlPattern,t=o.homepageUrlPattern,n=o.productDetailUrlPattern,i=o.productListUrlPattern;if(O(e)){return"cart"}if(O(n)){return"productDetail"}if(O(i)){return"productList"}if(O(t)){return"home"}return""};var j=function(){var o,e;var t=v.helloSettings,n=t.productAddToCartElementSelector,i=t.productDescriptionElementSelector,r=t.productTitleElementSelector,s=t.restrictionBehavior;if(!r||!i){y("Hello could not check item restrictions - must provide title and description selectors.")}var a=r&&l(r)&&document.querySelectorAll(r)||[];var h=i&&l(i)&&document.querySelectorAll(i)||[];if(a.length!==h.length){y("Hello could not check item restrictions - Title and description selectors do not match");return[]}var d=s==="RESTRICT_AND_BLOCK";var u=d&&n&&l(n)&&document.querySelectorAll(n)||[];if(d&&u.length!==h.length){y('Hello could not disable "Add to cart" buttons - Title and add to cart selectors do not match')}var f=[];for(var c=0;c<a.length;c++){var w=a[c];var g=h[c];var m=u[c];if(w&&g){var p={cartButtonNode:m||null,description:((o=g.textContent)===null||o===void 0?void 0:o.trim())||"",title:((e=w.textContent)===null||e===void 0?void 0:e.trim())||""};f.push(p)}}return f};var D=":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:inline-block}:host .zonos--hello-wrapper{position:relative}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper-mobile-override{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}@media (max-width: 768px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper{position:fixed;bottom:0;left:0;width:100vw;z-index:1001;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}}@media screen and (min-width: 769px){:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px;width:auto;height:auto;z-index:1001}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-wrapper .zonos--hello-dialog-wrapper.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}}:host .zonos--hello-widget{-webkit-transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);padding:6px;border-radius:30px;background:var(--zonos-elements-page-background);font-size:var(--zonos-elements-font-size-s);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;cursor:pointer;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;position:relative;z-index:1000}:host .zonos--hello-widget>.zonos--hello-message{-ms-flex-order:0;order:0;max-width:0;height:100%;white-space:nowrap;-webkit-transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);transition:border 0.3s ease-in, all 0.7s cubic-bezier(0.31, -0.02, 0.06, 1.53);overflow:hidden;color:var(--zonos-elements-text-color);position:absolute;background:var(--zonos-elements-page-background);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-top-left-radius:30px;border-bottom-left-radius:30px;left:0;-webkit-transform:translateX(calc(-100% + 16px));transform:translateX(calc(-100% + 16px));width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-top:var(--zonos-elements-border);border-bottom:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-has-restrictions{background:var(--zonos-elements-red-100);border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-has-restrictions>.zonos--hello-message{background:var(--zonos-elements-red-100);color:var(--zonos-elements-red-800);font-weight:500}:host .zonos--hello-widget.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:1px solid var(--zonos-elements-red-200)}:host .zonos--hello-widget.zonos--hello-show-peek-message{max-width:100vw;width:100%}:host .zonos--hello-widget.zonos--hello-show-peek-message>.zonos--hello-message{max-width:100vw;padding:0 6px;padding-right:16px;border:var(--zonos-elements-border)}:host .zonos--hello-widget.zonos--hello-show-peek-message:not(.zonos--hello-widget-animate-from-left)>.zonos--hello-message{border-right:none}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{border-left:0}:host .zonos--hello-widget.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:16px;padding-right:6px;border-left:none}:host .zonos--hello-widget.zonos--hello-widget-animate-from-left>.zonos--hello-message{-ms-flex-order:1;order:1;-webkit-transform:translateX(calc(100% - 16px));transform:translateX(calc(100% - 16px));right:0;left:auto;border-top-right-radius:30px;border-bottom-right-radius:30px}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--hello-widget .zonos--hello-country-flag-wrapper .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float{position:fixed;bottom:72px;right:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-left{left:32px;right:auto}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-top{bottom:auto;top:32px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-has-restrictions.zonos--hello-show-peek-message>.zonos--hello-message{border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float>.zonos--hello-message{position:relative;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;border-radius:30px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;top:0;bottom:0;left:0;-webkit-transform:translateX(0);transform:translateX(0);width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border:none}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-widget-animate-from-left>.zonos--hello-message{-webkit-transform:translateX(0);transform:translateX(0)}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message.zonos--hello-widget-animate-from-left>.zonos--hello-message{padding-left:8px;padding-right:4px}:host .zonos--hello-mobile-override.zonos--hello-widget.zonos--hello-widget-float.zonos--hello-show-peek-message>.zonos--hello-message{padding:0 var(--zonos-elements-radius-4);padding-right:6px;border:none}";var E=D;var S=3e3;var I=o("zonos_hello",function(){function o(o){var t=this;e(this,o);this.showPeekMessage=false;this.zonosStoreHelloSettings=v.helloSettings;this.showDialog=false;this.peekMessage="";this.initialUrl="";this.allRestrictedItems=[];this.allFoundProducts=[];this.productsOnPage=[];this.isHelloWidgetRendered=false;this.isMobile=false;this.getHelloPeekMessage=function(o){var e=v.currentHelloPage==="productDetail"||v.currentHelloPage==="productList";if(e&&t.allRestrictedItems.length){var n=a("click to learn more");var i=v.currentHelloPage==="productDetail"?a("Restricted item"):a("Restricted items found");return"".concat(i," - ").concat(n)}switch(v.currentHelloPage){case"cart":return a("Prepay duties and taxes at checkout");case"productList":case"productDetail":return a("See duty and tax thresholds");default:return a("Welcome to [storeName]",{storeName:o})}};this.enableShowPeekMessage=function(){if(t.peekMessage){t.showPeekMessage=true}};this.getNewItemRestrictions=function(o){return __awaiter(t,void 0,void 0,(function(){var e,t;return __generator(this,(function(n){switch(n.label){case 0:e=v.currentHelloPage==="productDetail"||v.currentHelloPage==="productList";if(!e||v.helloSettings.restrictionBehavior==="DISABLED"){return[2,[]]}return[4,L(o)];case 1:t=n.sent();return[2,t]}}))}))};this.triggerShowPeekMessage=function(){t.peekMessage=t.getHelloPeekMessage(v.organizationName);var o=v.helloSettings,e=o.peekMessageBehavior,n=o.peekMessageDelay;var i=n*1e3;if(e==="ENABLED"){setTimeout((function(){t.enableShowPeekMessage();var o=t.allRestrictedItems.some((function(o){return t.productsOnPage.some((function(e){return e.description===o.itemDescription}))}));if(!o){setTimeout((function(){t.showPeekMessage=false}),S)}}),i)}};this.disableAddToCartButtons=function(){if(t.productsOnPage.length){t.productsOnPage.forEach((function(o){var e,n;var i=t.allRestrictedItems.some((function(e){return e.itemDescription===o.description}));if(i){(e=o.cartButtonNode)===null||e===void 0?void 0:e.setAttribute("disabled","disabled")}else{(n=o.cartButtonNode)===null||n===void 0?void 0:n.removeAttribute("disabled")}}))}};this.handleItemRestrictions=function(){return __awaiter(t,void 0,void 0,(function(){var o,e;var t,n;var i=this;return __generator(this,(function(r){switch(r.label){case 0:this.productsOnPage=j();o=this.productsOnPage.filter((function(o){return!i.allFoundProducts.some((function(e){return e.title===o.title}))}));return[4,this.getNewItemRestrictions(o)];case 1:e=r.sent();(t=this.allRestrictedItems).push.apply(t,e);(n=this.allFoundProducts).push.apply(n,o);this.disableAddToCartButtons();return[2]}}))}))};this.reloadHelloData=function(){return __awaiter(t,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleItemRestrictions()];case 1:o.sent();this.triggerShowPeekMessage();return[2]}}))}))};this.handleProductCountChange=r((function(){var o=v.helloSettings.productTitleElementSelector;if(o){var e=j();if(t.allFoundProducts.length!==e.length&&window.location.href===t.initialUrl){if(!t.allFoundProducts.length){return}void t.reloadHelloData()}}}),1e3);this.watchProductCountChange=function(){var o;var e=new MutationObserver(t.handleProductCountChange);e.observe(document.body,{childList:true,subtree:true});(o=t.observerWatcher)===null||o===void 0?void 0:o.push(e)};this.watchPriceChange=function(){var o;var e=new MutationObserver((function(){return void t.displayCurrency()}));e.observe(document.body,{attributes:true,childList:true,subtree:true});(o=t.observerWatcher)===null||o===void 0?void 0:o.push(e)};this.updateHelloOnPageChange=function(){t.watchProductCountChange();setInterval((function(){if(window.location.href!==t.initialUrl){var o=t.initialUrl&&new URL(t.initialUrl);var e=o&&h(o.searchParams);if(e!==s.selectedCountryCode){t.allFoundProducts=[];t.allRestrictedItems=[];t.productsOnPage=[]}t.initialUrl=window.location.href;v.currentHelloPage=T();var n=new URL(window.location.href);var i=h(n.searchParams);if(!i){d(s.selectedCountryCode);return}void t.reloadHelloData()}}),1e3)};this.changeShowDialog=function(o){t.showDialog=o};this.shouldAnimateLeftDesktop=function(){var o=t.helloRef&&getComputedStyle(t.helloRef).position;if(t.helloRef&&o==="relative"){var e=x(t.helloRef);return e}};this.shouldRenderHello=function(o){if(o===void 0){o=true}var e,t;if(!s.localizationLoaded){return false}var n=v.helloSettings,i=n.countryDisplayRules,r=n.showForCountries;var l=i===null||i===void 0?void 0:i.widgetVisibility;var a=s.selectedCountryCode;var h=Array.isArray(r)?r:r!==null&&r!==void 0?r:l===null||l===void 0?void 0:l.behavior;if(o&&!s.isShippableCountry){y("Hello: not shippable country - Show for countries: ".concat(h))}if(Array.isArray(h)){return!!a&&h.includes(a)}var d;if(h==="ALL"){d=true}else{d=s.isShippableCountry}if(!d&&a&&((e=l===null||l===void 0?void 0:l.includedCountries)===null||e===void 0?void 0:e.includes(a))){d=true}if(d&&a&&((t=l===null||l===void 0?void 0:l.excludedCountries)===null||t===void 0?void 0:t.includes(a))){d=false}return d}}o.prototype.showDialogHandler=function(o){var e;if(o){var t=(e=this.helloElement)===null||e===void 0?void 0:e.parentElement;if(t&&t.parentElement===document.body){t.style.zIndex="2147483647";document.body.appendChild(t)}}};o.prototype.getCountryList=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){return[2,s.helloCountryList]}))}))};o.prototype.componentWillLoad=function(){var o=this;var e=setInterval((function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){if(!this.helloRef){return[2]}if(v.loadedConfig){this.helloRef.setAttribute("data-zonos-hello-loaded","");this.updateHelloOnPageChange();this.watchPriceChange();this.handleAppearanceSettingsOverrideChange();clearInterval(e)}return[2]}))}))}),100)};o.prototype.disconnectedCallback=function(){var o;(o=this.observerWatcher)===null||o===void 0?void 0:o.forEach((function(o){return o.disconnect()}))};o.prototype.displayCurrency=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){if(v.helloSettings.currencyBehavior==="DISABLED"){return[2]}if(!s.exchangeRate){y("Could not display currency. Exchange rate and format data is not available.","warn");return[2]}u();return[2]}))}))};o.prototype.convertAndFormat=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,f(o)]}))}))};o.prototype.convert=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,c(o)]}))}))};o.prototype.format=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,w({amount:o})]}))}))};o.prototype.openHelloDialog=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.changeShowDialog(o);return[2]}))}))};o.prototype.handleResize=function(){this.isMobile=window.innerWidth<=768};o.prototype.handleHelloWidgetInitializedState=function(o){var e=o.countryCode,t=o.currencyCode;var n,i;if(this.isHelloWidgetRendered){return}if(s.selectedCountryCode&&typeof v.helloSettings.onInitSuccess==="function"){this.isHelloWidgetRendered=true;void((i=(n=v.helloSettings).onInitSuccess)===null||i===void 0?void 0:i.call(n,{countryCode:e,currencyCode:t}))}};o.prototype.getHelloLocation=function(){var o=this.mobileLocationOverride||v.helloSettings.mobileLocation;var e=v.helloSettings.desktopLocation;var t=this.isMobile;switch(true){case t:{var n=this.animateFromLeftOverride||(o===null||o===void 0?void 0:o.includes("LEFT"));var i=o===null||o===void 0?void 0:o.includes("TOP");return{isMobileWindow:t,isOnLeft:n,isOnTop:i,shouldFloat:!!o}}default:case!t:{var r=!v.helloSettings.anchorElementSelector&&!!e;var n=this.animateFromLeftOverride||(e===null||e===void 0?void 0:e.includes("LEFT"))||this.shouldAnimateLeftDesktop();var i=e===null||e===void 0?void 0:e.includes("TOP");return{isMobileWindow:t,isOnLeft:n,isOnTop:i,shouldFloat:r}}}};o.prototype.handleAppearanceSettingsOverrideChange=function(){var o;if((o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.theme){this.appearanceSettingsOverride.theme=g(this.appearanceSettingsOverride.theme)}};o.prototype.componentDidLoad=function(){this.isMobile=window.innerWidth<=768};o.prototype.render=function(){var o=this;var e,i;var r=(e=v.helloSettings.excludedUrlPatterns)===null||e===void 0?void 0:e.some((function(o){return o&&new RegExp(o).test(window.location.href)}));if(r){y("Hello is excluded on this url","warn");return null}var l=s.selectedCountryCode,a=s.targetCurrency;var h=this.getHelloLocation(),d=h.isOnLeft,u=h.isOnTop,f=h.shouldFloat;var c=m(v.appearance,this.appearanceSettingsOverride||null);var w=c.theme;var g=(i=this.allRestrictedItems)===null||i===void 0?void 0:i.filter((function(e){return o.productsOnPage.some((function(o){return o.description===e.itemDescription}))}));this.peekMessage=this.getHelloPeekMessage(v.organizationName);var z=this.shouldRenderHello()&&!!l;if(z&&!this.isHelloWidgetRendered){this.handleHelloWidgetInitializedState({countryCode:l,currencyCode:a})}return t(n,{class:"zonos--hello zonos--elements","data-theme":w},z&&t("div",{class:p(["zonos--hello-wrapper",f&&"zonos--hello-widget-float"])},t("button",{class:p(["zonos--hello-widget",this.showPeekMessage&&"zonos--hello-show-peek-message",this.mobileLocationOverride&&"zonos--hello-mobile-override",d&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",u&&"zonos--hello-widget-top",!!this.allRestrictedItems.length&&"zonos--hello-has-restrictions",f&&"zonos--hello-widget-float"]),onClick:function(){void o.changeShowDialog(!o.showDialog)},onMouseEnter:function(){return o.enableShowPeekMessage()},onMouseLeave:function(){return o.showPeekMessage=false},ref:function(e){return e&&(o.helloRef=e)},type:"button"},t("zonos-text",{class:"zonos--hello-message"},this.peekMessage),l&&t("div",{class:"zonos--hello-country-flag-wrapper"},t("zonos-country-flag",{class:"zonos--hello-country-flag",countryCode:l}))),t("div",{class:p(["zonos--hello-dialog-wrapper",this.mobileLocationOverride&&"zonos--hello-dialog-wrapper-mobile-override",d&&"zonos--hello-widget-left zonos--hello-widget-animate-from-left",u&&"zonos--hello-widget-top",f&&"zonos--hello-widget-float"]),style:{height:this.showDialog?"fit-content":"0px"}},t("zonos-hello-dialog",{animateFromLeftOverride:this.animateFromLeftOverride,appearanceSettings:c,isOpen:this.showDialog,mobileLocationOverride:this.mobileLocationOverride,restrictedItems:g,setIsOpen:this.changeShowDialog}))))};Object.defineProperty(o.prototype,"helloElement",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(o,"watchers",{get:function(){return{showDialog:["showDialogHandler"],appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}},enumerable:false,configurable:true});return o}());I.style=E}}}));
@@ -1 +1 @@
1
- System.register(["./p-7261e245.system.js","./p-ac30b7a8.system.js","./p-d938f42f.system.js"],(function(t){"use strict";var e,s,i,o,n;return{setters:[function(t){e=t.r;s=t.h;i=t.a;o=t.g},function(t){n=t.f},function(){}],execute:function(){var a=":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{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";var h=a;var l=t("zonos_collapse",function(){function t(t){e(this,t);this.collapsed=false;this.collapseSize=0;this.height=this.el.scrollHeight;this.iframe=null}t.prototype.getElementHeight=function(){var t="".concat(this.height,"px");var e="".concat(this.collapseSize,"px");return this.collapsed?e:t};t.prototype.componentDidLoad=function(){this.height=this.el.scrollHeight};t.prototype.componentDidRender=function(){var t=this;var e,s,i;this.iframe=((e=this.el.shadowRoot)===null||e===void 0?void 0:e.querySelector("iframe"))||null;(i=(s=this.iframe)===null||s===void 0?void 0:s.contentWindow)===null||i===void 0?void 0:i.addEventListener("resize",(function(){if(!t.iframe){return}t.height=parseFloat(getComputedStyle(t.iframe).height)}))};t.prototype.render=function(){var t=this;if(!this.collapsed){setTimeout((function(){if(!t.collapsed){t.el.style.overflow="visible"}}),300)}else{this.el.style.overflow="hidden"}return s(i,{key:"2a96e5ed214d93d07057eb7958a26e8a7b286ce8",class:"zonos--elements zonos--collapse",style:{"--zonos--font-family":n(),height:this.getElementHeight()}},s("div",{key:"d2a039a3cde3c54bd560774d91cf36924311e251"},s("iframe",{key:"a2b1494c32fcd8a467e23ae6733fd341220a9020",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),s("slot",{key:"5dd47c6e903a01824ed04a9512b847180e67f667"})))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});return t}());l.style=h}}}));
1
+ System.register(["./p-7261e245.system.js","./p-15ef7644.system.js","./p-d938f42f.system.js"],(function(t){"use strict";var e,s,i,o,n;return{setters:[function(t){e=t.r;s=t.h;i=t.a;o=t.g},function(t){n=t.f},function(){}],execute:function(){var h=":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{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";var a=h;var l=t("zonos_collapse",function(){function t(t){e(this,t);this.collapsed=false;this.collapseSize=0;this.height=this.el.scrollHeight;this.iframe=null}t.prototype.getElementHeight=function(){var t="".concat(this.height,"px");var e="".concat(this.collapseSize,"px");return this.collapsed?e:t};t.prototype.componentDidLoad=function(){this.height=this.el.scrollHeight};t.prototype.componentDidRender=function(){var t=this;var e,s,i;this.iframe=((e=this.el.shadowRoot)===null||e===void 0?void 0:e.querySelector("iframe"))||null;(i=(s=this.iframe)===null||s===void 0?void 0:s.contentWindow)===null||i===void 0?void 0:i.addEventListener("resize",(function(){if(!t.iframe){return}t.height=parseFloat(getComputedStyle(t.iframe).height)}))};t.prototype.render=function(){var t=this;if(!this.collapsed){setTimeout((function(){if(!t.collapsed){t.el.style.overflow="visible"}}),300)}else{this.el.style.overflow="hidden"}return s(i,{key:"2a96e5ed214d93d07057eb7958a26e8a7b286ce8",class:"zonos--elements zonos--collapse",style:{"--zonos--font-family":n(),height:this.getElementHeight()}},s("div",{key:"d2a039a3cde3c54bd560774d91cf36924311e251"},s("iframe",{key:"a2b1494c32fcd8a467e23ae6733fd341220a9020",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),s("slot",{key:"5dd47c6e903a01824ed04a9512b847180e67f667"})))};Object.defineProperty(t.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});return t}());l.style=a}}}));