@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, d as createEvent, h, a as Host, g as getElement } from './index-_lt63o7c.js';
|
|
2
|
-
import { b as airwallexStore, c as collectStore, f as airwallexStoreInitSdk, l as createElement, m as airwallexStoreGetLocale, n as airwallexStoreOnChange } from './collect-
|
|
2
|
+
import { b as airwallexStore, c as collectStore, f as airwallexStoreInitSdk, l as createElement, m as airwallexStoreGetLocale, n as airwallexStoreOnChange } from './collect-Eo4gtyql.js';
|
|
3
3
|
import { d as cartStore } from './cart-BoQp8Ema.js';
|
|
4
4
|
import { h as localizationStoreOnChange, t as translate, l as localizationStore } from './localization-BIh-4pc_.js';
|
|
5
5
|
import { z as zonosStore } from './zonosStore-msUlqmSD.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, d as createEvent, h, F as Fragment, a as Host, g as getElement } from './index-_lt63o7c.js';
|
|
2
|
-
import { b as airwallexStore, d as airwallexStoreRetrievePaymentIntent, j as airwallexStoreMessageBasedOnStatus, e as airwallexStoreIsPaidStatus, k as airwallexStoreReset, c as collectStore } from './collect-
|
|
2
|
+
import { b as airwallexStore, d as airwallexStoreRetrievePaymentIntent, j as airwallexStoreMessageBasedOnStatus, e as airwallexStoreIsPaidStatus, k as airwallexStoreReset, c as collectStore } from './collect-Eo4gtyql.js';
|
|
3
3
|
import { b as stripeStore, c as stripeStoreRetrievePayment, t as trackConversionEvent, P as stripeStoreResetPromoCode, H as stripeStoreReset, Q as stripeStoreMessageBasedOnStatus, d as cartStore, x as cartStoreNextStep, I as cartStoreOnChange } from './cart-BoQp8Ema.js';
|
|
4
4
|
import { s as submitAnalytics, c as paypalStoreReset, a as paypalStore, b as paypalInitScript } from './paypal-DNfvnuUU.js';
|
|
5
5
|
import { t as translate, s as storageStore, k as languages, l as localizationStore, y as translationStoreOnChange } from './localization-BIh-4pc_.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, h, a as Host, F as Fragment } from './index-_lt63o7c.js';
|
|
2
|
-
import { c as collectStore, a as airwallexStoreSetFromSession, b as airwallexStore, d as airwallexStoreRetrievePaymentIntent, e as airwallexStoreIsPaidStatus, f as airwallexStoreInitSdk, g as collectStoreUpdateSelectedShippingOption, h as collectStoreInitShippingInfo, i as collectStoreAsyncAddressUpdate } from './collect-
|
|
2
|
+
import { c as collectStore, a as airwallexStoreSetFromSession, b as airwallexStore, d as airwallexStoreRetrievePaymentIntent, e as airwallexStoreIsPaidStatus, f as airwallexStoreInitSdk, g as collectStoreUpdateSelectedShippingOption, h as collectStoreInitShippingInfo, i as collectStoreAsyncAddressUpdate } from './collect-Eo4gtyql.js';
|
|
3
3
|
import { b as stripeStore, i as initStripeElements, d as cartStore, c as stripeStoreRetrievePayment, r as cartStoreUpdateToErrorState, e as cartStoreUpdateItems, k as stripeStoreInitCheckoutSession, l as stripeStoreGetPaymentIntent, z as stripeStoreUpdateCheckoutSessionBaseCurrency, E as stripeStoreConfirmPayment, J as stripeStoreOnChange, H as stripeStoreReset, f as cartStoreReset } from './cart-BoQp8Ema.js';
|
|
4
4
|
import { p as paypalStoreHasPaypalEnabled, a as paypalStore } from './paypal-DNfvnuUU.js';
|
|
5
5
|
import { s as storageStore, t as translate, h as localizationStoreOnChange, j as currencyFormat, k as languages, l as localizationStore } from './localization-BIh-4pc_.js';
|
|
@@ -192,6 +192,15 @@ const injectDomesticElementHideStyle = (domesticElementSelector) => {
|
|
|
192
192
|
merchantSelector: domesticElementSelector,
|
|
193
193
|
supportsIs: supportsIsSelector,
|
|
194
194
|
});
|
|
195
|
+
// A raw `<` is never a valid CSS selector character, and it is the
|
|
196
|
+
// character that would close a `<style>` tag if this string were ever
|
|
197
|
+
// assigned as HTML. Some parsers (current jsdom) do not throw on it, so
|
|
198
|
+
// reject it before `querySelector`. `>` stays allowed: it is the child
|
|
199
|
+
// combinator.
|
|
200
|
+
if (fullSelector.includes('<')) {
|
|
201
|
+
log(`Skip domesticElementSelector injection: "${domesticElementSelector}" contains "<"`, 'warn');
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
195
204
|
// The browser's own parser is the source of truth — `document.querySelector`
|
|
196
205
|
// throws `DOMException(SyntaxError)` for syntactically invalid selectors.
|
|
197
206
|
// Validating the exact string we're about to emit catches both malformed
|
|
@@ -96,7 +96,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
96
96
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
97
97
|
PERFORMANCE OF THIS SOFTWARE.
|
|
98
98
|
***************************************************************************** */
|
|
99
|
-
/* global Reflect, Promise, SuppressedError, Symbol */var extendStatics=function(e,r){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t))e[t]=r[t]};return extendStatics(e,r)};function __extends(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");extendStatics(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var __assign=function(){__assign=Object.assign||function e(r){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))r[o]=t[o]}return r};return __assign.apply(this,arguments)};function __awaiter(e,r,t,n){function i(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(r,t){function o(e){try{s(n.next(e))}catch(e){t(e)}}function a(e){try{s(n["throw"](e))}catch(e){t(e)}}function s(e){e.done?r(e.value):i(e.value).then(o,a)}s((n=n.apply(e,[])).next())}))}function __generator(e,r){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(r){return u([e,r])}}function u(s){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(t=0)),t)try{if(n=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;i=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){t.label=s[1];break}if(s[0]===6&&t.label<o[1]){t.label=o[1];o=s;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(s);break}if(o[2])t.ops.pop();t.trys.pop();continue}s=r.call(e,t)}catch(e){s=[6,e];i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}}function __spreadArray(e,r,t){for(var n=0,i=r.length,o;n<i;n++){if(o||!(n in r)){if(!o)o=Array.prototype.slice.call(r,0,n);o[n]=r[n]}}return e.concat(o||Array.prototype.slice.call(r))}typeof SuppressedError==="function"?SuppressedError:function(e,r,t){var n=new Error(t);return n.name="SuppressedError",n.error=e,n.suppressed=r,n};var version="1.35.
|
|
99
|
+
/* global Reflect, Promise, SuppressedError, Symbol */var extendStatics=function(e,r){extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,r){e.__proto__=r}||function(e,r){for(var t in r)if(Object.prototype.hasOwnProperty.call(r,t))e[t]=r[t]};return extendStatics(e,r)};function __extends(e,r){if(typeof r!=="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");extendStatics(e,r);function t(){this.constructor=e}e.prototype=r===null?Object.create(r):(t.prototype=r.prototype,new t)}var __assign=function(){__assign=Object.assign||function e(r){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o))r[o]=t[o]}return r};return __assign.apply(this,arguments)};function __awaiter(e,r,t,n){function i(e){return e instanceof t?e:new t((function(r){r(e)}))}return new(t||(t=Promise))((function(r,t){function o(e){try{s(n.next(e))}catch(e){t(e)}}function a(e){try{s(n["throw"](e))}catch(e){t(e)}}function s(e){e.done?r(e.value):i(e.value).then(o,a)}s((n=n.apply(e,[])).next())}))}function __generator(e,r){var t={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},n,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(e){return function(r){return u([e,r])}}function u(s){if(n)throw new TypeError("Generator is already executing.");while(a&&(a=0,s[0]&&(t=0)),t)try{if(n=1,i&&(o=s[0]&2?i["return"]:s[0]?i["throw"]||((o=i["return"])&&o.call(i),0):i.next)&&!(o=o.call(i,s[1])).done)return o;if(i=0,o)s=[s[0]&2,o.value];switch(s[0]){case 0:case 1:o=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;i=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(o=t.trys,o=o.length>0&&o[o.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!o||s[1]>o[0]&&s[1]<o[3])){t.label=s[1];break}if(s[0]===6&&t.label<o[1]){t.label=o[1];o=s;break}if(o&&t.label<o[2]){t.label=o[2];t.ops.push(s);break}if(o[2])t.ops.pop();t.trys.pop();continue}s=r.call(e,t)}catch(e){s=[6,e];i=0}finally{n=o=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}}function __spreadArray(e,r,t){for(var n=0,i=r.length,o;n<i;n++){if(o||!(n in r)){if(!o)o=Array.prototype.slice.call(r,0,n);o[n]=r[n]}}return e.concat(o||Array.prototype.slice.call(r))}typeof SuppressedError==="function"?SuppressedError:function(e,r,t){var n=new Error(t);return n.name="SuppressedError",n.error=e,n.suppressed=r,n};var version="1.35.1";var packageJson={version:version};var airTrackerENV={dev:Environment.staging,staging:Environment.staging,demo:Environment.demo,prod:Environment.production};var initializeAirTracker=function(e,r){if(e===void 0){e=Environment.production}if(!window._AirwallexSDKs.airTracker){window._AirwallexSDKs.airTracker=new src_default({config:{appName:"components-sdk",appVersion:packageJson.version,env:airTrackerENV[e]||Environment.production}});window._AirwallexSDKs.airTracker.updateCommonData({clientId:r})}return window._AirwallexSDKs.airTracker};var maskPII=function(e){if(typeof e!=="object"){return e}try{var r=JSON.parse(JSON.stringify(e));Object.keys(r).forEach((function(e){if(typeof e==="string"&&["auth","code"].some((function(r){return e.includes(r)}))){r[e]="***"}}));return r}catch(r){return e}};var logError=function(e,r){var t,n;(n=(t=window._AirwallexSDKs)===null||t===void 0?void 0:t.airTracker)===null||n===void 0?void 0:n.error(e,__assign(__assign({},r),{context:"components-sdk"}))};var logWarning=function(e,r){var t;(t=window._AirwallexSDKs.airTracker)===null||t===void 0?void 0:t.warn(e,__assign(__assign({},r),{context:"components-sdk"}))};var logInfo=function(e,r){var t;(t=window._AirwallexSDKs.airTracker)===null||t===void 0?void 0:t.info(e,__assign(__assign({},r),{context:"components-sdk"}))};var LoadScriptError=/** @class */function(e){__extends(r,e);function r(r){var t=e.call(this,r)||this;t.code="LOAD_SCRIPT_ERROR";return t}return r}(Error);var _a,_b;var ENV;(function(e){e["dev"]="dev";e["staging"]="staging";e["demo"]="demo";e["prod"]="prod";e["sandbox"]="sandbox"})(ENV||(ENV={}));var PA_STATIC_HOST=(_a={},_a[ENV.dev]="https://checkout-staging.airwallex.com",_a[ENV.staging]="https://checkout-staging.airwallex.com",_a[ENV.demo]="https://checkout-demo.airwallex.com",_a[ENV.prod]="https://checkout.airwallex.com",_a[ENV.sandbox]="https://checkout.sandbox.airwallex.com",_a);var STATIC_HOST=(_b={},_b[ENV.dev]="https://static-staging.airwallex.com",_b[ENV.staging]="https://static-staging.airwallex.com",_b[ENV.demo]="https://static-demo.airwallex.com",_b[ENV.prod]="https://static.airwallex.com",_b[ENV.sandbox]="https://static.sandbox.airwallex.com",_b);var SDK_CONTROLLER="sdkController";var PAYMENTS="payments";var SDK_URL_MAPPING={kyc:"/widgets/kyc/sdk/v1/index.js",rfi:"/widgets/kycRfi/sdk/v1/index.js",paymentsKyb:"/widgets/paymentsKyb/sdk/v1/index.js",sdkController:"/widgets/sdk-controller/sdk/v1/index.js",payouts:"/widgets/payouts/sdk/v1/index.js",payments:"/assets/elements.bundle.min.js",sca:"/hosted-sca/sdk/v1/index.js",taxForm:"/widgets/taxForm/sdk/v1/index.js",billing:"/widgets/checkout/sdk/v1/index.js",balance:"/widgets/embedded-balance/sdk/v1/index.js"};var ELEMENT_TO_SDK={
|
|
100
100
|
// legacy
|
|
101
101
|
kyc:"kyc",paymentsKyb:"paymentsKyb",
|
|
102
102
|
// rfi elements
|
|
@@ -108,7 +108,9 @@ hpp:"payments",cvc:"payments",card:"payments",expiry:"payments",dropIn:"payments
|
|
|
108
108
|
// sca elements
|
|
109
109
|
scaSetup:"sca",scaVerify:"sca",scaManagement:"sca",taxForm:"taxForm",
|
|
110
110
|
// billing elements
|
|
111
|
-
embeddedCheckout:"billing"
|
|
111
|
+
embeddedCheckout:"billing",
|
|
112
|
+
// balance elements
|
|
113
|
+
balanceOverview:"balance",balanceDetail:"balance",balanceActivities:"balance",balanceActivityDetails:"balance",balanceHistoryChart:"balance",balanceInfo:"balance",balanceScheduledTransactions:"balance",balanceList:"balance"};var ELEMENT_GROUP_TO_ELEMENT={payments:["hpp","cvc","card","expiry","dropIn","cardNumber","applePayButton","googlePayButton","krCardNumber","krCardIdentifier","krCardExpiry","krCardPswFirstTwo"],payouts:["payoutForm","beneficiaryForm"],onboarding:["kyc","paymentsKyb"],risk:["scaSetup","scaVerify","scaManagement","transactionRfi","kycRfi","paymentEnablementRfi","lendingRfi","mrmRfi"],billing:["embeddedCheckout"],balance:["balanceOverview","balanceDetail","balanceActivities","balanceHistoryChart","balanceInfo","balanceScheduledTransactions","balanceList","balanceActivityDetails"]};var SDK_DEPENDENCIES={billing:["payments"]};var DOMAIN_FUNCTIONS_NAMESPACES=["payments","sca","billing"];var InvalidStaticResourceError=/** @class */function(e){__extends(r,e);function r(r){var t=e.call(this,r)||this;t.code="INVALID_STATIC_RESOURCE_ERROR";return t}return r}(Error);var timestamp=Date.now();var isElementGroup=function(e){return Object.keys(ELEMENT_GROUP_TO_ELEMENT).includes(e)};var sleep=function(e){if(e===void 0){e=500}return new Promise((function(r){return window.setTimeout(r,e)}))};var getSDKByElementName=function(e){return ELEMENT_TO_SDK[e]};var getHost=function(e,r){var t=e===PAYMENTS?PA_STATIC_HOST:STATIC_HOST;return t[r]||t.prod};
|
|
112
114
|
/**
|
|
113
115
|
* get the elements and sdks that need registry by controller
|
|
114
116
|
* @param enabledElements the enabledElements passed in init params
|
package/dist/esm-es5/index.js
CHANGED
|
@@ -54,7 +54,7 @@ var n=new URL(e).searchParams;var o=n.get("zonosQaUrl");if(!o){return null}var t
|
|
|
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=extractZonosQaUrl(window.location.href);var o="https://v1.3.
|
|
57
|
+
var e=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||e){return null}var n=extractZonosQaUrl(window.location.href);var o="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&&(o.includes("test.")||
|
|
60
60
|
// Vercel git domain
|
|
@@ -74,12 +74,12 @@ 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,"",o);window.location.reload();return null}));return r};
|
|
76
76
|
/* eslint-disable no-console */
|
|
77
|
-
/** Loading stripe script extracted from stripe.js repository */var V3_URL="https://js.stripe.com/v3";var V3_URL_REGEX=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var EXISTING_SCRIPT_MESSAGE="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";var zonosStripeFindScript=function(){var e=document.querySelectorAll('script[src^="'.concat(V3_URL,'"]'));for(var n=0;n<e.length;n++){var o=e[n];if(!o){continue}if(!V3_URL_REGEX.test(o.src)){continue}return o}return null};var stripePromise$1=null;var injectScript=function(e){var n="";var o=document.createElement("script");o.src="".concat(V3_URL).concat(n);var t=document.head||document.body;if(!t){logError("Expected document.body not to be null. Stripe.js requires a <body> element.");return null}t.appendChild(o);return o};var zonosStripeLoadScript=function(e){
|
|
77
|
+
/** Loading stripe script extracted from stripe.js repository */var STRIPE_API_VERSION="2025-02-24.acacia";var V3_URL="https://js.stripe.com/v3";var V3_URL_REGEX=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var V3_VERSION=3;var EXISTING_SCRIPT_MESSAGE="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";var zonosStripeFindScript=function(){var e=document.querySelectorAll('script[src^="'.concat(V3_URL,'"]'));for(var n=0;n<e.length;n++){var o=e[n];if(!o){continue}if(!V3_URL_REGEX.test(o.src)){continue}return o}return null};var stripePromise$1=null;var injectScript=function(e){var n="";var o=document.createElement("script");o.src="".concat(V3_URL).concat(n);var t=document.head||document.body;if(!t){logError("Expected document.body not to be null. Stripe.js requires a <body> element.");return null}t.appendChild(o);return o};var zonosStripeLoadScript=function(e){
|
|
78
78
|
// Ensure that we only attempt to load Stripe.js at most once
|
|
79
79
|
if(stripePromise$1!==null){return stripePromise$1}stripePromise$1=new Promise((function(n,o){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 t=zonosStripeFindScript();if(t&&e){console.warn(EXISTING_SCRIPT_MESSAGE)}else if(!t){t=injectScript()}t===null||t===void 0?void 0:t.addEventListener("load",(function(){if(window.Stripe){n(window.Stripe)}else{o(new Error("Stripe.js not available"))}}));t===null||t===void 0?void 0:t.addEventListener("error",(function(){o(new Error("Failed to load Stripe.js"))}))}catch(e){o(e);return}}));return stripePromise$1};var registerWrapper=function(e,n){if(!e||!e._registerWrapper){return}e._registerWrapper({name:"stripe-js",startTime:n})};var initStripe=function(e,n,o){if(e===null){return null}var t=e.
|
|
82
|
+
n(null);return}if(window.Stripe){n(window.Stripe);return}try{var t=zonosStripeFindScript();if(t&&e){console.warn(EXISTING_SCRIPT_MESSAGE)}else if(!t){t=injectScript()}t===null||t===void 0?void 0:t.addEventListener("load",(function(){if(window.Stripe){n(window.Stripe)}else{o(new Error("Stripe.js not available"))}}));t===null||t===void 0?void 0:t.addEventListener("error",(function(){o(new Error("Failed to load Stripe.js"))}))}catch(e){o(e);return}}));return stripePromise$1};var registerWrapper=function(e,n){if(!e||!e._registerWrapper){return}e._registerWrapper({name:"stripe-js",startTime:n})};var getStripeVersion=function(e){if(!("version"in e)){return}var n=e.version;return typeof n==="number"||typeof n==="string"?n:undefined};var initStripe=function(e,n,o){if(e===null){return null}var t=n[0],r=n[1];var i=Object.assign({},r);var a=getStripeVersion(e);var s=typeof a==="string"&&a!==V3_VERSION.toString();if(s){delete i.apiVersion}else{i.apiVersion=STRIPE_API_VERSION}var u=e(t,i);registerWrapper(u,o);return u};
|
|
83
83
|
// Execute our own script injection after a tick to give users time to do their
|
|
84
84
|
// own script injection.
|
|
85
85
|
var hasCheckoutCartCallback=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 stripePromise=Promise.resolve().then((function(){
|
|
@@ -97,15 +97,15 @@ return[4/*yield*/,new Promise((function(e){return setTimeout(e,500)}))];case 2:
|
|
|
97
97
|
e.sent();return[2/*return*/,getCartInfoById({cartId:d,retries:l-1})];case 3:if(c){return[2/*return*/,null]}return[2/*return*/,Object.assign(Object.assign({},s),{zonosMode:u})]}}))}))};var setupCartDataWithSettings=function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,o,t,r;return __generator(this,(function(i){switch(i.label){case 0:n=_getIsValidCartId(e),o=n.isDgsCartId,t=n.isLegacyCartId;if(!t&&!o){logError("[ZONOS - loadZonos] invalid cart id");return[2/*return*/,null]}return[4/*yield*/,getCartInfoById({cartId:e,retries:5})];case 1:r=i.sent();log("[ZONOS - loadZonos] getting temp cart data","info",r);if(!r){logError("[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;window.Zonos.zonosMode=r.zonosMode;return[2/*return*/,{cartData:r.cartData,settings:r.settings,storeFavicon:r.storeFaviconUrl,storeId:r.cartData.storeId,storeLogo:r.storeLogoUrl,zonosApiKey:r.cartData.credentialToken}]}}))}))};var _a;
|
|
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 zonosLoadUrl=function(){if(typeof document==="undefined"){return null}var e=document.querySelector('script[src*="/zonos.js"]');var n=checkIfLoadVersionDomain({loadScriptSrc:e===null||e===void 0?void 0:e.src}),o=n.currentLoadScriptUrl,t=n.isWhiteListed;if(t){return o}return null}();var startLoadTime=Date.now();var ZONOS_URL="https://v1.3.
|
|
100
|
+
*/var zonosLoadUrl=function(){if(typeof document==="undefined"){return null}var e=document.querySelector('script[src*="/zonos.js"]');var n=checkIfLoadVersionDomain({loadScriptSrc:e===null||e===void 0?void 0:e.src}),o=n.currentLoadScriptUrl,t=n.isWhiteListed;if(t){return o}return null}();var startLoadTime=Date.now();var ZONOS_URL="https://v1.3.293.js.zonos.com";var JS_DELIVR_ZONOS_URL=zonosLoadUrl||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.293";var UNPKG_ZONOS_URL="https://unpkg.com/@zonos/elements@1.3.293";var CDNJS_ZONOS_URL="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.293";var GOOGLE_FONT_URL="https://fonts.googleapis.com";var GOOGLE_FONT_REGEX=/^https:\/\/fonts\.googleapis\.com/;var Zonos=/** @class */function(){function e(){}return e}();_a=Zonos;Zonos.doneInit=false;Zonos.cartSettings=null;
|
|
101
101
|
// if query 'zonosDebug=1' param from url, debug mode is on
|
|
102
|
-
Zonos.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);Zonos.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);Zonos._paypalMockResponse=null;Zonos.iframeLogType=typeof window!=="undefined"?new URLSearchParams(window.location.search).get("iframeLogType"):null;Zonos.isBigCommerce=false;Zonos.releaseDate="
|
|
102
|
+
Zonos.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);Zonos.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);Zonos._paypalMockResponse=null;Zonos.iframeLogType=typeof window!=="undefined"?new URLSearchParams(window.location.search).get("iframeLogType"):null;Zonos.isBigCommerce=false;Zonos.releaseDate="1792077383128";Zonos.isLegacyCheckout=false;Zonos.googleAnalyticId=null;Zonos.googleAnalyticReady=false;Zonos.facebookPixelId=null;Zonos.facebookPixelReady=false;Zonos.startLoadTime=startLoadTime;Zonos.domain=typeof window!=="undefined"?// domain that embeds the iframe
|
|
103
103
|
window.location!=window.parent.location&&document.referrer||
|
|
104
104
|
// current domain
|
|
105
105
|
document.location.hostname:"";Zonos.showBaseForeign=typeof window!=="undefined"&&window.location.search.includes("zonosShowBaseForeign");Zonos.overrideUseCustomAddressForm=false;Zonos.isCollect=false;Zonos.isInvoice=false;
|
|
106
106
|
/**
|
|
107
107
|
* By default, the package will load from npm
|
|
108
|
-
*/Zonos.isNpm=true;Zonos.zonosQaUrl=null;Zonos.zonosQaUrlApi=null;Zonos.trackEventLogs=[];Zonos.version="v".concat("1.3.
|
|
108
|
+
*/Zonos.isNpm=true;Zonos.zonosQaUrl=null;Zonos.zonosQaUrlApi=null;Zonos.trackEventLogs=[];Zonos.version="v".concat("1.3.293");Zonos.modeAlerted=false;Zonos.cartData=null;Zonos.paypal=null;Zonos.zonosMode=null;Zonos.IframeService=IframeService;Zonos.getCurrentTimestamp=function(){return(new Date).getTime()};Zonos.zonosController=null;Zonos.loadTimeApiInfoList=[];Zonos.logIntervalId=null;Zonos.init=function(e){return __awaiter(void 0,void 0,void 0,(function(){var n,o,t,r,i,a,s,u,c,d,l,f,v,m,_;return __generator(this,(function(p){switch(p.label){case 0:n=e.appearance,o=e.checkoutSettings,t=e.currencyConverter,r=e.helloSettings,i=e.onCountryChange,a=e.overrideCurrencyFormat,s=e.storeId,u=e.zonosApiKey;_a.cartId=getCartIdFromQueryParam();
|
|
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
|
_a.createCartId=o===null||o===void 0?void 0:o.createCartId;
|