From 09d255d656ecdd911f53399a3c1476d846e407ce Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Sun, 3 Dec 2023 21:14:26 +0100 Subject: [PATCH] Fix --- lib/SvelteUi/app/dist/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/SvelteUi/app/dist/index.js b/lib/SvelteUi/app/dist/index.js index abfc40b6..91bfb713 100644 --- a/lib/SvelteUi/app/dist/index.js +++ b/lib/SvelteUi/app/dist/index.js @@ -1,7 +1,7 @@ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function l(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=l(i);fetch(i.href,o)}})();function fe(){}function xt(t,e){for(const l in e)t[l]=e[l];return t}function tc(t){return t()}function La(){return Object.create(null)}function ze(t){t.forEach(tc)}function co(t){return typeof t=="function"}function Ne(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let _s;function Js(t,e){return _s||(_s=document.createElement("a")),_s.href=e,t===_s.href}function xc(t){return Object.keys(t).length===0}function mo(t,...e){if(t==null)return fe;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function ai(t){let e;return mo(t,l=>e=l)(),e}function ul(t,e,l){t.$$.on_destroy.push(mo(e,l))}function po(t,e,l,n){if(t){const i=lc(t,e,l,n);return t[0](i)}}function lc(t,e,l,n){return t[1]&&n?xt(l.ctx.slice(),t[1](n(e))):l.ctx}function _o(t,e,l,n){if(t[2]&&n){const i=t[2](n(l));if(e.dirty===void 0)return i;if(typeof i=="object"){const o=[],u=Math.max(e.dirty.length,i.length);for(let a=0;a32){const e=[],l=t.ctx.length/32;for(let n=0;nt.removeEventListener(e,l,n)}function Ms(t){return function(e){return e.preventDefault(),t.call(this,e)}}function r(t,e,l){l==null?t.removeAttribute(e):t.getAttribute(e)!==l&&t.setAttribute(e,l)}const t0=["width","height"];function ui(t,e){const l=Object.getOwnPropertyDescriptors(t.__proto__);for(const n in e)e[n]==null?t.removeAttribute(n):n==="style"?t.style.cssText=e[n]:n==="__value"?t.value=t[n]=e[n]:l[n]&&l[n].set&&t0.indexOf(n)===-1?t[n]=e[n]:r(t,n,e[n])}function he(t){return t===""?null:+t}function l0(t){return Array.from(t.childNodes)}function X(t,e){e=""+e,t.data!==e&&(t.data=e)}function n0(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function i0(t,e,l){~e0.indexOf(l)?n0(t,e):X(t,e)}function te(t,e){t.value=e==null?"":e}function nc(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function qe(t,e,l){for(let n=0;n{u.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=ee(n.contentWindow,"resize",e),e()}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),C(n)}}function r0(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}function Oa(t,e){return new t(e)}let Si;function $i(t){Si=t}function Ti(){if(!Si)throw new Error("Function called outside component initialization");return Si}function ic(t){Ti().$$.on_mount.push(t)}function a0(t){Ti().$$.on_destroy.push(t)}function u0(){const t=Ti();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=r0(e,l,{cancelable:n});return i.slice().forEach(u=>{u.call(t,o)}),!o.defaultPrevented}return!0}}function Mi(t,e){return Ti().$$.context.set(t,e),e}function Bl(t){return Ti().$$.context.get(t)}const ii=[],ws=[];let si=[];const Fa=[],sc=Promise.resolve();let xs=!1;function oc(){xs||(xs=!0,sc.then(rc))}function f0(){return oc(),sc}function tt(t){si.push(t)}const Vs=new Set;let li=0;function rc(){if(li!==0)return;const t=Si;do{try{for(;lit.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),si=e}const bs=new Set;let rn;function De(){rn={r:0,c:[],p:rn}}function Ie(){rn.r||ze(rn.c),rn=rn.p}function D(t,e){t&&t.i&&(bs.delete(t),t.i(e))}function q(t,e,l,n){if(t&&t.o){if(bs.has(t))return;bs.add(t),rn.c.push(()=>{bs.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function ac(t,e){const l={},n={},i={$$scope:1};let o=t.length;for(;o--;){const u=t[o],a=e[o];if(a){for(const c in u)c in a||(n[c]=1);for(const c in a)i[c]||(l[c]=a[c],i[c]=1);t[o]=a}else for(const c in u)i[c]=1}for(const u in n)u in l||(l[u]=void 0);return l}function qa(t){return typeof t=="object"&&t!==null?t:{}}function ie(t){t&&t.c()}function le(t,e,l,n){const{fragment:i,after_update:o}=t.$$;i&&i.m(e,l),n||tt(()=>{const u=t.$$.on_mount.map(tc).filter(co);t.$$.on_destroy?t.$$.on_destroy.push(...u):ze(u),t.$$.on_mount=[]}),o.forEach(tt)}function ne(t,e){const l=t.$$;l.fragment!==null&&(m0(l.after_update),ze(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function p0(t,e){t.$$.dirty[0]===-1&&(ii.push(t),oc(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const d=v.length?v[0]:b;return f.ctx&&i(f.ctx[p],f.ctx[p]=d)&&(!f.skip_bound&&f.bound[p]&&f.bound[p](d),_&&p0(t,p)),b}):[],f.update(),_=!0,ze(f.before_update),f.fragment=n?n(f.ctx):!1,e.target){if(e.hydrate){const p=l0(e.target);f.fragment&&f.fragment.l(p),p.forEach(C)}else f.fragment&&f.fragment.c();e.intro&&D(t.$$.fragment),le(t,e.target,e.anchor,e.customElement),rc()}$i(c)}class Ee{$destroy(){ne(this,1),this.$destroy=fe}$on(e,l){if(!co(l))return fe;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(l),()=>{const i=n.indexOf(l);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!xc(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const Ba=t=>typeof t>"u",uc=t=>typeof t=="function",fc=t=>typeof t=="number";function _0(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function cc(){let t=0;return()=>t++}function d0(){return Math.random().toString(36).substring(2)}const Ul=typeof window>"u";function mc(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const pc=(t,e)=>t?{}:{style:e},eo=t=>({"aria-hidden":"true",...pc(t,"display:none;")}),ni=[];function _c(t,e){return{subscribe:at(t,e).subscribe}}function at(t,e=fe){let l;const n=new Set;function i(a){if(Ne(t,a)&&(t=a,l)){const c=!ni.length;for(const f of n)f[1](),ni.push(f,t);if(c){for(let f=0;f{n.delete(f),n.size===0&&l&&(l(),l=null)}}return{set:i,update:o,subscribe:u}}function v0(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,o=e.length<2;return _c(l,u=>{let a=!1;const c=[];let f=0,_=fe;const p=()=>{if(f)return;_();const v=e(n?c[0]:c,u);o?u(v):_=co(v)?v:fe},b=i.map((v,d)=>mo(v,M=>{c[d]=M,f&=~(1<{f|=1<`@@svnav-ctx__${t}`,to=Ni("LOCATION"),fi=Ni("ROUTER"),dc=Ni("ROUTE"),h0=Ni("ROUTE_PARAMS"),b0=Ni("FOCUS_ELEM"),vc=/^:(.+)/,wi=(t,e,l)=>t.substr(e,l),lo=(t,e)=>wi(t,0,e.length)===e,g0=t=>t==="",k0=t=>vc.test(t),hc=t=>t[0]==="*",w0=t=>t.replace(/\*.*$/,""),bc=t=>t.replace(/(^\/+|\/+$)/g,"");function ml(t,e=!1){const l=bc(t).split("/");return e?l.filter(Boolean):l}const Ks=(t,e)=>t+(e?`?${e}`:""),bo=t=>`/${bc(t)}`;function Ai(...t){const e=n=>ml(n,!0).join("/"),l=t.map(e).join("/");return bo(l)}const go=1,Ss=2,mn=3,y0=4,gc=5,C0=6,kc=7,$0=8,M0=9,wc=10,yc=11,S0={[go]:"Link",[Ss]:"Route",[mn]:"Router",[y0]:"useFocus",[gc]:"useLocation",[C0]:"useMatch",[kc]:"useNavigate",[$0]:"useParams",[M0]:"useResolvable",[wc]:"useResolve",[yc]:"navigate"},ko=t=>S0[t];function T0(t,e){let l;return t===Ss?l=e.path?`path="${e.path}"`:"default":t===go?l=`to="${e.to}"`:t===mn&&(l=`basepath="${e.basepath||""}"`),`<${ko(t)} ${l||""} />`}function N0(t,e,l,n){const i=l&&T0(n||t,l),o=i?` Occurred in: ${i}`:"",u=ko(t),a=uc(e)?e(u):e;return`<${u}> ${a}${o}`}const Cc=t=>(...e)=>t(N0(...e)),$c=Cc(t=>{throw new Error(t)}),ys=Cc(console.warn),Ua=4,A0=3,P0=2,E0=1,D0=1;function I0(t,e){const l=t.default?0:ml(t.fullPath).reduce((n,i)=>{let o=n;return o+=Ua,g0(i)?o+=D0:k0(i)?o+=P0:hc(i)?o-=Ua+E0:o+=A0,o},0);return{route:t,score:l,index:e}}function R0(t){return t.map(I0).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function Mc(t,e){let l,n;const[i]=e.split("?"),o=ml(i),u=o[0]==="",a=R0(t);for(let c=0,f=a.length;c({..._,params:b,uri:T});if(_.default){n=v(e);continue}const d=ml(_.fullPath),M=Math.max(o.length,d.length);let y=0;for(;y{f===".."?c.pop():f!=="."&&c.push(f)}),Ks(`/${c.join("/")}`,n)}function ja(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,u=ml(e,!0),a=ml(l,!0);for(;u.length;)u[0]!==a[0]&&$c(mn,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),u.shift(),a.shift();return{pathname:Ai(...a),hash:n,search:i,state:o}}const Ha=t=>t.length===1?"":t,wo=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?Ha(wi(t,l)):"",u=i?wi(t,0,l):t,a=n?Ha(wi(u,e)):"";return{pathname:(n?wi(u,0,e):u)||"/",search:a,hash:o}},O0=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function F0(t,e,l){return Ai(l,L0(t,e))}function q0(t,e){const l=bo(w0(t)),n=ml(l,!0),i=ml(e,!0).slice(0,n.length),o=Sc({fullPath:l},Ai(...i));return o&&o.uri}const Ys="POP",B0="PUSH",U0="REPLACE";function Qs(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function j0(t){let e=[],l=Qs(t),n=Ys;const i=(o=e)=>o.forEach(u=>u({location:l,action:n}));return{get location(){return l},listen(o){e.push(o);const u=()=>{l=Qs(t),n=Ys,i([o])};i([o]);const a=mc(t,"popstate",u);return()=>{a(),e=e.filter(c=>c!==o)}},navigate(o,u){const{state:a={},replace:c=!1}=u||{};if(n=c?U0:B0,fc(o))u&&ys(yc,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=Ys,t.history.go(o);else{const f={...a,_key:d0()};try{t.history[c?"replaceState":"pushState"](f,"",o)}catch{t.location[c?"replace":"assign"](o)}}l=Qs(t),i()}}}function Xs(t,e){return{...wo(e),state:t}}function H0(t="/"){let e=0,l=[Xs(null,t)];return{get entries(){return l},get location(){return l[e]},addEventListener(){},removeEventListener(){},history:{get state(){return l[e].state},pushState(n,i,o){e++,l=l.slice(0,e),l.push(Xs(n,o))},replaceState(n,i,o){l[e]=Xs(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const W0=!!(!Ul&&window.document&&window.document.createElement),z0=!Ul&&window.location.origin==="null",Tc=j0(W0&&!z0?window:H0()),{navigate:oi}=Tc;let Sl=null,Nc=!0;function G0(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nSl.level||t.level===Sl.level&&G0(t.routerId,Sl.routerId))&&(Sl=t)}function K0(){Sl=null}function Y0(){Nc=!1}function Wa(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=mc(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function Q0(t,e){return Number(t.dataset.svnavRouteEnd)===e}function X0(t){return/^H[1-6]$/i.test(t.tagName)}function za(t,e=document){return e.querySelector(t)}function Z0(t){let l=za(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!Q0(l,t);){if(X0(l))return l;const n=za("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function J0(t){Promise.resolve(ai(t.focusElement)).then(e=>{const l=e||Z0(t.id);l||ys(mn,`Could not find an element to focus. You should always render a header for accessibility reasons, or set a custom focus element via the "useFocus" hook. If you don't want this Route or Router to manage focus, pass "primary={false}" to it.`,t,Ss),!Wa(l)&&Wa(document.documentElement)})}const x0=(t,e,l)=>(n,i)=>f0().then(()=>{if(!Sl||Nc){Y0();return}if(n&&J0(Sl.route),t.announcements&&i){const{path:o,fullPath:u,meta:a,params:c,uri:f}=Sl.route,_=t.createAnnouncement({path:o,fullPath:u,meta:a,params:c,uri:f},ai(l));Promise.resolve(_).then(p=>{e.set(p)})}K0()}),e1="position:fixed;top:-1px;left:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;";function t1(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},pc(t[6],e1)],i={};for(let o=0;o`Navigated to ${ue.uri}`,announcements:!0,...d},T=_,N=bo(_),E=Bl(to),B=Bl(fi),P=!E,L=n1(),O=v&&!(B&&!B.manageFocus),F=at("");ul(t,F,ue=>l(0,a=ue));const x=B?B.disableInlineStyles:M,j=at([]);ul(t,j,ue=>l(20,u=ue));const z=at(null);ul(t,z,ue=>l(18,i=ue));let G=!1;const V=P?0:B.level+1,U=P?at((()=>ja(Ul?wo(p):b.location,N))()):E;ul(t,U,ue=>l(17,n=ue));const K=at(n);ul(t,K,ue=>l(19,o=ue));const H=x0(y,F,U),Y=ue=>ke=>ke.filter(me=>me.id!==ue);function Z(ue){if(Ul){if(G)return;const ke=Sc(ue,n.pathname);if(ke)return G=!0,ke}else j.update(ke=>{const me=Y(ue.id)(ke);return me.push(ue),me})}function re(ue){j.update(Y(ue))}return!P&&_!==Ga&&ys(mn,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:_}),P&&(ic(()=>b.listen(ke=>{const me=ja(ke.location,N);K.set(n),U.set(me)})),Mi(to,U)),Mi(fi,{activeRoute:z,registerRoute:Z,unregisterRoute:re,manageFocus:O,level:V,id:L,history:P?b:B.history,basepath:P?N:B.basepath,disableInlineStyles:x}),t.$$set=ue=>{"basepath"in ue&&l(11,_=ue.basepath),"url"in ue&&l(12,p=ue.url),"history"in ue&&l(13,b=ue.history),"primary"in ue&&l(14,v=ue.primary),"a11y"in ue&&l(15,d=ue.a11y),"disableInlineStyles"in ue&&l(16,M=ue.disableInlineStyles),"$$scope"in ue&&l(21,f=ue.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&_!==T&&ys(mn,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const ue=Mc(u,n.pathname);z.set(ue)}if(t.$$.dirty[0]&655360&&P){const ue=!!n.hash,ke=!ue&&O,me=!ue||n.pathname!==o.pathname;H(ke,me)}t.$$.dirty[0]&262144&&O&&i&&i.primary&&V0({level:V,routerId:L,route:i})},[a,y,P,L,O,F,x,j,z,U,K,_,p,b,v,d,M,n,i,o,u,f,c]}class s1 extends Ee{constructor(e){super(),Pe(this,e,i1,l1,Ne,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const Ac=s1;function Pi(t,e,l=fi,n=mn){Bl(l)||$c(t,o=>`You cannot use ${o} outside of a ${ko(n)}.`,e)}const o1=t=>{const{subscribe:e}=Bl(t);return{subscribe:e}};function Pc(){return Pi(gc),o1(to)}function Ec(){const{history:t}=Bl(fi);return t}function Dc(){const t=Bl(dc);return t?v0(t,e=>e.base):at("/")}function Ic(){Pi(wc);const t=Dc(),{basepath:e}=Bl(fi);return n=>F0(n,ai(t),e)}function r1(){Pi(kc);const t=Ic(),{navigate:e}=Ec();return(n,i)=>{const o=fc(n)?n:t(n);return e(o,i)}}const a1=t=>({params:t&16,location:t&8}),Va=t=>({params:Ul?ai(t[10]):t[4],location:t[3],navigate:t[11]});function Ka(t){let e,l;return e=new Ac({props:{primary:t[1],$$slots:{default:[c1]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.primary=n[1]),i&528409&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function u1(t){let e;const l=t[18].default,n=po(l,t,t[19],Va);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&vo(n,l,i,i[19],e?_o(l,i[19],o,a1):ho(i[19]),Va)},i(i){e||(D(n,i),e=!0)},o(i){q(n,i),e=!1},d(i){n&&n.d(i)}}}function f1(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},Ul?ai(t[10]):t[4],t[12]];var o=t[0];function u(a){let c={};for(let f=0;f{ne(_,1)}),Ie()}o?(e=Oa(o,u()),ie(e.$$.fragment),D(e.$$.fragment,1),le(e,l.parentNode,l)):e=null}else o&&e.$set(f)},i(a){n||(e&&D(e.$$.fragment,a),n=!0)},o(a){e&&q(e.$$.fragment,a),n=!1},d(a){a&&C(l),e&&ne(e,a)}}}function c1(t){let e,l,n,i;const o=[f1,u1],u=[];function a(c,f){return c[0]!==null?0:1}return e=a(t),l=u[e]=o[e](t),{c(){l.c(),n=Ve()},m(c,f){u[e].m(c,f),$(c,n,f),i=!0},p(c,f){let _=e;e=a(c),e===_?u[e].p(c,f):(De(),q(u[_],1,1,()=>{u[_]=null}),Ie(),l=u[e],l?l.p(c,f):(l=u[e]=o[e](c),l.c()),D(l,1),l.m(n.parentNode,n))},i(c){i||(D(l),i=!0)},o(c){q(l),i=!1},d(c){u[e].d(c),c&&C(n)}}}function m1(t){let e,l,n,i,o,u=[eo(t[7]),{"data-svnav-route-start":t[5]}],a={};for(let p=0;p{c=null}),Ie())},i(p){o||(D(c),o=!0)},o(p){q(c),o=!1},d(p){p&&C(e),p&&C(l),c&&c.d(p),p&&C(n),p&&C(i)}}}const p1=cc();function _1(t,e,l){let n;const i=["path","component","meta","primary"];let o=ks(e,i),u,a,c,f,{$$slots:_={},$$scope:p}=e,{path:b=""}=e,{component:v=null}=e,{meta:d={}}=e,{primary:M=!0}=e;Pi(Ss,e);const y=p1(),{registerRoute:T,unregisterRoute:N,activeRoute:E,disableInlineStyles:B}=Bl(fi);ul(t,E,G=>l(16,u=G));const P=Dc();ul(t,P,G=>l(17,c=G));const L=Pc();ul(t,L,G=>l(3,a=G));const O=at(null);let F;const x=at(),j=at({});ul(t,j,G=>l(4,f=G)),Mi(dc,x),Mi(h0,j),Mi(b0,O);const z=r1();return Ul||a0(()=>N(y)),t.$$set=G=>{l(24,e=xt(xt({},e),gs(G))),l(12,o=ks(e,i)),"path"in G&&l(13,b=G.path),"component"in G&&l(0,v=G.component),"meta"in G&&l(14,d=G.meta),"primary"in G&&l(1,M=G.primary),"$$scope"in G&&l(19,p=G.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const G=b==="",V=Ai(c,b),W={id:y,path:b,meta:d,default:G,fullPath:G?"":V,base:G?c:q0(V,a.pathname),primary:M,focusElement:O};x.set(W),l(15,F=T(W))}if(t.$$.dirty&98304&&l(2,n=!!(F||u&&u.id===y)),t.$$.dirty&98308&&n){const{params:G}=F||u;j.set(G)}},e=gs(e),[v,M,n,a,f,y,E,B,P,L,j,z,o,b,d,F,u,c,_,p]}class d1 extends Ee{constructor(e){super(),Pe(this,e,_1,m1,Ne,{path:13,component:0,meta:14,primary:1})}}const Ml=d1;function v1(t){let e,l,n,i;const o=t[13].default,u=po(o,t,t[12],null);let a=[{href:t[0]},t[2],t[1]],c={};for(let f=0;fl(11,p=O));const E=u0(),B=Ic(),{navigate:P}=Ec();function L(O){E("click",O),_0(O)&&(O.preventDefault(),P(n,{state:y,replace:u||M}))}return t.$$set=O=>{l(19,e=xt(xt({},e),gs(O))),l(18,_=ks(e,f)),"to"in O&&l(5,d=O.to),"replace"in O&&l(6,M=O.replace),"state"in O&&l(7,y=O.state),"getProps"in O&&l(8,T=O.getProps),"$$scope"in O&&l(12,v=O.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=B(d,p)),t.$$.dirty&2049&&l(10,i=lo(p.pathname,n)),t.$$.dirty&2049&&l(9,o=n===p.pathname),t.$$.dirty&2049&&(u=wo(n)===O0(p)),t.$$.dirty&512&&l(2,a=o?{"aria-current":"page"}:{}),l(1,c=(()=>{if(uc(T)){const O=T({location:p,href:n,isPartiallyCurrent:i,isCurrent:o});return{..._,...O}}return _})())},e=gs(e),[n,c,a,N,L,d,M,y,T,o,i,p,v,b]}class b1 extends Ee{constructor(e){super(),Pe(this,e,h1,v1,Ne,{to:5,replace:6,state:7,getProps:8})}}const el=b1;let no=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ql(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function g1(t){return t>218&&t<242?"#32d900":t>212&&t<248?"#b1d900":t>208&&t<252?"#ffb800":"#d90000"}function Rc(t){return t>90?"#d90000":t>85?"#e32100":t>80?"#ffb800":t>75?"#dcd800":"#32d900"}function k1(t){return t>75?"#32d900":t>50?"#77d900":t>25?"#94d900":"#dcd800"}function Cs(t){switch(t){case 1:return"Aidon";case 2:return"Kaifa";case 3:return"Kamstrup";case 8:return"Iskra";case 9:return"Landis+Gyr";case 10:return"Sagemcom";default:return"Unknown"}}function Oe(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function be(t,e){switch(e){case 5:switch(t){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(t){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"\xB5HAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1"}}function Ya(t){switch(t){case-1:return"Parse error";case-2:return"Incomplete data received";case-3:return"Payload boundry flag missing";case-4:return"Header checksum error";case-5:return"Footer checksum error";case-9:return"Unknown data received, check meter config";case-41:return"Frame length not equal";case-51:return"Authentication failed";case-52:return"Decryption failed";case-53:return"Encryption key invalid";case 90:return"No HAN data received for at least 30s";case 91:return"Serial break";case 92:return"Serial buffer full";case 93:return"Serial FIFO overflow";case 94:return"Serial frame error";case 95:return"Serial parity error";case 96:return"RX error";case 98:return"Exception in code, debugging necessary";case 99:return"Autodetection failed"}return t<0?"Unspecified error "+t:""}function Qa(t){switch(t){case-3:return"Connection failed";case-4:return"Network timeout";case-10:return"Connection denied";case-11:return"Failed to subscribe";case-13:return"Connection lost"}return t<0?"Unspecified error "+t:""}function Xa(t){switch(t){case 400:return"Unrecognized data in request";case 401:case 403:return"Unauthorized, check API key";case 404:return"Price unavailable, not found";case 425:return"Server says its too early";case 429:return"Exceeded API rate limit";case 500:return"Internal server error";case-1:return"Connection error";case-2:return"Incomplete data received";case-3:return"Invalid data, tag missing";case-51:return"Authentication failed";case-52:return"Decryption failed";case-53:return"Encryption key invalid"}return t<0?"Unspecified error "+t:""}function ri(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Ke(t,e){return t==1||t==2&&e}function Ut(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function ge(t,e){return isNaN(t)?"-":(isNaN(e)&&(e=t<10?1:0),t.toFixed(e))}function fl(t,e){return t.setTime(t.getTime()+e*36e5),t}function Za(t){if(t.chip=="esp8266")switch(t.boot_reason){case 0:return"Normal";case 1:return"WDT reset";case 2:return"Exception reset";case 3:return"Soft WDT reset";case 4:return"Software restart";case 5:return"Deep sleep";case 6:return"External reset";default:return"Unknown (8266)"}else switch(t.boot_reason){case 1:return"Vbat power on reset";case 3:return"Software reset";case 4:return"WDT reset";case 5:return"Deep sleep";case 6:return"SLC reset";case 7:return"Timer Group0 WDT reset";case 8:return"Timer Group1 WDT reset";case 9:return"RTC WDT reset";case 10:return"Instrusion test reset CPU";case 11:return"Time Group reset CPU";case 12:return"Software reset CPU";case 13:return"RTC WTD reset CPU";case 14:return"PRO CPU";case 15:return"Brownout";case 16:return"RTC reset";default:return"Unknown"}}function Ja(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energy Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}async function jl(t,e={}){const{timeout:l=8e3}=e,n=new AbortController,i=setTimeout(()=>n.abort(),l),o=await fetch(t,{...e,signal:n.signal});return clearTimeout(i),o}let al={version:"",chip:"",mac:null,apmac:null,vndcfg:null,usrcfg:null,fwconsent:null,booting:!1,upgrading:!1,ui:{},security:0,boot_reason:0,upgrade:{x:-1,e:0,f:null,t:null},trying:null};const jt=at(al);async function yo(){al=await(await jl("/sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),jt.set(al)}let vs=0,xa=-127,eu=null,w1={};const y1=_c(w1,t=>{let e;async function l(){jl("/data.json").then(n=>n.json()).then(n=>{t(n),xa!=n.t&&(xa=n.t,setTimeout(Bc,2e3)),eu==null&&n.pe&&n.p!=null&&(eu=n.p,Oc()),al.upgrading?window.location.reload():(!al||!al.chip||al.booting||vs>1&&!ri(al.board))&&(yo(),an&&clearTimeout(an),an=setTimeout($o,2e3),un&&clearTimeout(un),un=setTimeout(Mo,3e3));let i=5e3;if(ri(al.board)&&n.v>2.5){let o=3.3-Math.min(3.3,n.v);o>0&&(i=Math.max(o,.1)*10*5e3)}i>5e3&&console.log("Scheduling next data fetch in "+i+"ms"),e&&clearTimeout(e),e=setTimeout(l,i),vs=0}).catch(n=>{vs++,vs>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(l,15e3)):e=setTimeout(l,ri(al.board)?1e4:5e3)})}return l(),function(){clearTimeout(e)}});let io={},yi;const Co=at(io);async function Lc(){let t=!1;if(Co.update(e=>{for(var l=0;l<36;l++){if(e[Oe(l)]==null){t=l<12;break}e[Oe(l)]=e[Oe(l+1)]}return e}),t)Oc();else{let e=new Date;yi=setTimeout(Lc,(60-e.getMinutes())*6e4)}}async function Oc(){yi&&(clearTimeout(yi),yi=0),io=await(await jl("/energyprice.json")).json(),Co.set(io);let e=new Date;yi=setTimeout(Lc,(60-e.getMinutes())*6e4)}let so={},an;async function $o(){an&&(clearTimeout(an),an=0),so=await(await jl("/dayplot.json")).json(),Fc.set(so);let e=new Date;an=setTimeout($o,(60-e.getMinutes())*6e4+20)}const Fc=at(so,t=>($o(),function(){}));let oo={},un;async function Mo(){un&&(clearTimeout(un),un=0),oo=await(await jl("/monthplot.json")).json(),qc.set(oo);let e=new Date;un=setTimeout(Mo,(24-e.getHours())*36e5+40)}const qc=at(oo,t=>(Mo(),function(){}));let ro={};async function Bc(){ro=await(await jl("/temperature.json")).json(),Uc.set(ro)}const Uc=at(ro,t=>(Bc(),function(){}));let ao={},hs;async function jc(){hs&&(clearTimeout(hs),hs=0),ao=await(await jl("/tariff.json")).json(),Hc.set(ao);let e=new Date;hs=setTimeout(jc,(60-e.getMinutes())*6e4+30)}const Hc=at(ao,t=>function(){});let uo=[];const So=at(uo);async function C1(){uo=await(await jl("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),So.set(uo)}function $s(t){return"WARNING: "+t+" must be connected to an external power supply during firmware upgrade. Failure to do so may cause power-down during upload resulting in non-functioning unit."}async function Wc(t){await(await fetch("/upgrade?expected_version="+t,{method:"POST"})).json()}function zc(t,e){if(/^v\d{1,2}\.\d{1,2}\.\d{1,2}$/.test(t)){let l=t.substring(1).split("."),n=parseInt(l[0]),i=parseInt(l[1]),o=parseInt(l[2]),u=[...e];u.reverse();let a,c,f;for(let _=0;_o&&(a=p):M==i+1&&(c=p);else if(d==n+1)if(f){let T=f.tag_name.substring(1).split(".");parseInt(T[0]);let N=parseInt(T[1]);parseInt(T[2]),M==N&&(f=p)}else f=p}return c||f||a||!1}else return e[0]}const $1="/github.svg";function tu(t){let e,l;function n(u,a){return u[1]>1?E1:u[1]>0?P1:u[2]>1?A1:u[2]>0?N1:u[3]>1?T1:u[3]>0?S1:M1}let i=n(t),o=i(t);return{c(){e=S(`Up - `),o.c(),l=Ve()},m(u,a){$(u,e,a),o.m(u,a),$(u,l,a)},p(u,a){i===(i=n(u))&&o?o.p(u,a):(o.d(1),o=i(u),o&&(o.c(),o.m(l.parentNode,l)))},d(u){u&&C(e),o.d(u),u&&C(l)}}}function M1(t){let e,l;return{c(){e=S(t[0]),l=S(" seconds")},m(n,i){$(n,e,i),$(n,l,i)},p(n,i){i&1&&X(e,n[0])},d(n){n&&C(e),n&&C(l)}}}function S1(t){let e,l;return{c(){e=S(t[3]),l=S(" minute")},m(n,i){$(n,e,i),$(n,l,i)},p(n,i){i&8&&X(e,n[3])},d(n){n&&C(e),n&&C(l)}}}function T1(t){let e,l;return{c(){e=S(t[3]),l=S(" minutes")},m(n,i){$(n,e,i),$(n,l,i)},p(n,i){i&8&&X(e,n[3])},d(n){n&&C(e),n&&C(l)}}}function N1(t){let e,l;return{c(){e=S(t[2]),l=S(" hour")},m(n,i){$(n,e,i),$(n,l,i)},p(n,i){i&4&&X(e,n[2])},d(n){n&&C(e),n&&C(l)}}}function A1(t){let e,l;return{c(){e=S(t[2]),l=S(" hours")},m(n,i){$(n,e,i),$(n,l,i)},p(n,i){i&4&&X(e,n[2])},d(n){n&&C(e),n&&C(l)}}}function P1(t){let e,l;return{c(){e=S(t[1]),l=S(" day")},m(n,i){$(n,e,i),$(n,l,i)},p(n,i){i&2&&X(e,n[1])},d(n){n&&C(e),n&&C(l)}}}function E1(t){let e,l;return{c(){e=S(t[1]),l=S(" days")},m(n,i){$(n,e,i),$(n,l,i)},p(n,i){i&2&&X(e,n[1])},d(n){n&&C(e),n&&C(l)}}}function D1(t){let e,l=t[0]&&tu(t);return{c(){l&&l.c(),e=Ve()},m(n,i){l&&l.m(n,i),$(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=tu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:fe,o:fe,d(n){l&&l.d(n),n&&C(e)}}}function I1(t,e,l){let{epoch:n}=e,i=0,o=0,u=0;return t.$$set=a=>{"epoch"in a&&l(0,n=a.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(1,i=Math.floor(n/86400)),l(2,o=Math.floor(n/3600)),l(3,u=Math.floor(n/60)))},[n,i,o,u]}class R1 extends Ee{constructor(e){super(),Pe(this,e,I1,D1,Ne,{epoch:0})}}function L1(t){let e,l,n;return{c(){e=m("span"),l=S(t[2]),r(e,"title",t[1]),r(e,"class",n="bd-"+t[0])},m(i,o){$(i,e,o),s(e,l)},p(i,[o]){o&4&&X(l,i[2]),o&2&&r(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&r(e,"class",n)},i:fe,o:fe,d(i){i&&C(e)}}}function O1(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=e;return t.$$set=u=>{"color"in u&&l(0,n=u.color),"title"in u&&l(1,i=u.title),"text"in u&&l(2,o=u.text)},[n,i,o]}class fn extends Ee{constructor(e){super(),Pe(this,e,O1,L1,Ne,{color:0,title:1,text:2})}}function F1(t){let e,l=`${Oe(t[0].getDate())}.${Oe(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Oe(t[0].getHours())}:${Oe(t[0].getMinutes())}`,n;return{c(){e=m("span"),n=S(l),r(e,"class",t[1])},m(i,o){$(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Oe(i[0].getDate())}.${Oe(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Oe(i[0].getHours())}:${Oe(i[0].getMinutes())}`)&&X(n,l),o&2&&r(e,"class",i[1])},d(i){i&&C(e)}}}function q1(t){let e=`${Oe(t[0].getDate())}. ${no[t[0].getMonth()]} ${Oe(t[0].getHours())}:${Oe(t[0].getMinutes())}`,l;return{c(){l=S(e)},m(n,i){$(n,l,i)},p(n,i){i&1&&e!==(e=`${Oe(n[0].getDate())}. ${no[n[0].getMonth()]} ${Oe(n[0].getHours())}:${Oe(n[0].getMinutes())}`)&&X(l,e)},d(n){n&&C(l)}}}function B1(t){let e;function l(o,u){return o[2]?q1:F1}let n=l(t),i=n(t);return{c(){i.c(),e=Ve()},m(o,u){i.m(o,u),$(o,e,u)},p(o,[u]){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:fe,o:fe,d(o){i.d(o),o&&C(e)}}}function U1(t,e,l){let{timestamp:n}=e,{fullTimeColor:i}=e,{offset:o}=e,u;return t.$$set=a=>{"timestamp"in a&&l(0,n=a.timestamp),"fullTimeColor"in a&&l(1,i=a.fullTimeColor),"offset"in a&&l(3,o=a.offset)},t.$$.update=()=>{t.$$.dirty&9&&(l(2,u=Math.abs(new Date().getTime()-n.getTime())<3e5),isNaN(o)||fl(n,o-(24+n.getHours()-n.getUTCHours())%24))},[n,i,u,o]}class Gc extends Ee{constructor(e){super(),Pe(this,e,U1,B1,Ne,{timestamp:0,fullTimeColor:1,offset:3})}}function j1(t){let e,l,n;return{c(){e=Fe("svg"),l=Fe("path"),n=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"),r(n,"stroke-linecap","round"),r(n,"stroke-linejoin","round"),r(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(i,o){$(i,e,o),s(e,l),s(e,n)},p:fe,i:fe,o:fe,d(i){i&&C(e)}}}class H1 extends Ee{constructor(e){super(),Pe(this,e,null,j1,Ne,{})}}function W1(t){let e,l;return{c(){e=Fe("svg"),l=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){$(n,e,i),s(e,l)},p:fe,i:fe,o:fe,d(n){n&&C(e)}}}class z1 extends Ee{constructor(e){super(),Pe(this,e,null,W1,Ne,{})}}function G1(t){let e,l;return{c(){e=Fe("svg"),l=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){$(n,e,i),s(e,l)},p:fe,i:fe,o:fe,d(n){n&&C(e)}}}class Bt extends Ee{constructor(e){super(),Pe(this,e,null,G1,Ne,{})}}function V1(t){let e,l;return{c(){e=Fe("svg"),l=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15M9 12l3 3m0 0l3-3m-3 3V2.25"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){$(n,e,i),s(e,l)},p:fe,i:fe,o:fe,d(n){n&&C(e)}}}class Vc extends Ee{constructor(e){super(),Pe(this,e,null,V1,Ne,{})}}function K1(t){let e,l,n=t[1].version+"",i;return{c(){e=S("AMS reader "),l=m("span"),i=S(n)},m(o,u){$(o,e,u),$(o,l,u),s(l,i)},p(o,u){u&2&&n!==(n=o[1].version+"")&&X(i,n)},d(o){o&&C(e),o&&C(l)}}}function lu(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=m("div"),n=S(l),i=S("\xB0C"),r(e,"class","flex-none my-auto")},m(o,u){$(o,e,u),s(e,n),s(e,i)},p(o,u){u&1&&l!==(l=(o[0].t>-50?o[0].t.toFixed(1):"-")+"")&&X(n,l)},d(o){o&&C(e)}}}function nu(t){let e,l="HAN: "+Ya(t[0].he),n;return{c(){e=m("div"),n=S(l),r(e,"class","bd-red")},m(i,o){$(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="HAN: "+Ya(i[0].he))&&X(n,l)},d(i){i&&C(e)}}}function iu(t){let e,l="MQTT: "+Qa(t[0].me),n;return{c(){e=m("div"),n=S(l),r(e,"class","bd-red")},m(i,o){$(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="MQTT: "+Qa(i[0].me))&&X(n,l)},d(i){i&&C(e)}}}function su(t){let e,l="PriceAPI: "+Xa(t[0].ee),n;return{c(){e=m("div"),n=S(l),r(e,"class","bd-red")},m(i,o){$(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="PriceAPI: "+Xa(i[0].ee))&&X(n,l)},d(i){i&&C(e)}}}function ou(t){let e,l,n,i,o,u;return l=new el({props:{to:"/configuration",$$slots:{default:[Y1]},$$scope:{ctx:t}}}),o=new el({props:{to:"/status",$$slots:{default:[Q1]},$$scope:{ctx:t}}}),{c(){e=m("div"),ie(l.$$.fragment),n=h(),i=m("div"),ie(o.$$.fragment),r(e,"class","flex-none px-1 mt-1"),r(e,"title","Configuration"),r(i,"class","flex-none px-1 mt-1"),r(i,"title","Device information")},m(a,c){$(a,e,c),le(l,e,null),$(a,n,c),$(a,i,c),le(o,i,null),u=!0},i(a){u||(D(l.$$.fragment,a),D(o.$$.fragment,a),u=!0)},o(a){q(l.$$.fragment,a),q(o.$$.fragment,a),u=!1},d(a){a&&C(e),ne(l),a&&C(n),a&&C(i),ne(o)}}}function Y1(t){let e,l;return e=new H1({}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function Q1(t){let e,l;return e=new z1({}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function ru(t){let e,l,n,i,o;const u=[Z1,X1],a=[];function c(f,_){return f[1].security==0||f[0].a?0:1}return l=c(t),n=a[l]=u[l](t),{c(){e=m("div"),n.c(),r(e,"class","flex-none mr-3 text-yellow-500"),r(e,"title",i="New version: "+t[2].tag_name)},m(f,_){$(f,e,_),a[l].m(e,null),o=!0},p(f,_){let p=l;l=c(f),l===p?a[l].p(f,_):(De(),q(a[p],1,1,()=>{a[p]=null}),Ie(),n=a[l],n?n.p(f,_):(n=a[l]=u[l](f),n.c()),D(n,1),n.m(e,null)),(!o||_&4&&i!==(i="New version: "+f[2].tag_name))&&r(e,"title",i)},i(f){o||(D(n),o=!0)},o(f){q(n),o=!1},d(f){f&&C(e),a[l].d()}}}function X1(t){let e,l,n=t[2].tag_name+"",i;return{c(){e=m("span"),l=S("New version: "),i=S(n)},m(o,u){$(o,e,u),s(e,l),s(e,i)},p(o,u){u&4&&n!==(n=o[2].tag_name+"")&&X(i,n)},i:fe,o:fe,d(o){o&&C(e)}}}function Z1(t){let e,l,n,i=t[2].tag_name+"",o,u,a,c,f,_;return a=new Vc({}),{c(){e=m("button"),l=m("span"),n=S("New version: "),o=S(i),u=h(),ie(a.$$.fragment),r(l,"class","mt-1"),r(e,"class","flex")},m(p,b){$(p,e,b),s(e,l),s(l,n),s(l,o),s(e,u),le(a,e,null),c=!0,f||(_=ee(e,"click",t[3]),f=!0)},p(p,b){(!c||b&4)&&i!==(i=p[2].tag_name+"")&&X(o,i)},i(p){c||(D(a.$$.fragment,p),c=!0)},o(p){q(a.$$.fragment,p),c=!1},d(p){p&&C(e),ne(a),f=!1,_()}}}function J1(t){let e,l,n,i,o,u,a,c,f,_,p,b,v=(t[0].m?(t[0].m/1e3).toFixed(1):"-")+"",d,M,y,T,N,E,B,P,L,O,F,x,j,z,G,V,W,U,K,H,Y,Z,re,ue,ke,me,Se,je,Re,He;i=new el({props:{to:"/",$$slots:{default:[K1]},$$scope:{ctx:t}}}),c=new R1({props:{epoch:t[0].u}});let we=t[0].t>-50&&lu(t);N=new fn({props:{title:"ESP",text:t[1].booting?"Booting":t[0].v>2?t[0].v.toFixed(2)+"V":"ESP",color:ql(t[1].booting?2:t[0].em)}}),B=new fn({props:{title:"HAN",text:"HAN",color:ql(t[1].booting?9:t[0].hm)}}),L=new fn({props:{title:"WiFi",text:t[0].r?t[0].r.toFixed(0)+"dBm":"WiFi",color:ql(t[1].booting?9:t[0].wm)}}),F=new fn({props:{title:"MQTT",text:"MQTT",color:ql(t[1].booting?9:t[0].mm)}});let Te=(t[0].he<0||t[0].he>0)&&nu(t),Le=t[0].me<0&&iu(t),$e=(t[0].ee>0||t[0].ee<0)&&su(t);re=new Gc({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),offset:t[1].clock_offset,fullTimeColor:"text-red-500"}});let w=t[1].vndcfg&&t[1].usrcfg&&ou(t);je=new Bt({});let g=t[1].fwconsent===1&&t[2]&&ru(t);return{c(){e=m("nav"),l=m("div"),n=m("div"),ie(i.$$.fragment),o=h(),u=m("div"),a=m("div"),ie(c.$$.fragment),f=h(),we&&we.c(),_=h(),p=m("div"),b=S("Free mem: "),d=S(v),M=S("kb"),y=h(),T=m("div"),ie(N.$$.fragment),E=h(),ie(B.$$.fragment),P=h(),ie(L.$$.fragment),O=h(),ie(F.$$.fragment),x=h(),Te&&Te.c(),j=h(),Le&&Le.c(),z=h(),$e&&$e.c(),G=h(),V=m("div"),W=m("div"),U=m("a"),K=m("img"),Y=h(),Z=m("div"),ie(re.$$.fragment),ue=h(),w&&w.c(),ke=h(),me=m("div"),Se=m("a"),ie(je.$$.fragment),Re=h(),g&&g.c(),r(n,"class","flex text-lg text-gray-100 p-2"),r(a,"class","flex-none my-auto"),r(p,"class","flex-none my-auto"),r(u,"class","flex-none my-auto p-2 flex space-x-4"),r(T,"class","flex-auto flex-wrap my-auto justify-center p-2"),r(K,"class","gh-logo"),Js(K.src,H=$1)||r(K,"src",H),r(K,"alt","GitHub repo"),r(U,"class","float-right"),r(U,"href","https://github.com/UtilitechAS/amsreader-firmware"),r(U,"target","_blank"),r(U,"rel","noreferrer"),r(U,"aria-label","GitHub"),r(W,"class","flex-none"),r(Z,"class","flex-none my-auto px-2"),r(Se,"href",Ut("")),r(Se,"target","_blank"),r(Se,"rel","noreferrer"),r(me,"class","flex-none px-1 mt-1"),r(me,"title","Documentation"),r(V,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),r(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),r(e,"class","bg-violet-600 p-1 rounded-md mx-2")},m(k,A){$(k,e,A),s(e,l),s(l,n),le(i,n,null),s(l,o),s(l,u),s(u,a),le(c,a,null),s(u,f),we&&we.m(u,null),s(u,_),s(u,p),s(p,b),s(p,d),s(p,M),s(l,y),s(l,T),le(N,T,null),s(T,E),le(B,T,null),s(T,P),le(L,T,null),s(T,O),le(F,T,null),s(l,x),Te&&Te.m(l,null),s(l,j),Le&&Le.m(l,null),s(l,z),$e&&$e.m(l,null),s(l,G),s(l,V),s(V,W),s(W,U),s(U,K),s(V,Y),s(V,Z),le(re,Z,null),s(V,ue),w&&w.m(V,null),s(V,ke),s(V,me),s(me,Se),le(je,Se,null),s(V,Re),g&&g.m(V,null),He=!0},p(k,[A]){const I={};A&18&&(I.$$scope={dirty:A,ctx:k}),i.$set(I);const Q={};A&1&&(Q.epoch=k[0].u),c.$set(Q),k[0].t>-50?we?we.p(k,A):(we=lu(k),we.c(),we.m(u,_)):we&&(we.d(1),we=null),(!He||A&1)&&v!==(v=(k[0].m?(k[0].m/1e3).toFixed(1):"-")+"")&&X(d,v);const J={};A&3&&(J.text=k[1].booting?"Booting":k[0].v>2?k[0].v.toFixed(2)+"V":"ESP"),A&3&&(J.color=ql(k[1].booting?2:k[0].em)),N.$set(J);const se={};A&3&&(se.color=ql(k[1].booting?9:k[0].hm)),B.$set(se);const ce={};A&1&&(ce.text=k[0].r?k[0].r.toFixed(0)+"dBm":"WiFi"),A&3&&(ce.color=ql(k[1].booting?9:k[0].wm)),L.$set(ce);const ve={};A&3&&(ve.color=ql(k[1].booting?9:k[0].mm)),F.$set(ve),k[0].he<0||k[0].he>0?Te?Te.p(k,A):(Te=nu(k),Te.c(),Te.m(l,j)):Te&&(Te.d(1),Te=null),k[0].me<0?Le?Le.p(k,A):(Le=iu(k),Le.c(),Le.m(l,z)):Le&&(Le.d(1),Le=null),k[0].ee>0||k[0].ee<0?$e?$e.p(k,A):($e=su(k),$e.c(),$e.m(l,G)):$e&&($e.d(1),$e=null);const Me={};A&1&&(Me.timestamp=k[0].c?new Date(k[0].c*1e3):new Date(0)),A&2&&(Me.offset=k[1].clock_offset),re.$set(Me),k[1].vndcfg&&k[1].usrcfg?w?A&2&&D(w,1):(w=ou(k),w.c(),D(w,1),w.m(V,ke)):w&&(De(),q(w,1,1,()=>{w=null}),Ie()),k[1].fwconsent===1&&k[2]?g?(g.p(k,A),A&6&&D(g,1)):(g=ru(k),g.c(),D(g,1),g.m(V,null)):g&&(De(),q(g,1,1,()=>{g=null}),Ie())},i(k){He||(D(i.$$.fragment,k),D(c.$$.fragment,k),D(N.$$.fragment,k),D(B.$$.fragment,k),D(L.$$.fragment,k),D(F.$$.fragment,k),D(re.$$.fragment,k),D(w),D(je.$$.fragment,k),D(g),He=!0)},o(k){q(i.$$.fragment,k),q(c.$$.fragment,k),q(N.$$.fragment,k),q(B.$$.fragment,k),q(L.$$.fragment,k),q(F.$$.fragment,k),q(re.$$.fragment,k),q(w),q(je.$$.fragment,k),q(g),He=!1},d(k){k&&C(e),ne(i),ne(c),we&&we.d(),ne(N),ne(B),ne(L),ne(F),Te&&Te.d(),Le&&Le.d(),$e&&$e.d(),ne(re),w&&w.d(),ne(je),g&&g.d()}}}function x1(t,e,l){let{data:n={}}=e,i={},o={};function u(){confirm("Do you want to upgrade this device to "+o.tag_name+"?")&&(!ri(i.board)||confirm($s(be(i.chip,i.board))))&&(jt.update(a=>(a.upgrading=!0,a)),Wc(o.tag_name))}return jt.subscribe(a=>{l(1,i=a),a.fwconsent===1&&C1()}),So.subscribe(a=>{l(2,o=zc(i.version,a))}),t.$$set=a=>{"data"in a&&l(0,n=a.data)},[n,i,o,u]}class em extends Ee{constructor(e){super(),Pe(this,e,x1,J1,Ne,{data:0})}}function tm(t){let e,l,n,i;return{c(){e=Fe("svg"),l=Fe("path"),n=Fe("path"),r(l,"d",Zs(150,150,115,210,510)),r(l,"stroke","#eee"),r(l,"fill","none"),r(l,"stroke-width","55"),r(n,"d",i=Zs(150,150,115,210,210+300*t[0]/100)),r(n,"stroke",t[1]),r(n,"fill","none"),r(n,"stroke-width","55"),r(e,"viewBox","0 0 300 300"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"height","100%")},m(o,u){$(o,e,u),s(e,l),s(e,n)},p(o,[u]){u&1&&i!==(i=Zs(150,150,115,210,210+300*o[0]/100))&&r(n,"d",i),u&2&&r(n,"stroke",o[1])},i:fe,o:fe,d(o){o&&C(e)}}}function au(t,e,l,n){var i=(n-90)*Math.PI/180;return{x:t+l*Math.cos(i),y:e+l*Math.sin(i)}}function Zs(t,e,l,n,i){var o=au(t,e,l,i),u=au(t,e,l,n),a=i-n<=180?"0":"1",c=["M",o.x,o.y,"A",l,l,0,a,0,u.x,u.y].join(" ");return c}function lm(t,e,l){let{pct:n=0}=e,{color:i="red"}=e;return t.$$set=o=>{"pct"in o&&l(0,n=o.pct),"color"in o&&l(1,i=o.color)},[n,i]}class nm extends Ee{constructor(e){super(),Pe(this,e,lm,tm,Ne,{pct:0,color:1})}}function uu(t){let e,l,n,i,o,u,a,c;return{c(){e=m("br"),l=h(),n=m("span"),i=S(t[3]),o=h(),u=m("span"),a=S(t[4]),c=S("/kWh"),r(n,"class","pl-sub"),r(u,"class","pl-snt")},m(f,_){$(f,e,_),$(f,l,_),$(f,n,_),s(n,i),$(f,o,_),$(f,u,_),s(u,a),s(u,c)},p(f,_){_&8&&X(i,f[3]),_&16&&X(a,f[4])},d(f){f&&C(e),f&&C(l),f&&C(n),f&&C(o),f&&C(u)}}}function im(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,M,y;l=new nm({props:{pct:t[6],color:t[5](t[6])}});let T=t[3]&&uu(t);return{c(){e=m("div"),ie(l.$$.fragment),n=h(),i=m("span"),o=m("span"),u=S(t[2]),a=h(),c=m("br"),f=h(),_=m("span"),p=S(t[0]),b=h(),v=m("span"),d=S(t[1]),M=h(),T&&T.c(),r(o,"class","pl-lab"),r(_,"class","pl-val"),r(v,"class","pl-unt"),r(i,"class","pl-ov"),r(e,"class","pl-root")},m(N,E){$(N,e,E),le(l,e,null),s(e,n),s(e,i),s(i,o),s(o,u),s(i,a),s(i,c),s(i,f),s(i,_),s(_,p),s(i,b),s(i,v),s(v,d),s(i,M),T&&T.m(i,null),y=!0},p(N,[E]){const B={};E&64&&(B.pct=N[6]),E&96&&(B.color=N[5](N[6])),l.$set(B),(!y||E&4)&&X(u,N[2]),(!y||E&1)&&X(p,N[0]),(!y||E&2)&&X(d,N[1]),N[3]?T?T.p(N,E):(T=uu(N),T.c(),T.m(i,null)):T&&(T.d(1),T=null)},i(N){y||(D(l.$$.fragment,N),y=!0)},o(N){q(l.$$.fragment,N),y=!1},d(N){N&&C(e),ne(l),T&&T.d()}}}function sm(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:u}=e,{sub:a=""}=e,{subunit:c=""}=e,{colorFn:f}=e,_=0;return t.$$set=p=>{"val"in p&&l(0,n=p.val),"max"in p&&l(7,i=p.max),"unit"in p&&l(1,o=p.unit),"label"in p&&l(2,u=p.label),"sub"in p&&l(3,a=p.sub),"subunit"in p&&l(4,c=p.subunit),"colorFn"in p&&l(5,f=p.colorFn)},t.$$.update=()=>{t.$$.dirty&129&&l(6,_=Math.min(n,i)/i*100)},[n,o,u,a,c,f,_,i]}class Kc extends Ee{constructor(e){super(),Pe(this,e,sm,im,Ne,{val:0,max:7,unit:1,label:2,sub:3,subunit:4,colorFn:5})}}function fu(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function cu(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function mu(t,e,l){const n=t.slice();return n[13]=e[l],n}function pu(t){let e,l,n,i,o,u,a=t[0].title&&_u(t),c=t[0].y.ticks,f=[];for(let d=0;d20||t[11]%2==0)&&bu(t);return{c(){e=Fe("g"),n&&n.c(),r(e,"class","tick"),r(e,"transform",l="translate("+t[5](t[11])+","+t[4]+")")},m(i,o){$(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[11]%2==0?n?n.p(i,o):(n=bu(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&48&&l!==(l="translate("+i[5](i[11])+","+i[4]+")")&&r(e,"transform",l)},d(i){i&&C(e),n&&n.d()}}}function bu(t){let e,l=t[9].label+"",n,i;return{c(){e=Fe("text"),n=S(l),r(e,"x",i=t[3]/2),r(e,"y","-4")},m(o,u){$(o,e,u),s(e,n)},p(o,u){u&1&&l!==(l=o[9].label+"")&&X(n,l),u&8&&i!==(i=o[3]/2)&&r(e,"x",i)},d(o){o&&C(e)}}}function gu(t){let e=!isNaN(t[5](t[11])),l,n=e&&hu(t);return{c(){n&&n.c(),l=Ve()},m(i,o){n&&n.m(i,o),$(i,l,o)},p(i,o){o&32&&(e=!isNaN(i[5](i[11]))),e?n?n.p(i,o):(n=hu(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&C(l)}}}function ku(t){let e,l,n=t[9].value!==void 0&&wu(t),i=t[9].value2>1e-4&&$u(t);return{c(){e=Fe("g"),n&&n.c(),l=Fe("g"),i&&i.c()},m(o,u){$(o,e,u),n&&n.m(e,null),$(o,l,u),i&&i.m(l,null)},p(o,u){o[9].value!==void 0?n?n.p(o,u):(n=wu(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[9].value2>1e-4?i?i.p(o,u):(i=$u(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&C(e),n&&n.d(),o&&C(l),i&&i.d()}}}function wu(t){let e,l,n,i,o,u,a,c=t[3]>15&&yu(t);return{c(){e=Fe("rect"),c&&c.c(),a=Ve(),r(e,"x",l=t[5](t[11])+2),r(e,"y",n=t[6](t[9].value)),r(e,"width",i=t[3]-4),r(e,"height",o=t[6](t[0].y.min)-t[6](Math.min(t[0].y.min,0)+t[9].value)),r(e,"fill",u=t[9].color)},m(f,_){$(f,e,_),c&&c.m(f,_),$(f,a,_)},p(f,_){_&32&&l!==(l=f[5](f[11])+2)&&r(e,"x",l),_&65&&n!==(n=f[6](f[9].value))&&r(e,"y",n),_&8&&i!==(i=f[3]-4)&&r(e,"width",i),_&65&&o!==(o=f[6](f[0].y.min)-f[6](Math.min(f[0].y.min,0)+f[9].value))&&r(e,"height",o),_&1&&u!==(u=f[9].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,_):(c=yu(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&C(e),c&&c.d(f),f&&C(a)}}}function yu(t){let e,l=t[9].label+"",n,i,o,u,a,c,f=t[9].title&&Cu(t);return{c(){e=Fe("text"),n=S(l),f&&f.c(),c=Ve(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor",o=t[3]t[6](0)-t[7]?t[9].color:"white"),r(e,"transform",a="translate("+(t[5](t[11])+t[3]/2)+" "+(t[6](t[9].value)>t[6](0)-t[7]?t[6](t[9].value)-t[7]:t[6](t[9].value)+10)+") rotate("+(t[3]_[6](0)-_[7]?_[9].color:"white")&&r(e,"fill",u),p&233&&a!==(a="translate("+(_[5](_[11])+_[3]/2)+" "+(_[6](_[9].value)>_[6](0)-_[7]?_[6](_[9].value)-_[7]:_[6](_[9].value)+10)+") rotate("+(_[3]15&&Mu(t);return{c(){e=Fe("rect"),c&&c.c(),a=Ve(),r(e,"x",l=t[5](t[11])+2),r(e,"y",n=t[6](0)),r(e,"width",i=t[3]-4),r(e,"height",o=t[6](t[0].y.min)-t[6](t[0].y.min+t[9].value2)),r(e,"fill",u=t[9].color2?t[9].color2:t[9].color)},m(f,_){$(f,e,_),c&&c.m(f,_),$(f,a,_)},p(f,_){_&32&&l!==(l=f[5](f[11])+2)&&r(e,"x",l),_&64&&n!==(n=f[6](0))&&r(e,"y",n),_&8&&i!==(i=f[3]-4)&&r(e,"width",i),_&65&&o!==(o=f[6](f[0].y.min)-f[6](f[0].y.min+f[9].value2))&&r(e,"height",o),_&1&&u!==(u=f[9].color2?f[9].color2:f[9].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,_):(c=Mu(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&C(e),c&&c.d(f),f&&C(a)}}}function Mu(t){let e,l=t[9].label2+"",n,i,o,u,a,c=t[9].title2&&Su(t);return{c(){e=Fe("text"),n=S(l),c&&c.c(),a=Ve(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor","middle"),r(e,"fill",o=t[6](-t[9].value2)t[8].call(e))},m(i,o){$(i,e,o),n&&n.m(e,null),l=o0(e,t[8].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=pu(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:fe,o:fe,d(i){i&&C(e),n&&n.d(),l()}}}let cn=30;function rm(t,e,l){let{config:n}=e,i,o,u,a,c,f,_;function p(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=b=>{"config"in b&&l(0,n=b.config)},t.$$.update=()=>{if(t.$$.dirty&31){l(4,f=o-(n.title?20:0));let b=i-(n.padding.left+n.padding.right);l(3,u=b/n.points.length),l(7,_=un.y.max?M=n.padding.bottom:df||M<0?0:M})}},[n,i,o,u,f,a,c,_,p]}class pn extends Ee{constructor(e){super(),Pe(this,e,rm,om,Ne,{config:0})}}function am(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function um(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{ds:u}=e,a={};function c(f){return{label:ge(f)+"V",title:f.toFixed(1)+" V",value:isNaN(f)?0:f,color:g1(f||0)}}return t.$$set=f=>{"u1"in f&&l(1,n=f.u1),"u2"in f&&l(2,i=f.u2),"u3"in f&&l(3,o=f.u3),"ds"in f&&l(4,u=f.ds)},t.$$.update=()=>{if(t.$$.dirty&30){let f=[],_=[];n>0&&(f.push({label:u===1?"L1-L2":"L1"}),_.push(c(n))),i>0&&(f.push({label:u===1?"L1-L3":"L2"}),_.push(c(i))),o>0&&(f.push({label:u===1?"L2-L3":"L3"}),_.push(c(o))),l(0,a={padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:f},points:_})}},[a,n,i,o,u]}class fm extends Ee{constructor(e){super(),Pe(this,e,um,am,Ne,{u1:1,u2:2,u3:3,ds:4})}}function cm(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function mm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{i1:u}=e,{i2:a}=e,{i3:c}=e,{max:f}=e,_={};function p(b){return{label:ge(b)+"A",title:b.toFixed(1)+" A",value:isNaN(b)?0:b,color:Rc(b?b/f*100:0)}}return t.$$set=b=>{"u1"in b&&l(1,n=b.u1),"u2"in b&&l(2,i=b.u2),"u3"in b&&l(3,o=b.u3),"i1"in b&&l(4,u=b.i1),"i2"in b&&l(5,a=b.i2),"i3"in b&&l(6,c=b.i3),"max"in b&&l(7,f=b.max)},t.$$.update=()=>{if(t.$$.dirty&254){let b=[],v=[];n>0&&(b.push({label:"L1"}),v.push(p(u))),i>0&&(b.push({label:"L2"}),v.push(p(a))),o>0&&(b.push({label:"L3"}),v.push(p(c))),l(0,_={padding:{top:20,right:15,bottom:20,left:35},y:{min:0,max:f,ticks:[{value:0,label:"0%"},{value:f/4,label:"25%"},{value:f/2,label:"50%"},{value:f/4*3,label:"75%"},{value:f,label:"100%"}]},x:{ticks:b},points:v})}},[_,n,i,o,u,a,c,f]}class pm extends Ee{constructor(e){super(),Pe(this,e,mm,cm,Ne,{u1:1,u2:2,u3:3,i1:4,i2:5,i3:6,max:7})}}function _m(t){let e,l,n,i,o,u,a,c=(typeof t[0]<"u"?t[0].toFixed(0):"-")+"",f,_,p,b,v,d,M=(typeof t[1]<"u"?t[1].toFixed(0):"-")+"",y,T,N,E,B,P,L,O=(typeof t[2]<"u"?t[2].toFixed(1):"-")+"",F,x,j,z,G,V,W=(typeof t[3]<"u"?t[3].toFixed(1):"-")+"",U,K;return{c(){e=m("div"),l=m("strong"),l.textContent="Reactive",n=h(),i=m("div"),o=m("div"),o.textContent="Instant in",u=h(),a=m("div"),f=S(c),_=S(" VAr"),p=h(),b=m("div"),b.textContent="Instant out",v=h(),d=m("div"),y=S(M),T=S(" VAr"),N=h(),E=m("div"),B=m("div"),B.textContent="Total in",P=h(),L=m("div"),F=S(O),x=S(" kVArh"),j=h(),z=m("div"),z.textContent="Total out",G=h(),V=m("div"),U=S(W),K=S(" kVArh"),r(a,"class","text-right"),r(d,"class","text-right"),r(i,"class","grid grid-cols-2 mt-4"),r(L,"class","text-right"),r(V,"class","text-right"),r(E,"class","grid grid-cols-2 mt-4"),r(e,"class","mx-2 text-sm")},m(H,Y){$(H,e,Y),s(e,l),s(e,n),s(e,i),s(i,o),s(i,u),s(i,a),s(a,f),s(a,_),s(i,p),s(i,b),s(i,v),s(i,d),s(d,y),s(d,T),s(e,N),s(e,E),s(E,B),s(E,P),s(E,L),s(L,F),s(L,x),s(E,j),s(E,z),s(E,G),s(E,V),s(V,U),s(V,K)},p(H,[Y]){Y&1&&c!==(c=(typeof H[0]<"u"?H[0].toFixed(0):"-")+"")&&X(f,c),Y&2&&M!==(M=(typeof H[1]<"u"?H[1].toFixed(0):"-")+"")&&X(y,M),Y&4&&O!==(O=(typeof H[2]<"u"?H[2].toFixed(1):"-")+"")&&X(F,O),Y&8&&W!==(W=(typeof H[3]<"u"?H[3].toFixed(1):"-")+"")&&X(U,W)},i:fe,o:fe,d(H){H&&C(e)}}}function dm(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:u}=e;return t.$$set=a=>{"importInstant"in a&&l(0,n=a.importInstant),"exportInstant"in a&&l(1,i=a.exportInstant),"importTotal"in a&&l(2,o=a.importTotal),"exportTotal"in a&&l(3,u=a.exportTotal)},[n,i,o,u]}class vm extends Ee{constructor(e){super(),Pe(this,e,dm,_m,Ne,{importInstant:0,exportInstant:1,importTotal:2,exportTotal:3})}}function Nu(t){let e;function l(o,u){return o[3]?bm:hm}let n=l(t),i=n(t);return{c(){i.c(),e=Ve()},m(o,u){i.m(o,u),$(o,e,u)},p(o,u){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&C(e)}}}function hm(t){let e,l,n,i,o,u,a=ge(t[1].h.u,2)+"",c,f,_,p,b,v,d=ge(t[1].d.u,1)+"",M,y,T,N,E,B,P=ge(t[1].m.u)+"",L,O,F,x,j,z,G=ge(t[0].last_month.u)+"",V,W,U,K,H=t[4]&&Au(t);return{c(){e=m("strong"),e.textContent="Consumption",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=S(a),f=S(" kWh"),_=h(),p=m("div"),p.textContent="Day",b=h(),v=m("div"),M=S(d),y=S(" kWh"),T=h(),N=m("div"),N.textContent="Month",E=h(),B=m("div"),L=S(P),O=S(" kWh"),F=h(),x=m("div"),x.textContent="Last month",j=h(),z=m("div"),V=S(G),W=S(" kWh"),U=h(),H&&H.c(),K=Ve(),r(u,"class","text-right"),r(v,"class","text-right"),r(B,"class","text-right"),r(z,"class","text-right"),r(n,"class","grid grid-cols-2 mb-3")},m(Y,Z){$(Y,e,Z),$(Y,l,Z),$(Y,n,Z),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,_),s(n,p),s(n,b),s(n,v),s(v,M),s(v,y),s(n,T),s(n,N),s(n,E),s(n,B),s(B,L),s(B,O),s(n,F),s(n,x),s(n,j),s(n,z),s(z,V),s(z,W),$(Y,U,Z),H&&H.m(Y,Z),$(Y,K,Z)},p(Y,Z){Z&2&&a!==(a=ge(Y[1].h.u,2)+"")&&X(c,a),Z&2&&d!==(d=ge(Y[1].d.u,1)+"")&&X(M,d),Z&2&&P!==(P=ge(Y[1].m.u)+"")&&X(L,P),Z&1&&G!==(G=ge(Y[0].last_month.u)+"")&&X(V,G),Y[4]?H?H.p(Y,Z):(H=Au(Y),H.c(),H.m(K.parentNode,K)):H&&(H.d(1),H=null)},d(Y){Y&&C(e),Y&&C(l),Y&&C(n),Y&&C(U),H&&H.d(Y),Y&&C(K)}}}function bm(t){let e,l,n,i,o,u,a=ge(t[1].h.u,2)+"",c,f,_,p,b,v,d,M=ge(t[1].d.u,1)+"",y,T,N,E,B,P,L,O=ge(t[1].m.u)+"",F,x,j,z,G,V,W,U=ge(t[0].last_month.u)+"",K,H,Y,Z,re,ue,ke,me,Se,je,Re,He=ge(t[1].h.p,2)+"",we,Te,Le,$e,w,g,k,A=ge(t[1].d.p,1)+"",I,Q,J,se,ce,ve,Me,oe=ge(t[1].m.p)+"",pe,Be,_e,ye,vt,Hl,tl,ct=ge(t[0].last_month.p)+"",Tl,pl,Ht,ht,Qe=t[4]&&Pu(t),Xe=t[4]&&Eu(t),Ze=t[4]&&Du(t),Ue=t[4]&&Iu(t),Je=t[4]&&Ru(t),We=t[4]&&Lu(t),xe=t[4]&&Ou(t),et=t[4]&&Fu(t);return{c(){e=m("strong"),e.textContent="Import",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=S(a),f=S(" kWh"),_=h(),Qe&&Qe.c(),p=h(),b=m("div"),b.textContent="Day",v=h(),d=m("div"),y=S(M),T=S(" kWh"),N=h(),Xe&&Xe.c(),E=h(),B=m("div"),B.textContent="Month",P=h(),L=m("div"),F=S(O),x=S(" kWh"),j=h(),Ze&&Ze.c(),z=h(),G=m("div"),G.textContent="Last mo.",V=h(),W=m("div"),K=S(U),H=S(" kWh"),Y=h(),Ue&&Ue.c(),re=h(),ue=m("strong"),ue.textContent="Export",ke=h(),me=m("div"),Se=m("div"),Se.textContent="Hour",je=h(),Re=m("div"),we=S(He),Te=S(" kWh"),Le=h(),Je&&Je.c(),$e=h(),w=m("div"),w.textContent="Day",g=h(),k=m("div"),I=S(A),Q=S(" kWh"),J=h(),We&&We.c(),se=h(),ce=m("div"),ce.textContent="Month",ve=h(),Me=m("div"),pe=S(oe),Be=S(" kWh"),_e=h(),xe&&xe.c(),ye=h(),vt=m("div"),vt.textContent="Last mo.",Hl=h(),tl=m("div"),Tl=S(ct),pl=S(" kWh"),Ht=h(),et&&et.c(),r(u,"class","text-right"),r(d,"class","text-right"),r(L,"class","text-right"),r(W,"class","text-right"),r(n,"class",Z="grid grid-cols-"+t[5]+" mb-3"),r(Re,"class","text-right"),r(k,"class","text-right"),r(Me,"class","text-right"),r(tl,"class","text-right"),r(me,"class",ht="grid grid-cols-"+t[5])},m(de,Ce){$(de,e,Ce),$(de,l,Ce),$(de,n,Ce),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,_),Qe&&Qe.m(n,null),s(n,p),s(n,b),s(n,v),s(n,d),s(d,y),s(d,T),s(n,N),Xe&&Xe.m(n,null),s(n,E),s(n,B),s(n,P),s(n,L),s(L,F),s(L,x),s(n,j),Ze&&Ze.m(n,null),s(n,z),s(n,G),s(n,V),s(n,W),s(W,K),s(W,H),s(n,Y),Ue&&Ue.m(n,null),$(de,re,Ce),$(de,ue,Ce),$(de,ke,Ce),$(de,me,Ce),s(me,Se),s(me,je),s(me,Re),s(Re,we),s(Re,Te),s(me,Le),Je&&Je.m(me,null),s(me,$e),s(me,w),s(me,g),s(me,k),s(k,I),s(k,Q),s(me,J),We&&We.m(me,null),s(me,se),s(me,ce),s(me,ve),s(me,Me),s(Me,pe),s(Me,Be),s(me,_e),xe&&xe.m(me,null),s(me,ye),s(me,vt),s(me,Hl),s(me,tl),s(tl,Tl),s(tl,pl),s(me,Ht),et&&et.m(me,null)},p(de,Ce){Ce&2&&a!==(a=ge(de[1].h.u,2)+"")&&X(c,a),de[4]?Qe?Qe.p(de,Ce):(Qe=Pu(de),Qe.c(),Qe.m(n,p)):Qe&&(Qe.d(1),Qe=null),Ce&2&&M!==(M=ge(de[1].d.u,1)+"")&&X(y,M),de[4]?Xe?Xe.p(de,Ce):(Xe=Eu(de),Xe.c(),Xe.m(n,E)):Xe&&(Xe.d(1),Xe=null),Ce&2&&O!==(O=ge(de[1].m.u)+"")&&X(F,O),de[4]?Ze?Ze.p(de,Ce):(Ze=Du(de),Ze.c(),Ze.m(n,z)):Ze&&(Ze.d(1),Ze=null),Ce&1&&U!==(U=ge(de[0].last_month.u)+"")&&X(K,U),de[4]?Ue?Ue.p(de,Ce):(Ue=Iu(de),Ue.c(),Ue.m(n,null)):Ue&&(Ue.d(1),Ue=null),Ce&32&&Z!==(Z="grid grid-cols-"+de[5]+" mb-3")&&r(n,"class",Z),Ce&2&&He!==(He=ge(de[1].h.p,2)+"")&&X(we,He),de[4]?Je?Je.p(de,Ce):(Je=Ru(de),Je.c(),Je.m(me,$e)):Je&&(Je.d(1),Je=null),Ce&2&&A!==(A=ge(de[1].d.p,1)+"")&&X(I,A),de[4]?We?We.p(de,Ce):(We=Lu(de),We.c(),We.m(me,se)):We&&(We.d(1),We=null),Ce&2&&oe!==(oe=ge(de[1].m.p)+"")&&X(pe,oe),de[4]?xe?xe.p(de,Ce):(xe=Ou(de),xe.c(),xe.m(me,ye)):xe&&(xe.d(1),xe=null),Ce&1&&ct!==(ct=ge(de[0].last_month.p)+"")&&X(Tl,ct),de[4]?et?et.p(de,Ce):(et=Fu(de),et.c(),et.m(me,null)):et&&(et.d(1),et=null),Ce&32&&ht!==(ht="grid grid-cols-"+de[5])&&r(me,"class",ht)},d(de){de&&C(e),de&&C(l),de&&C(n),Qe&&Qe.d(),Xe&&Xe.d(),Ze&&Ze.d(),Ue&&Ue.d(),de&&C(re),de&&C(ue),de&&C(ke),de&&C(me),Je&&Je.d(),We&&We.d(),xe&&xe.d(),et&&et.d()}}}function Au(t){let e,l,n,i,o,u,a=ge(t[1].h.c,2)+"",c,f,_,p,b,v,d,M=ge(t[1].d.c,1)+"",y,T,N,E,B,P,L,O=ge(t[1].m.c)+"",F,x,j,z,G,V,W,U=ge(t[0].last_month.c)+"",K,H,Y;return{c(){e=m("strong"),e.textContent="Cost",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=S(a),f=h(),_=S(t[2]),p=h(),b=m("div"),b.textContent="Day",v=h(),d=m("div"),y=S(M),T=h(),N=S(t[2]),E=h(),B=m("div"),B.textContent="Month",P=h(),L=m("div"),F=S(O),x=h(),j=S(t[2]),z=h(),G=m("div"),G.textContent="Last month",V=h(),W=m("div"),K=S(U),H=h(),Y=S(t[2]),r(u,"class","text-right"),r(d,"class","text-right"),r(L,"class","text-right"),r(W,"class","text-right"),r(n,"class","grid grid-cols-2")},m(Z,re){$(Z,e,re),$(Z,l,re),$(Z,n,re),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(u,_),s(n,p),s(n,b),s(n,v),s(n,d),s(d,y),s(d,T),s(d,N),s(n,E),s(n,B),s(n,P),s(n,L),s(L,F),s(L,x),s(L,j),s(n,z),s(n,G),s(n,V),s(n,W),s(W,K),s(W,H),s(W,Y)},p(Z,re){re&2&&a!==(a=ge(Z[1].h.c,2)+"")&&X(c,a),re&4&&X(_,Z[2]),re&2&&M!==(M=ge(Z[1].d.c,1)+"")&&X(y,M),re&4&&X(N,Z[2]),re&2&&O!==(O=ge(Z[1].m.c)+"")&&X(F,O),re&4&&X(j,Z[2]),re&1&&U!==(U=ge(Z[0].last_month.c)+"")&&X(K,U),re&4&&X(Y,Z[2])},d(Z){Z&&C(e),Z&&C(l),Z&&C(n)}}}function Pu(t){let e,l=ge(t[1].h.c,2)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].h.c,2)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Eu(t){let e,l=ge(t[1].d.c,1)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].d.c,1)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Du(t){let e,l=ge(t[1].m.c)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].m.c)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Iu(t){let e,l=ge(t[0].last_month.c)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ge(u[0].last_month.c)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Ru(t){let e,l=ge(t[1].h.i,2)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].h.i,2)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Lu(t){let e,l=ge(t[1].d.i,1)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].d.i,1)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Ou(t){let e,l=ge(t[1].m.i)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].m.i)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Fu(t){let e,l=ge(t[0].last_month.i)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ge(u[0].last_month.i)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function gm(t){let e,l,n,i,o,u,a=t[1]&&Nu(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Real time calculation",n=h(),i=m("br"),o=m("br"),u=h(),a&&a.c(),r(e,"class","mx-2 text-sm")},m(c,f){$(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),s(e,u),a&&a.m(e,null)},p(c,[f]){c[1]?a?a.p(c,f):(a=Nu(c),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i:fe,o:fe,d(c){c&&C(e),a&&a.d()}}}function km(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:u}=e,a=!1,c=3;return t.$$set=f=>{"sysinfo"in f&&l(0,n=f.sysinfo),"data"in f&&l(1,i=f.data),"currency"in f&&l(2,o=f.currency),"hasExport"in f&&l(3,u=f.hasExport)},t.$$.update=()=>{t.$$.dirty&18&&(l(4,a=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(5,c=a?3:2))},[n,i,o,u,a,c]}class wm extends Ee{constructor(e){super(),Pe(this,e,km,gm,Ne,{sysinfo:0,data:1,currency:2,hasExport:3})}}function ym(t){let e,l,n=Ja(t[0].source)+"",i,o,u,a;return u=new pn({props:{config:t[1]}}),{c(){e=m("a"),l=S("Provided by: "),i=S(n),o=h(),ie(u.$$.fragment),r(e,"href","https://transparency.entsoe.eu/"),r(e,"target","_blank"),r(e,"class","text-xs float-right z-40")},m(c,f){$(c,e,f),s(e,l),s(e,i),$(c,o,f),le(u,c,f),a=!0},p(c,[f]){(!a||f&1)&&n!==(n=Ja(c[0].source)+"")&&X(i,n);const _={};f&2&&(_.config=c[1]),u.$set(_)},i(c){a||(D(u.$$.fragment,c),a=!0)},o(c){q(u.$$.fragment,c),a=!1},d(c){c&&C(e),c&&C(o),ne(u,c)}}}function Cm(t,e,l){let{json:n}=e,{sysinfo:i}=e,o={},u,a;return t.$$set=c=>{"json"in c&&l(0,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&29){let c=n.currency,f=new Date().getUTCHours(),_=0,p=0,b=0,v=[],d=[],M=[];l(4,a=l(3,u=0));let y=new Date;for(fl(y,i.clock_offset-(24+y.getHours()-y.getUTCHours())%24),_=f;_<24&&(p=n[Oe(b++)],p!=null);_++)d.push({label:Oe(y.getHours())}),M.push(p*100),l(4,a=Math.min(a,p*100)),l(3,u=Math.max(u,p*100)),fl(y,1);for(_=0;_<24&&(p=n[Oe(b++)],p!=null);_++)d.push({label:Oe(y.getHours())}),M.push(p*100),l(4,a=Math.min(a,p*100)),l(3,u=Math.max(u,p*100)),fl(y,1);if(a>-100&&u<100){switch(c){case"NOK":case"SEK":case"DKK":c="\xF8re";break;case"EUR":c="cent";break;default:c=c+"/100"}for(l(4,a*=100),l(3,u*=100),_=0;_=0?P.toFixed(L):"",title:P>=0?P.toFixed(2)+" "+c:"",value:p>=0?Math.abs(p):0,label2:P<0?P.toFixed(L):"",title2:P<0?P.toFixed(2)+" "+c:"",value2:p<0?Math.abs(p):0,color:"#7c3aed"})}let N=Math.max(u,Math.abs(a));if(a<0){l(4,a=Math.min(N/4*-1,a));let P=Math.ceil(Math.abs(a)/N*4),L=a/P;for(_=1;_{"json"in c&&l(1,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,f=[],_=[],p=[];l(4,a=l(3,u=0));let b=fl(new Date,-24),v=new Date().getUTCHours();for(fl(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),c=v;c<24;c++){let T=n["i"+Oe(c)],N=n["e"+Oe(c)];T===void 0&&(T=0),N===void 0&&(N=0),_.push({label:Oe(b.getHours())}),p.push({label:T.toFixed(1),title:T.toFixed(2)+" kWh",value:T*10,label2:N.toFixed(1),title2:N.toFixed(2)+" kWh",value2:N*10,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,N*10)),l(3,u=Math.max(u,T*10)),fl(b,1)}for(c=0;c{"json"in c&&l(1,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,f=[],_=[],p=[];l(4,a=l(3,u=0));let b=new Date,v=new Date;for(fl(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),fl(v,i.clock_offset-(24+v.getHours()-v.getUTCHours())%24),v.setDate(0),c=b.getDate();c<=v.getDate();c++){let T=n["i"+Oe(c)],N=n["e"+Oe(c)];T===void 0&&(T=0),N===void 0&&(N=0),_.push({label:Oe(c)}),p.push({label:T.toFixed(T<10?1:0),title:T.toFixed(2)+" kWh",value:T,label2:N.toFixed(N<10?1:0),title2:N.toFixed(2)+" kWh",value2:N,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,N)),l(3,u=Math.max(u,T))}for(c=1;c{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=0,c=0,f=[],_=[],p=[];n.s&&n.s.forEach((d,M)=>{var y=d.n?d.n:d.a;c=d.v,c==-127&&(c=0),_.push({label:y.slice(-4)}),p.push({label:c.toFixed(1),value:c,color:"#7c3aed"}),l(3,u=Math.min(u,c)),l(2,o=Math.max(o,c))}),l(2,o=Math.ceil(o)),l(3,u=Math.floor(u));let b=o;u<0&&(b+=Math.abs(u));let v=b/4;for(a=0;a<5;a++)c=u+v*a,f.push({value:c,label:c.toFixed(1)});l(0,i={title:"Temperature sensors (\xB0C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:u,max:o,ticks:f},x:{ticks:_},points:p})}},[i,n,o,u]}class Im extends Ee{constructor(e){super(),Pe(this,e,Dm,Em,Ne,{json:1})}}function Rm(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}let Lm=0;function Om(t,e,l){let n={},i=0,o;return Hc.subscribe(u=>{l(2,o=u)}),jc(),t.$$.update=()=>{if(t.$$.dirty&6){let u=0,a=[],c=[],f=[];if(a.push({value:0,label:0}),o&&o.p)for(u=0;u0?Oe(_.d)+"."+no[new Date().getMonth()]:"-"}),l(1,i=Math.max(i,_.v))}if(o&&o.t){for(u=0;u=i)break;a.push({value:_,label:_})}a.push({label:o.m.toFixed(1),align:"right",color:"green",value:o.m})}o&&o.c&&(a.push({label:o.c.toFixed(0),color:"orange",value:o.c}),l(1,i=Math.max(i,o.c))),l(1,i=Math.ceil(i)),l(0,n={title:"Tariff peaks",padding:{top:20,right:35,bottom:20,left:35},y:{min:Lm,max:i,ticks:a},x:{ticks:c},points:f})}},[n,i,o]}class Fm extends Ee{constructor(e){super(),Pe(this,e,Om,Rm,Ne,{})}}function qu(t){let e,l,n,i,o,u,a=(t[0].mt?Cs(t[0].mt):"-")+"",c,f,_,p=(t[0].ic?t[0].ic.toFixed(1):"-")+"",b,v,d;return i=new Kc({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:"Import",sub:t[0].p,subunit:t[0].pc,colorFn:Rc}}),{c(){e=m("div"),l=m("div"),n=m("div"),ie(i.$$.fragment),o=h(),u=m("div"),c=S(a),f=h(),_=m("div"),b=S(p),v=S(" kWh"),r(n,"class","col-span-2"),r(_,"class","text-right"),r(l,"class","grid grid-cols-2"),r(e,"class","cnt")},m(M,y){$(M,e,y),s(e,l),s(l,n),le(i,n,null),s(l,o),s(l,u),s(u,c),s(l,f),s(l,_),s(_,b),s(_,v),d=!0},p(M,y){const T={};y&1&&(T.val=M[0].i?M[0].i:0),y&1&&(T.max=M[0].im?M[0].im:15e3),y&1&&(T.sub=M[0].p),y&1&&(T.subunit=M[0].pc),i.$set(T),(!d||y&1)&&a!==(a=(M[0].mt?Cs(M[0].mt):"-")+"")&&X(c,a),(!d||y&1)&&p!==(p=(M[0].ic?M[0].ic.toFixed(1):"-")+"")&&X(b,p)},i(M){d||(D(i.$$.fragment,M),d=!0)},o(M){q(i.$$.fragment,M),d=!1},d(M){M&&C(e),ne(i)}}}function Bu(t){let e,l,n,i,o,u,a,c,f=(t[0].ec?t[0].ec.toFixed(1):"-")+"",_,p,b;return i=new Kc({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:"Export",colorFn:k1}}),{c(){e=m("div"),l=m("div"),n=m("div"),ie(i.$$.fragment),o=h(),u=m("div"),a=h(),c=m("div"),_=S(f),p=S(" kWh"),r(n,"class","col-span-2"),r(c,"class","text-right"),r(l,"class","grid grid-cols-2"),r(e,"class","cnt")},m(v,d){$(v,e,d),s(e,l),s(l,n),le(i,n,null),s(l,o),s(l,u),s(l,a),s(l,c),s(c,_),s(c,p),b=!0},p(v,d){const M={};d&1&&(M.val=v[0].e?v[0].e:0),d&1&&(M.max=v[0].om?v[0].om*1e3:1e4),i.$set(M),(!b||d&1)&&f!==(f=(v[0].ec?v[0].ec.toFixed(1):"-")+"")&&X(_,f)},i(v){b||(D(i.$$.fragment,v),b=!0)},o(v){q(i.$$.fragment,v),b=!1},d(v){v&&C(e),ne(i)}}}function Uu(t){let e,l,n;return l=new fm({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,ds:t[0].ds}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&1&&(u.u1=i[0].u1),o&1&&(u.u2=i[0].u2),o&1&&(u.u3=i[0].u3),o&1&&(u.ds=i[0].ds),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function ju(t){let e,l,n;return l=new pm({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,i1:t[0].i1,i2:t[0].i2,i3:t[0].i3,max:t[0].mf?t[0].mf:32}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&1&&(u.u1=i[0].u1),o&1&&(u.u2=i[0].u2),o&1&&(u.u3=i[0].u3),o&1&&(u.i1=i[0].i1),o&1&&(u.i2=i[0].i2),o&1&&(u.i3=i[0].i3),o&1&&(u.max=i[0].mf?i[0].mf:32),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Hu(t){let e,l,n;return l=new vm({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&1&&(u.importInstant=i[0].ri),o&1&&(u.exportInstant=i[0].re),o&1&&(u.importTotal=i[0].ric),o&1&&(u.exportTotal=i[0].rec),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Wu(t){let e,l,n;return l=new wm({props:{sysinfo:t[1],data:t[0].ea,currency:t[0].pc,hasExport:t[0].om>0||t[0].e>0}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&2&&(u.sysinfo=i[1]),o&1&&(u.data=i[0].ea),o&1&&(u.currency=i[0].pc),o&1&&(u.hasExport=i[0].om>0||i[0].e>0),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function zu(t){let e,l,n;return l=new Fm({}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt h-64")},m(i,o){$(i,e,o),le(l,e,null),n=!0},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Gu(t){let e,l,n;return l=new $m({props:{json:t[2],sysinfo:t[1]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&4&&(u.json=i[2]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Vu(t){let e,l,n;return l=new Tm({props:{json:t[3],sysinfo:t[1]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&8&&(u.json=i[3]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Ku(t){let e,l,n;return l=new Pm({props:{json:t[4],sysinfo:t[1]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&16&&(u.json=i[4]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Yu(t){let e,l,n;return l=new Im({props:{json:t[5]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&32&&(u.json=i[5]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function qm(t){let e,l=Ke(t[1].ui.i,t[0].i),n,i=Ke(t[1].ui.e,t[0].om||t[0].e>0),o,u=Ke(t[1].ui.v,t[0].u1>100||t[0].u2>100||t[0].u3>100),a,c=Ke(t[1].ui.a,t[0].i1>.01||t[0].i2>.01||t[0].i3>.01),f,_=Ke(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),p,b=Ke(t[1].ui.c,t[0].ea),v,d=Ke(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),M,y=Ke(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),T,N=Ke(t[1].ui.d,t[3]),E,B=Ke(t[1].ui.m,t[4]),P,L=Ke(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),O,F=l&&qu(t),x=i&&Bu(t),j=u&&Uu(t),z=c&&ju(t),G=_&&Hu(t),V=b&&Wu(t),W=d&&zu(),U=y&&Gu(t),K=N&&Vu(t),H=B&&Ku(t),Y=L&&Yu(t);return{c(){e=m("div"),F&&F.c(),n=h(),x&&x.c(),o=h(),j&&j.c(),a=h(),z&&z.c(),f=h(),G&&G.c(),p=h(),V&&V.c(),v=h(),W&&W.c(),M=h(),U&&U.c(),T=h(),K&&K.c(),E=h(),H&&H.c(),P=h(),Y&&Y.c(),r(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(Z,re){$(Z,e,re),F&&F.m(e,null),s(e,n),x&&x.m(e,null),s(e,o),j&&j.m(e,null),s(e,a),z&&z.m(e,null),s(e,f),G&&G.m(e,null),s(e,p),V&&V.m(e,null),s(e,v),W&&W.m(e,null),s(e,M),U&&U.m(e,null),s(e,T),K&&K.m(e,null),s(e,E),H&&H.m(e,null),s(e,P),Y&&Y.m(e,null),O=!0},p(Z,[re]){re&3&&(l=Ke(Z[1].ui.i,Z[0].i)),l?F?(F.p(Z,re),re&3&&D(F,1)):(F=qu(Z),F.c(),D(F,1),F.m(e,n)):F&&(De(),q(F,1,1,()=>{F=null}),Ie()),re&3&&(i=Ke(Z[1].ui.e,Z[0].om||Z[0].e>0)),i?x?(x.p(Z,re),re&3&&D(x,1)):(x=Bu(Z),x.c(),D(x,1),x.m(e,o)):x&&(De(),q(x,1,1,()=>{x=null}),Ie()),re&3&&(u=Ke(Z[1].ui.v,Z[0].u1>100||Z[0].u2>100||Z[0].u3>100)),u?j?(j.p(Z,re),re&3&&D(j,1)):(j=Uu(Z),j.c(),D(j,1),j.m(e,a)):j&&(De(),q(j,1,1,()=>{j=null}),Ie()),re&3&&(c=Ke(Z[1].ui.a,Z[0].i1>.01||Z[0].i2>.01||Z[0].i3>.01)),c?z?(z.p(Z,re),re&3&&D(z,1)):(z=ju(Z),z.c(),D(z,1),z.m(e,f)):z&&(De(),q(z,1,1,()=>{z=null}),Ie()),re&3&&(_=Ke(Z[1].ui.r,Z[0].ri>0||Z[0].re>0||Z[0].ric>0||Z[0].rec>0)),_?G?(G.p(Z,re),re&3&&D(G,1)):(G=Hu(Z),G.c(),D(G,1),G.m(e,p)):G&&(De(),q(G,1,1,()=>{G=null}),Ie()),re&3&&(b=Ke(Z[1].ui.c,Z[0].ea)),b?V?(V.p(Z,re),re&3&&D(V,1)):(V=Wu(Z),V.c(),D(V,1),V.m(e,v)):V&&(De(),q(V,1,1,()=>{V=null}),Ie()),re&3&&(d=Ke(Z[1].ui.t,Z[0].pr&&(Z[0].pr.startsWith("10YNO")||Z[0].pr.startsWith("10Y1001A1001A4")))),d?W?re&3&&D(W,1):(W=zu(),W.c(),D(W,1),W.m(e,M)):W&&(De(),q(W,1,1,()=>{W=null}),Ie()),re&3&&(y=Ke(Z[1].ui.p,Z[0].pe&&!Number.isNaN(Z[0].p))),y?U?(U.p(Z,re),re&3&&D(U,1)):(U=Gu(Z),U.c(),D(U,1),U.m(e,T)):U&&(De(),q(U,1,1,()=>{U=null}),Ie()),re&10&&(N=Ke(Z[1].ui.d,Z[3])),N?K?(K.p(Z,re),re&10&&D(K,1)):(K=Vu(Z),K.c(),D(K,1),K.m(e,E)):K&&(De(),q(K,1,1,()=>{K=null}),Ie()),re&18&&(B=Ke(Z[1].ui.m,Z[4])),B?H?(H.p(Z,re),re&18&&D(H,1)):(H=Ku(Z),H.c(),D(H,1),H.m(e,P)):H&&(De(),q(H,1,1,()=>{H=null}),Ie()),re&35&&(L=Ke(Z[1].ui.s,Z[0].t&&Z[0].t!=-127&&Z[5].c>1)),L?Y?(Y.p(Z,re),re&35&&D(Y,1)):(Y=Yu(Z),Y.c(),D(Y,1),Y.m(e,null)):Y&&(De(),q(Y,1,1,()=>{Y=null}),Ie())},i(Z){O||(D(F),D(x),D(j),D(z),D(G),D(V),D(W),D(U),D(K),D(H),D(Y),O=!0)},o(Z){q(F),q(x),q(j),q(z),q(G),q(V),q(W),q(U),q(K),q(H),q(Y),O=!1},d(Z){Z&&C(e),F&&F.d(),x&&x.d(),j&&j.d(),z&&z.d(),G&&G.d(),V&&V.d(),W&&W.d(),U&&U.d(),K&&K.d(),H&&H.d(),Y&&Y.d()}}}function Bm(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},u={},a={},c={};return Co.subscribe(f=>{l(2,o=f)}),Fc.subscribe(f=>{l(3,u=f)}),qc.subscribe(f=>{l(4,a=f)}),Uc.subscribe(f=>{l(5,c=f)}),t.$$set=f=>{"data"in f&&l(0,n=f.data),"sysinfo"in f&&l(1,i=f.sysinfo)},[n,i,o,u,a,c]}class Um extends Ee{constructor(e){super(),Pe(this,e,Bm,qm,Ne,{data:0,sysinfo:1})}}let fo={};const Ci=at(fo);async function jm(){fo=await(await fetch("/configuration.json")).json(),Ci.set(fo)}function Qu(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Hm(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){$(l,e,n)},d(l){l&&C(e)}}}function Wm(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){$(l,e,n)},d(l){l&&C(e)}}}function Xu(t){let e;return{c(){e=m("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){$(l,e,n)},d(l){l&&C(e)}}}function Zu(t){let e,l,n;return{c(){e=m("option"),e.textContent="UART1",l=h(),n=m("option"),n.textContent="UART2",e.__value=9,e.value=e.__value,n.__value=16,n.value=n.__value},m(i,o){$(i,e,o),$(i,l,o),$(i,n,o)},d(i){i&&C(e),i&&C(l),i&&C(n)}}}function Ju(t){let e;return{c(){e=m("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){$(l,e,n)},d(l){l&&C(e)}}}function xu(t){let e,l,n;return{c(){e=m("option"),l=S("GPIO"),n=S(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){$(i,e,o),s(e,l),s(e,n)},d(i){i&&C(e)}}}function ef(t){let e,l=t[4]>3&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!(t[0]=="esp32s2"&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&xu(t);return{c(){l&&l.c(),e=Ve()},m(n,i){l&&l.m(n,i),$(n,e,i)},p(n,i){n[4]>3&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!(n[0]=="esp32s2"&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=xu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&C(e)}}}function zm(t){let e,l,n,i,o;function u(d,M){return d[0]=="esp32c3"?Wm:Hm}let a=u(t),c=a(t),f=t[0]=="esp8266"&&Xu(),_=(t[0]=="esp32"||t[0]=="esp32solo")&&Zu(),p=t[0]=="esp32s2"&&Ju(),b={length:t[1]+1},v=[];for(let d=0;d{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32c3":l(1,i=19);break}},[n,i]}class Yc extends Ee{constructor(e){super(),Pe(this,e,Gm,zm,Ne,{chip:0})}}function tf(t){let e,l,n=t[1]&&lf(t);return{c(){e=m("div"),l=m("div"),n&&n.c(),r(l,"class","fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center"),r(e,"class","z-50"),r(e,"aria-modal","true")},m(i,o){$(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=lf(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&C(e),n&&n.d()}}}function lf(t){let e,l;return{c(){e=m("div"),l=S(t[1]),r(e,"class","bg-white m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 w-96")},m(n,i){$(n,e,i),s(e,l)},p(n,i){i&2&&X(l,n[1])},d(n){n&&C(e)}}}function Vm(t){let e,l=t[0]&&tf(t);return{c(){l&&l.c(),e=Ve()},m(n,i){l&&l.m(n,i),$(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=tf(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:fe,o:fe,d(n){l&&l.d(n),n&&C(e)}}}function Km(t,e,l){let{active:n}=e,{message:i}=e;return t.$$set=o=>{"active"in o&&l(0,n=o.active),"message"in o&&l(1,i=o.message)},[n,i]}class It extends Ee{constructor(e){super(),Pe(this,e,Km,Vm,Ne,{active:0,message:1})}}function nf(t,e,l){const n=t.slice();return n[1]=e[l],n}function sf(t){let e,l,n=t[1]+"",i;return{c(){e=m("option"),l=S("Europe/"),i=S(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,u){$(o,e,u),s(e,l),s(e,i)},p:fe,d(o){o&&C(e)}}}function Ym(t){let e,l,n,i=t[0],o=[];for(let u=0;u>1&1,A=0;A0;g--)A[g]=A[g]?A[g-1]^P.EXPONENT[F._modN(P.LOG[A[g]]+w)]:A[g-1];A[0]=P.EXPONENT[F._modN(P.LOG[A[0]]+w)]}for(w=0;w<=k;w++)A[w]=P.LOG[A[w]]},_checkBadness:function(){var w,g,k,A,I,Q=0,J=this._badness,se=this.buffer,ce=this.width;for(I=0;Ice*ce;)oe-=ce*ce,Me++;for(Q+=Me*F.N4,A=0;A=J-2&&(w=J-2,I>9&&w--);var se=w;if(I>9){for(Q[se+2]=0,Q[se+3]=0;se--;)g=Q[se],Q[se+3]|=255&g<<4,Q[se+2]=g>>4;Q[2]|=255&w<<4,Q[1]=w>>4,Q[0]=64|w>>12}else{for(Q[se+1]=0,Q[se+2]=0;se--;)g=Q[se],Q[se+2]|=255&g<<4,Q[se+1]=g>>4;Q[1]|=255&w<<4,Q[0]=64|w>>4}for(se=w+3-(I<10);se=5&&(k+=F.N1+A[g]-5);for(g=3;gw||A[g-3]*3>=A[g]*4||A[g+3]*3>=A[g]*4)&&(k+=F.N3);return k},_finish:function(){this._stringBuffer=this.buffer.slice();var w,g,k=0,A=3e4;for(g=0;g<8&&(this._applyMask(g),w=this._checkBadness(),w>=1)A&1&&(I[Q-1-g+Q*8]=1,g<6?I[8+Q*g]=1:I[8+Q*(g+1)]=1);for(g=0;g<7;g++,A>>=1)A&1&&(I[8+Q*(Q-7+g)]=1,g?I[6-g+Q*8]=1:I[7+Q*8]=1)},_interleaveBlocks:function(){var w,g,k=this._dataBlock,A=this._ecc,I=this._eccBlock,Q=0,J=this._calculateMaxLength(),se=this._neccBlock1,ce=this._neccBlock2,ve=this._stringBuffer;for(w=0;w1)for(w=T.BLOCK[A],k=I-7;;){for(g=I-7;g>w-3&&(this._addAlignment(g,k),!(g6)for(w=O.BLOCK[Q-7],g=17,k=0;k<6;k++)for(A=0;A<3;A++,g--)1&(g>11?Q>>g-12:w>>g)?(I[5-k+J*(2-A+J-11)]=1,I[2-A+J-11+J*(5-k)]=1):(this._setMask(5-k,2-A+J-11),this._setMask(2-A+J-11,5-k))},_isMasked:function(w,g){var k=F._getMaskBit(w,g);return this._mask[k]===1},_pack:function(){var w,g,k,A=1,I=1,Q=this.width,J=Q-1,se=Q-1,ce=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(g=0;gg&&(k=w,w=g,g=k),k=g,k+=g*g,k>>=1,k+=w,k},_modN:function(w){for(;w>=255;)w-=255,w=(w>>8)+(w&255);return w},N1:3,N2:3,N3:40,N4:10}),x=F,j=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var w=this.element;w.width=w.height=this.qrious.size}}),z=j,G=p.extend(function(w,g,k,A){this.name=w,this.modifiable=Boolean(g),this.defaultValue=k,this._valueTransformer=A},{transform:function(w){var g=this._valueTransformer;return typeof g=="function"?g(w,this):w}}),V=G,W=p.extend(null,{abs:function(w){return w!=null?Math.abs(w):null},hasOwn:function(w,g){return Object.prototype.hasOwnProperty.call(w,g)},noop:function(){},toUpperCase:function(w){return w!=null?w.toUpperCase():null}}),U=W,K=p.extend(function(w){this.options={},w.forEach(function(g){this.options[g.name]=g},this)},{exists:function(w){return this.options[w]!=null},get:function(w,g){return K._get(this.options[w],g)},getAll:function(w){var g,k=this.options,A={};for(g in k)U.hasOwn(k,g)&&(A[g]=K._get(k[g],w));return A},init:function(w,g,k){typeof k!="function"&&(k=U.noop);var A,I;for(A in this.options)U.hasOwn(this.options,A)&&(I=this.options[A],K._set(I,I.defaultValue,g),K._createAccessor(I,g,k));this._setAll(w,g,!0)},set:function(w,g,k){return this._set(w,g,k)},setAll:function(w,g){return this._setAll(w,g)},_set:function(w,g,k,A){var I=this.options[w];if(!I)throw new Error("Invalid option: "+w);if(!I.modifiable&&!A)throw new Error("Option cannot be modified: "+w);return K._set(I,g,k)},_setAll:function(w,g,k){if(!w)return!1;var A,I=!1;for(A in w)U.hasOwn(w,A)&&this._set(A,w[A],g,k)&&(I=!0);return I}},{_createAccessor:function(w,g,k){var A={get:function(){return K._get(w,g)}};w.modifiable&&(A.set=function(I){K._set(w,I,g)&&k(I,w)}),Object.defineProperty(g,w.name,A)},_get:function(w,g){return g["_"+w.name]},_set:function(w,g,k){var A="_"+w.name,I=k[A],Q=w.transform(g!=null?g:w.defaultValue);return k[A]=Q,Q!==I}}),H=K,Y=p.extend(function(){this._services={}},{getService:function(w){var g=this._services[w];if(!g)throw new Error("Service is not being managed with name: "+w);return g},setService:function(w,g){if(this._services[w])throw new Error("Service is already managed with name: "+w);g&&(this._services[w]=g)}}),Z=Y,re=new H([new V("background",!0,"white"),new V("backgroundAlpha",!0,1,U.abs),new V("element"),new V("foreground",!0,"black"),new V("foregroundAlpha",!0,1,U.abs),new V("level",!0,"L",U.toUpperCase),new V("mime",!0,"image/png"),new V("padding",!0,null,U.abs),new V("size",!0,100,U.abs),new V("value",!0,"")]),ue=new Z,ke=p.extend(function(w){re.init(w,this,this.update.bind(this));var g=re.get("element",this),k=ue.getService("element"),A=g&&k.isCanvas(g)?g:k.createCanvas(),I=g&&k.isImage(g)?g:k.createImage();this._canvasRenderer=new M(this,A,!0),this._imageRenderer=new z(this,I,I===g),this.update()},{get:function(){return re.getAll(this)},set:function(w){re.setAll(w,this)&&this.update()},toDataURL:function(w){return this.canvas.toDataURL(w||this.mime)},update:function(){var w=new x({level:this.level,value:this.value});this._canvasRenderer.render(w),this._imageRenderer.render(w)}},{use:function(w){ue.setService(w.getName(),w)}});Object.defineProperties(ke.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var me=ke,Se=me,je=p.extend({getName:function(){}}),Re=je,He=Re.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(w){},isImage:function(w){}}),we=He,Te=we.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(w){return w instanceof HTMLCanvasElement},isImage:function(w){return w instanceof HTMLImageElement}}),Le=Te;Se.use(new Le);var $e=Se;return $e})})(Xc);const ep=Xc.exports;function tp(t){let e,l;return{c(){e=m("img"),Js(e.src,l=t[2])||r(e,"src",l),r(e,"alt",t[0]),r(e,"class",t[1])},m(n,i){$(n,e,i)},p(n,[i]){i&4&&!Js(e.src,l=n[2])&&r(e,"src",l),i&1&&r(e,"alt",n[0]),i&2&&r(e,"class",n[1])},i:fe,o:fe,d(n){n&&C(e)}}}function lp(t,e,l){const n=new ep;let{errorCorrection:i="L"}=e,{background:o="#fff"}=e,{color:u="#000"}=e,{size:a="200"}=e,{value:c=""}=e,{padding:f=0}=e,{className:_="qrcode"}=e,p="";function b(){n.set({background:o,foreground:u,level:i,padding:f,size:a,value:c}),l(2,p=n.toDataURL("image/jpeg"))}return ic(()=>{b()}),t.$$set=v=>{"errorCorrection"in v&&l(3,i=v.errorCorrection),"background"in v&&l(4,o=v.background),"color"in v&&l(5,u=v.color),"size"in v&&l(6,a=v.size),"value"in v&&l(0,c=v.value),"padding"in v&&l(7,f=v.padding),"className"in v&&l(1,_=v.className)},t.$$.update=()=>{t.$$.dirty&1&&c&&b()},[c,_,p,i,o,u,a,f]}class np extends Ee{constructor(e){super(),Pe(this,e,lp,tp,Ne,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function of(t,e,l){const n=t.slice();return n[95]=e[l],n[96]=e,n[97]=l,n}function rf(t,e,l){const n=t.slice();return n[98]=e[l],n[99]=e,n[100]=l,n}function ip(t,e,l){const n=t.slice();return n[101]=e[l],n}function sp(t,e,l){const n=t.slice();return n[104]=e[l],n}function op(t){let e,l;return{c(){e=m("option"),l=S(t[104]),e.__value=t[104],e.value=e.__value},m(n,i){$(n,e,i),s(e,l)},p:fe,d(n){n&&C(e)}}}function af(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","pt"),r(l,"type","text"),r(l,"class","in-s"),r(l,"placeholder","ENTSO-E API key, optional, read docs")},m(o,u){$(o,e,u),$(o,l,u),te(l,t[3].p.t),n||(i=ee(l,"input",t[22]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].p.t&&te(l,o[3].p.t)},d(o){o&&C(e),o&&C(l),n=!1,i()}}}function uf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v;return{c(){e=m("div"),l=S("Username"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=S("Password"),f=m("br"),_=h(),p=m("input"),r(o,"name","gu"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(p,"name","gp"),r(p,"type","password"),r(p,"class","in-s"),r(a,"class","my-1")},m(d,M){$(d,e,M),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].g.u),$(d,u,M),$(d,a,M),s(a,c),s(a,f),s(a,_),s(a,p),te(p,t[3].g.p),b||(v=[ee(o,"input",t[24]),ee(p,"input",t[25])],b=!0)},p(d,M){M[0]&8&&o.value!==d[3].g.u&&te(o,d[3].g.u),M[0]&8&&p.value!==d[3].g.p&&te(p,d[3].g.p)},d(d){d&&C(e),d&&C(u),d&&C(a),b=!1,ze(v)}}}function rp(t){let e,l=t[101]*100+"",n;return{c(){e=m("option"),n=S(l),e.__value=t[101]*100,e.value=e.__value},m(i,o){$(i,e,o),s(e,n)},p:fe,d(i){i&&C(e)}}}function ff(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","mek"),r(l,"type","text"),r(l,"class","in-s")},m(o,u){$(o,e,u),$(o,l,u),te(l,t[3].m.e.k),n||(i=ee(l,"input",t[34]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].m.e.k&&te(l,o[3].m.e.k)},d(o){o&&C(e),o&&C(l),n=!1,i()}}}function cf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=S("Authentication key"),n=m("br"),i=h(),o=m("input"),r(o,"name","mea"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1")},m(c,f){$(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].m.e.a),u||(a=ee(o,"input",t[35]),u=!0)},p(c,f){f[0]&8&&o.value!==c[3].m.e.a&&te(o,c[3].m.e.a)},d(c){c&&C(e),u=!1,a()}}}function mf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,M,y,T,N,E,B,P,L,O,F,x,j;return{c(){e=m("div"),l=m("div"),n=S("Watt"),i=m("br"),o=h(),u=m("input"),a=h(),c=m("div"),f=S("Volt"),_=m("br"),p=h(),b=m("input"),v=h(),d=m("div"),M=S("Amp"),y=m("br"),T=h(),N=m("input"),E=h(),B=m("div"),P=S("kWh"),L=m("br"),O=h(),F=m("input"),r(u,"name","mmw"),r(u,"type","number"),r(u,"min","0.00"),r(u,"max","1000"),r(u,"step","0.001"),r(u,"class","in-f tr w-full"),r(l,"class","w-1/4"),r(b,"name","mmv"),r(b,"type","number"),r(b,"min","0.00"),r(b,"max","1000"),r(b,"step","0.001"),r(b,"class","in-m tr w-full"),r(c,"class","w-1/4"),r(N,"name","mma"),r(N,"type","number"),r(N,"min","0.00"),r(N,"max","1000"),r(N,"step","0.001"),r(N,"class","in-m tr w-full"),r(d,"class","w-1/4"),r(F,"name","mmc"),r(F,"type","number"),r(F,"min","0.00"),r(F,"max","1000"),r(F,"step","0.001"),r(F,"class","in-l tr w-full"),r(B,"class","w-1/4"),r(e,"class","flex my-1")},m(z,G){$(z,e,G),s(e,l),s(l,n),s(l,i),s(l,o),s(l,u),te(u,t[3].m.m.w),s(e,a),s(e,c),s(c,f),s(c,_),s(c,p),s(c,b),te(b,t[3].m.m.v),s(e,v),s(e,d),s(d,M),s(d,y),s(d,T),s(d,N),te(N,t[3].m.m.a),s(e,E),s(e,B),s(B,P),s(B,L),s(B,O),s(B,F),te(F,t[3].m.m.c),x||(j=[ee(u,"input",t[37]),ee(b,"input",t[38]),ee(N,"input",t[39]),ee(F,"input",t[40])],x=!0)},p(z,G){G[0]&8&&he(u.value)!==z[3].m.m.w&&te(u,z[3].m.m.w),G[0]&8&&he(b.value)!==z[3].m.m.v&&te(b,z[3].m.m.v),G[0]&8&&he(N.value)!==z[3].m.m.a&&te(N,z[3].m.m.a),G[0]&8&&he(F.value)!==z[3].m.m.c&&te(F,z[3].m.m.c)},d(z){z&&C(e),x=!1,ze(j)}}}function pf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,M,y;return{c(){e=m("div"),l=S("Gateway"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=S("DNS"),f=m("br"),_=h(),p=m("div"),b=m("input"),v=h(),d=m("input"),r(o,"name","ng"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(b,"name","nd1"),r(b,"type","text"),r(b,"class","in-f w-full"),r(d,"name","nd2"),r(d,"type","text"),r(d,"class","in-l w-full"),r(p,"class","flex"),r(a,"class","my-1")},m(T,N){$(T,e,N),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].n.g),$(T,u,N),$(T,a,N),s(a,c),s(a,f),s(a,_),s(a,p),s(p,b),te(b,t[3].n.d1),s(p,v),s(p,d),te(d,t[3].n.d2),M||(y=[ee(o,"input",t[49]),ee(b,"input",t[50]),ee(d,"input",t[51])],M=!0)},p(T,N){N[0]&8&&o.value!==T[3].n.g&&te(o,T[3].n.g),N[0]&8&&b.value!==T[3].n.d1&&te(b,T[3].n.d1),N[0]&8&&d.value!==T[3].n.d2&&te(d,T[3].n.d2)},d(T){T&&C(e),T&&C(u),T&&C(a),M=!1,ze(y)}}}function _f(t){let e,l,n,i,o;return{c(){e=m("label"),l=m("input"),n=S(" SSL"),r(l,"type","checkbox"),r(l,"name","qs"),l.__value="true",l.value=l.__value,r(l,"class","rounded mb-1"),r(e,"class","float-right mr-3")},m(u,a){$(u,e,a),s(e,l),l.checked=t[3].q.s.e,s(e,n),i||(o=[ee(l,"change",t[55]),ee(l,"change",t[14])],i=!0)},p(u,a){a[0]&8&&(l.checked=u[3].q.s.e)},d(u){u&&C(e),i=!1,ze(o)}}}function df(t){let e,l,n,i,o,u,a,c,f,_,p,b,v;const d=[up,ap],M=[];function y(O,F){return O[3].q.s.c?0:1}n=y(t),i=M[n]=d[n](t);const T=[pp,mp],N=[];function E(O,F){return O[3].q.s.r?0:1}a=E(t),c=N[a]=T[a](t);const B=[hp,vp],P=[];function L(O,F){return O[3].q.s.k?0:1}return p=L(t),b=P[p]=B[p](t),{c(){e=m("div"),l=m("span"),i.c(),o=h(),u=m("span"),c.c(),f=h(),_=m("span"),b.c(),r(l,"class","flex pr-2"),r(u,"class","flex pr-2"),r(_,"class","flex pr-2"),r(e,"class","my-1 flex")},m(O,F){$(O,e,F),s(e,l),M[n].m(l,null),s(e,o),s(e,u),N[a].m(u,null),s(e,f),s(e,_),P[p].m(_,null),v=!0},p(O,F){let x=n;n=y(O),n===x?M[n].p(O,F):(De(),q(M[x],1,1,()=>{M[x]=null}),Ie(),i=M[n],i?i.p(O,F):(i=M[n]=d[n](O),i.c()),D(i,1),i.m(l,null));let j=a;a=E(O),a===j?N[a].p(O,F):(De(),q(N[j],1,1,()=>{N[j]=null}),Ie(),c=N[a],c?c.p(O,F):(c=N[a]=T[a](O),c.c()),D(c,1),c.m(u,null));let z=p;p=L(O),p===z?P[p].p(O,F):(De(),q(P[z],1,1,()=>{P[z]=null}),Ie(),b=P[p],b?b.p(O,F):(b=P[p]=B[p](O),b.c()),D(b,1),b.m(_,null))},i(O){v||(D(i),D(c),D(b),v=!0)},o(O){q(i),q(c),q(b),v=!1},d(O){O&&C(e),M[n].d(),N[a].d(),P[p].d()}}}function ap(t){let e,l;return e=new el({props:{to:"/mqtt-ca",$$slots:{default:[fp]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i[3]&16384&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function up(t){let e,l,n,i,o,u,a,c;return l=new el({props:{to:"/mqtt-ca",$$slots:{default:[cp]},$$scope:{ctx:t}}}),o=new To({}),{c(){e=m("span"),ie(l.$$.fragment),n=h(),i=m("span"),ie(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){$(f,e,_),le(l,e,null),$(f,n,_),$(f,i,_),le(o,i,null),u=!0,a||(c=[ee(i,"click",t[11]),ee(i,"keypress",t[11])],a=!0)},p(f,_){const p={};_[3]&16384&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(D(l.$$.fragment,f),D(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&C(e),ne(l),f&&C(n),f&&C(i),ne(o),a=!1,ze(c)}}}function fp(t){let e,l;return e=new fn({props:{color:"blue",text:"Upload CA",title:"Click here to upload CA"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function cp(t){let e;return{c(){e=S("CA OK")},m(l,n){$(l,e,n)},d(l){l&&C(e)}}}function mp(t){let e,l;return e=new el({props:{to:"/mqtt-cert",$$slots:{default:[_p]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i[3]&16384&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function pp(t){let e,l,n,i,o,u,a,c;return l=new el({props:{to:"/mqtt-cert",$$slots:{default:[dp]},$$scope:{ctx:t}}}),o=new To({}),{c(){e=m("span"),ie(l.$$.fragment),n=h(),i=m("span"),ie(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){$(f,e,_),le(l,e,null),$(f,n,_),$(f,i,_),le(o,i,null),u=!0,a||(c=[ee(i,"click",t[12]),ee(i,"keypress",t[12])],a=!0)},p(f,_){const p={};_[3]&16384&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(D(l.$$.fragment,f),D(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&C(e),ne(l),f&&C(n),f&&C(i),ne(o),a=!1,ze(c)}}}function _p(t){let e,l;return e=new fn({props:{color:"blue",text:"Upload cert",title:"Click here to upload certificate"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function dp(t){let e;return{c(){e=S("Cert OK")},m(l,n){$(l,e,n)},d(l){l&&C(e)}}}function vp(t){let e,l;return e=new el({props:{to:"/mqtt-key",$$slots:{default:[bp]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i[3]&16384&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function hp(t){let e,l,n,i,o,u,a,c;return l=new el({props:{to:"/mqtt-key",$$slots:{default:[gp]},$$scope:{ctx:t}}}),o=new To({}),{c(){e=m("span"),ie(l.$$.fragment),n=h(),i=m("span"),ie(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){$(f,e,_),le(l,e,null),$(f,n,_),$(f,i,_),le(o,i,null),u=!0,a||(c=[ee(i,"click",t[13]),ee(i,"keypress",t[13])],a=!0)},p(f,_){const p={};_[3]&16384&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(D(l.$$.fragment,f),D(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&C(e),ne(l),f&&C(n),f&&C(i),ne(o),a=!1,ze(c)}}}function bp(t){let e,l;return e=new fn({props:{color:"blue",text:"Upload key",title:"Click here to upload key"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function gp(t){let e;return{c(){e=S("Key OK")},m(l,n){$(l,e,n)},d(l){l&&C(e)}}}function vf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,M,y,T,N,E,B,P,L,O,F,x,j,z,G,V,W,U,K;return o=new Bt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Domoticz",n=h(),i=m("a"),ie(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),_=m("div"),p=S("Electricity IDX"),b=m("br"),v=h(),d=m("input"),M=h(),y=m("div"),T=S("Current IDX"),N=m("br"),E=h(),B=m("input"),P=h(),L=m("div"),O=S(`Voltage IDX: L1, L2 & L3 + `),o.c(),l=Ve()},m(u,a){$(u,e,a),o.m(u,a),$(u,l,a)},p(u,a){i===(i=n(u))&&o?o.p(u,a):(o.d(1),o=i(u),o&&(o.c(),o.m(l.parentNode,l)))},d(u){u&&C(e),o.d(u),u&&C(l)}}}function M1(t){let e,l;return{c(){e=S(t[0]),l=S(" seconds")},m(n,i){$(n,e,i),$(n,l,i)},p(n,i){i&1&&X(e,n[0])},d(n){n&&C(e),n&&C(l)}}}function S1(t){let e,l;return{c(){e=S(t[3]),l=S(" minute")},m(n,i){$(n,e,i),$(n,l,i)},p(n,i){i&8&&X(e,n[3])},d(n){n&&C(e),n&&C(l)}}}function T1(t){let e,l;return{c(){e=S(t[3]),l=S(" minutes")},m(n,i){$(n,e,i),$(n,l,i)},p(n,i){i&8&&X(e,n[3])},d(n){n&&C(e),n&&C(l)}}}function N1(t){let e,l;return{c(){e=S(t[2]),l=S(" hour")},m(n,i){$(n,e,i),$(n,l,i)},p(n,i){i&4&&X(e,n[2])},d(n){n&&C(e),n&&C(l)}}}function A1(t){let e,l;return{c(){e=S(t[2]),l=S(" hours")},m(n,i){$(n,e,i),$(n,l,i)},p(n,i){i&4&&X(e,n[2])},d(n){n&&C(e),n&&C(l)}}}function P1(t){let e,l;return{c(){e=S(t[1]),l=S(" day")},m(n,i){$(n,e,i),$(n,l,i)},p(n,i){i&2&&X(e,n[1])},d(n){n&&C(e),n&&C(l)}}}function E1(t){let e,l;return{c(){e=S(t[1]),l=S(" days")},m(n,i){$(n,e,i),$(n,l,i)},p(n,i){i&2&&X(e,n[1])},d(n){n&&C(e),n&&C(l)}}}function D1(t){let e,l=t[0]&&tu(t);return{c(){l&&l.c(),e=Ve()},m(n,i){l&&l.m(n,i),$(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=tu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:fe,o:fe,d(n){l&&l.d(n),n&&C(e)}}}function I1(t,e,l){let{epoch:n}=e,i=0,o=0,u=0;return t.$$set=a=>{"epoch"in a&&l(0,n=a.epoch)},t.$$.update=()=>{t.$$.dirty&1&&(l(1,i=Math.floor(n/86400)),l(2,o=Math.floor(n/3600)),l(3,u=Math.floor(n/60)))},[n,i,o,u]}class R1 extends Ee{constructor(e){super(),Pe(this,e,I1,D1,Ne,{epoch:0})}}function L1(t){let e,l,n;return{c(){e=m("span"),l=S(t[2]),r(e,"title",t[1]),r(e,"class",n="bd-"+t[0])},m(i,o){$(i,e,o),s(e,l)},p(i,[o]){o&4&&X(l,i[2]),o&2&&r(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&r(e,"class",n)},i:fe,o:fe,d(i){i&&C(e)}}}function O1(t,e,l){let{color:n}=e,{title:i}=e,{text:o}=e;return t.$$set=u=>{"color"in u&&l(0,n=u.color),"title"in u&&l(1,i=u.title),"text"in u&&l(2,o=u.text)},[n,i,o]}class fn extends Ee{constructor(e){super(),Pe(this,e,O1,L1,Ne,{color:0,title:1,text:2})}}function F1(t){let e,l=`${Oe(t[0].getDate())}.${Oe(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Oe(t[0].getHours())}:${Oe(t[0].getMinutes())}`,n;return{c(){e=m("span"),n=S(l),r(e,"class",t[1])},m(i,o){$(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Oe(i[0].getDate())}.${Oe(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Oe(i[0].getHours())}:${Oe(i[0].getMinutes())}`)&&X(n,l),o&2&&r(e,"class",i[1])},d(i){i&&C(e)}}}function q1(t){let e=`${Oe(t[0].getDate())}. ${no[t[0].getMonth()]} ${Oe(t[0].getHours())}:${Oe(t[0].getMinutes())}`,l;return{c(){l=S(e)},m(n,i){$(n,l,i)},p(n,i){i&1&&e!==(e=`${Oe(n[0].getDate())}. ${no[n[0].getMonth()]} ${Oe(n[0].getHours())}:${Oe(n[0].getMinutes())}`)&&X(l,e)},d(n){n&&C(l)}}}function B1(t){let e;function l(o,u){return o[2]?q1:F1}let n=l(t),i=n(t);return{c(){i.c(),e=Ve()},m(o,u){i.m(o,u),$(o,e,u)},p(o,[u]){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:fe,o:fe,d(o){i.d(o),o&&C(e)}}}function U1(t,e,l){let{timestamp:n}=e,{fullTimeColor:i}=e,{offset:o}=e,u;return t.$$set=a=>{"timestamp"in a&&l(0,n=a.timestamp),"fullTimeColor"in a&&l(1,i=a.fullTimeColor),"offset"in a&&l(3,o=a.offset)},t.$$.update=()=>{t.$$.dirty&9&&(l(2,u=Math.abs(new Date().getTime()-n.getTime())<3e5),isNaN(o)||fl(n,o-(24+n.getHours()-n.getUTCHours())%24))},[n,i,u,o]}class Gc extends Ee{constructor(e){super(),Pe(this,e,U1,B1,Ne,{timestamp:0,fullTimeColor:1,offset:3})}}function j1(t){let e,l,n;return{c(){e=Fe("svg"),l=Fe("path"),n=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"),r(n,"stroke-linecap","round"),r(n,"stroke-linejoin","round"),r(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(i,o){$(i,e,o),s(e,l),s(e,n)},p:fe,i:fe,o:fe,d(i){i&&C(e)}}}class H1 extends Ee{constructor(e){super(),Pe(this,e,null,j1,Ne,{})}}function W1(t){let e,l;return{c(){e=Fe("svg"),l=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){$(n,e,i),s(e,l)},p:fe,i:fe,o:fe,d(n){n&&C(e)}}}class z1 extends Ee{constructor(e){super(),Pe(this,e,null,W1,Ne,{})}}function G1(t){let e,l;return{c(){e=Fe("svg"),l=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){$(n,e,i),s(e,l)},p:fe,i:fe,o:fe,d(n){n&&C(e)}}}class Bt extends Ee{constructor(e){super(),Pe(this,e,null,G1,Ne,{})}}function V1(t){let e,l;return{c(){e=Fe("svg"),l=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15M9 12l3 3m0 0l3-3m-3 3V2.25"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){$(n,e,i),s(e,l)},p:fe,i:fe,o:fe,d(n){n&&C(e)}}}class Vc extends Ee{constructor(e){super(),Pe(this,e,null,V1,Ne,{})}}function K1(t){let e,l,n=t[1].version+"",i;return{c(){e=S("AMS reader "),l=m("span"),i=S(n)},m(o,u){$(o,e,u),$(o,l,u),s(l,i)},p(o,u){u&2&&n!==(n=o[1].version+"")&&X(i,n)},d(o){o&&C(e),o&&C(l)}}}function lu(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=m("div"),n=S(l),i=S("\xB0C"),r(e,"class","flex-none my-auto")},m(o,u){$(o,e,u),s(e,n),s(e,i)},p(o,u){u&1&&l!==(l=(o[0].t>-50?o[0].t.toFixed(1):"-")+"")&&X(n,l)},d(o){o&&C(e)}}}function nu(t){let e,l="HAN: "+Ya(t[0].he),n;return{c(){e=m("div"),n=S(l),r(e,"class","bd-red")},m(i,o){$(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="HAN: "+Ya(i[0].he))&&X(n,l)},d(i){i&&C(e)}}}function iu(t){let e,l="MQTT: "+Qa(t[0].me),n;return{c(){e=m("div"),n=S(l),r(e,"class","bd-red")},m(i,o){$(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="MQTT: "+Qa(i[0].me))&&X(n,l)},d(i){i&&C(e)}}}function su(t){let e,l="PriceAPI: "+Xa(t[0].ee),n;return{c(){e=m("div"),n=S(l),r(e,"class","bd-red")},m(i,o){$(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="PriceAPI: "+Xa(i[0].ee))&&X(n,l)},d(i){i&&C(e)}}}function ou(t){let e,l,n,i,o,u;return l=new el({props:{to:"/configuration",$$slots:{default:[Y1]},$$scope:{ctx:t}}}),o=new el({props:{to:"/status",$$slots:{default:[Q1]},$$scope:{ctx:t}}}),{c(){e=m("div"),ie(l.$$.fragment),n=h(),i=m("div"),ie(o.$$.fragment),r(e,"class","flex-none px-1 mt-1"),r(e,"title","Configuration"),r(i,"class","flex-none px-1 mt-1"),r(i,"title","Device information")},m(a,c){$(a,e,c),le(l,e,null),$(a,n,c),$(a,i,c),le(o,i,null),u=!0},i(a){u||(D(l.$$.fragment,a),D(o.$$.fragment,a),u=!0)},o(a){q(l.$$.fragment,a),q(o.$$.fragment,a),u=!1},d(a){a&&C(e),ne(l),a&&C(n),a&&C(i),ne(o)}}}function Y1(t){let e,l;return e=new H1({}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function Q1(t){let e,l;return e=new z1({}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function ru(t){let e,l,n,i,o;const u=[Z1,X1],a=[];function c(f,_){return f[1].security==0||f[0].a?0:1}return l=c(t),n=a[l]=u[l](t),{c(){e=m("div"),n.c(),r(e,"class","flex-none mr-3 text-yellow-500"),r(e,"title",i="New version: "+t[2].tag_name)},m(f,_){$(f,e,_),a[l].m(e,null),o=!0},p(f,_){let p=l;l=c(f),l===p?a[l].p(f,_):(De(),q(a[p],1,1,()=>{a[p]=null}),Ie(),n=a[l],n?n.p(f,_):(n=a[l]=u[l](f),n.c()),D(n,1),n.m(e,null)),(!o||_&4&&i!==(i="New version: "+f[2].tag_name))&&r(e,"title",i)},i(f){o||(D(n),o=!0)},o(f){q(n),o=!1},d(f){f&&C(e),a[l].d()}}}function X1(t){let e,l,n=t[2].tag_name+"",i;return{c(){e=m("span"),l=S("New version: "),i=S(n)},m(o,u){$(o,e,u),s(e,l),s(e,i)},p(o,u){u&4&&n!==(n=o[2].tag_name+"")&&X(i,n)},i:fe,o:fe,d(o){o&&C(e)}}}function Z1(t){let e,l,n,i=t[2].tag_name+"",o,u,a,c,f,_;return a=new Vc({}),{c(){e=m("button"),l=m("span"),n=S("New version: "),o=S(i),u=h(),ie(a.$$.fragment),r(l,"class","mt-1"),r(e,"class","flex")},m(p,b){$(p,e,b),s(e,l),s(l,n),s(l,o),s(e,u),le(a,e,null),c=!0,f||(_=ee(e,"click",t[3]),f=!0)},p(p,b){(!c||b&4)&&i!==(i=p[2].tag_name+"")&&X(o,i)},i(p){c||(D(a.$$.fragment,p),c=!0)},o(p){q(a.$$.fragment,p),c=!1},d(p){p&&C(e),ne(a),f=!1,_()}}}function J1(t){let e,l,n,i,o,u,a,c,f,_,p,b,v=(t[0].m?(t[0].m/1e3).toFixed(1):"-")+"",d,M,y,T,N,E,B,P,L,O,F,x,j,z,G,V,W,U,K,H,Y,Z,re,ue,ke,me,Se,je,Re,He;i=new el({props:{to:"/",$$slots:{default:[K1]},$$scope:{ctx:t}}}),c=new R1({props:{epoch:t[0].u}});let we=t[0].t>-50&&lu(t);N=new fn({props:{title:"ESP",text:t[1].booting?"Booting":t[0].v>2?t[0].v.toFixed(2)+"V":"ESP",color:ql(t[1].booting?2:t[0].em)}}),B=new fn({props:{title:"HAN",text:"HAN",color:ql(t[1].booting?9:t[0].hm)}}),L=new fn({props:{title:"WiFi",text:t[0].r?t[0].r.toFixed(0)+"dBm":"WiFi",color:ql(t[1].booting?9:t[0].wm)}}),F=new fn({props:{title:"MQTT",text:"MQTT",color:ql(t[1].booting?9:t[0].mm)}});let Te=(t[0].he<0||t[0].he>0)&&nu(t),Le=t[0].me<0&&iu(t),$e=(t[0].ee>0||t[0].ee<0)&&su(t);re=new Gc({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),offset:t[1].clock_offset,fullTimeColor:"text-red-500"}});let w=t[1].vndcfg&&t[1].usrcfg&&ou(t);je=new Bt({});let g=t[1].fwconsent===1&&t[2]&&ru(t);return{c(){e=m("nav"),l=m("div"),n=m("div"),ie(i.$$.fragment),o=h(),u=m("div"),a=m("div"),ie(c.$$.fragment),f=h(),we&&we.c(),_=h(),p=m("div"),b=S("Free mem: "),d=S(v),M=S("kb"),y=h(),T=m("div"),ie(N.$$.fragment),E=h(),ie(B.$$.fragment),P=h(),ie(L.$$.fragment),O=h(),ie(F.$$.fragment),x=h(),Te&&Te.c(),j=h(),Le&&Le.c(),z=h(),$e&&$e.c(),G=h(),V=m("div"),W=m("div"),U=m("a"),K=m("img"),Y=h(),Z=m("div"),ie(re.$$.fragment),ue=h(),w&&w.c(),ke=h(),me=m("div"),Se=m("a"),ie(je.$$.fragment),Re=h(),g&&g.c(),r(n,"class","flex text-lg text-gray-100 p-2"),r(a,"class","flex-none my-auto"),r(p,"class","flex-none my-auto"),r(u,"class","flex-none my-auto p-2 flex space-x-4"),r(T,"class","flex-auto flex-wrap my-auto justify-center p-2"),r(K,"class","gh-logo"),Js(K.src,H=$1)||r(K,"src",H),r(K,"alt","GitHub repo"),r(U,"class","float-right"),r(U,"href","https://github.com/UtilitechAS/amsreader-firmware"),r(U,"target","_blank"),r(U,"rel","noreferrer"),r(U,"aria-label","GitHub"),r(W,"class","flex-none"),r(Z,"class","flex-none my-auto px-2"),r(Se,"href",Ut("")),r(Se,"target","_blank"),r(Se,"rel","noreferrer"),r(me,"class","flex-none px-1 mt-1"),r(me,"title","Documentation"),r(V,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),r(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),r(e,"class","bg-violet-600 p-1 rounded-md mx-2")},m(k,A){$(k,e,A),s(e,l),s(l,n),le(i,n,null),s(l,o),s(l,u),s(u,a),le(c,a,null),s(u,f),we&&we.m(u,null),s(u,_),s(u,p),s(p,b),s(p,d),s(p,M),s(l,y),s(l,T),le(N,T,null),s(T,E),le(B,T,null),s(T,P),le(L,T,null),s(T,O),le(F,T,null),s(l,x),Te&&Te.m(l,null),s(l,j),Le&&Le.m(l,null),s(l,z),$e&&$e.m(l,null),s(l,G),s(l,V),s(V,W),s(W,U),s(U,K),s(V,Y),s(V,Z),le(re,Z,null),s(V,ue),w&&w.m(V,null),s(V,ke),s(V,me),s(me,Se),le(je,Se,null),s(V,Re),g&&g.m(V,null),He=!0},p(k,[A]){const I={};A&18&&(I.$$scope={dirty:A,ctx:k}),i.$set(I);const Q={};A&1&&(Q.epoch=k[0].u),c.$set(Q),k[0].t>-50?we?we.p(k,A):(we=lu(k),we.c(),we.m(u,_)):we&&(we.d(1),we=null),(!He||A&1)&&v!==(v=(k[0].m?(k[0].m/1e3).toFixed(1):"-")+"")&&X(d,v);const J={};A&3&&(J.text=k[1].booting?"Booting":k[0].v>2?k[0].v.toFixed(2)+"V":"ESP"),A&3&&(J.color=ql(k[1].booting?2:k[0].em)),N.$set(J);const se={};A&3&&(se.color=ql(k[1].booting?9:k[0].hm)),B.$set(se);const ce={};A&1&&(ce.text=k[0].r?k[0].r.toFixed(0)+"dBm":"WiFi"),A&3&&(ce.color=ql(k[1].booting?9:k[0].wm)),L.$set(ce);const ve={};A&3&&(ve.color=ql(k[1].booting?9:k[0].mm)),F.$set(ve),k[0].he<0||k[0].he>0?Te?Te.p(k,A):(Te=nu(k),Te.c(),Te.m(l,j)):Te&&(Te.d(1),Te=null),k[0].me<0?Le?Le.p(k,A):(Le=iu(k),Le.c(),Le.m(l,z)):Le&&(Le.d(1),Le=null),k[0].ee>0||k[0].ee<0?$e?$e.p(k,A):($e=su(k),$e.c(),$e.m(l,G)):$e&&($e.d(1),$e=null);const Me={};A&1&&(Me.timestamp=k[0].c?new Date(k[0].c*1e3):new Date(0)),A&2&&(Me.offset=k[1].clock_offset),re.$set(Me),k[1].vndcfg&&k[1].usrcfg?w?A&2&&D(w,1):(w=ou(k),w.c(),D(w,1),w.m(V,ke)):w&&(De(),q(w,1,1,()=>{w=null}),Ie()),k[1].fwconsent===1&&k[2]?g?(g.p(k,A),A&6&&D(g,1)):(g=ru(k),g.c(),D(g,1),g.m(V,null)):g&&(De(),q(g,1,1,()=>{g=null}),Ie())},i(k){He||(D(i.$$.fragment,k),D(c.$$.fragment,k),D(N.$$.fragment,k),D(B.$$.fragment,k),D(L.$$.fragment,k),D(F.$$.fragment,k),D(re.$$.fragment,k),D(w),D(je.$$.fragment,k),D(g),He=!0)},o(k){q(i.$$.fragment,k),q(c.$$.fragment,k),q(N.$$.fragment,k),q(B.$$.fragment,k),q(L.$$.fragment,k),q(F.$$.fragment,k),q(re.$$.fragment,k),q(w),q(je.$$.fragment,k),q(g),He=!1},d(k){k&&C(e),ne(i),ne(c),we&&we.d(),ne(N),ne(B),ne(L),ne(F),Te&&Te.d(),Le&&Le.d(),$e&&$e.d(),ne(re),w&&w.d(),ne(je),g&&g.d()}}}function x1(t,e,l){let{data:n={}}=e,i={},o={};function u(){confirm("Do you want to upgrade this device to "+o.tag_name+"?")&&(!ri(i.board)||confirm($s(be(i.chip,i.board))))&&(jt.update(a=>(a.upgrading=!0,a)),Wc(o.tag_name))}return jt.subscribe(a=>{l(1,i=a),a.fwconsent===1&&C1()}),So.subscribe(a=>{l(2,o=zc(i.version,a))}),t.$$set=a=>{"data"in a&&l(0,n=a.data)},[n,i,o,u]}class em extends Ee{constructor(e){super(),Pe(this,e,x1,J1,Ne,{data:0})}}function tm(t){let e,l,n,i;return{c(){e=Fe("svg"),l=Fe("path"),n=Fe("path"),r(l,"d",Zs(150,150,115,210,510)),r(l,"stroke","#eee"),r(l,"fill","none"),r(l,"stroke-width","55"),r(n,"d",i=Zs(150,150,115,210,210+300*t[0]/100)),r(n,"stroke",t[1]),r(n,"fill","none"),r(n,"stroke-width","55"),r(e,"viewBox","0 0 300 300"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"height","100%")},m(o,u){$(o,e,u),s(e,l),s(e,n)},p(o,[u]){u&1&&i!==(i=Zs(150,150,115,210,210+300*o[0]/100))&&r(n,"d",i),u&2&&r(n,"stroke",o[1])},i:fe,o:fe,d(o){o&&C(e)}}}function au(t,e,l,n){var i=(n-90)*Math.PI/180;return{x:t+l*Math.cos(i),y:e+l*Math.sin(i)}}function Zs(t,e,l,n,i){var o=au(t,e,l,i),u=au(t,e,l,n),a=i-n<=180?"0":"1",c=["M",o.x,o.y,"A",l,l,0,a,0,u.x,u.y].join(" ");return c}function lm(t,e,l){let{pct:n=0}=e,{color:i="red"}=e;return t.$$set=o=>{"pct"in o&&l(0,n=o.pct),"color"in o&&l(1,i=o.color)},[n,i]}class nm extends Ee{constructor(e){super(),Pe(this,e,lm,tm,Ne,{pct:0,color:1})}}function uu(t){let e,l,n,i,o,u,a,c;return{c(){e=m("br"),l=h(),n=m("span"),i=S(t[3]),o=h(),u=m("span"),a=S(t[4]),c=S("/kWh"),r(n,"class","pl-sub"),r(u,"class","pl-snt")},m(f,_){$(f,e,_),$(f,l,_),$(f,n,_),s(n,i),$(f,o,_),$(f,u,_),s(u,a),s(u,c)},p(f,_){_&8&&X(i,f[3]),_&16&&X(a,f[4])},d(f){f&&C(e),f&&C(l),f&&C(n),f&&C(o),f&&C(u)}}}function im(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,M,y;l=new nm({props:{pct:t[6],color:t[5](t[6])}});let T=t[3]&&uu(t);return{c(){e=m("div"),ie(l.$$.fragment),n=h(),i=m("span"),o=m("span"),u=S(t[2]),a=h(),c=m("br"),f=h(),_=m("span"),p=S(t[0]),b=h(),v=m("span"),d=S(t[1]),M=h(),T&&T.c(),r(o,"class","pl-lab"),r(_,"class","pl-val"),r(v,"class","pl-unt"),r(i,"class","pl-ov"),r(e,"class","pl-root")},m(N,E){$(N,e,E),le(l,e,null),s(e,n),s(e,i),s(i,o),s(o,u),s(i,a),s(i,c),s(i,f),s(i,_),s(_,p),s(i,b),s(i,v),s(v,d),s(i,M),T&&T.m(i,null),y=!0},p(N,[E]){const B={};E&64&&(B.pct=N[6]),E&96&&(B.color=N[5](N[6])),l.$set(B),(!y||E&4)&&X(u,N[2]),(!y||E&1)&&X(p,N[0]),(!y||E&2)&&X(d,N[1]),N[3]?T?T.p(N,E):(T=uu(N),T.c(),T.m(i,null)):T&&(T.d(1),T=null)},i(N){y||(D(l.$$.fragment,N),y=!0)},o(N){q(l.$$.fragment,N),y=!1},d(N){N&&C(e),ne(l),T&&T.d()}}}function sm(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:u}=e,{sub:a=""}=e,{subunit:c=""}=e,{colorFn:f}=e,_=0;return t.$$set=p=>{"val"in p&&l(0,n=p.val),"max"in p&&l(7,i=p.max),"unit"in p&&l(1,o=p.unit),"label"in p&&l(2,u=p.label),"sub"in p&&l(3,a=p.sub),"subunit"in p&&l(4,c=p.subunit),"colorFn"in p&&l(5,f=p.colorFn)},t.$$.update=()=>{t.$$.dirty&129&&l(6,_=Math.min(n,i)/i*100)},[n,o,u,a,c,f,_,i]}class Kc extends Ee{constructor(e){super(),Pe(this,e,sm,im,Ne,{val:0,max:7,unit:1,label:2,sub:3,subunit:4,colorFn:5})}}function fu(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function cu(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function mu(t,e,l){const n=t.slice();return n[13]=e[l],n}function pu(t){let e,l,n,i,o,u,a=t[0].title&&_u(t),c=t[0].y.ticks,f=[];for(let d=0;d20||t[11]%2==0)&&bu(t);return{c(){e=Fe("g"),n&&n.c(),r(e,"class","tick"),r(e,"transform",l="translate("+t[5](t[11])+","+t[4]+")")},m(i,o){$(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[11]%2==0?n?n.p(i,o):(n=bu(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&48&&l!==(l="translate("+i[5](i[11])+","+i[4]+")")&&r(e,"transform",l)},d(i){i&&C(e),n&&n.d()}}}function bu(t){let e,l=t[9].label+"",n,i;return{c(){e=Fe("text"),n=S(l),r(e,"x",i=t[3]/2),r(e,"y","-4")},m(o,u){$(o,e,u),s(e,n)},p(o,u){u&1&&l!==(l=o[9].label+"")&&X(n,l),u&8&&i!==(i=o[3]/2)&&r(e,"x",i)},d(o){o&&C(e)}}}function gu(t){let e=!isNaN(t[5](t[11])),l,n=e&&hu(t);return{c(){n&&n.c(),l=Ve()},m(i,o){n&&n.m(i,o),$(i,l,o)},p(i,o){o&32&&(e=!isNaN(i[5](i[11]))),e?n?n.p(i,o):(n=hu(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&C(l)}}}function ku(t){let e,l,n=t[9].value!==void 0&&wu(t),i=t[9].value2>1e-4&&$u(t);return{c(){e=Fe("g"),n&&n.c(),l=Fe("g"),i&&i.c()},m(o,u){$(o,e,u),n&&n.m(e,null),$(o,l,u),i&&i.m(l,null)},p(o,u){o[9].value!==void 0?n?n.p(o,u):(n=wu(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[9].value2>1e-4?i?i.p(o,u):(i=$u(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&C(e),n&&n.d(),o&&C(l),i&&i.d()}}}function wu(t){let e,l,n,i,o,u,a,c=t[3]>15&&yu(t);return{c(){e=Fe("rect"),c&&c.c(),a=Ve(),r(e,"x",l=t[5](t[11])+2),r(e,"y",n=t[6](t[9].value)),r(e,"width",i=t[3]-4),r(e,"height",o=t[6](t[0].y.min)-t[6](Math.min(t[0].y.min,0)+t[9].value)),r(e,"fill",u=t[9].color)},m(f,_){$(f,e,_),c&&c.m(f,_),$(f,a,_)},p(f,_){_&32&&l!==(l=f[5](f[11])+2)&&r(e,"x",l),_&65&&n!==(n=f[6](f[9].value))&&r(e,"y",n),_&8&&i!==(i=f[3]-4)&&r(e,"width",i),_&65&&o!==(o=f[6](f[0].y.min)-f[6](Math.min(f[0].y.min,0)+f[9].value))&&r(e,"height",o),_&1&&u!==(u=f[9].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,_):(c=yu(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&C(e),c&&c.d(f),f&&C(a)}}}function yu(t){let e,l=t[9].label+"",n,i,o,u,a,c,f=t[9].title&&Cu(t);return{c(){e=Fe("text"),n=S(l),f&&f.c(),c=Ve(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor",o=t[3]t[6](0)-t[7]?t[9].color:"white"),r(e,"transform",a="translate("+(t[5](t[11])+t[3]/2)+" "+(t[6](t[9].value)>t[6](0)-t[7]?t[6](t[9].value)-t[7]:t[6](t[9].value)+10)+") rotate("+(t[3]_[6](0)-_[7]?_[9].color:"white")&&r(e,"fill",u),p&233&&a!==(a="translate("+(_[5](_[11])+_[3]/2)+" "+(_[6](_[9].value)>_[6](0)-_[7]?_[6](_[9].value)-_[7]:_[6](_[9].value)+10)+") rotate("+(_[3]15&&Mu(t);return{c(){e=Fe("rect"),c&&c.c(),a=Ve(),r(e,"x",l=t[5](t[11])+2),r(e,"y",n=t[6](0)),r(e,"width",i=t[3]-4),r(e,"height",o=t[6](t[0].y.min)-t[6](t[0].y.min+t[9].value2)),r(e,"fill",u=t[9].color2?t[9].color2:t[9].color)},m(f,_){$(f,e,_),c&&c.m(f,_),$(f,a,_)},p(f,_){_&32&&l!==(l=f[5](f[11])+2)&&r(e,"x",l),_&64&&n!==(n=f[6](0))&&r(e,"y",n),_&8&&i!==(i=f[3]-4)&&r(e,"width",i),_&65&&o!==(o=f[6](f[0].y.min)-f[6](f[0].y.min+f[9].value2))&&r(e,"height",o),_&1&&u!==(u=f[9].color2?f[9].color2:f[9].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,_):(c=Mu(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&C(e),c&&c.d(f),f&&C(a)}}}function Mu(t){let e,l=t[9].label2+"",n,i,o,u,a,c=t[9].title2&&Su(t);return{c(){e=Fe("text"),n=S(l),c&&c.c(),a=Ve(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor","middle"),r(e,"fill",o=t[6](-t[9].value2)t[8].call(e))},m(i,o){$(i,e,o),n&&n.m(e,null),l=o0(e,t[8].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=pu(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:fe,o:fe,d(i){i&&C(e),n&&n.d(),l()}}}let cn=30;function rm(t,e,l){let{config:n}=e,i,o,u,a,c,f,_;function p(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=b=>{"config"in b&&l(0,n=b.config)},t.$$.update=()=>{if(t.$$.dirty&31){l(4,f=o-(n.title?20:0));let b=i-(n.padding.left+n.padding.right);l(3,u=b/n.points.length),l(7,_=un.y.max?M=n.padding.bottom:df||M<0?0:M})}},[n,i,o,u,f,a,c,_,p]}class pn extends Ee{constructor(e){super(),Pe(this,e,rm,om,Ne,{config:0})}}function am(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function um(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{ds:u}=e,a={};function c(f){return{label:ge(f)+"V",title:f.toFixed(1)+" V",value:isNaN(f)?0:f,color:g1(f||0)}}return t.$$set=f=>{"u1"in f&&l(1,n=f.u1),"u2"in f&&l(2,i=f.u2),"u3"in f&&l(3,o=f.u3),"ds"in f&&l(4,u=f.ds)},t.$$.update=()=>{if(t.$$.dirty&30){let f=[],_=[];n>0&&(f.push({label:u===1?"L1-L2":"L1"}),_.push(c(n))),i>0&&(f.push({label:u===1?"L1-L3":"L2"}),_.push(c(i))),o>0&&(f.push({label:u===1?"L2-L3":"L3"}),_.push(c(o))),l(0,a={title:"Voltage",padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:f},points:_})}},[a,n,i,o,u]}class fm extends Ee{constructor(e){super(),Pe(this,e,um,am,Ne,{u1:1,u2:2,u3:3,ds:4})}}function cm(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function mm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{i1:u}=e,{i2:a}=e,{i3:c}=e,{max:f}=e,_={};function p(b){return{label:ge(b)+"A",title:b.toFixed(1)+" A",value:isNaN(b)?0:b,color:Rc(b?b/f*100:0)}}return t.$$set=b=>{"u1"in b&&l(1,n=b.u1),"u2"in b&&l(2,i=b.u2),"u3"in b&&l(3,o=b.u3),"i1"in b&&l(4,u=b.i1),"i2"in b&&l(5,a=b.i2),"i3"in b&&l(6,c=b.i3),"max"in b&&l(7,f=b.max)},t.$$.update=()=>{if(t.$$.dirty&254){let b=[],v=[];n>0&&(b.push({label:"L1"}),v.push(p(u))),i>0&&(b.push({label:"L2"}),v.push(p(a))),o>0&&(b.push({label:"L3"}),v.push(p(c))),l(0,_={title:"Amperage",padding:{top:20,right:15,bottom:20,left:35},y:{min:0,max:f,ticks:[{value:0,label:"0%"},{value:f/4,label:"25%"},{value:f/2,label:"50%"},{value:f/4*3,label:"75%"},{value:f,label:"100%"}]},x:{ticks:b},points:v})}},[_,n,i,o,u,a,c,f]}class pm extends Ee{constructor(e){super(),Pe(this,e,mm,cm,Ne,{u1:1,u2:2,u3:3,i1:4,i2:5,i3:6,max:7})}}function _m(t){let e,l,n,i,o,u,a,c=(typeof t[0]<"u"?t[0].toFixed(0):"-")+"",f,_,p,b,v,d,M=(typeof t[1]<"u"?t[1].toFixed(0):"-")+"",y,T,N,E,B,P,L,O=(typeof t[2]<"u"?t[2].toFixed(1):"-")+"",F,x,j,z,G,V,W=(typeof t[3]<"u"?t[3].toFixed(1):"-")+"",U,K;return{c(){e=m("div"),l=m("strong"),l.textContent="Reactive",n=h(),i=m("div"),o=m("div"),o.textContent="Instant in",u=h(),a=m("div"),f=S(c),_=S(" VAr"),p=h(),b=m("div"),b.textContent="Instant out",v=h(),d=m("div"),y=S(M),T=S(" VAr"),N=h(),E=m("div"),B=m("div"),B.textContent="Total in",P=h(),L=m("div"),F=S(O),x=S(" kVArh"),j=h(),z=m("div"),z.textContent="Total out",G=h(),V=m("div"),U=S(W),K=S(" kVArh"),r(a,"class","text-right"),r(d,"class","text-right"),r(i,"class","grid grid-cols-2 mt-4"),r(L,"class","text-right"),r(V,"class","text-right"),r(E,"class","grid grid-cols-2 mt-4"),r(e,"class","mx-2 text-sm")},m(H,Y){$(H,e,Y),s(e,l),s(e,n),s(e,i),s(i,o),s(i,u),s(i,a),s(a,f),s(a,_),s(i,p),s(i,b),s(i,v),s(i,d),s(d,y),s(d,T),s(e,N),s(e,E),s(E,B),s(E,P),s(E,L),s(L,F),s(L,x),s(E,j),s(E,z),s(E,G),s(E,V),s(V,U),s(V,K)},p(H,[Y]){Y&1&&c!==(c=(typeof H[0]<"u"?H[0].toFixed(0):"-")+"")&&X(f,c),Y&2&&M!==(M=(typeof H[1]<"u"?H[1].toFixed(0):"-")+"")&&X(y,M),Y&4&&O!==(O=(typeof H[2]<"u"?H[2].toFixed(1):"-")+"")&&X(F,O),Y&8&&W!==(W=(typeof H[3]<"u"?H[3].toFixed(1):"-")+"")&&X(U,W)},i:fe,o:fe,d(H){H&&C(e)}}}function dm(t,e,l){let{importInstant:n}=e,{exportInstant:i}=e,{importTotal:o}=e,{exportTotal:u}=e;return t.$$set=a=>{"importInstant"in a&&l(0,n=a.importInstant),"exportInstant"in a&&l(1,i=a.exportInstant),"importTotal"in a&&l(2,o=a.importTotal),"exportTotal"in a&&l(3,u=a.exportTotal)},[n,i,o,u]}class vm extends Ee{constructor(e){super(),Pe(this,e,dm,_m,Ne,{importInstant:0,exportInstant:1,importTotal:2,exportTotal:3})}}function Nu(t){let e;function l(o,u){return o[3]?bm:hm}let n=l(t),i=n(t);return{c(){i.c(),e=Ve()},m(o,u){i.m(o,u),$(o,e,u)},p(o,u){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&C(e)}}}function hm(t){let e,l,n,i,o,u,a=ge(t[1].h.u,2)+"",c,f,_,p,b,v,d=ge(t[1].d.u,1)+"",M,y,T,N,E,B,P=ge(t[1].m.u)+"",L,O,F,x,j,z,G=ge(t[0].last_month.u)+"",V,W,U,K,H=t[4]&&Au(t);return{c(){e=m("strong"),e.textContent="Consumption",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=S(a),f=S(" kWh"),_=h(),p=m("div"),p.textContent="Day",b=h(),v=m("div"),M=S(d),y=S(" kWh"),T=h(),N=m("div"),N.textContent="Month",E=h(),B=m("div"),L=S(P),O=S(" kWh"),F=h(),x=m("div"),x.textContent="Last month",j=h(),z=m("div"),V=S(G),W=S(" kWh"),U=h(),H&&H.c(),K=Ve(),r(u,"class","text-right"),r(v,"class","text-right"),r(B,"class","text-right"),r(z,"class","text-right"),r(n,"class","grid grid-cols-2 mb-3")},m(Y,Z){$(Y,e,Z),$(Y,l,Z),$(Y,n,Z),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,_),s(n,p),s(n,b),s(n,v),s(v,M),s(v,y),s(n,T),s(n,N),s(n,E),s(n,B),s(B,L),s(B,O),s(n,F),s(n,x),s(n,j),s(n,z),s(z,V),s(z,W),$(Y,U,Z),H&&H.m(Y,Z),$(Y,K,Z)},p(Y,Z){Z&2&&a!==(a=ge(Y[1].h.u,2)+"")&&X(c,a),Z&2&&d!==(d=ge(Y[1].d.u,1)+"")&&X(M,d),Z&2&&P!==(P=ge(Y[1].m.u)+"")&&X(L,P),Z&1&&G!==(G=ge(Y[0].last_month.u)+"")&&X(V,G),Y[4]?H?H.p(Y,Z):(H=Au(Y),H.c(),H.m(K.parentNode,K)):H&&(H.d(1),H=null)},d(Y){Y&&C(e),Y&&C(l),Y&&C(n),Y&&C(U),H&&H.d(Y),Y&&C(K)}}}function bm(t){let e,l,n,i,o,u,a=ge(t[1].h.u,2)+"",c,f,_,p,b,v,d,M=ge(t[1].d.u,1)+"",y,T,N,E,B,P,L,O=ge(t[1].m.u)+"",F,x,j,z,G,V,W,U=ge(t[0].last_month.u)+"",K,H,Y,Z,re,ue,ke,me,Se,je,Re,He=ge(t[1].h.p,2)+"",we,Te,Le,$e,w,g,k,A=ge(t[1].d.p,1)+"",I,Q,J,se,ce,ve,Me,oe=ge(t[1].m.p)+"",pe,Be,_e,ye,vt,Hl,tl,ct=ge(t[0].last_month.p)+"",Tl,pl,Ht,ht,Qe=t[4]&&Pu(t),Xe=t[4]&&Eu(t),Ze=t[4]&&Du(t),Ue=t[4]&&Iu(t),Je=t[4]&&Ru(t),We=t[4]&&Lu(t),xe=t[4]&&Ou(t),et=t[4]&&Fu(t);return{c(){e=m("strong"),e.textContent="Import",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=S(a),f=S(" kWh"),_=h(),Qe&&Qe.c(),p=h(),b=m("div"),b.textContent="Day",v=h(),d=m("div"),y=S(M),T=S(" kWh"),N=h(),Xe&&Xe.c(),E=h(),B=m("div"),B.textContent="Month",P=h(),L=m("div"),F=S(O),x=S(" kWh"),j=h(),Ze&&Ze.c(),z=h(),G=m("div"),G.textContent="Last mo.",V=h(),W=m("div"),K=S(U),H=S(" kWh"),Y=h(),Ue&&Ue.c(),re=h(),ue=m("strong"),ue.textContent="Export",ke=h(),me=m("div"),Se=m("div"),Se.textContent="Hour",je=h(),Re=m("div"),we=S(He),Te=S(" kWh"),Le=h(),Je&&Je.c(),$e=h(),w=m("div"),w.textContent="Day",g=h(),k=m("div"),I=S(A),Q=S(" kWh"),J=h(),We&&We.c(),se=h(),ce=m("div"),ce.textContent="Month",ve=h(),Me=m("div"),pe=S(oe),Be=S(" kWh"),_e=h(),xe&&xe.c(),ye=h(),vt=m("div"),vt.textContent="Last mo.",Hl=h(),tl=m("div"),Tl=S(ct),pl=S(" kWh"),Ht=h(),et&&et.c(),r(u,"class","text-right"),r(d,"class","text-right"),r(L,"class","text-right"),r(W,"class","text-right"),r(n,"class",Z="grid grid-cols-"+t[5]+" mb-3"),r(Re,"class","text-right"),r(k,"class","text-right"),r(Me,"class","text-right"),r(tl,"class","text-right"),r(me,"class",ht="grid grid-cols-"+t[5])},m(de,Ce){$(de,e,Ce),$(de,l,Ce),$(de,n,Ce),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,_),Qe&&Qe.m(n,null),s(n,p),s(n,b),s(n,v),s(n,d),s(d,y),s(d,T),s(n,N),Xe&&Xe.m(n,null),s(n,E),s(n,B),s(n,P),s(n,L),s(L,F),s(L,x),s(n,j),Ze&&Ze.m(n,null),s(n,z),s(n,G),s(n,V),s(n,W),s(W,K),s(W,H),s(n,Y),Ue&&Ue.m(n,null),$(de,re,Ce),$(de,ue,Ce),$(de,ke,Ce),$(de,me,Ce),s(me,Se),s(me,je),s(me,Re),s(Re,we),s(Re,Te),s(me,Le),Je&&Je.m(me,null),s(me,$e),s(me,w),s(me,g),s(me,k),s(k,I),s(k,Q),s(me,J),We&&We.m(me,null),s(me,se),s(me,ce),s(me,ve),s(me,Me),s(Me,pe),s(Me,Be),s(me,_e),xe&&xe.m(me,null),s(me,ye),s(me,vt),s(me,Hl),s(me,tl),s(tl,Tl),s(tl,pl),s(me,Ht),et&&et.m(me,null)},p(de,Ce){Ce&2&&a!==(a=ge(de[1].h.u,2)+"")&&X(c,a),de[4]?Qe?Qe.p(de,Ce):(Qe=Pu(de),Qe.c(),Qe.m(n,p)):Qe&&(Qe.d(1),Qe=null),Ce&2&&M!==(M=ge(de[1].d.u,1)+"")&&X(y,M),de[4]?Xe?Xe.p(de,Ce):(Xe=Eu(de),Xe.c(),Xe.m(n,E)):Xe&&(Xe.d(1),Xe=null),Ce&2&&O!==(O=ge(de[1].m.u)+"")&&X(F,O),de[4]?Ze?Ze.p(de,Ce):(Ze=Du(de),Ze.c(),Ze.m(n,z)):Ze&&(Ze.d(1),Ze=null),Ce&1&&U!==(U=ge(de[0].last_month.u)+"")&&X(K,U),de[4]?Ue?Ue.p(de,Ce):(Ue=Iu(de),Ue.c(),Ue.m(n,null)):Ue&&(Ue.d(1),Ue=null),Ce&32&&Z!==(Z="grid grid-cols-"+de[5]+" mb-3")&&r(n,"class",Z),Ce&2&&He!==(He=ge(de[1].h.p,2)+"")&&X(we,He),de[4]?Je?Je.p(de,Ce):(Je=Ru(de),Je.c(),Je.m(me,$e)):Je&&(Je.d(1),Je=null),Ce&2&&A!==(A=ge(de[1].d.p,1)+"")&&X(I,A),de[4]?We?We.p(de,Ce):(We=Lu(de),We.c(),We.m(me,se)):We&&(We.d(1),We=null),Ce&2&&oe!==(oe=ge(de[1].m.p)+"")&&X(pe,oe),de[4]?xe?xe.p(de,Ce):(xe=Ou(de),xe.c(),xe.m(me,ye)):xe&&(xe.d(1),xe=null),Ce&1&&ct!==(ct=ge(de[0].last_month.p)+"")&&X(Tl,ct),de[4]?et?et.p(de,Ce):(et=Fu(de),et.c(),et.m(me,null)):et&&(et.d(1),et=null),Ce&32&&ht!==(ht="grid grid-cols-"+de[5])&&r(me,"class",ht)},d(de){de&&C(e),de&&C(l),de&&C(n),Qe&&Qe.d(),Xe&&Xe.d(),Ze&&Ze.d(),Ue&&Ue.d(),de&&C(re),de&&C(ue),de&&C(ke),de&&C(me),Je&&Je.d(),We&&We.d(),xe&&xe.d(),et&&et.d()}}}function Au(t){let e,l,n,i,o,u,a=ge(t[1].h.c,2)+"",c,f,_,p,b,v,d,M=ge(t[1].d.c,1)+"",y,T,N,E,B,P,L,O=ge(t[1].m.c)+"",F,x,j,z,G,V,W,U=ge(t[0].last_month.c)+"",K,H,Y;return{c(){e=m("strong"),e.textContent="Cost",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=S(a),f=h(),_=S(t[2]),p=h(),b=m("div"),b.textContent="Day",v=h(),d=m("div"),y=S(M),T=h(),N=S(t[2]),E=h(),B=m("div"),B.textContent="Month",P=h(),L=m("div"),F=S(O),x=h(),j=S(t[2]),z=h(),G=m("div"),G.textContent="Last month",V=h(),W=m("div"),K=S(U),H=h(),Y=S(t[2]),r(u,"class","text-right"),r(d,"class","text-right"),r(L,"class","text-right"),r(W,"class","text-right"),r(n,"class","grid grid-cols-2")},m(Z,re){$(Z,e,re),$(Z,l,re),$(Z,n,re),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(u,_),s(n,p),s(n,b),s(n,v),s(n,d),s(d,y),s(d,T),s(d,N),s(n,E),s(n,B),s(n,P),s(n,L),s(L,F),s(L,x),s(L,j),s(n,z),s(n,G),s(n,V),s(n,W),s(W,K),s(W,H),s(W,Y)},p(Z,re){re&2&&a!==(a=ge(Z[1].h.c,2)+"")&&X(c,a),re&4&&X(_,Z[2]),re&2&&M!==(M=ge(Z[1].d.c,1)+"")&&X(y,M),re&4&&X(N,Z[2]),re&2&&O!==(O=ge(Z[1].m.c)+"")&&X(F,O),re&4&&X(j,Z[2]),re&1&&U!==(U=ge(Z[0].last_month.c)+"")&&X(K,U),re&4&&X(Y,Z[2])},d(Z){Z&&C(e),Z&&C(l),Z&&C(n)}}}function Pu(t){let e,l=ge(t[1].h.c,2)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].h.c,2)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Eu(t){let e,l=ge(t[1].d.c,1)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].d.c,1)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Du(t){let e,l=ge(t[1].m.c)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].m.c)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Iu(t){let e,l=ge(t[0].last_month.c)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ge(u[0].last_month.c)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Ru(t){let e,l=ge(t[1].h.i,2)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].h.i,2)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Lu(t){let e,l=ge(t[1].d.i,1)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].d.i,1)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Ou(t){let e,l=ge(t[1].m.i)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].m.i)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Fu(t){let e,l=ge(t[0].last_month.i)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){$(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ge(u[0].last_month.i)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function gm(t){let e,l,n,i,o,u,a=t[1]&&Nu(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Real time calculation",n=h(),i=m("br"),o=m("br"),u=h(),a&&a.c(),r(e,"class","mx-2 text-sm")},m(c,f){$(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),s(e,u),a&&a.m(e,null)},p(c,[f]){c[1]?a?a.p(c,f):(a=Nu(c),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i:fe,o:fe,d(c){c&&C(e),a&&a.d()}}}function km(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:u}=e,a=!1,c=3;return t.$$set=f=>{"sysinfo"in f&&l(0,n=f.sysinfo),"data"in f&&l(1,i=f.data),"currency"in f&&l(2,o=f.currency),"hasExport"in f&&l(3,u=f.hasExport)},t.$$.update=()=>{t.$$.dirty&18&&(l(4,a=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(5,c=a?3:2))},[n,i,o,u,a,c]}class wm extends Ee{constructor(e){super(),Pe(this,e,km,gm,Ne,{sysinfo:0,data:1,currency:2,hasExport:3})}}function ym(t){let e,l,n=Ja(t[0].source)+"",i,o,u,a;return u=new pn({props:{config:t[1]}}),{c(){e=m("a"),l=S("Provided by: "),i=S(n),o=h(),ie(u.$$.fragment),r(e,"href","https://transparency.entsoe.eu/"),r(e,"target","_blank"),r(e,"class","text-xs float-right z-40")},m(c,f){$(c,e,f),s(e,l),s(e,i),$(c,o,f),le(u,c,f),a=!0},p(c,[f]){(!a||f&1)&&n!==(n=Ja(c[0].source)+"")&&X(i,n);const _={};f&2&&(_.config=c[1]),u.$set(_)},i(c){a||(D(u.$$.fragment,c),a=!0)},o(c){q(u.$$.fragment,c),a=!1},d(c){c&&C(e),c&&C(o),ne(u,c)}}}function Cm(t,e,l){let{json:n}=e,{sysinfo:i}=e,o={},u,a;return t.$$set=c=>{"json"in c&&l(0,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&29){let c=n.currency,f=new Date().getUTCHours(),_=0,p=0,b=0,v=[],d=[],M=[];l(4,a=l(3,u=0));let y=new Date;for(fl(y,i.clock_offset-(24+y.getHours()-y.getUTCHours())%24),_=f;_<24&&(p=n[Oe(b++)],p!=null);_++)d.push({label:Oe(y.getHours())}),M.push(p*100),l(4,a=Math.min(a,p*100)),l(3,u=Math.max(u,p*100)),fl(y,1);for(_=0;_<24&&(p=n[Oe(b++)],p!=null);_++)d.push({label:Oe(y.getHours())}),M.push(p*100),l(4,a=Math.min(a,p*100)),l(3,u=Math.max(u,p*100)),fl(y,1);if(a>-100&&u<100){switch(c){case"NOK":case"SEK":case"DKK":c="\xF8re";break;case"EUR":c="cent";break;default:c=c+"/100"}for(l(4,a*=100),l(3,u*=100),_=0;_=0?P.toFixed(L):"",title:P>=0?P.toFixed(2)+" "+c:"",value:p>=0?Math.abs(p):0,label2:P<0?P.toFixed(L):"",title2:P<0?P.toFixed(2)+" "+c:"",value2:p<0?Math.abs(p):0,color:"#7c3aed"})}let N=Math.max(u,Math.abs(a));if(a<0){l(4,a=Math.min(N/4*-1,a));let P=Math.ceil(Math.abs(a)/N*4),L=a/P;for(_=1;_{"json"in c&&l(1,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,f=[],_=[],p=[];l(4,a=l(3,u=0));let b=fl(new Date,-24),v=new Date().getUTCHours();for(fl(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),c=v;c<24;c++){let T=n["i"+Oe(c)],N=n["e"+Oe(c)];T===void 0&&(T=0),N===void 0&&(N=0),_.push({label:Oe(b.getHours())}),p.push({label:T.toFixed(1),title:T.toFixed(2)+" kWh",value:T*10,label2:N.toFixed(1),title2:N.toFixed(2)+" kWh",value2:N*10,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,N*10)),l(3,u=Math.max(u,T*10)),fl(b,1)}for(c=0;c{"json"in c&&l(1,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,f=[],_=[],p=[];l(4,a=l(3,u=0));let b=new Date,v=new Date;for(fl(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),fl(v,i.clock_offset-(24+v.getHours()-v.getUTCHours())%24),v.setDate(0),c=b.getDate();c<=v.getDate();c++){let T=n["i"+Oe(c)],N=n["e"+Oe(c)];T===void 0&&(T=0),N===void 0&&(N=0),_.push({label:Oe(c)}),p.push({label:T.toFixed(T<10?1:0),title:T.toFixed(2)+" kWh",value:T,label2:N.toFixed(N<10?1:0),title2:N.toFixed(2)+" kWh",value2:N,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,N)),l(3,u=Math.max(u,T))}for(c=1;c{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=0,c=0,f=[],_=[],p=[];n.s&&n.s.forEach((d,M)=>{var y=d.n?d.n:d.a;c=d.v,c==-127&&(c=0),_.push({label:y.slice(-4)}),p.push({label:c.toFixed(1),value:c,color:"#7c3aed"}),l(3,u=Math.min(u,c)),l(2,o=Math.max(o,c))}),l(2,o=Math.ceil(o)),l(3,u=Math.floor(u));let b=o;u<0&&(b+=Math.abs(u));let v=b/4;for(a=0;a<5;a++)c=u+v*a,f.push({value:c,label:c.toFixed(1)});l(0,i={title:"Temperature sensors (\xB0C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:u,max:o,ticks:f},x:{ticks:_},points:p})}},[i,n,o,u]}class Im extends Ee{constructor(e){super(),Pe(this,e,Dm,Em,Ne,{json:1})}}function Rm(t){let e,l;return e=new pn({props:{config:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}let Lm=0;function Om(t,e,l){let n={},i=0,o;return Hc.subscribe(u=>{l(2,o=u)}),jc(),t.$$.update=()=>{if(t.$$.dirty&6){let u=0,a=[],c=[],f=[];if(a.push({value:0,label:0}),o&&o.p)for(u=0;u0?Oe(_.d)+"."+no[new Date().getMonth()]:"-"}),l(1,i=Math.max(i,_.v))}if(o&&o.t){for(u=0;u=i)break;a.push({value:_,label:_})}a.push({label:o.m.toFixed(1),align:"right",color:"green",value:o.m})}o&&o.c&&(a.push({label:o.c.toFixed(0),color:"orange",value:o.c}),l(1,i=Math.max(i,o.c))),l(1,i=Math.ceil(i)),l(0,n={title:"Tariff peaks",padding:{top:20,right:35,bottom:20,left:35},y:{min:Lm,max:i,ticks:a},x:{ticks:c},points:f})}},[n,i,o]}class Fm extends Ee{constructor(e){super(),Pe(this,e,Om,Rm,Ne,{})}}function qu(t){let e,l,n,i,o,u,a=(t[0].mt?Cs(t[0].mt):"-")+"",c,f,_,p=(t[0].ic?t[0].ic.toFixed(1):"-")+"",b,v,d;return i=new Kc({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:"Import",sub:t[0].p,subunit:t[0].pc,colorFn:Rc}}),{c(){e=m("div"),l=m("div"),n=m("div"),ie(i.$$.fragment),o=h(),u=m("div"),c=S(a),f=h(),_=m("div"),b=S(p),v=S(" kWh"),r(n,"class","col-span-2"),r(_,"class","text-right"),r(l,"class","grid grid-cols-2"),r(e,"class","cnt")},m(M,y){$(M,e,y),s(e,l),s(l,n),le(i,n,null),s(l,o),s(l,u),s(u,c),s(l,f),s(l,_),s(_,b),s(_,v),d=!0},p(M,y){const T={};y&1&&(T.val=M[0].i?M[0].i:0),y&1&&(T.max=M[0].im?M[0].im:15e3),y&1&&(T.sub=M[0].p),y&1&&(T.subunit=M[0].pc),i.$set(T),(!d||y&1)&&a!==(a=(M[0].mt?Cs(M[0].mt):"-")+"")&&X(c,a),(!d||y&1)&&p!==(p=(M[0].ic?M[0].ic.toFixed(1):"-")+"")&&X(b,p)},i(M){d||(D(i.$$.fragment,M),d=!0)},o(M){q(i.$$.fragment,M),d=!1},d(M){M&&C(e),ne(i)}}}function Bu(t){let e,l,n,i,o,u,a,c,f=(t[0].ec?t[0].ec.toFixed(1):"-")+"",_,p,b;return i=new Kc({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:"Export",colorFn:k1}}),{c(){e=m("div"),l=m("div"),n=m("div"),ie(i.$$.fragment),o=h(),u=m("div"),a=h(),c=m("div"),_=S(f),p=S(" kWh"),r(n,"class","col-span-2"),r(c,"class","text-right"),r(l,"class","grid grid-cols-2"),r(e,"class","cnt")},m(v,d){$(v,e,d),s(e,l),s(l,n),le(i,n,null),s(l,o),s(l,u),s(l,a),s(l,c),s(c,_),s(c,p),b=!0},p(v,d){const M={};d&1&&(M.val=v[0].e?v[0].e:0),d&1&&(M.max=v[0].om?v[0].om*1e3:1e4),i.$set(M),(!b||d&1)&&f!==(f=(v[0].ec?v[0].ec.toFixed(1):"-")+"")&&X(_,f)},i(v){b||(D(i.$$.fragment,v),b=!0)},o(v){q(i.$$.fragment,v),b=!1},d(v){v&&C(e),ne(i)}}}function Uu(t){let e,l,n;return l=new fm({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,ds:t[0].ds}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&1&&(u.u1=i[0].u1),o&1&&(u.u2=i[0].u2),o&1&&(u.u3=i[0].u3),o&1&&(u.ds=i[0].ds),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function ju(t){let e,l,n;return l=new pm({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,i1:t[0].i1,i2:t[0].i2,i3:t[0].i3,max:t[0].mf?t[0].mf:32}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&1&&(u.u1=i[0].u1),o&1&&(u.u2=i[0].u2),o&1&&(u.u3=i[0].u3),o&1&&(u.i1=i[0].i1),o&1&&(u.i2=i[0].i2),o&1&&(u.i3=i[0].i3),o&1&&(u.max=i[0].mf?i[0].mf:32),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Hu(t){let e,l,n;return l=new vm({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&1&&(u.importInstant=i[0].ri),o&1&&(u.exportInstant=i[0].re),o&1&&(u.importTotal=i[0].ric),o&1&&(u.exportTotal=i[0].rec),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Wu(t){let e,l,n;return l=new wm({props:{sysinfo:t[1],data:t[0].ea,currency:t[0].pc,hasExport:t[0].om>0||t[0].e>0}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&2&&(u.sysinfo=i[1]),o&1&&(u.data=i[0].ea),o&1&&(u.currency=i[0].pc),o&1&&(u.hasExport=i[0].om>0||i[0].e>0),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function zu(t){let e,l,n;return l=new Fm({}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt h-64")},m(i,o){$(i,e,o),le(l,e,null),n=!0},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Gu(t){let e,l,n;return l=new $m({props:{json:t[2],sysinfo:t[1]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&4&&(u.json=i[2]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Vu(t){let e,l,n;return l=new Tm({props:{json:t[3],sysinfo:t[1]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&8&&(u.json=i[3]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Ku(t){let e,l,n;return l=new Pm({props:{json:t[4],sysinfo:t[1]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&16&&(u.json=i[4]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Yu(t){let e,l,n;return l=new Im({props:{json:t[5]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&32&&(u.json=i[5]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function qm(t){let e,l=Ke(t[1].ui.i,t[0].i),n,i=Ke(t[1].ui.e,t[0].om||t[0].e>0),o,u=Ke(t[1].ui.v,t[0].u1>100||t[0].u2>100||t[0].u3>100),a,c=Ke(t[1].ui.a,t[0].i1>.01||t[0].i2>.01||t[0].i3>.01),f,_=Ke(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),p,b=Ke(t[1].ui.c,t[0].ea),v,d=Ke(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),M,y=Ke(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),T,N=Ke(t[1].ui.d,t[3]),E,B=Ke(t[1].ui.m,t[4]),P,L=Ke(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),O,F=l&&qu(t),x=i&&Bu(t),j=u&&Uu(t),z=c&&ju(t),G=_&&Hu(t),V=b&&Wu(t),W=d&&zu(),U=y&&Gu(t),K=N&&Vu(t),H=B&&Ku(t),Y=L&&Yu(t);return{c(){e=m("div"),F&&F.c(),n=h(),x&&x.c(),o=h(),j&&j.c(),a=h(),z&&z.c(),f=h(),G&&G.c(),p=h(),V&&V.c(),v=h(),W&&W.c(),M=h(),U&&U.c(),T=h(),K&&K.c(),E=h(),H&&H.c(),P=h(),Y&&Y.c(),r(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(Z,re){$(Z,e,re),F&&F.m(e,null),s(e,n),x&&x.m(e,null),s(e,o),j&&j.m(e,null),s(e,a),z&&z.m(e,null),s(e,f),G&&G.m(e,null),s(e,p),V&&V.m(e,null),s(e,v),W&&W.m(e,null),s(e,M),U&&U.m(e,null),s(e,T),K&&K.m(e,null),s(e,E),H&&H.m(e,null),s(e,P),Y&&Y.m(e,null),O=!0},p(Z,[re]){re&3&&(l=Ke(Z[1].ui.i,Z[0].i)),l?F?(F.p(Z,re),re&3&&D(F,1)):(F=qu(Z),F.c(),D(F,1),F.m(e,n)):F&&(De(),q(F,1,1,()=>{F=null}),Ie()),re&3&&(i=Ke(Z[1].ui.e,Z[0].om||Z[0].e>0)),i?x?(x.p(Z,re),re&3&&D(x,1)):(x=Bu(Z),x.c(),D(x,1),x.m(e,o)):x&&(De(),q(x,1,1,()=>{x=null}),Ie()),re&3&&(u=Ke(Z[1].ui.v,Z[0].u1>100||Z[0].u2>100||Z[0].u3>100)),u?j?(j.p(Z,re),re&3&&D(j,1)):(j=Uu(Z),j.c(),D(j,1),j.m(e,a)):j&&(De(),q(j,1,1,()=>{j=null}),Ie()),re&3&&(c=Ke(Z[1].ui.a,Z[0].i1>.01||Z[0].i2>.01||Z[0].i3>.01)),c?z?(z.p(Z,re),re&3&&D(z,1)):(z=ju(Z),z.c(),D(z,1),z.m(e,f)):z&&(De(),q(z,1,1,()=>{z=null}),Ie()),re&3&&(_=Ke(Z[1].ui.r,Z[0].ri>0||Z[0].re>0||Z[0].ric>0||Z[0].rec>0)),_?G?(G.p(Z,re),re&3&&D(G,1)):(G=Hu(Z),G.c(),D(G,1),G.m(e,p)):G&&(De(),q(G,1,1,()=>{G=null}),Ie()),re&3&&(b=Ke(Z[1].ui.c,Z[0].ea)),b?V?(V.p(Z,re),re&3&&D(V,1)):(V=Wu(Z),V.c(),D(V,1),V.m(e,v)):V&&(De(),q(V,1,1,()=>{V=null}),Ie()),re&3&&(d=Ke(Z[1].ui.t,Z[0].pr&&(Z[0].pr.startsWith("10YNO")||Z[0].pr.startsWith("10Y1001A1001A4")))),d?W?re&3&&D(W,1):(W=zu(),W.c(),D(W,1),W.m(e,M)):W&&(De(),q(W,1,1,()=>{W=null}),Ie()),re&3&&(y=Ke(Z[1].ui.p,Z[0].pe&&!Number.isNaN(Z[0].p))),y?U?(U.p(Z,re),re&3&&D(U,1)):(U=Gu(Z),U.c(),D(U,1),U.m(e,T)):U&&(De(),q(U,1,1,()=>{U=null}),Ie()),re&10&&(N=Ke(Z[1].ui.d,Z[3])),N?K?(K.p(Z,re),re&10&&D(K,1)):(K=Vu(Z),K.c(),D(K,1),K.m(e,E)):K&&(De(),q(K,1,1,()=>{K=null}),Ie()),re&18&&(B=Ke(Z[1].ui.m,Z[4])),B?H?(H.p(Z,re),re&18&&D(H,1)):(H=Ku(Z),H.c(),D(H,1),H.m(e,P)):H&&(De(),q(H,1,1,()=>{H=null}),Ie()),re&35&&(L=Ke(Z[1].ui.s,Z[0].t&&Z[0].t!=-127&&Z[5].c>1)),L?Y?(Y.p(Z,re),re&35&&D(Y,1)):(Y=Yu(Z),Y.c(),D(Y,1),Y.m(e,null)):Y&&(De(),q(Y,1,1,()=>{Y=null}),Ie())},i(Z){O||(D(F),D(x),D(j),D(z),D(G),D(V),D(W),D(U),D(K),D(H),D(Y),O=!0)},o(Z){q(F),q(x),q(j),q(z),q(G),q(V),q(W),q(U),q(K),q(H),q(Y),O=!1},d(Z){Z&&C(e),F&&F.d(),x&&x.d(),j&&j.d(),z&&z.d(),G&&G.d(),V&&V.d(),W&&W.d(),U&&U.d(),K&&K.d(),H&&H.d(),Y&&Y.d()}}}function Bm(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},u={},a={},c={};return Co.subscribe(f=>{l(2,o=f)}),Fc.subscribe(f=>{l(3,u=f)}),qc.subscribe(f=>{l(4,a=f)}),Uc.subscribe(f=>{l(5,c=f)}),t.$$set=f=>{"data"in f&&l(0,n=f.data),"sysinfo"in f&&l(1,i=f.sysinfo)},[n,i,o,u,a,c]}class Um extends Ee{constructor(e){super(),Pe(this,e,Bm,qm,Ne,{data:0,sysinfo:1})}}let fo={};const Ci=at(fo);async function jm(){fo=await(await fetch("/configuration.json")).json(),Ci.set(fo)}function Qu(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Hm(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){$(l,e,n)},d(l){l&&C(e)}}}function Wm(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){$(l,e,n)},d(l){l&&C(e)}}}function Xu(t){let e;return{c(){e=m("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){$(l,e,n)},d(l){l&&C(e)}}}function Zu(t){let e,l,n;return{c(){e=m("option"),e.textContent="UART1",l=h(),n=m("option"),n.textContent="UART2",e.__value=9,e.value=e.__value,n.__value=16,n.value=n.__value},m(i,o){$(i,e,o),$(i,l,o),$(i,n,o)},d(i){i&&C(e),i&&C(l),i&&C(n)}}}function Ju(t){let e;return{c(){e=m("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){$(l,e,n)},d(l){l&&C(e)}}}function xu(t){let e,l,n;return{c(){e=m("option"),l=S("GPIO"),n=S(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){$(i,e,o),s(e,l),s(e,n)},d(i){i&&C(e)}}}function ef(t){let e,l=t[4]>3&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!(t[0]=="esp32s2"&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&xu(t);return{c(){l&&l.c(),e=Ve()},m(n,i){l&&l.m(n,i),$(n,e,i)},p(n,i){n[4]>3&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!(n[0]=="esp32s2"&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=xu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&C(e)}}}function zm(t){let e,l,n,i,o;function u(d,M){return d[0]=="esp32c3"?Wm:Hm}let a=u(t),c=a(t),f=t[0]=="esp8266"&&Xu(),_=(t[0]=="esp32"||t[0]=="esp32solo")&&Zu(),p=t[0]=="esp32s2"&&Ju(),b={length:t[1]+1},v=[];for(let d=0;d{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32c3":l(1,i=19);break}},[n,i]}class Yc extends Ee{constructor(e){super(),Pe(this,e,Gm,zm,Ne,{chip:0})}}function tf(t){let e,l,n=t[1]&&lf(t);return{c(){e=m("div"),l=m("div"),n&&n.c(),r(l,"class","fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center"),r(e,"class","z-50"),r(e,"aria-modal","true")},m(i,o){$(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=lf(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&C(e),n&&n.d()}}}function lf(t){let e,l;return{c(){e=m("div"),l=S(t[1]),r(e,"class","bg-white m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 w-96")},m(n,i){$(n,e,i),s(e,l)},p(n,i){i&2&&X(l,n[1])},d(n){n&&C(e)}}}function Vm(t){let e,l=t[0]&&tf(t);return{c(){l&&l.c(),e=Ve()},m(n,i){l&&l.m(n,i),$(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=tf(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:fe,o:fe,d(n){l&&l.d(n),n&&C(e)}}}function Km(t,e,l){let{active:n}=e,{message:i}=e;return t.$$set=o=>{"active"in o&&l(0,n=o.active),"message"in o&&l(1,i=o.message)},[n,i]}class It extends Ee{constructor(e){super(),Pe(this,e,Km,Vm,Ne,{active:0,message:1})}}function nf(t,e,l){const n=t.slice();return n[1]=e[l],n}function sf(t){let e,l,n=t[1]+"",i;return{c(){e=m("option"),l=S("Europe/"),i=S(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,u){$(o,e,u),s(e,l),s(e,i)},p:fe,d(o){o&&C(e)}}}function Ym(t){let e,l,n,i=t[0],o=[];for(let u=0;u>1&1,A=0;A0;g--)A[g]=A[g]?A[g-1]^P.EXPONENT[F._modN(P.LOG[A[g]]+w)]:A[g-1];A[0]=P.EXPONENT[F._modN(P.LOG[A[0]]+w)]}for(w=0;w<=k;w++)A[w]=P.LOG[A[w]]},_checkBadness:function(){var w,g,k,A,I,Q=0,J=this._badness,se=this.buffer,ce=this.width;for(I=0;Ice*ce;)oe-=ce*ce,Me++;for(Q+=Me*F.N4,A=0;A=J-2&&(w=J-2,I>9&&w--);var se=w;if(I>9){for(Q[se+2]=0,Q[se+3]=0;se--;)g=Q[se],Q[se+3]|=255&g<<4,Q[se+2]=g>>4;Q[2]|=255&w<<4,Q[1]=w>>4,Q[0]=64|w>>12}else{for(Q[se+1]=0,Q[se+2]=0;se--;)g=Q[se],Q[se+2]|=255&g<<4,Q[se+1]=g>>4;Q[1]|=255&w<<4,Q[0]=64|w>>4}for(se=w+3-(I<10);se=5&&(k+=F.N1+A[g]-5);for(g=3;gw||A[g-3]*3>=A[g]*4||A[g+3]*3>=A[g]*4)&&(k+=F.N3);return k},_finish:function(){this._stringBuffer=this.buffer.slice();var w,g,k=0,A=3e4;for(g=0;g<8&&(this._applyMask(g),w=this._checkBadness(),w>=1)A&1&&(I[Q-1-g+Q*8]=1,g<6?I[8+Q*g]=1:I[8+Q*(g+1)]=1);for(g=0;g<7;g++,A>>=1)A&1&&(I[8+Q*(Q-7+g)]=1,g?I[6-g+Q*8]=1:I[7+Q*8]=1)},_interleaveBlocks:function(){var w,g,k=this._dataBlock,A=this._ecc,I=this._eccBlock,Q=0,J=this._calculateMaxLength(),se=this._neccBlock1,ce=this._neccBlock2,ve=this._stringBuffer;for(w=0;w1)for(w=T.BLOCK[A],k=I-7;;){for(g=I-7;g>w-3&&(this._addAlignment(g,k),!(g6)for(w=O.BLOCK[Q-7],g=17,k=0;k<6;k++)for(A=0;A<3;A++,g--)1&(g>11?Q>>g-12:w>>g)?(I[5-k+J*(2-A+J-11)]=1,I[2-A+J-11+J*(5-k)]=1):(this._setMask(5-k,2-A+J-11),this._setMask(2-A+J-11,5-k))},_isMasked:function(w,g){var k=F._getMaskBit(w,g);return this._mask[k]===1},_pack:function(){var w,g,k,A=1,I=1,Q=this.width,J=Q-1,se=Q-1,ce=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(g=0;gg&&(k=w,w=g,g=k),k=g,k+=g*g,k>>=1,k+=w,k},_modN:function(w){for(;w>=255;)w-=255,w=(w>>8)+(w&255);return w},N1:3,N2:3,N3:40,N4:10}),x=F,j=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var w=this.element;w.width=w.height=this.qrious.size}}),z=j,G=p.extend(function(w,g,k,A){this.name=w,this.modifiable=Boolean(g),this.defaultValue=k,this._valueTransformer=A},{transform:function(w){var g=this._valueTransformer;return typeof g=="function"?g(w,this):w}}),V=G,W=p.extend(null,{abs:function(w){return w!=null?Math.abs(w):null},hasOwn:function(w,g){return Object.prototype.hasOwnProperty.call(w,g)},noop:function(){},toUpperCase:function(w){return w!=null?w.toUpperCase():null}}),U=W,K=p.extend(function(w){this.options={},w.forEach(function(g){this.options[g.name]=g},this)},{exists:function(w){return this.options[w]!=null},get:function(w,g){return K._get(this.options[w],g)},getAll:function(w){var g,k=this.options,A={};for(g in k)U.hasOwn(k,g)&&(A[g]=K._get(k[g],w));return A},init:function(w,g,k){typeof k!="function"&&(k=U.noop);var A,I;for(A in this.options)U.hasOwn(this.options,A)&&(I=this.options[A],K._set(I,I.defaultValue,g),K._createAccessor(I,g,k));this._setAll(w,g,!0)},set:function(w,g,k){return this._set(w,g,k)},setAll:function(w,g){return this._setAll(w,g)},_set:function(w,g,k,A){var I=this.options[w];if(!I)throw new Error("Invalid option: "+w);if(!I.modifiable&&!A)throw new Error("Option cannot be modified: "+w);return K._set(I,g,k)},_setAll:function(w,g,k){if(!w)return!1;var A,I=!1;for(A in w)U.hasOwn(w,A)&&this._set(A,w[A],g,k)&&(I=!0);return I}},{_createAccessor:function(w,g,k){var A={get:function(){return K._get(w,g)}};w.modifiable&&(A.set=function(I){K._set(w,I,g)&&k(I,w)}),Object.defineProperty(g,w.name,A)},_get:function(w,g){return g["_"+w.name]},_set:function(w,g,k){var A="_"+w.name,I=k[A],Q=w.transform(g!=null?g:w.defaultValue);return k[A]=Q,Q!==I}}),H=K,Y=p.extend(function(){this._services={}},{getService:function(w){var g=this._services[w];if(!g)throw new Error("Service is not being managed with name: "+w);return g},setService:function(w,g){if(this._services[w])throw new Error("Service is already managed with name: "+w);g&&(this._services[w]=g)}}),Z=Y,re=new H([new V("background",!0,"white"),new V("backgroundAlpha",!0,1,U.abs),new V("element"),new V("foreground",!0,"black"),new V("foregroundAlpha",!0,1,U.abs),new V("level",!0,"L",U.toUpperCase),new V("mime",!0,"image/png"),new V("padding",!0,null,U.abs),new V("size",!0,100,U.abs),new V("value",!0,"")]),ue=new Z,ke=p.extend(function(w){re.init(w,this,this.update.bind(this));var g=re.get("element",this),k=ue.getService("element"),A=g&&k.isCanvas(g)?g:k.createCanvas(),I=g&&k.isImage(g)?g:k.createImage();this._canvasRenderer=new M(this,A,!0),this._imageRenderer=new z(this,I,I===g),this.update()},{get:function(){return re.getAll(this)},set:function(w){re.setAll(w,this)&&this.update()},toDataURL:function(w){return this.canvas.toDataURL(w||this.mime)},update:function(){var w=new x({level:this.level,value:this.value});this._canvasRenderer.render(w),this._imageRenderer.render(w)}},{use:function(w){ue.setService(w.getName(),w)}});Object.defineProperties(ke.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var me=ke,Se=me,je=p.extend({getName:function(){}}),Re=je,He=Re.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(w){},isImage:function(w){}}),we=He,Te=we.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(w){return w instanceof HTMLCanvasElement},isImage:function(w){return w instanceof HTMLImageElement}}),Le=Te;Se.use(new Le);var $e=Se;return $e})})(Xc);const ep=Xc.exports;function tp(t){let e,l;return{c(){e=m("img"),Js(e.src,l=t[2])||r(e,"src",l),r(e,"alt",t[0]),r(e,"class",t[1])},m(n,i){$(n,e,i)},p(n,[i]){i&4&&!Js(e.src,l=n[2])&&r(e,"src",l),i&1&&r(e,"alt",n[0]),i&2&&r(e,"class",n[1])},i:fe,o:fe,d(n){n&&C(e)}}}function lp(t,e,l){const n=new ep;let{errorCorrection:i="L"}=e,{background:o="#fff"}=e,{color:u="#000"}=e,{size:a="200"}=e,{value:c=""}=e,{padding:f=0}=e,{className:_="qrcode"}=e,p="";function b(){n.set({background:o,foreground:u,level:i,padding:f,size:a,value:c}),l(2,p=n.toDataURL("image/jpeg"))}return ic(()=>{b()}),t.$$set=v=>{"errorCorrection"in v&&l(3,i=v.errorCorrection),"background"in v&&l(4,o=v.background),"color"in v&&l(5,u=v.color),"size"in v&&l(6,a=v.size),"value"in v&&l(0,c=v.value),"padding"in v&&l(7,f=v.padding),"className"in v&&l(1,_=v.className)},t.$$.update=()=>{t.$$.dirty&1&&c&&b()},[c,_,p,i,o,u,a,f]}class np extends Ee{constructor(e){super(),Pe(this,e,lp,tp,Ne,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function of(t,e,l){const n=t.slice();return n[95]=e[l],n[96]=e,n[97]=l,n}function rf(t,e,l){const n=t.slice();return n[98]=e[l],n[99]=e,n[100]=l,n}function ip(t,e,l){const n=t.slice();return n[101]=e[l],n}function sp(t,e,l){const n=t.slice();return n[104]=e[l],n}function op(t){let e,l;return{c(){e=m("option"),l=S(t[104]),e.__value=t[104],e.value=e.__value},m(n,i){$(n,e,i),s(e,l)},p:fe,d(n){n&&C(e)}}}function af(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","pt"),r(l,"type","text"),r(l,"class","in-s"),r(l,"placeholder","ENTSO-E API key, optional, read docs")},m(o,u){$(o,e,u),$(o,l,u),te(l,t[3].p.t),n||(i=ee(l,"input",t[22]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].p.t&&te(l,o[3].p.t)},d(o){o&&C(e),o&&C(l),n=!1,i()}}}function uf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v;return{c(){e=m("div"),l=S("Username"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=S("Password"),f=m("br"),_=h(),p=m("input"),r(o,"name","gu"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(p,"name","gp"),r(p,"type","password"),r(p,"class","in-s"),r(a,"class","my-1")},m(d,M){$(d,e,M),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].g.u),$(d,u,M),$(d,a,M),s(a,c),s(a,f),s(a,_),s(a,p),te(p,t[3].g.p),b||(v=[ee(o,"input",t[24]),ee(p,"input",t[25])],b=!0)},p(d,M){M[0]&8&&o.value!==d[3].g.u&&te(o,d[3].g.u),M[0]&8&&p.value!==d[3].g.p&&te(p,d[3].g.p)},d(d){d&&C(e),d&&C(u),d&&C(a),b=!1,ze(v)}}}function rp(t){let e,l=t[101]*100+"",n;return{c(){e=m("option"),n=S(l),e.__value=t[101]*100,e.value=e.__value},m(i,o){$(i,e,o),s(e,n)},p:fe,d(i){i&&C(e)}}}function ff(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","mek"),r(l,"type","text"),r(l,"class","in-s")},m(o,u){$(o,e,u),$(o,l,u),te(l,t[3].m.e.k),n||(i=ee(l,"input",t[34]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].m.e.k&&te(l,o[3].m.e.k)},d(o){o&&C(e),o&&C(l),n=!1,i()}}}function cf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=S("Authentication key"),n=m("br"),i=h(),o=m("input"),r(o,"name","mea"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1")},m(c,f){$(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].m.e.a),u||(a=ee(o,"input",t[35]),u=!0)},p(c,f){f[0]&8&&o.value!==c[3].m.e.a&&te(o,c[3].m.e.a)},d(c){c&&C(e),u=!1,a()}}}function mf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,M,y,T,N,E,B,P,L,O,F,x,j;return{c(){e=m("div"),l=m("div"),n=S("Watt"),i=m("br"),o=h(),u=m("input"),a=h(),c=m("div"),f=S("Volt"),_=m("br"),p=h(),b=m("input"),v=h(),d=m("div"),M=S("Amp"),y=m("br"),T=h(),N=m("input"),E=h(),B=m("div"),P=S("kWh"),L=m("br"),O=h(),F=m("input"),r(u,"name","mmw"),r(u,"type","number"),r(u,"min","0.00"),r(u,"max","1000"),r(u,"step","0.001"),r(u,"class","in-f tr w-full"),r(l,"class","w-1/4"),r(b,"name","mmv"),r(b,"type","number"),r(b,"min","0.00"),r(b,"max","1000"),r(b,"step","0.001"),r(b,"class","in-m tr w-full"),r(c,"class","w-1/4"),r(N,"name","mma"),r(N,"type","number"),r(N,"min","0.00"),r(N,"max","1000"),r(N,"step","0.001"),r(N,"class","in-m tr w-full"),r(d,"class","w-1/4"),r(F,"name","mmc"),r(F,"type","number"),r(F,"min","0.00"),r(F,"max","1000"),r(F,"step","0.001"),r(F,"class","in-l tr w-full"),r(B,"class","w-1/4"),r(e,"class","flex my-1")},m(z,G){$(z,e,G),s(e,l),s(l,n),s(l,i),s(l,o),s(l,u),te(u,t[3].m.m.w),s(e,a),s(e,c),s(c,f),s(c,_),s(c,p),s(c,b),te(b,t[3].m.m.v),s(e,v),s(e,d),s(d,M),s(d,y),s(d,T),s(d,N),te(N,t[3].m.m.a),s(e,E),s(e,B),s(B,P),s(B,L),s(B,O),s(B,F),te(F,t[3].m.m.c),x||(j=[ee(u,"input",t[37]),ee(b,"input",t[38]),ee(N,"input",t[39]),ee(F,"input",t[40])],x=!0)},p(z,G){G[0]&8&&he(u.value)!==z[3].m.m.w&&te(u,z[3].m.m.w),G[0]&8&&he(b.value)!==z[3].m.m.v&&te(b,z[3].m.m.v),G[0]&8&&he(N.value)!==z[3].m.m.a&&te(N,z[3].m.m.a),G[0]&8&&he(F.value)!==z[3].m.m.c&&te(F,z[3].m.m.c)},d(z){z&&C(e),x=!1,ze(j)}}}function pf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,M,y;return{c(){e=m("div"),l=S("Gateway"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=S("DNS"),f=m("br"),_=h(),p=m("div"),b=m("input"),v=h(),d=m("input"),r(o,"name","ng"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(b,"name","nd1"),r(b,"type","text"),r(b,"class","in-f w-full"),r(d,"name","nd2"),r(d,"type","text"),r(d,"class","in-l w-full"),r(p,"class","flex"),r(a,"class","my-1")},m(T,N){$(T,e,N),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].n.g),$(T,u,N),$(T,a,N),s(a,c),s(a,f),s(a,_),s(a,p),s(p,b),te(b,t[3].n.d1),s(p,v),s(p,d),te(d,t[3].n.d2),M||(y=[ee(o,"input",t[49]),ee(b,"input",t[50]),ee(d,"input",t[51])],M=!0)},p(T,N){N[0]&8&&o.value!==T[3].n.g&&te(o,T[3].n.g),N[0]&8&&b.value!==T[3].n.d1&&te(b,T[3].n.d1),N[0]&8&&d.value!==T[3].n.d2&&te(d,T[3].n.d2)},d(T){T&&C(e),T&&C(u),T&&C(a),M=!1,ze(y)}}}function _f(t){let e,l,n,i,o;return{c(){e=m("label"),l=m("input"),n=S(" SSL"),r(l,"type","checkbox"),r(l,"name","qs"),l.__value="true",l.value=l.__value,r(l,"class","rounded mb-1"),r(e,"class","float-right mr-3")},m(u,a){$(u,e,a),s(e,l),l.checked=t[3].q.s.e,s(e,n),i||(o=[ee(l,"change",t[55]),ee(l,"change",t[14])],i=!0)},p(u,a){a[0]&8&&(l.checked=u[3].q.s.e)},d(u){u&&C(e),i=!1,ze(o)}}}function df(t){let e,l,n,i,o,u,a,c,f,_,p,b,v;const d=[up,ap],M=[];function y(O,F){return O[3].q.s.c?0:1}n=y(t),i=M[n]=d[n](t);const T=[pp,mp],N=[];function E(O,F){return O[3].q.s.r?0:1}a=E(t),c=N[a]=T[a](t);const B=[hp,vp],P=[];function L(O,F){return O[3].q.s.k?0:1}return p=L(t),b=P[p]=B[p](t),{c(){e=m("div"),l=m("span"),i.c(),o=h(),u=m("span"),c.c(),f=h(),_=m("span"),b.c(),r(l,"class","flex pr-2"),r(u,"class","flex pr-2"),r(_,"class","flex pr-2"),r(e,"class","my-1 flex")},m(O,F){$(O,e,F),s(e,l),M[n].m(l,null),s(e,o),s(e,u),N[a].m(u,null),s(e,f),s(e,_),P[p].m(_,null),v=!0},p(O,F){let x=n;n=y(O),n===x?M[n].p(O,F):(De(),q(M[x],1,1,()=>{M[x]=null}),Ie(),i=M[n],i?i.p(O,F):(i=M[n]=d[n](O),i.c()),D(i,1),i.m(l,null));let j=a;a=E(O),a===j?N[a].p(O,F):(De(),q(N[j],1,1,()=>{N[j]=null}),Ie(),c=N[a],c?c.p(O,F):(c=N[a]=T[a](O),c.c()),D(c,1),c.m(u,null));let z=p;p=L(O),p===z?P[p].p(O,F):(De(),q(P[z],1,1,()=>{P[z]=null}),Ie(),b=P[p],b?b.p(O,F):(b=P[p]=B[p](O),b.c()),D(b,1),b.m(_,null))},i(O){v||(D(i),D(c),D(b),v=!0)},o(O){q(i),q(c),q(b),v=!1},d(O){O&&C(e),M[n].d(),N[a].d(),P[p].d()}}}function ap(t){let e,l;return e=new el({props:{to:"/mqtt-ca",$$slots:{default:[fp]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i[3]&16384&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function up(t){let e,l,n,i,o,u,a,c;return l=new el({props:{to:"/mqtt-ca",$$slots:{default:[cp]},$$scope:{ctx:t}}}),o=new To({}),{c(){e=m("span"),ie(l.$$.fragment),n=h(),i=m("span"),ie(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){$(f,e,_),le(l,e,null),$(f,n,_),$(f,i,_),le(o,i,null),u=!0,a||(c=[ee(i,"click",t[11]),ee(i,"keypress",t[11])],a=!0)},p(f,_){const p={};_[3]&16384&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(D(l.$$.fragment,f),D(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&C(e),ne(l),f&&C(n),f&&C(i),ne(o),a=!1,ze(c)}}}function fp(t){let e,l;return e=new fn({props:{color:"blue",text:"Upload CA",title:"Click here to upload CA"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function cp(t){let e;return{c(){e=S("CA OK")},m(l,n){$(l,e,n)},d(l){l&&C(e)}}}function mp(t){let e,l;return e=new el({props:{to:"/mqtt-cert",$$slots:{default:[_p]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i[3]&16384&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function pp(t){let e,l,n,i,o,u,a,c;return l=new el({props:{to:"/mqtt-cert",$$slots:{default:[dp]},$$scope:{ctx:t}}}),o=new To({}),{c(){e=m("span"),ie(l.$$.fragment),n=h(),i=m("span"),ie(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){$(f,e,_),le(l,e,null),$(f,n,_),$(f,i,_),le(o,i,null),u=!0,a||(c=[ee(i,"click",t[12]),ee(i,"keypress",t[12])],a=!0)},p(f,_){const p={};_[3]&16384&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(D(l.$$.fragment,f),D(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&C(e),ne(l),f&&C(n),f&&C(i),ne(o),a=!1,ze(c)}}}function _p(t){let e,l;return e=new fn({props:{color:"blue",text:"Upload cert",title:"Click here to upload certificate"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function dp(t){let e;return{c(){e=S("Cert OK")},m(l,n){$(l,e,n)},d(l){l&&C(e)}}}function vp(t){let e,l;return e=new el({props:{to:"/mqtt-key",$$slots:{default:[bp]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i[3]&16384&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function hp(t){let e,l,n,i,o,u,a,c;return l=new el({props:{to:"/mqtt-key",$$slots:{default:[gp]},$$scope:{ctx:t}}}),o=new To({}),{c(){e=m("span"),ie(l.$$.fragment),n=h(),i=m("span"),ie(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){$(f,e,_),le(l,e,null),$(f,n,_),$(f,i,_),le(o,i,null),u=!0,a||(c=[ee(i,"click",t[13]),ee(i,"keypress",t[13])],a=!0)},p(f,_){const p={};_[3]&16384&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(D(l.$$.fragment,f),D(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&C(e),ne(l),f&&C(n),f&&C(i),ne(o),a=!1,ze(c)}}}function bp(t){let e,l;return e=new fn({props:{color:"blue",text:"Upload key",title:"Click here to upload key"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function gp(t){let e;return{c(){e=S("Key OK")},m(l,n){$(l,e,n)},d(l){l&&C(e)}}}function vf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,M,y,T,N,E,B,P,L,O,F,x,j,z,G,V,W,U,K;return o=new Bt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Domoticz",n=h(),i=m("a"),ie(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),_=m("div"),p=S("Electricity IDX"),b=m("br"),v=h(),d=m("input"),M=h(),y=m("div"),T=S("Current IDX"),N=m("br"),E=h(),B=m("input"),P=h(),L=m("div"),O=S(`Voltage IDX: L1, L2 & L3 `),F=m("div"),x=m("input"),j=h(),z=m("input"),G=h(),V=m("input"),r(l,"class","text-sm"),r(i,"href",Ut("MQTT-configuration#domoticz")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","o"),a.value="true",r(d,"name","oe"),r(d,"type","text"),r(d,"class","in-f tr w-full"),r(_,"class","w-1/2"),r(B,"name","oc"),r(B,"type","text"),r(B,"class","in-l tr w-full"),r(y,"class","w-1/2"),r(f,"class","my-1 flex"),r(x,"name","ou1"),r(x,"type","text"),r(x,"class","in-f tr w-1/3"),r(z,"name","ou2"),r(z,"type","text"),r(z,"class","in-m tr w-1/3"),r(V,"name","ou3"),r(V,"type","text"),r(V,"class","in-l tr w-1/3"),r(F,"class","flex"),r(L,"class","my-1"),r(e,"class","cnt")},m(H,Y){$(H,e,Y),s(e,l),s(e,n),s(e,i),le(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,_),s(_,p),s(_,b),s(_,v),s(_,d),te(d,t[3].o.e),s(f,M),s(f,y),s(y,T),s(y,N),s(y,E),s(y,B),te(B,t[3].o.c),s(e,P),s(e,L),s(L,O),s(L,F),s(F,x),te(x,t[3].o.u1),s(F,j),s(F,z),te(z,t[3].o.u2),s(F,G),s(F,V),te(V,t[3].o.u3),W=!0,U||(K=[ee(d,"input",t[63]),ee(B,"input",t[64]),ee(x,"input",t[65]),ee(z,"input",t[66]),ee(V,"input",t[67])],U=!0)},p(H,Y){Y[0]&8&&d.value!==H[3].o.e&&te(d,H[3].o.e),Y[0]&8&&B.value!==H[3].o.c&&te(B,H[3].o.c),Y[0]&8&&x.value!==H[3].o.u1&&te(x,H[3].o.u1),Y[0]&8&&z.value!==H[3].o.u2&&te(z,H[3].o.u2),Y[0]&8&&V.value!==H[3].o.u3&&te(V,H[3].o.u3)},i(H){W||(D(o.$$.fragment,H),W=!0)},o(H){q(o.$$.fragment,H),W=!1},d(H){H&&C(e),ne(o),U=!1,ze(K)}}}function hf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,M,y,T,N,E,B,P,L,O,F,x,j,z,G,V;return o=new Bt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Home-Assistant",n=h(),i=m("a"),ie(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),_=S("Discovery topic prefix"),p=m("br"),b=h(),v=m("input"),d=h(),M=m("div"),y=S("Hostname for URL"),T=m("br"),N=h(),E=m("input"),P=h(),L=m("div"),O=S("Name tag"),F=m("br"),x=h(),j=m("input"),r(l,"class","text-sm"),r(i,"href",Ut("MQTT-configuration#home-assistant")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","h"),a.value="true",r(v,"name","ht"),r(v,"type","text"),r(v,"class","in-s"),r(v,"placeholder","homeassistant"),r(f,"class","my-1"),r(E,"name","hh"),r(E,"type","text"),r(E,"class","in-s"),r(E,"placeholder",B=t[3].g.h+".local"),r(M,"class","my-1"),r(j,"name","hn"),r(j,"type","text"),r(j,"class","in-s"),r(L,"class","my-1"),r(e,"class","cnt")},m(W,U){$(W,e,U),s(e,l),s(e,n),s(e,i),le(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,_),s(f,p),s(f,b),s(f,v),te(v,t[3].h.t),s(e,d),s(e,M),s(M,y),s(M,T),s(M,N),s(M,E),te(E,t[3].h.h),s(e,P),s(e,L),s(L,O),s(L,F),s(L,x),s(L,j),te(j,t[3].h.n),z=!0,G||(V=[ee(v,"input",t[68]),ee(E,"input",t[69]),ee(j,"input",t[70])],G=!0)},p(W,U){U[0]&8&&v.value!==W[3].h.t&&te(v,W[3].h.t),(!z||U[0]&8&&B!==(B=W[3].g.h+".local"))&&r(E,"placeholder",B),U[0]&8&&E.value!==W[3].h.h&&te(E,W[3].h.h),U[0]&8&&j.value!==W[3].h.n&&te(j,W[3].h.n)},i(W){z||(D(o.$$.fragment,W),z=!0)},o(W){q(o.$$.fragment,W),z=!1},d(W){W&&C(e),ne(o),G=!1,ze(V)}}}function bf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d=t[3].c.es&&gf(t);return{c(){e=m("div"),l=m("input"),n=h(),i=m("strong"),i.textContent="Cloud connections",o=h(),u=m("div"),a=m("label"),c=m("input"),f=S(" Energy Speedometer"),_=h(),d&&d.c(),r(l,"type","hidden"),r(l,"name","c"),l.value="true",r(i,"class","text-sm"),r(c,"type","checkbox"),r(c,"class","rounded mb-1"),r(c,"name","ces"),c.__value="true",c.value=c.__value,r(u,"class","my-1"),r(e,"class","cnt")},m(M,y){$(M,e,y),s(e,l),s(e,n),s(e,i),s(e,o),s(e,u),s(u,a),s(a,c),c.checked=t[3].c.es,s(a,f),s(u,_),d&&d.m(u,null),p=!0,b||(v=ee(c,"change",t[71]),b=!0)},p(M,y){y[0]&8&&(c.checked=M[3].c.es),M[3].c.es?d?(d.p(M,y),y[0]&8&&D(d,1)):(d=gf(M),d.c(),D(d,1),d.m(u,null)):d&&(De(),q(d,1,1,()=>{d=null}),Ie())},i(M){p||(D(d),p=!0)},o(M){q(d),p=!1},d(M){M&&C(e),d&&d.d(),b=!1,v()}}}function gf(t){let e,l,n=t[0].mac+"",i,o,u,a,c=(t[0].meter.id?t[0].meter.id:"missing, required")+"",f,_,p,b,v=t[0].mac&&t[0].meter.id&&kf(t);return{c(){e=m("div"),l=S("MAC: "),i=S(n),o=h(),u=m("div"),a=S("Meter ID: "),f=S(c),_=h(),v&&v.c(),p=Ve(),r(e,"class","pl-5"),r(u,"class","pl-5")},m(d,M){$(d,e,M),s(e,l),s(e,i),$(d,o,M),$(d,u,M),s(u,a),s(u,f),$(d,_,M),v&&v.m(d,M),$(d,p,M),b=!0},p(d,M){(!b||M[0]&1)&&n!==(n=d[0].mac+"")&&X(i,n),(!b||M[0]&1)&&c!==(c=(d[0].meter.id?d[0].meter.id:"missing, required")+"")&&X(f,c),d[0].mac&&d[0].meter.id?v?(v.p(d,M),M[0]&1&&D(v,1)):(v=kf(d),v.c(),D(v,1),v.m(p.parentNode,p)):v&&(De(),q(v,1,1,()=>{v=null}),Ie())},i(d){b||(D(v),b=!0)},o(d){q(v),b=!1},d(d){d&&C(e),d&&C(o),d&&C(u),d&&C(_),v&&v.d(d),d&&C(p)}}}function kf(t){let e,l,n;return l=new np({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","pl-2")},m(i,o){$(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o[0]&1&&(u.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function wf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,M,y,T,N,E;o=new Bt({});let B={length:9},P=[];for(let L=0;L20&&Mf(t),_=t[0].chip=="esp8266"&&Nf(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Hardware",n=h(),i=m("a"),ie(o.$$.fragment),u=h(),f&&f.c(),a=h(),_&&_.c(),r(l,"class","text-sm"),r(i,"href",Ut("GPIO-configuration")),r(i,"target","_blank"),r(i,"class","float-right"),r(e,"class","cnt")},m(p,b){$(p,e,b),s(e,l),s(e,n),s(e,i),le(o,i,null),s(e,u),f&&f.m(e,null),s(e,a),_&&_.m(e,null),c=!0},p(p,b){p[0].board>20?f?(f.p(p,b),b[0]&1&&D(f,1)):(f=Mf(p),f.c(),D(f,1),f.m(e,a)):f&&(De(),q(f,1,1,()=>{f=null}),Ie()),p[0].chip=="esp8266"?_?_.p(p,b):(_=Nf(p),_.c(),_.m(e,null)):_&&(_.d(1),_=null)},i(p){c||(D(o.$$.fragment,p),D(f),c=!0)},o(p){q(o.$$.fragment,p),q(f),c=!1},d(p){p&&C(e),ne(o),f&&f.d(),_&&_.d()}}}function Mf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,M,y,T,N,E,B,P,L,O,F,x,j,z,G,V,W,U,K,H,Y,Z,re,ue,ke,me,Se,je,Re,He,we,Te,Le,$e,w,g,k,A,I,Q,J,se,ce,ve,Me,oe;b=new Yc({props:{chip:t[0].chip}});let pe=t[0].chip!="esp8266"&&Sf(t),Be=t[3].i.v.p>0&&Tf(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=S("HAN"),u=m("label"),a=m("input"),c=S(" pullup"),f=m("br"),_=h(),p=m("select"),ie(b.$$.fragment),v=h(),d=m("div"),M=S("AP button"),y=m("br"),T=h(),N=m("input"),E=h(),B=m("div"),P=S("LED"),L=m("label"),O=m("input"),F=S(" inv"),x=m("br"),j=h(),z=m("div"),G=m("input"),V=h(),W=m("div"),U=S("RGB"),K=m("label"),H=m("input"),Y=S(" inverted"),Z=m("br"),re=h(),ue=m("div"),ke=m("input"),me=h(),Se=m("input"),je=h(),Re=m("input"),He=h(),we=m("div"),Te=S("Temperature"),Le=m("br"),$e=h(),w=m("input"),g=h(),k=m("div"),A=S("Analog temp"),I=m("br"),Q=h(),J=m("input"),se=h(),pe&&pe.c(),ce=h(),Be&&Be.c(),r(e,"type","hidden"),r(e,"name","i"),e.value="true",r(a,"name","ihu"),a.__value="true",a.value=a.__value,r(a,"type","checkbox"),r(a,"class","rounded mb-1"),r(u,"class","ml-2"),r(p,"name","ihp"),r(p,"class","in-f w-full"),t[3].i.h.p===void 0&&tt(()=>t[76].call(p)),r(i,"class","w-1/3"),r(N,"name","ia"),r(N,"type","number"),r(N,"min","0"),r(N,"max",t[6]),r(N,"class","in-m tr w-full"),r(d,"class","w-1/3"),r(O,"name","ili"),O.__value="true",O.value=O.__value,r(O,"type","checkbox"),r(O,"class","rounded mb-1"),r(L,"class","ml-4"),r(G,"name","ilp"),r(G,"type","number"),r(G,"min","0"),r(G,"max",t[6]),r(G,"class","in-l tr w-full"),r(z,"class","flex"),r(B,"class","w-1/3"),r(H,"name","iri"),H.__value="true",H.value=H.__value,r(H,"type","checkbox"),r(H,"class","rounded mb-1"),r(K,"class","ml-4"),r(ke,"name","irr"),r(ke,"type","number"),r(ke,"min","0"),r(ke,"max",t[6]),r(ke,"class","in-f tr w-1/3"),r(Se,"name","irg"),r(Se,"type","number"),r(Se,"min","0"),r(Se,"max",t[6]),r(Se,"class","in-m tr w-1/3"),r(Re,"name","irb"),r(Re,"type","number"),r(Re,"min","0"),r(Re,"max",t[6]),r(Re,"class","in-l tr w-1/3"),r(ue,"class","flex"),r(W,"class","w-full"),r(w,"name","itd"),r(w,"type","number"),r(w,"min","0"),r(w,"max",t[6]),r(w,"class","in-f tr w-full"),r(we,"class","my-1 w-1/3"),r(J,"name","ita"),r(J,"type","number"),r(J,"min","0"),r(J,"max",t[6]),r(J,"class","in-l tr w-full"),r(k,"class","my-1 pr-1 w-1/3"),r(n,"class","flex flex-wrap")},m(_e,ye){$(_e,e,ye),$(_e,l,ye),$(_e,n,ye),s(n,i),s(i,o),s(i,u),s(u,a),a.checked=t[3].i.h.u,s(u,c),s(i,f),s(i,_),s(i,p),le(b,p,null),qe(p,t[3].i.h.p,!0),s(n,v),s(n,d),s(d,M),s(d,y),s(d,T),s(d,N),te(N,t[3].i.a),s(n,E),s(n,B),s(B,P),s(B,L),s(L,O),O.checked=t[3].i.l.i,s(L,F),s(B,x),s(B,j),s(B,z),s(z,G),te(G,t[3].i.l.p),s(n,V),s(n,W),s(W,U),s(W,K),s(K,H),H.checked=t[3].i.r.i,s(K,Y),s(W,Z),s(W,re),s(W,ue),s(ue,ke),te(ke,t[3].i.r.r),s(ue,me),s(ue,Se),te(Se,t[3].i.r.g),s(ue,je),s(ue,Re),te(Re,t[3].i.r.b),s(n,He),s(n,we),s(we,Te),s(we,Le),s(we,$e),s(we,w),te(w,t[3].i.t.d),s(n,g),s(n,k),s(k,A),s(k,I),s(k,Q),s(k,J),te(J,t[3].i.t.a),s(n,se),pe&&pe.m(n,null),s(n,ce),Be&&Be.m(n,null),ve=!0,Me||(oe=[ee(a,"change",t[75]),ee(p,"change",t[76]),ee(N,"input",t[77]),ee(O,"change",t[78]),ee(G,"input",t[79]),ee(H,"change",t[80]),ee(ke,"input",t[81]),ee(Se,"input",t[82]),ee(Re,"input",t[83]),ee(w,"input",t[84]),ee(J,"input",t[85])],Me=!0)},p(_e,ye){ye[0]&8&&(a.checked=_e[3].i.h.u);const vt={};ye[0]&1&&(vt.chip=_e[0].chip),b.$set(vt),ye[0]&8&&qe(p,_e[3].i.h.p),(!ve||ye[0]&64)&&r(N,"max",_e[6]),ye[0]&8&&he(N.value)!==_e[3].i.a&&te(N,_e[3].i.a),ye[0]&8&&(O.checked=_e[3].i.l.i),(!ve||ye[0]&64)&&r(G,"max",_e[6]),ye[0]&8&&he(G.value)!==_e[3].i.l.p&&te(G,_e[3].i.l.p),ye[0]&8&&(H.checked=_e[3].i.r.i),(!ve||ye[0]&64)&&r(ke,"max",_e[6]),ye[0]&8&&he(ke.value)!==_e[3].i.r.r&&te(ke,_e[3].i.r.r),(!ve||ye[0]&64)&&r(Se,"max",_e[6]),ye[0]&8&&he(Se.value)!==_e[3].i.r.g&&te(Se,_e[3].i.r.g),(!ve||ye[0]&64)&&r(Re,"max",_e[6]),ye[0]&8&&he(Re.value)!==_e[3].i.r.b&&te(Re,_e[3].i.r.b),(!ve||ye[0]&64)&&r(w,"max",_e[6]),ye[0]&8&&he(w.value)!==_e[3].i.t.d&&te(w,_e[3].i.t.d),(!ve||ye[0]&64)&&r(J,"max",_e[6]),ye[0]&8&&he(J.value)!==_e[3].i.t.a&&te(J,_e[3].i.t.a),_e[0].chip!="esp8266"?pe?pe.p(_e,ye):(pe=Sf(_e),pe.c(),pe.m(n,ce)):pe&&(pe.d(1),pe=null),_e[3].i.v.p>0?Be?Be.p(_e,ye):(Be=Tf(_e),Be.c(),Be.m(n,null)):Be&&(Be.d(1),Be=null)},i(_e){ve||(D(b.$$.fragment,_e),ve=!0)},o(_e){q(b.$$.fragment,_e),ve=!1},d(_e){_e&&C(e),_e&&C(l),_e&&C(n),ne(b),pe&&pe.d(),Be&&Be.d(),Me=!1,ze(oe)}}}function Sf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=S("Vcc"),n=m("br"),i=h(),o=m("input"),r(o,"name","ivp"),r(o,"type","number"),r(o,"min","0"),r(o,"max",t[6]),r(o,"class","in-s tr w-full"),r(e,"class","my-1 pl-1 w-1/3")},m(c,f){$(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].i.v.p),u||(a=ee(o,"input",t[86]),u=!0)},p(c,f){f[0]&64&&r(o,"max",c[6]),f[0]&8&&he(o.value)!==c[3].i.v.p&&te(o,c[3].i.v.p)},d(c){c&&C(e),u=!1,a()}}}function Tf(t){let e,l,n,i,o,u,a,c,f,_;return{c(){e=m("div"),l=S("Voltage divider"),n=m("br"),i=h(),o=m("div"),u=m("input"),a=h(),c=m("input"),r(u,"name","ivdv"),r(u,"type","number"),r(u,"min","0"),r(u,"max","65535"),r(u,"class","in-f tr w-full"),r(u,"placeholder","VCC"),r(c,"name","ivdg"),r(c,"type","number"),r(c,"min","0"),r(c,"max","65535"),r(c,"class","in-l tr w-full"),r(c,"placeholder","GND"),r(o,"class","flex"),r(e,"class","my-1")},m(p,b){$(p,e,b),s(e,l),s(e,n),s(e,i),s(e,o),s(o,u),te(u,t[3].i.v.d.v),s(o,a),s(o,c),te(c,t[3].i.v.d.g),f||(_=[ee(u,"input",t[87]),ee(c,"input",t[88])],f=!0)},p(p,b){b[0]&8&&he(u.value)!==p[3].i.v.d.v&&te(u,p[3].i.v.d.v),b[0]&8&&he(c.value)!==p[3].i.v.d.g&&te(c,p[3].i.v.d.g)},d(p){p&&C(e),f=!1,ze(_)}}}function Nf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,M,y,T,N=(t[0].board==2||t[0].board==100)&&Af(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=S("Vcc offset"),u=m("br"),a=h(),c=m("input"),f=h(),_=m("div"),p=S("Multiplier"),b=m("br"),v=h(),d=m("input"),M=h(),N&&N.c(),r(e,"type","hidden"),r(e,"name","iv"),e.value="true",r(c,"name","ivo"),r(c,"type","number"),r(c,"min","0.0"),r(c,"max","3.5"),r(c,"step","0.01"),r(c,"class","in-f tr w-full"),r(i,"class","w-1/3"),r(d,"name","ivm"),r(d,"type","number"),r(d,"min","0.1"),r(d,"max","10"),r(d,"step","0.01"),r(d,"class","in-l tr w-full"),r(_,"class","w-1/3 pr-1"),r(n,"class","my-1 flex flex-wrap")},m(E,B){$(E,e,B),$(E,l,B),$(E,n,B),s(n,i),s(i,o),s(i,u),s(i,a),s(i,c),te(c,t[3].i.v.o),s(n,f),s(n,_),s(_,p),s(_,b),s(_,v),s(_,d),te(d,t[3].i.v.m),s(n,M),N&&N.m(n,null),y||(T=[ee(c,"input",t[89]),ee(d,"input",t[90])],y=!0)},p(E,B){B[0]&8&&he(c.value)!==E[3].i.v.o&&te(c,E[3].i.v.o),B[0]&8&&he(d.value)!==E[3].i.v.m&&te(d,E[3].i.v.m),E[0].board==2||E[0].board==100?N?N.p(E,B):(N=Af(E),N.c(),N.m(n,null)):N&&(N.d(1),N=null)},d(E){E&&C(e),E&&C(l),E&&C(n),N&&N.d(),y=!1,ze(T)}}}function Af(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=S("Boot limit"),n=m("br"),i=h(),o=m("input"),r(o,"name","ivb"),r(o,"type","number"),r(o,"min","2.5"),r(o,"max","3.5"),r(o,"step","0.1"),r(o,"class","in-s tr w-full"),r(e,"class","w-1/3 pl-1")},m(c,f){$(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].i.v.b),u||(a=ee(o,"input",t[91]),u=!0)},p(c,f){f[0]&8&&he(o.value)!==c[3].i.v.b&&te(o,c[3].i.v.b)},d(c){c&&C(e),u=!1,a()}}}function Pf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,M,y,T=t[3].d.t&&Ef();return{c(){e=m("div"),e.textContent="Debug can cause sudden reboots. Do not leave on!",l=h(),n=m("div"),i=m("label"),o=m("input"),u=S(" Enable telnet"),a=h(),T&&T.c(),c=h(),f=m("div"),_=m("select"),p=m("option"),p.textContent="Verbose",b=m("option"),b.textContent="Debug",v=m("option"),v.textContent="Info",d=m("option"),d.textContent="Warning",r(e,"class","bd-red"),r(o,"type","checkbox"),r(o,"name","dt"),o.__value="true",o.value=o.__value,r(o,"class","rounded mb-1"),r(n,"class","my-1"),p.__value=1,p.value=p.__value,b.__value=2,b.value=b.__value,v.__value=3,v.value=v.__value,d.__value=4,d.value=d.__value,r(_,"name","dl"),r(_,"class","in-s"),t[3].d.l===void 0&&tt(()=>t[94].call(_)),r(f,"class","my-1")},m(N,E){$(N,e,E),$(N,l,E),$(N,n,E),s(n,i),s(i,o),o.checked=t[3].d.t,s(i,u),$(N,a,E),T&&T.m(N,E),$(N,c,E),$(N,f,E),s(f,_),s(_,p),s(_,b),s(_,v),s(_,d),qe(_,t[3].d.l,!0),M||(y=[ee(o,"change",t[93]),ee(_,"change",t[94])],M=!0)},p(N,E){E[0]&8&&(o.checked=N[3].d.t),N[3].d.t?T||(T=Ef(),T.c(),T.m(c.parentNode,c)):T&&(T.d(1),T=null),E[0]&8&&qe(_,N[3].d.l)},d(N){N&&C(e),N&&C(l),N&&C(n),N&&C(a),T&&T.d(N),N&&C(c),N&&C(f),M=!1,ze(y)}}}function Ef(t){let e;return{c(){e=m("div"),e.textContent="Telnet is unsafe and should be off when not in use",r(e,"class","bd-red")},m(l,n){$(l,e,n)},d(l){l&&C(e)}}}function kp(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,M,y,T,N,E,B,P,L,O,F,x,j,z,G,V,W,U,K,H,Y,Z,re,ue,ke,me,Se,je,Re,He,we,Te,Le,$e,w,g,k,A,I,Q,J,se,ce,ve,Me,oe,pe,Be,_e,ye,vt,Hl,tl,ct,Tl,pl,Ht,ht,Qe,Xe,Ze,Ue,Je,We,xe,et,de,Ce,Ei,_l,_n,Tt,Di,Ii,Ri,dl,Li,Oi,Fi,Nt,Nl,Al,Pl,qi,Ge,Ae,vl,Ts,El,Rt,Bi,Wl,Ao,ll,Ui,Po,Ns,Eo,ci,Wt,Do,Io,Dl,nl,Il,Ro,ji,Lo,pt,Rl,Oo,Hi,dn,vn,hn,bn,Wi,Fo,At,zi,qo,zl,Bo,Uo,jo,il,gn,kn,Ho,wn,Gl,Wo,zo,Go,yn,zt,Vo,Gi,Ko,Vl,Yo,Qo,Xo,Cn,Gt,Zo,Vi,Jo,As,xo,Kl,Ki,Vt,er,tr,lr,Ps,Yi,Kt,nr,ir,sr,mt,Qi,or,$n,Mn,rr,mi,ar,Yl,ur,fr,cr,hl,mr,Ql,pr,_r,dr,bl,vr,Sn,Xl,hr,br,gr,Lt,Tn,Nn,An,Pn,kr,Zl,wr,yr,Cr,En,Ot,$r,Xi,Mr,Zi,Ji,Yt,Sr,Tr,ut,xi,Nr,Dn,In,Ar,Jl,Pr,Er,Dr,Ll,sl,Rn,Ln,Ir,Pt,es,ts,Rr,Et,On,ls,ns,Lr,Es,is,ss,Qt,Or,Fr,pi,qr,Ol,Br,_i,Xt,Ur,jr,Hr,os,gl,Wr,Ye,rs,zr,Fn,qn,Gr,di,Vr,ol,Kr,Ds,Yr,Qr,Bn,kl,Xr,Zt,Zr,Is,xl,Jr,xr,ea,wl,ta,en,la,na,ia,yl,sa,Un,jn,oa,ra,aa,Cl,ua,Hn,fa,ca,ma,bt,Wn,zn,Gn,Vn,Kn,Yn,pa,tn,_a,da,va,$l,ha,Rs,Ls,Os,Fs=t[3].p.r.startsWith("10YNO")||t[3].p.r.startsWith("10Y1001A1001A4"),qs,rl,as,ba,Qn,Xn,ga,vi,ka,hi,wa,Bs,Dt,us,ya,Zn,Jn,Ca,bi,$a,fs,cs,Jt,Ma,Sa,Ta,Fl,Us,xn,Na,ms,ei,Aa,ps,js,ln,Hs,nn,Ws,sn,zs,on,Ft,Gs,Pa;a=new Bt({}),F=new Xm({});let Zc=["NOK","SEK","DKK","EUR"],gi=[];for(let R=0;R<4;R+=1)gi[R]=op(sp(t,Zc,R));let gt=t[3].p.e&&t[0].chip!="esp8266"&&af(t),kt=t[3].g.s>0&&uf(t);Rt=new Bt({});let Jc=[24,48,96,192,384,576,1152],ki=[];for(let R=0;R<7;R+=1)ki[R]=rp(ip(t,Jc,R));let wt=t[3].m.e.e&&ff(t),yt=t[3].m.e.e&&cf(t),Ct=t[3].m.m.e&&mf(t);Mn=new Bt({}),In=new Bt({}),On=new Qc({});let $t=t[3].n.m=="static"&&pf(t);qn=new Bt({});let Mt=t[0].chip!="esp8266"&&_f(t),lt=t[3].q.s.e&&df(t),nt=t[3].q.m==3&&vf(t),it=t[3].q.m==4&&hf(t),st=t[3].c.es!=null&&bf(t),ot=Fs&&wf(t);Xn=new Bt({});let ti=t[7],_t=[];for(let R=0;R20||t[0].chip=="esp8266")&&$f(t);Jn=new Bt({});let St=t[3].d.s&&Pf(t);return ln=new It({props:{active:t[1],message:"Loading configuration"}}),nn=new It({props:{active:t[2],message:"Saving configuration"}}),sn=new It({props:{active:t[4],message:"Performing factory reset"}}),on=new It({props:{active:t[5],message:"Device have been factory reset and switched to AP mode"}}),{c(){e=m("form"),l=m("div"),n=m("div"),i=m("strong"),i.textContent="General",o=h(),u=m("a"),ie(a.$$.fragment),c=h(),f=m("input"),_=h(),p=m("div"),b=m("div"),v=m("div"),d=S("Hostname"),M=m("br"),y=h(),T=m("input"),N=h(),E=m("div"),B=S("Time zone"),P=m("br"),L=h(),O=m("select"),ie(F.$$.fragment),x=h(),j=m("input"),z=h(),G=m("div"),V=m("div"),W=m("div"),U=S("Price region"),K=m("br"),H=h(),Y=m("select"),Z=m("optgroup"),re=m("option"),re.textContent="NO1",ue=m("option"),ue.textContent="NO2",ke=m("option"),ke.textContent="NO3",me=m("option"),me.textContent="NO4",Se=m("option"),Se.textContent="NO5",je=m("optgroup"),Re=m("option"),Re.textContent="SE1",He=m("option"),He.textContent="SE2",we=m("option"),we.textContent="SE3",Te=m("option"),Te.textContent="SE4",Le=m("optgroup"),$e=m("option"),$e.textContent="DK1",w=m("option"),w.textContent="DK2",g=m("option"),g.textContent="Austria",k=m("option"),k.textContent="Belgium",A=m("option"),A.textContent="Czech Republic",I=m("option"),I.textContent="Estonia",Q=m("option"),Q.textContent="Finland",J=m("option"),J.textContent="France",se=m("option"),se.textContent="Germany",ce=m("option"),ce.textContent="Great Britain",ve=m("option"),ve.textContent="Latvia",Me=m("option"),Me.textContent="Lithuania",oe=m("option"),oe.textContent="Netherland",pe=m("option"),pe.textContent="Poland",Be=m("option"),Be.textContent="Switzerland",_e=h(),ye=m("div"),vt=S("Currency"),Hl=m("br"),tl=h(),ct=m("select");for(let R=0;R<4;R+=1)gi[R].c();Tl=h(),pl=m("div"),Ht=m("div"),ht=m("div"),Qe=S("Fixed price"),Xe=m("br"),Ze=h(),Ue=m("input"),Je=h(),We=m("div"),xe=S("Multiplier"),et=m("br"),de=h(),Ce=m("input"),Ei=h(),_l=m("div"),_n=m("label"),Tt=m("input"),Di=S(" Enable price fetch from remote server"),Ii=h(),gt&>.c(),Ri=h(),dl=m("div"),Li=S("Security"),Oi=m("br"),Fi=h(),Nt=m("select"),Nl=m("option"),Nl.textContent="None",Al=m("option"),Al.textContent="Only configuration",Pl=m("option"),Pl.textContent="Everything",qi=h(),kt&&kt.c(),Ge=h(),Ae=m("div"),vl=m("strong"),vl.textContent="Meter",Ts=h(),El=m("a"),ie(Rt.$$.fragment),Bi=h(),Wl=m("input"),Ao=h(),ll=m("div"),Ui=m("span"),Ui.textContent="Buffer size",Po=h(),Ns=m("span"),Ns.textContent="Serial conf.",Eo=h(),ci=m("label"),Wt=m("input"),Do=S(" inverted"),Io=h(),Dl=m("div"),nl=m("select"),Il=m("option"),Ro=S("Autodetect");for(let R=0;R<7;R+=1)ki[R].c();Lo=h(),pt=m("select"),Rl=m("option"),Oo=S("-"),dn=m("option"),dn.textContent="7N1",vn=m("option"),vn.textContent="8N1",hn=m("option"),hn.textContent="7E1",bn=m("option"),bn.textContent="8E1",Fo=h(),At=m("input"),qo=h(),zl=m("div"),Bo=S("Voltage"),Uo=m("br"),jo=h(),il=m("select"),gn=m("option"),gn.textContent="400V (TN)",kn=m("option"),kn.textContent="230V (IT/TT)",Ho=h(),wn=m("div"),Gl=m("div"),Wo=S("Main fuse"),zo=m("br"),Go=h(),yn=m("label"),zt=m("input"),Vo=h(),Gi=m("span"),Gi.textContent="A",Ko=h(),Vl=m("div"),Yo=S("Production"),Qo=m("br"),Xo=h(),Cn=m("label"),Gt=m("input"),Zo=h(),Vi=m("span"),Vi.textContent="kWp",Jo=h(),As=m("div"),xo=h(),Kl=m("div"),Ki=m("label"),Vt=m("input"),er=S(" Meter is encrypted"),tr=h(),wt&&wt.c(),lr=h(),yt&&yt.c(),Ps=h(),Yi=m("label"),Kt=m("input"),nr=S(" Multipliers"),ir=h(),Ct&&Ct.c(),sr=h(),mt=m("div"),Qi=m("strong"),Qi.textContent="WiFi",or=h(),$n=m("a"),ie(Mn.$$.fragment),rr=h(),mi=m("input"),ar=h(),Yl=m("div"),ur=S("SSID"),fr=m("br"),cr=h(),hl=m("input"),mr=h(),Ql=m("div"),pr=S("Password"),_r=m("br"),dr=h(),bl=m("input"),vr=h(),Sn=m("div"),Xl=m("div"),hr=S("Power saving"),br=m("br"),gr=h(),Lt=m("select"),Tn=m("option"),Tn.textContent="Default",Nn=m("option"),Nn.textContent="Off",An=m("option"),An.textContent="Minimum",Pn=m("option"),Pn.textContent="Maximum",kr=h(),Zl=m("div"),wr=S("Power"),yr=m("br"),Cr=h(),En=m("div"),Ot=m("input"),$r=h(),Xi=m("span"),Xi.textContent="dBm",Mr=h(),Zi=m("div"),Ji=m("label"),Yt=m("input"),Sr=S(" Allow 802.11b legacy rates"),Tr=h(),ut=m("div"),xi=m("strong"),xi.textContent="Network",Nr=h(),Dn=m("a"),ie(In.$$.fragment),Ar=h(),Jl=m("div"),Pr=S("IP"),Er=m("br"),Dr=h(),Ll=m("div"),sl=m("select"),Rn=m("option"),Rn.textContent="DHCP",Ln=m("option"),Ln.textContent="Static",Ir=h(),Pt=m("input"),Rr=h(),Et=m("select"),ie(On.$$.fragment),Lr=h(),$t&&$t.c(),Es=h(),is=m("div"),ss=m("label"),Qt=m("input"),Or=S(" enable mDNS"),Fr=h(),pi=m("input"),qr=h(),Ol=m("div"),Br=S("NTP "),_i=m("label"),Xt=m("input"),Ur=S(" obtain from DHCP"),jr=m("br"),Hr=h(),os=m("div"),gl=m("input"),Wr=h(),Ye=m("div"),rs=m("strong"),rs.textContent="MQTT",zr=h(),Fn=m("a"),ie(qn.$$.fragment),Gr=h(),di=m("input"),Vr=h(),ol=m("div"),Kr=S(`Server `),Mt&&Mt.c(),Ds=h(),Yr=m("br"),Qr=h(),Bn=m("div"),kl=m("input"),Xr=h(),Zt=m("input"),Zr=h(),lt&<.c(),Is=h(),xl=m("div"),Jr=S("Username"),xr=m("br"),ea=h(),wl=m("input"),ta=h(),en=m("div"),la=S("Password"),na=m("br"),ia=h(),yl=m("input"),sa=h(),Un=m("div"),jn=m("div"),oa=S("Client ID"),ra=m("br"),aa=h(),Cl=m("input"),ua=h(),Hn=m("div"),fa=S("Payload"),ca=m("br"),ma=h(),bt=m("select"),Wn=m("option"),Wn.textContent="JSON",zn=m("option"),zn.textContent="Raw (minimal)",Gn=m("option"),Gn.textContent="Raw (full)",Vn=m("option"),Vn.textContent="Domoticz",Kn=m("option"),Kn.textContent="HomeAssistant",Yn=m("option"),Yn.textContent="HEX dump",pa=h(),tn=m("div"),_a=S("Publish topic"),da=m("br"),va=h(),$l=m("input"),ha=h(),nt&&nt.c(),Rs=h(),it&&it.c(),Ls=h(),st&&st.c(),Os=h(),ot&&ot.c(),qs=h(),rl=m("div"),as=m("strong"),as.textContent="User interface",ba=h(),Qn=m("a"),ie(Xn.$$.fragment),ga=h(),vi=m("input"),ka=h(),hi=m("div");for(let R=0;R<_t.length;R+=1)_t[R].c();wa=h(),rt&&rt.c(),Bs=h(),Dt=m("div"),us=m("strong"),us.textContent="Debugging",ya=h(),Zn=m("a"),ie(Jn.$$.fragment),Ca=h(),bi=m("input"),$a=h(),fs=m("div"),cs=m("label"),Jt=m("input"),Ma=S(" Enable debugging"),Sa=h(),St&&St.c(),Ta=h(),Fl=m("div"),Us=m("div"),xn=m("button"),xn.textContent="Factory reset",Na=h(),ms=m("div"),ei=m("button"),ei.textContent="Reboot",Aa=h(),ps=m("div"),ps.innerHTML='',js=h(),ie(ln.$$.fragment),Hs=h(),ie(nn.$$.fragment),Ws=h(),ie(sn.$$.fragment),zs=h(),ie(on.$$.fragment),r(i,"class","text-sm"),r(u,"href",Ut("General-configuration")),r(u,"target","_blank"),r(u,"class","float-right"),r(f,"type","hidden"),r(f,"name","g"),f.value="true",r(T,"name","gh"),r(T,"type","text"),r(T,"class","in-f w-full"),r(T,"pattern","[A-Za-z0-9-]+"),r(O,"name","gt"),r(O,"class","in-l w-full"),t[3].g.t===void 0&&tt(()=>t[16].call(O)),r(b,"class","flex"),r(p,"class","my-1"),r(j,"type","hidden"),r(j,"name","p"),j.value="true",re.__value="10YNO-1--------2",re.value=re.__value,ue.__value="10YNO-2--------T",ue.value=ue.__value,ke.__value="10YNO-3--------J",ke.value=ke.__value,me.__value="10YNO-4--------9",me.value=me.__value,Se.__value="10Y1001A1001A48H",Se.value=Se.__value,r(Z,"label","Norway"),Re.__value="10Y1001A1001A44P",Re.value=Re.__value,He.__value="10Y1001A1001A45N",He.value=He.__value,we.__value="10Y1001A1001A46L",we.value=we.__value,Te.__value="10Y1001A1001A47J",Te.value=Te.__value,r(je,"label","Sweden"),$e.__value="10YDK-1--------W",$e.value=$e.__value,w.__value="10YDK-2--------M",w.value=w.__value,r(Le,"label","Denmark"),g.__value="10YAT-APG------L",g.value=g.__value,k.__value="10YBE----------2",k.value=k.__value,A.__value="10YCZ-CEPS-----N",A.value=A.__value,I.__value="10Y1001A1001A39I",I.value=I.__value,Q.__value="10YFI-1--------U",Q.value=Q.__value,J.__value="10YFR-RTE------C",J.value=J.__value,se.__value="10Y1001A1001A83F",se.value=se.__value,ce.__value="10YGB----------A",ce.value=ce.__value,ve.__value="10YLV-1001A00074",ve.value=ve.__value,Me.__value="10YLT-1001A0008Q",Me.value=Me.__value,oe.__value="10YNL----------L",oe.value=oe.__value,pe.__value="10YPL-AREA-----S",pe.value=pe.__value,Be.__value="10YCH-SWISSGRIDZ",Be.value=Be.__value,r(Y,"name","pr"),r(Y,"class","in-f w-full"),t[3].p.r===void 0&&tt(()=>t[17].call(Y)),r(W,"class","w-full"),r(ct,"name","pc"),r(ct,"class","in-l"),t[3].p.c===void 0&&tt(()=>t[18].call(ct)),r(V,"class","flex"),r(G,"class","my-1"),r(Ue,"name","pf"),r(Ue,"type","number"),r(Ue,"min","0.001"),r(Ue,"max","65"),r(Ue,"step","0.001"),r(Ue,"class","in-f tr w-full"),r(ht,"class","w-1/2"),r(Ce,"name","pm"),r(Ce,"type","number"),r(Ce,"min","0.001"),r(Ce,"max","1000"),r(Ce,"step","0.001"),r(Ce,"class","in-l tr w-full"),r(We,"class","w-1/2"),r(Ht,"class","flex"),r(pl,"class","my-1"),r(Tt,"type","checkbox"),r(Tt,"name","pe"),Tt.__value="true",Tt.value=Tt.__value,r(Tt,"class","rounded mb-1"),r(_l,"class","my-1"),Nl.__value=0,Nl.value=Nl.__value,Al.__value=1,Al.value=Al.__value,Pl.__value=2,Pl.value=Pl.__value,r(Nt,"name","gs"),r(Nt,"class","in-s"),t[3].g.s===void 0&&tt(()=>t[23].call(Nt)),r(dl,"class","my-1"),r(n,"class","cnt"),r(vl,"class","text-sm"),r(El,"href",Ut("Meter-configuration")),r(El,"target","_blank"),r(El,"class","float-right"),r(Wl,"type","hidden"),r(Wl,"name","m"),Wl.value="true",r(Ui,"class","float-right"),r(Wt,"name","mi"),Wt.__value="true",Wt.value=Wt.__value,r(Wt,"type","checkbox"),r(Wt,"class","rounded mb-1"),r(ci,"class","mt-2 ml-3 whitespace-nowrap"),Il.__value=0,Il.value=Il.__value,Il.disabled=ji=t[3].m.b!=0,r(nl,"name","mb"),r(nl,"class","in-f tr w-1/2"),t[3].m.b===void 0&&tt(()=>t[27].call(nl)),Rl.__value=0,Rl.value=Rl.__value,Rl.disabled=Hi=t[3].m.b!=0,dn.__value=2,dn.value=dn.__value,vn.__value=3,vn.value=vn.__value,hn.__value=10,hn.value=hn.__value,bn.__value=11,bn.value=bn.__value,r(pt,"name","mp"),r(pt,"class","in-m"),pt.disabled=Wi=t[3].m.b==0,t[3].m.p===void 0&&tt(()=>t[28].call(pt)),r(At,"name","ms"),r(At,"type","number"),r(At,"min",64),r(At,"max",zi=t[0].chip=="esp8266"?t[3].i.h.p==3||t[3].i.h.p==113?512:128:4096),r(At,"step",64),r(At,"class","in-l tr w-1/2"),r(Dl,"class","flex w-full"),r(ll,"class","my-1"),gn.__value=2,gn.value=gn.__value,kn.__value=1,kn.value=kn.__value,r(il,"name","md"),r(il,"class","in-s"),t[3].m.d===void 0&&tt(()=>t[30].call(il)),r(zl,"class","my-1"),r(zt,"name","mf"),r(zt,"type","number"),r(zt,"min","5"),r(zt,"max","65535"),r(zt,"class","in-f tr w-full"),r(Gi,"class","in-post"),r(yn,"class","flex"),r(Gl,"class","mx-1"),r(Gt,"name","mr"),r(Gt,"type","number"),r(Gt,"min","0"),r(Gt,"max","65535"),r(Gt,"class","in-f tr w-full"),r(Vi,"class","in-post"),r(Cn,"class","flex"),r(Vl,"class","mx-1"),r(wn,"class","my-1 flex"),r(As,"class","my-1"),r(Vt,"type","checkbox"),r(Vt,"name","me"),Vt.__value="true",Vt.value=Vt.__value,r(Vt,"class","rounded mb-1"),r(Kl,"class","my-1"),r(Kt,"type","checkbox"),r(Kt,"name","mm"),Kt.__value="true",Kt.value=Kt.__value,r(Kt,"class","rounded mb-1"),r(Ae,"class","cnt"),r(Qi,"class","text-sm"),r($n,"href",Ut("WiFi-configuration")),r($n,"target","_blank"),r($n,"class","float-right"),r(mi,"type","hidden"),r(mi,"name","w"),mi.value="true",r(hl,"name","ws"),r(hl,"type","text"),r(hl,"class","in-s"),r(Yl,"class","my-1"),r(bl,"name","wp"),r(bl,"type","password"),r(bl,"class","in-s"),r(Ql,"class","my-1"),Tn.__value=255,Tn.value=Tn.__value,Nn.__value=0,Nn.value=Nn.__value,An.__value=1,An.value=An.__value,Pn.__value=2,Pn.value=Pn.__value,r(Lt,"name","wz"),r(Lt,"class","in-s"),t[3].w.z===void 0&&tt(()=>t[43].call(Lt)),r(Xl,"class","w-1/2"),r(Ot,"name","ww"),r(Ot,"type","number"),r(Ot,"min","0"),r(Ot,"max","20.5"),r(Ot,"step","0.5"),r(Ot,"class","in-f tr w-full"),r(Xi,"class","in-post"),r(En,"class","flex"),r(Zl,"class","ml-2 w-1/2"),r(Sn,"class","my-1 flex"),r(Yt,"type","checkbox"),r(Yt,"name","wb"),Yt.__value="true",Yt.value=Yt.__value,r(Yt,"class","rounded mb-1"),r(Zi,"class","my-3"),r(mt,"class","cnt"),r(xi,"class","text-sm"),r(Dn,"href",Ut("Network-configuration")),r(Dn,"target","_blank"),r(Dn,"class","float-right"),Rn.__value="dhcp",Rn.value=Rn.__value,Ln.__value="static",Ln.value=Ln.__value,r(sl,"name","nm"),r(sl,"class","in-f"),t[3].n.m===void 0&&tt(()=>t[46].call(sl)),r(Pt,"name","ni"),r(Pt,"type","text"),r(Pt,"class","in-m w-full"),Pt.disabled=es=t[3].n.m=="dhcp",Pt.required=ts=t[3].n.m=="static",r(Et,"name","ns"),r(Et,"class","in-l"),Et.disabled=ls=t[3].n.m=="dhcp",Et.required=ns=t[3].n.m=="static",t[3].n.s===void 0&&tt(()=>t[48].call(Et)),r(Ll,"class","flex"),r(Jl,"class","my-1"),r(Qt,"name","nd"),Qt.__value="true",Qt.value=Qt.__value,r(Qt,"type","checkbox"),r(Qt,"class","rounded mb-1"),r(is,"class","my-1"),r(pi,"type","hidden"),r(pi,"name","ntp"),pi.value="true",r(Xt,"name","ntpd"),Xt.__value="true",Xt.value=Xt.__value,r(Xt,"type","checkbox"),r(Xt,"class","rounded mb-1"),r(_i,"class","ml-4"),r(gl,"name","ntph"),r(gl,"type","text"),r(gl,"class","in-s"),r(os,"class","flex"),r(Ol,"class","my-1"),r(ut,"class","cnt"),r(rs,"class","text-sm"),r(Fn,"href",Ut("MQTT-configuration")),r(Fn,"target","_blank"),r(Fn,"class","float-right"),r(di,"type","hidden"),r(di,"name","q"),di.value="true",r(kl,"name","qh"),r(kl,"type","text"),r(kl,"class","in-f w-3/4"),r(Zt,"name","qp"),r(Zt,"type","number"),r(Zt,"min","1024"),r(Zt,"max","65535"),r(Zt,"class","in-l tr w-1/4"),r(Bn,"class","flex"),r(ol,"class","my-1"),r(wl,"name","qu"),r(wl,"type","text"),r(wl,"class","in-s"),r(xl,"class","my-1"),r(yl,"name","qa"),r(yl,"type","password"),r(yl,"class","in-s"),r(en,"class","my-1"),r(Cl,"name","qc"),r(Cl,"type","text"),r(Cl,"class","in-f w-full"),Wn.__value=0,Wn.value=Wn.__value,zn.__value=1,zn.value=zn.__value,Gn.__value=2,Gn.value=Gn.__value,Vn.__value=3,Vn.value=Vn.__value,Kn.__value=4,Kn.value=Kn.__value,Yn.__value=255,Yn.value=Yn.__value,r(bt,"name","qm"),r(bt,"class","in-l"),t[3].q.m===void 0&&tt(()=>t[61].call(bt)),r(Un,"class","my-1 flex"),r($l,"name","qb"),r($l,"type","text"),r($l,"class","in-s"),r(tn,"class","my-1"),r(Ye,"class","cnt"),r(as,"class","text-sm"),r(Qn,"href",Ut("User-interface")),r(Qn,"target","_blank"),r(Qn,"class","float-right"),r(vi,"type","hidden"),r(vi,"name","u"),vi.value="true",r(hi,"class","flex flex-wrap"),r(rl,"class","cnt"),r(us,"class","text-sm"),r(Zn,"href","https://amsleser.no/blog/post/24-telnet-debug"),r(Zn,"target","_blank"),r(Zn,"class","float-right"),r(bi,"type","hidden"),r(bi,"name","d"),bi.value="true",r(Jt,"type","checkbox"),r(Jt,"name","ds"),Jt.__value="true",Jt.value=Jt.__value,r(Jt,"class","rounded mb-1"),r(fs,"class","mt-3"),r(Dt,"class","cnt"),r(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),r(xn,"type","button"),r(xn,"class","py-2 px-4 rounded bg-red-500 text-white ml-2"),r(ei,"type","button"),r(ei,"class","py-2 px-4 rounded bg-yellow-500 text-white"),r(ms,"class","text-center"),r(ps,"class","text-right"),r(Fl,"class","grid grid-cols-3"),r(e,"autocomplete","off")},m(R,ae){$(R,e,ae),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),le(a,u,null),s(n,c),s(n,f),s(n,_),s(n,p),s(p,b),s(b,v),s(v,d),s(v,M),s(v,y),s(v,T),te(T,t[3].g.h),s(b,N),s(b,E),s(E,B),s(E,P),s(E,L),s(E,O),le(F,O,null),qe(O,t[3].g.t,!0),s(n,x),s(n,j),s(n,z),s(n,G),s(G,V),s(V,W),s(W,U),s(W,K),s(W,H),s(W,Y),s(Y,Z),s(Z,re),s(Z,ue),s(Z,ke),s(Z,me),s(Z,Se),s(Y,je),s(je,Re),s(je,He),s(je,we),s(je,Te),s(Y,Le),s(Le,$e),s(Le,w),s(Y,g),s(Y,k),s(Y,A),s(Y,I),s(Y,Q),s(Y,J),s(Y,se),s(Y,ce),s(Y,ve),s(Y,Me),s(Y,oe),s(Y,pe),s(Y,Be),qe(Y,t[3].p.r,!0),s(V,_e),s(V,ye),s(ye,vt),s(ye,Hl),s(ye,tl),s(ye,ct);for(let ft=0;ft<4;ft+=1)gi[ft]&&gi[ft].m(ct,null);qe(ct,t[3].p.c,!0),s(n,Tl),s(n,pl),s(pl,Ht),s(Ht,ht),s(ht,Qe),s(ht,Xe),s(ht,Ze),s(ht,Ue),te(Ue,t[3].p.f),s(Ht,Je),s(Ht,We),s(We,xe),s(We,et),s(We,de),s(We,Ce),te(Ce,t[3].p.m),s(n,Ei),s(n,_l),s(_l,_n),s(_n,Tt),Tt.checked=t[3].p.e,s(_n,Di),s(_l,Ii),gt&>.m(_l,null),s(n,Ri),s(n,dl),s(dl,Li),s(dl,Oi),s(dl,Fi),s(dl,Nt),s(Nt,Nl),s(Nt,Al),s(Nt,Pl),qe(Nt,t[3].g.s,!0),s(n,qi),kt&&kt.m(n,null),s(l,Ge),s(l,Ae),s(Ae,vl),s(Ae,Ts),s(Ae,El),le(Rt,El,null),s(Ae,Bi),s(Ae,Wl),s(Ae,Ao),s(Ae,ll),s(ll,Ui),s(ll,Po),s(ll,Ns),s(ll,Eo),s(ll,ci),s(ci,Wt),Wt.checked=t[3].m.i,s(ci,Do),s(ll,Io),s(ll,Dl),s(Dl,nl),s(nl,Il),s(Il,Ro);for(let ft=0;ft<7;ft+=1)ki[ft]&&ki[ft].m(nl,null);qe(nl,t[3].m.b,!0),s(Dl,Lo),s(Dl,pt),s(pt,Rl),s(Rl,Oo),s(pt,dn),s(pt,vn),s(pt,hn),s(pt,bn),qe(pt,t[3].m.p,!0),s(Dl,Fo),s(Dl,At),te(At,t[3].m.s),s(Ae,qo),s(Ae,zl),s(zl,Bo),s(zl,Uo),s(zl,jo),s(zl,il),s(il,gn),s(il,kn),qe(il,t[3].m.d,!0),s(Ae,Ho),s(Ae,wn),s(wn,Gl),s(Gl,Wo),s(Gl,zo),s(Gl,Go),s(Gl,yn),s(yn,zt),te(zt,t[3].m.f),s(yn,Vo),s(yn,Gi),s(wn,Ko),s(wn,Vl),s(Vl,Yo),s(Vl,Qo),s(Vl,Xo),s(Vl,Cn),s(Cn,Gt),te(Gt,t[3].m.r),s(Cn,Zo),s(Cn,Vi),s(Ae,Jo),s(Ae,As),s(Ae,xo),s(Ae,Kl),s(Kl,Ki),s(Ki,Vt),Vt.checked=t[3].m.e.e,s(Ki,er),s(Kl,tr),wt&&wt.m(Kl,null),s(Ae,lr),yt&&yt.m(Ae,null),s(Ae,Ps),s(Ae,Yi),s(Yi,Kt),Kt.checked=t[3].m.m.e,s(Yi,nr),s(Ae,ir),Ct&&Ct.m(Ae,null),s(l,sr),s(l,mt),s(mt,Qi),s(mt,or),s(mt,$n),le(Mn,$n,null),s(mt,rr),s(mt,mi),s(mt,ar),s(mt,Yl),s(Yl,ur),s(Yl,fr),s(Yl,cr),s(Yl,hl),te(hl,t[3].w.s),s(mt,mr),s(mt,Ql),s(Ql,pr),s(Ql,_r),s(Ql,dr),s(Ql,bl),te(bl,t[3].w.p),s(mt,vr),s(mt,Sn),s(Sn,Xl),s(Xl,hr),s(Xl,br),s(Xl,gr),s(Xl,Lt),s(Lt,Tn),s(Lt,Nn),s(Lt,An),s(Lt,Pn),qe(Lt,t[3].w.z,!0),s(Sn,kr),s(Sn,Zl),s(Zl,wr),s(Zl,yr),s(Zl,Cr),s(Zl,En),s(En,Ot),te(Ot,t[3].w.w),s(En,$r),s(En,Xi),s(mt,Mr),s(mt,Zi),s(Zi,Ji),s(Ji,Yt),Yt.checked=t[3].w.b,s(Ji,Sr),s(l,Tr),s(l,ut),s(ut,xi),s(ut,Nr),s(ut,Dn),le(In,Dn,null),s(ut,Ar),s(ut,Jl),s(Jl,Pr),s(Jl,Er),s(Jl,Dr),s(Jl,Ll),s(Ll,sl),s(sl,Rn),s(sl,Ln),qe(sl,t[3].n.m,!0),s(Ll,Ir),s(Ll,Pt),te(Pt,t[3].n.i),s(Ll,Rr),s(Ll,Et),le(On,Et,null),qe(Et,t[3].n.s,!0),s(ut,Lr),$t&&$t.m(ut,null),s(ut,Es),s(ut,is),s(is,ss),s(ss,Qt),Qt.checked=t[3].n.d,s(ss,Or),s(ut,Fr),s(ut,pi),s(ut,qr),s(ut,Ol),s(Ol,Br),s(Ol,_i),s(_i,Xt),Xt.checked=t[3].n.h,s(_i,Ur),s(Ol,jr),s(Ol,Hr),s(Ol,os),s(os,gl),te(gl,t[3].n.n1),s(l,Wr),s(l,Ye),s(Ye,rs),s(Ye,zr),s(Ye,Fn),le(qn,Fn,null),s(Ye,Gr),s(Ye,di),s(Ye,Vr),s(Ye,ol),s(ol,Kr),Mt&&Mt.m(ol,null),s(ol,Ds),s(ol,Yr),s(ol,Qr),s(ol,Bn),s(Bn,kl),te(kl,t[3].q.h),s(Bn,Xr),s(Bn,Zt),te(Zt,t[3].q.p),s(Ye,Zr),lt&<.m(Ye,null),s(Ye,Is),s(Ye,xl),s(xl,Jr),s(xl,xr),s(xl,ea),s(xl,wl),te(wl,t[3].q.u),s(Ye,ta),s(Ye,en),s(en,la),s(en,na),s(en,ia),s(en,yl),te(yl,t[3].q.a),s(Ye,sa),s(Ye,Un),s(Un,jn),s(jn,oa),s(jn,ra),s(jn,aa),s(jn,Cl),te(Cl,t[3].q.c),s(Un,ua),s(Un,Hn),s(Hn,fa),s(Hn,ca),s(Hn,ma),s(Hn,bt),s(bt,Wn),s(bt,zn),s(bt,Gn),s(bt,Vn),s(bt,Kn),s(bt,Yn),qe(bt,t[3].q.m,!0),s(Ye,pa),s(Ye,tn),s(tn,_a),s(tn,da),s(tn,va),s(tn,$l),te($l,t[3].q.b),s(l,ha),nt&&nt.m(l,null),s(l,Rs),it&&it.m(l,null),s(l,Ls),st&&st.m(l,null),s(l,Os),ot&&ot.m(l,null),s(l,qs),s(l,rl),s(rl,as),s(rl,ba),s(rl,Qn),le(Xn,Qn,null),s(rl,ga),s(rl,vi),s(rl,ka),s(rl,hi);for(let ft=0;ft<_t.length;ft+=1)_t[ft]&&_t[ft].m(hi,null);s(l,wa),rt&&rt.m(l,null),s(l,Bs),s(l,Dt),s(Dt,us),s(Dt,ya),s(Dt,Zn),le(Jn,Zn,null),s(Dt,Ca),s(Dt,bi),s(Dt,$a),s(Dt,fs),s(fs,cs),s(cs,Jt),Jt.checked=t[3].d.s,s(cs,Ma),s(Dt,Sa),St&&St.m(Dt,null),s(e,Ta),s(e,Fl),s(Fl,Us),s(Us,xn),s(Fl,Na),s(Fl,ms),s(ms,ei),s(Fl,Aa),s(Fl,ps),$(R,js,ae),le(ln,R,ae),$(R,Hs,ae),le(nn,R,ae),$(R,Ws,ae),le(sn,R,ae),$(R,zs,ae),le(on,R,ae),Ft=!0,Gs||(Pa=[ee(T,"input",t[15]),ee(O,"change",t[16]),ee(Y,"change",t[17]),ee(ct,"change",t[18]),ee(Ue,"input",t[19]),ee(Ce,"input",t[20]),ee(Tt,"change",t[21]),ee(Nt,"change",t[23]),ee(Wt,"change",t[26]),ee(nl,"change",t[27]),ee(pt,"change",t[28]),ee(At,"input",t[29]),ee(il,"change",t[30]),ee(zt,"input",t[31]),ee(Gt,"input",t[32]),ee(Vt,"change",t[33]),ee(Kt,"change",t[36]),ee(hl,"input",t[41]),ee(bl,"input",t[42]),ee(Lt,"change",t[43]),ee(Ot,"input",t[44]),ee(Yt,"change",t[45]),ee(sl,"change",t[46]),ee(Pt,"input",t[47]),ee(Et,"change",t[48]),ee(Qt,"change",t[52]),ee(Xt,"change",t[53]),ee(gl,"input",t[54]),ee(kl,"input",t[56]),ee(Zt,"input",t[57]),ee(wl,"input",t[58]),ee(yl,"input",t[59]),ee(Cl,"input",t[60]),ee(bt,"change",t[61]),ee($l,"input",t[62]),ee(Jt,"change",t[92]),ee(xn,"click",t[8]),ee(ei,"click",t[10]),ee(e,"submit",Ms(t[9]))],Gs=!0)},p(R,ae){if(ae[0]&8&&T.value!==R[3].g.h&&te(T,R[3].g.h),ae[0]&8&&qe(O,R[3].g.t),ae[0]&8&&qe(Y,R[3].p.r),ae[0]&8&&qe(ct,R[3].p.c),ae[0]&8&&he(Ue.value)!==R[3].p.f&&te(Ue,R[3].p.f),ae[0]&8&&he(Ce.value)!==R[3].p.m&&te(Ce,R[3].p.m),ae[0]&8&&(Tt.checked=R[3].p.e),R[3].p.e&&R[0].chip!="esp8266"?gt?gt.p(R,ae):(gt=af(R),gt.c(),gt.m(_l,null)):gt&&(gt.d(1),gt=null),ae[0]&8&&qe(Nt,R[3].g.s),R[3].g.s>0?kt?kt.p(R,ae):(kt=uf(R),kt.c(),kt.m(n,null)):kt&&(kt.d(1),kt=null),ae[0]&8&&(Wt.checked=R[3].m.i),(!Ft||ae[0]&8&&ji!==(ji=R[3].m.b!=0))&&(Il.disabled=ji),ae[0]&8&&qe(nl,R[3].m.b),(!Ft||ae[0]&8&&Hi!==(Hi=R[3].m.b!=0))&&(Rl.disabled=Hi),(!Ft||ae[0]&8&&Wi!==(Wi=R[3].m.b==0))&&(pt.disabled=Wi),ae[0]&8&&qe(pt,R[3].m.p),(!Ft||ae[0]&9&&zi!==(zi=R[0].chip=="esp8266"?R[3].i.h.p==3||R[3].i.h.p==113?512:128:4096))&&r(At,"max",zi),ae[0]&8&&he(At.value)!==R[3].m.s&&te(At,R[3].m.s),ae[0]&8&&qe(il,R[3].m.d),ae[0]&8&&he(zt.value)!==R[3].m.f&&te(zt,R[3].m.f),ae[0]&8&&he(Gt.value)!==R[3].m.r&&te(Gt,R[3].m.r),ae[0]&8&&(Vt.checked=R[3].m.e.e),R[3].m.e.e?wt?wt.p(R,ae):(wt=ff(R),wt.c(),wt.m(Kl,null)):wt&&(wt.d(1),wt=null),R[3].m.e.e?yt?yt.p(R,ae):(yt=cf(R),yt.c(),yt.m(Ae,Ps)):yt&&(yt.d(1),yt=null),ae[0]&8&&(Kt.checked=R[3].m.m.e),R[3].m.m.e?Ct?Ct.p(R,ae):(Ct=mf(R),Ct.c(),Ct.m(Ae,null)):Ct&&(Ct.d(1),Ct=null),ae[0]&8&&hl.value!==R[3].w.s&&te(hl,R[3].w.s),ae[0]&8&&bl.value!==R[3].w.p&&te(bl,R[3].w.p),ae[0]&8&&qe(Lt,R[3].w.z),ae[0]&8&&he(Ot.value)!==R[3].w.w&&te(Ot,R[3].w.w),ae[0]&8&&(Yt.checked=R[3].w.b),ae[0]&8&&qe(sl,R[3].n.m),(!Ft||ae[0]&8&&es!==(es=R[3].n.m=="dhcp"))&&(Pt.disabled=es),(!Ft||ae[0]&8&&ts!==(ts=R[3].n.m=="static"))&&(Pt.required=ts),ae[0]&8&&Pt.value!==R[3].n.i&&te(Pt,R[3].n.i),(!Ft||ae[0]&8&&ls!==(ls=R[3].n.m=="dhcp"))&&(Et.disabled=ls),(!Ft||ae[0]&8&&ns!==(ns=R[3].n.m=="static"))&&(Et.required=ns),ae[0]&8&&qe(Et,R[3].n.s),R[3].n.m=="static"?$t?$t.p(R,ae):($t=pf(R),$t.c(),$t.m(ut,Es)):$t&&($t.d(1),$t=null),ae[0]&8&&(Qt.checked=R[3].n.d),ae[0]&8&&(Xt.checked=R[3].n.h),ae[0]&8&&gl.value!==R[3].n.n1&&te(gl,R[3].n.n1),R[0].chip!="esp8266"?Mt?Mt.p(R,ae):(Mt=_f(R),Mt.c(),Mt.m(ol,Ds)):Mt&&(Mt.d(1),Mt=null),ae[0]&8&&kl.value!==R[3].q.h&&te(kl,R[3].q.h),ae[0]&8&&he(Zt.value)!==R[3].q.p&&te(Zt,R[3].q.p),R[3].q.s.e?lt?(lt.p(R,ae),ae[0]&8&&D(lt,1)):(lt=df(R),lt.c(),D(lt,1),lt.m(Ye,Is)):lt&&(De(),q(lt,1,1,()=>{lt=null}),Ie()),ae[0]&8&&wl.value!==R[3].q.u&&te(wl,R[3].q.u),ae[0]&8&&yl.value!==R[3].q.a&&te(yl,R[3].q.a),ae[0]&8&&Cl.value!==R[3].q.c&&te(Cl,R[3].q.c),ae[0]&8&&qe(bt,R[3].q.m),ae[0]&8&&$l.value!==R[3].q.b&&te($l,R[3].q.b),R[3].q.m==3?nt?(nt.p(R,ae),ae[0]&8&&D(nt,1)):(nt=vf(R),nt.c(),D(nt,1),nt.m(l,Rs)):nt&&(De(),q(nt,1,1,()=>{nt=null}),Ie()),R[3].q.m==4?it?(it.p(R,ae),ae[0]&8&&D(it,1)):(it=hf(R),it.c(),D(it,1),it.m(l,Ls)):it&&(De(),q(it,1,1,()=>{it=null}),Ie()),R[3].c.es!=null?st?(st.p(R,ae),ae[0]&8&&D(st,1)):(st=bf(R),st.c(),D(st,1),st.m(l,Os)):st&&(De(),q(st,1,1,()=>{st=null}),Ie()),ae[0]&8&&(Fs=R[3].p.r.startsWith("10YNO")||R[3].p.r.startsWith("10Y1001A1001A4")),Fs?ot?(ot.p(R,ae),ae[0]&8&&D(ot,1)):(ot=wf(R),ot.c(),D(ot,1),ot.m(l,qs)):ot&&(De(),q(ot,1,1,()=>{ot=null}),Ie()),ae[0]&136){ti=R[7];let qt;for(qt=0;qt20||R[0].chip=="esp8266"?rt?(rt.p(R,ae),ae[0]&1&&D(rt,1)):(rt=$f(R),rt.c(),D(rt,1),rt.m(l,Bs)):rt&&(De(),q(rt,1,1,()=>{rt=null}),Ie()),ae[0]&8&&(Jt.checked=R[3].d.s),R[3].d.s?St?St.p(R,ae):(St=Pf(R),St.c(),St.m(Dt,null)):St&&(St.d(1),St=null);const ft={};ae[0]&2&&(ft.active=R[1]),ln.$set(ft);const Ea={};ae[0]&4&&(Ea.active=R[2]),nn.$set(Ea);const Da={};ae[0]&16&&(Da.active=R[4]),sn.$set(Da);const Ia={};ae[0]&32&&(Ia.active=R[5]),on.$set(Ia)},i(R){Ft||(D(a.$$.fragment,R),D(F.$$.fragment,R),D(Rt.$$.fragment,R),D(Mn.$$.fragment,R),D(In.$$.fragment,R),D(On.$$.fragment,R),D(qn.$$.fragment,R),D(lt),D(nt),D(it),D(st),D(ot),D(Xn.$$.fragment,R),D(rt),D(Jn.$$.fragment,R),D(ln.$$.fragment,R),D(nn.$$.fragment,R),D(sn.$$.fragment,R),D(on.$$.fragment,R),Ft=!0)},o(R){q(a.$$.fragment,R),q(F.$$.fragment,R),q(Rt.$$.fragment,R),q(Mn.$$.fragment,R),q(In.$$.fragment,R),q(On.$$.fragment,R),q(qn.$$.fragment,R),q(lt),q(nt),q(it),q(st),q(ot),q(Xn.$$.fragment,R),q(rt),q(Jn.$$.fragment,R),q(ln.$$.fragment,R),q(nn.$$.fragment,R),q(sn.$$.fragment,R),q(on.$$.fragment,R),Ft=!1},d(R){R&&C(e),ne(a),ne(F),cl(gi,R),gt&>.d(),kt&&kt.d(),ne(Rt),cl(ki,R),wt&&wt.d(),yt&&yt.d(),Ct&&Ct.d(),ne(Mn),ne(In),ne(On),$t&&$t.d(),ne(qn),Mt&&Mt.d(),lt&<.d(),nt&&nt.d(),it&&it.d(),st&&st.d(),ot&&ot.d(),ne(Xn),cl(_t,R),rt&&rt.d(),ne(Jn),St&&St.d(),R&&C(js),ne(ln,R),R&&C(Hs),ne(nn,R),R&&C(Ws),ne(sn,R),R&&C(zs),ne(on,R),Gs=!1,ze(Pa)}}}async function wp(){await(await fetch("/reboot",{method:"POST"})).json()}function yp(t,e,l){let{sysinfo:n={}}=e,i=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Reactive",key:"r"},{name:"Realtime",key:"c"},{name:"Peaks",key:"t"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"}],o=!0,u=!1,a={g:{t:"",h:"",s:0,u:"",p:""},m:{b:2400,p:11,i:!1,d:0,f:0,r:0,e:{e:!1,k:"",a:""},m:{e:!1,w:!1,v:!1,a:!1,c:!1}},w:{s:"",p:"",w:0,z:255,a:!0,b:!0},n:{m:"",i:"",s:"",g:"",d1:"",d2:"",d:!1,n1:"",n2:"",h:!1},q:{h:"",p:1883,u:"",a:"",b:"",s:{e:!1,c:!1,r:!0,k:!1}},o:{e:"",c:"",u1:"",u2:"",u3:""},t:{t:[0,0,0,0,0,0,0,0,0,0],h:1},p:{e:!1,t:"",r:"",c:"",m:1,f:null},d:{s:!1,t:!1,l:5},u:{i:0,e:0,v:0,a:0,r:0,c:0,t:0,p:0,d:0,m:0,s:0},i:{h:{p:null,u:!0},a:null,l:{p:null,i:!1},r:{r:null,g:null,b:null,i:!1},t:{d:null,a:null},v:{p:null,d:{v:null,g:null},o:null,m:null,b:null}},h:{t:"",h:"",n:""},c:{es:null}};Ci.subscribe(Ge=>{Ge.version&&(l(3,a=Ge),l(1,o=!1))}),jm();let c=!1,f=!1;async function _(){if(confirm("Are you sure you want to factory reset the device?")){l(4,c=!0);const Ge=new URLSearchParams;Ge.append("perform","true");let vl=await(await fetch("/reset",{method:"POST",body:Ge})).json();l(4,c=!1),l(5,f=vl.success)}}async function p(Ge){l(2,u=!0);const Ae=new FormData(Ge.target),vl=new URLSearchParams;for(let Rt of Ae){const[Bi,Wl]=Rt;vl.append(Bi,Wl)}let El=await(await fetch("/save",{method:"POST",body:vl})).json();jt.update(Rt=>(Rt.booting=El.reboot,Rt.ui=a.u,Rt)),l(2,u=!1),oi("/")}const b=function(){confirm("Are you sure you want to reboot the device?")&&(jt.update(Ge=>(Ge.booting=!0,Ge)),wp())};async function v(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("/mqtt-ca",{method:"POST"})).text(),Ci.update(Ae=>(Ae.q.s.c=!1,Ae)))}async function d(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("/mqtt-cert",{method:"POST"})).text(),Ci.update(Ae=>(Ae.q.s.r=!1,Ae)))}async function M(){confirm("Are you sure you want to delete key?")&&(await(await fetch("/mqtt-key",{method:"POST"})).text(),Ci.update(Ae=>(Ae.q.s.k=!1,Ae)))}const y=function(){a.q.s.e?a.q.p==1883&&l(3,a.q.p=8883,a):a.q.p==8883&&l(3,a.q.p=1883,a)};let T=44;function N(){a.g.h=this.value,l(3,a)}function E(){a.g.t=dt(this),l(3,a)}function B(){a.p.r=dt(this),l(3,a)}function P(){a.p.c=dt(this),l(3,a)}function L(){a.p.f=he(this.value),l(3,a)}function O(){a.p.m=he(this.value),l(3,a)}function F(){a.p.e=this.checked,l(3,a)}function x(){a.p.t=this.value,l(3,a)}function j(){a.g.s=dt(this),l(3,a)}function z(){a.g.u=this.value,l(3,a)}function G(){a.g.p=this.value,l(3,a)}function V(){a.m.i=this.checked,l(3,a)}function W(){a.m.b=dt(this),l(3,a)}function U(){a.m.p=dt(this),l(3,a)}function K(){a.m.s=he(this.value),l(3,a)}function H(){a.m.d=dt(this),l(3,a)}function Y(){a.m.f=he(this.value),l(3,a)}function Z(){a.m.r=he(this.value),l(3,a)}function re(){a.m.e.e=this.checked,l(3,a)}function ue(){a.m.e.k=this.value,l(3,a)}function ke(){a.m.e.a=this.value,l(3,a)}function me(){a.m.m.e=this.checked,l(3,a)}function Se(){a.m.m.w=he(this.value),l(3,a)}function je(){a.m.m.v=he(this.value),l(3,a)}function Re(){a.m.m.a=he(this.value),l(3,a)}function He(){a.m.m.c=he(this.value),l(3,a)}function we(){a.w.s=this.value,l(3,a)}function Te(){a.w.p=this.value,l(3,a)}function Le(){a.w.z=dt(this),l(3,a)}function $e(){a.w.w=he(this.value),l(3,a)}function w(){a.w.b=this.checked,l(3,a)}function g(){a.n.m=dt(this),l(3,a)}function k(){a.n.i=this.value,l(3,a)}function A(){a.n.s=dt(this),l(3,a)}function I(){a.n.g=this.value,l(3,a)}function Q(){a.n.d1=this.value,l(3,a)}function J(){a.n.d2=this.value,l(3,a)}function se(){a.n.d=this.checked,l(3,a)}function ce(){a.n.h=this.checked,l(3,a)}function ve(){a.n.n1=this.value,l(3,a)}function Me(){a.q.s.e=this.checked,l(3,a)}function oe(){a.q.h=this.value,l(3,a)}function pe(){a.q.p=he(this.value),l(3,a)}function Be(){a.q.u=this.value,l(3,a)}function _e(){a.q.a=this.value,l(3,a)}function ye(){a.q.c=this.value,l(3,a)}function vt(){a.q.m=dt(this),l(3,a)}function Hl(){a.q.b=this.value,l(3,a)}function tl(){a.o.e=this.value,l(3,a)}function ct(){a.o.c=this.value,l(3,a)}function Tl(){a.o.u1=this.value,l(3,a)}function pl(){a.o.u2=this.value,l(3,a)}function Ht(){a.o.u3=this.value,l(3,a)}function ht(){a.h.t=this.value,l(3,a)}function Qe(){a.h.h=this.value,l(3,a)}function Xe(){a.h.n=this.value,l(3,a)}function Ze(){a.c.es=this.checked,l(3,a)}function Ue(Ge){a.t.t[Ge]=he(this.value),l(3,a)}function Je(){a.t.h=he(this.value),l(3,a)}function We(Ge){a.u[Ge.key]=dt(this),l(3,a)}function xe(){a.i.h.u=this.checked,l(3,a)}function et(){a.i.h.p=dt(this),l(3,a)}function de(){a.i.a=he(this.value),l(3,a)}function Ce(){a.i.l.i=this.checked,l(3,a)}function Ei(){a.i.l.p=he(this.value),l(3,a)}function _l(){a.i.r.i=this.checked,l(3,a)}function _n(){a.i.r.r=he(this.value),l(3,a)}function Tt(){a.i.r.g=he(this.value),l(3,a)}function Di(){a.i.r.b=he(this.value),l(3,a)}function Ii(){a.i.t.d=he(this.value),l(3,a)}function Ri(){a.i.t.a=he(this.value),l(3,a)}function dl(){a.i.v.p=he(this.value),l(3,a)}function Li(){a.i.v.d.v=he(this.value),l(3,a)}function Oi(){a.i.v.d.g=he(this.value),l(3,a)}function Fi(){a.i.v.o=he(this.value),l(3,a)}function Nt(){a.i.v.m=he(this.value),l(3,a)}function Nl(){a.i.v.b=he(this.value),l(3,a)}function Al(){a.d.s=this.checked,l(3,a)}function Pl(){a.d.t=this.checked,l(3,a)}function qi(){a.d.l=dt(this),l(3,a)}return t.$$set=Ge=>{"sysinfo"in Ge&&l(0,n=Ge.sysinfo)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(6,T=n.chip=="esp8266"?16:n.chip=="esp32s2"?44:39)},[n,o,u,a,c,f,T,i,_,p,b,v,d,M,y,N,E,B,P,L,O,F,x,j,z,G,V,W,U,K,H,Y,Z,re,ue,ke,me,Se,je,Re,He,we,Te,Le,$e,w,g,k,A,I,Q,J,se,ce,ve,Me,oe,pe,Be,_e,ye,vt,Hl,tl,ct,Tl,pl,Ht,ht,Qe,Xe,Ze,Ue,Je,We,xe,et,de,Ce,Ei,_l,_n,Tt,Di,Ii,Ri,dl,Li,Oi,Fi,Nt,Nl,Al,Pl,qi]}class Cp extends Ee{constructor(e){super(),Pe(this,e,yp,kp,Ne,{sysinfo:0},null,[-1,-1,-1,-1])}}function Df(t,e,l){const n=t.slice();return n[20]=e[l],n}function $p(t){let e=be(t[1].chip,t[1].board)+"",l;return{c(){l=S(e)},m(n,i){$(n,l,i)},p(n,i){i&2&&e!==(e=be(n[1].chip,n[1].board)+"")&&X(l,e)},d(n){n&&C(l)}}}function If(t){let e,l,n=t[1].apmac+"",i,o,u,a,c,f,_,p,b,v=Za(t[1])+"",d,M,y=t[1].boot_reason+"",T,N,E=t[1].ex_cause+"",B,P,L;const O=[Sp,Mp],F=[];function x(j,z){return j[0].u>0?0:1}return c=x(t),f=F[c]=O[c](t),{c(){e=m("div"),l=S("AP MAC: "),i=S(n),o=h(),u=m("div"),a=S(`Last boot: `),f.c(),_=h(),p=m("div"),b=S("Reason: "),d=S(v),M=S(" ("),T=S(y),N=S("/"),B=S(E),P=S(")"),r(e,"class","my-2"),r(u,"class","my-2"),r(p,"class","my-2")},m(j,z){$(j,e,z),s(e,l),s(e,i),$(j,o,z),$(j,u,z),s(u,a),F[c].m(u,null),$(j,_,z),$(j,p,z),s(p,b),s(p,d),s(p,M),s(p,T),s(p,N),s(p,B),s(p,P),L=!0},p(j,z){(!L||z&2)&&n!==(n=j[1].apmac+"")&&X(i,n);let G=c;c=x(j),c===G?F[c].p(j,z):(De(),q(F[G],1,1,()=>{F[G]=null}),Ie(),f=F[c],f?f.p(j,z):(f=F[c]=O[c](j),f.c()),D(f,1),f.m(u,null)),(!L||z&2)&&v!==(v=Za(j[1])+"")&&X(d,v),(!L||z&2)&&y!==(y=j[1].boot_reason+"")&&X(T,y),(!L||z&2)&&E!==(E=j[1].ex_cause+"")&&X(B,E)},i(j){L||(D(f),L=!0)},o(j){q(f),L=!1},d(j){j&&C(e),j&&C(o),j&&C(u),F[c].d(),j&&C(_),j&&C(p)}}}function Mp(t){let e;return{c(){e=S("-")},m(l,n){$(l,e,n)},p:fe,i:fe,o:fe,d(l){l&&C(e)}}}function Sp(t){let e,l;return e=new Gc({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.timestamp=new Date(new Date().getTime()-n[0].u*1e3)),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function Tp(t){let e;return{c(){e=m("span"),e.textContent="Update consents",r(e,"class","btn-pri-sm")},m(l,n){$(l,e,n)},p:fe,d(l){l&&C(e)}}}function Rf(t){let e,l,n,i,o,u=Cs(t[1].meter.mfg)+"",a,c,f,_,p=(t[1].meter.model?t[1].meter.model:"unknown")+"",b,v,d,M,y=(t[1].meter.id?t[1].meter.id:"unknown")+"",T;return{c(){e=m("div"),l=m("strong"),l.textContent="Meter",n=h(),i=m("div"),o=S("Manufacturer: "),a=S(u),c=h(),f=m("div"),_=S("Model: "),b=S(p),v=h(),d=m("div"),M=S("ID: "),T=S(y),r(l,"class","text-sm"),r(i,"class","my-2"),r(f,"class","my-2"),r(d,"class","my-2"),r(e,"class","cnt")},m(N,E){$(N,e,E),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,c),s(e,f),s(f,_),s(f,b),s(e,v),s(e,d),s(d,M),s(d,T)},p(N,E){E&2&&u!==(u=Cs(N[1].meter.mfg)+"")&&X(a,u),E&2&&p!==(p=(N[1].meter.model?N[1].meter.model:"unknown")+"")&&X(b,p),E&2&&y!==(y=(N[1].meter.id?N[1].meter.id:"unknown")+"")&&X(T,y)},d(N){N&&C(e)}}}function Lf(t){let e,l,n,i,o,u=t[1].net.ip+"",a,c,f,_,p=t[1].net.mask+"",b,v,d,M,y=t[1].net.gw+"",T,N,E,B,P=t[1].net.dns1+"",L,O,F=t[1].net.dns2&&Of(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Network",n=h(),i=m("div"),o=S("IP: "),a=S(u),c=h(),f=m("div"),_=S("Mask: "),b=S(p),v=h(),d=m("div"),M=S("Gateway: "),T=S(y),N=h(),E=m("div"),B=S("DNS: "),L=S(P),O=h(),F&&F.c(),r(l,"class","text-sm"),r(i,"class","my-2"),r(f,"class","my-2"),r(d,"class","my-2"),r(E,"class","my-2"),r(e,"class","cnt")},m(x,j){$(x,e,j),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,c),s(e,f),s(f,_),s(f,b),s(e,v),s(e,d),s(d,M),s(d,T),s(e,N),s(e,E),s(E,B),s(E,L),s(E,O),F&&F.m(E,null)},p(x,j){j&2&&u!==(u=x[1].net.ip+"")&&X(a,u),j&2&&p!==(p=x[1].net.mask+"")&&X(b,p),j&2&&y!==(y=x[1].net.gw+"")&&X(T,y),j&2&&P!==(P=x[1].net.dns1+"")&&X(L,P),x[1].net.dns2?F?F.p(x,j):(F=Of(x),F.c(),F.m(E,null)):F&&(F.d(1),F=null)},d(x){x&&C(e),F&&F.d()}}}function Of(t){let e,l=t[1].net.dns2+"",n;return{c(){e=S("/ "),n=S(l)},m(i,o){$(i,e,o),$(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2+"")&&X(n,l)},d(i){i&&C(e),i&&C(n)}}}function Ff(t){let e,l,n,i=t[1].upgrade.t+"",o,u,a=t[1].version+"",c,f,_=t[1].upgrade.x+"",p,b,v=t[1].upgrade.e+"",d,M;return{c(){e=m("div"),l=m("div"),n=S("Previous upgrade attempt ("),o=S(i),u=S(") does not match current version ("),c=S(a),f=S(") ["),p=S(_),b=S("/"),d=S(v),M=S("]"),r(l,"class","bd-yellow"),r(e,"class","my-2")},m(y,T){$(y,e,T),s(e,l),s(l,n),s(l,o),s(l,u),s(l,c),s(l,f),s(l,p),s(l,b),s(l,d),s(l,M)},p(y,T){T&2&&i!==(i=y[1].upgrade.t+"")&&X(o,i),T&2&&a!==(a=y[1].version+"")&&X(c,a),T&2&&_!==(_=y[1].upgrade.x+"")&&X(p,_),T&2&&v!==(v=y[1].upgrade.e+"")&&X(d,v)},d(y){y&&C(e)}}}function qf(t){let e,l,n,i=t[2].tag_name+"",o,u,a,c,f,_,p=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[2]&&t[2].tag_name!=t[1].version&&Bf(t),b=t[1].fwconsent===2&&Uf();return{c(){e=m("div"),l=S(`Latest version: