@zonos/elements 1.3.202 → 1.3.203

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/cjs/{cart-637ba3d0.js → cart-0d91ad0b.js} +13 -1
  2. package/dist/cjs/index.cjs.js +7 -7
  3. package/dist/cjs/{paypal-0eceff03.js → paypal-9953115b.js} +1 -1
  4. package/dist/cjs/zonos-address_11.cjs.entry.js +1 -1
  5. package/dist/cjs/zonos-cart-items_14.cjs.entry.js +8 -4
  6. package/dist/cjs/zonos-checkout.cjs.entry.js +2 -2
  7. package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
  8. package/dist/cjs/zonos-empty-state-payment_4.cjs.entry.js +2 -2
  9. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +7 -3
  10. package/dist/collection/components/store/checkout/cart.js +13 -2
  11. package/dist/collection/types/generated/graphql.internal.types.js +14 -7
  12. package/dist/esm/{cart-b7c15b61.js → cart-db61eb95.js} +13 -2
  13. package/dist/esm/index.js +7 -7
  14. package/dist/esm/{paypal-932fd3dd.js → paypal-2e0ffb07.js} +1 -1
  15. package/dist/esm/zonos-address_11.entry.js +1 -1
  16. package/dist/esm/zonos-cart-items_14.entry.js +8 -4
  17. package/dist/esm/zonos-checkout.entry.js +2 -2
  18. package/dist/esm/zonos-controller.entry.js +1 -1
  19. package/dist/esm/zonos-empty-state-payment_4.entry.js +2 -2
  20. package/dist/esm-es5/{cart-b7c15b61.js → cart-db61eb95.js} +1 -1
  21. package/dist/esm-es5/index.js +1 -1
  22. package/dist/esm-es5/{paypal-932fd3dd.js → paypal-2e0ffb07.js} +1 -1
  23. package/dist/esm-es5/zonos-address_11.entry.js +1 -1
  24. package/dist/esm-es5/zonos-cart-items_14.entry.js +1 -1
  25. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  26. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  27. package/dist/esm-es5/zonos-empty-state-payment_4.entry.js +1 -1
  28. package/dist/scripts/index.d.ts +5 -1
  29. package/dist/scripts/index.js +1 -1
  30. package/dist/scripts/loadZonos.js +1 -1
  31. package/dist/scripts/zonos.js +1 -1
  32. package/dist/types/components/store/checkout/cart.d.ts +5 -1
  33. package/dist/types/types/generated/graphql.internal.types.d.ts +43 -22
  34. package/dist/types/types/generated/graphql.internal.types.ts +36 -19
  35. package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
  36. package/dist/zonos-elements/index.esm.js +1 -1
  37. package/dist/zonos-elements/{p-d2466fbd.system.js → p-0693422b.system.js} +1 -1
  38. package/dist/zonos-elements/{p-30cfa524.entry.js → p-06f25f75.entry.js} +1 -1
  39. package/dist/zonos-elements/{p-98b65387.entry.js → p-0c62cfb3.entry.js} +1 -1
  40. package/dist/zonos-elements/{p-6a52a2bc.system.entry.js → p-25970cb8.system.entry.js} +1 -1
  41. package/dist/zonos-elements/{p-c58acd4c.system.entry.js → p-2bb8ca7d.system.entry.js} +1 -1
  42. package/dist/zonos-elements/{p-bec2a3ce.entry.js → p-2f70d0eb.entry.js} +1 -1
  43. package/dist/zonos-elements/{p-2b8f787a.entry.js → p-411b8e10.entry.js} +1 -1
  44. package/dist/zonos-elements/{p-2af2eb6f.system.entry.js → p-54cdc47f.system.entry.js} +1 -1
  45. package/dist/zonos-elements/{p-32320d9a.system.js → p-6b6a9dd6.system.js} +1 -1
  46. package/dist/zonos-elements/{p-bc220d35.system.js → p-7cd09f1f.system.js} +1 -1
  47. package/dist/zonos-elements/{p-aae60057.js → p-a9307caa.js} +1 -1
  48. package/dist/zonos-elements/{p-d60ca44b.system.entry.js → p-cdd3087f.system.entry.js} +1 -1
  49. package/dist/zonos-elements/p-d2165441.system.entry.js +1 -0
  50. package/dist/zonos-elements/{p-db3968a2.js → p-d99d9e00.js} +1 -1
  51. package/dist/zonos-elements/p-dfd1ba1d.entry.js +1 -0
  52. package/dist/zonos-elements/p-ea6d87a1.system.js +1 -1
  53. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  54. package/package.json +1 -1
  55. package/dist/zonos-elements/p-0f77d087.system.entry.js +0 -1
  56. package/dist/zonos-elements/p-b52aba52.entry.js +0 -1
