@zonos/elements 1.3.292 → 1.3.293
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.
- package/dist/cjs/{collect-Oeo5tjN5.js → collect-DnrvaXUI.js} +24 -4
- package/dist/cjs/index.cjs.js +30 -8
- package/dist/cjs/zonos-address-completion-dialog_7.cjs.entry.js +1 -1
- package/dist/cjs/zonos-airwallex-payment.cjs.entry.js +1 -1
- package/dist/cjs/zonos-collect-finish_6.cjs.entry.js +1 -1
- package/dist/cjs/zonos-collect.cjs.entry.js +1 -1
- package/dist/cjs/zonos-controller.cjs.entry.js +9 -0
- package/dist/collection/components/utils/checkout/injectDomesticElementHideStyle.js +9 -0
- package/dist/collection/scripts/_stripe.js +23 -1
- package/dist/esm/{collect-CdrR5OBy.js → collect-Eo4gtyql.js} +24 -4
- package/dist/esm/index.js +30 -8
- package/dist/esm/zonos-address-completion-dialog_7.entry.js +1 -1
- package/dist/esm/zonos-airwallex-payment.entry.js +1 -1
- package/dist/esm/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm/zonos-collect.entry.js +1 -1
- package/dist/esm/zonos-controller.entry.js +9 -0
- package/dist/esm-es5/{collect-CdrR5OBy.js → collect-Eo4gtyql.js} +4 -2
- package/dist/esm-es5/index.js +6 -6
- package/dist/esm-es5/zonos-address-completion-dialog_7.entry.js +1 -1
- package/dist/esm-es5/zonos-airwallex-payment.entry.js +1 -1
- package/dist/esm-es5/zonos-collect-finish_6.entry.js +1 -1
- package/dist/esm-es5/zonos-collect.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +6 -0
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-e0e9cff5.system.entry.js → p-06030d3b.system.entry.js} +6 -0
- package/dist/zonos-elements/{p-DzLNk-Pf.js → p-0mGRBGcf.js} +1 -1
- package/dist/zonos-elements/{p-552fbde1.system.entry.js → p-155ed3d3.system.entry.js} +6 -6
- package/dist/zonos-elements/{p-04bded81.system.entry.js → p-31043c2e.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-938fc1e4.entry.js → p-3a2da031.entry.js} +1 -1
- package/dist/zonos-elements/{p-b2dd7f02.system.entry.js → p-5967a1c1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c5bab786.entry.js → p-725e29bb.entry.js} +1 -1
- package/dist/zonos-elements/{p-c3646ae6.system.entry.js → p-7bd99479.system.entry.js} +3 -3
- package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
- package/dist/zonos-elements/{p-DNc279vN.system.js → p-CZD8WvyY.system.js} +33 -31
- package/dist/zonos-elements/{p-y7PFdTUN.system.js → p-D6qXIvFm.system.js} +52 -52
- package/dist/zonos-elements/{p-6e296228.entry.js → p-ad9ff14c.entry.js} +1 -1
- package/dist/zonos-elements/p-c9d5d8f1.entry.js +1 -0
- package/dist/zonos-elements/{p-550d4eea.entry.js → p-d8b312e5.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +6 -4
- package/dist/zonos-elements/p-82595838.entry.js +0 -1
|
@@ -48,13 +48,13 @@ o("[ZONOS - loadZonos] Retrieve new test public token ".concat(d),"info");return
|
|
|
48
48
|
var n=new URL(e).searchParams;var t=n.get("zonosQaUrl");if(!t){return null}var r=/[^a-zA-Z0-9-_]+/.test(t);if(!!r){return null}return t};
|
|
49
49
|
/**
|
|
50
50
|
* Get the Zonos QA URL and return it. Will remove `zonosQaUrl` from the url query if it doesn't exists.
|
|
51
|
-
*/var
|
|
51
|
+
*/var g=function(){
|
|
52
52
|
/**
|
|
53
53
|
* This is flag to force load cdn for testing purpose
|
|
54
54
|
* When developing, if the script load is from `dev.elements.zonos.com`,
|
|
55
55
|
* it would load script from that same domain instead of loading from cdn
|
|
56
56
|
*/
|
|
57
|
-
var e=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||e){return null}var n=O(window.location.href);var t="https://v1.3.
|
|
57
|
+
var e=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||e){return null}var n=O(window.location.href);var t="https://v1.3.293.js.zonos.com";
|
|
58
58
|
// when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
|
|
59
59
|
if(!n&&(t.includes("test.")||
|
|
60
60
|
// Vercel git domain
|
|
@@ -74,79 +74,79 @@ var e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");var n=w
|
|
|
74
74
|
* @ref https://github.com/vercel/next.js/issues/33233#issuecomment-1052349396
|
|
75
75
|
**/window.history.replaceState(window.history.state,"",t);window.location.reload();return null}));return i};
|
|
76
76
|
/* eslint-disable no-console */
|
|
77
|
-
/** Loading stripe script extracted from stripe.js repository */var
|
|
77
|
+
/** Loading stripe script extracted from stripe.js repository */var S="2025-02-24.acacia";var b="https://js.stripe.com/v3";var _=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var j=3;var z="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";var k=function(){var e=document.querySelectorAll('script[src^="'.concat(b,'"]'));for(var n=0;n<e.length;n++){var t=e[n];if(!t){continue}if(!_.test(t.src)){continue}return t}return null};var N=null;var I=function(e){var n="";var t=document.createElement("script");t.src="".concat(b).concat(n);var r=document.head||document.body;if(!r){s("Expected document.body not to be null. Stripe.js requires a <body> element.");return null}r.appendChild(t);return t};var A=function(e){
|
|
78
78
|
// Ensure that we only attempt to load Stripe.js at most once
|
|
79
|
-
if(
|
|
79
|
+
if(N!==null){return N}N=new Promise((function(n,t){if(typeof window==="undefined"||typeof document==="undefined"){
|
|
80
80
|
// Resolve to null when imported server side. This makes the module
|
|
81
81
|
// safe to import in an isomorphic code base.
|
|
82
|
-
n(null);return}if(window.Stripe){n(window.Stripe);return}try{var r=
|
|
82
|
+
n(null);return}if(window.Stripe){n(window.Stripe);return}try{var r=k();if(r&&e){console.warn(z)}else if(!r){r=I()}r===null||r===void 0?void 0:r.addEventListener("load",(function(){if(window.Stripe){n(window.Stripe)}else{t(new Error("Stripe.js not available"))}}));r===null||r===void 0?void 0:r.addEventListener("error",(function(){t(new Error("Failed to load Stripe.js"))}))}catch(e){t(e);return}}));return N};var T=function(e,n){if(!e||!e._registerWrapper){return}e._registerWrapper({name:"stripe-js",startTime:n})};var Z=function(e){if(!("version"in e)){return}var n=e.version;return typeof n==="number"||typeof n==="string"?n:undefined};var R=function(e,n,t){if(e===null){return null}var r=n[0],o=n[1];var i=Object.assign({},o);var u=Z(e);var a=typeof u==="string"&&u!==j.toString();if(a){delete i.apiVersion}else{i.apiVersion=S}var s=e(r,i);T(s,t);return s};
|
|
83
83
|
// Execute our own script injection after a tick to give users time to do their
|
|
84
84
|
// own script injection.
|
|
85
|
-
var
|
|
85
|
+
var E=function(){var e,n;return typeof window!=="undefined"&&(typeof((e=window.Zonos)===null||e===void 0?void 0:e.createCartId)==="function"||typeof((n=window.Zonos)===null||n===void 0?void 0:n.buildCartDetail)==="function")};var L=Promise.resolve().then((function(){
|
|
86
86
|
// Skip eagerly loading Stripe when no checkout cart callback is configured
|
|
87
87
|
// (e.g. a Hello-only integration). Stripe is loaded on demand instead.
|
|
88
|
-
if(!
|
|
88
|
+
if(!E()){return null}return A(null)}));var U=false;L.catch((function(e){if(!U){
|
|
89
89
|
// eslint-disable-next-line no-console
|
|
90
|
-
console.warn(e)}}));var
|
|
90
|
+
console.warn(e)}}));var C=function(){var e=[];for(var n=0;n<arguments.length;n++){e[n]=arguments[n]}return __awaiter(v,void 0,void 0,(function(){var n,t,r,o;return __generator(this,(function(i){switch(i.label){case 0:U=true;t=Date.now();return[4/*yield*/,L];case 1:if(!((n=i.sent())!==null&&n!==void 0))return[3/*break*/,2];o=n;return[3/*break*/,4];case 2:return[4/*yield*/,A(null)];case 3:o=i.sent();i.label=4;case 4:r=o;return[2/*return*/,R(r,e,t)]}}))}))};var P="tempCartUUID";
|
|
91
91
|
/**
|
|
92
92
|
* Simple function to get the cart id from the query param.
|
|
93
|
-
*/var
|
|
93
|
+
*/var D=function(){var e=new URLSearchParams(window.location.search);var n=e.get(P);return n};var F=function(e){return __awaiter(v,[e],void 0,(function(e){var n,r,u,s,d,l,f,v,m;var w=e.cartId,p=e.retries;return __generator(this,(function(e){switch(e.label){case 0:n=i();r=t();u=c()||undefined;s=new URLSearchParams;if(r.overrideShouldEnabledCustomAddress){s.set("overrideShouldEnabledCustomAddress",r.overrideShouldEnabledCustomAddress)}return[4/*yield*/,a("/api/zonos-elements/get-cart?".concat(s.toString()),{body:{isTestMode:n,renewCartExpirationToken:u,tempCartUUID:w},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:d=e.sent(),l=d.errors,f=d.json,v=d.zonosMode;m=!f||l.length;if(!(m&&p))return[3/*break*/,3];o("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:p});
|
|
94
94
|
// wait 1 second before retrying
|
|
95
95
|
return[4/*yield*/,new Promise((function(e){return setTimeout(e,500)}))];case 2:
|
|
96
96
|
// wait 1 second before retrying
|
|
97
|
-
e.sent();return[2/*return*/,
|
|
97
|
+
e.sent();return[2/*return*/,F({cartId:w,retries:p-1})];case 3:if(m){return[2/*return*/,null]}return[2/*return*/,Object.assign(Object.assign({},f),{zonosMode:v})]}}))}))};var M=function(e){return __awaiter(v,void 0,void 0,(function(){var n,t,r,i;return __generator(this,(function(u){switch(u.label){case 0:n=d(e),t=n.isDgsCartId,r=n.isLegacyCartId;if(!r&&!t){s("[ZONOS - loadZonos] invalid cart id");return[2/*return*/,null]}return[4/*yield*/,F({cartId:e,retries:5})];case 1:i=u.sent();o("[ZONOS - loadZonos] getting temp cart data","info",i);if(!i){s("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2/*return*/,null]}window.Zonos.storeId=i.cartData.storeId;window.Zonos.zonosApiKey=i.cartData.credentialToken;window.Zonos.zonosMode=i.zonosMode;return[2/*return*/,{cartData:i.cartData,settings:i.settings,storeFavicon:i.storeFaviconUrl,storeId:i.cartData.storeId,storeLogo:i.storeLogoUrl,zonosApiKey:i.cartData.credentialToken}]}}))}))};var x;
|
|
98
98
|
/**
|
|
99
99
|
* Get the load version and url based on the loadScriptSrc, if the domain that used to load `zonos.js` is in white listed domains, use currentLoadScriptUrl as the load url instead, if zonosQaUrl exists, it would also fall under the white listed domain
|
|
100
|
-
*/var
|
|
100
|
+
*/var B=function(){if(typeof document==="undefined"){return null}var e=document.querySelector('script[src*="/zonos.js"]');var n=m({loadScriptSrc:e===null||e===void 0?void 0:e.src}),t=n.currentLoadScriptUrl,r=n.isWhiteListed;if(r){return t}return null}();var G=Date.now();var K="https://v1.3.293.js.zonos.com";var V=B||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.293";var q="https://unpkg.com/@zonos/elements@1.3.293";var H="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.293";var W="https://fonts.googleapis.com";var Q=/^https:\/\/fonts\.googleapis\.com/;var Y=/** @class */function(){function e(){}return e}();e("Zonos",Y);x=Y;Y.doneInit=false;Y.cartSettings=null;
|
|
101
101
|
// if query 'zonosDebug=1' param from url, debug mode is on
|
|
102
|
-
|
|
102
|
+
Y.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);Y.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);Y._paypalMockResponse=null;Y.iframeLogType=typeof window!=="undefined"?new URLSearchParams(window.location.search).get("iframeLogType"):null;Y.isBigCommerce=false;Y.releaseDate="1792077383128";Y.isLegacyCheckout=false;Y.googleAnalyticId=null;Y.googleAnalyticReady=false;Y.facebookPixelId=null;Y.facebookPixelReady=false;Y.startLoadTime=G;Y.domain=typeof window!=="undefined"?// domain that embeds the iframe
|
|
103
103
|
window.location!=window.parent.location&&document.referrer||
|
|
104
104
|
// current domain
|
|
105
|
-
document.location.hostname:"";
|
|
105
|
+
document.location.hostname:"";Y.showBaseForeign=typeof window!=="undefined"&&window.location.search.includes("zonosShowBaseForeign");Y.overrideUseCustomAddressForm=false;Y.isCollect=false;Y.isInvoice=false;
|
|
106
106
|
/**
|
|
107
107
|
* By default, the package will load from npm
|
|
108
|
-
*/
|
|
108
|
+
*/Y.isNpm=true;Y.zonosQaUrl=null;Y.zonosQaUrlApi=null;Y.trackEventLogs=[];Y.version="v".concat("1.3.293");Y.modeAlerted=false;Y.cartData=null;Y.paypal=null;Y.zonosMode=null;Y.IframeService=r;Y.getCurrentTimestamp=function(){return(new Date).getTime()};Y.zonosController=null;Y.loadTimeApiInfoList=[];Y.logIntervalId=null;Y.init=function(e){return __awaiter(v,void 0,void 0,(function(){var n,t,r,i,u,a,c,d,f,v,m,w,p,h,O;return __generator(this,(function(S){switch(S.label){case 0:n=e.appearance,t=e.checkoutSettings,r=e.currencyConverter,i=e.helloSettings,u=e.onCountryChange,a=e.overrideCurrencyFormat,c=e.storeId,d=e.zonosApiKey;x.cartId=D();
|
|
109
109
|
// Expose the checkout cart callbacks on the global so Stripe loading can be
|
|
110
110
|
// gated on whether at least one of them is configured.
|
|
111
|
-
|
|
111
|
+
x.createCartId=t===null||t===void 0?void 0:t.createCartId;
|
|
112
112
|
// eslint-disable-next-line @typescript-eslint/no-deprecated -- intentionally mirror the (deprecated) callback so Stripe loading can be gated on it
|
|
113
|
-
|
|
113
|
+
x.buildCartDetail=t===null||t===void 0?void 0:t.buildCartDetail;if(x.doneInit){
|
|
114
114
|
// do nothing if zonos is already initialized
|
|
115
|
-
return[2/*return*/]}o("====== ZONOS DEBUG MODE: on (".concat(
|
|
115
|
+
return[2/*return*/]}o("====== ZONOS DEBUG MODE: on (".concat(x.version,") ======"));x.zonosApiKey=d;x.storeId=c;
|
|
116
116
|
// When not in iframe, providers are ready (gtag/fbq work directly). When in iframe, relay sets these after parent configures.
|
|
117
|
-
if(typeof window!=="undefined"&&window.parent===window){
|
|
117
|
+
if(typeof window!=="undefined"&&window.parent===window){x.googleAnalyticReady=true;x.facebookPixelReady=true}if(!x.isNpm)return[3/*break*/,4];o("====== ZONOS LOADING FROM NPM ======");f=g();
|
|
118
118
|
// if zonosQaUrl is available, inject the script from the zonosQaUrl and then call init again
|
|
119
|
-
if(f&&!window.isZonosPreview){o('====== RE-INJECT "zonos.js" FROM PRVIEW: '.concat(f," ======"),"info");v=document.createElement("script");v.src="".concat(f,"/dist/scripts/zonos.js");document.head.appendChild(v);v.addEventListener("load",(function(){window.Zonos.isNpm=
|
|
119
|
+
if(f&&!window.isZonosPreview){o('====== RE-INJECT "zonos.js" FROM PRVIEW: '.concat(f," ======"),"info");v=document.createElement("script");v.src="".concat(f,"/dist/scripts/zonos.js");document.head.appendChild(v);v.addEventListener("load",(function(){window.Zonos.isNpm=x.isNpm;window.Zonos.isBigCommerce=x.isBigCommerce;window.Zonos.isLegacyCheckout=x.isLegacyCheckout;window.Zonos.zonosMode=x.zonosMode;
|
|
120
120
|
// call init again after the script is loaded
|
|
121
121
|
void window.Zonos.init(e)}));v.addEventListener("error",(function(){alert('[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: '.concat(f))}));
|
|
122
122
|
// Set so won't inject the preview script again
|
|
123
123
|
window.isZonosPreview=true;return[2/*return*/]}
|
|
124
124
|
// zonosApiKey is required if tempCartUUID in query params are not provided
|
|
125
|
-
if(!d&&!
|
|
125
|
+
if(!d&&!x.cartId){s("Zonos API key is required unless `tempCartUUID` is provided in url query params.");return[2/*return*/]}if(!(!x.cartData&&x.cartId))return[3/*break*/,2];o("Initialize cart data");return[4/*yield*/,M(x.cartId)];case 1:m=S.sent();if(!m){s("Failed to get cart data");return[2/*return*/]}x.cartData=m.cartData;x.zonosApiKey=m.zonosApiKey;x.cartSettings=m.settings;S.label=2;case 2:return[4/*yield*/,y()];case 3:w=S.sent();if(w){x.zonosApiKey=w}S.label=4;case 4:p=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");h=x.cartId&&x.cartData||!!p;
|
|
126
126
|
// inject hidden button to body to trigger checkout right away if we have cartData or stripe client secret
|
|
127
|
-
if(h){o("Cart data or stripe client secret is available, inject hidden button and trigger checkout");O=document.createElement("button");O.style.display="none";O.id="".concat(l);document.body.appendChild(O)}o("init zonos");
|
|
127
|
+
if(h){o("Cart data or stripe client secret is available, inject hidden button and trigger checkout");O=document.createElement("button");O.style.display="none";O.id="".concat(l);document.body.appendChild(O)}o("init zonos");x.restoreNativeBrowserFunctions();
|
|
128
128
|
// inject custom script for hosted checkout if can find it in metadata
|
|
129
|
-
|
|
129
|
+
x.injectCustomScriptForHostedCheckout();
|
|
130
130
|
// inject zonos cdn
|
|
131
|
-
|
|
131
|
+
x.injectZonosCdn();
|
|
132
132
|
// inject css for zonos elements
|
|
133
|
-
|
|
133
|
+
x.injectZonosCss();
|
|
134
134
|
// inject fonts for zonos elements
|
|
135
|
-
|
|
135
|
+
x.injectFonts();
|
|
136
136
|
// inject checkout international button
|
|
137
|
-
|
|
137
|
+
x.injectCheckoutInternationalButton();
|
|
138
138
|
// init zonos controller
|
|
139
|
-
|
|
139
|
+
x.injectController({config:{appearance:n,checkoutSettings:t,currencyConverter:r,helloSettings:i,onCountryChange:u,overrideCurrencyFormat:a}});x.doneInit=true;return[2/*return*/]}}))}))};
|
|
140
140
|
/**
|
|
141
141
|
* Inject the hidden international checkout button to trigger checkout regardless of shipping zones
|
|
142
|
-
*/
|
|
142
|
+
*/Y.injectCheckoutInternationalButton=function(){if(!document.querySelector("#".concat(f))){
|
|
143
143
|
// inject the hidden international checkout button
|
|
144
|
-
var e=document.createElement("button");e.id=f;e.style.display="none";document.body.appendChild(e)}};
|
|
144
|
+
var e=document.createElement("button");e.id=f;e.style.display="none";document.body.appendChild(e)}};Y.injectCustomScriptForHostedCheckout=function(){var e=x.cartData;var n=(e===null||e===void 0?void 0:e.metadata)||[];var t=n.find((function(e){return e.key==="customHeaderScript"}));var r=n.find((function(e){return e.key==="customFooterScript"}));
|
|
145
145
|
// googleAnalyticId / facebookPixelId are set by customHTML in checkoutSettings (e.g. <script>window.Zonos.googleAnalyticId = "G-XXX"; window.Zonos.facebookPixelId = "1234567890";<\/script>), injected by zonos-controller
|
|
146
146
|
// Only inject the script if checkout is on Zonos hosted checkout and custom script is available
|
|
147
|
-
if(!window.Zonos.isLegacyCheckout||!t&&!r){o("Skip injecting custom script for hosted checkout","info",{footerScript:r,headerScript:t,isLegacyCheckout:window.Zonos.isLegacyCheckout});return}if(t){o("Injecting custom header script");var i=document.createElement("script");i.textContent=t.value;document.head.appendChild(i)}if(r){o("Injecting custom footer script");var i=document.createElement("script");i.textContent=r.value;document.body.appendChild(i)}};
|
|
147
|
+
if(!window.Zonos.isLegacyCheckout||!t&&!r){o("Skip injecting custom script for hosted checkout","info",{footerScript:r,headerScript:t,isLegacyCheckout:window.Zonos.isLegacyCheckout});return}if(t){o("Injecting custom header script");var i=document.createElement("script");i.textContent=t.value;document.head.appendChild(i)}if(r){o("Injecting custom footer script");var i=document.createElement("script");i.textContent=r.value;document.body.appendChild(i)}};Y.displayCurrency=function(){var e=document.querySelector("zonos-hello");if(e){void e.displayCurrency()}};Y.triggerCheckoutInternational=function(){return __awaiter(v,void 0,void 0,(function(){var e;return __generator(this,(function(t){e=document.querySelector("#".concat(f));setTimeout((function(){if(e){e.dispatchEvent(n("click"))}}),10);return[2/*return*/]}))}))};
|
|
148
148
|
// Called openHelloDialog because the main use case is to simply open the dialog
|
|
149
|
-
|
|
149
|
+
Y.openHelloDialog=function(e){var n=document.querySelector("zonos-hello");if(n){void n.openHelloDialog(e!==null&&e!==void 0?e:true)}};Y.showNotification=function(e){var n;void((n=x.zonosController)===null||n===void 0?void 0:n.showNotification(e))};Y.updateOrganizationName=function(e){var n;void((n=x.zonosController)===null||n===void 0?void 0:n.updateOrganizationName(e))};Y.disablePlaceOrderButtons=function(e){var n=e.autoEnable,t=n===void 0?true:n,r=e.config,o=e.disable,i=e.placeOrderButtonSelector;var u;
|
|
150
150
|
// if disablePlaceOrderButtonActivation is true, do nothing
|
|
151
151
|
if((u=r.checkoutSettings)===null||u===void 0?void 0:u.disablePlaceOrderButtonActivation){return}
|
|
152
152
|
// if placeOrderAnchor is passed in the config for checkoutSettings, disable the place order button until zonos is initialized
|
|
@@ -169,7 +169,7 @@ e.removeEventListener("click",s)}))}),5e3)}}};
|
|
|
169
169
|
* Zonos elements and its dependencies are using the native browser functions.
|
|
170
170
|
* This function will restore the native browser functions that are overridden by the merchant's polyfills.
|
|
171
171
|
* If the URL parameter `useMerchantPolyfill=1` is present, keep the merchant's polyfills instead of restoring native browser functions. This allows testing checkout compatibility with merchant polyfills.
|
|
172
|
-
*/
|
|
172
|
+
*/Y.restoreNativeBrowserFunctions=function(){var e;
|
|
173
173
|
// If the URL parameter `useMerchantPolyfill=1` is present, keep the merchant's polyfills instead of restoring native browser functions.
|
|
174
174
|
var n=new URL(window.location.href).searchParams.get("useMerchantPolyfill")==="1";if(n){return}var t="zonos---native-browser";var r=document.querySelector("iframe#".concat(t));if(!r){
|
|
175
175
|
// add a hidden iframe
|
|
@@ -177,49 +177,49 @@ r=document.createElement("iframe");r.id=t;r.style.display="none";r.style.opacity
|
|
|
177
177
|
/**
|
|
178
178
|
* Override Array.from if the site is using the obsolete prototype.js (last updated 2015).
|
|
179
179
|
* If old browser is being used and Array.from is not available, just use Array from the prototype.js polyfill
|
|
180
|
-
*/var o=((e=r.contentWindow)===null||e===void 0?void 0:e.window.Array.from)||Array.from;Array.from=o;document.body.removeChild(r)};
|
|
180
|
+
*/var o=((e=r.contentWindow)===null||e===void 0?void 0:e.window.Array.from)||Array.from;Array.from=o;document.body.removeChild(r)};Y.injectController=function(e){var n=e.config;var t,r;if(document.querySelector("zonos-controller")){return}
|
|
181
181
|
// if placeOrderAnchor is passed in the config for checkoutSettings, disable the place order button until zonos is initialized
|
|
182
|
-
if((t=n.checkoutSettings)===null||t===void 0?void 0:t.placeOrderButtonSelector){var i=n.checkoutSettings.placeOrderButtonSelector;
|
|
182
|
+
if((t=n.checkoutSettings)===null||t===void 0?void 0:t.placeOrderButtonSelector){var i=n.checkoutSettings.placeOrderButtonSelector;x.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:i});
|
|
183
183
|
// create a mutation observer to see if any new elements that match our selector is added to the DOM
|
|
184
|
-
var u=new MutationObserver((function(){
|
|
184
|
+
var u=new MutationObserver((function(){x.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:i})}));u.observe(document.body,{childList:true,subtree:true})}
|
|
185
185
|
// if alwaysTriggerInternationalCheckoutSelector is passed in the config for checkoutSettings, disable the place order button until zonos is initialized
|
|
186
|
-
if((r=n.checkoutSettings)===null||r===void 0?void 0:r.alwaysTriggerInternationalCheckoutSelector){var a=n.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;
|
|
186
|
+
if((r=n.checkoutSettings)===null||r===void 0?void 0:r.alwaysTriggerInternationalCheckoutSelector){var a=n.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;x.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:a});
|
|
187
187
|
// create a mutation observer to see if any new elements that match our selector is added to the DOM
|
|
188
|
-
var u=new MutationObserver((function(){
|
|
188
|
+
var u=new MutationObserver((function(){x.disablePlaceOrderButtons({config:n,disable:true,placeOrderButtonSelector:a})}));u.observe(document.body,{childList:true,subtree:true})}var c=document.createElement("zonos-controller");c.config=n;c.zonosApiKey=x.zonosApiKey||"";c.addEventListener("stripeInitEvent",(function(e){return __awaiter(v,void 0,void 0,(function(){var n,t;return __generator(this,(function(r){switch(r.label){case 0:n=e.detail;o("loading Stripe");return[4/*yield*/,C(n.publishableKey)];case 1:t=r.sent();if(!t){s("API seems to be invalid or missing. Failed to load Stripe");return[2/*return*/]}window.Zonos.stripe=t;if(window.Zonos.isCollect){void c.initCollectElement(t)}else if(window.Zonos.isInvoice){void c.initInvoiceElement(t)}else{void c.initCheckoutElement(t)}return[2/*return*/]}}))}))}));document.body.appendChild(c);
|
|
189
189
|
// set zonos controller to be global
|
|
190
|
-
|
|
190
|
+
x.zonosController=c;o("Zonos controller injected!")};Y.injectScript=function(e){var n=e.cdnType,t=e.isModule,r=e.theRestUrl;var i=x.getZonosUrl(n);var u="".concat(i,"/").concat(r);var a=function(){var e=document.querySelector('script[src="'.concat(u,'"]'));return!!e};if(a()){o('Zonos script "'.concat(u,'" already exists in the document'),"warn");return}var c=document.head||document.body;
|
|
191
191
|
// init zonos elements when the zonosKey is valid
|
|
192
192
|
// inject esmodule cdn for zonos elements
|
|
193
193
|
var d=document.createElement("script");if(!!t){d.type="module"}else{d.noModule=true}d.src=u;d.crossOrigin="anonymous";d.onerror=function(){s("Failed to load ".concat(d.src));var e=h(n);
|
|
194
194
|
// if next fallback cdn type exists, inject the script with the next fallback cdn type
|
|
195
|
-
if(!e){return}
|
|
195
|
+
if(!e){return}x.injectScript({cdnType:e,isModule:t,theRestUrl:r})};c.appendChild(d)};
|
|
196
196
|
/**
|
|
197
197
|
* We now support loading Zonos via npm. For clients using npm, `zonosBase` will always load from the server side. Therefore, the `zonosLoadUrl` defined earlier won't work since it lacks access to client-side APIs such as `window` and `document`.
|
|
198
|
-
*/
|
|
198
|
+
*/Y.getZonosUrl=function(e){var n=function(){switch(e){case"jsdelivr":return V;case"unpkg":return q;case"cdnjs":return H;case"vercel":return K}};
|
|
199
199
|
// To ensure that sites using zonos-elements load the script from a specific domain when using npm, we need to check for zonosQaUrl and use it if available. Otherwise it will always load from the compiled versioned domain
|
|
200
|
-
if(
|
|
200
|
+
if(x.isNpm){var t=g();
|
|
201
201
|
// Default to hard coded domain if zonosQaUrl is not available
|
|
202
|
-
return t||n()}return n()};
|
|
202
|
+
return t||n()}return n()};Y.injectZonosCdn=function(){
|
|
203
203
|
// init zonos elements when the zonosKey is valid
|
|
204
204
|
// inject esmodule cdn for zonos elements
|
|
205
|
-
|
|
205
|
+
x.injectScript({cdnType:p,isModule:true,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"});
|
|
206
206
|
// inject non module cdn for zonos elements
|
|
207
|
-
|
|
207
|
+
x.injectScript({cdnType:p,isModule:false,theRestUrl:"dist/zonos-elements/zonos-elements.js"});o("Zonos cdn script injected!")};Y.injectStylesheet=function(e){var n=e.cdnType,t=e.theRestUrl;var r=x.getZonosUrl(n);var o=document.head||document.body;
|
|
208
208
|
// inject preconnect css for zonos elements
|
|
209
|
-
var i=document.createElement("link");i.rel="preconnect";i.href="".concat(
|
|
209
|
+
var i=document.createElement("link");i.rel="preconnect";i.href="".concat(K,"/");o.appendChild(i);
|
|
210
210
|
// inject css for zonos elements
|
|
211
211
|
var u=document.createElement("link");u.rel="stylesheet";u.href="".concat(r,"/").concat(t);u.onerror=function(){s("Failed to load ".concat(u.href));var e=h(n);
|
|
212
212
|
// if the css failed to load, try to load the next fallback cdn if exists
|
|
213
|
-
if(!e){return}
|
|
213
|
+
if(!e){return}x.injectStylesheet({cdnType:e,theRestUrl:t})};o.appendChild(u)};Y.injectZonosCss=function(){var e=function(){return!!document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')};if(e()){o("Zonos style links already injected","warn");return}
|
|
214
214
|
// inject css for zonos elements
|
|
215
|
-
|
|
215
|
+
x.injectStylesheet({cdnType:p,theRestUrl:"dist/zonos-elements/zonos-elements.css"});o("Zonos style css injected!")};Y.injectFonts=function(){var e=function(){var e=document.fonts.check("1em Inter");if(e){o("Inter font already loaded","warn");return}var n=document.querySelectorAll('link[rel="stylesheet"][href^="'.concat(W,'"]'));for(var t=0;t<n.length;t++){var r=n[t];if(!r){continue}if(Q.test(r.href)){continue}return r}return null};if(e()){o("Inter font already injected","warn");return}var n=document.head||document.body;
|
|
216
216
|
// inject font css for zonos elements
|
|
217
|
-
var t=document.createElement("link");t.rel="preconnect";t.href=
|
|
217
|
+
var t=document.createElement("link");t.rel="preconnect";t.href=W;n.appendChild(t);
|
|
218
218
|
// inject font css for zonos elements
|
|
219
|
-
var r=document.createElement("link");r.rel="stylesheet";r.href="".concat(
|
|
219
|
+
var r=document.createElement("link");r.rel="stylesheet";r.href="".concat(W,"/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap");n.appendChild(r);o("Zonos font injected!")};
|
|
220
220
|
// apply font for zonos elements and inject font if needed
|
|
221
|
-
|
|
221
|
+
Y.setupGoogleFont=function(e){var n;void((n=x.zonosController)===null||n===void 0?void 0:n.setupGoogleFont(e))};
|
|
222
222
|
// this function is to inject google font to the browser, not apply the font for zonos elements, to apply the font and inject font if needed, use `setupGoogleFont` instead
|
|
223
|
-
|
|
223
|
+
Y.injectSupportGoogleFont=function(e){var n;o("[FONT] injecting ".concat(e));var t=(n=e.match(/family=(.*?):/))===null||n===void 0?void 0:n[1];var r=document.head||document.body;
|
|
224
224
|
// inject font css for zonos elements
|
|
225
|
-
if(!document.querySelector('link[rel="preconnect"][href^="'.concat(
|
|
225
|
+
if(!document.querySelector('link[rel="preconnect"][href^="'.concat(W,'"]'))){var i=document.createElement("link");i.rel="preconnect";i.href=W;r.appendChild(i)}if(document.querySelector('link[rel="stylesheet"][href="'.concat(e,'"]'))){o("[FONT] ".concat(t," font already injected"),"warn");return}var u=document.createElement("link");u.rel="stylesheet";u.href=e;r.appendChild(u);o("[FONT] ".concat(t," font injected!"))};var J=e("checkoutSessionMutableAttributeKeys",["ZONOS_FORM_TYPE_USING","APP_VERSION","APP_VERSION_NPM_INTEGRATION","LEGACY_CHECKOUT_FACADE"]);var $=e("checkoutSessionImmutableAttributeKeys",["ORDER_DUPLICATION_CONSENT","WITH_ABANDONED_CART_TOKEN"]);var X=e("checkoutSessionAttributeKeys",__spreadArray(__spreadArray([],J,true),$,true))}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,d as e,h as t,F as s,a as n,g as l}from"./p-_lt63o7c.js";import{b as a,d as i,j as c,e as r,k as d,c as h}from"./p-DzLNk-Pf.js";import{b as p,c as m,t as f,P as u,H as b,Q as z,d as y,x as g,I as x}from"./p-FRWZayxL.js";import{s as v,c as w,a as k,b as C}from"./p-7abqRc9V.js";import{t as L,s as I,k as S,l as j,y as H}from"./p-clDfq9AL.js";import{z as P}from"./p-W82paT5F.js";import{h as Z,s as _,g as M,i as D,a as B}from"./p-DE4a-QD5.js";import{c as W}from"./p-XQfWgQLB.js";import{g as F}from"./p-C_z9WL8a.js";import{l as U,b as T}from"./p-BJmZPrZl.js";import{i as V,a as R}from"./p-DGlnuxEX.js";import{c as $}from"./p-BJHSB96f.js";import{s as E}from"./p-D-bZg-Pc.js";import{r as A}from"./p-Mrz_lnC1.js";import{p as N}from"./p-CFbfEmjN.js";import{r as O}from"./p-BXjdMMUy.js";import"./p-YdrG78th.js";import"./p-Cye-evFK.js";import"./p-CICjAi70.js";import"./p-sz4L-ZnB.js";const Q=class{constructor(t){o(this,t),this.closeClick=e(this,"closeClick",7),this.borderRadius="ROUNDED",this.confirmationId=null,this.isLoading=!0,this.notificationType="success",this.notificationTitle="",this.notificationMessages=[],this.notificationActionText=L("Keep shopping"),this.order=null,this.isWaitingToRedirect=!0,this.pullOrder=async()=>{var o,e;const t=I.checkoutSessionId,s=new URLSearchParams;s.set("checkoutSessionId",t||"");const{baseUrl:n,errors:l,json:a}=await Z(`/api/zonos-elements/get-order?${s.toString()}`);return l.length||!(null==a?void 0:a.id)?{baseUrl:n,order:null}:(await(null===(e=(o=P.checkoutSettings).onOrderSuccess)||void 0===e?void 0:e.call(o,{zonosApiRoute:n,zonosOrder:a})),{baseUrl:n,order:a})},this.handleSuccessBehavior=async()=>{this.isLoading=!1,await this.getPullOrder()},this.getPullOrder=async(o=0)=>{var e,t;0===o&&U("=== Start to poll for order info","info");const{baseUrl:s,order:n}=await this.pullOrder(),l=!!(null===(t=null===(e=null==n?void 0:n.references)||void 0===e?void 0:e.find((o=>"zonosOrderNumber"===(null==o?void 0:o.key))))||void 0===t?void 0:t.value),a=I.checkoutSessionId,i=parseFloat(new URLSearchParams(window.location.search).get("maxPollingRetries")||"0")||30;U(`=== Polling order (${o} attemps)`,"info"),n?(U("=== CollectOrder info found","info"),o>10&&_({endpoint:`${s}/api/zonos-elements/get-order?checkoutSessionId=${a}&orderId=${n.id}`,errors:[`Collect order found after ${o} attempts`],metadata:{allLogs:T,checkoutSessionId:I.checkoutSessionId||"",orderId:n.id,storeId:P.storeId}}),this.order=n):n&&l||!(o<i)?_({endpoint:`${s}/api/zonos-elements/get-order?checkoutSessionId=${a}`,errors:[`Collect order not found after ${i} attempts`],metadata:{allLogs:T,checkoutSessionId:I.checkoutSessionId||"",storeId:P.storeId}}):(await new Promise((o=>setTimeout(o,1e3))),await this.getPullOrder(o+1))},this.checkStripePaymentStatus=async()=>{const o=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||p.clientSecret;if(o||this.storybookForceStatus){const{error:e,messages:t,status:s}=await m({clientSecret:o,storybookForceStatus:this.storybookForceStatus}),n="requires_action"===s||e;this.notificationType=n?"error":"success",this.notificationMessages=t||[],this.notificationTitle=L(n?"Payment failed":"You're all set!"),U("=== Payment intent retrieve status","info",{clientSecret:o,error:e,messages:t,status:s});const l=new URL(window.location.href);if(l.searchParams.delete("payment_intent_client_secret"),l.searchParams.delete("payment_intent"),l.searchParams.delete("redirect_status"),l.searchParams.delete("zonosCheckoutSessionId"),window.history.replaceState({},"",l.toString()),e&&(null==t?void 0:t.length))v({event:"zonos-checkout-payment-fail"}),_({endpoint:"Stripe payment failed",errors:[`Payment intent "${o.split("_secret_")[0]||o}" status: ${s} - checkout session: ${I.checkoutSessionId}`],metadata:{allLogs:T,credentialToken:window.Zonos.zonosApiKey}});else{v({event:"zonos-checkout-success"}),f({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,u(),b(),I.checkoutSessionId=null},this.getAirwallexSessionInfo=async()=>{if(a.paymentIntentId)return{isCompleted:!1,paymentIntentId:a.paymentIntentId};const o=I.checkoutSessionId;if(!o)return{isCompleted:!1,paymentIntentId:null};const{json:e}=await Z("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"}),t=null==e?void 0:e.checkoutSession;return{isCompleted:!(!(null==t?void 0:t.completedAt)&&!(null==t?void 0:t.order)),paymentIntentId:(null==t?void 0:t.paymentIntentId)||null}},this.checkAirwallexPaymentStatus=async()=>{const o=a.paymentConfirmed,e="succeeded"===this.storybookForceStatus,{isCompleted:t,paymentIntentId:s}=await this.getAirwallexSessionInfo(),{status:n}=s?await i(s):{status:null},l=o||e||t||r(n),{messages:h}=c(o||e||t?"SUCCEEDED":n);if(U("=== Airwallex payment intent retrieve status","info",{forcedSuccess:e,isCompleted:t,isPaid:l,paymentIntentId:s,sdkConfirmed:o,status:n}),this.notificationType=l?"success":"error",this.notificationTitle=L(l?"You're all set!":"Payment failed"),this.notificationMessages=h,l){v({event:"zonos-checkout-success"}),f({checkoutSessionId:I.checkoutSessionId,eventName:"checkout_orderCompleted"});const o=W("zonos-checkout-success",{message:"Zonos Checkout successfully processed order"});document.dispatchEvent(o),await this.handleSuccessBehavior()}else v({event:"zonos-checkout-payment-fail"}),_({endpoint:"Airwallex payment failed",errors:[`Payment intent "${s}" status: ${n} - checkout session: ${I.checkoutSessionId}`],metadata:{allLogs:T,credentialToken:window.Zonos.zonosApiKey}});this.isLoading=!1,u(),b(),d(),I.checkoutSessionId=null},this.checkStagingOrderStatus=async()=>{this.notificationType="success",this.notificationTitle=L("You're all set!"),this.notificationMessages=z("succeeded").messages,await this.handleSuccessBehavior(),u(),b(),w(),I.checkoutSessionId=null},this.checkPaypalPaymentStatus=async()=>{if(k.paypalErrorMessage)return this.notificationType="error",this.notificationTitle=L("Payment failed"),this.notificationMessages=[k.paypalErrorMessage],void(this.isLoading=!1);this.isLoading=!1,k.orderIdCreated&&(v({event:"zonos-checkout-success"}),f({checkoutSessionId:I.checkoutSessionId,eventName:"checkout_orderCompleted"}),this.notificationType="success",this.notificationTitle=L("You're all set!"),this.notificationMessages=z("succeeded").messages,await this.handleSuccessBehavior()),u(),b(),w(),I.checkoutSessionId=null},this.getReceiptUrl=({cartId:o})=>{const e=new URL(`${window.location.origin}/receipt`);e.searchParams.set("referenceId",o),M()&&e.searchParams.set("zonosTestMode","1");const t=new URLSearchParams(window.location.search).get("zonosQaUrl");return t&&e.searchParams.set("zonosQaUrl",t),e.toString()}}componentDidLoad(){if(this.overrideNotification)return this.notificationType=this.overrideNotification.type,this.notificationTitle=this.overrideNotification.title,this.notificationMessages=this.overrideNotification.messages,void(this.isLoading=!1);y.isStagingMode?this.checkStagingOrderStatus():"AIRWALLEX"===h.paymentProcessor?this.checkAirwallexPaymentStatus():k.orderIdCreated?this.checkPaypalPaymentStatus():this.checkStripePaymentStatus()}render(){const o=window.Zonos.cartId;return t(n,{key:"af26499a2062cf495d4c46a7763ed988a4da0669",class:"zonos--checkout-finish zonos--elements",style:{"--zonos--border-radius":F({overrideBorderStyle:this.borderRadius})}},!this.isLoading&&t("div",{key:"54fb28be3daee7dd1d63f1dcbdb9a84354fcdb6c",class:"zonos--finish-details"},t("div",{key:"9c71e5dbd23e613e1038924f14c0465d94dbad07",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:"3285f4bb8854d5bab6eef487d2b2ae3556794998",class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),this.confirmationId&&t("zonos-badge",{key:"4cecd6f15ed26fe1e525c01a48e3961845e6f6d8",badgeColor:"gray"},this.confirmationId),t("zonos-text",{key:"dd7c4011d4d7f92fcd19d53e945adf42f2b3f05e",class:"zonos--subtitle",textColor:"gray-600"},this.notificationMessages.map((o=>t(s,null,o,t("br",null))))),this.order&&o&&t("div",{key:"a11bd49a754d32dd15dc34f2311f9706d459f07b",class:"zonos--button-container"},t("zonos-button",{key:"305bcf958a1772cc123414285522e9e0f0b1a839",onClick:()=>{window.open(this.getReceiptUrl({cartId:o}),"_blank")},size:"lg",variant:"primary"},L("View receipt"))))))}static get assetsDirs(){return["assets"]}};Q.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:24px;border-radius:var(--zonos--border-radius, 10px);gap:24px;margin-top:24px;background-color:var(--zonos-elements-gray-50);padding:48px}:host .zonos--finish-details{max-width:640px;min-width:300px;line-height:24px;width:0 auto;margin:auto}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .zonos--finish-button-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto;margin-top:48px;max-width:300px}:host .zonos--button-container{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto}:host .zonos--subtitle{text-align:center}:host .zonos--order-number{background-color:var(--zonos-elements-gray-0);border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800);border-radius:var(--zonos-elements-radius-6);padding:4px 8px}";const X=class{constructor(e){o(this,e),this.mobile=!1,this.tablet=!1,this.showLanguageDialog=!1,this.isMobile=!1,this.isTablet=!1}handleGlobalClick(o){!this.el.contains(o.target)&&this.showLanguageDialog&&(this.showLanguageDialog=!1)}toggleLanguageDialog(){this.showLanguageDialog=!this.showLanguageDialog}handleMobileChange(){this.isMobile=V(this.mobile)}handleTabletChange(){this.isTablet=R(this.tablet)}componentWillLoad(){this.isMobile=V(this.mobile),this.isTablet=R(this.tablet)}render(){var o;const e=null===(o=S.find((o=>o.code===j.selectedLocale)))||void 0===o?void 0:o.label,l="gray-1000";return t(n,{key:"7733eba3e2253cc976484a9da290f66afd6ef93d",class:$(["zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},t("div",{key:"2c5a058034844d818010f4002704fa17e6fd9a46",class:"zonos--collect-footer"},t("div",{key:"bffe2afd93ca0531b7eea825a7fd69d68b7aa308",class:"zonos--collect-locale-wrapper"},E()&&t(s,{key:"5469f522ea7b4b3f25fd7c0a63e717c29e34a84c"},t("zonos-button",{key:"1c88778482c2960cf2a5e55beeda3f3c7f21b950",buttonColor:l,class:"zonos--collect-footer-language-button",icon:t("zonos-icon",{"aria-label":"Language select",content:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM11.4709 5.80634C11.7686 5.53723 11.9541 5.5 12 5.5C12.0459 5.5 12.2314 5.53723 12.5291 5.80634C12.8115 6.06164 13.1289 6.46913 13.4271 7.03651C13.9505 8.03191 14.3838 9.46098 14.48 11.25H9.51996C9.61624 9.46098 10.0495 8.03191 10.5729 7.03651C10.8711 6.46913 11.1885 6.06164 11.4709 5.80634ZM8.01802 11.25C8.11591 9.23031 8.60319 7.55958 9.24516 6.33849C9.29983 6.23451 9.35585 6.13335 9.41312 6.03514C7.32916 6.94017 5.81218 8.90533 5.5428 11.25H8.01802ZM5.5428 12.75H8.01802C8.11591 14.7697 8.60319 16.4404 9.24516 17.6615C9.29983 17.7655 9.35585 17.8666 9.41312 17.9649C7.32916 17.0598 5.81218 15.0947 5.5428 12.75ZM9.51996 12.75H14.48C14.3838 14.539 13.9505 15.9681 13.4271 16.9635C13.1289 17.5309 12.8115 17.9384 12.5291 18.1937C12.2314 18.4628 12.0459 18.5 12 18.5C11.9541 18.5 11.7686 18.4628 11.4709 18.1937C11.1885 17.9384 10.8711 17.5309 10.5729 16.9635C10.0495 15.9681 9.61624 14.539 9.51996 12.75ZM15.982 12.75C15.8841 14.7697 15.3968 16.4404 14.7548 17.6615C14.7002 17.7655 14.6441 17.8666 14.5869 17.9649C16.6708 17.0598 18.1878 15.0947 18.4572 12.75H15.982ZM18.4572 11.25C18.1878 8.90533 16.6708 6.94017 14.5869 6.03514C14.6441 6.13335 14.7002 6.23451 14.7548 6.33849C15.3968 7.55958 15.8841 9.23031 15.982 11.25H18.4572Z" fill="currentColor"/>\n</svg>\n',iconColor:l}),onClick:()=>this.toggleLanguageDialog(),variant:"subtle"},t("span",{key:"451485445df5f34ca64a36dddd5007ce9f229173",class:"zonos--collect-locale-label"},e,t("zonos-icon",{key:"a395943215ca541f3db4d3aa6e111c87930a6d08","aria-hidden":"true",class:"zonos--collect-locale-chevron",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:l,size:18}))),t("div",{key:"46edba3f7fc8f9316b69626872e0cb478e72cbd4",class:$(["zonos--collect-language-dialog",this.showLanguageDialog&&"zonos--collect-language-dialog-open"])},t("zonos-language-select",{key:"e77a7197a218755149ee6b7f3e07a646bc95e930",handleOnClose:()=>this.toggleLanguageDialog()})))),t("div",{key:"b18dcfe4f0806f3abb6b5855321381334e5206a7",class:"zonos--collect-footer-icon-wrapper"},t("div",{key:"5c6c376fe1174cec16e9b6c029172138bc8b180a",class:"zonos--collect-footer-logo"},t("zonos-text",{key:"0899e6990f8f37cf2d604ef15ffd3db0571d5389",textColor:l},"Powered by"),t("a",{key:"853891db2db1a4d1297597a9857772503e5b4d10",href:"https://zonos.com",target:"_blank",title:"Zonos website"},t("zonos-icon",{key:"d8731023822bffdec3cfe821c67387df651de13a",autoHeight:!0,content:'<svg width="43" height="10" viewBox="0 0 43 10" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.35896 0.0640869H0.30768C0.166068 0.0640869 0.0512695 0.178886 0.0512695 0.320497V1.85896C0.0512695 2.00057 0.166068 2.11537 0.30768 2.11537H4.44439C4.54964 2.11537 4.61005 2.2352 4.54745 2.31982L0.151823 8.2615C0.0865163 8.34978 0.0512695 8.45669 0.0512695 8.56649V9.67947C0.0512695 9.82108 0.166068 9.93588 0.30768 9.93588H7.35896C7.50057 9.93588 7.61537 9.82108 7.61537 9.67947V8.14101C7.61537 7.9994 7.50057 7.8846 7.35896 7.8846H3.22226C3.117 7.8846 3.05659 7.76477 3.11919 7.68015L7.51482 1.73847C7.58013 1.65019 7.61537 1.54328 7.61537 1.43348V0.320497C7.61537 0.178886 7.50057 0.0640869 7.35896 0.0640869Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M11.718 0C10.1602 0 8.89746 1.26279 8.89746 2.82051V7.17949C8.89746 8.73721 10.1602 10 11.718 10H13.6411C15.1988 10 16.4616 8.73721 16.4616 7.17949V2.82051C16.4616 1.26279 15.1988 0 13.6411 0H11.718ZM11.718 2.05128C11.2931 2.05128 10.9487 2.39568 10.9487 2.82051V7.17949C10.9487 7.60432 11.2931 7.94872 11.718 7.94872H13.6411C14.0659 7.94872 14.4103 7.60432 14.4103 7.17949V5V2.82051C14.4103 2.39568 14.0659 2.05128 13.6411 2.05128H11.718Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M17.7437 0.436316V9.71132C17.7437 9.85293 17.8585 9.96773 18.0001 9.96773H19.5385C19.6801 9.96773 19.7949 9.85293 19.7949 9.71132V3.74801C19.7949 3.44829 19.969 3.17587 20.241 3.04996L22.1641 2.15964C22.6739 1.92363 23.2565 2.29592 23.2565 2.85769V9.71132C23.2565 9.85293 23.3713 9.96773 23.5129 9.96773H25.0513C25.193 9.96773 25.3078 9.85293 25.3078 9.71132V2.85595C25.3078 0.79631 23.1718 -0.568775 21.3027 0.296257L19.9742 0.911055C19.8685 0.959946 19.7432 0.931536 19.669 0.84187L19.2748 0.365697C19.1773 0.248019 19.0325 0.179905 18.8797 0.179905H18.0001C17.8585 0.179905 17.7437 0.294704 17.7437 0.436316Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M29.4104 0C27.8526 0 26.5898 1.26279 26.5898 2.82051V7.17949C26.5898 8.73721 27.8526 10 29.4104 10H31.3334C32.8912 10 34.1539 8.73721 34.1539 7.17949V2.82051C34.1539 1.26279 32.8912 0 31.3334 0H29.4104ZM29.4104 2.05128C28.9855 2.05128 28.6411 2.39568 28.6411 2.82051V7.17949C28.6411 7.60432 28.9855 7.94872 29.4104 7.94872H31.3334C31.7583 7.94872 32.1027 7.60432 32.1027 7.17949V2.82051C32.1027 2.39568 31.7583 2.05128 31.3334 2.05128H29.4104Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M38.2085 0.0640869H40.3889C41.8309 0.0640869 42.9999 1.23306 42.9999 2.67506C42.9999 2.79477 42.9108 2.89574 42.792 2.91059L41.1732 3.11293C41.054 3.12784 40.9486 3.03485 40.9486 2.91466C40.9486 2.47322 40.5908 2.11537 40.1493 2.11537H38.3397C37.8688 2.11537 37.4871 2.49712 37.4871 2.96803C37.4871 3.3685 37.7658 3.71501 38.1569 3.80087L40.7916 4.37922C42.0811 4.66229 42.9999 5.80462 42.9999 7.12486C42.9999 8.67735 41.7414 9.93588 40.1889 9.93588H38.0468C36.6048 9.93588 35.4358 8.76691 35.4358 7.32491C35.4358 7.2052 35.5249 7.10423 35.6437 7.08938L37.2625 6.88703C37.3817 6.87213 37.4871 6.96512 37.4871 7.08531C37.4871 7.52675 37.8449 7.8846 38.2864 7.8846H40.1176C40.5765 7.8846 40.9486 7.51252 40.9486 7.05354C40.9486 6.67478 40.6925 6.34394 40.3258 6.24901L37.5136 5.52093C36.2902 5.20422 35.4358 4.10042 35.4358 2.83676C35.4358 1.30545 36.6772 0.0640869 38.2085 0.0640869Z" fill="var(--zonos-elements-gray-700)"/>\n</svg>\n',size:42}))),t("div",{key:"ba5ae7870c1ed277142ceccf1d44276270b967d0",class:"dot"}),t("a",{key:"253dd9112d0626981473d0d0a3309cc577ea5b54",href:"https://zonos.com/docs/legal/zonos-privacy-policy",target:"_blank"},t("zonos-text",{key:"a5117f4e2194a4b5d1a5de1696763ca1e174b004",textColor:l},"Privacy policy")))))}get el(){return l(this)}static get watchers(){return{mobile:[{handleMobileChange:0}],tablet:[{handleTabletChange:0}]}}};X.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:absolute;bottom:0;left:32px;right:32px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--collect-footer{gap:16px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px;padding-left:0;-ms-flex-align:center;align-items:center;width:100%}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:16px}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo a{line-height:0}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper a{text-decoration:none}:host .zonos--collect-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--collect-footer .zonos--collect-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--collect-footer .zonos--collect-locale-wrapper{gap:4px}}:host .zonos--collect-footer .zonos--collect-locale-wrapper .zonos--collect-locale-label{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;gap:4px}:host .zonos--collect-footer .zonos--collect-language-dialog{position:absolute;bottom:36px;left:var(--language-dialog-left);background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);width:360px;max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:bottom left;transform-origin:bottom left;opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar{width:10px}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--collect-footer .zonos--collect-language-dialog.zonos--collect-language-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .dot{display:-ms-inline-flexbox;display:inline-flex;background:var(--zonos-elements-gray-400);width:6px;height:6px;border-radius:50%}:host(.mobile),:host(.tablet){background-color:var(--zonos-elements-gray-0);width:100%;position:-webkit-sticky;position:sticky;bottom:0}:host(.tablet) .zonos--collect-footer{width:100%;max-width:800px;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex}:host(.mobile) .zonos--collect-locale-wrapper{display:none}:host(.mobile) .zonos--collect-footer{-ms-flex-pack:center;justify-content:center}";const Y=class{constructor(t){o(this,t),this.collapseClicked=e(this,"collapseClicked",7),this.mobile=!0,this.landedCostId="",this.isMobile=!1,this.collapseState=this.collapsed}handleCollapseChangeFromProp(o){this.collapseState=o}handleCollapseChange(o){this.collapseClicked.emit(o)}handleWindowResize(){this.isMobile=D(this.mobile)}componentWillLoad(){this.handleWindowResize()}renderShippingAddress(){if(h.isFetchingShippingInfo)return t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},t("zonos-skeleton",{skeletonWidth:"99px"})),t("div",{class:"zonos--collect-order-shipping-info"},t("zonos-skeleton",{skeletonWidth:"152px"}),t("zonos-h-stack",{spacing:8},t("zonos-skeleton",{skeletonWidth:"75px"}),t("zonos-skeleton",{skeletonWidth:"75px"})),t("zonos-skeleton",{skeletonWidth:"50px"})));const o=h.shippingAddress;return o?t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},L("Shipping address")),t("div",{class:"zonos--collect-order-shipping-info"},[[o.location.line1,o.location.line2].filter(Boolean).join(" "),[o.location.locality,o.location.administrativeAreaCode,o.location.postalCode].filter(Boolean).join(", "),o.location.countryCode].map((o=>t("zonos-text",null,o))))):null}render(){return t(n,{class:$(["zonos--collect-order-details zonos--elements",this.isMobile&&"mobile"])},t("div",{class:"zonos--wrapper"},t("button",{class:"zonos--order-details-header",onClick:()=>{this.collapseState=!this.collapseState},type:"button"},t("zonos-text",{type:"semiBoldLabel"},L("Shipment details")),(()=>t("zonos-icon",this.collapseState?{"aria-label":"Collapse expanded section",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"}:{"aria-label":"Expand collapsed section",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"}))()),t("div",{class:"zonos--order-details-wrapper"},t("zonos-collapse",{collapsed:this.collapseState},t("div",{class:"zonos--collect-order-details-content"},t("zonos-collect-cart-items",null),t("div",{class:"zonos--collect-order-info"},t("div",{class:"zonos--collect-order-details-row"},null!==h.amountTotalPaid&&t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},L("Total paid")),t("zonos-text",null,A({amount:h.amountTotalPaid||0,isForeign:!0}))),h.originCompanyName&&t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},L("Ordered from")),t("zonos-text",null,h.originCompanyName||""))),this.renderShippingAddress()))))))}static get assetsDirs(){return["assets"]}static get watchers(){return{collapsed:[{handleCollapseChangeFromProp:0}],collapseState:[{handleCollapseChange:0}]}}};Y.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{height:100%}:host *{-ms-scroll-chaining:none;overscroll-behavior:contain}:host *::-webkit-scrollbar{width:10px}:host *::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host *::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host *::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--wrapper{overflow:auto;background-color:var(--zonos-elements-gray-50);border-radius:16px;height:100%;min-height:56px}:host .zonos--order-details-header{position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--zonos-elements-gray-50);border:none;display:-ms-flexbox;display:flex;padding:16px 16px 0 16px;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host .zonos--order-details-header:focus-visible{outline:none}:host .zonos--order-details-wrapper{position:relative;padding:0 16px 16px 16px}:host .zonos--collect-order-details-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:28px}:host .zonos--collect-order-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}:host .zonos--collect-order-info .zonos--collect-order-details-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px}:host .zonos--collect-order-info .zonos--collect-order-details-row>*{-ms-flex:1 1 150px;flex:1 1 150px}:host .zonos--collect-order-info .zonos--collect-order-details-column{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--collect-order-info .zonos--collect-order-shipping-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0}";const q=class{constructor(t){o(this,t),this.continueClicked=e(this,"continueClicked",7),this.paypalSessionFailed=e(this,"paypalSessionFailed",7),this.paypalSessionDone=e(this,"paypalSessionDone",7),this.airwallexPaymentDone=e(this,"airwallexPaymentDone",7),this.storeUnsubscribeList=[],this.continueLoading=!1,this.showErrorBanner=!1,this.hasStripePaymentError=!1,this.stagingOrderCreateErrorMessage="",this.internalContinueLoading=this.continueLoading,this.handleValidate=()=>{var o;return!!(null===(o=p.stripePaymentEventData)||void 0===o?void 0:o.complete)},this.continueClickHandler=async({currencyCode:o})=>{var e,t;if(!this.handleValidate())return null===(e=p.stripeBillingAddressElement)||void 0===e||e.getValue(),this.showErrorBanner=!0,null===(t=p.stripeElements)||void 0===t||t.submit(),void setTimeout((()=>{var o;null===(o=this.ele.querySelector("zonos-banner"))||void 0===o||o.scrollIntoView({behavior:"smooth"})}),10);p.checkoutSettlementCurrency=o,v({event:"zonos-checkout-payment-info"}),this.continueClicked.emit()},this.copyCardToClipboard=async o=>{try{await navigator.clipboard.writeText(o)}catch(e){const t=document.createElement("textarea");t.style.position="fixed",t.style.left="-1000px",t.style.top="-1000px",t.style.width="1px",t.style.height="1px",t.value=o,t.id="zonos-copy-card-number",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}window.Zonos.showNotification({message:L("Card number copied to clipboard"),timeout:4e3,type:"success"})},this.placeTestOrder=async()=>{this.internalContinueLoading=!0;const{errors:o}=await N();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)}componentWillLoad(){this.storeUnsubscribeList=[x("currency",(()=>{C({currency:y.currency})}))],C({currency:y.currency})}disconnectedCallback(){this.storeUnsubscribeList.forEach((o=>o()))}render(){var o;if("AIRWALLEX"===h.paymentProcessor)return t(n,{class:"zonos--checkout-payment zonos--elements"},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},L("Payment method")),t("zonos-airwallex-payment",{onAirwallexPaymentSuccess:()=>this.airwallexPaymentDone.emit()})));if(this.hasStripePaymentError=p.hasPaymentError,!p.stripeElements)return null;if(!p.clientSecret)return null;this.showErrorBanner&&(this.showErrorBanner=!this.handleValidate());const e=M(),l=y.isStagingMode||B(),a="external_paypal"===(null===(o=p.stripePaymentEventData)||void 0===o?void 0:o.value.type);return t(n,{class:"zonos--checkout-payment zonos--elements"},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},L("Payment method")),(()=>{if(l){const o=P.appearance.theme;return t(s,null,this.stagingOrderCreateErrorMessage&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},this.stagingOrderCreateErrorMessage),t("zonos-empty-state-payment",{emptyStateText:L("No payment method needed for staging"),theme:o}),t("div",{class:"zonos--group-btn"},t("zonos-button",{backgroundColor:this.submitBtnColor,loading:this.internalContinueLoading,onClick:()=>{this.placeTestOrder()},size:"lg",variant:this.submitBtnType},L("Place test order"))))}return p.isFetchingSession||h.isFetchingShippingInfo?null:t(s,null,this.showErrorBanner&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},L("Missing required fields. Make sure all fields are completed.")),this.hasStripePaymentError&&t("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},p.customErrorMessage||L("We couldn't complete your payment. Please verify the payment details and try again.")),k.paypalErrorMessage&&t("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},k.paypalErrorMessage),t("zonos-payment",null),t("div",{class:"zonos--group-btn"},!a&&t(s,null,t("zonos-button",{backgroundColor:this.submitBtnColor,bold:!0,isDisabled:this.continueLoading&&"USD"===p.checkoutSettlementCurrency,loading:this.continueLoading&&"USD"!==p.checkoutSettlementCurrency,onClick:async()=>{y.checkoutSession?await this.continueClickHandler({currencyCode:y.checkoutSession.subtotals.presentmentCurrencyCode}):U("Checkout session is not found")},size:"lg",variant:this.submitBtnType},L("Pay [orderTotal]",{orderTotal:A({amount:h.amountDutyTaxFeeTotal||0,isForeign:!0})})),p.shouldRenderPayInUsdButton&&t("zonos-button",{class:"zonos--pay-in-base-currency-btn",isDisabled:this.continueLoading&&"USD"!==p.checkoutSettlementCurrency,loading:this.continueLoading&&"USD"===p.checkoutSettlementCurrency,onClick:async()=>{await this.continueClickHandler({currencyCode:"USD"})},size:"lg",variant:"subtle"},L("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"}})),e&&t("zonos-card",{backgroundColor:"gray-100",borderRadius:12,class:"zonos--test-cards"},t("zonos-v-stack",{spacing:16},t("div",null,t("zonos-text",{type:"semiBoldLabel"},L("Test cards")),t("zonos-text",{textColor:"gray-700"},L("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")},L("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")},L("Failure")," (****0002)")),t("zonos-notification",null)))})()))}get ele(){return l(this)}static get watchers(){return{continueLoading:[{continueLoadingWatcher:0}],hasStripePaymentError:[{stripePaymentErrorWatcher:0}]}}};q.style=".sc-zonos-collect-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-payment-h *.sc-zonos-collect-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-payment-h img.sc-zonos-collect-payment{max-width:100%}.sc-zonos-collect-payment-h dl.sc-zonos-collect-payment,.sc-zonos-collect-payment-h dd.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h1.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h2.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h3.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h4.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h5.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h6.sc-zonos-collect-payment,.sc-zonos-collect-payment-h hr.sc-zonos-collect-payment,.sc-zonos-collect-payment-h figure.sc-zonos-collect-payment,.sc-zonos-collect-payment-h p.sc-zonos-collect-payment,.sc-zonos-collect-payment-h pre.sc-zonos-collect-payment{margin:0}.sc-zonos-collect-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--title.sc-zonos-collect-payment{margin-bottom:24px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment{margin-bottom:20px;overflow:visible;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--payment-error-banner.sc-zonos-collect-payment{margin-bottom:8px}.sc-zonos-collect-payment-h .zonos--error-banner.sc-zonos-collect-payment{margin-bottom:16px}.sc-zonos-collect-payment-h zonos-button.sc-zonos-collect-payment{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-collect-payment-h .zonos--pay-in-base-currency-btn.sc-zonos-collect-payment{-webkit-box-shadow:none;box-shadow:none}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:12px;bottom:-4px;padding-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-text.sc-zonos-collect-payment{text-align:center}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-button.sc-zonos-collect-payment{width:100%}.sc-zonos-collect-payment-h .zonos--test-cards.sc-zonos-collect-payment{margin-top:auto;padding-top:16px}";const G=class{constructor(e){o(this,e),this.mobile=!1,this.tablet=!1,this.collapsed=!1,this.isMobile=!1,this.isTablet=!1,this.isLoading=!0}handleWindowResize(){this.isMobile=V(this.mobile),this.isTablet=R(this.tablet)}componentWillLoad(){this.handleWindowResize(),setTimeout((()=>{this.isLoading=!1}),1e3)}render(){const o=this.isMobile?"gray-1000":"gray-800";return t(n,{key:"2ed81c7a0a16b9414fe1ce3799efa3b85679f982",class:$(["zonos--collect-review zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},t("div",{key:"fcf9fbc8dd807289bcd1c70406495b0c3396bfb8",class:"zonos--title"},t("zonos-text",{key:"44cfb3b82b8e617687c212e108cacafb45713243",textColor:o,type:"semiBoldLabel"},L("Pay [organizationName] duties, taxes and fees for your shipment",{organizationName:P.organizationName}))),t("div",{key:"5472a1ccc61b49ce8c9578a4c3f801386cab1e7d",class:"zonos--total-pay"},O({content:t("zonos-text",{type:"secondaryPageHeader"},A({amount:h.amountDutyTaxFeeTotal||0,isForeign:!0})),isLoading:h.isFetchingShippingInfo,skeletonHeight:"36px",skeletonWidth:"150px"})))}static get assetsDirs(){return["assets"]}};G.style=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:-webkit-sticky;position:sticky;top:0;background-color:var(--zonos-elements-gray-0);z-index:1}:host .zonos--total-pay{margin:8px 0 24px;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;gap:48px}:host .zonos--total-pay zonos-text{-ms-flex-negative:0;flex-shrink:0}:host .zonos--total-pay::after{content:"";position:relative;height:1px;width:100%;background:var(--zonos-elements-gray-200)}:host(.mobile),:host(.tablet){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;padding:4px 0;background-color:transparent;position:relative}:host(.mobile) .zonos--total-pay,:host(.tablet) .zonos--total-pay{margin:0}';const J=class{constructor(e){o(this,e),this.storeUnsubscribeList=[],this.subtotals={},this.initSubtotalData=()=>{var o;const e=null===(o=y.checkoutSession)||void 0===o?void 0:o.subtotals;if(!e)return;const t=L("Duties"),s=L("Taxes"),n=L("Fees"),l={[t]:0,[n]:0,[s]:0},a=e.duties,i=e.taxes,c=e.fees;void 0!==a&&(l[t]||(l[t]=0),l[t]+=a),void 0!==i&&(l[s]||(l[s]=0),l[s]+=i),void 0!==c&&(l[n]||(l[n]=0),l[n]+=c),this.subtotals=l}}disconnectedCallback(){this.storeUnsubscribeList.forEach((o=>o()))}componentWillLoad(){this.storeUnsubscribeList=[x("checkoutSession",this.initSubtotalData),H("translatedChunks",this.initSubtotalData)]}render(){return this.initSubtotalData(),t(n,{key:"f014c2ae733fe652d7d74349c0e12f93f46d71f5",class:"zonos--collect-subtotal zonos--elements"},t("table",{key:"0bab186aa957c29f026151f5a112ff66bb42cb04",class:"zonos--collect-table"},!!this.subtotals[L("Duties")]&&t("tr",{key:"97c24d5f179f5b59bcb91bc156b1d3e15b811262",class:"zonos--row zonos--collect-duty"},t("td",{key:"cba67296a6d17c0cd665981eb19ba95706f68843",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"6665f531a8656c4a1e0f9761d919c150587a36fb",type:"semiBoldLabel"},L("Duties"))),t("td",{key:"20aeeee1fde0e63aaa168f32a5400ea82758a14c",class:"zonos--column"}),t("td",{key:"14994ca56e814f68fa3511098f5299a0942a295a",class:"zonos--column zonos--collect-subtotal-price"},O({content:t("zonos-text",{type:"label"},A({amount:this.subtotals[L("Duties")]||0,isForeign:!0})),isLoading:h.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[L("Taxes")]&&t("tr",{key:"cbbe4ddf13aabca9ff86b21317b067191f4155b8",class:"zonos--row zonos--collect-tax"},t("td",{key:"675a36a92e136f3afd1960616e842e152cba6256",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"8896868f1e7f545d5b92c148a0f9812936ac2a9a",type:"semiBoldLabel"},L("Taxes"))),t("td",{key:"8a4c29f6d2d513fd7da8be7b1ab695794f3a99ab",class:"zonos--column"}),t("td",{key:"c15f7a872e59cce222a674acb55388dd18bfb74a",class:"zonos--column zonos--collect-subtotal-price"},O({content:t("zonos-text",{type:"label"},A({amount:this.subtotals[L("Taxes")]||0,isForeign:!0})),isLoading:h.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[L("Fees")]&&t("tr",{key:"4cf155874e4446b9ecab121cbaceba2328323359",class:"zonos--row zonos--collect-fee"},t("td",{key:"3efcb4779f34f35a2398eb661f4b799b6b4480c7",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"41d30bb15d216663cd507f2c92d6639b5559708c",type:"semiBoldLabel"},L("Fees"))),t("td",{key:"ef8259d337fb047d8979f5008d2d46f3fc76b007",class:"zonos--column"}),t("td",{key:"e0430efffbe23880a776953ba6a05b0cea268df4",class:"zonos--column zonos--collect-subtotal-price"},O({content:t("zonos-text",{type:"label"},A({amount:this.subtotals[L("Fees")]||0,isForeign:!0})),isLoading:h.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),t("tr",{key:"279ddddfc6e9fe88bc1f16aeaeb6464737ec212f",class:"zonos--row zonos--collect-spacing"},t("td",{key:"de88842e26eb39938b573fc2ac89915d9f6708ba",class:"zonos--column",colSpan:3})),t("tr",{key:"48ecfc5852f1cb25b7816503f3279a3cffc1a581",class:"zonos--row zonos--collect-total zonos--collect-total-subtotal"},t("td",{key:"06e65acfd5dd213481f415dc2475d9353e18ee53",class:"zonos--column"}),t("td",{key:"b5ae37799d471defdb983a9167b96aa5e176f78e",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"52afa80c7b0eeda13093c26ce031dab4e4a62ee8",type:"label"},L("Subtotal"))),t("td",{key:"840e0413b9c0d651ba7de6529d7c6581f165c047",class:"zonos--column zonos--collect-subtotal-price"},O({content:t("zonos-text",{type:"label"},A({amount:h.amountDutyTaxFeeTotal||0,isForeign:!0})),isLoading:h.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),t("tr",{key:"62ffc4102084c920e8bde4527415ea93d8ae8292",class:"zonos--row zonos--collect-total"},t("td",{key:"ef199898aa67686f1c36d2d0c73d1695443e81a9",class:"zonos--column"}),t("td",{key:"1bd5949e640823841ac7425a46b519482b975c37",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"96d53a1ffd935ac98cd5560419cc7d5395945da4",type:"semiBoldLabel"},L("Customs fees total"))),t("td",{key:"008f69a34b557f2660426acccafe925f6b554293",class:"zonos--column zonos--collect-subtotal-price"},O({content:t("zonos-text",{type:"semiBoldLabel"},A({amount:h.amountDutyTaxFeeTotal||0,isForeign:!0})),isLoading:h.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"})))))}static get assetsDirs(){return["assets"]}};J.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:-webkit-sticky;position:sticky;bottom:60px}:host .zonos--collect-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--collect-table .zonos--column{padding:8px 8px;vertical-align:top}:host .zonos--collect-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--collect-table .zonos--column:first-child{width:60px;max-width:100px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--collect-subtotal-price{text-align:right}:host .zonos--collect-subtotal-price zonos-text{white-space:nowrap}:host .zonos--collect-total .zonos--column{padding:16px 0}:host .zonos--collect-total-subtotal .zonos--collect-subtotal-title,:host .zonos--collect-total-subtotal .zonos--collect-subtotal-price{border-bottom:1px solid var(--zonos-elements-gray-200)}:host .zonos--collect-subtotal-price zonos-text,:host .zonos--collect-pay-total zonos-text{white-space:nowrap}";export{Q as zonos_collect_finish,X as zonos_collect_footer,Y as zonos_collect_order_details,q as zonos_collect_payment,G as zonos_collect_review,J as zonos_collect_subtotal}
|
|
1
|
+
import{r as o,d as e,h as t,F as s,a as n,g as l}from"./p-_lt63o7c.js";import{b as a,d as i,j as c,e as r,k as d,c as h}from"./p-0mGRBGcf.js";import{b as p,c as m,t as f,P as u,H as b,Q as z,d as y,x as g,I as x}from"./p-FRWZayxL.js";import{s as v,c as w,a as k,b as C}from"./p-7abqRc9V.js";import{t as L,s as I,k as S,l as j,y as H}from"./p-clDfq9AL.js";import{z as P}from"./p-W82paT5F.js";import{h as Z,s as _,g as M,i as B,a as D}from"./p-DE4a-QD5.js";import{c as W}from"./p-XQfWgQLB.js";import{g as F}from"./p-C_z9WL8a.js";import{l as U,b as T}from"./p-BJmZPrZl.js";import{i as V,a as R}from"./p-DGlnuxEX.js";import{c as $}from"./p-BJHSB96f.js";import{s as E}from"./p-D-bZg-Pc.js";import{r as A}from"./p-Mrz_lnC1.js";import{p as N}from"./p-CFbfEmjN.js";import{r as O}from"./p-BXjdMMUy.js";import"./p-YdrG78th.js";import"./p-Cye-evFK.js";import"./p-CICjAi70.js";import"./p-sz4L-ZnB.js";const Q=class{constructor(t){o(this,t),this.closeClick=e(this,"closeClick",7),this.borderRadius="ROUNDED",this.confirmationId=null,this.isLoading=!0,this.notificationType="success",this.notificationTitle="",this.notificationMessages=[],this.notificationActionText=L("Keep shopping"),this.order=null,this.isWaitingToRedirect=!0,this.pullOrder=async()=>{var o,e;const t=I.checkoutSessionId,s=new URLSearchParams;s.set("checkoutSessionId",t||"");const{baseUrl:n,errors:l,json:a}=await Z(`/api/zonos-elements/get-order?${s.toString()}`);return l.length||!(null==a?void 0:a.id)?{baseUrl:n,order:null}:(await(null===(e=(o=P.checkoutSettings).onOrderSuccess)||void 0===e?void 0:e.call(o,{zonosApiRoute:n,zonosOrder:a})),{baseUrl:n,order:a})},this.handleSuccessBehavior=async()=>{this.isLoading=!1,await this.getPullOrder()},this.getPullOrder=async(o=0)=>{var e,t;0===o&&U("=== Start to poll for order info","info");const{baseUrl:s,order:n}=await this.pullOrder(),l=!!(null===(t=null===(e=null==n?void 0:n.references)||void 0===e?void 0:e.find((o=>"zonosOrderNumber"===(null==o?void 0:o.key))))||void 0===t?void 0:t.value),a=I.checkoutSessionId,i=parseFloat(new URLSearchParams(window.location.search).get("maxPollingRetries")||"0")||30;U(`=== Polling order (${o} attemps)`,"info"),n?(U("=== CollectOrder info found","info"),o>10&&_({endpoint:`${s}/api/zonos-elements/get-order?checkoutSessionId=${a}&orderId=${n.id}`,errors:[`Collect order found after ${o} attempts`],metadata:{allLogs:T,checkoutSessionId:I.checkoutSessionId||"",orderId:n.id,storeId:P.storeId}}),this.order=n):n&&l||!(o<i)?_({endpoint:`${s}/api/zonos-elements/get-order?checkoutSessionId=${a}`,errors:[`Collect order not found after ${i} attempts`],metadata:{allLogs:T,checkoutSessionId:I.checkoutSessionId||"",storeId:P.storeId}}):(await new Promise((o=>setTimeout(o,1e3))),await this.getPullOrder(o+1))},this.checkStripePaymentStatus=async()=>{const o=new URLSearchParams(window.location.search).get("payment_intent_client_secret")||p.clientSecret;if(o||this.storybookForceStatus){const{error:e,messages:t,status:s}=await m({clientSecret:o,storybookForceStatus:this.storybookForceStatus}),n="requires_action"===s||e;this.notificationType=n?"error":"success",this.notificationMessages=t||[],this.notificationTitle=L(n?"Payment failed":"You're all set!"),U("=== Payment intent retrieve status","info",{clientSecret:o,error:e,messages:t,status:s});const l=new URL(window.location.href);if(l.searchParams.delete("payment_intent_client_secret"),l.searchParams.delete("payment_intent"),l.searchParams.delete("redirect_status"),l.searchParams.delete("zonosCheckoutSessionId"),window.history.replaceState({},"",l.toString()),e&&(null==t?void 0:t.length))v({event:"zonos-checkout-payment-fail"}),_({endpoint:"Stripe payment failed",errors:[`Payment intent "${o.split("_secret_")[0]||o}" status: ${s} - checkout session: ${I.checkoutSessionId}`],metadata:{allLogs:T,credentialToken:window.Zonos.zonosApiKey}});else{v({event:"zonos-checkout-success"}),f({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,u(),b(),I.checkoutSessionId=null},this.getAirwallexSessionInfo=async()=>{if(a.paymentIntentId)return{isCompleted:!1,paymentIntentId:a.paymentIntentId};const o=I.checkoutSessionId;if(!o)return{isCompleted:!1,paymentIntentId:null};const{json:e}=await Z("/api/zonos-elements/collect/get-checkout-session",{body:{checkoutSessionId:o},method:"POST"}),t=null==e?void 0:e.checkoutSession;return{isCompleted:!(!(null==t?void 0:t.completedAt)&&!(null==t?void 0:t.order)),paymentIntentId:(null==t?void 0:t.paymentIntentId)||null}},this.checkAirwallexPaymentStatus=async()=>{const o=a.paymentConfirmed,e="succeeded"===this.storybookForceStatus,{isCompleted:t,paymentIntentId:s}=await this.getAirwallexSessionInfo(),{status:n}=s?await i(s):{status:null},l=o||e||t||r(n),{messages:h}=c(o||e||t?"SUCCEEDED":n);if(U("=== Airwallex payment intent retrieve status","info",{forcedSuccess:e,isCompleted:t,isPaid:l,paymentIntentId:s,sdkConfirmed:o,status:n}),this.notificationType=l?"success":"error",this.notificationTitle=L(l?"You're all set!":"Payment failed"),this.notificationMessages=h,l){v({event:"zonos-checkout-success"}),f({checkoutSessionId:I.checkoutSessionId,eventName:"checkout_orderCompleted"});const o=W("zonos-checkout-success",{message:"Zonos Checkout successfully processed order"});document.dispatchEvent(o),await this.handleSuccessBehavior()}else v({event:"zonos-checkout-payment-fail"}),_({endpoint:"Airwallex payment failed",errors:[`Payment intent "${s}" status: ${n} - checkout session: ${I.checkoutSessionId}`],metadata:{allLogs:T,credentialToken:window.Zonos.zonosApiKey}});this.isLoading=!1,u(),b(),d(),I.checkoutSessionId=null},this.checkStagingOrderStatus=async()=>{this.notificationType="success",this.notificationTitle=L("You're all set!"),this.notificationMessages=z("succeeded").messages,await this.handleSuccessBehavior(),u(),b(),w(),I.checkoutSessionId=null},this.checkPaypalPaymentStatus=async()=>{if(k.paypalErrorMessage)return this.notificationType="error",this.notificationTitle=L("Payment failed"),this.notificationMessages=[k.paypalErrorMessage],void(this.isLoading=!1);this.isLoading=!1,k.orderIdCreated&&(v({event:"zonos-checkout-success"}),f({checkoutSessionId:I.checkoutSessionId,eventName:"checkout_orderCompleted"}),this.notificationType="success",this.notificationTitle=L("You're all set!"),this.notificationMessages=z("succeeded").messages,await this.handleSuccessBehavior()),u(),b(),w(),I.checkoutSessionId=null},this.getReceiptUrl=({cartId:o})=>{const e=new URL(`${window.location.origin}/receipt`);e.searchParams.set("referenceId",o),M()&&e.searchParams.set("zonosTestMode","1");const t=new URLSearchParams(window.location.search).get("zonosQaUrl");return t&&e.searchParams.set("zonosQaUrl",t),e.toString()}}componentDidLoad(){if(this.overrideNotification)return this.notificationType=this.overrideNotification.type,this.notificationTitle=this.overrideNotification.title,this.notificationMessages=this.overrideNotification.messages,void(this.isLoading=!1);y.isStagingMode?this.checkStagingOrderStatus():"AIRWALLEX"===h.paymentProcessor?this.checkAirwallexPaymentStatus():k.orderIdCreated?this.checkPaypalPaymentStatus():this.checkStripePaymentStatus()}render(){const o=window.Zonos.cartId;return t(n,{key:"af26499a2062cf495d4c46a7763ed988a4da0669",class:"zonos--checkout-finish zonos--elements",style:{"--zonos--border-radius":F({overrideBorderStyle:this.borderRadius})}},!this.isLoading&&t("div",{key:"54fb28be3daee7dd1d63f1dcbdb9a84354fcdb6c",class:"zonos--finish-details"},t("div",{key:"9c71e5dbd23e613e1038924f14c0465d94dbad07",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:"3285f4bb8854d5bab6eef487d2b2ae3556794998",class:"zonos--title",type:"semiBoldSubheader"},this.notificationTitle),this.confirmationId&&t("zonos-badge",{key:"4cecd6f15ed26fe1e525c01a48e3961845e6f6d8",badgeColor:"gray"},this.confirmationId),t("zonos-text",{key:"dd7c4011d4d7f92fcd19d53e945adf42f2b3f05e",class:"zonos--subtitle",textColor:"gray-600"},this.notificationMessages.map((o=>t(s,null,o,t("br",null))))),this.order&&o&&t("div",{key:"a11bd49a754d32dd15dc34f2311f9706d459f07b",class:"zonos--button-container"},t("zonos-button",{key:"305bcf958a1772cc123414285522e9e0f0b1a839",onClick:()=>{window.open(this.getReceiptUrl({cartId:o}),"_blank")},size:"lg",variant:"primary"},L("View receipt"))))))}static get assetsDirs(){return["assets"]}};Q.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%}:host .zonos--group{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;margin-bottom:24px;border-radius:var(--zonos--border-radius, 10px);gap:24px;margin-top:24px;background-color:var(--zonos-elements-gray-50);padding:48px}:host .zonos--finish-details{max-width:640px;min-width:300px;line-height:24px;width:0 auto;margin:auto}:host zonos-button{width:100%}:host .loading-wrapper{min-height:300px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .zonos--finish-button-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto;margin-top:48px;max-width:300px}:host .zonos--button-container{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;gap:16px;margin:0 auto}:host .zonos--subtitle{text-align:center}:host .zonos--order-number{background-color:var(--zonos-elements-gray-0);border:1px solid var(--zonos-elements-gray-200);color:var(--zonos-elements-gray-800);border-radius:var(--zonos-elements-radius-6);padding:4px 8px}";const G=class{constructor(e){o(this,e),this.mobile=!1,this.tablet=!1,this.showLanguageDialog=!1,this.isMobile=!1,this.isTablet=!1}handleGlobalClick(o){!this.el.contains(o.target)&&this.showLanguageDialog&&(this.showLanguageDialog=!1)}toggleLanguageDialog(){this.showLanguageDialog=!this.showLanguageDialog}handleMobileChange(){this.isMobile=V(this.mobile)}handleTabletChange(){this.isTablet=R(this.tablet)}componentWillLoad(){this.isMobile=V(this.mobile),this.isTablet=R(this.tablet)}render(){var o;const e=null===(o=S.find((o=>o.code===j.selectedLocale)))||void 0===o?void 0:o.label,l="gray-1000";return t(n,{key:"7733eba3e2253cc976484a9da290f66afd6ef93d",class:$(["zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},t("div",{key:"2c5a058034844d818010f4002704fa17e6fd9a46",class:"zonos--collect-footer"},t("div",{key:"bffe2afd93ca0531b7eea825a7fd69d68b7aa308",class:"zonos--collect-locale-wrapper"},E()&&t(s,{key:"5469f522ea7b4b3f25fd7c0a63e717c29e34a84c"},t("zonos-button",{key:"1c88778482c2960cf2a5e55beeda3f3c7f21b950",buttonColor:l,class:"zonos--collect-footer-language-button",icon:t("zonos-icon",{"aria-label":"Language select",content:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" color="var(--zonos-elements-gray-1000)" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM11.4709 5.80634C11.7686 5.53723 11.9541 5.5 12 5.5C12.0459 5.5 12.2314 5.53723 12.5291 5.80634C12.8115 6.06164 13.1289 6.46913 13.4271 7.03651C13.9505 8.03191 14.3838 9.46098 14.48 11.25H9.51996C9.61624 9.46098 10.0495 8.03191 10.5729 7.03651C10.8711 6.46913 11.1885 6.06164 11.4709 5.80634ZM8.01802 11.25C8.11591 9.23031 8.60319 7.55958 9.24516 6.33849C9.29983 6.23451 9.35585 6.13335 9.41312 6.03514C7.32916 6.94017 5.81218 8.90533 5.5428 11.25H8.01802ZM5.5428 12.75H8.01802C8.11591 14.7697 8.60319 16.4404 9.24516 17.6615C9.29983 17.7655 9.35585 17.8666 9.41312 17.9649C7.32916 17.0598 5.81218 15.0947 5.5428 12.75ZM9.51996 12.75H14.48C14.3838 14.539 13.9505 15.9681 13.4271 16.9635C13.1289 17.5309 12.8115 17.9384 12.5291 18.1937C12.2314 18.4628 12.0459 18.5 12 18.5C11.9541 18.5 11.7686 18.4628 11.4709 18.1937C11.1885 17.9384 10.8711 17.5309 10.5729 16.9635C10.0495 15.9681 9.61624 14.539 9.51996 12.75ZM15.982 12.75C15.8841 14.7697 15.3968 16.4404 14.7548 17.6615C14.7002 17.7655 14.6441 17.8666 14.5869 17.9649C16.6708 17.0598 18.1878 15.0947 18.4572 12.75H15.982ZM18.4572 11.25C18.1878 8.90533 16.6708 6.94017 14.5869 6.03514C14.6441 6.13335 14.7002 6.23451 14.7548 6.33849C15.3968 7.55958 15.8841 9.23031 15.982 11.25H18.4572Z" fill="currentColor"/>\n</svg>\n',iconColor:l}),onClick:()=>this.toggleLanguageDialog(),variant:"subtle"},t("span",{key:"451485445df5f34ca64a36dddd5007ce9f229173",class:"zonos--collect-locale-label"},e,t("zonos-icon",{key:"a395943215ca541f3db4d3aa6e111c87930a6d08","aria-hidden":"true",class:"zonos--collect-locale-chevron",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:l,size:18}))),t("div",{key:"46edba3f7fc8f9316b69626872e0cb478e72cbd4",class:$(["zonos--collect-language-dialog",this.showLanguageDialog&&"zonos--collect-language-dialog-open"])},t("zonos-language-select",{key:"e77a7197a218755149ee6b7f3e07a646bc95e930",handleOnClose:()=>this.toggleLanguageDialog()})))),t("div",{key:"b18dcfe4f0806f3abb6b5855321381334e5206a7",class:"zonos--collect-footer-icon-wrapper"},t("div",{key:"5c6c376fe1174cec16e9b6c029172138bc8b180a",class:"zonos--collect-footer-logo"},t("zonos-text",{key:"0899e6990f8f37cf2d604ef15ffd3db0571d5389",textColor:l},"Powered by"),t("a",{key:"853891db2db1a4d1297597a9857772503e5b4d10",href:"https://zonos.com",target:"_blank",title:"Zonos website"},t("zonos-icon",{key:"d8731023822bffdec3cfe821c67387df651de13a",autoHeight:!0,content:'<svg width="43" height="10" viewBox="0 0 43 10" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.35896 0.0640869H0.30768C0.166068 0.0640869 0.0512695 0.178886 0.0512695 0.320497V1.85896C0.0512695 2.00057 0.166068 2.11537 0.30768 2.11537H4.44439C4.54964 2.11537 4.61005 2.2352 4.54745 2.31982L0.151823 8.2615C0.0865163 8.34978 0.0512695 8.45669 0.0512695 8.56649V9.67947C0.0512695 9.82108 0.166068 9.93588 0.30768 9.93588H7.35896C7.50057 9.93588 7.61537 9.82108 7.61537 9.67947V8.14101C7.61537 7.9994 7.50057 7.8846 7.35896 7.8846H3.22226C3.117 7.8846 3.05659 7.76477 3.11919 7.68015L7.51482 1.73847C7.58013 1.65019 7.61537 1.54328 7.61537 1.43348V0.320497C7.61537 0.178886 7.50057 0.0640869 7.35896 0.0640869Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M11.718 0C10.1602 0 8.89746 1.26279 8.89746 2.82051V7.17949C8.89746 8.73721 10.1602 10 11.718 10H13.6411C15.1988 10 16.4616 8.73721 16.4616 7.17949V2.82051C16.4616 1.26279 15.1988 0 13.6411 0H11.718ZM11.718 2.05128C11.2931 2.05128 10.9487 2.39568 10.9487 2.82051V7.17949C10.9487 7.60432 11.2931 7.94872 11.718 7.94872H13.6411C14.0659 7.94872 14.4103 7.60432 14.4103 7.17949V5V2.82051C14.4103 2.39568 14.0659 2.05128 13.6411 2.05128H11.718Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M17.7437 0.436316V9.71132C17.7437 9.85293 17.8585 9.96773 18.0001 9.96773H19.5385C19.6801 9.96773 19.7949 9.85293 19.7949 9.71132V3.74801C19.7949 3.44829 19.969 3.17587 20.241 3.04996L22.1641 2.15964C22.6739 1.92363 23.2565 2.29592 23.2565 2.85769V9.71132C23.2565 9.85293 23.3713 9.96773 23.5129 9.96773H25.0513C25.193 9.96773 25.3078 9.85293 25.3078 9.71132V2.85595C25.3078 0.79631 23.1718 -0.568775 21.3027 0.296257L19.9742 0.911055C19.8685 0.959946 19.7432 0.931536 19.669 0.84187L19.2748 0.365697C19.1773 0.248019 19.0325 0.179905 18.8797 0.179905H18.0001C17.8585 0.179905 17.7437 0.294704 17.7437 0.436316Z" fill="var(--zonos-elements-gray-800)"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M29.4104 0C27.8526 0 26.5898 1.26279 26.5898 2.82051V7.17949C26.5898 8.73721 27.8526 10 29.4104 10H31.3334C32.8912 10 34.1539 8.73721 34.1539 7.17949V2.82051C34.1539 1.26279 32.8912 0 31.3334 0H29.4104ZM29.4104 2.05128C28.9855 2.05128 28.6411 2.39568 28.6411 2.82051V7.17949C28.6411 7.60432 28.9855 7.94872 29.4104 7.94872H31.3334C31.7583 7.94872 32.1027 7.60432 32.1027 7.17949V2.82051C32.1027 2.39568 31.7583 2.05128 31.3334 2.05128H29.4104Z" fill="var(--zonos-elements-gray-800)"/>\n<path d="M38.2085 0.0640869H40.3889C41.8309 0.0640869 42.9999 1.23306 42.9999 2.67506C42.9999 2.79477 42.9108 2.89574 42.792 2.91059L41.1732 3.11293C41.054 3.12784 40.9486 3.03485 40.9486 2.91466C40.9486 2.47322 40.5908 2.11537 40.1493 2.11537H38.3397C37.8688 2.11537 37.4871 2.49712 37.4871 2.96803C37.4871 3.3685 37.7658 3.71501 38.1569 3.80087L40.7916 4.37922C42.0811 4.66229 42.9999 5.80462 42.9999 7.12486C42.9999 8.67735 41.7414 9.93588 40.1889 9.93588H38.0468C36.6048 9.93588 35.4358 8.76691 35.4358 7.32491C35.4358 7.2052 35.5249 7.10423 35.6437 7.08938L37.2625 6.88703C37.3817 6.87213 37.4871 6.96512 37.4871 7.08531C37.4871 7.52675 37.8449 7.8846 38.2864 7.8846H40.1176C40.5765 7.8846 40.9486 7.51252 40.9486 7.05354C40.9486 6.67478 40.6925 6.34394 40.3258 6.24901L37.5136 5.52093C36.2902 5.20422 35.4358 4.10042 35.4358 2.83676C35.4358 1.30545 36.6772 0.0640869 38.2085 0.0640869Z" fill="var(--zonos-elements-gray-700)"/>\n</svg>\n',size:42}))),t("div",{key:"ba5ae7870c1ed277142ceccf1d44276270b967d0",class:"dot"}),t("a",{key:"253dd9112d0626981473d0d0a3309cc577ea5b54",href:"https://zonos.com/docs/legal/zonos-privacy-policy",target:"_blank"},t("zonos-text",{key:"a5117f4e2194a4b5d1a5de1696763ca1e174b004",textColor:l},"Privacy policy")))))}get el(){return l(this)}static get watchers(){return{mobile:[{handleMobileChange:0}],tablet:[{handleTabletChange:0}]}}};G.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:absolute;bottom:0;left:32px;right:32px;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;z-index:2}:host .zonos--collect-footer{gap:16px;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;padding:12px;padding-left:0;-ms-flex-align:center;align-items:center;width:100%}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:16px}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo{display:-ms-inline-flexbox;display:inline-flex;gap:8px;-ms-flex-align:center;align-items:center}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper .zonos--collect-footer-logo a{line-height:0}:host .zonos--collect-footer .zonos--collect-footer-icon-wrapper a{text-decoration:none}:host .zonos--collect-footer zonos-button button.outline{outline:1px solid var(--zonos-elements-gray-800)}:host .zonos--collect-footer .zonos--collect-locale-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px;position:relative}@media (max-width: 400px){:host .zonos--collect-footer .zonos--collect-locale-wrapper{gap:4px}}:host .zonos--collect-footer .zonos--collect-locale-wrapper .zonos--collect-locale-label{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;gap:4px}:host .zonos--collect-footer .zonos--collect-language-dialog{position:absolute;bottom:36px;left:var(--language-dialog-left);background:var(--zonos-elements-surface-color);-webkit-box-shadow:var(--zonos-elements-v3-shadow-xl);box-shadow:var(--zonos-elements-v3-shadow-xl);border-radius:var(--zonos-elements-radius-12);width:360px;max-width:100vw;max-height:500px;z-index:2147483011;overflow:auto;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:bottom left;transform-origin:bottom left;opacity:0;-webkit-transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out;transition:transform 0.3s ease-out, opacity 0.3s ease-out, -webkit-transform 0.3s ease-out;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar{width:10px}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--collect-footer .zonos--collect-language-dialog::-webkit-scrollbar-track{border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--collect-footer .zonos--collect-language-dialog.zonos--collect-language-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .dot{display:-ms-inline-flexbox;display:inline-flex;background:var(--zonos-elements-gray-400);width:6px;height:6px;border-radius:50%}:host(.mobile),:host(.tablet){background-color:var(--zonos-elements-gray-0);width:100%;position:-webkit-sticky;position:sticky;bottom:0}:host(.tablet) .zonos--collect-footer{width:100%;max-width:800px;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex}:host(.mobile) .zonos--collect-locale-wrapper{display:none}:host(.mobile) .zonos--collect-footer{-ms-flex-pack:center;justify-content:center}";const X=class{constructor(t){o(this,t),this.collapseClicked=e(this,"collapseClicked",7),this.mobile=!0,this.landedCostId="",this.isMobile=!1,this.collapseState=this.collapsed}handleCollapseChangeFromProp(o){this.collapseState=o}handleCollapseChange(o){this.collapseClicked.emit(o)}handleWindowResize(){this.isMobile=B(this.mobile)}componentWillLoad(){this.handleWindowResize()}renderShippingAddress(){if(h.isFetchingShippingInfo)return t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},t("zonos-skeleton",{skeletonWidth:"99px"})),t("div",{class:"zonos--collect-order-shipping-info"},t("zonos-skeleton",{skeletonWidth:"152px"}),t("zonos-h-stack",{spacing:8},t("zonos-skeleton",{skeletonWidth:"75px"}),t("zonos-skeleton",{skeletonWidth:"75px"})),t("zonos-skeleton",{skeletonWidth:"50px"})));const o=h.shippingAddress;return o?t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},L("Shipping address")),t("div",{class:"zonos--collect-order-shipping-info"},[[o.location.line1,o.location.line2].filter(Boolean).join(" "),[o.location.locality,o.location.administrativeAreaCode,o.location.postalCode].filter(Boolean).join(", "),o.location.countryCode].map((o=>t("zonos-text",null,o))))):null}render(){return t(n,{class:$(["zonos--collect-order-details zonos--elements",this.isMobile&&"mobile"])},t("div",{class:"zonos--wrapper"},t("button",{class:"zonos--order-details-header",onClick:()=>{this.collapseState=!this.collapseState},type:"button"},t("zonos-text",{type:"semiBoldLabel"},L("Shipment details")),(()=>t("zonos-icon",this.collapseState?{"aria-label":"Collapse expanded section",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M6.293 9.293a1 1 0 0 1 1.414 0L12 13.586l4.293-4.293a1 1 0 0 1 1.414 1.414l-4.93 4.93a1.1 1.1 0 0 1-1.555 0l-4.93-4.93a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"}:{"aria-label":"Expand collapsed section",content:'<svg color="var(--zonos-elements-gray-400)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M17.707 14.707a1 1 0 0 1-1.414 0L12 10.414l-4.293 4.293a1 1 0 0 1-1.414-1.414l4.93-4.93a1.1 1.1 0 0 1 1.555 0l4.93 4.93a1 1 0 0 1 0 1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>',iconColor:"gray-1200"}))()),t("div",{class:"zonos--order-details-wrapper"},t("zonos-collapse",{collapsed:this.collapseState},t("div",{class:"zonos--collect-order-details-content"},t("zonos-collect-cart-items",null),t("div",{class:"zonos--collect-order-info"},t("div",{class:"zonos--collect-order-details-row"},null!==h.amountTotalPaid&&t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},L("Total paid")),t("zonos-text",null,A({amount:h.amountTotalPaid||0,isForeign:!0}))),h.originCompanyName&&t("div",{class:"zonos--collect-order-details-column"},t("zonos-text",{type:"smallHeader"},L("Ordered from")),t("zonos-text",null,h.originCompanyName||""))),this.renderShippingAddress()))))))}static get assetsDirs(){return["assets"]}static get watchers(){return{collapsed:[{handleCollapseChangeFromProp:0}],collapseState:[{handleCollapseChange:0}]}}};X.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{height:100%}:host *{-ms-scroll-chaining:none;overscroll-behavior:contain}:host *::-webkit-scrollbar{width:10px}:host *::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host *::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host *::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--wrapper{overflow:auto;background-color:var(--zonos-elements-gray-50);border-radius:16px;height:100%;min-height:56px}:host .zonos--order-details-header{position:-webkit-sticky;position:sticky;top:0;z-index:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:var(--zonos-elements-gray-50);border:none;display:-ms-flexbox;display:flex;padding:16px 16px 0 16px;width:100%;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center}:host .zonos--order-details-header:focus-visible{outline:none}:host .zonos--order-details-wrapper{position:relative;padding:0 16px 16px 16px}:host .zonos--collect-order-details-content{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:28px}:host .zonos--collect-order-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:32px}:host .zonos--collect-order-info .zonos--collect-order-details-row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:16px}:host .zonos--collect-order-info .zonos--collect-order-details-row>*{-ms-flex:1 1 150px;flex:1 1 150px}:host .zonos--collect-order-info .zonos--collect-order-details-column{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px}:host .zonos--collect-order-info .zonos--collect-order-shipping-info{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:0}";const Y=class{constructor(t){o(this,t),this.continueClicked=e(this,"continueClicked",7),this.paypalSessionFailed=e(this,"paypalSessionFailed",7),this.paypalSessionDone=e(this,"paypalSessionDone",7),this.airwallexPaymentDone=e(this,"airwallexPaymentDone",7),this.storeUnsubscribeList=[],this.continueLoading=!1,this.showErrorBanner=!1,this.hasStripePaymentError=!1,this.stagingOrderCreateErrorMessage="",this.internalContinueLoading=this.continueLoading,this.handleValidate=()=>{var o;return!!(null===(o=p.stripePaymentEventData)||void 0===o?void 0:o.complete)},this.continueClickHandler=async({currencyCode:o})=>{var e,t;if(!this.handleValidate())return null===(e=p.stripeBillingAddressElement)||void 0===e||e.getValue(),this.showErrorBanner=!0,null===(t=p.stripeElements)||void 0===t||t.submit(),void setTimeout((()=>{var o;null===(o=this.ele.querySelector("zonos-banner"))||void 0===o||o.scrollIntoView({behavior:"smooth"})}),10);p.checkoutSettlementCurrency=o,v({event:"zonos-checkout-payment-info"}),this.continueClicked.emit()},this.copyCardToClipboard=async o=>{try{await navigator.clipboard.writeText(o)}catch(e){const t=document.createElement("textarea");t.style.position="fixed",t.style.left="-1000px",t.style.top="-1000px",t.style.width="1px",t.style.height="1px",t.value=o,t.id="zonos-copy-card-number",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}window.Zonos.showNotification({message:L("Card number copied to clipboard"),timeout:4e3,type:"success"})},this.placeTestOrder=async()=>{this.internalContinueLoading=!0;const{errors:o}=await N();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)}componentWillLoad(){this.storeUnsubscribeList=[x("currency",(()=>{C({currency:y.currency})}))],C({currency:y.currency})}disconnectedCallback(){this.storeUnsubscribeList.forEach((o=>o()))}render(){var o;if("AIRWALLEX"===h.paymentProcessor)return t(n,{class:"zonos--checkout-payment zonos--elements"},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},L("Payment method")),t("zonos-airwallex-payment",{onAirwallexPaymentSuccess:()=>this.airwallexPaymentDone.emit()})));if(this.hasStripePaymentError=p.hasPaymentError,!p.stripeElements)return null;if(!p.clientSecret)return null;this.showErrorBanner&&(this.showErrorBanner=!this.handleValidate());const e=M(),l=y.isStagingMode||D(),a="external_paypal"===(null===(o=p.stripePaymentEventData)||void 0===o?void 0:o.value.type);return t(n,{class:"zonos--checkout-payment zonos--elements"},t("div",{class:"zonos--group"},t("zonos-text",{class:"zonos--title",type:"semiBoldSubheader"},L("Payment method")),(()=>{if(l){const o=P.appearance.theme;return t(s,null,this.stagingOrderCreateErrorMessage&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},this.stagingOrderCreateErrorMessage),t("zonos-empty-state-payment",{emptyStateText:L("No payment method needed for staging"),theme:o}),t("div",{class:"zonos--group-btn"},t("zonos-button",{backgroundColor:this.submitBtnColor,loading:this.internalContinueLoading,onClick:()=>{this.placeTestOrder()},size:"lg",variant:this.submitBtnType},L("Place test order"))))}return p.isFetchingSession||h.isFetchingShippingInfo?null:t(s,null,this.showErrorBanner&&t("zonos-banner",{class:"zonos--error-banner",intent:"error"},L("Missing required fields. Make sure all fields are completed.")),this.hasStripePaymentError&&t("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},p.customErrorMessage||L("We couldn't complete your payment. Please verify the payment details and try again.")),k.paypalErrorMessage&&t("zonos-banner",{class:"zonos--payment-error-banner",intent:"error"},k.paypalErrorMessage),t("zonos-payment",null),t("div",{class:"zonos--group-btn"},!a&&t(s,null,t("zonos-button",{backgroundColor:this.submitBtnColor,bold:!0,isDisabled:this.continueLoading&&"USD"===p.checkoutSettlementCurrency,loading:this.continueLoading&&"USD"!==p.checkoutSettlementCurrency,onClick:async()=>{y.checkoutSession?await this.continueClickHandler({currencyCode:y.checkoutSession.subtotals.presentmentCurrencyCode}):U("Checkout session is not found")},size:"lg",variant:this.submitBtnType},L("Pay [orderTotal]",{orderTotal:A({amount:h.amountDutyTaxFeeTotal||0,isForeign:!0})})),p.shouldRenderPayInUsdButton&&t("zonos-button",{class:"zonos--pay-in-base-currency-btn",isDisabled:this.continueLoading&&"USD"!==p.checkoutSettlementCurrency,loading:this.continueLoading&&"USD"===p.checkoutSettlementCurrency,onClick:async()=>{await this.continueClickHandler({currencyCode:"USD"})},size:"lg",variant:"subtle"},L("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"}})),e&&t("zonos-card",{backgroundColor:"gray-100",borderRadius:12,class:"zonos--test-cards"},t("zonos-v-stack",{spacing:16},t("div",null,t("zonos-text",{type:"semiBoldLabel"},L("Test cards")),t("zonos-text",{textColor:"gray-700"},L("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")},L("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")},L("Failure")," (****0002)")),t("zonos-notification",null)))})()))}get ele(){return l(this)}static get watchers(){return{continueLoading:[{continueLoadingWatcher:0}],hasStripePaymentError:[{stripePaymentErrorWatcher:0}]}}};Y.style=".sc-zonos-collect-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-collect-payment-h *.sc-zonos-collect-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-collect-payment-h img.sc-zonos-collect-payment{max-width:100%}.sc-zonos-collect-payment-h dl.sc-zonos-collect-payment,.sc-zonos-collect-payment-h dd.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h1.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h2.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h3.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h4.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h5.sc-zonos-collect-payment,.sc-zonos-collect-payment-h h6.sc-zonos-collect-payment,.sc-zonos-collect-payment-h hr.sc-zonos-collect-payment,.sc-zonos-collect-payment-h figure.sc-zonos-collect-payment,.sc-zonos-collect-payment-h p.sc-zonos-collect-payment,.sc-zonos-collect-payment-h pre.sc-zonos-collect-payment{margin:0}.sc-zonos-collect-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-collect-payment-h{overflow:hidden;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--title.sc-zonos-collect-payment{margin-bottom:24px}.sc-zonos-collect-payment-h .zonos--group.sc-zonos-collect-payment{margin-bottom:20px;overflow:visible;padding:5px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex:1;flex:1}.sc-zonos-collect-payment-h .zonos--payment-error-banner.sc-zonos-collect-payment{margin-bottom:8px}.sc-zonos-collect-payment-h .zonos--error-banner.sc-zonos-collect-payment{margin-bottom:16px}.sc-zonos-collect-payment-h zonos-button.sc-zonos-collect-payment{-webkit-box-shadow:0 0 1px 0 var(--zonos-elements-gray-600);box-shadow:0 0 1px 0 var(--zonos-elements-gray-600)}.sc-zonos-collect-payment-h .zonos--pay-in-base-currency-btn.sc-zonos-collect-payment{-webkit-box-shadow:none;box-shadow:none}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment{position:-webkit-sticky;position:sticky;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-direction:column;flex-direction:column;gap:12px;bottom:-4px;padding-top:12px;background:var(--zonos--primary-color, var(--zonos-elements-gray-0))}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-text.sc-zonos-collect-payment{text-align:center}.sc-zonos-collect-payment-h .zonos--group-btn.sc-zonos-collect-payment zonos-button.sc-zonos-collect-payment{width:100%}.sc-zonos-collect-payment-h .zonos--test-cards.sc-zonos-collect-payment{margin-top:auto;padding-top:16px}";const q=class{constructor(e){o(this,e),this.mobile=!1,this.tablet=!1,this.collapsed=!1,this.isMobile=!1,this.isTablet=!1,this.isLoading=!0}handleWindowResize(){this.isMobile=V(this.mobile),this.isTablet=R(this.tablet)}componentWillLoad(){this.handleWindowResize(),setTimeout((()=>{this.isLoading=!1}),1e3)}render(){const o=this.isMobile?"gray-1000":"gray-800";return t(n,{key:"2ed81c7a0a16b9414fe1ce3799efa3b85679f982",class:$(["zonos--collect-review zonos--elements",this.isMobile&&"mobile",this.isTablet&&"tablet"])},t("div",{key:"fcf9fbc8dd807289bcd1c70406495b0c3396bfb8",class:"zonos--title"},t("zonos-text",{key:"44cfb3b82b8e617687c212e108cacafb45713243",textColor:o,type:"semiBoldLabel"},L("Pay [organizationName] duties, taxes and fees for your shipment",{organizationName:P.organizationName}))),t("div",{key:"5472a1ccc61b49ce8c9578a4c3f801386cab1e7d",class:"zonos--total-pay"},O({content:t("zonos-text",{type:"secondaryPageHeader"},A({amount:h.amountDutyTaxFeeTotal||0,isForeign:!0})),isLoading:h.isFetchingShippingInfo,skeletonHeight:"36px",skeletonWidth:"150px"})))}static get assetsDirs(){return["assets"]}};q.style=':host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:-webkit-sticky;position:sticky;top:0;background-color:var(--zonos-elements-gray-0);z-index:1}:host .zonos--total-pay{margin:8px 0 24px;display:-ms-flexbox;display:flex;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0;-ms-flex-align:center;align-items:center;gap:48px}:host .zonos--total-pay zonos-text{-ms-flex-negative:0;flex-shrink:0}:host .zonos--total-pay::after{content:"";position:relative;height:1px;width:100%;background:var(--zonos-elements-gray-200)}:host(.mobile),:host(.tablet){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;padding:4px 0;background-color:transparent;position:relative}:host(.mobile) .zonos--total-pay,:host(.tablet) .zonos--total-pay{margin:0}';const J=class{constructor(e){o(this,e),this.storeUnsubscribeList=[],this.subtotals={},this.initSubtotalData=()=>{var o;const e=null===(o=y.checkoutSession)||void 0===o?void 0:o.subtotals;if(!e)return;const t=L("Duties"),s=L("Taxes"),n=L("Fees"),l={[t]:0,[n]:0,[s]:0},a=e.duties,i=e.taxes,c=e.fees;void 0!==a&&(l[t]||(l[t]=0),l[t]+=a),void 0!==i&&(l[s]||(l[s]=0),l[s]+=i),void 0!==c&&(l[n]||(l[n]=0),l[n]+=c),this.subtotals=l}}disconnectedCallback(){this.storeUnsubscribeList.forEach((o=>o()))}componentWillLoad(){this.storeUnsubscribeList=[x("checkoutSession",this.initSubtotalData),H("translatedChunks",this.initSubtotalData)]}render(){return this.initSubtotalData(),t(n,{key:"f014c2ae733fe652d7d74349c0e12f93f46d71f5",class:"zonos--collect-subtotal zonos--elements"},t("table",{key:"0bab186aa957c29f026151f5a112ff66bb42cb04",class:"zonos--collect-table"},!!this.subtotals[L("Duties")]&&t("tr",{key:"97c24d5f179f5b59bcb91bc156b1d3e15b811262",class:"zonos--row zonos--collect-duty"},t("td",{key:"cba67296a6d17c0cd665981eb19ba95706f68843",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"6665f531a8656c4a1e0f9761d919c150587a36fb",type:"semiBoldLabel"},L("Duties"))),t("td",{key:"20aeeee1fde0e63aaa168f32a5400ea82758a14c",class:"zonos--column"}),t("td",{key:"14994ca56e814f68fa3511098f5299a0942a295a",class:"zonos--column zonos--collect-subtotal-price"},O({content:t("zonos-text",{type:"label"},A({amount:this.subtotals[L("Duties")]||0,isForeign:!0})),isLoading:h.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[L("Taxes")]&&t("tr",{key:"cbbe4ddf13aabca9ff86b21317b067191f4155b8",class:"zonos--row zonos--collect-tax"},t("td",{key:"675a36a92e136f3afd1960616e842e152cba6256",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"8896868f1e7f545d5b92c148a0f9812936ac2a9a",type:"semiBoldLabel"},L("Taxes"))),t("td",{key:"8a4c29f6d2d513fd7da8be7b1ab695794f3a99ab",class:"zonos--column"}),t("td",{key:"c15f7a872e59cce222a674acb55388dd18bfb74a",class:"zonos--column zonos--collect-subtotal-price"},O({content:t("zonos-text",{type:"label"},A({amount:this.subtotals[L("Taxes")]||0,isForeign:!0})),isLoading:h.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),!!this.subtotals[L("Fees")]&&t("tr",{key:"4cf155874e4446b9ecab121cbaceba2328323359",class:"zonos--row zonos--collect-fee"},t("td",{key:"3efcb4779f34f35a2398eb661f4b799b6b4480c7",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"41d30bb15d216663cd507f2c92d6639b5559708c",type:"semiBoldLabel"},L("Fees"))),t("td",{key:"ef8259d337fb047d8979f5008d2d46f3fc76b007",class:"zonos--column"}),t("td",{key:"e0430efffbe23880a776953ba6a05b0cea268df4",class:"zonos--column zonos--collect-subtotal-price"},O({content:t("zonos-text",{type:"label"},A({amount:this.subtotals[L("Fees")]||0,isForeign:!0})),isLoading:h.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),t("tr",{key:"279ddddfc6e9fe88bc1f16aeaeb6464737ec212f",class:"zonos--row zonos--collect-spacing"},t("td",{key:"de88842e26eb39938b573fc2ac89915d9f6708ba",class:"zonos--column",colSpan:3})),t("tr",{key:"48ecfc5852f1cb25b7816503f3279a3cffc1a581",class:"zonos--row zonos--collect-total zonos--collect-total-subtotal"},t("td",{key:"06e65acfd5dd213481f415dc2475d9353e18ee53",class:"zonos--column"}),t("td",{key:"b5ae37799d471defdb983a9167b96aa5e176f78e",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"52afa80c7b0eeda13093c26ce031dab4e4a62ee8",type:"label"},L("Subtotal"))),t("td",{key:"840e0413b9c0d651ba7de6529d7c6581f165c047",class:"zonos--column zonos--collect-subtotal-price"},O({content:t("zonos-text",{type:"label"},A({amount:h.amountDutyTaxFeeTotal||0,isForeign:!0})),isLoading:h.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"}))),t("tr",{key:"62ffc4102084c920e8bde4527415ea93d8ae8292",class:"zonos--row zonos--collect-total"},t("td",{key:"ef199898aa67686f1c36d2d0c73d1695443e81a9",class:"zonos--column"}),t("td",{key:"1bd5949e640823841ac7425a46b519482b975c37",class:"zonos--column zonos--collect-subtotal-title"},t("zonos-text",{key:"96d53a1ffd935ac98cd5560419cc7d5395945da4",type:"semiBoldLabel"},L("Customs fees total"))),t("td",{key:"008f69a34b557f2660426acccafe925f6b554293",class:"zonos--column zonos--collect-subtotal-price"},O({content:t("zonos-text",{type:"semiBoldLabel"},A({amount:h.amountDutyTaxFeeTotal||0,isForeign:!0})),isLoading:h.isFetchingShippingInfo,skeletonHeight:"14px",skeletonWidth:"150px"})))))}static get assetsDirs(){return["assets"]}};J.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{position:-webkit-sticky;position:sticky;bottom:60px}:host .zonos--collect-table{width:100%;border:none;border-collapse:collapse;overflow:auto;font-size:var(--zonos-elements-font-size-base)}:host .zonos--collect-table .zonos--column{padding:8px 8px;vertical-align:top}:host .zonos--collect-table .zonos--column:last-child{text-align:right;padding-right:0}:host .zonos--collect-table .zonos--column:first-child{width:60px;max-width:100px}:host .zonos--title-with-icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:8px}:host .zonos--collect-subtotal-price{text-align:right}:host .zonos--collect-subtotal-price zonos-text{white-space:nowrap}:host .zonos--collect-total .zonos--column{padding:16px 0}:host .zonos--collect-total-subtotal .zonos--collect-subtotal-title,:host .zonos--collect-total-subtotal .zonos--collect-subtotal-price{border-bottom:1px solid var(--zonos-elements-gray-200)}:host .zonos--collect-subtotal-price zonos-text,:host .zonos--collect-pay-total zonos-text{white-space:nowrap}";export{Q as zonos_collect_finish,G as zonos_collect_footer,X as zonos_collect_order_details,Y as zonos_collect_payment,q as zonos_collect_review,J as zonos_collect_subtotal}
|