1"use strict";(self.webpackChunksanvt=self.webpackChunksanvt||[]).push([[138],{6138:function(I,h,i){i.r(h),i.d(h,{default:function(){return M}});var o=i(69);const f={class:"relative language hidden"},y={class:"relative flex items-center justify-between"},w={class:"m-0 p-0 text-[16px] leading-[20.26px] tracking-[0.16px] text-black"},k=["placeholder"],b={class:"m-0 p-0 text-black text-base font-medium leading-[20.26px] tracking-[0.16px] mt-10"},v={role:"list",class:"hide-scrollbar absolute z-[1] mt-1 max-h-80 w-full min-w-[10rem] select-none overflow-y-scroll bg-white text-xs leading-6 text-black-100 !flex flex-wrap flex-col gap-3 mt-8"},L=["id","onClick","disabled"],x=["for"];function P(t,e,r,a,s,l){return(0,o.openBlock)(),(0,o.createElementBlock)("div",f,[(0,o.createElementVNode)("div",y,[(0,o.createElementVNode)("button",{type:"button",class:"btn-back-choose-language",onClick:e[0]||(e[0]=n=>l.handleBackMenu())},e[3]||(e[3]=[(0,o.createElementVNode)("svg",{width:"21",height:"12",viewBox:"0 0 21 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[(0,o.createElementVNode)("path",{d:"M20.333 6H1.99967M1.99967 6L8.47026 11M1.99967 6L8.47026 1",stroke:"#151414","stroke-width":"1.4375"})],-1)])),(0,o.createElementVNode)("h4",w,(0,o.toDisplayString)(s.locales.change_language_label),1),(0,o.createElementVNode)("input",{type:"search",readonly:"",class:"flex w-full max-w-[8rem] cursor-pointer rounded-full border border-lightgrey bg-white px-4 py-2 shadow-sm placeholder:text-black-300 hidden",placeholder:s.currentLanguage.name,onClick:e[1]||(e[1]=n=>l.togglePicker("language"))},null,8,k),(0,o.createElementVNode)("button",{type:"button",class:"",onClick:e[2]||(e[2]=n=>l.handleCloseChooseLanguage())},e[4]||(e[4]=[(0,o.createStaticVNode)('<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" class="localization-picker-icon"><g clip-path="url(#clip0_311_24053)"><path d="M11.9996 23.4C18.2957 23.4 23.3996 18.296 23.3996 12C23.3996 5.70395 18.2957 0.599998 11.9996 0.599998C5.70356 0.599998 0.599609 5.70395 0.599609 12C0.599609 18.296 5.70356 23.4 11.9996 23.4Z" stroke="#151414" stroke-width="1.2"></path><path d="M16 8L8 16" stroke="#151414" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"></path><path d="M8 8L16 16" stroke="#151414" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"></path></g><defs><clipPath id="clip0_311_24053"><rect width="24" height="24" fill="white"></rect></clipPath></defs></svg>',1)]))]),(0,o.createElementVNode)("h4",b,(0,o.toDisplayString)(s.locales.change_language_desc),1),(0,o.withDirectives)((0,o.createElementVNode)("ul",v,[((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(s.languages,n=>((0,o.openBlock)(),(0,o.createElementBlock)("li",{key:n.iso_code,tabindex:"-1",class:"flex items-center justify-start gap-4"},[(0,o.createElementVNode)("input",{type:"radio",name:"pickerLanguage",id:`mobile-picker-language--${n.iso_code}`,onClick:u=>l.handleLanguageRedirect(n),disabled:s.currentLanguage.iso_code===n.iso_code,class:"relative w-[18px] h-0 border-0 before:content-[''] before:block before:w-[18px] before:h-[18px] before:border before:border-[#CCCCCC] before:rounded-full before:absolute before:top-1/2 before:left-1/2 before:-translate-x-1/2 before:-translate-y-1/2 after:content-[''] after:w-[13px] after:h-[13px] after:block after:rounded-full after:absolute after:top-1/2 after:left-1/2 after:-translate-x-1/2 after:-translate-y-1/2"},null,8,L),(0,o.createElementVNode)("label",{for:`mobile-picker-language--${n.iso_code}`,class:"text-[#B2B2B2] uppercase"},(0,o.toDisplayString)(n.name.includes("English")?"English":n.name.split(" ").shift()),9,x)]))),128))],512),[[o.vShow,s.showLanguagePicker]])])}var C=Object.defineProperty,S=Object.defineProperties,E=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,p=(t,e,r)=>e in t?C(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,m=(t,e)=>{for(var r in e||(e={}))V.call(e,r)&&p(t,r,e[r]);if(g)for(var r of g(e))N.call(e,r)&&p(t,r,e[r]);return t},_=(t,e)=>S(t,E(e)),O=(t,e,r)=>new Promise((a,s)=>{var l=c=>{try{u(r.next(c))}catch(d){s(d)}},n=c=>{try{u(r.throw(c))}catch(d){s(d)}},u=c=>c.done?a(c.value):Promise.resolve(c.value).then(l,n);u((r=r.apply(t,e)).next())}),B={name:"LocalizationPickerLanguage",props:{languageOnly:{type:Boolean,required:!1,default:!1}},data(){return{markets:[],languages:[],countryList:[],searchTerm:"",path:theme.routes.current_path,showPopup:!1,showLanguagePicker:!1,showCountryPicker:!1,currentLanguage:{name:theme.settings.current_language_name.includes("English")?"English":theme.settings.current_language_name,iso_code:theme.settings.current_language_iso_code,root_url:theme.settings.current_language_root_url},currentCountry:{name:theme.settings.current_country_name,iso_code:theme.settings.current_country_iso_code},locales:{change_language_or_country:theme.translations.change_language_or_country,change_country_desc:theme.translations.change_country_desc,change_language_desc:theme.translations.change_language_desc,change_language_label:theme.translations.change_language_label,change_country_label:theme.translations.change_country_label}}},computed:{allCountries(){return this.markets.length<1?this.countryList:this.countryList.map(t=>{var e;return _(m({},t),{url:(e=this.markets.find(r=>{var a;return(a=r.countries.split(","))==null?void 0:a.includes(t.iso_code)}))==null?void 0:e.url})})}},mounted(){this.getGeoInfo(),this.hasUrlParams()},created(){this.debouncedSearch=theme.utils.debounce((...t)=>{this.search(...t)},300)},beforeUnmount(){this.debouncedSearch=null,this.getGeoInfo()},methods:{getGeoInfo(){return O(this,null,function*(){const e=yield(yield fetch(`${window.Shopify.routes.root}?view=geo`)).json();this.markets=e.markets,this.countryList=e.countries.map(r=>_(m({},r),{name:this.decodeHtml(r.name)})),this.languages=e.languages})},hasUrlParams(){const e=new URL(document.location).searchParams;if(!e||!e.get("country")){this.hasStoredCountry();return}const r=e.get("country"),a=this.allCountries.find(l=>l.iso_code===r);if(!a)return;
1this.updateValues(a);const s={name:a.name,iso_code:a.iso_code};localStorage.setItem("country",JSON.stringify(s))},hasStoredCountry(){const t=localStorage.getItem("country");if(!t)return;const e=JSON.parse(t);this.updateValues(e)},updateValues(t){this.currentCountry.name=t.name,this.currentCountry.iso_code=t.iso_code},togglePopup(){const t=document.querySelector('aside[data-modal-id="drawer-menu"] .modal-popup__content');return this.showPopup=!this.showPopup,t.classList.contains("!overflow-hidden")?t.classList.remove("!overflow-hidden"):t.classList.add("!overflow-hidden")},togglePicker(t){return t==="country"?(this.showCountryPicker=!this.showCountryPicker,this.showLanguagePicker=!1,this.showCountryPicker):(this.showLanguagePicker=!this.showLanguagePicker,this.showCountryPicker=!1,document.querySelector(".modal-popup__content").classList.toggle("open-modal"),this.showLanguagePicker)},handleLanguageRedirect(t){this.currentLanguage.name=t.name,this.currentLanguage.iso_code=t.iso_code;const e=new URL(document.location),{origin:r,search:a}=e,s=this.currentLanguage.root_url==="/"?"":this.currentLanguage.root_url,l=t.root_url==="/"?"":t.root_url,n=new URL(`${r}${this.path.replace(s,l)}${a}`);localStorage.setItem("language_root_url",JSON.stringify(t)),e.href!==n.href&&window.location.replace(n)},handleCountryRedirect(t){if(!t.url)return;const e=new URL(`https://${t.url}${this.path}?currency=${t.currency}&country=${t.iso_code}`);window.location.replace(e)},search(t){const e=t.toLowerCase();return this.countryList=this.countryList.filter(r=>r.name.toLowerCase().includes(e)),this.countryList},handleBackMenu(){document.querySelector(".demo-test").classList.add("hidden"),document.querySelector(".demo-test .language").classList.add("hidden"),document.querySelector(".demo-test .country").classList.add("hidden")},handleCloseChooseLanguage(){document.querySelector(".demo-test").classList.add("hidden"),document.querySelector(".modal-popup").classList.remove("open")},decodeHtml(t){const e=document.createElement("textarea");return e.innerHTML=t,e.value}}},j=i(9014),M=(0,j.A)(B,[["render",P]])}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.