PageSourceSearch

https://www.kozarovce.sk/build/assets/motion-create-CGqtnWuf.js

js kozarovce.sk collected 2026-09-25 07:43:58 UTC 5,579 bytes, 2 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/app-DwAHMZ1w.js","assets/app-CG6DamIu.css"])))=>i.map(i=>d[i]);
2import{L as g,b as m,f as v,p as y,_ as S,c as L}from"./app-DwAHMZ1w.js";const _=17,h=document.getElementById("osm-container"),q=h.dataset.lat?parseFloat(h.dataset.lat):48.14859353838798,E=h.dataset.lng?parseFloat(h.dataset.lng):17.107649445533756,p=g.map("osm-container",{inertia:!1,zoomControl:!1}).setView([q,E],_);g.control.zoom({position:"topright"}).addTo(p);g.tileLayer("https://tile.openstreetmap.org/{z}/{x}/{y}.png",{maxZoom:19,attribution:'&copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',zIndex:49}).addTo(p);let x=35;for(const e of Object.values(p.getPanes()))e.style.zIndex=(x++).toString();for(const e of Array.from(document.querySelectorAll(":has(> .leaflet-control-zoom), :has(> .leaflet-control-attribution")))e.style.zIndex="49";let c;async function b(e,o){c&&c.remove(),c=g.circle([e,o],{color:"blue",fillColor:"red",fillOpacity:.5,radius:2}).addTo(p);const t=new FormData;t.append("lat",e.toString()),t.append("lon",o.toString());const s=await(await fetch("/geocoding/reverse",{method:"POST",headers:y(),body:v(t)})).json();if(!s.length)return;const n=s[0].address,i=n.road,d=n.house_number&&i?` ${n.house_number}`:"",l=n.postcode&&i?`, ${n.postcode}`:"",r=n.city?` ${n.city}`:"";p.setView([e,o]),c.bindPopup(`${i}${d}${l}${r}<br><span class="text-gray-400">${e.toString()}, ${o.toString()}</span>`),c.on("mouseover",function(){this.openPopup()}),c.on("click",function(){c.remove()}),c.openPopup();const f=document.querySelector('form input[name="motion_latitude"]'),u=document.querySelector('form input[name="motion_longitude"]');f&&u&&(f.value=e.toString(),u.value=o.toString(),f.dispatchEvent(new Event("input")),u.dispatchEvent(new Event("input"))),window.dispatchEvent(new CustomEvent("map-clicked",{detail:{lat:e.toString(),lng:o.toString()}}))}p.on("click",async e=>{b(e.latlng.lat,e.latlng.lng)});function k(e){b(e.coords.latitude,e.coords.longitude)}document.querySelector("[data-current-position]").addEventListener("click",()=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(k):m("geolocation-not-available")});let w=0;for(const e of["input","focus"])document.querySelector("input#searchPlace")?.addEventListener(e,o=>{const t=document.querySelector("[data-address-options");if(t.classList.remove("flex"),t.classList.add("hidden"),!t||(t.innerHTML="",o.target.value.length<3))return;const n=w=new Date().getTime();setTimeout(async()=>{if(n!==w)return;const i=new FormData;i.append("search",o.target.value);const d=await(await fetch("/geocoding/index",{method:"POST",headers:y(),body:v(i)})).json();(!d.length||!d[0].length)&&(t.classList.remove("flex"),t.classList.add("hidden"),o.target.autocomplete="off");for(const l of d[0]){const r=document.createElement("div");r.classList.add("truncate","border","border-black","cursor-pointer","p-1","bg-white","rounded-md"),r.innerHTML=l.display_name,r.title=l.display_name,t.appendChild(r),r.dataset.lat=l.lat,r.dataset.lon=l.lon,r.addEventListener("click",f=>{const u=f.target;b(Number(u.dataset.lat),Number(u.dataset.lon)),t.classList.add("hidden"),t.classList.remove("flex")})}t.classList.remove("hidden"),t.classList.add("flex"),o.target.autocomplete="off"},1e3)});document.querySelector("input#searchPlace")?.addEventListener("click",e=>{e.stopPropagation()});window.addEventListener("click",e=>{const o=e.target;if(!o.closest("[data-address-options")&&!o.closest("[data-map-search")){const t=document.querySelector("[data-address-options");t.classList.remove("flex"),t.classList.add("hidden");const s=document.querySelector("#searchPlace");s&&(s.autocomplete=""),s.value||(s.classList.add("w-8"),s.classList.remove("w-60"))}});document.querySelector("[data-map-search] [data-search-icon]")?.addEventListener("click",()=>{const e=document.querySelector("[data-map-search] input");e&&e.classList.contains("w-8")&&(e.classList.add("w-60"),e.classList.remove("w-8"),e.focus())});const a=document.querySelector('[data-form="motion-create"]');a&&(a.addEventListener("submit",e=>{e.preventDefault();const o=document.querySelectorAll('input[name="motion_email"], input[name="motion_phone"]');if(!Array.from(o).filter(t=>t.value.trim()).length){m("motion-phone-or-mail-required");return}a.querySelector('button[type="submit"]').setAttribute("disabled","disabled"),P()}),document.querySelector('[data-form="motion-verify"]')?.addEventListener("submit",e=>{e.preventDefault();const o=e.target.querySelector('button[type="submit"]');o.classList.add("loading"),o.setAttribute("disabled","disabled"),T()}));async function P(){if(+await m("motion-create-consent",{loading:!0})){const o=await(await S(async()=>{const{execute:i}=await import("./app-DwAHMZ1w.js").then(d=>d.r);return{execute:i}},__vite__mapDeps([0,1]))).execute("motion_create"),t=new FormData(a);t.append("_captcha",o),t.delete("motion_images[]");const n=await(await fetch(`${a.action}/verify`,{method:a.method,headers:y(),body:v(t)})).json();n.success?m("motion-create-verify",{loading:!0,content:n.sms_verification_text}):m("fetch-error",{content:n.message})}L("motion-create-consent"),a.querySelector('button[type="submit"]').removeAttribute("disabled")}async function T(){const e=new FormData(a);e.append("motion_code",document.querySelector('[name="motion_code"]').value);const t=await(await fetch(`${a.action}/store`,{method:a.method,headers:y(null),body:e})).json();t.success?window.location.href=a.action:m("fetch-error",{content:t.message}),L("motion-create-verify")}

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.