PageSourceSearch

https://sanvt.com/cdn/shop/t/573/assets/vue.510.757edca280d5d038a328.js

js sanvt.com collected 2026-09-24 22:37:37 UTC 11,933 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunksanvt=self.webpackChunksanvt||[]).push([[510],{1510:function(Y,m,u){u.r(m),u.d(m,{default:function(){return X}});var e=u(69);const b={key:0,class:"relative ml-6"},f={class:"relative"},w=["placeholder"],y={type:"button",class:"pointer-events-none absolute right-4 top-1/2 -translate-y-1/2"},k={role:"list",class:"hide-scrollbar absolute z-[1] mt-1 max-h-80 w-full min-w-[10rem] select-none overflow-y-scroll rounded-popup rounded-tl-none bg-white p-4 text-xs leading-6 text-black-100 shadow-[0_2px_10px_5px_rgba(0,0,0,0.1)]"},v=["disabled"],P=["hreflang","lang","data-value","onClick"],x={class:"tablet:localization-popup-margin absolute bottom-full right-0 w-full rounded-popup rounded-br-none bg-white px-4 py-10 text-xs text-black-100 shadow-[0_2px_10px_5px_rgba(0,0,0,0.1)] tablet:bottom-0 tablet:top-full tablet:h-fit tablet:w-auto tablet:max-w-[15rem] tablet:rounded-br-popup tablet:rounded-tr-none"},C={class:"mx-auto max-w-[20ch] pb-5 text-center font-bold uppercase"},L={class:"relative pb-3"},E={class:"relative"},V=["placeholder"],N={type:"button",class:"pointer-events-none absolute right-4 top-1/2 -translate-y-1/2"},S={role:"list",class:"hide-scrollbar mt-1 max-h-80 w-full select-none overflow-y-scroll rounded-light leading-6 text-black-100"},B=["disabled"],O=["hreflang","lang","data-value","onClick"],z={class:"relative"},U={class:"relative"},R=["placeholder"],T={type:"button",class:"pointer-events-none absolute right-4 top-1/2 -translate-y-1/2"},D={key:0,role:"list",class:"mt-1 max-h-80 w-full select-none overflow-y-scroll rounded-light leading-6 text-black-100"},F=["disabled"],I=["hreflang","lang","data-value","onClick","innerHTML"];function H(o,t,n,a,l,s){const c=(0,e.resolveComponent)("v-icon");return n.languageOnly?((0,e.openBlock)(),(0,e.createElementBlock)("div",b,[(0,e.createElementVNode)("div",f,[(0,e.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",placeholder:l.currentLanguage.name,onClick:t[0]||(t[0]=r=>s.togglePicker("language"))},null,8,w),(0,e.createElementVNode)("button",y,[(0,e.createVNode)(c,{icon:"arrow-down",height:18,width:11,color:"#383838",class:"localization-picker-icon",flipped:l.showLanguagePicker},null,8,["flipped"])])]),(0,e.withDirectives)((0,e.createElementVNode)("ul",k,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(l.languages,r=>((0,e.openBlock)(),(0,e.createElementBlock)("li",{key:r.iso_code,tabindex:"-1"},[(0,e.createElementVNode)("button",{type:"button",class:"my-0.5 w-full rounded-full text-left disabled:pointer-events-none disabled:bg-black-100 disabled:text-white",disabled:l.currentLanguage.iso_code===r.iso_code},[(0,e.createElementVNode)("a",{href:"#",hreflang:r.iso_code,lang:r.iso_code,"data-value":r.iso_code,class:"block truncate rounded-full px-4 py-2 hover:bg-black-800 focus:bg-black-100 focus:text-white",onClick:(0,e.withModifiers)(i=>s.handleLanguageRedirect(r),["prevent"])},(0,e.toDisplayString)(r.name.includes("English")?"English":r.name.charAt(0).toUpperCase()+r.name.slice(1)),9,P)],8,v)]))),128))],512),[[e.vShow,l.showLanguagePicker]])])):((0,e.openBlock)(),(0,e.createElementBlock)(e.Fragment,{key:1},[(0,e.createElementVNode)("button",{type:"button",class:"flex items-center uppercase",onClick:t[1]||(t[1]=(...r)=>s.togglePopup&&s.togglePopup(...r))},[(0,e.createVNode)(c,{icon:"language",height:20,width:20,color:"#FFFFFF","color-mobile":"#151414",flipped:l.showPopup},null,8,["flipped"])]),(0,e.withDirectives)((0,e.createElementVNode)("div",x,[(0,e.createElementVNode)("button",{type:"button",class:"absolute right-4 top-4 -m-2 p-2",onClick:t[2]||(t[2]=(...r)=>s.togglePopup&&s.togglePopup(...r))},[(0,e.createVNode)(c,{icon:"close-btn",height:12,width:12,class:"localization-picker-icon",color:"#B2B2B2"})]),(0,e.createElementVNode)("h3",C,(0,e.toDisplayString)(l.locales.change_language_or_country),1),(0,e.createElementVNode)("div",L,[(0,e.createElementVNode)("div",E,[(0,e.createElementVNode)("input",{type:"search",readonly:"",class:"asdsad flex w-full min-w-[10.5rem] cursor-pointer rounded-full border border-lightgrey bg-black-900 px-4 py-2 shadow-sm placeholder:text-black-300",placeholder:l.currentLanguage.name.charAt(0).toUpperCase()+l.currentLanguage.name.slice(1),onClick:t[3]||(t[3]=r=>s.togglePicker("language"))},null,8,V),(0,e.createElementVNode)("button",N,[(0,e.createVNode)(c,{icon:"arrow-down",height:18,width:11,color:"#383838",class:"localization-picker-icon",flipped:l.showLanguagePicker},null,8,["flipped"])])]),(0,e.withDirectives)((0,e.createElementVNode)("ul",S,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(l.languages,r=>((0,e.openBlock)(),(0,e.createElementBlock)("li",{key:r.iso_code,tabindex:"-1"},[(0,e.createElementVNode)("button",{type:"button",class:"my-0.5 w-full rounded-full text-left disabled:pointer-events-none disabled:bg-black-100 disabled:text-white",disabled:l.currentLanguage.iso_code===r.iso_code},[(0,e.createElementVNode)("a",{href:"#",hreflang:r.iso_code,lang:r.iso_code,"data-value":r.iso_code,class:"block truncate rounded-full px-4 py-2 hover:bg-black-800 focus:bg-black-100 focus:text-white",onClick:(0,e.withModifiers)(i=>s.handleLanguageRedirect(r),["prevent"])},(0,e.toDisplayString)(r.name.includes("English")?"English":r.name.charAt(0).toUpperCase()+r.name.slice(1)),9,O)],8,B)]))),128))],512),[[e.vShow,l.showLanguagePicker]])]),(0,e.createElementVNode)("div",z,[(0,e.createElementVNode)("div",U,[(0,e.createElementVNode)("button",{type:"button",class:(0,e.normalizeClass)(["absolute left-4 top-1/2 -translate-y-1/2",!l.showCountryPicker&&"hidden"])},[(0,e.createVNode)(c,{icon:"search",height:14,width:14,color:"#383838",class:"localization-picker-icon tablet:hidden"})],2),(0,e.withDirectives)((0,e.createElementVNode)("input",{"onUpdate:modelValue":t[4]||(t[4]=r=>l.searchTerm=r),type:"search",class:(0,e.normalizeClass)(["flex w-full min-w-[10.5rem] cursor-pointer rounded-full border border-lightgrey bg-black-900 px-4 py-2 shadow-sm placeholder:text-black-300",l.showCountryPicker&&"indent-5"]),placeholder:s.decodeHtml(l.currentCountry.name),onClick:t[5]||(t[5]=r=>s.togglePicker("country")),onInput:t[6]||(t[6]=r=>o.debouncedSearch(l.searchTerm))},null,42,R),[[e.vModelText,l.searchTerm]]),(0,e.createElementVNode)("button",T,[(0,e.createVNode)(c,{icon:"arrow-down",height:18,width:11,color:"#383838",class:(0,e.normalizeClass)(["localization-picker-icon",l.searchTerm.length>0&&"hidden"]),flipped:l.showCountryPicker},null,8,["class","flipped"])])]),l.showCountryPicker?((0,e.openBlock)(),(0,e.createElementBlock)("ul",D,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(s.allCountries,r=>((0,e.openBlock)(),(0,e.createElementBlock)("li",{key:r.iso_code,tabindex:"-1"},[(0,e.createElementVNode)("button",{type:"button",class:"my-0.5 w-full rounded-full text-left disabled:pointer-events-none disabled:bg-black-100 disabled:text-white",disabled:l.currentCountry.iso_code===r.iso_code},[(0,e.createElementVNode)("a",{href:"#",hreflang:r.iso_code,lang:r.iso_code,"data-value":r.iso_code,class:(0,e.normalizeClass)(["block truncate rounded-full px-4 py-2 hover:bg-black-800",[l.showCountryPicker&&"indent-5",!r.url&&"cursor-not-allowed text-black-500"]]),onClick:(0,e.withModifiers)(i=>s.handleCountryRedirect(r),["prevent"]),innerHTML:s.decodeHtml(r.name)}
1,null,10,I)],8,F)]))),128))])):(0,e.createCommentVNode)("",!0)])],512),[[e.vShow,l.showPopup]])],64))}var M=Object.defineProperty,j=Object.defineProperties,A=Object.getOwnPropertyDescriptors,g=Object.getOwnPropertySymbols,J=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,_=(o,t,n)=>t in o?M(o,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[t]=n,d=(o,t)=>{for(var n in t||(t={}))J.call(t,n)&&_(o,n,t[n]);if(g)for(var n of g(t))G.call(t,n)&&_(o,n,t[n]);return o},h=(o,t)=>j(o,A(t)),K=(o,t,n)=>new Promise((a,l)=>{var s=i=>{try{r(n.next(i))}catch(p){l(p)}},c=i=>{try{r(n.throw(i))}catch(p){l(p)}},r=i=>i.done?a(i.value):Promise.resolve(i.value).then(s,c);r((n=n.apply(o,t)).next())}),Q={name:"LocalizationPicker",props:{languageOnly:{type:Boolean,required:!1,default:!1}},data(){return{markets:[],languages:[],countryList:[],countrySearch:[],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.searchTerm===""?this.countryList.map(o=>{var t;return h(d({},o),{url:(t=this.markets.find(n=>{var a;return(a=n.countries.split(","))==null?void 0:a.includes(o.iso_code)}))==null?void 0:t.url})}):this.countrySearch.map(o=>{var t;return h(d({},o),{url:(t=this.markets.find(n=>{var a;return(a=n.countries.split(","))==null?void 0:a.includes(o.iso_code)}))==null?void 0:t.url})})}},mounted(){this.getGeoInfo(),this.hasUrlParams()},created(){this.debouncedSearch=theme.utils.debounce((...o)=>{this.search(...o)},300)},beforeUnmount(){this.debouncedSearch=null},methods:{getGeoInfo(){return K(this,null,function*(){const t=yield(yield fetch(`${window.Shopify.routes.root}?view=geo`)).json();this.markets=t.markets,this.countryList=t.countries.map(n=>h(d({},n),{name:this.decodeHtml(n.name)})),this.languages=t.languages})},hasUrlParams(){const t=new URL(document.location).searchParams;if(!t||!t.get("country")){this.hasStoredCountry();return}const n=t.get("country"),a=this.allCountries.find(s=>s.iso_code===n);if(!a)return;this.updateValues(a);const l={name:a.name,iso_code:a.iso_code};localStorage.setItem("country",JSON.stringify(l))},hasStoredCountry(){const o=localStorage.getItem("country");if(!o)return;const t=JSON.parse(o);this.updateValues(t)},updateValues(o){this.currentCountry.name=o.name,this.currentCountry.iso_code=o.iso_code},togglePopup(){const o=document.querySelector('aside[data-modal-id="drawer-menu"] .modal-popup__content');return this.showPopup=!this.showPopup,o.classList.contains("!overflow-hidden")?o.classList.remove("!overflow-hidden"):o.classList.add("!overflow-hidden")},togglePicker(o){return o==="country"?(this.showCountryPicker=!this.showCountryPicker,this.showLanguagePicker=!1,this.showCountryPicker):(this.showLanguagePicker=!this.showLanguagePicker,this.showCountryPicker=!1,this.showLanguagePicker)},handleLanguageRedirect(o){const t=new URL(document.location),{origin:n,search:a}=t,l=this.currentLanguage.root_url==="/"?"":this.currentLanguage.root_url,s=o.root_url==="/"?"":o.root_url,c=new URL(`${n}${this.path.replace(l,s)}${a}`);localStorage.setItem("language_root_url",JSON.stringify(o)),t.href!==c.href&&window.location.replace(c)},handleCountryRedirect(o){if(!o.url)return;const t=new URL(`https://${o.url}${this.path}?currency=${o.currency}&country=${o.iso_code}`),n=new URL(document.location);localStorage.setItem("country_root_url",JSON.stringify(o)),n.href!==t.href&&window.location.replace(t)},search(o){const t=o.toLowerCase();return this.countrySearch=this.countryList.filter(n=>n.name.toLowerCase().includes(t)),this.countrySearch},decodeHtml(o){const t=document.createElement("textarea");return t.innerHTML=o,t.value}}},W=u(9014),X=(0,W.A)(Q,[["render",H]])}}]);

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.