From 64870cf9ca2da5f990e199fd05c0e59930da0b8c Mon Sep 17 00:00:00 2001 From: Gunnar Skjold Date: Mon, 25 Dec 2023 19:43:25 +0100 Subject: [PATCH] Adjustments to export plot color --- lib/SvelteUi/app/dist/index.js | 2 +- lib/SvelteUi/app/src/lib/DayPlot.svelte | 4 ++-- lib/SvelteUi/app/src/lib/MonthPlot.svelte | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/SvelteUi/app/dist/index.js b/lib/SvelteUi/app/dist/index.js index 46d8f4ba..33383005 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 pe(){}function ol(t,e){for(const l in e)t[l]=e[l];return t}function oc(t){return t()}function pa(){return Object.create(null)}function ze(t){t.forEach(oc)}function so(t){return typeof t=="function"}function Ee(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let rs;function Ws(t,e){return rs||(rs=document.createElement("a")),rs.href=e,t===rs.href}function s1(t){return Object.keys(t).length===0}function oo(t,...e){if(t==null)return pe;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function li(t){let e;return oo(t,l=>e=l)(),e}function pl(t,e,l){t.$$.on_destroy.push(oo(e,l))}function ro(t,e,l,n){if(t){const i=rc(t,e,l,n);return t[0](i)}}function rc(t,e,l,n){return t[1]&&n?ol(l.ctx.slice(),t[1](n(e))):l.ctx}function ao(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 wi(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 r1=["width","height"];function ni(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&&r1.indexOf(n)===-1?t[n]=e[n]:r(t,n,e[n])}function ge(t){return t===""?null:+t}function a1(t){return Array.from(t.childNodes)}function J(t,e){e=""+e,t.data!==e&&(t.data=e)}function u1(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function f1(t,e,l){~o1.indexOf(l)?u1(t,e):J(t,e)}function oe(t,e){t.value=e==null?"":e}function co(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function $e(t,e,l){for(let n=0;n{u.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=te(n.contentWindow,"resize",e),e()}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),$(n)}}function m1(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}function da(t,e){return new t(e)}let ki;function bi(t){ki=t}function yi(){if(!ki)throw new Error("Function called outside component initialization");return ki}function ac(t){yi().$$.on_mount.push(t)}function _1(t){yi().$$.on_destroy.push(t)}function p1(){const t=yi();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=m1(e,l,{cancelable:n});return i.slice().forEach(u=>{u.call(t,o)}),!o.defaultPrevented}return!0}}function gi(t,e){return yi().$$.context.set(t,e),e}function Ul(t){return yi().$$.context.get(t)}const xn=[],ps=[];let ei=[];const va=[],uc=Promise.resolve();let zs=!1;function fc(){zs||(zs=!0,uc.then(cc))}function d1(){return fc(),uc}function We(t){ei.push(t)}const Fs=new Set;let Zn=0;function cc(){if(Zn!==0)return;const t=ki;do{try{for(;Znt.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),ei=e}const cs=new Set;let sn;function Ae(){sn={r:0,c:[],p:sn}}function Pe(){sn.r||ze(sn.c),sn=sn.p}function I(t,e){t&&t.i&&(cs.delete(t),t.i(e))}function q(t,e,l,n){if(t&&t.o){if(cs.has(t))return;cs.add(t),sn.c.push(()=>{cs.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function mc(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 m in u)m in a||(n[m]=1);for(const m in a)i[m]||(l[m]=a[m],i[m]=1);t[o]=a}else for(const m in u)i[m]=1}for(const u in n)u in l||(l[u]=void 0);return l}function ha(t){return typeof t=="object"&&t!==null?t:{}}function re(t){t&&t.c()}function ie(t,e,l,n){const{fragment:i,after_update:o}=t.$$;i&&i.m(e,l),n||We(()=>{const u=t.$$.on_mount.map(oc).filter(so);t.$$.on_destroy?t.$$.on_destroy.push(...u):ze(u),t.$$.on_mount=[]}),o.forEach(We)}function se(t,e){const l=t.$$;l.fragment!==null&&(h1(l.after_update),ze(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function b1(t,e){t.$$.dirty[0]===-1&&(xn.push(t),fc(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const d=v.length?v[0]:h;return f.ctx&&i(f.ctx[_],f.ctx[_]=d)&&(!f.skip_bound&&f.bound[_]&&f.bound[_](d),p&&b1(t,_)),h}):[],f.update(),p=!0,ze(f.before_update),f.fragment=n?n(f.ctx):!1,e.target){if(e.hydrate){const _=a1(e.target);f.fragment&&f.fragment.l(_),_.forEach($)}else f.fragment&&f.fragment.c();e.intro&&I(t.$$.fragment),ie(t,e.target,e.anchor,e.customElement),cc()}bi(m)}class Re{$destroy(){se(this,1),this.$destroy=pe}$on(e,l){if(!so(l))return pe;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&&!s1(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const ba=t=>typeof t>"u",_c=t=>typeof t=="function",pc=t=>typeof t=="number";function g1(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function dc(){let t=0;return()=>t++}function k1(){return Math.random().toString(36).substring(2)}const jl=typeof window>"u";function vc(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const hc=(t,e)=>t?{}:{style:e},Gs=t=>({"aria-hidden":"true",...hc(t,"display:none;")}),Jn=[];function bc(t,e){return{subscribe:it(t,e).subscribe}}function it(t,e=pe){let l;const n=new Set;function i(a){if(Ee(t,a)&&(t=a,l)){const m=!Jn.length;for(const f of n)f[1](),Jn.push(f,t);if(m){for(let f=0;f{n.delete(f),n.size===0&&l&&(l(),l=null)}}return{set:i,update:o,subscribe:u}}function w1(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,o=e.length<2;return bc(l,u=>{let a=!1;const m=[];let f=0,p=pe;const _=()=>{if(f)return;p();const v=e(n?m[0]:m,u);o?u(v):p=so(v)?v:pe},h=i.map((v,d)=>oo(v,g=>{m[d]=g,f&=~(1<{f|=1<`@@svnav-ctx__${t}`,Vs=Ci("LOCATION"),ii=Ci("ROUTER"),gc=Ci("ROUTE"),y1=Ci("ROUTE_PARAMS"),C1=Ci("FOCUS_ELEM"),kc=/^:(.+)/,di=(t,e,l)=>t.substr(e,l),Ks=(t,e)=>di(t,0,e.length)===e,$1=t=>t==="",S1=t=>kc.test(t),wc=t=>t[0]==="*",M1=t=>t.replace(/\*.*$/,""),yc=t=>t.replace(/(^\/+|\/+$)/g,"");function vl(t,e=!1){const l=yc(t).split("/");return e?l.filter(Boolean):l}const qs=(t,e)=>t+(e?`?${e}`:""),_o=t=>`/${yc(t)}`;function $i(...t){const e=n=>vl(n,!0).join("/"),l=t.map(e).join("/");return _o(l)}const po=1,bs=2,cn=3,T1=4,Cc=5,N1=6,$c=7,E1=8,A1=9,Sc=10,Mc=11,P1={[po]:"Link",[bs]:"Route",[cn]:"Router",[T1]:"useFocus",[Cc]:"useLocation",[N1]:"useMatch",[$c]:"useNavigate",[E1]:"useParams",[A1]:"useResolvable",[Sc]:"useResolve",[Mc]:"navigate"},vo=t=>P1[t];function D1(t,e){let l;return t===bs?l=e.path?`path="${e.path}"`:"default":t===po?l=`to="${e.to}"`:t===cn&&(l=`basepath="${e.basepath||""}"`),`<${vo(t)} ${l||""} />`}function L1(t,e,l,n){const i=l&&D1(n||t,l),o=i?` Occurred in: ${i}`:"",u=vo(t),a=_c(e)?e(u):e;return`<${u}> ${a}${o}`}const Tc=t=>(...e)=>t(L1(...e)),Nc=Tc(t=>{throw new Error(t)}),ds=Tc(console.warn),ga=4,R1=3,I1=2,O1=1,F1=1;function q1(t,e){const l=t.default?0:vl(t.fullPath).reduce((n,i)=>{let o=n;return o+=ga,$1(i)?o+=F1:S1(i)?o+=I1:wc(i)?o-=ga+O1:o+=R1,o},0);return{route:t,score:l,index:e}}function B1(t){return t.map(q1).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function Ec(t,e){let l,n;const[i]=e.split("?"),o=vl(i),u=o[0]==="",a=B1(t);for(let m=0,f=a.length;m({...p,params:h,uri:D});if(p.default){n=v(e);continue}const d=vl(p.fullPath),g=Math.max(o.length,d.length);let w=0;for(;w{f===".."?m.pop():f!=="."&&m.push(f)}),qs(`/${m.join("/")}`,n)}function ka(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,u=vl(e,!0),a=vl(l,!0);for(;u.length;)u[0]!==a[0]&&Nc(cn,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),u.shift(),a.shift();return{pathname:$i(...a),hash:n,search:i,state:o}}const wa=t=>t.length===1?"":t,ho=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?wa(di(t,l)):"",u=i?di(t,0,l):t,a=n?wa(di(u,e)):"";return{pathname:(n?di(u,0,e):u)||"/",search:a,hash:o}},j1=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function H1(t,e,l){return $i(l,U1(t,e))}function W1(t,e){const l=_o(M1(t)),n=vl(l,!0),i=vl(e,!0).slice(0,n.length),o=Ac({fullPath:l},$i(...i));return o&&o.uri}const Bs="POP",z1="PUSH",G1="REPLACE";function Us(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function V1(t){let e=[],l=Us(t),n=Bs;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=Us(t),n=Bs,i([o])};i([o]);const a=vc(t,"popstate",u);return()=>{a(),e=e.filter(m=>m!==o)}},navigate(o,u){const{state:a={},replace:m=!1}=u||{};if(n=m?G1:z1,pc(o))u&&ds(Mc,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=Bs,t.history.go(o);else{const f={...a,_key:k1()};try{t.history[m?"replaceState":"pushState"](f,"",o)}catch{t.location[m?"replace":"assign"](o)}}l=Us(t),i()}}}function js(t,e){return{...ho(e),state:t}}function K1(t="/"){let e=0,l=[js(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(js(n,o))},replaceState(n,i,o){l[e]=js(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const Y1=!!(!jl&&window.document&&window.document.createElement),Q1=!jl&&window.location.origin==="null",Pc=V1(Y1&&!Q1?window:K1()),{navigate:fn}=Pc;let Sl=null,Dc=!0;function X1(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;nSl.level||t.level===Sl.level&&X1(t.routerId,Sl.routerId))&&(Sl=t)}function J1(){Sl=null}function x1(){Dc=!1}function ya(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=vc(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function e0(t,e){return Number(t.dataset.svnavRouteEnd)===e}function t0(t){return/^H[1-6]$/i.test(t.tagName)}function Ca(t,e=document){return e.querySelector(t)}function l0(t){let l=Ca(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!e0(l,t);){if(t0(l))return l;const n=Ca("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function n0(t){Promise.resolve(li(t.focusElement)).then(e=>{const l=e||l0(t.id);l||ds(cn,`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,bs),!ya(l)&&ya(document.documentElement)})}const i0=(t,e,l)=>(n,i)=>d1().then(()=>{if(!Sl||Dc){x1();return}if(n&&n0(Sl.route),t.announcements&&i){const{path:o,fullPath:u,meta:a,params:m,uri:f}=Sl.route,p=t.createAnnouncement({path:o,fullPath:u,meta:a,params:m,uri:f},li(l));Promise.resolve(p).then(_=>{e.set(_)})}J1()}),s0="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 o0(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},hc(t[6],s0)],i={};for(let o=0;o`Navigated to ${ee.uri}`,announcements:!0,...d},D=p,M=_o(p),E=Ul(Vs),R=Ul(ii),O=!E,F=a0(),y=v&&!(R&&!R.manageFocus),P=it("");pl(t,P,ee=>l(0,a=ee));const ne=R?R.disableInlineStyles:g,H=it([]);pl(t,H,ee=>l(20,u=ee));const z=it(null);pl(t,z,ee=>l(18,i=ee));let U=!1;const K=O?0:R.level+1,G=O?it((()=>ka(jl?ho(_):h.location,M))()):E;pl(t,G,ee=>l(17,n=ee));const X=it(n);pl(t,X,ee=>l(19,o=ee));const Y=i0(w,P,G),j=ee=>V=>V.filter(W=>W.id!==ee);function x(ee){if(jl){if(U)return;const V=Ac(ee,n.pathname);if(V)return U=!0,V}else H.update(V=>{const W=j(ee.id)(V);return W.push(ee),W})}function ae(ee){H.update(j(ee))}return!O&&p!==$a&&ds(cn,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:p}),O&&(ac(()=>h.listen(V=>{const W=ka(V.location,M);X.set(n),G.set(W)})),gi(Vs,G)),gi(ii,{activeRoute:z,registerRoute:x,unregisterRoute:ae,manageFocus:y,level:K,id:F,history:O?h:R.history,basepath:O?M:R.basepath,disableInlineStyles:ne}),t.$$set=ee=>{"basepath"in ee&&l(11,p=ee.basepath),"url"in ee&&l(12,_=ee.url),"history"in ee&&l(13,h=ee.history),"primary"in ee&&l(14,v=ee.primary),"a11y"in ee&&l(15,d=ee.a11y),"disableInlineStyles"in ee&&l(16,g=ee.disableInlineStyles),"$$scope"in ee&&l(21,f=ee.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&p!==D&&ds(cn,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const ee=Ec(u,n.pathname);z.set(ee)}if(t.$$.dirty[0]&655360&&O){const ee=!!n.hash,V=!ee&&y,W=!ee||n.pathname!==o.pathname;Y(V,W)}t.$$.dirty[0]&262144&&y&&i&&i.primary&&Z1({level:K,routerId:F,route:i})},[a,w,O,F,y,P,ne,H,z,G,X,p,_,h,v,d,g,n,i,o,u,f,m]}class f0 extends Re{constructor(e){super(),Le(this,e,u0,r0,Ee,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const Lc=f0;function Si(t,e,l=ii,n=cn){Ul(l)||Nc(t,o=>`You cannot use ${o} outside of a ${vo(n)}.`,e)}const c0=t=>{const{subscribe:e}=Ul(t);return{subscribe:e}};function Rc(){return Si(Cc),c0(Vs)}function Ic(){const{history:t}=Ul(ii);return t}function Oc(){const t=Ul(gc);return t?w1(t,e=>e.base):it("/")}function Fc(){Si(Sc);const t=Oc(),{basepath:e}=Ul(ii);return n=>H1(n,li(t),e)}function m0(){Si($c);const t=Fc(),{navigate:e}=Ic();return(n,i)=>{const o=pc(n)?n:t(n);return e(o,i)}}const _0=t=>({params:t&16,location:t&8}),Sa=t=>({params:jl?li(t[10]):t[4],location:t[3],navigate:t[11]});function Ma(t){let e,l;return e=new Lc({props:{primary:t[1],$$slots:{default:[v0]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(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||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function p0(t){let e;const l=t[18].default,n=ro(l,t,t[19],Sa);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&uo(n,l,i,i[19],e?ao(l,i[19],o,_0):fo(i[19]),Sa)},i(i){e||(I(n,i),e=!0)},o(i){q(n,i),e=!1},d(i){n&&n.d(i)}}}function d0(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},jl?li(t[10]):t[4],t[12]];var o=t[0];function u(a){let m={};for(let f=0;f{se(p,1)}),Pe()}o?(e=da(o,u()),re(e.$$.fragment),I(e.$$.fragment,1),ie(e,l.parentNode,l)):e=null}else o&&e.$set(f)},i(a){n||(e&&I(e.$$.fragment,a),n=!0)},o(a){e&&q(e.$$.fragment,a),n=!1},d(a){a&&$(l),e&&se(e,a)}}}function v0(t){let e,l,n,i;const o=[d0,p0],u=[];function a(m,f){return m[0]!==null?0:1}return e=a(t),l=u[e]=o[e](t),{c(){l.c(),n=Ke()},m(m,f){u[e].m(m,f),S(m,n,f),i=!0},p(m,f){let p=e;e=a(m),e===p?u[e].p(m,f):(Ae(),q(u[p],1,1,()=>{u[p]=null}),Pe(),l=u[e],l?l.p(m,f):(l=u[e]=o[e](m),l.c()),I(l,1),l.m(n.parentNode,n))},i(m){i||(I(l),i=!0)},o(m){q(l),i=!1},d(m){u[e].d(m),m&&$(n)}}}function h0(t){let e,l,n,i,o,u=[Gs(t[7]),{"data-svnav-route-start":t[5]}],a={};for(let _=0;_{m=null}),Pe())},i(_){o||(I(m),o=!0)},o(_){q(m),o=!1},d(_){_&&$(e),_&&$(l),m&&m.d(_),_&&$(n),_&&$(i)}}}const b0=dc();function g0(t,e,l){let n;const i=["path","component","meta","primary"];let o=_s(e,i),u,a,m,f,{$$slots:p={},$$scope:_}=e,{path:h=""}=e,{component:v=null}=e,{meta:d={}}=e,{primary:g=!0}=e;Si(bs,e);const w=b0(),{registerRoute:D,unregisterRoute:M,activeRoute:E,disableInlineStyles:R}=Ul(ii);pl(t,E,U=>l(16,u=U));const O=Oc();pl(t,O,U=>l(17,m=U));const F=Rc();pl(t,F,U=>l(3,a=U));const y=it(null);let P;const ne=it(),H=it({});pl(t,H,U=>l(4,f=U)),gi(gc,ne),gi(y1,H),gi(C1,y);const z=m0();return jl||_1(()=>M(w)),t.$$set=U=>{l(24,e=ol(ol({},e),ms(U))),l(12,o=_s(e,i)),"path"in U&&l(13,h=U.path),"component"in U&&l(0,v=U.component),"meta"in U&&l(14,d=U.meta),"primary"in U&&l(1,g=U.primary),"$$scope"in U&&l(19,_=U.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const U=h==="",K=$i(m,h),Q={id:w,path:h,meta:d,default:U,fullPath:U?"":K,base:U?m:W1(K,a.pathname),primary:g,focusElement:y};ne.set(Q),l(15,P=D(Q))}if(t.$$.dirty&98304&&l(2,n=!!(P||u&&u.id===w)),t.$$.dirty&98308&&n){const{params:U}=P||u;H.set(U)}},e=ms(e),[v,g,n,a,f,w,E,R,O,F,H,z,o,h,d,P,u,m,p,_]}class k0 extends Re{constructor(e){super(),Le(this,e,g0,h0,Ee,{path:13,component:0,meta:14,primary:1})}}const ml=k0;function w0(t){let e,l,n,i;const o=t[13].default,u=ro(o,t,t[12],null);let a=[{href:t[0]},t[2],t[1]],m={};for(let f=0;fl(11,_=y));const E=p1(),R=Fc(),{navigate:O}=Ic();function F(y){E("click",y),g1(y)&&(y.preventDefault(),O(n,{state:w,replace:u||g}))}return t.$$set=y=>{l(19,e=ol(ol({},e),ms(y))),l(18,p=_s(e,f)),"to"in y&&l(5,d=y.to),"replace"in y&&l(6,g=y.replace),"state"in y&&l(7,w=y.state),"getProps"in y&&l(8,D=y.getProps),"$$scope"in y&&l(12,v=y.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=R(d,_)),t.$$.dirty&2049&&l(10,i=Ks(_.pathname,n)),t.$$.dirty&2049&&l(9,o=n===_.pathname),t.$$.dirty&2049&&(u=ho(n)===j1(_)),t.$$.dirty&512&&l(2,a=o?{"aria-current":"page"}:{}),l(1,m=(()=>{if(_c(D)){const y=D({location:_,href:n,isPartiallyCurrent:i,isCurrent:o});return{...p,...y}}return p})())},e=ms(e),[n,m,a,M,F,d,g,w,D,o,i,_,v,h]}class C0 extends Re{constructor(e){super(),Le(this,e,y0,w0,Ee,{to:5,replace:6,state:7,getProps:8})}}const Qt=C0;let Ys=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Bl(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function $0(t,e){return e?t>218&&t<242?"#32c000":t>212&&t<248?"#b1c000":t>208&&t<252?"#ffa000":"#d90000":t>218&&t<242?"#32d900":t>212&&t<248?"#b1d900":t>208&&t<252?"#ffb800":"#d90000"}function qc(t,e){let l;return e?t>90?l="#d90000":t>85?l="#e31000":t>80?l="#ffa900":t>75?l="#dcc300":l="#32c500":t>90?l="#d90000":t>85?l="#e32100":t>80?l="#ffb800":t>75?l="#dcd800":l="#32d900",l}function S0(t){return t>75?"#32d900":t>50?"#77d900":t>25?"#94d900":"#dcd800"}function vs(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 Ue(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function he(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 241:return"LilyGO T-ETH-POE";case 242:return"M5 PoESP32";case 243:return"WT32-ETH01";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";case 80:return"Generic ESP32-S3"}}function Ta(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 Na(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 Ea(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 Aa(t){switch(t){case 255:return"Unable to start upgrade";case-1:return"Connection refused";case-2:return"Failed to send headers";case-3:return"Failed to send payload";case-4:return"Not connected";case-5:return"Connection lost";case-6:return"No stream";case-7:return"Not a HTTP server";case-8:return"Not enough memory";case-9:return"Encoding error";case-10:return"Stream write";case-11:return"Read timeout"}return"Unknown "+t}function ti(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Xe(t,e){return t==1||t==2&&e}function Rt(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function ke(t,e){return isNaN(t)?"-":(isNaN(e)&&(e=t<10?1:0),t.toFixed(e))}function dl(t,e){return t.setTime(t.getTime()+e*36e5),t}function Pa(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 Da(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energi Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}function La(t){return t=="EOE"?"https://transparency.entsoe.eu/-E":t=="HKS"?"https://www.hvakosterstrommen.no/":t=="EDS"?"https://www.energidataservice.dk/":"#"}async function Ml(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 _l={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,if:{eth:!1}};const Wt=it(_l);async function bo(){_l=await(await Ml("/sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),Wt.set(_l)}let us=0,Ra=-127,Ia=null,M0={};const Bc=bc(M0,t=>{let e;async function l(){Ml("/data.json").then(n=>n.json()).then(n=>{t(n),Ra!=n.t&&(Ra=n.t,setTimeout(zc,2e3)),Ia==null&&n.pe&&n.p!=null&&(Ia=n.p,jc()),_l.upgrading?window.location.reload():(!_l||!_l.chip||_l.booting||us>1&&!ti(_l.board))&&(bo(),on&&clearTimeout(on),on=setTimeout(ko,2e3),rn&&clearTimeout(rn),rn=setTimeout(wo,3e3));let i=5e3;if(ti(_l.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),us=0}).catch(n=>{us++,us>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(l,15e3)):e=setTimeout(l,ti(_l.board)?1e4:5e3)})}return l(),function(){clearTimeout(e)}});let Qs={},vi;const go=it(Qs);async function Uc(){let t=!1;if(go.update(e=>{for(var l=0;l<36;l++){if(e[Ue(l)]==null){t=l<12;break}e[Ue(l)]=e[Ue(l+1)]}return e}),t)jc();else{let e=new Date;vi=setTimeout(Uc,(60-e.getMinutes())*6e4)}}async function jc(){vi&&(clearTimeout(vi),vi=0),Qs=await(await Ml("/energyprice.json")).json(),go.set(Qs);let e=new Date;vi=setTimeout(Uc,(60-e.getMinutes())*6e4)}let Xs={},on;async function ko(){on&&(clearTimeout(on),on=0),Xs=await(await Ml("/dayplot.json")).json(),Hc.set(Xs);let e=new Date;on=setTimeout(ko,(60-e.getMinutes())*6e4+20)}const Hc=it(Xs,t=>(ko(),function(){}));let Zs={},rn;async function wo(){rn&&(clearTimeout(rn),rn=0),Zs=await(await Ml("/monthplot.json")).json(),Wc.set(Zs);let e=new Date;rn=setTimeout(wo,(24-e.getHours())*36e5+40)}const Wc=it(Zs,t=>(wo(),function(){}));let Js={};async function zc(){Js=await(await Ml("/temperature.json")).json(),Gc.set(Js)}const Gc=it(Js,t=>(zc(),function(){}));let xs={},fs;async function Vc(){fs&&(clearTimeout(fs),fs=0),xs=await(await Ml("/tariff.json")).json(),Kc.set(xs);let e=new Date;fs=setTimeout(Vc,(60-e.getMinutes())*6e4+30)}const Kc=it(xs,t=>function(){});let eo=[];const yo=it(eo);async function T0(){eo=await(await Ml("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),yo.set(eo)}let to={};async function N0(){to=await(await Ml("/realtime.json")).json(),Yc.set(to)}const Yc=it(to,t=>(N0(),function(){}));function hs(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 Qc(t){await(await fetch("/upgrade?expected_version="+t,{method:"POST"})).json()}function Xc(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,m,f;for(let p=0;po&&(a=_):g==i+1&&(m=_);else if(d==n+1)if(f){let D=f.tag_name.substring(1).split(".");parseInt(D[0]);let M=parseInt(D[1]);parseInt(D[2]),g==M&&(f=_)}else f=_}return m||f||a||!1}else return e[0]}const E0="/github.svg";function Oa(t){let e,l;function n(u,a){return u[1]>1?O0:u[1]>0?I0:u[2]>1?R0:u[2]>0?L0:u[3]>1?D0:u[3]>0?P0:A0}let i=n(t),o=i(t);return{c(){e=N(`Up - `),o.c(),l=Ke()},m(u,a){S(u,e,a),o.m(u,a),S(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&&$(e),o.d(u),u&&$(l)}}}function A0(t){let e,l;return{c(){e=N(t[0]),l=N(" seconds")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&1&&J(e,n[0])},d(n){n&&$(e),n&&$(l)}}}function P0(t){let e,l;return{c(){e=N(t[3]),l=N(" minute")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&8&&J(e,n[3])},d(n){n&&$(e),n&&$(l)}}}function D0(t){let e,l;return{c(){e=N(t[3]),l=N(" minutes")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&8&&J(e,n[3])},d(n){n&&$(e),n&&$(l)}}}function L0(t){let e,l;return{c(){e=N(t[2]),l=N(" hour")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&4&&J(e,n[2])},d(n){n&&$(e),n&&$(l)}}}function R0(t){let e,l;return{c(){e=N(t[2]),l=N(" hours")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&4&&J(e,n[2])},d(n){n&&$(e),n&&$(l)}}}function I0(t){let e,l;return{c(){e=N(t[1]),l=N(" day")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&2&&J(e,n[1])},d(n){n&&$(e),n&&$(l)}}}function O0(t){let e,l;return{c(){e=N(t[1]),l=N(" days")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&2&&J(e,n[1])},d(n){n&&$(e),n&&$(l)}}}function F0(t){let e,l=t[0]&&Oa(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),S(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Oa(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:pe,o:pe,d(n){l&&l.d(n),n&&$(e)}}}function q0(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 B0 extends Re{constructor(e){super(),Le(this,e,q0,F0,Ee,{epoch:0})}}function U0(t){let e,l,n;return{c(){e=c("span"),l=N(t[2]),r(e,"title",t[1]),r(e,"class",n="bd-"+t[0])},m(i,o){S(i,e,o),s(e,l)},p(i,[o]){o&4&&J(l,i[2]),o&2&&r(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&r(e,"class",n)},i:pe,o:pe,d(i){i&&$(e)}}}function j0(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 an extends Re{constructor(e){super(),Le(this,e,j0,U0,Ee,{color:0,title:1,text:2})}}function H0(t){let e,l=`${Ue(t[0].getDate())}.${Ue(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Ue(t[0].getHours())}:${Ue(t[0].getMinutes())}`,n;return{c(){e=c("span"),n=N(l),r(e,"class",t[1])},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Ue(i[0].getDate())}.${Ue(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Ue(i[0].getHours())}:${Ue(i[0].getMinutes())}`)&&J(n,l),o&2&&r(e,"class",i[1])},d(i){i&&$(e)}}}function W0(t){let e=`${Ue(t[0].getDate())}. ${Ys[t[0].getMonth()]} ${Ue(t[0].getHours())}:${Ue(t[0].getMinutes())}`,l;return{c(){l=N(e)},m(n,i){S(n,l,i)},p(n,i){i&1&&e!==(e=`${Ue(n[0].getDate())}. ${Ys[n[0].getMonth()]} ${Ue(n[0].getHours())}:${Ue(n[0].getMinutes())}`)&&J(l,e)},d(n){n&&$(l)}}}function z0(t){let e;function l(o,u){return o[2]?W0:H0}let n=l(t),i=n(t);return{c(){i.c(),e=Ke()},m(o,u){i.m(o,u),S(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:pe,o:pe,d(o){i.d(o),o&&$(e)}}}function G0(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)||dl(n,o-(24+n.getHours()-n.getUTCHours())%24))},[n,i,u,o]}class Zc extends Re{constructor(e){super(),Le(this,e,G0,z0,Ee,{timestamp:0,fullTimeColor:1,offset:3})}}function V0(t){let e,l,n;return{c(){e=De("svg"),l=De("path"),n=De("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){S(i,e,o),s(e,l),s(e,n)},p:pe,i:pe,o:pe,d(i){i&&$(e)}}}class K0 extends Re{constructor(e){super(),Le(this,e,null,V0,Ee,{})}}function Y0(t){let e,l;return{c(){e=De("svg"),l=De("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){S(n,e,i),s(e,l)},p:pe,i:pe,o:pe,d(n){n&&$(e)}}}class Q0 extends Re{constructor(e){super(),Le(this,e,null,Y0,Ee,{})}}function X0(t){let e,l;return{c(){e=De("svg"),l=De("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){S(n,e,i),s(e,l)},p:pe,i:pe,o:pe,d(n){n&&$(e)}}}class Lt extends Re{constructor(e){super(),Le(this,e,null,X0,Ee,{})}}function Z0(t){let e,l;return{c(){e=De("svg"),l=De("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){S(n,e,i),s(e,l)},p:pe,i:pe,o:pe,d(n){n&&$(e)}}}class Jc extends Re{constructor(e){super(),Le(this,e,null,Z0,Ee,{})}}function J0(t){let e,l,n=t[1].version+"",i;return{c(){e=N("AMS reader "),l=c("span"),i=N(n)},m(o,u){S(o,e,u),S(o,l,u),s(l,i)},p(o,u){u&2&&n!==(n=o[1].version+"")&&J(i,n)},d(o){o&&$(e),o&&$(l)}}}function Fa(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=c("div"),n=N(l),i=N("\xB0C"),r(e,"class","flex-none my-auto")},m(o,u){S(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):"-")+"")&&J(n,l)},d(o){o&&$(e)}}}function qa(t){let e,l="HAN: "+Ta(t[0].he),n;return{c(){e=c("div"),n=N(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="HAN: "+Ta(i[0].he))&&J(n,l)},d(i){i&&$(e)}}}function Ba(t){let e,l="MQTT: "+Na(t[0].me),n;return{c(){e=c("div"),n=N(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="MQTT: "+Na(i[0].me))&&J(n,l)},d(i){i&&$(e)}}}function Ua(t){let e,l="Price service: "+Ea(t[0].ee),n;return{c(){e=c("div"),n=N(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="Price service: "+Ea(i[0].ee))&&J(n,l)},d(i){i&&$(e)}}}function ja(t){let e,l,n,i,o,u;return l=new Qt({props:{to:"/configuration",$$slots:{default:[x0]},$$scope:{ctx:t}}}),o=new Qt({props:{to:"/status",$$slots:{default:[em]},$$scope:{ctx:t}}}),{c(){e=c("div"),re(l.$$.fragment),n=b(),i=c("div"),re(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,m){S(a,e,m),ie(l,e,null),S(a,n,m),S(a,i,m),ie(o,i,null),u=!0},i(a){u||(I(l.$$.fragment,a),I(o.$$.fragment,a),u=!0)},o(a){q(l.$$.fragment,a),q(o.$$.fragment,a),u=!1},d(a){a&&$(e),se(l),a&&$(n),a&&$(i),se(o)}}}function x0(t){let e,l;return e=new K0({}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function em(t){let e,l;return e=new Q0({}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function Ha(t){let e,l,n,i,o;const u=[lm,tm],a=[];function m(f,p){return f[1].security==0||f[0].a?0:1}return l=m(t),n=a[l]=u[l](t),{c(){e=c("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,p){S(f,e,p),a[l].m(e,null),o=!0},p(f,p){let _=l;l=m(f),l===_?a[l].p(f,p):(Ae(),q(a[_],1,1,()=>{a[_]=null}),Pe(),n=a[l],n?n.p(f,p):(n=a[l]=u[l](f),n.c()),I(n,1),n.m(e,null)),(!o||p&4&&i!==(i="New version: "+f[2].tag_name))&&r(e,"title",i)},i(f){o||(I(n),o=!0)},o(f){q(n),o=!1},d(f){f&&$(e),a[l].d()}}}function tm(t){let e,l,n=t[2].tag_name+"",i;return{c(){e=c("span"),l=N("New version: "),i=N(n)},m(o,u){S(o,e,u),s(e,l),s(e,i)},p(o,u){u&4&&n!==(n=o[2].tag_name+"")&&J(i,n)},i:pe,o:pe,d(o){o&&$(e)}}}function lm(t){let e,l,n,i=t[2].tag_name+"",o,u,a,m,f,p;return a=new Jc({}),{c(){e=c("button"),l=c("span"),n=N("New version: "),o=N(i),u=b(),re(a.$$.fragment),r(l,"class","mt-1"),r(e,"class","flex")},m(_,h){S(_,e,h),s(e,l),s(l,n),s(l,o),s(e,u),ie(a,e,null),m=!0,f||(p=te(e,"click",t[3]),f=!0)},p(_,h){(!m||h&4)&&i!==(i=_[2].tag_name+"")&&J(o,i)},i(_){m||(I(a.$$.fragment,_),m=!0)},o(_){q(a.$$.fragment,_),m=!1},d(_){_&&$(e),se(a),f=!1,p()}}}function nm(t){let e,l,n,i,o,u,a,m,f,p,_,h,v=(t[0].m?(t[0].m/1e3).toFixed(1):"-")+"",d,g,w,D,M,E,R,O,F,y,P,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Ie,Se;i=new Qt({props:{to:"/",$$slots:{default:[J0]},$$scope:{ctx:t}}}),m=new B0({props:{epoch:t[0].u}});let ye=t[0].t>-50&&Fa(t);M=new an({props:{title:"ESP",text:t[1].booting?"Booting":t[0].v>2?t[0].v.toFixed(2)+"V":"ESP",color:Bl(t[1].booting?2:t[0].em)}}),R=new an({props:{title:"HAN",text:"HAN",color:Bl(t[1].booting?9:t[0].hm)}}),F=new an({props:{title:"WiFi",text:t[0].r?t[0].r.toFixed(0)+"dBm":"WiFi",color:Bl(t[1].booting?9:t[0].wm)}}),P=new an({props:{title:"MQTT",text:"MQTT",color:Bl(t[1].booting?9:t[0].mm)}});let ve=(t[0].he<0||t[0].he>0)&&qa(t),Te=t[0].me<0&&Ba(t),be=(t[0].ee>0||t[0].ee<0)&&Ua(t);ae=new Zc({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),offset:t[1].clock_offset,fullTimeColor:"text-red-500"}});let T=t[1].vndcfg&&t[1].usrcfg&&ja(t);He=new Lt({});let C=t[1].fwconsent===1&&t[2]&&Ha(t);return{c(){e=c("nav"),l=c("div"),n=c("div"),re(i.$$.fragment),o=b(),u=c("div"),a=c("div"),re(m.$$.fragment),f=b(),ye&&ye.c(),p=b(),_=c("div"),h=N("Free mem: "),d=N(v),g=N("kb"),w=b(),D=c("div"),re(M.$$.fragment),E=b(),re(R.$$.fragment),O=b(),re(F.$$.fragment),y=b(),re(P.$$.fragment),ne=b(),ve&&ve.c(),H=b(),Te&&Te.c(),z=b(),be&&be.c(),U=b(),K=c("div"),Q=c("div"),G=c("a"),X=c("img"),j=b(),x=c("div"),re(ae.$$.fragment),ee=b(),T&&T.c(),V=b(),W=c("div"),we=c("a"),re(He.$$.fragment),Ie=b(),C&&C.c(),r(n,"class","flex text-lg text-gray-100 p-2"),r(a,"class","flex-none my-auto"),r(_,"class","flex-none my-auto"),r(u,"class","flex-none my-auto p-2 flex space-x-4"),r(D,"class","flex-auto flex-wrap my-auto justify-center p-2"),r(X,"class","gh-logo"),Ws(X.src,Y=E0)||r(X,"src",Y),r(X,"alt","GitHub repo"),r(G,"class","float-right"),r(G,"href","https://github.com/UtilitechAS/amsreader-firmware"),r(G,"target","_blank"),r(G,"rel","noreferrer"),r(G,"aria-label","GitHub"),r(Q,"class","flex-none"),r(x,"class","flex-none my-auto px-2"),r(we,"href",Rt("")),r(we,"target","_blank"),r(we,"rel","noreferrer"),r(W,"class","flex-none px-1 mt-1"),r(W,"title","Documentation"),r(K,"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","hdr")},m(k,A){S(k,e,A),s(e,l),s(l,n),ie(i,n,null),s(l,o),s(l,u),s(u,a),ie(m,a,null),s(u,f),ye&&ye.m(u,null),s(u,p),s(u,_),s(_,h),s(_,d),s(_,g),s(l,w),s(l,D),ie(M,D,null),s(D,E),ie(R,D,null),s(D,O),ie(F,D,null),s(D,y),ie(P,D,null),s(l,ne),ve&&ve.m(l,null),s(l,H),Te&&Te.m(l,null),s(l,z),be&&be.m(l,null),s(l,U),s(l,K),s(K,Q),s(Q,G),s(G,X),s(K,j),s(K,x),ie(ae,x,null),s(K,ee),T&&T.m(K,null),s(K,V),s(K,W),s(W,we),ie(He,we,null),s(K,Ie),C&&C.m(K,null),Se=!0},p(k,[A]){const L={};A&18&&(L.$$scope={dirty:A,ctx:k}),i.$set(L);const Z={};A&1&&(Z.epoch=k[0].u),m.$set(Z),k[0].t>-50?ye?ye.p(k,A):(ye=Fa(k),ye.c(),ye.m(u,p)):ye&&(ye.d(1),ye=null),(!Se||A&1)&&v!==(v=(k[0].m?(k[0].m/1e3).toFixed(1):"-")+"")&&J(d,v);const le={};A&3&&(le.text=k[1].booting?"Booting":k[0].v>2?k[0].v.toFixed(2)+"V":"ESP"),A&3&&(le.color=Bl(k[1].booting?2:k[0].em)),M.$set(le);const fe={};A&3&&(fe.color=Bl(k[1].booting?9:k[0].hm)),R.$set(fe);const de={};A&1&&(de.text=k[0].r?k[0].r.toFixed(0)+"dBm":"WiFi"),A&3&&(de.color=Bl(k[1].booting?9:k[0].wm)),F.$set(de);const Ce={};A&3&&(Ce.color=Bl(k[1].booting?9:k[0].mm)),P.$set(Ce),k[0].he<0||k[0].he>0?ve?ve.p(k,A):(ve=qa(k),ve.c(),ve.m(l,H)):ve&&(ve.d(1),ve=null),k[0].me<0?Te?Te.p(k,A):(Te=Ba(k),Te.c(),Te.m(l,z)):Te&&(Te.d(1),Te=null),k[0].ee>0||k[0].ee<0?be?be.p(k,A):(be=Ua(k),be.c(),be.m(l,U)):be&&(be.d(1),be=null);const Oe={};A&1&&(Oe.timestamp=k[0].c?new Date(k[0].c*1e3):new Date(0)),A&2&&(Oe.offset=k[1].clock_offset),ae.$set(Oe),k[1].vndcfg&&k[1].usrcfg?T?A&2&&I(T,1):(T=ja(k),T.c(),I(T,1),T.m(K,V)):T&&(Ae(),q(T,1,1,()=>{T=null}),Pe()),k[1].fwconsent===1&&k[2]?C?(C.p(k,A),A&6&&I(C,1)):(C=Ha(k),C.c(),I(C,1),C.m(K,null)):C&&(Ae(),q(C,1,1,()=>{C=null}),Pe())},i(k){Se||(I(i.$$.fragment,k),I(m.$$.fragment,k),I(M.$$.fragment,k),I(R.$$.fragment,k),I(F.$$.fragment,k),I(P.$$.fragment,k),I(ae.$$.fragment,k),I(T),I(He.$$.fragment,k),I(C),Se=!0)},o(k){q(i.$$.fragment,k),q(m.$$.fragment,k),q(M.$$.fragment,k),q(R.$$.fragment,k),q(F.$$.fragment,k),q(P.$$.fragment,k),q(ae.$$.fragment,k),q(T),q(He.$$.fragment,k),q(C),Se=!1},d(k){k&&$(e),se(i),se(m),ye&&ye.d(),se(M),se(R),se(F),se(P),ve&&ve.d(),Te&&Te.d(),be&&be.d(),se(ae),T&&T.d(),se(He),C&&C.d()}}}function im(t,e,l){let{data:n={}}=e,i={},o={};function u(){confirm("Do you want to upgrade this device to "+o.tag_name+"?")&&(!ti(i.board)||confirm(hs(he(i.chip,i.board))))&&(Wt.update(a=>(a.upgrading=!0,a)),Qc(o.tag_name))}return Wt.subscribe(a=>{l(1,i=a),a.fwconsent===1&&T0()}),yo.subscribe(a=>{l(2,o=Xc(i.version,a))}),t.$$set=a=>{"data"in a&&l(0,n=a.data)},[n,i,o,u]}class sm extends Re{constructor(e){super(),Le(this,e,im,nm,Ee,{data:0})}}function om(t){let e,l,n,i;return{c(){e=De("svg"),l=De("path"),n=De("path"),r(l,"d",Hs(150,150,115,210,510)),r(l,"stroke","rgba(128, 128, 128, 0.15)"),r(l,"fill","none"),r(l,"stroke-width","55"),r(n,"d",i=Hs(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){S(o,e,u),s(e,l),s(e,n)},p(o,[u]){u&1&&i!==(i=Hs(150,150,115,210,210+300*o[0]/100))&&r(n,"d",i),u&2&&r(n,"stroke",o[1])},i:pe,o:pe,d(o){o&&$(e)}}}function Wa(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 Hs(t,e,l,n,i){var o=Wa(t,e,l,i),u=Wa(t,e,l,n),a=i-n<=180?"0":"1",m=["M",o.x,o.y,"A",l,l,0,a,0,u.x,u.y].join(" ");return m}function rm(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 am extends Re{constructor(e){super(),Le(this,e,rm,om,Ee,{pct:0,color:1})}}function za(t){let e,l,n,i,o,u,a,m;return{c(){e=c("br"),l=b(),n=c("span"),i=N(t[3]),o=b(),u=c("span"),a=N(t[4]),m=N("/kWh"),r(n,"class","pl-sub"),r(u,"class","pl-snt")},m(f,p){S(f,e,p),S(f,l,p),S(f,n,p),s(n,i),S(f,o,p),S(f,u,p),s(u,a),s(u,m)},p(f,p){p&8&&J(i,f[3]),p&16&&J(a,f[4])},d(f){f&&$(e),f&&$(l),f&&$(n),f&&$(o),f&&$(u)}}}function um(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w;l=new am({props:{pct:t[6],color:t[5](t[6],document.documentElement.classList.contains("dark"))}});let D=t[3]&&za(t);return{c(){e=c("div"),re(l.$$.fragment),n=b(),i=c("span"),o=c("span"),u=N(t[2]),a=b(),m=c("br"),f=b(),p=c("span"),_=N(t[0]),h=b(),v=c("span"),d=N(t[1]),g=b(),D&&D.c(),r(o,"class","pl-lab"),r(p,"class","pl-val"),r(v,"class","pl-unt"),r(i,"class","pl-ov"),r(e,"class","pl-root")},m(M,E){S(M,e,E),ie(l,e,null),s(e,n),s(e,i),s(i,o),s(o,u),s(i,a),s(i,m),s(i,f),s(i,p),s(p,_),s(i,h),s(i,v),s(v,d),s(i,g),D&&D.m(i,null),w=!0},p(M,[E]){const R={};E&64&&(R.pct=M[6]),E&96&&(R.color=M[5](M[6],document.documentElement.classList.contains("dark"))),l.$set(R),(!w||E&4)&&J(u,M[2]),(!w||E&1)&&J(_,M[0]),(!w||E&2)&&J(d,M[1]),M[3]?D?D.p(M,E):(D=za(M),D.c(),D.m(i,null)):D&&(D.d(1),D=null)},i(M){w||(I(l.$$.fragment,M),w=!0)},o(M){q(l.$$.fragment,M),w=!1},d(M){M&&$(e),se(l),D&&D.d()}}}function fm(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:u}=e,{sub:a=""}=e,{subunit:m=""}=e,{colorFn:f}=e,p=0;return t.$$set=_=>{"val"in _&&l(0,n=_.val),"max"in _&&l(7,i=_.max),"unit"in _&&l(1,o=_.unit),"label"in _&&l(2,u=_.label),"sub"in _&&l(3,a=_.sub),"subunit"in _&&l(4,m=_.subunit),"colorFn"in _&&l(5,f=_.colorFn)},t.$$.update=()=>{t.$$.dirty&129&&l(6,p=Math.min(n,i)/i*100)},[n,o,u,a,m,f,p,i]}class xc extends Re{constructor(e){super(),Le(this,e,fm,um,Ee,{val:0,max:7,unit:1,label:2,sub:3,subunit:4,colorFn:5})}}function Ga(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Va(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Ka(t,e,l){const n=t.slice();return n[15]=e[l],n}function Ya(t){let e,l,n,i,o,u,a=t[0].title&&Qa(t),m=t[0].y.ticks,f=[];for(let d=0;dt[9].call(e))},m(o,u){S(o,e,u),s(e,n),i=mo(e,t[9].bind(e))},p(o,u){u&1&&l!==(l=o[0].title+"")&&J(n,l)},d(o){o&&$(e),i()}}}function Xa(t){let e,l,n,i=t[15].label+"",o,u,a,m;return{c(){e=De("g"),l=De("line"),n=De("text"),o=N(i),r(l,"x2","100%"),r(n,"y","-4"),r(n,"x",u=t[15].align=="right"?"85%":""),r(e,"class",a="tick tick-"+t[15].value+" tick-"+t[15].color),r(e,"transform",m="translate(0, "+t[7](t[15].value)+")")},m(f,p){S(f,e,p),s(e,l),s(e,n),s(n,o)},p(f,p){p&1&&i!==(i=f[15].label+"")&&J(o,i),p&1&&u!==(u=f[15].align=="right"?"85%":"")&&r(n,"x",u),p&1&&a!==(a="tick tick-"+f[15].value+" tick-"+f[15].color)&&r(e,"class",a),p&129&&m!==(m="translate(0, "+f[7](f[15].value)+")")&&r(e,"transform",m)},d(f){f&&$(e)}}}function Za(t){let e=!isNaN(t[7](t[15].value)),l,n=e&&Xa(t);return{c(){n&&n.c(),l=Ke()},m(i,o){n&&n.m(i,o),S(i,l,o)},p(i,o){o&129&&(e=!isNaN(i[7](i[15].value))),e?n?n.p(i,o):(n=Xa(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&$(l)}}}function Ja(t){let e,l,n=(t[3]>20||t[13]%2==0)&&xa(t);return{c(){e=De("g"),n&&n.c(),r(e,"class","tick"),r(e,"transform",l="translate("+t[6](t[13])+","+t[4]+")")},m(i,o){S(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[13]%2==0?n?n.p(i,o):(n=xa(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&r(e,"transform",l)},d(i){i&&$(e),n&&n.d()}}}function xa(t){let e,l=t[11].label+"",n,i;return{c(){e=De("text"),n=N(l),r(e,"x",i=t[3]/2),r(e,"y","-4")},m(o,u){S(o,e,u),s(e,n)},p(o,u){u&1&&l!==(l=o[11].label+"")&&J(n,l),u&8&&i!==(i=o[3]/2)&&r(e,"x",i)},d(o){o&&$(e)}}}function eu(t){let e=!isNaN(t[6](t[13])),l,n=e&&Ja(t);return{c(){n&&n.c(),l=Ke()},m(i,o){n&&n.m(i,o),S(i,l,o)},p(i,o){o&64&&(e=!isNaN(i[6](i[13]))),e?n?n.p(i,o):(n=Ja(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&$(l)}}}function tu(t){let e,l,n=t[11].value!==void 0&&lu(t),i=t[11].value2>1e-4&&su(t);return{c(){e=De("g"),n&&n.c(),l=De("g"),i&&i.c()},m(o,u){S(o,e,u),n&&n.m(e,null),S(o,l,u),i&&i.m(l,null)},p(o,u){o[11].value!==void 0?n?n.p(o,u):(n=lu(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[11].value2>1e-4?i?i.p(o,u):(i=su(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&$(e),n&&n.d(),o&&$(l),i&&i.d()}}}function lu(t){let e,l,n,i,o,u,a,m=t[3]>15&&nu(t);return{c(){e=De("rect"),m&&m.c(),a=Ke(),r(e,"x",l=t[6](t[13])+2),r(e,"y",n=t[7](t[11].value)),r(e,"width",i=t[3]-4),r(e,"height",o=t[7](t[0].y.min)-t[7](Math.min(t[0].y.min,0)+t[11].value)),r(e,"fill",u=t[11].color)},m(f,p){S(f,e,p),m&&m.m(f,p),S(f,a,p)},p(f,p){p&64&&l!==(l=f[6](f[13])+2)&&r(e,"x",l),p&129&&n!==(n=f[7](f[11].value))&&r(e,"y",n),p&8&&i!==(i=f[3]-4)&&r(e,"width",i),p&129&&o!==(o=f[7](f[0].y.min)-f[7](Math.min(f[0].y.min,0)+f[11].value))&&r(e,"height",o),p&1&&u!==(u=f[11].color)&&r(e,"fill",u),f[3]>15?m?m.p(f,p):(m=nu(f),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},d(f){f&&$(e),m&&m.d(f),f&&$(a)}}}function nu(t){let e,l=t[11].label+"",n,i,o,u,a,m,f=t[11].title&&iu(t);return{c(){e=De("text"),n=N(l),f&&f.c(),m=Ke(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor",o=t[3]t[7](0)-t[8]?t[11].color:"white"),r(e,"transform",a="translate("+(t[6](t[13])+t[3]/2)+" "+(t[7](t[11].value)>t[7](0)-t[8]?t[7](t[11].value)-t[8]:t[7](t[11].value)+10)+") rotate("+(t[11].labelAngle?t[11].labelAngle:t[3]p[7](0)-p[8]?p[11].color:"white")&&r(e,"fill",u),_&457&&a!==(a="translate("+(p[6](p[13])+p[3]/2)+" "+(p[7](p[11].value)>p[7](0)-p[8]?p[7](p[11].value)-p[8]:p[7](p[11].value)+10)+") rotate("+(p[11].labelAngle?p[11].labelAngle:p[3]15&&ou(t);return{c(){e=De("rect"),m&&m.c(),a=Ke(),r(e,"x",l=t[6](t[13])+2),r(e,"y",n=t[7](0)),r(e,"width",i=t[3]-4),r(e,"height",o=t[7](t[0].y.min)-t[7](t[0].y.min+t[11].value2)),r(e,"fill",u=t[11].color2?t[11].color2:t[11].color)},m(f,p){S(f,e,p),m&&m.m(f,p),S(f,a,p)},p(f,p){p&64&&l!==(l=f[6](f[13])+2)&&r(e,"x",l),p&128&&n!==(n=f[7](0))&&r(e,"y",n),p&8&&i!==(i=f[3]-4)&&r(e,"width",i),p&129&&o!==(o=f[7](f[0].y.min)-f[7](f[0].y.min+f[11].value2))&&r(e,"height",o),p&1&&u!==(u=f[11].color2?f[11].color2:f[11].color)&&r(e,"fill",u),f[3]>15?m?m.p(f,p):(m=ou(f),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},d(f){f&&$(e),m&&m.d(f),f&&$(a)}}}function ou(t){let e,l=t[11].label2+"",n,i,o,u,a,m=t[11].title2&&ru(t);return{c(){e=De("text"),n=N(l),m&&m.c(),a=Ke(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor","middle"),r(e,"fill",o=t[7](-t[11].value2)t[10].call(e))},m(i,o){S(i,e,o),n&&n.m(e,null),l=mo(e,t[10].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=Ya(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:pe,o:pe,d(i){i&&$(e),n&&n.d(),l()}}}let un=30;function mm(t,e,l){let{config:n}=e,i,o,u,a,m,f,p,_=0;function h(){_=this.clientHeight,l(5,_)}function v(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=d=>{"config"in d&&l(0,n=d.config)},t.$$.update=()=>{if(t.$$.dirty&63){l(4,f=o-_);let d=i-(n.padding.left+n.padding.right);l(3,u=d/n.points.length),l(8,p=un.y.max?D=n.padding.bottom:wf||D<0?0:D})}},[n,i,o,u,f,_,a,m,p,h,v]}class mn extends Re{constructor(e){super(),Le(this,e,mm,cm,Ee,{config:0})}}function _m(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function pm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{ds:u}=e,a={};function m(f){return{label:ke(f)+"V",title:f.toFixed(1)+" V",value:isNaN(f)?0:f,color:$0(f||0,document.documentElement.classList.contains("dark"))}}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=[],p=[];n>0&&(f.push({label:u===1?"L1-L2":"L1"}),p.push(m(n))),i>0&&(f.push({label:u===1?"L1-L3":"L2"}),p.push(m(i))),o>0&&(f.push({label:u===1?"L2-L3":"L3"}),p.push(m(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:p})}},[a,n,i,o,u]}class dm extends Re{constructor(e){super(),Le(this,e,pm,_m,Ee,{u1:1,u2:2,u3:3,ds:4})}}function vm(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function hm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{i1:u}=e,{i2:a}=e,{i2e:m}=e,{i3:f}=e,{max:p}=e,_={};function h(v){return{label:ke(v)+"A",title:v.toFixed(1)+" A",value:isNaN(v)?0:v,color:qc(v?v/p*100:0,document.documentElement.classList.contains("dark"))}}return t.$$set=v=>{"u1"in v&&l(1,n=v.u1),"u2"in v&&l(2,i=v.u2),"u3"in v&&l(3,o=v.u3),"i1"in v&&l(4,u=v.i1),"i2"in v&&l(5,a=v.i2),"i2e"in v&&l(6,m=v.i2e),"i3"in v&&l(7,f=v.i3),"max"in v&&l(8,p=v.max)},t.$$.update=()=>{if(t.$$.dirty&510){let v=[],d=[];n>0&&(v.push({label:"L1"}),d.push(h(u))),i>0&&(m?(v.push({label:"L2"}),d.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(v.push({label:"L2"}),d.push(h(a)))),o>0&&(v.push({label:"L3"}),d.push(h(f))),l(0,_={title:"Amperage",padding:{top:20,right:15,bottom:20,left:35},y:{min:0,max:p,ticks:[{value:0,label:"0%"},{value:p/4,label:"25%"},{value:p/2,label:"50%"},{value:p/4*3,label:"75%"},{value:p,label:"100%"}]},x:{ticks:v},points:d})}},[_,n,i,o,u,a,m,f,p]}class bm extends Re{constructor(e){super(),Le(this,e,hm,vm,Ee,{u1:1,u2:2,u3:3,i1:4,i2:5,i2e:6,i3:7,max:8})}}function gm(t){let e,l,n,i,o,u,a,m=(typeof t[0]<"u"?t[0].toFixed(0):"-")+"",f,p,_,h,v,d,g=(typeof t[1]<"u"?t[1].toFixed(0):"-")+"",w,D,M,E,R,O,F,y=(typeof t[2]<"u"?t[2].toFixed(1):"-")+"",P,ne,H,z,U,K,Q=(typeof t[3]<"u"?t[3].toFixed(1):"-")+"",G,X;return{c(){e=c("div"),l=c("strong"),l.textContent="Reactive",n=b(),i=c("div"),o=c("div"),o.textContent="Instant in",u=b(),a=c("div"),f=N(m),p=N(" VAr"),_=b(),h=c("div"),h.textContent="Instant out",v=b(),d=c("div"),w=N(g),D=N(" VAr"),M=b(),E=c("div"),R=c("div"),R.textContent="Total in",O=b(),F=c("div"),P=N(y),ne=N(" kVArh"),H=b(),z=c("div"),z.textContent="Total out",U=b(),K=c("div"),G=N(Q),X=N(" kVArh"),r(a,"class","text-right"),r(d,"class","text-right"),r(i,"class","grid grid-cols-2 mt-4"),r(F,"class","text-right"),r(K,"class","text-right"),r(E,"class","grid grid-cols-2 mt-4"),r(e,"class","mx-2 text-sm")},m(Y,j){S(Y,e,j),s(e,l),s(e,n),s(e,i),s(i,o),s(i,u),s(i,a),s(a,f),s(a,p),s(i,_),s(i,h),s(i,v),s(i,d),s(d,w),s(d,D),s(e,M),s(e,E),s(E,R),s(E,O),s(E,F),s(F,P),s(F,ne),s(E,H),s(E,z),s(E,U),s(E,K),s(K,G),s(K,X)},p(Y,[j]){j&1&&m!==(m=(typeof Y[0]<"u"?Y[0].toFixed(0):"-")+"")&&J(f,m),j&2&&g!==(g=(typeof Y[1]<"u"?Y[1].toFixed(0):"-")+"")&&J(w,g),j&4&&y!==(y=(typeof Y[2]<"u"?Y[2].toFixed(1):"-")+"")&&J(P,y),j&8&&Q!==(Q=(typeof Y[3]<"u"?Y[3].toFixed(1):"-")+"")&&J(G,Q)},i:pe,o:pe,d(Y){Y&&$(e)}}}function km(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 wm extends Re{constructor(e){super(),Le(this,e,km,gm,Ee,{importInstant:0,exportInstant:1,importTotal:2,exportTotal:3})}}function uu(t){let e;function l(o,u){return o[3]?Cm:ym}let n=l(t),i=n(t);return{c(){i.c(),e=Ke()},m(o,u){i.m(o,u),S(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&&$(e)}}}function ym(t){let e,l,n,i,o,u,a=ke(t[1].h.u,2)+"",m,f,p,_,h,v,d=ke(t[1].d.u,1)+"",g,w,D,M,E,R,O=ke(t[1].m.u)+"",F,y,P,ne,H,z,U=ke(t[0].last_month.u)+"",K,Q,G,X,Y=t[4]&&fu(t);return{c(){e=c("strong"),e.textContent="Consumption",l=b(),n=c("div"),i=c("div"),i.textContent="Hour",o=b(),u=c("div"),m=N(a),f=N(" kWh"),p=b(),_=c("div"),_.textContent="Day",h=b(),v=c("div"),g=N(d),w=N(" kWh"),D=b(),M=c("div"),M.textContent="Month",E=b(),R=c("div"),F=N(O),y=N(" kWh"),P=b(),ne=c("div"),ne.textContent="Last month",H=b(),z=c("div"),K=N(U),Q=N(" kWh"),G=b(),Y&&Y.c(),X=Ke(),r(u,"class","text-right"),r(v,"class","text-right"),r(R,"class","text-right"),r(z,"class","text-right"),r(n,"class","grid grid-cols-2 mb-3")},m(j,x){S(j,e,x),S(j,l,x),S(j,n,x),s(n,i),s(n,o),s(n,u),s(u,m),s(u,f),s(n,p),s(n,_),s(n,h),s(n,v),s(v,g),s(v,w),s(n,D),s(n,M),s(n,E),s(n,R),s(R,F),s(R,y),s(n,P),s(n,ne),s(n,H),s(n,z),s(z,K),s(z,Q),S(j,G,x),Y&&Y.m(j,x),S(j,X,x)},p(j,x){x&2&&a!==(a=ke(j[1].h.u,2)+"")&&J(m,a),x&2&&d!==(d=ke(j[1].d.u,1)+"")&&J(g,d),x&2&&O!==(O=ke(j[1].m.u)+"")&&J(F,O),x&1&&U!==(U=ke(j[0].last_month.u)+"")&&J(K,U),j[4]?Y?Y.p(j,x):(Y=fu(j),Y.c(),Y.m(X.parentNode,X)):Y&&(Y.d(1),Y=null)},d(j){j&&$(e),j&&$(l),j&&$(n),j&&$(G),Y&&Y.d(j),j&&$(X)}}}function Cm(t){let e,l,n,i,o,u,a=ke(t[1].h.u,2)+"",m,f,p,_,h,v,d,g=ke(t[1].d.u,1)+"",w,D,M,E,R,O,F,y=ke(t[1].m.u)+"",P,ne,H,z,U,K,Q,G=ke(t[0].last_month.u)+"",X,Y,j,x,ae,ee,V,W,we,He,Ie,Se=ke(t[1].h.p,2)+"",ye,ve,Te,be,T,C,k,A=ke(t[1].d.p,1)+"",L,Z,le,fe,de,Ce,Oe,ue=ke(t[1].m.p)+"",Me,Je,It,st,wt,nt,Ot,Qe=ke(t[0].last_month.p)+"",Xt,zt,vt,xe,Ge=t[4]&&cu(t),Ye=t[4]&&mu(t),Ne=t[4]&&_u(t),Ze=t[4]&&pu(t),et=t[4]&&du(t),qe=t[4]&&vu(t),Fe=t[4]&&hu(t),_e=t[4]&&bu(t);return{c(){e=c("strong"),e.textContent="Import",l=b(),n=c("div"),i=c("div"),i.textContent="Hour",o=b(),u=c("div"),m=N(a),f=N(" kWh"),p=b(),Ge&&Ge.c(),_=b(),h=c("div"),h.textContent="Day",v=b(),d=c("div"),w=N(g),D=N(" kWh"),M=b(),Ye&&Ye.c(),E=b(),R=c("div"),R.textContent="Month",O=b(),F=c("div"),P=N(y),ne=N(" kWh"),H=b(),Ne&&Ne.c(),z=b(),U=c("div"),U.textContent="Last mo.",K=b(),Q=c("div"),X=N(G),Y=N(" kWh"),j=b(),Ze&&Ze.c(),ae=b(),ee=c("strong"),ee.textContent="Export",V=b(),W=c("div"),we=c("div"),we.textContent="Hour",He=b(),Ie=c("div"),ye=N(Se),ve=N(" kWh"),Te=b(),et&&et.c(),be=b(),T=c("div"),T.textContent="Day",C=b(),k=c("div"),L=N(A),Z=N(" kWh"),le=b(),qe&&qe.c(),fe=b(),de=c("div"),de.textContent="Month",Ce=b(),Oe=c("div"),Me=N(ue),Je=N(" kWh"),It=b(),Fe&&Fe.c(),st=b(),wt=c("div"),wt.textContent="Last mo.",nt=b(),Ot=c("div"),Xt=N(Qe),zt=N(" kWh"),vt=b(),_e&&_e.c(),r(u,"class","text-right"),r(d,"class","text-right"),r(F,"class","text-right"),r(Q,"class","text-right"),r(n,"class",x="grid grid-cols-"+t[5]+" mb-3"),r(Ie,"class","text-right"),r(k,"class","text-right"),r(Oe,"class","text-right"),r(Ot,"class","text-right"),r(W,"class",xe="grid grid-cols-"+t[5])},m(ce,Be){S(ce,e,Be),S(ce,l,Be),S(ce,n,Be),s(n,i),s(n,o),s(n,u),s(u,m),s(u,f),s(n,p),Ge&&Ge.m(n,null),s(n,_),s(n,h),s(n,v),s(n,d),s(d,w),s(d,D),s(n,M),Ye&&Ye.m(n,null),s(n,E),s(n,R),s(n,O),s(n,F),s(F,P),s(F,ne),s(n,H),Ne&&Ne.m(n,null),s(n,z),s(n,U),s(n,K),s(n,Q),s(Q,X),s(Q,Y),s(n,j),Ze&&Ze.m(n,null),S(ce,ae,Be),S(ce,ee,Be),S(ce,V,Be),S(ce,W,Be),s(W,we),s(W,He),s(W,Ie),s(Ie,ye),s(Ie,ve),s(W,Te),et&&et.m(W,null),s(W,be),s(W,T),s(W,C),s(W,k),s(k,L),s(k,Z),s(W,le),qe&&qe.m(W,null),s(W,fe),s(W,de),s(W,Ce),s(W,Oe),s(Oe,Me),s(Oe,Je),s(W,It),Fe&&Fe.m(W,null),s(W,st),s(W,wt),s(W,nt),s(W,Ot),s(Ot,Xt),s(Ot,zt),s(W,vt),_e&&_e.m(W,null)},p(ce,Be){Be&2&&a!==(a=ke(ce[1].h.u,2)+"")&&J(m,a),ce[4]?Ge?Ge.p(ce,Be):(Ge=cu(ce),Ge.c(),Ge.m(n,_)):Ge&&(Ge.d(1),Ge=null),Be&2&&g!==(g=ke(ce[1].d.u,1)+"")&&J(w,g),ce[4]?Ye?Ye.p(ce,Be):(Ye=mu(ce),Ye.c(),Ye.m(n,E)):Ye&&(Ye.d(1),Ye=null),Be&2&&y!==(y=ke(ce[1].m.u)+"")&&J(P,y),ce[4]?Ne?Ne.p(ce,Be):(Ne=_u(ce),Ne.c(),Ne.m(n,z)):Ne&&(Ne.d(1),Ne=null),Be&1&&G!==(G=ke(ce[0].last_month.u)+"")&&J(X,G),ce[4]?Ze?Ze.p(ce,Be):(Ze=pu(ce),Ze.c(),Ze.m(n,null)):Ze&&(Ze.d(1),Ze=null),Be&32&&x!==(x="grid grid-cols-"+ce[5]+" mb-3")&&r(n,"class",x),Be&2&&Se!==(Se=ke(ce[1].h.p,2)+"")&&J(ye,Se),ce[4]?et?et.p(ce,Be):(et=du(ce),et.c(),et.m(W,be)):et&&(et.d(1),et=null),Be&2&&A!==(A=ke(ce[1].d.p,1)+"")&&J(L,A),ce[4]?qe?qe.p(ce,Be):(qe=vu(ce),qe.c(),qe.m(W,fe)):qe&&(qe.d(1),qe=null),Be&2&&ue!==(ue=ke(ce[1].m.p)+"")&&J(Me,ue),ce[4]?Fe?Fe.p(ce,Be):(Fe=hu(ce),Fe.c(),Fe.m(W,st)):Fe&&(Fe.d(1),Fe=null),Be&1&&Qe!==(Qe=ke(ce[0].last_month.p)+"")&&J(Xt,Qe),ce[4]?_e?_e.p(ce,Be):(_e=bu(ce),_e.c(),_e.m(W,null)):_e&&(_e.d(1),_e=null),Be&32&&xe!==(xe="grid grid-cols-"+ce[5])&&r(W,"class",xe)},d(ce){ce&&$(e),ce&&$(l),ce&&$(n),Ge&&Ge.d(),Ye&&Ye.d(),Ne&&Ne.d(),Ze&&Ze.d(),ce&&$(ae),ce&&$(ee),ce&&$(V),ce&&$(W),et&&et.d(),qe&&qe.d(),Fe&&Fe.d(),_e&&_e.d()}}}function fu(t){let e,l,n,i,o,u,a=ke(t[1].h.c,2)+"",m,f,p,_,h,v,d,g=ke(t[1].d.c,1)+"",w,D,M,E,R,O,F,y=ke(t[1].m.c)+"",P,ne,H,z,U,K,Q,G=ke(t[0].last_month.c)+"",X,Y,j;return{c(){e=c("strong"),e.textContent="Cost",l=b(),n=c("div"),i=c("div"),i.textContent="Hour",o=b(),u=c("div"),m=N(a),f=b(),p=N(t[2]),_=b(),h=c("div"),h.textContent="Day",v=b(),d=c("div"),w=N(g),D=b(),M=N(t[2]),E=b(),R=c("div"),R.textContent="Month",O=b(),F=c("div"),P=N(y),ne=b(),H=N(t[2]),z=b(),U=c("div"),U.textContent="Last month",K=b(),Q=c("div"),X=N(G),Y=b(),j=N(t[2]),r(u,"class","text-right"),r(d,"class","text-right"),r(F,"class","text-right"),r(Q,"class","text-right"),r(n,"class","grid grid-cols-2")},m(x,ae){S(x,e,ae),S(x,l,ae),S(x,n,ae),s(n,i),s(n,o),s(n,u),s(u,m),s(u,f),s(u,p),s(n,_),s(n,h),s(n,v),s(n,d),s(d,w),s(d,D),s(d,M),s(n,E),s(n,R),s(n,O),s(n,F),s(F,P),s(F,ne),s(F,H),s(n,z),s(n,U),s(n,K),s(n,Q),s(Q,X),s(Q,Y),s(Q,j)},p(x,ae){ae&2&&a!==(a=ke(x[1].h.c,2)+"")&&J(m,a),ae&4&&J(p,x[2]),ae&2&&g!==(g=ke(x[1].d.c,1)+"")&&J(w,g),ae&4&&J(M,x[2]),ae&2&&y!==(y=ke(x[1].m.c)+"")&&J(P,y),ae&4&&J(H,x[2]),ae&1&&G!==(G=ke(x[0].last_month.c)+"")&&J(X,G),ae&4&&J(j,x[2])},d(x){x&&$(e),x&&$(l),x&&$(n)}}}function cu(t){let e,l=ke(t[1].h.c,2)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].h.c,2)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function mu(t){let e,l=ke(t[1].d.c,1)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].d.c,1)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function _u(t){let e,l=ke(t[1].m.c)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].m.c)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function pu(t){let e,l=ke(t[0].last_month.c)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ke(u[0].last_month.c)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function du(t){let e,l=ke(t[1].h.i,2)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].h.i,2)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function vu(t){let e,l=ke(t[1].d.i,1)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].d.i,1)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function hu(t){let e,l=ke(t[1].m.i)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].m.i)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function bu(t){let e,l=ke(t[0].last_month.i)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ke(u[0].last_month.i)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function $m(t){let e,l,n,i,o,u,a=t[1]&&uu(t);return{c(){e=c("div"),l=c("strong"),l.textContent="Real time calculation",n=b(),i=c("br"),o=c("br"),u=b(),a&&a.c(),r(e,"class","mx-2 text-sm")},m(m,f){S(m,e,f),s(e,l),s(e,n),s(e,i),s(e,o),s(e,u),a&&a.m(e,null)},p(m,[f]){m[1]?a?a.p(m,f):(a=uu(m),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i:pe,o:pe,d(m){m&&$(e),a&&a.d()}}}function Sm(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:u}=e,a=!1,m=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,m=a?3:2))},[n,i,o,u,a,m]}class Mm extends Re{constructor(e){super(),Le(this,e,Sm,$m,Ee,{sysinfo:0,data:1,currency:2,hasExport:3})}}function Tm(t){let e,l,n=Da(t[0].source)+"",i,o,u,a,m;return a=new mn({props:{config:t[1]}}),{c(){e=c("a"),l=N("Provided by: "),i=N(n),u=b(),re(a.$$.fragment),r(e,"href",o=La(t[0].source)),r(e,"target","_blank"),r(e,"class","text-xs float-right z-40")},m(f,p){S(f,e,p),s(e,l),s(e,i),S(f,u,p),ie(a,f,p),m=!0},p(f,[p]){(!m||p&1)&&n!==(n=Da(f[0].source)+"")&&J(i,n),(!m||p&1&&o!==(o=La(f[0].source)))&&r(e,"href",o);const _={};p&2&&(_.config=f[1]),a.$set(_)},i(f){m||(I(a.$$.fragment,f),m=!0)},o(f){q(a.$$.fragment,f),m=!1},d(f){f&&$(e),f&&$(u),se(a,f)}}}function Nm(t,e,l){let{json:n}=e,{sysinfo:i}=e,o={},u,a,m=document.documentElement.classList.contains("dark");return t.$$set=f=>{"json"in f&&l(0,n=f.json),"sysinfo"in f&&l(2,i=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&29){let f=n.currency,p=new Date().getUTCHours(),_=0,h=0,v=0,d=[],g=[],w=[];l(4,a=l(3,u=0));let D=new Date;for(dl(D,i.clock_offset-(24+D.getHours()-D.getUTCHours())%24),_=p;_<24&&(h=n[Ue(v++)],h!=null);_++)g.push({label:Ue(D.getHours())}),w.push(h*100),l(4,a=Math.min(a,h*100)),l(3,u=Math.max(u,h*100)),dl(D,1);for(_=0;_<24&&(h=n[Ue(v++)],h!=null);_++)g.push({label:Ue(D.getHours())}),w.push(h*100),l(4,a=Math.min(a,h*100)),l(3,u=Math.max(u,h*100)),dl(D,1);if(a>-100&&u<100){switch(f){case"NOK":case"DKK":f="\xF8re";break;case"SEK":f="\xF6re";break;case"EUR":f="cent";break;case"CHF":f="rp.";break;default:f=f+"/100"}for(l(4,a*=100),l(3,u*=100),_=0;_=0?F.toFixed(y):"",title:F>=0?F.toFixed(2)+" "+f:"",value:h>=0?Math.abs(h):0,label2:F<0?F.toFixed(y):"",title2:F<0?F.toFixed(2)+" "+f:"",value2:h<0?Math.abs(h):0,color:m?"#5c2da5":"#7c3aed"})}let E=Math.max(u,Math.abs(a));if(a<0){l(4,a=Math.min(E/4*-1,a));let F=Math.ceil(Math.abs(a)/E*4),y=a/F;for(_=1;_{"json"in f&&l(1,n=f.json),"sysinfo"in f&&l(2,i=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let f=0,p=[],_=[],h=[];l(4,a=l(3,u=0));let v=dl(new Date,-24),d=new Date().getUTCHours();for(dl(v,i.clock_offset-(24+v.getHours()-v.getUTCHours())%24),f=d;f<24;f++){let M=n["i"+Ue(f)],E=n["e"+Ue(f)];M===void 0&&(M=0),E===void 0&&(E=0),_.push({label:Ue(v.getHours())}),h.push({label:M.toFixed(1),title:M.toFixed(2)+" kWh",value:M*10,label2:E.toFixed(1),title2:E.toFixed(2)+" kWh",value2:E*10,color:m?"#5c2da5":"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,E*10)),l(3,u=Math.max(u,M*10)),dl(v,1)}for(f=0;f{"json"in f&&l(1,n=f.json),"sysinfo"in f&&l(2,i=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let f=0,p=[],_=[],h=[];l(4,a=l(3,u=0));let v=new Date,d=new Date;for(dl(v,i.clock_offset-(24+v.getHours()-v.getUTCHours())%24),dl(d,i.clock_offset-(24+d.getHours()-d.getUTCHours())%24),d.setDate(0),f=v.getDate();f<=d.getDate();f++){let M=n["i"+Ue(f)],E=n["e"+Ue(f)];M===void 0&&(M=0),E===void 0&&(E=0),_.push({label:Ue(f)}),h.push({label:M.toFixed(M<10?1:0),title:M.toFixed(2)+" kWh",value:M,label2:E.toFixed(E<10?1:0),title2:E.toFixed(2)+" kWh",value2:E,color:m?"#5c2da5":"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,E)),l(3,u=Math.max(u,M))}for(f=1;f{"json"in m&&l(1,n=m.json)},t.$$.update=()=>{if(t.$$.dirty&14){let m=0,f=0,p=[],_=[],h=[];n.s&&n.s.forEach((g,w)=>{var D=g.n?g.n:g.a;f=g.v,f==-127&&(f=0),_.push({label:D.slice(-4)}),h.push({label:f.toFixed(1),value:f,color:i?"#5c2da5":"#7c3aed"}),l(3,a=Math.min(a,f)),l(2,u=Math.max(u,f))}),l(2,u=Math.ceil(u)),l(3,a=Math.floor(a));let v=u;a<0&&(v+=Math.abs(a));let d=v/4;for(m=0;m<5;m++)f=a+d*m,p.push({value:f,label:f.toFixed(1)});l(0,o={title:"Temperature sensors (\xB0C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:a,max:u,ticks:p},x:{ticks:_},points:h})}},[o,n,u,a]}class qm extends Re{constructor(e){super(),Le(this,e,Fm,Om,Ee,{json:1})}}function Bm(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}let Um=0;function jm(t,e,l){let n=document.documentElement.classList.contains("dark"),i={},o=0,u;return Kc.subscribe(a=>{l(2,u=a)}),Vc(),t.$$.update=()=>{if(t.$$.dirty&6){let a=0,m=[],f=[],p=[];if(m.push({value:0,label:0}),u&&u.p)for(a=0;a0?Ue(_.d)+"."+Ys[new Date().getMonth()]:"-"}),l(1,o=Math.max(o,_.v))}if(u&&u.t){for(a=0;a=o)break;m.push({value:_,label:_})}m.push({label:u.m.toFixed(1),align:"right",color:"green",value:u.m})}u&&u.c&&(m.push({label:u.c.toFixed(0),color:"orange",value:u.c}),l(1,o=Math.max(o,u.c))),l(1,o=Math.ceil(o)),l(0,i={title:"Tariff peaks",padding:{top:20,right:35,bottom:20,left:35},y:{min:Um,max:o,ticks:m},x:{ticks:f},points:p})}},[i,o,u]}class Hm extends Re{constructor(e){super(),Le(this,e,jm,Bm,Ee,{})}}function gu(t,e,l){const n=t.slice();return n[20]=e[l],n[22]=l,n}function ku(t,e,l){const n=t.slice();return n[23]=e[l],n}function wu(t){let e,l,n,i,o,u=t[7],a=[];for(let p=0;pt[15].call(e))},m(f,p){S(f,e,p),s(e,l),s(l,n),s(l,i),s(l,o),s(e,u),m&&m.m(e,null),a=mo(e,t[15].bind(e))},p(f,[p]){p&1024&&J(i,f[10]),f[7]?m?m.p(f,p):(m=wu(f),m.c(),m.m(e,null)):m&&(m.d(1),m=null)},i:pe,o:pe,d(f){f&&$(e),m&&m.d(),a()}}}let zm=12;function Gm(t,e,l){let n=document.documentElement.classList.contains("dark"),i;Yc.subscribe(y=>{l(12,i=y)});let o,u=0,a=0;function m(){o&&clearTimeout(o),o=setTimeout(m,1e4),i.data.unshift(a),l(12,i.data=i.data.slice(0,i.size),i),u+=10}Bc.subscribe(y=>{u==0&&(o&&clearTimeout(o),o=setTimeout(m,1e4)),a=y.i-y.e,u=y.u});let f,p,_,h,v,d,g,w,D,M,E,R,O;function F(){_=this.clientWidth,h=this.clientHeight,l(0,_),l(1,h)}return t.$$.update=()=>{if(t.$$.dirty&29183&&(l(2,v=parseInt(h)-50),l(3,d=_-35),l(9,R=d/i.size),l(14,p=0),l(13,f=0),i.data)){for(let P in i.data){let ne=i.data[P];l(13,f=Math.max(Math.ceil(ne/1e3)*1e3,f)),l(14,p=Math.min(Math.ceil(ne/1e3)*1e3,p))}l(10,O=f>2500?"kW":"W"),l(7,M=[]);for(let P=p;P2500?(P/1e3).toFixed(1):P});l(8,E=[]);for(let P=p;P0||t[0].e>0}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt")},m(i,o){S(i,e,o),ie(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||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Lu(t){let e,l,n;return l=new Hm({}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt h-64")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},i(i){n||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Ru(t){let e,l,n;return l=new Vm({}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},i(i){n||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Iu(t){let e,l,n;return l=new Em({props:{json:t[2],sysinfo:t[1]}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(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||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Ou(t){let e,l,n;return l=new Dm({props:{json:t[3],sysinfo:t[1]}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(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||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Fu(t){let e,l,n;return l=new Im({props:{json:t[4],sysinfo:t[1]}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(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||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function qu(t){let e,l,n;return l=new qm({props:{json:t[5]}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&32&&(u.json=i[5]),l.$set(u)},i(i){n||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Km(t){let e,l=Xe(t[1].ui.i,t[0].i),n,i=Xe(t[1].ui.e,t[0].om||t[0].e>0),o,u=Xe(t[1].ui.v,t[0].u1>100||t[0].u2>100||t[0].u3>100),a,m=Xe(t[1].ui.a,t[0].i1>.01||t[0].i2>.01||t[0].i3>.01),f,p=Xe(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),_,h=Xe(t[1].ui.c,t[0].ea),v,d=Xe(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),g,w=Xe(t[1].ui.l),D,M=Xe(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),E,R=Xe(t[1].ui.d,t[3]),O,F=Xe(t[1].ui.m,t[4]),y,P=Xe(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),ne,H=l&&Tu(t),z=i&&Nu(t),U=u&&Eu(t),K=m&&Au(t),Q=p&&Pu(t),G=h&&Du(t),X=d&&Lu(),Y=w&&Ru(),j=M&&Iu(t),x=R&&Ou(t),ae=F&&Fu(t),ee=P&&qu(t);return{c(){e=c("div"),H&&H.c(),n=b(),z&&z.c(),o=b(),U&&U.c(),a=b(),K&&K.c(),f=b(),Q&&Q.c(),_=b(),G&&G.c(),v=b(),X&&X.c(),g=b(),Y&&Y.c(),D=b(),j&&j.c(),E=b(),x&&x.c(),O=b(),ae&&ae.c(),y=b(),ee&&ee.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(V,W){S(V,e,W),H&&H.m(e,null),s(e,n),z&&z.m(e,null),s(e,o),U&&U.m(e,null),s(e,a),K&&K.m(e,null),s(e,f),Q&&Q.m(e,null),s(e,_),G&&G.m(e,null),s(e,v),X&&X.m(e,null),s(e,g),Y&&Y.m(e,null),s(e,D),j&&j.m(e,null),s(e,E),x&&x.m(e,null),s(e,O),ae&&ae.m(e,null),s(e,y),ee&&ee.m(e,null),ne=!0},p(V,[W]){W&3&&(l=Xe(V[1].ui.i,V[0].i)),l?H?(H.p(V,W),W&3&&I(H,1)):(H=Tu(V),H.c(),I(H,1),H.m(e,n)):H&&(Ae(),q(H,1,1,()=>{H=null}),Pe()),W&3&&(i=Xe(V[1].ui.e,V[0].om||V[0].e>0)),i?z?(z.p(V,W),W&3&&I(z,1)):(z=Nu(V),z.c(),I(z,1),z.m(e,o)):z&&(Ae(),q(z,1,1,()=>{z=null}),Pe()),W&3&&(u=Xe(V[1].ui.v,V[0].u1>100||V[0].u2>100||V[0].u3>100)),u?U?(U.p(V,W),W&3&&I(U,1)):(U=Eu(V),U.c(),I(U,1),U.m(e,a)):U&&(Ae(),q(U,1,1,()=>{U=null}),Pe()),W&3&&(m=Xe(V[1].ui.a,V[0].i1>.01||V[0].i2>.01||V[0].i3>.01)),m?K?(K.p(V,W),W&3&&I(K,1)):(K=Au(V),K.c(),I(K,1),K.m(e,f)):K&&(Ae(),q(K,1,1,()=>{K=null}),Pe()),W&3&&(p=Xe(V[1].ui.r,V[0].ri>0||V[0].re>0||V[0].ric>0||V[0].rec>0)),p?Q?(Q.p(V,W),W&3&&I(Q,1)):(Q=Pu(V),Q.c(),I(Q,1),Q.m(e,_)):Q&&(Ae(),q(Q,1,1,()=>{Q=null}),Pe()),W&3&&(h=Xe(V[1].ui.c,V[0].ea)),h?G?(G.p(V,W),W&3&&I(G,1)):(G=Du(V),G.c(),I(G,1),G.m(e,v)):G&&(Ae(),q(G,1,1,()=>{G=null}),Pe()),W&3&&(d=Xe(V[1].ui.t,V[0].pr&&(V[0].pr.startsWith("10YNO")||V[0].pr.startsWith("10Y1001A1001A4")))),d?X?W&3&&I(X,1):(X=Lu(),X.c(),I(X,1),X.m(e,g)):X&&(Ae(),q(X,1,1,()=>{X=null}),Pe()),W&2&&(w=Xe(V[1].ui.l)),w?Y?W&2&&I(Y,1):(Y=Ru(),Y.c(),I(Y,1),Y.m(e,D)):Y&&(Ae(),q(Y,1,1,()=>{Y=null}),Pe()),W&3&&(M=Xe(V[1].ui.p,V[0].pe&&!Number.isNaN(V[0].p))),M?j?(j.p(V,W),W&3&&I(j,1)):(j=Iu(V),j.c(),I(j,1),j.m(e,E)):j&&(Ae(),q(j,1,1,()=>{j=null}),Pe()),W&10&&(R=Xe(V[1].ui.d,V[3])),R?x?(x.p(V,W),W&10&&I(x,1)):(x=Ou(V),x.c(),I(x,1),x.m(e,O)):x&&(Ae(),q(x,1,1,()=>{x=null}),Pe()),W&18&&(F=Xe(V[1].ui.m,V[4])),F?ae?(ae.p(V,W),W&18&&I(ae,1)):(ae=Fu(V),ae.c(),I(ae,1),ae.m(e,y)):ae&&(Ae(),q(ae,1,1,()=>{ae=null}),Pe()),W&35&&(P=Xe(V[1].ui.s,V[0].t&&V[0].t!=-127&&V[5].c>1)),P?ee?(ee.p(V,W),W&35&&I(ee,1)):(ee=qu(V),ee.c(),I(ee,1),ee.m(e,null)):ee&&(Ae(),q(ee,1,1,()=>{ee=null}),Pe())},i(V){ne||(I(H),I(z),I(U),I(K),I(Q),I(G),I(X),I(Y),I(j),I(x),I(ae),I(ee),ne=!0)},o(V){q(H),q(z),q(U),q(K),q(Q),q(G),q(X),q(Y),q(j),q(x),q(ae),q(ee),ne=!1},d(V){V&&$(e),H&&H.d(),z&&z.d(),U&&U.d(),K&&K.d(),Q&&Q.d(),G&&G.d(),X&&X.d(),Y&&Y.d(),j&&j.d(),x&&x.d(),ae&&ae.d(),ee&&ee.d()}}}function Ym(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},u={},a={},m={};return go.subscribe(f=>{l(2,o=f)}),Hc.subscribe(f=>{l(3,u=f)}),Wc.subscribe(f=>{l(4,a=f)}),Gc.subscribe(f=>{l(5,m=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,m]}class Qm extends Re{constructor(e){super(),Le(this,e,Ym,Km,Ee,{data:0,sysinfo:1})}}let lo={};const hi=it(lo);async function Xm(){lo=await(await fetch("/configuration.json")).json(),hi.set(lo)}let no={};const e1=it(no);async function Zm(){no=await(await fetch("/priceconfig.json")).json(),e1.set(no)}function Bu(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Jm(t){let e;return{c(){e=c("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function xm(t){let e;return{c(){e=c("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Uu(t){let e;return{c(){e=c("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function ju(t){let e,l,n;return{c(){e=c("option"),e.textContent="UART1",l=b(),n=c("option"),n.textContent="UART2",e.__value=9,e.value=e.__value,n.__value=16,n.value=n.__value},m(i,o){S(i,e,o),S(i,l,o),S(i,n,o)},d(i){i&&$(e),i&&$(l),i&&$(n)}}}function Hu(t){let e;return{c(){e=c("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Wu(t){let e,l,n;return{c(){e=c("option"),l=N("GPIO"),n=N(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){S(i,e,o),s(e,l),s(e,n)},d(i){i&&$(e)}}}function zu(t){let e,l=t[4]>1&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!((t[0]=="esp32s2"||t[0]=="esp32s3")&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Wu(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),S(n,e,i)},p(n,i){n[4]>1&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!((n[0]=="esp32s2"||n[0]=="esp32s3")&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Wu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&$(e)}}}function e_(t){let e,l,n,i,o;function u(d,g){return d[0]=="esp32c3"?xm:Jm}let a=u(t),m=a(t),f=t[0]=="esp8266"&&Uu(),p=(t[0]=="esp32"||t[0]=="esp32solo")&&ju(),_=(t[0]=="esp32s2"||t[0]=="esp32s3")&&Hu(),h={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"esp32s3":l(1,i=46);break;case"esp32c3":l(1,i=19);break}},[n,i]}class io extends Re{constructor(e){super(),Le(this,e,t_,e_,Ee,{chip:0})}}function Gu(t){let e,l,n=t[1]&&Vu(t);return{c(){e=c("div"),l=c("div"),n&&n.c(),r(l,"class","fixed inset-0 bg-gray-500 dark:bg-gray-900 bg-opacity-50 dark:bg-opacity-80 flex items-center justify-center"),r(e,"class","z-50"),r(e,"aria-modal","true")},m(i,o){S(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=Vu(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&$(e),n&&n.d()}}}function Vu(t){let e,l;return{c(){e=c("div"),l=N(t[1]),r(e,"class","bg-white dark:bg-gray-600 m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 dark:text-white w-96")},m(n,i){S(n,e,i),s(e,l)},p(n,i){i&2&&J(l,n[1])},d(n){n&&$(e)}}}function l_(t){let e,l=t[0]&&Gu(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),S(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Gu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:pe,o:pe,d(n){l&&l.d(n),n&&$(e)}}}function n_(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 kt extends Re{constructor(e){super(),Le(this,e,n_,l_,Ee,{active:0,message:1})}}function Ku(t,e,l){const n=t.slice();return n[1]=e[l],n}function Yu(t){let e,l,n=t[1]+"",i;return{c(){e=c("option"),l=N("Europe/"),i=N(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,u){S(o,e,u),s(e,l),s(e,i)},p:pe,d(o){o&&$(e)}}}function i_(t){let e,l,n,i=t[0],o=[];for(let u=0;u>1&1,A=0;A0;C--)A[C]=A[C]?A[C-1]^O.EXPONENT[P._modN(O.LOG[A[C]]+T)]:A[C-1];A[0]=O.EXPONENT[P._modN(O.LOG[A[0]]+T)]}for(T=0;T<=k;T++)A[T]=O.LOG[A[T]]},_checkBadness:function(){var T,C,k,A,L,Z=0,le=this._badness,fe=this.buffer,de=this.width;for(L=0;Lde*de;)ue-=de*de,Oe++;for(Z+=Oe*P.N4,A=0;A=le-2&&(T=le-2,L>9&&T--);var fe=T;if(L>9){for(Z[fe+2]=0,Z[fe+3]=0;fe--;)C=Z[fe],Z[fe+3]|=255&C<<4,Z[fe+2]=C>>4;Z[2]|=255&T<<4,Z[1]=T>>4,Z[0]=64|T>>12}else{for(Z[fe+1]=0,Z[fe+2]=0;fe--;)C=Z[fe],Z[fe+2]|=255&C<<4,Z[fe+1]=C>>4;Z[1]|=255&T<<4,Z[0]=64|T>>4}for(fe=T+3-(L<10);fe=5&&(k+=P.N1+A[C]-5);for(C=3;CT||A[C-3]*3>=A[C]*4||A[C+3]*3>=A[C]*4)&&(k+=P.N3);return k},_finish:function(){this._stringBuffer=this.buffer.slice();var T,C,k=0,A=3e4;for(C=0;C<8&&(this._applyMask(C),T=this._checkBadness(),T>=1)A&1&&(L[Z-1-C+Z*8]=1,C<6?L[8+Z*C]=1:L[8+Z*(C+1)]=1);for(C=0;C<7;C++,A>>=1)A&1&&(L[8+Z*(Z-7+C)]=1,C?L[6-C+Z*8]=1:L[7+Z*8]=1)},_interleaveBlocks:function(){var T,C,k=this._dataBlock,A=this._ecc,L=this._eccBlock,Z=0,le=this._calculateMaxLength(),fe=this._neccBlock1,de=this._neccBlock2,Ce=this._stringBuffer;for(T=0;T1)for(T=D.BLOCK[A],k=L-7;;){for(C=L-7;C>T-3&&(this._addAlignment(C,k),!(C6)for(T=y.BLOCK[Z-7],C=17,k=0;k<6;k++)for(A=0;A<3;A++,C--)1&(C>11?Z>>C-12:T>>C)?(L[5-k+le*(2-A+le-11)]=1,L[2-A+le-11+le*(5-k)]=1):(this._setMask(5-k,2-A+le-11),this._setMask(2-A+le-11,5-k))},_isMasked:function(T,C){var k=P._getMaskBit(T,C);return this._mask[k]===1},_pack:function(){var T,C,k,A=1,L=1,Z=this.width,le=Z-1,fe=Z-1,de=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(C=0;CC&&(k=T,T=C,C=k),k=C,k+=C*C,k>>=1,k+=T,k},_modN:function(T){for(;T>=255;)T-=255,T=(T>>8)+(T&255);return T},N1:3,N2:3,N3:40,N4:10}),ne=P,H=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var T=this.element;T.width=T.height=this.qrious.size}}),z=H,U=_.extend(function(T,C,k,A){this.name=T,this.modifiable=Boolean(C),this.defaultValue=k,this._valueTransformer=A},{transform:function(T){var C=this._valueTransformer;return typeof C=="function"?C(T,this):T}}),K=U,Q=_.extend(null,{abs:function(T){return T!=null?Math.abs(T):null},hasOwn:function(T,C){return Object.prototype.hasOwnProperty.call(T,C)},noop:function(){},toUpperCase:function(T){return T!=null?T.toUpperCase():null}}),G=Q,X=_.extend(function(T){this.options={},T.forEach(function(C){this.options[C.name]=C},this)},{exists:function(T){return this.options[T]!=null},get:function(T,C){return X._get(this.options[T],C)},getAll:function(T){var C,k=this.options,A={};for(C in k)G.hasOwn(k,C)&&(A[C]=X._get(k[C],T));return A},init:function(T,C,k){typeof k!="function"&&(k=G.noop);var A,L;for(A in this.options)G.hasOwn(this.options,A)&&(L=this.options[A],X._set(L,L.defaultValue,C),X._createAccessor(L,C,k));this._setAll(T,C,!0)},set:function(T,C,k){return this._set(T,C,k)},setAll:function(T,C){return this._setAll(T,C)},_set:function(T,C,k,A){var L=this.options[T];if(!L)throw new Error("Invalid option: "+T);if(!L.modifiable&&!A)throw new Error("Option cannot be modified: "+T);return X._set(L,C,k)},_setAll:function(T,C,k){if(!T)return!1;var A,L=!1;for(A in T)G.hasOwn(T,A)&&this._set(A,T[A],C,k)&&(L=!0);return L}},{_createAccessor:function(T,C,k){var A={get:function(){return X._get(T,C)}};T.modifiable&&(A.set=function(L){X._set(T,L,C)&&k(L,T)}),Object.defineProperty(C,T.name,A)},_get:function(T,C){return C["_"+T.name]},_set:function(T,C,k){var A="_"+T.name,L=k[A],Z=T.transform(C!=null?C:T.defaultValue);return k[A]=Z,Z!==L}}),Y=X,j=_.extend(function(){this._services={}},{getService:function(T){var C=this._services[T];if(!C)throw new Error("Service is not being managed with name: "+T);return C},setService:function(T,C){if(this._services[T])throw new Error("Service is already managed with name: "+T);C&&(this._services[T]=C)}}),x=j,ae=new Y([new K("background",!0,"white"),new K("backgroundAlpha",!0,1,G.abs),new K("element"),new K("foreground",!0,"black"),new K("foregroundAlpha",!0,1,G.abs),new K("level",!0,"L",G.toUpperCase),new K("mime",!0,"image/png"),new K("padding",!0,null,G.abs),new K("size",!0,100,G.abs),new K("value",!0,"")]),ee=new x,V=_.extend(function(T){ae.init(T,this,this.update.bind(this));var C=ae.get("element",this),k=ee.getService("element"),A=C&&k.isCanvas(C)?C:k.createCanvas(),L=C&&k.isImage(C)?C:k.createImage();this._canvasRenderer=new g(this,A,!0),this._imageRenderer=new z(this,L,L===C),this.update()},{get:function(){return ae.getAll(this)},set:function(T){ae.setAll(T,this)&&this.update()},toDataURL:function(T){return this.canvas.toDataURL(T||this.mime)},update:function(){var T=new ne({level:this.level,value:this.value});this._canvasRenderer.render(T),this._imageRenderer.render(T)}},{use:function(T){ee.setService(T.getName(),T)}});Object.defineProperties(V.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var W=V,we=W,He=_.extend({getName:function(){}}),Ie=He,Se=Ie.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(T){},isImage:function(T){}}),ye=Se,ve=ye.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(T){return T instanceof HTMLCanvasElement},isImage:function(T){return T instanceof HTMLImageElement}}),Te=ve;we.use(new Te);var be=we;return be})})(l1);const f_=l1.exports;function c_(t){let e,l;return{c(){e=c("img"),Ws(e.src,l=t[2])||r(e,"src",l),r(e,"alt",t[0]),r(e,"class",t[1])},m(n,i){S(n,e,i)},p(n,[i]){i&4&&!Ws(e.src,l=n[2])&&r(e,"src",l),i&1&&r(e,"alt",n[0]),i&2&&r(e,"class",n[1])},i:pe,o:pe,d(n){n&&$(e)}}}function m_(t,e,l){const n=new f_;let{errorCorrection:i="L"}=e,{background:o="#fff"}=e,{color:u="#000"}=e,{size:a="200"}=e,{value:m=""}=e,{padding:f=0}=e,{className:p="qrcode"}=e,_="";function h(){n.set({background:o,foreground:u,level:i,padding:f,size:a,value:m}),l(2,_=n.toDataURL("image/jpeg"))}return ac(()=>{h()}),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,m=v.value),"padding"in v&&l(7,f=v.padding),"className"in v&&l(1,p=v.className)},t.$$.update=()=>{t.$$.dirty&1&&m&&h()},[m,p,_,i,o,u,a,f]}class __ extends Re{constructor(e){super(),Le(this,e,m_,c_,Ee,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function Qu(t,e,l){const n=t.slice();return n[101]=e[l],n[102]=e,n[103]=l,n}function Xu(t,e,l){const n=t.slice();return n[104]=e[l],n[105]=e,n[106]=l,n}function p_(t,e,l){const n=t.slice();return n[107]=e[l],n}function d_(t,e,l){const n=t.slice();return n[110]=e[l],n}function v_(t){let e,l;return{c(){e=c("option"),l=N(t[110]),e.__value=t[110],e.value=e.__value},m(n,i){S(n,e,i),s(e,l)},p:pe,d(n){n&&$(e)}}}function h_(t){let e;return{c(){e=N("Configure price")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Zu(t){let e,l,n,i;return{c(){e=c("br"),l=c("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){S(o,e,u),S(o,l,u),oe(l,t[3].p.t),n||(i=te(l,"input",t[20]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].p.t&&oe(l,o[3].p.t)},d(o){o&&$(e),o&&$(l),n=!1,i()}}}function Ju(t){let e,l,n,i,o,u,a,m,f,p,_,h,v;return{c(){e=c("div"),l=N("Username"),n=c("br"),i=b(),o=c("input"),u=b(),a=c("div"),m=N("Password"),f=c("br"),p=b(),_=c("input"),r(o,"name","gu"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(_,"name","gp"),r(_,"type","password"),r(_,"class","in-s"),r(a,"class","my-1")},m(d,g){S(d,e,g),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].g.u),S(d,u,g),S(d,a,g),s(a,m),s(a,f),s(a,p),s(a,_),oe(_,t[3].g.p),h||(v=[te(o,"input",t[22]),te(_,"input",t[23])],h=!0)},p(d,g){g[0]&8&&o.value!==d[3].g.u&&oe(o,d[3].g.u),g[0]&8&&_.value!==d[3].g.p&&oe(_,d[3].g.p)},d(d){d&&$(e),d&&$(u),d&&$(a),h=!1,ze(v)}}}function b_(t){let e,l=t[107]*100+"",n;return{c(){e=c("option"),n=N(l),e.__value=t[107]*100,e.value=e.__value},m(i,o){S(i,e,o),s(e,n)},p:pe,d(i){i&&$(e)}}}function xu(t){let e,l,n,i;return{c(){e=c("br"),l=c("input"),r(l,"name","mek"),r(l,"type","text"),r(l,"class","in-s")},m(o,u){S(o,e,u),S(o,l,u),oe(l,t[3].m.e.k),n||(i=te(l,"input",t[33]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].m.e.k&&oe(l,o[3].m.e.k)},d(o){o&&$(e),o&&$(l),n=!1,i()}}}function ef(t){let e,l,n,i,o,u,a;return{c(){e=c("div"),l=N("Authentication key"),n=c("br"),i=b(),o=c("input"),r(o,"name","mea"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1")},m(m,f){S(m,e,f),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].m.e.a),u||(a=te(o,"input",t[34]),u=!0)},p(m,f){f[0]&8&&o.value!==m[3].m.e.a&&oe(o,m[3].m.e.a)},d(m){m&&$(e),u=!1,a()}}}function tf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w,D,M,E,R,O,F,y,P,ne,H;return{c(){e=c("div"),l=c("div"),n=N("Watt"),i=c("br"),o=b(),u=c("input"),a=b(),m=c("div"),f=N("Volt"),p=c("br"),_=b(),h=c("input"),v=b(),d=c("div"),g=N("Amp"),w=c("br"),D=b(),M=c("input"),E=b(),R=c("div"),O=N("kWh"),F=c("br"),y=b(),P=c("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(h,"name","mmv"),r(h,"type","number"),r(h,"min","0.00"),r(h,"max","1000"),r(h,"step","0.001"),r(h,"class","in-m tr w-full"),r(m,"class","w-1/4"),r(M,"name","mma"),r(M,"type","number"),r(M,"min","0.00"),r(M,"max","1000"),r(M,"step","0.001"),r(M,"class","in-m tr w-full"),r(d,"class","w-1/4"),r(P,"name","mmc"),r(P,"type","number"),r(P,"min","0.00"),r(P,"max","1000"),r(P,"step","0.001"),r(P,"class","in-l tr w-full"),r(R,"class","w-1/4"),r(e,"class","flex my-1")},m(z,U){S(z,e,U),s(e,l),s(l,n),s(l,i),s(l,o),s(l,u),oe(u,t[3].m.m.w),s(e,a),s(e,m),s(m,f),s(m,p),s(m,_),s(m,h),oe(h,t[3].m.m.v),s(e,v),s(e,d),s(d,g),s(d,w),s(d,D),s(d,M),oe(M,t[3].m.m.a),s(e,E),s(e,R),s(R,O),s(R,F),s(R,y),s(R,P),oe(P,t[3].m.m.c),ne||(H=[te(u,"input",t[36]),te(h,"input",t[37]),te(M,"input",t[38]),te(P,"input",t[39])],ne=!0)},p(z,U){U[0]&8&&ge(u.value)!==z[3].m.m.w&&oe(u,z[3].m.m.w),U[0]&8&&ge(h.value)!==z[3].m.m.v&&oe(h,z[3].m.m.v),U[0]&8&&ge(M.value)!==z[3].m.m.a&&oe(M,z[3].m.m.a),U[0]&8&&ge(P.value)!==z[3].m.m.c&&oe(P,z[3].m.m.c)},d(z){z&&$(e),ne=!1,ze(H)}}}function lf(t){let e;return{c(){e=c("option"),e.textContent="Ethernet",e.__value=3,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function nf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w,D,M,E,R,O,F,y,P,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V;return{c(){e=c("div"),l=N("SSID"),n=c("br"),i=b(),o=c("input"),u=b(),a=c("div"),m=N("Password"),f=c("br"),p=b(),_=c("input"),h=b(),v=c("div"),d=c("div"),g=N("Power saving"),w=c("br"),D=b(),M=c("select"),E=c("option"),E.textContent="Default",R=c("option"),R.textContent="Off",O=c("option"),O.textContent="Minimum",F=c("option"),F.textContent="Maximum",y=b(),P=c("div"),ne=N("Power"),H=c("br"),z=b(),U=c("div"),K=c("input"),Q=b(),G=c("span"),G.textContent="dBm",X=b(),Y=c("div"),j=c("label"),x=c("input"),ae=N(" Allow 802.11b legacy rates"),r(o,"name","ws"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(_,"name","wp"),r(_,"type","password"),r(_,"class","in-s"),r(a,"class","my-1"),E.__value=255,E.value=E.__value,R.__value=0,R.value=R.__value,O.__value=1,O.value=O.__value,F.__value=2,F.value=F.__value,r(M,"name","wz"),r(M,"class","in-s"),t[3].w.z===void 0&&We(()=>t[43].call(M)),r(d,"class","w-1/2"),r(K,"name","ww"),r(K,"type","number"),r(K,"min","0"),r(K,"max","20.5"),r(K,"step","0.5"),r(K,"class","in-f tr w-full"),r(G,"class","in-post"),r(U,"class","flex"),r(P,"class","ml-2 w-1/2"),r(v,"class","my-1 flex"),r(x,"type","checkbox"),r(x,"name","wb"),x.__value="true",x.value=x.__value,r(x,"class","rounded mb-1"),r(Y,"class","my-3")},m(W,we){S(W,e,we),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].w.s),S(W,u,we),S(W,a,we),s(a,m),s(a,f),s(a,p),s(a,_),oe(_,t[3].w.p),S(W,h,we),S(W,v,we),s(v,d),s(d,g),s(d,w),s(d,D),s(d,M),s(M,E),s(M,R),s(M,O),s(M,F),$e(M,t[3].w.z,!0),s(v,y),s(v,P),s(P,ne),s(P,H),s(P,z),s(P,U),s(U,K),oe(K,t[3].w.w),s(U,Q),s(U,G),S(W,X,we),S(W,Y,we),s(Y,j),s(j,x),x.checked=t[3].w.b,s(j,ae),ee||(V=[te(o,"input",t[41]),te(_,"input",t[42]),te(M,"change",t[43]),te(K,"input",t[44]),te(x,"change",t[45])],ee=!0)},p(W,we){we[0]&8&&o.value!==W[3].w.s&&oe(o,W[3].w.s),we[0]&8&&_.value!==W[3].w.p&&oe(_,W[3].w.p),we[0]&8&&$e(M,W[3].w.z),we[0]&8&&ge(K.value)!==W[3].w.w&&oe(K,W[3].w.w),we[0]&8&&(x.checked=W[3].w.b)},d(W){W&&$(e),W&&$(u),W&&$(a),W&&$(h),W&&$(v),W&&$(X),W&&$(Y),ee=!1,ze(V)}}}function sf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w;return{c(){e=c("div"),l=N("Gateway"),n=c("br"),i=b(),o=c("input"),u=b(),a=c("div"),m=N("DNS"),f=c("br"),p=b(),_=c("div"),h=c("input"),v=b(),d=c("input"),r(o,"name","ng"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(h,"name","nd1"),r(h,"type","text"),r(h,"class","in-f w-full"),r(d,"name","nd2"),r(d,"type","text"),r(d,"class","in-l w-full"),r(_,"class","flex"),r(a,"class","my-1")},m(D,M){S(D,e,M),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].n.g),S(D,u,M),S(D,a,M),s(a,m),s(a,f),s(a,p),s(a,_),s(_,h),oe(h,t[3].n.d1),s(_,v),s(_,d),oe(d,t[3].n.d2),g||(w=[te(o,"input",t[49]),te(h,"input",t[50]),te(d,"input",t[51])],g=!0)},p(D,M){M[0]&8&&o.value!==D[3].n.g&&oe(o,D[3].n.g),M[0]&8&&h.value!==D[3].n.d1&&oe(h,D[3].n.d1),M[0]&8&&d.value!==D[3].n.d2&&oe(d,D[3].n.d2)},d(D){D&&$(e),D&&$(u),D&&$(a),g=!1,ze(w)}}}function of(t){let e,l,n,i,o;return{c(){e=c("label"),l=c("input"),n=N(" 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){S(u,e,a),s(e,l),l.checked=t[3].q.s.e,s(e,n),i||(o=[te(l,"change",t[55]),te(l,"change",t[14])],i=!0)},p(u,a){a[0]&8&&(l.checked=u[3].q.s.e)},d(u){u&&$(e),i=!1,ze(o)}}}function rf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v;const d=[k_,g_],g=[];function w(y,P){return y[3].q.s.c?0:1}n=w(t),i=g[n]=d[n](t);const D=[$_,C_],M=[];function E(y,P){return y[3].q.s.r?0:1}a=E(t),m=M[a]=D[a](t);const R=[N_,T_],O=[];function F(y,P){return y[3].q.s.k?0:1}return _=F(t),h=O[_]=R[_](t),{c(){e=c("div"),l=c("span"),i.c(),o=b(),u=c("span"),m.c(),f=b(),p=c("span"),h.c(),r(l,"class","flex pr-2"),r(u,"class","flex pr-2"),r(p,"class","flex pr-2"),r(e,"class","my-1 flex")},m(y,P){S(y,e,P),s(e,l),g[n].m(l,null),s(e,o),s(e,u),M[a].m(u,null),s(e,f),s(e,p),O[_].m(p,null),v=!0},p(y,P){let ne=n;n=w(y),n===ne?g[n].p(y,P):(Ae(),q(g[ne],1,1,()=>{g[ne]=null}),Pe(),i=g[n],i?i.p(y,P):(i=g[n]=d[n](y),i.c()),I(i,1),i.m(l,null));let H=a;a=E(y),a===H?M[a].p(y,P):(Ae(),q(M[H],1,1,()=>{M[H]=null}),Pe(),m=M[a],m?m.p(y,P):(m=M[a]=D[a](y),m.c()),I(m,1),m.m(u,null));let z=_;_=F(y),_===z?O[_].p(y,P):(Ae(),q(O[z],1,1,()=>{O[z]=null}),Pe(),h=O[_],h?h.p(y,P):(h=O[_]=R[_](y),h.c()),I(h,1),h.m(p,null))},i(y){v||(I(i),I(m),I(h),v=!0)},o(y){q(i),q(m),q(h),v=!1},d(y){y&&$(e),g[n].d(),M[a].d(),O[_].d()}}}function g_(t){let e,l;return e=new Qt({props:{to:"/mqtt-ca",$$slots:{default:[w_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i[3]&1048576&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function k_(t){let e,l,n,i,o,u,a,m;return l=new Qt({props:{to:"/mqtt-ca",$$slots:{default:[y_]},$$scope:{ctx:t}}}),o=new gs({}),{c(){e=c("span"),re(l.$$.fragment),n=b(),i=c("span"),re(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,p){S(f,e,p),ie(l,e,null),S(f,n,p),S(f,i,p),ie(o,i,null),u=!0,a||(m=[te(i,"click",t[11]),te(i,"keypress",t[11])],a=!0)},p(f,p){const _={};p[3]&1048576&&(_.$$scope={dirty:p,ctx:f}),l.$set(_)},i(f){u||(I(l.$$.fragment,f),I(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&$(e),se(l),f&&$(n),f&&$(i),se(o),a=!1,ze(m)}}}function w_(t){let e,l;return e=new an({props:{color:"blue",text:"Upload CA",title:"Click here to upload CA"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function y_(t){let e;return{c(){e=N("CA OK")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function C_(t){let e,l;return e=new Qt({props:{to:"/mqtt-cert",$$slots:{default:[S_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i[3]&1048576&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function $_(t){let e,l,n,i,o,u,a,m;return l=new Qt({props:{to:"/mqtt-cert",$$slots:{default:[M_]},$$scope:{ctx:t}}}),o=new gs({}),{c(){e=c("span"),re(l.$$.fragment),n=b(),i=c("span"),re(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,p){S(f,e,p),ie(l,e,null),S(f,n,p),S(f,i,p),ie(o,i,null),u=!0,a||(m=[te(i,"click",t[12]),te(i,"keypress",t[12])],a=!0)},p(f,p){const _={};p[3]&1048576&&(_.$$scope={dirty:p,ctx:f}),l.$set(_)},i(f){u||(I(l.$$.fragment,f),I(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&$(e),se(l),f&&$(n),f&&$(i),se(o),a=!1,ze(m)}}}function S_(t){let e,l;return e=new an({props:{color:"blue",text:"Upload cert",title:"Click here to upload certificate"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function M_(t){let e;return{c(){e=N("Cert OK")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function T_(t){let e,l;return e=new Qt({props:{to:"/mqtt-key",$$slots:{default:[E_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i[3]&1048576&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function N_(t){let e,l,n,i,o,u,a,m;return l=new Qt({props:{to:"/mqtt-key",$$slots:{default:[A_]},$$scope:{ctx:t}}}),o=new gs({}),{c(){e=c("span"),re(l.$$.fragment),n=b(),i=c("span"),re(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,p){S(f,e,p),ie(l,e,null),S(f,n,p),S(f,i,p),ie(o,i,null),u=!0,a||(m=[te(i,"click",t[13]),te(i,"keypress",t[13])],a=!0)},p(f,p){const _={};p[3]&1048576&&(_.$$scope={dirty:p,ctx:f}),l.$set(_)},i(f){u||(I(l.$$.fragment,f),I(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&$(e),se(l),f&&$(n),f&&$(i),se(o),a=!1,ze(m)}}}function E_(t){let e,l;return e=new an({props:{color:"blue",text:"Upload key",title:"Click here to upload key"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function A_(t){let e;return{c(){e=N("Key OK")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function af(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w,D,M,E,R,O,F,y,P,ne,H,z,U,K,Q,G,X;return o=new Lt({}),{c(){e=c("div"),l=c("strong"),l.textContent="Domoticz",n=b(),i=c("a"),re(o.$$.fragment),u=b(),a=c("input"),m=b(),f=c("div"),p=c("div"),_=N("Electricity IDX"),h=c("br"),v=b(),d=c("input"),g=b(),w=c("div"),D=N("Current IDX"),M=c("br"),E=b(),R=c("input"),O=b(),F=c("div"),y=N(`Voltage IDX: L1, L2 & L3 + `),o.c(),l=Ke()},m(u,a){S(u,e,a),o.m(u,a),S(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&&$(e),o.d(u),u&&$(l)}}}function A0(t){let e,l;return{c(){e=N(t[0]),l=N(" seconds")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&1&&J(e,n[0])},d(n){n&&$(e),n&&$(l)}}}function P0(t){let e,l;return{c(){e=N(t[3]),l=N(" minute")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&8&&J(e,n[3])},d(n){n&&$(e),n&&$(l)}}}function D0(t){let e,l;return{c(){e=N(t[3]),l=N(" minutes")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&8&&J(e,n[3])},d(n){n&&$(e),n&&$(l)}}}function L0(t){let e,l;return{c(){e=N(t[2]),l=N(" hour")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&4&&J(e,n[2])},d(n){n&&$(e),n&&$(l)}}}function R0(t){let e,l;return{c(){e=N(t[2]),l=N(" hours")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&4&&J(e,n[2])},d(n){n&&$(e),n&&$(l)}}}function I0(t){let e,l;return{c(){e=N(t[1]),l=N(" day")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&2&&J(e,n[1])},d(n){n&&$(e),n&&$(l)}}}function O0(t){let e,l;return{c(){e=N(t[1]),l=N(" days")},m(n,i){S(n,e,i),S(n,l,i)},p(n,i){i&2&&J(e,n[1])},d(n){n&&$(e),n&&$(l)}}}function F0(t){let e,l=t[0]&&Oa(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),S(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Oa(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:pe,o:pe,d(n){l&&l.d(n),n&&$(e)}}}function q0(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 B0 extends Re{constructor(e){super(),Le(this,e,q0,F0,Ee,{epoch:0})}}function U0(t){let e,l,n;return{c(){e=c("span"),l=N(t[2]),r(e,"title",t[1]),r(e,"class",n="bd-"+t[0])},m(i,o){S(i,e,o),s(e,l)},p(i,[o]){o&4&&J(l,i[2]),o&2&&r(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&r(e,"class",n)},i:pe,o:pe,d(i){i&&$(e)}}}function j0(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 an extends Re{constructor(e){super(),Le(this,e,j0,U0,Ee,{color:0,title:1,text:2})}}function H0(t){let e,l=`${Ue(t[0].getDate())}.${Ue(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Ue(t[0].getHours())}:${Ue(t[0].getMinutes())}`,n;return{c(){e=c("span"),n=N(l),r(e,"class",t[1])},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Ue(i[0].getDate())}.${Ue(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Ue(i[0].getHours())}:${Ue(i[0].getMinutes())}`)&&J(n,l),o&2&&r(e,"class",i[1])},d(i){i&&$(e)}}}function W0(t){let e=`${Ue(t[0].getDate())}. ${Ys[t[0].getMonth()]} ${Ue(t[0].getHours())}:${Ue(t[0].getMinutes())}`,l;return{c(){l=N(e)},m(n,i){S(n,l,i)},p(n,i){i&1&&e!==(e=`${Ue(n[0].getDate())}. ${Ys[n[0].getMonth()]} ${Ue(n[0].getHours())}:${Ue(n[0].getMinutes())}`)&&J(l,e)},d(n){n&&$(l)}}}function z0(t){let e;function l(o,u){return o[2]?W0:H0}let n=l(t),i=n(t);return{c(){i.c(),e=Ke()},m(o,u){i.m(o,u),S(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:pe,o:pe,d(o){i.d(o),o&&$(e)}}}function G0(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)||dl(n,o-(24+n.getHours()-n.getUTCHours())%24))},[n,i,u,o]}class Zc extends Re{constructor(e){super(),Le(this,e,G0,z0,Ee,{timestamp:0,fullTimeColor:1,offset:3})}}function V0(t){let e,l,n;return{c(){e=De("svg"),l=De("path"),n=De("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){S(i,e,o),s(e,l),s(e,n)},p:pe,i:pe,o:pe,d(i){i&&$(e)}}}class K0 extends Re{constructor(e){super(),Le(this,e,null,V0,Ee,{})}}function Y0(t){let e,l;return{c(){e=De("svg"),l=De("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){S(n,e,i),s(e,l)},p:pe,i:pe,o:pe,d(n){n&&$(e)}}}class Q0 extends Re{constructor(e){super(),Le(this,e,null,Y0,Ee,{})}}function X0(t){let e,l;return{c(){e=De("svg"),l=De("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){S(n,e,i),s(e,l)},p:pe,i:pe,o:pe,d(n){n&&$(e)}}}class Lt extends Re{constructor(e){super(),Le(this,e,null,X0,Ee,{})}}function Z0(t){let e,l;return{c(){e=De("svg"),l=De("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){S(n,e,i),s(e,l)},p:pe,i:pe,o:pe,d(n){n&&$(e)}}}class Jc extends Re{constructor(e){super(),Le(this,e,null,Z0,Ee,{})}}function J0(t){let e,l,n=t[1].version+"",i;return{c(){e=N("AMS reader "),l=c("span"),i=N(n)},m(o,u){S(o,e,u),S(o,l,u),s(l,i)},p(o,u){u&2&&n!==(n=o[1].version+"")&&J(i,n)},d(o){o&&$(e),o&&$(l)}}}function Fa(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=c("div"),n=N(l),i=N("\xB0C"),r(e,"class","flex-none my-auto")},m(o,u){S(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):"-")+"")&&J(n,l)},d(o){o&&$(e)}}}function qa(t){let e,l="HAN: "+Ta(t[0].he),n;return{c(){e=c("div"),n=N(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="HAN: "+Ta(i[0].he))&&J(n,l)},d(i){i&&$(e)}}}function Ba(t){let e,l="MQTT: "+Na(t[0].me),n;return{c(){e=c("div"),n=N(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="MQTT: "+Na(i[0].me))&&J(n,l)},d(i){i&&$(e)}}}function Ua(t){let e,l="Price service: "+Ea(t[0].ee),n;return{c(){e=c("div"),n=N(l),r(e,"class","bd-red")},m(i,o){S(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="Price service: "+Ea(i[0].ee))&&J(n,l)},d(i){i&&$(e)}}}function ja(t){let e,l,n,i,o,u;return l=new Qt({props:{to:"/configuration",$$slots:{default:[x0]},$$scope:{ctx:t}}}),o=new Qt({props:{to:"/status",$$slots:{default:[em]},$$scope:{ctx:t}}}),{c(){e=c("div"),re(l.$$.fragment),n=b(),i=c("div"),re(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,m){S(a,e,m),ie(l,e,null),S(a,n,m),S(a,i,m),ie(o,i,null),u=!0},i(a){u||(I(l.$$.fragment,a),I(o.$$.fragment,a),u=!0)},o(a){q(l.$$.fragment,a),q(o.$$.fragment,a),u=!1},d(a){a&&$(e),se(l),a&&$(n),a&&$(i),se(o)}}}function x0(t){let e,l;return e=new K0({}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function em(t){let e,l;return e=new Q0({}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function Ha(t){let e,l,n,i,o;const u=[lm,tm],a=[];function m(f,p){return f[1].security==0||f[0].a?0:1}return l=m(t),n=a[l]=u[l](t),{c(){e=c("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,p){S(f,e,p),a[l].m(e,null),o=!0},p(f,p){let _=l;l=m(f),l===_?a[l].p(f,p):(Ae(),q(a[_],1,1,()=>{a[_]=null}),Pe(),n=a[l],n?n.p(f,p):(n=a[l]=u[l](f),n.c()),I(n,1),n.m(e,null)),(!o||p&4&&i!==(i="New version: "+f[2].tag_name))&&r(e,"title",i)},i(f){o||(I(n),o=!0)},o(f){q(n),o=!1},d(f){f&&$(e),a[l].d()}}}function tm(t){let e,l,n=t[2].tag_name+"",i;return{c(){e=c("span"),l=N("New version: "),i=N(n)},m(o,u){S(o,e,u),s(e,l),s(e,i)},p(o,u){u&4&&n!==(n=o[2].tag_name+"")&&J(i,n)},i:pe,o:pe,d(o){o&&$(e)}}}function lm(t){let e,l,n,i=t[2].tag_name+"",o,u,a,m,f,p;return a=new Jc({}),{c(){e=c("button"),l=c("span"),n=N("New version: "),o=N(i),u=b(),re(a.$$.fragment),r(l,"class","mt-1"),r(e,"class","flex")},m(_,h){S(_,e,h),s(e,l),s(l,n),s(l,o),s(e,u),ie(a,e,null),m=!0,f||(p=te(e,"click",t[3]),f=!0)},p(_,h){(!m||h&4)&&i!==(i=_[2].tag_name+"")&&J(o,i)},i(_){m||(I(a.$$.fragment,_),m=!0)},o(_){q(a.$$.fragment,_),m=!1},d(_){_&&$(e),se(a),f=!1,p()}}}function nm(t){let e,l,n,i,o,u,a,m,f,p,_,h,v=(t[0].m?(t[0].m/1e3).toFixed(1):"-")+"",d,g,w,D,M,E,R,O,F,y,P,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Ie,Se;i=new Qt({props:{to:"/",$$slots:{default:[J0]},$$scope:{ctx:t}}}),m=new B0({props:{epoch:t[0].u}});let ye=t[0].t>-50&&Fa(t);M=new an({props:{title:"ESP",text:t[1].booting?"Booting":t[0].v>2?t[0].v.toFixed(2)+"V":"ESP",color:Bl(t[1].booting?2:t[0].em)}}),R=new an({props:{title:"HAN",text:"HAN",color:Bl(t[1].booting?9:t[0].hm)}}),F=new an({props:{title:"WiFi",text:t[0].r?t[0].r.toFixed(0)+"dBm":"WiFi",color:Bl(t[1].booting?9:t[0].wm)}}),P=new an({props:{title:"MQTT",text:"MQTT",color:Bl(t[1].booting?9:t[0].mm)}});let ve=(t[0].he<0||t[0].he>0)&&qa(t),Te=t[0].me<0&&Ba(t),be=(t[0].ee>0||t[0].ee<0)&&Ua(t);ae=new Zc({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),offset:t[1].clock_offset,fullTimeColor:"text-red-500"}});let T=t[1].vndcfg&&t[1].usrcfg&&ja(t);He=new Lt({});let C=t[1].fwconsent===1&&t[2]&&Ha(t);return{c(){e=c("nav"),l=c("div"),n=c("div"),re(i.$$.fragment),o=b(),u=c("div"),a=c("div"),re(m.$$.fragment),f=b(),ye&&ye.c(),p=b(),_=c("div"),h=N("Free mem: "),d=N(v),g=N("kb"),w=b(),D=c("div"),re(M.$$.fragment),E=b(),re(R.$$.fragment),O=b(),re(F.$$.fragment),y=b(),re(P.$$.fragment),ne=b(),ve&&ve.c(),H=b(),Te&&Te.c(),z=b(),be&&be.c(),U=b(),K=c("div"),Q=c("div"),G=c("a"),X=c("img"),j=b(),x=c("div"),re(ae.$$.fragment),ee=b(),T&&T.c(),V=b(),W=c("div"),we=c("a"),re(He.$$.fragment),Ie=b(),C&&C.c(),r(n,"class","flex text-lg text-gray-100 p-2"),r(a,"class","flex-none my-auto"),r(_,"class","flex-none my-auto"),r(u,"class","flex-none my-auto p-2 flex space-x-4"),r(D,"class","flex-auto flex-wrap my-auto justify-center p-2"),r(X,"class","gh-logo"),Ws(X.src,Y=E0)||r(X,"src",Y),r(X,"alt","GitHub repo"),r(G,"class","float-right"),r(G,"href","https://github.com/UtilitechAS/amsreader-firmware"),r(G,"target","_blank"),r(G,"rel","noreferrer"),r(G,"aria-label","GitHub"),r(Q,"class","flex-none"),r(x,"class","flex-none my-auto px-2"),r(we,"href",Rt("")),r(we,"target","_blank"),r(we,"rel","noreferrer"),r(W,"class","flex-none px-1 mt-1"),r(W,"title","Documentation"),r(K,"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","hdr")},m(k,A){S(k,e,A),s(e,l),s(l,n),ie(i,n,null),s(l,o),s(l,u),s(u,a),ie(m,a,null),s(u,f),ye&&ye.m(u,null),s(u,p),s(u,_),s(_,h),s(_,d),s(_,g),s(l,w),s(l,D),ie(M,D,null),s(D,E),ie(R,D,null),s(D,O),ie(F,D,null),s(D,y),ie(P,D,null),s(l,ne),ve&&ve.m(l,null),s(l,H),Te&&Te.m(l,null),s(l,z),be&&be.m(l,null),s(l,U),s(l,K),s(K,Q),s(Q,G),s(G,X),s(K,j),s(K,x),ie(ae,x,null),s(K,ee),T&&T.m(K,null),s(K,V),s(K,W),s(W,we),ie(He,we,null),s(K,Ie),C&&C.m(K,null),Se=!0},p(k,[A]){const L={};A&18&&(L.$$scope={dirty:A,ctx:k}),i.$set(L);const Z={};A&1&&(Z.epoch=k[0].u),m.$set(Z),k[0].t>-50?ye?ye.p(k,A):(ye=Fa(k),ye.c(),ye.m(u,p)):ye&&(ye.d(1),ye=null),(!Se||A&1)&&v!==(v=(k[0].m?(k[0].m/1e3).toFixed(1):"-")+"")&&J(d,v);const le={};A&3&&(le.text=k[1].booting?"Booting":k[0].v>2?k[0].v.toFixed(2)+"V":"ESP"),A&3&&(le.color=Bl(k[1].booting?2:k[0].em)),M.$set(le);const fe={};A&3&&(fe.color=Bl(k[1].booting?9:k[0].hm)),R.$set(fe);const de={};A&1&&(de.text=k[0].r?k[0].r.toFixed(0)+"dBm":"WiFi"),A&3&&(de.color=Bl(k[1].booting?9:k[0].wm)),F.$set(de);const Ce={};A&3&&(Ce.color=Bl(k[1].booting?9:k[0].mm)),P.$set(Ce),k[0].he<0||k[0].he>0?ve?ve.p(k,A):(ve=qa(k),ve.c(),ve.m(l,H)):ve&&(ve.d(1),ve=null),k[0].me<0?Te?Te.p(k,A):(Te=Ba(k),Te.c(),Te.m(l,z)):Te&&(Te.d(1),Te=null),k[0].ee>0||k[0].ee<0?be?be.p(k,A):(be=Ua(k),be.c(),be.m(l,U)):be&&(be.d(1),be=null);const Oe={};A&1&&(Oe.timestamp=k[0].c?new Date(k[0].c*1e3):new Date(0)),A&2&&(Oe.offset=k[1].clock_offset),ae.$set(Oe),k[1].vndcfg&&k[1].usrcfg?T?A&2&&I(T,1):(T=ja(k),T.c(),I(T,1),T.m(K,V)):T&&(Ae(),q(T,1,1,()=>{T=null}),Pe()),k[1].fwconsent===1&&k[2]?C?(C.p(k,A),A&6&&I(C,1)):(C=Ha(k),C.c(),I(C,1),C.m(K,null)):C&&(Ae(),q(C,1,1,()=>{C=null}),Pe())},i(k){Se||(I(i.$$.fragment,k),I(m.$$.fragment,k),I(M.$$.fragment,k),I(R.$$.fragment,k),I(F.$$.fragment,k),I(P.$$.fragment,k),I(ae.$$.fragment,k),I(T),I(He.$$.fragment,k),I(C),Se=!0)},o(k){q(i.$$.fragment,k),q(m.$$.fragment,k),q(M.$$.fragment,k),q(R.$$.fragment,k),q(F.$$.fragment,k),q(P.$$.fragment,k),q(ae.$$.fragment,k),q(T),q(He.$$.fragment,k),q(C),Se=!1},d(k){k&&$(e),se(i),se(m),ye&&ye.d(),se(M),se(R),se(F),se(P),ve&&ve.d(),Te&&Te.d(),be&&be.d(),se(ae),T&&T.d(),se(He),C&&C.d()}}}function im(t,e,l){let{data:n={}}=e,i={},o={};function u(){confirm("Do you want to upgrade this device to "+o.tag_name+"?")&&(!ti(i.board)||confirm(hs(he(i.chip,i.board))))&&(Wt.update(a=>(a.upgrading=!0,a)),Qc(o.tag_name))}return Wt.subscribe(a=>{l(1,i=a),a.fwconsent===1&&T0()}),yo.subscribe(a=>{l(2,o=Xc(i.version,a))}),t.$$set=a=>{"data"in a&&l(0,n=a.data)},[n,i,o,u]}class sm extends Re{constructor(e){super(),Le(this,e,im,nm,Ee,{data:0})}}function om(t){let e,l,n,i;return{c(){e=De("svg"),l=De("path"),n=De("path"),r(l,"d",Hs(150,150,115,210,510)),r(l,"stroke","rgba(128, 128, 128, 0.15)"),r(l,"fill","none"),r(l,"stroke-width","55"),r(n,"d",i=Hs(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){S(o,e,u),s(e,l),s(e,n)},p(o,[u]){u&1&&i!==(i=Hs(150,150,115,210,210+300*o[0]/100))&&r(n,"d",i),u&2&&r(n,"stroke",o[1])},i:pe,o:pe,d(o){o&&$(e)}}}function Wa(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 Hs(t,e,l,n,i){var o=Wa(t,e,l,i),u=Wa(t,e,l,n),a=i-n<=180?"0":"1",m=["M",o.x,o.y,"A",l,l,0,a,0,u.x,u.y].join(" ");return m}function rm(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 am extends Re{constructor(e){super(),Le(this,e,rm,om,Ee,{pct:0,color:1})}}function za(t){let e,l,n,i,o,u,a,m;return{c(){e=c("br"),l=b(),n=c("span"),i=N(t[3]),o=b(),u=c("span"),a=N(t[4]),m=N("/kWh"),r(n,"class","pl-sub"),r(u,"class","pl-snt")},m(f,p){S(f,e,p),S(f,l,p),S(f,n,p),s(n,i),S(f,o,p),S(f,u,p),s(u,a),s(u,m)},p(f,p){p&8&&J(i,f[3]),p&16&&J(a,f[4])},d(f){f&&$(e),f&&$(l),f&&$(n),f&&$(o),f&&$(u)}}}function um(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w;l=new am({props:{pct:t[6],color:t[5](t[6],document.documentElement.classList.contains("dark"))}});let D=t[3]&&za(t);return{c(){e=c("div"),re(l.$$.fragment),n=b(),i=c("span"),o=c("span"),u=N(t[2]),a=b(),m=c("br"),f=b(),p=c("span"),_=N(t[0]),h=b(),v=c("span"),d=N(t[1]),g=b(),D&&D.c(),r(o,"class","pl-lab"),r(p,"class","pl-val"),r(v,"class","pl-unt"),r(i,"class","pl-ov"),r(e,"class","pl-root")},m(M,E){S(M,e,E),ie(l,e,null),s(e,n),s(e,i),s(i,o),s(o,u),s(i,a),s(i,m),s(i,f),s(i,p),s(p,_),s(i,h),s(i,v),s(v,d),s(i,g),D&&D.m(i,null),w=!0},p(M,[E]){const R={};E&64&&(R.pct=M[6]),E&96&&(R.color=M[5](M[6],document.documentElement.classList.contains("dark"))),l.$set(R),(!w||E&4)&&J(u,M[2]),(!w||E&1)&&J(_,M[0]),(!w||E&2)&&J(d,M[1]),M[3]?D?D.p(M,E):(D=za(M),D.c(),D.m(i,null)):D&&(D.d(1),D=null)},i(M){w||(I(l.$$.fragment,M),w=!0)},o(M){q(l.$$.fragment,M),w=!1},d(M){M&&$(e),se(l),D&&D.d()}}}function fm(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:u}=e,{sub:a=""}=e,{subunit:m=""}=e,{colorFn:f}=e,p=0;return t.$$set=_=>{"val"in _&&l(0,n=_.val),"max"in _&&l(7,i=_.max),"unit"in _&&l(1,o=_.unit),"label"in _&&l(2,u=_.label),"sub"in _&&l(3,a=_.sub),"subunit"in _&&l(4,m=_.subunit),"colorFn"in _&&l(5,f=_.colorFn)},t.$$.update=()=>{t.$$.dirty&129&&l(6,p=Math.min(n,i)/i*100)},[n,o,u,a,m,f,p,i]}class xc extends Re{constructor(e){super(),Le(this,e,fm,um,Ee,{val:0,max:7,unit:1,label:2,sub:3,subunit:4,colorFn:5})}}function Ga(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Va(t,e,l){const n=t.slice();return n[11]=e[l],n[13]=l,n}function Ka(t,e,l){const n=t.slice();return n[15]=e[l],n}function Ya(t){let e,l,n,i,o,u,a=t[0].title&&Qa(t),m=t[0].y.ticks,f=[];for(let d=0;dt[9].call(e))},m(o,u){S(o,e,u),s(e,n),i=mo(e,t[9].bind(e))},p(o,u){u&1&&l!==(l=o[0].title+"")&&J(n,l)},d(o){o&&$(e),i()}}}function Xa(t){let e,l,n,i=t[15].label+"",o,u,a,m;return{c(){e=De("g"),l=De("line"),n=De("text"),o=N(i),r(l,"x2","100%"),r(n,"y","-4"),r(n,"x",u=t[15].align=="right"?"85%":""),r(e,"class",a="tick tick-"+t[15].value+" tick-"+t[15].color),r(e,"transform",m="translate(0, "+t[7](t[15].value)+")")},m(f,p){S(f,e,p),s(e,l),s(e,n),s(n,o)},p(f,p){p&1&&i!==(i=f[15].label+"")&&J(o,i),p&1&&u!==(u=f[15].align=="right"?"85%":"")&&r(n,"x",u),p&1&&a!==(a="tick tick-"+f[15].value+" tick-"+f[15].color)&&r(e,"class",a),p&129&&m!==(m="translate(0, "+f[7](f[15].value)+")")&&r(e,"transform",m)},d(f){f&&$(e)}}}function Za(t){let e=!isNaN(t[7](t[15].value)),l,n=e&&Xa(t);return{c(){n&&n.c(),l=Ke()},m(i,o){n&&n.m(i,o),S(i,l,o)},p(i,o){o&129&&(e=!isNaN(i[7](i[15].value))),e?n?n.p(i,o):(n=Xa(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&$(l)}}}function Ja(t){let e,l,n=(t[3]>20||t[13]%2==0)&&xa(t);return{c(){e=De("g"),n&&n.c(),r(e,"class","tick"),r(e,"transform",l="translate("+t[6](t[13])+","+t[4]+")")},m(i,o){S(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[13]%2==0?n?n.p(i,o):(n=xa(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&80&&l!==(l="translate("+i[6](i[13])+","+i[4]+")")&&r(e,"transform",l)},d(i){i&&$(e),n&&n.d()}}}function xa(t){let e,l=t[11].label+"",n,i;return{c(){e=De("text"),n=N(l),r(e,"x",i=t[3]/2),r(e,"y","-4")},m(o,u){S(o,e,u),s(e,n)},p(o,u){u&1&&l!==(l=o[11].label+"")&&J(n,l),u&8&&i!==(i=o[3]/2)&&r(e,"x",i)},d(o){o&&$(e)}}}function eu(t){let e=!isNaN(t[6](t[13])),l,n=e&&Ja(t);return{c(){n&&n.c(),l=Ke()},m(i,o){n&&n.m(i,o),S(i,l,o)},p(i,o){o&64&&(e=!isNaN(i[6](i[13]))),e?n?n.p(i,o):(n=Ja(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&$(l)}}}function tu(t){let e,l,n=t[11].value!==void 0&&lu(t),i=t[11].value2>1e-4&&su(t);return{c(){e=De("g"),n&&n.c(),l=De("g"),i&&i.c()},m(o,u){S(o,e,u),n&&n.m(e,null),S(o,l,u),i&&i.m(l,null)},p(o,u){o[11].value!==void 0?n?n.p(o,u):(n=lu(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[11].value2>1e-4?i?i.p(o,u):(i=su(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&$(e),n&&n.d(),o&&$(l),i&&i.d()}}}function lu(t){let e,l,n,i,o,u,a,m=t[3]>15&&nu(t);return{c(){e=De("rect"),m&&m.c(),a=Ke(),r(e,"x",l=t[6](t[13])+2),r(e,"y",n=t[7](t[11].value)),r(e,"width",i=t[3]-4),r(e,"height",o=t[7](t[0].y.min)-t[7](Math.min(t[0].y.min,0)+t[11].value)),r(e,"fill",u=t[11].color)},m(f,p){S(f,e,p),m&&m.m(f,p),S(f,a,p)},p(f,p){p&64&&l!==(l=f[6](f[13])+2)&&r(e,"x",l),p&129&&n!==(n=f[7](f[11].value))&&r(e,"y",n),p&8&&i!==(i=f[3]-4)&&r(e,"width",i),p&129&&o!==(o=f[7](f[0].y.min)-f[7](Math.min(f[0].y.min,0)+f[11].value))&&r(e,"height",o),p&1&&u!==(u=f[11].color)&&r(e,"fill",u),f[3]>15?m?m.p(f,p):(m=nu(f),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},d(f){f&&$(e),m&&m.d(f),f&&$(a)}}}function nu(t){let e,l=t[11].label+"",n,i,o,u,a,m,f=t[11].title&&iu(t);return{c(){e=De("text"),n=N(l),f&&f.c(),m=Ke(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor",o=t[3]t[7](0)-t[8]?t[11].color:"white"),r(e,"transform",a="translate("+(t[6](t[13])+t[3]/2)+" "+(t[7](t[11].value)>t[7](0)-t[8]?t[7](t[11].value)-t[8]:t[7](t[11].value)+10)+") rotate("+(t[11].labelAngle?t[11].labelAngle:t[3]p[7](0)-p[8]?p[11].color:"white")&&r(e,"fill",u),_&457&&a!==(a="translate("+(p[6](p[13])+p[3]/2)+" "+(p[7](p[11].value)>p[7](0)-p[8]?p[7](p[11].value)-p[8]:p[7](p[11].value)+10)+") rotate("+(p[11].labelAngle?p[11].labelAngle:p[3]15&&ou(t);return{c(){e=De("rect"),m&&m.c(),a=Ke(),r(e,"x",l=t[6](t[13])+2),r(e,"y",n=t[7](0)),r(e,"width",i=t[3]-4),r(e,"height",o=t[7](t[0].y.min)-t[7](t[0].y.min+t[11].value2)),r(e,"fill",u=t[11].color2?t[11].color2:t[11].color)},m(f,p){S(f,e,p),m&&m.m(f,p),S(f,a,p)},p(f,p){p&64&&l!==(l=f[6](f[13])+2)&&r(e,"x",l),p&128&&n!==(n=f[7](0))&&r(e,"y",n),p&8&&i!==(i=f[3]-4)&&r(e,"width",i),p&129&&o!==(o=f[7](f[0].y.min)-f[7](f[0].y.min+f[11].value2))&&r(e,"height",o),p&1&&u!==(u=f[11].color2?f[11].color2:f[11].color)&&r(e,"fill",u),f[3]>15?m?m.p(f,p):(m=ou(f),m.c(),m.m(a.parentNode,a)):m&&(m.d(1),m=null)},d(f){f&&$(e),m&&m.d(f),f&&$(a)}}}function ou(t){let e,l=t[11].label2+"",n,i,o,u,a,m=t[11].title2&&ru(t);return{c(){e=De("text"),n=N(l),m&&m.c(),a=Ke(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor","middle"),r(e,"fill",o=t[7](-t[11].value2)t[10].call(e))},m(i,o){S(i,e,o),n&&n.m(e,null),l=mo(e,t[10].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=Ya(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:pe,o:pe,d(i){i&&$(e),n&&n.d(),l()}}}let un=30;function mm(t,e,l){let{config:n}=e,i,o,u,a,m,f,p,_=0;function h(){_=this.clientHeight,l(5,_)}function v(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=d=>{"config"in d&&l(0,n=d.config)},t.$$.update=()=>{if(t.$$.dirty&63){l(4,f=o-_);let d=i-(n.padding.left+n.padding.right);l(3,u=d/n.points.length),l(8,p=un.y.max?D=n.padding.bottom:wf||D<0?0:D})}},[n,i,o,u,f,_,a,m,p,h,v]}class mn extends Re{constructor(e){super(),Le(this,e,mm,cm,Ee,{config:0})}}function _m(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function pm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{ds:u}=e,a={};function m(f){return{label:ke(f)+"V",title:f.toFixed(1)+" V",value:isNaN(f)?0:f,color:$0(f||0,document.documentElement.classList.contains("dark"))}}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=[],p=[];n>0&&(f.push({label:u===1?"L1-L2":"L1"}),p.push(m(n))),i>0&&(f.push({label:u===1?"L1-L3":"L2"}),p.push(m(i))),o>0&&(f.push({label:u===1?"L2-L3":"L3"}),p.push(m(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:p})}},[a,n,i,o,u]}class dm extends Re{constructor(e){super(),Le(this,e,pm,_m,Ee,{u1:1,u2:2,u3:3,ds:4})}}function vm(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function hm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{i1:u}=e,{i2:a}=e,{i2e:m}=e,{i3:f}=e,{max:p}=e,_={};function h(v){return{label:ke(v)+"A",title:v.toFixed(1)+" A",value:isNaN(v)?0:v,color:qc(v?v/p*100:0,document.documentElement.classList.contains("dark"))}}return t.$$set=v=>{"u1"in v&&l(1,n=v.u1),"u2"in v&&l(2,i=v.u2),"u3"in v&&l(3,o=v.u3),"i1"in v&&l(4,u=v.i1),"i2"in v&&l(5,a=v.i2),"i2e"in v&&l(6,m=v.i2e),"i3"in v&&l(7,f=v.i3),"max"in v&&l(8,p=v.max)},t.$$.update=()=>{if(t.$$.dirty&510){let v=[],d=[];n>0&&(v.push({label:"L1"}),d.push(h(u))),i>0&&(m?(v.push({label:"L2"}),d.push({label:"Not available",labelAngle:-90,title:"L2 current is not reported by your meter",value:0,color:"#7c3aedcc"})):(v.push({label:"L2"}),d.push(h(a)))),o>0&&(v.push({label:"L3"}),d.push(h(f))),l(0,_={title:"Amperage",padding:{top:20,right:15,bottom:20,left:35},y:{min:0,max:p,ticks:[{value:0,label:"0%"},{value:p/4,label:"25%"},{value:p/2,label:"50%"},{value:p/4*3,label:"75%"},{value:p,label:"100%"}]},x:{ticks:v},points:d})}},[_,n,i,o,u,a,m,f,p]}class bm extends Re{constructor(e){super(),Le(this,e,hm,vm,Ee,{u1:1,u2:2,u3:3,i1:4,i2:5,i2e:6,i3:7,max:8})}}function gm(t){let e,l,n,i,o,u,a,m=(typeof t[0]<"u"?t[0].toFixed(0):"-")+"",f,p,_,h,v,d,g=(typeof t[1]<"u"?t[1].toFixed(0):"-")+"",w,D,M,E,R,O,F,y=(typeof t[2]<"u"?t[2].toFixed(1):"-")+"",P,ne,H,z,U,K,Q=(typeof t[3]<"u"?t[3].toFixed(1):"-")+"",G,X;return{c(){e=c("div"),l=c("strong"),l.textContent="Reactive",n=b(),i=c("div"),o=c("div"),o.textContent="Instant in",u=b(),a=c("div"),f=N(m),p=N(" VAr"),_=b(),h=c("div"),h.textContent="Instant out",v=b(),d=c("div"),w=N(g),D=N(" VAr"),M=b(),E=c("div"),R=c("div"),R.textContent="Total in",O=b(),F=c("div"),P=N(y),ne=N(" kVArh"),H=b(),z=c("div"),z.textContent="Total out",U=b(),K=c("div"),G=N(Q),X=N(" kVArh"),r(a,"class","text-right"),r(d,"class","text-right"),r(i,"class","grid grid-cols-2 mt-4"),r(F,"class","text-right"),r(K,"class","text-right"),r(E,"class","grid grid-cols-2 mt-4"),r(e,"class","mx-2 text-sm")},m(Y,j){S(Y,e,j),s(e,l),s(e,n),s(e,i),s(i,o),s(i,u),s(i,a),s(a,f),s(a,p),s(i,_),s(i,h),s(i,v),s(i,d),s(d,w),s(d,D),s(e,M),s(e,E),s(E,R),s(E,O),s(E,F),s(F,P),s(F,ne),s(E,H),s(E,z),s(E,U),s(E,K),s(K,G),s(K,X)},p(Y,[j]){j&1&&m!==(m=(typeof Y[0]<"u"?Y[0].toFixed(0):"-")+"")&&J(f,m),j&2&&g!==(g=(typeof Y[1]<"u"?Y[1].toFixed(0):"-")+"")&&J(w,g),j&4&&y!==(y=(typeof Y[2]<"u"?Y[2].toFixed(1):"-")+"")&&J(P,y),j&8&&Q!==(Q=(typeof Y[3]<"u"?Y[3].toFixed(1):"-")+"")&&J(G,Q)},i:pe,o:pe,d(Y){Y&&$(e)}}}function km(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 wm extends Re{constructor(e){super(),Le(this,e,km,gm,Ee,{importInstant:0,exportInstant:1,importTotal:2,exportTotal:3})}}function uu(t){let e;function l(o,u){return o[3]?Cm:ym}let n=l(t),i=n(t);return{c(){i.c(),e=Ke()},m(o,u){i.m(o,u),S(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&&$(e)}}}function ym(t){let e,l,n,i,o,u,a=ke(t[1].h.u,2)+"",m,f,p,_,h,v,d=ke(t[1].d.u,1)+"",g,w,D,M,E,R,O=ke(t[1].m.u)+"",F,y,P,ne,H,z,U=ke(t[0].last_month.u)+"",K,Q,G,X,Y=t[4]&&fu(t);return{c(){e=c("strong"),e.textContent="Consumption",l=b(),n=c("div"),i=c("div"),i.textContent="Hour",o=b(),u=c("div"),m=N(a),f=N(" kWh"),p=b(),_=c("div"),_.textContent="Day",h=b(),v=c("div"),g=N(d),w=N(" kWh"),D=b(),M=c("div"),M.textContent="Month",E=b(),R=c("div"),F=N(O),y=N(" kWh"),P=b(),ne=c("div"),ne.textContent="Last month",H=b(),z=c("div"),K=N(U),Q=N(" kWh"),G=b(),Y&&Y.c(),X=Ke(),r(u,"class","text-right"),r(v,"class","text-right"),r(R,"class","text-right"),r(z,"class","text-right"),r(n,"class","grid grid-cols-2 mb-3")},m(j,x){S(j,e,x),S(j,l,x),S(j,n,x),s(n,i),s(n,o),s(n,u),s(u,m),s(u,f),s(n,p),s(n,_),s(n,h),s(n,v),s(v,g),s(v,w),s(n,D),s(n,M),s(n,E),s(n,R),s(R,F),s(R,y),s(n,P),s(n,ne),s(n,H),s(n,z),s(z,K),s(z,Q),S(j,G,x),Y&&Y.m(j,x),S(j,X,x)},p(j,x){x&2&&a!==(a=ke(j[1].h.u,2)+"")&&J(m,a),x&2&&d!==(d=ke(j[1].d.u,1)+"")&&J(g,d),x&2&&O!==(O=ke(j[1].m.u)+"")&&J(F,O),x&1&&U!==(U=ke(j[0].last_month.u)+"")&&J(K,U),j[4]?Y?Y.p(j,x):(Y=fu(j),Y.c(),Y.m(X.parentNode,X)):Y&&(Y.d(1),Y=null)},d(j){j&&$(e),j&&$(l),j&&$(n),j&&$(G),Y&&Y.d(j),j&&$(X)}}}function Cm(t){let e,l,n,i,o,u,a=ke(t[1].h.u,2)+"",m,f,p,_,h,v,d,g=ke(t[1].d.u,1)+"",w,D,M,E,R,O,F,y=ke(t[1].m.u)+"",P,ne,H,z,U,K,Q,G=ke(t[0].last_month.u)+"",X,Y,j,x,ae,ee,V,W,we,He,Ie,Se=ke(t[1].h.p,2)+"",ye,ve,Te,be,T,C,k,A=ke(t[1].d.p,1)+"",L,Z,le,fe,de,Ce,Oe,ue=ke(t[1].m.p)+"",Me,Je,It,st,wt,nt,Ot,Qe=ke(t[0].last_month.p)+"",Xt,zt,vt,xe,Ge=t[4]&&cu(t),Ye=t[4]&&mu(t),Ne=t[4]&&_u(t),Ze=t[4]&&pu(t),et=t[4]&&du(t),qe=t[4]&&vu(t),Fe=t[4]&&hu(t),_e=t[4]&&bu(t);return{c(){e=c("strong"),e.textContent="Import",l=b(),n=c("div"),i=c("div"),i.textContent="Hour",o=b(),u=c("div"),m=N(a),f=N(" kWh"),p=b(),Ge&&Ge.c(),_=b(),h=c("div"),h.textContent="Day",v=b(),d=c("div"),w=N(g),D=N(" kWh"),M=b(),Ye&&Ye.c(),E=b(),R=c("div"),R.textContent="Month",O=b(),F=c("div"),P=N(y),ne=N(" kWh"),H=b(),Ne&&Ne.c(),z=b(),U=c("div"),U.textContent="Last mo.",K=b(),Q=c("div"),X=N(G),Y=N(" kWh"),j=b(),Ze&&Ze.c(),ae=b(),ee=c("strong"),ee.textContent="Export",V=b(),W=c("div"),we=c("div"),we.textContent="Hour",He=b(),Ie=c("div"),ye=N(Se),ve=N(" kWh"),Te=b(),et&&et.c(),be=b(),T=c("div"),T.textContent="Day",C=b(),k=c("div"),L=N(A),Z=N(" kWh"),le=b(),qe&&qe.c(),fe=b(),de=c("div"),de.textContent="Month",Ce=b(),Oe=c("div"),Me=N(ue),Je=N(" kWh"),It=b(),Fe&&Fe.c(),st=b(),wt=c("div"),wt.textContent="Last mo.",nt=b(),Ot=c("div"),Xt=N(Qe),zt=N(" kWh"),vt=b(),_e&&_e.c(),r(u,"class","text-right"),r(d,"class","text-right"),r(F,"class","text-right"),r(Q,"class","text-right"),r(n,"class",x="grid grid-cols-"+t[5]+" mb-3"),r(Ie,"class","text-right"),r(k,"class","text-right"),r(Oe,"class","text-right"),r(Ot,"class","text-right"),r(W,"class",xe="grid grid-cols-"+t[5])},m(ce,Be){S(ce,e,Be),S(ce,l,Be),S(ce,n,Be),s(n,i),s(n,o),s(n,u),s(u,m),s(u,f),s(n,p),Ge&&Ge.m(n,null),s(n,_),s(n,h),s(n,v),s(n,d),s(d,w),s(d,D),s(n,M),Ye&&Ye.m(n,null),s(n,E),s(n,R),s(n,O),s(n,F),s(F,P),s(F,ne),s(n,H),Ne&&Ne.m(n,null),s(n,z),s(n,U),s(n,K),s(n,Q),s(Q,X),s(Q,Y),s(n,j),Ze&&Ze.m(n,null),S(ce,ae,Be),S(ce,ee,Be),S(ce,V,Be),S(ce,W,Be),s(W,we),s(W,He),s(W,Ie),s(Ie,ye),s(Ie,ve),s(W,Te),et&&et.m(W,null),s(W,be),s(W,T),s(W,C),s(W,k),s(k,L),s(k,Z),s(W,le),qe&&qe.m(W,null),s(W,fe),s(W,de),s(W,Ce),s(W,Oe),s(Oe,Me),s(Oe,Je),s(W,It),Fe&&Fe.m(W,null),s(W,st),s(W,wt),s(W,nt),s(W,Ot),s(Ot,Xt),s(Ot,zt),s(W,vt),_e&&_e.m(W,null)},p(ce,Be){Be&2&&a!==(a=ke(ce[1].h.u,2)+"")&&J(m,a),ce[4]?Ge?Ge.p(ce,Be):(Ge=cu(ce),Ge.c(),Ge.m(n,_)):Ge&&(Ge.d(1),Ge=null),Be&2&&g!==(g=ke(ce[1].d.u,1)+"")&&J(w,g),ce[4]?Ye?Ye.p(ce,Be):(Ye=mu(ce),Ye.c(),Ye.m(n,E)):Ye&&(Ye.d(1),Ye=null),Be&2&&y!==(y=ke(ce[1].m.u)+"")&&J(P,y),ce[4]?Ne?Ne.p(ce,Be):(Ne=_u(ce),Ne.c(),Ne.m(n,z)):Ne&&(Ne.d(1),Ne=null),Be&1&&G!==(G=ke(ce[0].last_month.u)+"")&&J(X,G),ce[4]?Ze?Ze.p(ce,Be):(Ze=pu(ce),Ze.c(),Ze.m(n,null)):Ze&&(Ze.d(1),Ze=null),Be&32&&x!==(x="grid grid-cols-"+ce[5]+" mb-3")&&r(n,"class",x),Be&2&&Se!==(Se=ke(ce[1].h.p,2)+"")&&J(ye,Se),ce[4]?et?et.p(ce,Be):(et=du(ce),et.c(),et.m(W,be)):et&&(et.d(1),et=null),Be&2&&A!==(A=ke(ce[1].d.p,1)+"")&&J(L,A),ce[4]?qe?qe.p(ce,Be):(qe=vu(ce),qe.c(),qe.m(W,fe)):qe&&(qe.d(1),qe=null),Be&2&&ue!==(ue=ke(ce[1].m.p)+"")&&J(Me,ue),ce[4]?Fe?Fe.p(ce,Be):(Fe=hu(ce),Fe.c(),Fe.m(W,st)):Fe&&(Fe.d(1),Fe=null),Be&1&&Qe!==(Qe=ke(ce[0].last_month.p)+"")&&J(Xt,Qe),ce[4]?_e?_e.p(ce,Be):(_e=bu(ce),_e.c(),_e.m(W,null)):_e&&(_e.d(1),_e=null),Be&32&&xe!==(xe="grid grid-cols-"+ce[5])&&r(W,"class",xe)},d(ce){ce&&$(e),ce&&$(l),ce&&$(n),Ge&&Ge.d(),Ye&&Ye.d(),Ne&&Ne.d(),Ze&&Ze.d(),ce&&$(ae),ce&&$(ee),ce&&$(V),ce&&$(W),et&&et.d(),qe&&qe.d(),Fe&&Fe.d(),_e&&_e.d()}}}function fu(t){let e,l,n,i,o,u,a=ke(t[1].h.c,2)+"",m,f,p,_,h,v,d,g=ke(t[1].d.c,1)+"",w,D,M,E,R,O,F,y=ke(t[1].m.c)+"",P,ne,H,z,U,K,Q,G=ke(t[0].last_month.c)+"",X,Y,j;return{c(){e=c("strong"),e.textContent="Cost",l=b(),n=c("div"),i=c("div"),i.textContent="Hour",o=b(),u=c("div"),m=N(a),f=b(),p=N(t[2]),_=b(),h=c("div"),h.textContent="Day",v=b(),d=c("div"),w=N(g),D=b(),M=N(t[2]),E=b(),R=c("div"),R.textContent="Month",O=b(),F=c("div"),P=N(y),ne=b(),H=N(t[2]),z=b(),U=c("div"),U.textContent="Last month",K=b(),Q=c("div"),X=N(G),Y=b(),j=N(t[2]),r(u,"class","text-right"),r(d,"class","text-right"),r(F,"class","text-right"),r(Q,"class","text-right"),r(n,"class","grid grid-cols-2")},m(x,ae){S(x,e,ae),S(x,l,ae),S(x,n,ae),s(n,i),s(n,o),s(n,u),s(u,m),s(u,f),s(u,p),s(n,_),s(n,h),s(n,v),s(n,d),s(d,w),s(d,D),s(d,M),s(n,E),s(n,R),s(n,O),s(n,F),s(F,P),s(F,ne),s(F,H),s(n,z),s(n,U),s(n,K),s(n,Q),s(Q,X),s(Q,Y),s(Q,j)},p(x,ae){ae&2&&a!==(a=ke(x[1].h.c,2)+"")&&J(m,a),ae&4&&J(p,x[2]),ae&2&&g!==(g=ke(x[1].d.c,1)+"")&&J(w,g),ae&4&&J(M,x[2]),ae&2&&y!==(y=ke(x[1].m.c)+"")&&J(P,y),ae&4&&J(H,x[2]),ae&1&&G!==(G=ke(x[0].last_month.c)+"")&&J(X,G),ae&4&&J(j,x[2])},d(x){x&&$(e),x&&$(l),x&&$(n)}}}function cu(t){let e,l=ke(t[1].h.c,2)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].h.c,2)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function mu(t){let e,l=ke(t[1].d.c,1)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].d.c,1)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function _u(t){let e,l=ke(t[1].m.c)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].m.c)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function pu(t){let e,l=ke(t[0].last_month.c)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ke(u[0].last_month.c)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function du(t){let e,l=ke(t[1].h.i,2)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].h.i,2)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function vu(t){let e,l=ke(t[1].d.i,1)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].d.i,1)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function hu(t){let e,l=ke(t[1].m.i)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ke(u[1].m.i)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function bu(t){let e,l=ke(t[0].last_month.i)+"",n,i,o;return{c(){e=c("div"),n=N(l),i=b(),o=N(t[2]),r(e,"class","text-right")},m(u,a){S(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ke(u[0].last_month.i)+"")&&J(n,l),a&4&&J(o,u[2])},d(u){u&&$(e)}}}function $m(t){let e,l,n,i,o,u,a=t[1]&&uu(t);return{c(){e=c("div"),l=c("strong"),l.textContent="Real time calculation",n=b(),i=c("br"),o=c("br"),u=b(),a&&a.c(),r(e,"class","mx-2 text-sm")},m(m,f){S(m,e,f),s(e,l),s(e,n),s(e,i),s(e,o),s(e,u),a&&a.m(e,null)},p(m,[f]){m[1]?a?a.p(m,f):(a=uu(m),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i:pe,o:pe,d(m){m&&$(e),a&&a.d()}}}function Sm(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:u}=e,a=!1,m=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,m=a?3:2))},[n,i,o,u,a,m]}class Mm extends Re{constructor(e){super(),Le(this,e,Sm,$m,Ee,{sysinfo:0,data:1,currency:2,hasExport:3})}}function Tm(t){let e,l,n=Da(t[0].source)+"",i,o,u,a,m;return a=new mn({props:{config:t[1]}}),{c(){e=c("a"),l=N("Provided by: "),i=N(n),u=b(),re(a.$$.fragment),r(e,"href",o=La(t[0].source)),r(e,"target","_blank"),r(e,"class","text-xs float-right z-40")},m(f,p){S(f,e,p),s(e,l),s(e,i),S(f,u,p),ie(a,f,p),m=!0},p(f,[p]){(!m||p&1)&&n!==(n=Da(f[0].source)+"")&&J(i,n),(!m||p&1&&o!==(o=La(f[0].source)))&&r(e,"href",o);const _={};p&2&&(_.config=f[1]),a.$set(_)},i(f){m||(I(a.$$.fragment,f),m=!0)},o(f){q(a.$$.fragment,f),m=!1},d(f){f&&$(e),f&&$(u),se(a,f)}}}function Nm(t,e,l){let{json:n}=e,{sysinfo:i}=e,o={},u,a,m=document.documentElement.classList.contains("dark");return t.$$set=f=>{"json"in f&&l(0,n=f.json),"sysinfo"in f&&l(2,i=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&29){let f=n.currency,p=new Date().getUTCHours(),_=0,h=0,v=0,d=[],g=[],w=[];l(4,a=l(3,u=0));let D=new Date;for(dl(D,i.clock_offset-(24+D.getHours()-D.getUTCHours())%24),_=p;_<24&&(h=n[Ue(v++)],h!=null);_++)g.push({label:Ue(D.getHours())}),w.push(h*100),l(4,a=Math.min(a,h*100)),l(3,u=Math.max(u,h*100)),dl(D,1);for(_=0;_<24&&(h=n[Ue(v++)],h!=null);_++)g.push({label:Ue(D.getHours())}),w.push(h*100),l(4,a=Math.min(a,h*100)),l(3,u=Math.max(u,h*100)),dl(D,1);if(a>-100&&u<100){switch(f){case"NOK":case"DKK":f="\xF8re";break;case"SEK":f="\xF6re";break;case"EUR":f="cent";break;case"CHF":f="rp.";break;default:f=f+"/100"}for(l(4,a*=100),l(3,u*=100),_=0;_=0?F.toFixed(y):"",title:F>=0?F.toFixed(2)+" "+f:"",value:h>=0?Math.abs(h):0,label2:F<0?F.toFixed(y):"",title2:F<0?F.toFixed(2)+" "+f:"",value2:h<0?Math.abs(h):0,color:m?"#5c2da5":"#7c3aed"})}let E=Math.max(u,Math.abs(a));if(a<0){l(4,a=Math.min(E/4*-1,a));let F=Math.ceil(Math.abs(a)/E*4),y=a/F;for(_=1;_{"json"in f&&l(1,n=f.json),"sysinfo"in f&&l(2,i=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let f=0,p=[],_=[],h=[];l(4,a=l(3,u=0));let v=dl(new Date,-24),d=new Date().getUTCHours();for(dl(v,i.clock_offset-(24+v.getHours()-v.getUTCHours())%24),f=d;f<24;f++){let M=n["i"+Ue(f)],E=n["e"+Ue(f)];M===void 0&&(M=0),E===void 0&&(E=0),_.push({label:Ue(v.getHours())}),h.push({label:M.toFixed(1),title:M.toFixed(2)+" kWh",value:M*10,label2:E.toFixed(1),title2:E.toFixed(2)+" kWh",value2:E*10,color:m?"#5c2da5":"#7c3aed",color2:m?"#27728e":"#37829e"}),l(4,a=Math.max(a,E*10)),l(3,u=Math.max(u,M*10)),dl(v,1)}for(f=0;f{"json"in f&&l(1,n=f.json),"sysinfo"in f&&l(2,i=f.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let f=0,p=[],_=[],h=[];l(4,a=l(3,u=0));let v=new Date,d=new Date;for(dl(v,i.clock_offset-(24+v.getHours()-v.getUTCHours())%24),dl(d,i.clock_offset-(24+d.getHours()-d.getUTCHours())%24),d.setDate(0),f=v.getDate();f<=d.getDate();f++){let M=n["i"+Ue(f)],E=n["e"+Ue(f)];M===void 0&&(M=0),E===void 0&&(E=0),_.push({label:Ue(f)}),h.push({label:M.toFixed(M<10?1:0),title:M.toFixed(2)+" kWh",value:M,label2:E.toFixed(E<10?1:0),title2:E.toFixed(2)+" kWh",value2:E,color:m?"#5c2da5":"#7c3aed",color2:m?"#27728e":"#37829e"}),l(4,a=Math.max(a,E)),l(3,u=Math.max(u,M))}for(f=1;f{"json"in m&&l(1,n=m.json)},t.$$.update=()=>{if(t.$$.dirty&14){let m=0,f=0,p=[],_=[],h=[];n.s&&n.s.forEach((g,w)=>{var D=g.n?g.n:g.a;f=g.v,f==-127&&(f=0),_.push({label:D.slice(-4)}),h.push({label:f.toFixed(1),value:f,color:i?"#5c2da5":"#7c3aed"}),l(3,a=Math.min(a,f)),l(2,u=Math.max(u,f))}),l(2,u=Math.ceil(u)),l(3,a=Math.floor(a));let v=u;a<0&&(v+=Math.abs(a));let d=v/4;for(m=0;m<5;m++)f=a+d*m,p.push({value:f,label:f.toFixed(1)});l(0,o={title:"Temperature sensors (\xB0C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:a,max:u,ticks:p},x:{ticks:_},points:h})}},[o,n,u,a]}class qm extends Re{constructor(e){super(),Le(this,e,Fm,Om,Ee,{json:1})}}function Bm(t){let e,l;return e=new mn({props:{config:t[0]}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}let Um=0;function jm(t,e,l){let n=document.documentElement.classList.contains("dark"),i={},o=0,u;return Kc.subscribe(a=>{l(2,u=a)}),Vc(),t.$$.update=()=>{if(t.$$.dirty&6){let a=0,m=[],f=[],p=[];if(m.push({value:0,label:0}),u&&u.p)for(a=0;a0?Ue(_.d)+"."+Ys[new Date().getMonth()]:"-"}),l(1,o=Math.max(o,_.v))}if(u&&u.t){for(a=0;a=o)break;m.push({value:_,label:_})}m.push({label:u.m.toFixed(1),align:"right",color:"green",value:u.m})}u&&u.c&&(m.push({label:u.c.toFixed(0),color:"orange",value:u.c}),l(1,o=Math.max(o,u.c))),l(1,o=Math.ceil(o)),l(0,i={title:"Tariff peaks",padding:{top:20,right:35,bottom:20,left:35},y:{min:Um,max:o,ticks:m},x:{ticks:f},points:p})}},[i,o,u]}class Hm extends Re{constructor(e){super(),Le(this,e,jm,Bm,Ee,{})}}function gu(t,e,l){const n=t.slice();return n[20]=e[l],n[22]=l,n}function ku(t,e,l){const n=t.slice();return n[23]=e[l],n}function wu(t){let e,l,n,i,o,u=t[7],a=[];for(let p=0;pt[15].call(e))},m(f,p){S(f,e,p),s(e,l),s(l,n),s(l,i),s(l,o),s(e,u),m&&m.m(e,null),a=mo(e,t[15].bind(e))},p(f,[p]){p&1024&&J(i,f[10]),f[7]?m?m.p(f,p):(m=wu(f),m.c(),m.m(e,null)):m&&(m.d(1),m=null)},i:pe,o:pe,d(f){f&&$(e),m&&m.d(),a()}}}let zm=12;function Gm(t,e,l){let n=document.documentElement.classList.contains("dark"),i;Yc.subscribe(y=>{l(12,i=y)});let o,u=0,a=0;function m(){o&&clearTimeout(o),o=setTimeout(m,1e4),i.data.unshift(a),l(12,i.data=i.data.slice(0,i.size),i),u+=10}Bc.subscribe(y=>{u==0&&(o&&clearTimeout(o),o=setTimeout(m,1e4)),a=y.i-y.e,u=y.u});let f,p,_,h,v,d,g,w,D,M,E,R,O;function F(){_=this.clientWidth,h=this.clientHeight,l(0,_),l(1,h)}return t.$$.update=()=>{if(t.$$.dirty&29183&&(l(2,v=parseInt(h)-50),l(3,d=_-35),l(9,R=d/i.size),l(14,p=0),l(13,f=0),i.data)){for(let P in i.data){let ne=i.data[P];l(13,f=Math.max(Math.ceil(ne/1e3)*1e3,f)),l(14,p=Math.min(Math.ceil(ne/1e3)*1e3,p))}l(10,O=f>2500?"kW":"W"),l(7,M=[]);for(let P=p;P2500?(P/1e3).toFixed(1):P});l(8,E=[]);for(let P=p;P0||t[0].e>0}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt")},m(i,o){S(i,e,o),ie(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||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Lu(t){let e,l,n;return l=new Hm({}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt h-64")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},i(i){n||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Ru(t){let e,l,n;return l=new Vm({}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},i(i){n||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Iu(t){let e,l,n;return l=new Em({props:{json:t[2],sysinfo:t[1]}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(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||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Ou(t){let e,l,n;return l=new Dm({props:{json:t[3],sysinfo:t[1]}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(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||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Fu(t){let e,l,n;return l=new Im({props:{json:t[4],sysinfo:t[1]}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(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||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function qu(t){let e,l,n;return l=new qm({props:{json:t[5]}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){S(i,e,o),ie(l,e,null),n=!0},p(i,o){const u={};o&32&&(u.json=i[5]),l.$set(u)},i(i){n||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function Km(t){let e,l=Xe(t[1].ui.i,t[0].i),n,i=Xe(t[1].ui.e,t[0].om||t[0].e>0),o,u=Xe(t[1].ui.v,t[0].u1>100||t[0].u2>100||t[0].u3>100),a,m=Xe(t[1].ui.a,t[0].i1>.01||t[0].i2>.01||t[0].i3>.01),f,p=Xe(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),_,h=Xe(t[1].ui.c,t[0].ea),v,d=Xe(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),g,w=Xe(t[1].ui.l),D,M=Xe(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),E,R=Xe(t[1].ui.d,t[3]),O,F=Xe(t[1].ui.m,t[4]),y,P=Xe(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),ne,H=l&&Tu(t),z=i&&Nu(t),U=u&&Eu(t),K=m&&Au(t),Q=p&&Pu(t),G=h&&Du(t),X=d&&Lu(),Y=w&&Ru(),j=M&&Iu(t),x=R&&Ou(t),ae=F&&Fu(t),ee=P&&qu(t);return{c(){e=c("div"),H&&H.c(),n=b(),z&&z.c(),o=b(),U&&U.c(),a=b(),K&&K.c(),f=b(),Q&&Q.c(),_=b(),G&&G.c(),v=b(),X&&X.c(),g=b(),Y&&Y.c(),D=b(),j&&j.c(),E=b(),x&&x.c(),O=b(),ae&&ae.c(),y=b(),ee&&ee.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(V,W){S(V,e,W),H&&H.m(e,null),s(e,n),z&&z.m(e,null),s(e,o),U&&U.m(e,null),s(e,a),K&&K.m(e,null),s(e,f),Q&&Q.m(e,null),s(e,_),G&&G.m(e,null),s(e,v),X&&X.m(e,null),s(e,g),Y&&Y.m(e,null),s(e,D),j&&j.m(e,null),s(e,E),x&&x.m(e,null),s(e,O),ae&&ae.m(e,null),s(e,y),ee&&ee.m(e,null),ne=!0},p(V,[W]){W&3&&(l=Xe(V[1].ui.i,V[0].i)),l?H?(H.p(V,W),W&3&&I(H,1)):(H=Tu(V),H.c(),I(H,1),H.m(e,n)):H&&(Ae(),q(H,1,1,()=>{H=null}),Pe()),W&3&&(i=Xe(V[1].ui.e,V[0].om||V[0].e>0)),i?z?(z.p(V,W),W&3&&I(z,1)):(z=Nu(V),z.c(),I(z,1),z.m(e,o)):z&&(Ae(),q(z,1,1,()=>{z=null}),Pe()),W&3&&(u=Xe(V[1].ui.v,V[0].u1>100||V[0].u2>100||V[0].u3>100)),u?U?(U.p(V,W),W&3&&I(U,1)):(U=Eu(V),U.c(),I(U,1),U.m(e,a)):U&&(Ae(),q(U,1,1,()=>{U=null}),Pe()),W&3&&(m=Xe(V[1].ui.a,V[0].i1>.01||V[0].i2>.01||V[0].i3>.01)),m?K?(K.p(V,W),W&3&&I(K,1)):(K=Au(V),K.c(),I(K,1),K.m(e,f)):K&&(Ae(),q(K,1,1,()=>{K=null}),Pe()),W&3&&(p=Xe(V[1].ui.r,V[0].ri>0||V[0].re>0||V[0].ric>0||V[0].rec>0)),p?Q?(Q.p(V,W),W&3&&I(Q,1)):(Q=Pu(V),Q.c(),I(Q,1),Q.m(e,_)):Q&&(Ae(),q(Q,1,1,()=>{Q=null}),Pe()),W&3&&(h=Xe(V[1].ui.c,V[0].ea)),h?G?(G.p(V,W),W&3&&I(G,1)):(G=Du(V),G.c(),I(G,1),G.m(e,v)):G&&(Ae(),q(G,1,1,()=>{G=null}),Pe()),W&3&&(d=Xe(V[1].ui.t,V[0].pr&&(V[0].pr.startsWith("10YNO")||V[0].pr.startsWith("10Y1001A1001A4")))),d?X?W&3&&I(X,1):(X=Lu(),X.c(),I(X,1),X.m(e,g)):X&&(Ae(),q(X,1,1,()=>{X=null}),Pe()),W&2&&(w=Xe(V[1].ui.l)),w?Y?W&2&&I(Y,1):(Y=Ru(),Y.c(),I(Y,1),Y.m(e,D)):Y&&(Ae(),q(Y,1,1,()=>{Y=null}),Pe()),W&3&&(M=Xe(V[1].ui.p,V[0].pe&&!Number.isNaN(V[0].p))),M?j?(j.p(V,W),W&3&&I(j,1)):(j=Iu(V),j.c(),I(j,1),j.m(e,E)):j&&(Ae(),q(j,1,1,()=>{j=null}),Pe()),W&10&&(R=Xe(V[1].ui.d,V[3])),R?x?(x.p(V,W),W&10&&I(x,1)):(x=Ou(V),x.c(),I(x,1),x.m(e,O)):x&&(Ae(),q(x,1,1,()=>{x=null}),Pe()),W&18&&(F=Xe(V[1].ui.m,V[4])),F?ae?(ae.p(V,W),W&18&&I(ae,1)):(ae=Fu(V),ae.c(),I(ae,1),ae.m(e,y)):ae&&(Ae(),q(ae,1,1,()=>{ae=null}),Pe()),W&35&&(P=Xe(V[1].ui.s,V[0].t&&V[0].t!=-127&&V[5].c>1)),P?ee?(ee.p(V,W),W&35&&I(ee,1)):(ee=qu(V),ee.c(),I(ee,1),ee.m(e,null)):ee&&(Ae(),q(ee,1,1,()=>{ee=null}),Pe())},i(V){ne||(I(H),I(z),I(U),I(K),I(Q),I(G),I(X),I(Y),I(j),I(x),I(ae),I(ee),ne=!0)},o(V){q(H),q(z),q(U),q(K),q(Q),q(G),q(X),q(Y),q(j),q(x),q(ae),q(ee),ne=!1},d(V){V&&$(e),H&&H.d(),z&&z.d(),U&&U.d(),K&&K.d(),Q&&Q.d(),G&&G.d(),X&&X.d(),Y&&Y.d(),j&&j.d(),x&&x.d(),ae&&ae.d(),ee&&ee.d()}}}function Ym(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},u={},a={},m={};return go.subscribe(f=>{l(2,o=f)}),Hc.subscribe(f=>{l(3,u=f)}),Wc.subscribe(f=>{l(4,a=f)}),Gc.subscribe(f=>{l(5,m=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,m]}class Qm extends Re{constructor(e){super(),Le(this,e,Ym,Km,Ee,{data:0,sysinfo:1})}}let lo={};const hi=it(lo);async function Xm(){lo=await(await fetch("/configuration.json")).json(),hi.set(lo)}let no={};const e1=it(no);async function Zm(){no=await(await fetch("/priceconfig.json")).json(),e1.set(no)}function Bu(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Jm(t){let e;return{c(){e=c("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function xm(t){let e;return{c(){e=c("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Uu(t){let e;return{c(){e=c("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function ju(t){let e,l,n;return{c(){e=c("option"),e.textContent="UART1",l=b(),n=c("option"),n.textContent="UART2",e.__value=9,e.value=e.__value,n.__value=16,n.value=n.__value},m(i,o){S(i,e,o),S(i,l,o),S(i,n,o)},d(i){i&&$(e),i&&$(l),i&&$(n)}}}function Hu(t){let e;return{c(){e=c("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Wu(t){let e,l,n;return{c(){e=c("option"),l=N("GPIO"),n=N(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){S(i,e,o),s(e,l),s(e,n)},d(i){i&&$(e)}}}function zu(t){let e,l=t[4]>1&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!((t[0]=="esp32s2"||t[0]=="esp32s3")&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&Wu(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),S(n,e,i)},p(n,i){n[4]>1&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!((n[0]=="esp32s2"||n[0]=="esp32s3")&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=Wu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&$(e)}}}function e_(t){let e,l,n,i,o;function u(d,g){return d[0]=="esp32c3"?xm:Jm}let a=u(t),m=a(t),f=t[0]=="esp8266"&&Uu(),p=(t[0]=="esp32"||t[0]=="esp32solo")&&ju(),_=(t[0]=="esp32s2"||t[0]=="esp32s3")&&Hu(),h={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"esp32s3":l(1,i=46);break;case"esp32c3":l(1,i=19);break}},[n,i]}class io extends Re{constructor(e){super(),Le(this,e,t_,e_,Ee,{chip:0})}}function Gu(t){let e,l,n=t[1]&&Vu(t);return{c(){e=c("div"),l=c("div"),n&&n.c(),r(l,"class","fixed inset-0 bg-gray-500 dark:bg-gray-900 bg-opacity-50 dark:bg-opacity-80 flex items-center justify-center"),r(e,"class","z-50"),r(e,"aria-modal","true")},m(i,o){S(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=Vu(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&$(e),n&&n.d()}}}function Vu(t){let e,l;return{c(){e=c("div"),l=N(t[1]),r(e,"class","bg-white dark:bg-gray-600 m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 dark:text-white w-96")},m(n,i){S(n,e,i),s(e,l)},p(n,i){i&2&&J(l,n[1])},d(n){n&&$(e)}}}function l_(t){let e,l=t[0]&&Gu(t);return{c(){l&&l.c(),e=Ke()},m(n,i){l&&l.m(n,i),S(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=Gu(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:pe,o:pe,d(n){l&&l.d(n),n&&$(e)}}}function n_(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 kt extends Re{constructor(e){super(),Le(this,e,n_,l_,Ee,{active:0,message:1})}}function Ku(t,e,l){const n=t.slice();return n[1]=e[l],n}function Yu(t){let e,l,n=t[1]+"",i;return{c(){e=c("option"),l=N("Europe/"),i=N(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,u){S(o,e,u),s(e,l),s(e,i)},p:pe,d(o){o&&$(e)}}}function i_(t){let e,l,n,i=t[0],o=[];for(let u=0;u>1&1,A=0;A0;C--)A[C]=A[C]?A[C-1]^O.EXPONENT[P._modN(O.LOG[A[C]]+T)]:A[C-1];A[0]=O.EXPONENT[P._modN(O.LOG[A[0]]+T)]}for(T=0;T<=k;T++)A[T]=O.LOG[A[T]]},_checkBadness:function(){var T,C,k,A,L,Z=0,le=this._badness,fe=this.buffer,de=this.width;for(L=0;Lde*de;)ue-=de*de,Oe++;for(Z+=Oe*P.N4,A=0;A=le-2&&(T=le-2,L>9&&T--);var fe=T;if(L>9){for(Z[fe+2]=0,Z[fe+3]=0;fe--;)C=Z[fe],Z[fe+3]|=255&C<<4,Z[fe+2]=C>>4;Z[2]|=255&T<<4,Z[1]=T>>4,Z[0]=64|T>>12}else{for(Z[fe+1]=0,Z[fe+2]=0;fe--;)C=Z[fe],Z[fe+2]|=255&C<<4,Z[fe+1]=C>>4;Z[1]|=255&T<<4,Z[0]=64|T>>4}for(fe=T+3-(L<10);fe=5&&(k+=P.N1+A[C]-5);for(C=3;CT||A[C-3]*3>=A[C]*4||A[C+3]*3>=A[C]*4)&&(k+=P.N3);return k},_finish:function(){this._stringBuffer=this.buffer.slice();var T,C,k=0,A=3e4;for(C=0;C<8&&(this._applyMask(C),T=this._checkBadness(),T>=1)A&1&&(L[Z-1-C+Z*8]=1,C<6?L[8+Z*C]=1:L[8+Z*(C+1)]=1);for(C=0;C<7;C++,A>>=1)A&1&&(L[8+Z*(Z-7+C)]=1,C?L[6-C+Z*8]=1:L[7+Z*8]=1)},_interleaveBlocks:function(){var T,C,k=this._dataBlock,A=this._ecc,L=this._eccBlock,Z=0,le=this._calculateMaxLength(),fe=this._neccBlock1,de=this._neccBlock2,Ce=this._stringBuffer;for(T=0;T1)for(T=D.BLOCK[A],k=L-7;;){for(C=L-7;C>T-3&&(this._addAlignment(C,k),!(C6)for(T=y.BLOCK[Z-7],C=17,k=0;k<6;k++)for(A=0;A<3;A++,C--)1&(C>11?Z>>C-12:T>>C)?(L[5-k+le*(2-A+le-11)]=1,L[2-A+le-11+le*(5-k)]=1):(this._setMask(5-k,2-A+le-11),this._setMask(2-A+le-11,5-k))},_isMasked:function(T,C){var k=P._getMaskBit(T,C);return this._mask[k]===1},_pack:function(){var T,C,k,A=1,L=1,Z=this.width,le=Z-1,fe=Z-1,de=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(C=0;CC&&(k=T,T=C,C=k),k=C,k+=C*C,k>>=1,k+=T,k},_modN:function(T){for(;T>=255;)T-=255,T=(T>>8)+(T&255);return T},N1:3,N2:3,N3:40,N4:10}),ne=P,H=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var T=this.element;T.width=T.height=this.qrious.size}}),z=H,U=_.extend(function(T,C,k,A){this.name=T,this.modifiable=Boolean(C),this.defaultValue=k,this._valueTransformer=A},{transform:function(T){var C=this._valueTransformer;return typeof C=="function"?C(T,this):T}}),K=U,Q=_.extend(null,{abs:function(T){return T!=null?Math.abs(T):null},hasOwn:function(T,C){return Object.prototype.hasOwnProperty.call(T,C)},noop:function(){},toUpperCase:function(T){return T!=null?T.toUpperCase():null}}),G=Q,X=_.extend(function(T){this.options={},T.forEach(function(C){this.options[C.name]=C},this)},{exists:function(T){return this.options[T]!=null},get:function(T,C){return X._get(this.options[T],C)},getAll:function(T){var C,k=this.options,A={};for(C in k)G.hasOwn(k,C)&&(A[C]=X._get(k[C],T));return A},init:function(T,C,k){typeof k!="function"&&(k=G.noop);var A,L;for(A in this.options)G.hasOwn(this.options,A)&&(L=this.options[A],X._set(L,L.defaultValue,C),X._createAccessor(L,C,k));this._setAll(T,C,!0)},set:function(T,C,k){return this._set(T,C,k)},setAll:function(T,C){return this._setAll(T,C)},_set:function(T,C,k,A){var L=this.options[T];if(!L)throw new Error("Invalid option: "+T);if(!L.modifiable&&!A)throw new Error("Option cannot be modified: "+T);return X._set(L,C,k)},_setAll:function(T,C,k){if(!T)return!1;var A,L=!1;for(A in T)G.hasOwn(T,A)&&this._set(A,T[A],C,k)&&(L=!0);return L}},{_createAccessor:function(T,C,k){var A={get:function(){return X._get(T,C)}};T.modifiable&&(A.set=function(L){X._set(T,L,C)&&k(L,T)}),Object.defineProperty(C,T.name,A)},_get:function(T,C){return C["_"+T.name]},_set:function(T,C,k){var A="_"+T.name,L=k[A],Z=T.transform(C!=null?C:T.defaultValue);return k[A]=Z,Z!==L}}),Y=X,j=_.extend(function(){this._services={}},{getService:function(T){var C=this._services[T];if(!C)throw new Error("Service is not being managed with name: "+T);return C},setService:function(T,C){if(this._services[T])throw new Error("Service is already managed with name: "+T);C&&(this._services[T]=C)}}),x=j,ae=new Y([new K("background",!0,"white"),new K("backgroundAlpha",!0,1,G.abs),new K("element"),new K("foreground",!0,"black"),new K("foregroundAlpha",!0,1,G.abs),new K("level",!0,"L",G.toUpperCase),new K("mime",!0,"image/png"),new K("padding",!0,null,G.abs),new K("size",!0,100,G.abs),new K("value",!0,"")]),ee=new x,V=_.extend(function(T){ae.init(T,this,this.update.bind(this));var C=ae.get("element",this),k=ee.getService("element"),A=C&&k.isCanvas(C)?C:k.createCanvas(),L=C&&k.isImage(C)?C:k.createImage();this._canvasRenderer=new g(this,A,!0),this._imageRenderer=new z(this,L,L===C),this.update()},{get:function(){return ae.getAll(this)},set:function(T){ae.setAll(T,this)&&this.update()},toDataURL:function(T){return this.canvas.toDataURL(T||this.mime)},update:function(){var T=new ne({level:this.level,value:this.value});this._canvasRenderer.render(T),this._imageRenderer.render(T)}},{use:function(T){ee.setService(T.getName(),T)}});Object.defineProperties(V.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var W=V,we=W,He=_.extend({getName:function(){}}),Ie=He,Se=Ie.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(T){},isImage:function(T){}}),ye=Se,ve=ye.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(T){return T instanceof HTMLCanvasElement},isImage:function(T){return T instanceof HTMLImageElement}}),Te=ve;we.use(new Te);var be=we;return be})})(l1);const f_=l1.exports;function c_(t){let e,l;return{c(){e=c("img"),Ws(e.src,l=t[2])||r(e,"src",l),r(e,"alt",t[0]),r(e,"class",t[1])},m(n,i){S(n,e,i)},p(n,[i]){i&4&&!Ws(e.src,l=n[2])&&r(e,"src",l),i&1&&r(e,"alt",n[0]),i&2&&r(e,"class",n[1])},i:pe,o:pe,d(n){n&&$(e)}}}function m_(t,e,l){const n=new f_;let{errorCorrection:i="L"}=e,{background:o="#fff"}=e,{color:u="#000"}=e,{size:a="200"}=e,{value:m=""}=e,{padding:f=0}=e,{className:p="qrcode"}=e,_="";function h(){n.set({background:o,foreground:u,level:i,padding:f,size:a,value:m}),l(2,_=n.toDataURL("image/jpeg"))}return ac(()=>{h()}),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,m=v.value),"padding"in v&&l(7,f=v.padding),"className"in v&&l(1,p=v.className)},t.$$.update=()=>{t.$$.dirty&1&&m&&h()},[m,p,_,i,o,u,a,f]}class __ extends Re{constructor(e){super(),Le(this,e,m_,c_,Ee,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function Qu(t,e,l){const n=t.slice();return n[101]=e[l],n[102]=e,n[103]=l,n}function Xu(t,e,l){const n=t.slice();return n[104]=e[l],n[105]=e,n[106]=l,n}function p_(t,e,l){const n=t.slice();return n[107]=e[l],n}function d_(t,e,l){const n=t.slice();return n[110]=e[l],n}function v_(t){let e,l;return{c(){e=c("option"),l=N(t[110]),e.__value=t[110],e.value=e.__value},m(n,i){S(n,e,i),s(e,l)},p:pe,d(n){n&&$(e)}}}function h_(t){let e;return{c(){e=N("Configure price")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function Zu(t){let e,l,n,i;return{c(){e=c("br"),l=c("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){S(o,e,u),S(o,l,u),oe(l,t[3].p.t),n||(i=te(l,"input",t[20]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].p.t&&oe(l,o[3].p.t)},d(o){o&&$(e),o&&$(l),n=!1,i()}}}function Ju(t){let e,l,n,i,o,u,a,m,f,p,_,h,v;return{c(){e=c("div"),l=N("Username"),n=c("br"),i=b(),o=c("input"),u=b(),a=c("div"),m=N("Password"),f=c("br"),p=b(),_=c("input"),r(o,"name","gu"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(_,"name","gp"),r(_,"type","password"),r(_,"class","in-s"),r(a,"class","my-1")},m(d,g){S(d,e,g),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].g.u),S(d,u,g),S(d,a,g),s(a,m),s(a,f),s(a,p),s(a,_),oe(_,t[3].g.p),h||(v=[te(o,"input",t[22]),te(_,"input",t[23])],h=!0)},p(d,g){g[0]&8&&o.value!==d[3].g.u&&oe(o,d[3].g.u),g[0]&8&&_.value!==d[3].g.p&&oe(_,d[3].g.p)},d(d){d&&$(e),d&&$(u),d&&$(a),h=!1,ze(v)}}}function b_(t){let e,l=t[107]*100+"",n;return{c(){e=c("option"),n=N(l),e.__value=t[107]*100,e.value=e.__value},m(i,o){S(i,e,o),s(e,n)},p:pe,d(i){i&&$(e)}}}function xu(t){let e,l,n,i;return{c(){e=c("br"),l=c("input"),r(l,"name","mek"),r(l,"type","text"),r(l,"class","in-s")},m(o,u){S(o,e,u),S(o,l,u),oe(l,t[3].m.e.k),n||(i=te(l,"input",t[33]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].m.e.k&&oe(l,o[3].m.e.k)},d(o){o&&$(e),o&&$(l),n=!1,i()}}}function ef(t){let e,l,n,i,o,u,a;return{c(){e=c("div"),l=N("Authentication key"),n=c("br"),i=b(),o=c("input"),r(o,"name","mea"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1")},m(m,f){S(m,e,f),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].m.e.a),u||(a=te(o,"input",t[34]),u=!0)},p(m,f){f[0]&8&&o.value!==m[3].m.e.a&&oe(o,m[3].m.e.a)},d(m){m&&$(e),u=!1,a()}}}function tf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w,D,M,E,R,O,F,y,P,ne,H;return{c(){e=c("div"),l=c("div"),n=N("Watt"),i=c("br"),o=b(),u=c("input"),a=b(),m=c("div"),f=N("Volt"),p=c("br"),_=b(),h=c("input"),v=b(),d=c("div"),g=N("Amp"),w=c("br"),D=b(),M=c("input"),E=b(),R=c("div"),O=N("kWh"),F=c("br"),y=b(),P=c("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(h,"name","mmv"),r(h,"type","number"),r(h,"min","0.00"),r(h,"max","1000"),r(h,"step","0.001"),r(h,"class","in-m tr w-full"),r(m,"class","w-1/4"),r(M,"name","mma"),r(M,"type","number"),r(M,"min","0.00"),r(M,"max","1000"),r(M,"step","0.001"),r(M,"class","in-m tr w-full"),r(d,"class","w-1/4"),r(P,"name","mmc"),r(P,"type","number"),r(P,"min","0.00"),r(P,"max","1000"),r(P,"step","0.001"),r(P,"class","in-l tr w-full"),r(R,"class","w-1/4"),r(e,"class","flex my-1")},m(z,U){S(z,e,U),s(e,l),s(l,n),s(l,i),s(l,o),s(l,u),oe(u,t[3].m.m.w),s(e,a),s(e,m),s(m,f),s(m,p),s(m,_),s(m,h),oe(h,t[3].m.m.v),s(e,v),s(e,d),s(d,g),s(d,w),s(d,D),s(d,M),oe(M,t[3].m.m.a),s(e,E),s(e,R),s(R,O),s(R,F),s(R,y),s(R,P),oe(P,t[3].m.m.c),ne||(H=[te(u,"input",t[36]),te(h,"input",t[37]),te(M,"input",t[38]),te(P,"input",t[39])],ne=!0)},p(z,U){U[0]&8&&ge(u.value)!==z[3].m.m.w&&oe(u,z[3].m.m.w),U[0]&8&&ge(h.value)!==z[3].m.m.v&&oe(h,z[3].m.m.v),U[0]&8&&ge(M.value)!==z[3].m.m.a&&oe(M,z[3].m.m.a),U[0]&8&&ge(P.value)!==z[3].m.m.c&&oe(P,z[3].m.m.c)},d(z){z&&$(e),ne=!1,ze(H)}}}function lf(t){let e;return{c(){e=c("option"),e.textContent="Ethernet",e.__value=3,e.value=e.__value},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function nf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w,D,M,E,R,O,F,y,P,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V;return{c(){e=c("div"),l=N("SSID"),n=c("br"),i=b(),o=c("input"),u=b(),a=c("div"),m=N("Password"),f=c("br"),p=b(),_=c("input"),h=b(),v=c("div"),d=c("div"),g=N("Power saving"),w=c("br"),D=b(),M=c("select"),E=c("option"),E.textContent="Default",R=c("option"),R.textContent="Off",O=c("option"),O.textContent="Minimum",F=c("option"),F.textContent="Maximum",y=b(),P=c("div"),ne=N("Power"),H=c("br"),z=b(),U=c("div"),K=c("input"),Q=b(),G=c("span"),G.textContent="dBm",X=b(),Y=c("div"),j=c("label"),x=c("input"),ae=N(" Allow 802.11b legacy rates"),r(o,"name","ws"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(_,"name","wp"),r(_,"type","password"),r(_,"class","in-s"),r(a,"class","my-1"),E.__value=255,E.value=E.__value,R.__value=0,R.value=R.__value,O.__value=1,O.value=O.__value,F.__value=2,F.value=F.__value,r(M,"name","wz"),r(M,"class","in-s"),t[3].w.z===void 0&&We(()=>t[43].call(M)),r(d,"class","w-1/2"),r(K,"name","ww"),r(K,"type","number"),r(K,"min","0"),r(K,"max","20.5"),r(K,"step","0.5"),r(K,"class","in-f tr w-full"),r(G,"class","in-post"),r(U,"class","flex"),r(P,"class","ml-2 w-1/2"),r(v,"class","my-1 flex"),r(x,"type","checkbox"),r(x,"name","wb"),x.__value="true",x.value=x.__value,r(x,"class","rounded mb-1"),r(Y,"class","my-3")},m(W,we){S(W,e,we),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].w.s),S(W,u,we),S(W,a,we),s(a,m),s(a,f),s(a,p),s(a,_),oe(_,t[3].w.p),S(W,h,we),S(W,v,we),s(v,d),s(d,g),s(d,w),s(d,D),s(d,M),s(M,E),s(M,R),s(M,O),s(M,F),$e(M,t[3].w.z,!0),s(v,y),s(v,P),s(P,ne),s(P,H),s(P,z),s(P,U),s(U,K),oe(K,t[3].w.w),s(U,Q),s(U,G),S(W,X,we),S(W,Y,we),s(Y,j),s(j,x),x.checked=t[3].w.b,s(j,ae),ee||(V=[te(o,"input",t[41]),te(_,"input",t[42]),te(M,"change",t[43]),te(K,"input",t[44]),te(x,"change",t[45])],ee=!0)},p(W,we){we[0]&8&&o.value!==W[3].w.s&&oe(o,W[3].w.s),we[0]&8&&_.value!==W[3].w.p&&oe(_,W[3].w.p),we[0]&8&&$e(M,W[3].w.z),we[0]&8&&ge(K.value)!==W[3].w.w&&oe(K,W[3].w.w),we[0]&8&&(x.checked=W[3].w.b)},d(W){W&&$(e),W&&$(u),W&&$(a),W&&$(h),W&&$(v),W&&$(X),W&&$(Y),ee=!1,ze(V)}}}function sf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w;return{c(){e=c("div"),l=N("Gateway"),n=c("br"),i=b(),o=c("input"),u=b(),a=c("div"),m=N("DNS"),f=c("br"),p=b(),_=c("div"),h=c("input"),v=b(),d=c("input"),r(o,"name","ng"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(h,"name","nd1"),r(h,"type","text"),r(h,"class","in-f w-full"),r(d,"name","nd2"),r(d,"type","text"),r(d,"class","in-l w-full"),r(_,"class","flex"),r(a,"class","my-1")},m(D,M){S(D,e,M),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].n.g),S(D,u,M),S(D,a,M),s(a,m),s(a,f),s(a,p),s(a,_),s(_,h),oe(h,t[3].n.d1),s(_,v),s(_,d),oe(d,t[3].n.d2),g||(w=[te(o,"input",t[49]),te(h,"input",t[50]),te(d,"input",t[51])],g=!0)},p(D,M){M[0]&8&&o.value!==D[3].n.g&&oe(o,D[3].n.g),M[0]&8&&h.value!==D[3].n.d1&&oe(h,D[3].n.d1),M[0]&8&&d.value!==D[3].n.d2&&oe(d,D[3].n.d2)},d(D){D&&$(e),D&&$(u),D&&$(a),g=!1,ze(w)}}}function of(t){let e,l,n,i,o;return{c(){e=c("label"),l=c("input"),n=N(" 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){S(u,e,a),s(e,l),l.checked=t[3].q.s.e,s(e,n),i||(o=[te(l,"change",t[55]),te(l,"change",t[14])],i=!0)},p(u,a){a[0]&8&&(l.checked=u[3].q.s.e)},d(u){u&&$(e),i=!1,ze(o)}}}function rf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v;const d=[k_,g_],g=[];function w(y,P){return y[3].q.s.c?0:1}n=w(t),i=g[n]=d[n](t);const D=[$_,C_],M=[];function E(y,P){return y[3].q.s.r?0:1}a=E(t),m=M[a]=D[a](t);const R=[N_,T_],O=[];function F(y,P){return y[3].q.s.k?0:1}return _=F(t),h=O[_]=R[_](t),{c(){e=c("div"),l=c("span"),i.c(),o=b(),u=c("span"),m.c(),f=b(),p=c("span"),h.c(),r(l,"class","flex pr-2"),r(u,"class","flex pr-2"),r(p,"class","flex pr-2"),r(e,"class","my-1 flex")},m(y,P){S(y,e,P),s(e,l),g[n].m(l,null),s(e,o),s(e,u),M[a].m(u,null),s(e,f),s(e,p),O[_].m(p,null),v=!0},p(y,P){let ne=n;n=w(y),n===ne?g[n].p(y,P):(Ae(),q(g[ne],1,1,()=>{g[ne]=null}),Pe(),i=g[n],i?i.p(y,P):(i=g[n]=d[n](y),i.c()),I(i,1),i.m(l,null));let H=a;a=E(y),a===H?M[a].p(y,P):(Ae(),q(M[H],1,1,()=>{M[H]=null}),Pe(),m=M[a],m?m.p(y,P):(m=M[a]=D[a](y),m.c()),I(m,1),m.m(u,null));let z=_;_=F(y),_===z?O[_].p(y,P):(Ae(),q(O[z],1,1,()=>{O[z]=null}),Pe(),h=O[_],h?h.p(y,P):(h=O[_]=R[_](y),h.c()),I(h,1),h.m(p,null))},i(y){v||(I(i),I(m),I(h),v=!0)},o(y){q(i),q(m),q(h),v=!1},d(y){y&&$(e),g[n].d(),M[a].d(),O[_].d()}}}function g_(t){let e,l;return e=new Qt({props:{to:"/mqtt-ca",$$slots:{default:[w_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i[3]&1048576&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function k_(t){let e,l,n,i,o,u,a,m;return l=new Qt({props:{to:"/mqtt-ca",$$slots:{default:[y_]},$$scope:{ctx:t}}}),o=new gs({}),{c(){e=c("span"),re(l.$$.fragment),n=b(),i=c("span"),re(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,p){S(f,e,p),ie(l,e,null),S(f,n,p),S(f,i,p),ie(o,i,null),u=!0,a||(m=[te(i,"click",t[11]),te(i,"keypress",t[11])],a=!0)},p(f,p){const _={};p[3]&1048576&&(_.$$scope={dirty:p,ctx:f}),l.$set(_)},i(f){u||(I(l.$$.fragment,f),I(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&$(e),se(l),f&&$(n),f&&$(i),se(o),a=!1,ze(m)}}}function w_(t){let e,l;return e=new an({props:{color:"blue",text:"Upload CA",title:"Click here to upload CA"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function y_(t){let e;return{c(){e=N("CA OK")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function C_(t){let e,l;return e=new Qt({props:{to:"/mqtt-cert",$$slots:{default:[S_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i[3]&1048576&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function $_(t){let e,l,n,i,o,u,a,m;return l=new Qt({props:{to:"/mqtt-cert",$$slots:{default:[M_]},$$scope:{ctx:t}}}),o=new gs({}),{c(){e=c("span"),re(l.$$.fragment),n=b(),i=c("span"),re(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,p){S(f,e,p),ie(l,e,null),S(f,n,p),S(f,i,p),ie(o,i,null),u=!0,a||(m=[te(i,"click",t[12]),te(i,"keypress",t[12])],a=!0)},p(f,p){const _={};p[3]&1048576&&(_.$$scope={dirty:p,ctx:f}),l.$set(_)},i(f){u||(I(l.$$.fragment,f),I(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&$(e),se(l),f&&$(n),f&&$(i),se(o),a=!1,ze(m)}}}function S_(t){let e,l;return e=new an({props:{color:"blue",text:"Upload cert",title:"Click here to upload certificate"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function M_(t){let e;return{c(){e=N("Cert OK")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function T_(t){let e,l;return e=new Qt({props:{to:"/mqtt-key",$$slots:{default:[E_]},$$scope:{ctx:t}}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p(n,i){const o={};i[3]&1048576&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function N_(t){let e,l,n,i,o,u,a,m;return l=new Qt({props:{to:"/mqtt-key",$$slots:{default:[A_]},$$scope:{ctx:t}}}),o=new gs({}),{c(){e=c("span"),re(l.$$.fragment),n=b(),i=c("span"),re(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,p){S(f,e,p),ie(l,e,null),S(f,n,p),S(f,i,p),ie(o,i,null),u=!0,a||(m=[te(i,"click",t[13]),te(i,"keypress",t[13])],a=!0)},p(f,p){const _={};p[3]&1048576&&(_.$$scope={dirty:p,ctx:f}),l.$set(_)},i(f){u||(I(l.$$.fragment,f),I(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&$(e),se(l),f&&$(n),f&&$(i),se(o),a=!1,ze(m)}}}function E_(t){let e,l;return e=new an({props:{color:"blue",text:"Upload key",title:"Click here to upload key"}}),{c(){re(e.$$.fragment)},m(n,i){ie(e,n,i),l=!0},p:pe,i(n){l||(I(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){se(e,n)}}}function A_(t){let e;return{c(){e=N("Key OK")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function af(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w,D,M,E,R,O,F,y,P,ne,H,z,U,K,Q,G,X;return o=new Lt({}),{c(){e=c("div"),l=c("strong"),l.textContent="Domoticz",n=b(),i=c("a"),re(o.$$.fragment),u=b(),a=c("input"),m=b(),f=c("div"),p=c("div"),_=N("Electricity IDX"),h=c("br"),v=b(),d=c("input"),g=b(),w=c("div"),D=N("Current IDX"),M=c("br"),E=b(),R=c("input"),O=b(),F=c("div"),y=N(`Voltage IDX: L1, L2 & L3 `),P=c("div"),ne=c("input"),H=b(),z=c("input"),U=b(),K=c("input"),r(l,"class","text-sm"),r(i,"href",Rt("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(p,"class","w-1/2"),r(R,"name","oc"),r(R,"type","text"),r(R,"class","in-l tr w-full"),r(w,"class","w-1/2"),r(f,"class","my-1 flex"),r(ne,"name","ou1"),r(ne,"type","text"),r(ne,"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(K,"name","ou3"),r(K,"type","text"),r(K,"class","in-l tr w-1/3"),r(P,"class","flex"),r(F,"class","my-1"),r(e,"class","cnt")},m(Y,j){S(Y,e,j),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),s(e,a),s(e,m),s(e,f),s(f,p),s(p,_),s(p,h),s(p,v),s(p,d),oe(d,t[3].o.e),s(f,g),s(f,w),s(w,D),s(w,M),s(w,E),s(w,R),oe(R,t[3].o.c),s(e,O),s(e,F),s(F,y),s(F,P),s(P,ne),oe(ne,t[3].o.u1),s(P,H),s(P,z),oe(z,t[3].o.u2),s(P,U),s(P,K),oe(K,t[3].o.u3),Q=!0,G||(X=[te(d,"input",t[63]),te(R,"input",t[64]),te(ne,"input",t[65]),te(z,"input",t[66]),te(K,"input",t[67])],G=!0)},p(Y,j){j[0]&8&&d.value!==Y[3].o.e&&oe(d,Y[3].o.e),j[0]&8&&R.value!==Y[3].o.c&&oe(R,Y[3].o.c),j[0]&8&&ne.value!==Y[3].o.u1&&oe(ne,Y[3].o.u1),j[0]&8&&z.value!==Y[3].o.u2&&oe(z,Y[3].o.u2),j[0]&8&&K.value!==Y[3].o.u3&&oe(K,Y[3].o.u3)},i(Y){Q||(I(o.$$.fragment,Y),Q=!0)},o(Y){q(o.$$.fragment,Y),Q=!1},d(Y){Y&&$(e),se(o),G=!1,ze(X)}}}function uf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w,D,M,E,R,O,F,y,P,ne,H,z,U,K;return o=new Lt({}),{c(){e=c("div"),l=c("strong"),l.textContent="Home-Assistant",n=b(),i=c("a"),re(o.$$.fragment),u=b(),a=c("input"),m=b(),f=c("div"),p=N("Discovery topic prefix"),_=c("br"),h=b(),v=c("input"),d=b(),g=c("div"),w=N("Hostname for URL"),D=c("br"),M=b(),E=c("input"),O=b(),F=c("div"),y=N("Name tag"),P=c("br"),ne=b(),H=c("input"),r(l,"class","text-sm"),r(i,"href",Rt("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",R=t[3].g.h+".local"),r(g,"class","my-1"),r(H,"name","hn"),r(H,"type","text"),r(H,"class","in-s"),r(F,"class","my-1"),r(e,"class","cnt")},m(Q,G){S(Q,e,G),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),s(e,a),s(e,m),s(e,f),s(f,p),s(f,_),s(f,h),s(f,v),oe(v,t[3].h.t),s(e,d),s(e,g),s(g,w),s(g,D),s(g,M),s(g,E),oe(E,t[3].h.h),s(e,O),s(e,F),s(F,y),s(F,P),s(F,ne),s(F,H),oe(H,t[3].h.n),z=!0,U||(K=[te(v,"input",t[68]),te(E,"input",t[69]),te(H,"input",t[70])],U=!0)},p(Q,G){G[0]&8&&v.value!==Q[3].h.t&&oe(v,Q[3].h.t),(!z||G[0]&8&&R!==(R=Q[3].g.h+".local"))&&r(E,"placeholder",R),G[0]&8&&E.value!==Q[3].h.h&&oe(E,Q[3].h.h),G[0]&8&&H.value!==Q[3].h.n&&oe(H,Q[3].h.n)},i(Q){z||(I(o.$$.fragment,Q),z=!0)},o(Q){q(o.$$.fragment,Q),z=!1},d(Q){Q&&$(e),se(o),U=!1,ze(K)}}}function ff(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w,D,M,E,R,O,F,y,P,ne,H,z,U,K,Q,G,X,Y,j,x,ae;o=new Lt({});let ee=t[3].c.es&&cf(t);return{c(){e=c("div"),l=c("strong"),l.textContent="Cloud connections",n=b(),i=c("a"),re(o.$$.fragment),u=b(),a=c("input"),m=b(),f=c("div"),p=c("label"),_=c("input"),h=N(" Enable cloud upload"),v=b(),d=c("div"),g=N("Client ID"),w=c("br"),D=b(),M=c("input"),O=b(),F=c("div"),y=N("Client secret"),P=c("br"),ne=b(),H=c("input"),U=b(),K=c("div"),Q=c("label"),G=c("input"),X=N(" Energy Speedometer"),Y=b(),ee&&ee.c(),r(l,"class","text-sm"),r(i,"href",Rt("Cloud")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","c"),a.value="true",r(_,"type","checkbox"),r(_,"name","ce"),_.__value="true",_.value=_.__value,r(_,"class","rounded mb-1"),r(f,"class","my-1"),r(M,"name","ci"),r(M,"type","text"),r(M,"class","in-s"),r(M,"pattern",E=t[3].c.e?"[A-Z0-9]{16}":".*"),M.required=R=t[3].c.e,r(d,"class","my-1"),r(H,"name","cs"),r(H,"type","text"),r(H,"class","in-s"),r(H,"pattern",z=t[3].c.e&&t[3].c.s!="***"?"[A-Z0-9]{16}":".*"),r(F,"class","my-1"),r(G,"type","checkbox"),r(G,"class","rounded mb-1"),r(G,"name","ces"),G.__value="true",G.value=G.__value,r(K,"class","my-1"),r(e,"class","cnt")},m(V,W){S(V,e,W),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),s(e,a),s(e,m),s(e,f),s(f,p),s(p,_),_.checked=t[3].c.e,s(p,h),s(e,v),s(e,d),s(d,g),s(d,w),s(d,D),s(d,M),oe(M,t[3].c.i),s(e,O),s(e,F),s(F,y),s(F,P),s(F,ne),s(F,H),oe(H,t[3].c.s),s(e,U),s(e,K),s(K,Q),s(Q,G),G.checked=t[3].c.es,s(Q,X),s(K,Y),ee&&ee.m(K,null),j=!0,x||(ae=[te(_,"change",t[71]),te(M,"input",t[72]),te(H,"input",t[73]),te(G,"change",t[74])],x=!0)},p(V,W){W[0]&8&&(_.checked=V[3].c.e),(!j||W[0]&8&&E!==(E=V[3].c.e?"[A-Z0-9]{16}":".*"))&&r(M,"pattern",E),(!j||W[0]&8&&R!==(R=V[3].c.e))&&(M.required=R),W[0]&8&&M.value!==V[3].c.i&&oe(M,V[3].c.i),(!j||W[0]&8&&z!==(z=V[3].c.e&&V[3].c.s!="***"?"[A-Z0-9]{16}":".*"))&&r(H,"pattern",z),W[0]&8&&H.value!==V[3].c.s&&oe(H,V[3].c.s),W[0]&8&&(G.checked=V[3].c.es),V[3].c.es?ee?(ee.p(V,W),W[0]&8&&I(ee,1)):(ee=cf(V),ee.c(),I(ee,1),ee.m(K,null)):ee&&(Ae(),q(ee,1,1,()=>{ee=null}),Pe())},i(V){j||(I(o.$$.fragment,V),I(ee),j=!0)},o(V){q(o.$$.fragment,V),q(ee),j=!1},d(V){V&&$(e),se(o),ee&&ee.d(),x=!1,ze(ae)}}}function cf(t){let e,l,n=t[0].mac+"",i,o,u,a,m=(t[0].meter.id?t[0].meter.id:"missing, required")+"",f,p,_,h,v=t[0].mac&&t[0].meter.id&&mf(t);return{c(){e=c("div"),l=N("MAC: "),i=N(n),o=b(),u=c("div"),a=N("Meter ID: "),f=N(m),p=b(),v&&v.c(),_=Ke(),r(e,"class","pl-5"),r(u,"class","pl-5")},m(d,g){S(d,e,g),s(e,l),s(e,i),S(d,o,g),S(d,u,g),s(u,a),s(u,f),S(d,p,g),v&&v.m(d,g),S(d,_,g),h=!0},p(d,g){(!h||g[0]&1)&&n!==(n=d[0].mac+"")&&J(i,n),(!h||g[0]&1)&&m!==(m=(d[0].meter.id?d[0].meter.id:"missing, required")+"")&&J(f,m),d[0].mac&&d[0].meter.id?v?(v.p(d,g),g[0]&1&&I(v,1)):(v=mf(d),v.c(),I(v,1),v.m(_.parentNode,_)):v&&(Ae(),q(v,1,1,()=>{v=null}),Pe())},i(d){h||(I(v),h=!0)},o(d){q(v),h=!1},d(d){d&&$(e),d&&$(o),d&&$(u),d&&$(p),v&&v.d(d),d&&$(_)}}}function mf(t){let e,l,n;return l=new __({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=c("div"),re(l.$$.fragment),r(e,"class","pl-2")},m(i,o){S(i,e,o),ie(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||(I(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&$(e),se(l)}}}function _f(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w,D,M,E;o=new Lt({});let R={length:9},O=[];for(let F=0;F20&&hf(t),_=t[3].i.d.d>0&&kf(t),h=t[0].chip=="esp8266"&&wf(t);return{c(){e=c("div"),l=c("strong"),l.textContent="Hardware",n=b(),i=c("a"),re(o.$$.fragment),u=b(),p&&p.c(),a=b(),_&&_.c(),m=b(),h&&h.c(),r(l,"class","text-sm"),r(i,"href",Rt("GPIO-configuration")),r(i,"target","_blank"),r(i,"class","float-right"),r(e,"class","cnt")},m(v,d){S(v,e,d),s(e,l),s(e,n),s(e,i),ie(o,i,null),s(e,u),p&&p.m(e,null),s(e,a),_&&_.m(e,null),s(e,m),h&&h.m(e,null),f=!0},p(v,d){v[0].board>20?p?(p.p(v,d),d[0]&1&&I(p,1)):(p=hf(v),p.c(),I(p,1),p.m(e,a)):p&&(Ae(),q(p,1,1,()=>{p=null}),Pe()),v[3].i.d.d>0?_?_.p(v,d):(_=kf(v),_.c(),_.m(e,m)):_&&(_.d(1),_=null),v[0].chip=="esp8266"?h?h.p(v,d):(h=wf(v),h.c(),h.m(e,null)):h&&(h.d(1),h=null)},i(v){f||(I(o.$$.fragment,v),I(p),f=!0)},o(v){q(o.$$.fragment,v),q(p),f=!1},d(v){v&&$(e),se(o),p&&p.d(),_&&_.d(),h&&h.d()}}}function hf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w,D,M,E,R,O,F,y,P,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Ie,Se,ye,ve,Te,be,T,C,k,A,L,Z,le,fe,de,Ce,Oe,ue,Me,Je,It,st,wt,nt,Ot,Qe,Xt,zt,vt,xe,Ge,Ye,Ne,Ze,et;f=new io({props:{chip:t[0].chip}}),w=new io({props:{chip:t[0].chip}});let qe=t[0].chip!="esp8266"&&bf(t),Fe=t[3].i.v.p>0&&gf(t);return{c(){e=c("input"),l=b(),n=c("div"),i=c("div"),o=N("HAN RX"),u=c("br"),a=b(),m=c("select"),re(f.$$.fragment),p=b(),_=c("div"),h=N("HAN TX"),v=c("br"),d=b(),g=c("select"),re(w.$$.fragment),D=b(),M=c("div"),E=c("label"),R=c("input"),O=N(" pullup"),F=b(),y=c("div"),P=c("div"),ne=N("AP button"),H=c("br"),z=b(),U=c("input"),K=b(),Q=c("div"),G=N("LED"),X=c("br"),Y=b(),j=c("div"),x=c("input"),ae=b(),ee=c("div"),V=c("label"),W=c("input"),we=N(" inverted"),He=b(),Ie=c("div"),Se=N("RGB"),ye=c("label"),ve=c("input"),Te=N(" inverted"),be=c("br"),T=b(),C=c("div"),k=c("input"),A=b(),L=c("input"),Z=b(),le=c("input"),fe=b(),de=c("div"),Ce=c("div"),Oe=N(`LED dis. GPIO `),ue=c("input"),Me=b(),Je=c("div"),It=N("Temperature"),st=c("br"),wt=b(),nt=c("input"),Ot=b(),Qe=c("div"),Xt=N("Analog temp"),zt=c("br"),vt=b(),xe=c("input"),Ge=b(),qe&&qe.c(),Ye=b(),Fe&&Fe.c(),r(e,"type","hidden"),r(e,"name","i"),e.value="true",r(m,"name","ihp"),r(m,"class","in-f w-full"),t[3].i.h.p===void 0&&We(()=>t[78].call(m)),r(i,"class","w-1/3"),r(g,"name","iht"),r(g,"class","in-l w-full"),t[3].i.h.t===void 0&&We(()=>t[79].call(g)),r(_,"class","w-1/3"),r(R,"name","ihu"),R.__value="true",R.value=R.__value,r(R,"type","checkbox"),r(R,"class","rounded mb-1"),r(E,"class","ml-2"),r(M,"class","w-1/3"),r(n,"class","flex flex-wrap"),r(U,"name","ia"),r(U,"type","number"),r(U,"min","0"),r(U,"max",t[6]),r(U,"class","in-f tr w-full"),r(P,"class","w-1/3"),r(x,"name","ilp"),r(x,"type","number"),r(x,"min","0"),r(x,"max",t[6]),r(x,"class","in-l tr w-full"),r(j,"class","flex"),r(Q,"class","w-1/3"),r(W,"name","ili"),W.__value="true",W.value=W.__value,r(W,"type","checkbox"),r(W,"class","rounded mb-1"),r(V,"class","ml-4"),r(ee,"class","w-1/3"),r(ve,"name","iri"),ve.__value="true",ve.value=ve.__value,r(ve,"type","checkbox"),r(ve,"class","rounded mb-1"),r(ye,"class","ml-4"),r(k,"name","irr"),r(k,"type","number"),r(k,"min","0"),r(k,"max",t[6]),r(k,"class","in-f tr w-1/3"),r(L,"name","irg"),r(L,"type","number"),r(L,"min","0"),r(L,"max",t[6]),r(L,"class","in-m tr w-1/3"),r(le,"name","irb"),r(le,"type","number"),r(le,"min","0"),r(le,"max",t[6]),r(le,"class","in-l tr w-1/3"),r(C,"class","flex"),r(Ie,"class","w-full"),r(ue,"name","idd"),r(ue,"type","number"),r(ue,"min","0"),r(ue,"max",t[6]),r(ue,"class","in-s tr"),r(Ce,"class","my-1 pr-1 w-1/3"),r(de,"class","w-full"),r(nt,"name","itd"),r(nt,"type","number"),r(nt,"min","0"),r(nt,"max",t[6]),r(nt,"class","in-f tr w-full"),r(Je,"class","my-1 w-1/3"),r(xe,"name","ita"),r(xe,"type","number"),r(xe,"min","0"),r(xe,"max",t[6]),r(xe,"class","in-l tr w-full"),r(Qe,"class","my-1 pr-1 w-1/3"),r(y,"class","flex flex-wrap")},m(_e,ce){S(_e,e,ce),S(_e,l,ce),S(_e,n,ce),s(n,i),s(i,o),s(i,u),s(i,a),s(i,m),ie(f,m,null),$e(m,t[3].i.h.p,!0),s(n,p),s(n,_),s(_,h),s(_,v),s(_,d),s(_,g),ie(w,g,null),$e(g,t[3].i.h.t,!0),s(n,D),s(n,M),s(M,E),s(E,R),R.checked=t[3].i.h.u,s(E,O),S(_e,F,ce),S(_e,y,ce),s(y,P),s(P,ne),s(P,H),s(P,z),s(P,U),oe(U,t[3].i.a),s(y,K),s(y,Q),s(Q,G),s(Q,X),s(Q,Y),s(Q,j),s(j,x),oe(x,t[3].i.l.p),s(y,ae),s(y,ee),s(ee,V),s(V,W),W.checked=t[3].i.l.i,s(V,we),s(y,He),s(y,Ie),s(Ie,Se),s(Ie,ye),s(ye,ve),ve.checked=t[3].i.r.i,s(ye,Te),s(Ie,be),s(Ie,T),s(Ie,C),s(C,k),oe(k,t[3].i.r.r),s(C,A),s(C,L),oe(L,t[3].i.r.g),s(C,Z),s(C,le),oe(le,t[3].i.r.b),s(y,fe),s(y,de),s(de,Ce),s(Ce,Oe),s(Ce,ue),oe(ue,t[3].i.d.d),s(y,Me),s(y,Je),s(Je,It),s(Je,st),s(Je,wt),s(Je,nt),oe(nt,t[3].i.t.d),s(y,Ot),s(y,Qe),s(Qe,Xt),s(Qe,zt),s(Qe,vt),s(Qe,xe),oe(xe,t[3].i.t.a),s(y,Ge),qe&&qe.m(y,null),s(y,Ye),Fe&&Fe.m(y,null),Ne=!0,Ze||(et=[te(m,"change",t[78]),te(g,"change",t[79]),te(R,"change",t[80]),te(U,"input",t[81]),te(x,"input",t[82]),te(W,"change",t[83]),te(ve,"change",t[84]),te(k,"input",t[85]),te(L,"input",t[86]),te(le,"input",t[87]),te(ue,"input",t[88]),te(nt,"input",t[89]),te(xe,"input",t[90])],Ze=!0)},p(_e,ce){const Be={};ce[0]&1&&(Be.chip=_e[0].chip),f.$set(Be),ce[0]&8&&$e(m,_e[3].i.h.p);const pt={};ce[0]&1&&(pt.chip=_e[0].chip),w.$set(pt),ce[0]&8&&$e(g,_e[3].i.h.t),ce[0]&8&&(R.checked=_e[3].i.h.u),(!Ne||ce[0]&64)&&r(U,"max",_e[6]),ce[0]&8&&ge(U.value)!==_e[3].i.a&&oe(U,_e[3].i.a),(!Ne||ce[0]&64)&&r(x,"max",_e[6]),ce[0]&8&&ge(x.value)!==_e[3].i.l.p&&oe(x,_e[3].i.l.p),ce[0]&8&&(W.checked=_e[3].i.l.i),ce[0]&8&&(ve.checked=_e[3].i.r.i),(!Ne||ce[0]&64)&&r(k,"max",_e[6]),ce[0]&8&&ge(k.value)!==_e[3].i.r.r&&oe(k,_e[3].i.r.r),(!Ne||ce[0]&64)&&r(L,"max",_e[6]),ce[0]&8&&ge(L.value)!==_e[3].i.r.g&&oe(L,_e[3].i.r.g),(!Ne||ce[0]&64)&&r(le,"max",_e[6]),ce[0]&8&&ge(le.value)!==_e[3].i.r.b&&oe(le,_e[3].i.r.b),(!Ne||ce[0]&64)&&r(ue,"max",_e[6]),ce[0]&8&&ge(ue.value)!==_e[3].i.d.d&&oe(ue,_e[3].i.d.d),(!Ne||ce[0]&64)&&r(nt,"max",_e[6]),ce[0]&8&&ge(nt.value)!==_e[3].i.t.d&&oe(nt,_e[3].i.t.d),(!Ne||ce[0]&64)&&r(xe,"max",_e[6]),ce[0]&8&&ge(xe.value)!==_e[3].i.t.a&&oe(xe,_e[3].i.t.a),_e[0].chip!="esp8266"?qe?qe.p(_e,ce):(qe=bf(_e),qe.c(),qe.m(y,Ye)):qe&&(qe.d(1),qe=null),_e[3].i.v.p>0?Fe?Fe.p(_e,ce):(Fe=gf(_e),Fe.c(),Fe.m(y,null)):Fe&&(Fe.d(1),Fe=null)},i(_e){Ne||(I(f.$$.fragment,_e),I(w.$$.fragment,_e),Ne=!0)},o(_e){q(f.$$.fragment,_e),q(w.$$.fragment,_e),Ne=!1},d(_e){_e&&$(e),_e&&$(l),_e&&$(n),se(f),se(w),_e&&$(F),_e&&$(y),qe&&qe.d(),Fe&&Fe.d(),Ze=!1,ze(et)}}}function bf(t){let e,l,n,i,o,u,a;return{c(){e=c("div"),l=N("Vcc"),n=c("br"),i=b(),o=c("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(m,f){S(m,e,f),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].i.v.p),u||(a=te(o,"input",t[91]),u=!0)},p(m,f){f[0]&64&&r(o,"max",m[6]),f[0]&8&&ge(o.value)!==m[3].i.v.p&&oe(o,m[3].i.v.p)},d(m){m&&$(e),u=!1,a()}}}function gf(t){let e,l,n,i,o,u,a,m,f,p;return{c(){e=c("div"),l=N("Voltage divider"),n=c("br"),i=b(),o=c("div"),u=c("input"),a=b(),m=c("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(m,"name","ivdg"),r(m,"type","number"),r(m,"min","0"),r(m,"max","65535"),r(m,"class","in-l tr w-full"),r(m,"placeholder","GND"),r(o,"class","flex"),r(e,"class","my-1")},m(_,h){S(_,e,h),s(e,l),s(e,n),s(e,i),s(e,o),s(o,u),oe(u,t[3].i.v.d.v),s(o,a),s(o,m),oe(m,t[3].i.v.d.g),f||(p=[te(u,"input",t[92]),te(m,"input",t[93])],f=!0)},p(_,h){h[0]&8&&ge(u.value)!==_[3].i.v.d.v&&oe(u,_[3].i.v.d.v),h[0]&8&&ge(m.value)!==_[3].i.v.d.g&&oe(m,_[3].i.v.d.g)},d(_){_&&$(e),f=!1,ze(p)}}}function kf(t){let e,l,n,i,o,u,a;return{c(){e=c("div"),l=N(`LED behaviour `),n=c("select"),i=c("option"),i.textContent="Enabled",o=c("option"),o.textContent="Disabled",i.__value=0,i.value=i.__value,o.__value=1,o.value=o.__value,r(n,"name","idb"),r(n,"class","in-s"),t[3].i.d.b===void 0&&We(()=>t[94].call(n)),r(e,"class","my-1 w-full")},m(m,f){S(m,e,f),s(e,l),s(e,n),s(n,i),s(n,o),$e(n,t[3].i.d.b,!0),u||(a=te(n,"change",t[94]),u=!0)},p(m,f){f[0]&8&&$e(n,m[3].i.d.b)},d(m){m&&$(e),u=!1,a()}}}function wf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w,D,M=(t[0].board==2||t[0].board==100)&&yf(t);return{c(){e=c("input"),l=b(),n=c("div"),i=c("div"),o=N("Vcc offset"),u=c("br"),a=b(),m=c("input"),f=b(),p=c("div"),_=N("Multiplier"),h=c("br"),v=b(),d=c("input"),g=b(),M&&M.c(),r(e,"type","hidden"),r(e,"name","iv"),e.value="true",r(m,"name","ivo"),r(m,"type","number"),r(m,"min","0.0"),r(m,"max","3.5"),r(m,"step","0.01"),r(m,"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(p,"class","w-1/3 pr-1"),r(n,"class","my-1 flex flex-wrap")},m(E,R){S(E,e,R),S(E,l,R),S(E,n,R),s(n,i),s(i,o),s(i,u),s(i,a),s(i,m),oe(m,t[3].i.v.o),s(n,f),s(n,p),s(p,_),s(p,h),s(p,v),s(p,d),oe(d,t[3].i.v.m),s(n,g),M&&M.m(n,null),w||(D=[te(m,"input",t[95]),te(d,"input",t[96])],w=!0)},p(E,R){R[0]&8&&ge(m.value)!==E[3].i.v.o&&oe(m,E[3].i.v.o),R[0]&8&&ge(d.value)!==E[3].i.v.m&&oe(d,E[3].i.v.m),E[0].board==2||E[0].board==100?M?M.p(E,R):(M=yf(E),M.c(),M.m(n,null)):M&&(M.d(1),M=null)},d(E){E&&$(e),E&&$(l),E&&$(n),M&&M.d(),w=!1,ze(D)}}}function yf(t){let e,l,n,i,o,u,a;return{c(){e=c("div"),l=N("Boot limit"),n=c("br"),i=b(),o=c("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(m,f){S(m,e,f),s(e,l),s(e,n),s(e,i),s(e,o),oe(o,t[3].i.v.b),u||(a=te(o,"input",t[97]),u=!0)},p(m,f){f[0]&8&&ge(o.value)!==m[3].i.v.b&&oe(o,m[3].i.v.b)},d(m){m&&$(e),u=!1,a()}}}function Cf(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w,D=t[3].d.t&&$f();return{c(){e=c("div"),e.textContent="Debug can cause sudden reboots. Do not leave on!",l=b(),n=c("div"),i=c("label"),o=c("input"),u=N(" Enable telnet"),a=b(),D&&D.c(),m=b(),f=c("div"),p=c("select"),_=c("option"),_.textContent="Verbose",h=c("option"),h.textContent="Debug",v=c("option"),v.textContent="Info",d=c("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"),_.__value=1,_.value=_.__value,h.__value=2,h.value=h.__value,v.__value=3,v.value=v.__value,d.__value=4,d.value=d.__value,r(p,"name","dl"),r(p,"class","in-s"),t[3].d.l===void 0&&We(()=>t[100].call(p)),r(f,"class","my-1")},m(M,E){S(M,e,E),S(M,l,E),S(M,n,E),s(n,i),s(i,o),o.checked=t[3].d.t,s(i,u),S(M,a,E),D&&D.m(M,E),S(M,m,E),S(M,f,E),s(f,p),s(p,_),s(p,h),s(p,v),s(p,d),$e(p,t[3].d.l,!0),g||(w=[te(o,"change",t[99]),te(p,"change",t[100])],g=!0)},p(M,E){E[0]&8&&(o.checked=M[3].d.t),M[3].d.t?D||(D=$f(),D.c(),D.m(m.parentNode,m)):D&&(D.d(1),D=null),E[0]&8&&$e(p,M[3].d.l)},d(M){M&&$(e),M&&$(l),M&&$(n),M&&$(a),D&&D.d(M),M&&$(m),M&&$(f),g=!1,ze(w)}}}function $f(t){let e;return{c(){e=c("div"),e.textContent="Telnet is unsafe and should be off when not in use",r(e,"class","bd-red")},m(l,n){S(l,e,n)},d(l){l&&$(e)}}}function P_(t){let e,l,n,i,o,u,a,m,f,p,_,h,v,d,g,w,D,M,E,R,O,F,y,P,ne,H,z,U,K,Q,G,X,Y,j,x,ae,ee,V,W,we,He,Ie,Se,ye,ve,Te,be,T,C,k,A,L,Z,le,fe,de,Ce,Oe,ue,Me,Je,It,st,wt,nt,Ot,Qe,Xt,zt,vt,xe,Ge,Ye,Ne,Ze,et,qe,Fe,_e,ce,Be,pt,Tl,Nl,El,Mi,Ti,je,_n,Ni,Al,Pl,Ei,Hl,Ai,Wl,Pi,hl,Di,Li,Ri,Gt,Dl,Ve,yt,ht,si,Ii,bl,Oi,zl,Zt,$o,So,Ll,rl,Rl,Mo,Fi,To,bt,Il,No,qi,pn,dn,vn,hn,Bi,Eo,Ft,Ui,Ao,Gl,Po,Do,Lo,al,bn,gn,Ro,kn,Vl,Io,Oo,Fo,wn,Jt,qo,ji,Bo,Kl,Uo,jo,Ho,yn,xt,Wo,Hi,zo,ks,Go,Yl,Wi,el,Vo,Ko,Yo,ws,zi,tl,Qo,Xo,Zo,qt,Gi,Jo,Cn,$n,xo,oi,er,Ql,tr,lr,nr,Vt,Sn,Mn,ir,sr,mt,Vi,or,Tn,Nn,rr,Xl,ar,ur,fr,Ol,ul,En,An,cr,Bt,Ki,Yi,mr,Ut,Pn,Qi,Xi,_r,ys,Zi,Ji,ll,pr,dr,ri,vr,Fl,hr,ai,nl,br,gr,kr,xi,gl,wr,lt,es,yr,Dn,Ln,Cr,ui,$r,fl,Sr,Cs,Mr,Tr,Rn,kl,Nr,il,Er,$s,Zl,Ar,Pr,Dr,wl,Lr,Jl,Rr,Ir,Or,yl,Fr,In,On,qr,Br,Ur,Cl,jr,Fn,Hr,Wr,zr,Ct,qn,Bn,Un,jn,Hn,Wn,Gr,xl,Vr,Kr,Yr,$l,Qr,Ss,Ms,Ts,Ns=t[3].p.r.startsWith("10YNO")||t[3].p.r.startsWith("10Y1001A1001A4"),Es,cl,ts,Xr,zn,Gn,Zr,fi,Jr,ci,xr,As,jt,ls,ea,Vn,Kn,ta,mi,la,ns,is,sl,na,ia,sa,ql,Ps,Yn,oa,ss,Qn,ra,os,Ds,en,Ls,tn,Rs,ln,Is,nn,Kt,Os,aa;a=new Lt({}),P=new o_({});let n1=["NOK","SEK","DKK","EUR","CHF"],_i=[];for(let B=0;B<5;B+=1)_i[B]=v_(d_(t,n1,B));vt=new Qt({props:{to:"/priceconfig",class:"text-blue-600 hover:text-blue-800",$$slots:{default:[h_]},$$scope:{ctx:t}}});let $t=t[3].p.e&&t[0].chip!="esp8266"&&Zu(t),St=t[3].g.s>0&&Ju(t);Pl=new Lt({});let i1=[24,48,96,192,384,576,1152],pi=[];for(let B=0;B<7;B+=1)pi[B]=b_(p_(t,i1,B));let Mt=t[3].m.e.e&&xu(t),Tt=t[3].m.e.e&&ef(t),Nt=t[3].m.m.e&&tf(t);$n=new Lt({});let Ht=t[0].if&&t[0].if.eth&&lf(),Et=(t[3].n.c==1||t[3].n.c==2)&&nf(t);Nn=new Lt({}),Pn=new t1({});let At=t[3].n.m=="static"&&sf(t);Ln=new Lt({});let Pt=t[0].chip!="esp8266"&&of(t),ot=t[3].q.s.e&&rf(t),rt=t[3].q.m==3&&af(t),at=t[3].q.m==4&&uf(t),ut=t[3].c.es!=null&&ff(t),ft=Ns&&_f(t);Gn=new Lt({});let Xn=t[7],gt=[];for(let B=0;B20||t[0].chip=="esp8266"||t[3].i.d.d>0)&&vf(t);Kn=new Lt({});let Dt=t[3].d.s&&Cf(t);return en=new kt({props:{active:t[1],message:"Loading configuration"}}),tn=new kt({props:{active:t[2],message:"Saving configuration"}}),ln=new kt({props:{active:t[4],message:"Performing factory reset"}}),nn=new kt({props:{active:t[5],message:"Device have been factory reset and switched to AP mode"}}),{c(){e=c("form"),l=c("div"),n=c("div"),i=c("strong"),i.textContent="General",o=b(),u=c("a"),re(a.$$.fragment),m=b(),f=c("input"),p=b(),_=c("div"),h=c("div"),v=c("div"),d=N("Hostname"),g=c("br"),w=b(),D=c("input"),M=b(),E=c("div"),R=N("Time zone"),O=c("br"),F=b(),y=c("select"),re(P.$$.fragment),ne=b(),H=c("input"),z=b(),U=c("div"),K=c("div"),Q=c("div"),G=N("Price region"),X=c("br"),Y=b(),j=c("select"),x=c("optgroup"),ae=c("option"),ae.textContent="NO1",ee=c("option"),ee.textContent="NO2",V=c("option"),V.textContent="NO3",W=c("option"),W.textContent="NO4",we=c("option"),we.textContent="NO5",He=c("optgroup"),Ie=c("option"),Ie.textContent="SE1",Se=c("option"),Se.textContent="SE2",ye=c("option"),ye.textContent="SE3",ve=c("option"),ve.textContent="SE4",Te=c("optgroup"),be=c("option"),be.textContent="DK1",T=c("option"),T.textContent="DK2",C=c("option"),C.textContent="Austria",k=c("option"),k.textContent="Belgium",A=c("option"),A.textContent="Czech Republic",L=c("option"),L.textContent="Estonia",Z=c("option"),Z.textContent="Finland",le=c("option"),le.textContent="France",fe=c("option"),fe.textContent="Germany",de=c("option"),de.textContent="Great Britain",Ce=c("option"),Ce.textContent="Latvia",Oe=c("option"),Oe.textContent="Lithuania",ue=c("option"),ue.textContent="Netherland",Me=c("option"),Me.textContent="Poland",Je=c("option"),Je.textContent="Switzerland",It=b(),st=c("div"),wt=N("Currency"),nt=c("br"),Ot=b(),Qe=c("select");for(let B=0;B<5;B+=1)_i[B].c();Xt=b(),zt=c("div"),re(vt.$$.fragment),xe=b(),Ge=c("div"),Ye=c("label"),Ne=c("input"),Ze=N(" Enable price fetch from remote server"),et=b(),$t&&$t.c(),qe=b(),Fe=c("div"),_e=N("Security"),ce=c("br"),Be=b(),pt=c("select"),Tl=c("option"),Tl.textContent="None",Nl=c("option"),Nl.textContent="Only configuration",El=c("option"),El.textContent="Everything",Mi=b(),St&&St.c(),Ti=b(),je=c("div"),_n=c("strong"),_n.textContent="Meter",Ni=b(),Al=c("a"),re(Pl.$$.fragment),Ei=b(),Hl=c("input"),Ai=b(),Wl=c("input"),Pi=b(),hl=c("div"),Di=N("Communication"),Li=c("br"),Ri=b(),Gt=c("select"),Dl=c("option"),Dl.textContent="Passive (Push)",Ve=c("option"),Ve.textContent="Kamstrup (Pull)",yt=b(),ht=c("div"),si=c("span"),si.textContent="Buffer size",Ii=b(),bl=c("span"),bl.textContent="Serial conf.",Oi=b(),zl=c("label"),Zt=c("input"),$o=N(" inverted"),So=b(),Ll=c("div"),rl=c("select"),Rl=c("option"),Mo=N("Autodetect");for(let B=0;B<7;B+=1)pi[B].c();To=b(),bt=c("select"),Il=c("option"),No=N("-"),pn=c("option"),pn.textContent="7N1",dn=c("option"),dn.textContent="8N1",vn=c("option"),vn.textContent="7E1",hn=c("option"),hn.textContent="8E1",Eo=b(),Ft=c("input"),Ao=b(),Gl=c("div"),Po=N("Voltage"),Do=c("br"),Lo=b(),al=c("select"),bn=c("option"),bn.textContent="400V (TN)",gn=c("option"),gn.textContent="230V (IT/TT)",Ro=b(),kn=c("div"),Vl=c("div"),Io=N("Main fuse"),Oo=c("br"),Fo=b(),wn=c("label"),Jt=c("input"),qo=b(),ji=c("span"),ji.textContent="A",Bo=b(),Kl=c("div"),Uo=N("Production"),jo=c("br"),Ho=b(),yn=c("label"),xt=c("input"),Wo=b(),Hi=c("span"),Hi.textContent="kWp",zo=b(),ks=c("div"),Go=b(),Yl=c("div"),Wi=c("label"),el=c("input"),Vo=N(" Meter is encrypted"),Ko=b(),Mt&&Mt.c(),Yo=b(),Tt&&Tt.c(),ws=b(),zi=c("label"),tl=c("input"),Qo=N(" Multipliers"),Xo=b(),Nt&&Nt.c(),Zo=b(),qt=c("div"),Gi=c("strong"),Gi.textContent="Connection",Jo=b(),Cn=c("a"),re($n.$$.fragment),xo=b(),oi=c("input"),er=b(),Ql=c("div"),tr=N("Connection"),lr=c("br"),nr=b(),Vt=c("select"),Sn=c("option"),Sn.textContent="WiFi",Mn=c("option"),Mn.textContent="Access point",Ht&&Ht.c(),ir=b(),Et&&Et.c(),sr=b(),mt=c("div"),Vi=c("strong"),Vi.textContent="Network",or=b(),Tn=c("a"),re(Nn.$$.fragment),rr=b(),Xl=c("div"),ar=N("IP"),ur=c("br"),fr=b(),Ol=c("div"),ul=c("select"),En=c("option"),En.textContent="DHCP",An=c("option"),An.textContent="Static",cr=b(),Bt=c("input"),mr=b(),Ut=c("select"),re(Pn.$$.fragment),_r=b(),At&&At.c(),ys=b(),Zi=c("div"),Ji=c("label"),ll=c("input"),pr=N(" enable mDNS"),dr=b(),ri=c("input"),vr=b(),Fl=c("div"),hr=N("NTP "),ai=c("label"),nl=c("input"),br=N(" obtain from DHCP"),gr=c("br"),kr=b(),xi=c("div"),gl=c("input"),wr=b(),lt=c("div"),es=c("strong"),es.textContent="MQTT",yr=b(),Dn=c("a"),re(Ln.$$.fragment),Cr=b(),ui=c("input"),$r=b(),fl=c("div"),Sr=N(`Server diff --git a/lib/SvelteUi/app/src/lib/DayPlot.svelte b/lib/SvelteUi/app/src/lib/DayPlot.svelte index d8f253a3..7d1564f2 100644 --- a/lib/SvelteUi/app/src/lib/DayPlot.svelte +++ b/lib/SvelteUi/app/src/lib/DayPlot.svelte @@ -37,7 +37,7 @@ title2: exp.toFixed(2) + ' kWh', value2: exp*10, color: dark ? '#5c2da5' : '#7c3aed', - color2: '#37829E' + color2: dark ? '#27728e' : '#37829e', }); min = Math.max(min, exp*10); max = Math.max(max, imp*10); @@ -60,7 +60,7 @@ title2: exp.toFixed(2) + ' kWh', value2: exp*10, color: dark ? '#5c2da5' : '#7c3aed', - color2: '#37829E' + color2: dark ? '#27728e' : '#37829e', }); min = Math.max(min, exp*10); max = Math.max(max, imp*10); diff --git a/lib/SvelteUi/app/src/lib/MonthPlot.svelte b/lib/SvelteUi/app/src/lib/MonthPlot.svelte index 5a45232a..a02e8621 100644 --- a/lib/SvelteUi/app/src/lib/MonthPlot.svelte +++ b/lib/SvelteUi/app/src/lib/MonthPlot.svelte @@ -40,7 +40,7 @@ title2: exp.toFixed(2) + ' kWh', value2: exp, color: dark ? '#5c2da5' : '#7c3aed', - color2: '#37829E' + color2: dark ? '#27728e' : '#37829e', }); min = Math.max(min, exp); max = Math.max(max, imp); @@ -62,7 +62,7 @@ title2: exp.toFixed(2) + ' kWh', value2: exp, color: dark ? '#5c2da5' : '#7c3aed', - color2: '#37829E' + color2: dark ? '#27728e' : '#37829e', }); min = Math.max(min, exp); max = Math.max(max, imp);