@zonos/elements 1.3.254 → 1.3.256

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 (212) hide show
  1. package/dist/cjs/{cart-77640463.js → cart-e156c1e3.js} +1 -1
  2. package/dist/cjs/{hasInclusivePrice-e93c64fd.js → hasInclusivePrice-d6d274bd.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{invoice-211ef96c.js → invoice-f4b5d538.js} +2 -2
  5. package/dist/cjs/{isCollectMobileTablet-14fb5ab4.js → isCollectMobileTablet-c9369cd8.js} +2 -2
  6. package/dist/cjs/loader.cjs.js +1 -1
  7. package/dist/cjs/{localization-be7afc1b.js → localization-5bb1e598.js} +243 -0
  8. package/dist/cjs/{paypal-c61ef042.js → paypal-f9641595.js} +2 -2
  9. package/dist/cjs/{placeTestOrder-0f7477c8.js → placeTestOrder-7ac7f91a.js} +2 -2
  10. package/dist/cjs/{renderCheckoutCurrency-1ac02803.js → renderCheckoutCurrency-6b59a718.js} +2 -2
  11. package/dist/cjs/zonos-address-display_8.cjs.entry.js +2 -2
  12. package/dist/cjs/zonos-address_4.cjs.entry.js +2 -2
  13. package/dist/cjs/zonos-card_5.cjs.entry.js +3 -3
  14. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +6 -6
  15. package/dist/cjs/zonos-checkout.cjs.entry.js +357 -78
  16. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +2 -2
  17. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +6 -6
  18. package/dist/cjs/zonos-collect.cjs.entry.js +4 -4
  19. package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
  20. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  21. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  22. package/dist/cjs/zonos-elements.cjs.js +1 -1
  23. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
  24. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  25. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +4 -4
  26. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +6 -6
  27. package/dist/cjs/zonos-invoice.cjs.entry.js +4 -4
  28. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  29. package/dist/cjs/zonos-store-credit.cjs.entry.js +3 -3
  30. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +60 -2
  31. package/dist/collection/components/store/hello/localization.js +3 -0
  32. package/dist/collection/components/store/translationStore/strings.arabic.js +12 -0
  33. package/dist/collection/components/store/translationStore/strings.base.js +12 -0
  34. package/dist/collection/components/store/translationStore/strings.chinese.js +12 -0
  35. package/dist/collection/components/store/translationStore/strings.danish.js +12 -0
  36. package/dist/collection/components/store/translationStore/strings.dutch.js +12 -0
  37. package/dist/collection/components/store/translationStore/strings.french.js +12 -0
  38. package/dist/collection/components/store/translationStore/strings.german.js +12 -0
  39. package/dist/collection/components/store/translationStore/strings.hebrew.js +12 -0
  40. package/dist/collection/components/store/translationStore/strings.indonesian.js +12 -0
  41. package/dist/collection/components/store/translationStore/strings.italian.js +12 -0
  42. package/dist/collection/components/store/translationStore/strings.japanese.js +12 -0
  43. package/dist/collection/components/store/translationStore/strings.korean.js +12 -0
  44. package/dist/collection/components/store/translationStore/strings.norwegian.js +12 -0
  45. package/dist/collection/components/store/translationStore/strings.polish.js +12 -0
  46. package/dist/collection/components/store/translationStore/strings.portuguese.js +12 -0
  47. package/dist/collection/components/store/translationStore/strings.russian.js +12 -0
  48. package/dist/collection/components/store/translationStore/strings.spanish.js +12 -0
  49. package/dist/collection/components/store/translationStore/strings.swedish.js +12 -0
  50. package/dist/collection/components/store/translationStore/strings.turkish.js +12 -0
  51. package/dist/collection/components/store/translationStore/strings.vietnamese.js +12 -0
  52. package/dist/collection/components/utils/checkout/bigcommerceStorefrontApi.js +52 -0
  53. package/dist/collection/components/utils/checkout/buildBigcommerceRedirectUrl.js +22 -0
  54. package/dist/collection/components/utils/checkout/checkBigCommerceBypassCustomerGroup.js +122 -0
  55. package/dist/collection/components/utils/checkout/watchBigcommerceDomesticCheckout.js +5 -2
  56. package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +120 -86
  57. package/dist/esm/{cart-394c9ddb.js → cart-55b8dd7c.js} +1 -1
  58. package/dist/esm/{hasInclusivePrice-f0322e1c.js → hasInclusivePrice-ddae18fd.js} +1 -1
  59. package/dist/esm/index.js +7 -7
  60. package/dist/esm/{invoice-5ae81ae5.js → invoice-dbe85a18.js} +2 -2
  61. package/dist/esm/{isCollectMobileTablet-15b668d6.js → isCollectMobileTablet-8af0d16d.js} +2 -2
  62. package/dist/esm/loader.js +1 -1
  63. package/dist/esm/{localization-0ebc8356.js → localization-d11c973f.js} +243 -0
  64. package/dist/esm/{paypal-b6fa3ec3.js → paypal-f87fbee0.js} +2 -2
  65. package/dist/esm/{placeTestOrder-5756cbc3.js → placeTestOrder-8e8e97be.js} +2 -2
  66. package/dist/esm/{renderCheckoutCurrency-5f3e06ea.js → renderCheckoutCurrency-45c74af2.js} +2 -2
  67. package/dist/esm/zonos-address-display_8.entry.js +2 -2
  68. package/dist/esm/zonos-address_4.entry.js +2 -2
  69. package/dist/esm/zonos-card_5.entry.js +3 -3
  70. package/dist/esm/zonos-cart-items_12.entry.js +6 -6
  71. package/dist/esm/zonos-checkout.entry.js +358 -79
  72. package/dist/esm/zonos-collect-cart-items_3.entry.js +2 -2
  73. package/dist/esm/zonos-collect-finish_6.entry.js +6 -6
  74. package/dist/esm/zonos-collect.entry.js +4 -4
  75. package/dist/esm/zonos-controller.entry.js +2 -2
  76. package/dist/esm/zonos-country-flag.entry.js +1 -1
  77. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  78. package/dist/esm/zonos-elements.js +1 -1
  79. package/dist/esm/zonos-hello-dialog.entry.js +2 -2
  80. package/dist/esm/zonos-hello.entry.js +1 -1
  81. package/dist/esm/zonos-invoice-cart-items_2.entry.js +4 -4
  82. package/dist/esm/zonos-invoice-finish_5.entry.js +6 -6
  83. package/dist/esm/zonos-invoice.entry.js +4 -4
  84. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  85. package/dist/esm/zonos-store-credit.entry.js +3 -3
  86. package/dist/esm-es5/{cart-394c9ddb.js → cart-55b8dd7c.js} +1 -1
  87. package/dist/esm-es5/{hasInclusivePrice-f0322e1c.js → hasInclusivePrice-ddae18fd.js} +1 -1
  88. package/dist/esm-es5/index.js +1 -1
  89. package/dist/esm-es5/{invoice-5ae81ae5.js → invoice-dbe85a18.js} +1 -1
  90. package/dist/esm-es5/{isCollectMobileTablet-15b668d6.js → isCollectMobileTablet-8af0d16d.js} +1 -1
  91. package/dist/esm-es5/loader.js +1 -1
  92. package/dist/esm-es5/localization-d11c973f.js +1 -0
  93. package/dist/esm-es5/{paypal-b6fa3ec3.js → paypal-f87fbee0.js} +1 -1
  94. package/dist/esm-es5/{placeTestOrder-5756cbc3.js → placeTestOrder-8e8e97be.js} +1 -1
  95. package/dist/esm-es5/{renderCheckoutCurrency-5f3e06ea.js → renderCheckoutCurrency-45c74af2.js} +1 -1
  96. package/dist/esm-es5/zonos-address-display_8.entry.js +1 -1
  97. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  98. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  99. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  100. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  101. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  102. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  103. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  104. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  105. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  106. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  107. package/dist/esm-es5/zonos-elements.js +1 -1
  108. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  109. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  110. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  111. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  112. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  113. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  114. package/dist/esm-es5/zonos-store-credit.entry.js +1 -1
  115. package/dist/scripts/index.d.ts +19 -0
  116. package/dist/scripts/index.js +1 -1
  117. package/dist/scripts/loadZonos.js +1 -1
  118. package/dist/scripts/zonos.js +1 -1
  119. package/dist/types/components/checkout/zonos-checkout/zonos-checkout.d.ts +13 -0
  120. package/dist/types/components/store/translationStore/strings.arabic.d.ts +12 -0
  121. package/dist/types/components/store/translationStore/strings.base.d.ts +12 -0
  122. package/dist/types/components/store/translationStore/strings.chinese.d.ts +12 -0
  123. package/dist/types/components/store/translationStore/strings.danish.d.ts +12 -0
  124. package/dist/types/components/store/translationStore/strings.dutch.d.ts +12 -0
  125. package/dist/types/components/store/translationStore/strings.french.d.ts +12 -0
  126. package/dist/types/components/store/translationStore/strings.german.d.ts +12 -0
  127. package/dist/types/components/store/translationStore/strings.hebrew.d.ts +12 -0
  128. package/dist/types/components/store/translationStore/strings.indonesian.d.ts +12 -0
  129. package/dist/types/components/store/translationStore/strings.italian.d.ts +12 -0
  130. package/dist/types/components/store/translationStore/strings.japanese.d.ts +12 -0
  131. package/dist/types/components/store/translationStore/strings.korean.d.ts +12 -0
  132. package/dist/types/components/store/translationStore/strings.norwegian.d.ts +12 -0
  133. package/dist/types/components/store/translationStore/strings.polish.d.ts +12 -0
  134. package/dist/types/components/store/translationStore/strings.portuguese.d.ts +12 -0
  135. package/dist/types/components/store/translationStore/strings.russian.d.ts +12 -0
  136. package/dist/types/components/store/translationStore/strings.spanish.d.ts +12 -0
  137. package/dist/types/components/store/translationStore/strings.swedish.d.ts +12 -0
  138. package/dist/types/components/store/translationStore/strings.turkish.d.ts +12 -0
  139. package/dist/types/components/store/translationStore/strings.vietnamese.d.ts +12 -0
  140. package/dist/types/components/utils/checkout/bigcommerceStorefrontApi.d.ts +36 -0
  141. package/dist/types/components/utils/checkout/buildBigcommerceRedirectUrl.d.ts +11 -0
  142. package/dist/types/components/utils/checkout/checkBigCommerceBypassCustomerGroup.d.ts +30 -0
  143. package/dist/types/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.d.ts +16 -1
  144. package/dist/types/types/utils/ZonosSettings.d.ts +7 -0
  145. package/dist/zonos-elements/index.esm.js +1 -1
  146. package/dist/zonos-elements/{p-bdaf2a38.entry.js → p-00728af1.entry.js} +1 -1
  147. package/dist/zonos-elements/{p-4a38ea5e.system.entry.js → p-08830a50.system.entry.js} +1 -1
  148. package/dist/zonos-elements/p-179bbeae.js +1 -0
  149. package/dist/zonos-elements/{p-b49b8da4.system.entry.js → p-1c9e9692.system.entry.js} +1 -1
  150. package/dist/zonos-elements/{p-97fb5ad5.entry.js → p-225957b9.entry.js} +1 -1
  151. package/dist/zonos-elements/p-29b60bf3.system.js +1 -1
  152. package/dist/zonos-elements/{p-27fad55a.system.js → p-2a28c7ac.system.js} +1 -1
  153. package/dist/zonos-elements/{p-92d91395.system.entry.js → p-2cb5ef7d.system.entry.js} +1 -1
  154. package/dist/zonos-elements/{p-b37a85f0.system.entry.js → p-2eeda8a9.system.entry.js} +1 -1
  155. package/dist/zonos-elements/{p-0da3cc62.system.entry.js → p-32365d6a.system.entry.js} +1 -1
  156. package/dist/zonos-elements/{p-11d6de1a.entry.js → p-399f5ad6.entry.js} +1 -1
  157. package/dist/zonos-elements/{p-57b27c60.js → p-3a8925e9.js} +1 -1
  158. package/dist/zonos-elements/p-3f141999.system.js +1 -0
  159. package/dist/zonos-elements/{p-620ba943.js → p-3fae811a.js} +1 -1
  160. package/dist/zonos-elements/{p-93dec11b.entry.js → p-50d31f4f.entry.js} +1 -1
  161. package/dist/zonos-elements/{p-c6047442.system.entry.js → p-52b70520.system.entry.js} +1 -1
  162. package/dist/zonos-elements/{p-a0ac3ca2.system.entry.js → p-53275a0d.system.entry.js} +1 -1
  163. package/dist/zonos-elements/p-5343c32b.system.js +1 -0
  164. package/dist/zonos-elements/{p-09d7a5cb.system.js → p-57b5d3e3.system.js} +1 -1
  165. package/dist/zonos-elements/{p-daaaa8f1.system.entry.js → p-59025df9.system.entry.js} +1 -1
  166. package/dist/zonos-elements/{p-a1e23675.system.entry.js → p-5d0b0126.system.entry.js} +1 -1
  167. package/dist/zonos-elements/{p-8dfa0bb8.system.entry.js → p-664aff48.system.entry.js} +1 -1
  168. package/dist/zonos-elements/{p-c1ae7391.system.entry.js → p-6b45e9f3.system.entry.js} +1 -1
  169. package/dist/zonos-elements/{p-321e7920.system.js → p-70e069d3.system.js} +1 -1
  170. package/dist/zonos-elements/{p-fce715f1.system.entry.js → p-72de2fdc.system.entry.js} +1 -1
  171. package/dist/zonos-elements/{p-8abeab5a.entry.js → p-7d4a1565.entry.js} +1 -1
  172. package/dist/zonos-elements/{p-07ca3347.system.entry.js → p-8608c123.system.entry.js} +1 -1
  173. package/dist/zonos-elements/{p-615b5d13.entry.js → p-89757efe.entry.js} +1 -1
  174. package/dist/zonos-elements/{p-920d9189.entry.js → p-8a593061.entry.js} +1 -1
  175. package/dist/zonos-elements/{p-efa69c89.entry.js → p-8ccf97ce.entry.js} +1 -1
  176. package/dist/zonos-elements/{p-4f23732f.js → p-93c64387.js} +1 -1
  177. package/dist/zonos-elements/p-93d6e13f.entry.js +1 -0
  178. package/dist/zonos-elements/p-9631c373.system.js +1 -0
  179. package/dist/zonos-elements/p-99e1734a.js +1 -0
  180. package/dist/zonos-elements/{p-a5adc047.system.entry.js → p-9b42f0ad.system.entry.js} +1 -1
  181. package/dist/zonos-elements/{p-8efb79ab.entry.js → p-aad014df.entry.js} +1 -1
  182. package/dist/zonos-elements/p-ae397ff8.system.entry.js +1 -0
  183. package/dist/zonos-elements/{p-d65cfa9b.system.entry.js → p-b439d38f.system.entry.js} +1 -1
  184. package/dist/zonos-elements/{p-2bdc2206.entry.js → p-b85d4286.entry.js} +1 -1
  185. package/dist/zonos-elements/{p-2c2e5ee6.entry.js → p-befad3c4.entry.js} +1 -1
  186. package/dist/zonos-elements/{p-a5fb864a.system.entry.js → p-c66649fe.system.entry.js} +1 -1
  187. package/dist/zonos-elements/{p-d8610393.entry.js → p-d14e5c81.entry.js} +1 -1
  188. package/dist/zonos-elements/{p-a95ac160.entry.js → p-d155b9c6.entry.js} +1 -1
  189. package/dist/zonos-elements/{p-dcef3647.system.js → p-d280e9b6.system.js} +1 -1
  190. package/dist/zonos-elements/{p-9ff90151.entry.js → p-dba635e6.entry.js} +1 -1
  191. package/dist/zonos-elements/{p-1162b685.entry.js → p-ddde268d.entry.js} +1 -1
  192. package/dist/zonos-elements/p-e2adf04b.system.js +1 -0
  193. package/dist/zonos-elements/p-ee2c7a1e.js +1 -0
  194. package/dist/zonos-elements/{p-3d757163.entry.js → p-f36e907e.entry.js} +1 -1
  195. package/dist/zonos-elements/{p-29f7950c.js → p-f6733ffb.js} +1 -1
  196. package/dist/zonos-elements/{p-95f7f2a0.entry.js → p-f9ffff4e.entry.js} +1 -1
  197. package/dist/zonos-elements/p-fa0c5017.js +1 -0
  198. package/dist/zonos-elements/{p-fbccfa3e.system.js → p-fbd44c55.system.js} +1 -1
  199. package/dist/zonos-elements/{p-c2121663.system.entry.js → p-fc1c7fe5.system.entry.js} +1 -1
  200. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  201. package/package.json +1 -1
  202. package/dist/esm-es5/localization-0ebc8356.js +0 -1
  203. package/dist/zonos-elements/p-0dd5a4b8.system.js +0 -1
  204. package/dist/zonos-elements/p-1282495f.system.js +0 -1
  205. package/dist/zonos-elements/p-13041752.js +0 -1
  206. package/dist/zonos-elements/p-2b118454.js +0 -1
  207. package/dist/zonos-elements/p-2c9c750e.system.js +0 -1
  208. package/dist/zonos-elements/p-4df85216.entry.js +0 -1
  209. package/dist/zonos-elements/p-ac353826.js +0 -1
  210. package/dist/zonos-elements/p-ca19a10a.js +0 -1
  211. package/dist/zonos-elements/p-cc9620e5.system.entry.js +0 -1
  212. package/dist/zonos-elements/p-cf69bcc4.system.js +0 -1
@@ -1 +1 @@
1
- System.register(["./p-7261e245.system.js","./p-cf69bcc4.system.js","./p-ac30b7a8.system.js","./p-23e7c655.system.js","./p-01174496.system.js","./p-d938f42f.system.js"],(function(t){"use strict";var s,o,n,e,i,a,h;return{setters:[function(t){s=t.r;o=t.h;n=t.a;e=t.g},function(t){i=t.l},function(t){a=t.f},function(t){h=t.c},function(){},function(){}],execute:function(){var r=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .flag-container{position:relative;overflow:hidden;width:100%;height:100%}:host .flag-icon{position:absolute;top:0;left:0;width:100%;height:100%;background-position:center;background-repeat:no-repeat;background-size:cover}";var f=r;var l="https://zonos-store-assets.s3.amazonaws.com/images/elements-flags";var c=t("zonos_country_flag",function(){function t(t){s(this,t);this.countryCode=i.selectedCountryCode}t.prototype.render=function(){if(!this.el.shadowRoot||!this.countryCode){return null}var t="".concat(l,"/").concat(this.countryCode,".svg");var s=a();return o(n,{class:"zonos--elements",style:this.size?{"--zonos--font-family":s,height:"".concat(this.size,"px"),width:"".concat(this.size,"px")}:{"--zonos--font-family":s}},o("div",{class:h(["flag-container"])},o("div",{class:"flag-icon",style:{backgroundImage:"url(".concat(t,")")}})))};Object.defineProperty(t.prototype,"el",{get:function(){return e(this)},enumerable:false,configurable:true});return t}());c.style=f}}}));
1
+ System.register(["./p-7261e245.system.js","./p-e2adf04b.system.js","./p-ac30b7a8.system.js","./p-23e7c655.system.js","./p-01174496.system.js","./p-d938f42f.system.js"],(function(t){"use strict";var s,o,n,e,i,a,h;return{setters:[function(t){s=t.r;o=t.h;n=t.a;e=t.g},function(t){i=t.l},function(t){a=t.f},function(t){h=t.c},function(){},function(){}],execute:function(){var r=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex}:host .flag-container{position:relative;overflow:hidden;width:100%;height:100%}:host .flag-icon{position:absolute;top:0;left:0;width:100%;height:100%;background-position:center;background-repeat:no-repeat;background-size:cover}";var f=r;var l="https://zonos-store-assets.s3.amazonaws.com/images/elements-flags";var c=t("zonos_country_flag",function(){function t(t){s(this,t);this.countryCode=i.selectedCountryCode}t.prototype.render=function(){if(!this.el.shadowRoot||!this.countryCode){return null}var t="".concat(l,"/").concat(this.countryCode,".svg");var s=a();return o(n,{class:"zonos--elements",style:this.size?{"--zonos--font-family":s,height:"".concat(this.size,"px"),width:"".concat(this.size,"px")}:{"--zonos--font-family":s}},o("div",{class:h(["flag-container"])},o("div",{class:"flag-icon",style:{backgroundImage:"url(".concat(t,")")}})))};Object.defineProperty(t.prototype,"el",{get:function(){return e(this)},enumerable:false,configurable:true});return t}());c.style=f}}}));
@@ -1 +1 @@
1
- import{r as e,h as o,a as s}from"./p-ce75b047.js";import{u as t,t as a,l as n}from"./p-13041752.js";import{f as l}from"./p-058f6124.js";import{l as i}from"./p-97aceb11.js";import"./p-41dd1cb8.js";import"./p-0a377722.js";const c=class{constructor(o){e(this,o),this.handleOnClose=()=>{},this.languageSelected=e=>{t(e),this.handleOnClose()}}render(){const{selectedLocale:e}=n;return o(s,{key:"748efbe1de696c0e1f52cef03d86f211c1e5f505",class:"zonos--elements",style:{"--zonos--font-family":l()}},o("div",{key:"97dd3f26dd5aff625b26a08125737f915bfbd112",class:"zonos--language-select"},o("zonos-select-dialog-header",{key:"8c00e1cf6d7addf5b817e07c1fb1b492cfb5775f",handleOnClose:()=>this.handleOnClose(),label:a("Select a language")}),o("div",{key:"0260631e4303d5cee5035f31667203e4e3417a76",class:"zonos--language-select-content"},i.map((s=>o("button",{class:"zonos--language-select-button",onClick:()=>this.languageSelected(s.code)},o("zonos-text",{textColor:"gray-800"},s.translatedLabel),s.code===e&&o("zonos-icon",{content:'<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',size:16})))))))}};c.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--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}}";const d=class{constructor(o){e(this,o),this.handleOnClose=()=>{},this.label=""}render(){return o(s,{key:"a1b9179c608e89ae29416a7c1cb93a5e15c9b029",class:"zonos--elements",style:{"--zonos--font-family":l()}},o("zonos-v-stack",{key:"736354e40352c79c5b1d27207c424fc6ee82f7f4",class:"zonos--select-dialog-header-wrapper",spacing:8},o("div",{key:"700c0321bb2ea565ff861b833f51f3418ad61e4f",class:"zonos--select-dialog-header"},o("zonos-text",{key:"a45fb7507453949a1f3c687ae73635bb8b3f9282",type:"boldLabel"},this.label),o("zonos-button",{key:"a6b210caedc6248d8ab112bb10d888455d6fc6da",class:"zonos--close-button",icon:o("zonos-icon",{"aria-label":"Close select dialog",content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>',size:20}),noBackground:!0,onClick:()=>this.handleOnClose()})),o("slot",{key:"3bfbcd7c5bab9f11e4ed936dcd3b99da553709a0"})))}};d.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--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}";export{c as zonos_language_select,d as zonos_select_dialog_header}
1
+ import{r as e,h as o,a as s}from"./p-ce75b047.js";import{u as t,t as a,l as n}from"./p-99e1734a.js";import{f as l}from"./p-058f6124.js";import{l as i}from"./p-97aceb11.js";import"./p-41dd1cb8.js";import"./p-0a377722.js";const c=class{constructor(o){e(this,o),this.handleOnClose=()=>{},this.languageSelected=e=>{t(e),this.handleOnClose()}}render(){const{selectedLocale:e}=n;return o(s,{key:"748efbe1de696c0e1f52cef03d86f211c1e5f505",class:"zonos--elements",style:{"--zonos--font-family":l()}},o("div",{key:"97dd3f26dd5aff625b26a08125737f915bfbd112",class:"zonos--language-select"},o("zonos-select-dialog-header",{key:"8c00e1cf6d7addf5b817e07c1fb1b492cfb5775f",handleOnClose:()=>this.handleOnClose(),label:a("Select a language")}),o("div",{key:"0260631e4303d5cee5035f31667203e4e3417a76",class:"zonos--language-select-content"},i.map((s=>o("button",{class:"zonos--language-select-button",onClick:()=>this.languageSelected(s.code)},o("zonos-text",{textColor:"gray-800"},s.translatedLabel),s.code===e&&o("zonos-icon",{content:'<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',size:16})))))))}};c.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--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}}";const d=class{constructor(o){e(this,o),this.handleOnClose=()=>{},this.label=""}render(){return o(s,{key:"a1b9179c608e89ae29416a7c1cb93a5e15c9b029",class:"zonos--elements",style:{"--zonos--font-family":l()}},o("zonos-v-stack",{key:"736354e40352c79c5b1d27207c424fc6ee82f7f4",class:"zonos--select-dialog-header-wrapper",spacing:8},o("div",{key:"700c0321bb2ea565ff861b833f51f3418ad61e4f",class:"zonos--select-dialog-header"},o("zonos-text",{key:"a45fb7507453949a1f3c687ae73635bb8b3f9282",type:"boldLabel"},this.label),o("zonos-button",{key:"a6b210caedc6248d8ab112bb10d888455d6fc6da",class:"zonos--close-button",icon:o("zonos-icon",{"aria-label":"Close select dialog",content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" clip-rule="evenodd"/><path fill="#4D505A" fill-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" clip-rule="evenodd"/></svg>',size:20}),noBackground:!0,onClick:()=>this.handleOnClose()})),o("slot",{key:"3bfbcd7c5bab9f11e4ed936dcd3b99da553709a0"})))}};d.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--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}";export{c as zonos_language_select,d as zonos_select_dialog_header}
@@ -0,0 +1 @@
1
+ var __awaiter=this&&this.__awaiter||function(e,o,t,n){function r(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function c(e){try{a(n["throw"](e))}catch(e){i(e)}}function a(e){e.done?t(e.value):r(e.value).then(s,c)}a((n=n.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,r,i,s;return s={next:c(0),throw:c(1),return:c(2)},typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(o){return a([e,o])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,c[0]&&(t=0)),t)try{if(n=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:t.label++;return{value:c[1],done:false};case 5:t.label++;r=c[1];c=[0];continue;case 7:c=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1];i=c;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(c);break}if(i[2])t.ops.pop();t.trys.pop();continue}c=o.call(e,t)}catch(e){c=[6,e];r=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var n=0,r=o.length,i;n<r;n++){if(i||!(n in o)){if(!i)i=Array.prototype.slice.call(o,0,n);i[n]=o[n]}}return e.concat(i||Array.prototype.slice.call(o))};System.register(["./p-7261e245.system.js","./p-fbd44c55.system.js","./p-57b5d3e3.system.js","./p-e2adf04b.system.js","./p-ac30b7a8.system.js","./p-398d9022.system.js","./p-01174496.system.js","./p-9d44fef6.system.js","./p-d938f42f.system.js","./p-40a4c8a2.system.js","./p-23e7c655.system.js","./p-bf37ccc7.system.js","./p-7501c637.system.js","./p-d18a2b2c.system.js","./p-1aa93d1e.system.js","./p-ab25379f.system.js","./p-2770ba48.system.js","./p-8c6624b6.system.js","./p-3fbd9cc0.system.js"],(function(e){"use strict";var o,t,n,r,i,s,c,a,u,d,l,h,f,v,m,p,g,w,z,k,y,b,_,C,x,S,T,I,A,O,E,P,N,B,j,L,U,D,R,F,M,Z,H,G,K,V,W,Y,q,Q,J,X,$,ee,oe,te,ne,re,ie,se,ce,ae,ue,de,le,he,fe,ve,me,pe,ge,we,ze,ke,ye,be,_e;return{setters:[function(e){o=e.r;t=e.h;n=e.F;r=e.a},function(e){i=e.s;s=e.a;c=e.b;a=e.i;u=e.c;d=e.d;l=e.e;h=e.f;f=e.g;v=e.h;m=e.j;p=e.k;g=e.l;w=e.t;z=e.m;k=e.n;y=e.o;b=e.p;_=e.q;C=e.r;x=e.u;S=e.v;T=e.w;I=e.x;A=e.y;O=e.z;E=e.A;P=e.B;N=e.C;B=e.D;j=e.E;L=e.F},function(e){U=e.p;D=e.a;R=e.b},function(e){F=e.f;M=e.l;Z=e.a;H=e.g;G=e.s;K=e.V;V=e.b;W=e.t;Y=e.c;q=e.d},function(e){Q=e.z;J=e.g;X=e.m},function(e){$=e.b},function(e){ee=e.h;oe=e.g;te=e.l;ne=e.b;re=e.j;ie=e.s;se=e.a;ce=e.i},function(e){ae=e.u},function(e){ue=e.l;de=e.g;le=e.b},function(e){he=e._;fe=e.c;ve=e.a;me=e.d;pe=e.g},function(e){ge=e.c},function(e){we=e.c},function(e){ze=e.g},function(e){ke=e.i},function(e){ye=e.s},function(e){be=e.s},function(e){_e=e.R},function(){},function(){}],execute:function(){var Ce=this;var xe=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o,t;return __generator(this,(function(n){switch(n.label){case 0:return[4,ee("/api/zonos-elements/get-store-discount-enabled-status")];case 1:e=n.sent(),o=e.errors,t=e.json;if(o.length||!(t===null||t===void 0?void 0:t.enabled)){return[2,{enabled:false}]}return[2,{enabled:true}]}}))}))};var Se=function(e){return __awaiter(Ce,[e],void 0,(function(e){var o,t,n,r;var i=e.testKeys;return __generator(this,(function(e){switch(e.label){case 0:if(i.length===0){return[2,null]}return[4,ee("/api/zonos-elements/select-variance-test",{body:{testKeys:i},method:"POST"})];case 1:o=e.sent(),t=o.errors,n=o.json;if(t.length||!n){return[2,null]}r=F(n);return[2,r]}}))}))};var Te=function(e){var o=e.cartId,t=e.checkoutSessionId,n=e.customerAddress1,r=e.customerAddress2,i=e.customerCity,s=e.customerCountry,c=e.customerEmail,a=e.customerFirstName,u=e.customerLastName,d=e.customerPhone,l=e.customerState,h=e.customerZip,f=e.hostedCheckoutUrl,v=e.isTestMode,m=e.isVariantTest;var p=new URLSearchParams;p.set("tempCartUUID",o);if(a){p.set("customerFirstName",a)}if(u){p.set("customerLastName",u)}if(c){p.set("customerEmail",c)}if(d){p.set("customerPhone",d)}if(h){p.set("customerZip",h)}if(i){p.set("customerCity",i)}if(l){p.set("customerState",l)}if(s){p.set("zCountry",s)}if(n){p.set("customerAddress1",n)}if(r){p.set("customerAddress2",r)}if(v){p.set("zonosTestMode","1")}if(t){p.set("zonosCheckoutSessionId",t)}if(m){p.set("zonosVariantTest","1")}return"".concat(f,"?").concat(p.toString())};var Ie=function(e){var o=new URL(e,window.location.origin);var t=new URLSearchParams(window.location.search).get("zonosQaUrl");if(t){o.searchParams.set("zonosQaUrl",t)}if(oe()){o.searchParams.set("zonosTestMode","1")}return o.toString()};var Ae=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:i.trys.push([0,3,,4]);return[4,fetch("/api/storefront/cart",{credentials:"same-origin",headers:{Accept:"application/json"}})];case 1:t=i.sent();if(!t.ok){ue("Failed to fetch BigCommerce cart: ".concat(String(t.status)),"error");return[2,null]}return[4,t.json()];case 2:n=i.sent();return[2,(o=(e=n===null||n===void 0?void 0:n[0])===null||e===void 0?void 0:e.id)!==null&&o!==void 0?o:null];case 3:r=i.sent();te("Error fetching BigCommerce cart data",r);return[2,null];case 4:return[2]}}))}))};var Oe=function(e){return __awaiter(Ce,void 0,void 0,(function(){var o,t;return __generator(this,(function(n){switch(n.label){case 0:n.trys.push([0,3,,4]);return[4,fetch("/api/storefront/checkouts/".concat(e,"?include=customer.customerGroup"),{credentials:"same-origin",headers:{Accept:"application/json","Content-Type":"application/json"}})];case 1:o=n.sent();if(!o.ok){ue("Failed to fetch BigCommerce checkout: ".concat(String(o.status)),"error");return[2,null]}return[4,o.json()];case 2:return[2,n.sent()];case 3:t=n.sent();te("Error fetching BigCommerce checkout data",t);return[2,null];case 4:return[2]}}))}))};var Ee={customerGroupId:null,shouldBypass:false};var Pe=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o,t,n,r,i,s,c,a,u;return __generator(this,(function(d){switch(d.label){case 0:if(!window.Zonos.isBigCommerce){return[2,{conclusive:true,result:Ee}]}r=(e=Q.genericSettings)===null||e===void 0?void 0:e.bigcommerceBypassCustomerGroupIds;if(!(r===null||r===void 0?void 0:r.length)){if(Q.loadedConfig){return[2,{conclusive:true,result:Ee}]}return[2,{conclusive:false,result:Ee}]}return[4,Ae()];case 1:i=d.sent();if(!i){ue("BigCommerce bypass check: no active cart yet, will retry on next call","info");return[2,{conclusive:false,result:Ee}]}return[4,Oe(i)];case 2:s=d.sent();if(!s){ue("BigCommerce bypass check: failed to fetch checkout data, will retry","info");return[2,{conclusive:false,result:Ee}]}c=(n=(t=(o=s.customer)===null||o===void 0?void 0:o.customerGroup)===null||t===void 0?void 0:t.id)!==null&&n!==void 0?n:null;if(c===null){ue("BigCommerce bypass check: no customer group found (guest user)","info");return[2,{conclusive:true,result:Ee}]}a=r.includes(c);u={customerGroupId:c,shouldBypass:a};if(a){ue("BigCommerce bypass check: customer group ".concat(String(c)," is in bypass list; caller should keep the user on BC native checkout"),"info")}else{ue("BigCommerce bypass check: customer group ".concat(String(c)," is not in bypass list"),"info")}return[2,{conclusive:true,result:u}]}}))}))};var Ne=null;var Be=function(){var e=Pe();var o=e.then((function(e){var t=e.conclusive,n=e.result;if(!t&&Ne===o){Ne=null}return n}));Ne=o;return o};var je=function(){var e;if(!window.Zonos.isBigCommerce){return}var o=(e=Q.genericSettings)===null||e===void 0?void 0:e.bigcommerceBypassCustomerGroupIds;if(!(o===null||o===void 0?void 0:o.length)){return}void Be()};var Le=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(Ce,__spreadArray([],e,true),void 0,(function(e){if(e===void 0){e={}}return __generator(this,(function(o){if(e.forceRefresh||!Ne){return[2,Be()]}return[2,Ne]}))}))};var Ue=function(e){if(e===void 0){e=true}if(!M.localizationLoaded){return true}if(M.isDisabledCountry){if(e){ue("Checkout: disabled country")}return true}return false};var De=function(e,o){if(e===void 0){e=true}var t;if(!M.localizationLoaded){return false}if(o){var n=!!((t=M.shippingZoneCountries)===null||t===void 0?void 0:t[o])&&!Q.disabledCountries.includes(o);if(e&&!n){ue("Checkout: ".concat(o," is not a shippable country: ").concat(n))}return n}if(!M.isShippableCountry){if(e){ue("Checkout: not shippable country")}return false}return true};var Re='select[name="shippingAddress.countryCode"]';var Fe=function(e){return __awaiter(Ce,[e],void 0,(function(e){var o,t,n,r,i,c,a,u,d,l,h,f,v,m,p,g;var w=e.onInternationalCheckoutSelected,z=e.onLoggedInInternationalAddressDetected;return __generator(this,(function(e){switch(e.label){case 0:return[4,Le()];case 1:h=e.sent().shouldBypass;if(h){return[2,"noAction"]}return[4,Ae()];case 2:f=e.sent();if(!f){return[2,"noAction"]}return[4,Oe(f)];case 3:v=e.sent();m=(t=(o=v===null||v===void 0?void 0:v.consignments)===null||o===void 0?void 0:o[0])===null||t===void 0?void 0:t.shippingAddress;if(!(m===null||m===void 0?void 0:m.countryCode)){return[2,"noAction"]}p=m.countryCode;if(!De(false,p)){return[2,"noAction"]}ue(z?"Logged-in user has international shipping address: ".concat(p,", prompting user to choose checkout"):"Logged-in user has international shipping address: ".concat(p,", redirecting automatically (legacy behavior)"),"info");if(!z)return[3,5];return[4,z()];case 4:g=e.sent();if(g==="stay"){ue("User opted to stay on BigCommerce native checkout despite international default address","info");return[2,"optedOut"]}e.label=5;case 5:if(!w)return[3,7];return[4,w()];case 6:e.sent();e.label=7;case 7:Z({isInitializing:false,newSelectedCountryCode:p});s({address1:(n=m.address1)!==null&&n!==void 0?n:"",address2:(r=m.address2)!==null&&r!==void 0?r:"",city:(i=m.city)!==null&&i!==void 0?i:"",countryCode:p,firstName:(c=m.firstName)!==null&&c!==void 0?c:"",lastName:(a=m.lastName)!==null&&a!==void 0?a:"",phone:(u=m.phone)!==null&&u!==void 0?u:"",postalCode:(d=m.postalCode)!==null&&d!==void 0?d:"",state:(l=m.stateOrProvince)!==null&&l!==void 0?l:""});window.location.href=Ie("/");return[2,"redirected"]}}))}))};var Me=function(e){var o=e.domesticRedirectedBtnSelector,t=e.onInternationalCheckoutSelected,n=e.onLoggedInInternationalAddressDetected,r=e.onShippingAddressSessionFound;if(!window.Zonos.isBigCommerce){return}var c=function(e){return __awaiter(Ce,void 0,void 0,(function(){var o,n,r,i,c;return __generator(this,(function(a){switch(a.label){case 0:n=document.querySelector(((o=Q.genericSettings)===null||o===void 0?void 0:o.bigcommerceDomesticCheckoutCountrySelector)||Re);r=(n===null||n===void 0?void 0:n.value)||e;if(!r){return[2,false]}if(!De(false,r)){return[2,false]}return[4,Le({forceRefresh:true})];case 1:i=a.sent().shouldBypass;if(i){ue("Bypass customer group detected on BC checkout, stopping interval","info");return[2,true]}if(!t)return[3,3];return[4,t()];case 2:a.sent();a.label=3;case 3:Z({isInitializing:false,newSelectedCountryCode:r});c={address1:"",address2:"",city:"",countryCode:r,firstName:"",lastName:"",phone:"",postalCode:"",stateOrProvince:""};s({address1:c.address1,address2:c.address2,city:c.city,countryCode:c.countryCode,firstName:c.firstName,lastName:c.lastName,phone:c.phone,postalCode:c.postalCode,state:c.stateOrProvince});window.location.href=Ie("/");return[2,true]}}))}))};var a=false;var u=false;var d=false;var l=false;var h=false;var f=new MutationObserver((function(){return __awaiter(Ce,void 0,void 0,(function(){var e,s,v,m,p,g,w,z,k,y;var b=this;return __generator(this,(function(_){switch(_.label){case 0:s=document.querySelector(o);v=i();if(!s&&v){m=document.createElement("button");m.style.display="none";m.id="zonos--domestic-redirected-checkout-button";document.body.appendChild(m);r===null||r===void 0?void 0:r(v);f.disconnect();return[2]}p=window.location.pathname.includes("/checkout")&&window.Zonos.isBigCommerce;if(!p){f.disconnect();return[2]}if(!(!l&&!d))return[3,5];d=true;h=true;_.label=1;case 1:_.trys.push([1,3,4,5]);return[4,Fe({onInternationalCheckoutSelected:t,onLoggedInInternationalAddressDetected:n})];case 2:g=_.sent();if(g==="redirected"){f.disconnect();return[2]}if(g==="optedOut"){l=true}return[3,5];case 3:w=_.sent();te("Error checking logged-in user shipping address",w);return[3,5];case 4:d=false;h=false;return[7];case 5:z=document.querySelector(((e=Q.genericSettings)===null||e===void 0?void 0:e.bigcommerceDomesticCheckoutCountrySelector)||Re);if(!z){return[2]}ue("Domestic checkout found - Listening for shipping country change","info",{value:z.value});if(u){return[2]}u=true;f.disconnect();k=setInterval((function(){return __awaiter(b,void 0,void 0,(function(){var e,o;return __generator(this,(function(t){switch(t.label){case 0:if(a||h){return[2]}a=true;t.label=1;case 1:t.trys.push([1,3,,4]);return[4,c()];case 2:e=t.sent();if(e){clearInterval(k);return[2]}a=false;return[3,4];case 3:o=t.sent();a=false;return[3,4];case 4:return[2]}}))}))}),1e3);y=setInterval((function(){var e;if(!window.bcStripeElements){clearInterval(y);return}var o=(e=window.bcStripeElements)===null||e===void 0?void 0:e.getElement("address");if(!o){return}clearInterval(y);o.on("change",(function(e){var o=e.value.address.country;if(o&&!h){void c(o)}}))}),500);return[2]}}))}))}));f.observe(document.body,{childList:true,subtree:true})};var Ze=function(){var e=new URLSearchParams(window.location.search);ue("legacy urlParams","info",Object.fromEntries(e.entries()));var o=function(o){var t=e.get(o);if(!t||t==="undefined"){return""}return t};var t=H(e)||M.selectedCountryCode||"US";var n=o("customerCity");var r=o("customerEmail");var i=o("customerAddress1");var s=o("customerAddress2");var c=o("customerName");var a=o("customerPhone");var u=o("customerZip");var d=o("customerState");var l=o("customerFirstName");var h=o("customerLastName");return{customerAddress1:i,customerAddress2:s,customerCity:n,customerCountry:t,customerEmail:r,customerFirstName:l,customerLastName:h,customerName:c,customerPhone:a,customerState:d,customerZip:u}};var He=0;var Ge=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o;var t;return __generator(this,(function(n){switch(n.label){case 0:if(window.Zonos.loadTimeApiInfoList.length===0){return[2]}ue("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});e={data:__spreadArray([],window.Zonos.loadTimeApiInfoList,true),storeId:window.Zonos.storeId||0};window.Zonos.loadTimeApiInfoList.length=0;return[4,ee("/api/zonos-elements/log-bulk-load-data",{body:e,method:"POST"})];case 1:o=n.sent().errors;if(o.length){(t=window.Zonos.loadTimeApiInfoList).push.apply(t,e.data);He++;if(He>5&&window.Zonos.logIntervalId){clearInterval(window.Zonos.logIntervalId)}}return[2]}}))}))};var Ke=function(){return __awaiter(Ce,void 0,void 0,(function(){var e,o;return __generator(this,(function(t){e=de().elapsedTime;o={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:e,metadata:Object.assign({allLogs:le},ne()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};void ee("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2]}))}))};var Ve=function(e){return __awaiter(Ce,[e],void 0,(function(e){var o;var t=e.loadTime;return __generator(this,(function(e){o={cache:"miss",eventName:"jsdelivr",flag:"LOG_NATIVE_CHECKOUT_LOAD",href:window.location.href,loadTime:t,metadata:Object.assign({allLogs:le},ne()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};void ee("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2]}))}))};var We=function(e){return(e===null||e===void 0?void 0:e.filter((function(e){if(e.expiresAt&&e.expiresAt<Date.now()||!e.expiresAt){return false}return true})))||[]};var Ye=function(e){var o;var t=(o=G.enabledVariantTestKeys)===null||o===void 0?void 0:o.find((function(o){return o.testKey===e}));return(t===null||t===void 0?void 0:t.selectedVariantKey)||null};var qe=function(e){return Q.enabledVariantTestKeys.includes(e)};var Qe=function(e){var o=e.baseTestObj,t=e.mergeTestObj;return o.map((function(e){var o=e.testKey;var n=t.find((function(e){var t=e.testKey;return t===o}));return{expiresAt:(n===null||n===void 0?void 0:n.expiresAt)||Date.now()+K,selectedVariantKey:(n===null||n===void 0?void 0:n.selectedVariantKey)||null,testKey:o}}))};var Je=function(e){return __awaiter(Ce,[e],void 0,(function(e){var o,t,n,r,i;var s=e.cartId,c=e.retries;return __generator(this,(function(e){switch(e.label){case 0:o=oe();return[4,ee("/api/zonos-elements/get-temp-cart",{body:{isTestMode:o,options:{noOnlineStoreSettings:true},tempCartUUID:s},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:t=e.sent(),n=t.errors,r=t.json;i=!r||n.length;if(!(i&&c))return[3,3];ue("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:c});return[4,new Promise((function(e){return setTimeout(e,500)}))];case 2:e.sent();return[2,Je({cartId:s,retries:c-1})];case 3:if(i){return[2,null]}return[2,r]}}))}))};var Xe=function(e){return __awaiter(Ce,void 0,void 0,(function(){var o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:o=he(e),t=o.isDgsCartId,n=o.isLegacyCartId;if(!n&&!t){te("[ZONOS - loadZonos] invalid cart id");return[2,null]}return[4,Je({cartId:e,retries:5})];case 1:r=i.sent();ue("[ZONOS - loadZonos] getting temp cart data","info",r);if(!r){te("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2,null]}window.Zonos.storeId=r.cartData.storeId;window.Zonos.zonosApiKey=r.cartData.credentialToken;return[2,{cartData:r.cartData,storeFavicon:r.storeFaviconUrl,storeId:r.cartData.storeId,storeLogo:r.storeLogoUrl,zonosApiKey:r.cartData.credentialToken}]}}))}))};var $e='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var eo=".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h{z-index:2147483647;position:fixed}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto;position:relative}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.hidden-mode.sc-zonos-checkout-h{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0;z-index:-1}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}.zonos--processing-payment.sc-zonos-checkout-h{z-index:2147483646}";var oo=eo;var to=90*60*1e3;var no=6*60*60*1e3;var ro=e("zonos_checkout",function(){function e(e){var t=this;o(this,e);this.storeUnsubscribeList=[];this.isRedirectAfterOrder=false;this.preview=false;this.hiddenMode=false;this.mobile=false;this.defaultAddress=[];this.forceDialogOpen=false;this.defaultAddressParams=[];this.defaultCustomerProfileAddress=[];this.customerProfile=null;this.open=this.forceDialogOpen;this.isOverlayLoading=false;this.stripe=window.Zonos.stripe;this.submitLoading=false;this.collapseReviewMobile=true;this.isAttachError=false;this.isMobile=false;this.isIframed=false;this.isLegacyCheckout=window.Zonos.isLegacyCheckout;this.confirmDialogOpen=false;this.isCartExpired=false;this.payInUsdConfirmDialogOpen=false;this.inventoryCheckErrorMessage=null;this.placedOrderInfo=null;this.shouldShowFedexShippingConsentDialog=false;this.detectedDomesticCheckoutDialogOpen=false;this.redirectToDomesticCheckoutDialogOpen=false;this.loggedInIntlAddressConfirmDialogOpen=false;this.loggedInIntlAddressResolver=null;this.clientSecret=c.clientSecret;this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret;this.applyStripeTheme=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:r=((e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.theme)||Q.appearance.theme;return[4,a({overrideBorderRadius:(o=this.appearanceSettingsOverride)===null||o===void 0?void 0:o.style,overridePrimaryColor:(t=this.appearanceSettingsOverride)===null||t===void 0?void 0:t.colorPrimary,overrideSecondaryColor:(n=this.appearanceSettingsOverride)===null||n===void 0?void 0:n.colorSecondary,overrideTheme:this.isMobile?r:undefined,paypalEnabled:U()})];case 1:i.sent();return[2]}}))}))};this.checkStripePaymentIntentStatus=function(e){return __awaiter(t,[e],void 0,(function(e){var o,t,n,r,i,s,a,d,l;var h=e.triggeredButton;return __generator(this,(function(e){switch(e.label){case 0:o=h===null||h===void 0?void 0:h.matches("#".concat(fe));t=!!window.Zonos.cartData;n=new URL(window.location.href).searchParams;r=n.get("payment_intent_client_secret");i=n.get("zonosCheckoutSessionId");if(!o){ue("Checkout is triggered by user, no need to check stripe payment intent status");return[2,{shouldAllowOrder:true}]}ue("Payment intent exist, checking stripe payment intent status");if(!r){ue("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:t}]}return[4,u({clientSecret:r})];case 1:s=e.sent(),a=s.error,d=s.status;l=new URLSearchParams(window.location.search).get("redirect_status");if(l){if(!a){ue("Payment intent is succeeded or in a good state to move forward, show success screen")}else{ue("Payment intent failed, show status from error")}this.open=true;G.checkoutSessionId=i;c.clientSecret=r;void this.setToFinishStep(d);return[2,{shouldAllowOrder:false}]}if(!t){ue("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}ue("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))};this.initializeTestKeys=function(){G.enabledVariantTestKeys=We(G.enabledVariantTestKeys||[]);var e=Q.enabledVariantTestKeys.map((function(e){var o;var t=(o=G.enabledVariantTestKeys)===null||o===void 0?void 0:o.find((function(o){var t=o.testKey;return t===e}));return{expiresAt:(t===null||t===void 0?void 0:t.expiresAt)||Date.now()+K,selectedVariantKey:(t===null||t===void 0?void 0:t.selectedVariantKey)||null,testKey:e}}));V(e);return{allSelected:false}};this.shouldAllowHostedVsNativeTest=function(){if(typeof Q.checkoutSettings.createCartId!=="function"){return false}var e=Q.enabledVariantTestKeys.includes("hosted_vs_native");if(!e){return false}return true};this.registerTestHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:e=this.shouldAllowHostedVsNativeTest();if(!e){return[2]}ue("[TEST] - Registering hosted vs native test");o=Ye("hosted_vs_native");if(o){ue("[TEST] - Hosted vs native test already has variant selected: ".concat(o));return[2]}return[4,Se({testKeys:["hosted_vs_native"]})];case 1:t=r.sent();if(!t){ue("[TEST] - Failed to get selection for hosted vs native test");return[2]}n=Qe({baseTestObj:G.enabledVariantTestKeys||[],mergeTestObj:t});V(n);return[2]}}))}))};this.handleHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n,r,i,s,c;return __generator(this,(function(a){switch(a.label){case 0:o=this.shouldAllowHostedVsNativeTest();if(!o){return[2,{redirected:false}]}t=Ye("hosted_vs_native");ue("[TEST] - hosted_vs_native: ".concat(t));if(typeof Q.checkoutSettings.createCartId!=="function"){ue("[TEST] - createCartId is not provided, skipping hosted vs native test");return[2,{redirected:false}]}if(t!=="hosted"){ue("[TEST] - Hosted vs native test is enabled for native, skipping");return[2,{redirected:false}]}if(!((e=Q.genericSettings)===null||e===void 0?void 0:e.hostedCheckoutUrl)){ue("[TEST] - Hosted checkout URL is not provided");return[2,{redirected:false}]}ue('"createCartId" is provided, start building cart');return[4,Q.checkoutSettings.createCartId()];case 1:n=a.sent();i=null;if(typeof n==="object"){r=n.cartId;i=n.shippingData||null}else{r=n}s=Ze();c=Te(Object.assign(Object.assign({cartId:r,checkoutSessionId:G.checkoutSessionId||undefined,hostedCheckoutUrl:Q.genericSettings.hostedCheckoutUrl,isTestMode:oe(),isVariantTest:true},s),i));ue("[TEST] - Redirecting to: ".concat(c));window.open(c,"_blank");return[2,{redirected:true}]}}))}))};this.formatDate=function(e){if(!e){return""}var o=new Date(e);return o.toLocaleDateString()};this.formatTime=function(e){if(!e){return""}var o=new Date(e);return o.toLocaleTimeString()};this.getCurrentLocalePageEnum=function(){switch(d.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}};this.getBaseCurrencySettlementInfo=function(){var e=d.selectedLandedCost;if(!e){return null}var o=e.landedCost.amountSubtotals;if(!o){return null}var t=(o.discounts||0)+o.items+o.landedCostTotal+o.shipping;return{settlementAmount:t}};this.getDefaultAddress=function(){if(t.defaultCustomerProfileAddress.length){return t.defaultCustomerProfileAddress}if(Array.isArray(t.defaultAddress)&&t.defaultAddress.length){return t.defaultAddress}if(!Array.isArray(t.defaultAddress)&&typeof t.defaultAddress==="object"){return[t.defaultAddress]}return t.defaultAddressParams};this.handleHostedOpenWindowCallback=function(e){var o;var t=(o=Q.genericSettings)===null||o===void 0?void 0:o.hostedCheckoutUrl;if(!origin){return}var n=["dev.checkout.elements.zonos.com"].some((function(o){return e.origin.includes(o)}));if(e.origin!==t&&!n){return}switch(e.data.type){case"zonos-checkout-session-update":G.checkoutSessionId=e.data.checkoutSessionId;break}};this.captureParamsRedirectedForVariantTest=function(){var e=new URL(window.location.href);var o=e.searchParams.get("zonosVariantTest")==="1";if(!o){return}var t=e.searchParams.get("zonosCheckoutSessionId");if(t){G.checkoutSessionId=t}var n=G.enabledVariantTestKeys||[];if(window.Zonos.isLegacyCheckout){var r=Ye("hosted_vs_native");if(!r){n.push({expiresAt:Date.now()+K,selectedVariantKey:"hosted",testKey:"hosted_vs_native"});V(n)}else{V(n.map((function(e){if(e.testKey==="hosted_vs_native"){return Object.assign(Object.assign({},e),{selectedVariantKey:"hosted"})}return e})))}}e.searchParams.delete("zonosCheckoutSessionId");e.searchParams.delete("zonosVariantTest");window.history.replaceState({},"",e.toString())}}e.prototype.initCartInfoHandler=function(e){return __awaiter(this,void 0,void 0,(function(){var o;return __generator(this,(function(t){o=e.detail;void l({adjustments:d.adjustments,cartItems:o});return[2]}))}))};e.prototype.handleKeyPress=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){if(e.key==="Escape"){void this.closeDialogHandler()}return[2]}))}))};e.prototype.closeDialogHandler=function(e){return __awaiter(this,void 0,void 0,(function(){var o,t;return __generator(this,(function(n){if(!this.open){return[2]}if(!(e===null||e===void 0?void 0:e.confirmed)){this.confirmDialogOpen=true;return[2]}this.confirmDialogOpen=false;be({event:"zonos-checkout-close",metadata:{checkoutSessionId:G.checkoutSessionId}});this.open=this.forceDialogOpen||false;if(!this.preview&&d.step==="finish"){h()}d.step="customer-info";f();v();(t=(o=Q.checkoutSettings).onClose)===null||t===void 0?void 0:t.call(o);return[2]}))}))};e.prototype.buildCartAndInit=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,c,i,s,s,a,u,i,h;return __generator(this,(function(f){switch(f.label){case 0:if(!(typeof Q.checkoutSettings.createCartId==="function"))return[3,4];ue('"createCartId" is provided, start building cart');return[4,Q.checkoutSettings.createCartId()];case 1:e=f.sent();o=void 0;if(typeof e==="object"){ue("object detected, use cartId and prefill address from createCartId","info",e);o=e.cartId;this.useShippingDataFromCreateCartId(e.shippingData);d.customerAuthenticationToken=e.customerAuthenticationToken||null}else{o=e}window.Zonos.cartId=o;return[4,Xe(o)];case 2:t=f.sent();n=t===null||t===void 0?void 0:t.cartData;if(!n){te("Failed to build cart, please try again.");return[2,false]}window.Zonos.cartData=n;r=$(n),i=r.adjustments,s=r.cartItems;return[4,l({adjustments:i,cartItems:s})];case 3:f.sent();return[3,9];case 4:if(!window.Zonos.cartData)return[3,6];ue("tempCartUUID is provided, start building cart");c=$(window.Zonos.cartData),i=c.adjustments,s=c.cartItems;return[4,l({adjustments:i,cartItems:s})];case 5:f.sent();return[3,9];case 6:if(!(Q.checkoutSettings.buildCartDetail&&M.selectedCountryCode))return[3,9];ue("build cart detail");return[4,Q.checkoutSettings.buildCartDetail({countryCode:M.selectedCountryCode,currencyCode:M.targetCurrency})];case 7:s=f.sent();a=s.filter((function(e){return e.amount>=0}));u=s.filter((function(e){return e.amount<0}));ue("cartItems","info",{cartItems:s});i=u.map((function(e){return{amount:e.amount,currencyCode:e.currencyCode,description:e.name||e.description||"",productId:e.productId||null,sku:e.sku||null,type:"CART_TOTAL"}}));return[4,l({adjustments:i,cartItems:a})];case 8:f.sent();f.label=9;case 9:if(!!G.checkoutSessionId)return[3,11];return[4,m()];case 10:h=f.sent();ue("stripeStoreInitCheckoutSession: ".concat(h));if(!h){return[2,false]}f.label=11;case 11:if(!d.isStagingMode){void p()}return[4,this.applyStripeTheme()];case 12:f.sent();this.isRedirectAfterOrder=Q.checkoutSettings.successBehavior==="REDIRECT_TO_SUCCESS_PAGE"||!!d.externalConfirmationPageURL;return[2,true]}}))}))};e.prototype.reloadCheckoutSession=function(){window.location.reload()};e.prototype.handleOrderDuplication=function(){var e=re(localStorage.getItem("zonos--placed-order-info"));if(!e){localStorage.removeItem("zonos--placed-order-info");return}var o=Date.now()-e.time;ue("=== Existing placed order info: ".concat(e.orderId," - ").concat(this.formatDate(e.time)," - elapsed in hh:ss format: ").concat(new Date(o).toISOString().substring(11,8)),"warn");var t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||no;if(o>t){ue("=== Existing placed order info is older than ".concat(t,"ms, cleaning localStorage"),"warn");localStorage.removeItem("zonos--placed-order-info");return}this.placedOrderInfo=e;ue("=== Showing order duplication confirmation","warn")};e.prototype.recordCheckoutInfo=function(){if(!G.checkoutSessionId){return}void ae({attributes:[{key:"APP_VERSION",value:window.Zonos.version},{key:"APP_VERSION_NPM_INTEGRATION",value:window.Zonos.isNpm?"1":"0"},{key:"LEGACY_CHECKOUT_FACADE",value:window.Zonos.isLegacyCheckout?"1":"0"}],checkoutSessionId:G.checkoutSessionId})};e.prototype.confirmProceedWithOrderDuplication=function(){this.placedOrderInfo=null;if(!G.checkoutSessionId){return}void ae({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:G.checkoutSessionId})};e.prototype.markTheSessionAsAbandonedCart=function(){if(!G.checkoutSessionId){return}void ae({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:G.checkoutSessionId})};e.prototype.handleCancelOrderDuplication=function(){var e;this.placedOrderInfo=null;if(this.isLegacyCheckout){var o=((e=window.Zonos.cartData)===null||e===void 0?void 0:e.storeBaseUrl)||Q.onlineStoreSettings.url;if(!o){return}if(window.parent){window.parent.location.href=o}window.location.href=o;return}void this.closeDialogHandler({confirmed:true})};e.prototype.attachCheckout=function(){var e=this;var o=Q.checkoutSettings.placeOrderButtonSelector;var t=Q.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;ue("attach checkout ".concat(o));ue("attach checkout to always trigger international checkout selector: ".concat(t));if(!o&&!t&&!window.Zonos.cartData){return}var n=[o,t,"#".concat(me),"#".concat(fe),"#".concat(ve)].filter(Boolean);var r=document.querySelectorAll(n.join(","));r.forEach((function(n){var r=n.getAttribute("data-zonos-checkout-attached");if(r){return}ue("attached event to button ".concat(o),"info",{button:n});n.addEventListener("click",(function(o){return __awaiter(e,void 0,void 0,(function(){var e,r,i,s,a,u,l,h,f,v,m,p,y,b,_,C,x;return __generator(this,(function(S){switch(S.label){case 0:i=performance.now();s=t&&n.matches(t);a=n.matches("#".concat(ve));u=n.matches("#".concat(me))||n.matches("#".concat(fe));if(!window.Zonos.isLegacyCheckout&&(!De()||Ue())&&!s&&!a&&!u){return[2]}o.preventDefault();o.stopPropagation();ue("zonos checkout button clicked");return[4,this.checkStripePaymentIntentStatus({triggeredButton:o.target})];case 1:l=S.sent().shouldAllowOrder;if(!l){return[2]}if(!window.Zonos.logIntervalId){window.Zonos.logIntervalId=setInterval((function(){void Ge()}),2e3)}if(!qe("hosted_vs_native"))return[3,4];this.isOverlayLoading=true;return[4,this.registerTestHostedVsNative()];case 2:S.sent();return[4,this.handleHostedVsNative()];case 3:h=S.sent().redirected;this.isOverlayLoading=false;if(h){return[2]}S.label=4;case 4:if(!window.Zonos.isBigCommerce)return[3,6];return[4,Le()];case 5:f=S.sent().shouldBypass;if(f){ue("Bypass customer group detected, redirecting to BigCommerce native checkout","info");window.location.href=Ie("/checkout");return[2]}S.label=6;case 6:c.isFetchingSession=true;this.open=true;S.label=7;case 7:S.trys.push([7,10,,11]);return[4,this.buildCartAndInit()];case 8:v=S.sent();if(!v){throw new Error("Error building cart")}(e=window.opener)===null||e===void 0?void 0:e.postMessage({checkoutSessionId:G.checkoutSessionId,type:"zonos-checkout-session-update"},"*");g({isPreview:this.preview,sessionTimeout:to});be({event:"zonos-checkout-start",metadata:{checkoutSessionId:G.checkoutSessionId}});m=G.checkoutSessionId;void w({checkoutSessionId:m,eventName:"checkout_open"});return[4,xe()];case 9:p=S.sent().enabled;d.shouldHideDiscountInput=!p;this.handleOrderDuplication();if(window.Zonos.isLegacyCheckout){void Ke()}else{y=performance.now();b=y-i;void Ve({loadTime:b})}this.recordCheckoutInfo();_=!!pe();if(_){this.markTheSessionAsAbandonedCart()}return[3,11];case 10:C=S.sent();if(C instanceof Error){x=C.message;if(x==="Cart is expired."){this.isCartExpired=true}}c.isFetchingSession=false;te(C);if(this.isCartExpired){c.isFetchingSession=true;return[2]}void ie({endpoint:"Error creating Checkout",errors:[C instanceof Error?C.toString():"Unknown error"],metadata:{allLogs:le,cartId:window.Zonos.cartId,checkoutSessionBody:z(),href:window.location.href,storeBaseUrl:((r=window.Zonos.cartData)===null||r===void 0?void 0:r.storeBaseUrl)||Q.onlineStoreSettings.url}});k({messages:[W("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:W("Error creating Checkout")});return[3,11];case 11:return[2]}}))}))}),{capture:true,passive:false});if(!Q.checkoutSettings.disablePlaceOrderButtonActivation){n.removeAttribute("disabled")}n.setAttribute("data-zonos-checkout-attached","true");if(n.matches("#".concat(me))){n.dispatchEvent(we("click"));y();n.remove()}if(n.matches("#".concat(fe))){n.dispatchEvent(we("click"));n.remove()}}))};e.prototype.appearanceSettingsOverrideChanged=function(){if(!this.appearanceSettingsOverride){return}void this.applyStripeTheme()};e.prototype.useShippingDataFromCreateCartId=function(e){if(!e){return}ue("shipping data from createCartId result","info",Object.entries(e));var o=e.customerAddress1,t=e.customerAddress2,n=e.customerCity,r=e.customerCountry,i=e.customerEmail,s=e.customerFirstName,c=e.customerLastName,a=e.customerName,u=e.customerPhone,d=e.customerState,l=e.customerZip;var h=new URLSearchParams(window.location.search);var f=r||H(h)||M.selectedCountryCode;this.applyPrefillAddress({customerAddress1:o,customerAddress2:t,customerCity:n,customerCountry:f,customerEmail:i,customerFirstName:s,customerLastName:c,customerName:a,customerPhone:u,customerState:d,customerZip:l})};e.prototype.useLegacyQueryParams=function(){var e=new URLSearchParams(window.location.search);ue("legacy urlParams","info",Object.fromEntries(e.entries()));var o=function(o){var t=e.get(o);if(!t||t==="undefined"){return null}return t};var t=H(e)||M.selectedCountryCode;var n=o("customerCity");var r=o("customerEmail");var i=o("customerAddress1");var s=o("customerAddress2");var c=o("customerName");var a=o("customerFirstName");var u=o("customerLastName");var d=o("customerPhone");var l=o("customerZip");var h=o("customerState");this.applyPrefillAddress({customerAddress1:i,customerAddress2:s,customerCity:n,customerCountry:t,customerEmail:r,customerFirstName:a,customerLastName:u,customerName:c,customerPhone:d,customerState:h,customerZip:l})};e.prototype.applyPrefillAddress=function(e){var o=e.customerAddress1||"";var t=e.customerCountry||"";var n=e.customerAddress2||"";var r=e.customerCity||"";var i=e.customerEmail||"";var s=e.customerFirstName&&e.customerLastName?"".concat(e.customerFirstName," ").concat(e.customerLastName):e.customerName||"";var c=e.customerPhone||"";var a=e.customerZip||"";var u=e.customerState||"";if(!o||!s||!c||!t){ue("Missing required query params so it can not be prefilled","info",[!o&&"line1",!s&&"name",!c&&"phone",!t&&"country"].filter(Boolean).join(", "));return}if(t&&M.shippingZoneCountries&&!(t in M.shippingZoneCountries)){ue('Country "'.concat(t,'" is not in the shipping zone, so it can not be prefilled'),"warn");return}this.defaultAddressParams=[{address:{city:r||"",country:t,line1:o,line2:n,postal_code:a,state:u},email:i,name:s,phone:c}];ue("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:e})};e.prototype.overrideStagingModeChanged=function(){d.isStagingMode=!!this.overrideStagingMode};e.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var e;var o=this;return __generator(this,(function(t){c.stripe=window.Zonos.stripe;this.stripe=window.Zonos.stripe;d.isStagingMode=se();if(typeof this.overrideStagingMode!=="undefined"){d.isStagingMode=this.overrideStagingMode}je();Me({domesticRedirectedBtnSelector:me,onInternationalCheckoutSelected:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.detectedDomesticCheckoutDialogOpen=true;return[4,new Promise((function(e){return setTimeout(e,2e3)}))];case 1:e.sent();return[2]}}))}))},onLoggedInInternationalAddressDetected:function(){return new Promise((function(e){o.loggedInIntlAddressResolver=e;o.loggedInIntlAddressConfirmDialogOpen=true}))},onShippingAddressSessionFound:function(e){o.defaultAddress=[{address:{city:e.city,country:e.countryCode,line1:e.address1,line2:e.address2,postal_code:e.postalCode,state:e.state},email:"",name:"".concat(e.firstName," ").concat(e.lastName),phone:e.phone}]}});if(window.Zonos){this.useLegacyQueryParams()}e=setInterval((function(){c.stripe=window.Zonos.stripe;o.stripe=window.Zonos.stripe;if(!o.stripe){ue("waiting for stripe to be loaded");return}if(o.storybookPaymentStatusOverride){clearInterval(e);return}ue("init checkout");if(o.preview||o.forceDialogOpen){void o.buildCartAndInit()}else if(window.Zonos.isLegacyCheckout){o.attachCheckout()}else if(window){o.attachCheckout();var t=new MutationObserver((function(){o.attachCheckout()}));t.observe(document.body,{childList:true,subtree:true})}clearInterval(e)}),50);setTimeout((function(){clearInterval(e)}),1e4);return[2]}))}))};e.prototype.setToFinishStep=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){d.step="finish";this.storybookPaymentStatusOverride=e;return[2]}))}))};e.prototype.mockCheckoutSession=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(o){b(e);return[2]}))}))};e.prototype.triggerCheckoutInternational=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(this,(function(o){e=document.querySelector("#".concat(ve));if(e){e.dispatchEvent(we("click"))}return[2]}))}))};e.prototype.handleCustomerInfoContinue=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,a;var u=this;return __generator(this,(function(l){switch(l.label){case 0:be({event:"zonos-checkout-customer-info",metadata:{checkoutSessionId:G.checkoutSessionId}});r=G.checkoutSessionId;void w({checkoutSessionId:r,eventName:"checkout_customerInfoCompleted"});this.submitLoading=true;return[4,_()];case 1:i=l.sent().isRequestNotReady;if(i&&d.addressFormRenderType==="stripe"){void ie({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:(o=(e=c.stripeAddressEventData)===null||e===void 0?void 0:e.value)===null||o===void 0?void 0:o.address,billingAddress:(n=(t=c.stripeBillingAddressEventData)===null||t===void 0?void 0:t.value)===null||n===void 0?void 0:n.address,cartId:window.Zonos.cartId}})}s=function(e){if(d.step!=="customer-info"){clearInterval(e);return}if(!c.isFetchingLandedCost){if(d.landedCostData){void R({currency:d.currency});C()}u.submitLoading=false;if(e){clearInterval(e)}}};s();a=setInterval((function(){s(a)}),20);setTimeout((function(){clearInterval(a)}),1e4);return[2]}}))}))};e.prototype.handleShippingContinue=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){C();return[2]}))}))};e.prototype.handleInventoryCheckDialogConfirm=function(){d.inventoryCheckErrorMessage=null;if(!this.isLegacyCheckout){void this.closeDialogHandler({confirmed:true})}};e.prototype.handleCartExpiredDialogConfirm=function(){var e;this.isCartExpired=false;if(this.isLegacyCheckout){var o=(e=window.Zonos.cartData)===null||e===void 0?void 0:e.storeBaseUrl;if(!o){return}if(window.parent){window.parent.location.href=o}window.location.href=o;return}if(window.parent){window.parent.location.href=window.location.href}window.location.reload()};e.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n,r,i,s,a,u,l;return __generator(this,(function(h){switch(h.label){case 0:e=c.checkoutSettlementCurrency==="USD";if(e&&c.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;D.paypalErrorMessage=null;c.hasPaymentError=false;this.submitLoading=true;d.inventoryCheckErrorMessage=null;return[4,x()];case 1:o=h.sent();if(!o){c.hasPaymentError=true;c.customErrorMessage=W("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:c.checkoutSettlementCurrency});this.submitLoading=false;return[2]}h.label=2;case 2:h.trys.push([2,4,,5]);t=d;return[4,S()];case 3:t.inventoryCheckErrorMessage=h.sent();return[3,5];case 4:n=h.sent();d.inventoryCheckErrorMessage=W("Unable to check inventory. Please try again.");return[3,5];case 5:if(d.inventoryCheckErrorMessage){this.submitLoading=false;return[2]}r=L();if(!(r>0))return[3,7];return[4,T()];case 6:i=h.sent();if(!i.success){c.hasPaymentError=true;c.customErrorMessage=i.error||W("Unable to apply store credit. Please try again.");this.submitLoading=false;return[2]}h.label=7;case 7:if(!I())return[3,13];h.label=8;case 8:h.trys.push([8,11,,12]);return[4,A()];case 9:s=h.sent();if(!s.valid){c.hasPaymentError=true;c.customErrorMessage=s.errorMessage;this.submitLoading=false;return[2]}return[4,O()];case 10:a=h.sent();if(!a.success){c.hasPaymentError=true;c.customErrorMessage=a.error||W("Unable to place order with store credit. Please try again.");this.submitLoading=false;return[2]}C();v();return[3,12];case 11:u=h.sent();te(u);be({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:G.checkoutSessionId}});c.hasPaymentError=true;return[3,12];case 12:this.submitLoading=false;return[2];case 13:h.trys.push([13,15,,16]);return[4,E()];case 14:h.sent();C();v();return[3,16];case 15:l=h.sent();te(l);be({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:G.checkoutSessionId}});c.hasPaymentError=true;if(c.shouldInventoryRefund){void P();c.shouldInventoryRefund=false}return[3,16];case 16:this.submitLoading=false;return[2]}}))}))};e.prototype.handleFinishClick=function(){return __awaiter(this,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:N();if(!this.preview)return[3,2];d.step="customer-info";return[4,this.init()];case 1:r.sent();return[2];case 2:h();if(window.Zonos.isLegacyCheckout&&window.Zonos.cartData){e=window.Zonos.cartData.storeBaseUrl||Q.onlineStoreSettings.url;if(window.parent){window.parent.location.href=e}window.location.href=e;return[2]}o=window.location.href;t=o.split("?")[0];this.open=false;n=window.location.hostname.includes("dashboard.zonos.com");if(!n){window.history.replaceState(window.history.state,document.title,t);window.location.reload()}return[2]}}))}))};e.prototype.handleWindowResize=function(){this.isMobile=ce(this.mobile);void this.applyStripeTheme();ue("mobile: ".concat(this.isMobile))};e.prototype.handleMobileChange=function(){this.isMobile=ce(this.mobile);void this.applyStripeTheme();ue("mobile: ".concat(this.isMobile))};e.prototype.handleAppearanceSettingsOverrideChange=function(){var e;if((e=this.appearanceSettingsOverride)===null||e===void 0?void 0:e.theme){this.appearanceSettingsOverride.theme=J(this.appearanceSettingsOverride.theme)}};e.prototype.handleAddressChange=function(){N()};e.prototype.handleCustomerProfileChange=function(){var e,o;if(!this.customerProfile){ue("No customer profile","info");this.defaultCustomerProfileAddress=[];return}ue("Customer profile found","info",{customerProfile:this.customerProfile});this.defaultCustomerProfileAddress=((o=(e=c.customerProfile)===null||e===void 0?void 0:e.locations)===null||o===void 0?void 0:o.map((function(e){var o;return{address:{city:e.locality,country:e.countryCode,line1:e.line1,line2:e.line2||"",postal_code:e.postalCode,state:e.administrativeArea},email:e.email||((o=c.customerProfile)===null||o===void 0?void 0:o.email)||"",name:e.name||"",phone:e.phone||""}})))||[]};e.prototype.handleClientSecretChange=function(){ue("==== Client secret changed","info",{clientSecret:this.clientSecret,stripeCustomerSessionClientSecret:this.stripeCustomerSessionClientSecret});void this.applyStripeTheme()};e.prototype.handleOpenChange=function(){var e="data-zonos-overflow-origin";var o=document.body;var t=document.documentElement;if(this.open){window.Zonos.openHelloDialog(false);if(o.style.overflow){o.setAttribute(e,o.style.overflow)}o.style.overflow="hidden";if(t.style.overflow){t.setAttribute(e,t.style.overflow)}t.style.overflow="hidden"}else{this.stripeCustomerSessionClientSecret=null;var n=o.getAttribute(e);var r=t.getAttribute(e);if(n){o.removeAttribute(e);o.style.overflow=n}else{o.style.removeProperty("overflow")}if(r){t.removeAttribute(e);t.style.overflow=r}else{t.style.removeProperty("overflow")}}};e.prototype.componentWillLoad=function(){var e=this;void this.init();this.isMobile=ce(this.mobile);this.isIframed=window.self!==window.top;ue("iframed: ".concat(this.isIframed));if(window.Zonos.isLegacyCheckout){this.captureParamsRedirectedForVariantTest()}this.handleAppearanceSettingsOverrideChange();this.storeUnsubscribeList=[Y("selectedLocale",(function(){void e.applyStripeTheme()})),B("selectedShippingOption",(function(){var o,t,n,r;var i=d.selectedShippingOption;if(((o=Q.genericSettings)===null||o===void 0?void 0:o.shouldFedExShippingConsentForCanadianShopper)&&((n=(t=i===null||i===void 0?void 0:i.shippingProfile)===null||t===void 0?void 0:t.serviceLevel.code)===null||n===void 0?void 0:n.toLowerCase().startsWith("fedex."))&&((r=c.stripeAddressEventData)===null||r===void 0?void 0:r.value.address.country)==="CA"){e.shouldShowFedexShippingConsentDialog=true}})),j("stripeAddressEventData",(function(o){var t;if(!window.Zonos.isBigCommerce||!o||e.redirectToDomesticCheckoutDialogOpen||!((t=Q.genericSettings)===null||t===void 0?void 0:t.isBigcommerceDomesticCheckoutRedirectEnabled)||Q.sourceCurrency!=="USD"){return}if(!e.open){return}if(window.location.pathname.includes("/checkout")){return}var n=o.value.address.country;if(n&&Q.disabledCountries.includes(n)){e.redirectToDomesticCheckoutDialogOpen=true;ue("Domestic country ".concat(n," selected in international checkout, redirecting to BigCommerce domestic checkout"),"info");setTimeout((function(){window.location.href=Ie("/checkout")}),2e3)}}))];this.initializeTestKeys();window.addEventListener("message",this.handleHostedOpenWindowCallback);ue("mobile: ".concat(this.isMobile))};e.prototype.disconnectedCallback=function(){N();h();this.storeUnsubscribeList.forEach((function(e){return e()}));window.removeEventListener("message",this.handleHostedOpenWindowCallback)};e.prototype.render=function(){var e=this;var o,i,s,a;this.customerProfile=c.customerProfile;this.clientSecret=c.clientSecret;if(c.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret}var u=d.step!=="finish"&&d.step!=="error"&&!c.stripeElements||c.isFetchingSession;var l=X(Q.appearance,this.appearanceSettingsOverride||null),h=l.colorPrimary,f=l.colorSecondary,v=l.logoUrl,m=l.style;var p=Q.appearance.zonosAttribution==="ENABLED";var g=Q.appearance.theme;var w=h&&ke(h)?"DARK":"LIGHT";var z=this.isMobile?g:w;var k=!this.isMobile?f:undefined;var y=M.customMessages;var b=(o=y.find((function(e){return e.pageName==="checkout_default"})))===null||o===void 0?void 0:o.message;var _=this.getCurrentLocalePageEnum();var C=y.filter((function(e){return e.pageName===_}));var x=this.getBaseCurrencySettlementInfo();var S=function(){var o=e.preview?"".concat(v,"?timestamp=").concat(Date.now()):v;return t("div",{class:"zonos--logo"},o&&t("img",{alt:"".concat(Q.organizationName," logo"),src:o}))};var T=oe();var I=function(){var o=new URLSearchParams(window.location.search);var n=o.get("zonosQaUrl");var r=o.get("zonosDebug");var i=o.get("zonosE2ETest");var s=e.overrideStagingMode||se();return t("zonos-v-stack",null,t("div",{class:"zonos--logo-wrapper"},S(),T&&t("zonos-badge",{badgeColor:"orange",size:"small"},W("Test mode")),s&&t("zonos-badge",{badgeColor:"red",size:"small"},W("Staging mode")),r==="1"&&t("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),n&&t("zonos-badge",{badgeColor:"purple",size:"small"},n),i&&t("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),t("zonos-checkout-progress-tabs",{backgroundColor:e.isMobile?"--zonos-elements-gray-0":null}),C.map((function(e){return t("zonos-custom-message",{icon:$e,message:e.message})})))};var A=function(){if(d.checkoutSessionTimeoutShow){return t("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:W("Your checkout session has expired. Please reload the page to continue."),restStateTitle:W("Session timed out"),restStateType:"Warning"},t("zonos-button",{onClick:function(){return e.reloadCheckoutSession()},variant:"primary"},W("Reload")))}return t("div",{class:"zonos--content",style:{"--zonos--border-radius":ze({overrideBorderStyle:m})}},d.step!=="finish"&&d.step!=="error"&&t(n,null,t("div",{class:"zonos--left","data-theme":z,style:ye({"--zonos--primary-color":!e.isMobile?h:undefined})},!e.isMobile&&I(),d.step==="customer-info"&&t("zonos-customer-info",{continueLoading:e.submitLoading,defaultAddress:e.getDefaultAddress(),isMobile:e.isMobile,onContinueClicked:function(){return e.handleCustomerInfoContinue()},submitBtnColor:k}),d.step==="shipping"&&t("zonos-shipping",{continueLoading:e.submitLoading,isMobile:e.isMobile,onContinueClicked:function(){return e.handleShippingContinue()},submitBtnColor:k}),d.step==="payment"&&t("zonos-checkout-payment",{continueLoading:e.submitLoading,isMobile:e.isMobile,onContinueClicked:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4,this.handleStripePaymentContinue()];case 1:e.sent();return[2]}}))}))},submitBtnColor:k})),t("div",{class:"zonos--right","data-theme":g},e.isMobile&&I(),t("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&t("zonos-currency-toggle",null),!e.isLegacyCheckout&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:_e}),noBackground:true,onClick:function(){return e.closeDialogHandler()}})),t("div",{class:"flex--wrapper"},t("div",{class:"zonos--wrapper"},t("zonos-review",{collapsed:e.collapseReviewMobile,mobile:e.isMobile,onClick:function(){if(!e.isMobile){return}e.collapseReviewMobile=!e.collapseReviewMobile}}),t("zonos-collapse",{collapsed:e.collapseReviewMobile&&e.isMobile},t("zonos-cart-items",null),e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",{submitBtnColor:k}),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:$e,message:b})))),t("zonos-cart-restricted-items",null),!e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",null),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:$e,message:b}))))),(d.step==="finish"||d.step==="error")&&t("div",{class:"zonos--done","data-theme":g},t("div",{class:"zonos--header"},S(),!e.isRedirectAfterOrder&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:_e}),noBackground:true,onClick:function(){return e.handleFinishClick()},theme:g})),t("zonos-checkout-finish",{borderRadius:m,onCloseClick:function(){return e.handleFinishClick()},overrideNotification:d.step==="error"&&!!d.error?Object.assign(Object.assign({},d.error),{type:"error"}):undefined,storybookForceStatus:e.storybookPaymentStatusOverride})),t("zonos-checkout-footer",{"data-theme":g,mobile:e.isMobile,slot:!e.isMobile?"dialog-footer":undefined}))};return t(r,{class:ge(["zonos--checkout zonos--elements",d.step==="payment"&&"zonos--processing-payment",p&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?A():t("zonos-dialog",{borderStyle:m,class:"zonos--checkout-dialog","data-theme":g,height:"980px",isLoading:u,mobile:this.isMobile,noBodyPadding:true,noBorder:true,noClickOutside:true,noCloseButton:true,onCloseDialog:function(){return e.closeDialogHandler()},open:this.open,width:"1200px"},A()),t("zonos-dialog",{isLoading:true,loadingText:W("You will be redirected to international checkout shortly."),loadingTitle:W("We detected that you are shipping to an international address."),noClickOutside:true,noCloseButton:true,open:this.detectedDomesticCheckoutDialogOpen,width:"450px"}),t("zonos-dialog",{isLoading:true,loadingText:W("You will be redirected to domestic checkout shortly."),loadingTitle:W("We detected that you are shipping to a domestic address."),noClickOutside:true,noCloseButton:true,open:this.redirectToDomesticCheckoutDialogOpen,width:"450px"}),t("zonos-confirm-dialog",{class:"zonos--logged-in-intl-address-dialog",dialogCancelBtnText:W("Stay on this page"),dialogConfirmBtnText:W("Continue to international checkout"),dialogIntent:"info",dialogOpen:this.loggedInIntlAddressConfirmDialogOpen,dialogSubtitle:W("Your saved default address ships internationally. Would you like to continue to international checkout, or stay here and select a domestic address?"),dialogTitle:W("International shipping address detected"),dialogWidth:480,onCancelClicked:function(){var o;e.loggedInIntlAddressConfirmDialogOpen=false;(o=e.loggedInIntlAddressResolver)===null||o===void 0?void 0:o.call(e,"stay");e.loggedInIntlAddressResolver=null},onConfirmClicked:function(){var o;e.loggedInIntlAddressConfirmDialogOpen=false;(o=e.loggedInIntlAddressResolver)===null||o===void 0?void 0:o.call(e,"redirect");e.loggedInIntlAddressResolver=null}}),t("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:W("Don't close"),dialogConfirmBtnText:W("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:W("Would you like to close checkout and return to the site?"),dialogTitle:W("Are you sure?"),onCancelClicked:function(){e.confirmDialogOpen=false},onConfirmClicked:function(){return e.closeDialogHandler({confirmed:true})}}),t("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:W("Return to merchant site"),dialogConfirmBtnText:W("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:((i=this.placedOrderInfo)===null||i===void 0?void 0:i.zonosOrderNumber)?W("It looks like you placed an order recently ([date] at [time]) under order number #[orderNumber]. Check your email for the order confirmation. Are you sure you want to place another order?",{date:this.formatDate(this.placedOrderInfo.time),orderNumber:this.placedOrderInfo.zonosOrderNumber,time:this.formatTime(this.placedOrderInfo.time)}):W("It looks like you placed an order recently ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?",{date:this.formatDate(((s=this.placedOrderInfo)===null||s===void 0?void 0:s.time)||null),time:this.formatTime(((a=this.placedOrderInfo)===null||a===void 0?void 0:a.time)||null)}),dialogTitle:W("Are you sure?"),dialogWidth:530,onCancelClicked:function(){e.handleCancelOrderDuplication()},onConfirmClicked:function(){e.confirmProceedWithOrderDuplication()}}),t("zonos-confirm-dialog",{class:"zonos--fedex-shipping-dialog",dialogConfirmBtnText:W("Confirm"),dialogIntent:"info",dialogOpen:!!this.shouldShowFedexShippingConsentDialog,dialogSubtitle:t(n,null,W("If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request."),t("zonos-link",{href:"https://ftn.fedex.com/us/assets/docs/One-Time_GAA.pdf",target:"_blank"},W("View GAA Form."))),dialogTitle:W("Fedex Shipping Procedure"),dialogType:"alert",dialogWidth:500,onConfirmClicked:function(){return e.shouldShowFedexShippingConsentDialog=false}}),t("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:W("Return to cart"),dialogIntent:"danger",dialogOpen:!!d.inventoryCheckErrorMessage,dialogSubtitle:d.inventoryCheckErrorMessage,dialogTitle:W("Couldn't place order"),dialogType:"alert",onConfirmClicked:function(){return e.handleInventoryCheckDialogConfirm()}}),x&&t("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:W("Cancel"),dialogConfirmBtnText:W("Pay [orderTotal]",{orderTotal:q({amount:x.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:W("By paying in USD, your card will be charged directly with no currency conversion. However, using a non-USD based card may result in additional currency conversion fees at the bank level."),dialogTitle:W("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){e.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return e.handleStripePaymentContinue()}}),t("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:W("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:W("You are being sent back to the shop to re-add items to your cart."),dialogTitle:W("Shopping cart expired"),dialogType:"alert",onConfirmClicked:function(){return e.handleCartExpiredDialogConfirm()}}),t("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],overrideStagingMode:["overrideStagingModeChanged"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"],customerProfile:["handleCustomerProfileChange"],clientSecret:["handleClientSecretChange"],stripeCustomerSessionClientSecret:["handleClientSecretChange"],open:["handleOpenChange"]}},enumerable:false,configurable:true});return e}());ro.style=oo}}}));
@@ -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-cf69bcc4.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-3fbd9cc0.system.js","./p-e2adf04b.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 +1 @@
1
- import{r as o,e as t,h as s,a as e}from"./p-ce75b047.js";import{d as a}from"./p-620ba943.js";import{c as n}from"./p-9581bffb.js";import{f as i}from"./p-058f6124.js";import{c as r}from"./p-b4b7f705.js";import{s as h}from"./p-96d77739.js";import"./p-13041752.js";import"./p-41dd1cb8.js";import"./p-0a377722.js";import"./p-67897a0d.js";import"./p-f830f800.js";const l=class{constructor(t){o(this,t),this.errorImages=[]}render(){const o=t("./assets/empty-item.jpeg"),i=a.items.filter((o=>!o.isRestricted));return s(e,{key:"2f5507537492851b67a5204ab68ce2f938899f23",class:"zonos--collect-cart-items zonos--elements"},s("table",{key:"e648cda9d4c111ecde60291f420178e4e4230b50",class:"zonos--cart-table"},s("tbody",{key:"b266291e61d0df5c0ea3ae8240a3bfb6147edbb4"},i.map((t=>{const e=t.imageUrl,a=n(t.name);return s("tr",{class:"zonos--collect-cart-item"},s("td",{class:"zonos--column zonos--cart-item-image"},e&&!this.errorImages.includes(e)?s("img",{alt:t.name,onError:()=>{this.errorImages=[...this.errorImages,e]},src:t.imageUrl,style:{"min-width":"40px"},width:40}):s("img",{alt:t.name,src:o,width:40})),s("td",{class:"zonos--column zonos--cart-item-name"},s("div",null,a.map((o=>s("zonos-text",{type:"semiBoldLabel"},o))))))})))))}static get assetsDirs(){return["assets"]}};l.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column{padding:8px;padding-left:0;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column:first-child{width:48px}:host .zonos--cart-table td{vertical-align:middle}:host .zonos--cart-item-price zonos-text{white-space:nowrap}:host img{min-width:40px;margin-top:6px;-webkit-box-shadow:0 0 0 1px rgba(110, 110, 120, 0.1), 0 1px 2px 0 rgba(10, 10, 11, 0.06), 0 1px 3px 0 rgba(10, 10, 11, 0.1);box-shadow:0 0 0 1px rgba(110, 110, 120, 0.1), 0 1px 2px 0 rgba(10, 10, 11, 0.06), 0 1px 3px 0 rgba(10, 10, 11, 0.1);border-radius:10px}";const c=class{constructor(t){o(this,t),this.spacing=24}render(){return s(e,{key:"443aa77bfbf4c0c84c33d0ef7652caec001968c3",style:{"--spacing":`${this.spacing}px`,"--zonos--font-family":i()}},s("slot",{key:"3366df34b9f0f3549e556cff1e47878c2f6cd124"}))}};c.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:row;flex-direction:row;gap:var(--spacing, 24px)}";const m=class{constructor(t){o(this,t),this.skeletonWidth="100%",this.skeletonHeight="14px"}render(){return s(e,{key:"096e505180d901c1523567f89cdbcca7869a0895",class:r(["zonos--elements zonos--skeleton"]),style:h({"--zonos--skeleton-height":this.skeletonHeight,"--zonos--skeleton-width":this.skeletonWidth})})}};m.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:inline-block;background:var(--zonos-elements-gray-200);border-radius:var(--zonos-elements-radius-12);width:var(--zonos--skeleton-width);height:var(--zonos--skeleton-height);min-height:var(--zonos--skeleton-height);max-width:100%}";export{l as zonos_collect_cart_items,c as zonos_h_stack,m as zonos_skeleton}
1
+ import{r as o,e as t,h as s,a as e}from"./p-ce75b047.js";import{d as a}from"./p-3fae811a.js";import{c as n}from"./p-9581bffb.js";import{f as i}from"./p-058f6124.js";import{c as r}from"./p-b4b7f705.js";import{s as h}from"./p-96d77739.js";import"./p-99e1734a.js";import"./p-41dd1cb8.js";import"./p-0a377722.js";import"./p-67897a0d.js";import"./p-f830f800.js";const l=class{constructor(t){o(this,t),this.errorImages=[]}render(){const o=t("./assets/empty-item.jpeg"),i=a.items.filter((o=>!o.isRestricted));return s(e,{key:"2f5507537492851b67a5204ab68ce2f938899f23",class:"zonos--collect-cart-items zonos--elements"},s("table",{key:"e648cda9d4c111ecde60291f420178e4e4230b50",class:"zonos--cart-table"},s("tbody",{key:"b266291e61d0df5c0ea3ae8240a3bfb6147edbb4"},i.map((t=>{const e=t.imageUrl,a=n(t.name);return s("tr",{class:"zonos--collect-cart-item"},s("td",{class:"zonos--column zonos--cart-item-image"},e&&!this.errorImages.includes(e)?s("img",{alt:t.name,onError:()=>{this.errorImages=[...this.errorImages,e]},src:t.imageUrl,style:{"min-width":"40px"},width:40}):s("img",{alt:t.name,src:o,width:40})),s("td",{class:"zonos--column zonos--cart-item-name"},s("div",null,a.map((o=>s("zonos-text",{type:"semiBoldLabel"},o))))))})))))}static get assetsDirs(){return["assets"]}};l.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column{padding:8px;padding-left:0;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column:first-child{width:48px}:host .zonos--cart-table td{vertical-align:middle}:host .zonos--cart-item-price zonos-text{white-space:nowrap}:host img{min-width:40px;margin-top:6px;-webkit-box-shadow:0 0 0 1px rgba(110, 110, 120, 0.1), 0 1px 2px 0 rgba(10, 10, 11, 0.06), 0 1px 3px 0 rgba(10, 10, 11, 0.1);box-shadow:0 0 0 1px rgba(110, 110, 120, 0.1), 0 1px 2px 0 rgba(10, 10, 11, 0.06), 0 1px 3px 0 rgba(10, 10, 11, 0.1);border-radius:10px}";const c=class{constructor(t){o(this,t),this.spacing=24}render(){return s(e,{key:"443aa77bfbf4c0c84c33d0ef7652caec001968c3",style:{"--spacing":`${this.spacing}px`,"--zonos--font-family":i()}},s("slot",{key:"3366df34b9f0f3549e556cff1e47878c2f6cd124"}))}};c.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:row;flex-direction:row;gap:var(--spacing, 24px)}";const m=class{constructor(t){o(this,t),this.skeletonWidth="100%",this.skeletonHeight="14px"}render(){return s(e,{key:"096e505180d901c1523567f89cdbcca7869a0895",class:r(["zonos--elements zonos--skeleton"]),style:h({"--zonos--skeleton-height":this.skeletonHeight,"--zonos--skeleton-width":this.skeletonWidth})})}};m.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:inline-block;background:var(--zonos-elements-gray-200);border-radius:var(--zonos-elements-radius-12);width:var(--zonos--skeleton-width);height:var(--zonos--skeleton-height);min-height:var(--zonos--skeleton-height);max-width:100%}";export{l as zonos_collect_cart_items,c as zonos_h_stack,m as zonos_skeleton}
@@ -1 +1 @@
1
- import{r as s,d as t,h as o,a as e,g as i}from"./p-ce75b047.js";import{t as n}from"./p-7d7ffb42.js";import{b as a,t as r,Q as l,E as d,q as c,d as h}from"./p-620ba943.js";import{s as p,r as u,t as m,q as f,l as z}from"./p-13041752.js";import{z as b,g,f as y}from"./p-058f6124.js";import{l as v,i as k,s as x}from"./p-41dd1cb8.js";import{a as w,s as C}from"./p-63a383f4.js";import{c as I}from"./p-b4b7f705.js";import{l as A}from"./p-0a377722.js";import{c as E,s as j}from"./p-6b361d2b.js";import{g as S}from"./p-f830f800.js";import"./p-908f13ae.js";import"./p-67897a0d.js";import"./p-1d42cd20.js";const D=class{constructor(o){s(this,o),this.invalidCharacters=t(this,"invalidCharacters",7),this.taxIdChanged=t(this,"taxIdChanged",7),this.storeUnsubscribeList=[],this.isAutoCompleteAdjusted=!1,this.defaultAddress=[],this.taxIdErrorMessage="",this.shortAddressCodeErrorMessage="",this.stripe=window.Zonos.stripe,this.isDirtyAddress=!1,this.isAddressFilled=!1,this.checkoutSessionId=p.checkoutSessionId,this.prevCountry=null,this.prevPostalCode=null,this.trackingSent=!1,this.prefetchLandedCost=n(c,1e3)}getStripeAddressInstance(){return"billing"===this.type?{stripeAddressElement:a.stripeBillingAddressElement,stripeAddressEventData:a.stripeBillingAddressEventData,stripeElements:a.stripeElementsForBillingAddress}:{stripeAddressElement:a.stripeAddressElement,stripeAddressEventData:a.stripeAddressEventData,stripeElements:a.stripeElements}}updateAddressEventData({event:s,type:t}){"billing"===t?a.stripeBillingAddressEventData=s:a.stripeAddressEventData=s,"shipping"===t&&s.value.address.line1.length&&this.prefetchLandedCost()}isAddressFilledChanged(){p.checkoutSessionId&&this.isAddressFilled&&!this.trackingSent&&"shipping"===this.type&&(this.trackingSent=!0,r({checkoutSessionId:p.checkoutSessionId,eventName:"checkout_customerInfoFilled"}))}updateAddressElement({stripeAddressElement:s,type:t}){"shipping"!==t?a.stripeBillingAddressElement=s:a.stripeAddressElement=s}async watchInitStripe(){this.stripe=window.Zonos.stripe;const{stripeAddressEventData:s,stripeElements:t}=this.getStripeAddressInstance();if(!this.stripe||!t)return void v("Stripe is not initialized. Couldn't load stripe element.");const o=this.defaultAddress.map((s=>Object.assign(Object.assign({},s),{name:s.name,phone:s.phone||void 0}))),e=z.shippingZoneCountries,i=e?Object.values(e).map((s=>s.code)):[],n=new URLSearchParams(window.location.search).has("zonosCheckoutAllCountries"),a="shipping"===this.type?i:[],r=(null==s?void 0:s.value.address.country)||u(a);A(`Stripe country code: ${r}`,"info");const d=t.create("address",{allowedCountries:n?[]:a,contacts:o.length&&!s?this.defaultAddress:[],defaultValues:{address:Object.assign(Object.assign({},null==s?void 0:s.value.address),{country:r}),firstName:null==s?void 0:s.value.firstName,lastName:null==s?void 0:s.value.lastName,phone:null==s?void 0:s.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});d.mount(this.el.querySelector(".zonos--address-component")),(null==s?void 0:s.value.address)&&(this.prevCountry=s.value.address.country,this.prevPostalCode=s.value.address.postal_code),d.on("change",(s=>{const t=s.value;if(!this.isDirtyAddress&&t.address.line1.length>=3){if(this.isDirtyAddress=!0,!this.isAutoCompleteAdjusted){const s=this.el.querySelector('iframe[src*="autocomplete-suggestions"]');s&&(s.style.zIndex="3"),this.isAutoCompleteAdjusted=!0}setTimeout((()=>{if(k())this.el.scrollIntoView({behavior:"smooth",block:"end"});else{const s="shipping"===this.type?100:600,t=this.el.closest(".zonos--group"),o=this.el.getBoundingClientRect().top+s;null==t||t.scrollTo({behavior:"smooth",top:o})}}),600)}const{firstName:o,lastName:e}=l({firstName:t.firstName,lastName:t.lastName,name:t.name});this.updateAddressEventData({event:Object.assign(Object.assign({},s),{elementMode:this.type,elementType:"address",value:Object.assign(Object.assign({},t),{firstName:o,lastName:e})}),type:this.type})})),this.updateAddressElement({stripeAddressElement:d,type:this.type})}defaultAddressChanged(s,t){if(JSON.stringify(t)===JSON.stringify(s))return;A("Reset address element when default address property is changed","info",{defaultAddress:this.defaultAddress});const o=this.getStripeAddressInstance().stripeAddressElement;null==o||o.clear(),null==o||o.destroy(),"shipping"===this.type?a.stripeAddressEventData=null:a.stripeBillingAddressEventData=null,this.watchInitStripe()}isInTaxIdCountry(s){return E.includes(s)}renderTaxIdInput(){var s;if("billing"===this.type)return null;const t=null===(s=a.stripeAddressEventData)||void 0===s?void 0:s.value.address.country;if(!t)return null;if(!this.isInTaxIdCountry(t))return null;if(!w({companyName:a.companyName,countryCode:t}))return null;const e=j[t];return o("div",{class:"zonos--tax-id-input"},o("zonos-stripe-input",{inputLabel:m(e.friendlyName),inputPlaceholder:e.placeholder,inputValue:a.taxId||"",isError:!!this.taxIdErrorMessage,onInputChange:s=>{a.taxId=s.detail,this.taxIdChanged.emit(s.detail)}}),this.taxIdErrorMessage&&o("zonos-text",{textColor:"red-600",type:"caption"},this.taxIdErrorMessage))}renderShortAddressCodeInput(){var s;if("billing"===this.type)return null;const t=null===(s=a.stripeAddressEventData)||void 0===s?void 0:s.value.address.country;return t&&C({countryCode:t})?o("div",{class:"zonos--short-address-code-input"},o("zonos-stripe-input",{inputLabel:m("Short address code"),inputPlaceholder:"RRRD2929",inputValue:a.shortAddressCode||"",isError:!!this.shortAddressCodeErrorMessage,onInputChange:s=>{a.shortAddressCode=s.detail}}),this.shortAddressCodeErrorMessage&&o("zonos-text",{textColor:"red-600",type:"caption"},this.shortAddressCodeErrorMessage)):null}renderCompanyNameInput(){return("billing"!==this.type||window.Zonos.isCollect||window.Zonos.isInvoice)&&("ENABLED"===b.checkoutSettings.companyFieldsStatus||window.Zonos.isCollect||window.Zonos.isInvoice)?o("zonos-stripe-input",{class:"zonos--company-name-input",inputLabel:m("Company name (optional)"),inputValue:a.companyName,onInputChange:s=>{a.companyName=s.detail}}):null}disconnectedCallback(){const s=this.getStripeAddressInstance().stripeAddressElement;null==s||s.destroy();try{this.storeUnsubscribeList.forEach((s=>s()))}catch(s){}}componentDidLoad(){const s=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!s&&s.value.address.line1.length>0,this.watchInitStripe(),this.checkoutSessionId=p.checkoutSessionId,this.storeUnsubscribeList=[f("checkoutSessionId",(()=>{this.checkoutSessionId=p.checkoutSessionId})),d("stripeElements",(()=>{"shipping"===this.type&&this.watchInitStripe()})),d("stripeElementsForBillingAddress",(()=>{"billing"===this.type&&this.watchInitStripe()}))]}render(){var s;return this.checkoutSessionId=p.checkoutSessionId,(null===(s=a.stripeAddressEventData)||void 0===s?void 0:s.complete)&&(this.isAddressFilled=!0),o(e,{key:"5dc571d7c5e706ae9cb90de70deee22847e5ba7e",class:I(["zonos--address","zonos--elements",`zonos--${this.type}-address`])},this.titleText&&o("zonos-text",{key:"a7c9f730bc9b64aa2c6e8cc24701e638481eac19",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("slot",{key:"3078529c201c7947ffc833485d46184bc79ab1d1",name:"below-title"}),this.renderCompanyNameInput(),this.renderTaxIdInput(),this.renderShortAddressCodeInput(),o("div",{key:"b4a9850ac30ad9c483e05743ff41b7de9756d826",class:"zonos--address-component"}))}get el(){return i(this)}static get watchers(){return{checkoutSessionId:["isAddressFilledChanged"],isAddressFilled:["isAddressFilledChanged"],stripe:["watchInitStripe"],defaultAddress:["defaultAddressChanged"]}}};D.style=".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h .zonos--company-name-input.sc-zonos-address,.sc-zonos-address-h .zonos--tax-id-input.sc-zonos-address,.sc-zonos-address-h .zonos--short-address-code-input.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";const L=class{constructor(o){s(this,o),this.confirmClicked=t(this,"confirmClicked",7),this.cancelClicked=t(this,"cancelClicked",7),this.dialogTitle=m("Are you sure?"),this.dialogIntent="info",this.dialogSubtitle=null,this.dialogWidth=350,this.dialogType="confirm",this.isMobile=!1,this.noClickOutside=!1,this.clickOutsideDialogHandler=s=>{s.target!==s.currentTarget||this.noClickOutside||this.closeDialogHandler()}}handleKeyDown(s){"Escape"===s.key&&this.closeDialogHandler()}focusDialog(){this.dialogOpen&&setTimeout((()=>{var s,t;null===(t=null===(s=this.el.shadowRoot)||void 0===s?void 0:s.querySelector(".zonos--backdrop"))||void 0===t||t.focus()}),100)}confirmDialogHandler(){this.dialogOpen&&this.confirmClicked.emit()}closeDialogHandler(){this.dialogOpen&&this.cancelClicked.emit()}renderIcon(){switch(this.dialogIntent){case"info":return o("zonos-icon",{content:'<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-400)"></path>\n <path d="M10.25 10.25a1.75 1.75 0 1 1 2.431 1.613c-.616.26-1.431.885-1.431 1.887a.75.75 0 0 0 1.5 0c0-.053.02-.128.108-.228.092-.104.236-.205.408-.278A3.25 3.25 0 1 0 8.75 10.25a.75.75 0 0 0 1.5 0Zm2.5 5.75a.75.75 0 0 0-1.5 0v.25a.75.75 0 0 0 1.5 0V16Z" fill="currentColor"></path>\n</svg>',iconColor:"blue-800"});case"danger":return o("zonos-icon",{content:'<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-400)"></path>\n <path d="M12.75 9a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V9Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>',iconColor:"red-800"});case"warn":return o("zonos-icon",{content:'<svg color="var(--zonos-elements-orange-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M14.46 5.492c-1.014-2.027-3.906-2.027-4.92 0L4.276 16.02c-.914 1.83.416 3.98 2.46 3.98h10.528c2.044 0 3.374-2.151 2.46-3.98L14.46 5.492Z" data-is-secondary-color="true" fill="var(--zonos-elements-orange-400)"></path>\n <path d="M12.75 10a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V10Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>',iconColor:"orange-800"})}}getButtonConfirmVariant(){switch(this.dialogIntent){case"warn":return"warning";case"danger":return"danger";default:return"primary"}}render(){this.focusDialog();const s=S(),t=g(b.appearance.theme);return o(e,{key:"db0bfe0b8a125e806a97c9382faa938078000349",class:I([this.dialogOpen&&"open","zonos--elements"]),"data-dialog-type":this.dialogType,"data-theme":t,style:{"--zonos--border-radius":s,"--zonos--dialog-width":`${this.dialogWidth}px`,"--zonos--font-family":y()}},o("div",{key:"1676defad54705df4e9282bda6b5734592d0fb60",class:"zonos--backdrop",tabIndex:-1}),o("div",{key:"2a6ec6b5df7ea30304cfed5276e55618b40add93",class:I(["zonos--confirm-layout",this.dialogIntent]),onClick:s=>this.clickOutsideDialogHandler(s)},o("div",{key:"d1c8358c3fd98c27a469fe7443d1983c1c134a7c",class:"zonos--confirm-dialog",onBlur:()=>{this.focusDialog()}},o("div",{key:"137e9659aa7aec2e4604acf80809b35bce69ca79",class:"wrapper"},o("div",{key:"9c1057857ea095e7e88c8950469add2bc4c1318e",class:"icon-wrapper"},this.renderIcon()),o("div",{key:"48f0e0cd9ce62b425bae831d1387261bbd4162a1",class:"content"},o("div",{key:"0d3e681f350e5db547181beadf5c6bcf49a8bbd2",class:"title"},o("zonos-text",{key:"f16a43d2b3c9504911b1e36ba573873f80093c47",type:"subheader"},this.dialogTitle)),this.dialogSubtitle&&o("div",{key:"fd570f98bc736a68c16fedee72b1417dc6906fa6",class:"subtitle"},o("zonos-text",{key:"6785aa19dd44cf7f6fae7317e3924be6c6ee8af3",textColor:"gray-800"},this.dialogSubtitle))),o("div",{key:"4206cad3dcff0055fc5f3ea8e7c217ae33c63263",class:"footer"},"confirm"===this.dialogType&&o("zonos-button",{key:"72d1a216641d482bdbeae384963dcdff1cfc3f45",backgroundColor:"gray-0",class:"cancel-button",onClick:()=>this.closeDialogHandler(),size:"lg",withBoxShadow:!0},this.dialogCancelBtnText||m("Cancel")),o("zonos-button",{key:"a6a206eff11d1f42c33ef9113cc393d727c60f89",class:"confirm-button",onClick:()=>this.confirmDialogHandler(),size:"lg",variant:this.getButtonConfirmVariant()},this.dialogConfirmBtnText))))))}static get assetsDirs(){return["assets"]}get el(){return i(this)}};L.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--confirm-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:opacity 0.3s, visibility 0.3s;transition:opacity 0.3s, visibility 0.3s}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--confirm-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color)}:host .zonos--confirm-dialog{position:relative;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;width:var(--zonos--dialog-width);border-radius:var(--zonos--border-radius, 10px);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;gap:24px}:host .icon-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:40px;width:40px;border-radius:50%;background:var(--zonos-elements-blue-100)}:host .warn .icon-wrapper{background:var(--zonos-elements-orange-100)}:host .danger .icon-wrapper{background:var(--zonos-elements-red-100)}:host .footer{display:-ms-flexbox;display:flex;width:100%;gap:8px}:host .footer zonos-button{-ms-flex:1;flex:1}:host .content{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .content zonos-text{text-align:center}:host(.open) .zonos--confirm-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483009;opacity:0.65}:host(.open) .zonos--confirm-layout{opacity:1;z-index:2147483010;-webkit-transform:scale(1);transform:scale(1)}";const N=s=>/^[a-zA-Z0-9.%_+-]*@[a-zA-Z0-9][a-zA-Z0-9.-]*\.[a-zA-Z0-9]{2,}$/.test(s),Z=class{constructor(o){s(this,o),this.linkAuthenticationChange=t(this,"linkAuthenticationChange",7),this.storeUnsubscribeList=[],this.defaultEmail=null,this.isEmailError=!1,this.stripe=a.stripe,this.isStagingMode=h.isStagingMode,this.clientSecret=a.clientSecret,this.retriesInitializeLink=0,this.setCustomEmailInputToLinkEvent=s=>{const t=N(s);a.stripeLinkEventData={complete:!!t,elementType:"linkAuthentication",empty:!s,value:{email:s}}},this.handleNormalEmailInput=s=>{var t;this.setCustomEmailInputToLinkEvent(s.detail),null===(t=this.linkAuthenticationChange)||void 0===t||t.emit()}}watchIsStagingMode(){setTimeout((()=>{this.watchInitStripe()}),0)}async watchInitStripe(){if(!this.stripe||!a.stripeElements)return;if(h.isStagingMode||!this.clientSecret)return;const s=this.defaultEmail?{email:this.defaultEmail}:void 0;try{const t=a.stripeLinkElement||a.stripeElements.create("linkAuthentication",{defaultValues:s}),o=this.el.querySelector(".zonos--link-authentication-component");if(!o)return void v("Cannot find container element for linkAuthenticationElement");t.mount(o),t.on("change",(s=>{var t;a.stripeLinkEventData=s,null===(t=this.linkAuthenticationChange)||void 0===t||t.emit()})),a.stripeLinkElement=t,this.retriesInitializeLink=0,this.retriesInitializeLink>11&&(A("Stripe link element initialized","info",{retriesInitializeLink:this.retriesInitializeLink,stripe:this.stripe}),x({endpoint:"stripe-link-authentication-init-long-running",errors:["Stripe link element initialized after 20 retries - 10 seconds"],metadata:{retriesInitializeLink:this.retriesInitializeLink}}))}catch(s){s instanceof Error&&(this.retriesInitializeLink++,this.retriesInitializeLink<51&&(await new Promise((s=>setTimeout(s,500))),this.watchInitStripe()),51===this.retriesInitializeLink&&x({endpoint:"stripe-link-authentication-init-error",errors:[s.message],metadata:{retriesInitializeLink:this.retriesInitializeLink}}))}}watchDefaultEmail(s,t){var o,e;A("Default email is changed","info",{newDefaultEmail:s,oldDefaultEmail:t}),t!==s&&(s||(a.stripeLinkEventData=null),h.isStagingMode?this.setCustomEmailInputToLinkEvent(s||""):(null===(o=a.stripeLinkElement)||void 0===o||o.clear(),null===(e=a.stripeLinkElement)||void 0===e||e.destroy(),a.stripeLinkElement=null,a.stripeLinkEventData=null,A("Reset stripe link element when default email is changed","info",{defaultEmail:s}),this.watchInitStripe()))}disconnectedCallback(){try{this.storeUnsubscribeList.forEach((s=>s()))}catch(s){}}componentDidLoad(){this.storeUnsubscribeList=[d("stripeElements",(async()=>{this.watchInitStripe()})),d("clientSecret",(async()=>{this.clientSecret=a.clientSecret})),d("stripe",(async()=>{this.stripe=a.stripe}))],this.watchInitStripe(),this.defaultEmail&&this.setCustomEmailInputToLinkEvent(this.defaultEmail)}render(){return this.isStagingMode=h.isStagingMode,this.clientSecret=a.clientSecret,o(e,{class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":S()}},this.titleText&&o("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),(()=>{var s;return h.isStagingMode?o("zonos-stripe-input",{inputLabel:m("Email"),inputValue:this.defaultEmail||(null===(s=a.stripeLinkEventData)||void 0===s?void 0:s.value.email)||"",isError:this.isEmailError,onBlur:()=>{var s;const t=(null===(s=a.stripeLinkEventData)||void 0===s?void 0:s.value.email)||"";if(!t)return;const o=N(t);this.isEmailError=!o},onInputChange:this.handleNormalEmailInput}):o("div",{class:`zonos--link-authentication-component ${this.isEmailError&&"zonos--input-invalid"}`})})(),this.isEmailError&&o("zonos-text",{textColor:"red-600"},m("Please enter a valid email address.")))}get el(){return i(this)}static get watchers(){return{isStagingMode:["watchIsStagingMode"],stripe:["watchInitStripe"],clientSecret:["watchInitStripe"],defaultEmail:["watchDefaultEmail"]}}};Z.style=".sc-zonos-link-authentication-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}.sc-zonos-link-authentication-h .zonos--input-invalid.sc-zonos-link-authentication{border:2px solid var(--zonos-elements-red-600);border-radius:var(--zonos--border-radius)}";const B=class{constructor(t){s(this,t),this.open=!1,this.size=40}render(){return o(e,{key:"13154a3c9250f15d8dca292f0673c6465bfb15e0",class:I(["zonos--elements",this.open&&"zonos--open"])},o("div",{key:"4470fccd21e58bd7959ef3e20c8775ac637cace0",class:"zonos--loading-overlay"},o("zonos-spinner",{key:"5b32b821cea982866da56176eeaafd5d8958f25d",size:this.size,spinnerColor:this.spinnerColor})))}};B.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:fixed;inset:0;z-index:2147483010;pointer-events:none;display:block}:host .zonos--loading-overlay{position:fixed;inset:0;width:100vw;height:100vh;background:var(--zonos-elements-backdrop-color);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;opacity:0;visibility:hidden;-webkit-transition:opacity 0.3s ease, visibility 0.3s ease;transition:opacity 0.3s ease, visibility 0.3s ease;z-index:2147483010}:host(.zonos--open){pointer-events:auto}:host(.zonos--open) .zonos--loading-overlay{opacity:0.65;visibility:visible}";export{D as zonos_address,L as zonos_confirm_dialog,Z as zonos_link_authentication,B as zonos_loading_overlay}
1
+ import{r as s,d as t,h as o,a as e,g as i}from"./p-ce75b047.js";import{t as n}from"./p-7d7ffb42.js";import{b as a,t as r,Q as l,E as d,q as c,d as h}from"./p-3fae811a.js";import{s as p,r as u,t as f,q as m,l as z}from"./p-99e1734a.js";import{z as b,g,f as y}from"./p-058f6124.js";import{l as v,i as k,s as x}from"./p-41dd1cb8.js";import{a as w,s as C}from"./p-63a383f4.js";import{c as I}from"./p-b4b7f705.js";import{l as A}from"./p-0a377722.js";import{c as E,s as j}from"./p-6b361d2b.js";import{g as S}from"./p-f830f800.js";import"./p-908f13ae.js";import"./p-67897a0d.js";import"./p-1d42cd20.js";const D=class{constructor(o){s(this,o),this.invalidCharacters=t(this,"invalidCharacters",7),this.taxIdChanged=t(this,"taxIdChanged",7),this.storeUnsubscribeList=[],this.isAutoCompleteAdjusted=!1,this.defaultAddress=[],this.taxIdErrorMessage="",this.shortAddressCodeErrorMessage="",this.stripe=window.Zonos.stripe,this.isDirtyAddress=!1,this.isAddressFilled=!1,this.checkoutSessionId=p.checkoutSessionId,this.prevCountry=null,this.prevPostalCode=null,this.trackingSent=!1,this.prefetchLandedCost=n(c,1e3)}getStripeAddressInstance(){return"billing"===this.type?{stripeAddressElement:a.stripeBillingAddressElement,stripeAddressEventData:a.stripeBillingAddressEventData,stripeElements:a.stripeElementsForBillingAddress}:{stripeAddressElement:a.stripeAddressElement,stripeAddressEventData:a.stripeAddressEventData,stripeElements:a.stripeElements}}updateAddressEventData({event:s,type:t}){"billing"===t?a.stripeBillingAddressEventData=s:a.stripeAddressEventData=s,"shipping"===t&&s.value.address.line1.length&&this.prefetchLandedCost()}isAddressFilledChanged(){p.checkoutSessionId&&this.isAddressFilled&&!this.trackingSent&&"shipping"===this.type&&(this.trackingSent=!0,r({checkoutSessionId:p.checkoutSessionId,eventName:"checkout_customerInfoFilled"}))}updateAddressElement({stripeAddressElement:s,type:t}){"shipping"!==t?a.stripeBillingAddressElement=s:a.stripeAddressElement=s}async watchInitStripe(){this.stripe=window.Zonos.stripe;const{stripeAddressEventData:s,stripeElements:t}=this.getStripeAddressInstance();if(!this.stripe||!t)return void v("Stripe is not initialized. Couldn't load stripe element.");const o=this.defaultAddress.map((s=>Object.assign(Object.assign({},s),{name:s.name,phone:s.phone||void 0}))),e=z.shippingZoneCountries,i=e?Object.values(e).map((s=>s.code)):[],n=new URLSearchParams(window.location.search).has("zonosCheckoutAllCountries"),a="shipping"===this.type?i:[],r=(null==s?void 0:s.value.address.country)||u(a);A(`Stripe country code: ${r}`,"info");const d=t.create("address",{allowedCountries:n?[]:a,contacts:o.length&&!s?this.defaultAddress:[],defaultValues:{address:Object.assign(Object.assign({},null==s?void 0:s.value.address),{country:r}),firstName:null==s?void 0:s.value.firstName,lastName:null==s?void 0:s.value.lastName,phone:null==s?void 0:s.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});d.mount(this.el.querySelector(".zonos--address-component")),(null==s?void 0:s.value.address)&&(this.prevCountry=s.value.address.country,this.prevPostalCode=s.value.address.postal_code),d.on("change",(s=>{const t=s.value;if(!this.isDirtyAddress&&t.address.line1.length>=3){if(this.isDirtyAddress=!0,!this.isAutoCompleteAdjusted){const s=this.el.querySelector('iframe[src*="autocomplete-suggestions"]');s&&(s.style.zIndex="3"),this.isAutoCompleteAdjusted=!0}setTimeout((()=>{if(k())this.el.scrollIntoView({behavior:"smooth",block:"end"});else{const s="shipping"===this.type?100:600,t=this.el.closest(".zonos--group"),o=this.el.getBoundingClientRect().top+s;null==t||t.scrollTo({behavior:"smooth",top:o})}}),600)}const{firstName:o,lastName:e}=l({firstName:t.firstName,lastName:t.lastName,name:t.name});this.updateAddressEventData({event:Object.assign(Object.assign({},s),{elementMode:this.type,elementType:"address",value:Object.assign(Object.assign({},t),{firstName:o,lastName:e})}),type:this.type})})),this.updateAddressElement({stripeAddressElement:d,type:this.type})}defaultAddressChanged(s,t){if(JSON.stringify(t)===JSON.stringify(s))return;A("Reset address element when default address property is changed","info",{defaultAddress:this.defaultAddress});const o=this.getStripeAddressInstance().stripeAddressElement;null==o||o.clear(),null==o||o.destroy(),"shipping"===this.type?a.stripeAddressEventData=null:a.stripeBillingAddressEventData=null,this.watchInitStripe()}isInTaxIdCountry(s){return E.includes(s)}renderTaxIdInput(){var s;if("billing"===this.type)return null;const t=null===(s=a.stripeAddressEventData)||void 0===s?void 0:s.value.address.country;if(!t)return null;if(!this.isInTaxIdCountry(t))return null;if(!w({companyName:a.companyName,countryCode:t}))return null;const e=j[t];return o("div",{class:"zonos--tax-id-input"},o("zonos-stripe-input",{inputLabel:f(e.friendlyName),inputPlaceholder:e.placeholder,inputValue:a.taxId||"",isError:!!this.taxIdErrorMessage,onInputChange:s=>{a.taxId=s.detail,this.taxIdChanged.emit(s.detail)}}),this.taxIdErrorMessage&&o("zonos-text",{textColor:"red-600",type:"caption"},this.taxIdErrorMessage))}renderShortAddressCodeInput(){var s;if("billing"===this.type)return null;const t=null===(s=a.stripeAddressEventData)||void 0===s?void 0:s.value.address.country;return t&&C({countryCode:t})?o("div",{class:"zonos--short-address-code-input"},o("zonos-stripe-input",{inputLabel:f("Short address code"),inputPlaceholder:"RRRD2929",inputValue:a.shortAddressCode||"",isError:!!this.shortAddressCodeErrorMessage,onInputChange:s=>{a.shortAddressCode=s.detail}}),this.shortAddressCodeErrorMessage&&o("zonos-text",{textColor:"red-600",type:"caption"},this.shortAddressCodeErrorMessage)):null}renderCompanyNameInput(){return("billing"!==this.type||window.Zonos.isCollect||window.Zonos.isInvoice)&&("ENABLED"===b.checkoutSettings.companyFieldsStatus||window.Zonos.isCollect||window.Zonos.isInvoice)?o("zonos-stripe-input",{class:"zonos--company-name-input",inputLabel:f("Company name (optional)"),inputValue:a.companyName,onInputChange:s=>{a.companyName=s.detail}}):null}disconnectedCallback(){const s=this.getStripeAddressInstance().stripeAddressElement;null==s||s.destroy();try{this.storeUnsubscribeList.forEach((s=>s()))}catch(s){}}componentDidLoad(){const s=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!s&&s.value.address.line1.length>0,this.watchInitStripe(),this.checkoutSessionId=p.checkoutSessionId,this.storeUnsubscribeList=[m("checkoutSessionId",(()=>{this.checkoutSessionId=p.checkoutSessionId})),d("stripeElements",(()=>{"shipping"===this.type&&this.watchInitStripe()})),d("stripeElementsForBillingAddress",(()=>{"billing"===this.type&&this.watchInitStripe()}))]}render(){var s;return this.checkoutSessionId=p.checkoutSessionId,(null===(s=a.stripeAddressEventData)||void 0===s?void 0:s.complete)&&(this.isAddressFilled=!0),o(e,{key:"5dc571d7c5e706ae9cb90de70deee22847e5ba7e",class:I(["zonos--address","zonos--elements",`zonos--${this.type}-address`])},this.titleText&&o("zonos-text",{key:"a7c9f730bc9b64aa2c6e8cc24701e638481eac19",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("slot",{key:"3078529c201c7947ffc833485d46184bc79ab1d1",name:"below-title"}),this.renderCompanyNameInput(),this.renderTaxIdInput(),this.renderShortAddressCodeInput(),o("div",{key:"b4a9850ac30ad9c483e05743ff41b7de9756d826",class:"zonos--address-component"}))}get el(){return i(this)}static get watchers(){return{checkoutSessionId:["isAddressFilledChanged"],isAddressFilled:["isAddressFilledChanged"],stripe:["watchInitStripe"],defaultAddress:["defaultAddressChanged"]}}};D.style=".sc-zonos-address-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h .zonos--company-name-input.sc-zonos-address,.sc-zonos-address-h .zonos--tax-id-input.sc-zonos-address,.sc-zonos-address-h .zonos--short-address-code-input.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";const L=class{constructor(o){s(this,o),this.confirmClicked=t(this,"confirmClicked",7),this.cancelClicked=t(this,"cancelClicked",7),this.dialogTitle=f("Are you sure?"),this.dialogIntent="info",this.dialogSubtitle=null,this.dialogWidth=350,this.dialogType="confirm",this.isMobile=!1,this.noClickOutside=!1,this.clickOutsideDialogHandler=s=>{s.target!==s.currentTarget||this.noClickOutside||this.closeDialogHandler()}}handleKeyDown(s){"Escape"===s.key&&this.closeDialogHandler()}focusDialog(){this.dialogOpen&&setTimeout((()=>{var s,t;null===(t=null===(s=this.el.shadowRoot)||void 0===s?void 0:s.querySelector(".zonos--backdrop"))||void 0===t||t.focus()}),100)}confirmDialogHandler(){this.dialogOpen&&this.confirmClicked.emit()}closeDialogHandler(){this.dialogOpen&&this.cancelClicked.emit()}renderIcon(){switch(this.dialogIntent){case"info":return o("zonos-icon",{content:'<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-400)"></path>\n <path d="M10.25 10.25a1.75 1.75 0 1 1 2.431 1.613c-.616.26-1.431.885-1.431 1.887a.75.75 0 0 0 1.5 0c0-.053.02-.128.108-.228.092-.104.236-.205.408-.278A3.25 3.25 0 1 0 8.75 10.25a.75.75 0 0 0 1.5 0Zm2.5 5.75a.75.75 0 0 0-1.5 0v.25a.75.75 0 0 0 1.5 0V16Z" fill="currentColor"></path>\n</svg>',iconColor:"blue-800"});case"danger":return o("zonos-icon",{content:'<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-400)"></path>\n <path d="M12.75 9a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V9Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>',iconColor:"red-800"});case"warn":return o("zonos-icon",{content:'<svg color="var(--zonos-elements-orange-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg" style="display: block;">\n <path d="M14.46 5.492c-1.014-2.027-3.906-2.027-4.92 0L4.276 16.02c-.914 1.83.416 3.98 2.46 3.98h10.528c2.044 0 3.374-2.151 2.46-3.98L14.46 5.492Z" data-is-secondary-color="true" fill="var(--zonos-elements-orange-400)"></path>\n <path d="M12.75 10a.75.75 0 0 0-1.5 0v2.5a.75.75 0 0 0 1.5 0V10Zm0 5.5a.75.75 0 0 0-1.5 0v.5a.75.75 0 0 0 1.5 0v-.5Z" fill="currentColor"></path>\n</svg>',iconColor:"orange-800"})}}getButtonConfirmVariant(){switch(this.dialogIntent){case"warn":return"warning";case"danger":return"danger";default:return"primary"}}render(){this.focusDialog();const s=S(),t=g(b.appearance.theme);return o(e,{key:"db0bfe0b8a125e806a97c9382faa938078000349",class:I([this.dialogOpen&&"open","zonos--elements"]),"data-dialog-type":this.dialogType,"data-theme":t,style:{"--zonos--border-radius":s,"--zonos--dialog-width":`${this.dialogWidth}px`,"--zonos--font-family":y()}},o("div",{key:"1676defad54705df4e9282bda6b5734592d0fb60",class:"zonos--backdrop",tabIndex:-1}),o("div",{key:"2a6ec6b5df7ea30304cfed5276e55618b40add93",class:I(["zonos--confirm-layout",this.dialogIntent]),onClick:s=>this.clickOutsideDialogHandler(s)},o("div",{key:"d1c8358c3fd98c27a469fe7443d1983c1c134a7c",class:"zonos--confirm-dialog",onBlur:()=>{this.focusDialog()}},o("div",{key:"137e9659aa7aec2e4604acf80809b35bce69ca79",class:"wrapper"},o("div",{key:"9c1057857ea095e7e88c8950469add2bc4c1318e",class:"icon-wrapper"},this.renderIcon()),o("div",{key:"48f0e0cd9ce62b425bae831d1387261bbd4162a1",class:"content"},o("div",{key:"0d3e681f350e5db547181beadf5c6bcf49a8bbd2",class:"title"},o("zonos-text",{key:"f16a43d2b3c9504911b1e36ba573873f80093c47",type:"subheader"},this.dialogTitle)),this.dialogSubtitle&&o("div",{key:"fd570f98bc736a68c16fedee72b1417dc6906fa6",class:"subtitle"},o("zonos-text",{key:"6785aa19dd44cf7f6fae7317e3924be6c6ee8af3",textColor:"gray-800"},this.dialogSubtitle))),o("div",{key:"4206cad3dcff0055fc5f3ea8e7c217ae33c63263",class:"footer"},"confirm"===this.dialogType&&o("zonos-button",{key:"72d1a216641d482bdbeae384963dcdff1cfc3f45",backgroundColor:"gray-0",class:"cancel-button",onClick:()=>this.closeDialogHandler(),size:"lg",withBoxShadow:!0},this.dialogCancelBtnText||f("Cancel")),o("zonos-button",{key:"a6a206eff11d1f42c33ef9113cc393d727c60f89",class:"confirm-button",onClick:()=>this.confirmDialogHandler(),size:"lg",variant:this.getButtonConfirmVariant()},this.dialogConfirmBtnText))))))}static get assetsDirs(){return["assets"]}get el(){return i(this)}};L.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--confirm-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:opacity 0.3s, visibility 0.3s;transition:opacity 0.3s, visibility 0.3s}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--confirm-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color)}:host .zonos--confirm-dialog{position:relative;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;width:var(--zonos--dialog-width);border-radius:var(--zonos--border-radius, 10px);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;gap:24px}:host .icon-wrapper{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;height:40px;width:40px;border-radius:50%;background:var(--zonos-elements-blue-100)}:host .warn .icon-wrapper{background:var(--zonos-elements-orange-100)}:host .danger .icon-wrapper{background:var(--zonos-elements-red-100)}:host .footer{display:-ms-flexbox;display:flex;width:100%;gap:8px}:host .footer zonos-button{-ms-flex:1;flex:1}:host .content{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .content zonos-text{text-align:center}:host(.open) .zonos--confirm-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483009;opacity:0.65}:host(.open) .zonos--confirm-layout{opacity:1;z-index:2147483010;-webkit-transform:scale(1);transform:scale(1)}";const N=s=>/^[a-zA-Z0-9.%_+-]*@[a-zA-Z0-9][a-zA-Z0-9.-]*\.[a-zA-Z0-9]{2,}$/.test(s),Z=class{constructor(o){s(this,o),this.linkAuthenticationChange=t(this,"linkAuthenticationChange",7),this.storeUnsubscribeList=[],this.defaultEmail=null,this.isEmailError=!1,this.stripe=a.stripe,this.isStagingMode=h.isStagingMode,this.clientSecret=a.clientSecret,this.retriesInitializeLink=0,this.setCustomEmailInputToLinkEvent=s=>{const t=N(s);a.stripeLinkEventData={complete:!!t,elementType:"linkAuthentication",empty:!s,value:{email:s}}},this.handleNormalEmailInput=s=>{var t;this.setCustomEmailInputToLinkEvent(s.detail),null===(t=this.linkAuthenticationChange)||void 0===t||t.emit()}}watchIsStagingMode(){setTimeout((()=>{this.watchInitStripe()}),0)}async watchInitStripe(){if(!this.stripe||!a.stripeElements)return;if(h.isStagingMode||!this.clientSecret)return;const s=this.defaultEmail?{email:this.defaultEmail}:void 0;try{const t=a.stripeLinkElement||a.stripeElements.create("linkAuthentication",{defaultValues:s}),o=this.el.querySelector(".zonos--link-authentication-component");if(!o)return void v("Cannot find container element for linkAuthenticationElement");t.mount(o),t.on("change",(s=>{var t;a.stripeLinkEventData=s,null===(t=this.linkAuthenticationChange)||void 0===t||t.emit()})),a.stripeLinkElement=t,this.retriesInitializeLink=0,this.retriesInitializeLink>11&&(A("Stripe link element initialized","info",{retriesInitializeLink:this.retriesInitializeLink,stripe:this.stripe}),x({endpoint:"stripe-link-authentication-init-long-running",errors:["Stripe link element initialized after 20 retries - 10 seconds"],metadata:{retriesInitializeLink:this.retriesInitializeLink}}))}catch(s){s instanceof Error&&(this.retriesInitializeLink++,this.retriesInitializeLink<51&&(await new Promise((s=>setTimeout(s,500))),this.watchInitStripe()),51===this.retriesInitializeLink&&x({endpoint:"stripe-link-authentication-init-error",errors:[s.message],metadata:{retriesInitializeLink:this.retriesInitializeLink}}))}}watchDefaultEmail(s,t){var o,e;A("Default email is changed","info",{newDefaultEmail:s,oldDefaultEmail:t}),t!==s&&(s||(a.stripeLinkEventData=null),h.isStagingMode?this.setCustomEmailInputToLinkEvent(s||""):(null===(o=a.stripeLinkElement)||void 0===o||o.clear(),null===(e=a.stripeLinkElement)||void 0===e||e.destroy(),a.stripeLinkElement=null,a.stripeLinkEventData=null,A("Reset stripe link element when default email is changed","info",{defaultEmail:s}),this.watchInitStripe()))}disconnectedCallback(){try{this.storeUnsubscribeList.forEach((s=>s()))}catch(s){}}componentDidLoad(){this.storeUnsubscribeList=[d("stripeElements",(async()=>{this.watchInitStripe()})),d("clientSecret",(async()=>{this.clientSecret=a.clientSecret})),d("stripe",(async()=>{this.stripe=a.stripe}))],this.watchInitStripe(),this.defaultEmail&&this.setCustomEmailInputToLinkEvent(this.defaultEmail)}render(){return this.isStagingMode=h.isStagingMode,this.clientSecret=a.clientSecret,o(e,{class:"zonos--link-authentication zonos--elements",style:{"--zonos--border-radius":S()}},this.titleText&&o("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},this.titleText),(()=>{var s;return h.isStagingMode?o("zonos-stripe-input",{inputLabel:f("Email"),inputValue:this.defaultEmail||(null===(s=a.stripeLinkEventData)||void 0===s?void 0:s.value.email)||"",isError:this.isEmailError,onBlur:()=>{var s;const t=(null===(s=a.stripeLinkEventData)||void 0===s?void 0:s.value.email)||"";if(!t)return;const o=N(t);this.isEmailError=!o},onInputChange:this.handleNormalEmailInput}):o("div",{class:`zonos--link-authentication-component ${this.isEmailError&&"zonos--input-invalid"}`})})(),this.isEmailError&&o("zonos-text",{textColor:"red-600"},f("Please enter a valid email address.")))}get el(){return i(this)}static get watchers(){return{isStagingMode:["watchIsStagingMode"],stripe:["watchInitStripe"],clientSecret:["watchInitStripe"],defaultEmail:["watchDefaultEmail"]}}};Z.style=".sc-zonos-link-authentication-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}.sc-zonos-link-authentication-h .zonos--input-invalid.sc-zonos-link-authentication{border:2px solid var(--zonos-elements-red-600);border-radius:var(--zonos--border-radius)}";const B=class{constructor(t){s(this,t),this.open=!1,this.size=40}render(){return o(e,{key:"13154a3c9250f15d8dca292f0673c6465bfb15e0",class:I(["zonos--elements",this.open&&"zonos--open"])},o("div",{key:"4470fccd21e58bd7959ef3e20c8775ac637cace0",class:"zonos--loading-overlay"},o("zonos-spinner",{key:"5b32b821cea982866da56176eeaafd5d8958f25d",size:this.size,spinnerColor:this.spinnerColor})))}};B.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:fixed;inset:0;z-index:2147483010;pointer-events:none;display:block}:host .zonos--loading-overlay{position:fixed;inset:0;width:100vw;height:100vh;background:var(--zonos-elements-backdrop-color);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;opacity:0;visibility:hidden;-webkit-transition:opacity 0.3s ease, visibility 0.3s ease;transition:opacity 0.3s ease, visibility 0.3s ease;z-index:2147483010}:host(.zonos--open){pointer-events:auto}:host(.zonos--open) .zonos--loading-overlay{opacity:0.65;visibility:visible}";export{D as zonos_address,L as zonos_confirm_dialog,Z as zonos_link_authentication,B as zonos_loading_overlay}