@zonos/elements 1.3.120 → 1.3.122
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/{CheckoutConfig-222be92b.js → CheckoutConfig-00c7333a.js} +1 -1
- package/dist/cjs/{cart-ae361111.js → cart-0e01d134.js} +18 -6
- package/dist/cjs/{handleFetch-bd39d5cc.js → handleFetch-83c97d08.js} +1 -1
- package/dist/cjs/index.cjs.js +9 -9
- package/dist/cjs/{paypal-435e221c.js → paypal-f1366d51.js} +2 -2
- package/dist/cjs/zonos-address_7.cjs.entry.js +2 -2
- package/dist/cjs/zonos-cart-items_13.cjs.entry.js +3 -3
- package/dist/cjs/zonos-checkout.cjs.entry.js +4 -4
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification_3.cjs.entry.js +3 -3
- package/dist/collection/components/store/checkout/stripe.js +18 -5
- package/dist/collection/types/generated/graphql.frontend.types.js +2 -0
- package/dist/collection/types/generated/graphql.internal.types.js +37 -4
- package/dist/collection/utils/formattedUrl.js +2 -1
- package/dist/esm/{CheckoutConfig-f3f1d468.js → CheckoutConfig-5cde3ee4.js} +1 -1
- package/dist/esm/{cart-b3faa2e6.js → cart-782d513d.js} +18 -6
- package/dist/esm/{handleFetch-752697c2.js → handleFetch-7424d200.js} +1 -1
- package/dist/esm/index.js +10 -10
- package/dist/esm/{paypal-d5955b3d.js → paypal-7df6311e.js} +2 -2
- package/dist/esm/zonos-address_7.entry.js +2 -2
- package/dist/esm/zonos-cart-items_13.entry.js +3 -3
- package/dist/esm/zonos-checkout.entry.js +4 -4
- package/dist/esm/zonos-controller.entry.js +2 -2
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +2 -2
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-notification_3.entry.js +3 -3
- package/dist/esm-es5/{CheckoutConfig-f3f1d468.js → CheckoutConfig-5cde3ee4.js} +1 -1
- package/dist/esm-es5/cart-782d513d.js +1 -0
- package/dist/esm-es5/handleFetch-7424d200.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-d5955b3d.js → paypal-7df6311e.js} +1 -1
- package/dist/esm-es5/zonos-address_7.entry.js +1 -1
- package/dist/esm-es5/zonos-cart-items_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/scripts/index.d.ts +2 -1
- 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/store/checkout/cart.d.ts +1 -0
- package/dist/types/types/checkout/api/NormalizedTempCart.d.ts +1 -1
- package/dist/types/types/generated/graphql.frontend.types.d.ts +2 -0
- package/dist/types/types/generated/graphql.frontend.types.ts +2 -0
- package/dist/types/types/generated/graphql.internal.types.d.ts +47 -7
- package/dist/types/types/generated/graphql.internal.types.ts +60 -8
- package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/{p-b251cd5d.system.entry.js → p-05820096.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-d13ddc1f.system.entry.js → p-05839a81.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-3eff7fa5.entry.js → p-0a5d1db8.entry.js} +1 -1
- package/dist/zonos-elements/{p-2ee60347.entry.js → p-100dc75c.entry.js} +1 -1
- package/dist/zonos-elements/{p-c3e74351.entry.js → p-19d75216.entry.js} +1 -1
- package/dist/zonos-elements/{p-39e703fc.system.entry.js → p-1b240438.system.entry.js} +1 -1
- package/dist/zonos-elements/p-22cb3fa7.js +1 -0
- package/dist/zonos-elements/{p-9664f0a7.entry.js → p-2cb215fd.entry.js} +1 -1
- package/dist/zonos-elements/{p-29fe2c4b.entry.js → p-36cfebe1.entry.js} +1 -1
- package/dist/zonos-elements/{p-8c3ee8d2.system.js → p-5834b65d.system.js} +2 -2
- package/dist/zonos-elements/{p-aaf4c09d.entry.js → p-5e6b1a44.entry.js} +1 -1
- package/dist/zonos-elements/{p-a9646d31.system.entry.js → p-75d4bd5f.system.entry.js} +1 -1
- package/dist/zonos-elements/p-78887e65.system.js +1 -0
- package/dist/zonos-elements/{p-da11684f.system.entry.js → p-80919c61.system.entry.js} +1 -1
- package/dist/zonos-elements/p-81055154.system.js +1 -0
- package/dist/zonos-elements/{p-90c14606.system.entry.js → p-850b0e2a.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-a5789801.system.entry.js → p-86d875a8.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-bfc4b34b.entry.js → p-878e3c68.entry.js} +1 -1
- package/dist/zonos-elements/{p-c0fc4490.js → p-8e317f73.js} +1 -1
- package/dist/zonos-elements/{p-bb6a0fdd.system.entry.js → p-91a332f3.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-93aef7e7.system.entry.js → p-bbddbf97.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-9b5f28ba.system.js → p-bc2efe24.system.js} +1 -1
- package/dist/zonos-elements/{p-8c177526.entry.js → p-bce88a97.entry.js} +1 -1
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-681d9ad8.entry.js → p-d8e9e915.entry.js} +1 -1
- package/dist/zonos-elements/{p-1366ed16.system.entry.js → p-daac8c76.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-6d654e6b.system.js → p-e50eaf44.system.js} +1 -1
- package/dist/zonos-elements/{p-8fa35500.entry.js → p-f12c1c1a.entry.js} +1 -1
- package/dist/zonos-elements/p-f3cdaa23.js +1 -0
- package/dist/zonos-elements/{p-6a7a8af4.js → p-fcb2227b.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/cart-b3faa2e6.js +0 -1
- package/dist/esm-es5/handleFetch-752697c2.js +0 -1
- package/dist/zonos-elements/p-2d28546f.js +0 -1
- package/dist/zonos-elements/p-6cbcdee3.system.js +0 -1
- package/dist/zonos-elements/p-acd4cf3c.system.js +0 -1
- package/dist/zonos-elements/p-d4110fa4.js +0 -1
package/dist/scripts/zonos.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){"use strict";const e=performance.now(),o=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},t=(t,n,...r)=>{var s,i;const{elapsedTimePretty:a}=(()=>{const o=performance.now()-e,t=o>1e3?`${(o/1e3).toFixed(2)}s`:`${o.toFixed(2)}ms`;return{elapsedTime:o,elapsedTimePretty:t}})(),l=[`(${a})`,...r];l.map(o).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(t,...l));let c=document.querySelector("iframe#zonos---debug-logging-iframe");c||(c=document.createElement("iframe"),c.id="zonos---debug-logging-iframe",c.style.display="none",c.style.opacity="0",c.style.position="absolute",c.style.top="-9999px",c.style.left="-9999px",c.style.width="1px",c.style.height="1px",c.style.border="none",c.style.overflow="hidden",c.style.visibility="hidden",document.body.appendChild(c));const d=(null===(i=c.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(t,...l);break;case"info":d.info(t,...l);break;case"error":d.error(t,...l);break;default:d.groupCollapsed(t,...l),d.trace(),d.groupEnd()}},n=(e,...o)=>{t(e,"error",...o)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const o=r.indexOf(e);return r[o+1]||null},a=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),n="https://v1.3.120.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${r}' for loading elements script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,t=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),r},l="https://js.stripe.com/v3",c=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,d="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let u=null;const p=e=>(null!==u||(u=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(d),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${l}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&c.test(t.src))return t}return null})();r&&e?console.warn(d):r||(r=(e=>{const o=document.createElement("script");o.src=`${l}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),u),m=Promise.resolve().then((()=>p(null)));let h=!1;m.catch((e=>{h||console.warn(e)}));function w(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}"function"==typeof SuppressedError&&SuppressedError;const y=["cloudflare","vercel"],g=y[0],f={cloudflare:"https://route.elements.zonos.com",vercel:"https://v1.route.js.zonos.com"},v=f[g],b=(e=g)=>{const o=y.indexOf(e),t=y[o+1];return t||null},S=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},z=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{return await e.json()}catch(e){if(t)throw e;return o&&console.error(e),null}},j=async({basePathType:e,options:o,path:t})=>{let n;const r=window.Zonos.zonosQaUrlApi||f[e]||g,s=new URL(r+t),i=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(i));try{n=await fetch(s.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:r,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:r,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const a=n.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&a&&l&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await z({response:n}),response:n,zonosMode:a}}const c=n.status.toString();try{const e=await z({response:n,shouldThrow:!0});return{baseUrl:r,errors:[{message:JSON.stringify(e),type:c}],json:null,response:n,zonosMode:a}}catch(e){return{baseUrl:r,errors:[{message:`${c}: ${"Unknown error"}`,type:c}],json:null,response:null,zonosMode:a}}},O=async({basePathType:e,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,a=await j({basePathType:i,options:o,path:n}),{errors:l,response:c}=a,d=w(a,["errors","response"]),u=b(i),p=!!l.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),m=u&&p;return p&&(async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(t("sendErrorLog","warn",e,n,o),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${v}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=b();if(!o)return;fetch(`${f[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:f[i]+n,errors:l.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==o?void 0:o.headers,requestPayload:S(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.toString())||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.toString()),status:null==c?void 0:c.status,statusText:null==c?void 0:c.statusText},shouldPostReleaseErrorReporting:!0}),m?(t(`=== "${n}" failed to fetch, trying next fallback ${u}`),O({basePathType:u,options:o,path:n})):Object.assign({errors:l,response:c},d)},C=async({cartId:e,retries:o})=>{const n="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:r,json:s}=await(async(e,o)=>{const n=w(o||{},[]),r=n.body?JSON.stringify(n.body):void 0,s=n.method||"GET",i=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers),a=Object.assign(Object.assign({},n),{body:"GET"===s?void 0:r,headers:i,method:s}),l=new URLSearchParams(window.location.search).get("useFallbackApi");return t(e,"info"),O({basePathType:l||g,options:a,path:e})})("/api/zonos-elements/get-temp-cart",{body:{isTestMode:n,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),i=!s||r.length;return i&&o?(t("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),C({cartId:e,retries:o-1})):i?null:s},Z=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,E=new RegExp(`^${Z.source}$`),I=new RegExp(`^cart_${Z.source}$`),k=async e=>{const{isDgsCartId:o,isLegacyCartId:r}=(e=>e?I.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:E.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1})(e);if(!r&&!o)return n("[ZONOS - loadZonos] invalid cart id"),null;const s=await C({cartId:e,retries:5});return t("[ZONOS - loadZonos] getting temp cart data","info",s),s?{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}:(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)};var $;const A=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:o,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),n=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?o:null})(),T="https://v1.3.120.js.zonos.com",U=A||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.120",L="https://rsms.me",P="https://fonts.googleapis.com",N=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class D{}$=D,D.doneInit=!1,D.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),D.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),D._paypalMockResponse=null,D.isBigCommerce=!1,D.releaseDate="1730830453768",D.isLegacyCheckout=!1,D.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),D.isNpm=!0,D.zonosQaUrl=null,D.zonosQaUrlApi=null,D.version="v1.3.120",D.modeAlerted=!1,D.cartData=null,D.paypal=null,D.getCurrentTimestamp=()=>(new Date).getTime(),D.zonosController=null,D.init=async e=>{const{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c,storeId:d,zonosApiKey:u}=e;if($.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!$.doneInit){if(t(`====== ZONOS DEBUG MODE: on (${$.version}) ======`),$.zonosApiKey=u,$.storeId=d,$.isNpm){t("====== ZONOS LOADING FROM NPM ======");const o=a();if(o&&!window.isZonosPreview){t(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${o} ======`,"info");const n=document.createElement("script");return n.src=`${o}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=$.isNpm,window.Zonos.isBigCommerce=$.isBigCommerce,window.Zonos.isLegacyCheckout=$.isLegacyCheckout,window.Zonos.init(e)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${o}`)})),void(window.isZonosPreview=!0)}if(!u&&!$.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!$.cartData&&$.cartId){t("Initialize cart data");const e=await k($.cartId);if(!e)return void n("Failed to get cart data");$.cartData=e.cartData,$.zonosApiKey=e.zonosApiKey}}if($.cartId&&$.cartData){t("Cart data is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}t("init zonos"),$.injectZonosCdn(),$.injectZonosCss(),$.injectFonts(),$.injectController({config:{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c}}),$.doneInit=!0}},D.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},D.openHelloDialog=e=>{const o=document.querySelector("zonos-hello");o&&o.openHelloDialog(null==e||e)},D.showNotification=e=>{var o;null===(o=$.zonosController)||void 0===o||o.showNotification(e)},D.updateOrganizationName=e=>{var o;null===(o=$.zonosController)||void 0===o||o.updateOrganizationName(e)},D.disablePlaceOrderButtons=({autoEnable:e=!0,config:o,disable:t,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=o.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},D.injectController=({config:e})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const o=e.checkoutSettings.placeOrderButtonSelector;$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o});new MutationObserver((()=>{$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=$.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:o}=e;t("loading Stripe");const s=await(async(...e)=>{h=!0;const o=Date.now();return m.then((t=>((e,o,t)=>{if(null===e)return null;const n=e.apply(void 0,o);return((e,o)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:o})})(n,t),n})(t,e,o)))})(o.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),$.zonosController=r,t("Zonos controller injected!")},D.injectScript=({cdnType:e,isModule:o,theRestUrl:r})=>{const s=`${$.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void t(`Zonos script "${s}" already exists in the document`,"warn");const a=document.head||document.body,l=document.createElement("script");o?l.type="module":l.noModule=!0,l.src=s,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const t=i(e);t&&$.injectScript({cdnType:t,isModule:o,theRestUrl:r})},a.appendChild(l)},D.getZonosUrl=e=>{const o=()=>{switch(e){case"jsdelivr":return U;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.120";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.120";case"vercel":return T}};if($.isNpm){return a()||o()}return o()},D.injectZonosCdn=()=>{$.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),$.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),t("Zonos cdn script injected!")},D.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=$.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${T}/`,r.appendChild(s);const a=document.createElement("link");a.rel="stylesheet",a.href=`${t}/${o}`,a.onerror=()=>{n(`Failed to load ${a.href}`);const t=i(e);t&&$.injectStylesheet({cdnType:t,theRestUrl:o})},r.appendChild(a)},D.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?t("Zonos style links already injected","warn"):($.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),t("Zonos style css injected!"))},D.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${L}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&!N.test(t.href))return t}return null})())return void t("Inter font already injected","warn");const e=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=L,e.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${L}/inter/inter.css`,e.appendChild(n),t("Zonos font injected!")},D.setupGoogleFont=e=>{var o;null===(o=$.zonosController)||void 0===o||o.setupGoogleFont(e)},D.injectSupportGoogleFont=e=>{var o;t(`[FONT] injecting ${e}`);const n=null===(o=e.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${P}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=P,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),t(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=D)})();
|
|
1
|
+
(function(){"use strict";const e=performance.now(),o=e=>{if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(o){if(e&&"function"==typeof e.toString){return e.toString()}return"Unable to stringify info"}},t=(t,n,...r)=>{var s,i;const{elapsedTimePretty:a}=(()=>{const o=performance.now()-e,t=o>1e3?`${(o/1e3).toFixed(2)}s`:`${o.toFixed(2)}ms`;return{elapsedTime:o,elapsedTimePretty:t}})(),l=[`(${a})`,...r];l.map(o).join(" ");if(!(!!(null===(s=window.Zonos)||void 0===s?void 0:s.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/)))return void("error"===n&&console.error(t,...l));let c=document.querySelector("iframe#zonos---debug-logging-iframe");c||(c=document.createElement("iframe"),c.id="zonos---debug-logging-iframe",c.style.display="none",c.style.opacity="0",c.style.position="absolute",c.style.top="-9999px",c.style.left="-9999px",c.style.width="1px",c.style.height="1px",c.style.border="none",c.style.overflow="hidden",c.style.visibility="hidden",document.body.appendChild(c));const d=(null===(i=c.contentWindow)||void 0===i?void 0:i.window.console)||window.console;switch(n){case"warn":d.warn(t,...l);break;case"info":d.info(t,...l);break;case"error":d.error(t,...l);break;default:d.groupCollapsed(t,...l),d.trace(),d.groupEnd()}},n=(e,...o)=>{t(e,"error",...o)},r=["jsdelivr","cdnjs","unpkg","vercel"],s="jsdelivr",i=e=>{const o=r.indexOf(e);return r[o+1]||null},a=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const o=(e=>{if(!e)return null;const o=new URL(e).searchParams.get("zonosQaUrl");return o?/[^a-zA-Z0-9-_]+/.test(o)?null:o:null})(window.location.href),n="https://v1.3.122.js.zonos.com";if(!o&&(n.includes("test.")||n.includes("test-")))return n;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const r=`https://${o}.preview.js.zonos.com`;return t(`[ZONOS-WARNING] using '${r}' for loading elements script`,"warn"),fetch(r).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${r}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:o}=window.location,t=`${o}?${e.toString()}`;return window.history.replaceState(window.history.state,"",t),window.location.reload(),null})),r},l="https://js.stripe.com/v3",c=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,d="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let u=null;const p=e=>(null!==u||(u=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(d),window.Stripe)o(window.Stripe);else try{let r=(()=>{const e=document.querySelectorAll(`script[src^="${l}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&c.test(t.src))return t}return null})();r&&e?console.warn(d):r||(r=(e=>{const o=document.createElement("script");o.src=`${l}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})()),null==r||r.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==r||r.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),u),m=Promise.resolve().then((()=>p(null)));let h=!1;m.catch((e=>{h||console.warn(e)}));function w(e,o){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&o.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)o.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(t[n[r]]=e[n[r]])}return t}"function"==typeof SuppressedError&&SuppressedError;const y=["cloudflare","vercel"],g=y[0],f={cloudflare:"https://route.elements.zonos.com",vercel:"https://route.js.zonos.com"},v=f[g],b=(e=g)=>{const o=y.indexOf(e),t=y[o+1];return t||null},S=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},z=async({response:e,shouldLog:o=!0,shouldThrow:t=!1})=>{try{return await e.json()}catch(e){if(t)throw e;return o&&console.error(e),null}},j=async({basePathType:e,options:o,path:t})=>{let n;const r=window.Zonos.zonosQaUrlApi||f[e]||g,s=new URL(r+t),i=window.Zonos.cartId?`${window.location.hostname}-${window.Zonos.cartId}`:window.location.hostname;s.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(i));try{n=await fetch(s.toString(),o)}catch(e){if(e instanceof Error)return{baseUrl:r,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null};return{baseUrl:r,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const a=n.headers.get("Zonos-Mode"),l=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&a&&l&&(window.Zonos.modeAlerted=!0),n.ok){return{baseUrl:r,errors:[],json:await z({response:n}),response:n,zonosMode:a}}const c=n.status.toString();try{const e=await z({response:n,shouldThrow:!0});return{baseUrl:r,errors:[{message:JSON.stringify(e),type:c}],json:null,response:n,zonosMode:a}}catch(e){return{baseUrl:r,errors:[{message:`${c}: ${"Unknown error"}`,type:c}],json:null,response:null,zonosMode:a}}},O=async({basePathType:e,options:o,path:n})=>{var r,s;const i=n.startsWith("/api/bigcommerce")?"vercel":e,a=await j({basePathType:i,options:o,path:n}),{errors:l,response:c}=a,d=w(a,["errors","response"]),u=b(i),p=!!l.find((({type:e})=>"unknown"===e))||404===(null==c?void 0:c.status),m=u&&p;return p&&(async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(t("sendErrorLog","warn",e,n,o),r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const s="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:o,href:window.location.href,metadata:Object.assign({userAgent:s&&s.brands.length>0?s:window.navigator.userAgent},n)};try{fetch(`${v}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=b();if(!o)return;fetch(`${f[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}})({endpoint:f[i]+n,errors:l.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:i,nextFallbackApiType:u,requestHeaders:null==o?void 0:o.headers,requestPayload:S(null===(r=null==o?void 0:o.body)||void 0===r?void 0:r.toString())||(null===(s=null==o?void 0:o.body)||void 0===s?void 0:s.toString()),status:null==c?void 0:c.status,statusText:null==c?void 0:c.statusText},shouldPostReleaseErrorReporting:!0}),m?(t(`=== "${n}" failed to fetch, trying next fallback ${u}`),O({basePathType:u,options:o,path:n})):Object.assign({errors:l,response:c},d)},C=async({cartId:e,retries:o})=>{const n="1"===new URLSearchParams(window.location.search).get("zonosTestMode"),{errors:r,json:s}=await(async(e,o)=>{const n=w(o||{},[]),r=n.body?JSON.stringify(n.body):void 0,s=n.method||"GET",i=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers),a=Object.assign(Object.assign({},n),{body:"GET"===s?void 0:r,headers:i,method:s}),l=new URLSearchParams(window.location.search).get("useFallbackApi");return t(e,"info"),O({basePathType:l||g,options:a,path:e})})("/api/zonos-elements/get-temp-cart",{body:{isTestMode:n,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),i=!s||r.length;return i&&o?(t("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:o}),await new Promise((e=>setTimeout(e,500))),C({cartId:e,retries:o-1})):i?null:s},Z=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/,E=new RegExp(`^${Z.source}$`),I=new RegExp(`^cart_${Z.source}$`),k=async e=>{const{isDgsCartId:o,isLegacyCartId:r}=(e=>e?I.test(e)?{isDgsCartId:!0,isLegacyCartId:!1}:E.test(e)?{isDgsCartId:!1,isLegacyCartId:!0}:{isDgsCartId:!1,isLegacyCartId:!1}:{isDgsCartId:!1,isLegacyCartId:!1})(e);if(!r&&!o)return n("[ZONOS - loadZonos] invalid cart id"),null;const s=await C({cartId:e,retries:5});return t("[ZONOS - loadZonos] getting temp cart data","info",s),s?{cartData:s.cartData,storeFavicon:s.storeFaviconUrl,storeId:s.cartData.storeId,storeLogo:s.storeLogoUrl,zonosApiKey:s.cartData.credentialToken}:(n("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)};var $;const A=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:o,isWhiteListed:t}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const o=new URL(e).origin,t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>o.includes(e))),n=["qa.js.zonos.com"].some((e=>o.includes(e)));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:n,isWhiteListed:t}})({loadScriptSrc:null==e?void 0:e.src});return t?o:null})(),T="https://v1.3.122.js.zonos.com",U=A||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.122",L="https://rsms.me",P="https://fonts.googleapis.com",N=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class D{}$=D,D.doneInit=!1,D.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),D.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),D._paypalMockResponse=null,D.isBigCommerce=!1,D.releaseDate="1730912163735",D.isLegacyCheckout=!1,D.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),D.isNpm=!0,D.zonosQaUrl=null,D.zonosQaUrlApi=null,D.version="v1.3.122",D.modeAlerted=!1,D.cartData=null,D.paypal=null,D.getCurrentTimestamp=()=>(new Date).getTime(),D.zonosController=null,D.init=async e=>{const{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c,storeId:d,zonosApiKey:u}=e;if($.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!$.doneInit){if(t(`====== ZONOS DEBUG MODE: on (${$.version}) ======`),$.zonosApiKey=u,$.storeId=d,$.isNpm){t("====== ZONOS LOADING FROM NPM ======");const o=a();if(o&&!window.isZonosPreview){t(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${o} ======`,"info");const n=document.createElement("script");return n.src=`${o}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=$.isNpm,window.Zonos.isBigCommerce=$.isBigCommerce,window.Zonos.isLegacyCheckout=$.isLegacyCheckout,window.Zonos.init(e)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${o}`)})),void(window.isZonosPreview=!0)}if(!u&&!$.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!$.cartData&&$.cartId){t("Initialize cart data");const e=await k($.cartId);if(!e)return void n("Failed to get cart data");$.cartData=e.cartData,$.zonosApiKey=e.zonosApiKey}}if($.cartId&&$.cartData){t("Cart data is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id="zonos--checkout-hidden-button",document.body.appendChild(e)}t("init zonos"),$.injectZonosCdn(),$.injectZonosCss(),$.injectFonts(),$.injectController({config:{appearance:o,checkoutSettings:r,currencyConverter:s,helloSettings:i,onCountryChange:l,overrideCurrencyFormat:c}}),$.doneInit=!0}},D.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},D.openHelloDialog=e=>{const o=document.querySelector("zonos-hello");o&&o.openHelloDialog(null==e||e)},D.showNotification=e=>{var o;null===(o=$.zonosController)||void 0===o||o.showNotification(e)},D.updateOrganizationName=e=>{var o;null===(o=$.zonosController)||void 0===o||o.updateOrganizationName(e)},D.disablePlaceOrderButtons=({autoEnable:e=!0,config:o,disable:t,placeOrderButtonSelector:n})=>{var r;if(!(null===(r=o.checkoutSettings)||void 0===r?void 0:r.disablePlaceOrderButtonActivation)&&n){const o=document.querySelectorAll(n),r=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};o.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(t?(e.setAttribute("disabled","true"),e.addEventListener("click",r)):(e.removeAttribute("disabled"),e.removeEventListener("click",r)))})),e&&t&&setTimeout((()=>{o.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",r)}))}),5e3)}},D.injectController=({config:e})=>{var o;if(document.querySelector("zonos-controller"))return;if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.placeOrderButtonSelector){const o=e.checkoutSettings.placeOrderButtonSelector;$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o});new MutationObserver((()=>{$.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:o})})).observe(document.body,{childList:!0,subtree:!0})}const r=document.createElement("zonos-controller");r.config=e,r.zonosApiKey=$.zonosApiKey||"",r.addEventListener("stripeInitEvent",(async e=>{const{detail:o}=e;t("loading Stripe");const s=await(async(...e)=>{h=!0;const o=Date.now();return m.then((t=>((e,o,t)=>{if(null===e)return null;const n=e.apply(void 0,o);return((e,o)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:o})})(n,t),n})(t,e,o)))})(o.publishableKey);s?(window.Zonos.stripe=s,r.initCheckoutElement(s)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(r),$.zonosController=r,t("Zonos controller injected!")},D.injectScript=({cdnType:e,isModule:o,theRestUrl:r})=>{const s=`${$.getZonosUrl(e)}/${r}`;if(document.querySelector(`script[src="${s}"]`))return void t(`Zonos script "${s}" already exists in the document`,"warn");const a=document.head||document.body,l=document.createElement("script");o?l.type="module":l.noModule=!0,l.src=s,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const t=i(e);t&&$.injectScript({cdnType:t,isModule:o,theRestUrl:r})},a.appendChild(l)},D.getZonosUrl=e=>{const o=()=>{switch(e){case"jsdelivr":return U;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.122";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.122";case"vercel":return T}};if($.isNpm){return a()||o()}return o()},D.injectZonosCdn=()=>{$.injectScript({cdnType:s,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),$.injectScript({cdnType:s,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),t("Zonos cdn script injected!")},D.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=$.getZonosUrl(e),r=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${T}/`,r.appendChild(s);const a=document.createElement("link");a.rel="stylesheet",a.href=`${t}/${o}`,a.onerror=()=>{n(`Failed to load ${a.href}`);const t=i(e);t&&$.injectStylesheet({cdnType:t,theRestUrl:o})},r.appendChild(a)},D.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?t("Zonos style links already injected","warn"):($.injectStylesheet({cdnType:s,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),t("Zonos style css injected!"))},D.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${L}"]`);for(let o=0;o<e.length;o++){const t=e[o];if(t&&!N.test(t.href))return t}return null})())return void t("Inter font already injected","warn");const e=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=L,e.appendChild(o);const n=document.createElement("link");n.rel="stylesheet",n.href=`${L}/inter/inter.css`,e.appendChild(n),t("Zonos font injected!")},D.setupGoogleFont=e=>{var o;null===(o=$.zonosController)||void 0===o||o.setupGoogleFont(e)},D.injectSupportGoogleFont=e=>{var o;t(`[FONT] injecting ${e}`);const n=null===(o=e.match(/family=(.*?):/))||void 0===o?void 0:o[1],r=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${P}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=P,r.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void t(`[FONT] ${n} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,r.appendChild(s),t(`[FONT] ${n} font injected!`)},window.Zonos&&window.Zonos.doneInit||(window.Zonos=D)})();
|
|
@@ -150,6 +150,7 @@ declare const cartStoreCheckItemRestrictions: (itemsWorkflow: ItemWorkflowInfo[]
|
|
|
150
150
|
id: string;
|
|
151
151
|
imageUrl: string | null;
|
|
152
152
|
name: string | null;
|
|
153
|
+
productId: string;
|
|
153
154
|
quantity: number;
|
|
154
155
|
sku: string | null;
|
|
155
156
|
matchedItem: CartItemToUse | undefined;
|
|
@@ -94,6 +94,7 @@ export declare const featureAspectKeyEnum: {
|
|
|
94
94
|
readonly ExploreFrontendMutation: "explore_frontend_mutation";
|
|
95
95
|
readonly ExploreWeaviateMutation: "explore_weaviate_mutation";
|
|
96
96
|
readonly FeatureAspect: "feature_aspect";
|
|
97
|
+
readonly FeatureFlagManagement: "feature_flag_management";
|
|
97
98
|
readonly LocaleMessage: "locale_message";
|
|
98
99
|
readonly NewCheckoutBeta: "new_checkout_beta";
|
|
99
100
|
readonly NewPayoutReport: "new_payout_report";
|
|
@@ -113,6 +114,7 @@ export declare const featureAudienceNameEnum: {
|
|
|
113
114
|
readonly DocsContributor: "docs_contributor";
|
|
114
115
|
readonly Executive: "executive";
|
|
115
116
|
readonly ExecutiveAssistant: "executive_assistant";
|
|
117
|
+
readonly FeatureFlagAdmin: "feature_flag_admin";
|
|
116
118
|
readonly Finance: "finance";
|
|
117
119
|
readonly FrontendEngineer: "frontend_engineer";
|
|
118
120
|
readonly I18nKnownLanguage: "i18n_known_language";
|
|
@@ -73,6 +73,7 @@ export const featureAspectKeyEnum = {
|
|
|
73
73
|
ExploreFrontendMutation: 'explore_frontend_mutation',
|
|
74
74
|
ExploreWeaviateMutation: 'explore_weaviate_mutation',
|
|
75
75
|
FeatureAspect: 'feature_aspect',
|
|
76
|
+
FeatureFlagManagement: 'feature_flag_management',
|
|
76
77
|
LocaleMessage: 'locale_message',
|
|
77
78
|
NewCheckoutBeta: 'new_checkout_beta',
|
|
78
79
|
NewPayoutReport: 'new_payout_report',
|
|
@@ -96,6 +97,7 @@ export const featureAudienceNameEnum = {
|
|
|
96
97
|
DocsContributor: 'docs_contributor',
|
|
97
98
|
Executive: 'executive',
|
|
98
99
|
ExecutiveAssistant: 'executive_assistant',
|
|
100
|
+
FeatureFlagAdmin: 'feature_flag_admin',
|
|
99
101
|
Finance: 'finance',
|
|
100
102
|
FrontendEngineer: 'frontend_engineer',
|
|
101
103
|
I18nKnownLanguage: 'i18n_known_language',
|
|
@@ -459,11 +459,6 @@ export declare const classifyMissingHsCodesStatus: {
|
|
|
459
459
|
readonly Enabled: "ENABLED";
|
|
460
460
|
};
|
|
461
461
|
export type ClassifyMissingHsCodesStatus = (typeof classifyMissingHsCodesStatus)[keyof typeof classifyMissingHsCodesStatus];
|
|
462
|
-
export declare const clearanceType: {
|
|
463
|
-
readonly Commercial: "COMMERCIAL";
|
|
464
|
-
readonly Postal: "POSTAL";
|
|
465
|
-
};
|
|
466
|
-
export type ClearanceType = (typeof clearanceType)[keyof typeof clearanceType];
|
|
467
462
|
export declare const collectFeeCalculationType: {
|
|
468
463
|
readonly Flat: "FLAT";
|
|
469
464
|
readonly Percent: "PERCENT";
|
|
@@ -1233,11 +1228,17 @@ export type CustomsDocumentType = (typeof customsDocumentType)[keyof typeof cust
|
|
|
1233
1228
|
export declare const customsSpecAttributeType: {
|
|
1234
1229
|
readonly AccountNumber: "ACCOUNT_NUMBER";
|
|
1235
1230
|
readonly B13A: "B13A";
|
|
1231
|
+
readonly DutyTaxBillingAccountNumber: "DUTY_TAX_BILLING_ACCOUNT_NUMBER";
|
|
1236
1232
|
readonly Eccn: "ECCN";
|
|
1237
1233
|
readonly Eori: "EORI";
|
|
1234
|
+
readonly Gst: "GST";
|
|
1235
|
+
readonly Ioss: "IOSS";
|
|
1238
1236
|
readonly Itn: "ITN";
|
|
1239
1237
|
readonly OrderNumber: "ORDER_NUMBER";
|
|
1240
1238
|
readonly PurchaseOrderNumber: "PURCHASE_ORDER_NUMBER";
|
|
1239
|
+
readonly ShippingBillingAccountNumber: "SHIPPING_BILLING_ACCOUNT_NUMBER";
|
|
1240
|
+
readonly Vat: "VAT";
|
|
1241
|
+
readonly Voec: "VOEC";
|
|
1241
1242
|
};
|
|
1242
1243
|
export type CustomsSpecAttributeType = (typeof customsSpecAttributeType)[keyof typeof customsSpecAttributeType];
|
|
1243
1244
|
export declare const customsSpecSourceType: {
|
|
@@ -1362,6 +1363,7 @@ export declare const elementsUiTheme: {
|
|
|
1362
1363
|
};
|
|
1363
1364
|
export type ElementsUiTheme = (typeof elementsUiTheme)[keyof typeof elementsUiTheme];
|
|
1364
1365
|
export declare const emailTemplateProviderType: {
|
|
1366
|
+
readonly Custom: "CUSTOM";
|
|
1365
1367
|
readonly Sendgrid: "SENDGRID";
|
|
1366
1368
|
};
|
|
1367
1369
|
export type EmailTemplateProviderType = (typeof emailTemplateProviderType)[keyof typeof emailTemplateProviderType];
|
|
@@ -1374,7 +1376,10 @@ export declare const emailTemplateType: {
|
|
|
1374
1376
|
readonly AbandonedCart: "ABANDONED_CART";
|
|
1375
1377
|
readonly CatalogExport: "CATALOG_EXPORT";
|
|
1376
1378
|
readonly ClassificationExport: "CLASSIFICATION_EXPORT";
|
|
1379
|
+
readonly Custom: "CUSTOM";
|
|
1380
|
+
readonly InclusivePriceExport: "INCLUSIVE_PRICE_EXPORT";
|
|
1377
1381
|
readonly ManualClassificationExport: "MANUAL_CLASSIFICATION_EXPORT";
|
|
1382
|
+
readonly MerchantOrderConfirmation: "MERCHANT_ORDER_CONFIRMATION";
|
|
1378
1383
|
readonly OrderCanceled: "ORDER_CANCELED";
|
|
1379
1384
|
readonly OrderConfirmation: "ORDER_CONFIRMATION";
|
|
1380
1385
|
readonly OrderReceipt: "ORDER_RECEIPT";
|
|
@@ -1573,6 +1578,13 @@ export declare const inclusivePriceCatalogValidationJobComplianceStatus: {
|
|
|
1573
1578
|
readonly Pending: "PENDING";
|
|
1574
1579
|
};
|
|
1575
1580
|
export type InclusivePriceCatalogValidationJobComplianceStatus = (typeof inclusivePriceCatalogValidationJobComplianceStatus)[keyof typeof inclusivePriceCatalogValidationJobComplianceStatus];
|
|
1581
|
+
export declare const inclusivePriceExportJobStatus: {
|
|
1582
|
+
readonly Completed: "COMPLETED";
|
|
1583
|
+
readonly Error: "ERROR";
|
|
1584
|
+
readonly Initialized: "INITIALIZED";
|
|
1585
|
+
readonly Processing: "PROCESSING";
|
|
1586
|
+
};
|
|
1587
|
+
export type InclusivePriceExportJobStatus = (typeof inclusivePriceExportJobStatus)[keyof typeof inclusivePriceExportJobStatus];
|
|
1576
1588
|
export declare const inclusivePriceHistoryCsvJobStatus: {
|
|
1577
1589
|
readonly Completed: "COMPLETED";
|
|
1578
1590
|
readonly Error: "ERROR";
|
|
@@ -2139,6 +2151,20 @@ export declare const packageLocation: {
|
|
|
2139
2151
|
readonly Side: "SIDE";
|
|
2140
2152
|
};
|
|
2141
2153
|
export type PackageLocation = (typeof packageLocation)[keyof typeof packageLocation];
|
|
2154
|
+
export declare const packagingOptionBulkExportJobStatus: {
|
|
2155
|
+
readonly Completed: "COMPLETED";
|
|
2156
|
+
readonly CompletedWithErrors: "COMPLETED_WITH_ERRORS";
|
|
2157
|
+
readonly Error: "ERROR";
|
|
2158
|
+
readonly Initialized: "INITIALIZED";
|
|
2159
|
+
};
|
|
2160
|
+
export type PackagingOptionBulkExportJobStatus = (typeof packagingOptionBulkExportJobStatus)[keyof typeof packagingOptionBulkExportJobStatus];
|
|
2161
|
+
export declare const packagingOptionBulkJobStatus: {
|
|
2162
|
+
readonly Completed: "COMPLETED";
|
|
2163
|
+
readonly CompletedWithErrors: "COMPLETED_WITH_ERRORS";
|
|
2164
|
+
readonly Error: "ERROR";
|
|
2165
|
+
readonly Initialized: "INITIALIZED";
|
|
2166
|
+
};
|
|
2167
|
+
export type PackagingOptionBulkJobStatus = (typeof packagingOptionBulkJobStatus)[keyof typeof packagingOptionBulkJobStatus];
|
|
2142
2168
|
export declare const packagingOptionDeleteAction: {
|
|
2143
2169
|
readonly Delete: "DELETE";
|
|
2144
2170
|
readonly Disable: "DISABLE";
|
|
@@ -2262,6 +2288,11 @@ export declare const propertyType: {
|
|
|
2262
2288
|
readonly Residential: "RESIDENTIAL";
|
|
2263
2289
|
};
|
|
2264
2290
|
export type PropertyType = (typeof propertyType)[keyof typeof propertyType];
|
|
2291
|
+
export declare const providedHsCodeSource: {
|
|
2292
|
+
readonly Classify: "CLASSIFY";
|
|
2293
|
+
readonly User: "USER";
|
|
2294
|
+
};
|
|
2295
|
+
export type ProvidedHsCodeSource = (typeof providedHsCodeSource)[keyof typeof providedHsCodeSource];
|
|
2265
2296
|
export declare const providedHsCodeVisibilityStatus: {
|
|
2266
2297
|
readonly NotVisible: "NOT_VISIBLE";
|
|
2267
2298
|
readonly Visible: "VISIBLE";
|
|
@@ -2558,6 +2589,11 @@ export declare const trackingEventTypeCode: {
|
|
|
2558
2589
|
readonly PreTransit: "PRE_TRANSIT";
|
|
2559
2590
|
};
|
|
2560
2591
|
export type TrackingEventTypeCode = (typeof trackingEventTypeCode)[keyof typeof trackingEventTypeCode];
|
|
2592
|
+
export declare const trackingType: {
|
|
2593
|
+
readonly Package: "PACKAGE";
|
|
2594
|
+
readonly Shipment: "SHIPMENT";
|
|
2595
|
+
};
|
|
2596
|
+
export type TrackingType = (typeof trackingType)[keyof typeof trackingType];
|
|
2561
2597
|
export declare const transactionFeeType: {
|
|
2562
2598
|
readonly DutyTax: "DUTY_TAX";
|
|
2563
2599
|
readonly LcgPerShipment: "LCG_PER_SHIPMENT";
|
|
@@ -2655,6 +2691,7 @@ export declare const webhookType: {
|
|
|
2655
2691
|
readonly IpSettingStatusChanged: "IP_SETTING_STATUS_CHANGED";
|
|
2656
2692
|
readonly OrderCanceled: "ORDER_CANCELED";
|
|
2657
2693
|
readonly OrderCreated: "ORDER_CREATED";
|
|
2694
|
+
readonly OrderShipping: "ORDER_SHIPPING";
|
|
2658
2695
|
readonly OrderStatusChanged: "ORDER_STATUS_CHANGED";
|
|
2659
2696
|
readonly OrderUpdated: "ORDER_UPDATED";
|
|
2660
2697
|
readonly ShipmentCanceled: "SHIPMENT_CANCELED";
|
|
@@ -2691,6 +2728,7 @@ export type CartCalculateLandedCostMutation = {
|
|
|
2691
2728
|
id: string;
|
|
2692
2729
|
imageUrl: string | null;
|
|
2693
2730
|
name: string | null;
|
|
2731
|
+
productId: string;
|
|
2694
2732
|
quantity: number;
|
|
2695
2733
|
restriction: {
|
|
2696
2734
|
action: RestrictedItemAction;
|
|
@@ -2831,6 +2869,7 @@ export type CalculateLandedCostMutation = {
|
|
|
2831
2869
|
id: string;
|
|
2832
2870
|
imageUrl: string | null;
|
|
2833
2871
|
name: string | null;
|
|
2872
|
+
productId: string;
|
|
2834
2873
|
quantity: number;
|
|
2835
2874
|
restriction: {
|
|
2836
2875
|
action: RestrictedItemAction;
|
|
@@ -2909,6 +2948,7 @@ export type CartItemFragmentFragment = {
|
|
|
2909
2948
|
id: string;
|
|
2910
2949
|
imageUrl: string | null;
|
|
2911
2950
|
name: string | null;
|
|
2951
|
+
productId: string;
|
|
2912
2952
|
quantity: number;
|
|
2913
2953
|
restriction: {
|
|
2914
2954
|
action: RestrictedItemAction;
|
|
@@ -3665,7 +3705,7 @@ export type CartQuery = {
|
|
|
3665
3705
|
adjustments: Array<{
|
|
3666
3706
|
amount: number;
|
|
3667
3707
|
currencyCode: CurrencyCode;
|
|
3668
|
-
description: string;
|
|
3708
|
+
description: string | null;
|
|
3669
3709
|
productId: string | null;
|
|
3670
3710
|
sku: string | null;
|
|
3671
3711
|
type: CartAdjustmentType;
|
|
@@ -3715,7 +3755,7 @@ export type CartCreateMutation = {
|
|
|
3715
3755
|
adjustments: Array<{
|
|
3716
3756
|
amount: number;
|
|
3717
3757
|
currencyCode: CurrencyCode;
|
|
3718
|
-
description: string;
|
|
3758
|
+
description: string | null;
|
|
3719
3759
|
productId: string | null;
|
|
3720
3760
|
sku: string | null;
|
|
3721
3761
|
type: CartAdjustmentType;
|
|
@@ -581,12 +581,6 @@ export const classifyMissingHsCodesStatus = {
|
|
|
581
581
|
|
|
582
582
|
export type ClassifyMissingHsCodesStatus =
|
|
583
583
|
(typeof classifyMissingHsCodesStatus)[keyof typeof classifyMissingHsCodesStatus];
|
|
584
|
-
export const clearanceType = {
|
|
585
|
-
Commercial: 'COMMERCIAL',
|
|
586
|
-
Postal: 'POSTAL',
|
|
587
|
-
} as const;
|
|
588
|
-
|
|
589
|
-
export type ClearanceType = (typeof clearanceType)[keyof typeof clearanceType];
|
|
590
584
|
export const collectFeeCalculationType = {
|
|
591
585
|
Flat: 'FLAT',
|
|
592
586
|
Percent: 'PERCENT',
|
|
@@ -1411,11 +1405,17 @@ export type CustomsDocumentType =
|
|
|
1411
1405
|
export const customsSpecAttributeType = {
|
|
1412
1406
|
AccountNumber: 'ACCOUNT_NUMBER',
|
|
1413
1407
|
B13A: 'B13A',
|
|
1408
|
+
DutyTaxBillingAccountNumber: 'DUTY_TAX_BILLING_ACCOUNT_NUMBER',
|
|
1414
1409
|
Eccn: 'ECCN',
|
|
1415
1410
|
Eori: 'EORI',
|
|
1411
|
+
Gst: 'GST',
|
|
1412
|
+
Ioss: 'IOSS',
|
|
1416
1413
|
Itn: 'ITN',
|
|
1417
1414
|
OrderNumber: 'ORDER_NUMBER',
|
|
1418
1415
|
PurchaseOrderNumber: 'PURCHASE_ORDER_NUMBER',
|
|
1416
|
+
ShippingBillingAccountNumber: 'SHIPPING_BILLING_ACCOUNT_NUMBER',
|
|
1417
|
+
Vat: 'VAT',
|
|
1418
|
+
Voec: 'VOEC',
|
|
1419
1419
|
} as const;
|
|
1420
1420
|
|
|
1421
1421
|
export type CustomsSpecAttributeType =
|
|
@@ -1581,6 +1581,7 @@ export type ElementsUiTheme =
|
|
|
1581
1581
|
(typeof elementsUiTheme)[keyof typeof elementsUiTheme];
|
|
1582
1582
|
|
|
1583
1583
|
export const emailTemplateProviderType = {
|
|
1584
|
+
Custom: 'CUSTOM',
|
|
1584
1585
|
Sendgrid: 'SENDGRID',
|
|
1585
1586
|
} as const;
|
|
1586
1587
|
|
|
@@ -1597,7 +1598,10 @@ export const emailTemplateType = {
|
|
|
1597
1598
|
AbandonedCart: 'ABANDONED_CART',
|
|
1598
1599
|
CatalogExport: 'CATALOG_EXPORT',
|
|
1599
1600
|
ClassificationExport: 'CLASSIFICATION_EXPORT',
|
|
1601
|
+
Custom: 'CUSTOM',
|
|
1602
|
+
InclusivePriceExport: 'INCLUSIVE_PRICE_EXPORT',
|
|
1600
1603
|
ManualClassificationExport: 'MANUAL_CLASSIFICATION_EXPORT',
|
|
1604
|
+
MerchantOrderConfirmation: 'MERCHANT_ORDER_CONFIRMATION',
|
|
1601
1605
|
OrderCanceled: 'ORDER_CANCELED',
|
|
1602
1606
|
OrderConfirmation: 'ORDER_CONFIRMATION',
|
|
1603
1607
|
OrderReceipt: 'ORDER_RECEIPT',
|
|
@@ -1863,6 +1867,16 @@ export const inclusivePriceCatalogValidationJobComplianceStatus = {
|
|
|
1863
1867
|
export type InclusivePriceCatalogValidationJobComplianceStatus =
|
|
1864
1868
|
(typeof inclusivePriceCatalogValidationJobComplianceStatus)[keyof typeof inclusivePriceCatalogValidationJobComplianceStatus];
|
|
1865
1869
|
|
|
1870
|
+
export const inclusivePriceExportJobStatus = {
|
|
1871
|
+
Completed: 'COMPLETED',
|
|
1872
|
+
Error: 'ERROR',
|
|
1873
|
+
Initialized: 'INITIALIZED',
|
|
1874
|
+
Processing: 'PROCESSING',
|
|
1875
|
+
} as const;
|
|
1876
|
+
|
|
1877
|
+
export type InclusivePriceExportJobStatus =
|
|
1878
|
+
(typeof inclusivePriceExportJobStatus)[keyof typeof inclusivePriceExportJobStatus];
|
|
1879
|
+
|
|
1866
1880
|
export const inclusivePriceHistoryCsvJobStatus = {
|
|
1867
1881
|
Completed: 'COMPLETED',
|
|
1868
1882
|
Error: 'ERROR',
|
|
@@ -2574,6 +2588,26 @@ export const packageLocation = {
|
|
|
2574
2588
|
export type PackageLocation =
|
|
2575
2589
|
(typeof packageLocation)[keyof typeof packageLocation];
|
|
2576
2590
|
|
|
2591
|
+
export const packagingOptionBulkExportJobStatus = {
|
|
2592
|
+
Completed: 'COMPLETED',
|
|
2593
|
+
CompletedWithErrors: 'COMPLETED_WITH_ERRORS',
|
|
2594
|
+
Error: 'ERROR',
|
|
2595
|
+
Initialized: 'INITIALIZED',
|
|
2596
|
+
} as const;
|
|
2597
|
+
|
|
2598
|
+
export type PackagingOptionBulkExportJobStatus =
|
|
2599
|
+
(typeof packagingOptionBulkExportJobStatus)[keyof typeof packagingOptionBulkExportJobStatus];
|
|
2600
|
+
|
|
2601
|
+
export const packagingOptionBulkJobStatus = {
|
|
2602
|
+
Completed: 'COMPLETED',
|
|
2603
|
+
CompletedWithErrors: 'COMPLETED_WITH_ERRORS',
|
|
2604
|
+
Error: 'ERROR',
|
|
2605
|
+
Initialized: 'INITIALIZED',
|
|
2606
|
+
} as const;
|
|
2607
|
+
|
|
2608
|
+
export type PackagingOptionBulkJobStatus =
|
|
2609
|
+
(typeof packagingOptionBulkJobStatus)[keyof typeof packagingOptionBulkJobStatus];
|
|
2610
|
+
|
|
2577
2611
|
export const packagingOptionDeleteAction = {
|
|
2578
2612
|
Delete: 'DELETE',
|
|
2579
2613
|
Disable: 'DISABLE',
|
|
@@ -2738,6 +2772,13 @@ export const propertyType = {
|
|
|
2738
2772
|
} as const;
|
|
2739
2773
|
|
|
2740
2774
|
export type PropertyType = (typeof propertyType)[keyof typeof propertyType];
|
|
2775
|
+
export const providedHsCodeSource = {
|
|
2776
|
+
Classify: 'CLASSIFY',
|
|
2777
|
+
User: 'USER',
|
|
2778
|
+
} as const;
|
|
2779
|
+
|
|
2780
|
+
export type ProvidedHsCodeSource =
|
|
2781
|
+
(typeof providedHsCodeSource)[keyof typeof providedHsCodeSource];
|
|
2741
2782
|
export const providedHsCodeVisibilityStatus = {
|
|
2742
2783
|
NotVisible: 'NOT_VISIBLE',
|
|
2743
2784
|
Visible: 'VISIBLE',
|
|
@@ -3130,6 +3171,13 @@ export const trackingEventTypeCode = {
|
|
|
3130
3171
|
|
|
3131
3172
|
export type TrackingEventTypeCode =
|
|
3132
3173
|
(typeof trackingEventTypeCode)[keyof typeof trackingEventTypeCode];
|
|
3174
|
+
|
|
3175
|
+
export const trackingType = {
|
|
3176
|
+
Package: 'PACKAGE',
|
|
3177
|
+
Shipment: 'SHIPMENT',
|
|
3178
|
+
} as const;
|
|
3179
|
+
|
|
3180
|
+
export type TrackingType = (typeof trackingType)[keyof typeof trackingType];
|
|
3133
3181
|
export const transactionFeeType = {
|
|
3134
3182
|
DutyTax: 'DUTY_TAX',
|
|
3135
3183
|
LcgPerShipment: 'LCG_PER_SHIPMENT',
|
|
@@ -3245,6 +3293,7 @@ export const webhookType = {
|
|
|
3245
3293
|
IpSettingStatusChanged: 'IP_SETTING_STATUS_CHANGED',
|
|
3246
3294
|
OrderCanceled: 'ORDER_CANCELED',
|
|
3247
3295
|
OrderCreated: 'ORDER_CREATED',
|
|
3296
|
+
OrderShipping: 'ORDER_SHIPPING',
|
|
3248
3297
|
OrderStatusChanged: 'ORDER_STATUS_CHANGED',
|
|
3249
3298
|
OrderUpdated: 'ORDER_UPDATED',
|
|
3250
3299
|
ShipmentCanceled: 'SHIPMENT_CANCELED',
|
|
@@ -3290,6 +3339,7 @@ export type CartCalculateLandedCostMutation = {
|
|
|
3290
3339
|
id: string;
|
|
3291
3340
|
imageUrl: string | null;
|
|
3292
3341
|
name: string | null;
|
|
3342
|
+
productId: string;
|
|
3293
3343
|
quantity: number;
|
|
3294
3344
|
restriction: { action: RestrictedItemAction; reason: string } | null;
|
|
3295
3345
|
sku: string | null;
|
|
@@ -3405,6 +3455,7 @@ export type CalculateLandedCostMutation = {
|
|
|
3405
3455
|
id: string;
|
|
3406
3456
|
imageUrl: string | null;
|
|
3407
3457
|
name: string | null;
|
|
3458
|
+
productId: string;
|
|
3408
3459
|
quantity: number;
|
|
3409
3460
|
restriction: { action: RestrictedItemAction; reason: string } | null;
|
|
3410
3461
|
sku: string | null;
|
|
@@ -3463,6 +3514,7 @@ export type CartItemFragmentFragment = {
|
|
|
3463
3514
|
id: string;
|
|
3464
3515
|
imageUrl: string | null;
|
|
3465
3516
|
name: string | null;
|
|
3517
|
+
productId: string;
|
|
3466
3518
|
quantity: number;
|
|
3467
3519
|
restriction: { action: RestrictedItemAction; reason: string } | null;
|
|
3468
3520
|
sku: string | null;
|
|
@@ -4161,7 +4213,7 @@ export type CartQuery = {
|
|
|
4161
4213
|
adjustments: Array<{
|
|
4162
4214
|
amount: number;
|
|
4163
4215
|
currencyCode: CurrencyCode;
|
|
4164
|
-
description: string;
|
|
4216
|
+
description: string | null;
|
|
4165
4217
|
productId: string | null;
|
|
4166
4218
|
sku: string | null;
|
|
4167
4219
|
type: CartAdjustmentType;
|
|
@@ -4204,7 +4256,7 @@ export type CartCreateMutation = {
|
|
|
4204
4256
|
adjustments: Array<{
|
|
4205
4257
|
amount: number;
|
|
4206
4258
|
currencyCode: CurrencyCode;
|
|
4207
|
-
description: string;
|
|
4259
|
+
description: string | null;
|
|
4208
4260
|
productId: string | null;
|
|
4209
4261
|
sku: string | null;
|
|
4210
4262
|
type: CartAdjustmentType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg color="var(--zonos-elements-
|
|
1
|
+
<svg color="var(--zonos-elements-gray-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--zonos-elements-gray-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e,a as n}from"./p-d4110fa4.js";import{s as o,c as t}from"./p-c0fc4490.js";export{c as checkoutHiddenBtnSelector,d as domesticRedirectedBtnSelector}from"./p-c0fc4490.js";const s=["jsdelivr","cdnjs","unpkg","vercel"],r="jsdelivr",i=e=>{const n=s.indexOf(e);return s[n+1]||null},l=()=>{const n=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||n)return null;const o=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),t="https://v1.3.120.js.zonos.com";if(!o&&(t.includes("test.")||t.includes("test-")))return t;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const s=`https://${o}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${s}' for loading elements script`,"warn"),fetch(s).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${s}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),s},u="https://js.stripe.com/v3",a=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,m="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let p=null;const w=Promise.resolve().then((()=>{return e=null,null!==p||(p=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(m),window.Stripe)o(window.Stripe);else try{let s=(()=>{const e=document.querySelectorAll(`script[src^="${u}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&a.test(o.src))return o}return null})();s&&e?console.warn(m):s||(s=(e=>{const o=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src=`${u}${o}`;const s=document.head||document.body;return s?(s.appendChild(t),t):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==s||s.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==s||s.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),p;var e}));let f=!1;var h;w.catch((e=>{f||console.warn(e)}));const v=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),y="https://v1.3.120.js.zonos.com",z=v||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.120",j="https://rsms.me",S="https://fonts.googleapis.com",g=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class ${}h=$,$.doneInit=!1,$.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),$.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),$._paypalMockResponse=null,$.isBigCommerce=!1,$.releaseDate="1730830410393",$.isLegacyCheckout=!1,$.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),$.isNpm=!0,$.zonosQaUrl=null,$.zonosQaUrlApi=null,$.version="v1.3.120",$.modeAlerted=!1,$.cartData=null,$.paypal=null,$.getCurrentTimestamp=()=>(new Date).getTime(),$.zonosController=null,$.init=async s=>{const{appearance:r,checkoutSettings:i,currencyConverter:c,helloSettings:d,onCountryChange:u,overrideCurrencyFormat:a,storeId:m,zonosApiKey:p}=s;if(h.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!h.doneInit){if(e(`====== ZONOS DEBUG MODE: on (${h.version}) ======`),h.zonosApiKey=p,h.storeId=m,h.isNpm){e("====== ZONOS LOADING FROM NPM ======");const t=l();if(t&&!window.isZonosPreview){e(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${t} ======`,"info");const n=document.createElement("script");return n.src=`${t}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=h.isNpm,window.Zonos.isBigCommerce=h.isBigCommerce,window.Zonos.isLegacyCheckout=h.isLegacyCheckout,window.Zonos.init(s)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${t}`)})),void(window.isZonosPreview=!0)}if(!p&&!h.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!h.cartData&&h.cartId){e("Initialize cart data");const t=await o(h.cartId);if(!t)return void n("Failed to get cart data");h.cartData=t.cartData,h.zonosApiKey=t.zonosApiKey}}if(h.cartId&&h.cartData){e("Cart data is available, inject hidden button and trigger checkout");const n=document.createElement("button");n.style.display="none",n.id=`${t}`,document.body.appendChild(n)}e("init zonos"),h.injectZonosCdn(),h.injectZonosCss(),h.injectFonts(),h.injectController({config:{appearance:r,checkoutSettings:i,currencyConverter:c,helloSettings:d,onCountryChange:u,overrideCurrencyFormat:a}}),h.doneInit=!0}},$.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},$.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},$.showNotification=e=>{var n;null===(n=h.zonosController)||void 0===n||n.showNotification(e)},$.updateOrganizationName=e=>{var n;null===(n=h.zonosController)||void 0===n||n.updateOrganizationName(e)},$.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},$.injectController=({config:o})=>{var t;if(document.querySelector("zonos-controller"))return;if(null===(t=o.checkoutSettings)||void 0===t?void 0:t.placeOrderButtonSelector){const e=o.checkoutSettings.placeOrderButtonSelector;h.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e}),new MutationObserver((()=>{h.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=o,s.zonosApiKey=h.zonosApiKey||"",s.addEventListener("stripeInitEvent",(async o=>{const{detail:t}=o;e("loading Stripe");const r=await(async(...e)=>{f=!0;const n=Date.now();return w.then((o=>((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(o,e,n)))})(t.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),h.zonosController=s,e("Zonos controller injected!")},$.injectScript=({cdnType:o,isModule:t,theRestUrl:s})=>{const r=`${h.getZonosUrl(o)}/${s}`;if(document.querySelector(`script[src="${r}"]`))return void e(`Zonos script "${r}" already exists in the document`,"warn");const c=document.head||document.body,l=document.createElement("script");t?l.type="module":l.noModule=!0,l.src=r,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const e=i(o);e&&h.injectScript({cdnType:e,isModule:t,theRestUrl:s})},c.appendChild(l)},$.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return z;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.120";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.120";case"vercel":return y}};return h.isNpm&&l()||n()},$.injectZonosCdn=()=>{h.injectScript({cdnType:r,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),h.injectScript({cdnType:r,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},$.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=h.getZonosUrl(e),s=document.head||document.body,r=document.createElement("link");r.rel="preconnect",r.href=`${y}/`,s.appendChild(r);const c=document.createElement("link");c.rel="stylesheet",c.href=`${t}/${o}`,c.onerror=()=>{n(`Failed to load ${c.href}`);const t=i(e);t&&h.injectStylesheet({cdnType:t,theRestUrl:o})},s.appendChild(c)},$.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(h.injectStylesheet({cdnType:r,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},$.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${j}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!g.test(o.href))return o}return null})())return void e("Inter font already injected","warn");const n=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=j,n.appendChild(o);const t=document.createElement("link");t.rel="stylesheet",t.href=`${j}/inter/inter.css`,n.appendChild(t),e("Zonos font injected!")},$.setupGoogleFont=e=>{var n;null===(n=h.zonosController)||void 0===n||n.setupGoogleFont(e)},$.injectSupportGoogleFont=n=>{var o;e(`[FONT] injecting ${n}`);const t=null===(o=n.match(/family=(.*?):/))||void 0===o?void 0:o[1],s=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${S}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=S,s.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${n}"]`))return void e(`[FONT] ${t} font already injected`,"warn");const r=document.createElement("link");r.rel="stylesheet",r.href=n,s.appendChild(r),e(`[FONT] ${t} font injected!`)};export{$ as Zonos}
|
|
1
|
+
import{l as e,a as n}from"./p-f3cdaa23.js";import{s as o,c as t}from"./p-8e317f73.js";export{c as checkoutHiddenBtnSelector,d as domesticRedirectedBtnSelector}from"./p-8e317f73.js";const s=["jsdelivr","cdnjs","unpkg","vercel"],r="jsdelivr",i=e=>{const n=s.indexOf(e);return s[n+1]||null},l=()=>{const n=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||n)return null;const o=(e=>{if(!e)return null;const n=new URL(e).searchParams.get("zonosQaUrl");return n?/[^a-zA-Z0-9-_]+/.test(n)?null:n:null})(window.location.href),t="https://v1.3.122.js.zonos.com";if(!o&&(t.includes("test.")||t.includes("test-")))return t;if(!o&&["dev.demo.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!o)return null;if("dev-elements"===o)return"https://dev.elements.zonos.com";const s=`https://${o}.preview.js.zonos.com`;return e(`[ZONOS-WARNING] using '${s}' for loading elements script`,"warn"),fetch(s).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${s}' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE`);const e=new URLSearchParams(window.location.search);e.delete("zonosQaUrl");const{pathname:n}=window.location,o=`${n}?${e.toString()}`;return window.history.replaceState(window.history.state,"",o),window.location.reload(),null})),s},a="https://js.stripe.com/v3",u=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,m="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let p=null;const w=Promise.resolve().then((()=>{return e=null,null!==p||(p=new Promise(((o,t)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(m),window.Stripe)o(window.Stripe);else try{let s=(()=>{const e=document.querySelectorAll(`script[src^="${a}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&u.test(o.src))return o}return null})();s&&e?console.warn(m):s||(s=(e=>{const o=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",t=document.createElement("script");t.src=`${a}${o}`;const s=document.head||document.body;return s?(s.appendChild(t),t):(n("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==s||s.addEventListener("load",(()=>{window.Stripe?o(window.Stripe):t(new Error("Stripe.js not available"))})),null==s||s.addEventListener("error",(()=>{t(new Error("Failed to load Stripe.js"))}))}catch(e){return void t(e)}else o(null)}))),p;var e}));let f=!1;var h;w.catch((e=>{f||console.warn(e)}));const v=(()=>{if("undefined"==typeof document)return null;const e=document.querySelector('script[src*="/zonos.js"]'),{currentLoadScriptUrl:n,isWhiteListed:o}=(({loadScriptSrc:e})=>{if(!e)return{currentLoadScriptUrl:"",isForceLoadVersionDomain:!1,isWhiteListed:!1};const n=new URL(e).origin,o=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"].some((e=>n.includes(e))),t=["qa.js.zonos.com"].some((e=>n.includes(e)));return{currentLoadScriptUrl:n,isForceLoadVersionDomain:t,isWhiteListed:o}})({loadScriptSrc:null==e?void 0:e.src});return o?n:null})(),y="https://v1.3.122.js.zonos.com",z=v||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.122",j="https://rsms.me",S="https://fonts.googleapis.com",g=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;class ${}h=$,$.doneInit=!1,$.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),$.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),$._paypalMockResponse=null,$.isBigCommerce=!1,$.releaseDate="1730912119121",$.isLegacyCheckout=!1,$.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),$.isNpm=!0,$.zonosQaUrl=null,$.zonosQaUrlApi=null,$.version="v1.3.122",$.modeAlerted=!1,$.cartData=null,$.paypal=null,$.getCurrentTimestamp=()=>(new Date).getTime(),$.zonosController=null,$.init=async s=>{const{appearance:r,checkoutSettings:i,currencyConverter:c,helloSettings:d,onCountryChange:a,overrideCurrencyFormat:u,storeId:m,zonosApiKey:p}=s;if(h.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),!h.doneInit){if(e(`====== ZONOS DEBUG MODE: on (${h.version}) ======`),h.zonosApiKey=p,h.storeId=m,h.isNpm){e("====== ZONOS LOADING FROM NPM ======");const t=l();if(t&&!window.isZonosPreview){e(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${t} ======`,"info");const n=document.createElement("script");return n.src=`${t}/dist/scripts/zonos.js`,document.head.appendChild(n),n.addEventListener("load",(()=>{window.Zonos.isNpm=h.isNpm,window.Zonos.isBigCommerce=h.isBigCommerce,window.Zonos.isLegacyCheckout=h.isLegacyCheckout,window.Zonos.init(s)})),n.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${t}`)})),void(window.isZonosPreview=!0)}if(!p&&!h.cartId)return void n("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!h.cartData&&h.cartId){e("Initialize cart data");const t=await o(h.cartId);if(!t)return void n("Failed to get cart data");h.cartData=t.cartData,h.zonosApiKey=t.zonosApiKey}}if(h.cartId&&h.cartData){e("Cart data is available, inject hidden button and trigger checkout");const n=document.createElement("button");n.style.display="none",n.id=`${t}`,document.body.appendChild(n)}e("init zonos"),h.injectZonosCdn(),h.injectZonosCss(),h.injectFonts(),h.injectController({config:{appearance:r,checkoutSettings:i,currencyConverter:c,helloSettings:d,onCountryChange:a,overrideCurrencyFormat:u}}),h.doneInit=!0}},$.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},$.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},$.showNotification=e=>{var n;null===(n=h.zonosController)||void 0===n||n.showNotification(e)},$.updateOrganizationName=e=>{var n;null===(n=h.zonosController)||void 0===n||n.updateOrganizationName(e)},$.disablePlaceOrderButtons=({autoEnable:e=!0,config:n,disable:o,placeOrderButtonSelector:t})=>{var s;if(!(null===(s=n.checkoutSettings)||void 0===s?void 0:s.disablePlaceOrderButtonActivation)&&t){const n=document.querySelectorAll(t),s=e=>{e.target.getAttribute("disabled")&&(e.preventDefault(),e.stopPropagation())};n.forEach((e=>{e.getAttribute("data-zonos-checkout-attached")||(o?(e.setAttribute("disabled","true"),e.addEventListener("click",s)):(e.removeAttribute("disabled"),e.removeEventListener("click",s)))})),e&&o&&setTimeout((()=>{n.forEach((e=>{e.removeAttribute("disabled"),e.removeEventListener("click",s)}))}),5e3)}},$.injectController=({config:o})=>{var t;if(document.querySelector("zonos-controller"))return;if(null===(t=o.checkoutSettings)||void 0===t?void 0:t.placeOrderButtonSelector){const e=o.checkoutSettings.placeOrderButtonSelector;h.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e}),new MutationObserver((()=>{h.disablePlaceOrderButtons({config:o,disable:!0,placeOrderButtonSelector:e})})).observe(document.body,{childList:!0,subtree:!0})}const s=document.createElement("zonos-controller");s.config=o,s.zonosApiKey=h.zonosApiKey||"",s.addEventListener("stripeInitEvent",(async o=>{const{detail:t}=o;e("loading Stripe");const r=await(async(...e)=>{f=!0;const n=Date.now();return w.then((o=>((e,n,o)=>{if(null===e)return null;const t=e.apply(void 0,n);return((e,n)=>{e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",startTime:n})})(t,o),t})(o,e,n)))})(t.publishableKey);r?(window.Zonos.stripe=r,s.initCheckoutElement(r)):n("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(s),h.zonosController=s,e("Zonos controller injected!")},$.injectScript=({cdnType:o,isModule:t,theRestUrl:s})=>{const r=`${h.getZonosUrl(o)}/${s}`;if(document.querySelector(`script[src="${r}"]`))return void e(`Zonos script "${r}" already exists in the document`,"warn");const c=document.head||document.body,l=document.createElement("script");t?l.type="module":l.noModule=!0,l.src=r,l.crossOrigin="anonymous",l.onerror=()=>{n(`Failed to load ${l.src}`);const e=i(o);e&&h.injectScript({cdnType:e,isModule:t,theRestUrl:s})},c.appendChild(l)},$.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return z;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.122";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.122";case"vercel":return y}};return h.isNpm&&l()||n()},$.injectZonosCdn=()=>{h.injectScript({cdnType:r,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),h.injectScript({cdnType:r,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),e("Zonos cdn script injected!")},$.injectStylesheet=({cdnType:e,theRestUrl:o})=>{const t=h.getZonosUrl(e),s=document.head||document.body,r=document.createElement("link");r.rel="preconnect",r.href=`${y}/`,s.appendChild(r);const c=document.createElement("link");c.rel="stylesheet",c.href=`${t}/${o}`,c.onerror=()=>{n(`Failed to load ${c.href}`);const t=i(e);t&&h.injectStylesheet({cdnType:t,theRestUrl:o})},s.appendChild(c)},$.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?e("Zonos style links already injected","warn"):(h.injectStylesheet({cdnType:r,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),e("Zonos style css injected!"))},$.injectFonts=()=>{if((()=>{const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${j}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!g.test(o.href))return o}return null})())return void e("Inter font already injected","warn");const n=document.head||document.body,o=document.createElement("link");o.rel="preconnect",o.href=j,n.appendChild(o);const t=document.createElement("link");t.rel="stylesheet",t.href=`${j}/inter/inter.css`,n.appendChild(t),e("Zonos font injected!")},$.setupGoogleFont=e=>{var n;null===(n=h.zonosController)||void 0===n||n.setupGoogleFont(e)},$.injectSupportGoogleFont=n=>{var o;e(`[FONT] injecting ${n}`);const t=null===(o=n.match(/family=(.*?):/))||void 0===o?void 0:o[1],s=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${S}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=S,s.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${n}"]`))return void e(`[FONT] ${t} font already injected`,"warn");const r=document.createElement("link");r.rel="stylesheet",r.href=n,s.appendChild(r),e(`[FONT] ${t} font injected!`)};export{$ as Zonos}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,n,e,o){function i(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,r){function u(t){try{a(o.next(t))}catch(t){r(t)}}function s(t){try{a(o["throw"](t))}catch(t){r(t)}}function a(t){t.done?e(t.value):i(t.value).then(u,s)}a((o=o.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(t){return function(n){return a([t,n])}}function a(s){if(o)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(e=0)),e)try{if(o=1,i&&(r=s[0]&2?i["return"]:s[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;if(i=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;i=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){e.label=s[1];break}if(s[0]===6&&e.label<r[1]){e.label=r[1];r=s;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(s);break}if(r[2])e.ops.pop();e.trys.pop();continue}s=n.call(t,e)}catch(t){s=[6,t];i=0}finally{o=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-acd4cf3c.system.js","./p-00dc1507.system.js","./p-6cbcdee3.system.js","./p-c3e98be6.system.js","./p-c85b4e43.system.js"],(function(t){"use strict";var n,e,o,i,r,u,s,a,c,f,d,l,h,v,w;return{setters:[function(t){n=t.r;e=t.c;o=t.h;i=t.H},function(t){r=t.A;u=t.j;s=t.B;a=t.d;c=t.a},function(t){f=t.z;d=t.b;l=t.d},function(t){h=t.h;v=t.a;w=t.l},function(){},function(){}],execute:function(){var m=this;var _=function(){return __awaiter(m,void 0,void 0,(function(){var t,n,e,o;return __generator(this,(function(i){switch(i.label){case 0:return[4,h("/api/zonos-elements/zonos-settings")];case 1:t=i.sent(),n=t.errors,e=t.json,o=t.zonosMode;if(n.length){v("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:n,json:null,zonosMode:o}]}return[2,{errors:[],json:e,zonosMode:o}]}}))}))};var b=function(){var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var p=function(t){if(!t.placeOrderButtonSelector&&!window.Zonos.cartData){return}if(t.placeOrderButtonSelector&&!r(t.placeOrderButtonSelector)){v('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}b()};var g=function(t){var n=document.querySelector(t);var e=document.querySelector("zonos-hello");if(!e&&n){var o=document.createElement("zonos-hello");n.appendChild(o);return true}return false};var y=function(t){switch(t){case"BOTTOM_RIGHT":return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right";default:return"bottom-right"}};var z=function(t){var n=t.position,e=n===void 0?"bottom-right":n;var o=".zonos--hello-mobile-wrapper";var i=document.querySelector(o);if(i){return o}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(e==="top-right"){r.style.top="72px";r.style.right="24px"}if(e==="top-left"){r.style.top="72px";r.style.left="24px"}if(e==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(e==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483007";document.body.appendChild(r);return o};var O=function(t){return __awaiter(m,void 0,void 0,(function(){var n,e,o,i,u;return __generator(this,(function(s){if(window.Zonos.isLegacyCheckout){w("Hello is disabled when isLegacyCheckout","info");return[2]}n=t.anchorElementSelector;e=n;if(!t.anchorElementSelector&&t.desktopLocation){o=z({position:"bottom-right"});e=o}if(!e||!r(e)){v('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}w("Hello init complete");i=g(e);if(!i){u=new MutationObserver((function(){var t=g(e);if(t){u.disconnect()}}));u.observe(document.body,{childList:true,subtree:true});setTimeout((function(){g(e)}),1e3);setTimeout((function(){if(t.notFoundElementFallback){w("Hello anchor selector ".concat(t.anchorElementSelector," not found after 3 seconds, falling back to 'notFoundElementFallback': ").concat(t.notFoundElementFallback),"info");var n=z({position:y(t.notFoundElementFallback)});g(n)}}),3e3)}return[2]}))}))};var j=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var I=j;var k=t("zonos_controller",function(){function t(t){n(this,t);this.paypalInitEvent=e(this,"paypalInitEvent",7);this.stripeInitEvent=e(this,"stripeInitEvent",7);this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){w("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}u.stripe=t;void p(f.checkoutSettings);w("init checkout element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,e,o,i,r,u,s,a;return __generator(this,(function(c){switch(c.label){case 0:o=t||l();if(o==="Inter"){if(!t){return[2]}w("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t})}i=new URLSearchParams;i.set("family",o);return[4,h("/api/zonos-elements/get-font-detail?".concat(i.toString()))];case 1:r=c.sent(),u=r.errors,s=r.json;if(u.length>0||!(s===null||s===void 0?void 0:s.fontUrl)){w("Failed to load font ".concat(o),"warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:"Inter"});return[2]}a=s.fontUrl;(e=(n=window.Zonos).injectSupportGoogleFont)===null||e===void 0?void 0:e.call(n,a);if(!t){return[2]}w("[FONT] ".concat(t," font override applied"));f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.handleLocationChange=function(){void O(f.helloSettings)};t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function n(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var n=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return n.apply(this,arguments)}};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();f.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,e,o,i,r,u,a,c;var l=this;return __generator(this,(function(h){switch(h.label){case 0:return[4,_()];case 1:e=h.sent(),o=e.errors,i=e.json,r=e.zonosMode;if(((t=o[0])===null||t===void 0?void 0:t.type.toString())==="403"){w("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.initZonosNotification();u=function(){var t,n,e;if(window.Zonos.isLegacyCheckout){return((t=i===null||i===void 0?void 0:i.appearanceSettings)===null||t===void 0?void 0:t.logoUrl)||((n=l.config.appearance)===null||n===void 0?void 0:n.logoUrl)}return(e=l.config.appearance)===null||e===void 0?void 0:e.logoUrl};a=Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:u()}),checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{subscriptionStatus:undefined}):undefined});d({overrideSettings:a,zonosSettings:i});f.zonosMode=r;void this.setupGoogleFont();if(f.helloSettings.visibilityStatus==="DISABLED"){w("=== Hello is disabled by store owner ===","warn")}if(f.helloSettings&&f.helloSettings.visibilityStatus==="ENABLED"){w("Initializing hello");void O(f.helloSettings)}return[4,s()];case 2:h.sent();c=((n=i===null||i===void 0?void 0:i.checkoutSettings)===null||n===void 0?void 0:n.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!c||!this.stripeInitEvent){w("Checkout failed to load -- missing publishable key","warn");return[2]}if(f.checkoutSettings.subscriptionStatus==="INACTIVE"){w('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");w("zonos controller loaded");return[2]}if(f.checkoutSettings.visibilityStatus==="DISABLED"){w("=== Checkout is disabled by store owner ===","warn");w("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:c.token});return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(e){n=document.querySelector("zonos-notification");if(!n){w("Failed to show notification - zonos-notification not found","warn");return[2]}void n.showNotification(t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){a.checkoutSessionId=null;u.clientSecret=null;return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){d({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){w("Override country code to ".concat(t));void c(t);return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,f.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){f.organizationName=t;return[2]}))}))};t.prototype.render=function(){return o(i,{key:"8e6c4a23893a1d3913d996a62bd14fd000612e42",class:"zonos--elements"})};return t}());k.style=I}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,n,e,o){function i(t){return t instanceof e?t:new e((function(n){n(t)}))}return new(e||(e=Promise))((function(e,r){function u(t){try{a(o.next(t))}catch(t){r(t)}}function s(t){try{a(o["throw"](t))}catch(t){r(t)}}function a(t){t.done?e(t.value):i(t.value).then(u,s)}a((o=o.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,i,r,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(t){return function(n){return a([t,n])}}function a(s){if(o)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(e=0)),e)try{if(o=1,i&&(r=s[0]&2?i["return"]:s[0]?i["throw"]||((r=i["return"])&&r.call(i),0):i.next)&&!(r=r.call(i,s[1])).done)return r;if(i=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:e.label++;return{value:s[1],done:false};case 5:e.label++;i=s[1];s=[0];continue;case 7:s=e.ops.pop();e.trys.pop();continue;default:if(!(r=e.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){e=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){e.label=s[1];break}if(s[0]===6&&e.label<r[1]){e.label=r[1];r=s;break}if(r&&e.label<r[2]){e.label=r[2];e.ops.push(s);break}if(r[2])e.ops.pop();e.trys.pop();continue}s=n.call(t,e)}catch(t){s=[6,t];i=0}finally{o=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-78887e65.system.js","./p-00dc1507.system.js","./p-81055154.system.js","./p-c3e98be6.system.js","./p-c85b4e43.system.js"],(function(t){"use strict";var n,e,o,i,r,u,s,a,c,f,d,l,h,v,w;return{setters:[function(t){n=t.r;e=t.c;o=t.h;i=t.H},function(t){r=t.A;u=t.j;s=t.B;a=t.d;c=t.a},function(t){f=t.z;d=t.b;l=t.d},function(t){h=t.h;v=t.a;w=t.l},function(){},function(){}],execute:function(){var m=this;var _=function(){return __awaiter(m,void 0,void 0,(function(){var t,n,e,o;return __generator(this,(function(i){switch(i.label){case 0:return[4,h("/api/zonos-elements/zonos-settings")];case 1:t=i.sent(),n=t.errors,e=t.json,o=t.zonosMode;if(n.length){v("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:n,json:null,zonosMode:o}]}return[2,{errors:[],json:e,zonosMode:o}]}}))}))};var p=function(){var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var b=function(t){if(!t.placeOrderButtonSelector&&!window.Zonos.cartData){return}if(t.placeOrderButtonSelector&&!r(t.placeOrderButtonSelector)){v('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}p()};var g=function(t){var n=document.querySelector(t);var e=document.querySelector("zonos-hello");if(!e&&n){var o=document.createElement("zonos-hello");n.appendChild(o);return true}return false};var y=function(t){switch(t){case"BOTTOM_RIGHT":return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right";default:return"bottom-right"}};var z=function(t){var n=t.position,e=n===void 0?"bottom-right":n;var o=".zonos--hello-mobile-wrapper";var i=document.querySelector(o);if(i){return o}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(e==="top-right"){r.style.top="72px";r.style.right="24px"}if(e==="top-left"){r.style.top="72px";r.style.left="24px"}if(e==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(e==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483007";document.body.appendChild(r);return o};var O=function(t){return __awaiter(m,void 0,void 0,(function(){var n,e,o,i,u;return __generator(this,(function(s){if(window.Zonos.isLegacyCheckout){w("Hello is disabled when isLegacyCheckout","info");return[2]}n=t.anchorElementSelector;e=n;if(!t.anchorElementSelector&&t.desktopLocation){o=z({position:"bottom-right"});e=o}if(!e||!r(e)){v('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}w("Hello init complete");i=g(e);if(!i){u=new MutationObserver((function(){var t=g(e);if(t){u.disconnect()}}));u.observe(document.body,{childList:true,subtree:true});setTimeout((function(){g(e)}),1e3);setTimeout((function(){if(t.notFoundElementFallback){w("Hello anchor selector ".concat(t.anchorElementSelector," not found after 3 seconds, falling back to 'notFoundElementFallback': ").concat(t.notFoundElementFallback),"info");var n=z({position:y(t.notFoundElementFallback)});g(n)}}),3e3)}return[2]}))}))};var j=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var I=j;var k=t("zonos_controller",function(){function t(t){n(this,t);this.paypalInitEvent=e(this,"paypalInitEvent",7);this.stripeInitEvent=e(this,"stripeInitEvent",7);this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){w("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}u.stripe=t;void b(f.checkoutSettings);w("init checkout element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,e,o,i,r,u,s,a;return __generator(this,(function(c){switch(c.label){case 0:o=t||l();if(o==="Inter"){if(!t){return[2]}w("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t})}i=new URLSearchParams;i.set("family",o);return[4,h("/api/zonos-elements/get-font-detail?".concat(i.toString()))];case 1:r=c.sent(),u=r.errors,s=r.json;if(u.length>0||!(s===null||s===void 0?void 0:s.fontUrl)){w("Failed to load font ".concat(o),"warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:"Inter"});return[2]}a=s.fontUrl;(e=(n=window.Zonos).injectSupportGoogleFont)===null||e===void 0?void 0:e.call(n,a);if(!t){return[2]}w("[FONT] ".concat(t," font override applied"));f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.handleLocationChange=function(){void O(f.helloSettings)};t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function n(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var n=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return n.apply(this,arguments)}};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();f.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,e,o,i,r,u,a,c;var l=this;return __generator(this,(function(h){switch(h.label){case 0:return[4,_()];case 1:e=h.sent(),o=e.errors,i=e.json,r=e.zonosMode;if(((t=o[0])===null||t===void 0?void 0:t.type.toString())==="403"){w("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.initZonosNotification();u=function(){var t,n,e;if(window.Zonos.isLegacyCheckout){return((t=i===null||i===void 0?void 0:i.appearanceSettings)===null||t===void 0?void 0:t.logoUrl)||((n=l.config.appearance)===null||n===void 0?void 0:n.logoUrl)}return(e=l.config.appearance)===null||e===void 0?void 0:e.logoUrl};a=Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:u()}),checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{subscriptionStatus:undefined}):undefined});d({overrideSettings:a,zonosSettings:i});f.zonosMode=r;void this.setupGoogleFont();if(f.helloSettings.visibilityStatus==="DISABLED"){w("=== Hello is disabled by store owner ===","warn")}if(f.helloSettings&&f.helloSettings.visibilityStatus==="ENABLED"){w("Initializing hello");void O(f.helloSettings)}return[4,s()];case 2:h.sent();c=((n=i===null||i===void 0?void 0:i.checkoutSettings)===null||n===void 0?void 0:n.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!c||!this.stripeInitEvent){w("Checkout failed to load -- missing publishable key","warn");return[2]}if(f.checkoutSettings.subscriptionStatus==="INACTIVE"){w('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");w("zonos controller loaded");return[2]}if(f.checkoutSettings.visibilityStatus==="DISABLED"){w("=== Checkout is disabled by store owner ===","warn");w("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:c.token});return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(e){n=document.querySelector("zonos-notification");if(!n){w("Failed to show notification - zonos-notification not found","warn");return[2]}void n.showNotification(t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){a.checkoutSessionId=null;u.clientSecret=null;return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){d({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){w("Override country code to ".concat(t));void c(t);return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,f.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){f.organizationName=t;return[2]}))}))};t.prototype.render=function(){return o(i,{key:"8e6c4a23893a1d3913d996a62bd14fd000612e42",class:"zonos--elements"})};return t}());k.style=I}}}));
|