@@ -396,6 +396,13 @@ export const carrierApiSupportType = {
396
396
  export type CarrierApiSupportType =
397
397
  (typeof carrierApiSupportType)[keyof typeof carrierApiSupportType];
398
398
 
399
+ export const carrierBillingInvoiceCarrier = {
400
+ BroadReach: 'BROAD_REACH',
401
+ } as const;
402
+
403
+ export type CarrierBillingInvoiceCarrier =
404
+ (typeof carrierBillingInvoiceCarrier)[keyof typeof carrierBillingInvoiceCarrier];
405
+
399
406
  export const carrierBillingInvoiceFeeType = {
400
407
  RevShareAmount: 'REV_SHARE_AMOUNT',
401
408
  RevSharePercent: 'REV_SHARE_PERCENT',
@@ -2103,16 +2110,10 @@ export const incotermCode = {
2103
2110
 
2104
2111
  export type IncotermCode = (typeof incotermCode)[keyof typeof incotermCode];
2105
2112
  export const invoiceCarrier = {
2106
- Apc: 'APC',
2107
- Asendia: 'ASENDIA',
2108
- BoxC: 'BOX_C',
2109
- BroadReach: 'BROAD_REACH',
2110
2113
  Dhl: 'DHL',
2111
- DhlEcom: 'DHL_ECOM',
2112
- Epost: 'EPOST',
2113
2114
  Fedex: 'FEDEX',
2114
- Landmark: 'LANDMARK',
2115
2115
  Ups: 'UPS',
2116
+ Zonos: 'ZONOS',
2116
2117
  } as const;
2117
2118
 
2118
2119
  export type InvoiceCarrier =
@@ -2175,6 +2176,17 @@ export const invoiceStatus = {
2175
2176
  } as const;
2176
2177
 
2177
2178
  export type InvoiceStatus = (typeof invoiceStatus)[keyof typeof invoiceStatus];
2179
+ export const invoiceUploadStatus = {
2180
+ Error: 'ERROR',
2181
+ FailedReconciliation: 'FAILED_RECONCILIATION',
2182
+ PartiallyReconciled: 'PARTIALLY_RECONCILED',
2183
+ ProcessingReconciliation: 'PROCESSING_RECONCILIATION',
2184
+ Received: 'RECEIVED',
2185
+ Reconciled: 'RECONCILED',
2186
+ } as const;
2187
+
2188
+ export type InvoiceUploadStatus =
2189
+ (typeof invoiceUploadStatus)[keyof typeof invoiceUploadStatus];
2178
2190
  export const itemAmountTargetType = {
2179
2191
  BillingCompany: 'BILLING_COMPANY',
2180
2192
  ItemProvided: 'ITEM_PROVIDED',
@@ -3556,6 +3568,8 @@ export const storeFeeRuleDetailCategoryIdCreateType = {
3556
3568
  DdpServiceFee: 'DDP_SERVICE_FEE',
3557
3569
  DutyBuffer: 'DUTY_BUFFER',
3558
3570
  DutyTaxBuffer: 'DUTY_TAX_BUFFER',
3571
+ LandedCostGuaranteeBuffer: 'LANDED_COST_GUARANTEE_BUFFER',
3572
+ LandedCostGuaranteeSubsidy: 'LANDED_COST_GUARANTEE_SUBSIDY',
3559
3573
  MagentoCrossDockingBuffer: 'MAGENTO_CROSS_DOCKING_BUFFER',
3560
3574
  MagentoGuaranteeOrder: 'MAGENTO_GUARANTEE_ORDER',
3561
3575
  MagentoGuaranteePercent: 'MAGENTO_GUARANTEE_PERCENT',
@@ -4197,17 +4211,6 @@ export type CartCalculateLandedCostMutation = {
4197
4211
  landedCostTotal: number;
4198
4212
  shipping: number;
4199
4213
  } | null;
4200
- landedCostGuaranteeCode: LandedCostGuaranteeCode;
4201
- deMinimis: Array<{
4202
- formula: string;
4203
- threshold: DeMinimisThreshold;
4204
- method: IncotermCode;
4205
- note: string;
4206
- type: DeMinimisType;
4207
- }>;
4208
- duties: Array<{ amount: number; currencyCode: CurrencyCode }>;
4209
- fees: Array<{ amount: number; currencyCode: CurrencyCode }>;
4210
- id: string;
4211
4214
  appliedAdjustments: Array<{
4212
4215
  adjustment: {
4213
4216
  name: string | null;
@@ -4217,7 +4220,19 @@ export type CartCalculateLandedCostMutation = {
4217
4220
  item: { amount: number } | null;
4218
4221
  type: LandedCostAdjustmentType | null;
4219
4222
  }> | null;
4223
+ deMinimis: Array<{
4224
+ formula: string;
4225
+ threshold: DeMinimisThreshold;
4226
+ method: IncotermCode;
4227
+ note: string;
4228
+ type: DeMinimisType;
4229
+ }>;
4230
+ remittance: Array<{ amount: number; description: string }>;
4231
+ fees: Array<{ amount: number; currencyCode: CurrencyCode }>;
4232
+ id: string;
4233
+ landedCostGuaranteeCode: LandedCostGuaranteeCode;
4220
4234
  method: IncotermCode;
4235
+ duties: Array<{ amount: number; currencyCode: CurrencyCode }>;
4221
4236
  shipmentRating: { id: string };
4222
4237
  taxes: Array<{ amount: number; currencyCode: CurrencyCode }>;
4223
4238
  } | null> | null;
@@ -4303,8 +4318,8 @@ export type CalculateLandedCostMutation = {
4303
4318
  deMinimis: Array<{
4304
4319
  formula: string;
4305
4320
  method: IncotermCode;
4306
- threshold: DeMinimisThreshold;
4307
4321
  note: string;
4322
+ threshold: DeMinimisThreshold;
4308
4323
  type: DeMinimisType;
4309
4324
  }>;
4310
4325
  duties: Array<{ amount: number; currencyCode: CurrencyCode }>;
@@ -4312,6 +4327,7 @@ export type CalculateLandedCostMutation = {
4312
4327
  id: string;
4313
4328
  landedCostGuaranteeCode: LandedCostGuaranteeCode;
4314
4329
  method: IncotermCode;
4330
+ remittance: Array<{ amount: number; description: string }>;
4315
4331
  shipmentRating: { id: string };
4316
4332
  taxes: Array<{ amount: number; currencyCode: CurrencyCode }>;
4317
4333
  } | null> | null;
@@ -4396,6 +4412,7 @@ export type LandedCostFragment = {
4396
4412
  id: string;
4397
4413
  landedCostGuaranteeCode: LandedCostGuaranteeCode;
4398
4414
  method: IncotermCode;
4415
+ remittance: Array<{ amount: number; description: string }>;
4399
4416
  shipmentRating: { id: string };
4400
4417
  taxes: Array<{ amount: number; currencyCode: CurrencyCode }>;
4401
4418
  };
@@ -1 +1 @@
1
- <svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>
1
+ <svg color="var(--zonos-elements-red-800)" fill="none" height="24" viewBox="0 0 24 24" width="24" xmlns="https://www.w3.org/2000/svg"><path clip-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Z" data-is-secondary-color="true" fill="var(--zonos-elements-red-200)" fill-rule="evenodd"></path><path clip-rule="evenodd" d="M8.293 8.293a1 1 0 0 1 1.414 0L12 10.586l2.293-2.293a1 1 0 1 1 1.414 1.414L13.414 12l2.293 2.293a1 1 0 0 1-1.414 1.414L12 13.414l-2.293 2.293a1 1 0 0 1-1.414-1.414L10.586 12 8.293 9.707a1 1 0 0 1 0-1.414Z" fill="currentColor" fill-rule="evenodd"></path></svg>g>
@@ -1 +1 @@
1
- import{c as n}from"./p-595f5dd2.js";import{g as o,I as t}from"./p-e7b0c156.js";import{g as r,a as i,l,h as u,b as m}from"./p-0fc02cde.js";import{_ as p,c as w,a as f}from"./p-3f1a2d31.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./p-3f1a2d31.js";export{a as availableTestKeys}from"./p-04a01cb1.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./p-6b361d2b.js";const h=["jsdelivr","cdnjs","unpkg","vercel"],y="jsdelivr",v=e=>{const n=h.indexOf(e);return h[n+1]||null},g=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(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),o="https://v1.3.202.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const t=`https://${n}.preview.js.zonos.com`;return l(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' 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})),t},S="https://js.stripe.com/v3",z=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,j="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let O=null;const b=Promise.resolve().then((()=>{return e=null,null!==O||(O=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(j),window.Stripe)n(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${S}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&z.test(o.src))return o}return null})();t&&e?console.warn(j):t||(t=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${S}${n}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(m("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==t||t.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):o(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else n(null)}))),O;var e}));let k=!1;b.catch((e=>{k||console.warn(e)}));const $=async({cartId:e,retries:n})=>{const t=r(),s=o(),i=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&i.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:c,json:d,zonosMode:a}=await u(`/api/zonos-elements/get-cart?${i.toString()}`,{body:{isTestMode:t,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),m=!d||c.length;return m&&n?(l("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:n}),await new Promise((e=>setTimeout(e,500))),$({cartId:e,retries:n-1})):m?null:Object.assign(Object.assign({},d),{zonosMode:a})};var I;const Z=(()=>{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})(),L="https://v1.3.202.js.zonos.com",N=Z||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.202",U="https://fonts.googleapis.com",R=/^https:\/\/fonts\.googleapis\.com/;class T{}I=T,T.doneInit=!1,T.cartSettings=null,T.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),T.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),T._paypalMockResponse=null,T.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,T.isBigCommerce=!1,T.releaseDate="1747155347116",T.isLegacyCheckout=!1,T.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",T.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),T.overrideUseCustomAddressForm=!1,T.isNpm=!0,T.zonosQaUrl=null,T.zonosQaUrlApi=null,T.trackEventLogs=[],T.version="v1.3.202",T.modeAlerted=!1,T.cartData=null,T.paypal=null,T.zonosMode=null,T.IframeService=t,T.getCurrentTimestamp=()=>(new Date).getTime(),T.zonosController=null,T.loadTimeApiInfoList=[],T.logIntervalId=null,T.init=async e=>{const{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d,storeId:a,zonosApiKey:f}=e;if(I.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),I.doneInit)return;if(l(`====== ZONOS DEBUG MODE: on (${I.version}) ======`),I.zonosApiKey=f,I.storeId=a,I.isNpm){l("====== ZONOS LOADING FROM NPM ======");const n=g();if(n&&!window.isZonosPreview){l(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${n} ======`,"info");const o=document.createElement("script");return o.src=`${n}/dist/scripts/zonos.js`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=I.isNpm,window.Zonos.isBigCommerce=I.isBigCommerce,window.Zonos.isLegacyCheckout=I.isLegacyCheckout,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${n}`)})),void(window.isZonosPreview=!0)}if(!f&&!I.cartId)return void m("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!I.cartData&&I.cartId){l("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=p(e);if(!o&&!n)return m("[ZONOS - loadZonos] invalid cart id"),null;const t=await $({cartId:e,retries:5});return l("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(m("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(I.cartId);if(!e)return void m("Failed to get cart data");I.cartData=e.cartData,I.zonosApiKey=e.zonosApiKey,I.cartSettings=e.settings}const o=await(async()=>{const e=r(),n=i();if(!e&&!n||!window.Zonos.zonosApiKey)return null;if(l("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return l("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:o,json:t}=await u("/api/get-test-public-credential");if(o.length||!t)return m("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o),null;const s=t.publicCredential;return s?(l(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(m("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();o&&(I.zonosApiKey=o)}const h=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(I.cartId&&I.cartData||h){l("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${w}`,document.body.appendChild(e)}l("init zonos"),I.restoreNativeBrowserFunctions(),I.injectCustomScriptForHostedCheckout(),I.injectZonosCdn(),I.injectZonosCss(),I.injectFonts(),I.injectCheckoutInternationalButton(),I.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d}}),I.doneInit=!0},T.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${f}`)){const e=document.createElement("button");e.id=f,e.style.display="none",document.body.appendChild(e)}},T.injectCustomScriptForHostedCheckout=()=>{const e=I.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),t=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||t)){if(o){l("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(t){l("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else l("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},T.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},T.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${f}`);setTimeout((()=>{e&&e.dispatchEvent(n("click"))}),10)},T.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},T.showNotification=e=>{var n;null===(n=I.zonosController)||void 0===n||n.showNotification(e)},T.updateOrganizationName=e=>{var n;null===(n=I.zonosController)||void 0===n||n.updateOrganizationName(e)},T.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)}},T.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let o=document.querySelector(`iframe#${n}`);o||(o=document.createElement("iframe"),o.id=n,o.style.display="none",o.style.opacity="0",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.width="1px",o.style.height="1px",o.style.border="none",o.style.overflow="hidden",o.style.visibility="hidden",document.body.appendChild(o));const t=(null===(e=o.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(o)},T.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;I.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{I.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;I.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{I.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=I.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;l("loading Stripe");const o=await(async(...e)=>{k=!0;const n=Date.now();return b.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)))})(n.publishableKey);o?(window.Zonos.stripe=o,t.initCheckoutElement(o)):m("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),I.zonosController=t,l("Zonos controller injected!")},T.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const t=`${I.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${t}"]`))return void l(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,r=document.createElement("script");n?r.type="module":r.noModule=!0,r.src=t,r.crossOrigin="anonymous",r.onerror=()=>{m(`Failed to load ${r.src}`);const t=v(e);t&&I.injectScript({cdnType:t,isModule:n,theRestUrl:o})},s.appendChild(r)},T.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return N;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.202";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.202";case"vercel":return L}};return I.isNpm&&g()||n()},T.injectZonosCdn=()=>{I.injectScript({cdnType:y,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),I.injectScript({cdnType:y,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),l("Zonos cdn script injected!")},T.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const o=I.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${L}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${o}/${n}`,r.onerror=()=>{m(`Failed to load ${r.href}`);const o=v(e);o&&I.injectStylesheet({cdnType:o,theRestUrl:n})},t.appendChild(r)},T.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?l("Zonos style links already injected","warn"):(I.injectStylesheet({cdnType:y,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),l("Zonos style css injected!"))},T.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void l("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${U}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!R.test(o.href))return o}return null})())return void l("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=U,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${U}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),l("Zonos font injected!")},T.setupGoogleFont=e=>{var n;null===(n=I.zonosController)||void 0===n||n.setupGoogleFont(e)},T.injectSupportGoogleFont=e=>{var n;l(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${U}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=U,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void l(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),l(`[FONT] ${o} font injected!`)};export{T as Zonos}
1
+ import{c as n}from"./p-595f5dd2.js";import{g as o,I as t}from"./p-e7b0c156.js";import{g as r,a as i,l,h as u,b as m}from"./p-0fc02cde.js";import{_ as p,c as w,a as f}from"./p-3f1a2d31.js";export{c as checkoutHiddenBtnSelector,a as checkoutHiddenInternationalBtnSelector,d as domesticRedirectedBtnSelector}from"./p-3f1a2d31.js";export{a as availableTestKeys}from"./p-04a01cb1.js";export{c as countryRequireTaxId,e as euCountryCodes,s as shipToTaxIdLabels}from"./p-6b361d2b.js";const h=["jsdelivr","cdnjs","unpkg","vercel"],y="jsdelivr",v=e=>{const n=h.indexOf(e);return h[n+1]||null},g=()=>{const e=window&&window.location.href.includes("forceLoadCdn");if("undefined"==typeof window||e)return null;const n=(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),o="https://v1.3.203.js.zonos.com";if(!n&&(o.includes("test.")||o.includes("test-")))return o;if(!n&&["dev.demo.elements.zonos.com","dev.checkout.elements.zonos.com"].includes(window.location.hostname))return"https://dev.elements.zonos.com";if(!n)return null;if("dev-elements"===n)return"https://dev.elements.zonos.com";const t=`https://${n}.preview.js.zonos.com`;return l(`[ZONOS-WARNING] using '${t}' for loading elements script`,"warn"),fetch(t).then((()=>{window.sessionStorage.removeItem("zonos--checkout-session-id"),window.sessionStorage.removeItem("zonos--client-secret")})).catch((()=>{alert(`[ZONOS-WARNING] '${t}' 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})),t},S="https://js.stripe.com/v3",z=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,j="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";let O=null;const b=Promise.resolve().then((()=>{return e=null,null!==O||(O=new Promise(((n,o)=>{if("undefined"!=typeof window&&"undefined"!=typeof document)if(window.Stripe&&e&&console.warn(j),window.Stripe)n(window.Stripe);else try{let t=(()=>{const e=document.querySelectorAll(`script[src^="${S}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&z.test(o.src))return o}return null})();t&&e?console.warn(j):t||(t=(e=>{const n=e&&!e.advancedFraudSignals?"?advancedFraudSignals=false":"",o=document.createElement("script");o.src=`${S}${n}`;const t=document.head||document.body;return t?(t.appendChild(o),o):(m("Expected document.body not to be null. Stripe.js requires a <body> element."),null)})(e)),null==t||t.addEventListener("load",(()=>{window.Stripe?n(window.Stripe):o(new Error("Stripe.js not available"))})),null==t||t.addEventListener("error",(()=>{o(new Error("Failed to load Stripe.js"))}))}catch(e){return void o(e)}else n(null)}))),O;var e}));let k=!1;b.catch((e=>{k||console.warn(e)}));const $=async({cartId:e,retries:n})=>{const t=r(),s=o(),i=new URLSearchParams;s.overrideShouldEnabledCustomAddress&&i.set("overrideShouldEnabledCustomAddress",s.overrideShouldEnabledCustomAddress);const{errors:c,json:d,zonosMode:a}=await u(`/api/zonos-elements/get-cart?${i.toString()}`,{body:{isTestMode:t,tempCartUUID:e},headers:{"Content-Type":"application/json"},method:"POST"}),m=!d||c.length;return m&&n?(l("[ZONOS - loadZonos] temp cart not ready, retrying in 1 second","info",{retries:n}),await new Promise((e=>setTimeout(e,500))),$({cartId:e,retries:n-1})):m?null:Object.assign(Object.assign({},d),{zonosMode:a})};var I;const Z=(()=>{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})(),L="https://v1.3.203.js.zonos.com",N=Z||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.203",U="https://fonts.googleapis.com",R=/^https:\/\/fonts\.googleapis\.com/;class T{}I=T,T.doneInit=!1,T.cartSettings=null,T.debug="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/),T.zonosConversionTest="undefined"!=typeof window&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/),T._paypalMockResponse=null,T.iframeLogType="undefined"!=typeof window?new URLSearchParams(window.location.search).get("iframeLogType"):null,T.isBigCommerce=!1,T.releaseDate="1747253461839",T.isLegacyCheckout=!1,T.domain="undefined"!=typeof window?window.location!=window.parent.location&&document.referrer||document.location.hostname:"",T.showBaseForeign="undefined"!=typeof window&&window.location.search.includes("zonosShowBaseForeign"),T.overrideUseCustomAddressForm=!1,T.isNpm=!0,T.zonosQaUrl=null,T.zonosQaUrlApi=null,T.trackEventLogs=[],T.version="v1.3.203",T.modeAlerted=!1,T.cartData=null,T.paypal=null,T.zonosMode=null,T.IframeService=t,T.getCurrentTimestamp=()=>(new Date).getTime(),T.zonosController=null,T.loadTimeApiInfoList=[],T.logIntervalId=null,T.init=async e=>{const{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d,storeId:a,zonosApiKey:f}=e;if(I.cartId=new URLSearchParams(window.location.search).get("tempCartUUID"),I.doneInit)return;if(l(`====== ZONOS DEBUG MODE: on (${I.version}) ======`),I.zonosApiKey=f,I.storeId=a,I.isNpm){l("====== ZONOS LOADING FROM NPM ======");const n=g();if(n&&!window.isZonosPreview){l(`====== RE-INJECT "zonos.js" FROM PRVIEW: ${n} ======`,"info");const o=document.createElement("script");return o.src=`${n}/dist/scripts/zonos.js`,document.head.appendChild(o),o.addEventListener("load",(()=>{window.Zonos.isNpm=I.isNpm,window.Zonos.isBigCommerce=I.isBigCommerce,window.Zonos.isLegacyCheckout=I.isLegacyCheckout,window.Zonos.init(e)})),o.addEventListener("error",(()=>{alert(`[ZONOS - loadZonos] Failed to load "loadZonos.js" from zonosQaUrl: ${n}`)})),void(window.isZonosPreview=!0)}if(!f&&!I.cartId)return void m("Zonos API key is required unless `tempCartUUID` is provided in url query params.");if(!I.cartData&&I.cartId){l("Initialize cart data");const e=await(async e=>{const{isDgsCartId:n,isLegacyCartId:o}=p(e);if(!o&&!n)return m("[ZONOS - loadZonos] invalid cart id"),null;const t=await $({cartId:e,retries:5});return l("[ZONOS - loadZonos] getting temp cart data","info",t),t?(window.Zonos.storeId=t.cartData.storeId,window.Zonos.zonosApiKey=t.cartData.credentialToken,window.Zonos.zonosMode=t.zonosMode,{cartData:t.cartData,settings:t.settings,storeFavicon:t.storeFaviconUrl,storeId:t.cartData.storeId,storeLogo:t.storeLogoUrl,zonosApiKey:t.cartData.credentialToken}):(m("[ZONOS - loadZonos] Error getting temp cart data, stop checkout process."),null)})(I.cartId);if(!e)return void m("Failed to get cart data");I.cartData=e.cartData,I.zonosApiKey=e.zonosApiKey,I.cartSettings=e.settings}const o=await(async()=>{const e=r(),n=i();if(!e&&!n||!window.Zonos.zonosApiKey)return null;if(l("[ZONOS - loadZonos] Attempt test public credential","info"),window.Zonos.zonosApiKey.includes("credential_test"))return l("[ZONOS - loadZonos] Test mode is enabled but the API key is already a test key","info"),null;const{errors:o,json:t}=await u("/api/get-test-public-credential");if(o.length||!t)return m("[ZONOS - loadZonos] Failed to get test public credential. Keep using production key",o),null;const s=t.publicCredential;return s?(l(`[ZONOS - loadZonos] Retrieve new test public token ${s}`,"info"),s):(m("[ZONOS - loadZonos] No test public key credential. Keep using production key"),null)})();o&&(I.zonosApiKey=o)}const h=new URL(window.location.href).searchParams.get("payment_intent_client_secret")||sessionStorage.getItem("zonos--client-secret");if(I.cartId&&I.cartData||h){l("Cart data or stripe client secret is available, inject hidden button and trigger checkout");const e=document.createElement("button");e.style.display="none",e.id=`${w}`,document.body.appendChild(e)}l("init zonos"),I.restoreNativeBrowserFunctions(),I.injectCustomScriptForHostedCheckout(),I.injectZonosCdn(),I.injectZonosCss(),I.injectFonts(),I.injectCheckoutInternationalButton(),I.injectController({config:{appearance:n,checkoutSettings:o,currencyConverter:t,helloSettings:s,onCountryChange:c,overrideCurrencyFormat:d}}),I.doneInit=!0},T.injectCheckoutInternationalButton=()=>{if(!document.querySelector(`#${f}`)){const e=document.createElement("button");e.id=f,e.style.display="none",document.body.appendChild(e)}},T.injectCustomScriptForHostedCheckout=()=>{const e=I.cartData,n=(null==e?void 0:e.metadata)||[],o=n.find((e=>"customHeaderScript"===e.key)),t=n.find((e=>"customFooterScript"===e.key));if(window.Zonos.isLegacyCheckout&&(o||t)){if(o){l("Injecting custom header script");const e=document.createElement("script");e.textContent=o.value,document.head.appendChild(e)}if(t){l("Injecting custom footer script");const e=document.createElement("script");e.textContent=t.value,document.body.appendChild(e)}}else l("Skip injecting custom script for hosted checkout","info",{footerScript:t,headerScript:o,isLegacyCheckout:window.Zonos.isLegacyCheckout})},T.displayCurrency=()=>{const e=document.querySelector("zonos-hello");e&&e.displayCurrency()},T.triggerCheckoutInternational=async()=>{const e=document.querySelector(`#${f}`);setTimeout((()=>{e&&e.dispatchEvent(n("click"))}),10)},T.openHelloDialog=e=>{const n=document.querySelector("zonos-hello");n&&n.openHelloDialog(null==e||e)},T.showNotification=e=>{var n;null===(n=I.zonosController)||void 0===n||n.showNotification(e)},T.updateOrganizationName=e=>{var n;null===(n=I.zonosController)||void 0===n||n.updateOrganizationName(e)},T.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)}},T.restoreNativeBrowserFunctions=()=>{var e;if("1"===new URL(window.location.href).searchParams.get("useMerchantPolyfill"))return;const n="zonos---native-browser";let o=document.querySelector(`iframe#${n}`);o||(o=document.createElement("iframe"),o.id=n,o.style.display="none",o.style.opacity="0",o.style.position="absolute",o.style.top="-9999px",o.style.left="-9999px",o.style.width="1px",o.style.height="1px",o.style.border="none",o.style.overflow="hidden",o.style.visibility="hidden",document.body.appendChild(o));const t=(null===(e=o.contentWindow)||void 0===e?void 0:e.window.Array.from)||Array.from;Array.from=t,document.body.removeChild(o)},T.injectController=({config:e})=>{var n,o;if(document.querySelector("zonos-controller"))return;if(null===(n=e.checkoutSettings)||void 0===n?void 0:n.placeOrderButtonSelector){const n=e.checkoutSettings.placeOrderButtonSelector;I.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{I.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}if(null===(o=e.checkoutSettings)||void 0===o?void 0:o.alwaysTriggerInternationalCheckoutSelector){const n=e.checkoutSettings.alwaysTriggerInternationalCheckoutSelector;I.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n}),new MutationObserver((()=>{I.disablePlaceOrderButtons({config:e,disable:!0,placeOrderButtonSelector:n})})).observe(document.body,{childList:!0,subtree:!0})}const t=document.createElement("zonos-controller");t.config=e,t.zonosApiKey=I.zonosApiKey||"",t.addEventListener("stripeInitEvent",(async e=>{const{detail:n}=e;l("loading Stripe");const o=await(async(...e)=>{k=!0;const n=Date.now();return b.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)))})(n.publishableKey);o?(window.Zonos.stripe=o,t.initCheckoutElement(o)):m("API seems to be invalid or missing. Failed to load Stripe")})),document.body.appendChild(t),I.zonosController=t,l("Zonos controller injected!")},T.injectScript=({cdnType:e,isModule:n,theRestUrl:o})=>{const t=`${I.getZonosUrl(e)}/${o}`;if(document.querySelector(`script[src="${t}"]`))return void l(`Zonos script "${t}" already exists in the document`,"warn");const s=document.head||document.body,r=document.createElement("script");n?r.type="module":r.noModule=!0,r.src=t,r.crossOrigin="anonymous",r.onerror=()=>{m(`Failed to load ${r.src}`);const t=v(e);t&&I.injectScript({cdnType:t,isModule:n,theRestUrl:o})},s.appendChild(r)},T.getZonosUrl=e=>{const n=()=>{switch(e){case"jsdelivr":return N;case"unpkg":return"https://unpkg.com/@zonos/elements@1.3.203";case"cdnjs":return"https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.203";case"vercel":return L}};return I.isNpm&&g()||n()},T.injectZonosCdn=()=>{I.injectScript({cdnType:y,isModule:!0,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"}),I.injectScript({cdnType:y,isModule:!1,theRestUrl:"dist/zonos-elements/zonos-elements.js"}),l("Zonos cdn script injected!")},T.injectStylesheet=({cdnType:e,theRestUrl:n})=>{const o=I.getZonosUrl(e),t=document.head||document.body,s=document.createElement("link");s.rel="preconnect",s.href=`${L}/`,t.appendChild(s);const r=document.createElement("link");r.rel="stylesheet",r.href=`${o}/${n}`,r.onerror=()=>{m(`Failed to load ${r.href}`);const o=v(e);o&&I.injectStylesheet({cdnType:o,theRestUrl:n})},t.appendChild(r)},T.injectZonosCss=()=>{document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')?l("Zonos style links already injected","warn"):(I.injectStylesheet({cdnType:y,theRestUrl:"dist/zonos-elements/zonos-elements.css"}),l("Zonos style css injected!"))},T.injectFonts=()=>{if((()=>{if(document.fonts.check("1em Inter"))return void l("Inter font already loaded","warn");const e=document.querySelectorAll(`link[rel="stylesheet"][href^="${U}"]`);for(let n=0;n<e.length;n++){const o=e[n];if(o&&!R.test(o.href))return o}return null})())return void l("Inter font already injected","warn");const e=document.head||document.body,n=document.createElement("link");n.rel="preconnect",n.href=U,e.appendChild(n);const o=document.createElement("link");o.rel="stylesheet",o.href=`${U}/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap`,e.appendChild(o),l("Zonos font injected!")},T.setupGoogleFont=e=>{var n;null===(n=I.zonosController)||void 0===n||n.setupGoogleFont(e)},T.injectSupportGoogleFont=e=>{var n;l(`[FONT] injecting ${e}`);const o=null===(n=e.match(/family=(.*?):/))||void 0===n?void 0:n[1],t=document.head||document.body;if(!document.querySelector(`link[rel="preconnect"][href^="${U}"]`)){const e=document.createElement("link");e.rel="preconnect",e.href=U,t.appendChild(e)}if(document.querySelector(`link[rel="stylesheet"][href="${e}"]`))return void l(`[FONT] ${o} font already injected`,"warn");const s=document.createElement("link");s.rel="stylesheet",s.href=e,t.appendChild(s),l(`[FONT] ${o} font injected!`)};export{T as Zonos}
@@ -1,4 +1,4 @@
1
- var __awaiter=this&&this.__awaiter||function(n,r,e,t){function o(n){return n instanceof e?n:new e((function(r){r(n)}))}return new(e||(e=Promise))((function(e,i){function a(n){try{c(t.next(n))}catch(n){i(n)}}function u(n){try{c(t["throw"](n))}catch(n){i(n)}}function c(n){n.done?e(n.value):o(n.value).then(a,u)}c((t=t.apply(n,r||[])).next())}))};var __generator=this&&this.__generator||function(n,r){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,o,i,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(n){return function(r){return c([n,r])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(e=0)),e)try{if(t=1,o&&(i=u[0]&2?o["return"]:u[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;if(o=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;o=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1];i=u;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(u);break}if(i[2])e.ops.pop();e.trys.pop();continue}u=r.call(n,e)}catch(n){u=[6,n];o=0}finally{t=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-cb823c4d.system.js","./p-32320d9a.system.js","./p-5d0f7364.system.js","./p-1b75aa35.system.js","./p-c50b3100.system.js"],(function(n){"use strict";var r,e,t,o,i,a,u,c,s,l,d,f,v,p,h,w;return{setters:[function(n){r=n.z;e=n.c},function(n){t=n.t;o=n.z;i=n.d;a=n.e;u=n.v;c=n.r;s=n.j},function(n){l=n.t;d=n.s},function(n){f=n.h;v=n.l;p=n.b;h=n.j},function(n){w=n.t}],execute:function(){var y=this;
1
+ var __awaiter=this&&this.__awaiter||function(n,r,e,t){function o(n){return n instanceof e?n:new e((function(r){r(n)}))}return new(e||(e=Promise))((function(e,i){function a(n){try{c(t.next(n))}catch(n){i(n)}}function u(n){try{c(t["throw"](n))}catch(n){i(n)}}function c(n){n.done?e(n.value):o(n.value).then(a,u)}c((t=t.apply(n,r||[])).next())}))};var __generator=this&&this.__generator||function(n,r){var e={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},t,o,i,a;return a={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(a[Symbol.iterator]=function(){return this}),a;function u(n){return function(r){return c([n,r])}}function c(u){if(t)throw new TypeError("Generator is already executing.");while(a&&(a=0,u[0]&&(e=0)),e)try{if(t=1,o&&(i=u[0]&2?o["return"]:u[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,u[1])).done)return i;if(o=0,i)u=[u[0]&2,i.value];switch(u[0]){case 0:case 1:i=u;break;case 4:e.label++;return{value:u[1],done:false};case 5:e.label++;o=u[1];u=[0];continue;case 7:u=e.ops.pop();e.trys.pop();continue;default:if(!(i=e.trys,i=i.length>0&&i[i.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!i||u[1]>i[0]&&u[1]<i[3])){e.label=u[1];break}if(u[0]===6&&e.label<i[1]){e.label=i[1];i=u;break}if(i&&e.label<i[2]){e.label=i[2];e.ops.push(u);break}if(i[2])e.ops.pop();e.trys.pop();continue}u=r.call(n,e)}catch(n){u=[6,n];o=0}finally{t=i=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-cb823c4d.system.js","./p-6b6a9dd6.system.js","./p-5d0f7364.system.js","./p-1b75aa35.system.js","./p-c50b3100.system.js"],(function(n){"use strict";var r,e,t,o,i,a,u,c,s,l,d,f,v,p,h,w;return{setters:[function(n){r=n.z;e=n.c},function(n){t=n.t;o=n.z;i=n.d;a=n.e;u=n.v;c=n.r;s=n.j},function(n){l=n.t;d=n.s},function(n){f=n.h;v=n.l;p=n.b;h=n.j},function(n){w=n.t}],execute:function(){var y=this;
2
2
  /*!
3
3
  * paypal-js v8.1.0 (2024-06-07T16:55:00.122Z)
4
4
  * Copyright 2020-present, PayPal, Inc. All rights reserved.
@@ -1 +1 @@
1
- import{r as t,c as e,h as o,H as i}from"./p-c137dc82.js";import{d as n}from"./p-db3968a2.js";import{i as s,e as r,s as c,a as l}from"./p-f255e822.js";import{z as a,b as d,d as h}from"./p-4efa8187.js";import{g as u,i as p,a as f}from"./p-e7b0c156.js";import{h as m,b as v,l as g}from"./p-0fc02cde.js";import"./p-e26c9e83.js";import"./p-72f37935.js";import"./p-04a01cb1.js";const w=t=>{const e=document.querySelector(t);if(!document.querySelector("zonos-hello")&&e){const t=document.createElement("zonos-hello");return e.appendChild(t),!0}return!1},y=t=>{switch(t){case"BOTTOM_RIGHT":default:return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right"}},S=({position:t="bottom-right"})=>{const e=".zonos--hello-mobile-wrapper";if(document.querySelector(e))return e;const o=document.createElement("div");return o.className="zonos--hello-mobile-wrapper",o.style.position="fixed","top-right"===t&&(o.style.top="72px",o.style.right="24px"),"top-left"===t&&(o.style.top="72px",o.style.left="24px"),"bottom-right"===t&&(o.style.bottom="72px",o.style.right="24px"),"bottom-left"===t&&(o.style.bottom="72px",o.style.left="24px"),o.style.zIndex="2147483007",document.body.appendChild(o),e},z=async t=>{if(window.Zonos.isLegacyCheckout)return void g("Hello is disabled when isLegacyCheckout","info");const{anchorElementSelector:e}=t;let o=e;if(!t.anchorElementSelector&&t.desktopLocation){const t=S({position:"bottom-right"});o=t}if(o&&s(o)){if(g("Hello init complete"),!w(o)){const e=new MutationObserver((()=>{w(o)&&e.disconnect()}));e.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>{w(o)}),1e3),setTimeout((()=>{if(t.notFoundElementFallback){g(`Hello anchor selector ${t.anchorElementSelector} not found after 3 seconds, falling back to 'notFoundElementFallback': ${t.notFoundElementFallback}`,"info");const e=S({position:y(t.notFoundElementFallback)});w(e)}}),3e3)}}else v(`Selector anchorElementSelector "${t.anchorElementSelector}" is not a valid selector.`)};class b{constructor(t,e){this.targetId=t,this.allowedEvents=e,this.listeners=new Map,this.handleMessage=t=>{var e,o,i;const n=t.data,s=(null===(e=this.iframe)||void 0===e?void 0:e.contentWindow)||(null===(i=null===(o=this.iframe)||void 0===o?void 0:o.contentDocument)||void 0===i?void 0:i.defaultView);if(t.source!==s)return;if(!this.isValidMessage(n))return;const r=this.listeners.get(n.type);null==r||r.forEach((t=>{try{t(n.payload)}catch(t){v("Error in event listener:",t)}}))},this.initializeEventListeners(),this.iframe=document.getElementById(this.targetId)}initializeEventListeners(){window.addEventListener("message",this.handleMessage)}isValidMessage(t){if(!t||"object"!=typeof t)return!1;const e=t;return e.id===this.targetId&&"string"==typeof e.type&&this.allowedEvents.includes(e.type)&&void 0!==e.payload}on(t,e){this.listeners.has(t)||this.listeners.set(t,new Set),g(`[CheckoutAddressService] listening to ${t}`,"info");const o=e,i=this.listeners.get(t);return i&&i.add(o),()=>{const e=this.listeners.get(t);e&&e.delete(o)}}destroy(){window.removeEventListener("message",this.handleMessage),this.listeners.clear()}}class I extends b{constructor(){g("=== [Google Places Service] Initializing","info"),super(p.GOOGLE_PLACES,["fetchAutocompleteSuggestions","initializeGooglePlacesService","placeSelected","onFetchAutocompleteSuggestions","onInitializeGooglePlacesService","onPlaceSelected"])}sendMessage(t,e){var o;if(!(null===(o=this.iframe)||void 0===o?void 0:o.contentWindow))return;const i={id:this.targetId,logType:window.Zonos.iframeLogType,payload:e,type:t};g(`GooglePlacesService] parent --\x3e ${t}`,"info",e),this.iframe.contentWindow.postMessage(i,"*")}initialize(){this.sendMessage("initializeGooglePlacesService",{})}fetchSuggestions({country:t,query:e,type:o}){t&&this.sendMessage("fetchAutocompleteSuggestions",{request:{includedRegionCodes:[t],input:e},type:o})}selectPlace({placeId:t,type:e}){this.sendMessage("placeSelected",{placeId:t,type:e})}}class j{constructor(){this.googlePlaceInitialized=!1,g("=== [CheckoutAddressService] Initializing","info"),this.googlePlaces=new I,this.googlePlaces.on("onInitializeGooglePlacesService",(()=>{g("=== [CheckoutAddressService] parent <-- onInitializeGooglePlacesService","info"),this.googlePlaceInitialized=!0})),this.initialize()}initialize(){this.googlePlaces.initialize()}onInitializeGooglePlacesService(t){return this.googlePlaces.on("onInitializeGooglePlacesService",(()=>{g("[CheckoutAddressService] parent <-- onInitializeGooglePlacesService"),t()}))}isGooglePlaceInitialized(){return this.googlePlaceInitialized}onAddressSuggestions(t){return this.suggestionsCallback=t,this.googlePlaces.on("onFetchAutocompleteSuggestions",((...e)=>{g(`[CheckoutAddressService] parent <-- onFetchAutocompleteSuggestions ${e[0].type}`,"info",...e),t(...e)}))}onAddressSelected(t){return this.placeSelectedCallback=t,this.googlePlaces.on("onPlaceSelected",((...e)=>{g(`[CheckoutAddressService] parent <-- onPlaceSelected ${e[0].type}`,"info",...e),t(...e)}))}getAddressSuggestions({country:t,query:e,type:o}){this.googlePlaceInitialized&&this.googlePlaces.fetchSuggestions({country:t,query:e,type:o})}selectAddress({placeId:t,type:e}){this.googlePlaces.selectPlace({placeId:t,type:e})}destroy(){this.googlePlaces.destroy(),this.suggestionsCallback&&(this.suggestionsCallback=void 0),this.placeSelectedCallback&&(this.placeSelectedCallback=void 0)}}const k=class{constructor(o){t(this,o),this.paypalInitEvent=e(this,"paypalInitEvent",7),this.stripeInitEvent=e(this,"stripeInitEvent",7),this.config=void 0,this.zonosApiKey=void 0}async initCheckoutElement(t){var e;t?(n.stripe=t,((e=a.checkoutSettings).placeOrderButtonSelector||e.alwaysTriggerInternationalCheckoutSelector||window.Zonos.cartData)&&(!e.placeOrderButtonSelector||s(e.placeOrderButtonSelector)?!e.alwaysTriggerInternationalCheckoutSelector||s(e.alwaysTriggerInternationalCheckoutSelector)?(()=>{if(!document.querySelector("zonos-checkout")){const t=document.createElement("zonos-checkout");document.body.appendChild(t)}})():v(`Selector alwaysTriggerInternationalCheckoutSelector "${e.alwaysTriggerInternationalCheckoutSelector}" is not a valid selector`):v(`Selector checkoutButtonAnchor "${e.placeOrderButtonSelector}" is not a valid selector`)),g("init checkout element")):g("Stripe is not loaded yet - cannot init checkout element","warn")}initZonosNotification(){if(document.querySelector("zonos-notification"))return;const t=document.createElement("zonos-notification");document.body.appendChild(t)}async setupGoogleFont(t){var e,o;const i=t||h();if("Inter"===i){if(!t)return;g("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn"),a.appearance=Object.assign(Object.assign({},a.appearance),{fontFamily:t})}const n=new URLSearchParams;n.set("family",i);const{errors:s,json:r}=await m(`/api/zonos-elements/get-font-detail?${n.toString()}`);if(s.length>0)return g(`Failed to load font ${i}`,"warn"),void(a.appearance=Object.assign(Object.assign({},a.appearance),{fontFamily:"Inter"}));const c=null==r?void 0:r.fontUrl;c&&(null===(o=(e=window.Zonos).injectSupportGoogleFont)||void 0===o||o.call(e,c)),t&&(g(`[FONT] ${t} font override applied`),a.appearance=Object.assign(Object.assign({},a.appearance),{fontFamily:t}))}handleLocationChange(){z(a.helloSettings)}initHistoryListener(){const t=history.pushState;history.pushState=function(){return window.dispatchEvent(new window.Event("pushstate")),window.dispatchEvent(new window.Event("locationchange")),t.apply(this,arguments)};const e=history.replaceState;history.replaceState=function(){return window.dispatchEvent(new window.Event("replacestate")),window.dispatchEvent(new window.Event("locationchange")),e.apply(this,arguments)}}injectCustomHTML(t){if(!t)return;if(!window.Zonos.isLegacyCheckout)return void g("=== Skip injecting custom HTML for hosted checkout","info");g("=== Injecting custom HTML for hosted checkout");const e=document.createElement("template");e.innerHTML=t,e.content.querySelectorAll("script").forEach((t=>{const e=document.createElement("script");t.src?(e.src=t.src,e.async=t.async):e.textContent=t.innerHTML,document.body.appendChild(e)}))}async initGooglePlacesService(t){const e=null==t?void 0:t.genericSettings;if(!e)return;const o=e.signedTokenGooglePlaces;o&&f({id:p.GOOGLE_PLACES,onload:()=>{a.checkoutAddressService=new j},src:`https://route.elements.zonos.com/iframe/google-maps?signedToken=${o}`})}async componentWillLoad(){this.initHistoryListener(),a.zonosApiKey=this.zonosApiKey,(async()=>{var t,e,o,i,n,s;const{errors:c,json:l,zonosMode:h}=await(async()=>{if(window.Zonos.cartSettings)return{errors:[],json:window.Zonos.cartSettings,zonosMode:window.Zonos.zonosMode};const t=u(),e=new URLSearchParams;t.overrideShouldEnabledCustomAddress&&e.set("overrideShouldEnabledCustomAddress",t.overrideShouldEnabledCustomAddress);const{errors:o,json:i,zonosMode:n}=await m(`/api/zonos-elements/zonos-settings?${e.toString()}`);return o.length?(v("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings"),{errors:o,json:null,zonosMode:n}):{errors:[],json:i,zonosMode:n}})();if("403"===(null===(e=null===(t=c[0])||void 0===t?void 0:t.type)||void 0===e?void 0:e.toString()))return void g("Failed to load zonos settings. This domain may not have access","warn");const p=(null===(o=null==l?void 0:l.checkoutSettings)||void 0===o?void 0:o.customHTML)||"";this.injectCustomHTML(p),this.initZonosNotification();const f=window.Zonos.isLegacyCheckout&&!!window.Zonos.cartData&&"CLOSE_MODAL"===(null===(i=this.config.checkoutSettings)||void 0===i?void 0:i.successBehavior),w=Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:(()=>{var t,e,o;return window.Zonos.isLegacyCheckout?(null===(t=null==l?void 0:l.appearanceSettings)||void 0===t?void 0:t.logoUrl)||(null===(e=this.config.appearance)||void 0===e?void 0:e.logoUrl):null===(o=this.config.appearance)||void 0===o?void 0:o.logoUrl})()}),checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{allowedSettlementCurrencies:void 0,captureDelay:void 0,subscriptionStatus:void 0,successBehavior:f?"ZONOS_SUCCESS_PAGE":this.config.checkoutSettings.successBehavior,successRedirectUrl:f?(null===(n=window.Zonos.cartData)||void 0===n?void 0:n.storeBaseUrl)||(null==l?void 0:l.onlineStoreSettings.url):this.config.checkoutSettings.successRedirectUrl}):void 0});d({overrideSettings:w,zonosSettings:l}),a.zonosMode=h,this.setupGoogleFont(),"DISABLED"===a.helloSettings.visibilityStatus&&g("=== Hello is disabled by store owner ===","warn"),a.helloSettings&&"ENABLED"===a.helloSettings.visibilityStatus&&(g("Initializing hello"),z(a.helloSettings)),await r();const y=(null===(s=null==l?void 0:l.checkoutSettings)||void 0===s?void 0:s.externalServiceTokens.find((t=>"STRIPE_PUBLISHABLE_TOKEN"===t.type)))||null;if(y&&this.stripeInitEvent){if("INACTIVE"===a.checkoutSettings.subscriptionStatus)return g('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn"),void g("zonos controller loaded");if("DISABLED"===a.checkoutSettings.visibilityStatus)return g("=== Checkout is disabled by store owner ===","warn"),void g("zonos controller loaded");this.stripeInitEvent.emit({publishableKey:y.token}),this.initGooglePlacesService(l)}else g("Checkout failed to load -- missing publishable key","warn")})()}async showNotification(t){const e=document.querySelector("zonos-notification");e?e.showNotification(t):g("Failed to show notification - zonos-notification not found","warn")}async reset(){c.checkoutSessionId=null,n.clientSecret=""}async overrideConfig(t){d({overrideSettings:t,zonosSettings:null})}async overrideCountry(t){g(`Override country code to ${t}`),l(t)}async getAppearanceSetting(){return a.appearance}async updateOrganizationName(t){a.organizationName=t}render(){return o(i,{key:"62c0b3079d64f05800da24daa19e0e1e3a890bca",class:"zonos--elements"})}};k.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";export{k as zonos_controller}
1
+ import{r as t,c as e,h as o,H as i}from"./p-c137dc82.js";import{d as n}from"./p-d99d9e00.js";import{i as s,e as r,s as c,a as l}from"./p-f255e822.js";import{z as a,b as d,d as h}from"./p-4efa8187.js";import{g as u,i as p,a as f}from"./p-e7b0c156.js";import{h as m,b as v,l as g}from"./p-0fc02cde.js";import"./p-e26c9e83.js";import"./p-72f37935.js";import"./p-04a01cb1.js";const w=t=>{const e=document.querySelector(t);if(!document.querySelector("zonos-hello")&&e){const t=document.createElement("zonos-hello");return e.appendChild(t),!0}return!1},y=t=>{switch(t){case"BOTTOM_RIGHT":default:return"bottom-right";case"BOTTOM_LEFT":return"bottom-left";case"TOP_LEFT":return"top-left";case"TOP_RIGHT":return"top-right"}},S=({position:t="bottom-right"})=>{const e=".zonos--hello-mobile-wrapper";if(document.querySelector(e))return e;const o=document.createElement("div");return o.className="zonos--hello-mobile-wrapper",o.style.position="fixed","top-right"===t&&(o.style.top="72px",o.style.right="24px"),"top-left"===t&&(o.style.top="72px",o.style.left="24px"),"bottom-right"===t&&(o.style.bottom="72px",o.style.right="24px"),"bottom-left"===t&&(o.style.bottom="72px",o.style.left="24px"),o.style.zIndex="2147483007",document.body.appendChild(o),e},z=async t=>{if(window.Zonos.isLegacyCheckout)return void g("Hello is disabled when isLegacyCheckout","info");const{anchorElementSelector:e}=t;let o=e;if(!t.anchorElementSelector&&t.desktopLocation){const t=S({position:"bottom-right"});o=t}if(o&&s(o)){if(g("Hello init complete"),!w(o)){const e=new MutationObserver((()=>{w(o)&&e.disconnect()}));e.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>{w(o)}),1e3),setTimeout((()=>{if(t.notFoundElementFallback){g(`Hello anchor selector ${t.anchorElementSelector} not found after 3 seconds, falling back to 'notFoundElementFallback': ${t.notFoundElementFallback}`,"info");const e=S({position:y(t.notFoundElementFallback)});w(e)}}),3e3)}}else v(`Selector anchorElementSelector "${t.anchorElementSelector}" is not a valid selector.`)};class b{constructor(t,e){this.targetId=t,this.allowedEvents=e,this.listeners=new Map,this.handleMessage=t=>{var e,o,i;const n=t.data,s=(null===(e=this.iframe)||void 0===e?void 0:e.contentWindow)||(null===(i=null===(o=this.iframe)||void 0===o?void 0:o.contentDocument)||void 0===i?void 0:i.defaultView);if(t.source!==s)return;if(!this.isValidMessage(n))return;const r=this.listeners.get(n.type);null==r||r.forEach((t=>{try{t(n.payload)}catch(t){v("Error in event listener:",t)}}))},this.initializeEventListeners(),this.iframe=document.getElementById(this.targetId)}initializeEventListeners(){window.addEventListener("message",this.handleMessage)}isValidMessage(t){if(!t||"object"!=typeof t)return!1;const e=t;return e.id===this.targetId&&"string"==typeof e.type&&this.allowedEvents.includes(e.type)&&void 0!==e.payload}on(t,e){this.listeners.has(t)||this.listeners.set(t,new Set),g(`[CheckoutAddressService] listening to ${t}`,"info");const o=e,i=this.listeners.get(t);return i&&i.add(o),()=>{const e=this.listeners.get(t);e&&e.delete(o)}}destroy(){window.removeEventListener("message",this.handleMessage),this.listeners.clear()}}class I extends b{constructor(){g("=== [Google Places Service] Initializing","info"),super(p.GOOGLE_PLACES,["fetchAutocompleteSuggestions","initializeGooglePlacesService","placeSelected","onFetchAutocompleteSuggestions","onInitializeGooglePlacesService","onPlaceSelected"])}sendMessage(t,e){var o;if(!(null===(o=this.iframe)||void 0===o?void 0:o.contentWindow))return;const i={id:this.targetId,logType:window.Zonos.iframeLogType,payload:e,type:t};g(`GooglePlacesService] parent --\x3e ${t}`,"info",e),this.iframe.contentWindow.postMessage(i,"*")}initialize(){this.sendMessage("initializeGooglePlacesService",{})}fetchSuggestions({country:t,query:e,type:o}){t&&this.sendMessage("fetchAutocompleteSuggestions",{request:{includedRegionCodes:[t],input:e},type:o})}selectPlace({placeId:t,type:e}){this.sendMessage("placeSelected",{placeId:t,type:e})}}class j{constructor(){this.googlePlaceInitialized=!1,g("=== [CheckoutAddressService] Initializing","info"),this.googlePlaces=new I,this.googlePlaces.on("onInitializeGooglePlacesService",(()=>{g("=== [CheckoutAddressService] parent <-- onInitializeGooglePlacesService","info"),this.googlePlaceInitialized=!0})),this.initialize()}initialize(){this.googlePlaces.initialize()}onInitializeGooglePlacesService(t){return this.googlePlaces.on("onInitializeGooglePlacesService",(()=>{g("[CheckoutAddressService] parent <-- onInitializeGooglePlacesService"),t()}))}isGooglePlaceInitialized(){return this.googlePlaceInitialized}onAddressSuggestions(t){return this.suggestionsCallback=t,this.googlePlaces.on("onFetchAutocompleteSuggestions",((...e)=>{g(`[CheckoutAddressService] parent <-- onFetchAutocompleteSuggestions ${e[0].type}`,"info",...e),t(...e)}))}onAddressSelected(t){return this.placeSelectedCallback=t,this.googlePlaces.on("onPlaceSelected",((...e)=>{g(`[CheckoutAddressService] parent <-- onPlaceSelected ${e[0].type}`,"info",...e),t(...e)}))}getAddressSuggestions({country:t,query:e,type:o}){this.googlePlaceInitialized&&this.googlePlaces.fetchSuggestions({country:t,query:e,type:o})}selectAddress({placeId:t,type:e}){this.googlePlaces.selectPlace({placeId:t,type:e})}destroy(){this.googlePlaces.destroy(),this.suggestionsCallback&&(this.suggestionsCallback=void 0),this.placeSelectedCallback&&(this.placeSelectedCallback=void 0)}}const k=class{constructor(o){t(this,o),this.paypalInitEvent=e(this,"paypalInitEvent",7),this.stripeInitEvent=e(this,"stripeInitEvent",7),this.config=void 0,this.zonosApiKey=void 0}async initCheckoutElement(t){var e;t?(n.stripe=t,((e=a.checkoutSettings).placeOrderButtonSelector||e.alwaysTriggerInternationalCheckoutSelector||window.Zonos.cartData)&&(!e.placeOrderButtonSelector||s(e.placeOrderButtonSelector)?!e.alwaysTriggerInternationalCheckoutSelector||s(e.alwaysTriggerInternationalCheckoutSelector)?(()=>{if(!document.querySelector("zonos-checkout")){const t=document.createElement("zonos-checkout");document.body.appendChild(t)}})():v(`Selector alwaysTriggerInternationalCheckoutSelector "${e.alwaysTriggerInternationalCheckoutSelector}" is not a valid selector`):v(`Selector checkoutButtonAnchor "${e.placeOrderButtonSelector}" is not a valid selector`)),g("init checkout element")):g("Stripe is not loaded yet - cannot init checkout element","warn")}initZonosNotification(){if(document.querySelector("zonos-notification"))return;const t=document.createElement("zonos-notification");document.body.appendChild(t)}async setupGoogleFont(t){var e,o;const i=t||h();if("Inter"===i){if(!t)return;g("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn"),a.appearance=Object.assign(Object.assign({},a.appearance),{fontFamily:t})}const n=new URLSearchParams;n.set("family",i);const{errors:s,json:r}=await m(`/api/zonos-elements/get-font-detail?${n.toString()}`);if(s.length>0)return g(`Failed to load font ${i}`,"warn"),void(a.appearance=Object.assign(Object.assign({},a.appearance),{fontFamily:"Inter"}));const c=null==r?void 0:r.fontUrl;c&&(null===(o=(e=window.Zonos).injectSupportGoogleFont)||void 0===o||o.call(e,c)),t&&(g(`[FONT] ${t} font override applied`),a.appearance=Object.assign(Object.assign({},a.appearance),{fontFamily:t}))}handleLocationChange(){z(a.helloSettings)}initHistoryListener(){const t=history.pushState;history.pushState=function(){return window.dispatchEvent(new window.Event("pushstate")),window.dispatchEvent(new window.Event("locationchange")),t.apply(this,arguments)};const e=history.replaceState;history.replaceState=function(){return window.dispatchEvent(new window.Event("replacestate")),window.dispatchEvent(new window.Event("locationchange")),e.apply(this,arguments)}}injectCustomHTML(t){if(!t)return;if(!window.Zonos.isLegacyCheckout)return void g("=== Skip injecting custom HTML for hosted checkout","info");g("=== Injecting custom HTML for hosted checkout");const e=document.createElement("template");e.innerHTML=t,e.content.querySelectorAll("script").forEach((t=>{const e=document.createElement("script");t.src?(e.src=t.src,e.async=t.async):e.textContent=t.innerHTML,document.body.appendChild(e)}))}async initGooglePlacesService(t){const e=null==t?void 0:t.genericSettings;if(!e)return;const o=e.signedTokenGooglePlaces;o&&f({id:p.GOOGLE_PLACES,onload:()=>{a.checkoutAddressService=new j},src:`https://route.elements.zonos.com/iframe/google-maps?signedToken=${o}`})}async componentWillLoad(){this.initHistoryListener(),a.zonosApiKey=this.zonosApiKey,(async()=>{var t,e,o,i,n,s;const{errors:c,json:l,zonosMode:h}=await(async()=>{if(window.Zonos.cartSettings)return{errors:[],json:window.Zonos.cartSettings,zonosMode:window.Zonos.zonosMode};const t=u(),e=new URLSearchParams;t.overrideShouldEnabledCustomAddress&&e.set("overrideShouldEnabledCustomAddress",t.overrideShouldEnabledCustomAddress);const{errors:o,json:i,zonosMode:n}=await m(`/api/zonos-elements/zonos-settings?${e.toString()}`);return o.length?(v("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings"),{errors:o,json:null,zonosMode:n}):{errors:[],json:i,zonosMode:n}})();if("403"===(null===(e=null===(t=c[0])||void 0===t?void 0:t.type)||void 0===e?void 0:e.toString()))return void g("Failed to load zonos settings. This domain may not have access","warn");const p=(null===(o=null==l?void 0:l.checkoutSettings)||void 0===o?void 0:o.customHTML)||"";this.injectCustomHTML(p),this.initZonosNotification();const f=window.Zonos.isLegacyCheckout&&!!window.Zonos.cartData&&"CLOSE_MODAL"===(null===(i=this.config.checkoutSettings)||void 0===i?void 0:i.successBehavior),w=Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:(()=>{var t,e,o;return window.Zonos.isLegacyCheckout?(null===(t=null==l?void 0:l.appearanceSettings)||void 0===t?void 0:t.logoUrl)||(null===(e=this.config.appearance)||void 0===e?void 0:e.logoUrl):null===(o=this.config.appearance)||void 0===o?void 0:o.logoUrl})()}),checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{allowedSettlementCurrencies:void 0,captureDelay:void 0,subscriptionStatus:void 0,successBehavior:f?"ZONOS_SUCCESS_PAGE":this.config.checkoutSettings.successBehavior,successRedirectUrl:f?(null===(n=window.Zonos.cartData)||void 0===n?void 0:n.storeBaseUrl)||(null==l?void 0:l.onlineStoreSettings.url):this.config.checkoutSettings.successRedirectUrl}):void 0});d({overrideSettings:w,zonosSettings:l}),a.zonosMode=h,this.setupGoogleFont(),"DISABLED"===a.helloSettings.visibilityStatus&&g("=== Hello is disabled by store owner ===","warn"),a.helloSettings&&"ENABLED"===a.helloSettings.visibilityStatus&&(g("Initializing hello"),z(a.helloSettings)),await r();const y=(null===(s=null==l?void 0:l.checkoutSettings)||void 0===s?void 0:s.externalServiceTokens.find((t=>"STRIPE_PUBLISHABLE_TOKEN"===t.type)))||null;if(y&&this.stripeInitEvent){if("INACTIVE"===a.checkoutSettings.subscriptionStatus)return g('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn"),void g("zonos controller loaded");if("DISABLED"===a.checkoutSettings.visibilityStatus)return g("=== Checkout is disabled by store owner ===","warn"),void g("zonos controller loaded");this.stripeInitEvent.emit({publishableKey:y.token}),this.initGooglePlacesService(l)}else g("Checkout failed to load -- missing publishable key","warn")})()}async showNotification(t){const e=document.querySelector("zonos-notification");e?e.showNotification(t):g("Failed to show notification - zonos-notification not found","warn")}async reset(){c.checkoutSessionId=null,n.clientSecret=""}async overrideConfig(t){d({overrideSettings:t,zonosSettings:null})}async overrideCountry(t){g(`Override country code to ${t}`),l(t)}async getAppearanceSetting(){return a.appearance}async updateOrganizationName(t){a.organizationName=t}render(){return o(i,{key:"62c0b3079d64f05800da24daa19e0e1e3a890bca",class:"zonos--elements"})}};k.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";export{k as zonos_controller}
@@ -1 +1 @@
1
- import{r as t,h as o,H as s,d as n,c as a}from"./p-c137dc82.js";import{d as e}from"./p-4efa8187.js";import{c as i}from"./p-b4b7f705.js";import{g as r}from"./p-72f37935.js";import{d as p,t as h}from"./p-db3968a2.js";import{s as c}from"./p-f255e822.js";import{b as l,l as y}from"./p-0fc02cde.js";import{d as m}from"./p-aae60057.js";import"./p-04a01cb1.js";import"./p-e26c9e83.js";const d=class{constructor(o){t(this,o),this.emptyStateText=void 0,this.theme="LIGHT"}render(){return this.el.shadowRoot?(this.el.shadowRoot.innerHTML="DARK"===this.theme?'<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19124" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19124)"/>\n</mask>\n<g mask="url(#mask0_3739_19124)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="white" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19124" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n':'<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19125" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19125)"/>\n</mask>\n<g mask="url(#mask0_3739_19125)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="black" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19125" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n',o(s,{class:"zonos--elements",style:{"--zonos--font-family":e(),"--zonos--height":"100%","--zonos--width":"100%"}},o("zonos-text",{type:"semiBoldLabel"},this.emptyStateText))):null}get el(){return n(this)}};d.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;position:relative}:host zonos-text{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host svg{width:var(--zonos--width);height:var(--zonos--height)}";const f=class{constructor(o){t(this,o),this.notificationArray=[]}async showNotification(t){const o=`id-${Math.random().toString(36).substring(2,9)}`,s=Object.assign(Object.assign({},t),{id:o,timeout:t.timeout||5e3,transitionClass:"",type:t.type||"success"});this.notificationArray=[...this.notificationArray,s],setTimeout((()=>{this.updateTransitionClass({id:o,transitionClass:"show"})}),50),setTimeout((()=>{this.removeNotification(o)}),s.timeout)}updateTransitionClass({id:t,transitionClass:o}){this.notificationArray=this.notificationArray.map((s=>s.id===t?Object.assign(Object.assign({},s),{transitionClass:o}):s))}removeNotification(t){this.updateTransitionClass({id:t,transitionClass:""}),setTimeout((()=>{this.notificationArray=this.notificationArray.filter((o=>o.id!==t))}),300)}render(){return o(s,{key:"6a790a39afc037ae56f8a53dc89c3fa899b2d659",class:i(["zonos--elements zonos--notification"]),style:{"--zonos--border-radius":r(),"--zonos--font-family":e()}},o("div",{key:"32245a784f2322fb69a65b491648a30a84b0b3d3",class:"zonos--notification-items"},this.notificationArray.map((t=>o("div",{"aria-hidden":"true",class:i(["zonos--notification-item",t.type,t.transitionClass]),key:t.id,onClick:()=>{this.removeNotification(t.id)}},o("zonos-text",{textColor:"gray-0"},t.message))))))}};f.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";const z=class{constructor(o){t(this,o),this.trackingSent=!1,this.titleText=void 0,this.stripe=p.stripe,this.stripeElements=p.stripeElements,this.isPaymentInfoFilled=!1}watchIsPaymentInfoFilled(){var t;this.isPaymentInfoFilled&&!this.trackingSent&&(h({checkoutSessionId:c.checkoutSessionId,eventName:"checkout_paymentInfoFilled",metadata:{paymentMethod:null===(t=p.stripePaymentEventData)||void 0===t?void 0:t.value.type}}),this.trackingSent=!0)}watchInitStripe(){if(!this.stripeElements)return;const t=p.stripePaymentElement||this.stripeElements.create("payment",{layout:"tabs"}),o=this.el.querySelector(".zonos--payment-component");o?(t.mount(o),t.on("change",(t=>{t.complete&&(this.isPaymentInfoFilled=!0),p.stripePaymentEventData=t})),p.stripePaymentElement=t):l("Cannot find container element for paymentElement")}componentDidLoad(){this.watchInitStripe()}render(){return o(s,{key:"7210a20afba18d167a6e7d875ba23daa0db774e4",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"4f043b3149cca48d2f4463a826541ebe35d0b6ca",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"15721e208e90b969c075877680a02dca5bb81689",class:"zonos--payment-component"}),o("div",{key:"36d5767821464db479feff18e6368e862550c777",class:"zonos--payment-paypal-container"}))}get el(){return n(this)}static get watchers(){return{isPaymentInfoFilled:["watchIsPaymentInfoFilled"],stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}}};z.style=".sc-zonos-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}.sc-zonos-payment-h .zonos--payment-component.sc-zonos-payment{margin-bottom:4px}";const g=class{constructor(o){t(this,o),this.paypalSessionDone=a(this,"paypalSessionDone",7),this.paypalSessionFail=a(this,"paypalSessionFail",7)}async loadPaypal(){if(!window.Zonos.paypal)return void y("Paypal is not available");const t=m({onPaypalFail:()=>{y("onPaypalFail"),this.paypalSessionFail.emit()},onPaypalSessionDone:({orderId:t})=>{y("onPaypalSessionDone","info",{orderId:t}),this.paypalSessionDone.emit({orderId:t})}});if(!(null==t?void 0:t.length))return void y("There are no paypal buttons available");const o=this.el.querySelector(".zonos--payment-paypal-container");o?t.forEach((async t=>{await t.render(o)})):y("Cannot find container element for paypal buttons")}componentDidLoad(){this.loadPaypal()}render(){return o(s,{key:"e8c839cc9d0286f5ae4643243b14fa66f9584833",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"cac06948de1ccca97ba65eca10b3e5d9f3a9a362",class:"zonos--payment-paypal-container"}))}get el(){return n(this)}};g.style=".sc-zonos-paypal-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";export{d as zonos_empty_state_payment,f as zonos_notification,z as zonos_payment,g as zonos_paypal_payment}
1
+ import{r as t,h as o,H as s,d as n,c as a}from"./p-c137dc82.js";import{d as e}from"./p-4efa8187.js";import{c as i}from"./p-b4b7f705.js";import{g as r}from"./p-72f37935.js";import{d as p,t as h}from"./p-d99d9e00.js";import{s as c}from"./p-f255e822.js";import{b as l,l as y}from"./p-0fc02cde.js";import{d as m}from"./p-a9307caa.js";import"./p-04a01cb1.js";import"./p-e26c9e83.js";const d=class{constructor(o){t(this,o),this.emptyStateText=void 0,this.theme="LIGHT"}render(){return this.el.shadowRoot?(this.el.shadowRoot.innerHTML="DARK"===this.theme?'<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19124" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19124)"/>\n</mask>\n<g mask="url(#mask0_3739_19124)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="white" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19124" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n':'<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19125" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19125)"/>\n</mask>\n<g mask="url(#mask0_3739_19125)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="black" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19125" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n',o(s,{class:"zonos--elements",style:{"--zonos--font-family":e(),"--zonos--height":"100%","--zonos--width":"100%"}},o("zonos-text",{type:"semiBoldLabel"},this.emptyStateText))):null}get el(){return n(this)}};d.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;position:relative}:host zonos-text{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host svg{width:var(--zonos--width);height:var(--zonos--height)}";const f=class{constructor(o){t(this,o),this.notificationArray=[]}async showNotification(t){const o=`id-${Math.random().toString(36).substring(2,9)}`,s=Object.assign(Object.assign({},t),{id:o,timeout:t.timeout||5e3,transitionClass:"",type:t.type||"success"});this.notificationArray=[...this.notificationArray,s],setTimeout((()=>{this.updateTransitionClass({id:o,transitionClass:"show"})}),50),setTimeout((()=>{this.removeNotification(o)}),s.timeout)}updateTransitionClass({id:t,transitionClass:o}){this.notificationArray=this.notificationArray.map((s=>s.id===t?Object.assign(Object.assign({},s),{transitionClass:o}):s))}removeNotification(t){this.updateTransitionClass({id:t,transitionClass:""}),setTimeout((()=>{this.notificationArray=this.notificationArray.filter((o=>o.id!==t))}),300)}render(){return o(s,{key:"6a790a39afc037ae56f8a53dc89c3fa899b2d659",class:i(["zonos--elements zonos--notification"]),style:{"--zonos--border-radius":r(),"--zonos--font-family":e()}},o("div",{key:"32245a784f2322fb69a65b491648a30a84b0b3d3",class:"zonos--notification-items"},this.notificationArray.map((t=>o("div",{"aria-hidden":"true",class:i(["zonos--notification-item",t.type,t.transitionClass]),key:t.id,onClick:()=>{this.removeNotification(t.id)}},o("zonos-text",{textColor:"gray-0"},t.message))))))}};f.style=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";const z=class{constructor(o){t(this,o),this.trackingSent=!1,this.titleText=void 0,this.stripe=p.stripe,this.stripeElements=p.stripeElements,this.isPaymentInfoFilled=!1}watchIsPaymentInfoFilled(){var t;this.isPaymentInfoFilled&&!this.trackingSent&&(h({checkoutSessionId:c.checkoutSessionId,eventName:"checkout_paymentInfoFilled",metadata:{paymentMethod:null===(t=p.stripePaymentEventData)||void 0===t?void 0:t.value.type}}),this.trackingSent=!0)}watchInitStripe(){if(!this.stripeElements)return;const t=p.stripePaymentElement||this.stripeElements.create("payment",{layout:"tabs"}),o=this.el.querySelector(".zonos--payment-component");o?(t.mount(o),t.on("change",(t=>{t.complete&&(this.isPaymentInfoFilled=!0),p.stripePaymentEventData=t})),p.stripePaymentElement=t):l("Cannot find container element for paymentElement")}componentDidLoad(){this.watchInitStripe()}render(){return o(s,{key:"7210a20afba18d167a6e7d875ba23daa0db774e4",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"4f043b3149cca48d2f4463a826541ebe35d0b6ca",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"15721e208e90b969c075877680a02dca5bb81689",class:"zonos--payment-component"}),o("div",{key:"36d5767821464db479feff18e6368e862550c777",class:"zonos--payment-paypal-container"}))}get el(){return n(this)}static get watchers(){return{isPaymentInfoFilled:["watchIsPaymentInfoFilled"],stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}}};z.style=".sc-zonos-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}.sc-zonos-payment-h .zonos--payment-component.sc-zonos-payment{margin-bottom:4px}";const g=class{constructor(o){t(this,o),this.paypalSessionDone=a(this,"paypalSessionDone",7),this.paypalSessionFail=a(this,"paypalSessionFail",7)}async loadPaypal(){if(!window.Zonos.paypal)return void y("Paypal is not available");const t=m({onPaypalFail:()=>{y("onPaypalFail"),this.paypalSessionFail.emit()},onPaypalSessionDone:({orderId:t})=>{y("onPaypalSessionDone","info",{orderId:t}),this.paypalSessionDone.emit({orderId:t})}});if(!(null==t?void 0:t.length))return void y("There are no paypal buttons available");const o=this.el.querySelector(".zonos--payment-paypal-container");o?t.forEach((async t=>{await t.render(o)})):y("Cannot find container element for paypal buttons")}componentDidLoad(){this.loadPaypal()}render(){return o(s,{key:"e8c839cc9d0286f5ae4643243b14fa66f9584833",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"cac06948de1ccca97ba65eca10b3e5d9f3a9a362",class:"zonos--payment-paypal-container"}))}get el(){return n(this)}};g.style=".sc-zonos-paypal-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";export{d as zonos_empty_state_payment,f as zonos_notification,z as zonos_payment,g as zonos_paypal_payment}
@@ -1 +1 @@
1
- var __awaiter=this&&this.__awaiter||function(t,n,o,e){function s(t){return t instanceof o?t:new o((function(n){n(t)}))}return new(o||(o=Promise))((function(o,a){function i(t){try{c(e.next(t))}catch(t){a(t)}}function r(t){try{c(e["throw"](t))}catch(t){a(t)}}function c(t){t.done?o(t.value):s(t.value).then(i,r)}c((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},e,s,a,i;return i={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function r(t){return function(n){return c([t,n])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(o=0)),o)try{if(e=1,s&&(a=r[0]&2?s["return"]:r[0]?s["throw"]||((a=s["return"])&&a.call(s),0):s.next)&&!(a=a.call(s,r[1])).done)return a;if(s=0,a)r=[r[0]&2,a.value];switch(r[0]){case 0:case 1:a=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;s=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!a||r[1]>a[0]&&r[1]<a[3])){o.label=r[1];break}if(r[0]===6&&o.label<a[1]){o.label=a[1];a=r;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(r);break}if(a[2])o.ops.pop();o.trys.pop();continue}r=n.call(t,o)}catch(t){r=[6,t];s=0}finally{e=a=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,n,o){if(o||arguments.length===2)for(var e=0,s=n.length,a;e<s;e++){if(a||!(e in n)){if(!a)a=Array.prototype.slice.call(n,0,e);a[e]=n[e]}}return t.concat(a||Array.prototype.slice.call(n))};System.register(["./p-43633269.system.js","./p-cb823c4d.system.js","./p-23e7c655.system.js","./p-ef3e05e5.system.js","./p-32320d9a.system.js","./p-5d0f7364.system.js","./p-1b75aa35.system.js","./p-d2466fbd.system.js","./p-5a2dd041.system.js","./p-c50b3100.system.js"],(function(t){"use strict";var n,o,e,s,a,i,r,c,h,l,p,y,f,m;return{setters:[function(t){n=t.r;o=t.h;e=t.H;s=t.d;a=t.c},function(t){i=t.d},function(t){r=t.c},function(t){c=t.g},function(t){h=t.d;l=t.t},function(t){p=t.s},function(t){y=t.b;f=t.l},function(t){m=t.d},function(){},function(){}],execute:function(){var u='<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19124" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19124)"/>\n</mask>\n<g mask="url(#mask0_3739_19124)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="white" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19124" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n';var d='<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19125" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19125)"/>\n</mask>\n<g mask="url(#mask0_3739_19125)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="black" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19125" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n';var z=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;position:relative}:host zonos-text{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host svg{width:var(--zonos--width);height:var(--zonos--height)}";var g=z;var x=t("zonos_empty_state_payment",function(){function t(t){n(this,t);this.emptyStateText=undefined;this.theme="LIGHT"}t.prototype.render=function(){if(!this.el.shadowRoot){return null}if(this.theme==="DARK"){this.el.shadowRoot.innerHTML=u}else{this.el.shadowRoot.innerHTML=d}return o(e,{class:"zonos--elements",style:{"--zonos--font-family":i(),"--zonos--height":"100%","--zonos--width":"100%"}},o("zonos-text",{type:"semiBoldLabel"},this.emptyStateText))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());x.style=g;var w=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";var b=w;var k=t("zonos_notification",function(){function t(t){n(this,t);this.notificationArray=[]}t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n,o;var e=this;return __generator(this,(function(s){n="id-".concat(Math.random().toString(36).substring(2,9));o=Object.assign(Object.assign({},t),{id:n,timeout:t.timeout||5e3,transitionClass:"",type:t.type||"success"});this.notificationArray=__spreadArray(__spreadArray([],this.notificationArray,true),[o],false);setTimeout((function(){e.updateTransitionClass({id:n,transitionClass:"show"})}),50);setTimeout((function(){e.removeNotification(n)}),o.timeout);return[2]}))}))};t.prototype.updateTransitionClass=function(t){var n=t.id,o=t.transitionClass;this.notificationArray=this.notificationArray.map((function(t){if(t.id===n){return Object.assign(Object.assign({},t),{transitionClass:o})}return t}))};t.prototype.removeNotification=function(t){var n=this;this.updateTransitionClass({id:t,transitionClass:""});setTimeout((function(){n.notificationArray=n.notificationArray.filter((function(n){return n.id!==t}))}),300)};t.prototype.render=function(){var t=this;return o(e,{key:"6a790a39afc037ae56f8a53dc89c3fa899b2d659",class:r(["zonos--elements zonos--notification"]),style:{"--zonos--border-radius":c(),"--zonos--font-family":i()}},o("div",{key:"32245a784f2322fb69a65b491648a30a84b0b3d3",class:"zonos--notification-items"},this.notificationArray.map((function(n){return o("div",{"aria-hidden":"true",class:r(["zonos--notification-item",n.type,n.transitionClass]),key:n.id,onClick:function(){t.removeNotification(n.id)}},o("zonos-text",{textColor:"gray-0"},n.message))}))))};return t}());k.style=b;var v=".sc-zonos-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}.sc-zonos-payment-h .zonos--payment-component.sc-zonos-payment{margin-bottom:4px}";var _=v;var I=t("zonos_payment",function(){function t(t){n(this,t);this.trackingSent=false;this.titleText=undefined;this.stripe=h.stripe;this.stripeElements=h.stripeElements;this.isPaymentInfoFilled=false}t.prototype.watchIsPaymentInfoFilled=function(){var t;if(this.isPaymentInfoFilled&&!this.trackingSent){var n=p.checkoutSessionId;void l({checkoutSessionId:n,eventName:"checkout_paymentInfoFilled",metadata:{paymentMethod:(t=h.stripePaymentEventData)===null||t===void 0?void 0:t.value.type}});this.trackingSent=true}};t.prototype.watchInitStripe=function(){var t=this;if(!this.stripeElements){return}var n=h.stripePaymentElement||this.stripeElements.create("payment",{layout:"tabs"});var o=this.el.querySelector(".zonos--payment-component");if(!o){y("Cannot find container element for paymentElement");return}n.mount(o);n.on("change",(function(n){if(n.complete){t.isPaymentInfoFilled=true}h.stripePaymentEventData=n}));h.stripePaymentElement=n};t.prototype.componentDidLoad=function(){this.watchInitStripe()};t.prototype.render=function(){return o(e,{key:"7210a20afba18d167a6e7d875ba23daa0db774e4",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"4f043b3149cca48d2f4463a826541ebe35d0b6ca",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"15721e208e90b969c075877680a02dca5bb81689",class:"zonos--payment-component"}),o("div",{key:"36d5767821464db479feff18e6368e862550c777",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isPaymentInfoFilled:["watchIsPaymentInfoFilled"],stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return t}());I.style=_;var j=".sc-zonos-paypal-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";var S=j;var O=t("zonos_paypal_payment",function(){function t(t){n(this,t);this.paypalSessionDone=a(this,"paypalSessionDone",7);this.paypalSessionFail=a(this,"paypalSessionFail",7)}t.prototype.loadPaypal=function(){return __awaiter(this,void 0,void 0,(function(){var t,n;var o=this;return __generator(this,(function(e){if(!window.Zonos.paypal){f("Paypal is not available");return[2]}t=m({onPaypalFail:function(){f("onPaypalFail");o.paypalSessionFail.emit()},onPaypalSessionDone:function(t){var n=t.orderId;f("onPaypalSessionDone","info",{orderId:n});o.paypalSessionDone.emit({orderId:n})}});if(!(t===null||t===void 0?void 0:t.length)){f("There are no paypal buttons available");return[2]}n=this.el.querySelector(".zonos--payment-paypal-container");if(!n){f("Cannot find container element for paypal buttons");return[2]}t.forEach((function(t){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,t.render(n)];case 1:o.sent();return[2]}}))}))}));return[2]}))}))};t.prototype.componentDidLoad=function(){void this.loadPaypal()};t.prototype.render=function(){return o(e,{key:"e8c839cc9d0286f5ae4643243b14fa66f9584833",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"cac06948de1ccca97ba65eca10b3e5d9f3a9a362",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());O.style=S}}}));
1
+ var __awaiter=this&&this.__awaiter||function(t,n,o,e){function s(t){return t instanceof o?t:new o((function(n){n(t)}))}return new(o||(o=Promise))((function(o,a){function i(t){try{c(e.next(t))}catch(t){a(t)}}function r(t){try{c(e["throw"](t))}catch(t){a(t)}}function c(t){t.done?o(t.value):s(t.value).then(i,r)}c((e=e.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var o={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},e,s,a,i;return i={next:r(0),throw:r(1),return:r(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function r(t){return function(n){return c([t,n])}}function c(r){if(e)throw new TypeError("Generator is already executing.");while(i&&(i=0,r[0]&&(o=0)),o)try{if(e=1,s&&(a=r[0]&2?s["return"]:r[0]?s["throw"]||((a=s["return"])&&a.call(s),0):s.next)&&!(a=a.call(s,r[1])).done)return a;if(s=0,a)r=[r[0]&2,a.value];switch(r[0]){case 0:case 1:a=r;break;case 4:o.label++;return{value:r[1],done:false};case 5:o.label++;s=r[1];r=[0];continue;case 7:r=o.ops.pop();o.trys.pop();continue;default:if(!(a=o.trys,a=a.length>0&&a[a.length-1])&&(r[0]===6||r[0]===2)){o=0;continue}if(r[0]===3&&(!a||r[1]>a[0]&&r[1]<a[3])){o.label=r[1];break}if(r[0]===6&&o.label<a[1]){o.label=a[1];a=r;break}if(a&&o.label<a[2]){o.label=a[2];o.ops.push(r);break}if(a[2])o.ops.pop();o.trys.pop();continue}r=n.call(t,o)}catch(t){r=[6,t];s=0}finally{e=a=0}if(r[0]&5)throw r[1];return{value:r[0]?r[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(t,n,o){if(o||arguments.length===2)for(var e=0,s=n.length,a;e<s;e++){if(a||!(e in n)){if(!a)a=Array.prototype.slice.call(n,0,e);a[e]=n[e]}}return t.concat(a||Array.prototype.slice.call(n))};System.register(["./p-43633269.system.js","./p-cb823c4d.system.js","./p-23e7c655.system.js","./p-ef3e05e5.system.js","./p-6b6a9dd6.system.js","./p-5d0f7364.system.js","./p-1b75aa35.system.js","./p-0693422b.system.js","./p-5a2dd041.system.js","./p-c50b3100.system.js"],(function(t){"use strict";var n,o,e,s,a,i,r,c,h,l,p,y,f,m;return{setters:[function(t){n=t.r;o=t.h;e=t.H;s=t.d;a=t.c},function(t){i=t.d},function(t){r=t.c},function(t){c=t.g},function(t){h=t.d;l=t.t},function(t){p=t.s},function(t){y=t.b;f=t.l},function(t){m=t.d},function(){},function(){}],execute:function(){var u='<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19124" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19124)"/>\n</mask>\n<g mask="url(#mask0_3739_19124)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="white" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="white" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="white" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19124" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n';var d='<svg width="536" height="200" viewBox="0 0 536 200" fill="none" xmlns="http://www.w3.org/2000/svg">\n<mask id="mask0_3739_19125" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="536" height="200">\n<rect width="536" height="200" fill="url(#paint0_radial_3739_19125)"/>\n</mask>\n<g mask="url(#mask0_3739_19125)">\n<rect x="0.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="126.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="252.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="378.5" y="0.5" width="117" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="504.5" y="0.5" width="31" height="63" rx="9.5" stroke="black" stroke-opacity="0.08"/>\n<rect y="96" width="124" height="8" rx="4" fill="black" fill-opacity="0.08"/>\n<rect x="0.5" y="112.5" width="535" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="0.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n<rect x="272.5" y="160.5" width="263" height="39" rx="7.5" stroke="black" stroke-opacity="0.08"/>\n</g>\n<defs>\n<radialGradient id="paint0_radial_3739_19125" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="translate(268 100) rotate(90) scale(100 268)">\n<stop offset="0.25" stop-color="white" stop-opacity="0"/>\n<stop offset="0.75" stop-color="white"/>\n</radialGradient>\n</defs>\n</svg>\n';var z=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;position:relative}:host zonos-text{position:absolute;left:0;right:0;bottom:0;top:0;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host svg{width:var(--zonos--width);height:var(--zonos--height)}";var g=z;var x=t("zonos_empty_state_payment",function(){function t(t){n(this,t);this.emptyStateText=undefined;this.theme="LIGHT"}t.prototype.render=function(){if(!this.el.shadowRoot){return null}if(this.theme==="DARK"){this.el.shadowRoot.innerHTML=u}else{this.el.shadowRoot.innerHTML=d}return o(e,{class:"zonos--elements",style:{"--zonos--font-family":i(),"--zonos--height":"100%","--zonos--width":"100%"}},o("zonos-text",{type:"semiBoldLabel"},this.emptyStateText))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());x.style=g;var b=":host{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--zonos--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .zonos--notification-items{position:fixed;z-index:9999999999;bottom:24px;gap:8px;display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--notification-item{cursor:pointer;-webkit-transition:all 0.3s ease;transition:all 0.3s ease;padding:8px;border-radius:var(--zonos--border-radius, var(--zonos-elements-radius-6));opacity:0;-ms-flex-negative:0.0001;flex-shrink:0.0001;-webkit-transform:translateY(100%);transform:translateY(100%)}:host .zonos--notification-item+:host .zonos--notification-item{margin-top:8px}:host .zonos--notification-item.show{opacity:1;-webkit-transform:translateY(0);transform:translateY(0);-ms-flex-positive:1000;flex-grow:1000}:host .zonos--notification-item.success{background-color:var(--zonos-elements-green-700)}:host .zonos--notification-item.error{background-color:var(--zonos-elements-red-700)}:host .zonos--notification-item.warning{background-color:var(--zonos-elements-orange-700)}";var w=b;var k=t("zonos_notification",function(){function t(t){n(this,t);this.notificationArray=[]}t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n,o;var e=this;return __generator(this,(function(s){n="id-".concat(Math.random().toString(36).substring(2,9));o=Object.assign(Object.assign({},t),{id:n,timeout:t.timeout||5e3,transitionClass:"",type:t.type||"success"});this.notificationArray=__spreadArray(__spreadArray([],this.notificationArray,true),[o],false);setTimeout((function(){e.updateTransitionClass({id:n,transitionClass:"show"})}),50);setTimeout((function(){e.removeNotification(n)}),o.timeout);return[2]}))}))};t.prototype.updateTransitionClass=function(t){var n=t.id,o=t.transitionClass;this.notificationArray=this.notificationArray.map((function(t){if(t.id===n){return Object.assign(Object.assign({},t),{transitionClass:o})}return t}))};t.prototype.removeNotification=function(t){var n=this;this.updateTransitionClass({id:t,transitionClass:""});setTimeout((function(){n.notificationArray=n.notificationArray.filter((function(n){return n.id!==t}))}),300)};t.prototype.render=function(){var t=this;return o(e,{key:"6a790a39afc037ae56f8a53dc89c3fa899b2d659",class:r(["zonos--elements zonos--notification"]),style:{"--zonos--border-radius":c(),"--zonos--font-family":i()}},o("div",{key:"32245a784f2322fb69a65b491648a30a84b0b3d3",class:"zonos--notification-items"},this.notificationArray.map((function(n){return o("div",{"aria-hidden":"true",class:r(["zonos--notification-item",n.type,n.transitionClass]),key:n.id,onClick:function(){t.removeNotification(n.id)}},o("zonos-text",{textColor:"gray-0"},n.message))}))))};return t}());k.style=w;var v=".sc-zonos-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-payment-h *.sc-zonos-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-payment-h img.sc-zonos-payment{max-width:100%}.sc-zonos-payment-h dl.sc-zonos-payment,.sc-zonos-payment-h dd.sc-zonos-payment,.sc-zonos-payment-h h1.sc-zonos-payment,.sc-zonos-payment-h h2.sc-zonos-payment,.sc-zonos-payment-h h3.sc-zonos-payment,.sc-zonos-payment-h h4.sc-zonos-payment,.sc-zonos-payment-h h5.sc-zonos-payment,.sc-zonos-payment-h h6.sc-zonos-payment,.sc-zonos-payment-h hr.sc-zonos-payment,.sc-zonos-payment-h figure.sc-zonos-payment,.sc-zonos-payment-h p.sc-zonos-payment,.sc-zonos-payment-h pre.sc-zonos-payment{margin:0}.sc-zonos-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-payment-h .zonos--title.sc-zonos-payment{margin-bottom:16px}.sc-zonos-payment-h .zonos--payment-component.sc-zonos-payment{margin-bottom:4px}";var _=v;var I=t("zonos_payment",function(){function t(t){n(this,t);this.trackingSent=false;this.titleText=undefined;this.stripe=h.stripe;this.stripeElements=h.stripeElements;this.isPaymentInfoFilled=false}t.prototype.watchIsPaymentInfoFilled=function(){var t;if(this.isPaymentInfoFilled&&!this.trackingSent){var n=p.checkoutSessionId;void l({checkoutSessionId:n,eventName:"checkout_paymentInfoFilled",metadata:{paymentMethod:(t=h.stripePaymentEventData)===null||t===void 0?void 0:t.value.type}});this.trackingSent=true}};t.prototype.watchInitStripe=function(){var t=this;if(!this.stripeElements){return}var n=h.stripePaymentElement||this.stripeElements.create("payment",{layout:"tabs"});var o=this.el.querySelector(".zonos--payment-component");if(!o){y("Cannot find container element for paymentElement");return}n.mount(o);n.on("change",(function(n){if(n.complete){t.isPaymentInfoFilled=true}h.stripePaymentEventData=n}));h.stripePaymentElement=n};t.prototype.componentDidLoad=function(){this.watchInitStripe()};t.prototype.render=function(){return o(e,{key:"7210a20afba18d167a6e7d875ba23daa0db774e4",class:"zonos--payment zonos--elements"},this.titleText&&o("zonos-text",{key:"4f043b3149cca48d2f4463a826541ebe35d0b6ca",class:"zonos--title",type:"semiBoldLabel"},this.titleText),o("div",{key:"15721e208e90b969c075877680a02dca5bb81689",class:"zonos--payment-component"}),o("div",{key:"36d5767821464db479feff18e6368e862550c777",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{isPaymentInfoFilled:["watchIsPaymentInfoFilled"],stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}},enumerable:false,configurable:true});return t}());I.style=_;var j=".sc-zonos-paypal-payment-h{font-family:var(--zonos--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-paypal-payment-h *.sc-zonos-paypal-payment{font-family:var(--zonos--font-family, Inter), Inter}.sc-zonos-paypal-payment-h img.sc-zonos-paypal-payment{max-width:100%}.sc-zonos-paypal-payment-h dl.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h dd.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h1.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h2.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h3.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h4.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h5.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h h6.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h hr.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h figure.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h p.sc-zonos-paypal-payment,.sc-zonos-paypal-payment-h pre.sc-zonos-paypal-payment{margin:0}.sc-zonos-paypal-payment-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-paypal-payment-h{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-direction:column;flex-direction:column}";var S=j;var O=t("zonos_paypal_payment",function(){function t(t){n(this,t);this.paypalSessionDone=a(this,"paypalSessionDone",7);this.paypalSessionFail=a(this,"paypalSessionFail",7)}t.prototype.loadPaypal=function(){return __awaiter(this,void 0,void 0,(function(){var t,n;var o=this;return __generator(this,(function(e){if(!window.Zonos.paypal){f("Paypal is not available");return[2]}t=m({onPaypalFail:function(){f("onPaypalFail");o.paypalSessionFail.emit()},onPaypalSessionDone:function(t){var n=t.orderId;f("onPaypalSessionDone","info",{orderId:n});o.paypalSessionDone.emit({orderId:n})}});if(!(t===null||t===void 0?void 0:t.length)){f("There are no paypal buttons available");return[2]}n=this.el.querySelector(".zonos--payment-paypal-container");if(!n){f("Cannot find container element for paypal buttons");return[2]}t.forEach((function(t){return __awaiter(o,void 0,void 0,(function(){return __generator(this,(function(o){switch(o.label){case 0:return[4,t.render(n)];case 1:o.sent();return[2]}}))}))}));return[2]}))}))};t.prototype.componentDidLoad=function(){void this.loadPaypal()};t.prototype.render=function(){return o(e,{key:"e8c839cc9d0286f5ae4643243b14fa66f9584833",class:"zonos--paypal-payment zonos--elements"},o("div",{key:"cac06948de1ccca97ba65eca10b3e5d9f3a9a362",class:"zonos--payment-paypal-container"}))};Object.defineProperty(t.prototype,"el",{get:function(){return s(this)},enumerable:false,configurable:true});return t}());O.style=S}}}));