@zonos/elements 1.3.247 → 1.3.248

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 (149) hide show
  1. package/dist/cjs/{cart-97a2d20a.js → cart-28310848.js} +2 -0
  2. package/dist/cjs/index.cjs.js +14 -7
  3. package/dist/cjs/{invoice-05a10ee1.js → invoice-2e8e5879.js} +1 -1
  4. package/dist/cjs/{isCollectMobileTablet-edd4804c.js → isCollectMobileTablet-bd0f4556.js} +1 -1
  5. package/dist/cjs/{paypal-0b4b352b.js → paypal-3019ae94.js} +21 -18
  6. package/dist/cjs/{placeTestOrder-07b46688.js → placeTestOrder-b0369cfd.js} +1 -1
  7. package/dist/cjs/{renderCheckoutCurrency-dd3b0609.js → renderCheckoutCurrency-9e919b9f.js} +1 -1
  8. package/dist/cjs/submitGtag-a50ab32e.js +116 -0
  9. package/dist/cjs/zonos-address-display_9.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-address_4.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-card_5.cjs.entry.js +3 -2
  12. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +109 -17
  13. package/dist/cjs/zonos-checkout.cjs.entry.js +27 -6
  14. package/dist/cjs/zonos-collect-cart-items_3.cjs.entry.js +1 -1
  15. package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +12 -11
  16. package/dist/cjs/zonos-collect.cjs.entry.js +4 -3
  17. package/dist/cjs/zonos-controller.cjs.entry.js +5 -2
  18. package/dist/cjs/zonos-invoice-cart-items_2.cjs.entry.js +3 -3
  19. package/dist/cjs/zonos-invoice-finish_5.cjs.entry.js +12 -11
  20. package/dist/cjs/zonos-invoice.cjs.entry.js +4 -3
  21. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +88 -9
  22. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +9 -2
  23. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +24 -4
  24. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +9 -3
  25. package/dist/collection/components/checkout/zonos-collect/zonos-collect-finish/zonos-collect-finish.js +5 -5
  26. package/dist/collection/components/checkout/zonos-collect/zonos-collect-payment/zonos-collect-payment.js +1 -1
  27. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-finish/zonos-invoice-finish.js +5 -5
  28. package/dist/collection/components/checkout/zonos-invoice/zonos-invoice-payment/zonos-invoice-payment.js +1 -1
  29. package/dist/collection/components/main/zonos-controller.js +4 -1
  30. package/dist/collection/components/store/checkout/paypal.js +19 -1
  31. package/dist/collection/components/store/checkout/stripe.js +2 -0
  32. package/dist/collection/components/utils/submitGtag.js +90 -2
  33. package/dist/collection/scripts/_zonosBase.js +7 -0
  34. package/dist/collection/types/analyticsRelay.js +6 -0
  35. package/dist/esm/{cart-99ec4a3d.js → cart-ba8f3890.js} +2 -0
  36. package/dist/esm/index.js +14 -7
  37. package/dist/esm/{invoice-44e97c22.js → invoice-055bb6e5.js} +1 -1
  38. package/dist/esm/{isCollectMobileTablet-566ff0aa.js → isCollectMobileTablet-797cea8b.js} +1 -1
  39. package/dist/esm/{paypal-56534e48.js → paypal-8d8518c0.js} +23 -19
  40. package/dist/esm/{placeTestOrder-9e0ab5fd.js → placeTestOrder-0a74923e.js} +1 -1
  41. package/dist/esm/{renderCheckoutCurrency-1bd40006.js → renderCheckoutCurrency-bd059ecf.js} +1 -1
  42. package/dist/esm/submitGtag-89d6e9cb.js +113 -0
  43. package/dist/esm/zonos-address-display_9.entry.js +1 -1
  44. package/dist/esm/zonos-address_4.entry.js +1 -1
  45. package/dist/esm/zonos-card_5.entry.js +3 -2
  46. package/dist/esm/zonos-cart-items_12.entry.js +109 -17
  47. package/dist/esm/zonos-checkout.entry.js +27 -6
  48. package/dist/esm/zonos-collect-cart-items_3.entry.js +1 -1
  49. package/dist/esm/zonos-collect-finish_6.entry.js +12 -11
  50. package/dist/esm/zonos-collect.entry.js +4 -3
  51. package/dist/esm/zonos-controller.entry.js +5 -2
  52. package/dist/esm/zonos-invoice-cart-items_2.entry.js +3 -3
  53. package/dist/esm/zonos-invoice-finish_5.entry.js +12 -11
  54. package/dist/esm/zonos-invoice.entry.js +4 -3
  55. package/dist/esm-es5/{cart-99ec4a3d.js → cart-ba8f3890.js} +1 -1
  56. package/dist/esm-es5/index.js +1 -1
  57. package/dist/esm-es5/{invoice-44e97c22.js → invoice-055bb6e5.js} +1 -1
  58. package/dist/esm-es5/{isCollectMobileTablet-566ff0aa.js → isCollectMobileTablet-797cea8b.js} +1 -1
  59. package/dist/esm-es5/paypal-8d8518c0.js +17 -0
  60. package/dist/esm-es5/{placeTestOrder-9e0ab5fd.js → placeTestOrder-0a74923e.js} +1 -1
  61. package/dist/esm-es5/{renderCheckoutCurrency-1bd40006.js → renderCheckoutCurrency-bd059ecf.js} +1 -1
  62. package/dist/esm-es5/submitGtag-89d6e9cb.js +1 -0
  63. package/dist/esm-es5/zonos-address-display_9.entry.js +1 -1
  64. package/dist/esm-es5/zonos-address_4.entry.js +1 -1
  65. package/dist/esm-es5/zonos-card_5.entry.js +1 -1
  66. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  67. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  68. package/dist/esm-es5/zonos-collect-cart-items_3.entry.js +1 -1
  69. package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
  70. package/dist/esm-es5/zonos-collect.entry.js +1 -1
  71. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  72. package/dist/esm-es5/zonos-invoice-cart-items_2.entry.js +1 -1
  73. package/dist/esm-es5/zonos-invoice-finish_5.entry.js +1 -1
  74. package/dist/esm-es5/zonos-invoice.entry.js +1 -1
  75. package/dist/scripts/analyticsRelayOnInit.js +1 -0
  76. package/dist/scripts/index.d.ts +11 -0
  77. package/dist/scripts/index.js +1 -1
  78. package/dist/scripts/loadZonos.js +1 -1
  79. package/dist/scripts/zonos.js +1 -1
  80. package/dist/types/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.d.ts +4 -0
  81. package/dist/types/components/store/checkout/stripe.d.ts +6 -0
  82. package/dist/types/components/utils/submitGtag.d.ts +32 -2
  83. package/dist/types/scripts/_zonosBase.d.ts +11 -0
  84. package/dist/types/types/analyticsRelay.d.ts +12 -0
  85. package/dist/zonos-elements/index.esm.js +1 -1
  86. package/dist/zonos-elements/p-002e45f9.system.js +17 -0
  87. package/dist/zonos-elements/p-0792688d.system.entry.js +1 -0
  88. package/dist/zonos-elements/p-0b7beb16.system.entry.js +1 -0
  89. package/dist/zonos-elements/p-0f787f5d.entry.js +1 -0
  90. package/dist/zonos-elements/{p-2e8f842c.entry.js → p-0ff93ca6.entry.js} +1 -1
  91. package/dist/zonos-elements/{p-10355cf6.system.entry.js → p-1acf0a71.system.entry.js} +1 -1
  92. package/dist/zonos-elements/p-291f7ccb.system.entry.js +1 -0
  93. package/dist/zonos-elements/p-3972663a.system.entry.js +1 -0
  94. package/dist/zonos-elements/{p-53a9da45.entry.js → p-39fa55c7.entry.js} +1 -1
  95. package/dist/zonos-elements/{p-f6f1d779.system.entry.js → p-3e85b9f5.system.entry.js} +1 -1
  96. package/dist/zonos-elements/p-48475755.entry.js +1 -0
  97. package/dist/zonos-elements/{p-d0411b2d.entry.js → p-58248f03.entry.js} +1 -1
  98. package/dist/zonos-elements/p-5edef7c3.system.js +1 -0
  99. package/dist/zonos-elements/{p-678331f0.system.js → p-63a3d3b9.system.js} +1 -1
  100. package/dist/zonos-elements/p-64661dd1.js +1 -0
  101. package/dist/zonos-elements/p-69212d0f.entry.js +1 -0
  102. package/dist/zonos-elements/{p-71185d24.system.js → p-719403e0.system.js} +1 -1
  103. package/dist/zonos-elements/{p-382601a9.system.entry.js → p-71a8d971.system.entry.js} +1 -1
  104. package/dist/zonos-elements/p-71d855b8.system.entry.js +1 -0
  105. package/dist/zonos-elements/p-71f10bf0.entry.js +1 -0
  106. package/dist/zonos-elements/p-72ff005c.entry.js +1 -0
  107. package/dist/zonos-elements/{p-08365fdb.system.js → p-7dba5f23.system.js} +1 -1
  108. package/dist/zonos-elements/p-85e59f3a.system.entry.js +1 -0
  109. package/dist/zonos-elements/{p-ce98e472.js → p-866afec1.js} +1 -1
  110. package/dist/zonos-elements/p-942358eb.system.js +1 -0
  111. package/dist/zonos-elements/{p-2c10b067.system.entry.js → p-94c5fbfc.system.entry.js} +1 -1
  112. package/dist/zonos-elements/p-a12cb7ce.entry.js +1 -0
  113. package/dist/zonos-elements/p-abf38ed6.js +1 -0
  114. package/dist/zonos-elements/{p-df6e62f8.system.js → p-ae16dda9.system.js} +1 -1
  115. package/dist/zonos-elements/{p-46ece7ae.js → p-bc4bfa06.js} +1 -1
  116. package/dist/zonos-elements/p-bf5e47e2.entry.js +1 -0
  117. package/dist/zonos-elements/{p-dca14319.system.js → p-c027a832.system.js} +1 -1
  118. package/dist/zonos-elements/p-c2442878.system.js +1 -1
  119. package/dist/zonos-elements/p-c2f34b10.system.entry.js +1 -0
  120. package/dist/zonos-elements/p-c36696f9.js +1 -0
  121. package/dist/zonos-elements/p-c7311ce5.system.entry.js +1 -0
  122. package/dist/zonos-elements/{p-1b86711b.js → p-de8899bc.js} +1 -1
  123. package/dist/zonos-elements/p-e17bbcee.entry.js +1 -0
  124. package/dist/zonos-elements/{p-e458f737.entry.js → p-f6c2c743.entry.js} +1 -1
  125. package/dist/zonos-elements/p-fe06c9ea.js +17 -0
  126. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  127. package/package.json +1 -1
  128. package/dist/esm-es5/paypal-56534e48.js +0 -17
  129. package/dist/zonos-elements/p-0c201c39.system.entry.js +0 -1
  130. package/dist/zonos-elements/p-0cb5f151.system.entry.js +0 -1
  131. package/dist/zonos-elements/p-3e2f175c.entry.js +0 -1
  132. package/dist/zonos-elements/p-5295d36e.entry.js +0 -1
  133. package/dist/zonos-elements/p-64870563.entry.js +0 -1
  134. package/dist/zonos-elements/p-695e0803.system.entry.js +0 -1
  135. package/dist/zonos-elements/p-6e3cf6eb.entry.js +0 -1
  136. package/dist/zonos-elements/p-6f430d6f.system.entry.js +0 -1
  137. package/dist/zonos-elements/p-794d29dc.entry.js +0 -1
  138. package/dist/zonos-elements/p-8defdf0d.system.js +0 -17
  139. package/dist/zonos-elements/p-8e98a7c8.js +0 -1
  140. package/dist/zonos-elements/p-95348ebf.system.entry.js +0 -1
  141. package/dist/zonos-elements/p-9a066833.system.entry.js +0 -1
  142. package/dist/zonos-elements/p-aa6c2348.system.entry.js +0 -1
  143. package/dist/zonos-elements/p-ada8841a.js +0 -1
  144. package/dist/zonos-elements/p-c75b7c47.entry.js +0 -1
  145. package/dist/zonos-elements/p-caff391d.system.entry.js +0 -1
  146. package/dist/zonos-elements/p-dd19d9d8.js +0 -17
  147. package/dist/zonos-elements/p-df90bccf.entry.js +0 -1
  148. package/dist/zonos-elements/p-e07aaf09.system.js +0 -1
  149. package/dist/zonos-elements/p-f8eb618b.entry.js +0 -1
