@zonos/elements 1.3.79 → 1.3.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{CheckoutConfig-2fef694e.js → CheckoutConfig-850071ae.js} +1 -1
- package/dist/cjs/{cart-977c9d4c.js → cart-97e693e4.js} +4 -5
- package/dist/cjs/{createCustomEvent-2b19361e.js → createCustomEvent-777b3fa7.js} +2 -2
- package/dist/cjs/{handleFetch-661a8225.js → handleFetch-45e76490.js} +29 -1
- package/dist/cjs/index.cjs.js +10 -10
- package/dist/cjs/{paypal-3008c89e.js → paypal-16029169.js} +2 -2
- package/dist/cjs/zonos-address_8.cjs.entry.js +2 -2
- package/dist/cjs/zonos-badge_13.cjs.entry.js +4 -4
- package/dist/cjs/zonos-checkout.cjs.entry.js +17 -5
- package/dist/cjs/zonos-controller.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-flag.cjs.entry.js +2 -2
- package/dist/cjs/zonos-country-select_4.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello-dialog.cjs.entry.js +2 -2
- package/dist/cjs/zonos-hello.cjs.entry.js +2 -2
- package/dist/cjs/zonos-language-select_2.cjs.entry.js +2 -2
- package/dist/cjs/zonos-notification_3.cjs.entry.js +3 -3
- package/dist/collection/components/checkout/zonos-checkout/zonos-checkout.js +14 -1
- package/dist/collection/components/store/checkout/stripe.js +1 -1
- package/dist/collection/components/store/hello/localization.js +2 -3
- package/dist/collection/components/utils/handleFetch.js +1 -0
- package/dist/collection/components/utils/logging/log.js +26 -1
- package/dist/collection/components/utils/logging/sendErrorLog.js +2 -0
- package/dist/collection/scripts/_extractZonosQaUrl.js +16 -0
- package/dist/collection/scripts/_getZonosQaUrl.js +13 -4
- package/dist/esm/{CheckoutConfig-c7954c2a.js → CheckoutConfig-c0ec120d.js} +1 -1
- package/dist/esm/{cart-414322dc.js → cart-9bf6dece.js} +4 -5
- package/dist/esm/{createCustomEvent-fcd6d294.js → createCustomEvent-a18e45a2.js} +2 -2
- package/dist/esm/{handleFetch-80ecfb91.js → handleFetch-0133265e.js} +29 -2
- package/dist/esm/index.js +11 -11
- package/dist/esm/{paypal-3fecd52f.js → paypal-edab4cee.js} +2 -2
- package/dist/esm/zonos-address_8.entry.js +2 -2
- package/dist/esm/zonos-badge_13.entry.js +4 -4
- package/dist/esm/zonos-checkout.entry.js +17 -5
- package/dist/esm/zonos-controller.entry.js +2 -2
- package/dist/esm/zonos-country-flag.entry.js +2 -2
- package/dist/esm/zonos-country-select_4.entry.js +2 -2
- package/dist/esm/zonos-hello-dialog.entry.js +2 -2
- package/dist/esm/zonos-hello.entry.js +2 -2
- package/dist/esm/zonos-language-select_2.entry.js +2 -2
- package/dist/esm/zonos-notification_3.entry.js +3 -3
- package/dist/esm-es5/{CheckoutConfig-c7954c2a.js → CheckoutConfig-c0ec120d.js} +1 -1
- package/dist/esm-es5/{cart-414322dc.js → cart-9bf6dece.js} +1 -1
- package/dist/esm-es5/{createCustomEvent-fcd6d294.js → createCustomEvent-a18e45a2.js} +1 -1
- package/dist/esm-es5/handleFetch-0133265e.js +1 -0
- package/dist/esm-es5/index.js +1 -1
- package/dist/esm-es5/{paypal-3fecd52f.js → paypal-edab4cee.js} +1 -1
- package/dist/esm-es5/zonos-address_8.entry.js +1 -1
- package/dist/esm-es5/zonos-badge_13.entry.js +1 -1
- package/dist/esm-es5/zonos-checkout.entry.js +1 -1
- package/dist/esm-es5/zonos-controller.entry.js +1 -1
- package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
- package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
- package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
- package/dist/esm-es5/zonos-hello.entry.js +1 -1
- package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
- package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
- package/dist/scripts/index.js +1 -1
- package/dist/scripts/loadZonos.js +1 -1
- package/dist/scripts/zonos.js +1 -1
- package/dist/types/components/utils/logging/log.d.ts +2 -1
- package/dist/types/scripts/_extractZonosQaUrl.d.ts +1 -0
- package/dist/types/scripts/_getZonosQaUrl.d.ts +1 -1
- package/dist/zonos-elements/index.esm.js +1 -1
- package/dist/zonos-elements/p-197c5707.system.js +1 -0
- package/dist/zonos-elements/{p-ced3aa4f.system.entry.js → p-1b8c8e0c.system.entry.js} +1 -1
- package/dist/zonos-elements/p-214724f8.system.entry.js +1 -0
- package/dist/zonos-elements/{p-d5818f0a.js → p-23358611.js} +1 -1
- package/dist/zonos-elements/{p-0290df9c.entry.js → p-264fbd27.entry.js} +1 -1
- package/dist/zonos-elements/{p-9c02a170.system.js → p-49478dba.system.js} +1 -1
- package/dist/zonos-elements/{p-0a1db77d.system.entry.js → p-51f8c3d5.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-0f640802.system.js → p-62044821.system.js} +1 -1
- package/dist/zonos-elements/{p-75fd8895.js → p-6b4fec5a.js} +1 -1
- package/dist/zonos-elements/{p-a725574a.entry.js → p-6f821997.entry.js} +1 -1
- package/dist/zonos-elements/{p-c2920074.js → p-7ca0622f.js} +1 -1
- package/dist/zonos-elements/{p-cce51fa5.system.entry.js → p-811ed9bf.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-81cdd0d5.system.js → p-8c0ff373.system.js} +1 -1
- package/dist/zonos-elements/{p-f8dace42.system.entry.js → p-8cbbdd53.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-86bfda32.system.entry.js → p-8dae668f.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-bbabc829.system.entry.js → p-92ba4082.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-e68941ce.system.entry.js → p-95f0ffd1.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-982aa677.entry.js → p-97f0d9d2.entry.js} +1 -1
- package/dist/zonos-elements/{p-72f0641d.entry.js → p-a2fedd1c.entry.js} +1 -1
- package/dist/zonos-elements/{p-3d01ac9a.entry.js → p-a3200d5c.entry.js} +1 -1
- package/dist/zonos-elements/p-ad7ce197.js +1 -0
- package/dist/zonos-elements/{p-6b3fd741.js → p-b8e85bf5.js} +1 -1
- package/dist/zonos-elements/p-bc4a147d.entry.js +1 -0
- package/dist/zonos-elements/p-c78dd680.system.js +1 -1
- package/dist/zonos-elements/{p-acbec292.system.entry.js → p-d08ed3ea.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-2d466263.system.js → p-d26d827d.system.js} +1 -1
- package/dist/zonos-elements/{p-1047233d.entry.js → p-d775bd42.entry.js} +1 -1
- package/dist/zonos-elements/{p-4032de50.entry.js → p-df4deb97.entry.js} +1 -1
- package/dist/zonos-elements/p-e3cb74fd.system.js +1 -0
- package/dist/zonos-elements/{p-166b3181.entry.js → p-e468f85e.entry.js} +1 -1
- package/dist/zonos-elements/{p-f0d6f027.system.entry.js → p-f7b5ae86.system.entry.js} +1 -1
- package/dist/zonos-elements/{p-c1400636.entry.js → p-fac38f60.entry.js} +1 -1
- package/dist/zonos-elements/zonos-elements.esm.js +1 -1
- package/package.json +1 -1
- package/dist/esm-es5/handleFetch-80ecfb91.js +0 -1
- package/dist/zonos-elements/p-2ec2e9d3.js +0 -1
- package/dist/zonos-elements/p-502d5e52.system.entry.js +0 -1
- package/dist/zonos-elements/p-5880738e.system.js +0 -1
- package/dist/zonos-elements/p-c4957e35.system.js +0 -1
- package/dist/zonos-elements/p-e6ec9f12.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,c as o,h as e,H as t,d as i}from"./p-5b7da777.js";import{j as n,l as a,t as d}from"./p-75fd8895.js";import{i as l}from"./p-81a54668.js";import{a as r}from"./p-2ec2e9d3.js";import{i as c,c as h}from"./p-0c64dbbb.js";import{z as f,d as b}from"./p-1086aac3.js";import{c as p}from"./p-b4b7f705.js";import{R as m}from"./p-08e7107d.js";import{g as u}from"./p-1ca5696d.js";import{i as z}from"./p-a1b755bf.js";const y=class{constructor(e){s(this,e),this.invalidCharacters=o(this,"invalidCharacters",7),this.type=void 0,this.titleText=void 0,this.defaultAddress=null,this.stripe=window.Zonos.stripe,this.isDirtyAddress=!1}getStripeAddressInstance(){return"billing"===this.type?{stripeAddressElement:n.stripeBillingAddressElement,stripeAddressEventData:n.stripeBillingAddressEventData,stripeElements:n.stripeElementsForBillingAddress}:{stripeAddressElement:n.stripeAddressElement,stripeAddressEventData:n.stripeAddressEventData,stripeElements:n.stripeElements}}updateAddressEventData({event:s,type:o}){"billing"===o?n.stripeBillingAddressEventData=s:n.stripeAddressEventData=s}updateAddressElement({stripeAddressElement:s,type:o}){"shipping"!==o?n.stripeBillingAddressElement=s:n.stripeAddressElement=s}async watchInitStripe(){var s,o;this.stripe=window.Zonos.stripe;const{stripeAddressEventData:e,stripeElements:t}=this.getStripeAddressInstance();if(!this.stripe||!t)return void r("Stripe is not initialized. Couldn't load stripe element.");(null===(s=this.defaultAddress)||void 0===s?void 0:s.phone)||null===(o=this.defaultAddress)||void 0===o||delete o.phone;const i=a.shippingZoneCountries,n=i?Object.values(i).map((s=>s.code)):[],d=t.create("address",{allowedCountries:"shipping"===this.type?n:[],contacts:this.defaultAddress&&!e?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},null==e?void 0:e.value.address),{country:(null==e?void 0:e.value.address.country)||a.selectedCountryCode||"AL"}),firstName:null==e?void 0:e.value.firstName,lastName:null==e?void 0:e.value.lastName,phone:null==e?void 0:e.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});d.mount(this.el.querySelector(".zonos--address-component")),d.on("change",(s=>{const o=s.value;!this.isDirtyAddress&&o.address.line1.length>=3&&(this.isDirtyAddress=!0,setTimeout((()=>{if(l())this.el.scrollIntoView({behavior:"smooth",block:"end"});else{const s="shipping"===this.type?100:600,o=this.el.closest(".zonos--group"),e=this.el.getBoundingClientRect().top+s;null==o||o.scrollTo({behavior:"smooth",top:e})}}),600)),this.updateAddressEventData({event:Object.assign(Object.assign({},s),{elementMode:this.type,elementType:"address",value:Object.assign(Object.assign({},o),{firstName:o.firstName||o.name.split(" ")[0],lastName:o.lastName||o.name.split(" ")[1]})}),type:this.type})})),this.updateAddressElement({stripeAddressElement:d,type:this.type})}disconnectedCallback(){const s=this.getStripeAddressInstance().stripeAddressElement;null==s||s.destroy()}componentDidLoad(){const s=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!s&&s.value.address.line1.length>0,this.watchInitStripe()}render(){return e(t,{key:"2cecb49ed22bd0d5ce22c4f2110b37ecf7935cca",class:"zonos--address zonos--elements"},e("zonos-text",{key:"101635210ab6cb3b9a44b47eec101187d1c3a4ac",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"049f2b86986471d45bd413813307ec489d9f1993",class:"zonos--address-component"}))}get el(){return i(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};y.style=".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";const g=class{constructor(o){s(this,o),this.currentAddress=void 0,this.addressType=void 0}render(){var s;const{city:o,country:i,email:n,line1:l,line2:r,name:h,phone:f,postal_code:b,state:p}=this.currentAddress,m=null===(s=a.shippingZoneCountries)||void 0===s?void 0:s[i],u=({bold:s,content:o})=>{const t=c(o)?"red-600":"gray-1200";return e("zonos-text",{textColor:t,type:s?"boldLabel":"body"},o)};return e(t,{class:"zonos--address-form zonos--elements"},e("div",{class:"zonos--title"},e("zonos-text",{textColor:"gray-700",type:"smallHeader"},d("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{class:"zonos--address-group"},h&&e("div",{class:"zonos--address-line"},u({bold:!0,content:h})),n&&e("div",{class:"zonos--address-line"},u({content:n})),f&&e("div",{class:"zonos--address-line"},u({content:f})),l&&e("div",{class:"zonos--address-line"},u({content:l})),r&&e("div",{class:"zonos--address-line"},u({content:r})),e("div",{class:"zonos--address-line"},o&&u({content:o}),p&&u({content:p}),b&&u({content:b})),m&&e("div",{class:"zonos--address-line"},e("zonos-country-flag",{class:"zonos--country-flag",countryCode:m.code})," ",u({content:m.displayName}))))}};g.style=':host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:", ";color:var(--zonos-elements-gray-1200);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}';const v=class{constructor(e){s(this,e),this.addressChange=o(this,"addressChange",7),this.onInputChange=({key:s,value:o})=>{this.addressChange.emit(Object.assign(Object.assign({},this.localAddress),{[s]:o}))},this.currentAddress=void 0,this.translatedAddress=void 0,this.addressType=void 0,this.localAddress=this.currentAddress}watchCurrentAddress(){var s,o,e,t,i,n;const{city:a,line1:d,line2:l,name:r,postal_code:c,state:h}=this.currentAddress;this.localAddress=Object.assign(Object.assign({},this.currentAddress),{city:(null===(s=this.translatedAddress.city)||void 0===s?void 0:s[a])||a,line1:(null===(o=this.translatedAddress.line1)||void 0===o?void 0:o[d])||d,line2:(null===(e=this.translatedAddress.line2)||void 0===e?void 0:e[l])||l,name:(null===(t=this.translatedAddress.name)||void 0===t?void 0:t[r])||r,postal_code:(null===(i=this.translatedAddress.postal_code)||void 0===i?void 0:i[c])||c,state:(null===(n=this.translatedAddress.state)||void 0===n?void 0:n[h])||h})}componentWillLoad(){this.watchCurrentAddress()}render(){const{city:s,country:o,line1:i,line2:n,name:a,phone:l,postal_code:r,state:h}=this.localAddress,f=a.split(" ")[0]||"",b=a.split(" ").slice(1).join(" ")||"";return e(t,{key:"8b578737e33203a23563be7e9be0778deec99bbf",class:"zonos--address-form zonos--elements"},e("div",{key:"793675a1348547bf3f781788956befe325191011",class:"zonos--title"},e("zonos-text",{key:"13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9",textColor:"gray-700",type:"smallHeader"},d("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{key:"2c5de5b5283fb99ee5f8b61d7a217177986fc2db",class:"zonos--address-group"},e("div",{key:"23bf3c893071000d5995a5f175867bab11929193",class:"zonos--contact"},e("zonos-text",{key:"7cdfe2a84ebad89ba5b16498d75def99cf392384",type:"label"},d("Contact")),e("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:d("Email"),inputValue:this.currentAddress.email,isDisabled:!0}),e("div",{key:"cbdf61217125e22b1a6cec9a340ef0aca2c75670",class:"zonos--name zonos--address-row"},e("zonos-input",{key:"360c99e7b2c6caa64580d5768b5bb53368927275",class:"zonos--form-first-name",inputLabel:d("First name"),inputValue:f,isError:c(f),onInputChange:s=>this.onInputChange({key:"name",value:`${s.detail} ${b}`})}),e("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:d("Last name"),inputValue:b,isError:c(b),onInputChange:s=>this.onInputChange({key:"name",value:`${f} ${s.detail}`})}))),e("div",{key:"7b4fa2d3baa6cb257e7688e5ba6777123898b3fd",class:"zonos--address"},e("zonos-text",{key:"9d5782331b2642755a755aeb7f98c9f4d87f9a20",type:"label"},d("Address")),e("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:d("Country"),inputValue:o,isDisabled:!0}),e("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:d("Address line 1"),inputValue:i,isError:c(i),onInputChange:s=>this.onInputChange({key:"line1",value:s.detail})}),e("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:d("Address line 2"),inputValue:n,isError:c(n),onInputChange:s=>this.onInputChange({key:"line2",value:s.detail})}),e("div",{key:"dc166be9381142835d72e731cb38a718522a068a",class:"zonos--address-row"},e("zonos-input",{key:"4f1a98f9d10ce0cff3ef18a3037a12382552b31d",class:"zonos--form-city",inputLabel:d("City"),inputValue:s,isError:c(s),onInputChange:s=>this.onInputChange({key:"city",value:s.detail})}),e("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:d("State/Province"),inputValue:h,isError:c(h),onInputChange:s=>this.onInputChange({key:"state",value:s.detail})})),e("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:d("Postal code"),inputValue:r,isError:c(r),onInputChange:s=>this.onInputChange({key:"postal_code",value:s.detail})}),e("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:d("Phone number"),inputValue:l,onInputChange:s=>this.onInputChange({key:"phone",value:s.detail})}))))}static get watchers(){return{translatedAddress:["watchCurrentAddress"]}}};v.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";const x=class{constructor(e){s(this,e),this.closeUpdateDialog=o(this,"closeUpdateDialog",7),this.continueClicked=o(this,"continueClicked",7),this.closeUpdateDialogHandler=()=>{this.closeUpdateDialog.emit()},this.getTranslatedAddress=({currentAddress:s,translatedAddress:o})=>{var e,t,i,n,a,d;const{city:l,line1:r,line2:c,name:h,postal_code:f,state:b}=s;return{city:(null===(e=o.city)||void 0===e?void 0:e[l])||l,line1:(null===(t=o.line1)||void 0===t?void 0:t[r])||r,line2:(null===(i=o.line2)||void 0===i?void 0:i[c])||c,name:(null===(n=o.name)||void 0===n?void 0:n[h])||h,postal_code:(null===(a=o.postal_code)||void 0===a?void 0:a[f])||f,state:(null===(d=o.state)||void 0===d?void 0:d[b])||b}},this.continueClickHandler=async()=>{var s,o,e;this.continueLoading=!0;const t=this.billingAddress?this.getTranslatedAddress({currentAddress:this.billingAddress,translatedAddress:this.translatedBillingAddressState}):null,i=this.getTranslatedAddress({currentAddress:this.shippingAddress,translatedAddress:this.translatedShippingAddressState}),n=h(Object.assign(Object.assign({},i),{country:this.shippingAddress.country})),a=t&&this.billingAddress&&h(Object.assign(Object.assign({},t),{country:this.billingAddress.country})),d=!!Object.keys(n).length,l=!!a&&!!Object.keys(a).length;if(d||l){const t=null===(s=this.el.shadowRoot)||void 0===s?void 0:s.querySelectorAll("zonos-address-form"),i=null==t?void 0:t[0],n=null==t?void 0:t[1],a=(null===(o=null==i?void 0:i.shadowRoot)||void 0===o?void 0:o.querySelector(".has-error"))||(null===(e=null==n?void 0:n.shadowRoot)||void 0===e?void 0:e.querySelector(".has-error"));return a&&a.scrollIntoView({behavior:"smooth",block:"center"}),void(this.continueLoading=!1)}this.continueClicked.emit({billingAddress:t,shippingAddress:i})},this.buildTranslateAddressState=({currentAddress:s,translatedAddress:o})=>{const{city:e,line1:t,line2:i,name:n,postal_code:a,state:d}=s;return{city:{[e]:o.city},line1:{[t]:o.line1},line2:{[i]:o.line2},name:{[n]:o.name},postal_code:{[a]:o.postal_code},state:{[d]:o.state}}},this.continueLoading=!1,this.dialogLoading=void 0,this.dialogOpen=!1,this.submitBtnType=void 0,this.submitBtnColor=void 0,this.isMobile=!1,this.shippingAddress=void 0,this.billingAddress=void 0,this.translatedShippingAddress=void 0,this.translatedBillingAddress=void 0,this.showErrorBanner=!1,this.translatedShippingAddressState={},this.translatedBillingAddressState={}}watchTranslatedShippingAddress(){this.translatedShippingAddressState=this.translatedShippingAddress}watchTranslatedBillingAddress(){this.translatedBillingAddressState=this.translatedBillingAddress}componentWillLoad(){this.watchTranslatedBillingAddress(),this.watchTranslatedShippingAddress()}render(){const s="#ffffff"===(this.submitBtnColor||f.appearance.colorSecondary)?"outline":this.submitBtnType||"standard",o=this.billingAddress,i=this.shippingAddress;return e(t,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:p(["zonos--address-update-dialog zonos--elements",this.isMobile&&"mobile"])},e("zonos-dialog",{key:"eab429bb78ce6f05ba463d8748d7edd5499402fa",isLoading:this.dialogLoading,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeUpdateDialog.emit(),open:this.dialogOpen,width:"568px"},e("div",{key:"08f0400e62addfcaffd91bf5200999d29bbd2da9",class:"zonos--body"},e("div",{key:"8699df5e2f823e19066fbb552ba2a66c127c05e9",class:"zonos--dialog-header"},e("div",{key:"92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3",class:"zonos--dialog-title"},e("zonos-text",{key:"aaac3375526bddb319ce7c8f49bde30da7210264",type:"title"},d("Update your address")),e("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:m}),noBackground:!0,onClick:()=>this.closeUpdateDialogHandler()})),e("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},d("To ensure delivery all address details must be in Latin characters."))),e("div",{key:"2cb61f06ce174e2317870decfdd337c67c5cf128",class:"zonos--group"},e("zonos-text",{key:"a616c540984120b468e52bccfb380ea3974ced22",class:"zonos--what-you-entered",type:"semiBoldLabel"},d("What you entered")),e("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},e("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:i}),o&&e("zonos-address-display",{key:"7ea1683dc04a292810e04ed6550d86086f25186f",addressType:"billing",currentAddress:o})),e("div",{key:"4d1cd9096943518b8b4e267608a5e1542befb6a9",class:"zonos--address-form-section"},e("zonos-text",{key:"e4184a2cc618d26d43979fa8cfe06070cf8b5af8",type:"semiBoldLabel"},d("Translated address")),e("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:i,onAddressChange:s=>{this.translatedShippingAddressState=this.buildTranslateAddressState({currentAddress:i,translatedAddress:s.detail})},translatedAddress:this.translatedShippingAddressState}),o&&e("zonos-address-form",{key:"c3facc295b1322bb00baa6081f343dcea4f10777",addressType:"billing",class:"zonos--billing-address-form",currentAddress:o,onAddressChange:s=>{this.translatedBillingAddressState=this.buildTranslateAddressState({currentAddress:o,translatedAddress:s.detail})},translatedAddress:this.translatedBillingAddressState}))),e("div",{key:"1c89c9604ba0dece40275fcfac97e7f93706b430",class:"zonos--group-btn"},e("div",{key:"e47d393940b094b4e123864e4070daa87f0616f0",class:"zonos--button-wrapper"},e("zonos-button",{key:"216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6",class:"zonos--cancel-btn",onClick:()=>this.closeUpdateDialogHandler(),variant:"subtle"},d("Cancel")),e("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:()=>this.continueClickHandler(),size:"sm",variant:s},d("Update address")))))))}get el(){return i(this)}static get watchers(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}}};x.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:32px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--group::-webkit-scrollbar{width:10px}:host .zonos--group::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--group::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--group::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--address-display-group{display:-ms-flexbox;display:flex;gap:8px;margin-bottom:20px}:host .zonos--address-display-group zonos-address-display{-ms-flex:1;flex:1}:host .zonos--what-you-entered{margin-bottom:8px}:host .zonos--address-form-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--update-btn{-ms-flex-order:1;order:1}";const k=["blue","cyan","green","orange","purple","red","gray","glass"],w=class{constructor(e){s(this,e),this.checkboxSelected=o(this,"checkboxSelected",7),this.backgroundColor="blue",this.label=void 0,this.isChecked=!1,this.isDisabled=!1,this.size=12,this.fontSize="base",this.borderStyle=void 0}onClick(){this.isDisabled||this.checkboxSelected.emit(!this.isChecked)}render(){const s=k.includes(this.backgroundColor),o=s?`var(--zonos-elements-${this.backgroundColor}-600)`:this.backgroundColor,i=s?`var(--zonos-elements-${this.backgroundColor}-200)`:z(o)?"var(--zonos-elements-gray-0)":"var(--zonos-elements-gray-800)",n=u({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return e(t,{key:"bf51dd642e88096e874d78023a29dd68239e8d3a",class:p(["zonos--elements zonos--checkbox"]),style:{"--background-color":o,"--border-radius":n,"--font-family":b(),"--size":`${this.size}px`}},e("label",{key:"3598c9f21285304499aaafbab5226d619ecf4e69",class:p([this.isDisabled&&"disabled"])},e("input",{key:"277507f643404e6e44191c2d715b70f38fc6af85",checked:this.isChecked,disabled:this.isDisabled,hidden:!0,onChange:s=>{this.checkboxSelected.emit(s.target.checked)},type:"checkbox"}),e("span",{key:"3f0fd0d458e8cf660fa883ceaa241e3397829548",class:"checkmark-container"},e("svg",{key:"0d654744bea5b5696ddcf3778a155fb622022f1e",class:"checkmark",color:i,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e("path",{key:"cc19837ee088feb7053fdaeaea0d1213cbc60775","clip-rule":"evenodd",d:"M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z",fill:"currentColor","fill-rule":"evenodd"}))),this.label&&e("zonos-text",{key:"cb85d59651f67a33126d37c3ebfb1e8a91b457fe",size:this.fontSize},this.label)))}};w.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--size);width:var(--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--background-color);border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";const A=class{constructor(o){s(this,o),this.collapsed=!1,this.collapseSize=0,this.height=this.el.scrollHeight,this.iframe=null}getElementHeight(){return this.collapsed?`${this.collapseSize}px`:`${this.height}px`}componentDidLoad(){this.height=this.el.scrollHeight}componentDidRender(){var s,o,e;this.iframe=(null===(s=this.el.shadowRoot)||void 0===s?void 0:s.querySelector("iframe"))||null,null===(e=null===(o=this.iframe)||void 0===o?void 0:o.contentWindow)||void 0===e||e.addEventListener("resize",(()=>{this.iframe&&(this.height=parseFloat(getComputedStyle(this.iframe).height))}))}render(){return this.collapsed?this.el.style.overflow="hidden":setTimeout((()=>{this.collapsed||(this.el.style.overflow="visible")}),300),e(t,{key:"7cc2167ab3dab1a975d141f3c58d3c5982c1645a",class:"zonos--elements zonos--collapse",style:{"--font-family":b(),height:this.getElementHeight()}},e("div",{key:"1b791702f95066643ac82402a9fcff19b0fcc706"},e("iframe",{key:"08f678a4ce92f5600c584e329e3039bc4588ff3a",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),e("slot",{key:"83119f9ba9764c46fa7d1dd7b4c0b08c49033607"})))}get el(){return i(this)}};A.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";const C=class{constructor(e){s(this,e),this.closeDialog=o(this,"closeDialog",3),this.isMobileMode=()=>this.mobile||window.innerWidth<=768,this.closeButtonHandler=()=>{this.open&&this.closeDialog.emit()},this.clickOutsideDialogHandler=s=>{s.target!==s.currentTarget||this.noClickOutside||this.closeDialog.emit()},this.open=!1,this.headerText="",this.width="460px",this.height=void 0,this.minHeight=void 0,this.noHeader=!1,this.noBodyPadding=!1,this.noBorder=!1,this.borderStyle=void 0,this.noCloseButton=!1,this.noClickOutside=!1,this.mobile=!1,this.isLoading=!0,this.isMobile=!1}handleWindowResize(){this.isMobile=this.isMobileMode()}handleKeyDown(s){"Escape"===s.key&&this.closeButtonHandler()}componentDidLoad(){this.isMobile=this.isMobileMode()}render(){document.body.style.overflow=this.open?"hidden":"auto";const s=u({overrideBorderStyle:this.borderStyle});return e(t,{key:"03735385e07c7f6c8a87df42ad95f8c9d9533668",class:p(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":s,"--font-family":b(),"--height":this.height||"initial","--min-height":this.minHeight||"500px","--width":this.width}},e("div",{key:"da5d599e1a247f7e3364e6f5c9b2eae3db9539f5",class:"zonos--backdrop"}),e("div",{key:"cda1a996d9521c2e0b307f7a03ca3ee3d4915b8d",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},e("div",{key:"471d8a069d4f580233bdb3e9e971efdb268ef57d",class:"zonos--dialog"},this.isLoading&&e("div",{key:"57220007aabcaef133c2c0782fa238cc43d63964",class:"zonos--loading"},e("zonos-spinner",{key:"0298b754341abd61ec07706128d05df5332f915d",size:30})),(this.headerText||!this.noCloseButton)&&e("div",{key:"5103dbc1c7593a8042505f767d8290825f9d10e7",class:"zonos--header"},this.headerText&&e("h3",{key:"a2d9cd4c8cb359aa64cf104a172ca960068c20a0",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&e("zonos-button",{key:"de9bf8a949344d19fcb8bfb496719282553be194",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close dialog",content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-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" clip-rule="evenodd"/><path fill="#4D505A" fill-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" clip-rule="evenodd"/></svg>'}),noBackground:!0,onClick:this.closeButtonHandler,variant:"subtle"})),e("div",{key:"1ec2cdca0f186cd0b28602580022ed0cb4b0eec9",class:p(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},e("slot",{key:"5071d921f48bf792a951a390d83b121e32771668"})),e("slot",{key:"c1818ac301afc845f5b14fd0f2ac9a1fd3a27b99",name:"dialog-footer"}))))}static get assetsDirs(){return["assets"]}};C.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--loading{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;z-index:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--border-radius, var(--zonos-elements-radius-10))}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--min-height, auto);height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";const I=class{constructor(o){s(this,o),this.titleText=void 0,this.defaultEmail=null,this.stripe=n.stripe}watchInitStripe(){if(!this.stripe||!n.stripeElements)return;const s=n.stripeLinkElement||n.stripeElements.create("linkAuthentication",{defaultValues:(this.defaultEmail?{email:this.defaultEmail}:void 0)||void 0}),o=this.el.querySelector(".zonos--link-authentication-component");o?(s.mount(o),s.on("change",(s=>{n.stripeLinkEventData=s})),n.stripeLinkElement=s):r("Cannot find container element for linkAuthenticationElement")}componentDidLoad(){this.watchInitStripe()}render(){return e(t,{key:"f0b26abf99ef99c6665dabdddebc9ff086b6816c",class:"zonos--link-authentication zonos--elements"},e("zonos-text",{key:"898dbdffac06fe2a68af90610a22044bb72391ce",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"e2ec9abb0cf76a39a1262e1366e375dd898450cd",class:"zonos--link-authentication-component"}))}get el(){return i(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};I.style=".sc-zonos-link-authentication-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}";export{y as zonos_address,g as zonos_address_display,v as zonos_address_form,x as zonos_address_update_dialog,w as zonos_checkbox,A as zonos_collapse,C as zonos_dialog,I as zonos_link_authentication}
|
|
1
|
+
import{r as s,c as o,h as e,H as t,d as i}from"./p-5b7da777.js";import{j as n,l as a,t as d}from"./p-6b4fec5a.js";import{i as l}from"./p-81a54668.js";import{a as r}from"./p-ad7ce197.js";import{i as c,c as h}from"./p-0c64dbbb.js";import{z as f,d as b}from"./p-1086aac3.js";import{c as p}from"./p-b4b7f705.js";import{R as m}from"./p-08e7107d.js";import{g as u}from"./p-1ca5696d.js";import{i as z}from"./p-a1b755bf.js";const y=class{constructor(e){s(this,e),this.invalidCharacters=o(this,"invalidCharacters",7),this.type=void 0,this.titleText=void 0,this.defaultAddress=null,this.stripe=window.Zonos.stripe,this.isDirtyAddress=!1}getStripeAddressInstance(){return"billing"===this.type?{stripeAddressElement:n.stripeBillingAddressElement,stripeAddressEventData:n.stripeBillingAddressEventData,stripeElements:n.stripeElementsForBillingAddress}:{stripeAddressElement:n.stripeAddressElement,stripeAddressEventData:n.stripeAddressEventData,stripeElements:n.stripeElements}}updateAddressEventData({event:s,type:o}){"billing"===o?n.stripeBillingAddressEventData=s:n.stripeAddressEventData=s}updateAddressElement({stripeAddressElement:s,type:o}){"shipping"!==o?n.stripeBillingAddressElement=s:n.stripeAddressElement=s}async watchInitStripe(){var s,o;this.stripe=window.Zonos.stripe;const{stripeAddressEventData:e,stripeElements:t}=this.getStripeAddressInstance();if(!this.stripe||!t)return void r("Stripe is not initialized. Couldn't load stripe element.");(null===(s=this.defaultAddress)||void 0===s?void 0:s.phone)||null===(o=this.defaultAddress)||void 0===o||delete o.phone;const i=a.shippingZoneCountries,n=i?Object.values(i).map((s=>s.code)):[],d=t.create("address",{allowedCountries:"shipping"===this.type?n:[],contacts:this.defaultAddress&&!e?[this.defaultAddress]:[],defaultValues:{address:Object.assign(Object.assign({},null==e?void 0:e.value.address),{country:(null==e?void 0:e.value.address.country)||a.selectedCountryCode||"AL"}),firstName:null==e?void 0:e.value.firstName,lastName:null==e?void 0:e.value.lastName,phone:null==e?void 0:e.value.phone},display:{name:"split"},fields:{phone:"always"},mode:this.type,validation:{phone:{required:"always"}}});d.mount(this.el.querySelector(".zonos--address-component")),d.on("change",(s=>{const o=s.value;!this.isDirtyAddress&&o.address.line1.length>=3&&(this.isDirtyAddress=!0,setTimeout((()=>{if(l())this.el.scrollIntoView({behavior:"smooth",block:"end"});else{const s="shipping"===this.type?100:600,o=this.el.closest(".zonos--group"),e=this.el.getBoundingClientRect().top+s;null==o||o.scrollTo({behavior:"smooth",top:e})}}),600)),this.updateAddressEventData({event:Object.assign(Object.assign({},s),{elementMode:this.type,elementType:"address",value:Object.assign(Object.assign({},o),{firstName:o.firstName||o.name.split(" ")[0],lastName:o.lastName||o.name.split(" ")[1]})}),type:this.type})})),this.updateAddressElement({stripeAddressElement:d,type:this.type})}disconnectedCallback(){const s=this.getStripeAddressInstance().stripeAddressElement;null==s||s.destroy()}componentDidLoad(){const s=this.getStripeAddressInstance().stripeAddressEventData;this.isDirtyAddress=!!s&&s.value.address.line1.length>0,this.watchInitStripe()}render(){return e(t,{key:"2cecb49ed22bd0d5ce22c4f2110b37ecf7935cca",class:"zonos--address zonos--elements"},e("zonos-text",{key:"101635210ab6cb3b9a44b47eec101187d1c3a4ac",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"049f2b86986471d45bd413813307ec489d9f1993",class:"zonos--address-component"}))}get el(){return i(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};y.style=".sc-zonos-address-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-address-h *.sc-zonos-address{font-family:var(--font-family, Inter), Inter}.sc-zonos-address-h img.sc-zonos-address{max-width:100%}.sc-zonos-address-h dl.sc-zonos-address,.sc-zonos-address-h dd.sc-zonos-address,.sc-zonos-address-h h1.sc-zonos-address,.sc-zonos-address-h h2.sc-zonos-address,.sc-zonos-address-h h3.sc-zonos-address,.sc-zonos-address-h h4.sc-zonos-address,.sc-zonos-address-h h5.sc-zonos-address,.sc-zonos-address-h h6.sc-zonos-address,.sc-zonos-address-h hr.sc-zonos-address,.sc-zonos-address-h figure.sc-zonos-address,.sc-zonos-address-h p.sc-zonos-address,.sc-zonos-address-h pre.sc-zonos-address{margin:0}.sc-zonos-address-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-address-h .zonos--title.sc-zonos-address{margin-bottom:16px}.sc-zonos-address-h zonos-banner.sc-zonos-address{margin-top:8px}";const g=class{constructor(o){s(this,o),this.currentAddress=void 0,this.addressType=void 0}render(){var s;const{city:o,country:i,email:n,line1:l,line2:r,name:h,phone:f,postal_code:b,state:p}=this.currentAddress,m=null===(s=a.shippingZoneCountries)||void 0===s?void 0:s[i],u=({bold:s,content:o})=>{const t=c(o)?"red-600":"gray-1200";return e("zonos-text",{textColor:t,type:s?"boldLabel":"body"},o)};return e(t,{class:"zonos--address-form zonos--elements"},e("div",{class:"zonos--title"},e("zonos-text",{textColor:"gray-700",type:"smallHeader"},d("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{class:"zonos--address-group"},h&&e("div",{class:"zonos--address-line"},u({bold:!0,content:h})),n&&e("div",{class:"zonos--address-line"},u({content:n})),f&&e("div",{class:"zonos--address-line"},u({content:f})),l&&e("div",{class:"zonos--address-line"},u({content:l})),r&&e("div",{class:"zonos--address-line"},u({content:r})),e("div",{class:"zonos--address-line"},o&&u({content:o}),p&&u({content:p}),b&&u({content:b})),m&&e("div",{class:"zonos--address-line"},e("zonos-country-flag",{class:"zonos--country-flag",countryCode:m.code})," ",u({content:m.displayName}))))}};g.style=':host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:12px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:4px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-line{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .zonos--address-line zonos-text+zonos-text::before{content:", ";color:var(--zonos-elements-gray-1200);margin-right:4px}:host .zonos--country-flag{width:20px;height:14px;border-radius:2px;margin:1px;position:relative;overflow:hidden;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);margin-right:8px;z-index:10;justify-self:center}';const v=class{constructor(e){s(this,e),this.addressChange=o(this,"addressChange",7),this.onInputChange=({key:s,value:o})=>{this.addressChange.emit(Object.assign(Object.assign({},this.localAddress),{[s]:o}))},this.currentAddress=void 0,this.translatedAddress=void 0,this.addressType=void 0,this.localAddress=this.currentAddress}watchCurrentAddress(){var s,o,e,t,i,n;const{city:a,line1:d,line2:l,name:r,postal_code:c,state:h}=this.currentAddress;this.localAddress=Object.assign(Object.assign({},this.currentAddress),{city:(null===(s=this.translatedAddress.city)||void 0===s?void 0:s[a])||a,line1:(null===(o=this.translatedAddress.line1)||void 0===o?void 0:o[d])||d,line2:(null===(e=this.translatedAddress.line2)||void 0===e?void 0:e[l])||l,name:(null===(t=this.translatedAddress.name)||void 0===t?void 0:t[r])||r,postal_code:(null===(i=this.translatedAddress.postal_code)||void 0===i?void 0:i[c])||c,state:(null===(n=this.translatedAddress.state)||void 0===n?void 0:n[h])||h})}componentWillLoad(){this.watchCurrentAddress()}render(){const{city:s,country:o,line1:i,line2:n,name:a,phone:l,postal_code:r,state:h}=this.localAddress,f=a.split(" ")[0]||"",b=a.split(" ").slice(1).join(" ")||"";return e(t,{key:"8b578737e33203a23563be7e9be0778deec99bbf",class:"zonos--address-form zonos--elements"},e("div",{key:"793675a1348547bf3f781788956befe325191011",class:"zonos--title"},e("zonos-text",{key:"13de35cb0a7c98a48342e3fb86ae3ade9f5b88d9",textColor:"gray-700",type:"smallHeader"},d("shipping"===this.addressType?"Shipping":"Billing"))),e("div",{key:"2c5de5b5283fb99ee5f8b61d7a217177986fc2db",class:"zonos--address-group"},e("div",{key:"23bf3c893071000d5995a5f175867bab11929193",class:"zonos--contact"},e("zonos-text",{key:"7cdfe2a84ebad89ba5b16498d75def99cf392384",type:"label"},d("Contact")),e("zonos-input",{key:"1c39c38767fd306c5eb1164cdc989b8291209cf0",class:"zonos--form-email",inputLabel:d("Email"),inputValue:this.currentAddress.email,isDisabled:!0}),e("div",{key:"cbdf61217125e22b1a6cec9a340ef0aca2c75670",class:"zonos--name zonos--address-row"},e("zonos-input",{key:"360c99e7b2c6caa64580d5768b5bb53368927275",class:"zonos--form-first-name",inputLabel:d("First name"),inputValue:f,isError:c(f),onInputChange:s=>this.onInputChange({key:"name",value:`${s.detail} ${b}`})}),e("zonos-input",{key:"8ce5fa5c15c6f7928339ea10009ce0e68954a91f",class:"zonos--form-last-name",inputLabel:d("Last name"),inputValue:b,isError:c(b),onInputChange:s=>this.onInputChange({key:"name",value:`${f} ${s.detail}`})}))),e("div",{key:"7b4fa2d3baa6cb257e7688e5ba6777123898b3fd",class:"zonos--address"},e("zonos-text",{key:"9d5782331b2642755a755aeb7f98c9f4d87f9a20",type:"label"},d("Address")),e("zonos-input",{key:"a622025924ca86bdbf1d3c04b79e6dee172b4c42",class:"zonos--form-country",inputLabel:d("Country"),inputValue:o,isDisabled:!0}),e("zonos-input",{key:"f99b3a74db09ab5730878e80705b9aeac76bf800",class:"zonos--form-line1",inputLabel:d("Address line 1"),inputValue:i,isError:c(i),onInputChange:s=>this.onInputChange({key:"line1",value:s.detail})}),e("zonos-input",{key:"5d16aefa45a78045c87d166aaaec0255606e455e",class:"zonos--form-line2",inputLabel:d("Address line 2"),inputValue:n,isError:c(n),onInputChange:s=>this.onInputChange({key:"line2",value:s.detail})}),e("div",{key:"dc166be9381142835d72e731cb38a718522a068a",class:"zonos--address-row"},e("zonos-input",{key:"4f1a98f9d10ce0cff3ef18a3037a12382552b31d",class:"zonos--form-city",inputLabel:d("City"),inputValue:s,isError:c(s),onInputChange:s=>this.onInputChange({key:"city",value:s.detail})}),e("zonos-input",{key:"d4f97900b5fe2e1619950a52d1d1f716a8bc19ff",class:"zonos--form-state",inputLabel:d("State/Province"),inputValue:h,isError:c(h),onInputChange:s=>this.onInputChange({key:"state",value:s.detail})})),e("zonos-input",{key:"cf1eb0ca5cd15c8412a2e1246aaf2e39361dc733",class:"zonos--form-postal-code",inputLabel:d("Postal code"),inputValue:r,isError:c(r),onInputChange:s=>this.onInputChange({key:"postal_code",value:s.detail})}),e("zonos-input",{key:"7421c82847eded6bdbcce49ef8196124d8e50c1d",class:"zonos--form-phone",inputLabel:d("Phone number"),inputValue:l,onInputChange:s=>this.onInputChange({key:"phone",value:s.detail})}))))}static get watchers(){return{translatedAddress:["watchCurrentAddress"]}}};v.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--title{margin-bottom:20px}:host .zonos--address-group{display:-ms-flexbox;display:flex;gap:20px;-ms-flex-direction:column;flex-direction:column;margin:1px}:host .zonos--contact{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}:host .zonos--address-row{display:-ms-flexbox;display:flex;gap:8px}:host .zonos--address-row>*{-ms-flex:1;flex:1}:host .zonos--address{display:-ms-flexbox;display:flex;gap:8px;-ms-flex-direction:column;flex-direction:column}";const x=class{constructor(e){s(this,e),this.closeUpdateDialog=o(this,"closeUpdateDialog",7),this.continueClicked=o(this,"continueClicked",7),this.closeUpdateDialogHandler=()=>{this.closeUpdateDialog.emit()},this.getTranslatedAddress=({currentAddress:s,translatedAddress:o})=>{var e,t,i,n,a,d;const{city:l,line1:r,line2:c,name:h,postal_code:f,state:b}=s;return{city:(null===(e=o.city)||void 0===e?void 0:e[l])||l,line1:(null===(t=o.line1)||void 0===t?void 0:t[r])||r,line2:(null===(i=o.line2)||void 0===i?void 0:i[c])||c,name:(null===(n=o.name)||void 0===n?void 0:n[h])||h,postal_code:(null===(a=o.postal_code)||void 0===a?void 0:a[f])||f,state:(null===(d=o.state)||void 0===d?void 0:d[b])||b}},this.continueClickHandler=async()=>{var s,o,e;this.continueLoading=!0;const t=this.billingAddress?this.getTranslatedAddress({currentAddress:this.billingAddress,translatedAddress:this.translatedBillingAddressState}):null,i=this.getTranslatedAddress({currentAddress:this.shippingAddress,translatedAddress:this.translatedShippingAddressState}),n=h(Object.assign(Object.assign({},i),{country:this.shippingAddress.country})),a=t&&this.billingAddress&&h(Object.assign(Object.assign({},t),{country:this.billingAddress.country})),d=!!Object.keys(n).length,l=!!a&&!!Object.keys(a).length;if(d||l){const t=null===(s=this.el.shadowRoot)||void 0===s?void 0:s.querySelectorAll("zonos-address-form"),i=null==t?void 0:t[0],n=null==t?void 0:t[1],a=(null===(o=null==i?void 0:i.shadowRoot)||void 0===o?void 0:o.querySelector(".has-error"))||(null===(e=null==n?void 0:n.shadowRoot)||void 0===e?void 0:e.querySelector(".has-error"));return a&&a.scrollIntoView({behavior:"smooth",block:"center"}),void(this.continueLoading=!1)}this.continueClicked.emit({billingAddress:t,shippingAddress:i})},this.buildTranslateAddressState=({currentAddress:s,translatedAddress:o})=>{const{city:e,line1:t,line2:i,name:n,postal_code:a,state:d}=s;return{city:{[e]:o.city},line1:{[t]:o.line1},line2:{[i]:o.line2},name:{[n]:o.name},postal_code:{[a]:o.postal_code},state:{[d]:o.state}}},this.continueLoading=!1,this.dialogLoading=void 0,this.dialogOpen=!1,this.submitBtnType=void 0,this.submitBtnColor=void 0,this.isMobile=!1,this.shippingAddress=void 0,this.billingAddress=void 0,this.translatedShippingAddress=void 0,this.translatedBillingAddress=void 0,this.showErrorBanner=!1,this.translatedShippingAddressState={},this.translatedBillingAddressState={}}watchTranslatedShippingAddress(){this.translatedShippingAddressState=this.translatedShippingAddress}watchTranslatedBillingAddress(){this.translatedBillingAddressState=this.translatedBillingAddress}componentWillLoad(){this.watchTranslatedBillingAddress(),this.watchTranslatedShippingAddress()}render(){const s="#ffffff"===(this.submitBtnColor||f.appearance.colorSecondary)?"outline":this.submitBtnType||"standard",o=this.billingAddress,i=this.shippingAddress;return e(t,{key:"655845cef04f4af526b1a1c4e49243c4f2b4c7f6",class:p(["zonos--address-update-dialog zonos--elements",this.isMobile&&"mobile"])},e("zonos-dialog",{key:"eab429bb78ce6f05ba463d8748d7edd5499402fa",isLoading:this.dialogLoading,mobile:this.isMobile,noBodyPadding:!0,noBorder:!0,noClickOutside:!0,noCloseButton:!0,onCloseDialog:()=>this.closeUpdateDialog.emit(),open:this.dialogOpen,width:"568px"},e("div",{key:"08f0400e62addfcaffd91bf5200999d29bbd2da9",class:"zonos--body"},e("div",{key:"8699df5e2f823e19066fbb552ba2a66c127c05e9",class:"zonos--dialog-header"},e("div",{key:"92e0ff932dcdb0e5b59ea34b688d1ef8e31bfeb3",class:"zonos--dialog-title"},e("zonos-text",{key:"aaac3375526bddb319ce7c8f49bde30da7210264",type:"title"},d("Update your address")),e("zonos-button",{key:"66abf7b74045e68e84e631298504236d32ca9c4e",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close checkout dialog",content:m}),noBackground:!0,onClick:()=>this.closeUpdateDialogHandler()})),e("zonos-text",{key:"ffb3d8f169867d5f6dff269e1becd99c98c5a7da"},d("To ensure delivery all address details must be in Latin characters."))),e("div",{key:"2cb61f06ce174e2317870decfdd337c67c5cf128",class:"zonos--group"},e("zonos-text",{key:"a616c540984120b468e52bccfb380ea3974ced22",class:"zonos--what-you-entered",type:"semiBoldLabel"},d("What you entered")),e("div",{key:"6ac8f9c14472370c501af1b0d50bd8f8746b7694",class:"zonos--address-display-group"},e("zonos-address-display",{key:"ea2c67a7bba51c99f80be968e448beeffcf1f863",addressType:"shipping",currentAddress:i}),o&&e("zonos-address-display",{key:"7ea1683dc04a292810e04ed6550d86086f25186f",addressType:"billing",currentAddress:o})),e("div",{key:"4d1cd9096943518b8b4e267608a5e1542befb6a9",class:"zonos--address-form-section"},e("zonos-text",{key:"e4184a2cc618d26d43979fa8cfe06070cf8b5af8",type:"semiBoldLabel"},d("Translated address")),e("zonos-address-form",{key:"c55d9d3c658565ceb7c7b879f444e3937b9f7ad6",addressType:"shipping",class:"zonos--shipping-address-form",currentAddress:i,onAddressChange:s=>{this.translatedShippingAddressState=this.buildTranslateAddressState({currentAddress:i,translatedAddress:s.detail})},translatedAddress:this.translatedShippingAddressState}),o&&e("zonos-address-form",{key:"c3facc295b1322bb00baa6081f343dcea4f10777",addressType:"billing",class:"zonos--billing-address-form",currentAddress:o,onAddressChange:s=>{this.translatedBillingAddressState=this.buildTranslateAddressState({currentAddress:o,translatedAddress:s.detail})},translatedAddress:this.translatedBillingAddressState}))),e("div",{key:"1c89c9604ba0dece40275fcfac97e7f93706b430",class:"zonos--group-btn"},e("div",{key:"e47d393940b094b4e123864e4070daa87f0616f0",class:"zonos--button-wrapper"},e("zonos-button",{key:"216b7afe268a4acd6bb8a76b7f5a32dc09bdd4f6",class:"zonos--cancel-btn",onClick:()=>this.closeUpdateDialogHandler(),variant:"subtle"},d("Cancel")),e("zonos-button",{key:"acbacb92cedb325b46843d8f3aff13f4e7c86ab5",backgroundColor:this.submitBtnColor,class:"zonos--update-btn",loading:this.continueLoading,onClick:()=>this.continueClickHandler(),size:"sm",variant:s},d("Update address")))))))}get el(){return i(this)}static get watchers(){return{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}}};x.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--body{padding:0 24px;position:relative}:host .zonos--dialog-header{margin-bottom:32px;position:-webkit-sticky;position:sticky;padding-top:24px;top:0;z-index:11;background:var(--zonos-elements-gray-0)}:host .zonos--dialog-title{display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between;-ms-flex-align:center;align-items:center;margin-bottom:12px}:host .zonos--group{overflow:auto;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:8px;-ms-scroll-chaining:none;overscroll-behavior:contain}:host .zonos--group::-webkit-scrollbar{width:10px}:host .zonos--group::-webkit-scrollbar-track{background:var(--zonos-elements-gray-50)}:host .zonos--group::-webkit-scrollbar-thumb{border-radius:10px;background:#cccccc;border:3px solid transparent;background-clip:content-box}:host .zonos--group::-webkit-scrollbar-thumb:hover{background:#d6d6d6}:host .zonos--address-display-group{display:-ms-flexbox;display:flex;gap:8px;margin-bottom:20px}:host .zonos--address-display-group zonos-address-display{-ms-flex:1;flex:1}:host .zonos--what-you-entered{margin-bottom:8px}:host .zonos--address-form-section{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:24px}:host .zonos--group-btn{position:-webkit-sticky;position:sticky;padding:24px 0;bottom:0;display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:end;background:var(--zonos-elements-gray-0);z-index:11}:host .zonos--group-btn .zonos--button-wrapper{display:-ms-flexbox;display:flex;gap:8px}:host(.mobile) .zonos--button-wrapper{-ms-flex-direction:column;flex-direction:column;width:100%}:host(.mobile) .zonos--button-wrapper zonos-button{width:100%}:host(.mobile) .zonos--button-wrapper .zonos--cancel-btn{-ms-flex-order:2;order:2}:host(.mobile) .zonos--button-wrapper .zonos--update-btn{-ms-flex-order:1;order:1}";const k=["blue","cyan","green","orange","purple","red","gray","glass"],w=class{constructor(e){s(this,e),this.checkboxSelected=o(this,"checkboxSelected",7),this.backgroundColor="blue",this.label=void 0,this.isChecked=!1,this.isDisabled=!1,this.size=12,this.fontSize="base",this.borderStyle=void 0}onClick(){this.isDisabled||this.checkboxSelected.emit(!this.isChecked)}render(){const s=k.includes(this.backgroundColor),o=s?`var(--zonos-elements-${this.backgroundColor}-600)`:this.backgroundColor,i=s?`var(--zonos-elements-${this.backgroundColor}-200)`:z(o)?"var(--zonos-elements-gray-0)":"var(--zonos-elements-gray-800)",n=u({customRoundRadius:"4px",overrideBorderStyle:this.borderStyle});return e(t,{key:"bf51dd642e88096e874d78023a29dd68239e8d3a",class:p(["zonos--elements zonos--checkbox"]),style:{"--background-color":o,"--border-radius":n,"--font-family":b(),"--size":`${this.size}px`}},e("label",{key:"3598c9f21285304499aaafbab5226d619ecf4e69",class:p([this.isDisabled&&"disabled"])},e("input",{key:"277507f643404e6e44191c2d715b70f38fc6af85",checked:this.isChecked,disabled:this.isDisabled,hidden:!0,onChange:s=>{this.checkboxSelected.emit(s.target.checked)},type:"checkbox"}),e("span",{key:"3f0fd0d458e8cf660fa883ceaa241e3397829548",class:"checkmark-container"},e("svg",{key:"0d654744bea5b5696ddcf3778a155fb622022f1e",class:"checkmark",color:i,fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e("path",{key:"cc19837ee088feb7053fdaeaea0d1213cbc60775","clip-rule":"evenodd",d:"M17.456 7.404a.75.75 0 0 1 .14 1.052l-6.5 8.5a.75.75 0 0 1-1.126.074l-4-4a.75.75 0 0 1 1.06-1.06l3.395 3.394 5.98-7.82a.75.75 0 0 1 1.05-.14Z",fill:"currentColor","fill-rule":"evenodd"}))),this.label&&e("zonos-text",{key:"cb85d59651f67a33126d37c3ebfb1e8a91b457fe",size:this.fontSize},this.label)))}};w.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{display:-ms-inline-flexbox;display:inline-flex;cursor:pointer}:host label{display:-ms-inline-flexbox;display:inline-flex;position:relative;gap:8px;-ms-flex-align:center;align-items:center}:host label.disabled{cursor:not-allowed;opacity:0.6}:host input[type=checkbox]{opacity:0;position:absolute;left:0;width:0;height:0;top:0;z-index:-99999}:host svg{opacity:0}:host .checkmark-container{height:var(--size);width:var(--size);background-color:transparent;border:1.5px solid var(--zonos-elements-gray-400);position:relative;border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host .checkmark{opacity:0;position:absolute;top:-1.5px;left:-1.5px;right:-1.5px;bottom:-1.5px;width:calc(100% + 3px);-webkit-transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);transition:0.3s all cubic-bezier(0.175, 0.885, 0.32, 1.275);-webkit-transform:scale(0.4);transform:scale(0.4);background-color:var(--background-color);border-radius:var(--border-radius, var(--zonos-elements-radius-4))}:host input[type=checkbox]:checked~.checkmark-container .checkmark{opacity:1;-webkit-transform:scale(1);transform:scale(1)}";const A=class{constructor(o){s(this,o),this.collapsed=!1,this.collapseSize=0,this.height=this.el.scrollHeight,this.iframe=null}getElementHeight(){return this.collapsed?`${this.collapseSize}px`:`${this.height}px`}componentDidLoad(){this.height=this.el.scrollHeight}componentDidRender(){var s,o,e;this.iframe=(null===(s=this.el.shadowRoot)||void 0===s?void 0:s.querySelector("iframe"))||null,null===(e=null===(o=this.iframe)||void 0===o?void 0:o.contentWindow)||void 0===e||e.addEventListener("resize",(()=>{this.iframe&&(this.height=parseFloat(getComputedStyle(this.iframe).height))}))}render(){return this.collapsed?this.el.style.overflow="hidden":setTimeout((()=>{this.collapsed||(this.el.style.overflow="visible")}),300),e(t,{key:"7cc2167ab3dab1a975d141f3c58d3c5982c1645a",class:"zonos--elements zonos--collapse",style:{"--font-family":b(),height:this.getElementHeight()}},e("div",{key:"1b791702f95066643ac82402a9fcff19b0fcc706"},e("iframe",{key:"08f678a4ce92f5600c584e329e3039bc4588ff3a",class:"height-change-listener",tabindex:"-1",title:"collapse-height-change-listener"}),e("slot",{key:"83119f9ba9764c46fa7d1dd7b4c0b08c49033607"})))}get el(){return i(this)}};A.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out;overflow:hidden}:host div{position:relative}:host iframe{width:0;height:100%;position:absolute;top:0;border:0}";const C=class{constructor(e){s(this,e),this.closeDialog=o(this,"closeDialog",3),this.isMobileMode=()=>this.mobile||window.innerWidth<=768,this.closeButtonHandler=()=>{this.open&&this.closeDialog.emit()},this.clickOutsideDialogHandler=s=>{s.target!==s.currentTarget||this.noClickOutside||this.closeDialog.emit()},this.open=!1,this.headerText="",this.width="460px",this.height=void 0,this.minHeight=void 0,this.noHeader=!1,this.noBodyPadding=!1,this.noBorder=!1,this.borderStyle=void 0,this.noCloseButton=!1,this.noClickOutside=!1,this.mobile=!1,this.isLoading=!0,this.isMobile=!1}handleWindowResize(){this.isMobile=this.isMobileMode()}handleKeyDown(s){"Escape"===s.key&&this.closeButtonHandler()}componentDidLoad(){this.isMobile=this.isMobileMode()}render(){document.body.style.overflow=this.open?"hidden":"auto";const s=u({overrideBorderStyle:this.borderStyle});return e(t,{key:"03735385e07c7f6c8a87df42ad95f8c9d9533668",class:p(["zonos--elements",this.open&&"open",this.isLoading&&"is-loading",this.noBorder&&"no-border",this.isMobile&&"mobile"]),style:{"--border-radius":s,"--font-family":b(),"--height":this.height||"initial","--min-height":this.minHeight||"500px","--width":this.width}},e("div",{key:"da5d599e1a247f7e3364e6f5c9b2eae3db9539f5",class:"zonos--backdrop"}),e("div",{key:"cda1a996d9521c2e0b307f7a03ca3ee3d4915b8d",class:"zonos--dialog-layout",inert:!this.open,onClick:this.clickOutsideDialogHandler},e("div",{key:"471d8a069d4f580233bdb3e9e971efdb268ef57d",class:"zonos--dialog"},this.isLoading&&e("div",{key:"57220007aabcaef133c2c0782fa238cc43d63964",class:"zonos--loading"},e("zonos-spinner",{key:"0298b754341abd61ec07706128d05df5332f915d",size:30})),(this.headerText||!this.noCloseButton)&&e("div",{key:"5103dbc1c7593a8042505f767d8290825f9d10e7",class:"zonos--header"},this.headerText&&e("h3",{key:"a2d9cd4c8cb359aa64cf104a172ca960068c20a0",class:"zonos--header-text"},this.headerText),!this.noCloseButton&&e("zonos-button",{key:"de9bf8a949344d19fcb8bfb496719282553be194",class:"zonos--close-button",icon:e("zonos-icon",{"aria-label":"Close dialog",content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-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" clip-rule="evenodd"/><path fill="#4D505A" fill-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" clip-rule="evenodd"/></svg>'}),noBackground:!0,onClick:this.closeButtonHandler,variant:"subtle"})),e("div",{key:"1ec2cdca0f186cd0b28602580022ed0cb4b0eec9",class:p(["zonos--body",this.noBodyPadding&&"zonos--no-body-padding"])},e("slot",{key:"5071d921f48bf792a951a390d83b121e32771668"})),e("slot",{key:"c1818ac301afc845f5b14fd0f2ac9a1fd3a27b99",name:"dialog-footer"}))))}static get assetsDirs(){return["assets"]}};C.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--backdrop,:host .zonos--dialog-layout{opacity:0;z-index:-999;visibility:hidden;-webkit-transition:0.3s all ease;transition:0.3s all ease}:host .zonos--backdrop{width:100vw;height:100vh;left:0;top:0;background:var(--zonos-elements-backdrop-color);position:fixed}:host .zonos--loading{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;z-index:2147483009;background:var(--zonos-elements-gray-0);border-radius:var(--border-radius, var(--zonos-elements-radius-10))}:host .zonos--dialog-layout{width:100vw;height:100vh;left:0;top:0;position:fixed;display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;color:var(--zonos-elements-text-color);visibility:hidden}:host .zonos--dialog{position:relative;z-index:2147483008;background:var(--zonos-elements-gray-0);max-width:90vw;max-height:90vh;min-height:var(--min-height, auto);height:var(--height, auto);width:var(--width, auto);border-radius:var(--border-radius, var(--zonos-elements-radius-10));outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);border:var(--zonos-elements-border);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .zonos--header{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:justify;justify-content:space-between;padding:16px 24px}:host .zonos--header .-zonos-stencil-library--header-text{-ms-flex-positive:1;flex-grow:1}:host .zonos--header .zonos--close-button{width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;border-radius:var(--zonos-elements-radius-10);-ms-flex-item-align:start;align-self:flex-start}:host .zonos--header .zonos--close-button:hover{background:var(--zonos-elements-hover-color)}:host .zonos--body{padding:8px 24px;max-height:100%;height:100%;overflow:auto}:host .zonos--body.zonos--no-body-padding{padding:0}:host .zonos--footer{padding:16px 24px}:host(.open) .zonos--dialog-layout,:host(.open) .zonos--backdrop{visibility:visible}:host(.open) .zonos--backdrop{z-index:2147483008;opacity:0.65}:host(.open) .zonos--dialog-layout{opacity:1;z-index:2147483009;-webkit-transform:scale(1);transform:scale(1)}:host(.no-border) .zonos--dialog{border:none}:host(.mobile) .zonos--dialog{max-width:100vw;max-height:100vh;height:100%;width:100%;border-radius:0;-webkit-box-shadow:none;box-shadow:none;border:none}";const I=class{constructor(o){s(this,o),this.titleText=void 0,this.defaultEmail=null,this.stripe=n.stripe}watchInitStripe(){if(!this.stripe||!n.stripeElements)return;const s=n.stripeLinkElement||n.stripeElements.create("linkAuthentication",{defaultValues:(this.defaultEmail?{email:this.defaultEmail}:void 0)||void 0}),o=this.el.querySelector(".zonos--link-authentication-component");o?(s.mount(o),s.on("change",(s=>{n.stripeLinkEventData=s})),n.stripeLinkElement=s):r("Cannot find container element for linkAuthenticationElement")}componentDidLoad(){this.watchInitStripe()}render(){return e(t,{key:"f0b26abf99ef99c6665dabdddebc9ff086b6816c",class:"zonos--link-authentication zonos--elements"},e("zonos-text",{key:"898dbdffac06fe2a68af90610a22044bb72391ce",class:"zonos--title",type:"semiBoldLabel"},this.titleText),e("div",{key:"e2ec9abb0cf76a39a1262e1366e375dd898450cd",class:"zonos--link-authentication-component"}))}get el(){return i(this)}static get watchers(){return{stripe:["watchInitStripe"]}}};I.style=".sc-zonos-link-authentication-h{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}.sc-zonos-link-authentication-h *.sc-zonos-link-authentication{font-family:var(--font-family, Inter), Inter}.sc-zonos-link-authentication-h img.sc-zonos-link-authentication{max-width:100%}.sc-zonos-link-authentication-h dl.sc-zonos-link-authentication,.sc-zonos-link-authentication-h dd.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h1.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h2.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h3.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h4.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h5.sc-zonos-link-authentication,.sc-zonos-link-authentication-h h6.sc-zonos-link-authentication,.sc-zonos-link-authentication-h hr.sc-zonos-link-authentication,.sc-zonos-link-authentication-h figure.sc-zonos-link-authentication,.sc-zonos-link-authentication-h p.sc-zonos-link-authentication,.sc-zonos-link-authentication-h pre.sc-zonos-link-authentication{margin:0}.sc-zonos-link-authentication-h{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}.sc-zonos-link-authentication-h .zonos--title.sc-zonos-link-authentication{margin-bottom:16px}";export{y as zonos_address,g as zonos_address_display,v as zonos_address_form,x as zonos_address_update_dialog,w as zonos_checkbox,A as zonos_collapse,C as zonos_dialog,I as zonos_link_authentication}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,c as e,h as t,F as s,H as i}from"./p-5b7da777.js";import{t as n,l as a,E as l}from"./p-75fd8895.js";import{z as r}from"./p-1086aac3.js";import{c as d}from"./p-b4b7f705.js";import{f as h}from"./p-a87561b8.js";import{g as c}from"./p-5883217a.js";import"./p-2ec2e9d3.js";import"./p-a1b755bf.js";import"./p-1ca5696d.js";const f=`${n("The low-value GST law passed July 1st, 2018 applies to this retailer.")} ${(({href:o,text:e})=>`<zonos-link href="${o}" target="_blank" rel="noopener noreferrer">${e}</zonos-link>`)({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/australia-gst",text:n("Learn more.")})}`,m=class{constructor(t){o(this,t),this.closeDialog=e(this,"closeDialog",7),this.clickOutsideDialogHandler=o=>{!o.composedPath().includes(this.dialogRef)&&this.isOpen&&this.setIsOpen(!1)},this.getCurrentPageEnum=()=>{switch(r.currentHelloPage){case"home":return"hello_homepage";case"cart":return"hello_cart";case"productList":return"hello_item_list";case"productDetail":return"hello_item_details";default:return null}},this.setShowCountrySelect=async o=>{this.showCountrySelect=o},this.setShowLanguageSelect=async o=>{this.showLanguageSelect=o},this.hasTaxId=()=>{var o;return null===(o=a.countryLandedCost)||void 0===o?void 0:o.hasTaxId},this.hasInclusivePrices=()=>{var o;return"ENABLED"===(null===(o=a.inclusivePricing)||void 0===o?void 0:o.status)},this.isNoThresholdCountry=o=>!(!o||!this.hasTaxId())&&["AU"].includes(o),this.getDutyMessage=()=>{const{countryLandedCost:o}=a,e=(null==o?void 0:o.dutyDeminimus)?l({amount:o.dutyDeminimus}):null;return e&&!this.isNoThresholdCountry(null==o?void 0:o.countryCode)?n("Spend [threshold] duty free.",{threshold:e}):n("Duties will apply to all orders.")},this.getTaxMessage=()=>{const{countryLandedCost:o}=a,e=(null==o?void 0:o.vatTaxDeminimus)?l({amount:o.vatTaxDeminimus}):null;return e&&!this.isNoThresholdCountry(null==o?void 0:o.countryCode)?n("Spend [threshold] tax free.",{threshold:e}):n("Taxes will apply to all orders.")},this.getUkDutyTaxMessage=o=>o.allowLowValueOrders?null:[n("Orders to [countryName] must be over [threshold] to ship.",{countryName:"United Kingdom",threshold:l({amount:o.dutyDeminimus})})],this.getAustraliaDutyTaxMessage=o=>this.hasInclusivePrices()?[f]:[n("Duties & taxes in Australia, VAT or GST is [percentage] and is due on all orders.",{percentage:100*o.vatTaxRate+"%"}),f],this.getNewZealandDutyTaxMessge=o=>this.hasInclusivePrices()?null:[n("[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.",{percentage:100*o.vatTaxRate+"%",threshold:l({amount:o.vatTaxDeminimus})})],this.getInclusivePriceMessage=()=>{const o=a.inclusivePricing;return"ENABLED"!==(null==o?void 0:o.status)?null:"INCLUDED"===o.duty.status&&"INCLUDED"===o.tax.status&&"INCLUDED"===o.fee.status?n("Product prices already include duties, taxes, and fees. No additional duties, taxes, or fees will be added at checkout, with rare exceptions."):"INCLUDED"===o.duty.status&&"INCLUDED"===o.tax.status?n("Product prices already include duties and taxes. No additional duties or taxes will be added at checkout, with rare exceptions."):"INCLUDED"===o.duty.status&&"INCLUDED"===o.fee.status?n("Product prices already include duties and fees. No additional duties or fees will be added at checkout, with rare exceptions."):"INCLUDED"===o.tax.status&&"INCLUDED"===o.fee.status?n("Product prices already include taxes and fees. No additional taxes or fees will be added at checkout, with rare exceptions."):"INCLUDED"===o.duty.status?n("Product prices already include duties. No additional duties will be added at checkout, with rare exceptions."):"INCLUDED"===o.tax.status?n("Product prices already include taxes. No additional taxes will be added at checkout, with rare exceptions."):"INCLUDED"===o.fee.status?n("Product prices already include fees. No additional fees will be added at checkout, with rare exceptions."):null},this.getAdditionalDutyTaxMessage=()=>{if(!a.countryLandedCost)return null;if(!this.hasTaxId())return null;switch(a.countryLandedCost.countryCode){case"GB":return this.getUkDutyTaxMessage(a.countryLandedCost);case"AU":return this.getAustraliaDutyTaxMessage(a.countryLandedCost);case"NZ":return this.getNewZealandDutyTaxMessge(a.countryLandedCost);default:return null}},this.isOpen=!1,this.setIsOpen=()=>{},this.mobileLocationOverride=void 0,this.animateFromLeftOverride=void 0,this.appearanceSettings=void 0,this.restrictedItems=[],this.welcomeMessage="Welcome to our Demo App!",this.showCountrySelect=!1,this.showLanguageSelect=!1}globalClickHandler(o){this.clickOutsideDialogHandler(o)}isOpenHandler(o){o||(this.setShowCountrySelect(!1),this.setShowLanguageSelect(!1))}render(){var o;const{selectedCountryCode:e}=a,l=this.hasInclusivePrices(),f=this.getInclusivePriceMessage(),m=this.getDutyMessage(),g=this.getTaxMessage(),u=this.getAdditionalDutyTaxMessage(),p=this.animateFromLeftOverride||this.dialogRef&&c(this.dialogRef),b=this.dialogRef&&(()=>{const o=this.dialogRef.getBoundingClientRect();return o.top>=window.innerHeight-o.bottom})(),{customMessages:w}=a,x=n("Welcome to [storeName]",{storeName:r.organizationName}),C=(null===(o=w.find((o=>"hello_default"===o.pageName)))||void 0===o?void 0:o.message)||n("Know about duties and taxes before you buy. Shop with confidence!"),z=h(C),v=this.getCurrentPageEnum(),y=w.filter((o=>o.pageName===v));return t(i,{key:"df052224c778ebfceeef7c827fa3da0e8a2f3dc9",class:"zonos--elements"},t("div",{key:"0ecff6a07d24a72fb4f200cce82ab09e40b48baf",class:d(["zonos--hello-dialog",p&&"zonos--hello-dialog-animate-from-left",b&&"zonos--hello-dialog-animate-from-bottom",!!this.mobileLocationOverride&&"zonos--hello-dialog-mobile-override",this.isOpen&&"zonos--hello-dialog-open"]),inert:!this.isOpen,ref:o=>o&&(this.dialogRef=o)},!this.showCountrySelect&&!this.showLanguageSelect&&t("div",{key:"b2939d49930c8a34288a884582eb849a492080ff"},t("div",{key:"f1a22291d7865d57d37cbcd3c8f70c4aea57ed39",class:"zonos--hello-dialog-content"},t("zonos-button",{key:"ee3794826efc9fed856f0a320cf6428a428b4ea4",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close Zonos Hello dialog",content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-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" clip-rule="evenodd"/><path fill="#4D505A" fill-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" clip-rule="evenodd"/></svg>'}),noBackground:!0,onClick:()=>this.setIsOpen(!1)}),t("zonos-v-stack",{key:"3d2ff0b68268c97e385eb3cf7fcc34454d2ed3b5",spacing:24},t("zonos-country-flag",{key:"e09645ac583e59354d11b3c194d4d3f6d4780c55",class:"zonos--hello-country-flag",countryCode:e}),t("zonos-v-stack",{key:"42017a698c1678b90c8c7bbece5d623d0800e37b",class:"zonos--hello-dialog-header",spacing:4},t("zonos-text",{key:"ac30b7683dcc65773159832eadad8542d1d1bda8",type:"boldSubheader"},x),t("zonos-text",{key:"58cc0e8c51774c339b0fc735e4e98917ed614c8a",innerHTML:z,textColor:"gray-800"})),t("zonos-v-stack",{key:"0b3a3b2bf981ed72654506cc31f07edf6268b0a4",spacing:8},this.restrictedItems.map((o=>{var e;return o&&t("zonos-banner",{bannerTitle:o.name,intent:"error"},null===(e=o.itemRestrictions)||void 0===e?void 0:e.map((o=>t("zonos-text",{textColor:"red-800"},null==o?void 0:o.note))))})),t("zonos-card",{key:"196a593b167fc979bf0a2bef7f266ad3778f6ca0",spacing:"12px"},t("zonos-v-stack",{key:"94925c753ddfdd1a659580f7f78f8d6626cdcdaa",spacing:12},l?t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty de minimis",content:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M4.04505 6.64123C2.19006 8.49622 2.19006 11.5038 4.04505 13.3587L11.2929 20.6066C11.6834 20.9971 12.3166 20.9971 12.7071 20.6066L19.955 13.3587C21.8099 11.5038 21.8099 8.49622 19.955 6.64123L17.8336 4.51991C17.4431 4.12939 16.8099 4.12939 16.4194 4.51991L13.5241 7.41527C12.5864 6.86157 11.4136 6.86157 10.4759 7.41527L7.58059 4.51991C7.19006 4.12939 6.5569 4.12939 6.16637 4.51991L4.04505 6.64123ZM5.10571 12.2981C3.83651 11.0289 3.83651 8.9711 5.10571 7.70189L6.87348 5.93413L9.70191 8.76255C10.1056 9.16622 10.6991 9.12 11.0641 8.82749C11.6091 8.39083 12.3909 8.39082 12.9359 8.82749C13.301 9.12 13.8944 9.16622 14.2981 8.76255L17.1265 5.93413L18.8943 7.70189C20.1635 8.9711 20.1635 11.0289 18.8943 12.2981L12 19.1924L5.10571 12.2981Z"\n fill="#0F1015" />\n <path\n d="M10.0333 3.28075C9.63566 3.39679 9.40739 3.8132 9.52343 4.21083C9.63947 4.60846 10.0559 4.83673 10.4535 4.72069C11.4618 4.42644 12.5383 4.42644 13.5466 4.72069C13.9442 4.83673 14.3606 4.60846 14.4766 4.21083C14.5927 3.81321 14.3644 3.39679 13.9668 3.28075C12.6841 2.90642 11.316 2.90642 10.0333 3.28075Z"\n fill="#0F1015" />\n</svg>'}),t("zonos-text",null,f)):t(s,null,t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty de minimis",content:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.35028 11.5744C9.05738 11.2815 8.58251 11.2815 8.28962 11.5744C7.99672 11.8673 7.99672 12.3422 8.28962 12.635L11.2917 15.6372C11.6823 16.0277 12.3154 16.0277 12.7059 15.6372L15.708 12.6351C16.0009 12.3422 16.0009 11.8674 15.708 11.5745C15.4151 11.2816 14.9402 11.2816 14.6473 11.5745L12.7488 13.4729V4.68005C12.7488 4.26584 12.413 3.93005 11.9988 3.93005C11.5846 3.93005 11.2488 4.26584 11.2488 4.68005L11.2488 13.4729L9.35028 11.5744Z" fill="#4D505A"/>\n<path d="M20 14C20 13.5858 19.6642 13.25 19.25 13.25C18.8358 13.25 18.5 13.5858 18.5 14L18.5 17.25C18.5 17.9404 17.9404 18.5 17.25 18.5L6.75 18.5C6.05964 18.5 5.5 17.9404 5.5 17.25L5.5 14C5.5 13.5858 5.16421 13.25 4.75 13.25C4.33579 13.25 4 13.5858 4 14V17.25C4 18.7688 5.23122 20 6.75 20H17.25C18.7688 20 20 18.7688 20 17.25L20 14Z" fill="#4D505A"/>\n</svg>\n'}),t("zonos-text",null,m)),t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Tax de minimis",content:'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.16666 5.83301C2.16666 4.4523 3.28594 3.33301 4.66666 3.33301H16.3333C17.714 3.33301 18.8333 4.4523 18.8333 5.83301V14.1663C18.8333 15.5471 17.714 16.6663 16.3333 16.6663H4.66666C3.28594 16.6663 2.16666 15.5471 2.16666 14.1663V5.83301ZM4.66666 4.99967C4.20642 4.99967 3.83332 5.37277 3.83332 5.83301V14.1663C3.83332 14.6266 4.20642 14.9997 4.66666 14.9997H16.3333C16.7936 14.9997 17.1667 14.6266 17.1667 14.1663V5.83301C17.1667 5.37277 16.7936 4.99967 16.3333 4.99967H4.66666ZM6.33332 8.33301C6.79356 8.33301 7.16666 8.7061 7.16666 9.16634V10.833C7.16666 11.2932 6.79356 11.6663 6.33332 11.6663C5.87309 11.6663 5.49999 11.2932 5.49999 10.833V9.16634C5.49999 8.7061 5.87309 8.33301 6.33332 8.33301ZM8.83332 9.99967C8.83332 9.0792 9.57952 8.33301 10.5 8.33301C11.4205 8.33301 12.1667 9.0792 12.1667 9.99967C12.1667 10.9201 11.4205 11.6663 10.5 11.6663C9.57952 11.6663 8.83332 10.9201 8.83332 9.99967ZM14.6667 8.33301C15.1269 8.33301 15.5 8.7061 15.5 9.16634V10.833C15.5 11.2932 15.1269 11.6663 14.6667 11.6663C14.2064 11.6663 13.8333 11.2932 13.8333 10.833V9.16634C13.8333 8.7061 14.2064 8.33301 14.6667 8.33301Z" fill="#4D505A"/>\n</svg>\n'}),t("zonos-text",null,g))),null==u?void 0:u.map((o=>t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Additional information for buying goods from selected country",content:'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>\n</svg>\n'}),t("zonos-text",{innerHTML:o})))))),y.map((o=>t("zonos-custom-message",{icon:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n',message:o.message})))))),t("zonos-hello-dialog-footer",{key:"540006185ce1d28d610052801dcf9281773c5504",appearanceSettings:this.appearanceSettings,setShowCountrySelect:o=>this.setShowCountrySelect(o),setShowLanguageSelect:o=>this.setShowLanguageSelect(o)})),this.showCountrySelect&&t("div",{key:"886c371fdfa8c9c15188ef9d6cbb637162fb0d27"},t("zonos-country-select",{key:"1365bee67831b64637e5c481f239c557f2649694",handleOnClose:()=>this.setShowCountrySelect(!1)})),this.showLanguageSelect&&t("div",{key:"44929f0c23627970b1706f6e8c76e51022201379"},t("zonos-language-select",{key:"86b9f68c84da77f9e1af51dcb7d512eb6b289a27",handleOnClose:()=>this.setShowLanguageSelect(!1)}))))}static get assetsDirs(){return["assets"]}static get watchers(){return{isOpen:["isOpenHandler"]}}};m.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-dialog{position:absolute;background:var(--zonos-elements-surface-color);width:100vw;max-width:430px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-height:600px;border-radius:var(--zonos-elements-radius-12);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);overflow-y:auto;top:-2px;right:-2px;opacity:0;-webkit-transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:top right;transform-origin:top right;z-index:1001}:host .zonos--hello-dialog .zonos--hello-dialog-header{text-align:center}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:top left;transform-origin:top left;right:unset;left:-2px}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom{-webkit-transform-origin:bottom right;transform-origin:bottom right;bottom:calc(100% - 32px);top:unset}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom left;transform-origin:bottom left}:host .zonos--hello-dialog::-webkit-scrollbar{width:12px;height:12px}:host .zonos--hello-dialog::-webkit-scrollbar-track{background:#f5f5f5;border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--hello-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#ccc;border:4px solid transparent;background-clip:content-box}:host .zonos--hello-dialog::-webkit-scrollbar-thumb:hover{background:#999}:host .zonos--hello-dialog .zonos--animate-content{opacity:0;height:0;-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}:host .zonos--hello-dialog .zonos--show-animate-content{opacity:1;height:100%}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .zonos--hello-dialog .zonos--close-button{position:absolute;right:8px;top:8px;width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;z-index:10}:host .zonos--hello-dialog .zonos--close-button:hover{background:var(--zonos-elements-hover-color);border-radius:var(--zonos-elements-radius-6)}:host .zonos--hello-dialog .zonos--hello-dialog-content{padding:16px}:host .zonos--hello-dialog .zonos--hello-dialog-content .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:32px;height:24px}:host .zonos--hello-dialog .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:12px}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}@media (max-height: 600px){:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{max-height:80vh}}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}@media (max-width: 768px){:host .zonos--hello-dialog{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px) and (max-height: 600px){:host .zonos--hello-dialog{max-height:80vh}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}";export{m as zonos_hello_dialog}
|
|
1
|
+
import{r as o,c as e,h as t,F as s,H as i}from"./p-5b7da777.js";import{t as n,l as a,E as l}from"./p-6b4fec5a.js";import{z as r}from"./p-1086aac3.js";import{c as d}from"./p-b4b7f705.js";import{f as h}from"./p-a87561b8.js";import{g as c}from"./p-5883217a.js";import"./p-ad7ce197.js";import"./p-a1b755bf.js";import"./p-1ca5696d.js";const f=`${n("The low-value GST law passed July 1st, 2018 applies to this retailer.")} ${(({href:o,text:e})=>`<zonos-link href="${o}" target="_blank" rel="noopener noreferrer">${e}</zonos-link>`)({href:"https://zonos.com/docs/global-ecommerce/landed-cost/tax-remittance/australia-gst",text:n("Learn more.")})}`,m=class{constructor(t){o(this,t),this.closeDialog=e(this,"closeDialog",7),this.clickOutsideDialogHandler=o=>{!o.composedPath().includes(this.dialogRef)&&this.isOpen&&this.setIsOpen(!1)},this.getCurrentPageEnum=()=>{switch(r.currentHelloPage){case"home":return"hello_homepage";case"cart":return"hello_cart";case"productList":return"hello_item_list";case"productDetail":return"hello_item_details";default:return null}},this.setShowCountrySelect=async o=>{this.showCountrySelect=o},this.setShowLanguageSelect=async o=>{this.showLanguageSelect=o},this.hasTaxId=()=>{var o;return null===(o=a.countryLandedCost)||void 0===o?void 0:o.hasTaxId},this.hasInclusivePrices=()=>{var o;return"ENABLED"===(null===(o=a.inclusivePricing)||void 0===o?void 0:o.status)},this.isNoThresholdCountry=o=>!(!o||!this.hasTaxId())&&["AU"].includes(o),this.getDutyMessage=()=>{const{countryLandedCost:o}=a,e=(null==o?void 0:o.dutyDeminimus)?l({amount:o.dutyDeminimus}):null;return e&&!this.isNoThresholdCountry(null==o?void 0:o.countryCode)?n("Spend [threshold] duty free.",{threshold:e}):n("Duties will apply to all orders.")},this.getTaxMessage=()=>{const{countryLandedCost:o}=a,e=(null==o?void 0:o.vatTaxDeminimus)?l({amount:o.vatTaxDeminimus}):null;return e&&!this.isNoThresholdCountry(null==o?void 0:o.countryCode)?n("Spend [threshold] tax free.",{threshold:e}):n("Taxes will apply to all orders.")},this.getUkDutyTaxMessage=o=>o.allowLowValueOrders?null:[n("Orders to [countryName] must be over [threshold] to ship.",{countryName:"United Kingdom",threshold:l({amount:o.dutyDeminimus})})],this.getAustraliaDutyTaxMessage=o=>this.hasInclusivePrices()?[f]:[n("Duties & taxes in Australia, VAT or GST is [percentage] and is due on all orders.",{percentage:100*o.vatTaxRate+"%"}),f],this.getNewZealandDutyTaxMessge=o=>this.hasInclusivePrices()?null:[n("[percentage] GST due on any order above [threshold] along with an import entry transaction fee and MPI levy.",{percentage:100*o.vatTaxRate+"%",threshold:l({amount:o.vatTaxDeminimus})})],this.getInclusivePriceMessage=()=>{const o=a.inclusivePricing;return"ENABLED"!==(null==o?void 0:o.status)?null:"INCLUDED"===o.duty.status&&"INCLUDED"===o.tax.status&&"INCLUDED"===o.fee.status?n("Product prices already include duties, taxes, and fees. No additional duties, taxes, or fees will be added at checkout, with rare exceptions."):"INCLUDED"===o.duty.status&&"INCLUDED"===o.tax.status?n("Product prices already include duties and taxes. No additional duties or taxes will be added at checkout, with rare exceptions."):"INCLUDED"===o.duty.status&&"INCLUDED"===o.fee.status?n("Product prices already include duties and fees. No additional duties or fees will be added at checkout, with rare exceptions."):"INCLUDED"===o.tax.status&&"INCLUDED"===o.fee.status?n("Product prices already include taxes and fees. No additional taxes or fees will be added at checkout, with rare exceptions."):"INCLUDED"===o.duty.status?n("Product prices already include duties. No additional duties will be added at checkout, with rare exceptions."):"INCLUDED"===o.tax.status?n("Product prices already include taxes. No additional taxes will be added at checkout, with rare exceptions."):"INCLUDED"===o.fee.status?n("Product prices already include fees. No additional fees will be added at checkout, with rare exceptions."):null},this.getAdditionalDutyTaxMessage=()=>{if(!a.countryLandedCost)return null;if(!this.hasTaxId())return null;switch(a.countryLandedCost.countryCode){case"GB":return this.getUkDutyTaxMessage(a.countryLandedCost);case"AU":return this.getAustraliaDutyTaxMessage(a.countryLandedCost);case"NZ":return this.getNewZealandDutyTaxMessge(a.countryLandedCost);default:return null}},this.isOpen=!1,this.setIsOpen=()=>{},this.mobileLocationOverride=void 0,this.animateFromLeftOverride=void 0,this.appearanceSettings=void 0,this.restrictedItems=[],this.welcomeMessage="Welcome to our Demo App!",this.showCountrySelect=!1,this.showLanguageSelect=!1}globalClickHandler(o){this.clickOutsideDialogHandler(o)}isOpenHandler(o){o||(this.setShowCountrySelect(!1),this.setShowLanguageSelect(!1))}render(){var o;const{selectedCountryCode:e}=a,l=this.hasInclusivePrices(),f=this.getInclusivePriceMessage(),m=this.getDutyMessage(),g=this.getTaxMessage(),u=this.getAdditionalDutyTaxMessage(),p=this.animateFromLeftOverride||this.dialogRef&&c(this.dialogRef),b=this.dialogRef&&(()=>{const o=this.dialogRef.getBoundingClientRect();return o.top>=window.innerHeight-o.bottom})(),{customMessages:w}=a,x=n("Welcome to [storeName]",{storeName:r.organizationName}),C=(null===(o=w.find((o=>"hello_default"===o.pageName)))||void 0===o?void 0:o.message)||n("Know about duties and taxes before you buy. Shop with confidence!"),z=h(C),v=this.getCurrentPageEnum(),y=w.filter((o=>o.pageName===v));return t(i,{key:"df052224c778ebfceeef7c827fa3da0e8a2f3dc9",class:"zonos--elements"},t("div",{key:"0ecff6a07d24a72fb4f200cce82ab09e40b48baf",class:d(["zonos--hello-dialog",p&&"zonos--hello-dialog-animate-from-left",b&&"zonos--hello-dialog-animate-from-bottom",!!this.mobileLocationOverride&&"zonos--hello-dialog-mobile-override",this.isOpen&&"zonos--hello-dialog-open"]),inert:!this.isOpen,ref:o=>o&&(this.dialogRef=o)},!this.showCountrySelect&&!this.showLanguageSelect&&t("div",{key:"b2939d49930c8a34288a884582eb849a492080ff"},t("div",{key:"f1a22291d7865d57d37cbcd3c8f70c4aea57ed39",class:"zonos--hello-dialog-content"},t("zonos-button",{key:"ee3794826efc9fed856f0a320cf6428a428b4ea4",class:"zonos--close-button",icon:t("zonos-icon",{"aria-label":"Close Zonos Hello dialog",content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-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" clip-rule="evenodd"/><path fill="#4D505A" fill-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" clip-rule="evenodd"/></svg>'}),noBackground:!0,onClick:()=>this.setIsOpen(!1)}),t("zonos-v-stack",{key:"3d2ff0b68268c97e385eb3cf7fcc34454d2ed3b5",spacing:24},t("zonos-country-flag",{key:"e09645ac583e59354d11b3c194d4d3f6d4780c55",class:"zonos--hello-country-flag",countryCode:e}),t("zonos-v-stack",{key:"42017a698c1678b90c8c7bbece5d623d0800e37b",class:"zonos--hello-dialog-header",spacing:4},t("zonos-text",{key:"ac30b7683dcc65773159832eadad8542d1d1bda8",type:"boldSubheader"},x),t("zonos-text",{key:"58cc0e8c51774c339b0fc735e4e98917ed614c8a",innerHTML:z,textColor:"gray-800"})),t("zonos-v-stack",{key:"0b3a3b2bf981ed72654506cc31f07edf6268b0a4",spacing:8},this.restrictedItems.map((o=>{var e;return o&&t("zonos-banner",{bannerTitle:o.name,intent:"error"},null===(e=o.itemRestrictions)||void 0===e?void 0:e.map((o=>t("zonos-text",{textColor:"red-800"},null==o?void 0:o.note))))})),t("zonos-card",{key:"196a593b167fc979bf0a2bef7f266ad3778f6ca0",spacing:"12px"},t("zonos-v-stack",{key:"94925c753ddfdd1a659580f7f78f8d6626cdcdaa",spacing:12},l?t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty de minimis",content:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd"\n d="M4.04505 6.64123C2.19006 8.49622 2.19006 11.5038 4.04505 13.3587L11.2929 20.6066C11.6834 20.9971 12.3166 20.9971 12.7071 20.6066L19.955 13.3587C21.8099 11.5038 21.8099 8.49622 19.955 6.64123L17.8336 4.51991C17.4431 4.12939 16.8099 4.12939 16.4194 4.51991L13.5241 7.41527C12.5864 6.86157 11.4136 6.86157 10.4759 7.41527L7.58059 4.51991C7.19006 4.12939 6.5569 4.12939 6.16637 4.51991L4.04505 6.64123ZM5.10571 12.2981C3.83651 11.0289 3.83651 8.9711 5.10571 7.70189L6.87348 5.93413L9.70191 8.76255C10.1056 9.16622 10.6991 9.12 11.0641 8.82749C11.6091 8.39083 12.3909 8.39082 12.9359 8.82749C13.301 9.12 13.8944 9.16622 14.2981 8.76255L17.1265 5.93413L18.8943 7.70189C20.1635 8.9711 20.1635 11.0289 18.8943 12.2981L12 19.1924L5.10571 12.2981Z"\n fill="#0F1015" />\n <path\n d="M10.0333 3.28075C9.63566 3.39679 9.40739 3.8132 9.52343 4.21083C9.63947 4.60846 10.0559 4.83673 10.4535 4.72069C11.4618 4.42644 12.5383 4.42644 13.5466 4.72069C13.9442 4.83673 14.3606 4.60846 14.4766 4.21083C14.5927 3.81321 14.3644 3.39679 13.9668 3.28075C12.6841 2.90642 11.316 2.90642 10.0333 3.28075Z"\n fill="#0F1015" />\n</svg>'}),t("zonos-text",null,f)):t(s,null,t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Duty de minimis",content:'<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9.35028 11.5744C9.05738 11.2815 8.58251 11.2815 8.28962 11.5744C7.99672 11.8673 7.99672 12.3422 8.28962 12.635L11.2917 15.6372C11.6823 16.0277 12.3154 16.0277 12.7059 15.6372L15.708 12.6351C16.0009 12.3422 16.0009 11.8674 15.708 11.5745C15.4151 11.2816 14.9402 11.2816 14.6473 11.5745L12.7488 13.4729V4.68005C12.7488 4.26584 12.413 3.93005 11.9988 3.93005C11.5846 3.93005 11.2488 4.26584 11.2488 4.68005L11.2488 13.4729L9.35028 11.5744Z" fill="#4D505A"/>\n<path d="M20 14C20 13.5858 19.6642 13.25 19.25 13.25C18.8358 13.25 18.5 13.5858 18.5 14L18.5 17.25C18.5 17.9404 17.9404 18.5 17.25 18.5L6.75 18.5C6.05964 18.5 5.5 17.9404 5.5 17.25L5.5 14C5.5 13.5858 5.16421 13.25 4.75 13.25C4.33579 13.25 4 13.5858 4 14V17.25C4 18.7688 5.23122 20 6.75 20H17.25C18.7688 20 20 18.7688 20 17.25L20 14Z" fill="#4D505A"/>\n</svg>\n'}),t("zonos-text",null,m)),t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Tax de minimis",content:'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.16666 5.83301C2.16666 4.4523 3.28594 3.33301 4.66666 3.33301H16.3333C17.714 3.33301 18.8333 4.4523 18.8333 5.83301V14.1663C18.8333 15.5471 17.714 16.6663 16.3333 16.6663H4.66666C3.28594 16.6663 2.16666 15.5471 2.16666 14.1663V5.83301ZM4.66666 4.99967C4.20642 4.99967 3.83332 5.37277 3.83332 5.83301V14.1663C3.83332 14.6266 4.20642 14.9997 4.66666 14.9997H16.3333C16.7936 14.9997 17.1667 14.6266 17.1667 14.1663V5.83301C17.1667 5.37277 16.7936 4.99967 16.3333 4.99967H4.66666ZM6.33332 8.33301C6.79356 8.33301 7.16666 8.7061 7.16666 9.16634V10.833C7.16666 11.2932 6.79356 11.6663 6.33332 11.6663C5.87309 11.6663 5.49999 11.2932 5.49999 10.833V9.16634C5.49999 8.7061 5.87309 8.33301 6.33332 8.33301ZM8.83332 9.99967C8.83332 9.0792 9.57952 8.33301 10.5 8.33301C11.4205 8.33301 12.1667 9.0792 12.1667 9.99967C12.1667 10.9201 11.4205 11.6663 10.5 11.6663C9.57952 11.6663 8.83332 10.9201 8.83332 9.99967ZM14.6667 8.33301C15.1269 8.33301 15.5 8.7061 15.5 9.16634V10.833C15.5 11.2932 15.1269 11.6663 14.6667 11.6663C14.2064 11.6663 13.8333 11.2932 13.8333 10.833V9.16634C13.8333 8.7061 14.2064 8.33301 14.6667 8.33301Z" fill="#4D505A"/>\n</svg>\n'}),t("zonos-text",null,g))),null==u?void 0:u.map((o=>t("div",{class:"zonos--flex-message"},t("zonos-icon",{"aria-label":"Additional information for buying goods from selected country",content:'<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M9.66666 4.16667C9.20642 4.16667 8.83333 4.53976 8.83333 5V5.83333H12.1667V5C12.1667 4.53976 11.7936 4.16667 11.3333 4.16667H9.66666ZM13.8333 5.83333V5C13.8333 3.61929 12.714 2.5 11.3333 2.5H9.66666C8.28595 2.5 7.16666 3.61929 7.16666 5V5.83333H6.77759C5.44832 5.83333 4.35149 6.87354 4.2811 8.20094L3.92756 14.8676C3.85169 16.2983 4.99133 17.5 6.42405 17.5H14.5759C16.0087 17.5 17.1483 16.2983 17.0724 14.8676L16.7189 8.20094C16.6485 6.87354 15.5517 5.83333 14.2224 5.83333H13.8333ZM12.1667 7.5V8.33333C12.1667 8.79357 12.5398 9.16667 13 9.16667C13.4602 9.16667 13.8333 8.79357 13.8333 8.33333V7.5H14.2224C14.6655 7.5 15.0311 7.84674 15.0546 8.2892L15.4081 14.9559C15.4334 15.4328 15.0535 15.8333 14.5759 15.8333H6.42405C5.94648 15.8333 5.5666 15.4328 5.59189 14.9559L5.94542 8.2892C5.96889 7.84674 6.3345 7.5 6.77759 7.5H7.16666V8.33333C7.16666 8.79357 7.53976 9.16667 7.99999 9.16667C8.46023 9.16667 8.83333 8.79357 8.83333 8.33333V7.5H12.1667Z" fill="#4D505A"/>\n</svg>\n'}),t("zonos-text",{innerHTML:o})))))),y.map((o=>t("zonos-custom-message",{icon:'<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="https://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M2.25 4.5C2.25 3.25736 3.25736 2.25 4.5 2.25H13.5C14.7426 2.25 15.75 3.25736 15.75 4.5V10.5C15.75 11.7426 14.7426 12.75 13.5 12.75H8.25C8.01393 12.75 7.79164 12.8611 7.65 13.05L6.3 14.85C5.87508 15.4166 5.2082 15.75 4.5 15.75C3.25736 15.75 2.25 14.7426 2.25 13.5V4.5ZM4.5 3.75C4.08579 3.75 3.75 4.08579 3.75 4.5V13.5C3.75 13.9142 4.08579 14.25 4.5 14.25C4.73607 14.25 4.95836 14.1389 5.1 13.95L6.45 12.15C6.87492 11.5834 7.5418 11.25 8.25 11.25H13.5C13.9142 11.25 14.25 10.9142 14.25 10.5V4.5C14.25 4.08579 13.9142 3.75 13.5 3.75H4.5ZM5.25 6C5.25 5.58579 5.58579 5.25 6 5.25H12C12.4142 5.25 12.75 5.58579 12.75 6C12.75 6.41421 12.4142 6.75 12 6.75H6C5.58579 6.75 5.25 6.41421 5.25 6ZM5.25 9C5.25 8.58579 5.58579 8.25 6 8.25H8.25C8.66421 8.25 9 8.58579 9 9C9 9.41421 8.66421 9.75 8.25 9.75H6C5.58579 9.75 5.25 9.41421 5.25 9Z" fill="#4D505A"/>\n</svg>\n',message:o.message})))))),t("zonos-hello-dialog-footer",{key:"540006185ce1d28d610052801dcf9281773c5504",appearanceSettings:this.appearanceSettings,setShowCountrySelect:o=>this.setShowCountrySelect(o),setShowLanguageSelect:o=>this.setShowLanguageSelect(o)})),this.showCountrySelect&&t("div",{key:"886c371fdfa8c9c15188ef9d6cbb637162fb0d27"},t("zonos-country-select",{key:"1365bee67831b64637e5c481f239c557f2649694",handleOnClose:()=>this.setShowCountrySelect(!1)})),this.showLanguageSelect&&t("div",{key:"44929f0c23627970b1706f6e8c76e51022201379"},t("zonos-language-select",{key:"86b9f68c84da77f9e1af51dcb7d512eb6b289a27",handleOnClose:()=>this.setShowLanguageSelect(!1)}))))}static get assetsDirs(){return["assets"]}static get watchers(){return{isOpen:["isOpenHandler"]}}};m.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--hello-country-flag{height:18px;width:18px;position:relative;overflow:hidden;border-radius:30px;-webkit-box-shadow:var(--zonos-elements-v3-shadow-medium);box-shadow:var(--zonos-elements-v3-shadow-medium);z-index:10;justify-self:center}:host .zonos--hello-dialog{position:absolute;background:var(--zonos-elements-surface-color);width:100vw;max-width:430px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;max-height:600px;border-radius:var(--zonos-elements-radius-12);outline:none;-webkit-box-shadow:var(--zonos-elements-v3-shadow-xxl);box-shadow:var(--zonos-elements-v3-shadow-xxl);overflow-y:auto;top:-2px;right:-2px;opacity:0;-webkit-transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out;transition:opacity 0.3s ease-in-out, transform 0.3s ease-in-out, -webkit-transform 0.3s ease-in-out;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:top right;transform-origin:top right;z-index:1001}:host .zonos--hello-dialog .zonos--hello-dialog-header{text-align:center}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:top left;transform-origin:top left;right:unset;left:-2px}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom{-webkit-transform-origin:bottom right;transform-origin:bottom right;bottom:calc(100% - 32px);top:unset}:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-bottom.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom left;transform-origin:bottom left}:host .zonos--hello-dialog::-webkit-scrollbar{width:12px;height:12px}:host .zonos--hello-dialog::-webkit-scrollbar-track{background:#f5f5f5;border-top-right-radius:var(--zonos-elements-radius-12);border-bottom-right-radius:var(--zonos-elements-radius-12)}:host .zonos--hello-dialog::-webkit-scrollbar-thumb{border-radius:10px;background:#ccc;border:4px solid transparent;background-clip:content-box}:host .zonos--hello-dialog::-webkit-scrollbar-thumb:hover{background:#999}:host .zonos--hello-dialog .zonos--animate-content{opacity:0;height:0;-webkit-transition:all 0.3s ease-in-out;transition:all 0.3s ease-in-out}:host .zonos--hello-dialog .zonos--show-animate-content{opacity:1;height:100%}:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scale(1);transform:scale(1)}:host .zonos--hello-dialog .zonos--close-button{position:absolute;right:8px;top:8px;width:var(--zonos-elements-size-md);height:var(--zonos-elements-size-md);display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;cursor:pointer;z-index:10}:host .zonos--hello-dialog .zonos--close-button:hover{background:var(--zonos-elements-hover-color);border-radius:var(--zonos-elements-radius-6)}:host .zonos--hello-dialog .zonos--hello-dialog-content{padding:16px}:host .zonos--hello-dialog .zonos--hello-dialog-content .zonos--hello-country-flag{border-radius:var(--zonos-elements-radius-4);width:32px;height:24px}:host .zonos--hello-dialog .zonos--flex-message{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;gap:12px}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}@media (max-height: 600px){:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override{max-height:80vh}}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}:host .zonos--hello-dialog.zonos--hello-dialog-mobile-override.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}@media (max-width: 768px){:host .zonos--hello-dialog{position:-webkit-sticky;position:sticky;top:unset;left:unset;right:unset;bottom:0;width:100vw;max-width:100vw;max-height:500px;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;-webkit-transform:scaleY(0);transform:scaleY(0);border-radius:0;-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px) and (max-height: 600px){:host .zonos--hello-dialog{max-height:80vh}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-animate-from-left{-webkit-transform-origin:bottom;transform-origin:bottom}}@media (max-width: 768px){:host .zonos--hello-dialog.zonos--hello-dialog-open{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1)}}";export{m as zonos_hello_dialog}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(n,e,t,r){function o(n){return n instanceof t?n:new t((function(e){e(n)}))}return new(t||(t=Promise))((function(t,i){function u(n){try{a(r.next(n))}catch(n){i(n)}}function s(n){try{a(r["throw"](n))}catch(n){i(n)}}function a(n){n.done?t(n.value):o(n.value).then(u,s)}a((r=r.apply(n,e||[])).next())}))};var __generator=this&&this.__generator||function(n,e){var t={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(n){return function(e){return a([n,e])}}function a(s){if(r)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(t=0)),t)try{if(r=1,o&&(i=s[0]&2?o["return"]:s[0]?o["throw"]||((i=o["return"])&&i.call(o),0):o.next)&&!(i=i.call(o,s[1])).done)return i;if(o=0,i)s=[s[0]&2,i.value];switch(s[0]){case 0:case 1:i=s;break;case 4:t.label++;return{value:s[1],done:false};case 5:t.label++;o=s[1];s=[0];continue;case 7:s=t.ops.pop();t.trys.pop();continue;default:if(!(i=t.trys,i=i.length>0&&i[i.length-1])&&(s[0]===6||s[0]===2)){t=0;continue}if(s[0]===3&&(!i||s[1]>i[0]&&s[1]<i[3])){t.label=s[1];break}if(s[0]===6&&t.label<i[1]){t.label=i[1];i=s;break}if(i&&t.label<i[2]){t.label=i[2];t.ops.push(s);break}if(i[2])t.ops.pop();t.trys.pop();continue}s=e.call(n,t)}catch(n){s=[6,n];o=0}finally{r=i=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-197c5707.system.js","./p-8c0ff373.system.js"],(function(n){"use strict";var e,t,r,o;return{setters:[function(n){e=n.l;t=n.a},function(e){r=e.s;o=e.c;var t={};t.checkoutHiddenBtnSelector=e.c;t.domesticRedirectedBtnSelector=e.d;n(t)}],execute:function(){var i=this;var u=function(n){var e=n.loadScriptSrc;if(!e){return{currentLoadScriptUrl:"",isForceLoadVersionDomain:false,isWhiteListed:false}}var t=["dev.elements.zonos.com","dev.assets-checkout.zonos.com",".js.zonos.com","zonos-elements-test-git","zonos-elements-git"];var r=["qa.js.zonos.com"];var o=new URL(e).origin;var i=t.some((function(n){return o.includes(n)}));var u=r.some((function(n){return o.includes(n)}));return{currentLoadScriptUrl:o,isForceLoadVersionDomain:u,isWhiteListed:i}};var s=["jsdelivr","cdnjs","unpkg","vercel"];var a="jsdelivr";var c=function(n){var e=s.indexOf(n);var t=s[e+1];return t||null};var l=function(n){if(!n){return null}var e=new URL(n).searchParams;var t=e.get("zonosQaUrl");if(!t){return null}var r=/[^a-zA-Z0-9-_]+/.test(t);if(!!r){return null}return t};var d=function(){var n=window&&window.location.href.includes("forceLoadCdn");if(typeof window==="undefined"||n){return null}var t=l(window.location.href);var r="https://v1.3.81.js.zonos.com";if(!t&&(r.includes("test.")||r.includes("test-"))){return r}if(!t&&["dev.demo.elements.zonos.com"].includes(window.location.hostname)){return"https://dev.elements.zonos.com"}if(!t){return null}if(t==="dev-elements"){return"https://dev.elements.zonos.com"}var o="preview.js.zonos.com";var i="https://".concat(t,".").concat(o);e("[ZONOS-WARNING] using '".concat(i,"' for loading elements script"),"warn");void fetch(i).then((function(){window.sessionStorage.removeItem("zonos--checkout-session-id");window.sessionStorage.removeItem("zonos--client-secret")})).catch((function(){alert("[ZONOS-WARNING] '".concat(i,"' IS NO LONGER AVAILABLE. REMOVING zonosQaUrl PARAM AND RELOADING THE PAGE"));var n=new URLSearchParams(window.location.search);n.delete("zonosQaUrl");var e=window.location.pathname;var t="".concat(e,"?").concat(n.toString());window.history.replaceState(window.history.state,"",t);window.location.reload();return null}));return i};var f="https://js.stripe.com/v3";var v=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var m="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used";var w=function(){var n=document.querySelectorAll('script[src^="'.concat(f,'"]'));for(var e=0;e<n.length;e++){var t=n[e];if(!t){continue}if(!v.test(t.src)){continue}return t}return null};var p=null;var h=function(n){var e=n&&!n.advancedFraudSignals?"?advancedFraudSignals=false":"";var r=document.createElement("script");r.src="".concat(f).concat(e);var o=document.head||document.body;if(!o){t("Expected document.body not to be null. Stripe.js requires a <body> element.");return null}o.appendChild(r);return r};var y=function(n){if(p!==null){return p}p=new Promise((function(e,t){if(typeof window==="undefined"||typeof document==="undefined"){e(null);return}if(window.Stripe&&n){console.warn(m)}if(window.Stripe){e(window.Stripe);return}try{var r=w();if(r&&n){console.warn(m)}else if(!r){r=h(n)}r===null||r===void 0?void 0:r.addEventListener("load",(function(){if(window.Stripe){e(window.Stripe)}else{t(new Error("Stripe.js not available"))}}));r===null||r===void 0?void 0:r.addEventListener("error",(function(){t(new Error("Failed to load Stripe.js"))}))}catch(n){t(n);return}}));return p};var z=function(n,e){if(!n||!n._registerWrapper){return}n._registerWrapper({name:"stripe-js",startTime:e})};var j=function(n,e,t){if(n===null){return null}var r=n.apply(undefined,e);z(r,t);return r};var g=Promise.resolve().then((function(){return y(null)}));var b=false;g.catch((function(n){if(!b){console.warn(n)}}));var k=function(){var n=[];for(var e=0;e<arguments.length;e++){n[e]=arguments[e]}return __awaiter(i,void 0,void 0,(function(){var e;return __generator(this,(function(t){b=true;e=Date.now();return[2,g.then((function(t){return j(t,n,e)}))]}))}))};var S="tempCartUUID";var O=function(){var n=new URLSearchParams(window.location.search);var e=n.get(S);return e};var U;var L=function(){if(typeof document==="undefined"){return null}var n=document.querySelector('script[src*="/zonos.js"]');var e=u({loadScriptSrc:n===null||n===void 0?void 0:n.src}),t=e.currentLoadScriptUrl,r=e.isWhiteListed;if(r){return t}return null}();var N="https://v1.3.81.js.zonos.com";var _=L||"https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.81";var R="https://unpkg.com/@zonos/elements@1.3.81";var A="https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.81";var I="https://rsms.me";var E="https://fonts.googleapis.com";var F=/^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;var T=function(){function n(){}return n}();n("Zonos",T);U=T;T.doneInit=false;T.debug=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosDebug=1/);T.zonosConversionTest=typeof window!=="undefined"&&!!window.location.search.match(/\?.*(&*)zonosConversionTest/);T._paypalMockResponse=null;T.isBigCommerce=false;T.releaseDate="1728674078511";T.isLegacyCheckout=false;T.isNpm=true;T.zonosQaUrl=null;T.zonosQaUrlApi=null;T.version="v".concat("1.3.81");T.modeAlerted=false;T.cartData=null;T.paypal=null;T.getCurrentTimestamp=function(){return(new Date).getTime()};T.zonosController=null;T.init=function(n){return __awaiter(i,[n],void 0,(function(n){var i,u;var s=n.appearance,a=n.checkoutSettings,c=n.currencyConverter,l=n.helloSettings,d=n.onCountryChange,f=n.overrideCurrencyFormat,v=n.storeId,m=n.zonosApiKey;return __generator(this,(function(n){switch(n.label){case 0:U.cartId=O();if(U.doneInit){return[2]}e("====== ZONOS DEBUG MODE: on (".concat(U.version,") ======"));U.zonosApiKey=m;U.storeId=v;if(!U.isNpm)return[3,2];e("====== ZONOS LOADING FROM NPM ======");if(!m&&!U.cartId){t("Zonos API key is required unless `tempCartUUID` is provided in url query params.");return[2]}if(!(!U.cartData&&U.cartId))return[3,2];e("Initialize cart data");return[4,r(U.cartId)];case 1:i=n.sent();if(!i){t("Failed to get cart data");return[2]}U.cartData=i.cartData;U.zonosApiKey=i.zonosApiKey;n.label=2;case 2:if(U.cartId&&U.cartData){e("Cart data is available, inject hidden button and trigger checkout");u=document.createElement("button");u.style.display="none";u.id="".concat(o);document.body.appendChild(u)}e("init zonos");U.injectZonosCdn();U.injectZonosCss();U.injectFonts();U.injectController({config:{appearance:s,checkoutSettings:a,currencyConverter:c,helloSettings:l,onCountryChange:d,overrideCurrencyFormat:f}});U.doneInit=true;return[2]}}))}))};T.displayCurrency=function(){var n=document.querySelector("zonos-hello");if(n){void n.displayCurrency()}};T.openHelloDialog=function(n){var e=document.querySelector("zonos-hello");if(e){void e.openHelloDialog(n!==null&&n!==void 0?n:true)}};T.showNotification=function(n){var e;void((e=U.zonosController)===null||e===void 0?void 0:e.showNotification(n))};T.updateOrganizationName=function(n){var e;void((e=U.zonosController)===null||e===void 0?void 0:e.updateOrganizationName(n))};T.disablePlaceOrderButtons=function(n){var e=n.autoEnable,t=e===void 0?true:e,r=n.config,o=n.disable,i=n.placeOrderButtonSelector;var u;if((u=r.checkoutSettings)===null||u===void 0?void 0:u.disablePlaceOrderButtonActivation){return}if(i){var s=document.querySelectorAll(i);var a=function(n){var e=n.target;if(e.getAttribute("disabled")){n.preventDefault();n.stopPropagation()}};s.forEach((function(n){var e=n.getAttribute("data-zonos-checkout-attached");if(e){return}if(o){n.setAttribute("disabled","true");n.addEventListener("click",a)}else{n.removeAttribute("disabled");n.removeEventListener("click",a)}}));if(t&&o){setTimeout((function(){s.forEach((function(n){n.removeAttribute("disabled");n.removeEventListener("click",a)}))}),5e3)}}};T.injectController=function(n){var r=n.config;var o;if(document.querySelector("zonos-controller")){return}if((o=r.checkoutSettings)===null||o===void 0?void 0:o.placeOrderButtonSelector){var u=r.checkoutSettings.placeOrderButtonSelector;U.disablePlaceOrderButtons({config:r,disable:true,placeOrderButtonSelector:u});var s=new MutationObserver((function(){U.disablePlaceOrderButtons({config:r,disable:true,placeOrderButtonSelector:u})}));s.observe(document.body,{childList:true,subtree:true})}var a=document.createElement("zonos-controller");a.config=r;a.zonosApiKey=U.zonosApiKey||"";a.addEventListener("stripeInitEvent",(function(n){return __awaiter(i,void 0,void 0,(function(){var r,o;return __generator(this,(function(i){switch(i.label){case 0:r=n.detail;e("loading Stripe");return[4,k(r.publishableKey)];case 1:o=i.sent();if(!o){t("API seems to be invalid or missing. Failed to load Stripe");return[2]}window.Zonos.stripe=o;void a.initCheckoutElement(o);return[2]}}))}))}));document.body.appendChild(a);U.zonosController=a;e("Zonos controller injected!")};T.injectScript=function(n){var r=n.cdnType,o=n.isModule,i=n.theRestUrl;var u=U.getZonosUrl(r);var s="".concat(u,"/").concat(i);var a=function(){var n=document.querySelector('script[src="'.concat(s,'"]'));return!!n};if(a()){e('Zonos script "'.concat(s,'" already exists in the document'),"warn");return}var l=document.head||document.body;var d=document.createElement("script");if(!!o){d.type="module"}else{d.noModule=true}d.src=s;d.crossOrigin="anonymous";d.onerror=function(){t("Failed to load ".concat(d.src));var n=c(r);if(!n){return}U.injectScript({cdnType:n,isModule:o,theRestUrl:i})};l.appendChild(d)};T.getZonosUrl=function(n){var e=function(){switch(n){case"jsdelivr":return _;case"unpkg":return R;case"cdnjs":return A;case"vercel":return N}};if(U.isNpm){var t=d();return t||e()}return e()};T.injectZonosCdn=function(){U.injectScript({cdnType:a,isModule:true,theRestUrl:"dist/zonos-elements/zonos-elements.esm.js"});U.injectScript({cdnType:a,isModule:false,theRestUrl:"dist/zonos-elements/zonos-elements.js"});e("Zonos cdn script injected!")};T.injectStylesheet=function(n){var e=n.cdnType,r=n.theRestUrl;var o=U.getZonosUrl(e);var i=document.head||document.body;var u=document.createElement("link");u.rel="preconnect";u.href="".concat(N,"/");i.appendChild(u);var s=document.createElement("link");s.rel="stylesheet";s.href="".concat(o,"/").concat(r);s.onerror=function(){t("Failed to load ".concat(s.href));var n=c(e);if(!n){return}U.injectStylesheet({cdnType:n,theRestUrl:r})};i.appendChild(s)};T.injectZonosCss=function(){var n=function(){return!!document.querySelector('link[rel="stylesheet"][href*="/dist/zonos-elements/zonos-elements.css"]')};if(n()){e("Zonos style links already injected","warn");return}U.injectStylesheet({cdnType:a,theRestUrl:"dist/zonos-elements/zonos-elements.css"});e("Zonos style css injected!")};T.injectFonts=function(){var n=function(){var n=document.querySelectorAll('link[rel="stylesheet"][href^="'.concat(I,'"]'));for(var e=0;e<n.length;e++){var t=n[e];if(!t){continue}if(F.test(t.href)){continue}return t}return null};if(n()){e("Inter font already injected","warn");return}var t=document.head||document.body;var r=document.createElement("link");r.rel="preconnect";r.href=I;t.appendChild(r);var o=document.createElement("link");o.rel="stylesheet";o.href="".concat(I,"/inter/inter.css");t.appendChild(o);e("Zonos font injected!")};T.setupGoogleFont=function(n){var e;void((e=U.zonosController)===null||e===void 0?void 0:e.setupGoogleFont(n))};T.injectSupportGoogleFont=function(n){var t;e("[FONT] injecting ".concat(n));var r=(t=n.match(/family=(.*?):/))===null||t===void 0?void 0:t[1];var o=document.head||document.body;if(!document.querySelector('link[rel="preconnect"][href^="'.concat(E,'"]'))){var i=document.createElement("link");i.rel="preconnect";i.href=E;o.appendChild(i)}if(document.querySelector('link[rel="stylesheet"][href="'.concat(n,'"]'))){e("[FONT] ".concat(r," font already injected"),"warn");return}var u=document.createElement("link");u.rel="stylesheet";u.href=n;o.appendChild(u);e("[FONT] ".concat(r," font injected!"))}}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as o,c as t,h as n,H as e}from"./p-5b7da777.js";import{x as i,j as s,y as r,d as a,a as c}from"./p-
|
|
1
|
+
import{r as o,c as t,h as n,H as e}from"./p-5b7da777.js";import{x as i,j as s,y as r,d as a,a as c}from"./p-6b4fec5a.js";import{z as l,b as d,d as h}from"./p-1086aac3.js";import{h as u,a as f,l as m}from"./p-ad7ce197.js";import"./p-a1b755bf.js";import"./p-1ca5696d.js";const p=o=>{const t=document.querySelector(o);if(!document.querySelector("zonos-hello")&&t){const o=document.createElement("zonos-hello");return t.appendChild(o),!0}return!1},w=async o=>{if(window.Zonos.isLegacyCheckout)return void m("Hello is disabled when isLegacyCheckout","info");const{anchorElementSelector:t}=o;let n=t;if(!o.anchorElementSelector&&o.desktopLocation){const o=(({position:o="bottom-right"})=>{const t=".zonos--hello-mobile-wrapper";if(document.querySelector(t))return t;const n=document.createElement("div");return n.className="zonos--hello-mobile-wrapper",n.style.position="fixed","top-right"===o&&(n.style.top="72px",n.style.right="24px"),"top-left"===o&&(n.style.top="72px",n.style.left="24px"),"bottom-right"===o&&(n.style.bottom="72px",n.style.right="24px"),"bottom-left"===o&&(n.style.bottom="72px",n.style.left="24px"),n.style.zIndex="2147483007",document.body.appendChild(n),t})({position:"bottom-right"});n=o}if(n&&i(n)){if(m("Hello init complete"),!p(n)){const o=new MutationObserver((()=>{p(n)&&o.disconnect()}));o.observe(document.body,{childList:!0,subtree:!0}),setTimeout((()=>{p(n)}),1e3)}}else f(`Selector anchorElementSelector "${o.anchorElementSelector}" is not a valid selector.`)},v=class{constructor(n){o(this,n),this.paypalInitEvent=t(this,"paypalInitEvent",7),this.stripeInitEvent=t(this,"stripeInitEvent",7),this.config=void 0,this.zonosApiKey=void 0}async initCheckoutElement(o){var t;o?(s.stripe=o,((t=l.checkoutSettings).placeOrderButtonSelector||window.Zonos.cartData)&&(!t.placeOrderButtonSelector||i(t.placeOrderButtonSelector)?(()=>{if(!document.querySelector("zonos-checkout")){const o=document.createElement("zonos-checkout");document.body.appendChild(o)}})():f(`Selector checkoutButtonAnchor "${t.placeOrderButtonSelector}" is not a valid selector`)),m("init checkout element")):m("Stripe is not loaded yet - cannot init checkout element","warn")}initZonosNotification(){if(document.querySelector("zonos-notification"))return;const o=document.createElement("zonos-notification");document.body.appendChild(o)}async setupGoogleFont(o){var t,n;const e=o||h();if("Inter"===e){if(!o)return;m("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn"),l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:o})}const i=new URLSearchParams;i.set("family",e);const{errors:s,json:r}=await u(`/api/zonos-elements/get-font-detail?${i.toString()}`);if(s.length>0||!(null==r?void 0:r.fontUrl))return m(`Failed to load font ${e}`,"warn"),void(l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:"Inter"}));null===(n=(t=window.Zonos).injectSupportGoogleFont)||void 0===n||n.call(t,r.fontUrl),o&&(m(`[FONT] ${o} font override applied`),l.appearance=Object.assign(Object.assign({},l.appearance),{fontFamily:o}))}handleLocationChange(){w(l.helloSettings)}initHistoryListener(){const o=history.pushState;history.pushState=function(){return window.dispatchEvent(new window.Event("pushstate")),window.dispatchEvent(new window.Event("locationchange")),o.apply(this,arguments)};const t=history.replaceState;history.replaceState=function(){return window.dispatchEvent(new window.Event("replacestate")),window.dispatchEvent(new window.Event("locationchange")),t.apply(this,arguments)}}async componentWillLoad(){this.initHistoryListener(),l.zonosApiKey=this.zonosApiKey,(async()=>{var o,t;const{errors:n,json:e,zonosMode:i}=await(async()=>{const{errors:o,json:t,zonosMode:n}=await u("/api/zonos-elements/zonos-settings");return o.length?(f("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:t,zonosMode:n}})();if("403"===(null===(o=n[0])||void 0===o?void 0:o.type.toString()))return void m("Failed to load zonos settings. This domain may not have access","warn");this.initZonosNotification();const s=Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:(()=>{var o,t,n;return window.Zonos.isLegacyCheckout?(null===(o=null==e?void 0:e.appearanceSettings)||void 0===o?void 0:o.logoUrl)||(null===(t=this.config.appearance)||void 0===t?void 0:t.logoUrl):null===(n=this.config.appearance)||void 0===n?void 0:n.logoUrl})()}),checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{subscriptionStatus:void 0}):void 0});d({overrideSettings:s,zonosSettings:e}),l.zonosMode=i,this.setupGoogleFont(),"DISABLED"===l.helloSettings.visibilityStatus&&m("=== Hello is disabled by store owner ===","warn"),l.helloSettings&&"ENABLED"===l.helloSettings.visibilityStatus&&(m("Initializing hello"),w(l.helloSettings)),await r();const a=(null===(t=null==e?void 0:e.checkoutSettings)||void 0===t?void 0:t.externalServiceTokens.find((o=>"STRIPE_PUBLISHABLE_TOKEN"===o.type)))||null;if(a&&this.stripeInitEvent)return"INACTIVE"===l.checkoutSettings.subscriptionStatus?(m('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn"),void m("zonos controller loaded")):"DISABLED"===l.checkoutSettings.visibilityStatus?(m("=== Checkout is disabled by store owner ===","warn"),void m("zonos controller loaded")):void this.stripeInitEvent.emit({publishableKey:a.token});m("Checkout failed to load -- missing publishable key","warn")})()}async showNotification(o){const t=document.querySelector("zonos-notification");t?t.showNotification(o):m("Failed to show notification - zonos-notification not found","warn")}async reset(){a.checkoutSessionId=null,s.clientSecret=null}async overrideConfig(o){d({overrideSettings:o,zonosSettings:null})}async overrideCountry(o){m(`Override country code to ${o}`),c(o)}async getAppearanceSetting(){return l.appearance}async updateOrganizationName(o){l.organizationName=o}render(){return n(e,{key:"c168f24dcc30dffd48c604f8888b093a7a3f1525",class:"zonos--elements"})}};v.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";export{v as zonos_controller}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(t,n,i,o){function e(t){return t instanceof i?t:new i((function(n){n(t)}))}return new(i||(i=Promise))((function(i,r){function u(t){try{a(o.next(t))}catch(t){r(t)}}function s(t){try{a(o["throw"](t))}catch(t){r(t)}}function a(t){t.done?i(t.value):e(t.value).then(u,s)}a((o=o.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,e,r,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(t){return function(n){return a([t,n])}}function a(s){if(o)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(i=0)),i)try{if(o=1,e&&(r=s[0]&2?e["return"]:s[0]?e["throw"]||((r=e["return"])&&r.call(e),0):e.next)&&!(r=r.call(e,s[1])).done)return r;if(e=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;e=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(s[0]===6&&i.label<r[1]){i.label=r[1];r=s;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(s);break}if(r[2])i.ops.pop();i.trys.pop();continue}s=n.call(t,i)}catch(t){s=[6,t];e=0}finally{o=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-0f640802.system.js","./p-b74ff880.system.js","./p-c4957e35.system.js","./p-91462d96.system.js","./p-455b7545.system.js"],(function(t){"use strict";var n,i,o,e,r,u,s,a,c,f,d,h,l,v,w;return{setters:[function(t){n=t.r;i=t.c;o=t.h;e=t.H},function(t){r=t.x;u=t.j;s=t.y;a=t.d;c=t.a},function(t){f=t.z;d=t.b;h=t.d},function(t){l=t.h;v=t.a;w=t.l},function(){},function(){}],execute:function(){var m=this;var _=function(){return __awaiter(m,void 0,void 0,(function(){var t,n,i,o;return __generator(this,(function(e){switch(e.label){case 0:return[4,l("/api/zonos-elements/zonos-settings")];case 1:t=e.sent(),n=t.errors,i=t.json,o=t.zonosMode;if(n.length){v("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:n,json:null,zonosMode:o}]}return[2,{errors:[],json:i,zonosMode:o}]}}))}))};var p=function(){var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var b=function(t){if(!t.placeOrderButtonSelector&&!window.Zonos.cartData){return}if(t.placeOrderButtonSelector&&!r(t.placeOrderButtonSelector)){v('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}p()};var g=function(t){var n=document.querySelector(t);var i=document.querySelector("zonos-hello");if(!i&&n){var o=document.createElement("zonos-hello");n.appendChild(o);return true}return false};var y=function(t){var n=t.position,i=n===void 0?"bottom-right":n;var o=".zonos--hello-mobile-wrapper";var e=document.querySelector(o);if(e){return o}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(i==="top-right"){r.style.top="72px";r.style.right="24px"}if(i==="top-left"){r.style.top="72px";r.style.left="24px"}if(i==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(i==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483007";document.body.appendChild(r);return o};var z=function(t){return __awaiter(m,void 0,void 0,(function(){var n,i,o,e,u;return __generator(this,(function(s){if(window.Zonos.isLegacyCheckout){w("Hello is disabled when isLegacyCheckout","info");return[2]}n=t.anchorElementSelector;i=n;if(!t.anchorElementSelector&&t.desktopLocation){o=y({position:"bottom-right"});i=o}if(!i||!r(i)){v('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}w("Hello init complete");e=g(i);if(!e){u=new MutationObserver((function(){var t=g(i);if(t){u.disconnect()}}));u.observe(document.body,{childList:true,subtree:true});setTimeout((function(){g(i)}),1e3)}return[2]}))}))};var j=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var I=j;var k=t("zonos_controller",function(){function t(t){n(this,t);this.paypalInitEvent=i(this,"paypalInitEvent",7);this.stripeInitEvent=i(this,"stripeInitEvent",7);this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){w("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}u.stripe=t;void b(f.checkoutSettings);w("init checkout element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,i,o,e,r,u,s,a;return __generator(this,(function(c){switch(c.label){case 0:o=t||h();if(o==="Inter"){if(!t){return[2]}w("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t})}e=new URLSearchParams;e.set("family",o);return[4,l("/api/zonos-elements/get-font-detail?".concat(e.toString()))];case 1:r=c.sent(),u=r.errors,s=r.json;if(u.length>0||!(s===null||s===void 0?void 0:s.fontUrl)){w("Failed to load font ".concat(o),"warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:"Inter"});return[2]}a=s.fontUrl;(i=(n=window.Zonos).injectSupportGoogleFont)===null||i===void 0?void 0:i.call(n,a);if(!t){return[2]}w("[FONT] ".concat(t," font override applied"));f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.handleLocationChange=function(){void z(f.helloSettings)};t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function n(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var n=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return n.apply(this,arguments)}};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();f.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,i,o,e,r,u,a,c;var h=this;return __generator(this,(function(l){switch(l.label){case 0:return[4,_()];case 1:i=l.sent(),o=i.errors,e=i.json,r=i.zonosMode;if(((t=o[0])===null||t===void 0?void 0:t.type.toString())==="403"){w("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.initZonosNotification();u=function(){var t,n,i;if(window.Zonos.isLegacyCheckout){return((t=e===null||e===void 0?void 0:e.appearanceSettings)===null||t===void 0?void 0:t.logoUrl)||((n=h.config.appearance)===null||n===void 0?void 0:n.logoUrl)}return(i=h.config.appearance)===null||i===void 0?void 0:i.logoUrl};a=Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:u()}),checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{subscriptionStatus:undefined}):undefined});d({overrideSettings:a,zonosSettings:e});f.zonosMode=r;void this.setupGoogleFont();if(f.helloSettings.visibilityStatus==="DISABLED"){w("=== Hello is disabled by store owner ===","warn")}if(f.helloSettings&&f.helloSettings.visibilityStatus==="ENABLED"){w("Initializing hello");void z(f.helloSettings)}return[4,s()];case 2:l.sent();c=((n=e===null||e===void 0?void 0:e.checkoutSettings)===null||n===void 0?void 0:n.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!c||!this.stripeInitEvent){w("Checkout failed to load -- missing publishable key","warn");return[2]}if(f.checkoutSettings.subscriptionStatus==="INACTIVE"){w('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");w("zonos controller loaded");return[2]}if(f.checkoutSettings.visibilityStatus==="DISABLED"){w("=== Checkout is disabled by store owner ===","warn");w("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:c.token});return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){n=document.querySelector("zonos-notification");if(!n){w("Failed to show notification - zonos-notification not found","warn");return[2]}void n.showNotification(t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){a.checkoutSessionId=null;u.clientSecret=null;return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){d({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){w("Override country code to ".concat(t));void c(t);return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,f.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){f.organizationName=t;return[2]}))}))};t.prototype.render=function(){return o(e,{key:"c168f24dcc30dffd48c604f8888b093a7a3f1525",class:"zonos--elements"})};return t}());k.style=I}}}));
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(t,n,i,o){function e(t){return t instanceof i?t:new i((function(n){n(t)}))}return new(i||(i=Promise))((function(i,r){function u(t){try{a(o.next(t))}catch(t){r(t)}}function s(t){try{a(o["throw"](t))}catch(t){r(t)}}function a(t){t.done?i(t.value):e(t.value).then(u,s)}a((o=o.apply(t,n||[])).next())}))};var __generator=this&&this.__generator||function(t,n){var i={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},o,e,r,u;return u={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(u[Symbol.iterator]=function(){return this}),u;function s(t){return function(n){return a([t,n])}}function a(s){if(o)throw new TypeError("Generator is already executing.");while(u&&(u=0,s[0]&&(i=0)),i)try{if(o=1,e&&(r=s[0]&2?e["return"]:s[0]?e["throw"]||((r=e["return"])&&r.call(e),0):e.next)&&!(r=r.call(e,s[1])).done)return r;if(e=0,r)s=[s[0]&2,r.value];switch(s[0]){case 0:case 1:r=s;break;case 4:i.label++;return{value:s[1],done:false};case 5:i.label++;e=s[1];s=[0];continue;case 7:s=i.ops.pop();i.trys.pop();continue;default:if(!(r=i.trys,r=r.length>0&&r[r.length-1])&&(s[0]===6||s[0]===2)){i=0;continue}if(s[0]===3&&(!r||s[1]>r[0]&&s[1]<r[3])){i.label=s[1];break}if(s[0]===6&&i.label<r[1]){i.label=r[1];r=s;break}if(r&&i.label<r[2]){i.label=r[2];i.ops.push(s);break}if(r[2])i.ops.pop();i.trys.pop();continue}s=n.call(t,i)}catch(t){s=[6,t];e=0}finally{o=r=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};System.register(["./p-fd061229.system.js","./p-62044821.system.js","./p-b74ff880.system.js","./p-197c5707.system.js","./p-91462d96.system.js","./p-455b7545.system.js"],(function(t){"use strict";var n,i,o,e,r,u,s,a,c,f,d,h,l,v,w;return{setters:[function(t){n=t.r;i=t.c;o=t.h;e=t.H},function(t){r=t.x;u=t.j;s=t.y;a=t.d;c=t.a},function(t){f=t.z;d=t.b;h=t.d},function(t){l=t.h;v=t.a;w=t.l},function(){},function(){}],execute:function(){var m=this;var _=function(){return __awaiter(m,void 0,void 0,(function(){var t,n,i,o;return __generator(this,(function(e){switch(e.label){case 0:return[4,l("/api/zonos-elements/zonos-settings")];case 1:t=e.sent(),n=t.errors,i=t.json,o=t.zonosMode;if(n.length){v("Error occurred when getting zonos settings. If this is not an unauthorized error, it will use user settings or default settings");return[2,{errors:n,json:null,zonosMode:o}]}return[2,{errors:[],json:i,zonosMode:o}]}}))}))};var p=function(){var t=document.querySelector("zonos-checkout");if(!t){var n=document.createElement("zonos-checkout");document.body.appendChild(n)}};var b=function(t){if(!t.placeOrderButtonSelector&&!window.Zonos.cartData){return}if(t.placeOrderButtonSelector&&!r(t.placeOrderButtonSelector)){v('Selector checkoutButtonAnchor "'.concat(t.placeOrderButtonSelector,'" is not a valid selector'));return}p()};var g=function(t){var n=document.querySelector(t);var i=document.querySelector("zonos-hello");if(!i&&n){var o=document.createElement("zonos-hello");n.appendChild(o);return true}return false};var y=function(t){var n=t.position,i=n===void 0?"bottom-right":n;var o=".zonos--hello-mobile-wrapper";var e=document.querySelector(o);if(e){return o}var r=document.createElement("div");r.className="zonos--hello-mobile-wrapper";r.style.position="fixed";if(i==="top-right"){r.style.top="72px";r.style.right="24px"}if(i==="top-left"){r.style.top="72px";r.style.left="24px"}if(i==="bottom-right"){r.style.bottom="72px";r.style.right="24px"}if(i==="bottom-left"){r.style.bottom="72px";r.style.left="24px"}r.style.zIndex="2147483007";document.body.appendChild(r);return o};var z=function(t){return __awaiter(m,void 0,void 0,(function(){var n,i,o,e,u;return __generator(this,(function(s){if(window.Zonos.isLegacyCheckout){w("Hello is disabled when isLegacyCheckout","info");return[2]}n=t.anchorElementSelector;i=n;if(!t.anchorElementSelector&&t.desktopLocation){o=y({position:"bottom-right"});i=o}if(!i||!r(i)){v('Selector anchorElementSelector "'.concat(t.anchorElementSelector,'" is not a valid selector.'));return[2]}w("Hello init complete");e=g(i);if(!e){u=new MutationObserver((function(){var t=g(i);if(t){u.disconnect()}}));u.observe(document.body,{childList:true,subtree:true});setTimeout((function(){g(i)}),1e3)}return[2]}))}))};var j=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host{visibility:hidden;opacity:0;height:0}";var I=j;var k=t("zonos_controller",function(){function t(t){n(this,t);this.paypalInitEvent=i(this,"paypalInitEvent",7);this.stripeInitEvent=i(this,"stripeInitEvent",7);this.config=undefined;this.zonosApiKey=undefined}t.prototype.initCheckoutElement=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){if(!t){w("Stripe is not loaded yet - cannot init checkout element","warn");return[2]}u.stripe=t;void b(f.checkoutSettings);w("init checkout element");return[2]}))}))};t.prototype.initZonosNotification=function(){var t=document.querySelector("zonos-notification");if(t){return}var n=document.createElement("zonos-notification");document.body.appendChild(n)};t.prototype.setupGoogleFont=function(t){return __awaiter(this,void 0,void 0,(function(){var n,i,o,e,r,u,s,a;return __generator(this,(function(c){switch(c.label){case 0:o=t||h();if(o==="Inter"){if(!t){return[2]}w("[FONT] Just applied Inter , but no need to inject since we already inject Inter on start","warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t})}e=new URLSearchParams;e.set("family",o);return[4,l("/api/zonos-elements/get-font-detail?".concat(e.toString()))];case 1:r=c.sent(),u=r.errors,s=r.json;if(u.length>0||!(s===null||s===void 0?void 0:s.fontUrl)){w("Failed to load font ".concat(o),"warn");f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:"Inter"});return[2]}a=s.fontUrl;(i=(n=window.Zonos).injectSupportGoogleFont)===null||i===void 0?void 0:i.call(n,a);if(!t){return[2]}w("[FONT] ".concat(t," font override applied"));f.appearance=Object.assign(Object.assign({},f.appearance),{fontFamily:t});return[2]}}))}))};t.prototype.handleLocationChange=function(){void z(f.helloSettings)};t.prototype.initHistoryListener=function(){var t=history.pushState;history.pushState=function n(){window.dispatchEvent(new window.Event("pushstate"));window.dispatchEvent(new window.Event("locationchange"));return t.apply(this,arguments)};var n=history.replaceState;history.replaceState=function t(){window.dispatchEvent(new window.Event("replacestate"));window.dispatchEvent(new window.Event("locationchange"));return n.apply(this,arguments)}};t.prototype.componentWillLoad=function(){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(n){this.initHistoryListener();f.zonosApiKey=this.zonosApiKey;(function(){return __awaiter(t,void 0,void 0,(function(){var t,n,i,o,e,r,u,a,c;var h=this;return __generator(this,(function(l){switch(l.label){case 0:return[4,_()];case 1:i=l.sent(),o=i.errors,e=i.json,r=i.zonosMode;if(((t=o[0])===null||t===void 0?void 0:t.type.toString())==="403"){w("Failed to load zonos settings. This domain may not have access","warn");return[2]}this.initZonosNotification();u=function(){var t,n,i;if(window.Zonos.isLegacyCheckout){return((t=e===null||e===void 0?void 0:e.appearanceSettings)===null||t===void 0?void 0:t.logoUrl)||((n=h.config.appearance)===null||n===void 0?void 0:n.logoUrl)}return(i=h.config.appearance)===null||i===void 0?void 0:i.logoUrl};a=Object.assign(Object.assign({},this.config),{appearance:Object.assign(Object.assign({},this.config.appearance),{logoUrl:u()}),checkoutSettings:this.config.checkoutSettings?Object.assign(Object.assign({},this.config.checkoutSettings),{subscriptionStatus:undefined}):undefined});d({overrideSettings:a,zonosSettings:e});f.zonosMode=r;void this.setupGoogleFont();if(f.helloSettings.visibilityStatus==="DISABLED"){w("=== Hello is disabled by store owner ===","warn")}if(f.helloSettings&&f.helloSettings.visibilityStatus==="ENABLED"){w("Initializing hello");void z(f.helloSettings)}return[4,s()];case 2:l.sent();c=((n=e===null||e===void 0?void 0:e.checkoutSettings)===null||n===void 0?void 0:n.externalServiceTokens.find((function(t){return t.type==="STRIPE_PUBLISHABLE_TOKEN"})))||null;if(!c||!this.stripeInitEvent){w("Checkout failed to load -- missing publishable key","warn");return[2]}if(f.checkoutSettings.subscriptionStatus==="INACTIVE"){w('=== Checkout subscription is "INACTIVE" - Cancel initializing for Checkout ===',"warn");w("zonos controller loaded");return[2]}if(f.checkoutSettings.visibilityStatus==="DISABLED"){w("=== Checkout is disabled by store owner ===","warn");w("zonos controller loaded");return[2]}this.stripeInitEvent.emit({publishableKey:c.token});return[2]}}))}))})();return[2]}))}))};t.prototype.showNotification=function(t){return __awaiter(this,void 0,void 0,(function(){var n;return __generator(this,(function(i){n=document.querySelector("zonos-notification");if(!n){w("Failed to show notification - zonos-notification not found","warn");return[2]}void n.showNotification(t);return[2]}))}))};t.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){a.checkoutSessionId=null;u.clientSecret=null;return[2]}))}))};t.prototype.overrideConfig=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){d({overrideSettings:t,zonosSettings:null});return[2]}))}))};t.prototype.overrideCountry=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){w("Override country code to ".concat(t));void c(t);return[2]}))}))};t.prototype.getAppearanceSetting=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,f.appearance]}))}))};t.prototype.updateOrganizationName=function(t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){f.organizationName=t;return[2]}))}))};t.prototype.render=function(){return o(e,{key:"c168f24dcc30dffd48c604f8888b093a7a3f1525",class:"zonos--elements"})};return t}());k.style=I}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,h as o,H as t}from"./p-5b7da777.js";import{L as s,t as a,l as n}from"./p-
|
|
1
|
+
import{r as e,h as o,H as t}from"./p-5b7da777.js";import{L as s,t as a,l as n}from"./p-6b4fec5a.js";import{d as l}from"./p-1086aac3.js";import{l as i}from"./p-97aceb11.js";import"./p-ad7ce197.js";import"./p-a1b755bf.js";import"./p-1ca5696d.js";const c=class{constructor(o){e(this,o),this.languageSelected=e=>{s(e),this.handleOnClose()},this.handleOnClose=()=>{}}render(){const{selectedLocale:e}=n;return o(t,{key:"448f89b5870956b6e9455968134b94c9409a983d",class:"zonos--elements",style:{"--font-family":l()}},o("div",{key:"23841aa801d68da4b537cfaab5ea89405ec66a9f",class:"zonos--language-select"},o("zonos-select-dialog-header",{key:"5fc1b45aa0cb27c94163c2dace5ce4ad63215dfc",handleOnClose:()=>this.handleOnClose(),label:a("Select a language")}),o("div",{key:"7030fb276a05eea0e7333add3219b5316495662c",class:"zonos--language-select-content"},i.map((t=>o("button",{class:"zonos--language-select-button",onClick:()=>this.languageSelected(t.code)},o("zonos-text",{textColor:"gray-800"},t.translatedLabel),t.code===e&&o("zonos-icon",{content:'<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M7.99996 2.6665C5.05444 2.6665 2.66663 5.05432 2.66663 7.99984C2.66663 10.9454 5.05444 13.3332 7.99996 13.3332C10.9455 13.3332 13.3333 10.9454 13.3333 7.99984C13.3333 5.05432 10.9455 2.6665 7.99996 2.6665Z" fill="#AFF8C3"/>\n<path fill-rule="evenodd" clip-rule="evenodd" d="M10.1403 6.10535C10.3582 6.27488 10.3975 6.58902 10.228 6.80699L8.01055 9.65797C7.76436 9.97449 7.29646 10.0036 7.01291 9.72008L5.81307 8.52024C5.61781 8.32498 5.61781 8.0084 5.81307 7.81314C6.00833 7.61787 6.32492 7.61787 6.52018 7.81314L7.45301 8.74597L9.43862 6.19305C9.60815 5.97508 9.92229 5.93581 10.1403 6.10535Z" fill="#246627"/>\n</svg>\n',size:16})))))))}};c.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--language-select{width:100%}:host .zonos--language-select .zonos--language-select-content{display:grid;grid-template-columns:repeat(3, minmax(-webkit-max-content, 1fr));grid-template-columns:repeat(3, minmax(max-content, 1fr));padding:16px;padding-top:0px}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button{display:-ms-flexbox;display:flex;padding:8px;gap:4px;-ms-flex-align:center;align-items:center;border-radius:var(--zonos-elements-radius-4);cursor:pointer;width:100%;border:none;background:none}:host .zonos--language-select .zonos--language-select-content .zonos--language-select-button:hover{background:var(--zonos-elements-gray-100)}@media (max-width: 400px){:host .zonos--language-select .zonos--language-select-content{grid-template-columns:1fr 1fr}}";const r=class{constructor(o){e(this,o),this.handleOnClose=()=>{},this.label=""}render(){return o(t,{key:"8ac4e1bcd64f6a2073e1161fec76c9b117345ada",class:"zonos--elements",style:{"--font-family":l()}},o("zonos-v-stack",{key:"fe4a184a8bed7aceb4c3f8d341fed50380587c77",class:"zonos--select-dialog-header-wrapper",spacing:8},o("div",{key:"2176069a11ba20c7408ef898044f2ba68eea4a80",class:"zonos--select-dialog-header"},o("zonos-text",{key:"45b9d890484881a15c4fa7a7e4028f9887cc942e",type:"boldLabel"},this.label),o("zonos-button",{key:"65f0d9ea7b6dee35d23aa6fca19fd686190b667f",class:"zonos--close-button",icon:o("zonos-icon",{"aria-label":"Close select dialog",content:'<svg xmlns="https://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path fill="#C5C6CA" fill-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" clip-rule="evenodd"/><path fill="#4D505A" fill-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" clip-rule="evenodd"/></svg>',size:20}),noBackground:!0,onClick:()=>this.handleOnClose()})),o("slot",{key:"758fce95d668ad755745687d3fcf1a6a307061bc"})))}};r.style=":host{font-family:var(--font-family, Inter), Inter;display:block;white-space:normal}:host *{font-family:var(--font-family, Inter), Inter}:host img{max-width:100%}:host dl,:host dd,:host h1,:host h2,:host h3,:host h4,:host h5,:host h6,:host hr,:host figure,:host p,:host pre{margin:0}:host{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}:host .zonos--select-dialog-header-wrapper{position:-webkit-sticky;position:sticky;top:0;background:var(--zonos-elements-surface-color);padding:16px}:host .zonos--select-dialog-header-wrapper .zonos--select-dialog-header{position:relative;-ms-flex-pack:justify;justify-content:space-between;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}";export{c as zonos_language_select,r as zonos_select_dialog_header}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as o}from"./p-5b7da777.js";export{s as setNonce}from"./p-5b7da777.js";import{g as t}from"./p-e1255160.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((async e=>(await t(),o([["p-
|
|
1
|
+
import{p as e,b as o}from"./p-5b7da777.js";export{s as setNonce}from"./p-5b7da777.js";import{g as t}from"./p-e1255160.js";(()=>{const o=import.meta.url,t={};return""!==o&&(t.resourcesUrl=new URL(".",o).href),e(t)})().then((async e=>(await t(),o([["p-bc4a147d",[[2,"zonos-checkout",{appearanceSettingsOverride:[16],preview:[4],mobile:[4],defaultAddress:[16],forceDialogOpen:[4,"force-dialog-open"],open:[32],stripe:[32],submitLoading:[32],collapseReviewMobile:[32],isAttachError:[32],isMobile:[32],zonosReviewRef:[32],storybookPaymentStatusOverride:[32],isLegacyCheckout:[32],confirmDialogOpen:[32],inventoryCheckErrorMessage:[32],closeDialogHandler:[64],init:[64],setToFinishStep:[64],mockCheckoutSession:[64]},[[16,"zonos--init-cart-info","initCartInfoHandler"],[4,"keydown","handleKeyPress"],[9,"resize","handleWindowResize"]],{appearanceSettingsOverride:["appearanceSettingsOverrideChanged","handleAppearanceSettingsOverrideChange"],mobile:["handleMobileChange"],defaultAddress:["handleAddressChange"]}]]],["p-97f0d9d2",[[1,"zonos-hello",{mobileLocationOverride:[1,"mobile-location-override"],animateFromLeftOverride:[4,"animate-from-left-override"],appearanceSettingsOverride:[16],showPeekMessage:[32],zonosStoreHelloSettings:[32],showDialog:[32],peekMessage:[32],initialUrl:[32],allRestrictedItems:[32],allFoundProducts:[32],productsOnPage:[32],isHelloWidgetRendered:[32],isMobile:[32],getCountryList:[64],displayCurrency:[64],convertAndFormat:[64],convert:[64],format:[64],openHelloDialog:[64]},[[9,"resize","handleResize"]],{appearanceSettingsOverride:["handleAppearanceSettingsOverrideChange"]}]]],["p-e468f85e",[[1,"zonos-controller",{config:[16],zonosApiKey:[1,"zonos-api-key"],initCheckoutElement:[64],setupGoogleFont:[64],showNotification:[64],reset:[64],overrideConfig:[64],overrideCountry:[64],getAppearanceSetting:[64],updateOrganizationName:[64]},[[8,"locationchange","handleLocationChange"]]]]],["p-747eed39",[[1,"zonos-tooltip",{label:[1],subtitle:[1],showTooltip:[32]}]]],["p-6de38759",[[1,"zonos-component",{first:[1],middle:[1],last:[1]}]]],["p-25633055",[[1,"zonos-link",{href:[1],rel:[1],target:[1],linkTitle:[1,"link-title"]}]]],["p-7be7bd28",[[1,"zonos-logo",{theme:[1],width:[1]}]]],["p-30470eb7",[[1,"zonos-text",{textColor:[1,"text-color"],size:[1],type:[1],weight:[2],ready:[32]}]]],["p-fca6f444",[[1,"zonos-card",{actions:[16],backgroundColor:[1,"background-color"],borderRadius:[2,"border-radius"],footerActions:[16],footerContent:[16],footerHeight:[2,"footer-height"],label:[16],spacing:[1]}]]],["p-8894c902",[[1,"zonos-banner",{bannerTitle:[1,"banner-title"],intent:[1],hasContent:[32]}]]],["p-f4765417",[[1,"zonos-v-stack",{spacing:[2]}]]],["p-fac38f60",[[1,"zonos-language-select",{handleOnClose:[16]}],[1,"zonos-select-dialog-header",{handleOnClose:[16],label:[1]}]]],["p-264fbd27",[[1,"zonos-country-select",{handleOnClose:[16],inputValue:[32]}],[1,"zonos-hello-dialog-footer",{appearanceSettings:[16],setShowCountrySelect:[16],setShowLanguageSelect:[16]}],[1,"zonos-custom-message",{icon:[1],message:[1]}],[2,"zonos-virtual-scroll",{renderItem:[16],itemWidth:[2,"item-width"],fallbackItemHeight:[2,"fallback-item-height"],itemHeights:[16],container:[32],scrollTop:[32],totalHeight:[32]},null,{itemHeights:["updateTotalHeight"],fallbackItemHeight:["updateTotalHeight"]}]]],["p-df4deb97",[[1,"zonos-hello-dialog",{isOpen:[4,"is-open"],setIsOpen:[16],mobileLocationOverride:[1,"mobile-location-override"],animateFromLeftOverride:[4,"animate-from-left-override"],appearanceSettings:[16],restrictedItems:[16],welcomeMessage:[32],showCountrySelect:[32],showLanguageSelect:[32]},[[4,"click","globalClickHandler"]],{isOpen:["isOpenHandler"]}]]],["p-a1c5c1a2",[[1,"zonos-shipping-rich-radio",{items:[16],borderColor:[1,"border-color"],borderStyle:[1,"border-style"],theme:[1],initialSelectedValue:[8,"initial-selected-value"],selectedItem:[32]}]]],["p-41f42a5c",[[1,"zonos-input",{inputValue:[1,"input-value"],inputLabel:[1,"input-label"],inputSize:[1,"input-size"],isDisabled:[4,"is-disabled"],isError:[4,"is-error"],inputPlaceholder:[1,"input-placeholder"],value:[32]},null,{inputValue:["onInputValueChange"]}]]],["p-a2fedd1c",[[2,"zonos-payment",{titleText:[1,"title-text"],stripe:[32],stripeElements:[32]},null,{stripeElements:["watchInitStripe"],stripe:["watchInitStripe"]}],[2,"zonos-paypal-payment"],[1,"zonos-notification",{notificationArray:[32],showNotification:[64]}]]],["p-a3200d5c",[[1,"zonos-country-flag",{countryCode:[1,"country-code"],size:[2]}]]],["p-f3fc05a8",[[17,"zonos-button",{buttonColor:[1,"button-color"],backgroundColor:[1,"background-color"],borderStyle:[1,"border-style"],isDisabled:[4,"is-disabled"],icon:[16],iconRight:[4,"icon-right"],size:[1],variant:[1],noBackground:[4,"no-background"],withBoxShadow:[4,"with-box-shadow"],noPaddingLeft:[4,"no-padding-left"],noPaddingRight:[4,"no-padding-right"],loading:[4],justifyContent:[1,"justify-content"],theme:[1],hasIcon:[32],hasContent:[32]},[[2,"click","clickHandler"]],{icon:["iconChangeHandler"]}],[1,"zonos-spinner",{size:[2],spinnerColor:[1,"spinner-color"]}],[1,"zonos-icon",{autoHeight:[4,"auto-height"],iconColor:[1,"icon-color"],content:[1],size:[2]}]]],["p-d775bd42",[[1,"zonos-address-update-dialog",{continueLoading:[4,"continue-loading"],dialogLoading:[4,"dialog-loading"],dialogOpen:[4,"dialog-open"],submitBtnType:[1,"submit-btn-type"],submitBtnColor:[1,"submit-btn-color"],isMobile:[4,"is-mobile"],shippingAddress:[16],billingAddress:[16],translatedShippingAddress:[16],translatedBillingAddress:[16],showErrorBanner:[32],translatedShippingAddressState:[32],translatedBillingAddressState:[32]},null,{translatedShippingAddress:["watchTranslatedShippingAddress"],translatedBillingAddress:["watchTranslatedBillingAddress"]}],[2,"zonos-address",{type:[1],titleText:[1,"title-text"],defaultAddress:[16],stripe:[32],isDirtyAddress:[32]},null,{stripe:["watchInitStripe"]}],[1,"zonos-checkbox",{backgroundColor:[1,"background-color"],label:[1],isChecked:[4,"is-checked"],isDisabled:[4,"is-disabled"],size:[2],fontSize:[1,"font-size"],borderStyle:[1,"border-style"]},[[1,"click","onClick"]]],[2,"zonos-link-authentication",{titleText:[1,"title-text"],defaultEmail:[1,"default-email"],stripe:[32]},null,{stripe:["watchInitStripe"]}],[1,"zonos-dialog",{open:[4],headerText:[1,"header-text"],width:[1],height:[1],minHeight:[1,"min-height"],noHeader:[4,"no-header"],noBodyPadding:[4,"no-body-padding"],noBorder:[4,"no-border"],borderStyle:[1,"border-style"],noCloseButton:[4,"no-close-button"],noClickOutside:[4,"no-click-outside"],mobile:[4],isLoading:[4,"is-loading"],isMobile:[32]},[[9,"resize","handleWindowResize"],[4,"keydown","handleKeyDown"]]],[1,"zonos-address-display",{currentAddress:[16],addressType:[1,"address-type"]}],[1,"zonos-address-form",{currentAddress:[16],translatedAddress:[16],addressType:[1,"address-type"],localAddress:[32]},null,{translatedAddress:["watchCurrentAddress"]}],[1,"zonos-collapse",{collapsed:[4],collapseSize:[2,"collapse-size"],height:[32],iframe:[32]}]]],["p-6f821997",[[2,"zonos-customer-info",{continueLoading:[4,"continue-loading"],submitBtnType:[1,"submit-btn-type"],submitBtnColor:[1,"submit-btn-color"],isMobile:[4,"is-mobile"],defaultAddress:[16],showErrorBanner:[32],shippingCountry:[32],isCheckingForRestrictedItems:[32],isValidatingAddress:[32],invalidShippingCharacterList:[32],invalidBillingCharacterList:[32],openAddressValidationDialog:[32]}],[2,"zonos-checkout-payment",{submitBtnType:[1,"submit-btn-type"],continueLoading:[4,"continue-loading"],submitBtnColor:[1,"submit-btn-color"],showErrorBanner:[32]}],[1,"zonos-checkout-footer",{mobile:[4],dataTheme:[1,"data-theme"],showLanguageDialog:[32],isMobile:[32]},[[4,"click","handleGlobalClick"]],{mobile:["handleMobileChange"]}],[2,"zonos-shipping",{continueLoading:[4,"continue-loading"],submitBtnColor:[1,"submit-btn-color"],submitBtnType:[1,"submit-btn-type"],selectedShippingMethod:[32],isSelecting:[32],showErrorBanner:[32],serviceLevels:[32]}],[1,"zonos-cart-restricted-items",{hide:[4],errorImages:[32],internalCollapsed:[32],firstRender:[32]}],[1,"zonos-checkout-finish",{borderRadius:[1,"border-radius"],storybookForceStatus:[1,"storybook-force-status"],overrideNotification:[16],isLoading:[32],notificationType:[32],notificationTitle:[32],notificationMessages:[32],notificationActionText:[32],order:[32]}],[1,"zonos-confirm-dialog",{dialogTitle:[1,"dialog-title"],dialogIntent:[1,"dialog-intent"],dialogSubtitle:[1,"dialog-subtitle"],submitBtnColor:[1,"submit-btn-color"],dialogConfirmBtnText:[1,"dialog-confirm-btn-text"],dialogCancelBtnText:[1,"dialog-cancel-btn-text"],dialogType:[1,"dialog-type"],isMobile:[4,"is-mobile"],dialogOpen:[4,"dialog-open"],noClickOutside:[4,"no-click-outside"]},[[4,"keydown","handleKeyDown"]]],[1,"zonos-checkout-progress-tabs",{tabColor:[1,"tab-color"],backgroundColor:[1,"background-color"],setTabItems:[64],setTabSelected:[64]}],[1,"zonos-review",{mobile:[4],collapsed:[4],isMobile:[32]},[[9,"resize","handleWindowResize"]]],[1,"zonos-badge",{bold:[4],badgeColor:[1,"badge-color"],icon:[16],iconRight:[4,"icon-right"],size:[1],rounded:[4]}],[1,"zonos-cart-items",{errorImages:[32]}],[1,"zonos-cart-subtotal"],[1,"zonos-rest-state",{restStateSubtitle:[1,"rest-state-subtitle"],restStateTitle:[1,"rest-state-title"],restStateType:[1,"rest-state-type"],isErrorImageLoad:[32]}]]]],e))));
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __awaiter=this&&this.__awaiter||function(e,r,n,o){function t(e){return e instanceof n?e:new n((function(r){r(e)}))}return new(n||(n=Promise))((function(n,a){function i(e){try{u(o.next(e))}catch(e){a(e)}}function s(e){try{u(o["throw"](e))}catch(e){a(e)}}function u(e){e.done?n(e.value):t(e.value).then(i,s)}u((o=o.apply(e,r||[])).next())}))};var __generator=this&&this.__generator||function(e,r){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,t,a,i;return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(e){return function(r){return u([e,r])}}function u(s){if(o)throw new TypeError("Generator is already executing.");while(i&&(i=0,s[0]&&(n=0)),n)try{if(o=1,t&&(a=s[0]&2?t["return"]:s[0]?t["throw"]||((a=t["return"])&&a.call(t),0):t.next)&&!(a=a.call(t,s[1])).done)return a;if(t=0,a)s=[s[0]&2,a.value];switch(s[0]){case 0:case 1:a=s;break;case 4:n.label++;return{value:s[1],done:false};case 5:n.label++;t=s[1];s=[0];continue;case 7:s=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1];a=s;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(s);break}if(a[2])n.ops.pop();n.trys.pop();continue}s=r.call(e,n)}catch(e){s=[6,e];t=0}finally{o=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,r,n){if(n||arguments.length===2)for(var o=0,t=r.length,a;o<t;o++){if(a||!(o in r)){if(!a)a=Array.prototype.slice.call(r,0,o);a[o]=r[o]}}return e.concat(a||Array.prototype.slice.call(r))};var log=function(e,r){var n=[];for(var o=2;o<arguments.length;o++){n[o-2]=arguments[o]}var t,a;var i=!!((t=window.Zonos)===null||t===void 0?void 0:t.debug)||!!window.location.search.match(/\?.*(&*)zonosDebug=1/);if(!i){if(r==="error"){console.error.apply(console,__spreadArray([e],n,false))}return}var s=document.querySelector("iframe#zonos---debug-logging-iframe");if(!s){s=document.createElement("iframe");s.id="zonos---debug-logging-iframe";s.style.display="none";s.style.opacity="0";s.style.position="absolute";s.style.top="-9999px";s.style.left="-9999px";s.style.width="1px";s.style.height="1px";s.style.border="none";s.style.overflow="hidden";s.style.visibility="hidden";document.body.appendChild(s)}var u=((a=s.contentWindow)===null||a===void 0?void 0:a.window.console)||window.console;switch(r){case"warn":u.warn.apply(u,__spreadArray([e],n,false));break;case"info":u.info.apply(u,__spreadArray([e],n,false));break;case"error":u.error.apply(u,__spreadArray([e],n,false));break;default:u.groupCollapsed.apply(u,__spreadArray([e],n,false));u.trace();u.groupEnd();break}};var logError=function(e){var r=[];for(var n=1;n<arguments.length;n++){r[n-1]=arguments[n]}log.apply(void 0,__spreadArray([e,"error"],r,false))};var fallbackApiType=["cloudflare","vercel"];var MAIN_BASE_API_TYPE=fallbackApiType[0];var fallbackApiList={cloudflare:"https://route.elements.zonos.com",vercel:"https://v1.route.js.zonos.com"};var MAIN_BASE_API=fallbackApiList[MAIN_BASE_API_TYPE];var getNextFallbackApiType=function(e){if(e===void 0){e=MAIN_BASE_API_TYPE}var r=fallbackApiType.indexOf(e);var n=fallbackApiType[r+1];if(!n){return null}return n};var jsonParse=function(e){if(typeof e==="string"){try{var r=JSON.parse(e);return r}catch(e){return null}}return null};var postReleaseReportingDuration=1*3600*1e3;var sendErrorLog=function(e){return __awaiter(void 0,[e],void 0,(function(e){var r,n,o,t,a;var i=e.endpoint,s=e.errors,u=e.metadata,l=e.shouldPostReleaseErrorReporting;return __generator(this,(function(e){if(l){r=Number(window.Zonos.releaseDate);n=(new Date).getTime();if(n-r>postReleaseReportingDuration){return[2]}}o="userAgentData"in window.navigator?window.navigator.userAgentData:null;t={endpoint:i,errors:s,metadata:Object.assign({href:window.location.href,userAgent:o&&o.brands.length>0?o:window.navigator.userAgent},u)};try{void fetch("".concat(MAIN_BASE_API,"/api/zonos-elements/log-error"),{body:JSON.stringify(t),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){a=getNextFallbackApiType();if(!a){return[2]}void fetch("".concat(fallbackApiList[a],"/api/zonos-elements/log-error"),{body:JSON.stringify(t),method:"POST"})}return[2]}))}))};var __rest=undefined&&undefined.__rest||function(e,r){var n={};for(var o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&r.indexOf(o)<0)n[o]=e[o];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var t=0,o=Object.getOwnPropertySymbols(e);t<o.length;t++){if(r.indexOf(o[t])<0&&Object.prototype.propertyIsEnumerable.call(e,o[t]))n[o[t]]=e[o[t]]}return n};var getResponseBody=function(e){return __awaiter(void 0,[e],void 0,(function(e){var r,n;var o=e.response,t=e.shouldLog,a=t===void 0?true:t,i=e.shouldThrow,s=i===void 0?false:i;return __generator(this,(function(e){switch(e.label){case 0:e.trys.push([0,2,,3]);return[4,o.json()];case 1:r=e.sent();return[2,r];case 2:n=e.sent();if(s){throw n}if(a){console.error(n)}return[2,null];case 3:return[2]}}))}))};var encodeString=function(e){try{var r=btoa(e).replace(/=/g,"");return r}catch(r){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}};var handleRequest=function(e){return __awaiter(void 0,[e],void 0,(function(e){var r,n,o,t,a,i,s,u,l,c,l,i,d,i;var f=e.basePathType,v=e.options,p=e.path;return __generator(this,(function(e){switch(e.label){case 0:n=window.Zonos.zonosQaUrlApi||fallbackApiList[f]||MAIN_BASE_API_TYPE;o=n+p;t=new URL(o);t.searchParams.set("zToken",encodeString(window.location.hostname));e.label=1;case 1:e.trys.push([1,3,,4]);return[4,fetch(t.toString(),v)];case 2:r=e.sent();return[3,4];case 3:a=e.sent();if(a instanceof Error){return[2,{baseUrl:n,errors:[{message:a.message,type:"unknown"}],json:null,response:null,zonosMode:null}]}i="Failed to fetch";return[2,{baseUrl:n,errors:[{message:i,type:"unknown"}],json:null,response:null,zonosMode:null}];case 4:s=r.headers.get("Zonos-Mode");u=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&s&&u){window.Zonos.modeAlerted=true}if(!r.ok)return[3,6];return[4,getResponseBody({response:r})];case 5:l=e.sent();return[2,{baseUrl:n,errors:[],json:l,response:r,zonosMode:s}];case 6:c=r.status.toString();e.label=7;case 7:e.trys.push([7,9,,10]);return[4,getResponseBody({response:r,shouldThrow:true})];case 8:l=e.sent();i=JSON.stringify(l);return[2,{baseUrl:n,errors:[{message:i,type:c}],json:null,response:r,zonosMode:s}];case 9:d=e.sent();i="Unknown error";return[2,{baseUrl:n,errors:[{message:"".concat(c,": ").concat(i),type:c}],json:null,response:null,zonosMode:s}];case 10:return[2]}}))}))};var handleRequestWithFallback=function(e){return __awaiter(void 0,[e],void 0,(function(e){var r,n,o,t,a,i,s,u,l,c,d,f;var v=e.basePathType,p=e.options,h=e.path;return __generator(this,(function(e){switch(e.label){case 0:o=h.startsWith("/api/bigcommerce");t=o?"vercel":v;return[4,handleRequest({basePathType:t,options:p,path:h})];case 1:a=e.sent(),i=a.errors,s=a.response,u=__rest(a,["errors","response"]);l=getNextFallbackApiType(t);c=i.find((function(e){var r=e.type;return r==="unknown"}));d=!!c||(s===null||s===void 0?void 0:s.status)===404;f=l&&d;if(d){void sendErrorLog({endpoint:fallbackApiList[t]+h,errors:i.map((function(e){var r=e.message;return"API: ".concat(r)})),metadata:{currentBasePath:t,nextFallbackApiType:l,requestHeaders:p===null||p===void 0?void 0:p.headers,requestPayload:jsonParse((r=p===null||p===void 0?void 0:p.body)===null||r===void 0?void 0:r.toString())||((n=p===null||p===void 0?void 0:p.body)===null||n===void 0?void 0:n.toString()),status:s===null||s===void 0?void 0:s.status,statusText:s===null||s===void 0?void 0:s.statusText},shouldPostReleaseErrorReporting:true})}if(f){log('=== "'.concat(h,'" failed to fetch, trying next fallback ').concat(l));return[2,handleRequestWithFallback({basePathType:l,options:p,path:h})]}return[2,Object.assign({errors:i,response:s},u)]}}))}))};var handleFetch=function(e,r){return __awaiter(void 0,void 0,void 0,(function(){var n,o,t,a,i,s;return __generator(this,(function(u){n=__rest(r||{},[]);o=n.body?JSON.stringify(n.body):undefined;t=n.method||"GET";a=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers);i=Object.assign(Object.assign({},n),{body:t==="GET"?undefined:o,headers:a,method:t});s=new URLSearchParams(window.location.search).get("useFallbackApi");return[2,handleRequestWithFallback({basePathType:s||MAIN_BASE_API_TYPE,options:i,path:e})]}))}))};export{logError as a,fallbackApiList as f,handleFetch as h,jsonParse as j,log as l,sendErrorLog as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=(e,o,...n)=>{var r,t;if(!(null===(r=window.Zonos)||void 0===r?void 0:r.debug)&&!window.location.search.match(/\?.*(&*)zonosDebug=1/))return void("error"===o&&console.error(e,...n));let s=document.querySelector("iframe#zonos---debug-logging-iframe");s||(s=document.createElement("iframe"),s.id="zonos---debug-logging-iframe",s.style.display="none",s.style.opacity="0",s.style.position="absolute",s.style.top="-9999px",s.style.left="-9999px",s.style.width="1px",s.style.height="1px",s.style.border="none",s.style.overflow="hidden",s.style.visibility="hidden",document.body.appendChild(s));const a=(null===(t=s.contentWindow)||void 0===t?void 0:t.window.console)||window.console;switch(o){case"warn":a.warn(e,...n);break;case"info":a.info(e,...n);break;case"error":a.error(e,...n);break;default:a.groupCollapsed(e,...n),a.trace(),a.groupEnd()}},o=(o,...n)=>{e(o,"error",...n)},n=["cloudflare","vercel"],r=n[0],t={cloudflare:"https://route.elements.zonos.com",vercel:"https://v1.route.js.zonos.com"},s=t[r],a=(e=r)=>{const o=n.indexOf(e);return n[o+1]||null},l=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){return null}return null},i=async({endpoint:e,errors:o,metadata:n,shouldPostReleaseErrorReporting:r})=>{if(r){const e=Number(window.Zonos.releaseDate);if((new Date).getTime()-e>36e5)return}const l="userAgentData"in window.navigator?window.navigator.userAgentData:null,i={endpoint:e,errors:o,metadata:Object.assign({href:window.location.href,userAgent:l&&l.brands.length>0?l:window.navigator.userAgent},n)};try{fetch(`${s}/api/zonos-elements/log-error`,{body:JSON.stringify(i),headers:{"Zonos-Referer":window.location.hostname},method:"POST"})}catch(e){const o=a();if(!o)return;fetch(`${t[o]}/api/zonos-elements/log-error`,{body:JSON.stringify(i),method:"POST"})}};var d=function(e,o){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&o.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var t=0;for(r=Object.getOwnPropertySymbols(e);t<r.length;t++)o.indexOf(r[t])<0&&Object.prototype.propertyIsEnumerable.call(e,r[t])&&(n[r[t]]=e[r[t]])}return n};const c=async({response:e,shouldLog:o=!0,shouldThrow:n=!1})=>{try{return await e.json()}catch(e){if(n)throw e;return o&&console.error(e),null}},u=async({basePathType:o,options:n,path:s})=>{var p,w;const h=s.startsWith("/api/bigcommerce")?"vercel":o,b=await(async({basePathType:e,options:o,path:n})=>{let s;const a=window.Zonos.zonosQaUrlApi||t[e]||r,l=new URL(a+n);l.searchParams.set("zToken",(e=>{try{return btoa(e).replace(/=/g,"")}catch(o){return e.replace(/[^A-Za-z0-9]/g,"").split("").reverse().join("")}})(window.location.hostname));try{s=await fetch(l.toString(),o)}catch(e){return e instanceof Error?{baseUrl:a,errors:[{message:e.message,type:"unknown"}],json:null,response:null,zonosMode:null}:{baseUrl:a,errors:[{message:"Failed to fetch",type:"unknown"}],json:null,response:null,zonosMode:null}}const i=s.headers.get("Zonos-Mode"),d=window.Zonos.zonosQaUrl;if(!window.Zonos.modeAlerted&&i&&d&&(window.Zonos.modeAlerted=!0),s.ok)return{baseUrl:a,errors:[],json:await c({response:s}),response:s,zonosMode:i};const u=s.status.toString();try{const e=await c({response:s,shouldThrow:!0});return{baseUrl:a,errors:[{message:JSON.stringify(e),type:u}],json:null,response:s,zonosMode:i}}catch(e){return{baseUrl:a,errors:[{message:`${u}: Unknown error`,type:u}],json:null,response:null,zonosMode:i}}})({basePathType:h,options:n,path:s}),{errors:f,response:m}=b,y=d(b,["errors","response"]),g=a(h),v=!!f.find((({type:e})=>"unknown"===e))||404===(null==m?void 0:m.status),j=g&&v;return v&&i({endpoint:t[h]+s,errors:f.map((({message:e})=>`API: ${e}`)),metadata:{currentBasePath:h,nextFallbackApiType:g,requestHeaders:null==n?void 0:n.headers,requestPayload:l(null===(p=null==n?void 0:n.body)||void 0===p?void 0:p.toString())||(null===(w=null==n?void 0:n.body)||void 0===w?void 0:w.toString()),status:null==m?void 0:m.status,statusText:null==m?void 0:m.statusText},shouldPostReleaseErrorReporting:!0}),j?(e(`=== "${s}" failed to fetch, trying next fallback ${g}`),u({basePathType:g,options:n,path:s})):Object.assign({errors:f,response:m},y)},p=async(e,o)=>{const n=d(o||{},[]),t=n.body?JSON.stringify(n.body):void 0,s=n.method||"GET",a=Object.assign({"Content-Type":"application/json","Zonos-Is-BigCommerce":window.Zonos.isBigCommerce.toString(),"Zonos-Referer":window.location.hostname,"Zonos-Version":window.Zonos.version,credentialtoken:window.Zonos.zonosApiKey||"Empty credential token from zonos-elements"},n.headers),l=Object.assign(Object.assign({},n),{body:"GET"===s?void 0:t,headers:a,method:s}),i=new URLSearchParams(window.location.search).get("useFallbackApi");return u({basePathType:i||r,options:l,path:e})};export{o as a,t as f,p as h,l as j,e as l,i as s}
|