summaryrefslogtreecommitdiff
path: root/client/index.98d274eb.js
diff options
context:
space:
mode:
Diffstat (limited to 'client/index.98d274eb.js')
-rw-r--r--client/index.98d274eb.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/client/index.98d274eb.js b/client/index.98d274eb.js
new file mode 100644
index 0000000..75c0ce5
--- /dev/null
+++ b/client/index.98d274eb.js
@@ -0,0 +1 @@
+import{S as t,i as e,s as a,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 $,r as w,u as y,v as D,w as P,x as b,y as I,z as x}from"./client.cead19b7.js";function V(t){let e,a,m,g,E,$,w,y,D,P,b,I,x,V,j,C,N,M,T,_,k,A,S,H,J,K,z,B,O,q,F,Z,G,L,Q,R,U,W,X,Y,tt,et,at,st,rt,ot,nt,ct,it;return{c(){e=s("div"),a=s("div"),m=s("div"),g=s("i"),E=r(),$=s("h1"),w=o(t[0]),y=r(),D=s("div"),P=s("p"),b=o(t[1]),I=r(),x=s("div"),V=s("h2"),j=o("KP "),C=o(t[2]),N=r(),M=s("p"),T=s("span"),_=o("↑ KP "),k=o(t[4]),A=r(),S=s("span"),H=o("↓ KP "),J=o(t[3]),K=r(),z=s("div"),B=s("div"),O=s("p"),q=o("BZ"),F=r(),Z=s("p"),G=o(t[5]),L=r(),Q=s("div"),R=s("p"),U=o("Temp"),W=r(),X=s("p"),Y=o(t[7]),tt=o("°C"),et=r(),at=s("div"),st=s("p"),rt=o("Clouds"),ot=r(),nt=s("p"),ct=o(t[6]),it=o("%"),this.h()},l(s){e=n(s,"DIV",{class:!0});var r=c(e);a=n(r,"DIV",{class:!0});var o=c(a);m=n(o,"DIV",{class:!0});var f=c(m);g=n(f,"I",{class:!0}),c(g).forEach(i),E=l(f),$=n(f,"H1",{class:!0});var u=c($);w=h(u,t[0]),u.forEach(i),f.forEach(i),y=l(o),D=n(o,"DIV",{class:!0});var p=c(D);P=n(p,"P",{});var d=c(P);b=h(d,t[1]),d.forEach(i),p.forEach(i),I=l(o),x=n(o,"DIV",{class:!0});var v=c(x);V=n(v,"H2",{class:!0});var lt=c(V);j=h(lt,"KP "),C=h(lt,t[2]),lt.forEach(i),N=l(v),M=n(v,"P",{});var ht=c(M);T=n(ht,"SPAN",{className:!0});var ft=c(T);_=h(ft,"↑ KP "),k=h(ft,t[4]),ft.forEach(i),A=l(ht),S=n(ht,"SPAN",{className:!0});var ut=c(S);H=h(ut,"↓ KP "),J=h(ut,t[3]),ut.forEach(i),ht.forEach(i),v.forEach(i),K=l(o),z=n(o,"DIV",{class:!0});var pt=c(z);B=n(pt,"DIV",{});var dt=c(B);O=n(dt,"P",{class:!0});var vt=c(O);q=h(vt,"BZ"),vt.forEach(i),F=l(dt),Z=n(dt,"P",{class:!0});var mt=c(Z);G=h(mt,t[5]),mt.forEach(i),dt.forEach(i),L=l(pt),Q=n(pt,"DIV",{});var gt=c(Q);R=n(gt,"P",{class:!0});var Et=c(R);U=h(Et,"Temp"),Et.forEach(i),W=l(gt),X=n(gt,"P",{class:!0});var $t=c(X);Y=h($t,t[7]),tt=h($t,"°C"),$t.forEach(i),gt.forEach(i),et=l(pt),at=n(pt,"DIV",{});var wt=c(at);st=n(wt,"P",{class:!0});var yt=c(st);rt=h(yt,"Clouds"),yt.forEach(i),ot=l(wt),nt=n(wt,"P",{class:!0});var Dt=c(nt);ct=h(Dt,t[6]),it=h(Dt,"%"),Dt.forEach(i),wt.forEach(i),pt.forEach(i),o.forEach(i),r.forEach(i),this.h()},h(){f(g,"class","symbol fas fa-map-marker-alt svelte-1oi7i0p"),f($,"class","svelte-1oi7i0p"),f(m,"class","weatherCurrent-data-location svelte-1oi7i0p"),f(D,"class","weatherCurrent-data-date"),f(V,"class","svelte-1oi7i0p"),f(T,"classname","pr-2"),f(S,"classname","pl-2"),f(x,"class","weatherCurrent-data-kp svelte-1oi7i0p"),f(O,"class","svelte-1oi7i0p"),f(Z,"class","svelte-1oi7i0p"),f(R,"class","svelte-1oi7i0p"),f(X,"class","svelte-1oi7i0p"),f(st,"class","svelte-1oi7i0p"),f(nt,"class","svelte-1oi7i0p"),f(z,"class","current-details svelte-1oi7i0p"),f(a,"class","weatherCurrent-data svelte-1oi7i0p"),f(e,"class","weatherCurrent-wrapper svelte-1oi7i0p")},m(t,s){u(t,e,s),p(e,a),p(a,m),p(m,g),p(m,E),p(m,$),p($,w),p(a,y),p(a,D),p(D,P),p(P,b),p(a,I),p(a,x),p(x,V),p(V,j),p(V,C),p(x,N),p(x,M),p(M,T),p(T,_),p(T,k),p(M,A),p(M,S),p(S,H),p(S,J),p(a,K),p(a,z),p(z,B),p(B,O),p(O,q),p(B,F),p(B,Z),p(Z,G),p(z,L),p(z,Q),p(Q,R),p(R,U),p(Q,W),p(Q,X),p(X,Y),p(X,tt),p(z,et),p(z,at),p(at,st),p(st,rt),p(at,ot),p(at,nt),p(nt,ct),p(nt,it)},p(t,[e]){1&e&&d(w,t[0]),2&e&&d(b,t[1]),4&e&&d(C,t[2]),16&e&&d(k,t[4]),8&e&&d(J,t[3]),32&e&&d(G,t[5]),128&e&&d(Y,t[7]),64&e&&d(ct,t[6])},i:v,o:v,d(t){t&&i(e)}}}function j(t,e,a){var s=this&&this.__awaiter||function(t,e,a,s){return new(a||(a=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 e;t.done?r(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(n,c)}i((s=s.apply(t,e||[])).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="-",d="-";function v(t){o=t.coords.longitude,n=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(6,p=s.properties.timeseries[0].data.instant.details.cloud_area_fraction),a(7,d=s.properties.timeseries[0].data.instant.details.air_temperature)}))}(o,n),function(t,e){s(this,void 0,void 0,(function*(){console.log(`https://geocode.xyz/${t},${e}?geoit=json`);let s=yield fetch(`https://geocode.xyz/${e},${t}?geoit=json`).then((t=>t.json()));console.log(s),a(0,c=s.city)}))}(o,n)}function g(t){E()}function E(){o=28.283333,n=-15.416667}return m((function(){!function(){s(this,void 0,void 0,(function*(){a(5,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 e=new Date,s=new Date(0,0,0),o=1e3,n=0;t.forEach(((t,r)=>{t[1]>n&&(n=t[1]),t[1]<o&&(o=t[1]);let c=new Date(t[0]);Math.abs(c.getTime()-e.getTime())<Math.abs(s.getTime()-e.getTime())&&(s=c,a(2,l=t[1]))})),a(3,h=o.toString()),a(4,f=n.toString()),a(1,i=s.getDay()+". "+r[s.getMonth()]+" "+s.getHours()+":"+s.getMinutes())}))}(),navigator.geolocation?navigator.geolocation.getCurrentPosition(v,g):E()})),[c,i,l,h,f,u,p,d]}class C extends t{constructor(t){super(),e(this,t,j,V,a,{})}}function N(t){let e,a,d,m,g,E,$,w,y,D,P,b,I=t[5]&&function(t){let e,a,d,m,g,E,$,w,y,D,P,b;return{c(){e=s("div"),a=s("p"),d=s("i"),m=r(),g=o(t[3]),E=o("°C"),$=r(),w=s("p"),y=s("i"),D=r(),P=o(t[4]),b=o("%"),this.h()},l(s){e=n(s,"DIV",{});var r=c(e);a=n(r,"P",{});var o=c(a);d=n(o,"I",{class:!0}),c(d).forEach(i),m=l(o),g=h(o,t[3]),E=h(o,"°C"),o.forEach(i),$=l(r),w=n(r,"P",{});var f=c(w);y=n(f,"I",{class:!0}),c(y).forEach(i),D=l(f),P=h(f,t[4]),b=h(f,"%"),f.forEach(i),r.forEach(i),this.h()},h(){f(d,"class","fas fa-thermometer-half"),f(y,"class","fas fa-cloud")},m(t,s){u(t,e,s),p(e,a),p(a,d),p(a,m),p(a,g),p(a,E),p(e,$),p(e,w),p(w,y),p(w,D),p(w,P),p(w,b)},p:v,d(t){t&&i(e)}}}(t);return{c(){e=s("div"),a=s("div"),d=s("h3"),m=o(t[2]),g=r(),E=s("p"),$=o(t[1]),w=r(),y=s("div"),D=s("h2"),P=o(t[0]),b=r(),I&&I.c(),this.h()},l(s){e=n(s,"DIV",{class:!0});var r=c(e);a=n(r,"DIV",{});var o=c(a);d=n(o,"H3",{class:!0});var f=c(d);m=h(f,t[2]),f.forEach(i),g=l(o),E=n(o,"P",{});var u=c(E);$=h(u,t[1]),u.forEach(i),o.forEach(i),w=l(r),y=n(r,"DIV",{class:!0});var p=c(y);D=n(p,"H2",{class:!0});var v=c(D);P=h(v,t[0]),v.forEach(i),b=l(p),I&&I.l(p),p.forEach(i),r.forEach(i),this.h()},h(){f(d,"class","svelte-u548p6"),f(D,"class","svelte-u548p6"),f(y,"class","data svelte-u548p6"),f(e,"class","prediction-details svelte-u548p6")},m(t,s){u(t,e,s),p(e,a),p(a,d),p(d,m),p(a,g),p(a,E),p(E,$),p(e,w),p(e,y),p(y,D),p(D,P),p(y,b),I&&I.m(y,null)},p(t,[e]){t[5]&&I.p(t,e)},i:v,o:v,d(t){t&&i(e),I&&I.d()}}}function M(t,e,a){let{prediction:s}=e;let r=s.kp,o=s.time.split(" "),n=Number(o[0].split("-")[2])+". "+["January","February","March","April","May","June","July","August","September","October","November","December"][Number(o[0].split("-")[1])],c=o[1].substring(0,5),i=s.temp,l=s.clouds,h=s.hasNOMETData;return t.$$set=t=>{"prediction"in t&&a(6,s=t.prediction)},[r,n,c,i,l,h,s]}class T extends t{constructor(t){super(),e(this,t,M,N,a,{prediction:6})}}function _(t,e,a){const s=t.slice();return s[13]=e[a],s[15]=a,s}function k(t){let e,a,d,m,g;return{c(){e=s("div"),a=s("i"),d=r(),m=s("p"),g=o("No prediction data"),this.h()},l(t){e=n(t,"DIV",{class:!0});var s=c(e);a=n(s,"I",{class:!0}),c(a).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(a,"class","fas fa-7x fa-exclamation-triangle"),f(e,"class","no-data svelte-1romtap")},m(t,s){u(t,e,s),p(e,a),p(e,d),p(e,m),p(m,g)},p:v,i:v,o:v,d(t){t&&i(e)}}}function A(t){let e,a,d,v,m,y,D=t[0],P=[];for(let e=0;e<D.length;e+=1)P[e]=S(_(t,D,e));const b=t=>E(P[t],1,1,(()=>{P[t]=null}));return{c(){e=s("div"),a=s("h2"),d=o("Predicted"),v=r(),m=s("div");for(let t=0;t<P.length;t+=1)P[t].c();this.h()},l(t){e=n(t,"DIV",{className:!0});var s=c(e);a=n(s,"H2",{class:!0});var r=c(a);d=h(r,"Predicted"),r.forEach(i),s.forEach(i),v=l(t),m=n(t,"DIV",{class:!0});var o=c(m);for(let t=0;t<P.length;t+=1)P[t].l(o);o.forEach(i),this.h()},h(){f(a,"class","svelte-1romtap"),f(e,"classname","flex flex-row justify-between items-top"),f(m,"class","prediction-table svelte-1romtap")},m(t,s){u(t,e,s),p(e,a),p(a,d),u(t,v,s),u(t,m,s);for(let t=0;t<P.length;t+=1)P[t].m(m,null);y=!0},p(t,e){if(1&e){let a;for(D=t[0],a=0;a<D.length;a+=1){const s=_(t,D,a);P[a]?(P[a].p(s,e),w(P[a],1)):(P[a]=S(s),P[a].c(),w(P[a],1),P[a].m(m,null))}for(g(),a=D.length;a<P.length;a+=1)b(a);$()}},i(t){if(!y){for(let t=0;t<D.length;t+=1)w(P[t]);y=!0}},o(t){P=P.filter(Boolean);for(let t=0;t<P.length;t+=1)E(P[t]);y=!1},d(t){t&&i(e),t&&i(v),t&&i(m),I(P,t)}}}function S(t){let e,a;return e=new T({props:{prediction:t[13]}}),{c(){y(e.$$.fragment)},l(t){D(e.$$.fragment,t)},m(t,s){P(e,t,s),a=!0},p(t,a){const s={};1&a&&(s.prediction=t[13]),e.$set(s)},i(t){a||(w(e.$$.fragment,t),a=!0)},o(t){E(e.$$.fragment,t),a=!1},d(t){b(e,t)}}}function H(t){let e,a,r,o;const l=[A,k],h=[];function p(t,e){return t[0]?0:1}return a=p(t),r=h[a]=l[a](t),{c(){e=s("div"),r.c(),this.h()},l(t){e=n(t,"DIV",{class:!0});var a=c(e);r.l(a),a.forEach(i),this.h()},h(){f(e,"class","predicted-weather svelte-1romtap")},m(t,s){u(t,e,s),h[a].m(e,null),o=!0},p(t,[s]){let o=a;a=p(t),a===o?h[a].p(t,s):(g(),E(h[o],1,1,(()=>{h[o]=null})),$(),r=h[a],r||(r=h[a]=l[a](t),r.c()),w(r,1),r.m(e,null))},i(t){o||(w(r),o=!0)},o(t){E(r),o=!1},d(t){t&&i(e),h[a].d()}}}function J(t,e,a){var s=this&&this.__awaiter||function(t,e,a,s){return new(a||(a=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 e;t.done?r(t.value):(e=t.value,e instanceof a?e:new a((function(t){t(e)}))).then(n,c)}i((s=s.apply(t,e||[])).next())}))};let r,o,n,c=!1;function i(t,e){return s(this,void 0,void 0,(function*(){let s;c&&(s=yield fetch(`https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=${e}&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,e)=>{if("observed"!=t[2]){let e,a,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())<Math.abs(n.getTime()-r.getTime())&&(n=o,e=t.data.instant.details.air_temperature,a=t.data.instant.details.cloud_area_fraction)})),o.push({time:t[0],kp:t[1],temp:e,clouds:a,hasNOMETData:c})}})),a(0,n=o)}))}function l(t){r=t.coords.longitude,o=t.coords.latitude,i(r,o)}function h(t){c=!1,f()}function f(){r=28.283333,o=-15.416667,i(0,0)}return m((function(){navigator.geolocation?(c=!0,navigator.geolocation.getCurrentPosition(l,h)):(c=!1,f())})),[n]}class K extends t{constructor(t){super(),e(this,t,J,H,a,{})}}function z(t){let e,a,o,h,d,m;return o=new C({}),d=new K({}),{c(){e=r(),a=s("div"),y(o.$$.fragment),h=r(),y(d.$$.fragment),this.h()},l(t){x('[data-svelte="svelte-1q3846k"]',document.head).forEach(i),e=l(t),a=n(t,"DIV",{class:!0});var s=c(a);D(o.$$.fragment,s),h=l(s),D(d.$$.fragment,s),s.forEach(i),this.h()},h(){document.title="Aurora data",f(a,"class","homescreen svelte-pf4p6y")},m(t,s){u(t,e,s),u(t,a,s),P(o,a,null),p(a,h),P(d,a,null),m=!0},p:v,i(t){m||(w(o.$$.fragment,t),w(d.$$.fragment,t),m=!0)},o(t){E(o.$$.fragment,t),E(d.$$.fragment,t),m=!1},d(t){t&&i(e),t&&i(a),b(o),b(d)}}}export default class extends t{constructor(t){super(),e(this,t,null,z,a,{})}}