@@ -1 +0,0 @@
1
- import{r as o,d as s,h as t,H as e,F as n,c as i,a}from"./p-ab41bab5.js";import{d as r,E as l,F as c,G as h,b as d,y as p,c as u,t as m,H as f,I as z,r as g,J as b,K as y,z as x,L as v,D as w,M as k,N as C,O as L}from"./p-ce98e472.js";import{t as S,l as _,s as I,c as D}from"./p-09aabce0.js";import{r as A}from"./p-ada8841a.js";import{c as B}from"./p-0ef2a242.js";import{c as j}from"./p-b4b7f705.js";import{z as M,h as O,g as T,f as E}from"./p-b2a0ab4a.js";import{D as N,T as P,h as Z}from"./p-eea7ac64.js";import{s as $,c as F,a as R}from"./p-dd19d9d8.js";import{h as H,s as U,j as V,g as G,i as X,a as Y}from"./p-41dd1cb8.js";import{c as W}from"./p-595f5dd2.js";import{g as q}from"./p-1f894984.js";import{l as K,b as J}from"./p-0a377722.js";import{l as Q}from"./p-97aceb11.js";import{p as oo}from"./p-8e98a7c8.js";import{i as so}from"./p-57fa64d7.js";import{g as to}from"./p-41299ffb.js";import{i as eo}from"./p-ae393255.js";import{u as no}from"./p-fc776473.js";import{c as io}from"./p-0c64dbbb.js";import{s as ao,a as ro}from"./p-63a383f4.js";import{e as lo}from"./p-6b361d2b.js";import"./p-786d1c24.js";import"./p-5762e217.js";import"./p-1d42cd20.js";const co=class{constructor(s){o(this,s),this.errorImages=[]}render(){const o=s("./assets/empty-item.jpeg"),n=r.items.filter((o=>!o.isRestricted));return t(e,{key:"52911cfab4b2da9d65c840cd692e638c9dc732c5",class:"zonos--cart-items zonos--elements"},t("table",{key:"428a62423a7fcf0721f420c9fdceac4bd928a6eb",class:"zonos--cart-table"},t("tbody",{key:"41a438eeb79635ba00a241fa9771b9c33c7fe7ff"},n.map((s=>{const e=s.imageUrl,n=B(s.name),i=s.amount*s.quantity;return t("tr",{class:"zonos--cart-item"},t("td",{class:"zonos--column zonos--cart-item-image"},e&&!this.errorImages.includes(e)?t("img",{alt:s.name,onError:()=>{this.errorImages=[...this.errorImages,e]},src:s.imageUrl,style:{"min-width":"40px"},width:40}):t("img",{alt:s.name,src:o,width:40})),t("td",{class:"zonos--column zonos--cart-item-name"},t("div",null,n.map((o=>t("zonos-text",{type:"label"},o)))),t("zonos-text",{textColor:"gray-600",type:"caption"},S("Quantity"),": ",s.quantity)),t("td",{class:"zonos--column zonos--cart-item-price"},t("zonos-text",{type:"semiBoldLabel",weight:600},A({amount:i,isForeign:!1}))))})))))}static get assetsDirs(){return["assets"]}};co.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column{padding:8px;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host .zonos--cart-table td{vertical-align:top}:host .zonos--cart-item-name{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:12px}:host .zonos--cart-item-name .zonos--cart-item-quantity>*{display:inline-block}:host .zonos--cart-item-price zonos-text{white-space:nowrap}:host img{min-width:40px;margin-top:6px}";const ho=class{constructor(s){o(this,s),this.hide=!1,this.errorImages=[],this.internalCollapsed=!0,this.firstRender=!0}componentDidLoad(){this.firstRender=!0}render(){var o;const n=s("./assets/empty-item.jpeg"),i=(null===(o=r.exchangeRate)||void 0===o?void 0:o.rate)||1,a=r.restrictedItems.length;return this.hide||0===a?null:(this.firstRender&&(this.internalCollapsed=l(),this.firstRender=!1),t(e,{class:j(["zonos--cart-restricted-items","zonos--elements",this.internalCollapsed&&"collapsed"])},t("button",{class:j(["zonos--cart-title-collapse-trigger",this.internalCollapsed&&"collapsed"]),onClick:()=>{this.internalCollapsed=!this.internalCollapsed}},t("div",{class:"zonos--title-wrapper"},t("zonos-text",{textColor:"red-600",type:"label"},`${S(this.internalCollapsed?"Show":"Hide")} ${a} ${S("restricted items")}`),t("zonos-icon",{content:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#filter0_dd_2052_3658)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M7.46967 14.5303C7.76256 14.8232 8.23744 14.8232 8.53033 14.5303L12.5 10.5607L16.4697 14.5303C16.7626 14.8232 17.2374 14.8232 17.5303 14.5303C17.8232 14.2374 17.8232 13.7626 17.5303 13.4697L13.0303 8.96967C12.7374 8.67678 12.2626 8.67678 11.9697 8.96967L7.46967 13.4697C7.17678 13.7626 7.17678 14.2374 7.46967 14.5303Z" fill="currentColor"/>\n</g>\n<defs>\n<filter id="filter0_dd_2052_3658" x="-3.5" y="-2" width="32" height="32" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="2"/>\n<feGaussianBlur stdDeviation="2"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2052_3658"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="1"/>\n<feGaussianBlur stdDeviation="1"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0"/>\n<feBlend mode="normal" in2="effect1_dropShadow_2052_3658" result="effect2_dropShadow_2052_3658"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_2052_3658" result="shape"/>\n</filter>\n</defs>\n</svg>\n',iconColor:"red-600"}))),t("zonos-collapse",{collapsed:this.internalCollapsed},t("zonos-banner",{bannerTitle:S("The following items are unable to be shipped to your country and are not included in your cart total."),intent:"error"}),t("table",{class:"zonos--cart-table"},t("tbody",null,r.restrictedItems.map(((o,s)=>{var e,a;const r=o.imageUrl;return t("tr",{class:"zonos--cart-item"},t("td",{class:"zonos--column zonos--cart-item-image"},r&&!this.errorImages.includes(r)?t("img",{alt:(null===(e=o.matchedItem)||void 0===e?void 0:e.name)||o.name||`Restricted item ${s+1}`,onError:()=>{this.errorImages=[...this.errorImages,r]},src:r,style:{"min-width":"40px"},width:40}):t("img",{alt:o.name||`Restricted item ${s+1}`,src:n,width:40})),t("td",{class:"zonos--column zonos--cart-item-name"},t("zonos-text",{type:"label"},(null===(a=o.matchedItem)||void 0===a?void 0:a.name)||o.name),t("zonos-text",{type:"caption"},o.restriction.reason)),t("td",{class:"zonos--column zonos--cart-item-price"},t("zonos-text",{type:"semiBoldLabel"},A({amount:o.amount*o.quantity*i,isForeign:!1}))))})))))))}static get assetsDirs(){return["assets"]}};ho.style=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{overflow:auto;position:relative}:host zonos-banner{margin-bottom:12px}:host .zonos--cart-title-collapse-trigger{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:24px;-ms-flex-align:center;align-items:center;background:var(--zonos-elements-gray-0);width:100%;border:none;cursor:pointer;margin-bottom:16px;position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-transition:0.5s all ease;transition:0.5s all ease}:host .zonos--cart-title-collapse-trigger zonos-icon{-webkit-transition:-webkit-transform 0.3s ease;transition:-webkit-transform 0.3s ease;transition:transform 0.3s ease;transition:transform 0.3s ease, -webkit-transform 0.3s ease}:host .zonos--cart-title-collapse-trigger.collapsed{margin-bottom:0}:host .zonos--cart-title-collapse-trigger.collapsed zonos-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg)}:host .zonos--cart-title-collapse-trigger::before,:host .zonos--cart-title-collapse-trigger::after{content:"";display:block;width:80%;height:1px;background-color:var(--zonos-elements-border-color);-ms-flex-negative:1;flex-shrink:1}:host .zonos--cart-title-collapse-trigger .zonos--title-wrapper{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:row;flex-direction:row;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--cart-table{opacity:0.5;width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column{padding:8px;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host img{min-width:40px}:host(.collapsed){-ms-flex-negative:0;flex-shrink:0}';const po=class{constructor(s){o(this,s),this.loading=!1,this.getInclusivePriceType=()=>{var o,s;const t=_.inclusivePricingConfigurations.find(Boolean),e="ENABLED"===(null===(o=null==t?void 0:t.configurations[N])||void 0===o?void 0:o.status),n="ENABLED"===(null===(s=null==t?void 0:t.configurations[P])||void 0===s?void 0:s.status);return e&&n?"DUTY_TAX_AND_FEE":e?"DUTY_AND_FEE":n?"TAX":null},this.getCartSubtotalSubtitle=()=>{const o=this.getInclusivePriceType();return"DUTY_AND_FEE"===o?t("zonos-text",{class:"zonos--caption",type:"caption"},S("Duties and fees included")):"TAX"===o?t("zonos-text",{class:"zonos--caption",type:"caption"},S("Taxes included")):null}}render(){var o,s,i,a,p;const u="customer-info"===r.step?r.subtotal+r.adjustmentTotal:r.total,m="payment"===r.step||"shipping"===r.step,f=l()?u:0,z=l()?r.subtotal:0,g=!r.shouldHideDiscountInput&&"customer-info"!==r.step,b=null===(p=null===(a=null===(i=null===(s=null===(o=r.landedCostData)||void 0===o?void 0:o.find(Boolean))||void 0===s?void 0:s.landedCost.appliedAdjustments)||void 0===i?void 0:i.find((o=>{var s;return"PROMO_CODE"===(null===(s=o.adjustment)||void 0===s?void 0:s.source)})))||void 0===a?void 0:a.adjustment)||void 0===p?void 0:p.name,y=async()=>{r.promoCodeApplied=!0,r.promoCodeError=!1,this.loading=!0,await c(),this.loading=!1},x=async()=>{r.promoCodeError=!1,this.loading=!0,await h(),this.loading=!1};return t(e,{class:"zonos--cart-subtotal zonos--elements"},t("table",{class:"zonos--cart-table"},t("tr",{class:"zonos--row zonos--cart-subtotal"},t("td",{class:"zonos--column"}),t("td",{class:"zonos--column zonos--cart-subtotal-title"},t("zonos-text",{type:"semiBoldLabel"},S("Cart subtotal")),t("zonos-text",{class:"zonos--caption",type:"caption"},this.getCartSubtotalSubtitle())),t("td",{class:"zonos--column zonos--cart-subtotal-price"},t("zonos-text",{type:"semiBoldLabel"},A({amount:z,isForeign:!0})))),t("tr",{class:"zonos--row zonos--cart-shipping"},t("td",{class:"zonos--column"}),t("td",{class:"zonos--column zonos--cart-subtotal-title"},r.selectedShippingOption&&"customer-info"!==r.step?t(n,null,t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},r.selectedShippingOption.displayName),r.selectedShippingOptionTransitTime&&t("zonos-text",{class:"zonos--caption",type:"caption"},r.selectedShippingOptionTransitTime)):t(n,null,t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},S("Shipping")),t("zonos-text",{class:"zonos--caption",type:"caption"},S("No shipping method selected")))),t("td",{class:"zonos--column zonos--cart-subtotal-price"},r.shipping?A({amount:r.shipping,isForeign:!0}):"-")),m&&t("tr",{class:"zonos--row zonos--cart-duties"},t("td",{class:"zonos--column"}),(()=>{var o,s,e;if(Z()){const o=this.getInclusivePriceType();return o?"TAX"===o?t(n,null,t("td",{class:"zonos--column zonos--cart-subtotal-title zonos--landed-cost"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},S("Duties and fees")),t("zonos-text",{class:"zonos--caption",type:"caption"},S("Nothing due at the door"))),t("td",{class:"zonos--column zonos--cart-subtotal-price zonos--landed-cost"},t("div",{class:"zonos--cart-duty-tax-price"},null!==r.dutiesTaxesFees?A({amount:r.dutiesTaxesFees,isForeign:!0}):"-"))):"DUTY_AND_FEE"===o?t(n,null,t("td",{class:"zonos--column zonos--cart-subtotal-title zonos--landed-cost"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},S("Taxes"))),t("td",{class:"zonos--column zonos--cart-subtotal-price zonos--landed-cost"},t("div",{class:"zonos--cart-duty-tax-price"},null!==r.dutiesTaxesFees?A({amount:r.dutiesTaxesFees,isForeign:!0}):"-"))):t(n,null,t("td",{class:"zonos--column zonos--cart-subtotal-title zonos--landed-cost"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},S("Duties, taxes, and fees")),t("zonos-text",{class:"zonos--caption",type:"caption"},S("The purchase price covers duties, taxes and fees."))),t("td",{class:"zonos--column zonos--cart-subtotal-price zonos--landed-cost"},t("div",{class:"zonos--cart-duty-tax-price"},"-"))):null}return(null===(s=null===(o=M.genericSettings)||void 0===o?void 0:o.domesticCountries)||void 0===s?void 0:s.includes((null===(e=d.stripeAddressEventData)||void 0===e?void 0:e.value.address.country)||"US"))?t(n,null,t("td",{class:"zonos--column zonos--cart-subtotal-title zonos--landed-cost"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},S("Taxes and fees"))),t("td",{class:"zonos--column zonos--cart-subtotal-price zonos--landed-cost"},t("div",{class:"zonos--cart-duty-tax-price"},null!==r.dutiesTaxesFees||null!==r.dutiesTaxesFeesEstimate?A({amount:r.dutiesTaxesFees||r.dutiesTaxesFeesEstimate||0,isForeign:!0}):"-"))):"DAP"===r.landedCostMethod?t(n,null,t("td",{class:"zonos--column zonos--cart-subtotal-title zonos--landed-cost"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},S("Duties, taxes, and fees")),null!==r.dutiesTaxesFeesEstimate?`${S("Estimated [amount]",{amount:A({amount:r.dutiesTaxesFeesEstimate,isForeign:!0})})}`:"-"),t("td",{class:"zonos--column zonos--cart-subtotal-price zonos--landed-cost"},t("div",{class:"zonos--cart-duty-tax-price"},S("Due at delivery")))):t(n,null,t("td",{class:"zonos--column zonos--cart-subtotal-title zonos--landed-cost"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},S("Duties, taxes, and fees")),t("zonos-text",{class:"zonos--caption",type:"caption"},S("Nothing due at the door"))),t("td",{class:"zonos--column zonos--cart-subtotal-price zonos--landed-cost"},t("div",{class:"zonos--cart-duty-tax-price"},null!==r.dutiesTaxesFees?A({amount:r.dutiesTaxesFees,isForeign:!0}):"-")))})()),g&&t("tr",{class:"zonos--row zonos--cart-promo-code"},t("td",{class:"zonos--column"}),b?t(n,null,t("td",{class:"zonos--column zonos--cart-promo-code-col"},this.loading?t("zonos-spinner",{size:16}):t("zonos-badge",{dismissHandler:()=>x()},r.promoCode)),t("td",{class:"zonos--column zonos--cart-promo-code-col"})):t("td",{class:"zonos--column zonos--cart-promo-code-col",colSpan:2},t("div",{class:"zonos--cart-promo-code-input-wrapper"},t("zonos-input",{class:"zonos--cart-promo-code-input",inputLabel:S("Add promotional code"),inputValue:r.promoCode,isError:r.promoCodeError,onInputChange:o=>r.promoCode=o.detail.trim(),onKeyDown:o=>{"Enter"===o.key&&y()}}),t("zonos-button",{loading:this.loading,onClick:()=>y(),variant:"primary"},S("Apply"))))),!!r.adjustmentTotal&&t("tr",{class:"zonos--row zonos--cart-discount"},t("td",{class:"zonos--column"}),t("td",{class:"zonos--column zonos--cart-subtotal-title"},t("div",{class:"zonos--title-with-icon"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},S("Discounts")))),t("td",{class:"zonos--column zonos--cart-subtotal-price"},t("zonos-text",{type:"semiBoldLabel"},A({amount:r.adjustmentTotal,isForeign:!0})))),t("tr",{class:"zonos--row zonos--cart-pay-total"},t("td",{class:"zonos--column"}),t("td",{class:"zonos--column"},t("zonos-text",{class:"zonos--title",type:"semiBoldLabel"},S("Order total"))),t("td",{class:"zonos--column zonos--cart-total-price"},t("zonos-text",{type:"semiBoldLabel"},A({amount:f,isForeign:!0}))))))}static get assetsDirs(){return["assets"]}};po.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--cart-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--cart-table .zonos--column{padding:20px 8px;vertical-align:top}:host .zonos--cart-table .zonos--column:last-child{text-align:right}:host .zonos--cart-table .zonos--column:first-child{width:60px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--cart-subtotal-title,:host .zonos--cart-subtotal-price,:host .zonos--cart-promo-code-col{border-bottom:1px solid var(--zonos-elements-gray-200)}:host .zonos--cart-duty-tax-price{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:end;align-items:flex-end;gap:5px}:host .zonos--cart-subtotal-price{text-align:right}:host .zonos--cart-subtotal-price zonos-text{white-space:nowrap}:host .zonos--cart-subtotal-price zonos-text,:host .zonos--cart-pay-total zonos-text{white-space:nowrap}:host .zonos--cart-promo-code-input-wrapper{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}:host .zonos--cart-promo-code-input{-ms-flex:1;flex:1}";const uo=class{constructor(s){o(this,s),this.closeClick=i(this,"closeClick",7),this.borderRadius="ROUNDED",this.isLoading=!0,this.notificationType="success",this.notificationTitle="",this.notificationMessages=[],this.notificationActionText=S("Keep shopping"),this.order=null,this.isWaitingToRedirect=!0,this.pullOrder=async()=>{var o,s;const t=I.checkoutSessionId,e=new URLSearchParams;e.set("checkoutSessionId",t||"");const{baseUrl:n,errors:i,json:a}=await H(`/api/zonos-elements/get-order?${e.toString()}`);return i.length||!(null==a?void 0:a.id)?{baseUrl:n,order:null}:(await(null===(s=(o=M.checkoutSettings).onOrderSuccess)||void 0===s?void 0:s.call(o,{zonosApiRoute:n,zonosOrder:a})),{baseUrl:n,order:a})},this.redirectToUrl=o=>{p(),I.checkoutSessionId=null,window.parent&&(window.parent.location.href=o),window.location.href=o},this.isRedirectBehavior=()=>{const{successBehavior:o}=M.checkoutSettings;return"REDIRECT_TO_SUCCESS_PAGE"===o||!!r.externalConfirmationPageURL},this.shouldRenderKeepShoppingButton=()=>!this.isRedirectBehavior()&&"success"===this.notificationType,this.shouldRenderCloseButtonForRedirectBehavior=()=>this.isRedirectBehavior()||"error"===this.notificationType,this.redirectToMerchantSuccessPage=()=>{var o,s,t,e;const n=r.externalConfirmationPageURL||M.checkoutSettings.successRedirectUrl,i=new URLSearchParams,a=null===(o=this.order)||void 0===o?void 0:o.id,l=(null===(e=null===(t=null===(s=this.order)||void 0===s?void 0:s.references)||void 0===t?void 0:t.find((o=>"zonosOrderNumber"===(null==o?void 0:o.key))))||void 0===e?void 0:e.value)||null;a&&i.set("zOrderNumber",a),l&&i.set("orderId",l);const c=i.toString(),h=n.includes("?");this.isWaitingToRedirect=!0,this.redirectToUrl(c?`${n}${h?"&":"?"}${c}`:n)},this.handleSuccessBehavior=async()=>{this.saveOrderIdForDuplicationIssue();const{successBehavior:o}=M.checkoutSettings;switch(!0){case"REDIRECT_TO_SUCCESS_PAGE"===o:case!!r.externalConfirmationPageURL:if(this.notificationTitle=S("Order complete!"),this.notificationMessages=[S("Your order has been successfully placed."),S("You will be redirected back to the merchant's site in a few seconds.")],this.isLoading=!1,this.isWaitingToRedirect=!0,this.useOverrideSuccessNotification(),await this.getPullOrder(),!this.order)return K("=== Order info not found, not redirecting, hide spinner for close button","error"),void(this.isWaitingToRedirect=!1);this.isWaitingToRedirect=!1,this.redirectToMerchantSuccessPage();break;default:this.useOverrideSuccessNotification(),this.isLoading=!1,"function"==typeof M.checkoutSettings.onOrderSuccess&&await this.getPullOrder()}},this.getPullOrder=async(o=0)=>{var s,t;0===o&&K("=== Start to poll for order info","info");const{baseUrl:e,order:n}=await this.pullOrder(),{isLegacyCheckout:i}=window.Zonos,a=!!(null===(t=null===(s=null==n?void 0:n.references)||void 0===s?void 0:s.find((o=>"zonosOrderNumber"===(null==o?void 0:o.key))))||void 0===t?void 0:t.value),r=I.checkoutSessionId,l=parseFloat(new URLSearchParams(window.location.search).get("maxPollingRetries")||"0")||30;if(K(`=== Polling order (${o} attemps)`,"info"),n&&!i||n&&o>=l||a){if(K("=== Order info found","info"),i&&n&&!a)return void U({endpoint:`${e}/api/zonos-elements/get-order?checkoutSessionId=${r}&orderId=${n.id}`,errors:[`Order found but legacy order number doesn't exist after ${l} attempts`],metadata:{allLogs:J,checkoutSessionId:I.checkoutSessionId||"",orderId:n.id,storeId:M.storeId}});o>10&&U({endpoint:`${e}/api/zonos-elements/get-order?checkoutSessionId=${r}&orderId=${n.id}`,errors:[`Order found after ${o} attempts`],metadata:{allLogs:J,checkoutSessionId:I.checkoutSessionId||"",orderId:n.id,storeId:M.storeId}}),this.order=n}else n&&a||!(o<l)?U({endpoint:`${e}/api/zonos-elements/get-order?checkoutSessionId=${r}`,errors:[`Order not found after ${l} attempts`],metadata:{allLogs:J,checkoutSessionId:I.checkoutSessionId||"",storeId:M.storeId}}):(await new Promise((o=>setTimeout(o,1e3))),await this.getPullOrder(o+1))},this.useOverrideSuccessNotification=()=>{const{successPageSubtitleText:o,successPageTitleText:s}=M.checkoutSettings;s&&(this.notificationTitle=s),o&&(this.notificationMessages=o)},this.checkStripePaymentStatus=async()=>{const o=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||d.clientSecret;if(o||this.storybookForceStatus){const{error:s,messages:t,status:e}=await u({clientSecret:o,storybookForceStatus:this.storybookForceStatus}),n="requires_action"===e||s;this.notificationType=n?"error":"success",this.notificationMessages=t||[],this.notificationTitle=S(n?"Payment failed":"You're all set!"),K("=== Payment intent retrieve status","info",{clientSecret:o,error:s,messages:t,status:e});const i=new URL(window.location.href);if(i.searchParams.delete("payment_intent_client_secret"),i.searchParams.delete("payment_intent"),i.searchParams.delete("redirect_status"),i.searchParams.delete("zonosCheckoutSessionId"),window.history.replaceState({},"",i.toString()),s&&(null==t?void 0:t.length))$("zonos-checkout-payment-fail"),U({endpoint:"Stripe payment failed",errors:[`Payment intent "${o.split("_secret_")[0]}" status: ${e} - checkout session: ${I.checkoutSessionId}`],metadata:{allLogs:J,credentialToken:window.Zonos.zonosApiKey}});else{this.saveOrderIdForDuplicationIssue(),$("zonos-checkout-success"),m({checkoutSessionId:I.checkoutSessionId,eventName:"checkout_orderCompleted"});const o=W("zonos-checkout-success",{message:"Zonos Checkout successfully processed order"});document.dispatchEvent(o),await this.handleSuccessBehavior()}}this.isLoading=!1,f(),p(),I.checkoutSessionId=null},this.checkStagingOrderStatus=async()=>{this.notificationType="success",this.notificationTitle=S("You're all set!"),this.notificationMessages=z("succeeded").messages,this.useOverrideSuccessNotification(),await this.handleSuccessBehavior(),f(),p(),F(),I.checkoutSessionId=null},this.checkPaypalPaymentStatus=async()=>{if(R.paypalErrorMessage)return this.notificationType="error",this.notificationTitle=S("Payment failed"),this.notificationMessages=[R.paypalErrorMessage],void(this.isLoading=!1);this.isLoading=!1,R.orderIdCreated&&($("zonos-checkout-success"),m({checkoutSessionId:I.checkoutSessionId,eventName:"checkout_orderCompleted"}),this.notificationType="success",this.notificationTitle=S("You're all set!"),this.notificationMessages=z("succeeded").messages,this.useOverrideSuccessNotification(),await this.handleSuccessBehavior()),f(),p(),F(),I.checkoutSessionId=null},this.closeClickHandler=()=>{this.closeClick.emit()},this.saveOrderIdForDuplicationIssue=()=>{var o,s,t,e;const n=V(localStorage.getItem("zonos--placed-order-info")),i={cartId:window.Zonos.cartId||null,checkoutSessionId:(null==n?void 0:n.checkoutSessionId)||I.checkoutSessionId||"",orderId:(null===(o=this.order)||void 0===o?void 0:o.id)||null,time:(null==n?void 0:n.time)||Date.now(),zonosOrderNumber:(null===(e=null===(t=null===(s=this.order)||void 0===s?void 0:s.references)||void 0===t?void 0:t.find((o=>"zonosOrderNumber"===o.key)))||void 0===e?void 0:e.value)||null};localStorage.setItem("zonos--placed-order-info",JSON.stringify(i))}}componentDidLoad(){if(localStorage.removeItem("zonos--placed-order-info"),this.overrideNotification)return this.notificationType=this.overrideNotification.type,this.notificationTitle=this.overrideNotification.title,this.notificationMessages=this.overrideNotification.messages,void(this.isLoading=!1);r.isStagingMode?this.checkStagingOrderStatus():R.orderIdCreated?this.checkPaypalPaymentStatus():this.checkStripePaymentStatus()}render(){const o=G();return t(e,{key:"7b18913d8ebe7be5cbe9ee7d520b643c342c409d",class:"zonos--checkout-finish zonos--elements",style:{"--zonos--border-radius":q({overrideBorderStyle:this.borderRadius})}},!this.isLoading&&t("div",{key:"afb522b8b3b769817c00312fc9c14b4c032873ca",class:"zonos--finish-details"},t("div",{key:"c8cd43bc5269f7f252abaeb25dc98929f52b89bb",class:"zonos--group"},t("zonos-icon","success"===this.notificationType?{"aria-label":"Order success",content:'<svg color="var(--zonos-elements-blue-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M2 12C2 6.477 6.477 2 12 2s10 4.477 10 10-4.477 10-10 10S2 17.523 2 12Z" data-is-secondary-color="true" fill="var(--zonos-elements-blue-100)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M15.707 9.293a1 1 0 0 1 0 1.414l-3.646 3.647a1.5 1.5 0 0 1-2.122 0l-1.646-1.647a1 1 0 1 1 1.414-1.414L11 12.586l3.293-3.293a1 1 0 0 1 1.414 0Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"blue-800",size:50}:{"aria-label":"Order failed",content:'<svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"red-800",size:50}),t("zonos-text",{key:"1a7ead411d64fc8edf2de0383049bfd60660a315",class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),t("zonos-text",{key:"0c63714bbefc4e9beb1d2cf7414e5774bab4eabe",class:"zonos--subtitle",textColor:"gray-600"},this.notificationMessages.map((o=>t(n,null,o,t("br",null))))),this.shouldRenderCloseButtonForRedirectBehavior()&&t("zonos-button",{key:"06304d9815e2199108dfcb3dade1494f17b76137",loading:this.isWaitingToRedirect&&"error"!==this.notificationType,onClick:()=>{var o;(null===(o=this.order)||void 0===o?void 0:o.id)?this.redirectToMerchantSuccessPage():this.closeClickHandler()},size:"md",variant:"primary"},S("Close")),!window.Zonos.isLegacyCheckout&&this.shouldRenderKeepShoppingButton()&&t("zonos-button",{key:"9b809e21052fddb2149a2a1d0c22db4b10808403",onClick:()=>this.closeClickHandler(),size:"md",variant:"primary"},this.notificationActionText)),o&&"finish"===r.step&&"success"===this.notificationType&&t("div",{key:"4a278c7c4270d265c61b6b36d20864c55e1b42f1",class:"zonos--finish-button-wrapper"},t("zonos-button",{key:"fd8a876a0c5b76edd3be2d9b28da9c3963aee714",backgroundColor:"gray-0",buttonColor:"gray-1000",onClick:()=>this.closeClickHandler(),size:"lg",variant:"outline"},"New test cart"),t("zonos-button",{key:"7882981c1fe01ab6f78d8f84bcfc9aab94bffb74",onClick:()=>{const o=window.location.hostname.includes("dashboard.zonos.com");this.redirectToUrl(o?"/orders/all":"https://dashboard.zonos.com/orders/all")},size:"lg",variant:"primary"},"View order in Dashboard"))))}static get assetsDirs(){return["assets"]}};uo.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:24px;border-radius:var(--zonos--border-radius, 10px);gap:24px;margin-top:24px;background-color:var(--zonos-elements-gray-50);padding:20px}:host .zonos--finish-details{max-width:536px;min-width:300px;line-height:24px;width:0 auto;margin:auto}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .zonos--finish-button-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto;margin-top:48px;max-width:300px}:host .zonos--subtitle{text-align:center}:host .zonos--order-number{background-color:var(--zonos-elements-gray-0);border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800);border-radius:var(--zonos-elements-radius-6);padding:4px 8px}";const mo=class{constructor(s){o(this,s),this.mobile=!1,this.showLanguageDialog=!1,this.isMobile=!1}handleGlobalClick(o){!this.el.contains(o.target)&&this.showLanguageDialog&&(this.showLanguageDialog=!1)}toggleLanguageDialog(){this.showLanguageDialog=!this.showLanguageDialog}handleMobileChange(){this.isMobile=X(this.mobile)}componentWillLoad(){this.isMobile=X(this.mobile)}render(){var o;const s=null===(o=Q.find((o=>o.code===_.selectedLocale)))||void 0===o?void 0:o.label,n="LIGHT"!==this.dataTheme||this.mobile?"gray-1000":"gray-0";return t(e,{key:"aa7fe5e0bb22626f590d93a6c8a52876523a2dfb",class:j(["zonos--elements",this.isMobile&&"mobile"])},t("div",{key:"5fb0fc90649a06e324935484d0c5c1dba31d792c",class:"zonos--checkout-footer"},t("div",{key:"e34ac7fda1d9a13830276313e4a36a7840497d7e",class:"zonos--checkout-locale-wrapper"},t("zonos-button",{key:"775156c9f331715768b1bf9c36970d0c7da02fd2",buttonColor:n,class:"zonos--checkout-footer-language-button",icon:t("zonos-icon",{"aria-label":"Language select",content:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM11.4709 5.80634C11.7686 5.53723 11.9541 5.5 12 5.5C12.0459 5.5 12.2314 5.53723 12.5291 5.80634C12.8115 6.06164 13.1289 6.46913 13.4271 7.03651C13.9505 8.03191 14.3838 9.46098 14.48 11.25H9.51996C9.61624 9.46098 10.0495 8.03191 10.5729 7.03651C10.8711 6.46913 11.1885 6.06164 11.4709 5.80634ZM8.01802 11.25C8.11591 9.23031 8.60319 7.55958 9.24516 6.33849C9.29983 6.23451 9.35585 6.13335 9.41312 6.03514C7.32916 6.94017 5.81218 8.90533 5.5428 11.25H8.01802ZM5.5428 12.75H8.01802C8.11591 14.7697 8.60319 16.4404 9.24516 17.6615C9.29983 17.7655 9.35585 17.8666 9.41312 17.9649C7.32916 17.0598 5.81218 15.0947 5.5428 12.75ZM9.51996 12.75H14.48C14.3838 14.539 13.9505 15.9681 13.4271 16.9635C13.1289 17.5309 12.8115 17.9384 12.5291 18.1937C12.2314 18.4628 12.0459 18.5 12 18.5C11.9541 18.5 11.7686 18.4628 11.4709 18.1937C11.1885 17.9384 10.8711 17.5309 10.5729 16.9635C10.0495 15.9681 9.61624 14.539 9.51996 12.75ZM15.982 12.75C15.8841 14.7697 15.3968 16.4404 14.7548 17.6615C14.7002 17.7655 14.6441 17.8666 14.5869 17.9649C16.6708 17.0598 18.1878 15.0947 18.4572 12.75H15.982ZM18.4572 11.25C18.1878 8.90533 16.6708 6.94017 14.5869 6.03514C14.6441 6.13335 14.7002 6.23451 14.7548 6.33849C15.3968 7.55958 15.8841 9.23031 15.982 11.25H18.4572Z" fill="currentColor"/>\n</svg>\n',iconColor:n}),onClick:()=>this.toggleLanguageDialog(),variant:"subtle"},s),t("div",{key:"e2cc31362529661507811b9f5aa68586b3bf9ea5",class:j(["zonos--checkout-footer-dialog",this.showLanguageDialog&&"zonos--checkout-footer-dialog-open"])},t("zonos-language-select",{key:"ad43b0a6bb947a69ea970485ee8d9afb5c8d1adb",handleOnClose:()=>this.toggleLanguageDialog()}))),t("div",{key:"c652833a9ce05beb22b9530003863ac0e5e9f8ea",class:"zonos--checkout-footer-icon-wrapper"},t("a",{key:"f2f8fb4ef070fe6a59a8b787e9e3e6237c2cc395",href:"https://zonos.com/docs/legal/zonos-privacy-policy",target:"_blank"},t("zonos-text",{key:"50b8962317bfc01bc7edbbe4c51f58476ca3c4ec",textColor:n},"Privacy policy")),t("div",{key:"7b4b70f7c0bd4ae5f385d6738f844a795261b9b9",class:"zonos--checkout-footer-logo"},t("zonos-text",{key:"8a4279a6584a376cb10e8da6b33d8006ac896d5b",textColor:n},"Powered by"),t("a",{key:"523a822b1c5b80bcb1d5dde2a7d9fce5fe476d20",href:"https://zonos.com",target:"_blank",title:"Zonos website"},t("zonos-icon",{key:"19753e93a7820765cf208916f53adebdcdf05cf9",autoHeight:!0,content:'<svg width="408" height="112" viewBox="0 0 408 112" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M185.6 25.2H141.6C140.716 25.2 140 25.9164 140 26.8V36.4C140 37.2837 140.716 38 141.6 38H167.413C168.07 38 168.447 38.7478 168.056 39.2758L140.627 76.3519C140.22 76.9028 140 77.5699 140 78.2551V85.2001C140 86.0837 140.716 86.8 141.6 86.8H185.6C186.484 86.8 187.2 86.0837 187.2 85.2001V75.6C187.2 74.7164 186.484 74 185.6 74H159.787C159.13 74 158.753 73.2523 159.144 72.7243L186.573 35.6482C186.98 35.0973 187.2 34.4302 187.2 33.745V26.8C187.2 25.9164 186.484 25.2 185.6 25.2Z" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M212.8 24.8C203.08 24.8 195.2 32.6798 195.2 42.4V69.6C195.2 79.3203 203.08 87.2001 212.8 87.2001H224.8C234.52 87.2001 242.4 79.3203 242.4 69.6V42.4001C242.4 32.6798 234.52 24.8 224.8 24.8H212.8ZM212.8 37.6C210.149 37.6 208 39.7491 208 42.4001V69.6C208 72.251 210.149 74.4001 212.8 74.4001H224.8C227.451 74.4001 229.6 72.251 229.6 69.6V42.4C229.6 39.7491 227.451 37.6 224.8 37.6H212.8Z" fill="white"/>\n<path d="M250.4 27.5223V85.3983C250.4 86.282 251.116 86.9983 252 86.9983H261.6C262.484 86.9983 263.2 86.282 263.2 85.3983V48.1873C263.2 46.3171 264.286 44.6172 265.983 43.8314L277.983 38.2759C281.164 36.8032 284.8 39.1263 284.8 42.6317V85.3983C284.8 86.282 285.516 86.9983 286.4 86.9983H296C296.884 86.9983 297.6 86.282 297.6 85.3983V42.6209C297.6 29.7687 284.272 21.2506 272.608 26.6484L264.318 30.4847C263.659 30.7898 262.877 30.6125 262.414 30.053L259.954 27.0817C259.346 26.3474 258.443 25.9223 257.489 25.9223H252C251.116 25.9223 250.4 26.6387 250.4 27.5223Z" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M323.2 24.8C313.48 24.8 305.6 32.6798 305.6 42.4V69.6C305.6 79.3203 313.48 87.2001 323.2 87.2001H335.2C344.92 87.2001 352.8 79.3203 352.8 69.6V42.4001C352.8 32.6798 344.92 24.8 335.2 24.8H323.2ZM323.2 37.6C320.549 37.6 318.4 39.7491 318.4 42.4001V69.6C318.4 72.251 320.549 74.4001 323.2 74.4001H335.2C337.851 74.4001 340 72.251 340 69.6V42.4C340 39.7491 337.851 37.6 335.2 37.6H323.2Z" fill="white"/>\n<path d="M378.101 25.2H391.708C400.706 25.2 408 32.4944 408 41.4925C408 42.2395 407.444 42.8696 406.703 42.9622L396.602 44.2249C395.857 44.3179 395.2 43.7376 395.2 42.9876C395.2 40.2331 392.967 38 390.212 38H378.921C375.982 38 373.6 40.3822 373.6 43.3207C373.6 45.8196 375.339 47.9818 377.78 48.5176L394.22 52.1264C402.267 53.8928 408 61.021 408 69.2593C408 78.9468 400.147 86.8 390.459 86.8H377.092C368.094 86.8 360.8 79.5057 360.8 70.5076C360.8 69.7606 361.356 69.1305 362.097 69.0379L372.198 67.7752C372.943 67.6822 373.6 68.2625 373.6 69.0125C373.6 71.767 375.833 74 378.588 74H390.014C392.878 74 395.2 71.6783 395.2 68.8143C395.2 66.4508 393.602 64.3863 391.314 63.794L373.765 59.2508C366.132 57.2745 360.8 50.3868 360.8 42.5015C360.8 32.9462 368.546 25.2 378.101 25.2Z" fill="white"/>\n<path d="M8.8 58C8.8 31.9322 29.9322 10.8 56 10.8C82.0678 10.8 103.2 31.9322 103.2 58C103.2 74.868 94.3524 89.6734 81.0342 98.022C80.6447 98.2662 80.1318 98.123 79.9175 97.7162L78.7941 95.5842C78.5971 95.2104 78.7255 94.7484 79.0825 94.5224C91.1684 86.8682 99.2 73.374 99.2 58C99.2 45.1582 93.5931 33.6223 84.7029 25.7135L83.8042 24.914C83.1429 24.3257 82.1296 24.3861 81.5428 25.0488L76.655 30.5694C76.3787 30.8815 75.9095 30.9282 75.5707 30.6852C70.0598 26.7304 63.2996 24.4 56 24.4C37.4432 24.4 22.4 39.4432 22.4 58C22.4 70.9369 29.7121 82.1614 40.4157 87.7744L41.4783 88.3315C42.2607 88.7419 43.2277 88.4403 43.6381 87.6579L47.1029 81.0544C47.2912 80.6954 47.7178 80.5354 48.1006 80.6688C50.5764 81.5315 53.2355 82 56 82C69.2548 82 80 71.2548 80 58C80 44.7452 69.2548 34 56 34H54.8C53.9163 34 53.2 34.7163 53.2 35.6V43.2143C53.2 43.5965 52.9289 43.923 52.5577 44.014C46.267 45.5571 41.6 51.2335 41.6 58C41.6 62.3276 43.5125 66.2118 46.529 68.8473C49.059 71.0578 52.3762 72.4 56 72.4C63.9529 72.4 70.4 65.9529 70.4 58C70.4 51.2335 65.733 45.5571 59.4423 44.014C59.0711 43.923 58.8 43.5965 58.8 43.2143V40.7431C58.8 40.2532 59.2372 39.8772 59.7171 39.9756C68.0973 41.6948 74.4 49.1114 74.4 58C74.4 68.162 66.162 76.4 56 76.4C52.9185 76.4 50.0216 75.6447 47.4764 74.3116L46.4142 73.7552C45.6318 73.3454 44.6653 73.6471 44.255 74.4292L41.0133 80.6075C40.7934 81.0267 40.2589 81.165 39.8722 80.8921C32.6864 75.8202 28 67.4556 28 58C28 42.536 40.536 30 56 30C63.1489 30 69.6662 32.6755 74.6156 37.0841L75.5144 37.8846C76.1757 38.4736 77.1895 38.4135 77.7765 37.7505L82.4362 32.4876C82.745 32.1388 83.2861 32.1262 83.6026 32.4681C89.8104 39.1755 93.6 48.1438 93.6 58C93.6 72.4821 85.4133 85.0566 73.4023 91.3398C68.2018 94.0603 62.2848 95.6 56 95.6C39.9975 95.6 26.3233 85.602 20.8962 71.502L20.467 70.3868C20.1505 69.5646 19.229 69.1529 18.4054 69.4659L11.7892 71.9802C11.3597 72.1434 10.8807 71.9123 10.7497 71.4719C9.48157 67.2056 8.8 62.6844 8.8 58Z" fill="white"/>\n<path d="M47.2 58C47.2 53.1399 51.1399 49.2 56 49.2C60.8601 49.2 64.8 53.1399 64.8 58C64.8 62.8601 60.8601 66.8 56 66.8C53.7822 66.8 51.7621 65.9832 50.2135 64.6302C48.3624 63.0129 47.2 60.6439 47.2 58Z" fill="white"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M15.5314 80.7132C15.335 80.3641 14.9136 80.2069 14.5392 80.3492L7.33942 83.0853C6.51543 83.3984 5.59337 82.9861 5.27738 82.1632L3.70554 78.0698C1.30997 71.8314 0 65.0616 0 58C0 27.0721 25.0721 2 56 2C86.9279 2 112 27.0721 112 58C112 79.5691 99.8043 98.2795 81.9611 107.63L78.0725 109.668C77.291 110.078 76.3256 109.777 75.9143 108.997L72.3255 102.186C72.1387 101.831 71.7185 101.67 71.3402 101.803C66.5332 103.486 61.3687 104.4 56 104.4C38.6169 104.4 23.4779 94.8422 15.5314 80.7132ZM73.8305 98.177C73.6343 97.8047 73.1837 97.6488 72.7961 97.8125C67.6303 99.9943 61.9532 101.2 56 101.2C38.8594 101.2 24.0562 91.2184 17.0752 76.7588C16.8924 76.3802 16.4515 76.1992 16.0585 76.3485L9.18358 78.9612C8.35959 79.2743 7.43754 78.862 7.12154 78.0391L6.69286 76.9227C4.43567 71.0446 3.2 64.6633 3.2 58C3.2 28.8394 26.8394 5.2 56 5.2C85.1606 5.2 108.8 28.8394 108.8 58C108.8 78.3323 97.3067 95.9756 80.4757 104.796L79.4152 105.352C78.6338 105.761 77.6683 105.461 77.257 104.68L73.8305 98.177Z" fill="white"/>\n</svg>\n',size:108}))))))}get el(){return a(this)}static get watchers(){return{mobile:["handleMobileChange"]}}};mo.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:absolute;bottom:-50px;left:0;right:0;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--checkout-footer{width:calc(90vw - 22px);gap:16px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px;padding-left:0;-ms-flex-align:center;align-items:center}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:24px}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper .zonos--checkout-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper .zonos--checkout-footer-logo a{line-height:0}:host .zonos--checkout-footer .zonos--checkout-footer-icon-wrapper a{text-decoration:none}:host .zonos--checkout-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--checkout-footer .zonos--checkout-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--checkout-footer .zonos--checkout-locale-wrapper{gap:4px}}:host .zonos--checkout-footer .zonos--checkout-footer-dialog{position:absolute;bottom:36px;left:var(--language-dialog-left);background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);width:360px;max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:bottom left;transform-origin:bottom left;opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar{width:10px}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--checkout-footer .zonos--checkout-footer-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--checkout-footer .zonos--checkout-footer-dialog.zonos--checkout-footer-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host(.mobile){-ms-flex-direction:column;flex-direction:column;gap:32px;background:var(--zonos-elements-gray-0);position:relative;padding-top:24px;bottom:0}:host(.mobile) .zonos--checkout-footer{-ms-flex-direction:column;flex-direction:column;gap:4px}:host(.mobile) .zonos--checkout-locale-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.mobile) .zonos--checkout-footer-icon-wrapper{-ms-flex-direction:column;flex-direction:column}:host(.mobile) .zonos--checkout-footer-dialog{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw}";const fo=class{constructor(s){o(this,s),this.continueClicked=i(this,"continueClicked",7),this.paypalSessionFailed=i(this,"paypalSessionFailed",7),this.paypalSessionDone=i(this,"paypalSessionDone",7),this.continueLoading=!1,this.isMobile=!1,this.showErrorBanner=!1,this.hasStripePaymentError=!1,this.stagingOrderCreateErrorMessage="",this.internalContinueLoading=this.continueLoading,this.handleValidate=()=>{var o;return!!(null===(o=d.stripePaymentEventData)||void 0===o?void 0:o.complete)},this.continueClickHandler=async({currencyCode:o})=>{var s;if(!this.handleValidate())return this.showErrorBanner=!0,null===(s=d.stripeElements)||void 0===s||s.submit(),void setTimeout((()=>{var o;null===(o=this.ele.querySelector("zonos-banner"))||void 0===o||o.scrollIntoView({behavior:"smooth"})}),10);d.checkoutSettlementCurrency=o,$("zonos-checkout-payment-info"),this.continueClicked.emit()},this.copyCardToClipboard=async o=>{try{await navigator.clipboard.writeText(o)}catch(s){const t=document.createElement("textarea");t.style.position="fixed",t.style.left="-1000px",t.style.top="-1000px",t.style.width="1px",t.style.height="1px",t.value=o,t.id="zonos-copy-card-number",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}window.Zonos.showNotification({message:S("Card number copied to clipboard"),timeout:4e3,type:"success"})},this.placeTestOrder=async()=>{this.internalContinueLoading=!0;const{errors:o}=await oo();if(o.length)return this.stagingOrderCreateErrorMessage=o[0]||"Failed to create staging order. Please try again.",void(this.internalContinueLoading=!1);this.internalContinueLoading=!1,g()}}continueLoadingWatcher(){this.internalContinueLoading=this.continueLoading}stripePaymentErrorWatcher(){this.hasStripePaymentError&&setTimeout((()=>{var o;null===(o=this.ele.querySelector("zonos-banner"))||void 0===o||o.scrollIntoView({behavior:"smooth"})}),50)}render(){var o;if(this.hasStripePaymentError=d.hasPaymentError,!d.stripeElements)return null;this.showErrorBanner&&(this.showErrorBanner=!this.handleValidate());const s=G(),i=r.isStagingMode||Y(),a="external_paypal"===(null===(o=d.stripePaymentEventData)||void 0===o?void 0:o.value.type);return t(e,{class:"zonos--checkout-payment zonos--elements"},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},S("Payment method")),(()=>{if(i){const{colorPrimary:o}=M.appearance,s=o&&so(o)?"DARK":"LIGHT",e=this.isMobile?M.appearance.theme:s;return t(n,null,this.stagingOrderCreateErrorMessage&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},this.stagingOrderCreateErrorMessage),t("zonos-empty-state-payment",{emptyStateText:S("No payment method needed for staging"),theme:e}),t("div",{class:"zonos--group-btn"},t("zonos-button",{backgroundColor:this.submitBtnColor,loading:this.internalContinueLoading,onClick:()=>{this.placeTestOrder()},size:"lg",variant:this.submitBtnType},S("Place test order"))))}return t(n,null,this.showErrorBanner&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},S("Missing required fields. Make sure all fields are completed.")),this.hasStripePaymentError&&t("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},d.customErrorMessage||S("We couldn't complete your payment. Please verify the payment details and try again.")),R.paypalErrorMessage&&t("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},R.paypalErrorMessage),t("zonos-payment",null),t("div",{class:"zonos--group-btn"},!a&&t(n,null,t("zonos-button",{backgroundColor:this.submitBtnColor,bold:!0,isDisabled:this.continueLoading&&"USD"===d.checkoutSettlementCurrency,loading:this.continueLoading&&"USD"!==d.checkoutSettlementCurrency,onClick:async()=>{r.checkoutSession?await this.continueClickHandler({currencyCode:r.checkoutSession.subtotals.presentmentCurrencyCode}):K("Checkout session is not found")},size:"lg",variant:this.submitBtnType},S("Pay [orderTotal]",{orderTotal:A({amount:r.total,isForeign:!0})})),d.shouldRenderPayInUsdButton&&t("zonos-button",{class:"zonos--pay-in-base-currency-btn",isDisabled:this.continueLoading&&"USD"!==d.checkoutSettlementCurrency,loading:this.continueLoading&&"USD"===d.checkoutSettlementCurrency,onClick:async()=>{await this.continueClickHandler({currencyCode:"USD"})},size:"lg",variant:"subtle"},S("Click to pay in USD"))),t("zonos-paypal-payment",{onPaypalSessionDone:({detail:{orderId:o}})=>{this.paypalSessionDone.emit(o)},onPaypalSessionFail:()=>this.paypalSessionFailed.emit(),style:{display:a?"block":"none"}})),s&&t("zonos-card",{backgroundColor:"gray-100",borderRadius:12,class:"zonos--test-cards"},t("zonos-v-stack",{spacing:16},t("div",null,t("zonos-text",{type:"semiBoldLabel"},S("Test cards")),t("zonos-text",{textColor:"gray-700"},S("Click to copy the card number. Use any future expiration date and three number CVC."))),t("zonos-button",{icon:t("zonos-icon",{content:'<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M15.342 10.21a.75.75 0 0 0-1.184-.92l-2.978 3.829-1.4-1.4a.75.75 0 1 0-1.06 1.061l1.8 1.8a1 1 0 0 0 1.496-.093l3.326-4.277Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>'}),justifyContent:"flex-start",onClick:()=>this.copyCardToClipboard("4242424242424242")},S("Success")," (****4242)"),t("zonos-button",{icon:t("zonos-icon",{content:'<svg color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="var(--zonos-elements-gray-1000)" d="M14.475 10.586a.75.75 0 1 0-1.06-1.06L12 10.938l-1.414-1.414a.75.75 0 0 0-1.06 1.06L10.938 12l-1.414 1.414a.75.75 0 1 0 1.06 1.06L12 13.062l1.414 1.414a.75.75 0 0 0 1.06-1.06L13.062 12l1.414-1.414Z"/><path fill="var(--zonos-elements-gray-1000)" fill-rule="evenodd" d="M12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-6.5 8a6.5 6.5 0 1 1 13 0 6.5 6.5 0 0 1-13 0Z" clip-rule="evenodd"/></svg>'}),justifyContent:"flex-start",onClick:()=>this.copyCardToClipboard("4000000000000002")},S("Failure")," (****0002)")),t("zonos-notification",null)))})()))}get ele(){return a(this)}static get watchers(){return{continueLoading:["continueLoadingWatcher"],hasStripePaymentError:["stripePaymentErrorWatcher"]}}};fo.style=".sc-zonos-checkout-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-payment-h *.sc-zonos-checkout-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-payment-h img.sc-zonos-checkout-payment{max-width:100%}.sc-zonos-checkout-payment-h dl.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h dd.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h1.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h2.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h3.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h4.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h5.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h h6.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h hr.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h figure.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h p.sc-zonos-checkout-payment,.sc-zonos-checkout-payment-h pre.sc-zonos-checkout-payment{margin:0}.sc-zonos-checkout-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-checkout-payment-h .zonos--title.sc-zonos-checkout-payment{margin-bottom:24px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar{width:10px}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-payment-h .zonos--group.sc-zonos-checkout-payment::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-payment-h .zonos--payment-error-banner.sc-zonos-checkout-payment{margin-bottom:8px}.sc-zonos-checkout-payment-h .zonos--error-banner.sc-zonos-checkout-payment{margin-bottom:16px}.sc-zonos-checkout-payment-h zonos-button.sc-zonos-checkout-payment{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-checkout-payment-h .zonos--pay-in-base-currency-btn.sc-zonos-checkout-payment{-webkit-box-shadow:none;box-shadow:none}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:12px;bottom:-4px;padding-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment zonos-text.sc-zonos-checkout-payment{text-align:center}.sc-zonos-checkout-payment-h .zonos--group-btn.sc-zonos-checkout-payment zonos-button.sc-zonos-checkout-payment{width:100%}.sc-zonos-checkout-payment-h .zonos--test-cards.sc-zonos-checkout-payment{margin-top:auto;padding-top:16px}";const zo=class{constructor(s){o(this,s),this.tabColor=null,this.backgroundColor=null,this.getTotalSuccessStep=()=>(Object.values(r.tabItems).filter((o=>o.isDone)).length+1)/4*100+"%",this.isTabClickable=o=>{const s=r.tabItems[o];return!!s&&(!!s.isDone||Object.values(r.tabItems).slice(0,s.index-1).every((o=>o.isDone)))}}async setTabItems(o){r.tabItems=o}async setTabSelected(o){if(this.isTabClickable(o)){r.step=o;const s=(({selectedTab:o,tabList:s})=>{const t=s[o].index,e=Object.values(s).slice(t-1,Object.keys(s).length).map((o=>o.value)),n=Object.assign({},s);return Object.values(n).forEach((o=>{e.includes(o.value)&&(o.isDone=!1)})),n})({selectedTab:o,tabList:r.tabItems});r.tabItems=s}}render(){const o=r.step,s=this.tabColor||M.appearance.colorSecondary,n=this.backgroundColor||M.appearance.colorPrimary||"",i=n&&s?to({backgroundColor:eo(n)?window.getComputedStyle(this.ele).getPropertyValue(`--zonos-elements-${n.replace("--zonos-elements-","")}`):n,color:s}):s;return t(e,{key:"3c7b6b5ecce353611856c14c70eec992a8024b3b",class:"zonos--elements",style:{"--zonos--color":i,"--zonos--progress-percent":this.getTotalSuccessStep()}},t("div",{key:"60e0e7895f1a5667c41baecba5533ecbafcfd11c",class:"zonos--tab-wrapper"},Object.values(r.tabItems).map(((s,e)=>{const n=s.value===o;return t("button",{"aria-label":`Tab ${s.label}`,class:j(["zonos--tab-item",s.value===o&&"selected",s.isDone&&"done"]),disabled:!this.isTabClickable(s.value),key:s.value,onClick:()=>this.setTabSelected(s.value)},t("div",{class:"zonos--tab-index"},t("zonos-text",{class:"zonos--tab-index-label",textColor:n?i:"gray-1000",type:"label"},e+1),t("zonos-icon",{class:"zonos--tab-index-done-icon",content:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M18.289 7.40424C18.618 7.65585 18.6808 8.12656 18.4291 8.4556L11.9291 16.9556C11.7978 17.1273 11.5988 17.234 11.383 17.2484C11.1673 17.2627 10.9559 17.1832 10.803 17.0303L6.80304 13.0303C6.51015 12.7374 6.51015 12.2626 6.80304 11.9697C7.09594 11.6768 7.57081 11.6768 7.8637 11.9697L11.258 15.3639L17.2376 7.54442C17.4892 7.21539 17.9599 7.15263 18.289 7.40424Z" fill="currentColor"/>\n</svg>\n',iconColor:n?i:"gray-1000"})),t("zonos-text",{textColor:n?i:"gray-1000",type:"label"},S(s.label)))}))),t("div",{key:"fd6cbddf4abb19bedabc12b3c79c8dcb4a3bc938",class:"zonos--tab-progress"},t("div",{key:"83d85b7bcdac39b41d6e126d764242bf1076374a",class:"zonos--progress-bar-fill"})))}static get assetsDirs(){return["assets"]}get ele(){return a(this)}};zo.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{margin-bottom:32px}:host .zonos--tab-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:distribute;justify-content:space-around}:host .zonos--tab-index{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;font-size:13px;width:24px;height:24px;font-weight:bold}:host .zonos--tab-index .zonos--tab-index-label,:host .zonos--tab-index .zonos--tab-index-done-icon{position:absolute;top:0;width:24px;height:24px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-transition:top 0.5s ease-in-out, opacity 0.5s ease-in-out;transition:top 0.5s ease-in-out, opacity 0.5s ease-in-out}:host .zonos--tab-index .zonos--tab-index-done-icon{top:-50%;opacity:0}:host .zonos--tab-item{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;background:transparent;border:0;cursor:pointer}:host .zonos--tab-item:disabled{cursor:not-allowed}:host .zonos--tab-item.done .zonos--tab-index-done-icon{top:0;opacity:1}:host .zonos--tab-item.done .zonos--tab-index-label{opacity:0;top:50%}:host .zonos--tab-item.selected zonos-text{color:var(--zonos--color)}:host .zonos--tab-progress{width:100%;background-color:transparent;border-radius:10px;-webkit-box-shadow:inset 0 0 5px rgba(0, 0, 0, 0.4);box-shadow:inset 0 0 5px rgba(0, 0, 0, 0.4);overflow:hidden;position:relative;padding:1px;height:8px}:host .zonos--tab-progress .zonos--progress-bar-fill{border-radius:10px;background-color:var(--zonos--color);height:100%;width:var(--zonos--progress-percent);-webkit-transition:width 0.5s ease-in-out;transition:width 0.5s ease-in-out}";const go=class{constructor(s){o(this,s),this.errorImages=[]}async handleToggleChanged(o){var s;const t=null===(s=r.exchangeRate)||void 0===s?void 0:s.targetCurrencyCode;r.displayBaseCurrency=t!==o}render(){const{exchangeRate:o}=r,s=o&&o.sourceCurrencyCode!==o.targetCurrencyCode?[{label:o.sourceCurrencyCode,value:o.sourceCurrencyCode},{label:o.targetCurrencyCode,value:o.targetCurrencyCode}]:[];return s.length?t(e,{class:"zonos--currency-toggle zonos--elements"},t("zonos-toggle",{onToggleChanged:o=>this.handleToggleChanged(o.detail),options:s,value:r.displayBaseCurrency?s[0].value:s[1].value})):null}static get assetsDirs(){return["assets"]}},bo=35,yo=class{constructor(s){o(this,s),this.continueClicked=i(this,"continueClicked",7),this.testContinueClicked=i(this,"testContinueClicked",7),this.storeUnsubscribeList=[],this.continueLoading=!1,this.isMobile=!1,this.defaultAddress=[],this.shouldUseCustomAddressFormOverride=!1,this.showErrorBanner=!1,this.shippingCountry="",this.isCheckingForRestrictedItems=!1,this.isValidatingAddress=!1,this.taxIdErrorMessage="",this.shortAddressCodeErrorMessage="",this.invalidShippingCharacterList=null,this.invalidBillingCharacterList=null,this.openAddressValidationDialog=!1,this.isEmailError=!1,this.recordedFormTypeUsed=!1,this.selectedCountryCode=_.selectedCountryCode,this.genericSettings=M.genericSettings,this.addressFormRenderType=r.addressFormRenderType,this.exceededCharacterLimitErrorFieldList=[],this.handleInvalidCharacters=async()=>{if("ALL"===M.checkoutSettings.allowedCharacterSets)return{hasInvalidCharacters:!1};this.invalidShippingCharacterList=d.stripeAddressEventData?this.checkInvalidCharacters(d.stripeAddressEventData):null,this.invalidBillingCharacterList=d.stripeShippingSameAsBilling?null:this.checkInvalidCharacters(d.stripeBillingAddressEventData);const o=!!this.invalidShippingCharacterList||!!this.invalidBillingCharacterList;return o&&(this.openAddressValidationDialog=!0,this.isValidatingAddress=!0,await b({addressInvalidCharactersList:this.invalidShippingCharacterList,billingAddressInvalidCharactersList:this.invalidBillingCharacterList}),this.isValidatingAddress=!1),{hasInvalidCharacters:o}},this.transformTranslatedAddressToStripeEvent=({submitData:o,type:s})=>{const t="shippingAddress"===s?d.stripeAddressEventData:d.stripeBillingAddressEventData,e=o[s];if(!t||!e)return;const{firstName:n,lastName:i}=y({name:e.name}),a=Object.assign(Object.assign({},t),{complete:!0,value:Object.assign(Object.assign({},null==t?void 0:t.value),{address:Object.assign(Object.assign({},null==t?void 0:t.value.address),{city:e.city||(null==t?void 0:t.value.address.city)||"",line1:e.line1,line2:e.line2,postal_code:e.postal_code,state:e.state}),firstName:n,lastName:i,name:e.name})});"shippingAddress"===s?d.stripeAddressEventData=a:d.stripeBillingAddressEventData=a},this.continueClickHandler=async()=>{var o;if(null===(o=this.testContinueClicked)||void 0===o||o.emit({billingAddress:d.stripeBillingAddressEventData,sameAsBilling:d.stripeShippingSameAsBilling,shippingAddress:d.stripeAddressEventData}),!this.handleValidate())return setTimeout((()=>{var o;null===(o=this.el.querySelector("zonos-banner.zonos--error-banner"))||void 0===o||o.scrollIntoView({behavior:"smooth",block:"center"})}),50),void(this.showErrorBanner=!0);this.showErrorBanner=!1;const{hasInvalidCharacters:s}=await this.handleInvalidCharacters();s||this.continueClicked.emit({billingAddress:d.stripeBillingAddressEventData,sameAsBilling:d.stripeShippingSameAsBilling,shippingAddress:d.stripeAddressEventData})},this.validateCustomAddressForm=o=>{const s=d.stripeShippingSameAsBilling||"shipping"===o,t=s?d.customAddressErrors:d.customBillingAddressErrors,{city:e,firstName:n,lastName:i,line1:a,phone:r,postalCode:l,state:c}=t;let h=!1;return(e||n||i||a||r||l||c)&&(h=!0),s?d.customAddressErrors=Object.assign(Object.assign({},t),{showError:h}):d.customBillingAddressErrors=Object.assign(Object.assign({},t),{showError:h}),{isValid:!h}},this.validateAddressLength=({address:o,type:s})=>{if(!o)return[];const{city:t,line1:e,postal_code:n,state:i}=o.value.address,{firstName:a,lastName:r,name:l}=o.value,{firstName:c,lastName:h}=y({firstName:a,lastName:r,name:l}),d=e.length,p=n.length,u=i.length,m=c.length,f=h.length,z="shipping"===s?"shipping":"billing",g=[];return t.length>bo&&g.push({addressType:z,fieldLabel:"City",value:t}),d>bo&&g.push({addressType:z,fieldLabel:"Address line 1",value:e}),p>bo&&g.push({addressType:z,fieldLabel:"Zip",value:n}),u>bo&&g.push({addressType:z,fieldLabel:"State/Province/Region/Prefecture",value:i}),m>bo&&g.push({addressType:z,fieldLabel:"First name",value:c}),f>bo&&g.push({addressType:z,fieldLabel:"Last name",value:h}),g},this.handleValidate=()=>{var o,s;const t=d.stripeAddressEventData,e=d.stripeBillingAddressEventData,n=d.stripeLinkEventData,i=d.stripeShippingSameAsBilling?!!(null==t?void 0:t.complete):!!(null==e?void 0:e.complete),a=!!(null==t?void 0:t.complete),r=!!(null==n?void 0:n.complete);null===(o=d.stripeAddressElement)||void 0===o||o.getValue(),null===(s=d.stripeBillingAddressElement)||void 0===s||s.getValue();const l="zonos"===this.addressFormRenderType?this.validateCustomAddressForm("billing").isValid:i,c="zonos"===this.addressFormRenderType?this.validateCustomAddressForm("shipping").isValid:a;!r&&(null==n?void 0:n.empty)&&(this.isEmailError=!0),K("==> isValidBilling","info",l,{address:d.stripeBillingAddressEventData,errors:d.customBillingAddressErrors}),K("==> isValidShipping","info",c,{address:d.stripeAddressEventData,errors:d.customAddressErrors}),K("==> isValidLink","info",r);const{error:h,valid:p}=(({companyName:o,shippingCountry:s,taxId:t})=>{if(!ro({companyName:o,countryCode:s}))return{error:null,valid:!0};return(o=>["MX","AR",...lo].includes(o))(s)?lo.includes(s)?o.trim()?t?{error:null,valid:!0}:{error:"Tax id is required",valid:!1}:{error:null,valid:!0}:t?"AR"===s?/^[0-9]{2}-?[0-9]{8}-?[0-9]$/.test(t)?{error:null,valid:!0}:{error:"Invalid CUIT/CUIL format. Must contain 11 digits, with or without dashes (XX-XXXXXXXX-X).",valid:!1}:"MX"===s?/^[A-ZÑ]{3,4}[0-9]{6}[A-Z0-9]{3}$/.test(t)?{error:null,valid:!0}:{error:"Invalid RFC format. Must be 12–13 uppercase letters and numbers only.",valid:!1}:{error:null,valid:!0}:{error:"Tax id is required",valid:!1}:{error:null,valid:!0}})({companyName:d.companyName,shippingCountry:this.shippingCountry,taxId:d.taxId}),{error:u,valid:m}=(({shippingCountry:o,shortAddressCode:s})=>ao({countryCode:o})?s?"SA"!==o||/^[A-Za-z]{4}\s*[0-9]{4}$/.test(s)?{error:null,valid:!0}:{error:"Invalid short address code format. Must be 4 letters and 4 numbers.",valid:!1}:{error:"Short address code is required.",valid:!1}:{error:null,valid:!0})({shippingCountry:this.shippingCountry,shortAddressCode:d.shortAddressCode});this.taxIdErrorMessage=p?"":S(h),this.shortAddressCodeErrorMessage=m?"":S(u);const f=this.validateAddressLength({address:d.stripeAddressEventData,type:"shipping"}),z=this.validateAddressLength({address:d.stripeBillingAddressEventData,type:"billing"});return this.exceededCharacterLimitErrorFieldList=[...f,...z],!(!(l&&c&&r&&p&&m)||this.exceededCharacterLimitErrorFieldList.length>0)},this.handleEmailValidation=()=>{var o;this.isEmailError&&((null===(o=d.stripeLinkEventData)||void 0===o?void 0:o.empty)||(this.isEmailError=!1))},this.prepareAddressObject=o=>{var s;const t=o.value;return{city:t.address.city||"",country:t.address.country,email:(null===(s=d.stripeLinkEventData)||void 0===s?void 0:s.value.email)||"",line1:t.address.line1||"",line2:t.address.line2||"",name:t.name||"",phone:t.phone||"",postal_code:t.address.postal_code||"",state:t.address.state||""}},this.renderExceededCharacterLimitError=o=>{const s=this.exceededCharacterLimitErrorFieldList.filter((({addressType:s})=>s===o));return s.length?t("zonos-banner",{class:"zonos--error-banner",intent:"error",slot:"below-title"},t("ul",null,s.map((({fieldLabel:o,value:s})=>t("li",{key:o},S("Address line 1"===o?"[fieldLabel] is [currentLength] characters. Please shorten to [maxLength] or less or move the rest to address line 2.":"[fieldLabel] is [currentLength] characters. Please shorten to [maxLength] or less.",{currentLength:s.length,fieldLabel:o,maxLength:bo})))))):null},this.renderAddressComponent=o=>{this.selectedCountryCode||U({endpoint:"NO_COUNTRY_SELECTED_WHEN_RENDERING_ADDRESS_COMPONENT",errors:["No country selected when rendering address component"],metadata:{type:o},shouldPostReleaseErrorReporting:!0});const s="shipping"===o?this.defaultAddress:[];return"shipping"===o&&I.checkoutSessionId&&!this.recordedFormTypeUsed&&(no({attributes:[{key:"ZONOS_FORM_TYPE_USING",value:"zonos"===this.addressFormRenderType?"custom":"stripe"}],checkoutSessionId:I.checkoutSessionId}),this.recordedFormTypeUsed=!0),t("zonos"===this.addressFormRenderType?"zonos-custom-address":"zonos-address",{defaultAddress:s,shortAddressCodeErrorMessage:this.shortAddressCodeErrorMessage,taxIdErrorMessage:this.taxIdErrorMessage,titleText:S("shipping"===o?"Shipping address":"Billing address"),type:o},this.renderExceededCharacterLimitError(o))}}watchShowErrorBanner(){this.showErrorBanner&&(this.showErrorBanner=!this.handleValidate())}checkInvalidCharacters(o){if(!o)return null;if(!o.complete||"ALL"===M.checkoutSettings.allowedCharacterSets)return null;const{address:s,firstName:t,lastName:e,name:n}=o.value,{city:i,country:a,line1:r,line2:l,postal_code:c,state:h}=s,d=io({city:i,country:a,line1:r,line2:l||"",name:n||`${t} ${e}`,postal_code:c,state:h});return Object.keys(d).length?d:null}watchShouldEnabledCustomAddress(){var o,s,t;const e=this.shouldUseCustomAddressFormOverride||!!(null===(o=this.genericSettings)||void 0===o?void 0:o.shouldEnabledCustomAddress),n=!!this.selectedCountryCode&&e&&!!(null===(t=null===(s=this.genericSettings)||void 0===s?void 0:s.countryCustomAddressEnabled)||void 0===t?void 0:t.includes(this.selectedCountryCode));r.addressFormRenderType=n?"zonos":"stripe"}disconnectedCallback(){try{this.storeUnsubscribeList.forEach((o=>o()))}catch(o){}}componentWillLoad(){this.storeUnsubscribeList=[O("genericSettings",(()=>{this.genericSettings=M.genericSettings})),D("selectedCountryCode",(()=>{this.selectedCountryCode=_.selectedCountryCode})),x("addressFormRenderType",(()=>{this.addressFormRenderType=r.addressFormRenderType}))],this.watchShouldEnabledCustomAddress()}render(){var o,s,n,i,a,r;if(!d.stripeElements)return null;!this.shippingCountry&&d.stripeAddressEventData&&(this.shippingCountry=null===(o=d.stripeAddressEventData)||void 0===o?void 0:o.value.address.country),d.stripeAddressEventData&&this.shippingCountry!==d.stripeAddressEventData.value.address.country&&(this.shippingCountry=d.stripeAddressEventData.value.address.country);const l=!d.stripeShippingSameAsBilling,c=T(M.appearance.theme),h=(null===(s=this.defaultAddress.find(Boolean))||void 0===s?void 0:s.email)||(null===(a=null===(i=null===(n=d.customerProfile)||void 0===n?void 0:n.locations)||void 0===i?void 0:i.find(Boolean))||void 0===a?void 0:a.email)||(null===(r=d.customerProfile)||void 0===r?void 0:r.email);return t(e,{class:"zonos--customer-info zonos--elements"},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},S("Customer information")),this.showErrorBanner&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},S("Missing required fields. Make sure all fields are completed.")),t("zonos-link-authentication",{defaultEmail:h,isEmailError:this.isEmailError,onLinkAuthenticationChange:this.handleEmailValidation,titleText:S("Contact")}),this.renderAddressComponent("shipping"),t("zonos-checkbox",{class:"zonos--shipping-same-as-billing-cbx",isChecked:d.stripeShippingSameAsBilling,label:S("Shipping address same as billing"),onCheckboxSelected:o=>{d.stripeShippingSameAsBilling=o.detail}}),t("zonos-collapse",{collapsed:!l},this.renderAddressComponent("billing")),t("div",{class:"zonos--group-btn"},t("zonos-button",{backgroundColor:this.submitBtnColor,bold:!0,loading:this.continueLoading,onClick:()=>this.continueClickHandler(),size:"lg",variant:this.submitBtnType},S("Continue to shipping")))),d.stripeAddressEventData&&t("zonos-address-update-dialog",{billingAddress:!d.stripeShippingSameAsBilling&&d.stripeBillingAddressEventData?this.prepareAddressObject(d.stripeBillingAddressEventData):null,"data-theme":c,dialogLoading:this.isValidatingAddress,dialogOpen:this.openAddressValidationDialog,isMobile:this.isMobile,onCloseUpdateDialog:()=>this.openAddressValidationDialog=!1,onContinueClicked:o=>{const s=o.detail;this.transformTranslatedAddressToStripeEvent({submitData:s,type:"shippingAddress"}),this.transformTranslatedAddressToStripeEvent({submitData:s,type:"billingAddress"})},shippingAddress:this.prepareAddressObject(d.stripeAddressEventData),translatedBillingAddress:d.translatedAddress.billingAddress,translatedShippingAddress:d.translatedAddress.address}))}get el(){return a(this)}static get watchers(){return{showErrorBanner:["watchShowErrorBanner"],shouldUseCustomAddressFormOverride:["watchShouldEnabledCustomAddress"],genericSettings:["watchShouldEnabledCustomAddress"],selectedCountryCode:["watchShouldEnabledCustomAddress"]}}};yo.style=".sc-zonos-customer-info-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-customer-info-h *.sc-zonos-customer-info{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-customer-info-h img.sc-zonos-customer-info{max-width:100%}.sc-zonos-customer-info-h dl.sc-zonos-customer-info,.sc-zonos-customer-info-h dd.sc-zonos-customer-info,.sc-zonos-customer-info-h h1.sc-zonos-customer-info,.sc-zonos-customer-info-h h2.sc-zonos-customer-info,.sc-zonos-customer-info-h h3.sc-zonos-customer-info,.sc-zonos-customer-info-h h4.sc-zonos-customer-info,.sc-zonos-customer-info-h h5.sc-zonos-customer-info,.sc-zonos-customer-info-h h6.sc-zonos-customer-info,.sc-zonos-customer-info-h hr.sc-zonos-customer-info,.sc-zonos-customer-info-h figure.sc-zonos-customer-info,.sc-zonos-customer-info-h p.sc-zonos-customer-info,.sc-zonos-customer-info-h pre.sc-zonos-customer-info{margin:0}.sc-zonos-customer-info-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-customer-info-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%}.sc-zonos-customer-info-h .zonos--title.sc-zonos-customer-info{margin-bottom:20px}.sc-zonos-customer-info-h .zonos--link-authentication.sc-zonos-customer-info{margin-bottom:32px}.sc-zonos-customer-info-h .zonos--address.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--checkbox.sc-zonos-customer-info+.zonos--address.sc-zonos-customer-info{margin-bottom:0}.sc-zonos-customer-info-h zonos-button.sc-zonos-customer-info{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-customer-info-h .zonos--error-banner.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--tax-id-input.sc-zonos-customer-info{margin-bottom:16px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info{margin-bottom:20px;overflow:auto;padding:5px;height:100%;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar{width:10px}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-customer-info-h .zonos--group.sc-zonos-customer-info::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-customer-info-h .zonos--error-banner.sc-zonos-customer-info ul.sc-zonos-customer-info{list-style:disc;padding-left:8px}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:-4px;padding-top:8px;margin-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0));z-index:2}.sc-zonos-customer-info-h .zonos--group-btn.sc-zonos-customer-info zonos-button.sc-zonos-customer-info{width:100%}";const xo=class{constructor(t){o(this,t),this.isErrorImageLoad=!1,this.getImageRestState=()=>s(`./assets/${this.restStateType}.png`)}render(){const o=this.getImageRestState();return t(e,{key:"2d9be86849c6ff2f039ca21676cbdf912538eb1d",class:j(["zonos--elements zonos--restState"]),style:{"--zonos--font-family":E()}},t("div",{key:"f538f05fe92eca4ee05daf72ee3387bea337c20c",class:"zonos--restState-image"},t("img",{key:"cc752b1ed3e9e656810c901df9f8b19462efc978",alt:this.restStateType,onError:()=>{this.isErrorImageLoad=!0},src:o})),t("div",{key:"4729c415dbac98876fcd907437b8df21b925dec5",class:"content"},t("zonos-text",{key:"39313c8c71d228cd1076e809146ad7ac3d877a9a",class:"title",type:"boldSubheader"},this.restStateTitle),t("zonos-text",{key:"69813bd32ae3867ebebcc511655f2052b1175945",class:"subtitle"},this.restStateSubtitle)),t("div",{key:"98b085930fd76e2ff095cc971ae4699041c1a550",class:"action"},t("slot",{key:"188318643319081914ed30aad91de5f15b014953"})))}static get assetsDirs(){return["assets"]}};xo.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{height:100%;width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;-ms-flex-direction:column;flex-direction:column;gap:20px}:host .zonos--restState-image{width:124px;height:124px;margin-bottom:15px}:host .content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;gap:8px}";const vo=class{constructor(s){o(this,s),this.mobile=!1,this.collapsed=!1,this.isMobile=!1}handleWindowResize(){this.isMobile=X(this.mobile)}componentWillLoad(){this.isMobile=X(this.mobile)}render(){const o="customer-info"===r.step?r.subtotal+r.adjustmentTotal:r.total,s=l()?o:0,n=this.isMobile?"boldSubheader":"semiBoldLabel",i=this.isMobile?"boldSubheader":"secondaryPageHeader",a=this.isMobile?"gray-1000":"gray-800";return t(e,{class:j(["zonos--review zonos--elements",this.isMobile&&"mobile"])},t("div",{class:"zonos--title"},t("zonos-text",{textColor:a,type:n},S("Pay [organizationName]",{organizationName:M.organizationName})),(()=>this.isMobile?t("zonos-icon",this.collapsed?{"aria-label":"Expand collapsed section",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"}:{"aria-label":"Collapse expanded section",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"}):null)()),t("div",{class:"zonos--total-pay"},t("zonos-text",{type:i},A({amount:s,isForeign:!0}))))}static get assetsDirs(){return["assets"]}};vo.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:-webkit-sticky;position:sticky;top:0;background-color:var(--zonos-elements-gray-0);z-index:1}:host .zonos--total-pay{margin:8px 0 24px}:host(.mobile){display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:24px;-ms-flex-pack:justify;justify-content:space-between;padding:4px 0;margin-bottom:8px;background-color:transparent}:host(.mobile) .zonos--title{display:-ms-flexbox;display:flex;-ms-flex-item-align:center;align-self:center;gap:8px}:host(.mobile) .zonos--total-pay{margin:0}";const wo=class{constructor(s){o(this,s),this.continueClicked=i(this,"continueClicked",7),this.storeUnsubscribeList=[],this.continueLoading=!1,this.selectedShippingMethod=null,this.collapsedDAPOptions=!0,this.isSelecting=!1,this.showErrorBanner=!1,this.serviceLevelsDDP=[],this.serviceLevelsDAP=[],this.serviceLevelsOther=[],this.serviceLevelsAll=[],this.displayBaseCurrency=!1,this.shippingData=[],this.handleRadioSelected=async o=>{var s;if(this.selectedShippingMethod=o.detail,!this.selectedShippingMethod)return;const t=(null===(s=r.shippingData)||void 0===s?void 0:s.find((o=>{var s;return o.id===(null===(s=this.selectedShippingMethod)||void 0===s?void 0:s.shipmentRatingId)})))||null;t&&(this.isSelecting=!0,await v(),await w({applySubtotalsOnly:!1,landedCostId:o.detail.landedCostId,selectedShippingOption:t}),this.isSelecting=!1)},this.handleValidate=()=>!!this.selectedShippingMethod,this.isOutdatedShippingData=()=>{var o;return!!(null===(o=r.shippingData)||void 0===o?void 0:o.some((o=>{var s;if(!(null===(s=this.serviceLevelsAll)||void 0===s?void 0:s.find((s=>s.shipmentRatingId===o.id))))return!0})))},this.continueClickHandler=()=>{var o;this.handleValidate()?($("zonos-checkout-shipping-info"),m({checkoutSessionId:I.checkoutSessionId,eventName:"checkout_shippingInfoCompleted",metadata:{serviceLevelId:null===(o=this.selectedShippingMethod)||void 0===o?void 0:o.value}}),this.showErrorBanner=!1,this.continueClicked.emit()):this.showErrorBanner=!0},this.getLandedCostMethodLabelSuffix=o=>{var s,t,e;return 1==("DAP"===o&&!(null===(t=null===(s=M.genericSettings)||void 0===s?void 0:s.domesticCountries)||void 0===t?void 0:t.includes((null===(e=d.stripeAddressEventData)||void 0===e?void 0:e.value.address.country)||"US")))?S(" (Duties due at door)"):""},this.initServiceLevels=()=>{var o;this.collapsedDAPOptions=!0;const s=(null===(o=r.shippingData)||void 0===o?void 0:o.flatMap((o=>{var s;const t=k(o),e=t?`${t.minTransit}-${t.maxTransit} ${t.unit}`:"",n=null===(s=r.landedCostData)||void 0===s?void 0:s.filter((s=>{var t;return(null===(t=s.landedCost)||void 0===t?void 0:t.shipmentRating.id)===o.id}));return(null==n?void 0:n.map((s=>{const t=s.subtotals.shipping,n=C(s.landedCost);return{amount:t,label:`${o.displayName}${this.getLandedCostMethodLabelSuffix(n)}`,landedCostId:s.landedCostId,method:n,price:A({amount:t,isForeign:!0}),shipmentRatingId:o.id,sublabel:e,value:s.landedCostId}})))||[]})))||[],t=s.filter((o=>"DDP"===o.method)),e=s.filter((o=>"DAP"===o.method)),n=s.filter((o=>"DAP"!==o.method&&"DDP"!==o.method));this.serviceLevelsDDP=L(t),this.serviceLevelsDAP=L(e),this.serviceLevelsOther=L(n),this.serviceLevelsAll=[...this.serviceLevelsDDP,...this.serviceLevelsDAP,...this.serviceLevelsOther],[...this.serviceLevelsDDP,...this.serviceLevelsOther].length||(this.collapsedDAPOptions=!1)},this.isCurrencyToggled=()=>this.displayBaseCurrency!==r.displayBaseCurrency&&(this.displayBaseCurrency=r.displayBaseCurrency,!0),this.preselectFirstShippingMethod=async()=>{this.initServiceLevels();const o=this.serviceLevelsAll.find((o=>{var s;return o.shipmentRatingId===(null===(s=r.selectedShippingOption)||void 0===s?void 0:s.id)}))||null;if(o)return void this.handleRadioSelected({detail:o});const s=this.serviceLevelsAll.find(Boolean);s&&this.handleRadioSelected({detail:s})}}disconnectedCallback(){this.storeUnsubscribeList.forEach((o=>o()))}componentWillLoad(){this.storeUnsubscribeList=[x("shippingData",(()=>{this.isOutdatedShippingData()&&this.preselectFirstShippingMethod()})),x("landedCostData",(()=>{this.isOutdatedShippingData()&&this.preselectFirstShippingMethod()}))],this.preselectFirstShippingMethod()}render(){this.isCurrencyToggled()&&this.initServiceLevels();const o=[...this.serviceLevelsDDP,...this.serviceLevelsOther];return this.showErrorBanner&&(this.showErrorBanner=!this.handleValidate()),t(e,{class:"zonos--shipping zonos--elements"},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},S("Delivery options")),this.showErrorBanner&&!!this.serviceLevelsAll.length&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},S("No shipping method selected")),t("zonos-text",{class:"zonos--shipping-method-title",type:"semiBoldLabel"},S("Shipping method")),this.serviceLevelsAll.length?t("div",{class:"zonos--shipping-options-wrapper"},(()=>{var s;return"US"===(null===(s=d.stripeAddressEventData)||void 0===s?void 0:s.value.address.country)?t("zonos-shipping-rich-radio",{isMobile:this.isMobile,items:this.serviceLevelsAll,onRadioSelected:o=>this.handleRadioSelected(o),selectedItem:this.selectedShippingMethod}):t(n,null,t("zonos-shipping-rich-radio",{isMobile:this.isMobile,items:o,onRadioSelected:o=>this.handleRadioSelected(o),selectedItem:this.selectedShippingMethod}),!!o.length&&!!this.serviceLevelsDAP.length&&t("button",{class:j(["zonos--shipping-options-collapse-trigger",this.collapsedDAPOptions&&"collapsed"]),onClick:()=>{this.collapsedDAPOptions=!this.collapsedDAPOptions}},t("div",{class:"zonos--title-wrapper"},t("zonos-text",{type:"label"},`${S(this.collapsedDAPOptions?"Show non-prepaid options":"Hide non-prepaid options")} `),t("zonos-icon",{content:'<svg width="25" height="24" viewBox="0 0 25 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<g filter="url(#filter0_dd_2052_3658)">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M7.46967 14.5303C7.76256 14.8232 8.23744 14.8232 8.53033 14.5303L12.5 10.5607L16.4697 14.5303C16.7626 14.8232 17.2374 14.8232 17.5303 14.5303C17.8232 14.2374 17.8232 13.7626 17.5303 13.4697L13.0303 8.96967C12.7374 8.67678 12.2626 8.67678 11.9697 8.96967L7.46967 13.4697C7.17678 13.7626 7.17678 14.2374 7.46967 14.5303Z" fill="currentColor"/>\n</g>\n<defs>\n<filter id="filter0_dd_2052_3658" x="-3.5" y="-2" width="32" height="32" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">\n<feFlood flood-opacity="0" result="BackgroundImageFix"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="2"/>\n<feGaussianBlur stdDeviation="2"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"/>\n<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_2052_3658"/>\n<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>\n<feOffset dy="1"/>\n<feGaussianBlur stdDeviation="1"/>\n<feComposite in2="hardAlpha" operator="out"/>\n<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0"/>\n<feBlend mode="normal" in2="effect1_dropShadow_2052_3658" result="effect2_dropShadow_2052_3658"/>\n<feBlend mode="normal" in="SourceGraphic" in2="effect2_dropShadow_2052_3658" result="shape"/>\n</filter>\n</defs>\n</svg>\n'}))),t("zonos-collapse",{collapsed:this.collapsedDAPOptions},t("div",{class:"zonos--dap-wrapper"},t("zonos-banner",{bannerTitle:S("Duties and taxes will be charged upon delivery."),intent:"warning"},S("You may incur additional fees from the shipping carrier by not prepaying.")),t("zonos-shipping-rich-radio",{isMobile:this.isMobile,items:this.serviceLevelsDAP,onRadioSelected:o=>this.handleRadioSelected(o),selectedItem:this.selectedShippingMethod}))))})()):t("zonos-banner",{bannerTitle:r.customQuotingError?r.customQuotingError:S('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'),class:"zonos--shipping-method-error",intent:"error"}),t("div",{class:"zonos--group-btn"},t("zonos-button",{backgroundColor:this.submitBtnColor,bold:!0,loading:this.continueLoading||this.isSelecting,onClick:()=>this.continueClickHandler(),size:"lg",variant:this.submitBtnType},S("Go to payment")))))}};wo.style='.sc-zonos-shipping-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-shipping-h *.sc-zonos-shipping{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-shipping-h img.sc-zonos-shipping{max-width:100%}.sc-zonos-shipping-h dl.sc-zonos-shipping,.sc-zonos-shipping-h dd.sc-zonos-shipping,.sc-zonos-shipping-h h1.sc-zonos-shipping,.sc-zonos-shipping-h h2.sc-zonos-shipping,.sc-zonos-shipping-h h3.sc-zonos-shipping,.sc-zonos-shipping-h h4.sc-zonos-shipping,.sc-zonos-shipping-h h5.sc-zonos-shipping,.sc-zonos-shipping-h h6.sc-zonos-shipping,.sc-zonos-shipping-h hr.sc-zonos-shipping,.sc-zonos-shipping-h figure.sc-zonos-shipping,.sc-zonos-shipping-h p.sc-zonos-shipping,.sc-zonos-shipping-h pre.sc-zonos-shipping{margin:0}.sc-zonos-shipping-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-shipping-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-shipping-h .zonos--shipping-method-title.sc-zonos-shipping{margin-bottom:-16px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping{margin-bottom:20px;overflow:auto;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px;-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar{width:10px}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-shipping-h .zonos--group.sc-zonos-shipping::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-shipping-h .zonos--error-banner.sc-zonos-shipping{margin-bottom:16px}.sc-zonos-shipping-h .zonos--shipping-method-error.sc-zonos-shipping{margin-top:24px}.sc-zonos-shipping-h zonos-button.sc-zonos-shipping{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;bottom:0;z-index:1;margin-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-shipping-h .zonos--group-btn.sc-zonos-shipping zonos-button.sc-zonos-shipping{width:100%}.sc-zonos-shipping-h .zonos--shipping-options-wrapper.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;gap:24px;-ms-flex-align:center;align-items:center;background:transparent;width:100%;border:none;cursor:pointer;position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-transition:0.5s all ease;transition:0.5s all ease}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping zonos-icon.sc-zonos-shipping{-webkit-transition:-webkit-transform 0.3s ease;transition:-webkit-transform 0.3s ease;transition:transform 0.3s ease;transition:transform 0.3s ease, -webkit-transform 0.3s ease}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.collapsed.sc-zonos-shipping{margin-bottom:0}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.collapsed.sc-zonos-shipping zonos-icon.sc-zonos-shipping{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping::before,.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping::after{content:"";display:block;width:80%;height:1px;background-color:var(--zonos-elements-border-color);-ms-flex-negative:1;flex-shrink:1}.sc-zonos-shipping-h .zonos--shipping-options-collapse-trigger.sc-zonos-shipping .zonos--title-wrapper.sc-zonos-shipping{-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:row;flex-direction:row;gap:8px;-ms-flex-align:center;align-items:center}.sc-zonos-shipping-h .zonos--dap-wrapper.sc-zonos-shipping{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}';export{co as zonos_cart_items,ho as zonos_cart_restricted_items,po as zonos_cart_subtotal,uo as zonos_checkout_finish,mo as zonos_checkout_footer,fo as zonos_checkout_payment,zo as zonos_checkout_progress_tabs,go as zonos_currency_toggle,yo as zonos_customer_info,xo as zonos_rest_state,vo as zonos_review,wo as zonos_shipping}
@@ -1 +0,0 @@
1
- import{r as o,h as s,H as e,F as t}from"./p-ab41bab5.js";import{b as c,i as l,c as n,d as i,n as a,e as r,j as z,k as d,u as h,w as m,B as p,y as u,f as g}from"./p-ce98e472.js";import{i as b,a as f,c as x,b as w,d as v,e as y}from"./p-1b86711b.js";import{p as k,a as C}from"./p-dd19d9d8.js";import{s as S,t as j,c as I,d as L,l as O}from"./p-09aabce0.js";import{z as T}from"./p-b2a0ab4a.js";import{b as U}from"./p-83666056.js";import{h as E,s as P,l as N,g as _}from"./p-41dd1cb8.js";import{c as A}from"./p-b4b7f705.js";import{l as D}from"./p-0a377722.js";import{r as B}from"./p-27f6930b.js";import{l as F}from"./p-97aceb11.js";import"./p-57fa64d7.js";import"./p-1f894984.js";import"./p-786d1c24.js";const H=class{constructor(s){o(this,s),this.storeUnsubscribeList=[],this.onChangeLocaleListener=()=>{},this.mobile=!1,this.tablet=!1,this.stripe=window.Zonos.stripe,this.showLanguageDialogMobile=!1,this.submitLoading=!1,this.collapseReview=!0,this.isMobile=!1,this.isTablet=!1,this.isOverlayLoading=!0,this.isCartCollected=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.confirmationId=null,this.clientSecret=c.clientSecret,this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret,this.getBaseCurrencySettlementInfo=()=>{const o=i.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:s}}=o;return s?{settlementAmount:(s.discounts||0)+s.items+s.landedCostTotal+s.shipping}:null},this.applyStripeTheme=async()=>{const o=T.appearance.theme;await l({overrideTheme:this.isMobile?o:void 0,paypalEnabled:k()})},this.fetchCheckoutSession=async o=>{const{json:s}=await E("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"});return s},this.checkStripePaymentIntentStatus=async()=>{var o;const s=!!window.Zonos.cartData,e=new URL(window.location.href).searchParams,t=e.get("payment_intent_client_secret"),l=e.get("zonosCheckoutSessionId");if(D("Payment intent exist, checking stripe payment intent status"),!t)return D("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:s};const{error:i,status:a}=await n({clientSecret:t});if(new URLSearchParams(window.location.search).get("redirect_status")&&l){D(i?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen");const s=await this.fetchCheckoutSession(l);return this.confirmationId=(null===(o=null==s?void 0:s.checkoutSession.landedCost)||void 0===o?void 0:o.shortId)||null,S.checkoutSessionId=l,c.clientSecret=t,this.setToFinishStep(a),{shouldAllowOrder:!1}}return s?(D("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(D("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})}}resizeListener(){this.isMobile=b(this.mobile),this.isTablet=f(this.tablet)}async setToFinishStep(o){c.stripe=window.Zonos.stripe,i.step="finish",this.storybookPaymentStatusOverride=o,this.isOverlayLoading=!1}async initCollectCart(){var o,s,e,t,c,l,h,m,p,u,g;if(!window.Zonos.cartData)return;const b=null===(s=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.items[0])||void 0===s?void 0:s.currencyCode;b&&(i.currency=b);const f=null===(t=null===(e=window.Zonos.cartData)||void 0===e?void 0:e.references)||void 0===t?void 0:t.checkoutSessionId,v=null===(l=null===(c=window.Zonos.cartData)||void 0===c?void 0:c.references)||void 0===l?void 0:l.landedCostId;if(!v)return void a({messages:[j("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:T.organizationName})],title:j("Invalid session")});f?(D("Setting checkout session id from cart reference","info",f),S.checkoutSessionId=f):(D("Clear checkout session id from storage so we start from a fresh session for the collect cart"),S.checkoutSessionId=null);const{shouldAllowOrder:y}=await this.checkStripePaymentIntentStatus();if(y){try{const{adjustments:o,cartItems:s}=U(window.Zonos.cartData);if(await r({adjustments:o,cartItems:s,landedCostId:v,shouldInitSessionOnFailure:!1}),!S.checkoutSessionId&&!f){const o=await z();if(D(`stripeStoreInitCheckoutSession: ${o}`),!o)throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Collect quote but being used with sandbox credential")}if((!i.checkoutSession||(null===(h=i.checkoutSession)||void 0===h?void 0:h.completedAt))&&f){const o=await this.fetchCheckoutSession(f);if(this.confirmationId=(null===(m=null==o?void 0:o.checkoutSession.landedCost)||void 0===m?void 0:m.shortId)||null,null==o?void 0:o.checkoutSession.completedAt)return void this.setToFinishStep("succeeded");if(null==o?void 0:o.checkoutSession.clientSecret){const{status:s}=await n({clientSecret:o.checkoutSession.clientSecret});if("processing"===s||"succeeded"===s)return void this.setToFinishStep(s)}throw P({endpoint:"INVALID_COLLECT_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:f,cartId:null===(p=window.Zonos.cartData)||void 0===p?void 0:p.id,cartLandedCostId:v}}),new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it")}if(!i.checkoutSession)throw P({endpoint:"FAIL_TO_UPDATE_CREATE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this collect cart"],metadata:{cartCheckoutSessionId:f||"N/A",cartId:null===(u=window.Zonos.cartData)||void 0===u?void 0:u.id,cartLandedCostId:v||"N/A"}}),new Error("Could not update/create checkout session for this collect cart");d();const e=null===(g=i.checkoutSession)||void 0===g?void 0:g.landedCost;if(!e)throw new Error("Landed cost could not be found in checkout session after creating/updating them");await x(Object.assign(Object.assign({},i.checkoutSession),{id:S.checkoutSessionId||""})),w({landedCostId:e.id}),this.applyStripeTheme()}catch(o){N(o),a({messages:[j("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:T.organizationName})],title:j("Invalid session")})}this.isOverlayLoading=!1}}toggleLanguageDialog(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile}async handleStripePaymentContinue(){var o,s,e,t;if(null===(o=c.stripeBillingAddressElement)||void 0===o||o.getValue(),null===(s=c.stripeLinkEventData)||void 0===s?void 0:s.complete)if(null===(e=c.stripeBillingAddressEventData)||void 0===e?void 0:e.complete)if("USD"!==c.checkoutSettlementCurrency||!c.shouldRenderPayInUsdButton||this.payInUsdConfirmDialogOpen){if(this.payInUsdConfirmDialogOpen=!1,C.paypalErrorMessage=null,c.hasPaymentError=!1,this.submitLoading=!0,i.inventoryCheckErrorMessage=null,!await h())return c.hasPaymentError=!0,c.customErrorMessage=j("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:c.checkoutSettlementCurrency}),void(this.submitLoading=!1);await v();try{return await m({noLandedCostCheck:!0}),i.step="finish",void(this.confirmationId=y.landedCostShortId||(null===(t=i.selectedLandedCost)||void 0===t?void 0:t.landedCostId)||null)}catch(o){N(o),c.hasPaymentError=!0}this.submitLoading=!1}else this.payInUsdConfirmDialogOpen=!0;else{const o=document.querySelector(".zonos--billing-address");null==o||o.scrollIntoView({behavior:"smooth"})}else{const o=document.querySelector("zonos-link-authentication");null==o||o.scrollIntoView({behavior:"smooth"})}}componentWillLoad(){c.stripe=window.Zonos.stripe,i.step="payment",this.initCollectCart(),this.resizeListener(),this.storeUnsubscribeList=[p("clientSecret",(()=>{this.applyStripeTheme()})),I("selectedLocale",(()=>{this.applyStripeTheme()}))],D(`mobile: ${this.isMobile}`)}disconnectedCallback(){u(),g(),this.onChangeLocaleListener(),this.storeUnsubscribeList.forEach((o=>o()))}render(){this.clientSecret=c.clientSecret,c.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret);const o=this.getBaseCurrencySettlementInfo(),{logoUrl:l,theme:n}=T.appearance,a=()=>{const o=`${l}?timestamp=${Date.now()}`;return s("div",{class:"zonos--logo"},o&&s("img",{alt:`${T.organizationName} logo`,src:o}))},r=_(),z=()=>{var o;const e=new URLSearchParams(window.location.search),c=e.get("zonosQaUrl"),l=e.get("zonosDebug"),n=null===(o=F.find((o=>o.code===O.selectedLocale)))||void 0===o?void 0:o.label;return s(t,null,s("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},s("div",{class:"zonos--logo-wrapper"},a(),r&&s("zonos-badge",{badgeColor:"orange",size:"small"},j("Test mode")),"1"===l&&s("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),c&&s("zonos-badge",{badgeColor:"purple",size:"small"},c)),s("div",{class:"zonos--header-right"},s("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:()=>this.toggleLanguageDialog(),variant:"outline"},n,s("zonos-icon",{"aria-label":"Language select",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"})),s("div",{class:A(["zonos--collect-language-dialog",this.showLanguageDialogMobile&&"zonos--collect-language-dialog-open"])},s("zonos-language-select",{handleOnClose:()=>this.toggleLanguageDialog()})))),B({content:s("zonos-text",{class:"zonos--header-title",type:"header"},y.originCompanyName?j("Customs charges for your recent purchase from [companyName] are available for payment",{companyName:y.originCompanyName}):j("Customs charges from your recent purchase are available for payment")),isLoading:y.isFetchingShippingInfo,skeletonHeight:"34px",skeletonWidth:"600px"}))};return s(e,{class:A(["zonos--collect zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":n},(()=>this.isOverlayLoading||c.isFetchingSession?null:s("div",{class:"zonos--content"},"finish"!==i.step&&"error"!==i.step&&s(t,null,(this.isMobile||this.isTablet)&&z(),s("div",{class:"zonos--left","data-theme":n},!this.isMobile&&!this.isTablet&&z(),s("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},j("Billing info")),s("zonos-v-stack",{spacing:16},s("zonos-link-authentication",{titleText:""}),s("zonos-address",{titleText:"",type:"billing"})),s("zonos-collect-payment",{class:A(["zonos--collect-container"]),continueLoading:this.submitLoading,onContinueClicked:async()=>{await this.handleStripePaymentContinue()}})),s("div",{class:"zonos--right","data-theme":n},s("zonos-collect-review",{mobile:this.isMobile,tablet:this.isTablet}),s("div",{class:"zonos--order-details-container"},s("zonos-collect-order-details",{collapsed:this.collapseReview,mobile:this.isMobile,onCollapseClicked:()=>{this.collapseReview=!this.collapseReview}})),s("div",{class:"flex--wrapper"},s("zonos-v-stack",{spacing:16},s("zonos-collect-subtotal",null)),!this.isMobile&&!this.isTablet&&s("zonos-collect-footer",{"data-theme":n,mobile:this.isMobile,tablet:this.isTablet})))),("finish"===i.step||"error"===i.step)&&s("div",{class:"zonos--done","data-theme":n},s("div",{class:"zonos--header"},a()),s("zonos-collect-finish",{confirmationId:this.confirmationId,overrideNotification:"error"===i.step&&i.error?Object.assign(Object.assign({},i.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),(this.isMobile||this.isTablet||"finish"===i.step||"error"===i.step)&&s("zonos-collect-footer",{"data-theme":n,mobile:this.isMobile,tablet:this.isTablet})))(),o&&s("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:j("Cancel"),dialogConfirmBtnText:j("Pay [orderTotal]",{orderTotal:L({amount:o.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:j("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:j("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),s("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}};H.style=".sc-zonos-collect-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-h *.sc-zonos-collect{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-h img.sc-zonos-collect{max-width:100%}.sc-zonos-collect-h dl.sc-zonos-collect,.sc-zonos-collect-h dd.sc-zonos-collect,.sc-zonos-collect-h h1.sc-zonos-collect,.sc-zonos-collect-h h2.sc-zonos-collect,.sc-zonos-collect-h h3.sc-zonos-collect,.sc-zonos-collect-h h4.sc-zonos-collect,.sc-zonos-collect-h h5.sc-zonos-collect,.sc-zonos-collect-h h6.sc-zonos-collect,.sc-zonos-collect-h hr.sc-zonos-collect,.sc-zonos-collect-h figure.sc-zonos-collect,.sc-zonos-collect-h p.sc-zonos-collect,.sc-zonos-collect-h pre.sc-zonos-collect{margin:0}.sc-zonos-collect-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h *.sc-zonos-collect{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar{width:10px}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:100%;max-width:1400px;max-height:100%;height:calc(100% - 100px);overflow:hidden;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--header.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--logo.sc-zonos-collect{margin-bottom:0}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect zonos-checkout-finish.sc-zonos-collect{-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{padding:0 8px 8px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--payment-error-banner.sc-zonos-collect{margin-top:24px}.sc-zonos-collect-h .zonos--right.sc-zonos-collect{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-collect-h .zonos--right.sc-zonos-collect .zonos--order-details-container.sc-zonos-collect{overflow:hidden}.sc-zonos-collect-h .zonos--wrapper.sc-zonos-collect{overflow:auto;max-height:100%;position:relative}.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;margin-top:32px}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect>*.sc-zonos-collect{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-collect-h .zonos--header-right.sc-zonos-collect{display:none}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect img.sc-zonos-collect{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-collect-h .zonos--collect-container.sc-zonos-collect{overflow:visible}.mobile.sc-zonos-collect-h,.tablet.sc-zonos-collect-h{min-width:auto}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding-bottom:0}}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect{margin-bottom:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect{margin-top:8px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{max-height:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:auto}.mobile.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect{margin:0}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px;padding:0 16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{overflow:visible;width:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{gap:32px}.mobile.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{margin-top:0}.mobile.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:56px;top:-56px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--header-right.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:28px;top:-28px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar{width:10px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.zonos--collect-language-dialog-open.sc-zonos-collect{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-collect-h .zonos--content.sc-zonos-collect{-ms-scroll-chaining:chained;overscroll-behavior:auto}";export{H as zonos_collect}
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as o,H as i}from"./p-ab41bab5.js";import{b as n}from"./p-ce98e472.js";import{e as s,i as c,h as r,s as l,a}from"./p-09aabce0.js";import{z as d,e as h,f as u}from"./p-b2a0ab4a.js";import{g as p,i as m,a as f}from"./p-e7b0c156.js";import{h as w,l as v}from"./p-41dd1cb8.js";import{l as g}from"./p-0a377722.js";import"./p-57fa64d7.js";import"./p-1f894984.js";const y=t=>{const e=document.querySelector(t);if(!document.querySelector("zonos-hello")&&e){const t=document.createElement("zonos-hello");return e.appendChild(t),!0}return!1},S=t=>{switch(t){case"BOTTOM_RIGHT":default:return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right"}},b=({position:t="bottom-right"})=>{const e=".zonos--hello-mobile-wrapper";if(document.querySelector(e))return e;const o=document.createElement("div");return o.className="zonos--hello-mobile-wrapper",o.style.position="fixed","top-right"===t&&(o.style.top="72px",o.style.right="24px"),"top-left"===t&&(o.style.top="72px",o.style.left="24px"),"bottom-right"===t&&(o.style.bottom="72px",o.style.right="24px"),"bottom-left"===t&&(o.style.bottom="72px",o.style.left="24px"),o.style.zIndex="2147483647",document.body.appendChild(o),e},z=async t=>{if(window.Zonos.isLegacyCheckout)return void g("Hello is disabled when isLegacyCheckout","info");const{anchorElementSelector:e}=t;let o=e;if(!t.anchorElementSelector&&t.desktopLocation){const t=b({position:"bottom-right"});o=t}if(o&&c(o)){if(g("Hello init complete"),!y(o)){const e=new MutationObserver((()=>{y(o)&&e.disconnect()}));e.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>{y(o)}),1e3),setTimeout((()=>{if(t.notFoundElementFallback){g(`Hello anchor selector ${t.anchorElementSelector} not found after 3 seconds, falling back to 'notFoundElementFallback': ${t.notFoundElementFallback}`,"info");const e=b({position:S(t.notFoundElementFallback)});y(e)}}),3e3)}}else v(`Selector anchorElementSelector "${t.anchorElementSelector}" is not a valid selector.`)};class j{constructor(t,e){this.targetId=t,this.allowedEvents=e,this.listeners=new Map,this.handleMessage=t=>{var e,o,i;const n=t.data,s=(null===(e=this.iframe)||void 0===e?void 0:e.contentWindow)||(null===(i=null===(o=this.iframe)||void 0===o?void 0:o.contentDocument)||void 0===i?void 0:i.defaultView);if(t.source!==s)return;if(!this.isValidMessage(n))return;const c=this.listeners.get(n.type);null==c||c.forEach((t=>{try{t(n.payload)}catch(t){v("Error in event listener:",t)}}))},this.initializeEventListeners(),this.iframe=document.getElementById(this.targetId)}initializeEventListeners(){window.addEventListener("message",this.handleMessage)}isValidMessage(t){if(!t||"object"!=typeof t)return!1;const e=t;return e.id===this.targetId&&"string"==typeof e.type&&this.allowedEvents.includes(e.type)&&void 0!==e.payload}on(t,e){this.listeners.has(t)||this.listeners.set(t,new Set),g(`[CheckoutAddressService] listening to ${t}`,"info");const o=e,i=this.listeners.get(t);return i&&i.add(o),()=>{const e=this.listeners.get(t);e&&e.delete(o)}}destroy(){window.removeEventListener("message",this.handleMessage),this.listeners.clear()}}class I extends j{constructor(){g("=== [Google Places Service] Initializing","info"),super(m.GOOGLE_PLACES,["fetchAutocompleteSuggestions","initializeGooglePlacesService","placeSelected","onFetchAutocompleteSuggestions","onInitializeGooglePlacesService","onPlaceSelected"])}sendMessage(t,e){var o;if(!(null===(o=this.iframe)||void 0===o?void 0:o.contentWindow))return;const i={id:this.targetId,logType:window.Zonos.iframeLogType,payload:e,type:t};g(`GooglePlacesService] parent --\x3e ${t}`,"info",e),this.iframe.contentWindow.postMessage(i,"*")}initialize(){this.sendMessage("initializeGooglePlacesService",{})}fetchSuggestions({country:t,query:e,type:o}){t&&this.sendMessage("fetchAutocompleteSuggestions",{request:{includedRegionCodes:[t],input:e},type:o})}selectPlace({placeId:t,type:e}){this.sendMessage("placeSelected",{placeId:t,type:e})}}class O{constructor(){this.googlePlaceInitialized=!1,g("=== [CheckoutAddressService] Initializing","info"),this.googlePlaces=new I,this.googlePlaces.on("onInitializeGooglePlacesService",(()=>{g("=== [CheckoutAddressService] parent <-- onInitializeGooglePlacesService","info"),this.googlePlaceInitialized=!0})),this.initialize()}initialize(){this.googlePlaces.initialize()}onInitializeGooglePlacesService(t){return this.googlePlaces.on("onInitializeGooglePlacesService",(()=>{g("[CheckoutAddressService] parent <-- onInitializeGooglePlacesService"),t()}))}isGooglePlaceInitialized(){return this.googlePlaceInitialized}onAddressSuggestions(t){return this.suggestionsCallback=t,this.googlePlaces.on("onFetchAutocompleteSuggestions",((...e)=>{g(`[CheckoutAddressService] parent <-- onFetchAutocompleteSuggestions ${e[0].type}`,"info",...e),t(...e)}))}onAddressSelected(t){return this.placeSelectedCallback=t,this.googlePlaces.on("onPlaceSelected",((...e)=>{g(`[CheckoutAddressService] parent <-- onPlaceSelected ${e[0].type}`,"info",...e),t(...e)}))}getAddressSuggestions({country:t,query:e,type:o}){this.googlePlaceInitialized&&this.googlePlaces.fetchSuggestions({country:t,query:e,type:o})}selectAddress({placeId:t,type:e}){this.googlePlaces.selectPlace({placeId:t,type:e})}destroy(){this.googlePlaces.destroy(),this.suggestionsCallback&&(this.suggestionsCallback=void 0),this.placeSelectedCallback&&(this.placeSelectedCallback=void 0)}}const C=class{constructor(o){t(this,o),this.paypalInitEvent=e(this,"paypalInitEvent",7),this.stripeInitEvent=e(this,"stripeInitEvent",7)}async initCheckoutElement(t){var e;t?(n.stripe=t,((e=d.checkoutSettings).placeOrderButtonSelector||e.alwaysTriggerInternationalCheckoutSelector||window.Zonos.cartData)&&(!e.placeOrderButtonSelector||c(e.placeOrderButtonSelector)?!e.alwaysTriggerInternationalCheckoutSelector||c(e.alwaysTriggerInternationalCheckoutSelector)?(()=>{if(!document.querySelector("zonos-checkout")){const t=document.createElement("zonos-checkout");document.body.appendChild(t)}})():v(`Selector alwaysTriggerInternationalCheckoutSelector "${e.alwaysTriggerInternationalCheckoutSelector}" is not a valid selector`):v(`Selector checkoutButtonAnchor "${e.placeOrderButtonSelector}" is not a valid selector`)),g("init checkout element")):g("Stripe is not loaded yet - cannot init checkout element","warn")}async initCollectElement(t){t?(n.stripe=t,window.Zonos.cartData&&(()=>{if(!document.querySelector("zonos-collect")){const t=document.createElement("zonos-collect");document.body.appendChild(t)}})(),g("init Collect element")):g("Stripe is not loaded yet - cannot init Collect element","warn")}async initInvoiceElement(t){t?(n.stripe=t,window.Zonos.cartData&&(()=>{if(!document.querySelector("zonos-invoice")){const t=document.createElement("zonos-invoice");document.body.appendChild(t)}})(),g("init Invoice element")):g("Stripe is not loaded yet - cannot init Invoice element","warn")}initZonosNotification(){if(document.querySelector("zonos-notification"))return;const t=document.createElement("zonos-notification");document.body.appendChild(t)}async setupGoogleFont(t){var e,o;const i=t||u();if("Inter"===i){if(!t)return;g("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn"),d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:t})}const n=new URLSearchParams;n.set("family",i);const{errors:s,json:c}=await w(`/api/zonos-elements/get-font-detail?${n.toString()}`);if(s.length>0)return g(`Failed to load font ${i}`,"warn"),void(d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:"Inter"}));const r=null==c?void 0:c.fontUrl;r&&(null===(o=(e=window.Zonos).injectSupportGoogleFont)||void 0===o||o.call(e,r)),t&&(g(`[FONT] ${t} font override applied`),d.appearance=Object.assign(Object.assign({},d.appearance),{fontFamily:t}))}handleLocationChange(){z(d.helloSettings)}initHistoryListener(){const t=history.pushState;history.pushState=function(){return window.dispatchEvent(new window.Event("pushstate")),window.dispatchEvent(new window.Event("locationchange")),t.apply(this,arguments)};const e=history.replaceState;history.replaceState=function(){return window.dispatchEvent(new window.Event("replacestate")),window.dispatchEvent(new window.Event("locationchange")),e.apply(this,arguments)}}injectCustomHTML(t){if(!t)return;if(!window.Zonos.isLegacyCheckout||window.Zonos.isCollect||window.Zonos.isInvoice)return void g("=== Skip injecting custom HTML for hosted checkout","info");g("=== Injecting custom HTML for hosted checkout");const e=document.createElement("template");e.innerHTML=t,e.content.querySelectorAll("script").forEach((t=>{const e=document.createElement("script");t.src?(e.src=t.src,e.async=t.async):e.textContent=t.innerHTML,document.body.appendChild(e)}))}async initGooglePlacesService(t){const e=null==t?void 0:t.genericSettings;if(!e)return;const o=e.signedTokenGooglePlaces;o&&f({id:m.GOOGLE_PLACES,onload:()=>{d.checkoutAddressService=new O},src:`https://route.elements.zonos.com/iframe/google-maps?signedToken=${o}`})}buildBaseConfig(t){var e,o;const i=Object.assign(Object.assign({},this.config.checkoutSettings),{allowedSettlementCurrencies:void 0,captureDelay:void 0,subscriptionStatus:void 0});if(window.Zonos.isCollect||window.Zonos.isInvoice)return Object.assign(Object.assign({},this.config),{checkoutSettings:i,helloSettings:Object.assign(Object.assign({},this.config.helloSettings),{visibilityStatus:"DISABLED"})});if(!this.config.checkoutSettings)return Object.assign(Object.assign({},this.config),{checkoutSettings:void 0});const n=window.Zonos.isLegacyCheckout&&!!window.Zonos.cartData&&"CLOSE_MODAL"===(null===(e=this.config.checkoutSettings)||void 0===e?void 0:e.successBehavior);return Object.assign(Object.assign({},this.config),{checkoutSettings:Object.assign(Object.assign({},i),{successBehavior:n?"ZONOS_SUCCESS_PAGE":this.config.checkoutSettings.successBehavior,successRedirectUrl:n?(null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl)||(null==t?void 0:t.onlineStoreSettings.url):this.config.checkoutSettings.successRedirectUrl})})}async componentWillLoad(){this.initHistoryListener(),d.zonosApiKey=this.zonosApiKey,(async()=>{var t,e,o,i;const{errors:n,json:c,zonosMode:l}=await(async()=>{if(window.Zonos.cartSettings)return g("Reusing cached zonos settings"),{errors:[],json:window.Zonos.cartSettings,zonosMode:window.Zonos.zonosMode};const t=p(),e=new URLSearchParams;t.overrideShouldEnabledCustomAddress&&e.set("overrideShouldEnabledCustomAddress",t.overrideShouldEnabledCustomAddress);const o=s();o&&e.set("zCountry",o);const{errors:i,json:n,zonosMode:c}=await w(`/api/zonos-elements/zonos-settings?${e.toString()}`);return i.length?(v("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings"),{errors:i,json:null,zonosMode:c}):{errors:[],json:n,zonosMode:c}})();if("403"===(null===(e=null===(t=n[0])||void 0===t?void 0:t.type)||void 0===e?void 0:e.toString()))return void g("Failed to load zonos settings. This domain may not have access","warn");const a=(null===(o=null==c?void 0:c.checkoutSettings)||void 0===o?void 0:o.customHTML)||"";this.injectCustomHTML(a),this.initZonosNotification();const u=this.buildBaseConfig(c),m=Object.assign(Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:(()=>{var t,e,o;return window.Zonos.isLegacyCheckout?(null===(t=null==c?void 0:c.appearanceSettings)||void 0===t?void 0:t.logoUrl)||(null===(e=this.config.appearance)||void 0===e?void 0:e.logoUrl):null===(o=this.config.appearance)||void 0===o?void 0:o.logoUrl})()})}),u);h({overrideSettings:m,zonosSettings:c}),d.zonosMode=l,this.setupGoogleFont(),"DISABLED"===d.helloSettings.visibilityStatus&&g("=== Hello is disabled by store owner ===","warn"),d.helloSettings&&"ENABLED"===d.helloSettings.visibilityStatus&&(g("Initializing hello"),z(d.helloSettings)),await r();const f=(null===(i=null==c?void 0:c.checkoutSettings)||void 0===i?void 0:i.externalServiceTokens.find((t=>"STRIPE_PUBLISHABLE_TOKEN"===t.type)))||null;if(f&&this.stripeInitEvent){if(window.Zonos.isCollect||window.Zonos.isInvoice)return this.stripeInitEvent.emit({publishableKey:f.token}),void this.initGooglePlacesService(c);if("INACTIVE"===d.checkoutSettings.subscriptionStatus)return g('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn"),void g("zonos controller loaded");if("DISABLED"===d.checkoutSettings.visibilityStatus)return g("=== Checkout is disabled by store owner ===","warn"),void g("zonos controller loaded");this.stripeInitEvent.emit({publishableKey:f.token}),this.initGooglePlacesService(c)}else g("Checkout failed to load -- missing publishable key","warn")})()}async showNotification(t){const e=document.querySelector("zonos-notification");e?e.showNotification(t):g("Failed to show notification - zonos-notification not found","warn")}async reset(){l.checkoutSessionId=null,n.clientSecret=""}async overrideConfig(t){h({overrideSettings:t,zonosSettings:null})}async overrideCountry(t){g(`Override country code to ${t}`),a({isInitializing:!1,newSelectedCountryCode:t})}async getAppearanceSetting(){return d.appearance}async updateOrganizationName(t){d.organizationName=t}render(){return o(i,{key:"fe248e1e38cd3d98c56f55d39b704f7337c74c29",class:"zonos--elements"})}};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{visibility:hidden;opacity:0;height:0}";export{C as zonos_controller}
@@ -1 +0,0 @@
1
- var __awaiter=this&&this.__awaiter||function(o,e,t,s){function c(o){return o instanceof t?o:new t((function(e){e(o)}))}return new(t||(t=Promise))((function(t,n){function l(o){try{r(s.next(o))}catch(o){n(o)}}function i(o){try{r(s["throw"](o))}catch(o){n(o)}}function r(o){o.done?t(o.value):c(o.value).then(l,i)}r((s=s.apply(o,e||[])).next())}))};var __generator=this&&this.__generator||function(o,e){var t={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},s,c,n,l;return l={next:i(0),throw:i(1),return:i(2)},typeof Symbol==="function"&&(l[Symbol.iterator]=function(){return this}),l;function i(o){return function(e){return r([o,e])}}function r(i){if(s)throw new TypeError("Generator is already executing.");while(l&&(l=0,i[0]&&(t=0)),t)try{if(s=1,c&&(n=i[0]&2?c["return"]:i[0]?c["throw"]||((n=c["return"])&&n.call(c),0):c.next)&&!(n=n.call(c,i[1])).done)return n;if(c=0,n)i=[i[0]&2,n.value];switch(i[0]){case 0:case 1:n=i;break;case 4:t.label++;return{value:i[1],done:false};case 5:t.label++;c=i[1];i=[0];continue;case 7:i=t.ops.pop();t.trys.pop();continue;default:if(!(n=t.trys,n=n.length>0&&n[n.length-1])&&(i[0]===6||i[0]===2)){t=0;continue}if(i[0]===3&&(!n||i[1]>n[0]&&i[1]<n[3])){t.label=i[1];break}if(i[0]===6&&t.label<n[1]){t.label=n[1];n=i;break}if(n&&t.label<n[2]){t.label=n[2];t.ops.push(i);break}if(n[2])t.ops.pop();t.trys.pop();continue}i=e.call(o,t)}catch(o){i=[6,o];c=0}finally{s=n=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:true}}};System.register(["./p-989d3af9.system.js","./p-dca14319.system.js","./p-df6e62f8.system.js","./p-8defdf0d.system.js","./p-ae26aec5.system.js","./p-d45285aa.system.js","./p-398d9022.system.js","./p-01174496.system.js","./p-23e7c655.system.js","./p-d938f42f.system.js","./p-4ffbb0d6.system.js","./p-c9e433c0.system.js","./p-909e2bc3.system.js","./p-23d497e3.system.js","./p-443e1f30.system.js"],(function(o){"use strict";var e,t,s,c,n,l,i,r,a,d,z,h,u,f,m,p,g,b,v,w,x,y,k,_,C,S,j,I,O,T,L,E,U,P,N,A,D,B,R,F;return{setters:[function(o){e=o.r;t=o.h;s=o.H;c=o.F},function(o){n=o.b;l=o.i;i=o.c;r=o.d;a=o.n;d=o.e;z=o.j;h=o.k;u=o.u;f=o.w;m=o.B;p=o.y;g=o.f},function(o){b=o.i;v=o.a;w=o.c;x=o.b;y=o.d;k=o.e},function(o){_=o.p;C=o.a},function(o){S=o.s;j=o.t;I=o.c;O=o.d;T=o.l},function(o){L=o.z},function(o){E=o.b},function(o){U=o.h;P=o.s;N=o.l;A=o.g},function(o){D=o.c},function(o){B=o.l},function(o){R=o.r},function(o){F=o.l},function(){},function(){},function(){}],execute:function(){var H='<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>';var K=".sc-zonos-collect-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-h *.sc-zonos-collect{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-h img.sc-zonos-collect{max-width:100%}.sc-zonos-collect-h dl.sc-zonos-collect,.sc-zonos-collect-h dd.sc-zonos-collect,.sc-zonos-collect-h h1.sc-zonos-collect,.sc-zonos-collect-h h2.sc-zonos-collect,.sc-zonos-collect-h h3.sc-zonos-collect,.sc-zonos-collect-h h4.sc-zonos-collect,.sc-zonos-collect-h h5.sc-zonos-collect,.sc-zonos-collect-h h6.sc-zonos-collect,.sc-zonos-collect-h hr.sc-zonos-collect,.sc-zonos-collect-h figure.sc-zonos-collect,.sc-zonos-collect-h p.sc-zonos-collect,.sc-zonos-collect-h pre.sc-zonos-collect{margin:0}.sc-zonos-collect-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-h{z-index:2147483647;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;top:0;left:0;width:100%;height:100%;-ms-flex-align:center;align-items:center;background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h *.sc-zonos-collect{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar{width:10px}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-collect-h *.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;width:100%;-ms-flex-pack:center;justify-content:center}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex:1;flex:1;padding:56px 80px 60px;max-width:800px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200);overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{background-color:var(--zonos-elements-gray-0)}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:100%;max-width:1400px;max-height:100%;height:calc(100% - 100px);overflow:hidden;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--header.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect .zonos--logo.sc-zonos-collect{margin-bottom:0}.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect zonos-checkout-finish.sc-zonos-collect{-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{padding:0 8px 8px}.sc-zonos-collect-h .zonos--left.sc-zonos-collect .zonos--payment-error-banner.sc-zonos-collect{margin-top:24px}.sc-zonos-collect-h .zonos--right.sc-zonos-collect{position:relative;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.sc-zonos-collect-h .zonos--right.sc-zonos-collect .zonos--order-details-container.sc-zonos-collect{overflow:hidden}.sc-zonos-collect-h .zonos--wrapper.sc-zonos-collect{overflow:auto;max-height:100%;position:relative}.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%;margin-top:32px}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center;-ms-flex:1;flex:1}.sc-zonos-collect-h .zonos--logo-wrapper.sc-zonos-collect>*.sc-zonos-collect{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-collect-h .zonos--header-right.sc-zonos-collect{display:none}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-collect-h .zonos--logo.sc-zonos-collect img.sc-zonos-collect{max-height:70px;-o-object-position:left center;object-position:left center;-o-object-fit:contain;object-fit:contain}.sc-zonos-collect-h .zonos--collect-container.sc-zonos-collect{overflow:visible}.mobile.sc-zonos-collect-h,.tablet.sc-zonos-collect-h{min-width:auto}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{padding-bottom:0}}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--review.sc-zonos-collect{margin-bottom:0}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect .zonos--cart-items.sc-zonos-collect{margin-top:8px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect zonos-checkout-footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--wrapper.sc-zonos-collect{max-height:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--footer.sc-zonos-collect{-ms-flex-order:3;order:3}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--done.sc-zonos-collect{width:auto}.mobile.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--cart-subtotal.sc-zonos-collect{margin:0}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{position:-webkit-sticky;position:sticky;top:0;width:100%;padding:16px;background-color:var(--zonos-elements-gray-0);z-index:3}.mobile.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-title.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{max-width:800px;padding:0 16px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect{overflow:auto;-ms-flex-pack:unset;justify-content:unset;-ms-flex-align:center;align-items:center;gap:24px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--left.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{overflow:visible;width:100%}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect,.tablet.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--right.sc-zonos-collect{gap:32px}.mobile.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect,.tablet.sc-zonos-collect-h .flex--wrapper.sc-zonos-collect{margin-top:0}.mobile.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect,.tablet.sc-zonos-collect-h zonos-collect-footer.sc-zonos-collect{-ms-flex-order:3;order:3;left:0}.tablet.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:56px;top:-56px}.mobile.sc-zonos-collect-h .zonos--content.sc-zonos-collect .zonos--header-right.sc-zonos-collect{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.mobile.sc-zonos-collect-h .zonos--header-wrapper.sc-zonos-collect{padding-top:28px;top:-28px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect{position:fixed;left:0;right:0;bottom:0;-webkit-transform-origin:bottom center;transform-origin:bottom center;width:100vw;background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar{width:10px}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.sc-zonos-collect::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}.mobile.sc-zonos-collect-h .zonos--collect-language-dialog.zonos--collect-language-dialog-open.sc-zonos-collect{opacity:1;-webkit-transform:scale(1);transform:scale(1)}.iframed.sc-zonos-collect-h .zonos--content.sc-zonos-collect{-ms-scroll-chaining:chained;overscroll-behavior:auto}";var V=K;var W=o("zonos_collect",function(){function o(o){var t=this;e(this,o);this.storeUnsubscribeList=[];this.onChangeLocaleListener=function(){};this.mobile=false;this.tablet=false;this.stripe=window.Zonos.stripe;this.showLanguageDialogMobile=false;this.submitLoading=false;this.collapseReview=true;this.isMobile=false;this.isTablet=false;this.isOverlayLoading=true;this.isCartCollected=false;this.isCartExpired=false;this.payInUsdConfirmDialogOpen=false;this.inventoryCheckErrorMessage=null;this.confirmationId=null;this.clientSecret=n.clientSecret;this.stripeCustomerSessionClientSecret=n.stripeCustomerSessionClientSecret;this.getBaseCurrencySettlementInfo=function(){var o=r.selectedLandedCost;if(!o){return null}var e=o.landedCost.amountSubtotals;if(!e){return null}var t=(e.discounts||0)+e.items+e.landedCostTotal+e.shipping;return{settlementAmount:t}};this.applyStripeTheme=function(){return __awaiter(t,void 0,void 0,(function(){var o;return __generator(this,(function(e){switch(e.label){case 0:o=L.appearance.theme;return[4,l({overrideTheme:this.isMobile?o:undefined,paypalEnabled:_()})];case 1:e.sent();return[2]}}))}))};this.fetchCheckoutSession=function(o){return __awaiter(t,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return[4,U("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"})];case 1:e=t.sent().json;return[2,e]}}))}))};this.checkStripePaymentIntentStatus=function(){return __awaiter(t,void 0,void 0,(function(){var o,e,t,s,c,l,r,a,d,z;return __generator(this,(function(h){switch(h.label){case 0:e=!!window.Zonos.cartData;t=new URL(window.location.href).searchParams;s=t.get("payment_intent_client_secret");c=t.get("zonosCheckoutSessionId");B("Payment intent exist, checking stripe payment intent status");if(!s){B("No stripe client secret found in the URL, proceed to order if cart data is available");return[2,{shouldAllowOrder:e}]}return[4,i({clientSecret:s})];case 1:l=h.sent(),r=l.error,a=l.status;d=new URLSearchParams(window.location.search).get("redirect_status");if(!(d&&c))return[3,3];if(!r){B("Payment intent is succeeded or in a good state to move forward, show success screen")}else{B("Payment intent failed, show status from error")}return[4,this.fetchCheckoutSession(c)];case 2:z=h.sent();this.confirmationId=((o=z===null||z===void 0?void 0:z.checkoutSession.landedCost)===null||o===void 0?void 0:o.shortId)||null;S.checkoutSessionId=c;n.clientSecret=s;void this.setToFinishStep(a);return[2,{shouldAllowOrder:false}];case 3:if(!e){B("Cart data is not available, only check payment intent status, skip order.");return[2,{shouldAllowOrder:false}]}B("Payment intent is not succeeded, proceed to order");return[2,{shouldAllowOrder:true}]}}))}))}}o.prototype.resizeListener=function(){this.isMobile=b(this.mobile);this.isTablet=v(this.tablet)};o.prototype.setToFinishStep=function(o){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){n.stripe=window.Zonos.stripe;r.step="finish";this.storybookPaymentStatusOverride=o;this.isOverlayLoading=false;return[2]}))}))};o.prototype.initCollectCart=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,s,c,n,l,u,f,m,p,g,b,v,y,k,_,C,I,O,T,U,A;return __generator(this,(function(D){switch(D.label){case 0:if(!window.Zonos.cartData){return[2]}g=(e=(o=window.Zonos.cartData)===null||o===void 0?void 0:o.items[0])===null||e===void 0?void 0:e.currencyCode;if(g){r.currency=g}b=(s=(t=window.Zonos.cartData)===null||t===void 0?void 0:t.references)===null||s===void 0?void 0:s.checkoutSessionId;v=(n=(c=window.Zonos.cartData)===null||c===void 0?void 0:c.references)===null||n===void 0?void 0:n.landedCostId;if(!v){a({messages:[j("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:L.organizationName})],title:j("Invalid session")});return[2]}if(b){B("Setting checkout session id from cart reference","info",b);S.checkoutSessionId=b}else{B("Clear checkout session id from storage so we start from a fresh session for the collect cart");S.checkoutSessionId=null}return[4,this.checkStripePaymentIntentStatus()];case 1:y=D.sent().shouldAllowOrder;if(!y){return[2]}D.label=2;case 2:D.trys.push([2,11,,12]);k=E(window.Zonos.cartData),_=k.adjustments,C=k.cartItems;return[4,d({adjustments:_,cartItems:C,landedCostId:v,shouldInitSessionOnFailure:false})];case 3:D.sent();if(!(!S.checkoutSessionId&&!b))return[3,5];return[4,z()];case 4:I=D.sent();B("stripeStoreInitCheckoutSession: ".concat(I));if(!I){throw new Error("Failed to initialize checkout session! The cart might be created with LIVE Collect quote but being used with sandbox credential")}D.label=5;case 5:if(!((!r.checkoutSession||((l=r.checkoutSession)===null||l===void 0?void 0:l.completedAt))&&b))return[3,9];return[4,this.fetchCheckoutSession(b)];case 6:O=D.sent();this.confirmationId=((u=O===null||O===void 0?void 0:O.checkoutSession.landedCost)===null||u===void 0?void 0:u.shortId)||null;if(!!(O===null||O===void 0?void 0:O.checkoutSession.completedAt)){void this.setToFinishStep("succeeded");return[2]}if(!(O===null||O===void 0?void 0:O.checkoutSession.clientSecret))return[3,8];return[4,i({clientSecret:O.checkoutSession.clientSecret})];case 7:T=D.sent().status;if(T==="processing"||T==="succeeded"){void this.setToFinishStep(T);return[2]}D.label=8;case 8:void P({endpoint:"INVALID_COLLECT_CHECKOUT_SESSION",errors:["Invalid checkout session, can not retrieve the checkout session after failing to update it"],metadata:{cartCheckoutSessionId:b,cartId:(f=window.Zonos.cartData)===null||f===void 0?void 0:f.id,cartLandedCostId:v}});throw new Error("Invalid checkout session, can not retrieve the checkout session after failing to update it");case 9:if(!r.checkoutSession){void P({endpoint:"FAIL_TO_UPDATE_CREATE_CHECKOUT_SESSION",errors:["Could not update/create checkout session for this collect cart"],metadata:{cartCheckoutSessionId:b||"N/A",cartId:(m=window.Zonos.cartData)===null||m===void 0?void 0:m.id,cartLandedCostId:v||"N/A"}});throw new Error("Could not update/create checkout session for this collect cart")}void h();U=(p=r.checkoutSession)===null||p===void 0?void 0:p.landedCost;if(!U){throw new Error("Landed cost could not be found in checkout session after creating/updating them")}return[4,w(Object.assign(Object.assign({},r.checkoutSession),{id:S.checkoutSessionId||""}))];case 10:D.sent();void x({landedCostId:U.id});void this.applyStripeTheme();return[3,12];case 11:A=D.sent();N(A);a({messages:[j("Session does not have valid landed cost. Please contact [organizationName] for assistance.",{organizationName:L.organizationName})],title:j("Invalid session")});return[3,12];case 12:this.isOverlayLoading=false;return[2]}}))}))};o.prototype.toggleLanguageDialog=function(){this.showLanguageDialogMobile=!this.showLanguageDialogMobile};o.prototype.handleStripePaymentContinue=function(){return __awaiter(this,void 0,void 0,(function(){var o,e,t,s,c,l,i,a,d;return __generator(this,(function(z){switch(z.label){case 0:void((o=n.stripeBillingAddressElement)===null||o===void 0?void 0:o.getValue());if(!((e=n.stripeLinkEventData)===null||e===void 0?void 0:e.complete)){c=document.querySelector("zonos-link-authentication");c===null||c===void 0?void 0:c.scrollIntoView({behavior:"smooth"});return[2]}if(!((t=n.stripeBillingAddressEventData)===null||t===void 0?void 0:t.complete)){l=document.querySelector(".zonos--billing-address");l===null||l===void 0?void 0:l.scrollIntoView({behavior:"smooth"});return[2]}i=n.checkoutSettlementCurrency==="USD";if(i&&n.shouldRenderPayInUsdButton&&!this.payInUsdConfirmDialogOpen){this.payInUsdConfirmDialogOpen=true;return[2]}this.payInUsdConfirmDialogOpen=false;C.paypalErrorMessage=null;n.hasPaymentError=false;this.submitLoading=true;r.inventoryCheckErrorMessage=null;return[4,u()];case 1:a=z.sent();if(!a){n.hasPaymentError=true;n.customErrorMessage=j("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:n.checkoutSettlementCurrency});this.submitLoading=false;return[2]}return[4,y()];case 2:z.sent();z.label=3;case 3:z.trys.push([3,5,,6]);return[4,f({noLandedCostCheck:true})];case 4:z.sent();r.step="finish";this.confirmationId=k.landedCostShortId||((s=r.selectedLandedCost)===null||s===void 0?void 0:s.landedCostId)||null;return[2];case 5:d=z.sent();N(d);n.hasPaymentError=true;return[3,6];case 6:this.submitLoading=false;return[2]}}))}))};o.prototype.componentWillLoad=function(){var o=this;n.stripe=window.Zonos.stripe;r.step="payment";void this.initCollectCart();this.resizeListener();this.storeUnsubscribeList=[m("clientSecret",(function(){void o.applyStripeTheme()})),I("selectedLocale",(function(){void o.applyStripeTheme()}))];B("mobile: ".concat(this.isMobile))};o.prototype.disconnectedCallback=function(){p();g();this.onChangeLocaleListener();this.storeUnsubscribeList.forEach((function(o){return o()}))};o.prototype.render=function(){var o=this;this.clientSecret=n.clientSecret;if(n.stripeCustomerSessionClientSecret){this.stripeCustomerSessionClientSecret=n.stripeCustomerSessionClientSecret}var e=this.getBaseCurrencySettlementInfo();var l=L.appearance,i=l.logoUrl,a=l.theme;var d=function(){var o="".concat(i,"?timestamp=").concat(Date.now());return t("div",{class:"zonos--logo"},o&&t("img",{alt:"".concat(L.organizationName," logo"),src:o}))};var z=A();var h=function(){var e;var s=new URLSearchParams(window.location.search);var n=s.get("zonosQaUrl");var l=s.get("zonosDebug");var i=(e=F.find((function(o){return o.code===T.selectedLocale})))===null||e===void 0?void 0:e.label;return t(c,null,t("zonos-h-stack",{class:"zonos--header-wrapper",spacing:16},t("div",{class:"zonos--logo-wrapper"},d(),z&&t("zonos-badge",{badgeColor:"orange",size:"small"},j("Test mode")),l==="1"&&t("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),n&&t("zonos-badge",{badgeColor:"purple",size:"small"},n)),t("div",{class:"zonos--header-right"},t("zonos-button",{backgroundColor:"gray-0",class:"zonos--header-right-button",onClick:function(){return o.toggleLanguageDialog()},variant:"outline"},i,t("zonos-icon",{"aria-label":"Language select",content:H,iconColor:"gray-1200"})),t("div",{class:D(["zonos--collect-language-dialog",o.showLanguageDialogMobile&&"zonos--collect-language-dialog-open"])},t("zonos-language-select",{handleOnClose:function(){return o.toggleLanguageDialog()}})))),R({content:t("zonos-text",{class:"zonos--header-title",type:"header"},k.originCompanyName?j("Customs charges for your recent purchase from [companyName] are available for payment",{companyName:k.originCompanyName}):j("Customs charges from your recent purchase are available for payment")),isLoading:k.isFetchingShippingInfo,skeletonHeight:"34px",skeletonWidth:"600px"}))};var u=function(){if(o.isOverlayLoading||n.isFetchingSession){return null}return t("div",{class:"zonos--content"},r.step!=="finish"&&r.step!=="error"&&t(c,null,(o.isMobile||o.isTablet)&&h(),t("div",{class:"zonos--left","data-theme":a},!o.isMobile&&!o.isTablet&&h(),t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},j("Billing info")),t("zonos-v-stack",{spacing:16},t("zonos-link-authentication",{titleText:""}),t("zonos-address",{titleText:"",type:"billing"})),t("zonos-collect-payment",{class:D(["zonos--collect-container"]),continueLoading:o.submitLoading,onContinueClicked:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,this.handleStripePaymentContinue()];case 1:o.sent();return[2]}}))}))}})),t("div",{class:"zonos--right","data-theme":a},t("zonos-collect-review",{mobile:o.isMobile,tablet:o.isTablet}),t("div",{class:"zonos--order-details-container"},t("zonos-collect-order-details",{collapsed:o.collapseReview,mobile:o.isMobile,onCollapseClicked:function(){o.collapseReview=!o.collapseReview}})),t("div",{class:"flex--wrapper"},t("zonos-v-stack",{spacing:16},t("zonos-collect-subtotal",null)),!o.isMobile&&!o.isTablet&&t("zonos-collect-footer",{"data-theme":a,mobile:o.isMobile,tablet:o.isTablet})))),(r.step==="finish"||r.step==="error")&&t("div",{class:"zonos--done","data-theme":a},t("div",{class:"zonos--header"},d()),t("zonos-collect-finish",{confirmationId:o.confirmationId,overrideNotification:r.step==="error"&&!!r.error?Object.assign(Object.assign({},r.error),{type:"error"}):undefined,storybookForceStatus:o.storybookPaymentStatusOverride})),(o.isMobile||o.isTablet||r.step==="finish"||r.step==="error")&&t("zonos-collect-footer",{"data-theme":a,mobile:o.isMobile,tablet:o.isTablet}))};return t(s,{class:D(["zonos--collect zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"]),"data-theme":a},u(),e&&t("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:j("Cancel"),dialogConfirmBtnText:j("Pay [orderTotal]",{orderTotal:O({amount:e.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:j("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:j("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:function(){o.payInUsdConfirmDialogOpen=false},onConfirmClicked:function(){return o.handleStripePaymentContinue()}}),t("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(o,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return o}());W.style=V}}}));
@@ -1 +0,0 @@
1
- import{r as o,h as e,F as t,H as s}from"./p-ab41bab5.js";import{s as n,a as i,b as c,i as r,c as a,d,e as l,f as h,g as u,h as m,j as p,k as z,l as g,t as f,m as k,n as w,o as v,p as y,q as b,r as C,u as x,v as S,w as T,x as I,y as A,z as O}from"./p-ce98e472.js";import{p as _,s as E,a as P,b as N}from"./p-dd19d9d8.js";import{f as j,l as L,a as D,g as U,s as R,V as $,b as B,t as F,c as M,d as K}from"./p-09aabce0.js";import{z as H,g as Z,m as V}from"./p-b2a0ab4a.js";import{b as G}from"./p-83666056.js";import{h as W,b as q,g as Y,l as Q,j as J,s as X,a as oo,i as eo}from"./p-41dd1cb8.js";import{u as to}from"./p-fc776473.js";import{_ as so,c as no,a as io,d as co,g as ro}from"./p-b2d81c98.js";import{l as ao,g as lo,b as ho}from"./p-0a377722.js";import{c as uo}from"./p-b4b7f705.js";import{c as mo}from"./p-595f5dd2.js";import{g as po}from"./p-1f894984.js";import{i as zo}from"./p-57fa64d7.js";import{s as go}from"./p-96d77739.js";import{R as fo}from"./p-08e7107d.js";import"./p-786d1c24.js";import"./p-5762e217.js";const ko=(o=!0,e)=>{var t;if(!L.localizationLoaded)return!1;if(e){const s=!!(null===(t=L.shippingZoneCountries)||void 0===t?void 0:t[e])&&!H.disabledCountries.includes(e);return o&&!s&&ao(`Checkout: ${e} is not a shippable country: ${s}`),s}return!!L.isShippableCountry||(o&&ao("Checkout: not shippable country"),!1)},wo='select[name="shippingAddress.countryCode"]';let vo=0;const yo=o=>{var e;const t=null===(e=R.enabledVariantTestKeys)||void 0===e?void 0:e.find((e=>e.testKey===o));return(null==t?void 0:t.selectedVariantKey)||null},bo=async({cartId:o,retries:e})=>{const t=Y(),{errors:s,json:n}=await W("/api/zonos-elements/get-temp-cart",{body:{isTestMode:t,options:{noOnlineStoreSettings:!0},tempCartUUID:o},headers:{"Content-Type":"application/json"},method:"POST"}),i=!n||s.length;return i&&e?(ao("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:e}),await new Promise((o=>setTimeout(o,500))),bo({cartId:o,retries:e-1})):i?null:n},Co='<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',xo=class{constructor(e){o(this,e),this.storeUnsubscribeList=[],this.isRedirectAfterOrder=!1,this.preview=!1,this.hiddenMode=!1,this.mobile=!1,this.defaultAddress=[],this.forceDialogOpen=!1,this.defaultAddressParams=[],this.defaultCustomerProfileAddress=[],this.customerProfile=null,this.open=this.forceDialogOpen,this.isOverlayLoading=!1,this.stripe=window.Zonos.stripe,this.submitLoading=!1,this.collapseReviewMobile=!0,this.isAttachError=!1,this.isMobile=!1,this.isIframed=!1,this.isLegacyCheckout=window.Zonos.isLegacyCheckout,this.confirmDialogOpen=!1,this.isCartExpired=!1,this.payInUsdConfirmDialogOpen=!1,this.inventoryCheckErrorMessage=null,this.placedOrderInfo=null,this.shouldShowFedexShippingConsentDialog=!1,this.detectedDomesticCheckoutDialogOpen=!1,this.clientSecret=c.clientSecret,this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret,this.applyStripeTheme=async()=>{var o,e,t,s;const n=(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)||H.appearance.theme;await r({overrideBorderRadius:null===(e=this.appearanceSettingsOverride)||void 0===e?void 0:e.style,overridePrimaryColor:null===(t=this.appearanceSettingsOverride)||void 0===t?void 0:t.colorPrimary,overrideSecondaryColor:null===(s=this.appearanceSettingsOverride)||void 0===s?void 0:s.colorSecondary,overrideTheme:this.isMobile?n:void 0,paypalEnabled:_()})},this.checkStripePaymentIntentStatus=async({triggeredButton:o})=>{const e=null==o?void 0:o.matches(`#${no}`),t=!!window.Zonos.cartData,s=new URL(window.location.href).searchParams,n=s.get("payment_intent_client_secret"),i=s.get("zonosCheckoutSessionId");if(!e)return ao("Checkout is triggered by user, no need to check stripe payment intent status"),{shouldAllowOrder:!0};if(ao("Payment intent exist, checking stripe payment intent status"),!n)return ao("No stripe client secret found in the URL, proceed to order if cart data is available"),{shouldAllowOrder:t};const{error:r,status:d}=await a({clientSecret:n});return new URLSearchParams(window.location.search).get("redirect_status")?(ao(r?"Payment intent failed, show status from error":"Payment intent is succeeded or in a good state to move forward, show success screen"),this.open=!0,R.checkoutSessionId=i,c.clientSecret=n,this.setToFinishStep(d),{shouldAllowOrder:!1}):t?(ao("Payment intent is not succeeded, proceed to order"),{shouldAllowOrder:!0}):(ao("Cart data is not available, only check payment intent status, skip order."),{shouldAllowOrder:!1})},this.initializeTestKeys=()=>{var o;R.enabledVariantTestKeys=(null==(o=R.enabledVariantTestKeys||[])?void 0:o.filter((o=>!(o.expiresAt&&o.expiresAt<Date.now()||!o.expiresAt))))||[];const e=H.enabledVariantTestKeys.map((o=>{var e;const t=null===(e=R.enabledVariantTestKeys)||void 0===e?void 0:e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+$,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}}));return B(e),{allSelected:!1}},this.shouldAllowHostedVsNativeTest=()=>"function"==typeof H.checkoutSettings.createCartId&&!!H.enabledVariantTestKeys.includes("hosted_vs_native"),this.registerTestHostedVsNative=async()=>{if(!this.shouldAllowHostedVsNativeTest())return;ao("[TEST] - Registering hosted vs native test");const o=yo("hosted_vs_native");if(o)return void ao(`[TEST] - Hosted vs native test already has variant selected: ${o}`);const e=await(async({testKeys:o})=>{if(0===o.length)return null;const{errors:e,json:t}=await W("/api/zonos-elements/select-variance-test",{body:{testKeys:o},method:"POST"});return e.length||!t?null:j(t)})({testKeys:["hosted_vs_native"]});if(!e)return void ao("[TEST] - Failed to get selection for hosted vs native test");const t=(({baseTestObj:o,mergeTestObj:e})=>o.map((({testKey:o})=>{const t=e.find((({testKey:e})=>e===o));return{expiresAt:(null==t?void 0:t.expiresAt)||Date.now()+$,selectedVariantKey:(null==t?void 0:t.selectedVariantKey)||null,testKey:o}})))({baseTestObj:R.enabledVariantTestKeys||[],mergeTestObj:e});B(t)},this.handleHostedVsNative=async()=>{var o;if(!this.shouldAllowHostedVsNativeTest())return{redirected:!1};const e=yo("hosted_vs_native");if(ao(`[TEST] - hosted_vs_native: ${e}`),"function"!=typeof H.checkoutSettings.createCartId)return ao("[TEST] - createCartId is not provided, skipping hosted vs native test"),{redirected:!1};if("hosted"!==e)return ao("[TEST] - Hosted vs native test is enabled for native, skipping"),{redirected:!1};if(!(null===(o=H.genericSettings)||void 0===o?void 0:o.hostedCheckoutUrl))return ao("[TEST] - Hosted checkout URL is not provided"),{redirected:!1};ao('"createCartId" is provided, start building cart');const t=await H.checkoutSettings.createCartId();let s,n=null;"object"==typeof t?(s=t.cartId,n=t.shippingData||null):s=t;const i=(()=>{const o=new URLSearchParams(window.location.search);ao("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:""},t=U(o)||L.selectedCountryCode||"US",s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerPhone"),d=e("customerZip"),l=e("customerState");return{customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:e("customerFirstName"),customerLastName:e("customerLastName"),customerName:r,customerPhone:a,customerState:l,customerZip:d}})(),c=(({cartId:o,checkoutSessionId:e,customerAddress1:t,customerAddress2:s,customerCity:n,customerCountry:i,customerEmail:c,customerFirstName:r,customerLastName:a,customerPhone:d,customerState:l,customerZip:h,hostedCheckoutUrl:u,isTestMode:m,isVariantTest:p})=>{const z=new URLSearchParams;return z.set("tempCartUUID",o),r&&z.set("customerFirstName",r),a&&z.set("customerLastName",a),c&&z.set("customerEmail",c),d&&z.set("customerPhone",d),h&&z.set("customerZip",h),n&&z.set("customerCity",n),l&&z.set("customerState",l),i&&z.set("zCountry",i),t&&z.set("customerAddress1",t),s&&z.set("customerAddress2",s),m&&z.set("zonosTestMode","1"),e&&z.set("zonosCheckoutSessionId",e),p&&z.set("zonosVariantTest","1"),`${u}?${z.toString()}`})(Object.assign(Object.assign({cartId:s,checkoutSessionId:R.checkoutSessionId||void 0,hostedCheckoutUrl:H.genericSettings.hostedCheckoutUrl,isTestMode:Y(),isVariantTest:!0},i),n));return ao(`[TEST] - Redirecting to: ${c}`),window.open(c,"_blank"),{redirected:!0}},this.formatDate=o=>o?new Date(o).toLocaleDateString():"",this.formatTime=o=>o?new Date(o).toLocaleTimeString():"",this.getCurrentLocalePageEnum=()=>{switch(d.step){case"customer-info":return"checkout_customer_info";case"shipping":return"checkout_shipping_info";case"payment":return"checkout_payment_info";default:return null}},this.getBaseCurrencySettlementInfo=()=>{const o=d.selectedLandedCost;if(!o)return null;const{landedCost:{amountSubtotals:e}}=o;return e?{settlementAmount:(e.discounts||0)+e.items+e.landedCostTotal+e.shipping}:null},this.getDefaultAddress=()=>this.defaultCustomerProfileAddress.length?this.defaultCustomerProfileAddress:Array.isArray(this.defaultAddress)&&this.defaultAddress.length?this.defaultAddress:Array.isArray(this.defaultAddress)||"object"!=typeof this.defaultAddress?this.defaultAddressParams:[this.defaultAddress],this.handleHostedOpenWindowCallback=o=>{var e;const t=null===(e=H.genericSettings)||void 0===e?void 0:e.hostedCheckoutUrl;if(!origin)return;const s=["dev.checkout.elements.zonos.com"].some((e=>o.origin.includes(e)));o.origin!==t&&!s||"zonos-checkout-session-update"!==o.data.type||(R.checkoutSessionId=o.data.checkoutSessionId)},this.captureParamsRedirectedForVariantTest=()=>{const o=new URL(window.location.href);if("1"!==o.searchParams.get("zonosVariantTest"))return;const e=o.searchParams.get("zonosCheckoutSessionId");e&&(R.checkoutSessionId=e);const t=R.enabledVariantTestKeys||[];window.Zonos.isLegacyCheckout&&(yo("hosted_vs_native")?B(t.map((o=>"hosted_vs_native"===o.testKey?Object.assign(Object.assign({},o),{selectedVariantKey:"hosted"}):o))):(t.push({expiresAt:Date.now()+$,selectedVariantKey:"hosted",testKey:"hosted_vs_native"}),B(t))),o.searchParams.delete("zonosCheckoutSessionId"),o.searchParams.delete("zonosVariantTest"),window.history.replaceState({},"",o.toString())}}async initCartInfoHandler(o){l({adjustments:d.adjustments,cartItems:o.detail})}async handleKeyPress(o){"Escape"===o.key&&this.closeDialogHandler()}async closeDialogHandler(o){var e,t;this.open&&((null==o?void 0:o.confirmed)?(this.confirmDialogOpen=!1,E("zonos-checkout-close"),this.open=this.forceDialogOpen||!1,this.preview||"finish"!==d.step||h(),d.step="customer-info",u(),m(),null===(t=(e=H.checkoutSettings).onClose)||void 0===t||t.call(e)):this.confirmDialogOpen=!0)}async buildCartAndInit(){if("function"==typeof H.checkoutSettings.createCartId){ao('"createCartId" is provided, start building cart');const o=await H.checkoutSettings.createCartId();let e;"object"==typeof o?(ao("object detected, use cartId and prefill address from createCartId","info",o),e=o.cartId,this.useShippingDataFromCreateCartId(o.shippingData),d.customerAuthenticationToken=o.customerAuthenticationToken||null):e=o,window.Zonos.cartId=e;const t=await(async o=>{const{isDgsCartId:e,isLegacyCartId:t}=so(o);if(!t&&!e)return Q("[ZONOS - loadZonos] invalid cart id"),null;const s=await bo({cartId:o,retries:5});return ao("[ZONOS - loadZonos] getting temp cart data","info",s),s?(window.Zonos.storeId=s.cartData.storeId,window.Zonos.zonosApiKey=s.cartData.credentialToken,{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}):(Q("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(e),s=null==t?void 0:t.cartData;if(!s)return Q("Failed to build cart, please try again."),!1;window.Zonos.cartData=s;const{adjustments:n,cartItems:i}=G(s);await l({adjustments:n,cartItems:i})}else if(window.Zonos.cartData){ao("tempCartUUID is provided, start building cart");const{adjustments:o,cartItems:e}=G(window.Zonos.cartData);await l({adjustments:o,cartItems:e})}else if(H.checkoutSettings.buildCartDetail&&L.selectedCountryCode){ao("build cart detail");const o=await H.checkoutSettings.buildCartDetail({countryCode:L.selectedCountryCode,currencyCode:L.targetCurrency}),e=o.filter((o=>o.amount>=0)),t=o.filter((o=>o.amount<0));ao("cartItems","info",{cartItems:o});const s=t.map((o=>({amount:o.amount,currencyCode:o.currencyCode,description:o.name||o.description||"",productId:o.productId||null,sku:o.sku||null,type:"CART_TOTAL"})));await l({adjustments:s,cartItems:e})}if(!R.checkoutSessionId){const o=await p();if(ao(`stripeStoreInitCheckoutSession: ${o}`),!o)return!1}return d.isStagingMode||z(),await this.applyStripeTheme(),this.isRedirectAfterOrder="REDIRECT_TO_SUCCESS_PAGE"===H.checkoutSettings.successBehavior||!!d.externalConfirmationPageURL,!0}reloadCheckoutSession(){window.location.reload()}handleOrderDuplication(){const o=J(localStorage.getItem("zonos--placed-order-info"));if(!o)return void localStorage.removeItem("zonos--placed-order-info");const e=Date.now()-o.time;ao(`=== Existing placed order info: ${o.orderId} - ${this.formatDate(o.time)} - elapsed in hh:ss format: ${new Date(e).toISOString().substring(11,8)}`,"warn");const t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||216e5;if(e>t)return ao(`=== Existing placed order info is older than ${t}ms, cleaning localStorage`,"warn"),void localStorage.removeItem("zonos--placed-order-info");this.placedOrderInfo=o,ao("=== Showing order duplication confirmation","warn")}recordCheckoutInfo(){R.checkoutSessionId&&to({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:R.checkoutSessionId})}confirmProceedWithOrderDuplication(){this.placedOrderInfo=null,R.checkoutSessionId&&to({attributes:[{key:"ORDER_DUPLICATION_CONSENT",value:"1"}],checkoutSessionId:R.checkoutSessionId})}markTheSessionAsAbandonedCart(){R.checkoutSessionId&&to({attributes:[{key:"WITH_ABANDONED_CART_TOKEN",value:"1"}],checkoutSessionId:R.checkoutSessionId})}handleCancelOrderDuplication(){var o;if(this.placedOrderInfo=null,this.isLegacyCheckout){const e=(null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl)||H.onlineStoreSettings.url;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}this.closeDialogHandler({confirmed:!0})}attachCheckout(){const o=H.checkoutSettings.placeOrderButtonSelector,e=H.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;if(ao(`attach checkout ${o}`),ao(`attach checkout to always trigger international checkout selector: ${e}`),!o&&!e&&!window.Zonos.cartData)return;const t=[o,e,`#${co}`,`#${no}`,`#${io}`].filter(Boolean);document.querySelectorAll(t.join(",")).forEach((t=>{t.getAttribute("data-zonos-checkout-attached")||(ao(`attached event to button ${o}`,"info",{button:t}),t.addEventListener("click",(async o=>{var s,n;const i=performance.now(),r=e&&t.matches(e),a=t.matches(`#${io}`),l=t.matches(`#${co}`)||t.matches(`#${no}`);if(!window.Zonos.isLegacyCheckout&&(!ko()||((o=!0)=>!L.localizationLoaded||!!L.isDisabledCountry&&(o&&ao("Checkout: disabled country"),!0))())&&!r&&!a&&!l)return;o.preventDefault(),o.stopPropagation(),ao("zonos checkout button clicked");const{shouldAllowOrder:h}=await this.checkStripePaymentIntentStatus({triggeredButton:o.target});if(h){if(window.Zonos.logIntervalId||(window.Zonos.logIntervalId=setInterval((()=>{(async()=>{if(0===window.Zonos.loadTimeApiInfoList.length)return;ao("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});const o={data:[...window.Zonos.loadTimeApiInfoList],storeId:window.Zonos.storeId||0};window.Zonos.loadTimeApiInfoList.length=0;const{errors:e}=await W("/api/zonos-elements/log-bulk-load-data",{body:o,method:"POST"});e.length&&(window.Zonos.loadTimeApiInfoList.push(...o.data),vo++,vo>5&&window.Zonos.logIntervalId&&clearInterval(window.Zonos.logIntervalId))})()}),2e3)),H.enabledVariantTestKeys.includes("hosted_vs_native")){this.isOverlayLoading=!0,await this.registerTestHostedVsNative();const{redirected:o}=await this.handleHostedVsNative();if(this.isOverlayLoading=!1,o)return}c.isFetchingSession=!0,this.open=!0;try{if(!await this.buildCartAndInit())throw new Error("Error building cart");null===(s=window.opener)||void 0===s||s.postMessage({checkoutSessionId:R.checkoutSessionId,type:"zonos-checkout-session-update"},"*"),g({isPreview:this.preview,sessionTimeout:54e5}),E("zonos-checkout-start"),f({checkoutSessionId:R.checkoutSessionId,eventName:"checkout_open"});const{enabled:o}=await(async()=>{const{errors:o,json:e}=await W("/api/zonos-elements/get-store-discount-enabled-status");return o.length||!(null==e?void 0:e.enabled)?{enabled:!1}:{enabled:!0}})();if(d.shouldHideDiscountInput=!o,this.handleOrderDuplication(),window.Zonos.isLegacyCheckout)(async()=>{const{elapsedTime:o}=lo(),e={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:ho},q()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};W("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})();else{(async({loadTime:o})=>{const e={cache:"miss",eventName:"jsdelivr",flag:"LOG_NATIVE_CHECKOUT_LOAD",href:window.location.href,loadTime:o,metadata:Object.assign({allLogs:ho},q()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};W("/api/zonos-elements/log-script-load",{body:e,method:"POST"})})({loadTime:performance.now()-i})}this.recordCheckoutInfo(),ro()&&this.markTheSessionAsAbandonedCart()}catch(o){if(o instanceof Error&&"Cart is expired."===o.message&&(this.isCartExpired=!0),c.isFetchingSession=!1,Q(o),this.isCartExpired)return void(c.isFetchingSession=!0);X({endpoint:"Error creating Checkout",errors:[o instanceof Error?o.toString():"Unknown error"],metadata:{allLogs:ho,cartId:window.Zonos.cartId,checkoutSessionBody:k(),href:window.location.href,storeBaseUrl:(null===(n=window.Zonos.cartData)||void 0===n?void 0:n.storeBaseUrl)||H.onlineStoreSettings.url}}),w({messages:[F("There's been an error creating your checkout session. Please reload and try again or contact support if the error persists")],title:F("Error creating Checkout")})}}}),{capture:!0,passive:!1}),H.checkoutSettings.disablePlaceOrderButtonActivation||t.removeAttribute("disabled"),t.setAttribute("data-zonos-checkout-attached","true"),t.matches(`#${co}`)&&(t.dispatchEvent(mo("click")),v(),t.remove()),t.matches(`#${no}`)&&(t.dispatchEvent(mo("click")),t.remove()))}))}appearanceSettingsOverrideChanged(){this.appearanceSettingsOverride&&this.applyStripeTheme()}useShippingDataFromCreateCartId(o){if(!o)return;ao("shipping data from createCartId result","info",Object.entries(o));const{customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:n,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:h}=o,u=new URLSearchParams(window.location.search),m=n||U(u)||L.selectedCountryCode;this.applyPrefillAddress({customerAddress1:e,customerAddress2:t,customerCity:s,customerCountry:m,customerEmail:i,customerFirstName:c,customerLastName:r,customerName:a,customerPhone:d,customerState:l,customerZip:h})}useLegacyQueryParams(){const o=new URLSearchParams(window.location.search);ao("legacy urlParams","info",Object.fromEntries(o.entries()));const e=e=>{const t=o.get(e);return t&&"undefined"!==t?t:null},t=U(o)||L.selectedCountryCode,s=e("customerCity"),n=e("customerEmail"),i=e("customerAddress1"),c=e("customerAddress2"),r=e("customerName"),a=e("customerFirstName"),d=e("customerLastName"),l=e("customerPhone"),h=e("customerZip"),u=e("customerState");this.applyPrefillAddress({customerAddress1:i,customerAddress2:c,customerCity:s,customerCountry:t,customerEmail:n,customerFirstName:a,customerLastName:d,customerName:r,customerPhone:l,customerState:u,customerZip:h})}applyPrefillAddress(o){const e=o.customerAddress1||"",t=o.customerCountry||"",s=o.customerAddress2||"",n=o.customerCity||"",i=o.customerEmail||"",c=o.customerFirstName&&o.customerLastName?`${o.customerFirstName} ${o.customerLastName}`:o.customerName||"",r=o.customerPhone||"",a=o.customerZip||"",d=o.customerState||"";e&&c&&r&&t?t&&L.shippingZoneCountries&&!(t in L.shippingZoneCountries)?ao(`Country "${t}" is not in the shipping zone, so it can not be prefilled`,"warn"):(this.defaultAddressParams=[{address:{city:n||"",country:t,line1:e,line2:s,postal_code:a,state:d},email:i,name:c,phone:r}],ao("Prefill address applied","info",{prefillAddress:this.defaultAddressParams,providedAddress:o})):ao("Missing required query params so it can not be prefilled","info",[!e&&"line1",!c&&"name",!r&&"phone",!t&&"country"].filter(Boolean).join(", "))}overrideStagingModeChanged(){d.isStagingMode=!!this.overrideStagingMode}async init(){c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,d.isStagingMode=oo(),void 0!==this.overrideStagingMode&&(d.isStagingMode=this.overrideStagingMode),(({domesticRedirectedBtnSelector:o,onInternationalCheckoutSelected:e,onShippingAddressSessionFound:t})=>{if(!window.Zonos.isBigCommerce)return;const s=async o=>{var t;const s=document.querySelector((null===(t=H.genericSettings)||void 0===t?void 0:t.bigcommerceDomesticCheckoutCountrySelector)||wo),n=(null==s?void 0:s.value)||o;if(!n)return!1;if(!ko(!1,n))return!1;e&&await e(),D({isInitializing:!1,newSelectedCountryCode:n});const c={address1:"",address2:"",city:"",countryCode:n,firstName:"",lastName:"",phone:"",postalCode:"",stateOrProvince:""};return i({address1:c.address1,address2:c.address2,city:c.city,countryCode:c.countryCode,firstName:c.firstName,lastName:c.lastName,phone:c.phone,postalCode:c.postalCode,state:c.stateOrProvince}),window.location.href="/",!0};let c=!1,r=!1;const a=new MutationObserver((()=>{var e;const i=document.querySelector(o),d=n();if(!i&&d){const o=document.createElement("button");return o.style.display="none",o.id="zonos--domestic-redirected-checkout-button",document.body.appendChild(o),null==t||t(d),void a.disconnect()}const l=window.location.pathname.includes("/checkout")&&window.Zonos.isBigCommerce,h=document.querySelector((null===(e=H.genericSettings)||void 0===e?void 0:e.bigcommerceDomesticCheckoutCountrySelector)||wo);if(!l)return void a.disconnect();if(!h)return;if(ao("Domestic checkout found - Listening for shipping country change","info",{value:h.value}),r)return;r=!0,a.disconnect();const u=setInterval((async()=>{if(!c){c=!0;try{if(await s())return void clearInterval(u);c=!1}catch(o){c=!1}}}),1e3),m=setInterval((()=>{var o;if(!window.bcStripeElements)return void clearInterval(m);const e=null===(o=window.bcStripeElements)||void 0===o?void 0:o.getElement("address");e&&(clearInterval(m),e.on("change",(o=>{const e=o.value.address.country;e&&s(e)})))}),500)}));a.observe(document.body,{childList:!0,subtree:!0})})({domesticRedirectedBtnSelector:co,onInternationalCheckoutSelected:async()=>{this.detectedDomesticCheckoutDialogOpen=!0,await new Promise((o=>setTimeout(o,2e3)))},onShippingAddressSessionFound:o=>{this.defaultAddress=[{address:{city:o.city,country:o.countryCode,line1:o.address1,line2:o.address2,postal_code:o.postalCode,state:o.state},email:"",name:`${o.firstName} ${o.lastName}`,phone:o.phone}]}}),window.Zonos&&this.useLegacyQueryParams();const o=setInterval((()=>{c.stripe=window.Zonos.stripe,this.stripe=window.Zonos.stripe,this.stripe?(this.storybookPaymentStatusOverride||(ao("init checkout"),this.preview||this.forceDialogOpen?this.buildCartAndInit():window.Zonos.isLegacyCheckout?this.attachCheckout():window&&(this.attachCheckout(),new MutationObserver((()=>{this.attachCheckout()})).observe(document.body,{childList:!0,subtree:!0}))),clearInterval(o)):ao("waiting for stripe to be loaded")}),50);setTimeout((()=>{clearInterval(o)}),1e4)}async setToFinishStep(o){d.step="finish",this.storybookPaymentStatusOverride=o}async mockCheckoutSession(o){y(o)}async triggerCheckoutInternational(){const o=document.querySelector(`#${io}`);o&&o.dispatchEvent(mo("click"))}async handleCustomerInfoContinue(){var o,e,t,s;E("zonos-checkout-customer-info"),f({checkoutSessionId:R.checkoutSessionId,eventName:"checkout_customerInfoCompleted"}),this.submitLoading=!0;const{isRequestNotReady:n}=await b();n&&"stripe"===d.addressFormRenderType&&X({endpoint:"ADDRESS_NOT_READY_AT_CUSTOMER_INFO_CONTINUE",errors:["Address not ready at customer info continue"],metadata:{address:null===(e=null===(o=c.stripeAddressEventData)||void 0===o?void 0:o.value)||void 0===e?void 0:e.address,billingAddress:null===(s=null===(t=c.stripeBillingAddressEventData)||void 0===t?void 0:t.value)||void 0===s?void 0:s.address,cartId:window.Zonos.cartId}});const i=o=>{"customer-info"===d.step?c.isFetchingLandedCost||(d.landedCostData&&(N({currency:d.currency}),C()),this.submitLoading=!1,o&&clearInterval(o)):clearInterval(o)};i();const r=setInterval((()=>{i(r)}),20);setTimeout((()=>{clearInterval(r)}),1e4)}async handleShippingContinue(){C()}handleInventoryCheckDialogConfirm(){d.inventoryCheckErrorMessage=null,this.isLegacyCheckout||this.closeDialogHandler({confirmed:!0})}handleCartExpiredDialogConfirm(){var o;if(this.isCartExpired=!1,this.isLegacyCheckout){const e=null===(o=window.Zonos.cartData)||void 0===o?void 0:o.storeBaseUrl;if(!e)return;return window.parent&&(window.parent.location.href=e),void(window.location.href=e)}window.parent&&(window.parent.location.href=window.location.href),window.location.reload()}async handleStripePaymentContinue(){if("USD"!==c.checkoutSettlementCurrency||!c.shouldRenderPayInUsdButton||this.payInUsdConfirmDialogOpen){if(this.payInUsdConfirmDialogOpen=!1,P.paypalErrorMessage=null,c.hasPaymentError=!1,this.submitLoading=!0,d.inventoryCheckErrorMessage=null,!await x())return c.hasPaymentError=!0,c.customErrorMessage=F("Unable to complete payment in [currency]. Please try again or select a different currency. If the issue persists, contact our support team for assistance.",{currency:c.checkoutSettlementCurrency}),void(this.submitLoading=!1);try{d.inventoryCheckErrorMessage=await S()}catch(o){d.inventoryCheckErrorMessage=F("Unable to check inventory. Please try again.")}if(d.inventoryCheckErrorMessage)this.submitLoading=!1;else{try{await T(),C(),m()}catch(o){Q(o),E("zonos-checkout-payment-fail"),c.hasPaymentError=!0,c.shouldInventoryRefund&&(I(),c.shouldInventoryRefund=!1)}this.submitLoading=!1}}else this.payInUsdConfirmDialogOpen=!0}async handleFinishClick(){if(A(),this.preview)return d.step="customer-info",void await this.init();if(h(),window.Zonos.isLegacyCheckout&&window.Zonos.cartData){const o=window.Zonos.cartData.storeBaseUrl||H.onlineStoreSettings.url;return window.parent&&(window.parent.location.href=o),void(window.location.href=o)}const o=window.location.href.split("?")[0];this.open=!1,window.location.hostname.includes("dashboard.zonos.com")||(window.history.replaceState(window.history.state,document.title,o),window.location.reload())}handleWindowResize(){this.isMobile=eo(this.mobile),this.applyStripeTheme(),ao(`mobile: ${this.isMobile}`)}handleMobileChange(){this.isMobile=eo(this.mobile),this.applyStripeTheme(),ao(`mobile: ${this.isMobile}`)}handleAppearanceSettingsOverrideChange(){var o;(null===(o=this.appearanceSettingsOverride)||void 0===o?void 0:o.theme)&&(this.appearanceSettingsOverride.theme=Z(this.appearanceSettingsOverride.theme))}handleAddressChange(){A()}handleCustomerProfileChange(){var o,e;if(!this.customerProfile)return ao("No customer profile","info"),void(this.defaultCustomerProfileAddress=[]);ao("Customer profile found","info",{customerProfile:this.customerProfile}),this.defaultCustomerProfileAddress=(null===(e=null===(o=c.customerProfile)||void 0===o?void 0:o.locations)||void 0===e?void 0:e.map((o=>{var e;return{address:{city:o.locality,country:o.countryCode,line1:o.line1,line2:o.line2||"",postal_code:o.postalCode,state:o.administrativeArea},email:o.email||(null===(e=c.customerProfile)||void 0===e?void 0:e.email)||"",name:o.name||"",phone:o.phone||""}})))||[]}handleClientSecretChange(){ao("==== Client secret changed","info",{clientSecret:this.clientSecret,stripeCustomerSessionClientSecret:this.stripeCustomerSessionClientSecret}),this.applyStripeTheme()}handleOpenChange(){const o="data-zonos-overflow-origin",e=document.body,t=document.documentElement;if(this.open)window.Zonos.openHelloDialog(!1),e.style.overflow&&e.setAttribute(o,e.style.overflow),e.style.overflow="hidden",t.style.overflow&&t.setAttribute(o,t.style.overflow),t.style.overflow="hidden";else{this.stripeCustomerSessionClientSecret=null;const s=e.getAttribute(o),n=t.getAttribute(o);s?(e.removeAttribute(o),e.style.overflow=s):e.style.removeProperty("overflow"),n?(t.removeAttribute(o),t.style.overflow=n):t.style.removeProperty("overflow")}}componentWillLoad(){this.init(),this.isMobile=eo(this.mobile),this.isIframed=window.self!==window.top,ao(`iframed: ${this.isIframed}`),window.Zonos.isLegacyCheckout&&this.captureParamsRedirectedForVariantTest(),this.handleAppearanceSettingsOverrideChange(),this.storeUnsubscribeList=[M("selectedLocale",(()=>{this.applyStripeTheme()})),O("selectedShippingOption",(()=>{var o,e,t,s;const n=d.selectedShippingOption;(null===(o=H.genericSettings)||void 0===o?void 0:o.shouldFedExShippingConsentForCanadianShopper)&&(null===(t=null===(e=null==n?void 0:n.shippingProfile)||void 0===e?void 0:e.serviceLevel.code)||void 0===t?void 0:t.toLowerCase().startsWith("fedex."))&&"CA"===(null===(s=c.stripeAddressEventData)||void 0===s?void 0:s.value.address.country)&&(this.shouldShowFedexShippingConsentDialog=!0)}))],this.initializeTestKeys(),window.addEventListener("message",this.handleHostedOpenWindowCallback),ao(`mobile: ${this.isMobile}`)}disconnectedCallback(){A(),h(),this.storeUnsubscribeList.forEach((o=>o())),window.removeEventListener("message",this.handleHostedOpenWindowCallback)}render(){var o,n,i,r;this.customerProfile=c.customerProfile,this.clientSecret=c.clientSecret,c.stripeCustomerSessionClientSecret&&(this.stripeCustomerSessionClientSecret=c.stripeCustomerSessionClientSecret);const a="finish"!==d.step&&"error"!==d.step&&!c.stripeElements||c.isFetchingSession,{colorPrimary:l,colorSecondary:h,logoUrl:u,style:m}=V(H.appearance,this.appearanceSettingsOverride||null),p="ENABLED"===H.appearance.zonosAttribution,z=H.appearance.theme,g=l&&zo(l)?"DARK":"LIGHT",f=this.isMobile?z:g,k=this.isMobile?void 0:h,{customMessages:w}=L,v=null===(o=w.find((o=>"checkout_default"===o.pageName)))||void 0===o?void 0:o.message,y=this.getCurrentLocalePageEnum(),b=w.filter((o=>o.pageName===y)),C=this.getBaseCurrencySettlementInfo(),x=()=>{const o=this.preview?`${u}?timestamp=${Date.now()}`:u;return e("div",{class:"zonos--logo"},o&&e("img",{alt:`${H.organizationName} logo`,src:o}))},S=Y(),T=()=>{const o=new URLSearchParams(window.location.search),t=o.get("zonosQaUrl"),s=o.get("zonosDebug"),n=o.get("zonosE2ETest"),i=this.overrideStagingMode||oo();return e("zonos-v-stack",null,e("div",{class:"zonos--logo-wrapper"},x(),S&&e("zonos-badge",{badgeColor:"orange",size:"small"},F("Test mode")),i&&e("zonos-badge",{badgeColor:"red",size:"small"},F("Staging mode")),"1"===s&&e("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),t&&e("zonos-badge",{badgeColor:"purple",size:"small"},t),n&&e("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),e("zonos-checkout-progress-tabs",{backgroundColor:this.isMobile?"--zonos-elements-gray-0":null}),b.map((o=>e("zonos-custom-message",{icon:Co,message:o.message}))))},I=()=>d.checkoutSessionTimeoutShow?e("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:F("Your checkout session has expired. Please reload the page to continue."),restStateTitle:F("Session timed out"),restStateType:"Warning"},e("zonos-button",{onClick:()=>this.reloadCheckoutSession(),variant:"primary"},F("Reload"))):e("div",{class:"zonos--content",style:{"--zonos--border-radius":po({overrideBorderStyle:m})}},"finish"!==d.step&&"error"!==d.step&&e(t,null,e("div",{class:"zonos--left","data-theme":f,style:go({"--zonos--primary-color":this.isMobile?void 0:l})},!this.isMobile&&T(),"customer-info"===d.step&&e("zonos-customer-info",{continueLoading:this.submitLoading,defaultAddress:this.getDefaultAddress(),isMobile:this.isMobile,onContinueClicked:()=>this.handleCustomerInfoContinue(),submitBtnColor:k}),"shipping"===d.step&&e("zonos-shipping",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:()=>this.handleShippingContinue(),submitBtnColor:k}),"payment"===d.step&&e("zonos-checkout-payment",{continueLoading:this.submitLoading,isMobile:this.isMobile,onContinueClicked:async()=>{await this.handleStripePaymentContinue()},submitBtnColor:k})),e("div",{class:"zonos--right","data-theme":z},this.isMobile&&T(),e("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&e("zonos-currency-toggle",null),!this.isLegacyCheckout&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:fo}),noBackground:!0,onClick:()=>this.closeDialogHandler()})),e("div",{class:"flex--wrapper"},e("div",{class:"zonos--wrapper"},e("zonos-review",{collapsed:this.collapseReviewMobile,mobile:this.isMobile,onClick:()=>{this.isMobile&&(this.collapseReviewMobile=!this.collapseReviewMobile)}}),e("zonos-collapse",{collapsed:this.collapseReviewMobile&&this.isMobile},e("zonos-cart-items",null),this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",{submitBtnColor:k}),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Co,message:v})))),e("zonos-cart-restricted-items",null),!this.isMobile&&e("zonos-v-stack",{spacing:16},e("zonos-cart-subtotal",null),e("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Co,message:v}))))),("finish"===d.step||"error"===d.step)&&e("div",{class:"zonos--done","data-theme":z},e("div",{class:"zonos--header"},x(),!this.isRedirectAfterOrder&&e("zonos-button",{class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:fo}),noBackground:!0,onClick:()=>this.handleFinishClick(),theme:z})),e("zonos-checkout-finish",{borderRadius:m,onCloseClick:()=>this.handleFinishClick(),overrideNotification:"error"===d.step&&d.error?Object.assign(Object.assign({},d.error),{type:"error"}):void 0,storybookForceStatus:this.storybookPaymentStatusOverride})),e("zonos-checkout-footer",{"data-theme":z,mobile:this.isMobile,slot:this.isMobile?void 0:"dialog-footer"}));return e(s,{class:uo(["zonos--checkout zonos--elements","payment"===d.step&&"zonos--processing-payment",p&&"has-footer",this.preview&&"preview",this.isMobile&&"mobile",this.isIframed&&"iframed",this.hiddenMode&&"hidden-mode"])},this.preview?I():e("zonos-dialog",{borderStyle:m,class:"zonos--checkout-dialog","data-theme":z,height:"980px",isLoading:a,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeDialogHandler(),open:this.open,width:"1200px"},I()),e("zonos-dialog",{isLoading:!0,loadingText:F("You will be redirected to international checkout shortly."),loadingTitle:F("We detected that you are shipping to an international address."),noClickOutside:!0,noCloseButton:!0,open:this.detectedDomesticCheckoutDialogOpen,width:"450px"}),e("zonos-confirm-dialog",{class:"zonos--close-confirm-dialog",dialogCancelBtnText:F("Don't close"),dialogConfirmBtnText:F("Close"),dialogIntent:"warn",dialogOpen:this.confirmDialogOpen,dialogSubtitle:F("Would you like to close checkout and return to the site?"),dialogTitle:F("Are you sure?"),onCancelClicked:()=>{this.confirmDialogOpen=!1},onConfirmClicked:()=>this.closeDialogHandler({confirmed:!0})}),e("zonos-confirm-dialog",{class:"zonos--order-duplication-dialog",dialogCancelBtnText:F("Return to merchant site"),dialogConfirmBtnText:F("Proceed with order"),dialogIntent:"warn",dialogOpen:!!this.placedOrderInfo,dialogSubtitle:(null===(n=this.placedOrderInfo)||void 0===n?void 0:n.zonosOrderNumber)?F("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)}):F("It looks like you placed an order recently ([date] at [time]). Check your email for the order confirmation. Are you sure you want to place another one?",{date:this.formatDate((null===(i=this.placedOrderInfo)||void 0===i?void 0:i.time)||null),time:this.formatTime((null===(r=this.placedOrderInfo)||void 0===r?void 0:r.time)||null)}),dialogTitle:F("Are you sure?"),dialogWidth:530,onCancelClicked:()=>{this.handleCancelOrderDuplication()},onConfirmClicked:()=>{this.confirmProceedWithOrderDuplication()}}),e("zonos-confirm-dialog",{class:"zonos--fedex-shipping-dialog",dialogConfirmBtnText:F("Confirm"),dialogIntent:"info",dialogOpen:!!this.shouldShowFedexShippingConsentDialog,dialogSubtitle:e(t,null,F("If you select FedEx Ground as your shipping option, you'll need to complete a General Agency Agreement (GAA) after placing your order. This form allows FedEx to clear your package through Canadian customs on your behalf. FedEx will contact you directly—usually by email or phone—with instructions on how to complete the GAA. To avoid delays or the return of your package, please respond promptly to their request."),e("zonos-link",{href:"https://ftn.fedex.com/us/assets/docs/One-Time_GAA.pdf",target:"_blank"},F("View GAA Form."))),dialogTitle:F("Fedex Shipping Procedure"),dialogType:"alert",dialogWidth:500,onConfirmClicked:()=>this.shouldShowFedexShippingConsentDialog=!1}),e("zonos-confirm-dialog",{class:"zonos--inventory-check-failure-dialog",dialogConfirmBtnText:F("Return to cart"),dialogIntent:"danger",dialogOpen:!!d.inventoryCheckErrorMessage,dialogSubtitle:d.inventoryCheckErrorMessage,dialogTitle:F("Couldn't place order"),dialogType:"alert",onConfirmClicked:()=>this.handleInventoryCheckDialogConfirm()}),C&&e("zonos-confirm-dialog",{class:"zonos--pay-in-usd-dialog",dialogCancelBtnText:F("Cancel"),dialogConfirmBtnText:F("Pay [orderTotal]",{orderTotal:K({amount:C.settlementAmount,currency:"USD"})}),dialogIntent:"warn",dialogOpen:this.payInUsdConfirmDialogOpen,dialogSubtitle:F("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:F("Pay in USD (United States Dollar)?"),dialogType:"confirm",dialogWidth:480,onCancelClicked:()=>{this.payInUsdConfirmDialogOpen=!1},onConfirmClicked:()=>this.handleStripePaymentContinue()}),e("zonos-confirm-dialog",{class:"zonos--shopping-cart-expired-dialog",dialogConfirmBtnText:F("OK"),dialogIntent:"danger",dialogOpen:this.isCartExpired,dialogSubtitle:F("You are being sent back to the shop to re-add items to your cart."),dialogTitle:F("Shopping cart expired"),dialogType:"alert",onConfirmClicked:()=>this.handleCartExpiredDialogConfirm()}),e("zonos-loading-overlay",{open:this.isOverlayLoading}))}static get assetsDirs(){return["assets"]}static get watchers(){return{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],overrideStagingMode:["overrideStagingModeChanged"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"],customerProfile:["handleCustomerProfileChange"],clientSecret:["handleClientSecretChange"],stripeCustomerSessionClientSecret:["handleClientSecretChange"],open:["handleOpenChange"]}}};xo.style=".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h{z-index:2147483647;position:fixed}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto;position:relative}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.hidden-mode.sc-zonos-checkout-h{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0;z-index:-1}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}.zonos--processing-payment.sc-zonos-checkout-h{z-index:2147483646}";export{xo as zonos_checkout}