import{S as t,i as e,s as a,e as s,a as r,t as n,c,b as o,d as l,f as i,g as h,h as f,j as u,k as d,l as v,n as p,o as m,m as g,p as y,q as E,r as w,u as $,v as x,w as P,x as b,y as D,z as I,A as V}from"./client.7f720467.js";function z(t){let e,a,m,g,y,E,w,$,x,P,b,D,I,V,z,C,N,j,M,T,_,k,S,H,J,K,B,O,q,F,Z,G,L,Q,R,U,W,X,Y,tt,et,at,st,rt,nt,ct,ot,lt;return{c(){e=s("div"),a=s("div"),m=s("div"),g=s("i"),y=r(),E=s("h1"),w=n(A),$=r(),x=s("div"),P=s("p"),b=n(t[0]),D=r(),I=s("div"),V=s("h2"),z=n("KP "),C=n(t[1]),N=r(),j=s("p"),M=s("span"),T=n("↑ KP "),_=n(t[3]),k=r(),S=s("span"),H=n("↓ KP "),J=n(t[2]),K=r(),B=s("div"),O=s("div"),q=s("p"),F=n("BZ"),Z=r(),G=s("p"),L=n(t[4]),Q=r(),R=s("div"),U=s("p"),W=n("Probability"),X=r(),Y=s("p"),tt=n("10%"),et=r(),at=s("div"),st=s("p"),rt=n("Clouds"),nt=r(),ct=s("p"),ot=n(t[5]),lt=n("%"),this.h()},l(s){e=c(s,"DIV",{class:!0});var r=o(e);a=c(r,"DIV",{class:!0});var n=o(a);m=c(n,"DIV",{class:!0});var f=o(m);g=c(f,"I",{class:!0}),o(g).forEach(l),y=i(f),E=c(f,"H1",{class:!0});var u=o(E);w=h(u,A),u.forEach(l),f.forEach(l),$=i(n),x=c(n,"DIV",{class:!0});var d=o(x);P=c(d,"P",{});var v=o(P);b=h(v,t[0]),v.forEach(l),d.forEach(l),D=i(n),I=c(n,"DIV",{class:!0});var p=o(I);V=c(p,"H2",{class:!0});var it=o(V);z=h(it,"KP "),C=h(it,t[1]),it.forEach(l),N=i(p),j=c(p,"P",{});var ht=o(j);M=c(ht,"SPAN",{className:!0});var ft=o(M);T=h(ft,"↑ KP "),_=h(ft,t[3]),ft.forEach(l),k=i(ht),S=c(ht,"SPAN",{className:!0});var ut=o(S);H=h(ut,"↓ KP "),J=h(ut,t[2]),ut.forEach(l),ht.forEach(l),p.forEach(l),K=i(n),B=c(n,"DIV",{class:!0});var dt=o(B);O=c(dt,"DIV",{});var vt=o(O);q=c(vt,"P",{class:!0});var pt=o(q);F=h(pt,"BZ"),pt.forEach(l),Z=i(vt),G=c(vt,"P",{class:!0});var mt=o(G);L=h(mt,t[4]),mt.forEach(l),vt.forEach(l),Q=i(dt),R=c(dt,"DIV",{});var gt=o(R);U=c(gt,"P",{class:!0});var yt=o(U);W=h(yt,"Probability"),yt.forEach(l),X=i(gt),Y=c(gt,"P",{class:!0});var Et=o(Y);tt=h(Et,"10%"),Et.forEach(l),gt.forEach(l),et=i(dt),at=c(dt,"DIV",{});var wt=o(at);st=c(wt,"P",{class:!0});var $t=o(st);rt=h($t,"Clouds"),$t.forEach(l),nt=i(wt),ct=c(wt,"P",{class:!0});var xt=o(ct);ot=h(xt,t[5]),lt=h(xt,"%"),xt.forEach(l),wt.forEach(l),dt.forEach(l),n.forEach(l),r.forEach(l),this.h()},h(){f(g,"class","symbol fas fa-map-marker-alt svelte-1y77zx4"),f(E,"class","svelte-1y77zx4"),f(m,"class","weatherCurrent-data-location svelte-1y77zx4"),f(x,"class","weatherCurrent-data-date"),f(V,"class","svelte-1y77zx4"),f(M,"classname","pr-2"),f(S,"classname","pl-2"),f(I,"class","weatherCurrent-data-kp svelte-1y77zx4"),f(q,"class","svelte-1y77zx4"),f(G,"class","svelte-1y77zx4"),f(U,"class","svelte-1y77zx4"),f(Y,"class","svelte-1y77zx4"),f(st,"class","svelte-1y77zx4"),f(ct,"class","svelte-1y77zx4"),f(B,"class","current-details svelte-1y77zx4"),f(a,"class","weatherCurrent-data svelte-1y77zx4"),f(e,"class","weatherCurrent-wrapper svelte-1y77zx4")},m(t,s){u(t,e,s),d(e,a),d(a,m),d(m,g),d(m,y),d(m,E),d(E,w),d(a,$),d(a,x),d(x,P),d(P,b),d(a,D),d(a,I),d(I,V),d(V,z),d(V,C),d(I,N),d(I,j),d(j,M),d(M,T),d(M,_),d(j,k),d(j,S),d(S,H),d(S,J),d(a,K),d(a,B),d(B,O),d(O,q),d(q,F),d(O,Z),d(O,G),d(G,L),d(B,Q),d(B,R),d(R,U),d(U,W),d(R,X),d(R,Y),d(Y,tt),d(B,et),d(B,at),d(at,st),d(st,rt),d(at,nt),d(at,ct),d(ct,ot),d(ct,lt)},p(t,[e]){1&e&&v(b,t[0]),2&e&&v(C,t[1]),8&e&&v(_,t[3]),4&e&&v(J,t[2]),16&e&&v(L,t[4]),32&e&&v(ot,t[5])},i:p,o:p,d(t){t&&l(e)}}}let A="The earth";function C(t,e,a){var s=this&&this.__awaiter||function(t,e,a,s){return new(a||(a=Promise))((function(r,n){function c(t){try{l(s.next(t))}catch(t){n(t)}}function o(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(c,o)}l((s=s.apply(t,e||[])).next())}))};const r=["January","February","March","April","May","June","July","August","September","October","November","December"];Array();let n,c,o="-",l="-",i="-",h="-",f="-",u="-";function d(t){n=t.coords.longitude,c=t.coords.latitude,function(t,e){s(this,void 0,void 0,(function*(){let s=yield fetch(`https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=${e}&lon=${t}`).then((t=>t.json()));a(5,u=s.properties.timeseries[0].data.instant.details.cloud_area_fraction),a(4,f=(yield fetch("https://services.swpc.noaa.gov/products/summary/solar-wind-mag-field.json").then((t=>t.json()))).Bz);let n=yield fetch("https://services.swpc.noaa.gov/products/noaa-planetary-k-index-forecast.json").then((t=>t.json()));n.shift();let c=new Date,d=new Date(0,0,0),v=1e3,p=0;n.forEach(((t,e)=>{t[1]>p&&(p=t[1]),t[1]{"prediction"in t&&a(5,s=t.prediction)},[r,c,o,l,i,s]}class T extends t{constructor(t){super(),e(this,t,M,j,a,{prediction:5})}}function _(t,e,a){const s=t.slice();return s[18]=e[a],s[20]=a,s}function k(t){let e;return{c(){e=n("Cannot connect to NOAA")},l(t){e=h(t,"Cannot connect to NOAA")},m(t,a){u(t,e,a)},p:p,i:p,o:p,d(t){t&&l(e)}}}function S(t){let e,a,s=t[0],r=[];for(let e=0;ey(r[t],1,1,(()=>{r[t]=null}));return{c(){for(let t=0;t{I[a]=null})),E(),P=I[x],P||(P=I[x]=D[x](t),P.c()),w(P,1),P.m($,null))},i(t){b||(w(P),b=!0)},o(t){y(P),b=!1},d(t){t&&l(e),I[x].d()}}}function K(t,e,a){var s=this&&this.__awaiter||function(t,e,a,s){return new(a||(a=Promise))((function(r,n){function c(t){try{l(s.next(t))}catch(t){n(t)}}function o(t){try{l(s.throw(t))}catch(t){n(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(c,o)}l((s=s.apply(t,e||[])).next())}))};let r,n,c;Array();function o(t){n=t.coords.longitude,c=t.coords.latitude,function(t,e){s(this,void 0,void 0,(function*(){let s=yield fetch(`https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=${e}&lon=${t}`).then((t=>t.json())),n=yield fetch("https://services.swpc.noaa.gov/products/noaa-planetary-k-index-forecast.json").then((t=>t.json()));n.shift();let c=[];n.forEach(((t,e)=>{if("observed"!=t[2]){let e,a,r=new Date(t[0]),n=new Date(0,0,0);s.properties.timeseries.forEach(((t,s)=>{let c=new Date(t.time);Math.abs(c.getTime()-r.getTime())