import{S as t,i as a,s as e,e as s,a as r,t as n,c,b as o,d as i,f as l,g as h,h as u,j as f,k as v,l as d,n as p,o as m,m as g,p as E,q as w,r as y,u as $,v as D,w as b,x as P,y as I,z as V}from"./client.2977978b.js";function x(t){let a,e,m,g,E,w,y,$,D,b,P,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,nt,ct,ot,it,lt;return{c(){a=s("div"),e=s("div"),m=s("div"),g=s("i"),E=r(),w=s("h1"),y=n(C),$=r(),D=s("div"),b=s("p"),P=n(t[0]),I=r(),V=s("div"),x=s("h2"),N=n("KP "),T=n(t[1]),M=r(),j=s("p"),_=s("span"),k=n("↑ KP "),A=n(t[3]),S=r(),H=s("span"),J=n("↓ KP "),K=n(t[2]),B=r(),O=s("div"),q=s("div"),z=s("p"),F=n("BZ"),Z=r(),G=s("p"),L=n(t[4]),Q=r(),R=s("div"),U=s("p"),W=n("Temp"),X=r(),Y=s("p"),tt=n(t[6]),at=n("°C"),et=r(),st=s("div"),rt=s("p"),nt=n("Clouds"),ct=r(),ot=s("p"),it=n(t[5]),lt=n("%"),this.h()},l(s){a=c(s,"DIV",{class:!0});var r=o(a);e=c(r,"DIV",{class:!0});var n=o(e);m=c(n,"DIV",{class:!0});var u=o(m);g=c(u,"I",{class:!0}),o(g).forEach(i),E=l(u),w=c(u,"H1",{class:!0});var f=o(w);y=h(f,C),f.forEach(i),u.forEach(i),$=l(n),D=c(n,"DIV",{class:!0});var v=o(D);b=c(v,"P",{});var d=o(b);P=h(d,t[0]),d.forEach(i),v.forEach(i),I=l(n),V=c(n,"DIV",{class:!0});var p=o(V);x=c(p,"H2",{class:!0});var ht=o(x);N=h(ht,"KP "),T=h(ht,t[1]),ht.forEach(i),M=l(p),j=c(p,"P",{});var ut=o(j);_=c(ut,"SPAN",{className:!0});var ft=o(_);k=h(ft,"↑ KP "),A=h(ft,t[3]),ft.forEach(i),S=l(ut),H=c(ut,"SPAN",{className:!0});var vt=o(H);J=h(vt,"↓ KP "),K=h(vt,t[2]),vt.forEach(i),ut.forEach(i),p.forEach(i),B=l(n),O=c(n,"DIV",{class:!0});var dt=o(O);q=c(dt,"DIV",{});var pt=o(q);z=c(pt,"P",{class:!0});var mt=o(z);F=h(mt,"BZ"),mt.forEach(i),Z=l(pt),G=c(pt,"P",{class:!0});var gt=o(G);L=h(gt,t[4]),gt.forEach(i),pt.forEach(i),Q=l(dt),R=c(dt,"DIV",{});var Et=o(R);U=c(Et,"P",{class:!0});var wt=o(U);W=h(wt,"Temp"),wt.forEach(i),X=l(Et),Y=c(Et,"P",{class:!0});var yt=o(Y);tt=h(yt,t[6]),at=h(yt,"°C"),yt.forEach(i),Et.forEach(i),et=l(dt),st=c(dt,"DIV",{});var $t=o(st);rt=c($t,"P",{class:!0});var Dt=o(rt);nt=h(Dt,"Clouds"),Dt.forEach(i),ct=l($t),ot=c($t,"P",{class:!0});var bt=o(ot);it=h(bt,t[5]),lt=h(bt,"%"),bt.forEach(i),$t.forEach(i),dt.forEach(i),n.forEach(i),r.forEach(i),this.h()},h(){u(g,"class","symbol fas fa-map-marker-alt svelte-13muhi2"),u(w,"class","svelte-13muhi2"),u(m,"class","weatherCurrent-data-location svelte-13muhi2"),u(D,"class","weatherCurrent-data-date"),u(x,"class","svelte-13muhi2"),u(_,"classname","pr-2"),u(H,"classname","pl-2"),u(V,"class","weatherCurrent-data-kp svelte-13muhi2"),u(z,"class","svelte-13muhi2"),u(G,"class","svelte-13muhi2"),u(U,"class","svelte-13muhi2"),u(Y,"class","svelte-13muhi2"),u(rt,"class","svelte-13muhi2"),u(ot,"class","svelte-13muhi2"),u(O,"class","current-details svelte-13muhi2"),u(e,"class","weatherCurrent-data svelte-13muhi2"),u(a,"class","weatherCurrent-wrapper svelte-13muhi2")},m(t,s){f(t,a,s),v(a,e),v(e,m),v(m,g),v(m,E),v(m,w),v(w,y),v(e,$),v(e,D),v(D,b),v(b,P),v(e,I),v(e,V),v(V,x),v(x,N),v(x,T),v(V,M),v(V,j),v(j,_),v(_,k),v(_,A),v(j,S),v(j,H),v(H,J),v(H,K),v(e,B),v(e,O),v(O,q),v(q,z),v(z,F),v(q,Z),v(q,G),v(G,L),v(O,Q),v(O,R),v(R,U),v(U,W),v(R,X),v(R,Y),v(Y,tt),v(Y,at),v(O,et),v(O,st),v(st,rt),v(rt,nt),v(st,ct),v(st,ot),v(ot,it),v(ot,lt)},p(t,[a]){1&a&&d(P,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:p,o:p,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,n){function c(t){try{i(s.next(t))}catch(t){n(t)}}function o(t){try{i(s.throw(t))}catch(t){n(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(c,o)}i((s=s.apply(t,a||[])).next())}))};const r=["January","February","March","April","May","June","July","August","September","October","November","December"];let n,c,o="-",i="-",l="-",h="-",u="-",f="-",v="-";function d(t){n=t.coords.longitude,c=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,f=s.properties.timeseries[0].data.instant.details.cloud_area_fraction),e(6,v=s.properties.timeseries[0].data.instant.details.air_temperature)}))}(n,c)}function p(t){g()}function g(){n=28.283333,c=-15.416667}return m((function(){!function(){s(this,void 0,void 0,(function*(){e(4,u=(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),n=1e3,c=0;t.forEach(((t,r)=>{t[1]>c&&(c=t[1]),t[1]{"prediction"in t&&e(6,s=t.prediction)},[r,c,o,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=n("No prediction data"),this.h()},l(t){a=c(t,"DIV",{class:!0});var s=o(a);e=c(s,"I",{class:!0}),o(e).forEach(i),d=l(s),m=c(s,"P",{});var r=o(m);g=h(r,"No prediction data"),r.forEach(i),s.forEach(i),this.h()},h(){u(e,"class","fas fa-7x fa-exclamation-triangle"),u(a,"class","no-data svelte-bhvysr")},m(t,s){f(t,a,s),v(a,e),v(a,d),v(a,m),v(m,g)},p:p,i:p,o:p,d(t){t&&i(a)}}}function S(t){let a,e,d,p,m,$,D=t[0],b=[];for(let a=0;aE(b[t],1,1,(()=>{b[t]=null}));return{c(){a=s("div"),e=s("h2"),d=n("Predicted"),p=r(),m=s("div");for(let t=0;t{h[n]=null})),w(),r=h[e],r||(r=h[e]=l[e](t),r.c()),y(r,1),r.m(a,null))},i(t){n||(y(r),n=!0)},o(t){E(r),n=!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,n){function c(t){try{i(s.next(t))}catch(t){n(t)}}function o(t){try{i(s.throw(t))}catch(t){n(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(c,o)}i((s=s.apply(t,a||[])).next())}))};let r,n,c,o=!1;function i(t,a){return s(this,void 0,void 0,(function*(){let s;o&&(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 n=[];r.forEach(((t,a)=>{if("observed"!=t[2]){let a,e,r=new Date(t[0]),c=new Date(0,0,0);o&&s.properties.timeseries.forEach(((t,s)=>{let n=new Date(t.time);Math.abs(n.getTime()-r.getTime())