summaryrefslogtreecommitdiff
path: root/client/legacy/index.c0543b4c.js
diff options
context:
space:
mode:
authorjakobst1n <undefined>2022-05-21 13:37:59 +0200
committerjakobst1n <undefined>2022-05-21 13:37:59 +0200
commit74e78f01293e3f0836de38502d4c84aff961f396 (patch)
tree11feb254655499ef41bfc74c9a2b2a0cce9222ab /client/legacy/index.c0543b4c.js
parente972452bcd2dbf887654af85bfaeba2495d9c419 (diff)
downloadAurora-data-gh-pages.tar.gz
Aurora-data-gh-pages.zip
Updatesgh-pages
Diffstat (limited to 'client/legacy/index.c0543b4c.js')
-rw-r--r--client/legacy/index.c0543b4c.js1
1 files changed, 0 insertions, 1 deletions
diff --git a/client/legacy/index.c0543b4c.js b/client/legacy/index.c0543b4c.js
deleted file mode 100644
index 56d60ee..0000000
--- a/client/legacy/index.c0543b4c.js
+++ /dev/null
@@ -1 +0,0 @@
-import{_ as t,a as n,b as e,c as a,i as r,s as c,d as o,e as i,S as s,f as u,g as f,h as l,j as d,k as v,l as h,m as p,n as m,o as g,w as _,p as w,q as y,r as b,t as k,u as $,v as E,x as D,y as O,z as I,A as R,B as j,C as P,D as V,E as x,F as T,G as q,H as M,I as B,J as S,K as N,L as C,M as A,N as J,O as H,P as K,Q as z,R as L,T as Z}from"./client.b77ea58c.js";function F(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function G(t){var n,e,a,r,c,o,i,s,g;return{c:function(){n=u("div"),e=u("div"),a=u("div"),r=u("div"),c=u("div"),o=u("div"),i=u("div"),s=u("div"),g=u("div"),this.h()},l:function(t){n=f(t,"DIV",{class:!0});var u=l(n);e=f(u,"DIV",{class:!0}),l(e).forEach(d),a=f(u,"DIV",{class:!0}),l(a).forEach(d),r=f(u,"DIV",{class:!0}),l(r).forEach(d),c=f(u,"DIV",{class:!0}),l(c).forEach(d),o=f(u,"DIV",{class:!0}),l(o).forEach(d),i=f(u,"DIV",{class:!0}),l(i).forEach(d),s=f(u,"DIV",{class:!0}),l(s).forEach(d),g=f(u,"DIV",{class:!0}),l(g).forEach(d),u.forEach(d),this.h()},h:function(){v(e,"class","svelte-7k6qu0"),v(a,"class","svelte-7k6qu0"),v(r,"class","svelte-7k6qu0"),v(c,"class","svelte-7k6qu0"),v(o,"class","svelte-7k6qu0"),v(i,"class","svelte-7k6qu0"),v(s,"class","svelte-7k6qu0"),v(g,"class","svelte-7k6qu0"),v(n,"class","lds-roller svelte-7k6qu0")},m:function(t,u){h(t,n,u),p(n,e),p(n,a),p(n,r),p(n,c),p(n,o),p(n,i),p(n,s),p(n,g)},p:m,i:m,o:m,d:function(t){t&&d(n)}}}var Q=function(n){t(u,s);var e=F(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,null,G,c,{}),n}return i(u)}(),U=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"];function W(t){if(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z$/.test(t))return t;if(/^\d{4}\s[a-z,A-Z]+\s\d{2}$/.test(t)){var n=t.split(" ");return t="".concat(n[0],"-").concat(function(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,e=t.toString();n-e.length>0;)e="0"+e;return e}(function(t){if("string"!=typeof t)throw new Error("Cannot get month number of ".concat(g(t),"..."));if(t.length<3)throw new Error('Cannot get month number string "'.concat(t,'" of length ').concat(t.length,"..."));t=t.substring(0,3).toLowerCase();var n=U.indexOf(t);if(-1===n)throw new Error("Could not find the month ".concat(t,"."));return n}(n[1])),"-").concat(n[2],"T00:00:00Z"),t}return/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}/.test(t)?t.replace(" ","T")+"Z":/^\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}.\d{4}/.test(t)?t.replace(" ","T").split(".")[0]+"Z":(console.warn(t),t)}function X(t){return t=W(t),new Date(t)}const Y=_("light");setInterval((function(){if("undefined"==typeof window)return;let t=window.matchMedia("(prefers-color-scheme:dark)").matches?"dark":"light";t!=w(Y)&&Y.set(t)}),1e3),Y.subscribe((t=>{"undefined"!=typeof window&&("dark"==t?window.document.body.classList.add("dark"):window.document.body.classList.remove("dark"))}));const tt={updated:new Date(0,0,0),updating:!0};let nt=st("navigator_location"),et=st("earth_weather"),at=st("space_weather");const rt=_(ut("navigator_location")?function(t){return t.updated=new Date(t.updated),t}(nt):Object.assign(Object.assign({},tt),{available:!1,longitude:null,latitude:null,city:null})),ct=_(ut("earth_weather")?function(t){let n=t;return n.updated=new Date(n.updated),n.yr_data_raw.properties.meta.updated_at=new Date(n.yr_data_raw.properties.meta.updated_at),n.yr_data_raw.properties.timeseries=n.yr_data_raw.properties.timeseries.map((t=>Object.assign(Object.assign({},t),{time:new Date(t.time)}))),n}(et):Object.assign(Object.assign({},tt),{available:!1})),ot=_(ut("space_weather")?function(t){let n=t;return n.updated=new Date(n.updated),n.usnoaa_data_raw.geospace_pred_est_kp_1_hour=n.usnoaa_data_raw.geospace_pred_est_kp_1_hour.map((t=>Object.assign(Object.assign({},t),{model_prediction_time:new Date(t.model_prediction_time)}))),n.usnoaa_data_raw.noaa_planetary_k_index_forecast=n.usnoaa_data_raw.noaa_planetary_k_index_forecast.map((t=>Object.assign(Object.assign({},t),{time:new Date(t.time)}))),n.usnoaa_data_raw.outlook_27_day=n.usnoaa_data_raw.outlook_27_day.map((t=>Object.assign(Object.assign({},t),{time:new Date(t.time)}))),n.usnoaa_data_raw.solar_wind_mag_field.TimeStamp=new Date(n.usnoaa_data_raw.solar_wind_mag_field.TimeStamp),n}(at):Object.assign({},tt));function it(t,n){"undefined"!=typeof window&&localStorage.setItem(t,JSON.stringify(n))}function st(t){if("undefined"!=typeof window)return JSON.parse(localStorage.getItem(t))}function ut(t){return"undefined"!=typeof window&&localStorage.hasOwnProperty(t)}async function ft(){if("undefined"==typeof window)return;let t;dt(rt,!0);try{t=await async function(){return new Promise(((t,n)=>{"undefined"!=typeof navigator?navigator.geolocation.getCurrentPosition((n=>{t({longitude:n.coords.longitude,latitude:n.coords.latitude})}),(t=>{n(t)})):n(Error())}))}()}catch(t){if(0==w(rt).available)return;return console.log(t),rt.update((t=>Object.assign(Object.assign({},t),{available:!1,city:null,longitude:null,latitude:null}))),void dt(rt,!1)}if(w(rt).available&&Date.now()-w(rt).updated<3e5)return void dt(rt,!1,!1);let n={city:void 0};try{let e=await fetch(`https://geocode.xyz/${t.latitude},${t.longitude}?geoit=json`);n=await e.json()}catch(t){console.log(t)}rt.update((e=>Object.assign(Object.assign(Object.assign({},e),{available:!0,city:n.city}),t))),dt(rt,!1)}async function lt(){if("undefined"==typeof window)return;if(Date.now()-w(ot).updated<3e5)return;let t;dt(ot,!0);try{t=await async function(){let t,n={now:{bz:"-",bt:"-",kp:"-",kp_min:"-",kp_max:"-"},usnoaa_data_raw:{solar_wind_mag_field:!1,noaa_planetary_k_index_forecast:!1,geospace_pred_est_kp_1_hour:!1,outlook_27_day:!1}},e=await fetch("https://services.swpc.noaa.gov/products/summary/solar-wind-mag-field.json");t=await e.json(),t.TimeStamp=X(t.TimeStamp),n.usnoaa_data_raw.solar_wind_mag_field=t,n.now.bz=n.usnoaa_data_raw.solar_wind_mag_field.Bz,n.now.bt=n.usnoaa_data_raw.solar_wind_mag_field.Bt,e=await fetch("https://services.swpc.noaa.gov/json/geospace/geospace_pred_est_kp_1_hour.json"),t=await e.json(),t=t.map((t=>Object.assign(Object.assign({},t),{model_prediction_time:X(t.model_prediction_time)}))),n.usnoaa_data_raw.geospace_pred_est_kp_1_hour=t,e=await fetch("https://services.swpc.noaa.gov/text/27-day-outlook.txt"),t=await e.text(),t=[...t.matchAll(/^(?<time>\d{4}\s.{3}\s\d{2})\s+(?<flux107>\d+)\s+(?<aindex>\d+)\s+(?<kindex>\d+)$/gm)],t=t.map((t=>Object.assign(Object.assign({},t.groups),{time:X(t.groups.time)}))),n.usnoaa_data_raw.outlook_27_day=t,e=await fetch("https://services.swpc.noaa.gov/products/noaa-planetary-k-index-forecast.json"),t=await e.json(),t.shift(),n.usnoaa_data_raw.noaa_planetary_k_index_forecast=t;let a=new Date,r=new Date(0,0,0),c=1e3,o=0;return n.usnoaa_data_raw.noaa_planetary_k_index_forecast.forEach(((t,e)=>{t[1]>o&&(o=t[1]),t[1]<c&&(c=t[1]);let i=X(t[0]);Math.abs(i.getTime()-a.getTime())<Math.abs(r.getTime()-a.getTime())&&(r=i,n.now.kp=t[1]),n.usnoaa_data_raw.noaa_planetary_k_index_forecast[e]={time:i,kp:t[1],observed:t[2]}})),n.now.kp_min=c.toString(),n.now.kp_max=o.toString(),console.log(n),n}()}catch(t){return console.error(t),void dt(ot,!1,!1)}ot.update((n=>Object.assign(Object.assign({},n),t))),dt(ot,!1)}function dt(t,n=!1,e=!0){let a={};e&&!n&&(a={updated:new Date}),t.update((t=>Object.assign(Object.assign(Object.assign({},t),a),{updating:n})))}function vt(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function ht(t){var n,e,a;function r(t,n){return void 0!==t[2].city?mt:pt}var c=r(t),o=c(t);return{c:function(){n=u("i"),e=y(),o.c(),a=b(),this.h()},l:function(t){n=f(t,"I",{class:!0}),l(n).forEach(d),e=k(t),o.l(t),a=b(),this.h()},h:function(){v(n,"class","symbol fas fa-map-marker-alt svelte-9kdo4s")},m:function(t,r){h(t,n,r),h(t,e,r),o.m(t,r),h(t,a,r)},p:function(t,n){c===(c=r(t))&&o?o.p(t,n):(o.d(1),(o=c(t))&&(o.c(),o.m(a.parentNode,a)))},d:function(t){t&&d(n),t&&d(e),o.d(t),t&&d(a)}}}function pt(t){var n,e,a,r,c,o,i=t[2].longitude+"",s=t[2].latitude+"";return{c:function(){n=u("h1"),e=$("long: "),a=$(i),r=u("br"),c=$("lat: "),o=$(s),this.h()},l:function(t){n=f(t,"H1",{class:!0});var u=l(n);e=E(u,"long: "),a=E(u,i),r=f(u,"BR",{}),c=E(u,"lat: "),o=E(u,s),u.forEach(d),this.h()},h:function(){v(n,"class","svelte-9kdo4s")},m:function(t,i){h(t,n,i),p(n,e),p(n,a),p(n,r),p(n,c),p(n,o)},p:function(t,n){4&n&&i!==(i=t[2].longitude+"")&&O(a,i),4&n&&s!==(s=t[2].latitude+"")&&O(o,s)},d:function(t){t&&d(n)}}}function mt(t){var n,e,a=t[2].city+"";return{c:function(){n=u("h1"),e=$(a),this.h()},l:function(t){n=f(t,"H1",{class:!0});var r=l(n);e=E(r,a),r.forEach(d),this.h()},h:function(){v(n,"class","svelte-9kdo4s")},m:function(t,a){h(t,n,a),p(n,e)},p:function(t,n){4&n&&a!==(a=t[2].city+"")&&O(e,a)},d:function(t){t&&d(n)}}}function gt(t){var n,e,a;function r(t,e){return 24&e&&(n=null),null==n&&(n=!!(Math.abs(t[3].updated-t[4].updated)>6e5)),n?wt:_t}var c=r(t,-1),o=c(t),i=t[1]>=3e5&&yt(t);return{c:function(){o.c(),e=y(),i&&i.c(),a=b()},l:function(t){o.l(t),e=k(t),i&&i.l(t),a=b()},m:function(t,n){o.m(t,n),h(t,e,n),i&&i.m(t,n),h(t,a,n)},p:function(t,n){c===(c=r(t,n))&&o?o.p(t,n):(o.d(1),(o=c(t))&&(o.c(),o.m(e.parentNode,e))),t[1]>=3e5?i?i.p(t,n):((i=yt(t)).c(),i.m(a.parentNode,a)):i&&(i.d(1),i=null)},d:function(t){o.d(t),t&&d(e),i&&i.d(t),t&&d(a)}}}function _t(t){var n,e,a=t[0].toLocaleString("no-NO",{dateStyle:"medium",timeStyle:"short"})+"";return{c:function(){n=u("p"),e=$(a)},l:function(t){n=f(t,"P",{});var r=l(n);e=E(r,a),r.forEach(d)},m:function(t,a){h(t,n,a),p(n,e)},p:function(t,n){1&n&&a!==(a=t[0].toLocaleString("no-NO",{dateStyle:"medium",timeStyle:"short"})+"")&&O(e,a)},d:function(t){t&&d(n)}}}function wt(t){var n,e;return{c:function(){n=u("p"),e=$("There is more than 10 minutes difference between data updates")},l:function(t){n=f(t,"P",{});var a=l(n);e=E(a,"There is more than 10 minutes difference between data updates"),a.forEach(d)},m:function(t,a){h(t,n,a),p(n,e)},p:m,d:function(t){t&&d(n)}}}function yt(t){var n,e,a,r,c,o=Math.round(t[1]/60/1e3)+"";return{c:function(){n=u("span"),e=u("i"),a=$(" Data is "),r=$(o),c=$(" minutes old!"),this.h()},l:function(t){n=f(t,"SPAN",{style:!0});var i=l(n);e=f(i,"I",{class:!0}),l(e).forEach(d),a=E(i," Data is "),r=E(i,o),c=E(i," minutes old!"),i.forEach(d),this.h()},h:function(){v(e,"class","symbol fas fa-exclamation-circle"),D(n,"color","red")},m:function(t,o){h(t,n,o),p(n,e),p(n,a),p(n,r),p(n,c)},p:function(t,n){2&n&&o!==(o=Math.round(t[1]/60/1e3)+"")&&O(r,o)},d:function(t){t&&d(n)}}}function bt(t){var n,e,a,r,c,o,i,s,g,_,w,b,D=t[4].now.kp+"",I=t[4].now.kp_max+"",R=t[4].now.kp_min+"";return{c:function(){n=u("h2"),e=$("KP "),a=$(D),r=y(),c=u("p"),o=u("span"),i=$("↑ KP "),s=$(I),g=y(),_=u("span"),w=$("↓ KP "),b=$(R),this.h()},l:function(t){n=f(t,"H2",{class:!0});var u=l(n);e=E(u,"KP "),a=E(u,D),u.forEach(d),r=k(t),c=f(t,"P",{});var v=l(c);o=f(v,"SPAN",{classname:!0});var h=l(o);i=E(h,"↑ KP "),s=E(h,I),h.forEach(d),g=k(v),_=f(v,"SPAN",{classname:!0});var p=l(_);w=E(p,"↓ KP "),b=E(p,R),p.forEach(d),v.forEach(d),this.h()},h:function(){v(n,"class","svelte-9kdo4s"),v(o,"classname","pr-2"),v(_,"classname","pl-2")},m:function(t,u){h(t,n,u),p(n,e),p(n,a),h(t,r,u),h(t,c,u),p(c,o),p(o,i),p(o,s),p(c,g),p(c,_),p(_,w),p(_,b)},p:function(t,n){16&n&&D!==(D=t[4].now.kp+"")&&O(a,D),16&n&&I!==(I=t[4].now.kp_max+"")&&O(s,I),16&n&&R!==(R=t[4].now.kp_min+"")&&O(b,R)},i:m,o:m,d:function(t){t&&d(n),t&&d(r),t&&d(c)}}}function kt(t){var n,e;return n=new Q({}),{c:function(){T(n.$$.fragment)},l:function(t){q(n.$$.fragment,t)},m:function(t,a){M(n,t,a),e=!0},p:m,i:function(t){e||(V(n.$$.fragment,t),e=!0)},o:function(t){j(n.$$.fragment,t),e=!1},d:function(t){B(n,t)}}}function $t(t){var n,e,a,r,c,o,i,s,m,g,_,w,D,I,R,j=t[4].now.bz+"",P=t[4].now.bt+"",V=t[3].available&&Et(t);return{c:function(){n=u("div"),e=u("p"),a=$("BZ"),r=y(),c=u("p"),o=$(j),i=y(),s=u("div"),m=u("p"),g=$("BT"),_=y(),w=u("p"),D=$(P),I=y(),V&&V.c(),R=b(),this.h()},l:function(t){n=f(t,"DIV",{});var u=l(n);e=f(u,"P",{class:!0});var v=l(e);a=E(v,"BZ"),v.forEach(d),r=k(u),c=f(u,"P",{class:!0});var h=l(c);o=E(h,j),h.forEach(d),u.forEach(d),i=k(t),s=f(t,"DIV",{});var p=l(s);m=f(p,"P",{class:!0});var y=l(m);g=E(y,"BT"),y.forEach(d),_=k(p),w=f(p,"P",{class:!0});var $=l(w);D=E($,P),$.forEach(d),p.forEach(d),I=k(t),V&&V.l(t),R=b(),this.h()},h:function(){v(e,"class","svelte-9kdo4s"),v(c,"class","svelte-9kdo4s"),v(m,"class","svelte-9kdo4s"),v(w,"class","svelte-9kdo4s")},m:function(t,u){h(t,n,u),p(n,e),p(e,a),p(n,r),p(n,c),p(c,o),h(t,i,u),h(t,s,u),p(s,m),p(m,g),p(s,_),p(s,w),p(w,D),h(t,I,u),V&&V.m(t,u),h(t,R,u)},p:function(t,n){16&n&&j!==(j=t[4].now.bz+"")&&O(o,j),16&n&&P!==(P=t[4].now.bt+"")&&O(D,P),t[3].available?V?V.p(t,n):((V=Et(t)).c(),V.m(R.parentNode,R)):V&&(V.d(1),V=null)},d:function(t){t&&d(n),t&&d(i),t&&d(s),t&&d(I),V&&V.d(t),t&&d(R)}}}function Et(t){var n,e,a,r,c,o,i,s,m,g,_,w,b,D,I,R=t[3].now.temp+"",j=t[3].now.clouds+"";return{c:function(){n=u("div"),e=u("p"),a=$("Temp"),r=y(),c=u("p"),o=$(R),i=$("°C"),s=y(),m=u("div"),g=u("p"),_=$("Clouds"),w=y(),b=u("p"),D=$(j),I=$("%"),this.h()},l:function(t){n=f(t,"DIV",{});var u=l(n);e=f(u,"P",{class:!0});var v=l(e);a=E(v,"Temp"),v.forEach(d),r=k(u),c=f(u,"P",{class:!0});var h=l(c);o=E(h,R),i=E(h,"°C"),h.forEach(d),u.forEach(d),s=k(t),m=f(t,"DIV",{});var p=l(m);g=f(p,"P",{class:!0});var y=l(g);_=E(y,"Clouds"),y.forEach(d),w=k(p),b=f(p,"P",{class:!0});var $=l(b);D=E($,j),I=E($,"%"),$.forEach(d),p.forEach(d),this.h()},h:function(){v(e,"class","svelte-9kdo4s"),v(c,"class","svelte-9kdo4s"),v(g,"class","svelte-9kdo4s"),v(b,"class","svelte-9kdo4s")},m:function(t,u){h(t,n,u),p(n,e),p(e,a),p(n,r),p(n,c),p(c,o),p(c,i),h(t,s,u),h(t,m,u),p(m,g),p(g,_),p(m,w),p(m,b),p(b,D),p(b,I)},p:function(t,n){8&n&&R!==(R=t[3].now.temp+"")&&O(o,R),8&n&&j!==(j=t[3].now.clouds+"")&&O(D,j)},d:function(t){t&&d(n),t&&d(s),t&&d(m)}}}function Dt(t){var n,e,a,r,c,o,i,s,m,g,_,w,b=!t[2].updating&&t[2].available&&!t[3].updating&&!t[4].updating&&ht(t),$=!t[3].updating&&!t[4].updating&&gt(t),E=[kt,bt],D=[];function O(t,n){return t[4].updating||t[3].updating?0:1}s=O(t),m=D[s]=E[s](t);var x=!t[4].updating&&!t[3].updating&&$t(t);return{c:function(){n=u("div"),e=u("div"),a=u("div"),b&&b.c(),r=y(),c=u("div"),$&&$.c(),o=y(),i=u("div"),m.c(),g=y(),_=u("div"),x&&x.c(),this.h()},l:function(t){n=f(t,"DIV",{class:!0});var s=l(n);e=f(s,"DIV",{class:!0});var u=l(e);a=f(u,"DIV",{class:!0});var v=l(a);b&&b.l(v),v.forEach(d),r=k(u),c=f(u,"DIV",{class:!0});var h=l(c);$&&$.l(h),h.forEach(d),o=k(u),i=f(u,"DIV",{class:!0});var p=l(i);m.l(p),p.forEach(d),g=k(u),_=f(u,"DIV",{class:!0});var w=l(_);x&&x.l(w),w.forEach(d),u.forEach(d),s.forEach(d),this.h()},h:function(){v(a,"class","weatherCurrent-data-location svelte-9kdo4s"),v(c,"class","weatherCurrent-data-date"),v(i,"class","weatherCurrent-data-kp svelte-9kdo4s"),v(_,"class","current-details svelte-9kdo4s"),v(e,"class","weatherCurrent-data svelte-9kdo4s"),v(n,"class","weatherCurrent-wrapper svelte-9kdo4s")},m:function(t,u){h(t,n,u),p(n,e),p(e,a),b&&b.m(a,null),p(e,r),p(e,c),$&&$.m(c,null),p(e,o),p(e,i),D[s].m(i,null),p(e,g),p(e,_),x&&x.m(_,null),w=!0},p:function(t,n){var e=I(n,1)[0];t[2].updating||!t[2].available||t[3].updating||t[4].updating?b&&(b.d(1),b=null):b?b.p(t,e):((b=ht(t)).c(),b.m(a,null)),t[3].updating||t[4].updating?$&&($.d(1),$=null):$?$.p(t,e):(($=gt(t)).c(),$.m(c,null));var r=s;(s=O(t))===r?D[s].p(t,e):(R(),j(D[r],1,1,(function(){D[r]=null})),P(),(m=D[s])?m.p(t,e):(m=D[s]=E[s](t)).c(),V(m,1),m.m(i,null)),t[4].updating||t[3].updating?x&&(x.d(1),x=null):x?x.p(t,e):((x=$t(t)).c(),x.m(_,null))},i:function(t){w||(V(m),w=!0)},o:function(t){j(m),w=!1},d:function(t){t&&d(n),b&&b.d(),$&&$.d(),D[s].d(),x&&x.d()}}}function Ot(t,n,e){var a,r,c;x(t,rt,(function(t){return e(2,a=t)})),x(t,ct,(function(t){return e(3,r=t)})),x(t,ot,(function(t){return e(4,c=t)}));var o=new Date(0,0,0),i=0;return setInterval((function(){var t=w(ct).updated,n=w(ot).updated,a=new Date;a-n>a-t?(e(0,o=n),e(1,i=a-n)):(e(0,o=t),e(1,i=a-t))}),500),[o,i,a,r,c]}ft(),rt.subscribe((async function(t=null){if("undefined"==typeof window)return;if(null===t)return;if(t.updating)return;if(!t.available)return ct.update((t=>Object.assign(Object.assign({},t),{available:!1}))),void dt(ct,!1);if(w(ct).available&&Date.now()-w(ct).updated<3e5)return;dt(ct,!0);let n=await fetch(`https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=${t.latitude}&lon=${t.longitude}`),e=await n.json(),a={clouds:null,temp:null};try{a.clouds=e.properties.timeseries[0].data.instant.details.cloud_area_fraction,a.temp=e.properties.timeseries[0].data.instant.details.air_temperature,e.properties.timeseries=e.properties.timeseries.map((t=>Object.assign(Object.assign({},t),{time:X(t.time)})))}catch(t){return console.error(t),void dt(ct,!1,!1)}ct.update((t=>Object.assign(Object.assign({},t),{yr_data_raw:e,now:a,available:!0}))),dt(ct,!1)})),lt(),setInterval(ft,15e4),setInterval(lt,15e4),rt.subscribe((t=>it("navigator_location",t))),ct.subscribe((t=>it("earth_weather",t))),ot.subscribe((t=>it("space_weather",t)));var It=function(n){t(u,s);var e=vt(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,Ot,Dt,c,{}),n}return i(u)}();function Rt(t,n,e,a,r,c,o){try{var i=t[c](o),s=i.value}catch(t){return void e(t)}i.done?n(s):Promise.resolve(s).then(a,r)}function jt(t){return function(){var n=this,e=arguments;return new Promise((function(a,r){var c=t.apply(n,e);function o(t){Rt(c,a,r,o,i,"next",t)}function i(t){Rt(c,a,r,o,i,"throw",t)}o(void 0)}))}}function Pt(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function Vt(t){var n,e,a=t[1].default,r=S(a,t,t[0],null);return{c:function(){n=u("div"),r&&r.c(),this.h()},l:function(t){n=f(t,"DIV",{class:!0});var e=l(n);r&&r.l(e),e.forEach(d),this.h()},h:function(){v(n,"class","chip svelte-1jb0ny7")},m:function(t,a){h(t,n,a),r&&r.m(n,null),e=!0},p:function(t,n){var c=I(n,1)[0];r&&r.p&&(!e||1&c)&&N(r,a,t,t[0],e?A(a,t[0],c,null):C(t[0]),null)},i:function(t){e||(V(r,t),e=!0)},o:function(t){j(r,t),e=!1},d:function(t){t&&d(n),r&&r.d(t)}}}function xt(t,n,e){var a=n.$$slots,r=void 0===a?{}:a,c=n.$$scope;return t.$$set=function(t){"$$scope"in t&&e(0,c=t.$$scope)},[c,r]}var Tt=function(n){t(u,s);var e=Pt(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,xt,Vt,c,{}),n}return i(u)}();function qt(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function Mt(t){var n,e,a,r,c,o;return{c:function(){n=u("div"),e=u("div"),a=u("div"),r=y(),c=u("span"),o=$(t[1]),this.h()},l:function(i){n=f(i,"DIV",{class:!0,style:!0});var s=l(n);e=f(s,"DIV",{class:!0});var u=l(e);a=f(u,"DIV",{class:!0}),l(a).forEach(d),u.forEach(d),r=k(s),c=f(s,"SPAN",{class:!0});var v=l(c);o=E(v,t[1]),v.forEach(d),s.forEach(d),this.h()},h:function(){v(a,"class","bar svelte-1mo8cjf"),v(e,"class","bar-wrapper svelte-1mo8cjf"),v(c,"class","value svelte-1mo8cjf"),v(n,"class","wrapper svelte-1mo8cjf"),D(n,"--progress",100*t[0]+"%")},m:function(t,i){h(t,n,i),p(n,e),p(e,a),p(n,r),p(n,c),p(c,o)},p:function(t,e){var a=I(e,1)[0];2&a&&O(o,t[1]),1&a&&D(n,"--progress",100*t[0]+"%")},i:m,o:m,d:function(t){t&&d(n)}}}function Bt(t,n,e){var a=n.percentage,r=n.value;return t.$$set=function(t){"percentage"in t&&e(0,a=t.percentage),"value"in t&&e(1,r=t.value)},[a,r]}var St=function(n){t(u,s);var e=qt(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,Bt,Mt,c,{percentage:0,value:1}),n}return i(u)}();function Nt(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function Ct(t){var n,e,a,r,c,o,i,s,g,_,w,b,D;_=new St({props:{percentage:t[0]/9,value:t[0]}});var O=t[5]&&function(t){var n,e,a,r,c,o,i,s,g,_,w,b,D=Math.round(t[3])+"",O=Math.round(t[4])+"";return{c:function(){n=u("div"),e=u("p"),a=u("i"),r=y(),c=$(D),o=$("°C"),i=y(),s=u("p"),g=u("i"),_=y(),w=$(O),b=$("%"),this.h()},l:function(t){n=f(t,"DIV",{class:!0});var u=l(n);e=f(u,"P",{class:!0});var v=l(e);a=f(v,"I",{class:!0}),l(a).forEach(d),r=k(v),c=E(v,D),o=E(v,"°C"),v.forEach(d),i=k(u),s=f(u,"P",{class:!0});var h=l(s);g=f(h,"I",{class:!0}),l(g).forEach(d),_=k(h),w=E(h,O),b=E(h,"%"),h.forEach(d),u.forEach(d),this.h()},h:function(){v(a,"class","fas fa-thermometer-half svelte-m9qkku"),v(e,"class","svelte-m9qkku"),v(g,"class","fas fa-cloud svelte-m9qkku"),v(s,"class","svelte-m9qkku"),v(n,"class","svelte-m9qkku")},m:function(t,u){h(t,n,u),p(n,e),p(e,a),p(e,r),p(e,c),p(e,o),p(n,i),p(n,s),p(s,g),p(s,_),p(s,w),p(s,b)},p:m,d:function(t){t&&d(n)}}}(t);return{c:function(){n=u("div"),e=u("div"),a=u("h3"),r=$(t[2]),c=y(),o=u("p"),i=$(t[1]),s=y(),g=u("div"),T(_.$$.fragment),w=y(),b=u("div"),O&&O.c(),this.h()},l:function(u){n=f(u,"DIV",{class:!0});var v=l(n);e=f(v,"DIV",{class:!0});var h=l(e);a=f(h,"H3",{class:!0});var p=l(a);r=E(p,t[2]),p.forEach(d),c=k(h),o=f(h,"P",{class:!0});var m=l(o);i=E(m,t[1]),m.forEach(d),h.forEach(d),s=k(v),g=f(v,"DIV",{class:!0});var y=l(g);q(_.$$.fragment,y),y.forEach(d),w=k(v),b=f(v,"DIV",{class:!0});var $=l(b);O&&O.l($),$.forEach(d),v.forEach(d),this.h()},h:function(){v(a,"class","svelte-m9qkku"),v(o,"class","svelte-m9qkku"),v(e,"class","svelte-m9qkku"),v(g,"class","KP svelte-m9qkku"),v(b,"class","data svelte-m9qkku"),v(n,"class","prediction-details svelte-m9qkku")},m:function(t,u){h(t,n,u),p(n,e),p(e,a),p(a,r),p(e,c),p(e,o),p(o,i),p(n,s),p(n,g),M(_,g,null),p(n,w),p(n,b),O&&O.m(b,null),D=!0},p:function(t,n){var e=I(n,1)[0];t[5]&&O.p(t,e)},i:function(t){D||(V(_.$$.fragment,t),D=!0)},o:function(t){j(_.$$.fragment,t),D=!1},d:function(t){t&&d(n),B(_),O&&O.d()}}}function At(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,e=t,a=0;a<n-t.length;a++)e="0"+e;return e}function Jt(t,n,e){var a=n.prediction,r=a.kp,c=a.time.getDate()+". "+["January","February","March","April","May","June","July","August","September","October","November","December"][a.time.getMonth()],o=At(a.time.getHours().toString())+":"+At(a.time.getMinutes().toString()),i=a.temp,s=a.clouds,u=a.hasNOMETData;return t.$$set=function(t){"prediction"in t&&e(6,a=t.prediction)},[r,c,o,i,s,u,a]}var Ht=function(n){t(u,s);var e=Nt(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,Jt,Ct,c,{prediction:6}),n}return i(u)}();function Kt(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function zt(t,n,e){var a=t.slice();return a[5]=n[e],a[7]=e,a}function Lt(t){var n,e;return n=new Ht({props:{prediction:t[5]}}),{c:function(){T(n.$$.fragment)},l:function(t){q(n.$$.fragment,t)},m:function(t,a){M(n,t,a),e=!0},p:function(t,e){var a={};1&e&&(a.prediction=t[5]),n.$set(a)},i:function(t){e||(V(n.$$.fragment,t),e=!0)},o:function(t){j(n.$$.fragment,t),e=!1},d:function(t){B(n,t)}}}function Zt(t){for(var n,e,a=t[0],r=[],c=0;c<a.length;c+=1)r[c]=Lt(zt(t,a,c));var o=function(t){return j(r[t],1,1,(function(){r[t]=null}))};return{c:function(){n=u("div");for(var t=0;t<r.length;t+=1)r[t].c();this.h()},l:function(t){n=f(t,"DIV",{class:!0});for(var e=l(n),a=0;a<r.length;a+=1)r[a].l(e);e.forEach(d),this.h()},h:function(){v(n,"class","prediction-table svelte-1uc0m3l")},m:function(t,a){h(t,n,a);for(var c=0;c<r.length;c+=1)r[c].m(n,null);e=!0},p:function(t,e){var c=I(e,1)[0];if(1&c){var i;for(a=t[0],i=0;i<a.length;i+=1){var s=zt(t,a,i);r[i]?(r[i].p(s,c),V(r[i],1)):(r[i]=Lt(s),r[i].c(),V(r[i],1),r[i].m(n,null))}for(R(),i=a.length;i<r.length;i+=1)o(i);P()}},i:function(t){if(!e){for(var n=0;n<a.length;n+=1)V(r[n]);e=!0}},o:function(t){r=r.filter(Boolean);for(var n=0;n<r.length;n+=1)j(r[n]);e=!1},d:function(t){t&&d(n),J(r,t)}}}function Ft(t,n,e){var a,r,c;function o(){return i.apply(this,arguments)}function i(){return(i=jt(H.mark((function t(){var n;return H.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r.updating&&!a.updating){t.next=3;break}return e(0,c=null),t.abrupt("return");case 3:n=r.usnoaa_data_raw.geospace_pred_est_kp_1_hour.filter((function(t){return t.model_prediction_time>=new Date})),e(0,c=n.map((function(t){return{time:t.model_prediction_time,kp:Math.round(t.k),temp:null,clouds:null,hasNOMETData:a.available}}))),a.available&&c.forEach((function(t,n){var r,o,i=new Date(0,0,0),s=!0;a.yr_data_raw.properties.timeseries.forEach((function(n,e){var a=new Date(n.time);if(Math.abs(a.getTime()-t.time.getTime())<Math.abs(i.getTime()-t.time.getTime())){if(Math.abs(a.getTime()-t.time.getTime())>18e6)return void(s=!1);i=a,r=n.data.instant.details.air_temperature,o=n.data.instant.details.cloud_area_fraction}})),e(0,c[n]=Object.assign(Object.assign({},c[n]),{temp:r,clouds:o,hasNOMETData:s}),c)}));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return x(t,ct,(function(t){return e(1,a=t)})),x(t,ot,(function(t){return e(2,r=t)})),ot.subscribe(o),ct.subscribe(o),[c]}var Gt=function(n){t(u,s);var e=Kt(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,Ft,Zt,c,{}),n}return i(u)}();function Qt(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function Ut(t){var n,e,a;return e=new Tt({props:{$$slots:{default:[Wt]},$$scope:{ctx:t}}}),{c:function(){n=u("div"),T(e.$$.fragment),this.h()},l:function(t){n=f(t,"DIV",{class:!0});var a=l(n);q(e.$$.fragment,a),a.forEach(d),this.h()},h:function(){v(n,"class","svelte-m9qkku")},m:function(t,r){h(t,n,r),M(e,n,null),a=!0},p:function(t,n){var a={};257&n&&(a.$$scope={dirty:n,ctx:t}),e.$set(a)},i:function(t){a||(V(e.$$.fragment,t),a=!0)},o:function(t){j(e.$$.fragment,t),a=!1},d:function(t){t&&d(n),B(e)}}}function Wt(t){var n,e=t[0].observed+"";return{c:function(){n=$(e)},l:function(t){n=E(t,e)},m:function(t,e){h(t,n,e)},p:function(t,a){1&a&&e!==(e=t[0].observed+"")&&O(n,e)},d:function(t){t&&d(n)}}}function Xt(t){var n,e,a,r,c,o,i,s,g,_,w,b,D,O,x="predicted"!=t[0].observed&&Ut(t);w=new St({props:{percentage:t[1]/9,value:t[1]}});var S=t[6]&&function(t){var n,e,a,r,c,o,i,s,g,_,w,b,D=Math.round(t[4])+"",O=Math.round(t[5])+"";return{c:function(){n=u("div"),e=u("p"),a=u("i"),r=y(),c=$(D),o=$("°C"),i=y(),s=u("p"),g=u("i"),_=y(),w=$(O),b=$("%"),this.h()},l:function(t){n=f(t,"DIV",{class:!0});var u=l(n);e=f(u,"P",{class:!0});var v=l(e);a=f(v,"I",{class:!0}),l(a).forEach(d),r=k(v),c=E(v,D),o=E(v,"°C"),v.forEach(d),i=k(u),s=f(u,"P",{class:!0});var h=l(s);g=f(h,"I",{class:!0}),l(g).forEach(d),_=k(h),w=E(h,O),b=E(h,"%"),h.forEach(d),u.forEach(d),this.h()},h:function(){v(a,"class","fas fa-thermometer-half svelte-m9qkku"),v(e,"class","svelte-m9qkku"),v(g,"class","fas fa-cloud svelte-m9qkku"),v(s,"class","svelte-m9qkku"),v(n,"class","svelte-m9qkku")},m:function(t,u){h(t,n,u),p(n,e),p(e,a),p(e,r),p(e,c),p(e,o),p(n,i),p(n,s),p(s,g),p(s,_),p(s,w),p(s,b)},p:m,d:function(t){t&&d(n)}}}(t);return{c:function(){n=u("div"),e=u("div"),a=u("h3"),r=$(t[3]),c=y(),o=u("p"),i=$(t[2]),s=y(),x&&x.c(),g=y(),_=u("div"),T(w.$$.fragment),b=y(),D=u("div"),S&&S.c(),this.h()},l:function(u){n=f(u,"DIV",{class:!0});var v=l(n);e=f(v,"DIV",{class:!0});var h=l(e);a=f(h,"H3",{class:!0});var p=l(a);r=E(p,t[3]),p.forEach(d),c=k(h),o=f(h,"P",{class:!0});var m=l(o);i=E(m,t[2]),m.forEach(d),h.forEach(d),s=k(v),x&&x.l(v),g=k(v),_=f(v,"DIV",{class:!0});var y=l(_);q(w.$$.fragment,y),y.forEach(d),b=k(v),D=f(v,"DIV",{class:!0});var $=l(D);S&&S.l($),$.forEach(d),v.forEach(d),this.h()},h:function(){v(a,"class","svelte-m9qkku"),v(o,"class","svelte-m9qkku"),v(e,"class","svelte-m9qkku"),v(_,"class","KP svelte-m9qkku"),v(D,"class","data svelte-m9qkku"),v(n,"class","prediction-details svelte-m9qkku")},m:function(t,u){h(t,n,u),p(n,e),p(e,a),p(a,r),p(e,c),p(e,o),p(o,i),p(n,s),x&&x.m(n,null),p(n,g),p(n,_),M(w,_,null),p(n,b),p(n,D),S&&S.m(D,null),O=!0},p:function(t,e){var a=I(e,1)[0];"predicted"!=t[0].observed?x?(x.p(t,a),1&a&&V(x,1)):((x=Ut(t)).c(),V(x,1),x.m(n,g)):x&&(R(),j(x,1,1,(function(){x=null})),P()),t[6]&&S.p(t,a)},i:function(t){O||(V(x),V(w.$$.fragment,t),O=!0)},o:function(t){j(x),j(w.$$.fragment,t),O=!1},d:function(t){t&&d(n),x&&x.d(),B(w),S&&S.d()}}}function Yt(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,e=t,a=0;a<n-t.length;a++)e="0"+e;return e}function tn(t,n,e){var a=n.prediction,r=a.kp,c=a.time.getDate()+". "+["January","February","March","April","May","June","July","August","September","October","November","December"][a.time.getMonth()],o=Yt(a.time.getHours().toString())+":"+Yt(a.time.getMinutes().toString()),i=a.temp,s=a.clouds,u=a.hasNOMETData;return t.$$set=function(t){"prediction"in t&&e(0,a=t.prediction)},[a,r,c,o,i,s,u]}var nn=function(n){t(u,s);var e=Qt(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,tn,Xt,c,{prediction:0}),n}return i(u)}();function en(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function an(t,n,e){var a=t.slice();return a[5]=n[e],a[7]=e,a}function rn(t){var n,e;return n=new nn({props:{prediction:t[5]}}),{c:function(){T(n.$$.fragment)},l:function(t){q(n.$$.fragment,t)},m:function(t,a){M(n,t,a),e=!0},p:function(t,e){var a={};1&e&&(a.prediction=t[5]),n.$set(a)},i:function(t){e||(V(n.$$.fragment,t),e=!0)},o:function(t){j(n.$$.fragment,t),e=!1},d:function(t){B(n,t)}}}function cn(t){for(var n,e,a=t[0],r=[],c=0;c<a.length;c+=1)r[c]=rn(an(t,a,c));var o=function(t){return j(r[t],1,1,(function(){r[t]=null}))};return{c:function(){n=u("div");for(var t=0;t<r.length;t+=1)r[t].c();this.h()},l:function(t){n=f(t,"DIV",{class:!0});for(var e=l(n),a=0;a<r.length;a+=1)r[a].l(e);e.forEach(d),this.h()},h:function(){v(n,"class","prediction-table svelte-1uc0m3l")},m:function(t,a){h(t,n,a);for(var c=0;c<r.length;c+=1)r[c].m(n,null);e=!0},p:function(t,e){var c=I(e,1)[0];if(1&c){var i;for(a=t[0],i=0;i<a.length;i+=1){var s=an(t,a,i);r[i]?(r[i].p(s,c),V(r[i],1)):(r[i]=rn(s),r[i].c(),V(r[i],1),r[i].m(n,null))}for(R(),i=a.length;i<r.length;i+=1)o(i);P()}},i:function(t){if(!e){for(var n=0;n<a.length;n+=1)V(r[n]);e=!0}},o:function(t){r=r.filter(Boolean);for(var n=0;n<r.length;n+=1)j(r[n]);e=!1},d:function(t){t&&d(n),J(r,t)}}}function on(t,n,e){var a,r,c;function o(){return i.apply(this,arguments)}function i(){return(i=jt(H.mark((function t(){var n;return H.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r.updating&&!a.updating){t.next=3;break}return e(0,c=null),t.abrupt("return");case 3:n=r.usnoaa_data_raw.noaa_planetary_k_index_forecast.filter((function(t){return"observed"!==t.observed})),e(0,c=n.map((function(t){return{time:t.time,kp:t.kp,observed:t.observed,temp:null,clouds:null,hasNOMETData:a.available}}))),a.available&&c.forEach((function(t,n){var r,o,i=new Date(0,0,0);a.yr_data_raw.properties.timeseries.forEach((function(n,e){var a=new Date(n.time);Math.abs(a.getTime()-t.time.getTime())<Math.abs(i.getTime()-t.time.getTime())&&(i=a,r=n.data.instant.details.air_temperature,o=n.data.instant.details.cloud_area_fraction)})),e(0,c[n]=Object.assign(Object.assign({},c[n]),{temp:r,clouds:o}),c)}));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return x(t,ct,(function(t){return e(1,a=t)})),x(t,ot,(function(t){return e(2,r=t)})),ot.subscribe(o),ct.subscribe(o),[c]}var sn=function(n){t(u,s);var e=en(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,on,cn,c,{}),n}return i(u)}();function un(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function fn(t){var n,e,a,r,c,o,i,s,m,g;return i=new St({props:{percentage:t[0]/9,value:t[0]}}),{c:function(){n=u("div"),e=u("div"),a=u("h3"),r=$(t[1]),c=y(),o=u("div"),T(i.$$.fragment),s=y(),m=u("div"),this.h()},l:function(u){n=f(u,"DIV",{class:!0});var v=l(n);e=f(v,"DIV",{class:!0});var h=l(e);a=f(h,"H3",{class:!0});var p=l(a);r=E(p,t[1]),p.forEach(d),h.forEach(d),c=k(v),o=f(v,"DIV",{class:!0});var g=l(o);q(i.$$.fragment,g),g.forEach(d),s=k(v),m=f(v,"DIV",{class:!0}),l(m).forEach(d),v.forEach(d),this.h()},h:function(){v(a,"class","svelte-m9qkku"),v(e,"class","svelte-m9qkku"),v(o,"class","KP svelte-m9qkku"),v(m,"class","data svelte-m9qkku"),v(n,"class","prediction-details svelte-m9qkku")},m:function(t,u){h(t,n,u),p(n,e),p(e,a),p(a,r),p(n,c),p(n,o),M(i,o,null),p(n,s),p(n,m),g=!0},p:function(t,n){I(n,1)[0]},i:function(t){g||(V(i.$$.fragment,t),g=!0)},o:function(t){j(i.$$.fragment,t),g=!1},d:function(t){t&&d(n),B(i)}}}function ln(t){for(var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,e=t,a=0;a<n-t.length;a++)e="0"+e;return e}function dn(t,n,e){var a=n.prediction,r=a.kp,c=a.time.getDate()+". "+["January","February","March","April","May","June","July","August","September","October","November","December"][a.time.getMonth()];ln(a.time.getHours().toString()),ln(a.time.getMinutes().toString());var o=a.temp,i=a.clouds;return t.$$set=function(t){"prediction"in t&&e(4,a=t.prediction)},[r,c,o,i,a]}var vn=function(n){t(u,s);var e=un(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,dn,fn,c,{prediction:4}),n}return i(u)}();function hn(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function pn(t,n,e){var a=t.slice();return a[5]=n[e],a[7]=e,a}function mn(t){var n,e;return n=new vn({props:{prediction:t[5]}}),{c:function(){T(n.$$.fragment)},l:function(t){q(n.$$.fragment,t)},m:function(t,a){M(n,t,a),e=!0},p:function(t,e){var a={};1&e&&(a.prediction=t[5]),n.$set(a)},i:function(t){e||(V(n.$$.fragment,t),e=!0)},o:function(t){j(n.$$.fragment,t),e=!1},d:function(t){B(n,t)}}}function gn(t){for(var n,e,a=t[0],r=[],c=0;c<a.length;c+=1)r[c]=mn(pn(t,a,c));var o=function(t){return j(r[t],1,1,(function(){r[t]=null}))};return{c:function(){n=u("div");for(var t=0;t<r.length;t+=1)r[t].c();this.h()},l:function(t){n=f(t,"DIV",{class:!0});for(var e=l(n),a=0;a<r.length;a+=1)r[a].l(e);e.forEach(d),this.h()},h:function(){v(n,"class","prediction-table svelte-1uc0m3l")},m:function(t,a){h(t,n,a);for(var c=0;c<r.length;c+=1)r[c].m(n,null);e=!0},p:function(t,e){var c=I(e,1)[0];if(1&c){var i;for(a=t[0],i=0;i<a.length;i+=1){var s=pn(t,a,i);r[i]?(r[i].p(s,c),V(r[i],1)):(r[i]=mn(s),r[i].c(),V(r[i],1),r[i].m(n,null))}for(R(),i=a.length;i<r.length;i+=1)o(i);P()}},i:function(t){if(!e){for(var n=0;n<a.length;n+=1)V(r[n]);e=!0}},o:function(t){r=r.filter(Boolean);for(var n=0;n<r.length;n+=1)j(r[n]);e=!1},d:function(t){t&&d(n),J(r,t)}}}function _n(t,n,e){var a,r,c;function o(){return i.apply(this,arguments)}function i(){return(i=jt(H.mark((function t(){var n;return H.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!r.updating&&!a.updating){t.next=3;break}return e(0,c=null),t.abrupt("return");case 3:n=r.usnoaa_data_raw.outlook_27_day.filter((function(t){return t.time>=new Date})),e(0,c=n.map((function(t){return{time:t.time,kp:t.kindex,temp:null,clouds:null,hasNOMETData:a.available}}))),a.available&&c.forEach((function(t,n){var r,o,i=new Date(0,0,0),s=!0;a.yr_data_raw.properties.timeseries.forEach((function(n,e){var a=new Date(n.time);if(Math.abs(a.getTime()-t.time.getTime())<Math.abs(i.getTime()-t.time.getTime())){if(Math.abs(a.getTime()-t.time.getTime())>864e5)return void(s=!1);i=a,r=n.data.instant.details.air_temperature,o=n.data.instant.details.cloud_area_fraction}})),e(0,c[n]=Object.assign(Object.assign({},c[n]),{temp:r,clouds:o,hasNOMETData:s}),c)}));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return x(t,ct,(function(t){return e(1,a=t)})),x(t,ot,(function(t){return e(2,r=t)})),ot.subscribe(o),ct.subscribe(o),[c]}var wn=function(n){t(u,s);var e=hn(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,_n,gn,c,{}),n}return i(u)}();function yn(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function bn(t){var n,e,a,r,c;return{c:function(){n=u("div"),e=u("i"),a=y(),r=u("p"),c=$("No prediction data"),this.h()},l:function(t){n=f(t,"DIV",{class:!0});var o=l(n);e=f(o,"I",{class:!0}),l(e).forEach(d),a=k(o),r=f(o,"P",{});var i=l(r);c=E(i,"No prediction data"),i.forEach(d),o.forEach(d),this.h()},h:function(){v(e,"class","fas fa-7x fa-exclamation-triangle"),v(n,"class","no-data svelte-11gsg4a")},m:function(t,o){h(t,n,o),p(n,e),p(n,a),p(n,r),p(r,c)},p:m,i:m,o:m,d:function(t){t&&d(n)}}}function kn(t){var n,e,a,r,c,o,i,s,m,g,_,w,D,O,I,x,S,N,C,A=t[0];return A&&(I=new A({})),{c:function(){n=u("div"),e=u("h2"),a=$("Forecast"),r=y(),c=u("div"),o=u("div"),i=$("hour"),s=y(),m=u("div"),g=$("3 day"),_=y(),w=u("div"),D=$("Longterm"),O=y(),I&&T(I.$$.fragment),x=b(),this.h()},l:function(t){n=f(t,"DIV",{class:!0});var u=l(n);e=f(u,"H2",{class:!0});var v=l(e);a=E(v,"Forecast"),v.forEach(d),r=k(u),c=f(u,"DIV",{class:!0});var h=l(c);o=f(h,"DIV",{class:!0});var p=l(o);i=E(p,"hour"),p.forEach(d),s=k(h),m=f(h,"DIV",{class:!0});var y=l(m);g=E(y,"3 day"),y.forEach(d),_=k(h),w=f(h,"DIV",{class:!0});var $=l(w);D=E($,"Longterm"),$.forEach(d),h.forEach(d),u.forEach(d),O=k(t),I&&q(I.$$.fragment,t),x=b(),this.h()},h:function(){v(e,"class","svelte-11gsg4a"),v(o,"class","svelte-11gsg4a"),K(o,"selected",t[0]==Gt),v(m,"class","svelte-11gsg4a"),K(m,"selected",t[0]==sn),v(w,"class","svelte-11gsg4a"),K(w,"selected",t[0]==wn),v(c,"class","version-picker svelte-11gsg4a"),v(n,"class","header svelte-11gsg4a")},m:function(u,f){h(u,n,f),p(n,e),p(e,a),p(n,r),p(n,c),p(c,o),p(o,i),p(c,s),p(c,m),p(m,g),p(c,_),p(c,w),p(w,D),h(u,O,f),I&&M(I,u,f),h(u,x,f),S=!0,N||(C=[z(o,"click",t[3]),z(m,"click",t[4]),z(w,"click",t[5])],N=!0)},p:function(t,n){if(1&n&&K(o,"selected",t[0]==Gt),1&n&&K(m,"selected",t[0]==sn),1&n&&K(w,"selected",t[0]==wn),A!==(A=t[0])){if(I){R();var e=I;j(e.$$.fragment,1,0,(function(){B(e,1)})),P()}A?(I=new A({}),T(I.$$.fragment),V(I.$$.fragment,1),M(I,x.parentNode,x)):I=null}},i:function(t){S||(I&&V(I.$$.fragment,t),S=!0)},o:function(t){I&&j(I.$$.fragment,t),S=!1},d:function(t){t&&d(n),t&&d(O),t&&d(x),I&&B(I,t),N=!1,L(C)}}}function $n(t){var n,e,a,r,c=[kn,bn],o=[];function i(t,n){return t[1].updating||t[2].updating?1:0}return e=i(t),a=o[e]=c[e](t),{c:function(){n=u("div"),a.c(),this.h()},l:function(t){n=f(t,"DIV",{class:!0});var e=l(n);a.l(e),e.forEach(d),this.h()},h:function(){v(n,"class","drawer svelte-11gsg4a")},m:function(t,a){h(t,n,a),o[e].m(n,null),r=!0},p:function(t,r){var s=I(r,1)[0],u=e;(e=i(t))===u?o[e].p(t,s):(R(),j(o[u],1,1,(function(){o[u]=null})),P(),(a=o[e])?a.p(t,s):(a=o[e]=c[e](t)).c(),V(a,1),a.m(n,null))},i:function(t){r||(V(a),r=!0)},o:function(t){j(a),r=!1},d:function(t){t&&d(n),o[e].d()}}}function En(t,n,e){var a,r;x(t,ct,(function(t){return e(1,a=t)})),x(t,ot,(function(t){return e(2,r=t)}));var c=sn;return[c,a,r,function(){return e(0,c=Gt)},function(){return e(0,c=sn)},function(){return e(0,c=wn)}]}var Dn=function(n){t(u,s);var e=yn(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,En,$n,c,{}),n}return i(u)}();function On(t){var a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var r,c=n(t);if(a){var o=n(this).constructor;r=Reflect.construct(c,arguments,o)}else r=c.apply(this,arguments);return e(this,r)}}function In(t){var n,e,a,r,c,o;return a=new It({}),c=new Dn({}),{c:function(){n=y(),e=u("div"),T(a.$$.fragment),r=y(),T(c.$$.fragment),this.h()},l:function(t){Z('[data-svelte="svelte-1q3846k"]',document.head).forEach(d),n=k(t),e=f(t,"DIV",{class:!0});var o=l(e);q(a.$$.fragment,o),r=k(o),q(c.$$.fragment,o),o.forEach(d),this.h()},h:function(){document.title="Aurora data",v(e,"class","homescreen svelte-pf4p6y")},m:function(t,i){h(t,n,i),h(t,e,i),M(a,e,null),p(e,r),M(c,e,null),o=!0},p:m,i:function(t){o||(V(a.$$.fragment,t),V(c.$$.fragment,t),o=!0)},o:function(t){j(a.$$.fragment,t),j(c.$$.fragment,t),o=!1},d:function(t){t&&d(n),t&&d(e),B(a),B(c)}}}var Rn=function(n){t(u,s);var e=On(u);function u(t){var n;return a(this,u),n=e.call(this),r(o(n),t,null,In,c,{}),n}return i(u)}();export{Rn as default};