PageSourceSearch

https://www.nobodyschild.com/cdn/shop/t/9/assets/country-switcher-global-DxNl5HOr.js

js nobodyschild.com collected 2026-10-03 20:12:20 UTC 2,952 bytes, 1 lines download raw bytes

1class l extends HTMLElement{constructor(){super()}connectedCallback(){this.cacheSelectors(),this.setEventListeners(),this.detectUserCountry()}cacheSelectors(){this.select=this.querySelector("[data-localization-select]"),this.hiddenInput=this.querySelector("[data-country-switcher-input]"),this.form=this.querySelector("form"),this.popup=this.querySelector(".country-switcher-global__popup"),this.popupClose=this.querySelector(".country-switcher-global__close-button"),this.overlay=this.querySelector(".country-switcher-global__overlay")}setEventListeners(){var t,s,o,n;document.addEventListener("openCountrySwitcher",()=>{this.openPopup()}),(t=this.popupClose)==null||t.addEventListener("click",()=>{this.closePopup()}),(s=this.overlay)==null||s.addEventListener("click",()=>{this.closePopup()}),(o=this.select)==null||o.addEventListener("change",e=>{this.hiddenInput.value=e.target.value}),(n=this.form)==null||n.addEventListener("submit",e=>{e.preventDefault(),sessionStorage.setItem("countrySwitched","true"),this.form.submit(),this.closePopup()}),this.handleKeyDown=e=>{if(e.key==="Escape"){this.closePopup();return}if(e.key!=="Tab")return;const i=[...this.popup.querySelectorAll('button:not([disabled]), select, input:not([type="hidden"]), a[href], [tabindex]:not([tabindex="-1"])')];if(!i.length)return;const r=i[0],c=i[i.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),c.focus()):!e.shiftKey&&document.activeElement===c&&(e.preventDefault(),r.focus())}}openPopup(){var t,s;this.triggerElement=document.activeElement,this.removeAttribute("hidden"),(t=this.popup)==null||t.classList.add("country-switcher-global__popup--visible"),(s=this.overlay)==null||s.classList.add("country-switcher-global__overlay--visible"),document.body.style.overflow="hidden",document.addEventListener("keydown",this.handleKeyDown),requestAnimationFrame(()=>{var o;(o=this.popupClose)==null||o.focus()})}closePopup(){var t,s;sessionStorage.setItem("countrySwitched","true"),(t=this.popup)==null||t.classList.remove("country-switcher-global__popup--visible"),(s=this.overlay)==null||s.classList.remove("country-switcher-global__overlay--visible"),document.body.style.overflow="",document.removeEventListener("keydown",this.handleKeyDown),this.triggerElement&&(this.triggerElement.focus(),this.triggerElement=null),setTimeout(()=>{this.setAttribute("hidden","")},300)}isPopupOpen(){var t;return(t=this.popup)==null?void 0:t.classList.contains("country-switcher-global__popup--visible")}async detectUserCountry(){var t,s;try{const e=(await(await fetch("https://get.geojs.io/v1/ip/geo.json")).json()).country_code,i=(t=this.hiddenInput)==null?void 0:t.value;e&&e!==i&&!sessionStorage.getItem("countrySwitched")&&((s=this.select)!=null&&s.querySelector(`option[value="${e}"]`))&&(this.select.value=e,this.hiddenInput.value=e,this.openPopup())}catch(o){console.error("Country detection failed:",o)}}}customElements.define("ls-country-switcher-global",l);

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.