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