diff options
Diffstat (limited to 'client/legacy/index.b9026ed4.js')
-rw-r--r-- | client/legacy/index.b9026ed4.js | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/client/legacy/index.b9026ed4.js b/client/legacy/index.b9026ed4.js deleted file mode 100644 index c33323c..0000000 --- a/client/legacy/index.b9026ed4.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 i,e as o,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,w as g,o as y,p as k,q as _,r as b,t as w,u as $,v as E,x as D,y as R,z as I,A as O,B as V,C as j,D as P,E as x,F as q,G as M,H as T,I as B,J as S,K as N,L as A,M as C,N as J,O as H,P as K,Q as z,R as F}from"./client.e32a6024.js";function L(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 i=n(this).constructor;r=Reflect.construct(c,arguments,i)}else r=c.apply(this,arguments);return e(this,r)}}function Z(t){var n,e,a,r,c,i,o,s,g;return{c:function(){n=u("div"),e=u("div"),a=u("div"),r=u("div"),c=u("div"),i=u("div"),o=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),i=f(u,"DIV",{class:!0}),l(i).forEach(d),o=f(u,"DIV",{class:!0}),l(o).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(i,"class","svelte-7k6qu0"),v(o,"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,i),p(n,o),p(n,s),p(n,g)},p:m,i:m,o:m,d:function(t){t&&d(n)}}}var G=function(n){t(u,s);var e=L(u);function u(t){var n;return a(this,u),n=e.call(this),r(i(n),t,null,Z,c,{}),n}return o(u)}(),Q={January:1,Feb:2,March:3,April:4,May:5,June:6,July:7,August:8,September:9,October:10,November:11,December:12};function U(t){return t=function(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}(Q[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)}(t),new Date(t)}const W=g("light");setInterval((function(){if("undefined"==typeof window)return;let t=window.matchMedia("(prefers-color-scheme:dark)").matches?"dark":"light";t!=y(W)&&W.set(t)}),1e3),W.subscribe((t=>{"undefined"!=typeof window&&("dark"==t?window.document.body.classList.add("dark"):window.document.body.classList.remove("dark"))}));const X={updated:!1,updating:!0},Y=g(Object.assign(Object.assign({},X),{available:!1,longitude:null,latitude:null,city:null})),tt=g(Object.assign(Object.assign({},X),{available:!1})),nt=g(Object.assign({},X));!async function(){if("undefined"==typeof window)return;let t;at(Y,!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){return console.log(t),Y.update((t=>Object.assign(Object.assign({},t),{available:!1,city:null,longitude:null,latitude:null}))),void at(Y,!1)}let n=await fetch(`https://geocode.xyz/${t.latitude},${t.longitude}?geoit=json`),e=await n.json();Y.update((n=>Object.assign(Object.assign(Object.assign({},n),{available:!0,city:e.city}),t))),at(Y,!1)}(),Y.subscribe((async function(t=null){if("undefined"==typeof window)return;if(null===t)return;if(t.updating)return;if(!t.available)return tt.update((t=>Object.assign(Object.assign({},t),{available:!1}))),void at(tt,!1);at(tt,!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:U(t.time)})))}catch(t){}tt.update((t=>Object.assign(Object.assign({},t),{yr_data_raw:e,now:a,available:!0}))),at(tt,!1)})),async function(){if("undefined"==typeof window)return;at(nt,!0);let 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");n.usnoaa_data_raw.solar_wind_mag_field=await e.json(),n.usnoaa_data_raw.solar_wind_mag_field.TimeStamp=U(n.usnoaa_data_raw.solar_wind_mag_field.TimeStamp),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:U(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:U(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"),n.usnoaa_data_raw.noaa_planetary_k_index_forecast=await e.json(),n.usnoaa_data_raw.noaa_planetary_k_index_forecast.shift();let a=new Date,r=new Date(0,0,0),c=1e3,i=0;return n.usnoaa_data_raw.noaa_planetary_k_index_forecast.forEach(((t,e)=>{t[1]>i&&(i=t[1]),t[1]<c&&(c=t[1]);let o=U(t[0]);Math.abs(o.getTime()-a.getTime())<Math.abs(r.getTime()-a.getTime())&&(r=o,n.now.kp=t[1]),n.usnoaa_data_raw.noaa_planetary_k_index_forecast[e]={time:o,kp:t[1],observed:t[2]}})),n.now.kp_min=c.toString(),n.now.kp_max=i.toString(),console.log(n),n}();nt.update((n=>Object.assign(Object.assign({},n),t))),at(nt,!1)}();const et=(t,n)=>{"undefined"!=typeof window&&localStorage.setItem(t,JSON.stringify(n))};function at(t,n=!1){let e=n?{}:{updated:new Date};t.update((t=>Object.assign(Object.assign(Object.assign({},t),e),{updating:n})))}function rt(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 i=n(this).constructor;r=Reflect.construct(c,arguments,i)}else r=c.apply(this,arguments);return e(this,r)}}function ct(t){var n,e,a;function r(t,n){return void 0!==t[0].city?ot:it}var c=r(t),i=c(t);return{c:function(){n=u("i"),e=k(),i.c(),a=_(),this.h()},l:function(t){n=f(t,"I",{class:!0}),l(n).forEach(d),e=b(t),i.l(t),a=_(),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),i.m(t,r),h(t,a,r)},p:function(t,n){c===(c=r(t))&&i?i.p(t,n):(i.d(1),(i=c(t))&&(i.c(),i.m(a.parentNode,a)))},d:function(t){t&&d(n),t&&d(e),i.d(t),t&&d(a)}}}function it(t){var n,e,a,r,c,i,o=t[0].longitude+"",s=t[0].latitude+"";return{c:function(){n=u("h1"),e=w("long: "),a=w(o),r=u("br"),c=w("lat: "),i=w(s),this.h()},l:function(t){n=f(t,"H1",{class:!0});var u=l(n);e=$(u,"long: "),a=$(u,o),r=f(u,"BR",{}),c=$(u,"lat: "),i=$(u,s),u.forEach(d),this.h()},h:function(){v(n,"class","svelte-9kdo4s")},m:function(t,o){h(t,n,o),p(n,e),p(n,a),p(n,r),p(n,c),p(n,i)},p:function(t,n){1&n&&o!==(o=t[0].longitude+"")&&E(a,o),1&n&&s!==(s=t[0].latitude+"")&&E(i,s)},d:function(t){t&&d(n)}}}function ot(t){var n,e,a=t[0].city+"";return{c:function(){n=u("h1"),e=w(a),this.h()},l:function(t){n=f(t,"H1",{class:!0});var r=l(n);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){1&n&&a!==(a=t[0].city+"")&&E(e,a)},d:function(t){t&&d(n)}}}function st(t){var n,e;function a(t,e){return 6&e&&(n=null),null==n&&(n=!!(Math.abs(t[1].updated-t[2].updated)>6e5)),n?ft:ut}var r=a(t,-1),c=r(t);return{c:function(){c.c(),e=_()},l:function(t){c.l(t),e=_()},m:function(t,n){c.m(t,n),h(t,e,n)},p:function(t,n){r===(r=a(t,n))&&c?c.p(t,n):(c.d(1),(c=r(t))&&(c.c(),c.m(e.parentNode,e)))},d:function(t){c.d(t),t&&d(e)}}}function ut(t){var n,e,a=t[1].updated.toLocaleString("no-NO",{dateStyle:"medium",timeStyle:"short"})+"";return{c:function(){n=u("p"),e=w(a)},l:function(t){n=f(t,"P",{});var r=l(n);e=$(r,a),r.forEach(d)},m:function(t,a){h(t,n,a),p(n,e)},p:function(t,n){2&n&&a!==(a=t[1].updated.toLocaleString("no-NO",{dateStyle:"medium",timeStyle:"short"})+"")&&E(e,a)},d:function(t){t&&d(n)}}}function ft(t){var n,e;return{c:function(){n=u("p"),e=w("There is more than 10 minutes difference between data updates")},l:function(t){n=f(t,"P",{});var a=l(n);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 lt(t){var n,e,a,r,c,i,o,s,g,y,_,D,R=t[2].now.kp+"",I=t[2].now.kp_max+"",O=t[2].now.kp_min+"";return{c:function(){n=u("h2"),e=w("KP "),a=w(R),r=k(),c=u("p"),i=u("span"),o=w("↑ KP "),s=w(I),g=k(),y=u("span"),_=w("↓ KP "),D=w(O),this.h()},l:function(t){n=f(t,"H2",{class:!0});var u=l(n);e=$(u,"KP "),a=$(u,R),u.forEach(d),r=b(t),c=f(t,"P",{});var v=l(c);i=f(v,"SPAN",{classname:!0});var h=l(i);o=$(h,"↑ KP "),s=$(h,I),h.forEach(d),g=b(v),y=f(v,"SPAN",{classname:!0});var p=l(y);_=$(p,"↓ KP "),D=$(p,O),p.forEach(d),v.forEach(d),this.h()},h:function(){v(n,"class","svelte-9kdo4s"),v(i,"classname","pr-2"),v(y,"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,i),p(i,o),p(i,s),p(c,g),p(c,y),p(y,_),p(y,D)},p:function(t,n){4&n&&R!==(R=t[2].now.kp+"")&&E(a,R),4&n&&I!==(I=t[2].now.kp_max+"")&&E(s,I),4&n&&O!==(O=t[2].now.kp_min+"")&&E(D,O)},i:m,o:m,d:function(t){t&&d(n),t&&d(r),t&&d(c)}}}function dt(t){var n,e;return n=new G({}),{c:function(){P(n.$$.fragment)},l:function(t){x(n.$$.fragment,t)},m:function(t,a){q(n,t,a),e=!0},p:m,i:function(t){e||(V(n.$$.fragment,t),e=!0)},o:function(t){I(n.$$.fragment,t),e=!1},d:function(t){M(n,t)}}}function vt(t){var n,e,a,r,c,i,o,s,m,g,y,D,R,I,O,V=t[2].now.bz+"",j=t[2].now.bt+"",P=t[1].available&&ht(t);return{c:function(){n=u("div"),e=u("p"),a=w("BZ"),r=k(),c=u("p"),i=w(V),o=k(),s=u("div"),m=u("p"),g=w("BT"),y=k(),D=u("p"),R=w(j),I=k(),P&&P.c(),O=_(),this.h()},l:function(t){n=f(t,"DIV",{});var u=l(n);e=f(u,"P",{class:!0});var v=l(e);a=$(v,"BZ"),v.forEach(d),r=b(u),c=f(u,"P",{class:!0});var h=l(c);i=$(h,V),h.forEach(d),u.forEach(d),o=b(t),s=f(t,"DIV",{});var p=l(s);m=f(p,"P",{class:!0});var k=l(m);g=$(k,"BT"),k.forEach(d),y=b(p),D=f(p,"P",{class:!0});var w=l(D);R=$(w,j),w.forEach(d),p.forEach(d),I=b(t),P&&P.l(t),O=_(),this.h()},h:function(){v(e,"class","svelte-9kdo4s"),v(c,"class","svelte-9kdo4s"),v(m,"class","svelte-9kdo4s"),v(D,"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,i),h(t,o,u),h(t,s,u),p(s,m),p(m,g),p(s,y),p(s,D),p(D,R),h(t,I,u),P&&P.m(t,u),h(t,O,u)},p:function(t,n){4&n&&V!==(V=t[2].now.bz+"")&&E(i,V),4&n&&j!==(j=t[2].now.bt+"")&&E(R,j),t[1].available?P?P.p(t,n):((P=ht(t)).c(),P.m(O.parentNode,O)):P&&(P.d(1),P=null)},d:function(t){t&&d(n),t&&d(o),t&&d(s),t&&d(I),P&&P.d(t),t&&d(O)}}}function ht(t){var n,e,a,r,c,i,o,s,m,g,y,_,D,R,I,O=t[1].now.temp+"",V=t[1].now.clouds+"";return{c:function(){n=u("div"),e=u("p"),a=w("Temp"),r=k(),c=u("p"),i=w(O),o=w("°C"),s=k(),m=u("div"),g=u("p"),y=w("Clouds"),_=k(),D=u("p"),R=w(V),I=w("%"),this.h()},l:function(t){n=f(t,"DIV",{});var u=l(n);e=f(u,"P",{class:!0});var v=l(e);a=$(v,"Temp"),v.forEach(d),r=b(u),c=f(u,"P",{class:!0});var h=l(c);i=$(h,O),o=$(h,"°C"),h.forEach(d),u.forEach(d),s=b(t),m=f(t,"DIV",{});var p=l(m);g=f(p,"P",{class:!0});var k=l(g);y=$(k,"Clouds"),k.forEach(d),_=b(p),D=f(p,"P",{class:!0});var w=l(D);R=$(w,V),I=$(w,"%"),w.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(D,"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,i),p(c,o),h(t,s,u),h(t,m,u),p(m,g),p(g,y),p(m,_),p(m,D),p(D,R),p(D,I)},p:function(t,n){2&n&&O!==(O=t[1].now.temp+"")&&E(i,O),2&n&&V!==(V=t[1].now.clouds+"")&&E(R,V)},d:function(t){t&&d(n),t&&d(s),t&&d(m)}}}function pt(t){var n,e,a,r,c,i,o,s,m,g,y,_,w=!t[0].updating&&t[0].available&&!t[1].updating&&!t[2].updating&&ct(t),$=!t[1].updating&&!t[2].updating&&st(t),E=[dt,lt],j=[];function P(t,n){return t[2].updating||t[1].updating?0:1}s=P(t),m=j[s]=E[s](t);var x=!t[2].updating&&!t[1].updating&&vt(t);return{c:function(){n=u("div"),e=u("div"),a=u("div"),w&&w.c(),r=k(),c=u("div"),$&&$.c(),i=k(),o=u("div"),m.c(),g=k(),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);w&&w.l(v),v.forEach(d),r=b(u),c=f(u,"DIV",{class:!0});var h=l(c);$&&$.l(h),h.forEach(d),i=b(u),o=f(u,"DIV",{class:!0});var p=l(o);m.l(p),p.forEach(d),g=b(u),y=f(u,"DIV",{class:!0});var k=l(y);x&&x.l(k),k.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(o,"class","weatherCurrent-data-kp svelte-9kdo4s"),v(y,"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),w&&w.m(a,null),p(e,r),p(e,c),$&&$.m(c,null),p(e,i),p(e,o),j[s].m(o,null),p(e,g),p(e,y),x&&x.m(y,null),_=!0},p:function(t,n){var e=D(n,1)[0];t[0].updating||!t[0].available||t[1].updating||t[2].updating?w&&(w.d(1),w=null):w?w.p(t,e):((w=ct(t)).c(),w.m(a,null)),t[1].updating||t[2].updating?$&&($.d(1),$=null):$?$.p(t,e):(($=st(t)).c(),$.m(c,null));var r=s;(s=P(t))===r?j[s].p(t,e):(R(),I(j[r],1,1,(function(){j[r]=null})),O(),(m=j[s])?m.p(t,e):(m=j[s]=E[s](t)).c(),V(m,1),m.m(o,null)),t[2].updating||t[1].updating?x&&(x.d(1),x=null):x?x.p(t,e):((x=vt(t)).c(),x.m(y,null))},i:function(t){_||(V(m),_=!0)},o:function(t){I(m),_=!1},d:function(t){t&&d(n),w&&w.d(),$&&$.d(),j[s].d(),x&&x.d()}}}function mt(t,n,e){var a,r,c;return j(t,Y,(function(t){return e(0,a=t)})),j(t,tt,(function(t){return e(1,r=t)})),j(t,nt,(function(t){return e(2,c=t)})),[a,r,c]}Y.subscribe((t=>et("navigator_location",t))),tt.subscribe((t=>et("earth_weather",t))),nt.subscribe((t=>et("space_weather",t)));var gt=function(n){t(u,s);var e=rt(u);function u(t){var n;return a(this,u),n=e.call(this),r(i(n),t,mt,pt,c,{}),n}return o(u)}();function yt(t,n,e,a,r,c,i){try{var o=t[c](i),s=o.value}catch(t){return void e(t)}o.done?n(s):Promise.resolve(s).then(a,r)}function kt(t){return function(){var n=this,e=arguments;return new Promise((function(a,r){var c=t.apply(n,e);function i(t){yt(c,a,r,i,o,"next",t)}function o(t){yt(c,a,r,i,o,"throw",t)}i(void 0)}))}}function _t(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 i=n(this).constructor;r=Reflect.construct(c,arguments,i)}else r=c.apply(this,arguments);return e(this,r)}}function bt(t){var n,e,a=t[1].default,r=T(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=D(n,1)[0];r&&r.p&&(!e||1&c)&&B(r,a,t,t[0],e?N(a,t[0],c,null):S(t[0]),null)},i:function(t){e||(V(r,t),e=!0)},o:function(t){I(r,t),e=!1},d:function(t){t&&d(n),r&&r.d(t)}}}function wt(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 $t=function(n){t(u,s);var e=_t(u);function u(t){var n;return a(this,u),n=e.call(this),r(i(n),t,wt,bt,c,{}),n}return o(u)}();function Et(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 i=n(this).constructor;r=Reflect.construct(c,arguments,i)}else r=c.apply(this,arguments);return e(this,r)}}function Dt(t){var n,e,a,r,c,i;return{c:function(){n=u("div"),e=u("div"),a=u("div"),r=k(),c=u("span"),i=w(t[1]),this.h()},l:function(o){n=f(o,"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=b(s),c=f(s,"SPAN",{class:!0});var v=l(c);i=$(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"),A(n,"--progress",100*t[0]+"%")},m:function(t,o){h(t,n,o),p(n,e),p(e,a),p(n,r),p(n,c),p(c,i)},p:function(t,e){var a=D(e,1)[0];2&a&&E(i,t[1]),1&a&&A(n,"--progress",100*t[0]+"%")},i:m,o:m,d:function(t){t&&d(n)}}}function Rt(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 It=function(n){t(u,s);var e=Et(u);function u(t){var n;return a(this,u),n=e.call(this),r(i(n),t,Rt,Dt,c,{percentage:0,value:1}),n}return o(u)}();function Ot(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 i=n(this).constructor;r=Reflect.construct(c,arguments,i)}else r=c.apply(this,arguments);return e(this,r)}}function Vt(t){var n,e,a,r,c,i,o,s,g,y,_,E,R;y=new It({props:{percentage:t[0]/9,value:t[0]}});var O=t[5]&&function(t){var n,e,a,r,c,i,o,s,g,y,_,E,D=Math.round(t[3])+"",R=Math.round(t[4])+"";return{c:function(){n=u("div"),e=u("p"),a=u("i"),r=k(),c=w(D),i=w("°C"),o=k(),s=u("p"),g=u("i"),y=k(),_=w(R),E=w("%"),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=b(v),c=$(v,D),i=$(v,"°C"),v.forEach(d),o=b(u),s=f(u,"P",{class:!0});var h=l(s);g=f(h,"I",{class:!0}),l(g).forEach(d),y=b(h),_=$(h,R),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,i),p(n,o),p(n,s),p(s,g),p(s,y),p(s,_),p(s,E)},p:m,d:function(t){t&&d(n)}}}(t);return{c:function(){n=u("div"),e=u("div"),a=u("h3"),r=w(t[2]),c=k(),i=u("p"),o=w(t[1]),s=k(),g=u("div"),P(y.$$.fragment),_=k(),E=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=$(p,t[2]),p.forEach(d),c=b(h),i=f(h,"P",{class:!0});var m=l(i);o=$(m,t[1]),m.forEach(d),h.forEach(d),s=b(v),g=f(v,"DIV",{class:!0});var k=l(g);x(y.$$.fragment,k),k.forEach(d),_=b(v),E=f(v,"DIV",{class:!0});var w=l(E);O&&O.l(w),w.forEach(d),v.forEach(d),this.h()},h:function(){v(a,"class","svelte-m9qkku"),v(i,"class","svelte-m9qkku"),v(e,"class","svelte-m9qkku"),v(g,"class","KP svelte-m9qkku"),v(E,"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,i),p(i,o),p(n,s),p(n,g),q(y,g,null),p(n,_),p(n,E),O&&O.m(E,null),R=!0},p:function(t,n){var e=D(n,1)[0];t[5]&&O.p(t,e)},i:function(t){R||(V(y.$$.fragment,t),R=!0)},o:function(t){I(y.$$.fragment,t),R=!1},d:function(t){t&&d(n),M(y),O&&O.d()}}}function jt(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 Pt(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()],i=jt(a.time.getHours().toString())+":"+jt(a.time.getMinutes().toString()),o=a.temp,s=a.clouds,u=a.hasNOMETData;return t.$$set=function(t){"prediction"in t&&e(6,a=t.prediction)},[r,c,i,o,s,u,a]}var xt=function(n){t(u,s);var e=Ot(u);function u(t){var n;return a(this,u),n=e.call(this),r(i(n),t,Pt,Vt,c,{prediction:6}),n}return o(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 i=n(this).constructor;r=Reflect.construct(c,arguments,i)}else r=c.apply(this,arguments);return e(this,r)}}function Mt(t,n,e){var a=t.slice();return a[5]=n[e],a[7]=e,a}function Tt(t){var n,e;return n=new xt({props:{prediction:t[5]}}),{c:function(){P(n.$$.fragment)},l:function(t){x(n.$$.fragment,t)},m:function(t,a){q(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){I(n.$$.fragment,t),e=!1},d:function(t){M(n,t)}}}function Bt(t){for(var n,e,a=t[0],r=[],c=0;c<a.length;c+=1)r[c]=Tt(Mt(t,a,c));var i=function(t){return I(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=D(e,1)[0];if(1&c){var o;for(a=t[0],o=0;o<a.length;o+=1){var s=Mt(t,a,o);r[o]?(r[o].p(s,c),V(r[o],1)):(r[o]=Tt(s),r[o].c(),V(r[o],1),r[o].m(n,null))}for(R(),o=a.length;o<r.length;o+=1)i(o);O()}},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)I(r[n]);e=!1},d:function(t){t&&d(n),C(r,t)}}}function St(t,n,e){var a,r,c;function i(){return o.apply(this,arguments)}function o(){return(o=kt(J.mark((function t(){var n;return J.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,i,o=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(o.getTime()-t.time.getTime())){if(Math.abs(a.getTime()-t.time.getTime())>18e6)return void(s=!1);o=a,r=n.data.instant.details.air_temperature,i=n.data.instant.details.cloud_area_fraction}})),e(0,c[n]=Object.assign(Object.assign({},c[n]),{temp:r,clouds:i,hasNOMETData:s}),c)}));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return j(t,tt,(function(t){return e(1,a=t)})),j(t,nt,(function(t){return e(2,r=t)})),nt.subscribe(i),tt.subscribe(i),[c]}var Nt=function(n){t(u,s);var e=qt(u);function u(t){var n;return a(this,u),n=e.call(this),r(i(n),t,St,Bt,c,{}),n}return o(u)}();function At(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 i=n(this).constructor;r=Reflect.construct(c,arguments,i)}else r=c.apply(this,arguments);return e(this,r)}}function Ct(t){var n,e,a;return e=new $t({props:{$$slots:{default:[Jt]},$$scope:{ctx:t}}}),{c:function(){n=u("div"),P(e.$$.fragment),this.h()},l:function(t){n=f(t,"DIV",{class:!0});var a=l(n);x(e.$$.fragment,a),a.forEach(d),this.h()},h:function(){v(n,"class","svelte-m9qkku")},m:function(t,r){h(t,n,r),q(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){I(e.$$.fragment,t),a=!1},d:function(t){t&&d(n),M(e)}}}function Jt(t){var n,e=t[0].observed+"";return{c:function(){n=w(e)},l:function(t){n=$(t,e)},m:function(t,e){h(t,n,e)},p:function(t,a){1&a&&e!==(e=t[0].observed+"")&&E(n,e)},d:function(t){t&&d(n)}}}function Ht(t){var n,e,a,r,c,i,o,s,g,y,_,E,j,T,B="predicted"!=t[0].observed&&Ct(t);_=new It({props:{percentage:t[1]/9,value:t[1]}});var S=t[6]&&function(t){var n,e,a,r,c,i,o,s,g,y,_,E,D=Math.round(t[4])+"",R=Math.round(t[5])+"";return{c:function(){n=u("div"),e=u("p"),a=u("i"),r=k(),c=w(D),i=w("°C"),o=k(),s=u("p"),g=u("i"),y=k(),_=w(R),E=w("%"),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=b(v),c=$(v,D),i=$(v,"°C"),v.forEach(d),o=b(u),s=f(u,"P",{class:!0});var h=l(s);g=f(h,"I",{class:!0}),l(g).forEach(d),y=b(h),_=$(h,R),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,i),p(n,o),p(n,s),p(s,g),p(s,y),p(s,_),p(s,E)},p:m,d:function(t){t&&d(n)}}}(t);return{c:function(){n=u("div"),e=u("div"),a=u("h3"),r=w(t[3]),c=k(),i=u("p"),o=w(t[2]),s=k(),B&&B.c(),g=k(),y=u("div"),P(_.$$.fragment),E=k(),j=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=$(p,t[3]),p.forEach(d),c=b(h),i=f(h,"P",{class:!0});var m=l(i);o=$(m,t[2]),m.forEach(d),h.forEach(d),s=b(v),B&&B.l(v),g=b(v),y=f(v,"DIV",{class:!0});var k=l(y);x(_.$$.fragment,k),k.forEach(d),E=b(v),j=f(v,"DIV",{class:!0});var w=l(j);S&&S.l(w),w.forEach(d),v.forEach(d),this.h()},h:function(){v(a,"class","svelte-m9qkku"),v(i,"class","svelte-m9qkku"),v(e,"class","svelte-m9qkku"),v(y,"class","KP svelte-m9qkku"),v(j,"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,i),p(i,o),p(n,s),B&&B.m(n,null),p(n,g),p(n,y),q(_,y,null),p(n,E),p(n,j),S&&S.m(j,null),T=!0},p:function(t,e){var a=D(e,1)[0];"predicted"!=t[0].observed?B?(B.p(t,a),1&a&&V(B,1)):((B=Ct(t)).c(),V(B,1),B.m(n,g)):B&&(R(),I(B,1,1,(function(){B=null})),O()),t[6]&&S.p(t,a)},i:function(t){T||(V(B),V(_.$$.fragment,t),T=!0)},o:function(t){I(B),I(_.$$.fragment,t),T=!1},d:function(t){t&&d(n),B&&B.d(),M(_),S&&S.d()}}}function Kt(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 zt(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()],i=Kt(a.time.getHours().toString())+":"+Kt(a.time.getMinutes().toString()),o=a.temp,s=a.clouds,u=a.hasNOMETData;return t.$$set=function(t){"prediction"in t&&e(0,a=t.prediction)},[a,r,c,i,o,s,u]}var Ft=function(n){t(u,s);var e=At(u);function u(t){var n;return a(this,u),n=e.call(this),r(i(n),t,zt,Ht,c,{prediction:0}),n}return o(u)}();function Lt(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 i=n(this).constructor;r=Reflect.construct(c,arguments,i)}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 Gt(t){var n,e;return n=new Ft({props:{prediction:t[5]}}),{c:function(){P(n.$$.fragment)},l:function(t){x(n.$$.fragment,t)},m:function(t,a){q(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){I(n.$$.fragment,t),e=!1},d:function(t){M(n,t)}}}function Qt(t){for(var n,e,a=t[0],r=[],c=0;c<a.length;c+=1)r[c]=Gt(Zt(t,a,c));var i=function(t){return I(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=D(e,1)[0];if(1&c){var o;for(a=t[0],o=0;o<a.length;o+=1){var s=Zt(t,a,o);r[o]?(r[o].p(s,c),V(r[o],1)):(r[o]=Gt(s),r[o].c(),V(r[o],1),r[o].m(n,null))}for(R(),o=a.length;o<r.length;o+=1)i(o);O()}},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)I(r[n]);e=!1},d:function(t){t&&d(n),C(r,t)}}}function Ut(t,n,e){var a,r,c;function i(){return o.apply(this,arguments)}function o(){return(o=kt(J.mark((function t(){var n;return J.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,i,o=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(o.getTime()-t.time.getTime())&&(o=a,r=n.data.instant.details.air_temperature,i=n.data.instant.details.cloud_area_fraction)})),e(0,c[n]=Object.assign(Object.assign({},c[n]),{temp:r,clouds:i}),c)}));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return j(t,tt,(function(t){return e(1,a=t)})),j(t,nt,(function(t){return e(2,r=t)})),nt.subscribe(i),tt.subscribe(i),[c]}var Wt=function(n){t(u,s);var e=Lt(u);function u(t){var n;return a(this,u),n=e.call(this),r(i(n),t,Ut,Qt,c,{}),n}return o(u)}();function Xt(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 i=n(this).constructor;r=Reflect.construct(c,arguments,i)}else r=c.apply(this,arguments);return e(this,r)}}function Yt(t){var n,e,a,r,c,i,o,s,m,g;return o=new It({props:{percentage:t[0]/9,value:t[0]}}),{c:function(){n=u("div"),e=u("div"),a=u("h3"),r=w(t[1]),c=k(),i=u("div"),P(o.$$.fragment),s=k(),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=$(p,t[1]),p.forEach(d),h.forEach(d),c=b(v),i=f(v,"DIV",{class:!0});var g=l(i);x(o.$$.fragment,g),g.forEach(d),s=b(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(i,"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,i),q(o,i,null),p(n,s),p(n,m),g=!0},p:function(t,n){D(n,1)[0]},i:function(t){g||(V(o.$$.fragment,t),g=!0)},o:function(t){I(o.$$.fragment,t),g=!1},d:function(t){t&&d(n),M(o)}}}function tn(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 nn(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()];tn(a.time.getHours().toString()),tn(a.time.getMinutes().toString());var i=a.temp,o=a.clouds;return t.$$set=function(t){"prediction"in t&&e(4,a=t.prediction)},[r,c,i,o,a]}var en=function(n){t(u,s);var e=Xt(u);function u(t){var n;return a(this,u),n=e.call(this),r(i(n),t,nn,Yt,c,{prediction:4}),n}return o(u)}();function an(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 i=n(this).constructor;r=Reflect.construct(c,arguments,i)}else r=c.apply(this,arguments);return e(this,r)}}function rn(t,n,e){var a=t.slice();return a[5]=n[e],a[7]=e,a}function cn(t){var n,e;return n=new en({props:{prediction:t[5]}}),{c:function(){P(n.$$.fragment)},l:function(t){x(n.$$.fragment,t)},m:function(t,a){q(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){I(n.$$.fragment,t),e=!1},d:function(t){M(n,t)}}}function on(t){for(var n,e,a=t[0],r=[],c=0;c<a.length;c+=1)r[c]=cn(rn(t,a,c));var i=function(t){return I(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=D(e,1)[0];if(1&c){var o;for(a=t[0],o=0;o<a.length;o+=1){var s=rn(t,a,o);r[o]?(r[o].p(s,c),V(r[o],1)):(r[o]=cn(s),r[o].c(),V(r[o],1),r[o].m(n,null))}for(R(),o=a.length;o<r.length;o+=1)i(o);O()}},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)I(r[n]);e=!1},d:function(t){t&&d(n),C(r,t)}}}function sn(t,n,e){var a,r,c;function i(){return o.apply(this,arguments)}function o(){return(o=kt(J.mark((function t(){var n;return J.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,i,o=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(o.getTime()-t.time.getTime())){if(Math.abs(a.getTime()-t.time.getTime())>864e5)return void(s=!1);o=a,r=n.data.instant.details.air_temperature,i=n.data.instant.details.cloud_area_fraction}})),e(0,c[n]=Object.assign(Object.assign({},c[n]),{temp:r,clouds:i,hasNOMETData:s}),c)}));case 6:case"end":return t.stop()}}),t)})))).apply(this,arguments)}return j(t,tt,(function(t){return e(1,a=t)})),j(t,nt,(function(t){return e(2,r=t)})),nt.subscribe(i),tt.subscribe(i),[c]}var un=function(n){t(u,s);var e=an(u);function u(t){var n;return a(this,u),n=e.call(this),r(i(n),t,sn,on,c,{}),n}return o(u)}();function fn(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 i=n(this).constructor;r=Reflect.construct(c,arguments,i)}else r=c.apply(this,arguments);return e(this,r)}}function ln(t){var n,e,a,r,c;return{c:function(){n=u("div"),e=u("i"),a=k(),r=u("p"),c=w("No prediction data"),this.h()},l:function(t){n=f(t,"DIV",{class:!0});var i=l(n);e=f(i,"I",{class:!0}),l(e).forEach(d),a=b(i),r=f(i,"P",{});var o=l(r);c=$(o,"No prediction data"),o.forEach(d),i.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,i){h(t,n,i),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 dn(t){var n,e,a,r,c,i,o,s,m,g,y,E,D,j,T,B,S,N,A,C=t[0];return C&&(T=new C({})),{c:function(){n=u("div"),e=u("h2"),a=w("Forecast"),r=k(),c=u("div"),i=u("div"),o=w("hour"),s=k(),m=u("div"),g=w("3 day"),y=k(),E=u("div"),D=w("Longterm"),j=k(),T&&P(T.$$.fragment),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=$(v,"Forecast"),v.forEach(d),r=b(u),c=f(u,"DIV",{class:!0});var h=l(c);i=f(h,"DIV",{class:!0});var p=l(i);o=$(p,"hour"),p.forEach(d),s=b(h),m=f(h,"DIV",{class:!0});var k=l(m);g=$(k,"3 day"),k.forEach(d),y=b(h),E=f(h,"DIV",{class:!0});var w=l(E);D=$(w,"Longterm"),w.forEach(d),h.forEach(d),u.forEach(d),j=b(t),T&&x(T.$$.fragment,t),B=_(),this.h()},h:function(){v(e,"class","svelte-11gsg4a"),v(i,"class","svelte-11gsg4a"),H(i,"selected",t[0]==Nt),v(m,"class","svelte-11gsg4a"),H(m,"selected",t[0]==Wt),v(E,"class","svelte-11gsg4a"),H(E,"selected",t[0]==un),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,i),p(i,o),p(c,s),p(c,m),p(m,g),p(c,y),p(c,E),p(E,D),h(u,j,f),T&&q(T,u,f),h(u,B,f),S=!0,N||(A=[K(i,"click",t[3]),K(m,"click",t[4]),K(E,"click",t[5])],N=!0)},p:function(t,n){if(1&n&&H(i,"selected",t[0]==Nt),1&n&&H(m,"selected",t[0]==Wt),1&n&&H(E,"selected",t[0]==un),C!==(C=t[0])){if(T){R();var e=T;I(e.$$.fragment,1,0,(function(){M(e,1)})),O()}C?(T=new C({}),P(T.$$.fragment),V(T.$$.fragment,1),q(T,B.parentNode,B)):T=null}},i:function(t){S||(T&&V(T.$$.fragment,t),S=!0)},o:function(t){T&&I(T.$$.fragment,t),S=!1},d:function(t){t&&d(n),t&&d(j),t&&d(B),T&&M(T,t),N=!1,z(A)}}}function vn(t){var n,e,a,r,c=[dn,ln],i=[];function o(t,n){return t[1].updating||t[2].updating?1:0}return e=o(t),a=i[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),i[e].m(n,null),r=!0},p:function(t,r){var s=D(r,1)[0],u=e;(e=o(t))===u?i[e].p(t,s):(R(),I(i[u],1,1,(function(){i[u]=null})),O(),(a=i[e])?a.p(t,s):(a=i[e]=c[e](t)).c(),V(a,1),a.m(n,null))},i:function(t){r||(V(a),r=!0)},o:function(t){I(a),r=!1},d:function(t){t&&d(n),i[e].d()}}}function hn(t,n,e){var a,r;j(t,tt,(function(t){return e(1,a=t)})),j(t,nt,(function(t){return e(2,r=t)}));var c=Wt;return[c,a,r,function(){return e(0,c=Nt)},function(){return e(0,c=Wt)},function(){return e(0,c=un)}]}var pn=function(n){t(u,s);var e=fn(u);function u(t){var n;return a(this,u),n=e.call(this),r(i(n),t,hn,vn,c,{}),n}return o(u)}();function mn(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 i=n(this).constructor;r=Reflect.construct(c,arguments,i)}else r=c.apply(this,arguments);return e(this,r)}}function gn(t){var n,e,a,r,c,i;return a=new gt({}),c=new pn({}),{c:function(){n=k(),e=u("div"),P(a.$$.fragment),r=k(),P(c.$$.fragment),this.h()},l:function(t){F('[data-svelte="svelte-1q3846k"]',document.head).forEach(d),n=b(t),e=f(t,"DIV",{class:!0});var i=l(e);x(a.$$.fragment,i),r=b(i),x(c.$$.fragment,i),i.forEach(d),this.h()},h:function(){document.title="Aurora data",v(e,"class","homescreen svelte-pf4p6y")},m:function(t,o){h(t,n,o),h(t,e,o),q(a,e,null),p(e,r),q(c,e,null),i=!0},p:m,i:function(t){i||(V(a.$$.fragment,t),V(c.$$.fragment,t),i=!0)},o:function(t){I(a.$$.fragment,t),I(c.$$.fragment,t),i=!1},d:function(t){t&&d(n),t&&d(e),M(a),M(c)}}}var yn=function(n){t(u,s);var e=mn(u);function u(t){var n;return a(this,u),n=e.call(this),r(i(n),t,null,gn,c,{}),n}return o(u)}();export{yn as default}; |