@zonos/elements 1.4.1 → 1.4.2
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/index.cjs.js +7 -7
- package/dist/cjs/zonos-checkout.cjs.entry.js +77 -0
- package/dist/collection/components/utils/checkout/isBigCommerceCheckoutBypassEnabled.js +74 -0
- package/dist/collection/components/utils/checkout/watchImmediateBigcommerceDomesticCheckoutRedirect.js +8 -0
- package/dist/esm/index.js +7 -7
- package/dist/esm/zonos-checkout.entry.js +77 -0
- package/dist/esm-es5/index.js +4 -4
- package/dist/esm-es5/zonos-checkout.entry.js +38 -13
- package/dist/scripts/index.d.ts +14 -0
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/utils/checkout/isBigCommerceCheckoutBypassEnabled.d.ts +11 -0
- package/dist/types/types/checkout/CheckoutConfig.d.ts +14 -0
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-0457f579.entry.js +1 -0
- package/dist/zonos-elements/p-Bu9WCfUC.system.js +1 -1
- package/dist/zonos-elements/{p-DPZSD7Kg.system.js → p-DCS8qcL6.system.js} +4 -4
- package/dist/zonos-elements/{p-5236c676.system.entry.js → p-be1237fc.system.entry.js} +68 -43
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/zonos-elements/p-f8b50aa0.entry.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,o,t,n){function r(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function c(e){try{a(n["throw"](e))}catch(e){i(e)}}function a(e){e.done?t(e.value):r(e.value).then(s,c)}a((n=n.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,r,i,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=c(0),s["throw"]=c(1),s["return"]=c(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(o){return a([e,o])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,c[0]&&(t=0)),t)try{if(n=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:t.label++;return{value:c[1],done:false};case 5:t.label++;r=c[1];c=[0];continue;case 7:c=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1];i=c;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(c);break}if(i[2])t.ops.pop();t.trys.pop();continue}c=o.call(e,t)}catch(e){c=[6,e];r=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var n=0,r=o.length,i;n<r;n++){if(i||!(n in o)){if(!i)i=Array.prototype.slice.call(o,0,n);i[n]=o[n]}}return e.concat(i||Array.prototype.slice.call(o))};System.register(["./p-CIevpRv_.system.js","./p-DS-qw_qc.system.js","./p-XDxdMlQl.system.js","./p-DOD2I44l.system.js","./p-BuU_p5DP.system.js","./p-BDopxBpR.system.js","./p-zVLAvre1.system.js","./p-CBx5nYet.system.js","./p-BbgqQIHv.system.js","./p-smUku7Ku.system.js","./p-C2j7R11h.system.js","./p-DBOI98r5.system.js","./p-DQZncB2d.system.js","./p-DW-fW8yR.system.js","./p-BNtWsPPP.system.js","./p-0D0aCMu6.system.js","./p-Cby4EkFu.system.js","./p-B3GRrRtL.system.js","./p-DoEHepOc.system.js","./p-BGktDPwA.system.js","./p-8PPEbm_0.system.js"],(function(e){"use strict";var o,t,n,r,i,s,c,a,u,d,l,f,h,v,m,p,g,w,z,k,y,b,_,C,x,S,I,T,A,O,B,E,
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,o,t,n){function r(e){return e instanceof t?e:new t((function(o){o(e)}))}return new(t||(t=Promise))((function(t,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function c(e){try{a(n["throw"](e))}catch(e){i(e)}}function a(e){e.done?t(e.value):r(e.value).then(s,c)}a((n=n.apply(e,o||[])).next())}))};var __generator=this&&this.__generator||function(e,o){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},n,r,i,s=Object.create((typeof Iterator==="function"?Iterator:Object).prototype);return s.next=c(0),s["throw"]=c(1),s["return"]=c(2),typeof Symbol==="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(e){return function(o){return a([e,o])}}function a(c){if(n)throw new TypeError("Generator is already executing.");while(s&&(s=0,c[0]&&(t=0)),t)try{if(n=1,r&&(i=c[0]&2?r["return"]:c[0]?r["throw"]||((i=r["return"])&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;if(r=0,i)c=[c[0]&2,i.value];switch(c[0]){case 0:case 1:i=c;break;case 4:t.label++;return{value:c[1],done:false};case 5:t.label++;r=c[1];c=[0];continue;case 7:c=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){t=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){t.label=c[1];break}if(c[0]===6&&t.label<i[1]){t.label=i[1];i=c;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(c);break}if(i[2])t.ops.pop();t.trys.pop();continue}c=o.call(e,t)}catch(e){c=[6,e];r=0}finally{n=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,o,t){if(t||arguments.length===2)for(var n=0,r=o.length,i;n<r;n++){if(i||!(n in o)){if(!i)i=Array.prototype.slice.call(o,0,n);i[n]=o[n]}}return e.concat(i||Array.prototype.slice.call(o))};System.register(["./p-CIevpRv_.system.js","./p-DS-qw_qc.system.js","./p-XDxdMlQl.system.js","./p-DOD2I44l.system.js","./p-BuU_p5DP.system.js","./p-BDopxBpR.system.js","./p-zVLAvre1.system.js","./p-CBx5nYet.system.js","./p-BbgqQIHv.system.js","./p-smUku7Ku.system.js","./p-C2j7R11h.system.js","./p-DBOI98r5.system.js","./p-DQZncB2d.system.js","./p-DW-fW8yR.system.js","./p-BNtWsPPP.system.js","./p-0D0aCMu6.system.js","./p-Cby4EkFu.system.js","./p-B3GRrRtL.system.js","./p-DoEHepOc.system.js","./p-BGktDPwA.system.js","./p-8PPEbm_0.system.js"],(function(e){"use strict";var o,t,n,r,i,s,c,a,u,d,l,f,h,v,m,p,g,w,z,k,y,b,_,C,x,S,I,T,A,O,B,P,E,U,D,L,N,j,R,F,M,H,Z,G,K,V,Q,W,Y,q,J,X,$,ee,oe,te,ne,re,ie,se,ce,ae,ue,de,le,fe,he,ve,me,pe,ge,we,ze,ke,ye,be,_e,Ce,xe,Se,Ie,Te,Ae,Oe,Be,Pe;return{setters:[function(e){o=e.r;t=e.h;n=e.F;r=e.a},function(e){i=e.s;s=e.a;c=e.b;a=e.i;u=e.c;d=e.g;l=e.d;f=e.e;h=e.f;v=e.p;m=e.h;p=e.j;g=e.k;w=e.l;z=e.m;k=e.n;y=e.o;b=e.t;_=e.q;C=e.r;x=e.u;S=e.v;I=e.w;T=e.x;A=e.y;O=e.z;B=e.A;P=e.B;E=e.C;U=e.D;D=e.E;L=e.F;N=e.G;j=e.H;R=e.I;F=e.J;M=e.K},function(e){H=e.p;Z=e.s;G=e.a;K=e.b},function(e){V=e.f;Q=e.a;W=e.b;Y=e.i;q=e.l;J=e.c;X=e.d;$=e.g;ee=e.s;oe=e.V;te=e.e;ne=e.t;re=e.h;ie=e.j},function(e){se=e.z;ce=e.g;ae=e.m},function(e){ue=e.b},function(e){de=e.h;le=e.g;fe=e.j;he=e.l;ve=e.b;me=e.s;pe=e.a;ge=e.i},function(e){we=e.u},function(e){ze=e.l;ke=e.g;ye=e.b},function(e){be=e._;_e=e.c;Ce=e.d;xe=e.a;Se=e.g},function(e){Ie=e.c},function(e){Te=e.c},function(e){Ae=e.g},function(e){Oe=e.i},function(e){Be=e.s},function(e){Pe=e.R},null,null,null,null,null],execute:function(){var Ee=this;
|
|
2
2
|
/**
|
|
3
3
|
* Check if store discount is enabled
|
|
4
|
-
*/var
|
|
4
|
+
*/var Ue=function(){return __awaiter(Ee,void 0,void 0,(function(){var e,o,t;return __generator(this,(function(n){switch(n.label){case 0:return[4/*yield*/,de("/api/zonos-elements/get-store-discount-enabled-status")];case 1:e=n.sent(),o=e.errors,t=e.json;if(o.length||!(t===null||t===void 0?void 0:t.enabled)){return[2/*return*/,{enabled:false}]}return[2/*return*/,{enabled:true}]}}))}))};var De=function(e){return __awaiter(Ee,[e],void 0,(function(e){var o,t,n,r;var i=e.testKeys;return __generator(this,(function(e){switch(e.label){case 0:
|
|
5
5
|
// Do nothing if no test keys are provided
|
|
6
6
|
if(i.length===0){return[2/*return*/,null]}return[4/*yield*/,de("/api/zonos-elements/select-variance-test",{body:{testKeys:i},method:"POST"})];case 1:o=e.sent(),t=o.errors,n=o.json;if(t.length||!n){return[2/*return*/,null]}r=V(n);
|
|
7
7
|
// Filter the response to only include test keys that we support
|
|
@@ -50,7 +50,7 @@ if(t.get("zonosDebug")==="1"){o.searchParams.set("zonosDebug","1")}if(le()){o.se
|
|
|
50
50
|
/**
|
|
51
51
|
* Performs the actual fetch logic to determine if the customer
|
|
52
52
|
* belongs to a bypass group.
|
|
53
|
-
*/var He=function(e){return __awaiter(
|
|
53
|
+
*/var He=function(e){return __awaiter(Ee,void 0,void 0,(function(){var o,t,n,r,i,s,c,a,u,d,l,f;return __generator(this,(function(h){switch(h.label){case 0:
|
|
54
54
|
// Only relevant for BigCommerce stores — permanent no-op on other platforms
|
|
55
55
|
if(!window.Zonos.isBigCommerce){return[2/*return*/,{conclusive:true,result:Me}]}i=(o=se.genericSettings)===null||o===void 0?void 0:o.bigcommerceBypassCustomerGroupIds;if(!(i===null||i===void 0?void 0:i.length)){if(se.loadedConfig){
|
|
56
56
|
// Settings have finished loading and there are no bypass groups
|
|
@@ -102,7 +102,7 @@ void Ge()};
|
|
|
102
102
|
* always fetches fresh BigCommerce checkout data. Use this on the
|
|
103
103
|
* BigCommerce domestic checkout page when the shipping country changes,
|
|
104
104
|
* to ensure the customer group reflects the current checkout state.
|
|
105
|
-
*/var Ve=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(
|
|
105
|
+
*/var Ve=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(Ee,__spreadArray([],e,true),void 0,(function(e){if(e===void 0){e={}}return __generator(this,(function(o){if(e.forceRefresh||!Ze){return[2/*return*/,Ge(e.preFetched)]}return[2/*return*/,Ze]}))}))};var Qe={guestCheckoutType:null};
|
|
106
106
|
/**
|
|
107
107
|
* BigCommerce's `/checkouts/settings` values almost never change after a
|
|
108
108
|
* merchant's initial setup, so we persist the result in `localStorage` and
|
|
@@ -128,7 +128,7 @@ return null}};var Je=function(e,o){try{var t={expiresAt:Date.now()+We,guestCheck
|
|
|
128
128
|
* Results are cached in `localStorage` for `CACHE_TTL_MS` so navigations
|
|
129
129
|
* inside the same store don't all pay the proxy round trip — the setting
|
|
130
130
|
* is merchant-level and rarely changes.
|
|
131
|
-
*/var Xe=function(){return __awaiter(
|
|
131
|
+
*/var Xe=function(){return __awaiter(Ee,void 0,void 0,(function(){var e,o,t,n,r,i,s;return __generator(this,(function(c){switch(c.label){case 0:if(!window.Zonos.isBigCommerce){return[2/*return*/,Qe]}o=(e=se.checkoutSettings.bigCommerceConfig)===null||e===void 0?void 0:e.storeHash;if(!o){ze("BigCommerce checkout settings: no storeHash provided — skipping fetch","info");return[2/*return*/,Qe]}t=qe(o);if(t){return[2/*return*/,t]}return[4/*yield*/,de("/api/bigcommerce/checkout-settings",{body:{storeHash:o},method:"POST"})];case 1:n=c.sent(),r=n.errors,i=n.json;if(r.length||!i){ze("BigCommerce checkout settings: proxy call failed, falling back to guest-allowed behavior","info");return[2/*return*/,Qe]}s={guestCheckoutType:i.guestCheckoutType};Je(o,s);return[2/*return*/,s]}}))}))};var $e={redirectUrl:null,shouldForceLogin:false};
|
|
132
132
|
/**
|
|
133
133
|
* Session cache for the merchant-level "does BC require login?" answer.
|
|
134
134
|
* Hitting `/checkouts/settings` on every checkout open would add a visible
|
|
@@ -167,7 +167,7 @@ if(eo===e){eo=null}return false}));eo=e}return eo};
|
|
|
167
167
|
* Returning a `redirectUrl` is an instruction, not an action: callers drive
|
|
168
168
|
* the navigation themselves so they can short-circuit any UI state (loading
|
|
169
169
|
* overlays, dialog open flags) before `window.location.href` flips.
|
|
170
|
-
*/var no=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(
|
|
170
|
+
*/var no=function(){var e=[];for(var o=0;o<arguments.length;o++){e[o]=arguments[o]}return __awaiter(Ee,__spreadArray([],e,true),void 0,(function(e){var o,t,n,r,i;var s=e===void 0?{}:e,c=s.preFetched;return __generator(this,(function(e){switch(e.label){case 0:if(!window.Zonos.isBigCommerce){return[2/*return*/,$e]}return[4/*yield*/,oo()];case 1:o=e.sent();if(!o){return[2/*return*/,$e]}if(!c)return[3/*break*/,2];n=c.checkoutId;return[3/*break*/,4];case 2:return[4/*yield*/,Q()];case 3:n=e.sent();e.label=4;case 4:t=n;if(!t){
|
|
171
171
|
// No active cart — nothing to protect. Force-login only matters once
|
|
172
172
|
// the shopper has a cart we're about to carry into Zonos checkout.
|
|
173
173
|
return[2/*return*/,$e]}if(!c)return[3/*break*/,5];i=c.checkout;return[3/*break*/,7];case 5:return[4/*yield*/,W(t)];case 6:i=e.sent();e.label=7;case 7:r=i;if(!r){
|
|
@@ -239,17 +239,38 @@ return f.map((function(e,o){return{index:o,option:e}})).sort((function(e,o){var
|
|
|
239
239
|
*/
|
|
240
240
|
o){if(e===void 0){e=true}if(!q.localizationLoaded){return false}if(o){var t=J(o);if(e&&!t){ze("Checkout: ".concat(o," is not a shippable country: ").concat(t))}return t}
|
|
241
241
|
// if localization is loaded and the localization is not a shippable country, keep the original click event
|
|
242
|
-
if(!q.isShippableCountry){if(e){ze("Checkout: not shippable country")}return false}return true};var vo=
|
|
242
|
+
if(!q.isShippableCountry){if(e){ze("Checkout: not shippable country")}return false}return true};var vo=["1","true","yes"];
|
|
243
|
+
/**
|
|
244
|
+
* Page-load result of reading the checkout `zBypass` query. Later calls on the
|
|
245
|
+
* same checkout URL reuse this so stripping the parameter does not change the
|
|
246
|
+
* answer.
|
|
247
|
+
*/var mo=null;var po=function(){return window.location.pathname.includes("/checkout")};var go=function(e){if(e===null){return false}return vo.includes(e.trim().toLowerCase())};
|
|
248
|
+
/**
|
|
249
|
+
* True only when zonos-settings set
|
|
250
|
+
* `checkoutSettings.plugins.bigcommerce.allowBypassQuery` to `true`.
|
|
251
|
+
*/var wo=function(){var e,o;return((o=(e=se.checkoutSettings.plugins)===null||e===void 0?void 0:e.bigcommerce)===null||o===void 0?void 0:o.allowBypassQuery)===true};
|
|
252
|
+
/**
|
|
253
|
+
* Read an accepted `zBypass` query on the checkout page once, then remove it
|
|
254
|
+
* from the URL. A later call on that same URL returns the same answer.
|
|
255
|
+
*/var zo=function(){var e=window.location,o=e.pathname,t=e.search;if(mo&&mo.pathname===o&&mo.search===t){return mo.enabled}var n=new URLSearchParams(t);var r=go(n.get("zBypass"));if(!r){mo={enabled:false,pathname:o,search:t};return false}n.delete("zBypass");var i=n.toString();var s=window.location.hash||"";var c="".concat(o).concat(i?"?".concat(i):"").concat(s);window.history.replaceState(window.history.state,document.title,c);var a=wo();mo={enabled:a,pathname:o,search:window.location.search};return a};
|
|
256
|
+
/**
|
|
257
|
+
* True when this BigCommerce checkout page should skip address detection.
|
|
258
|
+
* That is only when zonos-settings allows the `zBypass` query and this
|
|
259
|
+
* checkout URL has an accepted value. Storefront pages are never bypassed, so
|
|
260
|
+
* the query stays in the URL until checkout. The query is removed once, and
|
|
261
|
+
* later calls on that checkout URL keep the same answer. Nothing is written
|
|
262
|
+
* to storage.
|
|
263
|
+
*/var ko=function(){var e;if(!((e=window.Zonos)===null||e===void 0?void 0:e.isBigCommerce)||!po()){return false}return zo()};var yo='select[name="shippingAddress.countryCode"]';
|
|
243
264
|
/**
|
|
244
265
|
* Native BigCommerce shipping-step "Continue" button. Clicking it commits the
|
|
245
266
|
* selected shipping address and advances to the payment step.
|
|
246
|
-
*/var
|
|
267
|
+
*/var bo="#checkout-shipping-continue, #checkout-billing-continue, #checkout-payment-continue";
|
|
247
268
|
/**
|
|
248
269
|
* Check if the logged-in user already has a shipping address on the checkout
|
|
249
270
|
* that is internationally shippable. If so, optionally prompt the user to
|
|
250
271
|
* confirm before saving the address to session and redirecting to the home
|
|
251
272
|
* page to open the international checkout.
|
|
252
|
-
*/var
|
|
273
|
+
*/var _o=function(e){return __awaiter(Ee,[e],void 0,(function(e){var o,t,n,r,i,c,a,u,d,l,f,h,v,m,p,g,w,z;var k=e.onInternationalCheckoutSelected,y=e.onLoggedInInternationalAddressDetected;return __generator(this,(function(e){switch(e.label){case 0:return[4/*yield*/,Q()];case 1:f=e.sent();if(!f){return[2/*return*/,"noAction"]}return[4/*yield*/,W(f)];case 2:h=e.sent();v={checkout:h,checkoutId:f};return[4/*yield*/,Ve({preFetched:v})];case 3:m=e.sent().shouldBypass;if(m){return[2/*return*/,"noAction"]}p=(t=(o=h===null||h===void 0?void 0:h.consignments)===null||o===void 0?void 0:o[0])===null||t===void 0?void 0:t.shippingAddress;if(!(p===null||p===void 0?void 0:p.countryCode)){return[2/*return*/,"noAction"]}g=p.countryCode;if(!ho(false,g)){return[2/*return*/,"noAction"]}ze(y?"Logged-in user has international shipping address: ".concat(g,", prompting user to choose checkout"):"Logged-in user has international shipping address: ".concat(g,", redirecting automatically (legacy behavior)"),"info");if(!y)return[3/*break*/,5];return[4/*yield*/,y()];case 4:w=e.sent();if(w==="stay"){ze("User opted to stay on BigCommerce native checkout despite international default address","info");return[2/*return*/,"optedOut"]}e.label=5;case 5:return[4/*yield*/,no({preFetched:v})];case 6:z=e.sent();if(z.shouldForceLogin&&z.redirectUrl){window.location.href=z.redirectUrl;return[2/*return*/,"redirected"]}if(!k)return[3/*break*/,8];return[4/*yield*/,k()];case 7:e.sent();e.label=8;case 8:
|
|
253
274
|
// Update localization store with the detected country
|
|
254
275
|
X({isInitializing:false,newSelectedCountryCode:g,persistOverride:false});
|
|
255
276
|
// Save the shipping address to session storage for the international checkout
|
|
@@ -261,13 +282,17 @@ window.location.href=Fe("/");return[2/*return*/,"redirected"]}}))}))};
|
|
|
261
282
|
/**
|
|
262
283
|
* Watch for changes in domestic checkout step. Redirects user to home page to open international checkout when user selects a country in the international shipping zone.
|
|
263
284
|
* @note Only works on default bigcommerce checkout page
|
|
264
|
-
*/var
|
|
285
|
+
*/var Co=function(e){var o=e.domesticRedirectedBtnSelector,t=e.onInternationalCheckoutSelected,n=e.onLoggedInInternationalAddressDetected,r=e.onShippingAddressSessionFound;if(!window.Zonos.isBigCommerce){return}
|
|
286
|
+
// Only the native checkout page skips address detection. Storefront pages
|
|
287
|
+
// still run the domestic-session handoff below, and they do not consume
|
|
288
|
+
// a `zBypass` query, so the parameter can survive until `/checkout`.
|
|
289
|
+
if(window.location.pathname.includes("/checkout")&&ko()){return}
|
|
265
290
|
/**
|
|
266
291
|
* Keep checking.
|
|
267
292
|
* @returns `true` if the caller should stop polling — either because the user
|
|
268
293
|
* is being redirected to Zonos international checkout, or because the
|
|
269
294
|
* logged-in customer is in a bypass group and should stay on BC checkout.
|
|
270
|
-
*/var c=function(e){return __awaiter(
|
|
295
|
+
*/var c=function(e){return __awaiter(Ee,void 0,void 0,(function(){var o,n,r,i,c,a,u,d,l,f;return __generator(this,(function(h){switch(h.label){case 0:n=document.querySelector(((o=se.genericSettings)===null||o===void 0?void 0:o.bigcommerceDomesticCheckoutCountrySelector)||yo);r=(n===null||n===void 0?void 0:n.value)||e;if(!r){
|
|
271
296
|
// do nothing if shipping country is not found
|
|
272
297
|
return[2/*return*/,"noAction"]}if(!ho(false,r)){
|
|
273
298
|
// do nothing if shipping country is not shippable
|
|
@@ -297,7 +322,7 @@ window.location.href=Fe("/");return[2/*return*/,"redirected"]}}))}))};
|
|
|
297
322
|
* checkout. Logged-in shoppers picking a saved address don't expose a
|
|
298
323
|
* country `<select>`, so read it from the active checkout consignment via the
|
|
299
324
|
* Storefront API; fall back to the `<select>` value when one is present.
|
|
300
|
-
*/var d=function(){return __awaiter(
|
|
325
|
+
*/var d=function(){return __awaiter(Ee,void 0,void 0,(function(){var e,o,t,n,r,i,s,c;return __generator(this,(function(a){switch(a.label){case 0:return[4/*yield*/,Q()];case 1:r=a.sent();if(!r)return[3/*break*/,3];return[4/*yield*/,W(r)];case 2:i=a.sent();s=(t=(o=(e=i===null||i===void 0?void 0:i.consignments)===null||e===void 0?void 0:e[0])===null||o===void 0?void 0:o.shippingAddress)===null||t===void 0?void 0:t.countryCode;if(s){return[2/*return*/,s]}a.label=3;case 3:c=document.querySelector(((n=se.genericSettings)===null||n===void 0?void 0:n.bigcommerceDomesticCheckoutCountrySelector)||yo);return[2/*return*/,(c===null||c===void 0?void 0:c.value)||null]}}))}))};
|
|
301
326
|
/**
|
|
302
327
|
* Req 2 (05CHECK-887): once a logged-in shopper with an international default
|
|
303
328
|
* address has chosen to "Stay on this page", we must still force them onto
|
|
@@ -312,7 +337,7 @@ window.location.href=Fe("/");return[2/*return*/,"redirected"]}}))}))};
|
|
|
312
337
|
* checkout. On any outcome other than a redirect — domestic, bypass group,
|
|
313
338
|
* or an unexpected error — replay the click so BigCommerce's own handler runs
|
|
314
339
|
* and the shopper is never left stuck on the shipping step.
|
|
315
|
-
*/var l=function(e,o){return __awaiter(
|
|
340
|
+
*/var l=function(e,o){return __awaiter(Ee,void 0,void 0,(function(){var t,n,r,i,s,u;return __generator(this,(function(l){switch(l.label){case 0:t=true;l.label=1;case 1:l.trys.push([1,9,,10]);n=null;l.label=2;case 2:l.trys.push([2,4,,5]);return[4/*yield*/,d()];case 3:n=l.sent();return[3/*break*/,5];case 4:r=l.sent();he("Error resolving selected shipping country on BC continue",r);return[3/*break*/,5];case 5:
|
|
316
341
|
// When the shopper is committing an international address we're about to
|
|
317
342
|
// save the domestic shipping session and redirect to `/`. Disconnect this
|
|
318
343
|
// /checkout-page observer first: otherwise its own session-detection
|
|
@@ -341,7 +366,7 @@ he("Error handling BC continue international redirect",u);return[3/*break*/,10];
|
|
|
341
366
|
*/var f=function(e){if(u){return}u=true;document.addEventListener("click",(function(o){
|
|
342
367
|
// Programmatic replay for the domestic / bypass case — let BC's own
|
|
343
368
|
// handler run without interference.
|
|
344
|
-
if(a){return}var t=o.target;if(!(t instanceof Element)){return}var n=t.closest(
|
|
369
|
+
if(a){return}var t=o.target;if(!(t instanceof Element)){return}var n=t.closest(bo);if(!n){return}
|
|
345
370
|
// Block BC's native advance until we know whether the selected shipping
|
|
346
371
|
// country forces an international redirect. Capture phase +
|
|
347
372
|
// stopImmediatePropagation (done synchronously here, before the async
|
|
@@ -370,13 +395,13 @@ o.preventDefault();o.stopImmediatePropagation();void l(n,e)}),true)};var h=false
|
|
|
370
395
|
// `handleInternationalCheckoutSelected` (both consult the helper), so the
|
|
371
396
|
// top-level gate is redundant. `initBigCommerceBypassCheck()` is called on
|
|
372
397
|
// page load so those inner calls typically resolve against a warm cache.
|
|
373
|
-
var w=new MutationObserver((function(){return __awaiter(
|
|
398
|
+
var w=new MutationObserver((function(){return __awaiter(Ee,void 0,void 0,(function(){var e,s,a,u,d,l,z,k,y,b;var _=this;return __generator(this,(function(C){switch(C.label){case 0:s=document.querySelector(o);a=i();
|
|
374
399
|
// append a hidden button to the body if the shipping address session is found
|
|
375
400
|
if(!s&&a){u=document.createElement("button");u.style.display="none";u.id="zonos--domestic-redirected-checkout-button";document.body.appendChild(u);r===null||r===void 0?void 0:r(a);
|
|
376
401
|
// disconnect the observer after we found the shipping continue button
|
|
377
402
|
w.disconnect();return[2/*return*/]}d=window.location.pathname.includes("/checkout")&&window.Zonos.isBigCommerce;
|
|
378
403
|
// Should just disconnect the observer if it's not bigcommerce domestic checkout page
|
|
379
|
-
if(!d){w.disconnect();return[2/*return*/]}if(!(!p&&!m))return[3/*break*/,5];m=true;g=true;C.label=1;case 1:C.trys.push([1,3,4,5]);return[4/*yield*/,
|
|
404
|
+
if(!d){w.disconnect();return[2/*return*/]}if(!(!p&&!m))return[3/*break*/,5];m=true;g=true;C.label=1;case 1:C.trys.push([1,3,4,5]);return[4/*yield*/,_o({onInternationalCheckoutSelected:t,onLoggedInInternationalAddressDetected:n})];case 2:l=C.sent();if(l==="redirected"){w.disconnect();return[2/*return*/]}if(l==="optedOut"){
|
|
380
405
|
// User elected to stay on BC native checkout — don't prompt again
|
|
381
406
|
// for the rest of this session. Continue with the rest of the
|
|
382
407
|
// observer logic so the country-change watcher still fires when
|
|
@@ -385,7 +410,7 @@ p=true;
|
|
|
385
410
|
// Attach the "Continue" redirect hook now (once). Delegation on
|
|
386
411
|
// `document` keeps it working even after this observer disconnects
|
|
387
412
|
// when the country <select> path sets up its interval below.
|
|
388
|
-
f(w)}return[3/*break*/,5];case 3:z=C.sent();he("Error checking logged-in user shipping address",z);return[3/*break*/,5];case 4:m=false;g=false;return[7/*endfinally*/];case 5:k=document.querySelector(((e=se.genericSettings)===null||e===void 0?void 0:e.bigcommerceDomesticCheckoutCountrySelector)||
|
|
413
|
+
f(w)}return[3/*break*/,5];case 3:z=C.sent();he("Error checking logged-in user shipping address",z);return[3/*break*/,5];case 4:m=false;g=false;return[7/*endfinally*/];case 5:k=document.querySelector(((e=se.genericSettings)===null||e===void 0?void 0:e.bigcommerceDomesticCheckoutCountrySelector)||yo);
|
|
389
414
|
// Shouldn't do anything if it's not bigcommerce domestic checkout page
|
|
390
415
|
if(!k){
|
|
391
416
|
// do nothing if shipping country and the continue button is not found
|
|
@@ -402,27 +427,27 @@ if(h||g){return[2/*return*/]}h=true;t.label=1;case 1:t.trys.push([1,3,,4]);retur
|
|
|
402
427
|
// - the logged-in customer is in a bypass group (stay on BC checkout)
|
|
403
428
|
if(e==="redirected"||e==="bypass"){clearInterval(y);return[2/*return*/]}h=false;return[3/*break*/,4];case 3:o=t.sent();h=false;return[3/*break*/,4];case 4:return[2/*return*/]}}))}))}),1e3);b=setInterval((function(){var e;if(!window.bcStripeElements){clearInterval(b);return}var o=(e=window.bcStripeElements)===null||e===void 0?void 0:e.getElement("address");if(!o){return}clearInterval(b);o.on("change",(function(e){var o=e.value.address.country;if(o&&!g){void c(o)}}));
|
|
404
429
|
// we want to attacch event to addressElement as soon as it's loaded
|
|
405
|
-
}),500);return[2/*return*/]}}))}))}));w.observe(document.body,{childList:true,subtree:true})};var
|
|
430
|
+
}),500);return[2/*return*/]}}))}))}));w.observe(document.body,{childList:true,subtree:true})};var xo=function(){var e=new URLSearchParams(window.location.search);ze("legacy urlParams","info",Object.fromEntries(e.entries()));var o=function(o){var t=e.get(o);if(!t||t==="undefined"){return""}return t};var t=
|
|
406
431
|
// fallback to selected country code if country is not provided
|
|
407
|
-
$(e)||q.selectedCountryCode||"US";var n=o("customerCity");var r=o("customerEmail");var i=o("customerAddress1");var s=o("customerAddress2");var c=o("customerName");var a=o("customerPhone");var u=o("customerZip");var d=o("customerState");var l=o("customerFirstName");var f=o("customerLastName");return{customerAddress1:i,customerAddress2:s,customerCity:n,customerCountry:t,customerEmail:r,customerFirstName:l,customerLastName:f,customerName:c,customerPhone:a,customerState:d,customerZip:u}};var
|
|
432
|
+
$(e)||q.selectedCountryCode||"US";var n=o("customerCity");var r=o("customerEmail");var i=o("customerAddress1");var s=o("customerAddress2");var c=o("customerName");var a=o("customerPhone");var u=o("customerZip");var d=o("customerState");var l=o("customerFirstName");var f=o("customerLastName");return{customerAddress1:i,customerAddress2:s,customerCity:n,customerCountry:t,customerEmail:r,customerFirstName:l,customerLastName:f,customerName:c,customerPhone:a,customerState:d,customerZip:u}};var So=0;var Io=function(){return __awaiter(Ee,void 0,void 0,(function(){var e,o;var t;return __generator(this,(function(n){switch(n.label){case 0:
|
|
408
433
|
// Don't send the log if there are no API calls to send
|
|
409
434
|
if(window.Zonos.loadTimeApiInfoList.length===0){return[2/*return*/]}ze("Sending bulk load time api log","info",{loadTimeApiInfoList:window.Zonos.loadTimeApiInfoList});e={data:__spreadArray([],window.Zonos.loadTimeApiInfoList,true),storeId:window.Zonos.storeId||0};
|
|
410
435
|
// Clear the list after sending the log successfully
|
|
411
436
|
window.Zonos.loadTimeApiInfoList.length=0;return[4/*yield*/,de("/api/zonos-elements/log-bulk-load-data",{body:e,method:"POST"})];case 1:o=n.sent().errors;if(o.length){
|
|
412
437
|
// If there are errors, add the logs back to the list so we can try again later
|
|
413
|
-
(t=window.Zonos.loadTimeApiInfoList).push.apply(t,e.data);
|
|
438
|
+
(t=window.Zonos.loadTimeApiInfoList).push.apply(t,e.data);So++;if(So>5&&window.Zonos.logIntervalId){
|
|
414
439
|
// If there are more than 3 failures, stop the interval
|
|
415
|
-
clearInterval(window.Zonos.logIntervalId)}}return[2/*return*/]}}))}))};var
|
|
440
|
+
clearInterval(window.Zonos.logIntervalId)}}return[2/*return*/]}}))}))};var To=function(){return __awaiter(Ee,void 0,void 0,(function(){var e,o;return __generator(this,(function(t){e=ke().elapsedTime;o={cache:"miss",eventName:"jsdelivr",flag:"LOG_CHECKOUT_FACADE_LOAD",href:window.location.href,loadTime:e,metadata:Object.assign({allLogs:ye},ve()),scriptLoadUrl:"checkoutFacade",storeId:window.Zonos.storeId||0};void de("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2/*return*/]}))}))};var Ao=function(e){return __awaiter(Ee,[e],void 0,(function(e){var o;var t=e.loadTime;return __generator(this,(function(e){o={cache:"miss",eventName:"jsdelivr",flag:"LOG_NATIVE_CHECKOUT_LOAD",href:window.location.href,loadTime:t,metadata:Object.assign({allLogs:ye},ve()),scriptLoadUrl:"nativeCheckout",storeId:window.Zonos.storeId||0};void de("/api/zonos-elements/log-script-load",{body:o,method:"POST"});return[2/*return*/]}))}))};var Oo=function(e){return(e===null||e===void 0?void 0:e.filter((function(e){if(e.expiresAt&&e.expiresAt<Date.now()||!e.expiresAt){return false}return true})))||[]};var Bo=function(e){var o;var t=(o=ee.enabledVariantTestKeys)===null||o===void 0?void 0:o.find((function(o){return o.testKey===e}));return(t===null||t===void 0?void 0:t.selectedVariantKey)||null};var Po=function(e){return se.enabledVariantTestKeys.includes(e)};var Eo=function(e){var o=e.baseTestObj,t=e.mergeTestObj;return o.map((function(e){var o=e.testKey;
|
|
416
441
|
// We will attempt to get the enabled selection from localStorage first and only re-fetch if the testKeys are changed
|
|
417
|
-
var n=t.find((function(e){var t=e.testKey;return t===o}));return{expiresAt:(n===null||n===void 0?void 0:n.expiresAt)||Date.now()+oe,selectedVariantKey:(n===null||n===void 0?void 0:n.selectedVariantKey)||null,testKey:o}}))};var
|
|
442
|
+
var n=t.find((function(e){var t=e.testKey;return t===o}));return{expiresAt:(n===null||n===void 0?void 0:n.expiresAt)||Date.now()+oe,selectedVariantKey:(n===null||n===void 0?void 0:n.selectedVariantKey)||null,testKey:o}}))};var Uo=function(e){return __awaiter(Ee,[e],void 0,(function(e){var o,t,n,r,i;var s=e.cartId,c=e.retries;return __generator(this,(function(e){switch(e.label){case 0:o=le();return[4/*yield*/,de("/api/zonos-elements/get-temp-cart",{body:{isTestMode:o,options:{noOnlineStoreSettings:true},tempCartUUID:s},headers:{"Content-Type":"application/json"},method:"POST"})];case 1:t=e.sent(),n=t.errors,r=t.json;i=!r||n.length;if(!(i&&c))return[3/*break*/,3];ze("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:c});
|
|
418
443
|
// wait 1 second before retrying
|
|
419
444
|
return[4/*yield*/,new Promise((function(e){return setTimeout(e,500)}))];case 2:
|
|
420
445
|
// wait 1 second before retrying
|
|
421
|
-
e.sent();return[2/*return*/,
|
|
446
|
+
e.sent();return[2/*return*/,Uo({cartId:s,retries:c-1})];case 3:if(i){return[2/*return*/,null]}return[2/*return*/,r]}}))}))};var Do=function(e){return __awaiter(Ee,void 0,void 0,(function(){var o,t,n,r;return __generator(this,(function(i){switch(i.label){case 0:o=be(e),t=o.isDgsCartId,n=o.isLegacyCartId;if(!n&&!t){he("[ZONOS - loadZonos] invalid cart id");return[2/*return*/,null]}return[4/*yield*/,Uo({cartId:e,retries:5})];case 1:r=i.sent();ze("[ZONOS - loadZonos] getting temp cart data","info",r);if(!r){he("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process.");return[2/*return*/,null]}window.Zonos.storeId=r.cartData.storeId;window.Zonos.zonosApiKey=r.cartData.credentialToken;return[2/*return*/,{cartData:r.cartData,storeFavicon:r.storeFaviconUrl,storeId:r.cartData.storeId,storeLogo:r.storeLogoUrl,zonosApiKey:r.cartData.credentialToken}]}}))}))};var Lo='<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n';var No=function(){return".sc-zonos-checkout-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-checkout-h *.sc-zonos-checkout{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-checkout-h img.sc-zonos-checkout{max-width:100%}.sc-zonos-checkout-h dl.sc-zonos-checkout,.sc-zonos-checkout-h dd.sc-zonos-checkout,.sc-zonos-checkout-h h1.sc-zonos-checkout,.sc-zonos-checkout-h h2.sc-zonos-checkout,.sc-zonos-checkout-h h3.sc-zonos-checkout,.sc-zonos-checkout-h h4.sc-zonos-checkout,.sc-zonos-checkout-h h5.sc-zonos-checkout,.sc-zonos-checkout-h h6.sc-zonos-checkout,.sc-zonos-checkout-h hr.sc-zonos-checkout,.sc-zonos-checkout-h figure.sc-zonos-checkout,.sc-zonos-checkout-h p.sc-zonos-checkout,.sc-zonos-checkout-h pre.sc-zonos-checkout{margin:0}.sc-zonos-checkout-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-checkout-h{z-index:2147483647;position:fixed}.sc-zonos-checkout-h *.sc-zonos-checkout{-ms-scroll-chaining:none;overscroll-behavior:contain}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar{width:10px}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}.sc-zonos-checkout-h *.sc-zonos-checkout::-webkit-scrollbar-thumb:hover{background:#d6d6d6}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;height:100%;overflow:hidden;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10))}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex:1;flex:1;padding:32px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{background-color:var(--zonos--primary-color, var(--zonos-elements-gray-0));border-right:1px solid var(--zonos-elements-gray-200)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{background-color:var(--zonos-elements-gray-0)}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:100%;max-height:100%;height:100%;overflow:auto;-ms-flex-direction:column;flex-direction:column;background-color:var(--zonos-elements-gray-0);-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;padding:24px;padding-bottom:50px}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--header.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;width:100%}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout .zonos--logo.sc-zonos-checkout{margin-bottom:0}.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout zonos-checkout-finish.sc-zonos-checkout{-ms-flex:1;flex:1}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;position:relative}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{padding:0 8px 8px}.sc-zonos-checkout-h .zonos--left.sc-zonos-checkout .zonos--payment-error-banner.sc-zonos-checkout{margin-top:24px}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout{position:relative}.sc-zonos-checkout-h .zonos--right.sc-zonos-checkout .zonos--right-actions.sc-zonos-checkout{position:absolute;right:24px;top:24px;z-index:2;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--wrapper.sc-zonos-checkout{overflow:auto;max-height:100%;position:relative}.sc-zonos-checkout-h .flex--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;max-height:100%}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;gap:16px;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo-wrapper.sc-zonos-checkout>*.sc-zonos-checkout{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}.sc-zonos-checkout-h .zonos--logo.sc-zonos-checkout img.sc-zonos-checkout{max-height:72px}.sc-zonos-checkout-h .zonos--checkout-default-message.sc-zonos-checkout{margin-left:76px;margin-bottom:8px}.zonos--close-button.sc-zonos-checkout{-ms-flex-item-align:start;align-self:flex-start}.preview.sc-zonos-checkout-h{min-width:500px;margin:auto;position:relative}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{border:var(--zonos-elements-border)}.preview.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{padding:32px}.hidden-mode.sc-zonos-checkout-h{height:0;opacity:0;pointer-events:none;position:absolute;visibility:hidden;width:0;z-index:-1}.mobile.sc-zonos-checkout-h{min-width:auto}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;overflow:auto;border-radius:0;max-height:100%;height:100%;border:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding:12px;padding-bottom:76px}@media (max-width: 768px){.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout,.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{padding-bottom:0}}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--left.sc-zonos-checkout{-ms-flex-order:2;order:2;border-right:none}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout{-ms-flex-order:1;order:1;padding-top:16px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;border:var(--zonos-elements-border);border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-10));background-color:var(--zonos-elements-gray-50);padding:12px;margin-top:32px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--review.sc-zonos-checkout{margin-bottom:0}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--right.sc-zonos-checkout .zonos--cart-items.sc-zonos-checkout{margin-top:8px}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout zonos-checkout-footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--wrapper.sc-zonos-checkout{max-height:100%}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--footer.sc-zonos-checkout{-ms-flex-order:3;order:3}.mobile.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout .zonos--done.sc-zonos-checkout{width:auto}.mobile.sc-zonos-checkout-h .zonos--cart-subtotal.sc-zonos-checkout{margin:0}.iframed.sc-zonos-checkout-h .zonos--content.sc-zonos-checkout{-ms-scroll-chaining:chained;overscroll-behavior:auto}.zonos--processing-payment.sc-zonos-checkout-h{z-index:2147483646}"};
|
|
422
447
|
// 90 minutes
|
|
423
|
-
var
|
|
448
|
+
var jo=90*60*1e3;
|
|
424
449
|
// 6 hours
|
|
425
|
-
var
|
|
450
|
+
var Ro=6*60*60*1e3;var Fo=e("zonos_checkout",/** @class */function(){function e(e){var t=this;o(this,e);this.storeUnsubscribeList=[];this.isRedirectAfterOrder=false;
|
|
426
451
|
/**
|
|
427
452
|
* Preview checkout without needing to click on the button. This would be useful for demo purpose
|
|
428
453
|
*/this.preview=false;
|
|
@@ -536,7 +561,7 @@ ee.checkoutSessionId=e;return[4/*yield*/,d()];case 1:o=s.sent(),t=o.errors,n=o.j
|
|
|
536
561
|
// treat every first-ever open as already paid, so both must be true.
|
|
537
562
|
if(r.completedAt&&r.order){void this.setToFinishStep("succeeded");return[2/*return*/,true]}if(!r.clientSecret)return[3/*break*/,3];return[4/*yield*/,u({clientSecret:r.clientSecret})];case 2:i=s.sent().status;if(i==="processing"||i==="succeeded"){c.clientSecret=r.clientSecret;void this.setToFinishStep(i);return[2/*return*/,true]}s.label=3;case 3:return[2/*return*/,false]}}))}))};this.initializeTestKeys=function(){
|
|
538
563
|
// cleanup expired test keys
|
|
539
|
-
ee.enabledVariantTestKeys=
|
|
564
|
+
ee.enabledVariantTestKeys=Oo(ee.enabledVariantTestKeys||[]);
|
|
540
565
|
// map existingSelection to the enabled variant test keys from database
|
|
541
566
|
var e=se.enabledVariantTestKeys.map((function(e){var o;
|
|
542
567
|
// We will attempt to get the enabled selection from localStorage first and only re-fetch if the testKeys are changed
|
|
@@ -546,19 +571,19 @@ if(typeof se.checkoutSettings.createCartId!=="function"){return false}var e=se.e
|
|
|
546
571
|
// Should not do anything if the test is not enabled
|
|
547
572
|
if(!e){return false}return true};
|
|
548
573
|
// Register test hosted vs native if needed to get the variant selection for this test
|
|
549
|
-
this.registerTestHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:e=this.shouldAllowHostedVsNativeTest();if(!e){return[2/*return*/]}ze("[TEST] - Registering hosted vs native test");o=
|
|
574
|
+
this.registerTestHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n;return __generator(this,(function(r){switch(r.label){case 0:e=this.shouldAllowHostedVsNativeTest();if(!e){return[2/*return*/]}ze("[TEST] - Registering hosted vs native test");o=Bo("hosted_vs_native");
|
|
550
575
|
// No need to request variant test for this test if the test already has variant selected
|
|
551
|
-
if(o){ze("[TEST] - Hosted vs native test already has variant selected: ".concat(o));return[2/*return*/]}return[4/*yield*/,
|
|
576
|
+
if(o){ze("[TEST] - Hosted vs native test already has variant selected: ".concat(o));return[2/*return*/]}return[4/*yield*/,De({testKeys:["hosted_vs_native"]})];case 1:t=r.sent();
|
|
552
577
|
// Do not prevent user from proceeding if the test is not enabled or failed to get selection
|
|
553
|
-
if(!t){ze("[TEST] - Failed to get selection for hosted vs native test");return[2/*return*/]}n=
|
|
578
|
+
if(!t){ze("[TEST] - Failed to get selection for hosted vs native test");return[2/*return*/]}n=Eo({baseTestObj:ee.enabledVariantTestKeys||[],mergeTestObj:t});
|
|
554
579
|
// Set the selected variant to the storage store
|
|
555
580
|
te(n);return[2/*return*/]}}))}))};
|
|
556
581
|
// Handle hosted vs native test
|
|
557
|
-
this.handleHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n,r,i,s,c;return __generator(this,(function(a){switch(a.label){case 0:o=this.shouldAllowHostedVsNativeTest();if(!o){return[2/*return*/,{redirected:false}]}t=
|
|
582
|
+
this.handleHostedVsNative=function(){return __awaiter(t,void 0,void 0,(function(){var e,o,t,n,r,i,s,c;return __generator(this,(function(a){switch(a.label){case 0:o=this.shouldAllowHostedVsNativeTest();if(!o){return[2/*return*/,{redirected:false}]}t=Bo("hosted_vs_native");ze("[TEST] - hosted_vs_native: ".concat(t));
|
|
558
583
|
// This test is only applicable to checkout that's using createCartid callback
|
|
559
584
|
if(typeof se.checkoutSettings.createCartId!=="function"){ze("[TEST] - createCartId is not provided, skipping hosted vs native test");return[2/*return*/,{redirected:false}]}
|
|
560
585
|
// No need to do anything if the test is enabled for native
|
|
561
|
-
if(t!=="hosted"){ze("[TEST] - Hosted vs native test is enabled for native, skipping");return[2/*return*/,{redirected:false}]}if(!((e=se.genericSettings)===null||e===void 0?void 0:e.hostedCheckoutUrl)){ze("[TEST] - Hosted checkout URL is not provided");return[2/*return*/,{redirected:false}]}ze('"createCartId" is provided, start building cart');return[4/*yield*/,se.checkoutSettings.createCartId()];case 1:n=a.sent();i=null;if(typeof n==="object"){r=n.cartId;i=n.shippingData||null}else{r=n}s=
|
|
586
|
+
if(t!=="hosted"){ze("[TEST] - Hosted vs native test is enabled for native, skipping");return[2/*return*/,{redirected:false}]}if(!((e=se.genericSettings)===null||e===void 0?void 0:e.hostedCheckoutUrl)){ze("[TEST] - Hosted checkout URL is not provided");return[2/*return*/,{redirected:false}]}ze('"createCartId" is provided, start building cart');return[4/*yield*/,se.checkoutSettings.createCartId()];case 1:n=a.sent();i=null;if(typeof n==="object"){r=n.cartId;i=n.shippingData||null}else{r=n}s=xo();c=Le(Object.assign(Object.assign({cartId:r,checkoutSessionId:ee.checkoutSessionId||undefined,hostedCheckoutUrl:se.genericSettings.hostedCheckoutUrl,isTestMode:le(),isVariantTest:true},s),i));ze("[TEST] - Redirecting to: ".concat(c));
|
|
562
587
|
// Open new page with the cart URL
|
|
563
588
|
window.open(c,"_blank");return[2/*return*/,{redirected:true}]}}))}))};this.formatDate=function(e){if(!e){return""}
|
|
564
589
|
// get date in 24/12/2024 format (without time)
|
|
@@ -601,7 +626,7 @@ if(!o){return}var t=e.searchParams.get("zonosCheckoutSessionId");if(t){ee.checko
|
|
|
601
626
|
// merge variant test input from url to storageStore.enabledVariantTestKeys
|
|
602
627
|
var n=ee.enabledVariantTestKeys||[];
|
|
603
628
|
// override the selected variant key if it's not "hosted" since we are in hosted checkout tab
|
|
604
|
-
if(window.Zonos.isLegacyCheckout){var r=
|
|
629
|
+
if(window.Zonos.isLegacyCheckout){var r=Bo("hosted_vs_native");
|
|
605
630
|
// Set selected variant key "hosted" to enabledVariantTestKeys if it's not in enabledVariantTestKeys already
|
|
606
631
|
if(!r){n.push({expiresAt:Date.now()+oe,selectedVariantKey:"hosted",testKey:"hosted_vs_native"});te(n)}else{te(n.map((function(e){if(e.testKey==="hosted_vs_native"){return Object.assign(Object.assign({},e),{selectedVariantKey:"hosted"})}return e})))}}
|
|
607
632
|
// Remove query params from the url
|
|
@@ -641,7 +666,7 @@ this.useShippingDataFromCreateCartId(o.shippingData);l.customerAuthenticationTok
|
|
|
641
666
|
// Normalize against misbehaving merchant callbacks: only accept an
|
|
642
667
|
// array of strings, drop everything else so a bad value can't crash
|
|
643
668
|
// the renderer (`.filter(...)` would throw on non-arrays).
|
|
644
|
-
l.customMessage=Array.isArray(o.customMessage)?o.customMessage.filter((function(e){return typeof e==="string"})):[]}else{t=o}window.Zonos.cartId=t;return[4/*yield*/,
|
|
669
|
+
l.customMessage=Array.isArray(o.customMessage)?o.customMessage.filter((function(e){return typeof e==="string"})):[]}else{t=o}window.Zonos.cartId=t;return[4/*yield*/,Do(t)];case 2:n=_.sent();r=n===null||n===void 0?void 0:n.cartData;if(!r){he("Failed to build cart, please try again.");return[2/*return*/,false]}window.Zonos.cartData=r;i=ue(r),s=i.adjustments,a=i.cartItems;return[4/*yield*/,f({adjustments:s,cartItems:a})];case 3:_.sent();return[3/*break*/,12];case 4:if(!window.Zonos.cartData)return[3/*break*/,9];ze("tempCartUUID is provided, start building cart");u=(e=window.Zonos.cartData.references)===null||e===void 0?void 0:e.checkoutSessionId;if(!u)return[3/*break*/,6];ze("Setting checkout session id from cart reference","info",u);return[4/*yield*/,this.recoverCompletedOrderModificationSession(u)];case 5:d=_.sent();if(d){
|
|
645
670
|
// Recovery routes straight to the finish step, bypassing the
|
|
646
671
|
// cartStoreUpdateItems call below that would normally clear this -
|
|
647
672
|
// without it, the finish screen would spin forever (dialogLoading
|
|
@@ -665,7 +690,7 @@ _.sent();k=se.checkoutSettings,y=k.successBehavior,b=k.successRedirectUrl;this.i
|
|
|
665
690
|
// to payment, same as the Collect flow does for its own cart type. Lives
|
|
666
691
|
// here (rather than at each buildCartAndInit call site) so every caller
|
|
667
692
|
// gets it, including the forceDialogOpen/preview init path.
|
|
668
|
-
if(z()){l.step="payment"}return[2/*return*/,true]}}))}))};e.prototype.reloadCheckoutSession=function(){window.location.reload()};e.prototype.handleOrderDuplication=function(){var e=fe(localStorage.getItem("zonos--placed-order-info"));if(!e){localStorage.removeItem("zonos--placed-order-info");return}var o=Date.now()-e.time;ze("=== Existing placed order info: ".concat(e.orderId," - ").concat(this.formatDate(e.time)," - elapsed in hh:ss format: ").concat(new Date(o).toISOString().substring(11,8)),"warn");var t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||
|
|
693
|
+
if(z()){l.step="payment"}return[2/*return*/,true]}}))}))};e.prototype.reloadCheckoutSession=function(){window.location.reload()};e.prototype.handleOrderDuplication=function(){var e=fe(localStorage.getItem("zonos--placed-order-info"));if(!e){localStorage.removeItem("zonos--placed-order-info");return}var o=Date.now()-e.time;ze("=== Existing placed order info: ".concat(e.orderId," - ").concat(this.formatDate(e.time)," - elapsed in hh:ss format: ").concat(new Date(o).toISOString().substring(11,8)),"warn");var t=parseFloat(new URLSearchParams(window.location.search).get("zonosOverrideExpiredDuplication")||"0")||Ro;
|
|
669
694
|
// if the order is placed within 5 minutes, confirm with the user to proceed with the order duplication
|
|
670
695
|
if(o>t){ze("=== Existing placed order info is older than ".concat(t,"ms, cleaning localStorage"),"warn");
|
|
671
696
|
// remove the placed order info if it's older than 5 minutes and do nothing.
|
|
@@ -714,7 +739,7 @@ if(!d){return[2/*return*/]}
|
|
|
714
739
|
* Move the logic below checking Stripe payment state so we don't record the load time on page load and only do so when checkout modal is actually showed up.
|
|
715
740
|
*/if(!window.Zonos.logIntervalId){
|
|
716
741
|
// log the load time of all API calls every 2 seconds. This is to track the load time of all API calls for checkout user
|
|
717
|
-
window.Zonos.logIntervalId=setInterval((function(){void
|
|
742
|
+
window.Zonos.logIntervalId=setInterval((function(){void Io()}),2e3)}if(!Po("hosted_vs_native"))return[3/*break*/,4];this.isOverlayLoading=true;return[4/*yield*/,this.registerTestHostedVsNative()];case 2:O.sent();return[4/*yield*/,this.handleHostedVsNative()];case 3:f=O.sent().redirected;this.isOverlayLoading=false;
|
|
718
743
|
// Stop the process if the user is being redirected to the hosted checkout page
|
|
719
744
|
if(f){return[2/*return*/]}O.label=4;case 4:if(!window.Zonos.isBigCommerce)return[3/*break*/,7];return[4/*yield*/,Ve()];case 5:h=O.sent().shouldBypass;if(h){ze("Bypass customer group detected, redirecting to BigCommerce native checkout","info");
|
|
720
745
|
// Carry over zonosQaUrl / zonosTestMode so the BC native
|
|
@@ -733,9 +758,9 @@ p=ne("Unable to check inventory. Please try again.");return[3/*break*/,13];case
|
|
|
733
758
|
// and "Return to cart" resets the message + closes cleanly.
|
|
734
759
|
l.inventoryCheckErrorMessage=p;c.isFetchingSession=false;this.open=false;return[2/*return*/]}O.label=14;case 14:(e=window.opener)===null||e===void 0?void 0:e.postMessage({checkoutSessionId:ee.checkoutSessionId,type:"zonos-checkout-session-update"},"*");
|
|
735
760
|
// start the timer to validate the price
|
|
736
|
-
y({isPreview:this.preview,sessionTimeout:
|
|
761
|
+
y({isPreview:this.preview,sessionTimeout:jo});Z({event:"zonos-checkout-start",metadata:{checkoutSessionId:ee.checkoutSessionId}});w=ee.checkoutSessionId;void b({checkoutSessionId:w,eventName:"checkout_open"});return[4/*yield*/,Ue()];case 15:z=O.sent().enabled;
|
|
737
762
|
// Hide discount input if there's no active discount configured for the store
|
|
738
|
-
l.shouldHideDiscountInput=!z;this.handleOrderDuplication();if(window.Zonos.isLegacyCheckout){void
|
|
763
|
+
l.shouldHideDiscountInput=!z;this.handleOrderDuplication();if(window.Zonos.isLegacyCheckout){void To()}else{x=performance.now();S=x-i;void Ao({loadTime:S})}this.recordCheckoutInfo();I=!!Se();if(I){this.markTheSessionAsAbandonedCart()}return[3/*break*/,17];case 16:T=O.sent();if(T instanceof Error){A=T.message;if(A==="Cart is expired."){this.isCartExpired=true}}
|
|
739
764
|
// stop loading
|
|
740
765
|
c.isFetchingSession=false;he(T);if(this.isCartExpired){c.isFetchingSession=true;return[2/*return*/]}
|
|
741
766
|
// We want to log the error anytime we fail to create a checkout session
|
|
@@ -795,7 +820,7 @@ this.handleBigcommerceInternationalResumeFlag();
|
|
|
795
820
|
// the prefill itself guards against overwriting other prefill sources.
|
|
796
821
|
void this.prefillBigCommerceCustomerAddresses();
|
|
797
822
|
// check if bigcommerce, if user enters the shipping address that's in the shipping zone at bigcommerce checkout
|
|
798
|
-
|
|
823
|
+
Co({domesticRedirectedBtnSelector:Ce,onInternationalCheckoutSelected:function(){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:this.detectedDomesticCheckoutDialogOpen=true;
|
|
799
824
|
// wait for 2 secs
|
|
800
825
|
return[4/*yield*/,new Promise((function(e){return setTimeout(e,2e3)}))];case 1:
|
|
801
826
|
// wait for 2 secs
|
|
@@ -889,12 +914,12 @@ l.inventoryCheckErrorMessage=ne("Unable to check inventory. Please try again.");
|
|
|
889
914
|
// Don't proceed to payment if there's an error message
|
|
890
915
|
if(l.inventoryCheckErrorMessage){
|
|
891
916
|
// stop the submit loading state
|
|
892
|
-
this.submitLoading=false;return[2/*return*/]}i=M();if(!(i>0))return[3/*break*/,8];return[4/*yield*/,B()];case 7:s=h.sent();if(!s.success){c.hasPaymentError=true;c.customErrorMessage=s.error||ne("Unable to apply store credit. Please try again.");this.submitLoading=false;return[2/*return*/]}h.label=8;case 8:if(!
|
|
917
|
+
this.submitLoading=false;return[2/*return*/]}i=M();if(!(i>0))return[3/*break*/,8];return[4/*yield*/,B()];case 7:s=h.sent();if(!s.success){c.hasPaymentError=true;c.customErrorMessage=s.error||ne("Unable to apply store credit. Please try again.");this.submitLoading=false;return[2/*return*/]}h.label=8;case 8:if(!P())return[3/*break*/,14];h.label=9;case 9:h.trys.push([9,12,,13]);return[4/*yield*/,E()];case 10:a=h.sent();if(!a.valid){c.hasPaymentError=true;c.customErrorMessage=a.errorMessage;this.submitLoading=false;return[2/*return*/]}return[4/*yield*/,U()];case 11:u=h.sent();if(!u.success){c.hasPaymentError=true;c.customErrorMessage=u.error||ne("Unable to place order with store credit. Please try again.");this.submitLoading=false;return[2/*return*/]}T();p();return[3/*break*/,13];case 12:d=h.sent();he(d);Z({event:"zonos-checkout-payment-fail",metadata:{checkoutSessionId:ee.checkoutSessionId}});c.hasPaymentError=true;return[3/*break*/,13];case 13:this.submitLoading=false;return[2/*return*/];case 14:h.trys.push([14,16,,17]);
|
|
893
918
|
// Order-modification payment-only sessions skip the shipping step,
|
|
894
919
|
// so cartStore.selectedLandedCost is never populated — bypass the
|
|
895
920
|
// landed-cost guard the same way zonos-collect does for its own
|
|
896
921
|
// no-shipping-step flow.
|
|
897
|
-
return[4/*yield*/,
|
|
922
|
+
return[4/*yield*/,D({noLandedCostCheck:z()})];case 15:
|
|
898
923
|
// Order-modification payment-only sessions skip the shipping step,
|
|
899
924
|
// so cartStore.selectedLandedCost is never populated — bypass the
|
|
900
925
|
// landed-cost guard the same way zonos-collect does for its own
|
|
@@ -1006,11 +1031,11 @@ var I=this.getBaseCurrencySettlementInfo();var T=function(){
|
|
|
1006
1031
|
// add timestamp to logo url if it's preview mode so browser won't cache it on the dashboard setting
|
|
1007
1032
|
var o=e.preview?"".concat(m,"?timestamp=").concat(Date.now()):m;return t("div",{class:"zonos--logo"},o&&t("img",{alt:"".concat(se.organizationName," logo"),src:o}))};var A=le();var O=function(){var o=new URLSearchParams(window.location.search);var n=o.get("zonosQaUrl");var r=o.get("zonosDebug");var i=o.get("zonosE2ETest");var s=e.overrideStagingMode||pe();return t("zonos-v-stack",null,t("div",{class:"zonos--logo-wrapper"},T(),A&&t("zonos-badge",{badgeColor:"orange",size:"small"},ne("Test mode")),s&&t("zonos-badge",{badgeColor:"red",size:"small"},ne("Staging mode")),r==="1"&&t("zonos-badge",{badgeColor:"cyan",size:"small"},"debug"),n&&t("zonos-badge",{badgeColor:"purple",size:"small"},n),i&&t("zonos-badge",{badgeColor:"gray",size:"small"},"E2E Test")),!d&&t("zonos-checkout-progress-tabs",{backgroundColor:
|
|
1008
1033
|
// only use different contrast color when the secondary color is too off with the background in mobile
|
|
1009
|
-
e.isMobile?"--zonos-elements-gray-0":null}),S.map((function(e){return t("zonos-custom-message",{icon:
|
|
1034
|
+
e.isMobile?"--zonos-elements-gray-0":null}),S.map((function(e){return t("zonos-custom-message",{icon:Lo,message:e.message})})))};var B=function(){if(l.checkoutSessionTimeoutShow){return t("zonos-rest-state",{class:"zonos--session-timeout",restStateSubtitle:ne("Your checkout session has expired. Please reload the page to continue."),restStateTitle:ne("Session timed out"),restStateType:"Warning"},t("zonos-button",{onClick:function(){return e.reloadCheckoutSession()},variant:"primary"},ne("Reload")))}return t("div",{class:"zonos--content",style:{"--zonos--border-radius":Ae({overrideBorderStyle:p})}},l.step!=="finish"&&l.step!=="error"&&t(n,null,t("div",{class:"zonos--left","data-theme":y,style:Be({"--zonos--primary-color":!e.isMobile?h:undefined})},!e.isMobile&&O(),l.step==="customer-info"&&t("zonos-customer-info",{continueLoading:e.submitLoading,defaultAddress:e.getDefaultAddress(),isMobile:e.isMobile,onContinueClicked:function(){return e.handleCustomerInfoContinue()},submitBtnColor:b}),l.step==="shipping"&&t("zonos-shipping",{continueLoading:e.submitLoading,isMobile:e.isMobile,onContinueClicked:function(){return e.handleShippingContinue()},submitBtnColor:b}),l.step==="payment"&&t("zonos-checkout-payment",{continueLoading:e.submitLoading,isMobile:e.isMobile,onContinueClicked:function(){return __awaiter(e,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return[4/*yield*/,this.handleStripePaymentContinue()];case 1:e.sent();return[2/*return*/]}}))}))},submitBtnColor:b})),t("div",{class:"zonos--right","data-theme":w},e.isMobile&&O(),t("div",{class:"zonos--right-actions"},window.Zonos.showBaseForeign&&t("zonos-currency-toggle",null),!e.isLegacyCheckout&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:Pe}),noBackground:true,onClick:function(){return e.closeDialogHandler()}})),t("div",{class:"flex--wrapper"},t("div",{class:"zonos--wrapper"},t("zonos-review",{collapsed:e.collapseReviewMobile,mobile:e.isMobile,onClick:function(){
|
|
1010
1035
|
// do nothing if it's not mobile
|
|
1011
1036
|
if(!e.isMobile){return}e.collapseReviewMobile=!e.collapseReviewMobile}}),t("zonos-collapse",{
|
|
1012
1037
|
// only collapsible on mobile
|
|
1013
|
-
collapsed:e.collapseReviewMobile&&e.isMobile},t("zonos-cart-items",null),e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",{submitBtnColor:b}),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:
|
|
1038
|
+
collapsed:e.collapseReviewMobile&&e.isMobile},t("zonos-cart-items",null),e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",{submitBtnColor:b}),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Lo,message:C})))),t("zonos-cart-restricted-items",null),!e.isMobile&&t("zonos-v-stack",{spacing:16},t("zonos-cart-subtotal",null),t("zonos-custom-message",{class:"zonos--checkout-default-message",icon:Lo,message:C}))))),(l.step==="finish"||l.step==="error")&&t("div",{class:"zonos--done","data-theme":w},t("div",{class:"zonos--header"},T(),!e.isRedirectAfterOrder&&t("zonos-button",{class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close checkout dialog",content:Pe}),noBackground:true,onClick:function(){return e.handleFinishClick()},theme:w})),t("zonos-checkout-finish",{borderRadius:p,onCloseClick:function(){return e.handleFinishClick()},overrideNotification:l.step==="error"&&!!l.error?Object.assign(Object.assign({},l.error),{type:"error"}):undefined,storybookForceStatus:e.storybookPaymentStatusOverride})),t("zonos-checkout-footer",{"data-theme":w,mobile:e.isMobile,
|
|
1014
1039
|
/**
|
|
1015
1040
|
* For this component, use slot instead of passing JSX through prop of other component. Because
|
|
1016
1041
|
* the click outside event will be triggered on and targeted to whichever component that it's attached to.
|
|
@@ -1040,4 +1065,4 @@ dialogOpen:this.isCartExpired,
|
|
|
1040
1065
|
// If dialog is in open state, the message should not be null
|
|
1041
1066
|
dialogSubtitle:ne("You are being sent back to the shop to re-add items to your cart."),dialogTitle:ne("Shopping cart expired"),dialogType:"alert",
|
|
1042
1067
|
// Mark user selected confirm to close the dialog
|
|
1043
|
-
onConfirmClicked:function(){return e.handleCartExpiredDialogConfirm()}}),t("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{appearanceSettingsOverride:[{appearanceSettingsOverrideChanged:0},{handleAppearanceSettingsOverrideChange:0}],overrideStagingMode:[{overrideStagingModeChanged:0}],mobile:[{handleMobileChange:0}],defaultAddress:[{handleAddressChange:0}],customerProfile:[{handleCustomerProfileChange:0}],clientSecret:[{handleClientSecretChange:0}],stripeCustomerSessionClientSecret:[{handleClientSecretChange:0}],open:[{handleOpenChange:0}]}},enumerable:false,configurable:true});return e}());
|
|
1068
|
+
onConfirmClicked:function(){return e.handleCartExpiredDialogConfirm()}}),t("zonos-loading-overlay",{open:this.isOverlayLoading}))};Object.defineProperty(e,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{appearanceSettingsOverride:[{appearanceSettingsOverrideChanged:0},{handleAppearanceSettingsOverrideChange:0}],overrideStagingMode:[{overrideStagingModeChanged:0}],mobile:[{handleMobileChange:0}],defaultAddress:[{handleAddressChange:0}],customerProfile:[{handleCustomerProfileChange:0}],clientSecret:[{handleClientSecretChange:0}],stripeCustomerSessionClientSecret:[{handleClientSecretChange:0}],open:[{handleOpenChange:0}]}},enumerable:false,configurable:true});return e}());Fo.style=No()}}}));
|