1import{d as g,r as d,c as o,N as _,b as w,s as k,x as e,C as n,B as r,f as p}from"./app-B4Hm5MTU.js";import{d as l,u as T,t as b}from"./utc-dJxYFV9p.js";const z={class:"grid desktop:gap-1 grid-cols-2 bg-white bg-opacity-80 rounded-lg backdrop-blur-xs max-w-[311px] md:max-w-[416px] shadow-xs p-5"},C={class:"flex flex-col gap-y-1 justify-self-end"},B={class:"flex flex-row gap-2 items-center leading-137 col-span-2"},j=["src"],S={class:"text-16"},L={class:"text-16 opacity-40"},$={class:"flex flex-col gap-2 desktop:gap-0 desktop:flex-row justify-between desktop:items-center col-span-2"},D={class:"flex flex-row gap-2 items-center"},F=g({__name:"CityWeather",props:{isLovelySite:{type:Boolean},cityTitle:{},cityHandler:{},small:{type:Boolean,default:!1}},setup(u){l.extend(T),l.extend(b);const a=u,s=d(null),c=d(new Date),f=o(()=>s.value?.current.temp_c??24.3),m=o(()=>s.value?.current.temp_f??75.7),x=o(()=>s.value?.current.condition.icon??"//cdn.weatherapi.com/weather/64x64/day/116.png"),h=o(()=>l(c.value).tz(s.value?.location.tz_id).format("hh:mm A")),y=o(()=>`GMT ${l(c.value).tz(s.value?.location.tz_id).format("Z")}`);return _(async()=>{setInterval(()=>{c.value=new Date},1e3);try{const t=`/actions/ticket-hub/weather?city=${a.cityHandler.toLowerCase()}`,i=await fetch(t);if(i.ok){const v=await i.json();s.value=v.data}}catch(t){console.error(`Error fetching weather data: ${t}`)}}),(t,i)=>(w(),k("div",z,[e("h4",{class:r([[a.isLovelySite?"h4":"text-22 font-semibold leading-120 font-display desktop:text-26"],"self-center"])},n(a.cityTitle),3),e("div",C,[e("p",{class:r([[a.isLovelySite?"text-16 leading-137":"text-12 desktop:text-16 leading-140 desktop:leading-137"],"text-right"])},n(h.value),3),e("p",{class:r(["opacity-40 text-right",a.isLovelySite?"text-16 leading-137":"text-12 leading-140 desktop:leading-137 desktop:text-16"])},n(y.value),3)]),e("div",B,[e("img",{src:x.value,alt:"",class:"object-center object-cover size-8"},null,8,j),e("span",S,n(f.value)+"°C",1),e("span",L,n(m.value)+"°F",1)]),e("div",$,[e("div",D,[p(t.$slots,"crowd")]),e("div",null,[p(t.$slots,"default")])])]))}});export{F as default}; 2//# sourceMappingURL=CityWeather-CmKjwpUs.js.map
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.