PageSourceSearch

https://4u.ge/assets/city_controller-xm7qj05d.digested.js

js 4u.ge collected 2026-10-03 01:51:15 UTC 2,559 bytes, 3 lines download raw bytes

1import{e}from"/assets/application-pevgkcf3.digested.js";class u extends e{static targets=["logo"];static values={cityScoped:Boolean,currentCitySlug:String,basePathWithoutCity:String,entityPage:Boolean};connect(){try{this.updateLogoLink()}catch(o){console.error("CityController: Failed to initialize",o)}this.onLocaleNegotiationReady=this.queueRedirectCheck.bind(this);let t=document.body;if(t?.matches?.('[data-controller~="locale-suggestion"]')&&t.dataset.localeNegotiationReady!=="true"){document.addEventListener("locale-suggestion:ready",this.onLocaleNegotiationReady,{once:!0});return}this.queueRedirectCheck()}disconnect(){if(this.onLocaleNegotiationReady)document.removeEventListener("locale-suggestion:ready",this.onLocaleNegotiationReady)}queueRedirectCheck(){queueMicrotask(()=>{try{this.checkAndRedirectIfNecessary()}catch(t){console.error("CityController: Failed to initialize",t)}})}setCity(t){let o=t.currentTarget.dataset.citySlug||"batumi";try{localStorage.setItem("4u_city",o)}catch(n){console.warn("CityController: localStorage not available",n)}let i=t.currentTarget.href;if(i)if(t.preventDefault(),window.Turbo?.visit)window.Turbo.visit(i);else window.location.href=i}checkAndRedirectIfNecessary(){if(!this.cityScopedValue)return;if(document.body?.dataset?.localeNavigationPending==="true"||document.body?.dataset?.cityNavigationPending==="true")return;let t=null;try{t=localStorage.getItem("4u_city")}catch{}if(!t)return;let o=this.currentCitySlugValue||"batumi";if(this.entityPageValue){if(t!==o)try{localStorage.setItem("4u_city",o)}catch{}return}if(t===o)return;let i=this.getCityifiedUrl(t),n=window.location.pathname+window.location.search+(window.location.hash||"");if(i!==n){if(document.body?.dataset)document.body.dataset.cityNavigationPending="true";if(window.Turbo?.visit)window.Turbo.visit(i,{action:"replace"});else window.location.replace(i)}}updateLogoLink(){if(!this.hasLogoTarget)return;let t=null;try{t=localStorage.getItem("4u_city")}catch{}if(t){let o=(window.location.pathname.match(/^\/(en|ru|be|uk)/)||[])[1],i=o?`/${o}`:"/";this.logoTarget.href=this.getCityifiedUrl(t,i)}}getCityifiedUrl(t,o=null){let i=o||this.basePathWithoutCityValue||"/",n=o?"":(window.location.search||"")+(window.location.hash||"");if(!t)return i+n;let a=["en","ru","be","uk"],r=i.replace(/^\//,"").split("/").filter(Boolean);if(r[0]&&a.includes(r[0])){let l=r.length>1?"/"+r.slice(1).join("/"):"";return"/"+r[0]+"/"+t+l+n}let c=r.length?"/"+r.join("/"):"";return"/"+t+c+n}}export{u as default};
2
3//# debugId=2A7773D818413CB464756E2164756E21

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.