diff --git a/lib/SvelteUi/app/dist/index.css b/lib/SvelteUi/app/dist/index.css index 0ac581a3..f1d30ab2 100644 --- a/lib/SvelteUi/app/dist/index.css +++ b/lib/SvelteUi/app/dist/index.css @@ -1 +1 @@ -/*! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{font-feature-settings:inherit;color:inherit;font-family:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}[multiple],[type=date],[type=datetime-local],[type=email],[type=month],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=time],[type=url],[type=week],input:where(:not([type])),select,textarea{--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-radius:0;border-width:1px;font-size:1rem;line-height:1.5rem;padding:.5rem .75rem}[multiple]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=email]:focus,[type=month]:focus,[type=number]:focus,[type=password]:focus,[type=search]:focus,[type=tel]:focus,[type=text]:focus,[type=time]:focus,[type=url]:focus,[type=week]:focus,input:where(:not([type])):focus,select:focus,textarea:focus{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);border-color:#2563eb;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-bottom:0;padding-top:0}select{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple],[size]:where(select:not([size="1"])){background-image:none;background-position:0 0;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-origin:border-box;border-color:#6b7280;border-width:1px;color:#2563eb;display:inline-block;flex-shrink:0;height:1rem;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1rem}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}[type=checkbox]:checked,[type=radio]:checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}[type=checkbox]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E")}[type=radio]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")}[type=checkbox]:checked:focus,[type=checkbox]:checked:hover,[type=radio]:checked:focus,[type=radio]:checked:hover{background-color:currentColor;border-color:transparent}[type=checkbox]:indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}[type=checkbox]:indeterminate:focus,[type=checkbox]:indeterminate:hover{background-color:currentColor;border-color:transparent}[type=file]{background:unset;border-color:inherit;border-radius:0;border-width:0;font-size:unset;line-height:inherit;padding:0}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.static{position:static}.fixed{position:fixed}.inset-0{top:0;right:0;bottom:0;left:0}.z-40{z-index:40}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.float-right{float:right}.clear-both{clear:both}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-3{margin:.75rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-bottom:.25rem;margin-top:.25rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.my-auto{margin-bottom:auto;margin-top:auto}.mb-1{margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-3{margin-right:.75rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-4{height:1rem}.h-6{height:1.5rem}.h-64{height:16rem}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-1\/4{width:25%}.w-3\/4{width:75%}.w-4{width:1rem}.w-40{width:10rem}.w-6{width:1.5rem}.w-96{width:24rem}.w-full{width:100%}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.rounded-l-md{border-bottom-left-radius:.375rem;border-top-left-radius:.375rem}.rounded-r-md{border-bottom-right-radius:.375rem;border-top-right-radius:.375rem}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.bg-violet-600{--tw-bg-opacity:1;background-color:rgb(124 58 237/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-yellow-500{--tw-bg-opacity:1;background-color:rgb(234 179 8/var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity:.5}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.pb-4{padding-bottom:1rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-5{padding-left:1.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.text-center{text-align:center}.text-right{text-align:right}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-green-100{--tw-text-opacity:1;color:rgb(220 252 231/var(--tw-text-opacity))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.text-red-100{--tw-text-opacity:1;color:rgb(254 226 226/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity))}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.gh-logo{height:2rem;width:2rem}.cnt{--tw-bg-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-radius:.25rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);margin:.5rem;min-height:268px;padding:.5rem}.gwf{height:16rem}@media (min-width:640px){.gwf{grid-column:span 2/span 2}}@media (min-width:768px){.gwf{grid-column:span 3/span 3}}@media (min-width:1024px){.gwf{grid-column:span 4/span 4}}@media (min-width:1280px){.gwf{grid-column:span 5/span 5}}@media (min-width:1536px){.gwf{grid-column:span 6/span 6}}.in-pre{border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;border-width:1px 0 1px 1px}.in-post,.in-pre{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}.in-post{border-bottom-right-radius:.375rem;border-top-right-radius:.375rem;border-width:1px 1px 1px 0}.in-post,.in-txt{border-color:rgb(209 213 219/var(--tw-border-opacity))}.in-txt{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-txt:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-f{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-f:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-m{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-m:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-l{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;border-top-right-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-l:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-s{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem;width:100%}.in-s:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.tr{text-align:right}.bd-green{background-color:rgb(34 197 94/var(--tw-bg-opacity));color:rgb(220 252 231/var(--tw-text-opacity))}.bd-green,.bd-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-yellow{background-color:rgb(234 179 8/var(--tw-bg-opacity));color:rgb(254 249 195/var(--tw-text-opacity))}.bd-red{background-color:rgb(239 68 68/var(--tw-bg-opacity));color:rgb(254 226 226/var(--tw-text-opacity))}.bd-blue,.bd-red{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-blue{background-color:rgb(59 130 246/var(--tw-bg-opacity));color:rgb(219 234 254/var(--tw-text-opacity))}.bd-gray{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(243 244 246/var(--tw-text-opacity));font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.btn-pri{padding:.5rem 1rem}.btn-pri,.btn-pri-sm{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));margin-right:.75rem}.btn-pri-sm{font-size:.75rem;line-height:1rem;padding:.25rem .5rem}.pl-root{position:relative}.pl-ov{left:25%;position:absolute;text-align:center;top:27%;width:50%}.pl-val{font-size:1.7rem}.pl-unt{color:gray;font-size:1rem}.pl-sub{font-size:1rem;padding-top:10px}.pl-snt{color:gray;font-size:.7rem}.pl-lab{font-size:1rem}.chart{height:100%;margin:0 auto;width:100%}svg{position:relative;width:100%}.tick{font-family:Helvetica,Arial;font-size:.85em;font-weight:200}.tick line{stroke:#e2e2e2;stroke-dasharray:2}.tick text{fill:#999;text-anchor:start}.tick.tick-0 line{stroke-dasharray:0}.tick.tick-green line{stroke:#32d900!important}.tick.tick-green text{fill:#32d900!important}.tick.tick-orange line{stroke:#d95600!important}.tick.tick-orange text{fill:#d95600!important}.x-axis .tick text{text-anchor:middle}.bars rect{stroke:#000;stroke-opacity:.25;opacity:.9}.bars text{display:block;font-family:Helvetica,Arial;font-size:.85em;text-align:center}.hover\:text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity))}@media (min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width:1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width:1536px){.\32xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}} +/*! tailwindcss v3.3.2 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-feature-settings:normal;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-variation-settings:normal;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}[multiple],[type=date],[type=datetime-local],[type=email],[type=month],[type=number],[type=password],[type=search],[type=tel],[type=text],[type=time],[type=url],[type=week],select,textarea{--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#6b7280;border-radius:0;border-width:1px;font-size:1rem;line-height:1.5rem;padding:.5rem .75rem}[multiple]:focus,[type=date]:focus,[type=datetime-local]:focus,[type=email]:focus,[type=month]:focus,[type=number]:focus,[type=password]:focus,[type=search]:focus,[type=tel]:focus,[type=text]:focus,[type=time]:focus,[type=url]:focus,[type=week]:focus,select:focus,textarea:focus{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);border-color:#2563eb;box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}input::-moz-placeholder,textarea::-moz-placeholder{color:#6b7280;opacity:1}input::placeholder,textarea::placeholder{color:#6b7280;opacity:1}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-date-and-time-value{min-height:1.5em}::-webkit-datetime-edit,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-meridiem-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-year-field{padding-bottom:0;padding-top:0}select{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3E%3C/svg%3E");background-position:right .5rem center;background-repeat:no-repeat;background-size:1.5em 1.5em;padding-right:2.5rem;-webkit-print-color-adjust:exact;print-color-adjust:exact}[multiple]{background-image:none;background-position:0 0;background-repeat:unset;background-size:initial;padding-right:.75rem;-webkit-print-color-adjust:unset;print-color-adjust:unset}[type=checkbox],[type=radio]{--tw-shadow:0 0 #0000;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;background-origin:border-box;border-color:#6b7280;border-width:1px;color:#2563eb;display:inline-block;flex-shrink:0;height:1rem;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact;-webkit-user-select:none;-moz-user-select:none;user-select:none;vertical-align:middle;width:1rem}[type=checkbox]{border-radius:0}[type=radio]{border-radius:100%}[type=checkbox]:focus,[type=radio]:focus{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:2px;--tw-ring-offset-color:#fff;--tw-ring-color:#2563eb;--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow);outline:2px solid transparent;outline-offset:2px}[type=checkbox]:checked,[type=radio]:checked{background-color:currentColor;background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}[type=checkbox]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E")}[type=radio]:checked{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='8' cy='8' r='3'/%3E%3C/svg%3E")}[type=checkbox]:checked:focus,[type=checkbox]:checked:hover,[type=radio]:checked:focus,[type=radio]:checked:hover{background-color:currentColor;border-color:transparent}[type=checkbox]:indeterminate{background-color:currentColor;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3E%3C/svg%3E");background-position:50%;background-repeat:no-repeat;background-size:100% 100%;border-color:transparent}[type=checkbox]:indeterminate:focus,[type=checkbox]:indeterminate:hover{background-color:currentColor;border-color:transparent}[type=file]{background:unset;border-color:inherit;border-radius:0;border-width:0;font-size:unset;line-height:inherit;padding:0}[type=file]:focus{outline:1px solid ButtonText;outline:1px auto -webkit-focus-ring-color}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.static{position:static}.fixed{position:fixed}.inset-0{inset:0}.z-40{z-index:40}.z-50{z-index:50}.col-span-2{grid-column:span 2/span 2}.float-right{float:right}.clear-both{clear:both}.m-1{margin:.25rem}.m-2{margin:.5rem}.m-3{margin:.75rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-bottom:.25rem;margin-top:.25rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.my-auto{margin-bottom:auto;margin-top:auto}.mb-1{margin-bottom:.25rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.ml-4{margin-left:1rem}.mr-3{margin-right:.75rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.flex{display:flex}.grid{display:grid}.hidden{display:none}.h-4{height:1rem}.h-6{height:1.5rem}.h-64{height:16rem}.w-1\/2{width:50%}.w-1\/3{width:33.333333%}.w-1\/4{width:25%}.w-3\/4{width:75%}.w-4{width:1rem}.w-40{width:10rem}.w-6{width:1.5rem}.w-96{width:24rem}.w-full{width:100%}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.flex-row-reverse{flex-direction:row-reverse}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.justify-center{justify-content:center}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(1rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(1rem*var(--tw-space-x-reverse))}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-md{border-radius:.375rem}.rounded-l-md{border-bottom-left-radius:.375rem;border-top-left-radius:.375rem}.rounded-r-md{border-bottom-right-radius:.375rem;border-top-right-radius:.375rem}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity))}.bg-green-500{--tw-bg-opacity:1;background-color:rgb(34 197 94/var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.bg-violet-600{--tw-bg-opacity:1;background-color:rgb(124 58 237/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-yellow-500{--tw-bg-opacity:1;background-color:rgb(234 179 8/var(--tw-bg-opacity))}.bg-opacity-50{--tw-bg-opacity:.5}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-4{padding-left:1rem;padding-right:1rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.pb-4{padding-bottom:1rem}.pl-1{padding-left:.25rem}.pl-2{padding-left:.5rem}.pl-5{padding-left:1.25rem}.pr-1{padding-right:.25rem}.pr-2{padding-right:.5rem}.text-center{text-align:center}.text-right{text-align:right}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-gray-100{--tw-text-opacity:1;color:rgb(243 244 246/var(--tw-text-opacity))}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-green-100{--tw-text-opacity:1;color:rgb(220 252 231/var(--tw-text-opacity))}.text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity))}.text-red-100{--tw-text-opacity:1;color:rgb(254 226 226/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity))}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.gh-logo{height:2rem;width:2rem}.cnt{--tw-bg-opacity:1;--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);background-color:rgb(255 255 255/var(--tw-bg-opacity));border-radius:.25rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);margin:.5rem;min-height:268px;padding:.5rem}.gwf{height:16rem}@media (min-width:640px){.gwf{grid-column:span 2/span 2}}@media (min-width:768px){.gwf{grid-column:span 3/span 3}}@media (min-width:1024px){.gwf{grid-column:span 4/span 4}}@media (min-width:1280px){.gwf{grid-column:span 5/span 5}}@media (min-width:1536px){.gwf{grid-column:span 6/span 6}}.in-pre{border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;border-width:1px 0 1px 1px}.in-post,.in-pre{--tw-border-opacity:1;--tw-bg-opacity:1;align-items:center;background-color:rgb(243 244 246/var(--tw-bg-opacity));display:flex;font-size:.875rem;line-height:1.25rem;padding-left:.75rem;padding-right:.75rem;white-space:nowrap}.in-post{border-bottom-right-radius:.375rem;border-top-right-radius:.375rem;border-width:1px 1px 1px 0}.in-post,.in-txt{border-color:rgb(209 213 219/var(--tw-border-opacity))}.in-txt{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-txt:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-f{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-left-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-top-left-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-f:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-m{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-m:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-l{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-bottom-right-radius:.375rem;border-color:rgb(209 213 219/var(--tw-border-opacity));border-left-width:0;border-top-right-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem}.in-l:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.in-s{--tw-border-opacity:1;--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);border-color:rgb(209 213 219/var(--tw-border-opacity));border-radius:.375rem;box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow);height:2.5rem;width:100%}.in-s:disabled{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.tr{text-align:right}.bd-green{background-color:rgb(34 197 94/var(--tw-bg-opacity));color:rgb(220 252 231/var(--tw-text-opacity))}.bd-green,.bd-yellow{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-yellow{background-color:rgb(234 179 8/var(--tw-bg-opacity));color:rgb(254 249 195/var(--tw-text-opacity))}.bd-red{background-color:rgb(239 68 68/var(--tw-bg-opacity));color:rgb(254 226 226/var(--tw-text-opacity))}.bd-blue,.bd-red{--tw-bg-opacity:1;--tw-text-opacity:1;border-radius:.25rem;font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.bd-blue{background-color:rgb(59 130 246/var(--tw-bg-opacity));color:rgb(219 234 254/var(--tw-text-opacity))}.bd-gray{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(243 244 246/var(--tw-text-opacity));font-size:.75rem;font-weight:600;line-height:1rem;margin-bottom:auto;margin-right:.5rem;margin-top:auto;padding:.125rem .625rem}.btn-pri{padding:.5rem 1rem}.btn-pri,.btn-pri-sm{--tw-bg-opacity:1;--tw-text-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity));border-radius:.25rem;color:rgb(255 255 255/var(--tw-text-opacity));margin-right:.75rem}.btn-pri-sm{font-size:.75rem;line-height:1rem;padding:.25rem .5rem}.pl-root{position:relative}.pl-ov{left:25%;position:absolute;text-align:center;top:27%;width:50%}.pl-val{font-size:1.7rem}.pl-unt{color:gray;font-size:1rem}.pl-sub{font-size:1rem;padding-top:10px}.pl-snt{color:gray;font-size:.7rem}.pl-lab{font-size:1rem}.chart{height:100%;margin:0 auto;width:100%}svg{position:relative;width:100%}.tick{font-family:Helvetica,Arial;font-size:.85em;font-weight:200}.tick line{stroke:#e2e2e2;stroke-dasharray:2}.tick text{fill:#999;text-anchor:start}.tick.tick-0 line{stroke-dasharray:0}.tick.tick-green line{stroke:#32d900!important}.tick.tick-green text{fill:#32d900!important}.tick.tick-orange line{stroke:#d95600!important}.tick.tick-orange text{fill:#d95600!important}.x-axis .tick text{text-anchor:middle}.bars rect{stroke:#000;stroke-opacity:.25;opacity:.9}.bars text{display:block;font-family:Helvetica,Arial;font-size:.85em;text-align:center}.hover\:text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity))}@media (min-width:640px){.sm\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@media (min-width:768px){.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}@media (min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}}@media (min-width:1280px){.xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.xl\:grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.xl\:grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}}@media (min-width:1536px){.\32xl\:grid-cols-6{grid-template-columns:repeat(6,minmax(0,1fr))}} diff --git a/lib/SvelteUi/app/dist/index.js b/lib/SvelteUi/app/dist/index.js index 165bf21a..c99a96cb 100644 --- a/lib/SvelteUi/app/dist/index.js +++ b/lib/SvelteUi/app/dist/index.js @@ -1,14 +1,14 @@ -(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function l(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=l(i);fetch(i.href,o)}})();function fe(){}function xt(t,e){for(const l in e)t[l]=e[l];return t}function oc(t){return t()}function Ua(){return Object.create(null)}function ze(t){t.forEach(oc)}function vo(t){return typeof t=="function"}function Ae(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let gs;function lo(t,e){return gs||(gs=document.createElement("a")),gs.href=e,t===gs.href}function i0(t){return Object.keys(t).length===0}function ho(t,...e){if(t==null)return fe;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function fi(t){let e;return ho(t,l=>e=l)(),e}function ul(t,e,l){t.$$.on_destroy.push(ho(e,l))}function bo(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?xt(l.ctx.slice(),t[1](n(e))):l.ctx}function go(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 Ps(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 o0=["width","height"];function ci(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&&o0.indexOf(n)===-1?t[n]=e[n]:r(t,n,e[n])}function he(t){return t===""?null:+t}function r0(t){return Array.from(t.childNodes)}function X(t,e){e=""+e,t.data!==e&&(t.data=e)}function a0(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function u0(t,e,l){~s0.indexOf(l)?a0(t,e):X(t,e)}function te(t,e){t.value=e??""}function ac(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function qe(t,e,l){for(let n=0;n{u.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=ee(n.contentWindow,"resize",e),e()}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),C(n)}}function m0(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}function ja(t,e){return new t(e)}let Ni;function Si(t){Ni=t}function Ai(){if(!Ni)throw new Error("Function called outside component initialization");return Ni}function uc(t){Ai().$$.on_mount.push(t)}function p0(t){Ai().$$.on_destroy.push(t)}function _0(){const t=Ai();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=m0(e,l,{cancelable:n});return i.slice().forEach(u=>{u.call(t,o)}),!o.defaultPrevented}return!0}}function Ti(t,e){return Ai().$$.context.set(t,e),e}function Bl(t){return Ai().$$.context.get(t)}const oi=[],Ss=[];let ri=[];const Ha=[],fc=Promise.resolve();let no=!1;function cc(){no||(no=!0,fc.then(mc))}function d0(){return cc(),fc}function et(t){ri.push(t)}const Xs=new Set;let ii=0;function mc(){if(ii!==0)return;const t=Ni;do{try{for(;iit.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),ri=e}const Cs=new Set;let un;function De(){un={r:0,c:[],p:un}}function Ie(){un.r||ze(un.c),un=un.p}function D(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),un.c.push(()=>{Cs.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function pc(t,e){const l={},n={},i={$$scope:1};let o=t.length;for(;o--;){const u=t[o],a=e[o];if(a){for(const c in u)c in a||(n[c]=1);for(const c in a)i[c]||(l[c]=a[c],i[c]=1);t[o]=a}else for(const c in u)i[c]=1}for(const u in n)u in l||(l[u]=void 0);return l}function Wa(t){return typeof t=="object"&&t!==null?t:{}}function ie(t){t&&t.c()}function le(t,e,l,n){const{fragment:i,after_update:o}=t.$$;i&&i.m(e,l),n||et(()=>{const u=t.$$.on_mount.map(oc).filter(vo);t.$$.on_destroy?t.$$.on_destroy.push(...u):ze(u),t.$$.on_mount=[]}),o.forEach(et)}function ne(t,e){const l=t.$$;l.fragment!==null&&(h0(l.after_update),ze(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function b0(t,e){t.$$.dirty[0]===-1&&(oi.push(t),cc(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const d=v.length?v[0]:b;return f.ctx&&i(f.ctx[p],f.ctx[p]=d)&&(!f.skip_bound&&f.bound[p]&&f.bound[p](d),_&&b0(t,p)),b}):[],f.update(),_=!0,ze(f.before_update),f.fragment=n?n(f.ctx):!1,e.target){if(e.hydrate){const p=r0(e.target);f.fragment&&f.fragment.l(p),p.forEach(C)}else f.fragment&&f.fragment.c();e.intro&&D(t.$$.fragment),le(t,e.target,e.anchor,e.customElement),mc()}Si(c)}class Ee{$destroy(){ne(this,1),this.$destroy=fe}$on(e,l){if(!vo(l))return fe;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(l),()=>{const i=n.indexOf(l);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!i0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const za=t=>typeof t>"u",_c=t=>typeof t=="function",dc=t=>typeof t=="number";function g0(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function vc(){let t=0;return()=>t++}function k0(){return Math.random().toString(36).substring(2)}const Ul=typeof window>"u";function hc(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const bc=(t,e)=>t?{}:{style:e},io=t=>({"aria-hidden":"true",...bc(t,"display:none;")}),si=[];function gc(t,e){return{subscribe:at(t,e).subscribe}}function at(t,e=fe){let l;const n=new Set;function i(a){if(Ae(t,a)&&(t=a,l)){const c=!si.length;for(const f of n)f[1](),si.push(f,t);if(c){for(let f=0;f{n.delete(f),n.size===0&&l&&(l(),l=null)}}return{set:i,update:o,subscribe:u}}function w0(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,o=e.length<2;return gc(l,u=>{let a=!1;const c=[];let f=0,_=fe;const p=()=>{if(f)return;_();const v=e(n?c[0]:c,u);o?u(v):_=vo(v)?v:fe},b=i.map((v,d)=>ho(v,$=>{c[d]=$,f&=~(1<{f|=1<`@@svnav-ctx__${t}`,so=Pi("LOCATION"),mi=Pi("ROUTER"),kc=Pi("ROUTE"),y0=Pi("ROUTE_PARAMS"),C0=Pi("FOCUS_ELEM"),wc=/^:(.+)/,Ci=(t,e,l)=>t.substr(e,l),oo=(t,e)=>Ci(t,0,e.length)===e,M0=t=>t==="",$0=t=>wc.test(t),yc=t=>t[0]==="*",S0=t=>t.replace(/\*.*$/,""),Cc=t=>t.replace(/(^\/+|\/+$)/g,"");function ml(t,e=!1){const l=Cc(t).split("/");return e?l.filter(Boolean):l}const Zs=(t,e)=>t+(e?`?${e}`:""),yo=t=>`/${Cc(t)}`;function Ei(...t){const e=n=>ml(n,!0).join("/"),l=t.map(e).join("/");return yo(l)}const Co=1,Es=2,_n=3,T0=4,Mc=5,N0=6,$c=7,A0=8,P0=9,Sc=10,Tc=11,E0={[Co]:"Link",[Es]:"Route",[_n]:"Router",[T0]:"useFocus",[Mc]:"useLocation",[N0]:"useMatch",[$c]:"useNavigate",[A0]:"useParams",[P0]:"useResolvable",[Sc]:"useResolve",[Tc]:"navigate"},Mo=t=>E0[t];function D0(t,e){let l;return t===Es?l=e.path?`path="${e.path}"`:"default":t===Co?l=`to="${e.to}"`:t===_n&&(l=`basepath="${e.basepath||""}"`),`<${Mo(t)} ${l||""} />`}function I0(t,e,l,n){const i=l&&D0(n||t,l),o=i?` +(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))n(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function l(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function n(i){if(i.ep)return;i.ep=!0;const o=l(i);fetch(i.href,o)}})();function fe(){}function xt(t,e){for(const l in e)t[l]=e[l];return t}function oc(t){return t()}function Ua(){return Object.create(null)}function ze(t){t.forEach(oc)}function vo(t){return typeof t=="function"}function Ae(t,e){return t!=t?e==e:t!==e||t&&typeof t=="object"||typeof t=="function"}let gs;function lo(t,e){return gs||(gs=document.createElement("a")),gs.href=e,t===gs.href}function i0(t){return Object.keys(t).length===0}function ho(t,...e){if(t==null)return fe;const l=t.subscribe(...e);return l.unsubscribe?()=>l.unsubscribe():l}function fi(t){let e;return ho(t,l=>e=l)(),e}function ul(t,e,l){t.$$.on_destroy.push(ho(e,l))}function bo(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?xt(l.ctx.slice(),t[1](n(e))):l.ctx}function go(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 Ps(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 o0=["width","height"];function ci(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&&o0.indexOf(n)===-1?t[n]=e[n]:r(t,n,e[n])}function he(t){return t===""?null:+t}function r0(t){return Array.from(t.childNodes)}function X(t,e){e=""+e,t.data!==e&&(t.data=e)}function a0(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function u0(t,e,l){~s0.indexOf(l)?a0(t,e):X(t,e)}function te(t,e){t.value=e==null?"":e}function ac(t,e,l,n){l==null?t.style.removeProperty(e):t.style.setProperty(e,l,n?"important":"")}function qe(t,e,l){for(let n=0;n{u.source===n.contentWindow&&e()})):(n.src="about:blank",n.onload=()=>{o=ee(n.contentWindow,"resize",e),e()}),s(t,n),()=>{(i||o&&n.contentWindow)&&o(),C(n)}}function m0(t,e,{bubbles:l=!1,cancelable:n=!1}={}){const i=document.createEvent("CustomEvent");return i.initCustomEvent(t,l,n,e),i}function ja(t,e){return new t(e)}let Ni;function Si(t){Ni=t}function Ai(){if(!Ni)throw new Error("Function called outside component initialization");return Ni}function uc(t){Ai().$$.on_mount.push(t)}function p0(t){Ai().$$.on_destroy.push(t)}function _0(){const t=Ai();return(e,l,{cancelable:n=!1}={})=>{const i=t.$$.callbacks[e];if(i){const o=m0(e,l,{cancelable:n});return i.slice().forEach(u=>{u.call(t,o)}),!o.defaultPrevented}return!0}}function Ti(t,e){return Ai().$$.context.set(t,e),e}function Bl(t){return Ai().$$.context.get(t)}const oi=[],Ss=[];let ri=[];const Ha=[],fc=Promise.resolve();let no=!1;function cc(){no||(no=!0,fc.then(mc))}function d0(){return cc(),fc}function et(t){ri.push(t)}const Xs=new Set;let ii=0;function mc(){if(ii!==0)return;const t=Ni;do{try{for(;iit.indexOf(n)===-1?e.push(n):l.push(n)),l.forEach(n=>n()),ri=e}const Cs=new Set;let un;function De(){un={r:0,c:[],p:un}}function Ie(){un.r||ze(un.c),un=un.p}function D(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),un.c.push(()=>{Cs.delete(t),n&&(l&&t.d(1),n())}),t.o(e)}else n&&n()}function pc(t,e){const l={},n={},i={$$scope:1};let o=t.length;for(;o--;){const u=t[o],a=e[o];if(a){for(const c in u)c in a||(n[c]=1);for(const c in a)i[c]||(l[c]=a[c],i[c]=1);t[o]=a}else for(const c in u)i[c]=1}for(const u in n)u in l||(l[u]=void 0);return l}function Wa(t){return typeof t=="object"&&t!==null?t:{}}function ie(t){t&&t.c()}function le(t,e,l,n){const{fragment:i,after_update:o}=t.$$;i&&i.m(e,l),n||et(()=>{const u=t.$$.on_mount.map(oc).filter(vo);t.$$.on_destroy?t.$$.on_destroy.push(...u):ze(u),t.$$.on_mount=[]}),o.forEach(et)}function ne(t,e){const l=t.$$;l.fragment!==null&&(h0(l.after_update),ze(l.on_destroy),l.fragment&&l.fragment.d(e),l.on_destroy=l.fragment=null,l.ctx=[])}function b0(t,e){t.$$.dirty[0]===-1&&(oi.push(t),cc(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const d=v.length?v[0]:b;return f.ctx&&i(f.ctx[p],f.ctx[p]=d)&&(!f.skip_bound&&f.bound[p]&&f.bound[p](d),_&&b0(t,p)),b}):[],f.update(),_=!0,ze(f.before_update),f.fragment=n?n(f.ctx):!1,e.target){if(e.hydrate){const p=r0(e.target);f.fragment&&f.fragment.l(p),p.forEach(C)}else f.fragment&&f.fragment.c();e.intro&&D(t.$$.fragment),le(t,e.target,e.anchor,e.customElement),mc()}Si(c)}class Ee{$destroy(){ne(this,1),this.$destroy=fe}$on(e,l){if(!vo(l))return fe;const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(l),()=>{const i=n.indexOf(l);i!==-1&&n.splice(i,1)}}$set(e){this.$$set&&!i0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const za=t=>typeof t>"u",_c=t=>typeof t=="function",dc=t=>typeof t=="number";function g0(t){return!t.defaultPrevented&&t.button===0&&!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function vc(){let t=0;return()=>t++}function k0(){return Math.random().toString(36).substring(2)}const Ul=typeof window>"u";function hc(t,e,l){return t.addEventListener(e,l),()=>t.removeEventListener(e,l)}const bc=(t,e)=>t?{}:{style:e},io=t=>({"aria-hidden":"true",...bc(t,"display:none;")}),si=[];function gc(t,e){return{subscribe:at(t,e).subscribe}}function at(t,e=fe){let l;const n=new Set;function i(a){if(Ae(t,a)&&(t=a,l)){const c=!si.length;for(const f of n)f[1](),si.push(f,t);if(c){for(let f=0;f{n.delete(f),n.size===0&&l&&(l(),l=null)}}return{set:i,update:o,subscribe:u}}function w0(t,e,l){const n=!Array.isArray(t),i=n?[t]:t,o=e.length<2;return gc(l,u=>{let a=!1;const c=[];let f=0,_=fe;const p=()=>{if(f)return;_();const v=e(n?c[0]:c,u);o?u(v):_=vo(v)?v:fe},b=i.map((v,d)=>ho(v,$=>{c[d]=$,f&=~(1<{f|=1<`@@svnav-ctx__${t}`,so=Pi("LOCATION"),mi=Pi("ROUTER"),kc=Pi("ROUTE"),y0=Pi("ROUTE_PARAMS"),C0=Pi("FOCUS_ELEM"),wc=/^:(.+)/,Ci=(t,e,l)=>t.substr(e,l),oo=(t,e)=>Ci(t,0,e.length)===e,M0=t=>t==="",$0=t=>wc.test(t),yc=t=>t[0]==="*",S0=t=>t.replace(/\*.*$/,""),Cc=t=>t.replace(/(^\/+|\/+$)/g,"");function ml(t,e=!1){const l=Cc(t).split("/");return e?l.filter(Boolean):l}const Zs=(t,e)=>t+(e?`?${e}`:""),yo=t=>`/${Cc(t)}`;function Ei(...t){const e=n=>ml(n,!0).join("/"),l=t.map(e).join("/");return yo(l)}const Co=1,Es=2,_n=3,T0=4,Mc=5,N0=6,$c=7,A0=8,P0=9,Sc=10,Tc=11,E0={[Co]:"Link",[Es]:"Route",[_n]:"Router",[T0]:"useFocus",[Mc]:"useLocation",[N0]:"useMatch",[$c]:"useNavigate",[A0]:"useParams",[P0]:"useResolvable",[Sc]:"useResolve",[Tc]:"navigate"},Mo=t=>E0[t];function D0(t,e){let l;return t===Es?l=e.path?`path="${e.path}"`:"default":t===Co?l=`to="${e.to}"`:t===_n&&(l=`basepath="${e.basepath||""}"`),`<${Mo(t)} ${l||""} />`}function I0(t,e,l,n){const i=l&&D0(n||t,l),o=i?` -Occurred in: ${i}`:"",u=Mo(t),a=_c(e)?e(u):e;return`<${u}> ${a}${o}`}const Nc=t=>(...e)=>t(I0(...e)),Ac=Nc(t=>{throw new Error(t)}),Ts=Nc(console.warn),Ga=4,O0=3,R0=2,L0=1,F0=1;function q0(t,e){const l=t.default?0:ml(t.fullPath).reduce((n,i)=>{let o=n;return o+=Ga,M0(i)?o+=F0:$0(i)?o+=R0:yc(i)?o-=Ga+L0:o+=O0,o},0);return{route:t,score:l,index:e}}function B0(t){return t.map(q0).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function Pc(t,e){let l,n;const[i]=e.split("?"),o=ml(i),u=o[0]==="",a=B0(t);for(let c=0,f=a.length;c({..._,params:b,uri:T});if(_.default){n=v(e);continue}const d=ml(_.fullPath),$=Math.max(o.length,d.length);let y=0;for(;y<$;y++){const T=d[y],N=o[y];if(!za(T)&&yc(T)){const B=T==="*"?"*":T.slice(1);b[B]=o.slice(y).map(decodeURIComponent).join("/");break}if(za(N)){p=!0;break}const E=wc.exec(T);if(E&&!u){const B=decodeURIComponent(N);b[E[1]]=B}else if(T!==N){p=!0;break}}if(!p){l=v(Ei(...o.slice(0,y)));break}}return l||n||null}function Ec(t,e){return Pc([t],e)}function U0(t,e){if(oo(t,"/"))return t;const[l,n]=t.split("?"),[i]=e.split("?"),o=ml(l),u=ml(i);if(o[0]==="")return Zs(i,n);if(!oo(o[0],".")){const f=u.concat(o).join("/");return Zs((i==="/"?"":"/")+f,n)}const a=u.concat(o),c=[];return a.forEach(f=>{f===".."?c.pop():f!=="."&&c.push(f)}),Zs(`/${c.join("/")}`,n)}function Va(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,u=ml(e,!0),a=ml(l,!0);for(;u.length;)u[0]!==a[0]&&Ac(_n,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),u.shift(),a.shift();return{pathname:Ei(...a),hash:n,search:i,state:o}}const Ka=t=>t.length===1?"":t,$o=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?Ka(Ci(t,l)):"",u=i?Ci(t,0,l):t,a=n?Ka(Ci(u,e)):"";return{pathname:(n?Ci(u,0,e):u)||"/",search:a,hash:o}},j0=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function H0(t,e,l){return Ei(l,U0(t,e))}function W0(t,e){const l=yo(S0(t)),n=ml(l,!0),i=ml(e,!0).slice(0,n.length),o=Ec({fullPath:l},Ei(...i));return o&&o.uri}const Js="POP",z0="PUSH",G0="REPLACE";function xs(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function V0(t){let e=[],l=xs(t),n=Js;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=xs(t),n=Js,i([o])};i([o]);const a=hc(t,"popstate",u);return()=>{a(),e=e.filter(c=>c!==o)}},navigate(o,u){const{state:a={},replace:c=!1}=u||{};if(n=c?G0:z0,dc(o))u&&Ts(Tc,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=Js,t.history.go(o);else{const f={...a,_key:k0()};try{t.history[c?"replaceState":"pushState"](f,"",o)}catch{t.location[c?"replace":"assign"](o)}}l=xs(t),i()}}}function eo(t,e){return{...$o(e),state:t}}function K0(t="/"){let e=0,l=[eo(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(eo(n,o))},replaceState(n,i,o){l[e]=eo(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const Y0=!!(!Ul&&window.document&&window.document.createElement),Q0=!Ul&&window.location.origin==="null",Dc=V0(Y0&&!Q0?window:K0()),{navigate:ai}=Dc;let $l=null,Ic=!0;function X0(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;n$l.level||t.level===$l.level&&X0(t.routerId,$l.routerId))&&($l=t)}function J0(){$l=null}function x0(){Ic=!1}function Ya(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=hc(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function e1(t,e){return Number(t.dataset.svnavRouteEnd)===e}function t1(t){return/^H[1-6]$/i.test(t.tagName)}function Qa(t,e=document){return e.querySelector(t)}function l1(t){let l=Qa(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!e1(l,t);){if(t1(l))return l;const n=Qa("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function n1(t){Promise.resolve(fi(t.focusElement)).then(e=>{const l=e||l1(t.id);l||Ts(_n,`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,Es),!Ya(l)&&Ya(document.documentElement)})}const i1=(t,e,l)=>(n,i)=>d0().then(()=>{if(!$l||Ic){x0();return}if(n&&n1($l.route),t.announcements&&i){const{path:o,fullPath:u,meta:a,params:c,uri:f}=$l.route,_=t.createAnnouncement({path:o,fullPath:u,meta:a,params:c,uri:f},fi(l));Promise.resolve(_).then(p=>{e.set(p)})}J0()}),s1="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 o1(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},bc(t[6],s1)],i={};for(let o=0;o`Navigated to ${ue.uri}`,announcements:!0,...d},T=_,N=yo(_),E=Bl(so),B=Bl(mi),P=!E,R=a1(),L=v&&!(B&&!B.manageFocus),F=at("");ul(t,F,ue=>l(0,a=ue));const x=B?B.disableInlineStyles:$,j=at([]);ul(t,j,ue=>l(20,u=ue));const z=at(null);ul(t,z,ue=>l(18,i=ue));let G=!1;const V=P?0:B.level+1,U=P?at((()=>Va(Ul?$o(p):b.location,N))()):E;ul(t,U,ue=>l(17,n=ue));const K=at(n);ul(t,K,ue=>l(19,o=ue));const H=i1(y,F,U),Y=ue=>we=>we.filter(me=>me.id!==ue);function Z(ue){if(Ul){if(G)return;const we=Ec(ue,n.pathname);if(we)return G=!0,we}else j.update(we=>{const me=Y(ue.id)(we);return me.push(ue),me})}function re(ue){j.update(Y(ue))}return!P&&_!==Xa&&Ts(_n,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:_}),P&&(uc(()=>b.listen(we=>{const me=Va(we.location,N);K.set(n),U.set(me)})),Ti(so,U)),Ti(mi,{activeRoute:z,registerRoute:Z,unregisterRoute:re,manageFocus:L,level:V,id:R,history:P?b:B.history,basepath:P?N:B.basepath,disableInlineStyles:x}),t.$$set=ue=>{"basepath"in ue&&l(11,_=ue.basepath),"url"in ue&&l(12,p=ue.url),"history"in ue&&l(13,b=ue.history),"primary"in ue&&l(14,v=ue.primary),"a11y"in ue&&l(15,d=ue.a11y),"disableInlineStyles"in ue&&l(16,$=ue.disableInlineStyles),"$$scope"in ue&&l(21,f=ue.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&_!==T&&Ts(_n,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const ue=Pc(u,n.pathname);z.set(ue)}if(t.$$.dirty[0]&655360&&P){const ue=!!n.hash,we=!ue&&L,me=!ue||n.pathname!==o.pathname;H(we,me)}t.$$.dirty[0]&262144&&L&&i&&i.primary&&Z0({level:V,routerId:R,route:i})},[a,y,P,R,L,F,x,j,z,U,K,_,p,b,v,d,$,n,i,o,u,f,c]}class f1 extends Ee{constructor(e){super(),Pe(this,e,u1,r1,Ae,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const Oc=f1;function Di(t,e,l=mi,n=_n){Bl(l)||Ac(t,o=>`You cannot use ${o} outside of a ${Mo(n)}.`,e)}const c1=t=>{const{subscribe:e}=Bl(t);return{subscribe:e}};function Rc(){return Di(Mc),c1(so)}function Lc(){const{history:t}=Bl(mi);return t}function Fc(){const t=Bl(kc);return t?w0(t,e=>e.base):at("/")}function qc(){Di(Sc);const t=Fc(),{basepath:e}=Bl(mi);return n=>H0(n,fi(t),e)}function m1(){Di($c);const t=qc(),{navigate:e}=Lc();return(n,i)=>{const o=dc(n)?n:t(n);return e(o,i)}}const p1=t=>({params:t&16,location:t&8}),Za=t=>({params:Ul?fi(t[10]):t[4],location:t[3],navigate:t[11]});function Ja(t){let e,l;return e=new Oc({props:{primary:t[1],$$slots:{default:[v1]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.primary=n[1]),i&528409&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function _1(t){let e;const l=t[18].default,n=bo(l,t,t[19],Za);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&ko(n,l,i,i[19],e?go(l,i[19],o,p1):wo(i[19]),Za)},i(i){e||(D(n,i),e=!0)},o(i){q(n,i),e=!1},d(i){n&&n.d(i)}}}function d1(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},Ul?fi(t[10]):t[4],t[12]];var o=t[0];function u(a){let c={};for(let f=0;f{ne(_,1)}),Ie()}o?(e=ja(o,u()),ie(e.$$.fragment),D(e.$$.fragment,1),le(e,l.parentNode,l)):e=null}else o&&e.$set(f)},i(a){n||(e&&D(e.$$.fragment,a),n=!0)},o(a){e&&q(e.$$.fragment,a),n=!1},d(a){a&&C(l),e&&ne(e,a)}}}function v1(t){let e,l,n,i;const o=[d1,_1],u=[];function a(c,f){return c[0]!==null?0:1}return e=a(t),l=u[e]=o[e](t),{c(){l.c(),n=Ge()},m(c,f){u[e].m(c,f),M(c,n,f),i=!0},p(c,f){let _=e;e=a(c),e===_?u[e].p(c,f):(De(),q(u[_],1,1,()=>{u[_]=null}),Ie(),l=u[e],l?l.p(c,f):(l=u[e]=o[e](c),l.c()),D(l,1),l.m(n.parentNode,n))},i(c){i||(D(l),i=!0)},o(c){q(l),i=!1},d(c){u[e].d(c),c&&C(n)}}}function h1(t){let e,l,n,i,o,u=[io(t[7]),{"data-svnav-route-start":t[5]}],a={};for(let p=0;p{c=null}),Ie())},i(p){o||(D(c),o=!0)},o(p){q(c),o=!1},d(p){p&&C(e),p&&C(l),c&&c.d(p),p&&C(n),p&&C(i)}}}const b1=vc();function g1(t,e,l){let n;const i=["path","component","meta","primary"];let o=$s(e,i),u,a,c,f,{$$slots:_={},$$scope:p}=e,{path:b=""}=e,{component:v=null}=e,{meta:d={}}=e,{primary:$=!0}=e;Di(Es,e);const y=b1(),{registerRoute:T,unregisterRoute:N,activeRoute:E,disableInlineStyles:B}=Bl(mi);ul(t,E,G=>l(16,u=G));const P=Fc();ul(t,P,G=>l(17,c=G));const R=Rc();ul(t,R,G=>l(3,a=G));const L=at(null);let F;const x=at(),j=at({});ul(t,j,G=>l(4,f=G)),Ti(kc,x),Ti(y0,j),Ti(C0,L);const z=m1();return Ul||p0(()=>N(y)),t.$$set=G=>{l(24,e=xt(xt({},e),Ms(G))),l(12,o=$s(e,i)),"path"in G&&l(13,b=G.path),"component"in G&&l(0,v=G.component),"meta"in G&&l(14,d=G.meta),"primary"in G&&l(1,$=G.primary),"$$scope"in G&&l(19,p=G.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const G=b==="",V=Ei(c,b),W={id:y,path:b,meta:d,default:G,fullPath:G?"":V,base:G?c:W0(V,a.pathname),primary:$,focusElement:L};x.set(W),l(15,F=T(W))}if(t.$$.dirty&98304&&l(2,n=!!(F||u&&u.id===y)),t.$$.dirty&98308&&n){const{params:G}=F||u;j.set(G)}},e=Ms(e),[v,$,n,a,f,y,E,B,P,R,j,z,o,b,d,F,u,c,_,p]}class k1 extends Ee{constructor(e){super(),Pe(this,e,g1,h1,Ae,{path:13,component:0,meta:14,primary:1})}}const Ml=k1;function w1(t){let e,l,n,i;const o=t[13].default,u=bo(o,t,t[12],null);let a=[{href:t[0]},t[2],t[1]],c={};for(let f=0;fl(11,p=L));const E=_0(),B=qc(),{navigate:P}=Lc();function R(L){E("click",L),g0(L)&&(L.preventDefault(),P(n,{state:y,replace:u||$}))}return t.$$set=L=>{l(19,e=xt(xt({},e),Ms(L))),l(18,_=$s(e,f)),"to"in L&&l(5,d=L.to),"replace"in L&&l(6,$=L.replace),"state"in L&&l(7,y=L.state),"getProps"in L&&l(8,T=L.getProps),"$$scope"in L&&l(12,v=L.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=B(d,p)),t.$$.dirty&2049&&l(10,i=oo(p.pathname,n)),t.$$.dirty&2049&&l(9,o=n===p.pathname),t.$$.dirty&2049&&(u=$o(n)===j0(p)),t.$$.dirty&512&&l(2,a=o?{"aria-current":"page"}:{}),l(1,c=(()=>{if(_c(T)){const L=T({location:p,href:n,isPartiallyCurrent:i,isCurrent:o});return{..._,...L}}return _})())},e=Ms(e),[n,c,a,N,R,d,$,y,T,o,i,p,v,b]}class C1 extends Ee{constructor(e){super(),Pe(this,e,y1,w1,Ae,{to:5,replace:6,state:7,getProps:8})}}const el=C1;let ro=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ql(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function M1(t){return t>218&&t<242?"#32d900":t>212&&t<248?"#b1d900":t>208&&t<252?"#ffb800":"#d90000"}function Bc(t){return t>90?"#d90000":t>85?"#e32100":t>80?"#ffb800":t>75?"#dcd800":"#32d900"}function $1(t){return t>75?"#32d900":t>50?"#77d900":t>25?"#94d900":"#dcd800"}function Ns(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 Le(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function be(t,e){switch(e){case 5:switch(t){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(t){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"µHAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1"}}function xa(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 eu(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 tu(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 ui(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Ve(t,e){return t==1||t==2&&e}function Bt(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function ge(t,e){return isNaN(t)?"-":(isNaN(e)&&(e=t<10?1:0),t.toFixed(e))}function fl(t,e){return t.setTime(t.getTime()+e*36e5),t}function lu(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 nu(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energy Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}async function jl(t,e={}){const{timeout:l=8e3}=e,n=new AbortController,i=setTimeout(()=>n.abort(),l),o=await fetch(t,{...e,signal:n.signal});return clearTimeout(i),o}let al={version:"",chip:"",mac:null,apmac:null,vndcfg:null,usrcfg:null,fwconsent:null,booting:!1,upgrading:!1,ui:{},security:0,boot_reason:0,upgrade:{x:-1,e:0,f:null,t:null},trying:null};const Ut=at(al);async function So(){al=await(await jl("/sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),Ut.set(al)}let ws=0,iu=-127,su=null,S1={};const T1=gc(S1,t=>{let e;async function l(){jl("/data.json").then(n=>n.json()).then(n=>{t(n),iu!=n.t&&(iu=n.t,setTimeout(zc,2e3)),su==null&&n.pe&&n.p!=null&&(su=n.p,jc()),al.upgrading?window.location.reload():(!al||!al.chip||al.booting||ws>1&&!ui(al.board))&&(So(),fn&&clearTimeout(fn),fn=setTimeout(No,2e3),cn&&clearTimeout(cn),cn=setTimeout(Ao,3e3));let i=5e3;if(ui(al.board)&&n.v>2.5){let o=3.3-Math.min(3.3,n.v);o>0&&(i=Math.max(o,.1)*10*5e3)}i>5e3&&console.log("Scheduling next data fetch in "+i+"ms"),e&&clearTimeout(e),e=setTimeout(l,i),ws=0}).catch(n=>{ws++,ws>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(l,15e3)):e=setTimeout(l,ui(al.board)?1e4:5e3)})}return l(),function(){clearTimeout(e)}});let ao={},Mi;const To=at(ao);async function Uc(){let t=!1;To.update(e=>{for(var l=0;l<36;l++){if(e[Le(l)]==null){t=l<12;break}e[Le(l)]=e[Le(l+1)]}return e}),t?jc():Mi=setTimeout(Uc,(60-new Date().getMinutes())*6e4)}async function jc(){Mi&&(clearTimeout(Mi),Mi=0),ao=await(await jl("/energyprice.json")).json(),To.set(ao),Mi=setTimeout(Uc,(60-new Date().getMinutes())*6e4)}let uo={},fn;async function No(){fn&&(clearTimeout(fn),fn=0),uo=await(await jl("/dayplot.json")).json(),Hc.set(uo),fn=setTimeout(No,(60-new Date().getMinutes())*6e4+20)}const Hc=at(uo,t=>(No(),function(){}));let fo={},cn;async function Ao(){cn&&(clearTimeout(cn),cn=0),fo=await(await jl("/monthplot.json")).json(),Wc.set(fo),cn=setTimeout(Ao,(24-new Date().getHours())*36e5+40)}const Wc=at(fo,t=>(Ao(),function(){}));let co={};async function zc(){co=await(await jl("/temperature.json")).json(),Gc.set(co)}const Gc=at(co,t=>(zc(),function(){}));let mo={},ys;async function Vc(){ys&&(clearTimeout(ys),ys=0),mo=await(await jl("/tariff.json")).json(),Kc.set(mo),ys=setTimeout(Vc,(60-new Date().getMinutes())*6e4+30)}const Kc=at(mo,t=>function(){});let po=[];const Po=at(po);async function N1(){po=await(await jl("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),Po.set(po)}function As(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 Yc(t){await(await fetch("/upgrade?expected_version="+t,{method:"POST"})).json()}function Qc(t,e){if(/^v\d{1,2}\.\d{1,2}\.\d{1,2}$/.test(t)){let l=t.substring(1).split("."),n=parseInt(l[0]),i=parseInt(l[1]),o=parseInt(l[2]),u=[...e];u.reverse();let a,c,f;for(let _=0;_o&&(a=p):$==i+1&&(c=p);else if(d==n+1)if(f){let T=f.tag_name.substring(1).split(".");parseInt(T[0]);let N=parseInt(T[1]);parseInt(T[2]),$==N&&(f=p)}else f=p}return c||f||a||!1}else return e[0]}const A1="/github.svg";function ou(t){let e,l;function n(u,a){return u[1]>1?L1:u[1]>0?R1:u[2]>1?O1:u[2]>0?I1:u[3]>1?D1:u[3]>0?E1:P1}let i=n(t),o=i(t);return{c(){e=S(`Up - `),o.c(),l=Ge()},m(u,a){M(u,e,a),o.m(u,a),M(u,l,a)},p(u,a){i===(i=n(u))&&o?o.p(u,a):(o.d(1),o=i(u),o&&(o.c(),o.m(l.parentNode,l)))},d(u){u&&C(e),o.d(u),u&&C(l)}}}function P1(t){let e,l;return{c(){e=S(t[0]),l=S(" seconds")},m(n,i){M(n,e,i),M(n,l,i)},p(n,i){i&1&&X(e,n[0])},d(n){n&&C(e),n&&C(l)}}}function E1(t){let e,l;return{c(){e=S(t[3]),l=S(" minute")},m(n,i){M(n,e,i),M(n,l,i)},p(n,i){i&8&&X(e,n[3])},d(n){n&&C(e),n&&C(l)}}}function D1(t){let e,l;return{c(){e=S(t[3]),l=S(" minutes")},m(n,i){M(n,e,i),M(n,l,i)},p(n,i){i&8&&X(e,n[3])},d(n){n&&C(e),n&&C(l)}}}function I1(t){let e,l;return{c(){e=S(t[2]),l=S(" hour")},m(n,i){M(n,e,i),M(n,l,i)},p(n,i){i&4&&X(e,n[2])},d(n){n&&C(e),n&&C(l)}}}function O1(t){let e,l;return{c(){e=S(t[2]),l=S(" hours")},m(n,i){M(n,e,i),M(n,l,i)},p(n,i){i&4&&X(e,n[2])},d(n){n&&C(e),n&&C(l)}}}function R1(t){let e,l;return{c(){e=S(t[1]),l=S(" day")},m(n,i){M(n,e,i),M(n,l,i)},p(n,i){i&2&&X(e,n[1])},d(n){n&&C(e),n&&C(l)}}}function L1(t){let e,l;return{c(){e=S(t[1]),l=S(" days")},m(n,i){M(n,e,i),M(n,l,i)},p(n,i){i&2&&X(e,n[1])},d(n){n&&C(e),n&&C(l)}}}function F1(t){let e,l=t[0]&&ou(t);return{c(){l&&l.c(),e=Ge()},m(n,i){l&&l.m(n,i),M(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=ou(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:fe,o:fe,d(n){l&&l.d(n),n&&C(e)}}}function q1(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 B1 extends Ee{constructor(e){super(),Pe(this,e,q1,F1,Ae,{epoch:0})}}function U1(t){let e,l,n;return{c(){e=m("span"),l=S(t[2]),r(e,"title",t[1]),r(e,"class",n="bd-"+t[0])},m(i,o){M(i,e,o),s(e,l)},p(i,[o]){o&4&&X(l,i[2]),o&2&&r(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&r(e,"class",n)},i:fe,o:fe,d(i){i&&C(e)}}}function j1(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 mn extends Ee{constructor(e){super(),Pe(this,e,j1,U1,Ae,{color:0,title:1,text:2})}}function H1(t){let e,l=`${Le(t[0].getDate())}.${Le(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Le(t[0].getHours())}:${Le(t[0].getMinutes())}`,n;return{c(){e=m("span"),n=S(l),r(e,"class",t[1])},m(i,o){M(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Le(i[0].getDate())}.${Le(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Le(i[0].getHours())}:${Le(i[0].getMinutes())}`)&&X(n,l),o&2&&r(e,"class",i[1])},d(i){i&&C(e)}}}function W1(t){let e=`${Le(t[0].getDate())}. ${ro[t[0].getMonth()]} ${Le(t[0].getHours())}:${Le(t[0].getMinutes())}`,l;return{c(){l=S(e)},m(n,i){M(n,l,i)},p(n,i){i&1&&e!==(e=`${Le(n[0].getDate())}. ${ro[n[0].getMonth()]} ${Le(n[0].getHours())}:${Le(n[0].getMinutes())}`)&&X(l,e)},d(n){n&&C(l)}}}function z1(t){let e;function l(o,u){return o[2]?W1:H1}let n=l(t),i=n(t);return{c(){i.c(),e=Ge()},m(o,u){i.m(o,u),M(o,e,u)},p(o,[u]){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:fe,o:fe,d(o){i.d(o),o&&C(e)}}}function G1(t,e,l){let{timestamp:n}=e,{fullTimeColor:i}=e,{offset:o}=e,u;return t.$$set=a=>{"timestamp"in a&&l(0,n=a.timestamp),"fullTimeColor"in a&&l(1,i=a.fullTimeColor),"offset"in a&&l(3,o=a.offset)},t.$$.update=()=>{t.$$.dirty&9&&(l(2,u=Math.abs(new Date().getTime()-n.getTime())<3e5),isNaN(o)||fl(n,o-(24+n.getHours()-n.getUTCHours())%24))},[n,i,u,o]}class Xc extends Ee{constructor(e){super(),Pe(this,e,G1,z1,Ae,{timestamp:0,fullTimeColor:1,offset:3})}}function V1(t){let e,l,n;return{c(){e=Fe("svg"),l=Fe("path"),n=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"),r(n,"stroke-linecap","round"),r(n,"stroke-linejoin","round"),r(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(i,o){M(i,e,o),s(e,l),s(e,n)},p:fe,i:fe,o:fe,d(i){i&&C(e)}}}class K1 extends Ee{constructor(e){super(),Pe(this,e,null,V1,Ae,{})}}function Y1(t){let e,l;return{c(){e=Fe("svg"),l=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){M(n,e,i),s(e,l)},p:fe,i:fe,o:fe,d(n){n&&C(e)}}}class Q1 extends Ee{constructor(e){super(),Pe(this,e,null,Y1,Ae,{})}}function X1(t){let e,l;return{c(){e=Fe("svg"),l=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){M(n,e,i),s(e,l)},p:fe,i:fe,o:fe,d(n){n&&C(e)}}}class qt extends Ee{constructor(e){super(),Pe(this,e,null,X1,Ae,{})}}function Z1(t){let e,l;return{c(){e=Fe("svg"),l=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15M9 12l3 3m0 0l3-3m-3 3V2.25"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){M(n,e,i),s(e,l)},p:fe,i:fe,o:fe,d(n){n&&C(e)}}}class Zc extends Ee{constructor(e){super(),Pe(this,e,null,Z1,Ae,{})}}function J1(t){let e,l,n=t[1].version+"",i;return{c(){e=S("AMS reader "),l=m("span"),i=S(n)},m(o,u){M(o,e,u),M(o,l,u),s(l,i)},p(o,u){u&2&&n!==(n=o[1].version+"")&&X(i,n)},d(o){o&&C(e),o&&C(l)}}}function ru(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=m("div"),n=S(l),i=S("°C"),r(e,"class","flex-none my-auto")},m(o,u){M(o,e,u),s(e,n),s(e,i)},p(o,u){u&1&&l!==(l=(o[0].t>-50?o[0].t.toFixed(1):"-")+"")&&X(n,l)},d(o){o&&C(e)}}}function au(t){let e,l="HAN: "+xa(t[0].he),n;return{c(){e=m("div"),n=S(l),r(e,"class","bd-red")},m(i,o){M(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="HAN: "+xa(i[0].he))&&X(n,l)},d(i){i&&C(e)}}}function uu(t){let e,l="MQTT: "+eu(t[0].me),n;return{c(){e=m("div"),n=S(l),r(e,"class","bd-red")},m(i,o){M(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="MQTT: "+eu(i[0].me))&&X(n,l)},d(i){i&&C(e)}}}function fu(t){let e,l="PriceAPI: "+tu(t[0].ee),n;return{c(){e=m("div"),n=S(l),r(e,"class","bd-red")},m(i,o){M(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="PriceAPI: "+tu(i[0].ee))&&X(n,l)},d(i){i&&C(e)}}}function cu(t){let e,l,n,i,o,u;return l=new el({props:{to:"/configuration",$$slots:{default:[x1]},$$scope:{ctx:t}}}),o=new el({props:{to:"/status",$$slots:{default:[em]},$$scope:{ctx:t}}}),{c(){e=m("div"),ie(l.$$.fragment),n=h(),i=m("div"),ie(o.$$.fragment),r(e,"class","flex-none px-1 mt-1"),r(e,"title","Configuration"),r(i,"class","flex-none px-1 mt-1"),r(i,"title","Device information")},m(a,c){M(a,e,c),le(l,e,null),M(a,n,c),M(a,i,c),le(o,i,null),u=!0},i(a){u||(D(l.$$.fragment,a),D(o.$$.fragment,a),u=!0)},o(a){q(l.$$.fragment,a),q(o.$$.fragment,a),u=!1},d(a){a&&C(e),ne(l),a&&C(n),a&&C(i),ne(o)}}}function x1(t){let e,l;return e=new K1({}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function em(t){let e,l;return e=new Q1({}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function mu(t){let e,l,n,i,o;const u=[lm,tm],a=[];function c(f,_){return f[1].security==0||f[0].a?0:1}return l=c(t),n=a[l]=u[l](t),{c(){e=m("div"),n.c(),r(e,"class","flex-none mr-3 text-yellow-500"),r(e,"title",i="New version: "+t[2].tag_name)},m(f,_){M(f,e,_),a[l].m(e,null),o=!0},p(f,_){let p=l;l=c(f),l===p?a[l].p(f,_):(De(),q(a[p],1,1,()=>{a[p]=null}),Ie(),n=a[l],n?n.p(f,_):(n=a[l]=u[l](f),n.c()),D(n,1),n.m(e,null)),(!o||_&4&&i!==(i="New version: "+f[2].tag_name))&&r(e,"title",i)},i(f){o||(D(n),o=!0)},o(f){q(n),o=!1},d(f){f&&C(e),a[l].d()}}}function tm(t){let e,l,n=t[2].tag_name+"",i;return{c(){e=m("span"),l=S("New version: "),i=S(n)},m(o,u){M(o,e,u),s(e,l),s(e,i)},p(o,u){u&4&&n!==(n=o[2].tag_name+"")&&X(i,n)},i:fe,o:fe,d(o){o&&C(e)}}}function lm(t){let e,l,n,i=t[2].tag_name+"",o,u,a,c,f,_;return a=new Zc({}),{c(){e=m("button"),l=m("span"),n=S("New version: "),o=S(i),u=h(),ie(a.$$.fragment),r(l,"class","mt-1"),r(e,"class","flex")},m(p,b){M(p,e,b),s(e,l),s(l,n),s(l,o),s(e,u),le(a,e,null),c=!0,f||(_=ee(e,"click",t[3]),f=!0)},p(p,b){(!c||b&4)&&i!==(i=p[2].tag_name+"")&&X(o,i)},i(p){c||(D(a.$$.fragment,p),c=!0)},o(p){q(a.$$.fragment,p),c=!1},d(p){p&&C(e),ne(a),f=!1,_()}}}function nm(t){let e,l,n,i,o,u,a,c,f,_,p,b,v=(t[0].m?(t[0].m/1e3).toFixed(1):"-")+"",d,$,y,T,N,E,B,P,R,L,F,x,j,z,G,V,W,U,K,H,Y,Z,re,ue,we,me,Te,je,Oe,He;i=new el({props:{to:"/",$$slots:{default:[J1]},$$scope:{ctx:t}}}),c=new B1({props:{epoch:t[0].u}});let ye=t[0].t>-50&&ru(t);N=new mn({props:{title:"ESP",text:t[1].booting?"Booting":t[0].v>2?t[0].v.toFixed(2)+"V":"ESP",color:ql(t[1].booting?2:t[0].em)}}),B=new mn({props:{title:"HAN",text:"HAN",color:ql(t[1].booting?9:t[0].hm)}}),R=new mn({props:{title:"WiFi",text:t[0].r?t[0].r.toFixed(0)+"dBm":"WiFi",color:ql(t[1].booting?9:t[0].wm)}}),F=new mn({props:{title:"MQTT",text:"MQTT",color:ql(t[1].booting?9:t[0].mm)}});let Ne=(t[0].he<0||t[0].he>0)&&au(t),Re=t[0].me<0&&uu(t),$e=(t[0].ee>0||t[0].ee<0)&&fu(t);re=new Xc({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),offset:t[1].clock_offset,fullTimeColor:"text-red-500"}});let w=t[1].vndcfg&&t[1].usrcfg&&cu(t);je=new qt({});let g=t[1].fwconsent===1&&t[2]&&mu(t);return{c(){e=m("nav"),l=m("div"),n=m("div"),ie(i.$$.fragment),o=h(),u=m("div"),a=m("div"),ie(c.$$.fragment),f=h(),ye&&ye.c(),_=h(),p=m("div"),b=S("Free mem: "),d=S(v),$=S("kb"),y=h(),T=m("div"),ie(N.$$.fragment),E=h(),ie(B.$$.fragment),P=h(),ie(R.$$.fragment),L=h(),ie(F.$$.fragment),x=h(),Ne&&Ne.c(),j=h(),Re&&Re.c(),z=h(),$e&&$e.c(),G=h(),V=m("div"),W=m("div"),U=m("a"),K=m("img"),Y=h(),Z=m("div"),ie(re.$$.fragment),ue=h(),w&&w.c(),we=h(),me=m("div"),Te=m("a"),ie(je.$$.fragment),Oe=h(),g&&g.c(),r(n,"class","flex text-lg text-gray-100 p-2"),r(a,"class","flex-none my-auto"),r(p,"class","flex-none my-auto"),r(u,"class","flex-none my-auto p-2 flex space-x-4"),r(T,"class","flex-auto flex-wrap my-auto justify-center p-2"),r(K,"class","gh-logo"),lo(K.src,H=A1)||r(K,"src",H),r(K,"alt","GitHub repo"),r(U,"class","float-right"),r(U,"href","https://github.com/UtilitechAS/amsreader-firmware"),r(U,"target","_blank"),r(U,"rel","noreferrer"),r(U,"aria-label","GitHub"),r(W,"class","flex-none"),r(Z,"class","flex-none my-auto px-2"),r(Te,"href",Bt("")),r(Te,"target","_blank"),r(Te,"rel","noreferrer"),r(me,"class","flex-none px-1 mt-1"),r(me,"title","Documentation"),r(V,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),r(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),r(e,"class","bg-violet-600 p-1 rounded-md mx-2")},m(k,A){M(k,e,A),s(e,l),s(l,n),le(i,n,null),s(l,o),s(l,u),s(u,a),le(c,a,null),s(u,f),ye&&ye.m(u,null),s(u,_),s(u,p),s(p,b),s(p,d),s(p,$),s(l,y),s(l,T),le(N,T,null),s(T,E),le(B,T,null),s(T,P),le(R,T,null),s(T,L),le(F,T,null),s(l,x),Ne&&Ne.m(l,null),s(l,j),Re&&Re.m(l,null),s(l,z),$e&&$e.m(l,null),s(l,G),s(l,V),s(V,W),s(W,U),s(U,K),s(V,Y),s(V,Z),le(re,Z,null),s(V,ue),w&&w.m(V,null),s(V,we),s(V,me),s(me,Te),le(je,Te,null),s(V,Oe),g&&g.m(V,null),He=!0},p(k,[A]){const I={};A&18&&(I.$$scope={dirty:A,ctx:k}),i.$set(I);const Q={};A&1&&(Q.epoch=k[0].u),c.$set(Q),k[0].t>-50?ye?ye.p(k,A):(ye=ru(k),ye.c(),ye.m(u,_)):ye&&(ye.d(1),ye=null),(!He||A&1)&&v!==(v=(k[0].m?(k[0].m/1e3).toFixed(1):"-")+"")&&X(d,v);const J={};A&3&&(J.text=k[1].booting?"Booting":k[0].v>2?k[0].v.toFixed(2)+"V":"ESP"),A&3&&(J.color=ql(k[1].booting?2:k[0].em)),N.$set(J);const se={};A&3&&(se.color=ql(k[1].booting?9:k[0].hm)),B.$set(se);const ce={};A&1&&(ce.text=k[0].r?k[0].r.toFixed(0)+"dBm":"WiFi"),A&3&&(ce.color=ql(k[1].booting?9:k[0].wm)),R.$set(ce);const ve={};A&3&&(ve.color=ql(k[1].booting?9:k[0].mm)),F.$set(ve),k[0].he<0||k[0].he>0?Ne?Ne.p(k,A):(Ne=au(k),Ne.c(),Ne.m(l,j)):Ne&&(Ne.d(1),Ne=null),k[0].me<0?Re?Re.p(k,A):(Re=uu(k),Re.c(),Re.m(l,z)):Re&&(Re.d(1),Re=null),k[0].ee>0||k[0].ee<0?$e?$e.p(k,A):($e=fu(k),$e.c(),$e.m(l,G)):$e&&($e.d(1),$e=null);const Se={};A&1&&(Se.timestamp=k[0].c?new Date(k[0].c*1e3):new Date(0)),A&2&&(Se.offset=k[1].clock_offset),re.$set(Se),k[1].vndcfg&&k[1].usrcfg?w?A&2&&D(w,1):(w=cu(k),w.c(),D(w,1),w.m(V,we)):w&&(De(),q(w,1,1,()=>{w=null}),Ie()),k[1].fwconsent===1&&k[2]?g?(g.p(k,A),A&6&&D(g,1)):(g=mu(k),g.c(),D(g,1),g.m(V,null)):g&&(De(),q(g,1,1,()=>{g=null}),Ie())},i(k){He||(D(i.$$.fragment,k),D(c.$$.fragment,k),D(N.$$.fragment,k),D(B.$$.fragment,k),D(R.$$.fragment,k),D(F.$$.fragment,k),D(re.$$.fragment,k),D(w),D(je.$$.fragment,k),D(g),He=!0)},o(k){q(i.$$.fragment,k),q(c.$$.fragment,k),q(N.$$.fragment,k),q(B.$$.fragment,k),q(R.$$.fragment,k),q(F.$$.fragment,k),q(re.$$.fragment,k),q(w),q(je.$$.fragment,k),q(g),He=!1},d(k){k&&C(e),ne(i),ne(c),ye&&ye.d(),ne(N),ne(B),ne(R),ne(F),Ne&&Ne.d(),Re&&Re.d(),$e&&$e.d(),ne(re),w&&w.d(),ne(je),g&&g.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+"?")&&(!ui(i.board)||confirm(As(be(i.chip,i.board))))&&(Ut.update(a=>(a.upgrading=!0,a)),Yc(o.tag_name))}return Ut.subscribe(a=>{l(1,i=a),a.fwconsent===1&&N1()}),Po.subscribe(a=>{l(2,o=Qc(i.version,a))}),t.$$set=a=>{"data"in a&&l(0,n=a.data)},[n,i,o,u]}class sm extends Ee{constructor(e){super(),Pe(this,e,im,nm,Ae,{data:0})}}function om(t){let e,l,n,i;return{c(){e=Fe("svg"),l=Fe("path"),n=Fe("path"),r(l,"d",to(150,150,115,210,510)),r(l,"stroke","#eee"),r(l,"fill","none"),r(l,"stroke-width","55"),r(n,"d",i=to(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){M(o,e,u),s(e,l),s(e,n)},p(o,[u]){u&1&&i!==(i=to(150,150,115,210,210+300*o[0]/100))&&r(n,"d",i),u&2&&r(n,"stroke",o[1])},i:fe,o:fe,d(o){o&&C(e)}}}function pu(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 to(t,e,l,n,i){var o=pu(t,e,l,i),u=pu(t,e,l,n),a=i-n<=180?"0":"1",c=["M",o.x,o.y,"A",l,l,0,a,0,u.x,u.y].join(" ");return c}function 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 Ee{constructor(e){super(),Pe(this,e,rm,om,Ae,{pct:0,color:1})}}function _u(t){let e,l,n,i,o,u,a,c;return{c(){e=m("br"),l=h(),n=m("span"),i=S(t[3]),o=h(),u=m("span"),a=S(t[4]),c=S("/kWh"),r(n,"class","pl-sub"),r(u,"class","pl-snt")},m(f,_){M(f,e,_),M(f,l,_),M(f,n,_),s(n,i),M(f,o,_),M(f,u,_),s(u,a),s(u,c)},p(f,_){_&8&&X(i,f[3]),_&16&&X(a,f[4])},d(f){f&&C(e),f&&C(l),f&&C(n),f&&C(o),f&&C(u)}}}function um(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y;l=new am({props:{pct:t[6],color:t[5](t[6])}});let T=t[3]&&_u(t);return{c(){e=m("div"),ie(l.$$.fragment),n=h(),i=m("span"),o=m("span"),u=S(t[2]),a=h(),c=m("br"),f=h(),_=m("span"),p=S(t[0]),b=h(),v=m("span"),d=S(t[1]),$=h(),T&&T.c(),r(o,"class","pl-lab"),r(_,"class","pl-val"),r(v,"class","pl-unt"),r(i,"class","pl-ov"),r(e,"class","pl-root")},m(N,E){M(N,e,E),le(l,e,null),s(e,n),s(e,i),s(i,o),s(o,u),s(i,a),s(i,c),s(i,f),s(i,_),s(_,p),s(i,b),s(i,v),s(v,d),s(i,$),T&&T.m(i,null),y=!0},p(N,[E]){const B={};E&64&&(B.pct=N[6]),E&96&&(B.color=N[5](N[6])),l.$set(B),(!y||E&4)&&X(u,N[2]),(!y||E&1)&&X(p,N[0]),(!y||E&2)&&X(d,N[1]),N[3]?T?T.p(N,E):(T=_u(N),T.c(),T.m(i,null)):T&&(T.d(1),T=null)},i(N){y||(D(l.$$.fragment,N),y=!0)},o(N){q(l.$$.fragment,N),y=!1},d(N){N&&C(e),ne(l),T&&T.d()}}}function fm(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:u}=e,{sub:a=""}=e,{subunit:c=""}=e,{colorFn:f}=e,_=0;return t.$$set=p=>{"val"in p&&l(0,n=p.val),"max"in p&&l(7,i=p.max),"unit"in p&&l(1,o=p.unit),"label"in p&&l(2,u=p.label),"sub"in p&&l(3,a=p.sub),"subunit"in p&&l(4,c=p.subunit),"colorFn"in p&&l(5,f=p.colorFn)},t.$$.update=()=>{t.$$.dirty&129&&l(6,_=Math.min(n,i)/i*100)},[n,o,u,a,c,f,_,i]}class Jc extends Ee{constructor(e){super(),Pe(this,e,fm,um,Ae,{val:0,max:7,unit:1,label:2,sub:3,subunit:4,colorFn:5})}}function du(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function vu(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function hu(t,e,l){const n=t.slice();return n[13]=e[l],n}function bu(t){let e,l,n,i,o,u,a=t[0].title&&gu(t),c=t[0].y.ticks,f=[];for(let d=0;d20||t[11]%2==0)&&Cu(t);return{c(){e=Fe("g"),n&&n.c(),r(e,"class","tick"),r(e,"transform",l="translate("+t[5](t[11])+","+t[4]+")")},m(i,o){M(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[11]%2==0?n?n.p(i,o):(n=Cu(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&48&&l!==(l="translate("+i[5](i[11])+","+i[4]+")")&&r(e,"transform",l)},d(i){i&&C(e),n&&n.d()}}}function Cu(t){let e,l=t[9].label+"",n,i;return{c(){e=Fe("text"),n=S(l),r(e,"x",i=t[3]/2),r(e,"y","-4")},m(o,u){M(o,e,u),s(e,n)},p(o,u){u&1&&l!==(l=o[9].label+"")&&X(n,l),u&8&&i!==(i=o[3]/2)&&r(e,"x",i)},d(o){o&&C(e)}}}function Mu(t){let e=!isNaN(t[5](t[11])),l,n=e&&yu(t);return{c(){n&&n.c(),l=Ge()},m(i,o){n&&n.m(i,o),M(i,l,o)},p(i,o){o&32&&(e=!isNaN(i[5](i[11]))),e?n?n.p(i,o):(n=yu(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&C(l)}}}function $u(t){let e,l,n=t[9].value!==void 0&&Su(t),i=t[9].value2>1e-4&&Au(t);return{c(){e=Fe("g"),n&&n.c(),l=Fe("g"),i&&i.c()},m(o,u){M(o,e,u),n&&n.m(e,null),M(o,l,u),i&&i.m(l,null)},p(o,u){o[9].value!==void 0?n?n.p(o,u):(n=Su(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[9].value2>1e-4?i?i.p(o,u):(i=Au(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&C(e),n&&n.d(),o&&C(l),i&&i.d()}}}function Su(t){let e,l,n,i,o,u,a,c=t[3]>15&&Tu(t);return{c(){e=Fe("rect"),c&&c.c(),a=Ge(),r(e,"x",l=t[5](t[11])+2),r(e,"y",n=t[6](t[9].value)),r(e,"width",i=t[3]-4),r(e,"height",o=t[6](t[0].y.min)-t[6](Math.min(t[0].y.min,0)+t[9].value)),r(e,"fill",u=t[9].color)},m(f,_){M(f,e,_),c&&c.m(f,_),M(f,a,_)},p(f,_){_&32&&l!==(l=f[5](f[11])+2)&&r(e,"x",l),_&65&&n!==(n=f[6](f[9].value))&&r(e,"y",n),_&8&&i!==(i=f[3]-4)&&r(e,"width",i),_&65&&o!==(o=f[6](f[0].y.min)-f[6](Math.min(f[0].y.min,0)+f[9].value))&&r(e,"height",o),_&1&&u!==(u=f[9].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,_):(c=Tu(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&C(e),c&&c.d(f),f&&C(a)}}}function Tu(t){let e,l=t[9].label+"",n,i,o,u,a,c,f=t[9].title&&Nu(t);return{c(){e=Fe("text"),n=S(l),f&&f.c(),c=Ge(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor",o=t[3]t[6](0)-t[7]?t[9].color:"white"),r(e,"transform",a="translate("+(t[5](t[11])+t[3]/2)+" "+(t[6](t[9].value)>t[6](0)-t[7]?t[6](t[9].value)-t[7]:t[6](t[9].value)+10)+") rotate("+(t[3]_[6](0)-_[7]?_[9].color:"white")&&r(e,"fill",u),p&233&&a!==(a="translate("+(_[5](_[11])+_[3]/2)+" "+(_[6](_[9].value)>_[6](0)-_[7]?_[6](_[9].value)-_[7]:_[6](_[9].value)+10)+") rotate("+(_[3]15&&Pu(t);return{c(){e=Fe("rect"),c&&c.c(),a=Ge(),r(e,"x",l=t[5](t[11])+2),r(e,"y",n=t[6](0)),r(e,"width",i=t[3]-4),r(e,"height",o=t[6](t[0].y.min)-t[6](t[0].y.min+t[9].value2)),r(e,"fill",u=t[9].color2?t[9].color2:t[9].color)},m(f,_){M(f,e,_),c&&c.m(f,_),M(f,a,_)},p(f,_){_&32&&l!==(l=f[5](f[11])+2)&&r(e,"x",l),_&64&&n!==(n=f[6](0))&&r(e,"y",n),_&8&&i!==(i=f[3]-4)&&r(e,"width",i),_&65&&o!==(o=f[6](f[0].y.min)-f[6](f[0].y.min+f[9].value2))&&r(e,"height",o),_&1&&u!==(u=f[9].color2?f[9].color2:f[9].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,_):(c=Pu(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&C(e),c&&c.d(f),f&&C(a)}}}function Pu(t){let e,l=t[9].label2+"",n,i,o,u,a,c=t[9].title2&&Eu(t);return{c(){e=Fe("text"),n=S(l),c&&c.c(),a=Ge(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor","middle"),r(e,"fill",o=t[6](-t[9].value2)t[8].call(e))},m(i,o){M(i,e,o),n&&n.m(e,null),l=c0(e,t[8].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=bu(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:fe,o:fe,d(i){i&&C(e),n&&n.d(),l()}}}let pn=30;function mm(t,e,l){let{config:n}=e,i,o,u,a,c,f,_;function p(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=b=>{"config"in b&&l(0,n=b.config)},t.$$.update=()=>{if(t.$$.dirty&31){l(4,f=o-(n.title?20:0));let b=i-(n.padding.left+n.padding.right);l(3,u=b/n.points.length),l(7,_=un.y.max?$=n.padding.bottom:df||$<0?0:$})}},[n,i,o,u,f,a,c,_,p]}class dn extends Ee{constructor(e){super(),Pe(this,e,mm,cm,Ae,{config:0})}}function pm(t){let e,l;return e=new dn({props:{config:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function _m(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{ds:u}=e,a={};function c(f){return{label:ge(f)+"V",title:f.toFixed(1)+" V",value:isNaN(f)?0:f,color:M1(f||0)}}return t.$$set=f=>{"u1"in f&&l(1,n=f.u1),"u2"in f&&l(2,i=f.u2),"u3"in f&&l(3,o=f.u3),"ds"in f&&l(4,u=f.ds)},t.$$.update=()=>{if(t.$$.dirty&30){let f=[],_=[];n>0&&(f.push({label:u===1?"L1-L2":"L1"}),_.push(c(n))),i>0&&(f.push({label:u===1?"L1-L3":"L2"}),_.push(c(i))),o>0&&(f.push({label:u===1?"L2-L3":"L3"}),_.push(c(o))),l(0,a={padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:f},points:_})}},[a,n,i,o,u]}class dm extends Ee{constructor(e){super(),Pe(this,e,_m,pm,Ae,{u1:1,u2:2,u3:3,ds:4})}}function vm(t){let e,l;return e=new dn({props:{config:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function hm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{i1:u}=e,{i2:a}=e,{i3:c}=e,{max:f}=e,_={};function p(b){return{label:ge(b)+"A",title:b.toFixed(1)+" A",value:isNaN(b)?0:b,color:Bc(b?b/f*100:0)}}return t.$$set=b=>{"u1"in b&&l(1,n=b.u1),"u2"in b&&l(2,i=b.u2),"u3"in b&&l(3,o=b.u3),"i1"in b&&l(4,u=b.i1),"i2"in b&&l(5,a=b.i2),"i3"in b&&l(6,c=b.i3),"max"in b&&l(7,f=b.max)},t.$$.update=()=>{if(t.$$.dirty&254){let b=[],v=[];n>0&&(b.push({label:"L1"}),v.push(p(u))),i>0&&(b.push({label:"L2"}),v.push(p(a))),o>0&&(b.push({label:"L3"}),v.push(p(c))),l(0,_={padding:{top:20,right:15,bottom:20,left:35},y:{min:0,max:f,ticks:[{value:0,label:"0%"},{value:f/4,label:"25%"},{value:f/2,label:"50%"},{value:f/4*3,label:"75%"},{value:f,label:"100%"}]},x:{ticks:b},points:v})}},[_,n,i,o,u,a,c,f]}class bm extends Ee{constructor(e){super(),Pe(this,e,hm,vm,Ae,{u1:1,u2:2,u3:3,i1:4,i2:5,i3:6,max:7})}}function gm(t){let e,l,n,i,o,u,a,c=(typeof t[0]<"u"?t[0].toFixed(0):"-")+"",f,_,p,b,v,d,$=(typeof t[1]<"u"?t[1].toFixed(0):"-")+"",y,T,N,E,B,P,R,L=(typeof t[2]<"u"?t[2].toFixed(1):"-")+"",F,x,j,z,G,V,W=(typeof t[3]<"u"?t[3].toFixed(1):"-")+"",U,K;return{c(){e=m("div"),l=m("strong"),l.textContent="Reactive",n=h(),i=m("div"),o=m("div"),o.textContent="Instant in",u=h(),a=m("div"),f=S(c),_=S(" VAr"),p=h(),b=m("div"),b.textContent="Instant out",v=h(),d=m("div"),y=S($),T=S(" VAr"),N=h(),E=m("div"),B=m("div"),B.textContent="Total in",P=h(),R=m("div"),F=S(L),x=S(" kVArh"),j=h(),z=m("div"),z.textContent="Total out",G=h(),V=m("div"),U=S(W),K=S(" kVArh"),r(a,"class","text-right"),r(d,"class","text-right"),r(i,"class","grid grid-cols-2 mt-4"),r(R,"class","text-right"),r(V,"class","text-right"),r(E,"class","grid grid-cols-2 mt-4"),r(e,"class","mx-2 text-sm")},m(H,Y){M(H,e,Y),s(e,l),s(e,n),s(e,i),s(i,o),s(i,u),s(i,a),s(a,f),s(a,_),s(i,p),s(i,b),s(i,v),s(i,d),s(d,y),s(d,T),s(e,N),s(e,E),s(E,B),s(E,P),s(E,R),s(R,F),s(R,x),s(E,j),s(E,z),s(E,G),s(E,V),s(V,U),s(V,K)},p(H,[Y]){Y&1&&c!==(c=(typeof H[0]<"u"?H[0].toFixed(0):"-")+"")&&X(f,c),Y&2&&$!==($=(typeof H[1]<"u"?H[1].toFixed(0):"-")+"")&&X(y,$),Y&4&&L!==(L=(typeof H[2]<"u"?H[2].toFixed(1):"-")+"")&&X(F,L),Y&8&&W!==(W=(typeof H[3]<"u"?H[3].toFixed(1):"-")+"")&&X(U,W)},i:fe,o:fe,d(H){H&&C(e)}}}function 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 Ee{constructor(e){super(),Pe(this,e,km,gm,Ae,{importInstant:0,exportInstant:1,importTotal:2,exportTotal:3})}}function Iu(t){let e;function l(o,u){return o[3]?Cm:ym}let n=l(t),i=n(t);return{c(){i.c(),e=Ge()},m(o,u){i.m(o,u),M(o,e,u)},p(o,u){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&C(e)}}}function ym(t){let e,l,n,i,o,u,a=ge(t[1].h.u,2)+"",c,f,_,p,b,v,d=ge(t[1].d.u,1)+"",$,y,T,N,E,B,P=ge(t[1].m.u)+"",R,L,F,x,j,z,G=ge(t[0].last_month.u)+"",V,W,U,K,H=t[4]&&Ou(t);return{c(){e=m("strong"),e.textContent="Consumption",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=S(a),f=S(" kWh"),_=h(),p=m("div"),p.textContent="Day",b=h(),v=m("div"),$=S(d),y=S(" kWh"),T=h(),N=m("div"),N.textContent="Month",E=h(),B=m("div"),R=S(P),L=S(" kWh"),F=h(),x=m("div"),x.textContent="Last month",j=h(),z=m("div"),V=S(G),W=S(" kWh"),U=h(),H&&H.c(),K=Ge(),r(u,"class","text-right"),r(v,"class","text-right"),r(B,"class","text-right"),r(z,"class","text-right"),r(n,"class","grid grid-cols-2 mb-3")},m(Y,Z){M(Y,e,Z),M(Y,l,Z),M(Y,n,Z),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,_),s(n,p),s(n,b),s(n,v),s(v,$),s(v,y),s(n,T),s(n,N),s(n,E),s(n,B),s(B,R),s(B,L),s(n,F),s(n,x),s(n,j),s(n,z),s(z,V),s(z,W),M(Y,U,Z),H&&H.m(Y,Z),M(Y,K,Z)},p(Y,Z){Z&2&&a!==(a=ge(Y[1].h.u,2)+"")&&X(c,a),Z&2&&d!==(d=ge(Y[1].d.u,1)+"")&&X($,d),Z&2&&P!==(P=ge(Y[1].m.u)+"")&&X(R,P),Z&1&&G!==(G=ge(Y[0].last_month.u)+"")&&X(V,G),Y[4]?H?H.p(Y,Z):(H=Ou(Y),H.c(),H.m(K.parentNode,K)):H&&(H.d(1),H=null)},d(Y){Y&&C(e),Y&&C(l),Y&&C(n),Y&&C(U),H&&H.d(Y),Y&&C(K)}}}function Cm(t){let e,l,n,i,o,u,a=ge(t[1].h.u,2)+"",c,f,_,p,b,v,d,$=ge(t[1].d.u,1)+"",y,T,N,E,B,P,R,L=ge(t[1].m.u)+"",F,x,j,z,G,V,W,U=ge(t[0].last_month.u)+"",K,H,Y,Z,re,ue,we,me,Te,je,Oe,He=ge(t[1].h.p,2)+"",ye,Ne,Re,$e,w,g,k,A=ge(t[1].d.p,1)+"",I,Q,J,se,ce,ve,Se,oe=ge(t[1].m.p)+"",pe,Be,_e,Ce,vt,Hl,tl,ct=ge(t[0].last_month.p)+"",Sl,pl,jt,ht,Ye=t[4]&&Ru(t),Qe=t[4]&&Lu(t),Xe=t[4]&&Fu(t),Ue=t[4]&&qu(t),Ze=t[4]&&Bu(t),We=t[4]&&Uu(t),Je=t[4]&&ju(t),xe=t[4]&&Hu(t);return{c(){e=m("strong"),e.textContent="Import",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=S(a),f=S(" kWh"),_=h(),Ye&&Ye.c(),p=h(),b=m("div"),b.textContent="Day",v=h(),d=m("div"),y=S($),T=S(" kWh"),N=h(),Qe&&Qe.c(),E=h(),B=m("div"),B.textContent="Month",P=h(),R=m("div"),F=S(L),x=S(" kWh"),j=h(),Xe&&Xe.c(),z=h(),G=m("div"),G.textContent="Last mo.",V=h(),W=m("div"),K=S(U),H=S(" kWh"),Y=h(),Ue&&Ue.c(),re=h(),ue=m("strong"),ue.textContent="Export",we=h(),me=m("div"),Te=m("div"),Te.textContent="Hour",je=h(),Oe=m("div"),ye=S(He),Ne=S(" kWh"),Re=h(),Ze&&Ze.c(),$e=h(),w=m("div"),w.textContent="Day",g=h(),k=m("div"),I=S(A),Q=S(" kWh"),J=h(),We&&We.c(),se=h(),ce=m("div"),ce.textContent="Month",ve=h(),Se=m("div"),pe=S(oe),Be=S(" kWh"),_e=h(),Je&&Je.c(),Ce=h(),vt=m("div"),vt.textContent="Last mo.",Hl=h(),tl=m("div"),Sl=S(ct),pl=S(" kWh"),jt=h(),xe&&xe.c(),r(u,"class","text-right"),r(d,"class","text-right"),r(R,"class","text-right"),r(W,"class","text-right"),r(n,"class",Z="grid grid-cols-"+t[5]+" mb-3"),r(Oe,"class","text-right"),r(k,"class","text-right"),r(Se,"class","text-right"),r(tl,"class","text-right"),r(me,"class",ht="grid grid-cols-"+t[5])},m(de,Me){M(de,e,Me),M(de,l,Me),M(de,n,Me),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,_),Ye&&Ye.m(n,null),s(n,p),s(n,b),s(n,v),s(n,d),s(d,y),s(d,T),s(n,N),Qe&&Qe.m(n,null),s(n,E),s(n,B),s(n,P),s(n,R),s(R,F),s(R,x),s(n,j),Xe&&Xe.m(n,null),s(n,z),s(n,G),s(n,V),s(n,W),s(W,K),s(W,H),s(n,Y),Ue&&Ue.m(n,null),M(de,re,Me),M(de,ue,Me),M(de,we,Me),M(de,me,Me),s(me,Te),s(me,je),s(me,Oe),s(Oe,ye),s(Oe,Ne),s(me,Re),Ze&&Ze.m(me,null),s(me,$e),s(me,w),s(me,g),s(me,k),s(k,I),s(k,Q),s(me,J),We&&We.m(me,null),s(me,se),s(me,ce),s(me,ve),s(me,Se),s(Se,pe),s(Se,Be),s(me,_e),Je&&Je.m(me,null),s(me,Ce),s(me,vt),s(me,Hl),s(me,tl),s(tl,Sl),s(tl,pl),s(me,jt),xe&&xe.m(me,null)},p(de,Me){Me&2&&a!==(a=ge(de[1].h.u,2)+"")&&X(c,a),de[4]?Ye?Ye.p(de,Me):(Ye=Ru(de),Ye.c(),Ye.m(n,p)):Ye&&(Ye.d(1),Ye=null),Me&2&&$!==($=ge(de[1].d.u,1)+"")&&X(y,$),de[4]?Qe?Qe.p(de,Me):(Qe=Lu(de),Qe.c(),Qe.m(n,E)):Qe&&(Qe.d(1),Qe=null),Me&2&&L!==(L=ge(de[1].m.u)+"")&&X(F,L),de[4]?Xe?Xe.p(de,Me):(Xe=Fu(de),Xe.c(),Xe.m(n,z)):Xe&&(Xe.d(1),Xe=null),Me&1&&U!==(U=ge(de[0].last_month.u)+"")&&X(K,U),de[4]?Ue?Ue.p(de,Me):(Ue=qu(de),Ue.c(),Ue.m(n,null)):Ue&&(Ue.d(1),Ue=null),Me&32&&Z!==(Z="grid grid-cols-"+de[5]+" mb-3")&&r(n,"class",Z),Me&2&&He!==(He=ge(de[1].h.p,2)+"")&&X(ye,He),de[4]?Ze?Ze.p(de,Me):(Ze=Bu(de),Ze.c(),Ze.m(me,$e)):Ze&&(Ze.d(1),Ze=null),Me&2&&A!==(A=ge(de[1].d.p,1)+"")&&X(I,A),de[4]?We?We.p(de,Me):(We=Uu(de),We.c(),We.m(me,se)):We&&(We.d(1),We=null),Me&2&&oe!==(oe=ge(de[1].m.p)+"")&&X(pe,oe),de[4]?Je?Je.p(de,Me):(Je=ju(de),Je.c(),Je.m(me,Ce)):Je&&(Je.d(1),Je=null),Me&1&&ct!==(ct=ge(de[0].last_month.p)+"")&&X(Sl,ct),de[4]?xe?xe.p(de,Me):(xe=Hu(de),xe.c(),xe.m(me,null)):xe&&(xe.d(1),xe=null),Me&32&&ht!==(ht="grid grid-cols-"+de[5])&&r(me,"class",ht)},d(de){de&&C(e),de&&C(l),de&&C(n),Ye&&Ye.d(),Qe&&Qe.d(),Xe&&Xe.d(),Ue&&Ue.d(),de&&C(re),de&&C(ue),de&&C(we),de&&C(me),Ze&&Ze.d(),We&&We.d(),Je&&Je.d(),xe&&xe.d()}}}function Ou(t){let e,l,n,i,o,u,a=ge(t[1].h.c,2)+"",c,f,_,p,b,v,d,$=ge(t[1].d.c,1)+"",y,T,N,E,B,P,R,L=ge(t[1].m.c)+"",F,x,j,z,G,V,W,U=ge(t[0].last_month.c)+"",K,H,Y;return{c(){e=m("strong"),e.textContent="Cost",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=S(a),f=h(),_=S(t[2]),p=h(),b=m("div"),b.textContent="Day",v=h(),d=m("div"),y=S($),T=h(),N=S(t[2]),E=h(),B=m("div"),B.textContent="Month",P=h(),R=m("div"),F=S(L),x=h(),j=S(t[2]),z=h(),G=m("div"),G.textContent="Last month",V=h(),W=m("div"),K=S(U),H=h(),Y=S(t[2]),r(u,"class","text-right"),r(d,"class","text-right"),r(R,"class","text-right"),r(W,"class","text-right"),r(n,"class","grid grid-cols-2")},m(Z,re){M(Z,e,re),M(Z,l,re),M(Z,n,re),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(u,_),s(n,p),s(n,b),s(n,v),s(n,d),s(d,y),s(d,T),s(d,N),s(n,E),s(n,B),s(n,P),s(n,R),s(R,F),s(R,x),s(R,j),s(n,z),s(n,G),s(n,V),s(n,W),s(W,K),s(W,H),s(W,Y)},p(Z,re){re&2&&a!==(a=ge(Z[1].h.c,2)+"")&&X(c,a),re&4&&X(_,Z[2]),re&2&&$!==($=ge(Z[1].d.c,1)+"")&&X(y,$),re&4&&X(N,Z[2]),re&2&&L!==(L=ge(Z[1].m.c)+"")&&X(F,L),re&4&&X(j,Z[2]),re&1&&U!==(U=ge(Z[0].last_month.c)+"")&&X(K,U),re&4&&X(Y,Z[2])},d(Z){Z&&C(e),Z&&C(l),Z&&C(n)}}}function Ru(t){let e,l=ge(t[1].h.c,2)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].h.c,2)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Lu(t){let e,l=ge(t[1].d.c,1)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].d.c,1)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Fu(t){let e,l=ge(t[1].m.c)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].m.c)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function qu(t){let e,l=ge(t[0].last_month.c)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ge(u[0].last_month.c)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Bu(t){let e,l=ge(t[1].h.i,2)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].h.i,2)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Uu(t){let e,l=ge(t[1].d.i,1)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].d.i,1)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function ju(t){let e,l=ge(t[1].m.i)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].m.i)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Hu(t){let e,l=ge(t[0].last_month.i)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ge(u[0].last_month.i)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Mm(t){let e,l,n,i,o,u,a=t[1]&&Iu(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Real time calculation",n=h(),i=m("br"),o=m("br"),u=h(),a&&a.c(),r(e,"class","mx-2 text-sm")},m(c,f){M(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),s(e,u),a&&a.m(e,null)},p(c,[f]){c[1]?a?a.p(c,f):(a=Iu(c),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i:fe,o:fe,d(c){c&&C(e),a&&a.d()}}}function $m(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:u}=e,a=!1,c=3;return t.$$set=f=>{"sysinfo"in f&&l(0,n=f.sysinfo),"data"in f&&l(1,i=f.data),"currency"in f&&l(2,o=f.currency),"hasExport"in f&&l(3,u=f.hasExport)},t.$$.update=()=>{t.$$.dirty&18&&(l(4,a=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(5,c=a?3:2))},[n,i,o,u,a,c]}class Sm extends Ee{constructor(e){super(),Pe(this,e,$m,Mm,Ae,{sysinfo:0,data:1,currency:2,hasExport:3})}}function Tm(t){let e,l,n=nu(t[0].source)+"",i,o,u,a;return u=new dn({props:{config:t[1]}}),{c(){e=m("a"),l=S("Provided by: "),i=S(n),o=h(),ie(u.$$.fragment),r(e,"href","https://transparency.entsoe.eu/"),r(e,"target","_blank"),r(e,"class","text-xs float-right z-40")},m(c,f){M(c,e,f),s(e,l),s(e,i),M(c,o,f),le(u,c,f),a=!0},p(c,[f]){(!a||f&1)&&n!==(n=nu(c[0].source)+"")&&X(i,n);const _={};f&2&&(_.config=c[1]),u.$set(_)},i(c){a||(D(u.$$.fragment,c),a=!0)},o(c){q(u.$$.fragment,c),a=!1},d(c){c&&C(e),c&&C(o),ne(u,c)}}}function Nm(t,e,l){let{json:n}=e,{sysinfo:i}=e,o={},u,a;return t.$$set=c=>{"json"in c&&l(0,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&29){let c=n.currency,f=new Date().getUTCHours(),_=0,p=0,b=0,v=[],d=[],$=[];l(4,a=l(3,u=0));let y=new Date;for(fl(y,i.clock_offset-(24+y.getHours()-y.getUTCHours())%24),_=f;_<24&&(p=n[Le(b++)],p!=null);_++)d.push({label:Le(y.getHours())}),$.push(p*100),l(4,a=Math.min(a,p*100)),l(3,u=Math.max(u,p*100)),fl(y,1);for(_=0;_<24&&(p=n[Le(b++)],p!=null);_++)d.push({label:Le(y.getHours())}),$.push(p*100),l(4,a=Math.min(a,p*100)),l(3,u=Math.max(u,p*100)),fl(y,1);if(a>-100&&u<100){switch(c){case"NOK":case"SEK":case"DKK":c="øre";break;case"EUR":c="cent";break;default:c=c+"/100"}for(l(4,a*=100),l(3,u*=100),_=0;_<$.length;_++)$[_]*=100}let T=[];for(_=0;_<$.length;_++){p=$[_];let P=p*.01,R=Math.abs(p)<1e3?2:0;T.push({label:P>=0?P.toFixed(R):"",title:P>=0?P.toFixed(2)+" "+c:"",value:p>=0?Math.abs(p):0,label2:P<0?P.toFixed(R):"",title2:P<0?P.toFixed(2)+" "+c:"",value2:p<0?Math.abs(p):0,color:"#7c3aed"})}let N=Math.max(u,Math.abs(a));if(a<0){l(4,a=Math.min(N/4*-1,a));let P=Math.ceil(Math.abs(a)/N*4),R=a/P;for(_=1;_{"json"in c&&l(1,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,f=[],_=[],p=[];l(4,a=l(3,u=0));let b=fl(new Date,-24),v=new Date().getUTCHours();for(fl(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),c=v;c<24;c++){let T=n["i"+Le(c)],N=n["e"+Le(c)];T===void 0&&(T=0),N===void 0&&(N=0),_.push({label:Le(b.getHours())}),p.push({label:T.toFixed(1),title:T.toFixed(2)+" kWh",value:T*10,label2:N.toFixed(1),title2:N.toFixed(2)+" kWh",value2:N*10,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,N*10)),l(3,u=Math.max(u,T*10)),fl(b,1)}for(c=0;c{"json"in c&&l(1,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,f=[],_=[],p=[];l(4,a=l(3,u=0));let b=new Date,v=new Date;for(fl(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),fl(v,i.clock_offset-(24+v.getHours()-v.getUTCHours())%24),v.setDate(0),c=b.getDate();c<=v.getDate();c++){let T=n["i"+Le(c)],N=n["e"+Le(c)];T===void 0&&(T=0),N===void 0&&(N=0),_.push({label:Le(c)}),p.push({label:T.toFixed(T<10?1:0),title:T.toFixed(2)+" kWh",value:T,label2:N.toFixed(N<10?1:0),title2:N.toFixed(2)+" kWh",value2:N,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,N)),l(3,u=Math.max(u,T))}for(c=1;c{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=0,c=0,f=[],_=[],p=[];n.s&&n.s.forEach((d,$)=>{var y=d.n?d.n:d.a;c=d.v,c==-127&&(c=0),_.push({label:y.slice(-4)}),p.push({label:c.toFixed(1),value:c,color:"#7c3aed"}),l(3,u=Math.min(u,c)),l(2,o=Math.max(o,c))}),l(2,o=Math.ceil(o)),l(3,u=Math.floor(u));let b=o;u<0&&(b+=Math.abs(u));let v=b/4;for(a=0;a<5;a++)c=u+v*a,f.push({value:c,label:c.toFixed(1)});l(0,i={title:"Temperature sensors (°C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:u,max:o,ticks:f},x:{ticks:_},points:p})}},[i,n,o,u]}class qm extends Ee{constructor(e){super(),Pe(this,e,Fm,Lm,Ae,{json:1})}}function Bm(t){let e,l;return e=new dn({props:{config:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}let Um=0;function jm(t,e,l){let n={},i=0,o;return Kc.subscribe(u=>{l(2,o=u)}),Vc(),t.$$.update=()=>{if(t.$$.dirty&6){let u=0,a=[],c=[],f=[];if(a.push({value:0,label:0}),o&&o.p)for(u=0;u0?Le(_.d)+"."+ro[new Date().getMonth()]:"-"}),l(1,i=Math.max(i,_.v))}if(o&&o.t){for(u=0;u=i)break;a.push({value:_,label:_})}a.push({label:o.m.toFixed(1),align:"right",color:"green",value:o.m})}o&&o.c&&(a.push({label:o.c.toFixed(0),color:"orange",value:o.c}),l(1,i=Math.max(i,o.c))),l(1,i=Math.ceil(i)),l(0,n={title:"Tariff peaks",padding:{top:20,right:35,bottom:20,left:35},y:{min:Um,max:i,ticks:a},x:{ticks:c},points:f})}},[n,i,o]}class Hm extends Ee{constructor(e){super(),Pe(this,e,jm,Bm,Ae,{})}}function Wu(t){let e,l,n,i,o,u,a=(t[0].mt?Ns(t[0].mt):"-")+"",c,f,_,p=(t[0].ic?t[0].ic.toFixed(1):"-")+"",b,v,d;return i=new Jc({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:"Import",sub:t[0].p,subunit:t[0].pc,colorFn:Bc}}),{c(){e=m("div"),l=m("div"),n=m("div"),ie(i.$$.fragment),o=h(),u=m("div"),c=S(a),f=h(),_=m("div"),b=S(p),v=S(" kWh"),r(n,"class","col-span-2"),r(_,"class","text-right"),r(l,"class","grid grid-cols-2"),r(e,"class","cnt")},m($,y){M($,e,y),s(e,l),s(l,n),le(i,n,null),s(l,o),s(l,u),s(u,c),s(l,f),s(l,_),s(_,b),s(_,v),d=!0},p($,y){const T={};y&1&&(T.val=$[0].i?$[0].i:0),y&1&&(T.max=$[0].im?$[0].im:15e3),y&1&&(T.sub=$[0].p),y&1&&(T.subunit=$[0].pc),i.$set(T),(!d||y&1)&&a!==(a=($[0].mt?Ns($[0].mt):"-")+"")&&X(c,a),(!d||y&1)&&p!==(p=($[0].ic?$[0].ic.toFixed(1):"-")+"")&&X(b,p)},i($){d||(D(i.$$.fragment,$),d=!0)},o($){q(i.$$.fragment,$),d=!1},d($){$&&C(e),ne(i)}}}function zu(t){let e,l,n,i,o,u,a,c,f=(t[0].ec?t[0].ec.toFixed(1):"-")+"",_,p,b;return i=new Jc({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:"Export",colorFn:$1}}),{c(){e=m("div"),l=m("div"),n=m("div"),ie(i.$$.fragment),o=h(),u=m("div"),a=h(),c=m("div"),_=S(f),p=S(" kWh"),r(n,"class","col-span-2"),r(c,"class","text-right"),r(l,"class","grid grid-cols-2"),r(e,"class","cnt")},m(v,d){M(v,e,d),s(e,l),s(l,n),le(i,n,null),s(l,o),s(l,u),s(l,a),s(l,c),s(c,_),s(c,p),b=!0},p(v,d){const $={};d&1&&($.val=v[0].e?v[0].e:0),d&1&&($.max=v[0].om?v[0].om*1e3:1e4),i.$set($),(!b||d&1)&&f!==(f=(v[0].ec?v[0].ec.toFixed(1):"-")+"")&&X(_,f)},i(v){b||(D(i.$$.fragment,v),b=!0)},o(v){q(i.$$.fragment,v),b=!1},d(v){v&&C(e),ne(i)}}}function Gu(t){let e,l,n;return l=new dm({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,ds:t[0].ds}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&1&&(u.u1=i[0].u1),o&1&&(u.u2=i[0].u2),o&1&&(u.u3=i[0].u3),o&1&&(u.ds=i[0].ds),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Vu(t){let e,l,n;return l=new bm({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,i1:t[0].i1,i2:t[0].i2,i3:t[0].i3,max:t[0].mf?t[0].mf:32}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&1&&(u.u1=i[0].u1),o&1&&(u.u2=i[0].u2),o&1&&(u.u3=i[0].u3),o&1&&(u.i1=i[0].i1),o&1&&(u.i2=i[0].i2),o&1&&(u.i3=i[0].i3),o&1&&(u.max=i[0].mf?i[0].mf:32),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Ku(t){let e,l,n;return l=new wm({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&1&&(u.importInstant=i[0].ri),o&1&&(u.exportInstant=i[0].re),o&1&&(u.importTotal=i[0].ric),o&1&&(u.exportTotal=i[0].rec),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Yu(t){let e,l,n;return l=new Sm({props:{sysinfo:t[1],data:t[0].ea,currency:t[0].pc,hasExport:t[0].om>0||t[0].e>0}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&2&&(u.sysinfo=i[1]),o&1&&(u.data=i[0].ea),o&1&&(u.currency=i[0].pc),o&1&&(u.hasExport=i[0].om>0||i[0].e>0),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Qu(t){let e,l,n;return l=new Hm({}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt h-64")},m(i,o){M(i,e,o),le(l,e,null),n=!0},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Xu(t){let e,l,n;return l=new Am({props:{json:t[2],sysinfo:t[1]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&4&&(u.json=i[2]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Zu(t){let e,l,n;return l=new Dm({props:{json:t[3],sysinfo:t[1]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&8&&(u.json=i[3]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Ju(t){let e,l,n;return l=new Rm({props:{json:t[4],sysinfo:t[1]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&16&&(u.json=i[4]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function xu(t){let e,l,n;return l=new qm({props:{json:t[5]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&32&&(u.json=i[5]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Wm(t){let e,l=Ve(t[1].ui.i,t[0].i),n,i=Ve(t[1].ui.e,t[0].om||t[0].e>0),o,u=Ve(t[1].ui.v,t[0].u1>100||t[0].u2>100||t[0].u3>100),a,c=Ve(t[1].ui.a,t[0].i1>.01||t[0].i2>.01||t[0].i3>.01),f,_=Ve(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),p,b=Ve(t[1].ui.c,t[0].ea),v,d=Ve(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("10YNO")||t[0].pr=="10Y1001A1001A48H")),$,y=Ve(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),T,N=Ve(t[1].ui.d,t[3]),E,B=Ve(t[1].ui.m,t[4]),P,R=Ve(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),L,F=l&&Wu(t),x=i&&zu(t),j=u&&Gu(t),z=c&&Vu(t),G=_&&Ku(t),V=b&&Yu(t),W=d&&Qu(),U=y&&Xu(t),K=N&&Zu(t),H=B&&Ju(t),Y=R&&xu(t);return{c(){e=m("div"),F&&F.c(),n=h(),x&&x.c(),o=h(),j&&j.c(),a=h(),z&&z.c(),f=h(),G&&G.c(),p=h(),V&&V.c(),v=h(),W&&W.c(),$=h(),U&&U.c(),T=h(),K&&K.c(),E=h(),H&&H.c(),P=h(),Y&&Y.c(),r(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(Z,re){M(Z,e,re),F&&F.m(e,null),s(e,n),x&&x.m(e,null),s(e,o),j&&j.m(e,null),s(e,a),z&&z.m(e,null),s(e,f),G&&G.m(e,null),s(e,p),V&&V.m(e,null),s(e,v),W&&W.m(e,null),s(e,$),U&&U.m(e,null),s(e,T),K&&K.m(e,null),s(e,E),H&&H.m(e,null),s(e,P),Y&&Y.m(e,null),L=!0},p(Z,[re]){re&3&&(l=Ve(Z[1].ui.i,Z[0].i)),l?F?(F.p(Z,re),re&3&&D(F,1)):(F=Wu(Z),F.c(),D(F,1),F.m(e,n)):F&&(De(),q(F,1,1,()=>{F=null}),Ie()),re&3&&(i=Ve(Z[1].ui.e,Z[0].om||Z[0].e>0)),i?x?(x.p(Z,re),re&3&&D(x,1)):(x=zu(Z),x.c(),D(x,1),x.m(e,o)):x&&(De(),q(x,1,1,()=>{x=null}),Ie()),re&3&&(u=Ve(Z[1].ui.v,Z[0].u1>100||Z[0].u2>100||Z[0].u3>100)),u?j?(j.p(Z,re),re&3&&D(j,1)):(j=Gu(Z),j.c(),D(j,1),j.m(e,a)):j&&(De(),q(j,1,1,()=>{j=null}),Ie()),re&3&&(c=Ve(Z[1].ui.a,Z[0].i1>.01||Z[0].i2>.01||Z[0].i3>.01)),c?z?(z.p(Z,re),re&3&&D(z,1)):(z=Vu(Z),z.c(),D(z,1),z.m(e,f)):z&&(De(),q(z,1,1,()=>{z=null}),Ie()),re&3&&(_=Ve(Z[1].ui.r,Z[0].ri>0||Z[0].re>0||Z[0].ric>0||Z[0].rec>0)),_?G?(G.p(Z,re),re&3&&D(G,1)):(G=Ku(Z),G.c(),D(G,1),G.m(e,p)):G&&(De(),q(G,1,1,()=>{G=null}),Ie()),re&3&&(b=Ve(Z[1].ui.c,Z[0].ea)),b?V?(V.p(Z,re),re&3&&D(V,1)):(V=Yu(Z),V.c(),D(V,1),V.m(e,v)):V&&(De(),q(V,1,1,()=>{V=null}),Ie()),re&3&&(d=Ve(Z[1].ui.t,Z[0].pr&&(Z[0].pr.startsWith("10YNO")||Z[0].pr=="10Y1001A1001A48H"))),d?W?re&3&&D(W,1):(W=Qu(),W.c(),D(W,1),W.m(e,$)):W&&(De(),q(W,1,1,()=>{W=null}),Ie()),re&3&&(y=Ve(Z[1].ui.p,Z[0].pe&&!Number.isNaN(Z[0].p))),y?U?(U.p(Z,re),re&3&&D(U,1)):(U=Xu(Z),U.c(),D(U,1),U.m(e,T)):U&&(De(),q(U,1,1,()=>{U=null}),Ie()),re&10&&(N=Ve(Z[1].ui.d,Z[3])),N?K?(K.p(Z,re),re&10&&D(K,1)):(K=Zu(Z),K.c(),D(K,1),K.m(e,E)):K&&(De(),q(K,1,1,()=>{K=null}),Ie()),re&18&&(B=Ve(Z[1].ui.m,Z[4])),B?H?(H.p(Z,re),re&18&&D(H,1)):(H=Ju(Z),H.c(),D(H,1),H.m(e,P)):H&&(De(),q(H,1,1,()=>{H=null}),Ie()),re&35&&(R=Ve(Z[1].ui.s,Z[0].t&&Z[0].t!=-127&&Z[5].c>1)),R?Y?(Y.p(Z,re),re&35&&D(Y,1)):(Y=xu(Z),Y.c(),D(Y,1),Y.m(e,null)):Y&&(De(),q(Y,1,1,()=>{Y=null}),Ie())},i(Z){L||(D(F),D(x),D(j),D(z),D(G),D(V),D(W),D(U),D(K),D(H),D(Y),L=!0)},o(Z){q(F),q(x),q(j),q(z),q(G),q(V),q(W),q(U),q(K),q(H),q(Y),L=!1},d(Z){Z&&C(e),F&&F.d(),x&&x.d(),j&&j.d(),z&&z.d(),G&&G.d(),V&&V.d(),W&&W.d(),U&&U.d(),K&&K.d(),H&&H.d(),Y&&Y.d()}}}function zm(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},u={},a={},c={};return To.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,c=f)}),t.$$set=f=>{"data"in f&&l(0,n=f.data),"sysinfo"in f&&l(1,i=f.sysinfo)},[n,i,o,u,a,c]}class Gm extends Ee{constructor(e){super(),Pe(this,e,zm,Wm,Ae,{data:0,sysinfo:1})}}let _o={};const $i=at(_o);async function Vm(){_o=await(await fetch("/configuration.json")).json(),$i.set(_o)}function ef(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Km(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function Ym(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function tf(t){let e;return{c(){e=m("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function lf(t){let e,l,n;return{c(){e=m("option"),e.textContent="UART1",l=h(),n=m("option"),n.textContent="UART2",e.__value=9,e.value=e.__value,n.__value=16,n.value=n.__value},m(i,o){M(i,e,o),M(i,l,o),M(i,n,o)},d(i){i&&C(e),i&&C(l),i&&C(n)}}}function nf(t){let e;return{c(){e=m("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function sf(t){let e,l,n;return{c(){e=m("option"),l=S("GPIO"),n=S(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){M(i,e,o),s(e,l),s(e,n)},d(i){i&&C(e)}}}function of(t){let e,l=t[4]>3&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!(t[0]=="esp32s2"&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&sf(t);return{c(){l&&l.c(),e=Ge()},m(n,i){l&&l.m(n,i),M(n,e,i)},p(n,i){n[4]>3&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!(n[0]=="esp32s2"&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=sf(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&C(e)}}}function Qm(t){let e,l,n,i,o;function u(d,$){return d[0]=="esp32c3"?Ym:Km}let a=u(t),c=a(t),f=t[0]=="esp8266"&&tf(),_=(t[0]=="esp32"||t[0]=="esp32solo")&&lf(),p=t[0]=="esp32s2"&&nf(),b={length:t[1]+1},v=[];for(let d=0;d{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32c3":l(1,i=19);break}},[n,i]}class xc extends Ee{constructor(e){super(),Pe(this,e,Xm,Qm,Ae,{chip:0})}}function rf(t){let e,l,n=t[1]&&af(t);return{c(){e=m("div"),l=m("div"),n&&n.c(),r(l,"class","fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center"),r(e,"class","z-50"),r(e,"aria-modal","true")},m(i,o){M(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=af(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&C(e),n&&n.d()}}}function af(t){let e,l;return{c(){e=m("div"),l=S(t[1]),r(e,"class","bg-white m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 w-96")},m(n,i){M(n,e,i),s(e,l)},p(n,i){i&2&&X(l,n[1])},d(n){n&&C(e)}}}function Zm(t){let e,l=t[0]&&rf(t);return{c(){l&&l.c(),e=Ge()},m(n,i){l&&l.m(n,i),M(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=rf(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:fe,o:fe,d(n){l&&l.d(n),n&&C(e)}}}function Jm(t,e,l){let{active:n}=e,{message:i}=e;return t.$$set=o=>{"active"in o&&l(0,n=o.active),"message"in o&&l(1,i=o.message)},[n,i]}class It extends Ee{constructor(e){super(),Pe(this,e,Jm,Zm,Ae,{active:0,message:1})}}function uf(t,e,l){const n=t.slice();return n[1]=e[l],n}function ff(t){let e,l,n=t[1]+"",i;return{c(){e=m("option"),l=S("Europe/"),i=S(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,u){M(o,e,u),s(e,l),s(e,i)},p:fe,d(o){o&&C(e)}}}function xm(t){let e,l,n,i=t[0],o=[];for(let u=0;u>1&1,A=0;A0;g--)A[g]=A[g]?A[g-1]^P.EXPONENT[F._modN(P.LOG[A[g]]+w)]:A[g-1];A[0]=P.EXPONENT[F._modN(P.LOG[A[0]]+w)]}for(w=0;w<=k;w++)A[w]=P.LOG[A[w]]},_checkBadness:function(){var w,g,k,A,I,Q=0,J=this._badness,se=this.buffer,ce=this.width;for(I=0;Ice*ce;)oe-=ce*ce,Se++;for(Q+=Se*F.N4,A=0;A=J-2&&(w=J-2,I>9&&w--);var se=w;if(I>9){for(Q[se+2]=0,Q[se+3]=0;se--;)g=Q[se],Q[se+3]|=255&g<<4,Q[se+2]=g>>4;Q[2]|=255&w<<4,Q[1]=w>>4,Q[0]=64|w>>12}else{for(Q[se+1]=0,Q[se+2]=0;se--;)g=Q[se],Q[se+2]|=255&g<<4,Q[se+1]=g>>4;Q[1]|=255&w<<4,Q[0]=64|w>>4}for(se=w+3-(I<10);se=5&&(k+=F.N1+A[g]-5);for(g=3;gw||A[g-3]*3>=A[g]*4||A[g+3]*3>=A[g]*4)&&(k+=F.N3);return k},_finish:function(){this._stringBuffer=this.buffer.slice();var w,g,k=0,A=3e4;for(g=0;g<8&&(this._applyMask(g),w=this._checkBadness(),w>=1)A&1&&(I[Q-1-g+Q*8]=1,g<6?I[8+Q*g]=1:I[8+Q*(g+1)]=1);for(g=0;g<7;g++,A>>=1)A&1&&(I[8+Q*(Q-7+g)]=1,g?I[6-g+Q*8]=1:I[7+Q*8]=1)},_interleaveBlocks:function(){var w,g,k=this._dataBlock,A=this._ecc,I=this._eccBlock,Q=0,J=this._calculateMaxLength(),se=this._neccBlock1,ce=this._neccBlock2,ve=this._stringBuffer;for(w=0;w1)for(w=T.BLOCK[A],k=I-7;;){for(g=I-7;g>w-3&&(this._addAlignment(g,k),!(g6)for(w=L.BLOCK[Q-7],g=17,k=0;k<6;k++)for(A=0;A<3;A++,g--)1&(g>11?Q>>g-12:w>>g)?(I[5-k+J*(2-A+J-11)]=1,I[2-A+J-11+J*(5-k)]=1):(this._setMask(5-k,2-A+J-11),this._setMask(2-A+J-11,5-k))},_isMasked:function(w,g){var k=F._getMaskBit(w,g);return this._mask[k]===1},_pack:function(){var w,g,k,A=1,I=1,Q=this.width,J=Q-1,se=Q-1,ce=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(g=0;gg&&(k=w,w=g,g=k),k=g,k+=g*g,k>>=1,k+=w,k},_modN:function(w){for(;w>=255;)w-=255,w=(w>>8)+(w&255);return w},N1:3,N2:3,N3:40,N4:10}),x=F,j=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var w=this.element;w.width=w.height=this.qrious.size}}),z=j,G=p.extend(function(w,g,k,A){this.name=w,this.modifiable=!!g,this.defaultValue=k,this._valueTransformer=A},{transform:function(w){var g=this._valueTransformer;return typeof g=="function"?g(w,this):w}}),V=G,W=p.extend(null,{abs:function(w){return w!=null?Math.abs(w):null},hasOwn:function(w,g){return Object.prototype.hasOwnProperty.call(w,g)},noop:function(){},toUpperCase:function(w){return w!=null?w.toUpperCase():null}}),U=W,K=p.extend(function(w){this.options={},w.forEach(function(g){this.options[g.name]=g},this)},{exists:function(w){return this.options[w]!=null},get:function(w,g){return K._get(this.options[w],g)},getAll:function(w){var g,k=this.options,A={};for(g in k)U.hasOwn(k,g)&&(A[g]=K._get(k[g],w));return A},init:function(w,g,k){typeof k!="function"&&(k=U.noop);var A,I;for(A in this.options)U.hasOwn(this.options,A)&&(I=this.options[A],K._set(I,I.defaultValue,g),K._createAccessor(I,g,k));this._setAll(w,g,!0)},set:function(w,g,k){return this._set(w,g,k)},setAll:function(w,g){return this._setAll(w,g)},_set:function(w,g,k,A){var I=this.options[w];if(!I)throw new Error("Invalid option: "+w);if(!I.modifiable&&!A)throw new Error("Option cannot be modified: "+w);return K._set(I,g,k)},_setAll:function(w,g,k){if(!w)return!1;var A,I=!1;for(A in w)U.hasOwn(w,A)&&this._set(A,w[A],g,k)&&(I=!0);return I}},{_createAccessor:function(w,g,k){var A={get:function(){return K._get(w,g)}};w.modifiable&&(A.set=function(I){K._set(w,I,g)&&k(I,w)}),Object.defineProperty(g,w.name,A)},_get:function(w,g){return g["_"+w.name]},_set:function(w,g,k){var A="_"+w.name,I=k[A],Q=w.transform(g??w.defaultValue);return k[A]=Q,Q!==I}}),H=K,Y=p.extend(function(){this._services={}},{getService:function(w){var g=this._services[w];if(!g)throw new Error("Service is not being managed with name: "+w);return g},setService:function(w,g){if(this._services[w])throw new Error("Service is already managed with name: "+w);g&&(this._services[w]=g)}}),Z=Y,re=new H([new V("background",!0,"white"),new V("backgroundAlpha",!0,1,U.abs),new V("element"),new V("foreground",!0,"black"),new V("foregroundAlpha",!0,1,U.abs),new V("level",!0,"L",U.toUpperCase),new V("mime",!0,"image/png"),new V("padding",!0,null,U.abs),new V("size",!0,100,U.abs),new V("value",!0,"")]),ue=new Z,we=p.extend(function(w){re.init(w,this,this.update.bind(this));var g=re.get("element",this),k=ue.getService("element"),A=g&&k.isCanvas(g)?g:k.createCanvas(),I=g&&k.isImage(g)?g:k.createImage();this._canvasRenderer=new $(this,A,!0),this._imageRenderer=new z(this,I,I===g),this.update()},{get:function(){return re.getAll(this)},set:function(w){re.setAll(w,this)&&this.update()},toDataURL:function(w){return this.canvas.toDataURL(w||this.mime)},update:function(){var w=new x({level:this.level,value:this.value});this._canvasRenderer.render(w),this._imageRenderer.render(w)}},{use:function(w){ue.setService(w.getName(),w)}});Object.defineProperties(we.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var me=we,Te=me,je=p.extend({getName:function(){}}),Oe=je,He=Oe.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(w){},isImage:function(w){}}),ye=He,Ne=ye.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(w){return w instanceof HTMLCanvasElement},isImage:function(w){return w instanceof HTMLImageElement}}),Re=Ne;Te.use(new Re);var $e=Te;return $e})})(t0);var op=t0.exports;const rp=sp(op);function ap(t){let e,l;return{c(){e=m("img"),lo(e.src,l=t[2])||r(e,"src",l),r(e,"alt",t[0]),r(e,"class",t[1])},m(n,i){M(n,e,i)},p(n,[i]){i&4&&!lo(e.src,l=n[2])&&r(e,"src",l),i&1&&r(e,"alt",n[0]),i&2&&r(e,"class",n[1])},i:fe,o:fe,d(n){n&&C(e)}}}function up(t,e,l){const n=new rp;let{errorCorrection:i="L"}=e,{background:o="#fff"}=e,{color:u="#000"}=e,{size:a="200"}=e,{value:c=""}=e,{padding:f=0}=e,{className:_="qrcode"}=e,p="";function b(){n.set({background:o,foreground:u,level:i,padding:f,size:a,value:c}),l(2,p=n.toDataURL("image/jpeg"))}return uc(()=>{b()}),t.$$set=v=>{"errorCorrection"in v&&l(3,i=v.errorCorrection),"background"in v&&l(4,o=v.background),"color"in v&&l(5,u=v.color),"size"in v&&l(6,a=v.size),"value"in v&&l(0,c=v.value),"padding"in v&&l(7,f=v.padding),"className"in v&&l(1,_=v.className)},t.$$.update=()=>{t.$$.dirty&1&&c&&b()},[c,_,p,i,o,u,a,f]}class fp extends Ee{constructor(e){super(),Pe(this,e,up,ap,Ae,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function cf(t,e,l){const n=t.slice();return n[96]=e[l],n[97]=e,n[98]=l,n}function mf(t,e,l){const n=t.slice();return n[99]=e[l],n[100]=e,n[101]=l,n}function cp(t,e,l){const n=t.slice();return n[102]=e[l],n}function mp(t,e,l){const n=t.slice();return n[105]=e[l],n}function pp(t){let e,l;return{c(){e=m("option"),l=S(t[105]),e.__value=t[105],e.value=e.__value},m(n,i){M(n,e,i),s(e,l)},p:fe,d(n){n&&C(e)}}}function pf(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","pt"),r(l,"type","text"),r(l,"class","in-s"),r(l,"placeholder","ENTSO-E API key, optional, read docs")},m(o,u){M(o,e,u),M(o,l,u),te(l,t[3].p.t),n||(i=ee(l,"input",t[22]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].p.t&&te(l,o[3].p.t)},d(o){o&&C(e),o&&C(l),n=!1,i()}}}function _f(t){let e,l,n,i,o,u,a,c,f,_,p,b,v;return{c(){e=m("div"),l=S("Username"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=S("Password"),f=m("br"),_=h(),p=m("input"),r(o,"name","gu"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(p,"name","gp"),r(p,"type","password"),r(p,"class","in-s"),r(a,"class","my-1")},m(d,$){M(d,e,$),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].g.u),M(d,u,$),M(d,a,$),s(a,c),s(a,f),s(a,_),s(a,p),te(p,t[3].g.p),b||(v=[ee(o,"input",t[24]),ee(p,"input",t[25])],b=!0)},p(d,$){$[0]&8&&o.value!==d[3].g.u&&te(o,d[3].g.u),$[0]&8&&p.value!==d[3].g.p&&te(p,d[3].g.p)},d(d){d&&C(e),d&&C(u),d&&C(a),b=!1,ze(v)}}}function _p(t){let e,l=t[102]*100+"",n;return{c(){e=m("option"),n=S(l),e.__value=t[102]*100,e.value=e.__value},m(i,o){M(i,e,o),s(e,n)},p:fe,d(i){i&&C(e)}}}function df(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","mek"),r(l,"type","text"),r(l,"class","in-s")},m(o,u){M(o,e,u),M(o,l,u),te(l,t[3].m.e.k),n||(i=ee(l,"input",t[34]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].m.e.k&&te(l,o[3].m.e.k)},d(o){o&&C(e),o&&C(l),n=!1,i()}}}function vf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=S("Authentication key"),n=m("br"),i=h(),o=m("input"),r(o,"name","mea"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1")},m(c,f){M(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].m.e.a),u||(a=ee(o,"input",t[35]),u=!0)},p(c,f){f[0]&8&&o.value!==c[3].m.e.a&&te(o,c[3].m.e.a)},d(c){c&&C(e),u=!1,a()}}}function hf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,R,L,F,x,j;return{c(){e=m("div"),l=m("div"),n=S("Watt"),i=m("br"),o=h(),u=m("input"),a=h(),c=m("div"),f=S("Volt"),_=m("br"),p=h(),b=m("input"),v=h(),d=m("div"),$=S("Amp"),y=m("br"),T=h(),N=m("input"),E=h(),B=m("div"),P=S("kWh"),R=m("br"),L=h(),F=m("input"),r(u,"name","mmw"),r(u,"type","number"),r(u,"min","0.00"),r(u,"max","1000"),r(u,"step","0.001"),r(u,"class","in-f tr w-full"),r(l,"class","w-1/4"),r(b,"name","mmv"),r(b,"type","number"),r(b,"min","0.00"),r(b,"max","1000"),r(b,"step","0.001"),r(b,"class","in-m tr w-full"),r(c,"class","w-1/4"),r(N,"name","mma"),r(N,"type","number"),r(N,"min","0.00"),r(N,"max","1000"),r(N,"step","0.001"),r(N,"class","in-m tr w-full"),r(d,"class","w-1/4"),r(F,"name","mmc"),r(F,"type","number"),r(F,"min","0.00"),r(F,"max","1000"),r(F,"step","0.001"),r(F,"class","in-l tr w-full"),r(B,"class","w-1/4"),r(e,"class","flex my-1")},m(z,G){M(z,e,G),s(e,l),s(l,n),s(l,i),s(l,o),s(l,u),te(u,t[3].m.m.w),s(e,a),s(e,c),s(c,f),s(c,_),s(c,p),s(c,b),te(b,t[3].m.m.v),s(e,v),s(e,d),s(d,$),s(d,y),s(d,T),s(d,N),te(N,t[3].m.m.a),s(e,E),s(e,B),s(B,P),s(B,R),s(B,L),s(B,F),te(F,t[3].m.m.c),x||(j=[ee(u,"input",t[37]),ee(b,"input",t[38]),ee(N,"input",t[39]),ee(F,"input",t[40])],x=!0)},p(z,G){G[0]&8&&he(u.value)!==z[3].m.m.w&&te(u,z[3].m.m.w),G[0]&8&&he(b.value)!==z[3].m.m.v&&te(b,z[3].m.m.v),G[0]&8&&he(N.value)!==z[3].m.m.a&&te(N,z[3].m.m.a),G[0]&8&&he(F.value)!==z[3].m.m.c&&te(F,z[3].m.m.c)},d(z){z&&C(e),x=!1,ze(j)}}}function bf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y;return{c(){e=m("div"),l=S("Gateway"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=S("DNS"),f=m("br"),_=h(),p=m("div"),b=m("input"),v=h(),d=m("input"),r(o,"name","ng"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(b,"name","nd1"),r(b,"type","text"),r(b,"class","in-f w-full"),r(d,"name","nd2"),r(d,"type","text"),r(d,"class","in-l w-full"),r(p,"class","flex"),r(a,"class","my-1")},m(T,N){M(T,e,N),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].n.g),M(T,u,N),M(T,a,N),s(a,c),s(a,f),s(a,_),s(a,p),s(p,b),te(b,t[3].n.d1),s(p,v),s(p,d),te(d,t[3].n.d2),$||(y=[ee(o,"input",t[50]),ee(b,"input",t[51]),ee(d,"input",t[52])],$=!0)},p(T,N){N[0]&8&&o.value!==T[3].n.g&&te(o,T[3].n.g),N[0]&8&&b.value!==T[3].n.d1&&te(b,T[3].n.d1),N[0]&8&&d.value!==T[3].n.d2&&te(d,T[3].n.d2)},d(T){T&&C(e),T&&C(u),T&&C(a),$=!1,ze(y)}}}function gf(t){let e,l,n,i,o;return{c(){e=m("label"),l=m("input"),n=S(" SSL"),r(l,"type","checkbox"),r(l,"name","qs"),l.__value="true",l.value=l.__value,r(l,"class","rounded mb-1"),r(e,"class","float-right mr-3")},m(u,a){M(u,e,a),s(e,l),l.checked=t[3].q.s.e,s(e,n),i||(o=[ee(l,"change",t[56]),ee(l,"change",t[14])],i=!0)},p(u,a){a[0]&8&&(l.checked=u[3].q.s.e)},d(u){u&&C(e),i=!1,ze(o)}}}function kf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v;const d=[vp,dp],$=[];function y(L,F){return L[3].q.s.c?0:1}n=y(t),i=$[n]=d[n](t);const T=[kp,gp],N=[];function E(L,F){return L[3].q.s.r?0:1}a=E(t),c=N[a]=T[a](t);const B=[Mp,Cp],P=[];function R(L,F){return L[3].q.s.k?0:1}return p=R(t),b=P[p]=B[p](t),{c(){e=m("div"),l=m("span"),i.c(),o=h(),u=m("span"),c.c(),f=h(),_=m("span"),b.c(),r(l,"class","flex pr-2"),r(u,"class","flex pr-2"),r(_,"class","flex pr-2"),r(e,"class","my-1 flex")},m(L,F){M(L,e,F),s(e,l),$[n].m(l,null),s(e,o),s(e,u),N[a].m(u,null),s(e,f),s(e,_),P[p].m(_,null),v=!0},p(L,F){let x=n;n=y(L),n===x?$[n].p(L,F):(De(),q($[x],1,1,()=>{$[x]=null}),Ie(),i=$[n],i?i.p(L,F):(i=$[n]=d[n](L),i.c()),D(i,1),i.m(l,null));let j=a;a=E(L),a===j?N[a].p(L,F):(De(),q(N[j],1,1,()=>{N[j]=null}),Ie(),c=N[a],c?c.p(L,F):(c=N[a]=T[a](L),c.c()),D(c,1),c.m(u,null));let z=p;p=R(L),p===z?P[p].p(L,F):(De(),q(P[z],1,1,()=>{P[z]=null}),Ie(),b=P[p],b?b.p(L,F):(b=P[p]=B[p](L),b.c()),D(b,1),b.m(_,null))},i(L){v||(D(i),D(c),D(b),v=!0)},o(L){q(i),q(c),q(b),v=!1},d(L){L&&C(e),$[n].d(),N[a].d(),P[p].d()}}}function dp(t){let e,l;return e=new el({props:{to:"/mqtt-ca",$$slots:{default:[hp]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i[3]&32768&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function vp(t){let e,l,n,i,o,u,a,c;return l=new el({props:{to:"/mqtt-ca",$$slots:{default:[bp]},$$scope:{ctx:t}}}),o=new Eo({}),{c(){e=m("span"),ie(l.$$.fragment),n=h(),i=m("span"),ie(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){M(f,e,_),le(l,e,null),M(f,n,_),M(f,i,_),le(o,i,null),u=!0,a||(c=[ee(i,"click",t[11]),ee(i,"keypress",t[11])],a=!0)},p(f,_){const p={};_[3]&32768&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(D(l.$$.fragment,f),D(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&C(e),ne(l),f&&C(n),f&&C(i),ne(o),a=!1,ze(c)}}}function hp(t){let e,l;return e=new mn({props:{color:"blue",text:"Upload CA",title:"Click here to upload CA"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function bp(t){let e;return{c(){e=S("CA OK")},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function gp(t){let e,l;return e=new el({props:{to:"/mqtt-cert",$$slots:{default:[wp]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i[3]&32768&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function kp(t){let e,l,n,i,o,u,a,c;return l=new el({props:{to:"/mqtt-cert",$$slots:{default:[yp]},$$scope:{ctx:t}}}),o=new Eo({}),{c(){e=m("span"),ie(l.$$.fragment),n=h(),i=m("span"),ie(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){M(f,e,_),le(l,e,null),M(f,n,_),M(f,i,_),le(o,i,null),u=!0,a||(c=[ee(i,"click",t[12]),ee(i,"keypress",t[12])],a=!0)},p(f,_){const p={};_[3]&32768&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(D(l.$$.fragment,f),D(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&C(e),ne(l),f&&C(n),f&&C(i),ne(o),a=!1,ze(c)}}}function wp(t){let e,l;return e=new mn({props:{color:"blue",text:"Upload cert",title:"Click here to upload certificate"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function yp(t){let e;return{c(){e=S("Cert OK")},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function Cp(t){let e,l;return e=new el({props:{to:"/mqtt-key",$$slots:{default:[$p]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i[3]&32768&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function Mp(t){let e,l,n,i,o,u,a,c;return l=new el({props:{to:"/mqtt-key",$$slots:{default:[Sp]},$$scope:{ctx:t}}}),o=new Eo({}),{c(){e=m("span"),ie(l.$$.fragment),n=h(),i=m("span"),ie(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){M(f,e,_),le(l,e,null),M(f,n,_),M(f,i,_),le(o,i,null),u=!0,a||(c=[ee(i,"click",t[13]),ee(i,"keypress",t[13])],a=!0)},p(f,_){const p={};_[3]&32768&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(D(l.$$.fragment,f),D(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&C(e),ne(l),f&&C(n),f&&C(i),ne(o),a=!1,ze(c)}}}function $p(t){let e,l;return e=new mn({props:{color:"blue",text:"Upload key",title:"Click here to upload key"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function Sp(t){let e;return{c(){e=S("Key OK")},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function wf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,R,L,F,x,j,z,G,V,W,U,K;return o=new qt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Domoticz",n=h(),i=m("a"),ie(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),_=m("div"),p=S("Electricity IDX"),b=m("br"),v=h(),d=m("input"),$=h(),y=m("div"),T=S("Current IDX"),N=m("br"),E=h(),B=m("input"),P=h(),R=m("div"),L=S(`Voltage IDX: L1, L2 & L3 - `),F=m("div"),x=m("input"),j=h(),z=m("input"),G=h(),V=m("input"),r(l,"class","text-sm"),r(i,"href",Bt("MQTT-configuration#domoticz")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","o"),a.value="true",r(d,"name","oe"),r(d,"type","text"),r(d,"class","in-f tr w-full"),r(_,"class","w-1/2"),r(B,"name","oc"),r(B,"type","text"),r(B,"class","in-l tr w-full"),r(y,"class","w-1/2"),r(f,"class","my-1 flex"),r(x,"name","ou1"),r(x,"type","text"),r(x,"class","in-f tr w-1/3"),r(z,"name","ou2"),r(z,"type","text"),r(z,"class","in-m tr w-1/3"),r(V,"name","ou3"),r(V,"type","text"),r(V,"class","in-l tr w-1/3"),r(F,"class","flex"),r(R,"class","my-1"),r(e,"class","cnt")},m(H,Y){M(H,e,Y),s(e,l),s(e,n),s(e,i),le(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,_),s(_,p),s(_,b),s(_,v),s(_,d),te(d,t[3].o.e),s(f,$),s(f,y),s(y,T),s(y,N),s(y,E),s(y,B),te(B,t[3].o.c),s(e,P),s(e,R),s(R,L),s(R,F),s(F,x),te(x,t[3].o.u1),s(F,j),s(F,z),te(z,t[3].o.u2),s(F,G),s(F,V),te(V,t[3].o.u3),W=!0,U||(K=[ee(d,"input",t[64]),ee(B,"input",t[65]),ee(x,"input",t[66]),ee(z,"input",t[67]),ee(V,"input",t[68])],U=!0)},p(H,Y){Y[0]&8&&d.value!==H[3].o.e&&te(d,H[3].o.e),Y[0]&8&&B.value!==H[3].o.c&&te(B,H[3].o.c),Y[0]&8&&x.value!==H[3].o.u1&&te(x,H[3].o.u1),Y[0]&8&&z.value!==H[3].o.u2&&te(z,H[3].o.u2),Y[0]&8&&V.value!==H[3].o.u3&&te(V,H[3].o.u3)},i(H){W||(D(o.$$.fragment,H),W=!0)},o(H){q(o.$$.fragment,H),W=!1},d(H){H&&C(e),ne(o),U=!1,ze(K)}}}function yf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,R,L,F,x,j,z,G,V;return o=new qt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Home-Assistant",n=h(),i=m("a"),ie(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),_=S("Discovery topic prefix"),p=m("br"),b=h(),v=m("input"),d=h(),$=m("div"),y=S("Hostname for URL"),T=m("br"),N=h(),E=m("input"),P=h(),R=m("div"),L=S("Name tag"),F=m("br"),x=h(),j=m("input"),r(l,"class","text-sm"),r(i,"href",Bt("MQTT-configuration#home-assistant")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","h"),a.value="true",r(v,"name","ht"),r(v,"type","text"),r(v,"class","in-s"),r(v,"placeholder","homeassistant"),r(f,"class","my-1"),r(E,"name","hh"),r(E,"type","text"),r(E,"class","in-s"),r(E,"placeholder",B=t[3].g.h+".local"),r($,"class","my-1"),r(j,"name","hn"),r(j,"type","text"),r(j,"class","in-s"),r(R,"class","my-1"),r(e,"class","cnt")},m(W,U){M(W,e,U),s(e,l),s(e,n),s(e,i),le(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,_),s(f,p),s(f,b),s(f,v),te(v,t[3].h.t),s(e,d),s(e,$),s($,y),s($,T),s($,N),s($,E),te(E,t[3].h.h),s(e,P),s(e,R),s(R,L),s(R,F),s(R,x),s(R,j),te(j,t[3].h.n),z=!0,G||(V=[ee(v,"input",t[69]),ee(E,"input",t[70]),ee(j,"input",t[71])],G=!0)},p(W,U){U[0]&8&&v.value!==W[3].h.t&&te(v,W[3].h.t),(!z||U[0]&8&&B!==(B=W[3].g.h+".local"))&&r(E,"placeholder",B),U[0]&8&&E.value!==W[3].h.h&&te(E,W[3].h.h),U[0]&8&&j.value!==W[3].h.n&&te(j,W[3].h.n)},i(W){z||(D(o.$$.fragment,W),z=!0)},o(W){q(o.$$.fragment,W),z=!1},d(W){W&&C(e),ne(o),G=!1,ze(V)}}}function Cf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d=t[3].c.es&&Mf(t);return{c(){e=m("div"),l=m("input"),n=h(),i=m("strong"),i.textContent="Cloud connections",o=h(),u=m("div"),a=m("label"),c=m("input"),f=S(" Energy Speedometer"),_=h(),d&&d.c(),r(l,"type","hidden"),r(l,"name","c"),l.value="true",r(i,"class","text-sm"),r(c,"type","checkbox"),r(c,"class","rounded mb-1"),r(c,"name","ces"),c.__value="true",c.value=c.__value,r(u,"class","my-1"),r(e,"class","cnt")},m($,y){M($,e,y),s(e,l),s(e,n),s(e,i),s(e,o),s(e,u),s(u,a),s(a,c),c.checked=t[3].c.es,s(a,f),s(u,_),d&&d.m(u,null),p=!0,b||(v=ee(c,"change",t[72]),b=!0)},p($,y){y[0]&8&&(c.checked=$[3].c.es),$[3].c.es?d?(d.p($,y),y[0]&8&&D(d,1)):(d=Mf($),d.c(),D(d,1),d.m(u,null)):d&&(De(),q(d,1,1,()=>{d=null}),Ie())},i($){p||(D(d),p=!0)},o($){q(d),p=!1},d($){$&&C(e),d&&d.d(),b=!1,v()}}}function Mf(t){let e,l,n=t[0].mac+"",i,o,u,a,c=(t[0].meter.id?t[0].meter.id:"missing, required")+"",f,_,p,b,v=t[0].mac&&t[0].meter.id&&$f(t);return{c(){e=m("div"),l=S("MAC: "),i=S(n),o=h(),u=m("div"),a=S("Meter ID: "),f=S(c),_=h(),v&&v.c(),p=Ge(),r(e,"class","pl-5"),r(u,"class","pl-5")},m(d,$){M(d,e,$),s(e,l),s(e,i),M(d,o,$),M(d,u,$),s(u,a),s(u,f),M(d,_,$),v&&v.m(d,$),M(d,p,$),b=!0},p(d,$){(!b||$[0]&1)&&n!==(n=d[0].mac+"")&&X(i,n),(!b||$[0]&1)&&c!==(c=(d[0].meter.id?d[0].meter.id:"missing, required")+"")&&X(f,c),d[0].mac&&d[0].meter.id?v?(v.p(d,$),$[0]&1&&D(v,1)):(v=$f(d),v.c(),D(v,1),v.m(p.parentNode,p)):v&&(De(),q(v,1,1,()=>{v=null}),Ie())},i(d){b||(D(v),b=!0)},o(d){q(v),b=!1},d(d){d&&C(e),d&&C(o),d&&C(u),d&&C(_),v&&v.d(d),d&&C(p)}}}function $f(t){let e,l,n;return l=new fp({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","pl-2")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o[0]&1&&(u.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Sf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E;o=new qt({});let B={length:9},P=[];for(let R=0;R20&&Pf(t),_=t[0].chip=="esp8266"&&If(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Hardware",n=h(),i=m("a"),ie(o.$$.fragment),u=h(),f&&f.c(),a=h(),_&&_.c(),r(l,"class","text-sm"),r(i,"href",Bt("GPIO-configuration")),r(i,"target","_blank"),r(i,"class","float-right"),r(e,"class","cnt")},m(p,b){M(p,e,b),s(e,l),s(e,n),s(e,i),le(o,i,null),s(e,u),f&&f.m(e,null),s(e,a),_&&_.m(e,null),c=!0},p(p,b){p[0].board>20?f?(f.p(p,b),b[0]&1&&D(f,1)):(f=Pf(p),f.c(),D(f,1),f.m(e,a)):f&&(De(),q(f,1,1,()=>{f=null}),Ie()),p[0].chip=="esp8266"?_?_.p(p,b):(_=If(p),_.c(),_.m(e,null)):_&&(_.d(1),_=null)},i(p){c||(D(o.$$.fragment,p),D(f),c=!0)},o(p){q(o.$$.fragment,p),q(f),c=!1},d(p){p&&C(e),ne(o),f&&f.d(),_&&_.d()}}}function Pf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,R,L,F,x,j,z,G,V,W,U,K,H,Y,Z,re,ue,we,me,Te,je,Oe,He,ye,Ne,Re,$e,w,g,k,A,I,Q,J,se,ce,ve,Se,oe;b=new xc({props:{chip:t[0].chip}});let pe=t[0].chip!="esp8266"&&Ef(t),Be=t[3].i.v.p>0&&Df(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=S("HAN"),u=m("label"),a=m("input"),c=S(" pullup"),f=m("br"),_=h(),p=m("select"),ie(b.$$.fragment),v=h(),d=m("div"),$=S("AP button"),y=m("br"),T=h(),N=m("input"),E=h(),B=m("div"),P=S("LED"),R=m("label"),L=m("input"),F=S(" inv"),x=m("br"),j=h(),z=m("div"),G=m("input"),V=h(),W=m("div"),U=S("RGB"),K=m("label"),H=m("input"),Y=S(" inverted"),Z=m("br"),re=h(),ue=m("div"),we=m("input"),me=h(),Te=m("input"),je=h(),Oe=m("input"),He=h(),ye=m("div"),Ne=S("Temperature"),Re=m("br"),$e=h(),w=m("input"),g=h(),k=m("div"),A=S("Analog temp"),I=m("br"),Q=h(),J=m("input"),se=h(),pe&&pe.c(),ce=h(),Be&&Be.c(),r(e,"type","hidden"),r(e,"name","i"),e.value="true",r(a,"name","ihu"),a.__value="true",a.value=a.__value,r(a,"type","checkbox"),r(a,"class","rounded mb-1"),r(u,"class","ml-2"),r(p,"name","ihp"),r(p,"class","in-f w-full"),t[3].i.h.p===void 0&&et(()=>t[77].call(p)),r(i,"class","w-1/3"),r(N,"name","ia"),r(N,"type","number"),r(N,"min","0"),r(N,"max",t[6]),r(N,"class","in-m tr w-full"),r(d,"class","w-1/3"),r(L,"name","ili"),L.__value="true",L.value=L.__value,r(L,"type","checkbox"),r(L,"class","rounded mb-1"),r(R,"class","ml-4"),r(G,"name","ilp"),r(G,"type","number"),r(G,"min","0"),r(G,"max",t[6]),r(G,"class","in-l tr w-full"),r(z,"class","flex"),r(B,"class","w-1/3"),r(H,"name","iri"),H.__value="true",H.value=H.__value,r(H,"type","checkbox"),r(H,"class","rounded mb-1"),r(K,"class","ml-4"),r(we,"name","irr"),r(we,"type","number"),r(we,"min","0"),r(we,"max",t[6]),r(we,"class","in-f tr w-1/3"),r(Te,"name","irg"),r(Te,"type","number"),r(Te,"min","0"),r(Te,"max",t[6]),r(Te,"class","in-m tr w-1/3"),r(Oe,"name","irb"),r(Oe,"type","number"),r(Oe,"min","0"),r(Oe,"max",t[6]),r(Oe,"class","in-l tr w-1/3"),r(ue,"class","flex"),r(W,"class","w-full"),r(w,"name","itd"),r(w,"type","number"),r(w,"min","0"),r(w,"max",t[6]),r(w,"class","in-f tr w-full"),r(ye,"class","my-1 w-1/3"),r(J,"name","ita"),r(J,"type","number"),r(J,"min","0"),r(J,"max",t[6]),r(J,"class","in-l tr w-full"),r(k,"class","my-1 pr-1 w-1/3"),r(n,"class","flex flex-wrap")},m(_e,Ce){M(_e,e,Ce),M(_e,l,Ce),M(_e,n,Ce),s(n,i),s(i,o),s(i,u),s(u,a),a.checked=t[3].i.h.u,s(u,c),s(i,f),s(i,_),s(i,p),le(b,p,null),qe(p,t[3].i.h.p,!0),s(n,v),s(n,d),s(d,$),s(d,y),s(d,T),s(d,N),te(N,t[3].i.a),s(n,E),s(n,B),s(B,P),s(B,R),s(R,L),L.checked=t[3].i.l.i,s(R,F),s(B,x),s(B,j),s(B,z),s(z,G),te(G,t[3].i.l.p),s(n,V),s(n,W),s(W,U),s(W,K),s(K,H),H.checked=t[3].i.r.i,s(K,Y),s(W,Z),s(W,re),s(W,ue),s(ue,we),te(we,t[3].i.r.r),s(ue,me),s(ue,Te),te(Te,t[3].i.r.g),s(ue,je),s(ue,Oe),te(Oe,t[3].i.r.b),s(n,He),s(n,ye),s(ye,Ne),s(ye,Re),s(ye,$e),s(ye,w),te(w,t[3].i.t.d),s(n,g),s(n,k),s(k,A),s(k,I),s(k,Q),s(k,J),te(J,t[3].i.t.a),s(n,se),pe&&pe.m(n,null),s(n,ce),Be&&Be.m(n,null),ve=!0,Se||(oe=[ee(a,"change",t[76]),ee(p,"change",t[77]),ee(N,"input",t[78]),ee(L,"change",t[79]),ee(G,"input",t[80]),ee(H,"change",t[81]),ee(we,"input",t[82]),ee(Te,"input",t[83]),ee(Oe,"input",t[84]),ee(w,"input",t[85]),ee(J,"input",t[86])],Se=!0)},p(_e,Ce){Ce[0]&8&&(a.checked=_e[3].i.h.u);const vt={};Ce[0]&1&&(vt.chip=_e[0].chip),b.$set(vt),Ce[0]&8&&qe(p,_e[3].i.h.p),(!ve||Ce[0]&64)&&r(N,"max",_e[6]),Ce[0]&8&&he(N.value)!==_e[3].i.a&&te(N,_e[3].i.a),Ce[0]&8&&(L.checked=_e[3].i.l.i),(!ve||Ce[0]&64)&&r(G,"max",_e[6]),Ce[0]&8&&he(G.value)!==_e[3].i.l.p&&te(G,_e[3].i.l.p),Ce[0]&8&&(H.checked=_e[3].i.r.i),(!ve||Ce[0]&64)&&r(we,"max",_e[6]),Ce[0]&8&&he(we.value)!==_e[3].i.r.r&&te(we,_e[3].i.r.r),(!ve||Ce[0]&64)&&r(Te,"max",_e[6]),Ce[0]&8&&he(Te.value)!==_e[3].i.r.g&&te(Te,_e[3].i.r.g),(!ve||Ce[0]&64)&&r(Oe,"max",_e[6]),Ce[0]&8&&he(Oe.value)!==_e[3].i.r.b&&te(Oe,_e[3].i.r.b),(!ve||Ce[0]&64)&&r(w,"max",_e[6]),Ce[0]&8&&he(w.value)!==_e[3].i.t.d&&te(w,_e[3].i.t.d),(!ve||Ce[0]&64)&&r(J,"max",_e[6]),Ce[0]&8&&he(J.value)!==_e[3].i.t.a&&te(J,_e[3].i.t.a),_e[0].chip!="esp8266"?pe?pe.p(_e,Ce):(pe=Ef(_e),pe.c(),pe.m(n,ce)):pe&&(pe.d(1),pe=null),_e[3].i.v.p>0?Be?Be.p(_e,Ce):(Be=Df(_e),Be.c(),Be.m(n,null)):Be&&(Be.d(1),Be=null)},i(_e){ve||(D(b.$$.fragment,_e),ve=!0)},o(_e){q(b.$$.fragment,_e),ve=!1},d(_e){_e&&C(e),_e&&C(l),_e&&C(n),ne(b),pe&&pe.d(),Be&&Be.d(),Se=!1,ze(oe)}}}function Ef(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=S("Vcc"),n=m("br"),i=h(),o=m("input"),r(o,"name","ivp"),r(o,"type","number"),r(o,"min","0"),r(o,"max",t[6]),r(o,"class","in-s tr w-full"),r(e,"class","my-1 pl-1 w-1/3")},m(c,f){M(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].i.v.p),u||(a=ee(o,"input",t[87]),u=!0)},p(c,f){f[0]&64&&r(o,"max",c[6]),f[0]&8&&he(o.value)!==c[3].i.v.p&&te(o,c[3].i.v.p)},d(c){c&&C(e),u=!1,a()}}}function Df(t){let e,l,n,i,o,u,a,c,f,_;return{c(){e=m("div"),l=S("Voltage divider"),n=m("br"),i=h(),o=m("div"),u=m("input"),a=h(),c=m("input"),r(u,"name","ivdv"),r(u,"type","number"),r(u,"min","0"),r(u,"max","65535"),r(u,"class","in-f tr w-full"),r(u,"placeholder","VCC"),r(c,"name","ivdg"),r(c,"type","number"),r(c,"min","0"),r(c,"max","65535"),r(c,"class","in-l tr w-full"),r(c,"placeholder","GND"),r(o,"class","flex"),r(e,"class","my-1")},m(p,b){M(p,e,b),s(e,l),s(e,n),s(e,i),s(e,o),s(o,u),te(u,t[3].i.v.d.v),s(o,a),s(o,c),te(c,t[3].i.v.d.g),f||(_=[ee(u,"input",t[88]),ee(c,"input",t[89])],f=!0)},p(p,b){b[0]&8&&he(u.value)!==p[3].i.v.d.v&&te(u,p[3].i.v.d.v),b[0]&8&&he(c.value)!==p[3].i.v.d.g&&te(c,p[3].i.v.d.g)},d(p){p&&C(e),f=!1,ze(_)}}}function If(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N=(t[0].board==2||t[0].board==100)&&Of(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=S("Vcc offset"),u=m("br"),a=h(),c=m("input"),f=h(),_=m("div"),p=S("Multiplier"),b=m("br"),v=h(),d=m("input"),$=h(),N&&N.c(),r(e,"type","hidden"),r(e,"name","iv"),e.value="true",r(c,"name","ivo"),r(c,"type","number"),r(c,"min","0.0"),r(c,"max","3.5"),r(c,"step","0.01"),r(c,"class","in-f tr w-full"),r(i,"class","w-1/3"),r(d,"name","ivm"),r(d,"type","number"),r(d,"min","0.1"),r(d,"max","10"),r(d,"step","0.01"),r(d,"class","in-l tr w-full"),r(_,"class","w-1/3 pr-1"),r(n,"class","my-1 flex flex-wrap")},m(E,B){M(E,e,B),M(E,l,B),M(E,n,B),s(n,i),s(i,o),s(i,u),s(i,a),s(i,c),te(c,t[3].i.v.o),s(n,f),s(n,_),s(_,p),s(_,b),s(_,v),s(_,d),te(d,t[3].i.v.m),s(n,$),N&&N.m(n,null),y||(T=[ee(c,"input",t[90]),ee(d,"input",t[91])],y=!0)},p(E,B){B[0]&8&&he(c.value)!==E[3].i.v.o&&te(c,E[3].i.v.o),B[0]&8&&he(d.value)!==E[3].i.v.m&&te(d,E[3].i.v.m),E[0].board==2||E[0].board==100?N?N.p(E,B):(N=Of(E),N.c(),N.m(n,null)):N&&(N.d(1),N=null)},d(E){E&&C(e),E&&C(l),E&&C(n),N&&N.d(),y=!1,ze(T)}}}function Of(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=S("Boot limit"),n=m("br"),i=h(),o=m("input"),r(o,"name","ivb"),r(o,"type","number"),r(o,"min","2.5"),r(o,"max","3.5"),r(o,"step","0.1"),r(o,"class","in-s tr w-full"),r(e,"class","w-1/3 pl-1")},m(c,f){M(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].i.v.b),u||(a=ee(o,"input",t[92]),u=!0)},p(c,f){f[0]&8&&he(o.value)!==c[3].i.v.b&&te(o,c[3].i.v.b)},d(c){c&&C(e),u=!1,a()}}}function Rf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T=t[3].d.t&&Lf();return{c(){e=m("div"),e.textContent="Debug can cause sudden reboots. Do not leave on!",l=h(),n=m("div"),i=m("label"),o=m("input"),u=S(" Enable telnet"),a=h(),T&&T.c(),c=h(),f=m("div"),_=m("select"),p=m("option"),p.textContent="Verbose",b=m("option"),b.textContent="Debug",v=m("option"),v.textContent="Info",d=m("option"),d.textContent="Warning",r(e,"class","bd-red"),r(o,"type","checkbox"),r(o,"name","dt"),o.__value="true",o.value=o.__value,r(o,"class","rounded mb-1"),r(n,"class","my-1"),p.__value=1,p.value=p.__value,b.__value=2,b.value=b.__value,v.__value=3,v.value=v.__value,d.__value=4,d.value=d.__value,r(_,"name","dl"),r(_,"class","in-s"),t[3].d.l===void 0&&et(()=>t[95].call(_)),r(f,"class","my-1")},m(N,E){M(N,e,E),M(N,l,E),M(N,n,E),s(n,i),s(i,o),o.checked=t[3].d.t,s(i,u),M(N,a,E),T&&T.m(N,E),M(N,c,E),M(N,f,E),s(f,_),s(_,p),s(_,b),s(_,v),s(_,d),qe(_,t[3].d.l,!0),$||(y=[ee(o,"change",t[94]),ee(_,"change",t[95])],$=!0)},p(N,E){E[0]&8&&(o.checked=N[3].d.t),N[3].d.t?T||(T=Lf(),T.c(),T.m(c.parentNode,c)):T&&(T.d(1),T=null),E[0]&8&&qe(_,N[3].d.l)},d(N){N&&C(e),N&&C(l),N&&C(n),N&&C(a),T&&T.d(N),N&&C(c),N&&C(f),$=!1,ze(y)}}}function Lf(t){let e;return{c(){e=m("div"),e.textContent="Telnet is unsafe and should be off when not in use",r(e,"class","bd-red")},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function Tp(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,R,L,F,x,j,z,G,V,W,U,K,H,Y,Z,re,ue,we,me,Te,je,Oe,He,ye,Ne,Re,$e,w,g,k,A,I,Q,J,se,ce,ve,Se,oe,pe,Be,_e,Ce,vt,Hl,tl,ct,Sl,pl,jt,ht,Ye,Qe,Xe,Ue,Ze,We,Je,xe,de,Me,Ii,_l,vn,Tt,Oi,Ri,Li,dl,Fi,qi,Bi,Nt,Tl,Nl,Al,Ui,ji,ke,mt,Wl,zl,Pl,El,Gl,Hi,ll,Wi,Io,Ds,Oo,pi,Ht,Ro,Lo,Dl,nl,Il,Fo,zi,qo,pt,Ol,Bo,Gi,hn,bn,gn,kn,Vi,Uo,At,Ki,jo,Vl,Ho,Wo,zo,il,wn,yn,Go,Cn,Kl,Vo,Ko,Yo,Mn,Wt,Qo,Yi,Xo,Yl,Zo,Jo,xo,$n,zt,er,Qi,tr,Is,lr,Ql,Xi,Gt,nr,ir,sr,Os,Zi,Vt,or,rr,ar,tt,Ji,ur,Sn,Tn,fr,_i,cr,Xl,mr,pr,_r,vl,dr,Zl,vr,hr,br,hl,gr,Nn,Jl,kr,wr,yr,Ot,An,Pn,En,Dn,Cr,xl,Mr,$r,Sr,In,Rt,Tr,xi,Nr,es,ts,Kt,Ar,Pr,ls,ns,Yt,Er,Dr,ut,is,Ir,On,Rn,Or,en,Rr,Lr,Fr,Rl,sl,Ln,Fn,qr,Pt,ss,os,Br,Et,qn,rs,as,Ur,Rs,us,fs,Qt,jr,Hr,di,Wr,Ll,zr,vi,Xt,Gr,Vr,Kr,cs,bl,Yr,Ke,ms,Qr,Bn,Un,Xr,hi,Zr,ol,Jr,Ls,xr,ea,jn,gl,ta,Zt,la,Fs,tn,na,ia,sa,kl,oa,ln,ra,aa,ua,wl,fa,Hn,Wn,ca,ma,pa,yl,_a,zn,da,va,ha,bt,Gn,Vn,Kn,Yn,Qn,Xn,ba,nn,ga,ka,wa,Cl,ya,qs,Bs,Us,js=t[3].p.r.startsWith("10YNO")||t[3].p.r=="10Y1001A1001A48H",Hs,rl,ps,Ca,Zn,Jn,Ma,bi,$a,gi,Sa,Ws,Dt,_s,Ta,xn,ei,Na,ki,Aa,ds,vs,Jt,Pa,Ea,Da,Fl,zs,ti,Ia,hs,li,Oa,bs,Gs,sn,Vs,on,Ks,rn,Ys,an,Lt,Qs,Ra;a=new qt({}),F=new tp({});let l0=["NOK","SEK","DKK","EUR"],wi=[];for(let O=0;O<4;O+=1)wi[O]=pp(mp(t,l0,O));let gt=t[3].p.e&&t[0].chip!="esp8266"&&pf(t),kt=t[3].g.s>0&&_f(t);Pl=new qt({});let n0=[24,48,96,192,384,576,1152],yi=[];for(let O=0;O<7;O+=1)yi[O]=_p(cp(t,n0,O));let wt=t[3].m.e.e&&df(t),yt=t[3].m.e.e&&vf(t),Ct=t[3].m.m.e&&hf(t);Tn=new qt({}),Rn=new qt({}),qn=new e0({});let Mt=t[3].n.m=="static"&&bf(t);Un=new qt({});let $t=t[0].chip!="esp8266"&&gf(t),lt=t[3].q.s.e&&kf(t),nt=t[3].q.m==3&&wf(t),it=t[3].q.m==4&&yf(t),st=t[3].c.es!=null&&Cf(t),ot=js&&Sf(t);Jn=new qt({});let ni=t[7],_t=[];for(let O=0;O20||t[0].chip=="esp8266")&&Af(t);ei=new qt({});let St=t[3].d.s&&Rf(t);return sn=new It({props:{active:t[1],message:"Loading configuration"}}),on=new It({props:{active:t[2],message:"Saving configuration"}}),rn=new It({props:{active:t[4],message:"Performing factory reset"}}),an=new It({props:{active:t[5],message:"Device have been factory reset and switched to AP mode"}}),{c(){e=m("form"),l=m("div"),n=m("div"),i=m("strong"),i.textContent="General",o=h(),u=m("a"),ie(a.$$.fragment),c=h(),f=m("input"),_=h(),p=m("div"),b=m("div"),v=m("div"),d=S("Hostname"),$=m("br"),y=h(),T=m("input"),N=h(),E=m("div"),B=S("Time zone"),P=m("br"),R=h(),L=m("select"),ie(F.$$.fragment),x=h(),j=m("input"),z=h(),G=m("div"),V=m("div"),W=m("div"),U=S("Price region"),K=m("br"),H=h(),Y=m("select"),Z=m("optgroup"),re=m("option"),re.textContent="NO1",ue=m("option"),ue.textContent="NO2",we=m("option"),we.textContent="NO3",me=m("option"),me.textContent="NO4",Te=m("option"),Te.textContent="NO5",je=m("optgroup"),Oe=m("option"),Oe.textContent="SE1",He=m("option"),He.textContent="SE2",ye=m("option"),ye.textContent="SE3",Ne=m("option"),Ne.textContent="SE4",Re=m("optgroup"),$e=m("option"),$e.textContent="DK1",w=m("option"),w.textContent="DK2",g=m("option"),g.textContent="Austria",k=m("option"),k.textContent="Belgium",A=m("option"),A.textContent="Czech Republic",I=m("option"),I.textContent="Estonia",Q=m("option"),Q.textContent="Finland",J=m("option"),J.textContent="France",se=m("option"),se.textContent="Germany",ce=m("option"),ce.textContent="Great Britain",ve=m("option"),ve.textContent="Latvia",Se=m("option"),Se.textContent="Lithuania",oe=m("option"),oe.textContent="Netherland",pe=m("option"),pe.textContent="Poland",Be=m("option"),Be.textContent="Switzerland",_e=h(),Ce=m("div"),vt=S("Currency"),Hl=m("br"),tl=h(),ct=m("select");for(let O=0;O<4;O+=1)wi[O].c();Sl=h(),pl=m("div"),jt=m("div"),ht=m("div"),Ye=S("Fixed price"),Qe=m("br"),Xe=h(),Ue=m("input"),Ze=h(),We=m("div"),Je=S("Multiplier"),xe=m("br"),de=h(),Me=m("input"),Ii=h(),_l=m("div"),vn=m("label"),Tt=m("input"),Oi=S(" Enable price fetch from remote server"),Ri=h(),gt&>.c(),Li=h(),dl=m("div"),Fi=S("Security"),qi=m("br"),Bi=h(),Nt=m("select"),Tl=m("option"),Tl.textContent="None",Nl=m("option"),Nl.textContent="Only configuration",Al=m("option"),Al.textContent="Everything",Ui=h(),kt&&kt.c(),ji=h(),ke=m("div"),mt=m("strong"),mt.textContent="Meter",Wl=h(),zl=m("a"),ie(Pl.$$.fragment),El=h(),Gl=m("input"),Hi=h(),ll=m("div"),Wi=m("span"),Wi.textContent="Buffer size",Io=h(),Ds=m("span"),Ds.textContent="Serial conf.",Oo=h(),pi=m("label"),Ht=m("input"),Ro=S(" inverted"),Lo=h(),Dl=m("div"),nl=m("select"),Il=m("option"),Fo=S("Autodetect");for(let O=0;O<7;O+=1)yi[O].c();qo=h(),pt=m("select"),Ol=m("option"),Bo=S("-"),hn=m("option"),hn.textContent="7N1",bn=m("option"),bn.textContent="8N1",gn=m("option"),gn.textContent="7E1",kn=m("option"),kn.textContent="8E1",Uo=h(),At=m("input"),jo=h(),Vl=m("div"),Ho=S("Voltage"),Wo=m("br"),zo=h(),il=m("select"),wn=m("option"),wn.textContent="400V (TN)",yn=m("option"),yn.textContent="230V (IT/TT)",Go=h(),Cn=m("div"),Kl=m("div"),Vo=S("Main fuse"),Ko=m("br"),Yo=h(),Mn=m("label"),Wt=m("input"),Qo=h(),Yi=m("span"),Yi.textContent="A",Xo=h(),Yl=m("div"),Zo=S("Production"),Jo=m("br"),xo=h(),$n=m("label"),zt=m("input"),er=h(),Qi=m("span"),Qi.textContent="kWp",tr=h(),Is=m("div"),lr=h(),Ql=m("div"),Xi=m("label"),Gt=m("input"),nr=S(" Meter is encrypted"),ir=h(),wt&&wt.c(),sr=h(),yt&&yt.c(),Os=h(),Zi=m("label"),Vt=m("input"),or=S(" Multipliers"),rr=h(),Ct&&Ct.c(),ar=h(),tt=m("div"),Ji=m("strong"),Ji.textContent="WiFi",ur=h(),Sn=m("a"),ie(Tn.$$.fragment),fr=h(),_i=m("input"),cr=h(),Xl=m("div"),mr=S("SSID"),pr=m("br"),_r=h(),vl=m("input"),dr=h(),Zl=m("div"),vr=S("Password"),hr=m("br"),br=h(),hl=m("input"),gr=h(),Nn=m("div"),Jl=m("div"),kr=S("Power saving"),wr=m("br"),yr=h(),Ot=m("select"),An=m("option"),An.textContent="Default",Pn=m("option"),Pn.textContent="Off",En=m("option"),En.textContent="Minimum",Dn=m("option"),Dn.textContent="Maximum",Cr=h(),xl=m("div"),Mr=S("Power"),$r=m("br"),Sr=h(),In=m("div"),Rt=m("input"),Tr=h(),xi=m("span"),xi.textContent="dBm",Nr=h(),es=m("div"),ts=m("label"),Kt=m("input"),Ar=S(" Auto reboot on connection problem"),Pr=h(),ls=m("div"),ns=m("label"),Yt=m("input"),Er=S(" Allow 802.11b legacy rates"),Dr=h(),ut=m("div"),is=m("strong"),is.textContent="Network",Ir=h(),On=m("a"),ie(Rn.$$.fragment),Or=h(),en=m("div"),Rr=S("IP"),Lr=m("br"),Fr=h(),Rl=m("div"),sl=m("select"),Ln=m("option"),Ln.textContent="DHCP",Fn=m("option"),Fn.textContent="Static",qr=h(),Pt=m("input"),Br=h(),Et=m("select"),ie(qn.$$.fragment),Ur=h(),Mt&&Mt.c(),Rs=h(),us=m("div"),fs=m("label"),Qt=m("input"),jr=S(" enable mDNS"),Hr=h(),di=m("input"),Wr=h(),Ll=m("div"),zr=S("NTP "),vi=m("label"),Xt=m("input"),Gr=S(" obtain from DHCP"),Vr=m("br"),Kr=h(),cs=m("div"),bl=m("input"),Yr=h(),Ke=m("div"),ms=m("strong"),ms.textContent="MQTT",Qr=h(),Bn=m("a"),ie(Un.$$.fragment),Xr=h(),hi=m("input"),Zr=h(),ol=m("div"),Jr=S(`Server - `),$t&&$t.c(),Ls=h(),xr=m("br"),ea=h(),jn=m("div"),gl=m("input"),ta=h(),Zt=m("input"),la=h(),lt&<.c(),Fs=h(),tn=m("div"),na=S("Username"),ia=m("br"),sa=h(),kl=m("input"),oa=h(),ln=m("div"),ra=S("Password"),aa=m("br"),ua=h(),wl=m("input"),fa=h(),Hn=m("div"),Wn=m("div"),ca=S("Client ID"),ma=m("br"),pa=h(),yl=m("input"),_a=h(),zn=m("div"),da=S("Payload"),va=m("br"),ha=h(),bt=m("select"),Gn=m("option"),Gn.textContent="JSON",Vn=m("option"),Vn.textContent="Raw (minimal)",Kn=m("option"),Kn.textContent="Raw (full)",Yn=m("option"),Yn.textContent="Domoticz",Qn=m("option"),Qn.textContent="HomeAssistant",Xn=m("option"),Xn.textContent="HEX dump",ba=h(),nn=m("div"),ga=S("Publish topic"),ka=m("br"),wa=h(),Cl=m("input"),ya=h(),nt&&nt.c(),qs=h(),it&&it.c(),Bs=h(),st&&st.c(),Us=h(),ot&&ot.c(),Hs=h(),rl=m("div"),ps=m("strong"),ps.textContent="User interface",Ca=h(),Zn=m("a"),ie(Jn.$$.fragment),Ma=h(),bi=m("input"),$a=h(),gi=m("div");for(let O=0;O<_t.length;O+=1)_t[O].c();Sa=h(),rt&&rt.c(),Ws=h(),Dt=m("div"),_s=m("strong"),_s.textContent="Debugging",Ta=h(),xn=m("a"),ie(ei.$$.fragment),Na=h(),ki=m("input"),Aa=h(),ds=m("div"),vs=m("label"),Jt=m("input"),Pa=S(" Enable debugging"),Ea=h(),St&&St.c(),Da=h(),Fl=m("div"),zs=m("div"),ti=m("button"),ti.textContent="Factory reset",Ia=h(),hs=m("div"),li=m("button"),li.textContent="Reboot",Oa=h(),bs=m("div"),bs.innerHTML='',Gs=h(),ie(sn.$$.fragment),Vs=h(),ie(on.$$.fragment),Ks=h(),ie(rn.$$.fragment),Ys=h(),ie(an.$$.fragment),r(i,"class","text-sm"),r(u,"href",Bt("General-configuration")),r(u,"target","_blank"),r(u,"class","float-right"),r(f,"type","hidden"),r(f,"name","g"),f.value="true",r(T,"name","gh"),r(T,"type","text"),r(T,"class","in-f w-full"),r(T,"pattern","[A-Za-z0-9-]+"),r(L,"name","gt"),r(L,"class","in-l w-full"),t[3].g.t===void 0&&et(()=>t[16].call(L)),r(b,"class","flex"),r(p,"class","my-1"),r(j,"type","hidden"),r(j,"name","p"),j.value="true",re.__value="10YNO-1--------2",re.value=re.__value,ue.__value="10YNO-2--------T",ue.value=ue.__value,we.__value="10YNO-3--------J",we.value=we.__value,me.__value="10YNO-4--------9",me.value=me.__value,Te.__value="10Y1001A1001A48H",Te.value=Te.__value,r(Z,"label","Norway"),Oe.__value="10Y1001A1001A44P",Oe.value=Oe.__value,He.__value="10Y1001A1001A45N",He.value=He.__value,ye.__value="10Y1001A1001A46L",ye.value=ye.__value,Ne.__value="10Y1001A1001A47J",Ne.value=Ne.__value,r(je,"label","Sweden"),$e.__value="10YDK-1--------W",$e.value=$e.__value,w.__value="10YDK-2--------M",w.value=w.__value,r(Re,"label","Denmark"),g.__value="10YAT-APG------L",g.value=g.__value,k.__value="10YBE----------2",k.value=k.__value,A.__value="10YCZ-CEPS-----N",A.value=A.__value,I.__value="10Y1001A1001A39I",I.value=I.__value,Q.__value="10YFI-1--------U",Q.value=Q.__value,J.__value="10YFR-RTE------C",J.value=J.__value,se.__value="10Y1001A1001A83F",se.value=se.__value,ce.__value="10YGB----------A",ce.value=ce.__value,ve.__value="10YLV-1001A00074",ve.value=ve.__value,Se.__value="10YLT-1001A0008Q",Se.value=Se.__value,oe.__value="10YNL----------L",oe.value=oe.__value,pe.__value="10YPL-AREA-----S",pe.value=pe.__value,Be.__value="10YCH-SWISSGRIDZ",Be.value=Be.__value,r(Y,"name","pr"),r(Y,"class","in-f w-full"),t[3].p.r===void 0&&et(()=>t[17].call(Y)),r(W,"class","w-full"),r(ct,"name","pc"),r(ct,"class","in-l"),t[3].p.c===void 0&&et(()=>t[18].call(ct)),r(V,"class","flex"),r(G,"class","my-1"),r(Ue,"name","pf"),r(Ue,"type","number"),r(Ue,"min","0.001"),r(Ue,"max","65"),r(Ue,"step","0.001"),r(Ue,"class","in-f tr w-full"),r(ht,"class","w-1/2"),r(Me,"name","pm"),r(Me,"type","number"),r(Me,"min","0.001"),r(Me,"max","1000"),r(Me,"step","0.001"),r(Me,"class","in-l tr w-full"),r(We,"class","w-1/2"),r(jt,"class","flex"),r(pl,"class","my-1"),r(Tt,"type","checkbox"),r(Tt,"name","pe"),Tt.__value="true",Tt.value=Tt.__value,r(Tt,"class","rounded mb-1"),r(_l,"class","my-1"),Tl.__value=0,Tl.value=Tl.__value,Nl.__value=1,Nl.value=Nl.__value,Al.__value=2,Al.value=Al.__value,r(Nt,"name","gs"),r(Nt,"class","in-s"),t[3].g.s===void 0&&et(()=>t[23].call(Nt)),r(dl,"class","my-1"),r(n,"class","cnt"),r(mt,"class","text-sm"),r(zl,"href",Bt("Meter-configuration")),r(zl,"target","_blank"),r(zl,"class","float-right"),r(Gl,"type","hidden"),r(Gl,"name","m"),Gl.value="true",r(Wi,"class","float-right"),r(Ht,"name","mi"),Ht.__value="true",Ht.value=Ht.__value,r(Ht,"type","checkbox"),r(Ht,"class","rounded mb-1"),r(pi,"class","mt-2 ml-3 whitespace-nowrap"),Il.__value=0,Il.value=Il.__value,Il.disabled=zi=t[3].m.b!=0,r(nl,"name","mb"),r(nl,"class","in-f tr w-1/2"),t[3].m.b===void 0&&et(()=>t[27].call(nl)),Ol.__value=0,Ol.value=Ol.__value,Ol.disabled=Gi=t[3].m.b!=0,hn.__value=2,hn.value=hn.__value,bn.__value=3,bn.value=bn.__value,gn.__value=10,gn.value=gn.__value,kn.__value=11,kn.value=kn.__value,r(pt,"name","mp"),r(pt,"class","in-m"),pt.disabled=Vi=t[3].m.b==0,t[3].m.p===void 0&&et(()=>t[28].call(pt)),r(At,"name","ms"),r(At,"type","number"),r(At,"min",64),r(At,"max",Ki=t[0].chip=="esp8266"?t[3].i.h.p==3||t[3].i.h.p==113?512:128:4096),r(At,"step",64),r(At,"class","in-l tr w-1/2"),r(Dl,"class","flex w-full"),r(ll,"class","my-1"),wn.__value=2,wn.value=wn.__value,yn.__value=1,yn.value=yn.__value,r(il,"name","md"),r(il,"class","in-s"),t[3].m.d===void 0&&et(()=>t[30].call(il)),r(Vl,"class","my-1"),r(Wt,"name","mf"),r(Wt,"type","number"),r(Wt,"min","5"),r(Wt,"max","65535"),r(Wt,"class","in-f tr w-full"),r(Yi,"class","in-post"),r(Mn,"class","flex"),r(Kl,"class","mx-1"),r(zt,"name","mr"),r(zt,"type","number"),r(zt,"min","0"),r(zt,"max","65535"),r(zt,"class","in-f tr w-full"),r(Qi,"class","in-post"),r($n,"class","flex"),r(Yl,"class","mx-1"),r(Cn,"class","my-1 flex"),r(Is,"class","my-1"),r(Gt,"type","checkbox"),r(Gt,"name","me"),Gt.__value="true",Gt.value=Gt.__value,r(Gt,"class","rounded mb-1"),r(Ql,"class","my-1"),r(Vt,"type","checkbox"),r(Vt,"name","mm"),Vt.__value="true",Vt.value=Vt.__value,r(Vt,"class","rounded mb-1"),r(ke,"class","cnt"),r(Ji,"class","text-sm"),r(Sn,"href",Bt("WiFi-configuration")),r(Sn,"target","_blank"),r(Sn,"class","float-right"),r(_i,"type","hidden"),r(_i,"name","w"),_i.value="true",r(vl,"name","ws"),r(vl,"type","text"),r(vl,"class","in-s"),r(Xl,"class","my-1"),r(hl,"name","wp"),r(hl,"type","password"),r(hl,"class","in-s"),r(Zl,"class","my-1"),An.__value=255,An.value=An.__value,Pn.__value=0,Pn.value=Pn.__value,En.__value=1,En.value=En.__value,Dn.__value=2,Dn.value=Dn.__value,r(Ot,"name","wz"),r(Ot,"class","in-s"),t[3].w.z===void 0&&et(()=>t[43].call(Ot)),r(Jl,"class","w-1/2"),r(Rt,"name","ww"),r(Rt,"type","number"),r(Rt,"min","0"),r(Rt,"max","20.5"),r(Rt,"step","0.5"),r(Rt,"class","in-f tr w-full"),r(xi,"class","in-post"),r(In,"class","flex"),r(xl,"class","ml-2 w-1/2"),r(Nn,"class","my-1 flex"),r(Kt,"type","checkbox"),r(Kt,"name","wa"),Kt.__value="true",Kt.value=Kt.__value,r(Kt,"class","rounded mb-1"),r(es,"class","my-3"),r(Yt,"type","checkbox"),r(Yt,"name","wb"),Yt.__value="true",Yt.value=Yt.__value,r(Yt,"class","rounded mb-1"),r(ls,"class","my-3"),r(tt,"class","cnt"),r(is,"class","text-sm"),r(On,"href",Bt("Network-configuration")),r(On,"target","_blank"),r(On,"class","float-right"),Ln.__value="dhcp",Ln.value=Ln.__value,Fn.__value="static",Fn.value=Fn.__value,r(sl,"name","nm"),r(sl,"class","in-f"),t[3].n.m===void 0&&et(()=>t[47].call(sl)),r(Pt,"name","ni"),r(Pt,"type","text"),r(Pt,"class","in-m w-full"),Pt.disabled=ss=t[3].n.m=="dhcp",Pt.required=os=t[3].n.m=="static",r(Et,"name","ns"),r(Et,"class","in-l"),Et.disabled=rs=t[3].n.m=="dhcp",Et.required=as=t[3].n.m=="static",t[3].n.s===void 0&&et(()=>t[49].call(Et)),r(Rl,"class","flex"),r(en,"class","my-1"),r(Qt,"name","nd"),Qt.__value="true",Qt.value=Qt.__value,r(Qt,"type","checkbox"),r(Qt,"class","rounded mb-1"),r(us,"class","my-1"),r(di,"type","hidden"),r(di,"name","ntp"),di.value="true",r(Xt,"name","ntpd"),Xt.__value="true",Xt.value=Xt.__value,r(Xt,"type","checkbox"),r(Xt,"class","rounded mb-1"),r(vi,"class","ml-4"),r(bl,"name","ntph"),r(bl,"type","text"),r(bl,"class","in-s"),r(cs,"class","flex"),r(Ll,"class","my-1"),r(ut,"class","cnt"),r(ms,"class","text-sm"),r(Bn,"href",Bt("MQTT-configuration")),r(Bn,"target","_blank"),r(Bn,"class","float-right"),r(hi,"type","hidden"),r(hi,"name","q"),hi.value="true",r(gl,"name","qh"),r(gl,"type","text"),r(gl,"class","in-f w-3/4"),r(Zt,"name","qp"),r(Zt,"type","number"),r(Zt,"min","1024"),r(Zt,"max","65535"),r(Zt,"class","in-l tr w-1/4"),r(jn,"class","flex"),r(ol,"class","my-1"),r(kl,"name","qu"),r(kl,"type","text"),r(kl,"class","in-s"),r(tn,"class","my-1"),r(wl,"name","qa"),r(wl,"type","password"),r(wl,"class","in-s"),r(ln,"class","my-1"),r(yl,"name","qc"),r(yl,"type","text"),r(yl,"class","in-f w-full"),Gn.__value=0,Gn.value=Gn.__value,Vn.__value=1,Vn.value=Vn.__value,Kn.__value=2,Kn.value=Kn.__value,Yn.__value=3,Yn.value=Yn.__value,Qn.__value=4,Qn.value=Qn.__value,Xn.__value=255,Xn.value=Xn.__value,r(bt,"name","qm"),r(bt,"class","in-l"),t[3].q.m===void 0&&et(()=>t[62].call(bt)),r(Hn,"class","my-1 flex"),r(Cl,"name","qb"),r(Cl,"type","text"),r(Cl,"class","in-s"),r(nn,"class","my-1"),r(Ke,"class","cnt"),r(ps,"class","text-sm"),r(Zn,"href",Bt("User-interface")),r(Zn,"target","_blank"),r(Zn,"class","float-right"),r(bi,"type","hidden"),r(bi,"name","u"),bi.value="true",r(gi,"class","flex flex-wrap"),r(rl,"class","cnt"),r(_s,"class","text-sm"),r(xn,"href","https://amsleser.no/blog/post/24-telnet-debug"),r(xn,"target","_blank"),r(xn,"class","float-right"),r(ki,"type","hidden"),r(ki,"name","d"),ki.value="true",r(Jt,"type","checkbox"),r(Jt,"name","ds"),Jt.__value="true",Jt.value=Jt.__value,r(Jt,"class","rounded mb-1"),r(ds,"class","mt-3"),r(Dt,"class","cnt"),r(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),r(ti,"type","button"),r(ti,"class","py-2 px-4 rounded bg-red-500 text-white ml-2"),r(li,"type","button"),r(li,"class","py-2 px-4 rounded bg-yellow-500 text-white"),r(hs,"class","text-center"),r(bs,"class","text-right"),r(Fl,"class","grid grid-cols-3"),r(e,"autocomplete","off")},m(O,ae){M(O,e,ae),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),le(a,u,null),s(n,c),s(n,f),s(n,_),s(n,p),s(p,b),s(b,v),s(v,d),s(v,$),s(v,y),s(v,T),te(T,t[3].g.h),s(b,N),s(b,E),s(E,B),s(E,P),s(E,R),s(E,L),le(F,L,null),qe(L,t[3].g.t,!0),s(n,x),s(n,j),s(n,z),s(n,G),s(G,V),s(V,W),s(W,U),s(W,K),s(W,H),s(W,Y),s(Y,Z),s(Z,re),s(Z,ue),s(Z,we),s(Z,me),s(Z,Te),s(Y,je),s(je,Oe),s(je,He),s(je,ye),s(je,Ne),s(Y,Re),s(Re,$e),s(Re,w),s(Y,g),s(Y,k),s(Y,A),s(Y,I),s(Y,Q),s(Y,J),s(Y,se),s(Y,ce),s(Y,ve),s(Y,Se),s(Y,oe),s(Y,pe),s(Y,Be),qe(Y,t[3].p.r,!0),s(V,_e),s(V,Ce),s(Ce,vt),s(Ce,Hl),s(Ce,tl),s(Ce,ct);for(let ft=0;ft<4;ft+=1)wi[ft]&&wi[ft].m(ct,null);qe(ct,t[3].p.c,!0),s(n,Sl),s(n,pl),s(pl,jt),s(jt,ht),s(ht,Ye),s(ht,Qe),s(ht,Xe),s(ht,Ue),te(Ue,t[3].p.f),s(jt,Ze),s(jt,We),s(We,Je),s(We,xe),s(We,de),s(We,Me),te(Me,t[3].p.m),s(n,Ii),s(n,_l),s(_l,vn),s(vn,Tt),Tt.checked=t[3].p.e,s(vn,Oi),s(_l,Ri),gt&>.m(_l,null),s(n,Li),s(n,dl),s(dl,Fi),s(dl,qi),s(dl,Bi),s(dl,Nt),s(Nt,Tl),s(Nt,Nl),s(Nt,Al),qe(Nt,t[3].g.s,!0),s(n,Ui),kt&&kt.m(n,null),s(l,ji),s(l,ke),s(ke,mt),s(ke,Wl),s(ke,zl),le(Pl,zl,null),s(ke,El),s(ke,Gl),s(ke,Hi),s(ke,ll),s(ll,Wi),s(ll,Io),s(ll,Ds),s(ll,Oo),s(ll,pi),s(pi,Ht),Ht.checked=t[3].m.i,s(pi,Ro),s(ll,Lo),s(ll,Dl),s(Dl,nl),s(nl,Il),s(Il,Fo);for(let ft=0;ft<7;ft+=1)yi[ft]&&yi[ft].m(nl,null);qe(nl,t[3].m.b,!0),s(Dl,qo),s(Dl,pt),s(pt,Ol),s(Ol,Bo),s(pt,hn),s(pt,bn),s(pt,gn),s(pt,kn),qe(pt,t[3].m.p,!0),s(Dl,Uo),s(Dl,At),te(At,t[3].m.s),s(ke,jo),s(ke,Vl),s(Vl,Ho),s(Vl,Wo),s(Vl,zo),s(Vl,il),s(il,wn),s(il,yn),qe(il,t[3].m.d,!0),s(ke,Go),s(ke,Cn),s(Cn,Kl),s(Kl,Vo),s(Kl,Ko),s(Kl,Yo),s(Kl,Mn),s(Mn,Wt),te(Wt,t[3].m.f),s(Mn,Qo),s(Mn,Yi),s(Cn,Xo),s(Cn,Yl),s(Yl,Zo),s(Yl,Jo),s(Yl,xo),s(Yl,$n),s($n,zt),te(zt,t[3].m.r),s($n,er),s($n,Qi),s(ke,tr),s(ke,Is),s(ke,lr),s(ke,Ql),s(Ql,Xi),s(Xi,Gt),Gt.checked=t[3].m.e.e,s(Xi,nr),s(Ql,ir),wt&&wt.m(Ql,null),s(ke,sr),yt&&yt.m(ke,null),s(ke,Os),s(ke,Zi),s(Zi,Vt),Vt.checked=t[3].m.m.e,s(Zi,or),s(ke,rr),Ct&&Ct.m(ke,null),s(l,ar),s(l,tt),s(tt,Ji),s(tt,ur),s(tt,Sn),le(Tn,Sn,null),s(tt,fr),s(tt,_i),s(tt,cr),s(tt,Xl),s(Xl,mr),s(Xl,pr),s(Xl,_r),s(Xl,vl),te(vl,t[3].w.s),s(tt,dr),s(tt,Zl),s(Zl,vr),s(Zl,hr),s(Zl,br),s(Zl,hl),te(hl,t[3].w.p),s(tt,gr),s(tt,Nn),s(Nn,Jl),s(Jl,kr),s(Jl,wr),s(Jl,yr),s(Jl,Ot),s(Ot,An),s(Ot,Pn),s(Ot,En),s(Ot,Dn),qe(Ot,t[3].w.z,!0),s(Nn,Cr),s(Nn,xl),s(xl,Mr),s(xl,$r),s(xl,Sr),s(xl,In),s(In,Rt),te(Rt,t[3].w.w),s(In,Tr),s(In,xi),s(tt,Nr),s(tt,es),s(es,ts),s(ts,Kt),Kt.checked=t[3].w.a,s(ts,Ar),s(tt,Pr),s(tt,ls),s(ls,ns),s(ns,Yt),Yt.checked=t[3].w.b,s(ns,Er),s(l,Dr),s(l,ut),s(ut,is),s(ut,Ir),s(ut,On),le(Rn,On,null),s(ut,Or),s(ut,en),s(en,Rr),s(en,Lr),s(en,Fr),s(en,Rl),s(Rl,sl),s(sl,Ln),s(sl,Fn),qe(sl,t[3].n.m,!0),s(Rl,qr),s(Rl,Pt),te(Pt,t[3].n.i),s(Rl,Br),s(Rl,Et),le(qn,Et,null),qe(Et,t[3].n.s,!0),s(ut,Ur),Mt&&Mt.m(ut,null),s(ut,Rs),s(ut,us),s(us,fs),s(fs,Qt),Qt.checked=t[3].n.d,s(fs,jr),s(ut,Hr),s(ut,di),s(ut,Wr),s(ut,Ll),s(Ll,zr),s(Ll,vi),s(vi,Xt),Xt.checked=t[3].n.h,s(vi,Gr),s(Ll,Vr),s(Ll,Kr),s(Ll,cs),s(cs,bl),te(bl,t[3].n.n1),s(l,Yr),s(l,Ke),s(Ke,ms),s(Ke,Qr),s(Ke,Bn),le(Un,Bn,null),s(Ke,Xr),s(Ke,hi),s(Ke,Zr),s(Ke,ol),s(ol,Jr),$t&&$t.m(ol,null),s(ol,Ls),s(ol,xr),s(ol,ea),s(ol,jn),s(jn,gl),te(gl,t[3].q.h),s(jn,ta),s(jn,Zt),te(Zt,t[3].q.p),s(Ke,la),lt&<.m(Ke,null),s(Ke,Fs),s(Ke,tn),s(tn,na),s(tn,ia),s(tn,sa),s(tn,kl),te(kl,t[3].q.u),s(Ke,oa),s(Ke,ln),s(ln,ra),s(ln,aa),s(ln,ua),s(ln,wl),te(wl,t[3].q.a),s(Ke,fa),s(Ke,Hn),s(Hn,Wn),s(Wn,ca),s(Wn,ma),s(Wn,pa),s(Wn,yl),te(yl,t[3].q.c),s(Hn,_a),s(Hn,zn),s(zn,da),s(zn,va),s(zn,ha),s(zn,bt),s(bt,Gn),s(bt,Vn),s(bt,Kn),s(bt,Yn),s(bt,Qn),s(bt,Xn),qe(bt,t[3].q.m,!0),s(Ke,ba),s(Ke,nn),s(nn,ga),s(nn,ka),s(nn,wa),s(nn,Cl),te(Cl,t[3].q.b),s(l,ya),nt&&nt.m(l,null),s(l,qs),it&&it.m(l,null),s(l,Bs),st&&st.m(l,null),s(l,Us),ot&&ot.m(l,null),s(l,Hs),s(l,rl),s(rl,ps),s(rl,Ca),s(rl,Zn),le(Jn,Zn,null),s(rl,Ma),s(rl,bi),s(rl,$a),s(rl,gi);for(let ft=0;ft<_t.length;ft+=1)_t[ft]&&_t[ft].m(gi,null);s(l,Sa),rt&&rt.m(l,null),s(l,Ws),s(l,Dt),s(Dt,_s),s(Dt,Ta),s(Dt,xn),le(ei,xn,null),s(Dt,Na),s(Dt,ki),s(Dt,Aa),s(Dt,ds),s(ds,vs),s(vs,Jt),Jt.checked=t[3].d.s,s(vs,Pa),s(Dt,Ea),St&&St.m(Dt,null),s(e,Da),s(e,Fl),s(Fl,zs),s(zs,ti),s(Fl,Ia),s(Fl,hs),s(hs,li),s(Fl,Oa),s(Fl,bs),M(O,Gs,ae),le(sn,O,ae),M(O,Vs,ae),le(on,O,ae),M(O,Ks,ae),le(rn,O,ae),M(O,Ys,ae),le(an,O,ae),Lt=!0,Qs||(Ra=[ee(T,"input",t[15]),ee(L,"change",t[16]),ee(Y,"change",t[17]),ee(ct,"change",t[18]),ee(Ue,"input",t[19]),ee(Me,"input",t[20]),ee(Tt,"change",t[21]),ee(Nt,"change",t[23]),ee(Ht,"change",t[26]),ee(nl,"change",t[27]),ee(pt,"change",t[28]),ee(At,"input",t[29]),ee(il,"change",t[30]),ee(Wt,"input",t[31]),ee(zt,"input",t[32]),ee(Gt,"change",t[33]),ee(Vt,"change",t[36]),ee(vl,"input",t[41]),ee(hl,"input",t[42]),ee(Ot,"change",t[43]),ee(Rt,"input",t[44]),ee(Kt,"change",t[45]),ee(Yt,"change",t[46]),ee(sl,"change",t[47]),ee(Pt,"input",t[48]),ee(Et,"change",t[49]),ee(Qt,"change",t[53]),ee(Xt,"change",t[54]),ee(bl,"input",t[55]),ee(gl,"input",t[57]),ee(Zt,"input",t[58]),ee(kl,"input",t[59]),ee(wl,"input",t[60]),ee(yl,"input",t[61]),ee(bt,"change",t[62]),ee(Cl,"input",t[63]),ee(Jt,"change",t[93]),ee(ti,"click",t[8]),ee(li,"click",t[10]),ee(e,"submit",Ps(t[9]))],Qs=!0)},p(O,ae){if(ae[0]&8&&T.value!==O[3].g.h&&te(T,O[3].g.h),ae[0]&8&&qe(L,O[3].g.t),ae[0]&8&&qe(Y,O[3].p.r),ae[0]&8&&qe(ct,O[3].p.c),ae[0]&8&&he(Ue.value)!==O[3].p.f&&te(Ue,O[3].p.f),ae[0]&8&&he(Me.value)!==O[3].p.m&&te(Me,O[3].p.m),ae[0]&8&&(Tt.checked=O[3].p.e),O[3].p.e&&O[0].chip!="esp8266"?gt?gt.p(O,ae):(gt=pf(O),gt.c(),gt.m(_l,null)):gt&&(gt.d(1),gt=null),ae[0]&8&&qe(Nt,O[3].g.s),O[3].g.s>0?kt?kt.p(O,ae):(kt=_f(O),kt.c(),kt.m(n,null)):kt&&(kt.d(1),kt=null),ae[0]&8&&(Ht.checked=O[3].m.i),(!Lt||ae[0]&8&&zi!==(zi=O[3].m.b!=0))&&(Il.disabled=zi),ae[0]&8&&qe(nl,O[3].m.b),(!Lt||ae[0]&8&&Gi!==(Gi=O[3].m.b!=0))&&(Ol.disabled=Gi),(!Lt||ae[0]&8&&Vi!==(Vi=O[3].m.b==0))&&(pt.disabled=Vi),ae[0]&8&&qe(pt,O[3].m.p),(!Lt||ae[0]&9&&Ki!==(Ki=O[0].chip=="esp8266"?O[3].i.h.p==3||O[3].i.h.p==113?512:128:4096))&&r(At,"max",Ki),ae[0]&8&&he(At.value)!==O[3].m.s&&te(At,O[3].m.s),ae[0]&8&&qe(il,O[3].m.d),ae[0]&8&&he(Wt.value)!==O[3].m.f&&te(Wt,O[3].m.f),ae[0]&8&&he(zt.value)!==O[3].m.r&&te(zt,O[3].m.r),ae[0]&8&&(Gt.checked=O[3].m.e.e),O[3].m.e.e?wt?wt.p(O,ae):(wt=df(O),wt.c(),wt.m(Ql,null)):wt&&(wt.d(1),wt=null),O[3].m.e.e?yt?yt.p(O,ae):(yt=vf(O),yt.c(),yt.m(ke,Os)):yt&&(yt.d(1),yt=null),ae[0]&8&&(Vt.checked=O[3].m.m.e),O[3].m.m.e?Ct?Ct.p(O,ae):(Ct=hf(O),Ct.c(),Ct.m(ke,null)):Ct&&(Ct.d(1),Ct=null),ae[0]&8&&vl.value!==O[3].w.s&&te(vl,O[3].w.s),ae[0]&8&&hl.value!==O[3].w.p&&te(hl,O[3].w.p),ae[0]&8&&qe(Ot,O[3].w.z),ae[0]&8&&he(Rt.value)!==O[3].w.w&&te(Rt,O[3].w.w),ae[0]&8&&(Kt.checked=O[3].w.a),ae[0]&8&&(Yt.checked=O[3].w.b),ae[0]&8&&qe(sl,O[3].n.m),(!Lt||ae[0]&8&&ss!==(ss=O[3].n.m=="dhcp"))&&(Pt.disabled=ss),(!Lt||ae[0]&8&&os!==(os=O[3].n.m=="static"))&&(Pt.required=os),ae[0]&8&&Pt.value!==O[3].n.i&&te(Pt,O[3].n.i),(!Lt||ae[0]&8&&rs!==(rs=O[3].n.m=="dhcp"))&&(Et.disabled=rs),(!Lt||ae[0]&8&&as!==(as=O[3].n.m=="static"))&&(Et.required=as),ae[0]&8&&qe(Et,O[3].n.s),O[3].n.m=="static"?Mt?Mt.p(O,ae):(Mt=bf(O),Mt.c(),Mt.m(ut,Rs)):Mt&&(Mt.d(1),Mt=null),ae[0]&8&&(Qt.checked=O[3].n.d),ae[0]&8&&(Xt.checked=O[3].n.h),ae[0]&8&&bl.value!==O[3].n.n1&&te(bl,O[3].n.n1),O[0].chip!="esp8266"?$t?$t.p(O,ae):($t=gf(O),$t.c(),$t.m(ol,Ls)):$t&&($t.d(1),$t=null),ae[0]&8&&gl.value!==O[3].q.h&&te(gl,O[3].q.h),ae[0]&8&&he(Zt.value)!==O[3].q.p&&te(Zt,O[3].q.p),O[3].q.s.e?lt?(lt.p(O,ae),ae[0]&8&&D(lt,1)):(lt=kf(O),lt.c(),D(lt,1),lt.m(Ke,Fs)):lt&&(De(),q(lt,1,1,()=>{lt=null}),Ie()),ae[0]&8&&kl.value!==O[3].q.u&&te(kl,O[3].q.u),ae[0]&8&&wl.value!==O[3].q.a&&te(wl,O[3].q.a),ae[0]&8&&yl.value!==O[3].q.c&&te(yl,O[3].q.c),ae[0]&8&&qe(bt,O[3].q.m),ae[0]&8&&Cl.value!==O[3].q.b&&te(Cl,O[3].q.b),O[3].q.m==3?nt?(nt.p(O,ae),ae[0]&8&&D(nt,1)):(nt=wf(O),nt.c(),D(nt,1),nt.m(l,qs)):nt&&(De(),q(nt,1,1,()=>{nt=null}),Ie()),O[3].q.m==4?it?(it.p(O,ae),ae[0]&8&&D(it,1)):(it=yf(O),it.c(),D(it,1),it.m(l,Bs)):it&&(De(),q(it,1,1,()=>{it=null}),Ie()),O[3].c.es!=null?st?(st.p(O,ae),ae[0]&8&&D(st,1)):(st=Cf(O),st.c(),D(st,1),st.m(l,Us)):st&&(De(),q(st,1,1,()=>{st=null}),Ie()),ae[0]&8&&(js=O[3].p.r.startsWith("10YNO")||O[3].p.r=="10Y1001A1001A48H"),js?ot?(ot.p(O,ae),ae[0]&8&&D(ot,1)):(ot=Sf(O),ot.c(),D(ot,1),ot.m(l,Hs)):ot&&(De(),q(ot,1,1,()=>{ot=null}),Ie()),ae[0]&136){ni=O[7];let Ft;for(Ft=0;Ft20||O[0].chip=="esp8266"?rt?(rt.p(O,ae),ae[0]&1&&D(rt,1)):(rt=Af(O),rt.c(),D(rt,1),rt.m(l,Ws)):rt&&(De(),q(rt,1,1,()=>{rt=null}),Ie()),ae[0]&8&&(Jt.checked=O[3].d.s),O[3].d.s?St?St.p(O,ae):(St=Rf(O),St.c(),St.m(Dt,null)):St&&(St.d(1),St=null);const ft={};ae[0]&2&&(ft.active=O[1]),sn.$set(ft);const La={};ae[0]&4&&(La.active=O[2]),on.$set(La);const Fa={};ae[0]&16&&(Fa.active=O[4]),rn.$set(Fa);const qa={};ae[0]&32&&(qa.active=O[5]),an.$set(qa)},i(O){Lt||(D(a.$$.fragment,O),D(F.$$.fragment,O),D(Pl.$$.fragment,O),D(Tn.$$.fragment,O),D(Rn.$$.fragment,O),D(qn.$$.fragment,O),D(Un.$$.fragment,O),D(lt),D(nt),D(it),D(st),D(ot),D(Jn.$$.fragment,O),D(rt),D(ei.$$.fragment,O),D(sn.$$.fragment,O),D(on.$$.fragment,O),D(rn.$$.fragment,O),D(an.$$.fragment,O),Lt=!0)},o(O){q(a.$$.fragment,O),q(F.$$.fragment,O),q(Pl.$$.fragment,O),q(Tn.$$.fragment,O),q(Rn.$$.fragment,O),q(qn.$$.fragment,O),q(Un.$$.fragment,O),q(lt),q(nt),q(it),q(st),q(ot),q(Jn.$$.fragment,O),q(rt),q(ei.$$.fragment,O),q(sn.$$.fragment,O),q(on.$$.fragment,O),q(rn.$$.fragment,O),q(an.$$.fragment,O),Lt=!1},d(O){O&&C(e),ne(a),ne(F),cl(wi,O),gt&>.d(),kt&&kt.d(),ne(Pl),cl(yi,O),wt&&wt.d(),yt&&yt.d(),Ct&&Ct.d(),ne(Tn),ne(Rn),ne(qn),Mt&&Mt.d(),ne(Un),$t&&$t.d(),lt&<.d(),nt&&nt.d(),it&&it.d(),st&&st.d(),ot&&ot.d(),ne(Jn),cl(_t,O),rt&&rt.d(),ne(ei),St&&St.d(),O&&C(Gs),ne(sn,O),O&&C(Vs),ne(on,O),O&&C(Ks),ne(rn,O),O&&C(Ys),ne(an,O),Qs=!1,ze(Ra)}}}async function Np(){await(await fetch("/reboot",{method:"POST"})).json()}function Ap(t,e,l){let{sysinfo:n={}}=e,i=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Reactive",key:"r"},{name:"Realtime",key:"c"},{name:"Peaks",key:"t"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"}],o=!0,u=!1,a={g:{t:"",h:"",s:0,u:"",p:""},m:{b:2400,p:11,i:!1,d:0,f:0,r:0,e:{e:!1,k:"",a:""},m:{e:!1,w:!1,v:!1,a:!1,c:!1}},w:{s:"",p:"",w:0,z:255,a:!0,b:!0},n:{m:"",i:"",s:"",g:"",d1:"",d2:"",d:!1,n1:"",n2:"",h:!1},q:{h:"",p:1883,u:"",a:"",b:"",s:{e:!1,c:!1,r:!0,k:!1}},o:{e:"",c:"",u1:"",u2:"",u3:""},t:{t:[0,0,0,0,0,0,0,0,0,0],h:1},p:{e:!1,t:"",r:"",c:"",m:1,f:null},d:{s:!1,t:!1,l:5},u:{i:0,e:0,v:0,a:0,r:0,c:0,t:0,p:0,d:0,m:0,s:0},i:{h:{p:null,u:!0},a:null,l:{p:null,i:!1},r:{r:null,g:null,b:null,i:!1},t:{d:null,a:null},v:{p:null,d:{v:null,g:null},o:null,m:null,b:null}},h:{t:"",h:"",n:""},c:{es:null}};$i.subscribe(ke=>{ke.version&&(l(3,a=ke),l(1,o=!1))}),Vm();let c=!1,f=!1;async function _(){if(confirm("Are you sure you want to factory reset the device?")){l(4,c=!0);const ke=new URLSearchParams;ke.append("perform","true");let Wl=await(await fetch("/reset",{method:"POST",body:ke})).json();l(4,c=!1),l(5,f=Wl.success)}}async function p(ke){l(2,u=!0);const mt=new FormData(ke.target),Wl=new URLSearchParams;for(let El of mt){const[Gl,Hi]=El;Wl.append(Gl,Hi)}let Pl=await(await fetch("/save",{method:"POST",body:Wl})).json();Ut.update(El=>(El.booting=Pl.reboot,El.ui=a.u,El)),l(2,u=!1),ai("/")}const b=function(){confirm("Are you sure you want to reboot the device?")&&(Ut.update(ke=>(ke.booting=!0,ke)),Np())};async function v(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("/mqtt-ca",{method:"POST"})).text(),$i.update(mt=>(mt.q.s.c=!1,mt)))}async function d(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("/mqtt-cert",{method:"POST"})).text(),$i.update(mt=>(mt.q.s.r=!1,mt)))}async function $(){confirm("Are you sure you want to delete key?")&&(await(await fetch("/mqtt-key",{method:"POST"})).text(),$i.update(mt=>(mt.q.s.k=!1,mt)))}const y=function(){a.q.s.e?a.q.p==1883&&l(3,a.q.p=8883,a):a.q.p==8883&&l(3,a.q.p=1883,a)};let T=44;function N(){a.g.h=this.value,l(3,a)}function E(){a.g.t=dt(this),l(3,a)}function B(){a.p.r=dt(this),l(3,a)}function P(){a.p.c=dt(this),l(3,a)}function R(){a.p.f=he(this.value),l(3,a)}function L(){a.p.m=he(this.value),l(3,a)}function F(){a.p.e=this.checked,l(3,a)}function x(){a.p.t=this.value,l(3,a)}function j(){a.g.s=dt(this),l(3,a)}function z(){a.g.u=this.value,l(3,a)}function G(){a.g.p=this.value,l(3,a)}function V(){a.m.i=this.checked,l(3,a)}function W(){a.m.b=dt(this),l(3,a)}function U(){a.m.p=dt(this),l(3,a)}function K(){a.m.s=he(this.value),l(3,a)}function H(){a.m.d=dt(this),l(3,a)}function Y(){a.m.f=he(this.value),l(3,a)}function Z(){a.m.r=he(this.value),l(3,a)}function re(){a.m.e.e=this.checked,l(3,a)}function ue(){a.m.e.k=this.value,l(3,a)}function we(){a.m.e.a=this.value,l(3,a)}function me(){a.m.m.e=this.checked,l(3,a)}function Te(){a.m.m.w=he(this.value),l(3,a)}function je(){a.m.m.v=he(this.value),l(3,a)}function Oe(){a.m.m.a=he(this.value),l(3,a)}function He(){a.m.m.c=he(this.value),l(3,a)}function ye(){a.w.s=this.value,l(3,a)}function Ne(){a.w.p=this.value,l(3,a)}function Re(){a.w.z=dt(this),l(3,a)}function $e(){a.w.w=he(this.value),l(3,a)}function w(){a.w.a=this.checked,l(3,a)}function g(){a.w.b=this.checked,l(3,a)}function k(){a.n.m=dt(this),l(3,a)}function A(){a.n.i=this.value,l(3,a)}function I(){a.n.s=dt(this),l(3,a)}function Q(){a.n.g=this.value,l(3,a)}function J(){a.n.d1=this.value,l(3,a)}function se(){a.n.d2=this.value,l(3,a)}function ce(){a.n.d=this.checked,l(3,a)}function ve(){a.n.h=this.checked,l(3,a)}function Se(){a.n.n1=this.value,l(3,a)}function oe(){a.q.s.e=this.checked,l(3,a)}function pe(){a.q.h=this.value,l(3,a)}function Be(){a.q.p=he(this.value),l(3,a)}function _e(){a.q.u=this.value,l(3,a)}function Ce(){a.q.a=this.value,l(3,a)}function vt(){a.q.c=this.value,l(3,a)}function Hl(){a.q.m=dt(this),l(3,a)}function tl(){a.q.b=this.value,l(3,a)}function ct(){a.o.e=this.value,l(3,a)}function Sl(){a.o.c=this.value,l(3,a)}function pl(){a.o.u1=this.value,l(3,a)}function jt(){a.o.u2=this.value,l(3,a)}function ht(){a.o.u3=this.value,l(3,a)}function Ye(){a.h.t=this.value,l(3,a)}function Qe(){a.h.h=this.value,l(3,a)}function Xe(){a.h.n=this.value,l(3,a)}function Ue(){a.c.es=this.checked,l(3,a)}function Ze(ke){a.t.t[ke]=he(this.value),l(3,a)}function We(){a.t.h=he(this.value),l(3,a)}function Je(ke){a.u[ke.key]=dt(this),l(3,a)}function xe(){a.i.h.u=this.checked,l(3,a)}function de(){a.i.h.p=dt(this),l(3,a)}function Me(){a.i.a=he(this.value),l(3,a)}function Ii(){a.i.l.i=this.checked,l(3,a)}function _l(){a.i.l.p=he(this.value),l(3,a)}function vn(){a.i.r.i=this.checked,l(3,a)}function Tt(){a.i.r.r=he(this.value),l(3,a)}function Oi(){a.i.r.g=he(this.value),l(3,a)}function Ri(){a.i.r.b=he(this.value),l(3,a)}function Li(){a.i.t.d=he(this.value),l(3,a)}function dl(){a.i.t.a=he(this.value),l(3,a)}function Fi(){a.i.v.p=he(this.value),l(3,a)}function qi(){a.i.v.d.v=he(this.value),l(3,a)}function Bi(){a.i.v.d.g=he(this.value),l(3,a)}function Nt(){a.i.v.o=he(this.value),l(3,a)}function Tl(){a.i.v.m=he(this.value),l(3,a)}function Nl(){a.i.v.b=he(this.value),l(3,a)}function Al(){a.d.s=this.checked,l(3,a)}function Ui(){a.d.t=this.checked,l(3,a)}function ji(){a.d.l=dt(this),l(3,a)}return t.$$set=ke=>{"sysinfo"in ke&&l(0,n=ke.sysinfo)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(6,T=n.chip=="esp8266"?16:n.chip=="esp32s2"?44:39)},[n,o,u,a,c,f,T,i,_,p,b,v,d,$,y,N,E,B,P,R,L,F,x,j,z,G,V,W,U,K,H,Y,Z,re,ue,we,me,Te,je,Oe,He,ye,Ne,Re,$e,w,g,k,A,I,Q,J,se,ce,ve,Se,oe,pe,Be,_e,Ce,vt,Hl,tl,ct,Sl,pl,jt,ht,Ye,Qe,Xe,Ue,Ze,We,Je,xe,de,Me,Ii,_l,vn,Tt,Oi,Ri,Li,dl,Fi,qi,Bi,Nt,Tl,Nl,Al,Ui,ji]}class Pp extends Ee{constructor(e){super(),Pe(this,e,Ap,Tp,Ae,{sysinfo:0},null,[-1,-1,-1,-1])}}function Ff(t,e,l){const n=t.slice();return n[20]=e[l],n}function Ep(t){let e=be(t[1].chip,t[1].board)+"",l;return{c(){l=S(e)},m(n,i){M(n,l,i)},p(n,i){i&2&&e!==(e=be(n[1].chip,n[1].board)+"")&&X(l,e)},d(n){n&&C(l)}}}function qf(t){let e,l,n=t[1].apmac+"",i,o,u,a,c,f,_,p,b,v=lu(t[1])+"",d,$,y=t[1].boot_reason+"",T,N,E=t[1].ex_cause+"",B,P,R;const L=[Ip,Dp],F=[];function x(j,z){return j[0].u>0?0:1}return c=x(t),f=F[c]=L[c](t),{c(){e=m("div"),l=S("AP MAC: "),i=S(n),o=h(),u=m("div"),a=S(`Last boot: - `),f.c(),_=h(),p=m("div"),b=S("Reason: "),d=S(v),$=S(" ("),T=S(y),N=S("/"),B=S(E),P=S(")"),r(e,"class","my-2"),r(u,"class","my-2"),r(p,"class","my-2")},m(j,z){M(j,e,z),s(e,l),s(e,i),M(j,o,z),M(j,u,z),s(u,a),F[c].m(u,null),M(j,_,z),M(j,p,z),s(p,b),s(p,d),s(p,$),s(p,T),s(p,N),s(p,B),s(p,P),R=!0},p(j,z){(!R||z&2)&&n!==(n=j[1].apmac+"")&&X(i,n);let G=c;c=x(j),c===G?F[c].p(j,z):(De(),q(F[G],1,1,()=>{F[G]=null}),Ie(),f=F[c],f?f.p(j,z):(f=F[c]=L[c](j),f.c()),D(f,1),f.m(u,null)),(!R||z&2)&&v!==(v=lu(j[1])+"")&&X(d,v),(!R||z&2)&&y!==(y=j[1].boot_reason+"")&&X(T,y),(!R||z&2)&&E!==(E=j[1].ex_cause+"")&&X(B,E)},i(j){R||(D(f),R=!0)},o(j){q(f),R=!1},d(j){j&&C(e),j&&C(o),j&&C(u),F[c].d(),j&&C(_),j&&C(p)}}}function Dp(t){let e;return{c(){e=S("-")},m(l,n){M(l,e,n)},p:fe,i:fe,o:fe,d(l){l&&C(e)}}}function Ip(t){let e,l;return e=new Xc({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.timestamp=new Date(new Date().getTime()-n[0].u*1e3)),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function Op(t){let e;return{c(){e=m("span"),e.textContent="Update consents",r(e,"class","btn-pri-sm")},m(l,n){M(l,e,n)},p:fe,d(l){l&&C(e)}}}function Bf(t){let e,l,n,i,o,u=Ns(t[1].meter.mfg)+"",a,c,f,_,p=(t[1].meter.model?t[1].meter.model:"unknown")+"",b,v,d,$,y=(t[1].meter.id?t[1].meter.id:"unknown")+"",T;return{c(){e=m("div"),l=m("strong"),l.textContent="Meter",n=h(),i=m("div"),o=S("Manufacturer: "),a=S(u),c=h(),f=m("div"),_=S("Model: "),b=S(p),v=h(),d=m("div"),$=S("ID: "),T=S(y),r(l,"class","text-sm"),r(i,"class","my-2"),r(f,"class","my-2"),r(d,"class","my-2"),r(e,"class","cnt")},m(N,E){M(N,e,E),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,c),s(e,f),s(f,_),s(f,b),s(e,v),s(e,d),s(d,$),s(d,T)},p(N,E){E&2&&u!==(u=Ns(N[1].meter.mfg)+"")&&X(a,u),E&2&&p!==(p=(N[1].meter.model?N[1].meter.model:"unknown")+"")&&X(b,p),E&2&&y!==(y=(N[1].meter.id?N[1].meter.id:"unknown")+"")&&X(T,y)},d(N){N&&C(e)}}}function Uf(t){let e,l,n,i,o,u=t[1].net.ip+"",a,c,f,_,p=t[1].net.mask+"",b,v,d,$,y=t[1].net.gw+"",T,N,E,B,P=t[1].net.dns1+"",R,L,F=t[1].net.dns2&&jf(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Network",n=h(),i=m("div"),o=S("IP: "),a=S(u),c=h(),f=m("div"),_=S("Mask: "),b=S(p),v=h(),d=m("div"),$=S("Gateway: "),T=S(y),N=h(),E=m("div"),B=S("DNS: "),R=S(P),L=h(),F&&F.c(),r(l,"class","text-sm"),r(i,"class","my-2"),r(f,"class","my-2"),r(d,"class","my-2"),r(E,"class","my-2"),r(e,"class","cnt")},m(x,j){M(x,e,j),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,c),s(e,f),s(f,_),s(f,b),s(e,v),s(e,d),s(d,$),s(d,T),s(e,N),s(e,E),s(E,B),s(E,R),s(E,L),F&&F.m(E,null)},p(x,j){j&2&&u!==(u=x[1].net.ip+"")&&X(a,u),j&2&&p!==(p=x[1].net.mask+"")&&X(b,p),j&2&&y!==(y=x[1].net.gw+"")&&X(T,y),j&2&&P!==(P=x[1].net.dns1+"")&&X(R,P),x[1].net.dns2?F?F.p(x,j):(F=jf(x),F.c(),F.m(E,null)):F&&(F.d(1),F=null)},d(x){x&&C(e),F&&F.d()}}}function jf(t){let e,l=t[1].net.dns2+"",n;return{c(){e=S("/ "),n=S(l)},m(i,o){M(i,e,o),M(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2+"")&&X(n,l)},d(i){i&&C(e),i&&C(n)}}}function Hf(t){let e,l,n,i=t[1].upgrade.t+"",o,u,a=t[1].version+"",c,f,_=t[1].upgrade.x+"",p,b,v=t[1].upgrade.e+"",d,$;return{c(){e=m("div"),l=m("div"),n=S("Previous upgrade attempt ("),o=S(i),u=S(") does not match current version ("),c=S(a),f=S(") ["),p=S(_),b=S("/"),d=S(v),$=S("]"),r(l,"class","bd-yellow"),r(e,"class","my-2")},m(y,T){M(y,e,T),s(e,l),s(l,n),s(l,o),s(l,u),s(l,c),s(l,f),s(l,p),s(l,b),s(l,d),s(l,$)},p(y,T){T&2&&i!==(i=y[1].upgrade.t+"")&&X(o,i),T&2&&a!==(a=y[1].version+"")&&X(c,a),T&2&&_!==(_=y[1].upgrade.x+"")&&X(p,_),T&2&&v!==(v=y[1].upgrade.e+"")&&X(d,v)},d(y){y&&C(e)}}}function Wf(t){let e,l,n,i=t[2].tag_name+"",o,u,a,c,f,_,p=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[2]&&t[2].tag_name!=t[1].version&&zf(t),b=t[1].fwconsent===2&&Gf();return{c(){e=m("div"),l=S(`Latest version: - `),n=m("a"),o=S(i),a=h(),p&&p.c(),c=h(),b&&b.c(),f=Ge(),r(n,"href",u=t[2].html_url),r(n,"class","ml-2 text-blue-600 hover:text-blue-800"),r(n,"target","_blank"),r(n,"rel","noreferrer"),r(e,"class","my-2 flex")},m(v,d){M(v,e,d),s(e,l),s(e,n),s(n,o),s(e,a),p&&p.m(e,null),M(v,c,d),b&&b.m(v,d),M(v,f,d),_=!0},p(v,d){(!_||d&4)&&i!==(i=v[2].tag_name+"")&&X(o,i),(!_||d&4&&u!==(u=v[2].html_url))&&r(n,"href",u),(v[1].security==0||v[0].a)&&v[1].fwconsent===1&&v[2]&&v[2].tag_name!=v[1].version?p?(p.p(v,d),d&7&&D(p,1)):(p=zf(v),p.c(),D(p,1),p.m(e,null)):p&&(De(),q(p,1,1,()=>{p=null}),Ie()),v[1].fwconsent===2?b||(b=Gf(),b.c(),b.m(f.parentNode,f)):b&&(b.d(1),b=null)},i(v){_||(D(p),_=!0)},o(v){q(p),_=!1},d(v){v&&C(e),p&&p.d(),v&&C(c),b&&b.d(v),v&&C(f)}}}function zf(t){let e,l,n,i,o,u;return n=new Zc({}),{c(){e=m("div"),l=m("button"),ie(n.$$.fragment),r(e,"class","flex-none ml-2 text-green-500"),r(e,"title","Install this version")},m(a,c){M(a,e,c),s(e,l),le(n,l,null),i=!0,o||(u=ee(l,"click",t[10]),o=!0)},p:fe,i(a){i||(D(n.$$.fragment,a),i=!0)},o(a){q(n.$$.fragment,a),i=!1},d(a){a&&C(e),ne(n),o=!1,u()}}}function Gf(t){let e;return{c(){e=m("div"),e.innerHTML='
You have disabled one-click firmware upgrade, link to self-upgrade is disabled
',r(e,"class","my-2")},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function Vf(t){let e,l=As(be(t[1].chip,t[1].board))+"",n;return{c(){e=m("div"),n=S(l),r(e,"class","bd-red")},m(i,o){M(i,e,o),s(e,n)},p(i,o){o&2&&l!==(l=As(be(i[1].chip,i[1].board))+"")&&X(n,l)},d(i){i&&C(e)}}}function Kf(t){let e,l,n,i,o,u;function a(_,p){return _[4].length==0?Lp:Rp}let c=a(t),f=c(t);return{c(){e=m("div"),l=m("form"),n=m("input"),i=h(),f.c(),ac(n,"display","none"),r(n,"name","file"),r(n,"type","file"),r(n,"accept",".bin"),r(l,"action","/firmware"),r(l,"enctype","multipart/form-data"),r(l,"method","post"),r(l,"autocomplete","off"),r(e,"class","my-2 flex")},m(_,p){M(_,e,p),s(e,l),s(l,n),t[12](n),s(l,i),f.m(l,null),o||(u=[ee(n,"change",t[13]),ee(l,"submit",t[15])],o=!0)},p(_,p){c===(c=a(_))&&f?f.p(_,p):(f.d(1),f=c(_),f&&(f.c(),f.m(l,null)))},d(_){_&&C(e),t[12](null),f.d(),o=!1,ze(u)}}}function Rp(t){let e=t[4][0].name+"",l,n,i;return{c(){l=S(e),n=h(),i=m("button"),i.textContent="Upload",r(i,"type","submit"),r(i,"class","btn-pri-sm float-right")},m(o,u){M(o,l,u),M(o,n,u),M(o,i,u)},p(o,u){u&16&&e!==(e=o[4][0].name+"")&&X(l,e)},d(o){o&&C(l),o&&C(n),o&&C(i)}}}function Lp(t){let e,l,n;return{c(){e=m("button"),e.textContent="Select firmware file for upgrade",r(e,"type","button"),r(e,"class","btn-pri-sm float-right")},m(i,o){M(i,e,o),l||(n=ee(e,"click",t[14]),l=!0)},p:fe,d(i){i&&C(e),l=!1,n()}}}function Yf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$=t[9],y=[];for(let P=0;P<$.length;P+=1)y[P]=Qf(Ff(t,$,P));let T=t[7].length==0&&Xf();function N(P,R){return P[7].length==0?qp:Fp}let E=N(t),B=E(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Backup & restore",n=h(),i=m("form"),o=m("div");for(let P=0;P Include Secrets
(SSID, PSK, passwords and tokens)',c=h(),T&&T.c(),f=h(),_=m("form"),p=m("input"),b=h(),B.c(),r(l,"class","text-sm"),r(a,"class","my-1 mx-3 col-span-2"),r(o,"class","grid grid-cols-2"),r(i,"method","get"),r(i,"action","/configfile.cfg"),r(i,"autocomplete","off"),ac(p,"display","none"),r(p,"name","file"),r(p,"type","file"),r(p,"accept",".cfg"),r(_,"action","/configfile"),r(_,"enctype","multipart/form-data"),r(_,"method","post"),r(_,"autocomplete","off"),r(e,"class","cnt")},m(P,R){M(P,e,R),s(e,l),s(e,n),s(e,i),s(i,o);for(let L=0;L{A=null}),Ie());const _e={};pe&8388608&&(_e.$$scope={dirty:pe,ctx:oe}),x.$set(_e),oe[1].meter?I?I.p(oe,pe):(I=Bf(oe),I.c(),I.m(e,V)):I&&(I.d(1),I=null),oe[1].net?Q?Q.p(oe,pe):(Q=Uf(oe),Q.c(),Q.m(e,W)):Q&&(Q.d(1),Q=null),(!w||pe&2)&&re!==(re=oe[1].version+"")&&X(ue,re),oe[1].upgrade.t&&oe[1].upgrade.t!=oe[1].version?J?J.p(oe,pe):(J=Hf(oe),J.c(),J.m(U,me)):J&&(J.d(1),J=null),oe[2]?se?(se.p(oe,pe),pe&4&&D(se,1)):(se=Wf(oe),se.c(),D(se,1),se.m(U,Te)):se&&(De(),q(se,1,1,()=>{se=null}),Ie()),pe&3&&(je=(oe[1].security==0||oe[0].a)&&ui(oe[1].board)),je?ce?ce.p(oe,pe):(ce=Vf(oe),ce.c(),ce.m(U,Oe)):ce&&(ce.d(1),ce=null),oe[1].security==0||oe[0].a?ve?ve.p(oe,pe):(ve=Kf(oe),ve.c(),ve.m(U,null)):ve&&(ve.d(1),ve=null),oe[1].security==0||oe[0].a?Se?Se.p(oe,pe):(Se=Yf(oe),Se.c(),Se.m(e,null)):Se&&(Se.d(1),Se=null);const Ce={};pe&32&&(Ce.active=oe[5]),Ne.$set(Ce);const vt={};pe&256&&(vt.active=oe[8]),$e.$set(vt)},i(oe){w||(D(y.$$.fragment,oe),D(A),D(x.$$.fragment,oe),D(se),D(Ne.$$.fragment,oe),D($e.$$.fragment,oe),w=!0)},o(oe){q(y.$$.fragment,oe),q(A),q(x.$$.fragment,oe),q(se),q(Ne.$$.fragment,oe),q($e.$$.fragment,oe),w=!1},d(oe){oe&&C(e),ne(y),A&&A.d(),ne(x),I&&I.d(),Q&&Q.d(),J&&J.d(),se&&se.d(),ce&&ce.d(),ve&&ve.d(),Se&&Se.d(),oe&&C(ye),ne(Ne,oe),oe&&C(Re),ne($e,oe),g=!1,k()}}}async function Up(){await(await fetch("/reboot",{method:"POST"})).json()}function jp(t,e,l){let{data:n}=e,{sysinfo:i}=e,o=[{name:"WiFi",key:"iw"},{name:"MQTT",key:"im"},{name:"Web",key:"ie"},{name:"Meter",key:"it"},{name:"Thresholds",key:"ih"},{name:"GPIO",key:"ig"},{name:"NTP",key:"in"},{name:"Price API",key:"is"}],u={};Po.subscribe(L=>{l(2,u=Qc(i.version,L)),u||l(2,u=L[0])});function a(){confirm("Do you want to upgrade this device to "+u.tag_name+"?")&&(i.board!=2&&i.board!=4&&i.board!=7||confirm(As(be(i.chip,i.board))))&&(Ut.update(L=>(L.upgrading=!0,L)),Yc(u.tag_name))}const c=function(){confirm("Are you sure you want to reboot the device?")&&(Ut.update(L=>(L.booting=!0,L)),Up())};let f,_=[],p=!1,b,v=[],d=!1;So();function $(L){Ss[L?"unshift":"push"](()=>{f=L,l(3,f)})}function y(){_=this.files,l(4,_)}const T=()=>{f.click()},N=()=>l(5,p=!0);function E(L){Ss[L?"unshift":"push"](()=>{b=L,l(6,b)})}function B(){v=this.files,l(7,v)}const P=()=>{b.click()},R=()=>l(8,d=!0);return t.$$set=L=>{"data"in L&&l(0,n=L.data),"sysinfo"in L&&l(1,i=L.sysinfo)},[n,i,u,f,_,p,b,v,d,o,a,c,$,y,T,N,E,B,P,R]}class Hp extends Ee{constructor(e){super(),Pe(this,e,jp,Bp,Ae,{data:0,sysinfo:1})}}function Zf(t){let e,l,n=be(t[0],7)+"",i,o,u=be(t[0],5)+"",a,c,f=be(t[0],4)+"",_,p,b=be(t[0],3)+"",v,d,$,y,T=be(t[0],2)+"",N,E,B=be(t[0],1)+"",P,R,L=be(t[0],0)+"",F,x,j,z,G=be(t[0],101)+"",V,W,U=be(t[0],100)+"",K;return{c(){e=m("optgroup"),l=m("option"),i=S(n),o=m("option"),a=S(u),c=m("option"),_=S(f),p=m("option"),v=S(b),d=h(),$=m("optgroup"),y=m("option"),N=S(T),E=m("option"),P=S(B),R=m("option"),F=S(L),x=h(),j=m("optgroup"),z=m("option"),V=S(G),W=m("option"),K=S(U),l.__value=7,l.value=l.__value,o.__value=5,o.value=o.__value,c.__value=4,c.value=c.__value,p.__value=3,p.value=p.__value,r(e,"label","amsleser.no"),y.__value=2,y.value=y.__value,E.__value=1,E.value=E.__value,R.__value=0,R.value=R.__value,r($,"label","Custom hardware"),z.__value=101,z.value=z.__value,W.__value=100,W.value=W.__value,r(j,"label","Generic hardware")},m(H,Y){M(H,e,Y),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,_),s(e,p),s(p,v),M(H,d,Y),M(H,$,Y),s($,y),s(y,N),s($,E),s(E,P),s($,R),s(R,F),M(H,x,Y),M(H,j,Y),s(j,z),s(z,V),s(j,W),s(W,K)},p(H,Y){Y&1&&n!==(n=be(H[0],7)+"")&&X(i,n),Y&1&&u!==(u=be(H[0],5)+"")&&X(a,u),Y&1&&f!==(f=be(H[0],4)+"")&&X(_,f),Y&1&&b!==(b=be(H[0],3)+"")&&X(v,b),Y&1&&T!==(T=be(H[0],2)+"")&&X(N,T),Y&1&&B!==(B=be(H[0],1)+"")&&X(P,B),Y&1&&L!==(L=be(H[0],0)+"")&&X(F,L),Y&1&&G!==(G=be(H[0],101)+"")&&X(V,G),Y&1&&U!==(U=be(H[0],100)+"")&&X(K,U)},d(H){H&&C(e),H&&C(d),H&&C($),H&&C(x),H&&C(j)}}}function Jf(t){let e,l,n=be(t[0],201)+"",i,o,u=be(t[0],202)+"",a,c,f=be(t[0],203)+"",_,p,b=be(t[0],200)+"",v;return{c(){e=m("optgroup"),l=m("option"),i=S(n),o=m("option"),a=S(u),c=m("option"),_=S(f),p=m("option"),v=S(b),l.__value=201,l.value=l.__value,o.__value=202,o.value=o.__value,c.__value=203,c.value=c.__value,p.__value=200,p.value=p.__value,r(e,"label","Generic hardware")},m(d,$){M(d,e,$),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,_),s(e,p),s(p,v)},p(d,$){$&1&&n!==(n=be(d[0],201)+"")&&X(i,n),$&1&&u!==(u=be(d[0],202)+"")&&X(a,u),$&1&&f!==(f=be(d[0],203)+"")&&X(_,f),$&1&&b!==(b=be(d[0],200)+"")&&X(v,b)},d(d){d&&C(e)}}}function xf(t){let e,l,n=be(t[0],7)+"",i,o,u=be(t[0],6)+"",a,c,f=be(t[0],5)+"",_,p,b,v,d=be(t[0],51)+"",$,y,T=be(t[0],50)+"",N;return{c(){e=m("optgroup"),l=m("option"),i=S(n),o=m("option"),a=S(u),c=m("option"),_=S(f),p=h(),b=m("optgroup"),v=m("option"),$=S(d),y=m("option"),N=S(T),l.__value=7,l.value=l.__value,o.__value=6,o.value=o.__value,c.__value=5,c.value=c.__value,r(e,"label","amsleser.no"),v.__value=51,v.value=v.__value,y.__value=50,y.value=y.__value,r(b,"label","Generic hardware")},m(E,B){M(E,e,B),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,_),M(E,p,B),M(E,b,B),s(b,v),s(v,$),s(b,y),s(y,N)},p(E,B){B&1&&n!==(n=be(E[0],7)+"")&&X(i,n),B&1&&u!==(u=be(E[0],6)+"")&&X(a,u),B&1&&f!==(f=be(E[0],5)+"")&&X(_,f),B&1&&d!==(d=be(E[0],51)+"")&&X($,d),B&1&&T!==(T=be(E[0],50)+"")&&X(N,T)},d(E){E&&C(e),E&&C(p),E&&C(b)}}}function ec(t){let e,l,n=be(t[0],8)+"",i,o,u,a,c=be(t[0],71)+"",f,_,p=be(t[0],70)+"",b;return{c(){e=m("optgroup"),l=m("option"),i=S(n),o=h(),u=m("optgroup"),a=m("option"),f=S(c),_=m("option"),b=S(p),l.__value=8,l.value=l.__value,r(e,"label","Custom hardware"),a.__value=71,a.value=a.__value,_.__value=70,_.value=_.__value,r(u,"label","Generic hardware")},m(v,d){M(v,e,d),s(e,l),s(l,i),M(v,o,d),M(v,u,d),s(u,a),s(a,f),s(u,_),s(_,b)},p(v,d){d&1&&n!==(n=be(v[0],8)+"")&&X(i,n),d&1&&c!==(c=be(v[0],71)+"")&&X(f,c),d&1&&p!==(p=be(v[0],70)+"")&&X(b,p)},d(v){v&&C(e),v&&C(o),v&&C(u)}}}function tc(t){let e,l,n=be(t[0],200)+"",i;return{c(){e=m("optgroup"),l=m("option"),i=S(n),l.__value=200,l.value=l.__value,r(e,"label","Generic hardware")},m(o,u){M(o,e,u),s(e,l),s(l,i)},p(o,u){u&1&&n!==(n=be(o[0],200)+"")&&X(i,n)},d(o){o&&C(e)}}}function Wp(t){let e,l,n,i,o,u,a,c=t[0]=="esp8266"&&Zf(t),f=t[0]=="esp32"&&Jf(t),_=t[0]=="esp32s2"&&xf(t),p=t[0]=="esp32c3"&&ec(t),b=t[0]=="esp32solo"&&tc(t);return{c(){e=m("option"),l=h(),c&&c.c(),n=h(),f&&f.c(),i=h(),_&&_.c(),o=h(),p&&p.c(),u=h(),b&&b.c(),a=Ge(),e.__value=-1,e.value=e.__value},m(v,d){M(v,e,d),M(v,l,d),c&&c.m(v,d),M(v,n,d),f&&f.m(v,d),M(v,i,d),_&&_.m(v,d),M(v,o,d),p&&p.m(v,d),M(v,u,d),b&&b.m(v,d),M(v,a,d)},p(v,[d]){v[0]=="esp8266"?c?c.p(v,d):(c=Zf(v),c.c(),c.m(n.parentNode,n)):c&&(c.d(1),c=null),v[0]=="esp32"?f?f.p(v,d):(f=Jf(v),f.c(),f.m(i.parentNode,i)):f&&(f.d(1),f=null),v[0]=="esp32s2"?_?_.p(v,d):(_=xf(v),_.c(),_.m(o.parentNode,o)):_&&(_.d(1),_=null),v[0]=="esp32c3"?p?p.p(v,d):(p=ec(v),p.c(),p.m(u.parentNode,u)):p&&(p.d(1),p=null),v[0]=="esp32solo"?b?b.p(v,d):(b=tc(v),b.c(),b.m(a.parentNode,a)):b&&(b.d(1),b=null)},i:fe,o:fe,d(v){v&&C(e),v&&C(l),c&&c.d(v),v&&C(n),f&&f.d(v),v&&C(i),_&&_.d(v),v&&C(o),p&&p.d(v),v&&C(u),b&&b.d(v),v&&C(a)}}}function zp(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class Gp extends Ee{constructor(e){super(),Pe(this,e,zp,Wp,Ae,{chip:0})}}function lc(t){let e;return{c(){e=m("div"),e.textContent="WARNING: Changing this configuration will affect basic configuration of your device. Only make changes here if instructed by vendor",r(e,"class","bd-red")},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function nc(t){let e,l,n,i,o,u,a;return u=new xc({props:{chip:t[0].chip}}),{c(){e=m("div"),l=S("HAN GPIO"),n=m("br"),i=h(),o=m("select"),ie(u.$$.fragment),r(o,"name","vh"),r(o,"class","in-s"),r(e,"class","my-3")},m(c,f){M(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),le(u,o,null),a=!0},p(c,f){const _={};f&1&&(_.chip=c[0].chip),u.$set(_)},i(c){a||(D(u.$$.fragment,c),a=!0)},o(c){q(u.$$.fragment,c),a=!1},d(c){c&&C(e),ne(u)}}}function Vp(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,R,L,F,x,j,z,G,V,W=t[0].usrcfg&&lc();d=new Gp({props:{chip:t[0].chip}});let U=t[0].board&&t[0].board>20&&nc(t);return j=new It({props:{active:t[1],message:"Saving device configuration"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=h(),u=m("strong"),u.textContent="Initial configuration",a=h(),W&&W.c(),c=h(),f=m("div"),_=S("Board type"),p=m("br"),b=h(),v=m("select"),ie(d.$$.fragment),$=h(),U&&U.c(),y=h(),T=m("div"),N=m("label"),E=m("input"),B=S(" Clear all other configuration"),P=h(),R=m("div"),R.innerHTML='',L=h(),F=m("span"),F.textContent=" ",x=h(),ie(j.$$.fragment),r(i,"type","hidden"),r(i,"name","v"),i.value="true",r(u,"class","text-sm"),r(v,"name","vb"),r(v,"class","in-s"),t[0].board===void 0&&et(()=>t[4].call(v)),r(f,"class","my-3"),r(E,"type","checkbox"),r(E,"name","vr"),E.__value="true",E.value=E.__value,r(E,"class","rounded mb-1"),r(T,"class","my-3"),r(R,"class","my-3"),r(F,"class","clear-both"),r(n,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(K,H){M(K,e,H),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),W&&W.m(n,null),s(n,c),s(n,f),s(f,_),s(f,p),s(f,b),s(f,v),le(d,v,null),qe(v,t[0].board,!0),s(n,$),U&&U.m(n,null),s(n,y),s(n,T),s(T,N),s(N,E),E.checked=t[2],s(N,B),s(n,P),s(n,R),s(n,L),s(n,F),M(K,x,H),le(j,K,H),z=!0,G||(V=[ee(v,"change",t[4]),ee(E,"change",t[5]),ee(n,"submit",Ps(t[3]))],G=!0)},p(K,[H]){K[0].usrcfg?W||(W=lc(),W.c(),W.m(n,c)):W&&(W.d(1),W=null);const Y={};H&1&&(Y.chip=K[0].chip),d.$set(Y),H&1&&qe(v,K[0].board),K[0].board&&K[0].board>20?U?(U.p(K,H),H&1&&D(U,1)):(U=nc(K),U.c(),D(U,1),U.m(n,y)):U&&(De(),q(U,1,1,()=>{U=null}),Ie()),H&4&&(E.checked=K[2]);const Z={};H&2&&(Z.active=K[1]),j.$set(Z)},i(K){z||(D(d.$$.fragment,K),D(U),D(j.$$.fragment,K),z=!0)},o(K){q(d.$$.fragment,K),q(U),q(j.$$.fragment,K),z=!1},d(K){K&&C(e),W&&W.d(),ne(d),U&&U.d(),K&&C(x),ne(j,K),G=!1,ze(V)}}}function Kp(t,e,l){let{sysinfo:n={}}=e,i=!1;async function o(f){l(1,i=!0);const _=new FormData(f.target),p=new URLSearchParams;for(let d of _){const[$,y]=d;p.append($,y)}let v=await(await fetch("/save",{method:"POST",body:p})).json();l(1,i=!1),Ut.update(d=>(d.vndcfg=v.success,d.booting=v.reboot,d)),ai(n.usrcfg?"/":"/setup")}let u=!1;function a(){n.board=dt(this),l(0,n)}function c(){u=this.checked,l(2,u),l(0,n)}return t.$$set=f=>{"sysinfo"in f&&l(0,n=f.sysinfo)},t.$$.update=()=>{t.$$.dirty&1&&l(2,u=!n.usrcfg)},[n,i,u,o,a,c]}class Yp extends Ee{constructor(e){super(),Pe(this,e,Kp,Vp,Ae,{sysinfo:0})}}function ic(t){let e,l,n,i,o,u,a,c;return a=new e0({}),{c(){e=m("br"),l=h(),n=m("div"),i=m("input"),o=h(),u=m("select"),ie(a.$$.fragment),r(i,"name","si"),r(i,"type","text"),r(i,"class","in-f w-full"),i.required=t[1],r(u,"name","su"),r(u,"class","in-l"),u.required=t[1],r(n,"class","flex")},m(f,_){M(f,e,_),M(f,l,_),M(f,n,_),s(n,i),s(n,o),s(n,u),le(a,u,null),c=!0},p(f,_){(!c||_&2)&&(i.required=f[1]),(!c||_&2)&&(u.required=f[1])},i(f){c||(D(a.$$.fragment,f),c=!0)},o(f){q(a.$$.fragment,f),c=!1},d(f){f&&C(e),f&&C(l),f&&C(n),ne(a)}}}function sc(t){let e;return{c(){e=m("div"),e.innerHTML=`
Gateway
+Occurred in: ${i}`:"",u=Mo(t),a=_c(e)?e(u):e;return`<${u}> ${a}${o}`}const Nc=t=>(...e)=>t(I0(...e)),Ac=Nc(t=>{throw new Error(t)}),Ts=Nc(console.warn),Ga=4,R0=3,L0=2,O0=1,F0=1;function q0(t,e){const l=t.default?0:ml(t.fullPath).reduce((n,i)=>{let o=n;return o+=Ga,M0(i)?o+=F0:$0(i)?o+=L0:yc(i)?o-=Ga+O0:o+=R0,o},0);return{route:t,score:l,index:e}}function B0(t){return t.map(q0).sort((e,l)=>e.scorel.score?-1:e.index-l.index)}function Pc(t,e){let l,n;const[i]=e.split("?"),o=ml(i),u=o[0]==="",a=B0(t);for(let c=0,f=a.length;c({..._,params:b,uri:T});if(_.default){n=v(e);continue}const d=ml(_.fullPath),$=Math.max(o.length,d.length);let y=0;for(;y<$;y++){const T=d[y],N=o[y];if(!za(T)&&yc(T)){const B=T==="*"?"*":T.slice(1);b[B]=o.slice(y).map(decodeURIComponent).join("/");break}if(za(N)){p=!0;break}const E=wc.exec(T);if(E&&!u){const B=decodeURIComponent(N);b[E[1]]=B}else if(T!==N){p=!0;break}}if(!p){l=v(Ei(...o.slice(0,y)));break}}return l||n||null}function Ec(t,e){return Pc([t],e)}function U0(t,e){if(oo(t,"/"))return t;const[l,n]=t.split("?"),[i]=e.split("?"),o=ml(l),u=ml(i);if(o[0]==="")return Zs(i,n);if(!oo(o[0],".")){const f=u.concat(o).join("/");return Zs((i==="/"?"":"/")+f,n)}const a=u.concat(o),c=[];return a.forEach(f=>{f===".."?c.pop():f!=="."&&c.push(f)}),Zs(`/${c.join("/")}`,n)}function Va(t,e){const{pathname:l,hash:n="",search:i="",state:o}=t,u=ml(e,!0),a=ml(l,!0);for(;u.length;)u[0]!==a[0]&&Ac(_n,`Invalid state: All locations must begin with the basepath "${e}", found "${l}"`),u.shift(),a.shift();return{pathname:Ei(...a),hash:n,search:i,state:o}}const Ka=t=>t.length===1?"":t,$o=t=>{const e=t.indexOf("?"),l=t.indexOf("#"),n=e!==-1,i=l!==-1,o=i?Ka(Ci(t,l)):"",u=i?Ci(t,0,l):t,a=n?Ka(Ci(u,e)):"";return{pathname:(n?Ci(u,0,e):u)||"/",search:a,hash:o}},j0=t=>{const{pathname:e,search:l,hash:n}=t;return e+l+n};function H0(t,e,l){return Ei(l,U0(t,e))}function W0(t,e){const l=yo(S0(t)),n=ml(l,!0),i=ml(e,!0).slice(0,n.length),o=Ec({fullPath:l},Ei(...i));return o&&o.uri}const Js="POP",z0="PUSH",G0="REPLACE";function xs(t){return{...t.location,pathname:encodeURI(decodeURI(t.location.pathname)),state:t.history.state,_key:t.history.state&&t.history.state._key||"initial"}}function V0(t){let e=[],l=xs(t),n=Js;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=xs(t),n=Js,i([o])};i([o]);const a=hc(t,"popstate",u);return()=>{a(),e=e.filter(c=>c!==o)}},navigate(o,u){const{state:a={},replace:c=!1}=u||{};if(n=c?G0:z0,dc(o))u&&Ts(Tc,"Navigation options (state or replace) are not supported, when passing a number as the first argument to navigate. They are ignored."),n=Js,t.history.go(o);else{const f={...a,_key:k0()};try{t.history[c?"replaceState":"pushState"](f,"",o)}catch{t.location[c?"replace":"assign"](o)}}l=xs(t),i()}}}function eo(t,e){return{...$o(e),state:t}}function K0(t="/"){let e=0,l=[eo(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(eo(n,o))},replaceState(n,i,o){l[e]=eo(n,o)},go(n){const i=e+n;i<0||i>l.length-1||(e=i)}}}}const Y0=!!(!Ul&&window.document&&window.document.createElement),Q0=!Ul&&window.location.origin==="null",Dc=V0(Y0&&!Q0?window:K0()),{navigate:ai}=Dc;let $l=null,Ic=!0;function X0(t,e){const l=document.querySelectorAll("[data-svnav-router]");for(let n=0;n$l.level||t.level===$l.level&&X0(t.routerId,$l.routerId))&&($l=t)}function J0(){$l=null}function x0(){Ic=!1}function Ya(t){if(!t)return!1;const e="tabindex";try{if(!t.hasAttribute(e)){t.setAttribute(e,"-1");let l;l=hc(t,"blur",()=>{t.removeAttribute(e),l()})}return t.focus(),document.activeElement===t}catch{return!1}}function e1(t,e){return Number(t.dataset.svnavRouteEnd)===e}function t1(t){return/^H[1-6]$/i.test(t.tagName)}function Qa(t,e=document){return e.querySelector(t)}function l1(t){let l=Qa(`[data-svnav-route-start="${t}"]`).nextElementSibling;for(;!e1(l,t);){if(t1(l))return l;const n=Qa("h1,h2,h3,h4,h5,h6",l);if(n)return n;l=l.nextElementSibling}return null}function n1(t){Promise.resolve(fi(t.focusElement)).then(e=>{const l=e||l1(t.id);l||Ts(_n,`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,Es),!Ya(l)&&Ya(document.documentElement)})}const i1=(t,e,l)=>(n,i)=>d0().then(()=>{if(!$l||Ic){x0();return}if(n&&n1($l.route),t.announcements&&i){const{path:o,fullPath:u,meta:a,params:c,uri:f}=$l.route,_=t.createAnnouncement({path:o,fullPath:u,meta:a,params:c,uri:f},fi(l));Promise.resolve(_).then(p=>{e.set(p)})}J0()}),s1="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 o1(t){let e,l,n=[{role:"status"},{"aria-atomic":"true"},{"aria-live":"polite"},{"data-svnav-announcer":""},bc(t[6],s1)],i={};for(let o=0;o`Navigated to ${ue.uri}`,announcements:!0,...d},T=_,N=yo(_),E=Bl(so),B=Bl(mi),P=!E,L=a1(),O=v&&!(B&&!B.manageFocus),F=at("");ul(t,F,ue=>l(0,a=ue));const x=B?B.disableInlineStyles:$,j=at([]);ul(t,j,ue=>l(20,u=ue));const z=at(null);ul(t,z,ue=>l(18,i=ue));let G=!1;const V=P?0:B.level+1,U=P?at((()=>Va(Ul?$o(p):b.location,N))()):E;ul(t,U,ue=>l(17,n=ue));const K=at(n);ul(t,K,ue=>l(19,o=ue));const H=i1(y,F,U),Y=ue=>we=>we.filter(me=>me.id!==ue);function Z(ue){if(Ul){if(G)return;const we=Ec(ue,n.pathname);if(we)return G=!0,we}else j.update(we=>{const me=Y(ue.id)(we);return me.push(ue),me})}function re(ue){j.update(Y(ue))}return!P&&_!==Xa&&Ts(_n,'Only top-level Routers can have a "basepath" prop. It is ignored.',{basepath:_}),P&&(uc(()=>b.listen(we=>{const me=Va(we.location,N);K.set(n),U.set(me)})),Ti(so,U)),Ti(mi,{activeRoute:z,registerRoute:Z,unregisterRoute:re,manageFocus:O,level:V,id:L,history:P?b:B.history,basepath:P?N:B.basepath,disableInlineStyles:x}),t.$$set=ue=>{"basepath"in ue&&l(11,_=ue.basepath),"url"in ue&&l(12,p=ue.url),"history"in ue&&l(13,b=ue.history),"primary"in ue&&l(14,v=ue.primary),"a11y"in ue&&l(15,d=ue.a11y),"disableInlineStyles"in ue&&l(16,$=ue.disableInlineStyles),"$$scope"in ue&&l(21,f=ue.$$scope)},t.$$.update=()=>{if(t.$$.dirty[0]&2048&&_!==T&&Ts(_n,'You cannot change the "basepath" prop. It is ignored.'),t.$$.dirty[0]&1179648){const ue=Pc(u,n.pathname);z.set(ue)}if(t.$$.dirty[0]&655360&&P){const ue=!!n.hash,we=!ue&&O,me=!ue||n.pathname!==o.pathname;H(we,me)}t.$$.dirty[0]&262144&&O&&i&&i.primary&&Z0({level:V,routerId:L,route:i})},[a,y,P,L,O,F,x,j,z,U,K,_,p,b,v,d,$,n,i,o,u,f,c]}class f1 extends Ee{constructor(e){super(),Pe(this,e,u1,r1,Ae,{basepath:11,url:12,history:13,primary:14,a11y:15,disableInlineStyles:16},null,[-1,-1])}}const Rc=f1;function Di(t,e,l=mi,n=_n){Bl(l)||Ac(t,o=>`You cannot use ${o} outside of a ${Mo(n)}.`,e)}const c1=t=>{const{subscribe:e}=Bl(t);return{subscribe:e}};function Lc(){return Di(Mc),c1(so)}function Oc(){const{history:t}=Bl(mi);return t}function Fc(){const t=Bl(kc);return t?w0(t,e=>e.base):at("/")}function qc(){Di(Sc);const t=Fc(),{basepath:e}=Bl(mi);return n=>H0(n,fi(t),e)}function m1(){Di($c);const t=qc(),{navigate:e}=Oc();return(n,i)=>{const o=dc(n)?n:t(n);return e(o,i)}}const p1=t=>({params:t&16,location:t&8}),Za=t=>({params:Ul?fi(t[10]):t[4],location:t[3],navigate:t[11]});function Ja(t){let e,l;return e=new Rc({props:{primary:t[1],$$slots:{default:[v1]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.primary=n[1]),i&528409&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function _1(t){let e;const l=t[18].default,n=bo(l,t,t[19],Za);return{c(){n&&n.c()},m(i,o){n&&n.m(i,o),e=!0},p(i,o){n&&n.p&&(!e||o&524312)&&ko(n,l,i,i[19],e?go(l,i[19],o,p1):wo(i[19]),Za)},i(i){e||(D(n,i),e=!0)},o(i){q(n,i),e=!1},d(i){n&&n.d(i)}}}function d1(t){let e,l,n;const i=[{location:t[3]},{navigate:t[11]},Ul?fi(t[10]):t[4],t[12]];var o=t[0];function u(a){let c={};for(let f=0;f{ne(_,1)}),Ie()}o?(e=ja(o,u()),ie(e.$$.fragment),D(e.$$.fragment,1),le(e,l.parentNode,l)):e=null}else o&&e.$set(f)},i(a){n||(e&&D(e.$$.fragment,a),n=!0)},o(a){e&&q(e.$$.fragment,a),n=!1},d(a){a&&C(l),e&&ne(e,a)}}}function v1(t){let e,l,n,i;const o=[d1,_1],u=[];function a(c,f){return c[0]!==null?0:1}return e=a(t),l=u[e]=o[e](t),{c(){l.c(),n=Ge()},m(c,f){u[e].m(c,f),M(c,n,f),i=!0},p(c,f){let _=e;e=a(c),e===_?u[e].p(c,f):(De(),q(u[_],1,1,()=>{u[_]=null}),Ie(),l=u[e],l?l.p(c,f):(l=u[e]=o[e](c),l.c()),D(l,1),l.m(n.parentNode,n))},i(c){i||(D(l),i=!0)},o(c){q(l),i=!1},d(c){u[e].d(c),c&&C(n)}}}function h1(t){let e,l,n,i,o,u=[io(t[7]),{"data-svnav-route-start":t[5]}],a={};for(let p=0;p{c=null}),Ie())},i(p){o||(D(c),o=!0)},o(p){q(c),o=!1},d(p){p&&C(e),p&&C(l),c&&c.d(p),p&&C(n),p&&C(i)}}}const b1=vc();function g1(t,e,l){let n;const i=["path","component","meta","primary"];let o=$s(e,i),u,a,c,f,{$$slots:_={},$$scope:p}=e,{path:b=""}=e,{component:v=null}=e,{meta:d={}}=e,{primary:$=!0}=e;Di(Es,e);const y=b1(),{registerRoute:T,unregisterRoute:N,activeRoute:E,disableInlineStyles:B}=Bl(mi);ul(t,E,G=>l(16,u=G));const P=Fc();ul(t,P,G=>l(17,c=G));const L=Lc();ul(t,L,G=>l(3,a=G));const O=at(null);let F;const x=at(),j=at({});ul(t,j,G=>l(4,f=G)),Ti(kc,x),Ti(y0,j),Ti(C0,O);const z=m1();return Ul||p0(()=>N(y)),t.$$set=G=>{l(24,e=xt(xt({},e),Ms(G))),l(12,o=$s(e,i)),"path"in G&&l(13,b=G.path),"component"in G&&l(0,v=G.component),"meta"in G&&l(14,d=G.meta),"primary"in G&&l(1,$=G.primary),"$$scope"in G&&l(19,p=G.$$scope)},t.$$.update=()=>{if(t.$$.dirty&155658){const G=b==="",V=Ei(c,b),W={id:y,path:b,meta:d,default:G,fullPath:G?"":V,base:G?c:W0(V,a.pathname),primary:$,focusElement:O};x.set(W),l(15,F=T(W))}if(t.$$.dirty&98304&&l(2,n=!!(F||u&&u.id===y)),t.$$.dirty&98308&&n){const{params:G}=F||u;j.set(G)}},e=Ms(e),[v,$,n,a,f,y,E,B,P,L,j,z,o,b,d,F,u,c,_,p]}class k1 extends Ee{constructor(e){super(),Pe(this,e,g1,h1,Ae,{path:13,component:0,meta:14,primary:1})}}const Ml=k1;function w1(t){let e,l,n,i;const o=t[13].default,u=bo(o,t,t[12],null);let a=[{href:t[0]},t[2],t[1]],c={};for(let f=0;fl(11,p=O));const E=_0(),B=qc(),{navigate:P}=Oc();function L(O){E("click",O),g0(O)&&(O.preventDefault(),P(n,{state:y,replace:u||$}))}return t.$$set=O=>{l(19,e=xt(xt({},e),Ms(O))),l(18,_=$s(e,f)),"to"in O&&l(5,d=O.to),"replace"in O&&l(6,$=O.replace),"state"in O&&l(7,y=O.state),"getProps"in O&&l(8,T=O.getProps),"$$scope"in O&&l(12,v=O.$$scope)},t.$$.update=()=>{t.$$.dirty&2080&&l(0,n=B(d,p)),t.$$.dirty&2049&&l(10,i=oo(p.pathname,n)),t.$$.dirty&2049&&l(9,o=n===p.pathname),t.$$.dirty&2049&&(u=$o(n)===j0(p)),t.$$.dirty&512&&l(2,a=o?{"aria-current":"page"}:{}),l(1,c=(()=>{if(_c(T)){const O=T({location:p,href:n,isPartiallyCurrent:i,isCurrent:o});return{..._,...O}}return _})())},e=Ms(e),[n,c,a,N,L,d,$,y,T,o,i,p,v,b]}class C1 extends Ee{constructor(e){super(),Pe(this,e,y1,w1,Ae,{to:5,replace:6,state:7,getProps:8})}}const el=C1;let ro=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function ql(t){return t===1?"green":t===2?"yellow":t===3?"red":"gray"}function M1(t){return t>218&&t<242?"#32d900":t>212&&t<248?"#b1d900":t>208&&t<252?"#ffb800":"#d90000"}function Bc(t){return t>90?"#d90000":t>85?"#e32100":t>80?"#ffb800":t>75?"#dcd800":"#32d900"}function $1(t){return t>75?"#32d900":t>50?"#77d900":t>25?"#94d900":"#dcd800"}function Ns(t){switch(t){case 1:return"Aidon";case 2:return"Kaifa";case 3:return"Kamstrup";case 8:return"Iskra";case 9:return"Landis+Gyr";case 10:return"Sagemcom";default:return"Unknown"}}function Oe(t){for(t=t.toString();t.length<2;)t="0"+t;return t}function be(t,e){switch(e){case 5:switch(t){case"esp8266":return"Pow-K (GPIO12)";case"esp32s2":return"Pow-K+"}case 7:switch(t){case"esp8266":return"Pow-U (GPIO12)";case"esp32s2":return"Pow-U+"}case 6:return"Pow-P1";case 51:return"Wemos S2 mini";case 50:return"Generic ESP32-S2";case 201:return"Wemos LOLIN D32";case 202:return"Adafruit HUZZAH32";case 203:return"DevKitC";case 200:return"Generic ESP32";case 2:return"HAN Reader 2.0 by Max Spencer";case 0:return"Custom hardware by Roar Fredriksen";case 1:return"Kamstrup module by Egil Opsahl";case 8:return"\xB5HAN mosquito by dbeinder";case 3:return"Pow-K (UART0)";case 4:return"Pow-U (UART0)";case 101:return"Wemos D1 mini";case 100:return"Generic ESP8266";case 70:return"Generic ESP32-C3";case 71:return"ESP32-C3-DevKitM-1"}}function xa(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 eu(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 tu(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 ui(t){switch(t){case 2:case 4:case 7:return!0}return!1}function Ve(t,e){return t==1||t==2&&e}function Bt(t){return"https://github.com/UtilitechAS/amsreader-firmware/wiki/"+t}function ge(t,e){return isNaN(t)?"-":(isNaN(e)&&(e=t<10?1:0),t.toFixed(e))}function fl(t,e){return t.setTime(t.getTime()+e*36e5),t}function lu(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 nu(t){return t=="EOE"?"ENTSO-E":t=="HKS"?"hvakosterstrommen.no":t=="EDS"?"Energy Data Service":t=="MIX"?"Mixed sources":"Unknown ("+t+")"}async function jl(t,e={}){const{timeout:l=8e3}=e,n=new AbortController,i=setTimeout(()=>n.abort(),l),o=await fetch(t,{...e,signal:n.signal});return clearTimeout(i),o}let al={version:"",chip:"",mac:null,apmac:null,vndcfg:null,usrcfg:null,fwconsent:null,booting:!1,upgrading:!1,ui:{},security:0,boot_reason:0,upgrade:{x:-1,e:0,f:null,t:null},trying:null};const Ut=at(al);async function So(){al=await(await jl("/sysinfo.json?t="+Math.floor(Date.now()/1e3))).json(),Ut.set(al)}let ws=0,iu=-127,su=null,S1={};const T1=gc(S1,t=>{let e;async function l(){jl("/data.json").then(n=>n.json()).then(n=>{t(n),iu!=n.t&&(iu=n.t,setTimeout(zc,2e3)),su==null&&n.pe&&n.p!=null&&(su=n.p,jc()),al.upgrading?window.location.reload():(!al||!al.chip||al.booting||ws>1&&!ui(al.board))&&(So(),fn&&clearTimeout(fn),fn=setTimeout(No,2e3),cn&&clearTimeout(cn),cn=setTimeout(Ao,3e3));let i=5e3;if(ui(al.board)&&n.v>2.5){let o=3.3-Math.min(3.3,n.v);o>0&&(i=Math.max(o,.1)*10*5e3)}i>5e3&&console.log("Scheduling next data fetch in "+i+"ms"),e&&clearTimeout(e),e=setTimeout(l,i),ws=0}).catch(n=>{ws++,ws>3?(t({em:3,hm:0,wm:0,mm:0}),e=setTimeout(l,15e3)):e=setTimeout(l,ui(al.board)?1e4:5e3)})}return l(),function(){clearTimeout(e)}});let ao={},Mi;const To=at(ao);async function Uc(){let t=!1;if(To.update(e=>{for(var l=0;l<36;l++){if(e[Oe(l)]==null){t=l<12;break}e[Oe(l)]=e[Oe(l+1)]}return e}),t)jc();else{let e=new Date;Mi=setTimeout(Uc,(60-e.getMinutes())*6e4)}}async function jc(){Mi&&(clearTimeout(Mi),Mi=0),ao=await(await jl("/energyprice.json")).json(),To.set(ao);let e=new Date;Mi=setTimeout(Uc,(60-e.getMinutes())*6e4)}let uo={},fn;async function No(){fn&&(clearTimeout(fn),fn=0),uo=await(await jl("/dayplot.json")).json(),Hc.set(uo);let e=new Date;fn=setTimeout(No,(60-e.getMinutes())*6e4+20)}const Hc=at(uo,t=>(No(),function(){}));let fo={},cn;async function Ao(){cn&&(clearTimeout(cn),cn=0),fo=await(await jl("/monthplot.json")).json(),Wc.set(fo);let e=new Date;cn=setTimeout(Ao,(24-e.getHours())*36e5+40)}const Wc=at(fo,t=>(Ao(),function(){}));let co={};async function zc(){co=await(await jl("/temperature.json")).json(),Gc.set(co)}const Gc=at(co,t=>(zc(),function(){}));let mo={},ys;async function Vc(){ys&&(clearTimeout(ys),ys=0),mo=await(await jl("/tariff.json")).json(),Kc.set(mo);let e=new Date;ys=setTimeout(Vc,(60-e.getMinutes())*6e4+30)}const Kc=at(mo,t=>function(){});let po=[];const Po=at(po);async function N1(){po=await(await jl("https://api.github.com/repos/UtilitechAS/amsreader-firmware/releases")).json(),Po.set(po)}function As(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 Yc(t){await(await fetch("/upgrade?expected_version="+t,{method:"POST"})).json()}function Qc(t,e){if(/^v\d{1,2}\.\d{1,2}\.\d{1,2}$/.test(t)){let l=t.substring(1).split("."),n=parseInt(l[0]),i=parseInt(l[1]),o=parseInt(l[2]),u=[...e];u.reverse();let a,c,f;for(let _=0;_o&&(a=p):$==i+1&&(c=p);else if(d==n+1)if(f){let T=f.tag_name.substring(1).split(".");parseInt(T[0]);let N=parseInt(T[1]);parseInt(T[2]),$==N&&(f=p)}else f=p}return c||f||a||!1}else return e[0]}const A1="/github.svg";function ou(t){let e,l;function n(u,a){return u[1]>1?O1:u[1]>0?L1:u[2]>1?R1:u[2]>0?I1:u[3]>1?D1:u[3]>0?E1:P1}let i=n(t),o=i(t);return{c(){e=S(`Up + `),o.c(),l=Ge()},m(u,a){M(u,e,a),o.m(u,a),M(u,l,a)},p(u,a){i===(i=n(u))&&o?o.p(u,a):(o.d(1),o=i(u),o&&(o.c(),o.m(l.parentNode,l)))},d(u){u&&C(e),o.d(u),u&&C(l)}}}function P1(t){let e,l;return{c(){e=S(t[0]),l=S(" seconds")},m(n,i){M(n,e,i),M(n,l,i)},p(n,i){i&1&&X(e,n[0])},d(n){n&&C(e),n&&C(l)}}}function E1(t){let e,l;return{c(){e=S(t[3]),l=S(" minute")},m(n,i){M(n,e,i),M(n,l,i)},p(n,i){i&8&&X(e,n[3])},d(n){n&&C(e),n&&C(l)}}}function D1(t){let e,l;return{c(){e=S(t[3]),l=S(" minutes")},m(n,i){M(n,e,i),M(n,l,i)},p(n,i){i&8&&X(e,n[3])},d(n){n&&C(e),n&&C(l)}}}function I1(t){let e,l;return{c(){e=S(t[2]),l=S(" hour")},m(n,i){M(n,e,i),M(n,l,i)},p(n,i){i&4&&X(e,n[2])},d(n){n&&C(e),n&&C(l)}}}function R1(t){let e,l;return{c(){e=S(t[2]),l=S(" hours")},m(n,i){M(n,e,i),M(n,l,i)},p(n,i){i&4&&X(e,n[2])},d(n){n&&C(e),n&&C(l)}}}function L1(t){let e,l;return{c(){e=S(t[1]),l=S(" day")},m(n,i){M(n,e,i),M(n,l,i)},p(n,i){i&2&&X(e,n[1])},d(n){n&&C(e),n&&C(l)}}}function O1(t){let e,l;return{c(){e=S(t[1]),l=S(" days")},m(n,i){M(n,e,i),M(n,l,i)},p(n,i){i&2&&X(e,n[1])},d(n){n&&C(e),n&&C(l)}}}function F1(t){let e,l=t[0]&&ou(t);return{c(){l&&l.c(),e=Ge()},m(n,i){l&&l.m(n,i),M(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=ou(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:fe,o:fe,d(n){l&&l.d(n),n&&C(e)}}}function q1(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 B1 extends Ee{constructor(e){super(),Pe(this,e,q1,F1,Ae,{epoch:0})}}function U1(t){let e,l,n;return{c(){e=m("span"),l=S(t[2]),r(e,"title",t[1]),r(e,"class",n="bd-"+t[0])},m(i,o){M(i,e,o),s(e,l)},p(i,[o]){o&4&&X(l,i[2]),o&2&&r(e,"title",i[1]),o&1&&n!==(n="bd-"+i[0])&&r(e,"class",n)},i:fe,o:fe,d(i){i&&C(e)}}}function j1(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 mn extends Ee{constructor(e){super(),Pe(this,e,j1,U1,Ae,{color:0,title:1,text:2})}}function H1(t){let e,l=`${Oe(t[0].getDate())}.${Oe(t[0].getMonth()+1)}.${t[0].getFullYear()} ${Oe(t[0].getHours())}:${Oe(t[0].getMinutes())}`,n;return{c(){e=m("span"),n=S(l),r(e,"class",t[1])},m(i,o){M(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l=`${Oe(i[0].getDate())}.${Oe(i[0].getMonth()+1)}.${i[0].getFullYear()} ${Oe(i[0].getHours())}:${Oe(i[0].getMinutes())}`)&&X(n,l),o&2&&r(e,"class",i[1])},d(i){i&&C(e)}}}function W1(t){let e=`${Oe(t[0].getDate())}. ${ro[t[0].getMonth()]} ${Oe(t[0].getHours())}:${Oe(t[0].getMinutes())}`,l;return{c(){l=S(e)},m(n,i){M(n,l,i)},p(n,i){i&1&&e!==(e=`${Oe(n[0].getDate())}. ${ro[n[0].getMonth()]} ${Oe(n[0].getHours())}:${Oe(n[0].getMinutes())}`)&&X(l,e)},d(n){n&&C(l)}}}function z1(t){let e;function l(o,u){return o[2]?W1:H1}let n=l(t),i=n(t);return{c(){i.c(),e=Ge()},m(o,u){i.m(o,u),M(o,e,u)},p(o,[u]){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},i:fe,o:fe,d(o){i.d(o),o&&C(e)}}}function G1(t,e,l){let{timestamp:n}=e,{fullTimeColor:i}=e,{offset:o}=e,u;return t.$$set=a=>{"timestamp"in a&&l(0,n=a.timestamp),"fullTimeColor"in a&&l(1,i=a.fullTimeColor),"offset"in a&&l(3,o=a.offset)},t.$$.update=()=>{t.$$.dirty&9&&(l(2,u=Math.abs(new Date().getTime()-n.getTime())<3e5),isNaN(o)||fl(n,o-(24+n.getHours()-n.getUTCHours())%24))},[n,i,u,o]}class Xc extends Ee{constructor(e){super(),Pe(this,e,G1,z1,Ae,{timestamp:0,fullTimeColor:1,offset:3})}}function V1(t){let e,l,n;return{c(){e=Fe("svg"),l=Fe("path"),n=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 011.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.56.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.893.149c-.425.07-.765.383-.93.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 01-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.397.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 01-.12-1.45l.527-.737c.25-.35.273-.806.108-1.204-.165-.397-.505-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.107-1.204l-.527-.738a1.125 1.125 0 01.12-1.45l.773-.773a1.125 1.125 0 011.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894z"),r(n,"stroke-linecap","round"),r(n,"stroke-linejoin","round"),r(n,"d","M15 12a3 3 0 11-6 0 3 3 0 016 0z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(i,o){M(i,e,o),s(e,l),s(e,n)},p:fe,i:fe,o:fe,d(i){i&&C(e)}}}class K1 extends Ee{constructor(e){super(),Pe(this,e,null,V1,Ae,{})}}function Y1(t){let e,l;return{c(){e=Fe("svg"),l=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){M(n,e,i),s(e,l)},p:fe,i:fe,o:fe,d(n){n&&C(e)}}}class Q1 extends Ee{constructor(e){super(),Pe(this,e,null,Y1,Ae,{})}}function X1(t){let e,l;return{c(){e=Fe("svg"),l=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9 5.25h.008v.008H12v-.008z"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){M(n,e,i),s(e,l)},p:fe,i:fe,o:fe,d(n){n&&C(e)}}}class qt extends Ee{constructor(e){super(),Pe(this,e,null,X1,Ae,{})}}function Z1(t){let e,l;return{c(){e=Fe("svg"),l=Fe("path"),r(l,"stroke-linecap","round"),r(l,"stroke-linejoin","round"),r(l,"d","M9 8.25H7.5a2.25 2.25 0 00-2.25 2.25v9a2.25 2.25 0 002.25 2.25h9a2.25 2.25 0 002.25-2.25v-9a2.25 2.25 0 00-2.25-2.25H15M9 12l3 3m0 0l3-3m-3 3V2.25"),r(e,"xmlns","http://www.w3.org/2000/svg"),r(e,"fill","none"),r(e,"viewBox","0 0 24 24"),r(e,"stroke-width","1.5"),r(e,"stroke","currentColor"),r(e,"class","w-6 h-6")},m(n,i){M(n,e,i),s(e,l)},p:fe,i:fe,o:fe,d(n){n&&C(e)}}}class Zc extends Ee{constructor(e){super(),Pe(this,e,null,Z1,Ae,{})}}function J1(t){let e,l,n=t[1].version+"",i;return{c(){e=S("AMS reader "),l=m("span"),i=S(n)},m(o,u){M(o,e,u),M(o,l,u),s(l,i)},p(o,u){u&2&&n!==(n=o[1].version+"")&&X(i,n)},d(o){o&&C(e),o&&C(l)}}}function ru(t){let e,l=(t[0].t>-50?t[0].t.toFixed(1):"-")+"",n,i;return{c(){e=m("div"),n=S(l),i=S("\xB0C"),r(e,"class","flex-none my-auto")},m(o,u){M(o,e,u),s(e,n),s(e,i)},p(o,u){u&1&&l!==(l=(o[0].t>-50?o[0].t.toFixed(1):"-")+"")&&X(n,l)},d(o){o&&C(e)}}}function au(t){let e,l="HAN: "+xa(t[0].he),n;return{c(){e=m("div"),n=S(l),r(e,"class","bd-red")},m(i,o){M(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="HAN: "+xa(i[0].he))&&X(n,l)},d(i){i&&C(e)}}}function uu(t){let e,l="MQTT: "+eu(t[0].me),n;return{c(){e=m("div"),n=S(l),r(e,"class","bd-red")},m(i,o){M(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="MQTT: "+eu(i[0].me))&&X(n,l)},d(i){i&&C(e)}}}function fu(t){let e,l="PriceAPI: "+tu(t[0].ee),n;return{c(){e=m("div"),n=S(l),r(e,"class","bd-red")},m(i,o){M(i,e,o),s(e,n)},p(i,o){o&1&&l!==(l="PriceAPI: "+tu(i[0].ee))&&X(n,l)},d(i){i&&C(e)}}}function cu(t){let e,l,n,i,o,u;return l=new el({props:{to:"/configuration",$$slots:{default:[x1]},$$scope:{ctx:t}}}),o=new el({props:{to:"/status",$$slots:{default:[em]},$$scope:{ctx:t}}}),{c(){e=m("div"),ie(l.$$.fragment),n=h(),i=m("div"),ie(o.$$.fragment),r(e,"class","flex-none px-1 mt-1"),r(e,"title","Configuration"),r(i,"class","flex-none px-1 mt-1"),r(i,"title","Device information")},m(a,c){M(a,e,c),le(l,e,null),M(a,n,c),M(a,i,c),le(o,i,null),u=!0},i(a){u||(D(l.$$.fragment,a),D(o.$$.fragment,a),u=!0)},o(a){q(l.$$.fragment,a),q(o.$$.fragment,a),u=!1},d(a){a&&C(e),ne(l),a&&C(n),a&&C(i),ne(o)}}}function x1(t){let e,l;return e=new K1({}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function em(t){let e,l;return e=new Q1({}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function mu(t){let e,l,n,i,o;const u=[lm,tm],a=[];function c(f,_){return f[1].security==0||f[0].a?0:1}return l=c(t),n=a[l]=u[l](t),{c(){e=m("div"),n.c(),r(e,"class","flex-none mr-3 text-yellow-500"),r(e,"title",i="New version: "+t[2].tag_name)},m(f,_){M(f,e,_),a[l].m(e,null),o=!0},p(f,_){let p=l;l=c(f),l===p?a[l].p(f,_):(De(),q(a[p],1,1,()=>{a[p]=null}),Ie(),n=a[l],n?n.p(f,_):(n=a[l]=u[l](f),n.c()),D(n,1),n.m(e,null)),(!o||_&4&&i!==(i="New version: "+f[2].tag_name))&&r(e,"title",i)},i(f){o||(D(n),o=!0)},o(f){q(n),o=!1},d(f){f&&C(e),a[l].d()}}}function tm(t){let e,l,n=t[2].tag_name+"",i;return{c(){e=m("span"),l=S("New version: "),i=S(n)},m(o,u){M(o,e,u),s(e,l),s(e,i)},p(o,u){u&4&&n!==(n=o[2].tag_name+"")&&X(i,n)},i:fe,o:fe,d(o){o&&C(e)}}}function lm(t){let e,l,n,i=t[2].tag_name+"",o,u,a,c,f,_;return a=new Zc({}),{c(){e=m("button"),l=m("span"),n=S("New version: "),o=S(i),u=h(),ie(a.$$.fragment),r(l,"class","mt-1"),r(e,"class","flex")},m(p,b){M(p,e,b),s(e,l),s(l,n),s(l,o),s(e,u),le(a,e,null),c=!0,f||(_=ee(e,"click",t[3]),f=!0)},p(p,b){(!c||b&4)&&i!==(i=p[2].tag_name+"")&&X(o,i)},i(p){c||(D(a.$$.fragment,p),c=!0)},o(p){q(a.$$.fragment,p),c=!1},d(p){p&&C(e),ne(a),f=!1,_()}}}function nm(t){let e,l,n,i,o,u,a,c,f,_,p,b,v=(t[0].m?(t[0].m/1e3).toFixed(1):"-")+"",d,$,y,T,N,E,B,P,L,O,F,x,j,z,G,V,W,U,K,H,Y,Z,re,ue,we,me,Te,je,Re,He;i=new el({props:{to:"/",$$slots:{default:[J1]},$$scope:{ctx:t}}}),c=new B1({props:{epoch:t[0].u}});let ye=t[0].t>-50&&ru(t);N=new mn({props:{title:"ESP",text:t[1].booting?"Booting":t[0].v>2?t[0].v.toFixed(2)+"V":"ESP",color:ql(t[1].booting?2:t[0].em)}}),B=new mn({props:{title:"HAN",text:"HAN",color:ql(t[1].booting?9:t[0].hm)}}),L=new mn({props:{title:"WiFi",text:t[0].r?t[0].r.toFixed(0)+"dBm":"WiFi",color:ql(t[1].booting?9:t[0].wm)}}),F=new mn({props:{title:"MQTT",text:"MQTT",color:ql(t[1].booting?9:t[0].mm)}});let Ne=(t[0].he<0||t[0].he>0)&&au(t),Le=t[0].me<0&&uu(t),$e=(t[0].ee>0||t[0].ee<0)&&fu(t);re=new Xc({props:{timestamp:t[0].c?new Date(t[0].c*1e3):new Date(0),offset:t[1].clock_offset,fullTimeColor:"text-red-500"}});let w=t[1].vndcfg&&t[1].usrcfg&&cu(t);je=new qt({});let g=t[1].fwconsent===1&&t[2]&&mu(t);return{c(){e=m("nav"),l=m("div"),n=m("div"),ie(i.$$.fragment),o=h(),u=m("div"),a=m("div"),ie(c.$$.fragment),f=h(),ye&&ye.c(),_=h(),p=m("div"),b=S("Free mem: "),d=S(v),$=S("kb"),y=h(),T=m("div"),ie(N.$$.fragment),E=h(),ie(B.$$.fragment),P=h(),ie(L.$$.fragment),O=h(),ie(F.$$.fragment),x=h(),Ne&&Ne.c(),j=h(),Le&&Le.c(),z=h(),$e&&$e.c(),G=h(),V=m("div"),W=m("div"),U=m("a"),K=m("img"),Y=h(),Z=m("div"),ie(re.$$.fragment),ue=h(),w&&w.c(),we=h(),me=m("div"),Te=m("a"),ie(je.$$.fragment),Re=h(),g&&g.c(),r(n,"class","flex text-lg text-gray-100 p-2"),r(a,"class","flex-none my-auto"),r(p,"class","flex-none my-auto"),r(u,"class","flex-none my-auto p-2 flex space-x-4"),r(T,"class","flex-auto flex-wrap my-auto justify-center p-2"),r(K,"class","gh-logo"),lo(K.src,H=A1)||r(K,"src",H),r(K,"alt","GitHub repo"),r(U,"class","float-right"),r(U,"href","https://github.com/UtilitechAS/amsreader-firmware"),r(U,"target","_blank"),r(U,"rel","noreferrer"),r(U,"aria-label","GitHub"),r(W,"class","flex-none"),r(Z,"class","flex-none my-auto px-2"),r(Te,"href",Bt("")),r(Te,"target","_blank"),r(Te,"rel","noreferrer"),r(me,"class","flex-none px-1 mt-1"),r(me,"title","Documentation"),r(V,"class","flex-auto p-2 flex flex-row-reverse flex-wrap"),r(l,"class","flex flex-wrap space-x-4 text-sm text-gray-300"),r(e,"class","bg-violet-600 p-1 rounded-md mx-2")},m(k,A){M(k,e,A),s(e,l),s(l,n),le(i,n,null),s(l,o),s(l,u),s(u,a),le(c,a,null),s(u,f),ye&&ye.m(u,null),s(u,_),s(u,p),s(p,b),s(p,d),s(p,$),s(l,y),s(l,T),le(N,T,null),s(T,E),le(B,T,null),s(T,P),le(L,T,null),s(T,O),le(F,T,null),s(l,x),Ne&&Ne.m(l,null),s(l,j),Le&&Le.m(l,null),s(l,z),$e&&$e.m(l,null),s(l,G),s(l,V),s(V,W),s(W,U),s(U,K),s(V,Y),s(V,Z),le(re,Z,null),s(V,ue),w&&w.m(V,null),s(V,we),s(V,me),s(me,Te),le(je,Te,null),s(V,Re),g&&g.m(V,null),He=!0},p(k,[A]){const I={};A&18&&(I.$$scope={dirty:A,ctx:k}),i.$set(I);const Q={};A&1&&(Q.epoch=k[0].u),c.$set(Q),k[0].t>-50?ye?ye.p(k,A):(ye=ru(k),ye.c(),ye.m(u,_)):ye&&(ye.d(1),ye=null),(!He||A&1)&&v!==(v=(k[0].m?(k[0].m/1e3).toFixed(1):"-")+"")&&X(d,v);const J={};A&3&&(J.text=k[1].booting?"Booting":k[0].v>2?k[0].v.toFixed(2)+"V":"ESP"),A&3&&(J.color=ql(k[1].booting?2:k[0].em)),N.$set(J);const se={};A&3&&(se.color=ql(k[1].booting?9:k[0].hm)),B.$set(se);const ce={};A&1&&(ce.text=k[0].r?k[0].r.toFixed(0)+"dBm":"WiFi"),A&3&&(ce.color=ql(k[1].booting?9:k[0].wm)),L.$set(ce);const ve={};A&3&&(ve.color=ql(k[1].booting?9:k[0].mm)),F.$set(ve),k[0].he<0||k[0].he>0?Ne?Ne.p(k,A):(Ne=au(k),Ne.c(),Ne.m(l,j)):Ne&&(Ne.d(1),Ne=null),k[0].me<0?Le?Le.p(k,A):(Le=uu(k),Le.c(),Le.m(l,z)):Le&&(Le.d(1),Le=null),k[0].ee>0||k[0].ee<0?$e?$e.p(k,A):($e=fu(k),$e.c(),$e.m(l,G)):$e&&($e.d(1),$e=null);const Se={};A&1&&(Se.timestamp=k[0].c?new Date(k[0].c*1e3):new Date(0)),A&2&&(Se.offset=k[1].clock_offset),re.$set(Se),k[1].vndcfg&&k[1].usrcfg?w?A&2&&D(w,1):(w=cu(k),w.c(),D(w,1),w.m(V,we)):w&&(De(),q(w,1,1,()=>{w=null}),Ie()),k[1].fwconsent===1&&k[2]?g?(g.p(k,A),A&6&&D(g,1)):(g=mu(k),g.c(),D(g,1),g.m(V,null)):g&&(De(),q(g,1,1,()=>{g=null}),Ie())},i(k){He||(D(i.$$.fragment,k),D(c.$$.fragment,k),D(N.$$.fragment,k),D(B.$$.fragment,k),D(L.$$.fragment,k),D(F.$$.fragment,k),D(re.$$.fragment,k),D(w),D(je.$$.fragment,k),D(g),He=!0)},o(k){q(i.$$.fragment,k),q(c.$$.fragment,k),q(N.$$.fragment,k),q(B.$$.fragment,k),q(L.$$.fragment,k),q(F.$$.fragment,k),q(re.$$.fragment,k),q(w),q(je.$$.fragment,k),q(g),He=!1},d(k){k&&C(e),ne(i),ne(c),ye&&ye.d(),ne(N),ne(B),ne(L),ne(F),Ne&&Ne.d(),Le&&Le.d(),$e&&$e.d(),ne(re),w&&w.d(),ne(je),g&&g.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+"?")&&(!ui(i.board)||confirm(As(be(i.chip,i.board))))&&(Ut.update(a=>(a.upgrading=!0,a)),Yc(o.tag_name))}return Ut.subscribe(a=>{l(1,i=a),a.fwconsent===1&&N1()}),Po.subscribe(a=>{l(2,o=Qc(i.version,a))}),t.$$set=a=>{"data"in a&&l(0,n=a.data)},[n,i,o,u]}class sm extends Ee{constructor(e){super(),Pe(this,e,im,nm,Ae,{data:0})}}function om(t){let e,l,n,i;return{c(){e=Fe("svg"),l=Fe("path"),n=Fe("path"),r(l,"d",to(150,150,115,210,510)),r(l,"stroke","#eee"),r(l,"fill","none"),r(l,"stroke-width","55"),r(n,"d",i=to(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){M(o,e,u),s(e,l),s(e,n)},p(o,[u]){u&1&&i!==(i=to(150,150,115,210,210+300*o[0]/100))&&r(n,"d",i),u&2&&r(n,"stroke",o[1])},i:fe,o:fe,d(o){o&&C(e)}}}function pu(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 to(t,e,l,n,i){var o=pu(t,e,l,i),u=pu(t,e,l,n),a=i-n<=180?"0":"1",c=["M",o.x,o.y,"A",l,l,0,a,0,u.x,u.y].join(" ");return c}function 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 Ee{constructor(e){super(),Pe(this,e,rm,om,Ae,{pct:0,color:1})}}function _u(t){let e,l,n,i,o,u,a,c;return{c(){e=m("br"),l=h(),n=m("span"),i=S(t[3]),o=h(),u=m("span"),a=S(t[4]),c=S("/kWh"),r(n,"class","pl-sub"),r(u,"class","pl-snt")},m(f,_){M(f,e,_),M(f,l,_),M(f,n,_),s(n,i),M(f,o,_),M(f,u,_),s(u,a),s(u,c)},p(f,_){_&8&&X(i,f[3]),_&16&&X(a,f[4])},d(f){f&&C(e),f&&C(l),f&&C(n),f&&C(o),f&&C(u)}}}function um(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y;l=new am({props:{pct:t[6],color:t[5](t[6])}});let T=t[3]&&_u(t);return{c(){e=m("div"),ie(l.$$.fragment),n=h(),i=m("span"),o=m("span"),u=S(t[2]),a=h(),c=m("br"),f=h(),_=m("span"),p=S(t[0]),b=h(),v=m("span"),d=S(t[1]),$=h(),T&&T.c(),r(o,"class","pl-lab"),r(_,"class","pl-val"),r(v,"class","pl-unt"),r(i,"class","pl-ov"),r(e,"class","pl-root")},m(N,E){M(N,e,E),le(l,e,null),s(e,n),s(e,i),s(i,o),s(o,u),s(i,a),s(i,c),s(i,f),s(i,_),s(_,p),s(i,b),s(i,v),s(v,d),s(i,$),T&&T.m(i,null),y=!0},p(N,[E]){const B={};E&64&&(B.pct=N[6]),E&96&&(B.color=N[5](N[6])),l.$set(B),(!y||E&4)&&X(u,N[2]),(!y||E&1)&&X(p,N[0]),(!y||E&2)&&X(d,N[1]),N[3]?T?T.p(N,E):(T=_u(N),T.c(),T.m(i,null)):T&&(T.d(1),T=null)},i(N){y||(D(l.$$.fragment,N),y=!0)},o(N){q(l.$$.fragment,N),y=!1},d(N){N&&C(e),ne(l),T&&T.d()}}}function fm(t,e,l){let{val:n}=e,{max:i}=e,{unit:o}=e,{label:u}=e,{sub:a=""}=e,{subunit:c=""}=e,{colorFn:f}=e,_=0;return t.$$set=p=>{"val"in p&&l(0,n=p.val),"max"in p&&l(7,i=p.max),"unit"in p&&l(1,o=p.unit),"label"in p&&l(2,u=p.label),"sub"in p&&l(3,a=p.sub),"subunit"in p&&l(4,c=p.subunit),"colorFn"in p&&l(5,f=p.colorFn)},t.$$.update=()=>{t.$$.dirty&129&&l(6,_=Math.min(n,i)/i*100)},[n,o,u,a,c,f,_,i]}class Jc extends Ee{constructor(e){super(),Pe(this,e,fm,um,Ae,{val:0,max:7,unit:1,label:2,sub:3,subunit:4,colorFn:5})}}function du(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function vu(t,e,l){const n=t.slice();return n[9]=e[l],n[11]=l,n}function hu(t,e,l){const n=t.slice();return n[13]=e[l],n}function bu(t){let e,l,n,i,o,u,a=t[0].title&&gu(t),c=t[0].y.ticks,f=[];for(let d=0;d20||t[11]%2==0)&&Cu(t);return{c(){e=Fe("g"),n&&n.c(),r(e,"class","tick"),r(e,"transform",l="translate("+t[5](t[11])+","+t[4]+")")},m(i,o){M(i,e,o),n&&n.m(e,null)},p(i,o){i[3]>20||i[11]%2==0?n?n.p(i,o):(n=Cu(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o&48&&l!==(l="translate("+i[5](i[11])+","+i[4]+")")&&r(e,"transform",l)},d(i){i&&C(e),n&&n.d()}}}function Cu(t){let e,l=t[9].label+"",n,i;return{c(){e=Fe("text"),n=S(l),r(e,"x",i=t[3]/2),r(e,"y","-4")},m(o,u){M(o,e,u),s(e,n)},p(o,u){u&1&&l!==(l=o[9].label+"")&&X(n,l),u&8&&i!==(i=o[3]/2)&&r(e,"x",i)},d(o){o&&C(e)}}}function Mu(t){let e=!isNaN(t[5](t[11])),l,n=e&&yu(t);return{c(){n&&n.c(),l=Ge()},m(i,o){n&&n.m(i,o),M(i,l,o)},p(i,o){o&32&&(e=!isNaN(i[5](i[11]))),e?n?n.p(i,o):(n=yu(i),n.c(),n.m(l.parentNode,l)):n&&(n.d(1),n=null)},d(i){n&&n.d(i),i&&C(l)}}}function $u(t){let e,l,n=t[9].value!==void 0&&Su(t),i=t[9].value2>1e-4&&Au(t);return{c(){e=Fe("g"),n&&n.c(),l=Fe("g"),i&&i.c()},m(o,u){M(o,e,u),n&&n.m(e,null),M(o,l,u),i&&i.m(l,null)},p(o,u){o[9].value!==void 0?n?n.p(o,u):(n=Su(o),n.c(),n.m(e,null)):n&&(n.d(1),n=null),o[9].value2>1e-4?i?i.p(o,u):(i=Au(o),i.c(),i.m(l,null)):i&&(i.d(1),i=null)},d(o){o&&C(e),n&&n.d(),o&&C(l),i&&i.d()}}}function Su(t){let e,l,n,i,o,u,a,c=t[3]>15&&Tu(t);return{c(){e=Fe("rect"),c&&c.c(),a=Ge(),r(e,"x",l=t[5](t[11])+2),r(e,"y",n=t[6](t[9].value)),r(e,"width",i=t[3]-4),r(e,"height",o=t[6](t[0].y.min)-t[6](Math.min(t[0].y.min,0)+t[9].value)),r(e,"fill",u=t[9].color)},m(f,_){M(f,e,_),c&&c.m(f,_),M(f,a,_)},p(f,_){_&32&&l!==(l=f[5](f[11])+2)&&r(e,"x",l),_&65&&n!==(n=f[6](f[9].value))&&r(e,"y",n),_&8&&i!==(i=f[3]-4)&&r(e,"width",i),_&65&&o!==(o=f[6](f[0].y.min)-f[6](Math.min(f[0].y.min,0)+f[9].value))&&r(e,"height",o),_&1&&u!==(u=f[9].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,_):(c=Tu(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&C(e),c&&c.d(f),f&&C(a)}}}function Tu(t){let e,l=t[9].label+"",n,i,o,u,a,c,f=t[9].title&&Nu(t);return{c(){e=Fe("text"),n=S(l),f&&f.c(),c=Ge(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor",o=t[3]t[6](0)-t[7]?t[9].color:"white"),r(e,"transform",a="translate("+(t[5](t[11])+t[3]/2)+" "+(t[6](t[9].value)>t[6](0)-t[7]?t[6](t[9].value)-t[7]:t[6](t[9].value)+10)+") rotate("+(t[3]_[6](0)-_[7]?_[9].color:"white")&&r(e,"fill",u),p&233&&a!==(a="translate("+(_[5](_[11])+_[3]/2)+" "+(_[6](_[9].value)>_[6](0)-_[7]?_[6](_[9].value)-_[7]:_[6](_[9].value)+10)+") rotate("+(_[3]15&&Pu(t);return{c(){e=Fe("rect"),c&&c.c(),a=Ge(),r(e,"x",l=t[5](t[11])+2),r(e,"y",n=t[6](0)),r(e,"width",i=t[3]-4),r(e,"height",o=t[6](t[0].y.min)-t[6](t[0].y.min+t[9].value2)),r(e,"fill",u=t[9].color2?t[9].color2:t[9].color)},m(f,_){M(f,e,_),c&&c.m(f,_),M(f,a,_)},p(f,_){_&32&&l!==(l=f[5](f[11])+2)&&r(e,"x",l),_&64&&n!==(n=f[6](0))&&r(e,"y",n),_&8&&i!==(i=f[3]-4)&&r(e,"width",i),_&65&&o!==(o=f[6](f[0].y.min)-f[6](f[0].y.min+f[9].value2))&&r(e,"height",o),_&1&&u!==(u=f[9].color2?f[9].color2:f[9].color)&&r(e,"fill",u),f[3]>15?c?c.p(f,_):(c=Pu(f),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(f){f&&C(e),c&&c.d(f),f&&C(a)}}}function Pu(t){let e,l=t[9].label2+"",n,i,o,u,a,c=t[9].title2&&Eu(t);return{c(){e=Fe("text"),n=S(l),c&&c.c(),a=Ge(),r(e,"width",i=t[3]-4),r(e,"dominant-baseline","middle"),r(e,"text-anchor","middle"),r(e,"fill",o=t[6](-t[9].value2)t[8].call(e))},m(i,o){M(i,e,o),n&&n.m(e,null),l=c0(e,t[8].bind(e))},p(i,[o]){i[0].x.ticks&&i[0].points&&i[4]?n?n.p(i,o):(n=bu(i),n.c(),n.m(e,null)):n&&(n.d(1),n=null)},i:fe,o:fe,d(i){i&&C(e),n&&n.d(),l()}}}let pn=30;function mm(t,e,l){let{config:n}=e,i,o,u,a,c,f,_;function p(){i=this.clientWidth,o=this.clientHeight,l(1,i),l(2,o)}return t.$$set=b=>{"config"in b&&l(0,n=b.config)},t.$$.update=()=>{if(t.$$.dirty&31){l(4,f=o-(n.title?20:0));let b=i-(n.padding.left+n.padding.right);l(3,u=b/n.points.length),l(7,_=un.y.max?$=n.padding.bottom:df||$<0?0:$})}},[n,i,o,u,f,a,c,_,p]}class dn extends Ee{constructor(e){super(),Pe(this,e,mm,cm,Ae,{config:0})}}function pm(t){let e,l;return e=new dn({props:{config:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function _m(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{ds:u}=e,a={};function c(f){return{label:ge(f)+"V",title:f.toFixed(1)+" V",value:isNaN(f)?0:f,color:M1(f||0)}}return t.$$set=f=>{"u1"in f&&l(1,n=f.u1),"u2"in f&&l(2,i=f.u2),"u3"in f&&l(3,o=f.u3),"ds"in f&&l(4,u=f.ds)},t.$$.update=()=>{if(t.$$.dirty&30){let f=[],_=[];n>0&&(f.push({label:u===1?"L1-L2":"L1"}),_.push(c(n))),i>0&&(f.push({label:u===1?"L1-L3":"L2"}),_.push(c(i))),o>0&&(f.push({label:u===1?"L2-L3":"L3"}),_.push(c(o))),l(0,a={padding:{top:20,right:15,bottom:20,left:35},y:{min:200,max:260,ticks:[{value:207,label:"-10%"},{value:230,label:"230v"},{value:253,label:"+10%"}]},x:{ticks:f},points:_})}},[a,n,i,o,u]}class dm extends Ee{constructor(e){super(),Pe(this,e,_m,pm,Ae,{u1:1,u2:2,u3:3,ds:4})}}function vm(t){let e,l;return e=new dn({props:{config:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function hm(t,e,l){let{u1:n}=e,{u2:i}=e,{u3:o}=e,{i1:u}=e,{i2:a}=e,{i3:c}=e,{max:f}=e,_={};function p(b){return{label:ge(b)+"A",title:b.toFixed(1)+" A",value:isNaN(b)?0:b,color:Bc(b?b/f*100:0)}}return t.$$set=b=>{"u1"in b&&l(1,n=b.u1),"u2"in b&&l(2,i=b.u2),"u3"in b&&l(3,o=b.u3),"i1"in b&&l(4,u=b.i1),"i2"in b&&l(5,a=b.i2),"i3"in b&&l(6,c=b.i3),"max"in b&&l(7,f=b.max)},t.$$.update=()=>{if(t.$$.dirty&254){let b=[],v=[];n>0&&(b.push({label:"L1"}),v.push(p(u))),i>0&&(b.push({label:"L2"}),v.push(p(a))),o>0&&(b.push({label:"L3"}),v.push(p(c))),l(0,_={padding:{top:20,right:15,bottom:20,left:35},y:{min:0,max:f,ticks:[{value:0,label:"0%"},{value:f/4,label:"25%"},{value:f/2,label:"50%"},{value:f/4*3,label:"75%"},{value:f,label:"100%"}]},x:{ticks:b},points:v})}},[_,n,i,o,u,a,c,f]}class bm extends Ee{constructor(e){super(),Pe(this,e,hm,vm,Ae,{u1:1,u2:2,u3:3,i1:4,i2:5,i3:6,max:7})}}function gm(t){let e,l,n,i,o,u,a,c=(typeof t[0]<"u"?t[0].toFixed(0):"-")+"",f,_,p,b,v,d,$=(typeof t[1]<"u"?t[1].toFixed(0):"-")+"",y,T,N,E,B,P,L,O=(typeof t[2]<"u"?t[2].toFixed(1):"-")+"",F,x,j,z,G,V,W=(typeof t[3]<"u"?t[3].toFixed(1):"-")+"",U,K;return{c(){e=m("div"),l=m("strong"),l.textContent="Reactive",n=h(),i=m("div"),o=m("div"),o.textContent="Instant in",u=h(),a=m("div"),f=S(c),_=S(" VAr"),p=h(),b=m("div"),b.textContent="Instant out",v=h(),d=m("div"),y=S($),T=S(" VAr"),N=h(),E=m("div"),B=m("div"),B.textContent="Total in",P=h(),L=m("div"),F=S(O),x=S(" kVArh"),j=h(),z=m("div"),z.textContent="Total out",G=h(),V=m("div"),U=S(W),K=S(" kVArh"),r(a,"class","text-right"),r(d,"class","text-right"),r(i,"class","grid grid-cols-2 mt-4"),r(L,"class","text-right"),r(V,"class","text-right"),r(E,"class","grid grid-cols-2 mt-4"),r(e,"class","mx-2 text-sm")},m(H,Y){M(H,e,Y),s(e,l),s(e,n),s(e,i),s(i,o),s(i,u),s(i,a),s(a,f),s(a,_),s(i,p),s(i,b),s(i,v),s(i,d),s(d,y),s(d,T),s(e,N),s(e,E),s(E,B),s(E,P),s(E,L),s(L,F),s(L,x),s(E,j),s(E,z),s(E,G),s(E,V),s(V,U),s(V,K)},p(H,[Y]){Y&1&&c!==(c=(typeof H[0]<"u"?H[0].toFixed(0):"-")+"")&&X(f,c),Y&2&&$!==($=(typeof H[1]<"u"?H[1].toFixed(0):"-")+"")&&X(y,$),Y&4&&O!==(O=(typeof H[2]<"u"?H[2].toFixed(1):"-")+"")&&X(F,O),Y&8&&W!==(W=(typeof H[3]<"u"?H[3].toFixed(1):"-")+"")&&X(U,W)},i:fe,o:fe,d(H){H&&C(e)}}}function 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 Ee{constructor(e){super(),Pe(this,e,km,gm,Ae,{importInstant:0,exportInstant:1,importTotal:2,exportTotal:3})}}function Iu(t){let e;function l(o,u){return o[3]?Cm:ym}let n=l(t),i=n(t);return{c(){i.c(),e=Ge()},m(o,u){i.m(o,u),M(o,e,u)},p(o,u){n===(n=l(o))&&i?i.p(o,u):(i.d(1),i=n(o),i&&(i.c(),i.m(e.parentNode,e)))},d(o){i.d(o),o&&C(e)}}}function ym(t){let e,l,n,i,o,u,a=ge(t[1].h.u,2)+"",c,f,_,p,b,v,d=ge(t[1].d.u,1)+"",$,y,T,N,E,B,P=ge(t[1].m.u)+"",L,O,F,x,j,z,G=ge(t[0].last_month.u)+"",V,W,U,K,H=t[4]&&Ru(t);return{c(){e=m("strong"),e.textContent="Consumption",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=S(a),f=S(" kWh"),_=h(),p=m("div"),p.textContent="Day",b=h(),v=m("div"),$=S(d),y=S(" kWh"),T=h(),N=m("div"),N.textContent="Month",E=h(),B=m("div"),L=S(P),O=S(" kWh"),F=h(),x=m("div"),x.textContent="Last month",j=h(),z=m("div"),V=S(G),W=S(" kWh"),U=h(),H&&H.c(),K=Ge(),r(u,"class","text-right"),r(v,"class","text-right"),r(B,"class","text-right"),r(z,"class","text-right"),r(n,"class","grid grid-cols-2 mb-3")},m(Y,Z){M(Y,e,Z),M(Y,l,Z),M(Y,n,Z),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,_),s(n,p),s(n,b),s(n,v),s(v,$),s(v,y),s(n,T),s(n,N),s(n,E),s(n,B),s(B,L),s(B,O),s(n,F),s(n,x),s(n,j),s(n,z),s(z,V),s(z,W),M(Y,U,Z),H&&H.m(Y,Z),M(Y,K,Z)},p(Y,Z){Z&2&&a!==(a=ge(Y[1].h.u,2)+"")&&X(c,a),Z&2&&d!==(d=ge(Y[1].d.u,1)+"")&&X($,d),Z&2&&P!==(P=ge(Y[1].m.u)+"")&&X(L,P),Z&1&&G!==(G=ge(Y[0].last_month.u)+"")&&X(V,G),Y[4]?H?H.p(Y,Z):(H=Ru(Y),H.c(),H.m(K.parentNode,K)):H&&(H.d(1),H=null)},d(Y){Y&&C(e),Y&&C(l),Y&&C(n),Y&&C(U),H&&H.d(Y),Y&&C(K)}}}function Cm(t){let e,l,n,i,o,u,a=ge(t[1].h.u,2)+"",c,f,_,p,b,v,d,$=ge(t[1].d.u,1)+"",y,T,N,E,B,P,L,O=ge(t[1].m.u)+"",F,x,j,z,G,V,W,U=ge(t[0].last_month.u)+"",K,H,Y,Z,re,ue,we,me,Te,je,Re,He=ge(t[1].h.p,2)+"",ye,Ne,Le,$e,w,g,k,A=ge(t[1].d.p,1)+"",I,Q,J,se,ce,ve,Se,oe=ge(t[1].m.p)+"",pe,Be,_e,Ce,vt,Hl,tl,ct=ge(t[0].last_month.p)+"",Sl,pl,jt,ht,Ye=t[4]&&Lu(t),Qe=t[4]&&Ou(t),Xe=t[4]&&Fu(t),Ue=t[4]&&qu(t),Ze=t[4]&&Bu(t),We=t[4]&&Uu(t),Je=t[4]&&ju(t),xe=t[4]&&Hu(t);return{c(){e=m("strong"),e.textContent="Import",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=S(a),f=S(" kWh"),_=h(),Ye&&Ye.c(),p=h(),b=m("div"),b.textContent="Day",v=h(),d=m("div"),y=S($),T=S(" kWh"),N=h(),Qe&&Qe.c(),E=h(),B=m("div"),B.textContent="Month",P=h(),L=m("div"),F=S(O),x=S(" kWh"),j=h(),Xe&&Xe.c(),z=h(),G=m("div"),G.textContent="Last mo.",V=h(),W=m("div"),K=S(U),H=S(" kWh"),Y=h(),Ue&&Ue.c(),re=h(),ue=m("strong"),ue.textContent="Export",we=h(),me=m("div"),Te=m("div"),Te.textContent="Hour",je=h(),Re=m("div"),ye=S(He),Ne=S(" kWh"),Le=h(),Ze&&Ze.c(),$e=h(),w=m("div"),w.textContent="Day",g=h(),k=m("div"),I=S(A),Q=S(" kWh"),J=h(),We&&We.c(),se=h(),ce=m("div"),ce.textContent="Month",ve=h(),Se=m("div"),pe=S(oe),Be=S(" kWh"),_e=h(),Je&&Je.c(),Ce=h(),vt=m("div"),vt.textContent="Last mo.",Hl=h(),tl=m("div"),Sl=S(ct),pl=S(" kWh"),jt=h(),xe&&xe.c(),r(u,"class","text-right"),r(d,"class","text-right"),r(L,"class","text-right"),r(W,"class","text-right"),r(n,"class",Z="grid grid-cols-"+t[5]+" mb-3"),r(Re,"class","text-right"),r(k,"class","text-right"),r(Se,"class","text-right"),r(tl,"class","text-right"),r(me,"class",ht="grid grid-cols-"+t[5])},m(de,Me){M(de,e,Me),M(de,l,Me),M(de,n,Me),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(n,_),Ye&&Ye.m(n,null),s(n,p),s(n,b),s(n,v),s(n,d),s(d,y),s(d,T),s(n,N),Qe&&Qe.m(n,null),s(n,E),s(n,B),s(n,P),s(n,L),s(L,F),s(L,x),s(n,j),Xe&&Xe.m(n,null),s(n,z),s(n,G),s(n,V),s(n,W),s(W,K),s(W,H),s(n,Y),Ue&&Ue.m(n,null),M(de,re,Me),M(de,ue,Me),M(de,we,Me),M(de,me,Me),s(me,Te),s(me,je),s(me,Re),s(Re,ye),s(Re,Ne),s(me,Le),Ze&&Ze.m(me,null),s(me,$e),s(me,w),s(me,g),s(me,k),s(k,I),s(k,Q),s(me,J),We&&We.m(me,null),s(me,se),s(me,ce),s(me,ve),s(me,Se),s(Se,pe),s(Se,Be),s(me,_e),Je&&Je.m(me,null),s(me,Ce),s(me,vt),s(me,Hl),s(me,tl),s(tl,Sl),s(tl,pl),s(me,jt),xe&&xe.m(me,null)},p(de,Me){Me&2&&a!==(a=ge(de[1].h.u,2)+"")&&X(c,a),de[4]?Ye?Ye.p(de,Me):(Ye=Lu(de),Ye.c(),Ye.m(n,p)):Ye&&(Ye.d(1),Ye=null),Me&2&&$!==($=ge(de[1].d.u,1)+"")&&X(y,$),de[4]?Qe?Qe.p(de,Me):(Qe=Ou(de),Qe.c(),Qe.m(n,E)):Qe&&(Qe.d(1),Qe=null),Me&2&&O!==(O=ge(de[1].m.u)+"")&&X(F,O),de[4]?Xe?Xe.p(de,Me):(Xe=Fu(de),Xe.c(),Xe.m(n,z)):Xe&&(Xe.d(1),Xe=null),Me&1&&U!==(U=ge(de[0].last_month.u)+"")&&X(K,U),de[4]?Ue?Ue.p(de,Me):(Ue=qu(de),Ue.c(),Ue.m(n,null)):Ue&&(Ue.d(1),Ue=null),Me&32&&Z!==(Z="grid grid-cols-"+de[5]+" mb-3")&&r(n,"class",Z),Me&2&&He!==(He=ge(de[1].h.p,2)+"")&&X(ye,He),de[4]?Ze?Ze.p(de,Me):(Ze=Bu(de),Ze.c(),Ze.m(me,$e)):Ze&&(Ze.d(1),Ze=null),Me&2&&A!==(A=ge(de[1].d.p,1)+"")&&X(I,A),de[4]?We?We.p(de,Me):(We=Uu(de),We.c(),We.m(me,se)):We&&(We.d(1),We=null),Me&2&&oe!==(oe=ge(de[1].m.p)+"")&&X(pe,oe),de[4]?Je?Je.p(de,Me):(Je=ju(de),Je.c(),Je.m(me,Ce)):Je&&(Je.d(1),Je=null),Me&1&&ct!==(ct=ge(de[0].last_month.p)+"")&&X(Sl,ct),de[4]?xe?xe.p(de,Me):(xe=Hu(de),xe.c(),xe.m(me,null)):xe&&(xe.d(1),xe=null),Me&32&&ht!==(ht="grid grid-cols-"+de[5])&&r(me,"class",ht)},d(de){de&&C(e),de&&C(l),de&&C(n),Ye&&Ye.d(),Qe&&Qe.d(),Xe&&Xe.d(),Ue&&Ue.d(),de&&C(re),de&&C(ue),de&&C(we),de&&C(me),Ze&&Ze.d(),We&&We.d(),Je&&Je.d(),xe&&xe.d()}}}function Ru(t){let e,l,n,i,o,u,a=ge(t[1].h.c,2)+"",c,f,_,p,b,v,d,$=ge(t[1].d.c,1)+"",y,T,N,E,B,P,L,O=ge(t[1].m.c)+"",F,x,j,z,G,V,W,U=ge(t[0].last_month.c)+"",K,H,Y;return{c(){e=m("strong"),e.textContent="Cost",l=h(),n=m("div"),i=m("div"),i.textContent="Hour",o=h(),u=m("div"),c=S(a),f=h(),_=S(t[2]),p=h(),b=m("div"),b.textContent="Day",v=h(),d=m("div"),y=S($),T=h(),N=S(t[2]),E=h(),B=m("div"),B.textContent="Month",P=h(),L=m("div"),F=S(O),x=h(),j=S(t[2]),z=h(),G=m("div"),G.textContent="Last month",V=h(),W=m("div"),K=S(U),H=h(),Y=S(t[2]),r(u,"class","text-right"),r(d,"class","text-right"),r(L,"class","text-right"),r(W,"class","text-right"),r(n,"class","grid grid-cols-2")},m(Z,re){M(Z,e,re),M(Z,l,re),M(Z,n,re),s(n,i),s(n,o),s(n,u),s(u,c),s(u,f),s(u,_),s(n,p),s(n,b),s(n,v),s(n,d),s(d,y),s(d,T),s(d,N),s(n,E),s(n,B),s(n,P),s(n,L),s(L,F),s(L,x),s(L,j),s(n,z),s(n,G),s(n,V),s(n,W),s(W,K),s(W,H),s(W,Y)},p(Z,re){re&2&&a!==(a=ge(Z[1].h.c,2)+"")&&X(c,a),re&4&&X(_,Z[2]),re&2&&$!==($=ge(Z[1].d.c,1)+"")&&X(y,$),re&4&&X(N,Z[2]),re&2&&O!==(O=ge(Z[1].m.c)+"")&&X(F,O),re&4&&X(j,Z[2]),re&1&&U!==(U=ge(Z[0].last_month.c)+"")&&X(K,U),re&4&&X(Y,Z[2])},d(Z){Z&&C(e),Z&&C(l),Z&&C(n)}}}function Lu(t){let e,l=ge(t[1].h.c,2)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].h.c,2)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Ou(t){let e,l=ge(t[1].d.c,1)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].d.c,1)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Fu(t){let e,l=ge(t[1].m.c)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].m.c)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function qu(t){let e,l=ge(t[0].last_month.c)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ge(u[0].last_month.c)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Bu(t){let e,l=ge(t[1].h.i,2)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].h.i,2)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Uu(t){let e,l=ge(t[1].d.i,1)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].d.i,1)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function ju(t){let e,l=ge(t[1].m.i)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&2&&l!==(l=ge(u[1].m.i)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Hu(t){let e,l=ge(t[0].last_month.i)+"",n,i,o;return{c(){e=m("div"),n=S(l),i=h(),o=S(t[2]),r(e,"class","text-right")},m(u,a){M(u,e,a),s(e,n),s(e,i),s(e,o)},p(u,a){a&1&&l!==(l=ge(u[0].last_month.i)+"")&&X(n,l),a&4&&X(o,u[2])},d(u){u&&C(e)}}}function Mm(t){let e,l,n,i,o,u,a=t[1]&&Iu(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Real time calculation",n=h(),i=m("br"),o=m("br"),u=h(),a&&a.c(),r(e,"class","mx-2 text-sm")},m(c,f){M(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),s(e,u),a&&a.m(e,null)},p(c,[f]){c[1]?a?a.p(c,f):(a=Iu(c),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},i:fe,o:fe,d(c){c&&C(e),a&&a.d()}}}function $m(t,e,l){let{sysinfo:n}=e,{data:i}=e,{currency:o}=e,{hasExport:u}=e,a=!1,c=3;return t.$$set=f=>{"sysinfo"in f&&l(0,n=f.sysinfo),"data"in f&&l(1,i=f.data),"currency"in f&&l(2,o=f.currency),"hasExport"in f&&l(3,u=f.hasExport)},t.$$.update=()=>{t.$$.dirty&18&&(l(4,a=i&&i.h&&(Math.abs(i.h.c)>.01||Math.abs(i.d.c)>.01||Math.abs(i.m.c)>.01||Math.abs(i.h.i)>.01||Math.abs(i.d.i)>.01||Math.abs(i.m.i)>.01)),l(5,c=a?3:2))},[n,i,o,u,a,c]}class Sm extends Ee{constructor(e){super(),Pe(this,e,$m,Mm,Ae,{sysinfo:0,data:1,currency:2,hasExport:3})}}function Tm(t){let e,l,n=nu(t[0].source)+"",i,o,u,a;return u=new dn({props:{config:t[1]}}),{c(){e=m("a"),l=S("Provided by: "),i=S(n),o=h(),ie(u.$$.fragment),r(e,"href","https://transparency.entsoe.eu/"),r(e,"target","_blank"),r(e,"class","text-xs float-right z-40")},m(c,f){M(c,e,f),s(e,l),s(e,i),M(c,o,f),le(u,c,f),a=!0},p(c,[f]){(!a||f&1)&&n!==(n=nu(c[0].source)+"")&&X(i,n);const _={};f&2&&(_.config=c[1]),u.$set(_)},i(c){a||(D(u.$$.fragment,c),a=!0)},o(c){q(u.$$.fragment,c),a=!1},d(c){c&&C(e),c&&C(o),ne(u,c)}}}function Nm(t,e,l){let{json:n}=e,{sysinfo:i}=e,o={},u,a;return t.$$set=c=>{"json"in c&&l(0,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&29){let c=n.currency,f=new Date().getUTCHours(),_=0,p=0,b=0,v=[],d=[],$=[];l(4,a=l(3,u=0));let y=new Date;for(fl(y,i.clock_offset-(24+y.getHours()-y.getUTCHours())%24),_=f;_<24&&(p=n[Oe(b++)],p!=null);_++)d.push({label:Oe(y.getHours())}),$.push(p*100),l(4,a=Math.min(a,p*100)),l(3,u=Math.max(u,p*100)),fl(y,1);for(_=0;_<24&&(p=n[Oe(b++)],p!=null);_++)d.push({label:Oe(y.getHours())}),$.push(p*100),l(4,a=Math.min(a,p*100)),l(3,u=Math.max(u,p*100)),fl(y,1);if(a>-100&&u<100){switch(c){case"NOK":case"SEK":case"DKK":c="\xF8re";break;case"EUR":c="cent";break;default:c=c+"/100"}for(l(4,a*=100),l(3,u*=100),_=0;_<$.length;_++)$[_]*=100}let T=[];for(_=0;_<$.length;_++){p=$[_];let P=p*.01,L=Math.abs(p)<1e3?2:0;T.push({label:P>=0?P.toFixed(L):"",title:P>=0?P.toFixed(2)+" "+c:"",value:p>=0?Math.abs(p):0,label2:P<0?P.toFixed(L):"",title2:P<0?P.toFixed(2)+" "+c:"",value2:p<0?Math.abs(p):0,color:"#7c3aed"})}let N=Math.max(u,Math.abs(a));if(a<0){l(4,a=Math.min(N/4*-1,a));let P=Math.ceil(Math.abs(a)/N*4),L=a/P;for(_=1;_{"json"in c&&l(1,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,f=[],_=[],p=[];l(4,a=l(3,u=0));let b=fl(new Date,-24),v=new Date().getUTCHours();for(fl(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),c=v;c<24;c++){let T=n["i"+Oe(c)],N=n["e"+Oe(c)];T===void 0&&(T=0),N===void 0&&(N=0),_.push({label:Oe(b.getHours())}),p.push({label:T.toFixed(1),title:T.toFixed(2)+" kWh",value:T*10,label2:N.toFixed(1),title2:N.toFixed(2)+" kWh",value2:N*10,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,N*10)),l(3,u=Math.max(u,T*10)),fl(b,1)}for(c=0;c{"json"in c&&l(1,n=c.json),"sysinfo"in c&&l(2,i=c.sysinfo)},t.$$.update=()=>{if(t.$$.dirty&30){let c=0,f=[],_=[],p=[];l(4,a=l(3,u=0));let b=new Date,v=new Date;for(fl(b,i.clock_offset-(24+b.getHours()-b.getUTCHours())%24),fl(v,i.clock_offset-(24+v.getHours()-v.getUTCHours())%24),v.setDate(0),c=b.getDate();c<=v.getDate();c++){let T=n["i"+Oe(c)],N=n["e"+Oe(c)];T===void 0&&(T=0),N===void 0&&(N=0),_.push({label:Oe(c)}),p.push({label:T.toFixed(T<10?1:0),title:T.toFixed(2)+" kWh",value:T,label2:N.toFixed(N<10?1:0),title2:N.toFixed(2)+" kWh",value2:N,color:"#7c3aed",color2:"#37829E"}),l(4,a=Math.max(a,N)),l(3,u=Math.max(u,T))}for(c=1;c{"json"in a&&l(1,n=a.json)},t.$$.update=()=>{if(t.$$.dirty&14){let a=0,c=0,f=[],_=[],p=[];n.s&&n.s.forEach((d,$)=>{var y=d.n?d.n:d.a;c=d.v,c==-127&&(c=0),_.push({label:y.slice(-4)}),p.push({label:c.toFixed(1),value:c,color:"#7c3aed"}),l(3,u=Math.min(u,c)),l(2,o=Math.max(o,c))}),l(2,o=Math.ceil(o)),l(3,u=Math.floor(u));let b=o;u<0&&(b+=Math.abs(u));let v=b/4;for(a=0;a<5;a++)c=u+v*a,f.push({value:c,label:c.toFixed(1)});l(0,i={title:"Temperature sensors (\xB0C)",height:226,width:1520,padding:{top:20,right:15,bottom:20,left:35},y:{min:u,max:o,ticks:f},x:{ticks:_},points:p})}},[i,n,o,u]}class qm extends Ee{constructor(e){super(),Pe(this,e,Fm,Om,Ae,{json:1})}}function Bm(t){let e,l;return e=new dn({props:{config:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,[i]){const o={};i&1&&(o.config=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}let Um=0;function jm(t,e,l){let n={},i=0,o;return Kc.subscribe(u=>{l(2,o=u)}),Vc(),t.$$.update=()=>{if(t.$$.dirty&6){let u=0,a=[],c=[],f=[];if(a.push({value:0,label:0}),o&&o.p)for(u=0;u0?Oe(_.d)+"."+ro[new Date().getMonth()]:"-"}),l(1,i=Math.max(i,_.v))}if(o&&o.t){for(u=0;u=i)break;a.push({value:_,label:_})}a.push({label:o.m.toFixed(1),align:"right",color:"green",value:o.m})}o&&o.c&&(a.push({label:o.c.toFixed(0),color:"orange",value:o.c}),l(1,i=Math.max(i,o.c))),l(1,i=Math.ceil(i)),l(0,n={title:"Tariff peaks",padding:{top:20,right:35,bottom:20,left:35},y:{min:Um,max:i,ticks:a},x:{ticks:c},points:f})}},[n,i,o]}class Hm extends Ee{constructor(e){super(),Pe(this,e,jm,Bm,Ae,{})}}function Wu(t){let e,l,n,i,o,u,a=(t[0].mt?Ns(t[0].mt):"-")+"",c,f,_,p=(t[0].ic?t[0].ic.toFixed(1):"-")+"",b,v,d;return i=new Jc({props:{val:t[0].i?t[0].i:0,max:t[0].im?t[0].im:15e3,unit:"W",label:"Import",sub:t[0].p,subunit:t[0].pc,colorFn:Bc}}),{c(){e=m("div"),l=m("div"),n=m("div"),ie(i.$$.fragment),o=h(),u=m("div"),c=S(a),f=h(),_=m("div"),b=S(p),v=S(" kWh"),r(n,"class","col-span-2"),r(_,"class","text-right"),r(l,"class","grid grid-cols-2"),r(e,"class","cnt")},m($,y){M($,e,y),s(e,l),s(l,n),le(i,n,null),s(l,o),s(l,u),s(u,c),s(l,f),s(l,_),s(_,b),s(_,v),d=!0},p($,y){const T={};y&1&&(T.val=$[0].i?$[0].i:0),y&1&&(T.max=$[0].im?$[0].im:15e3),y&1&&(T.sub=$[0].p),y&1&&(T.subunit=$[0].pc),i.$set(T),(!d||y&1)&&a!==(a=($[0].mt?Ns($[0].mt):"-")+"")&&X(c,a),(!d||y&1)&&p!==(p=($[0].ic?$[0].ic.toFixed(1):"-")+"")&&X(b,p)},i($){d||(D(i.$$.fragment,$),d=!0)},o($){q(i.$$.fragment,$),d=!1},d($){$&&C(e),ne(i)}}}function zu(t){let e,l,n,i,o,u,a,c,f=(t[0].ec?t[0].ec.toFixed(1):"-")+"",_,p,b;return i=new Jc({props:{val:t[0].e?t[0].e:0,max:t[0].om?t[0].om*1e3:1e4,unit:"W",label:"Export",colorFn:$1}}),{c(){e=m("div"),l=m("div"),n=m("div"),ie(i.$$.fragment),o=h(),u=m("div"),a=h(),c=m("div"),_=S(f),p=S(" kWh"),r(n,"class","col-span-2"),r(c,"class","text-right"),r(l,"class","grid grid-cols-2"),r(e,"class","cnt")},m(v,d){M(v,e,d),s(e,l),s(l,n),le(i,n,null),s(l,o),s(l,u),s(l,a),s(l,c),s(c,_),s(c,p),b=!0},p(v,d){const $={};d&1&&($.val=v[0].e?v[0].e:0),d&1&&($.max=v[0].om?v[0].om*1e3:1e4),i.$set($),(!b||d&1)&&f!==(f=(v[0].ec?v[0].ec.toFixed(1):"-")+"")&&X(_,f)},i(v){b||(D(i.$$.fragment,v),b=!0)},o(v){q(i.$$.fragment,v),b=!1},d(v){v&&C(e),ne(i)}}}function Gu(t){let e,l,n;return l=new dm({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,ds:t[0].ds}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&1&&(u.u1=i[0].u1),o&1&&(u.u2=i[0].u2),o&1&&(u.u3=i[0].u3),o&1&&(u.ds=i[0].ds),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Vu(t){let e,l,n;return l=new bm({props:{u1:t[0].u1,u2:t[0].u2,u3:t[0].u3,i1:t[0].i1,i2:t[0].i2,i3:t[0].i3,max:t[0].mf?t[0].mf:32}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&1&&(u.u1=i[0].u1),o&1&&(u.u2=i[0].u2),o&1&&(u.u3=i[0].u3),o&1&&(u.i1=i[0].i1),o&1&&(u.i2=i[0].i2),o&1&&(u.i3=i[0].i3),o&1&&(u.max=i[0].mf?i[0].mf:32),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Ku(t){let e,l,n;return l=new wm({props:{importInstant:t[0].ri,exportInstant:t[0].re,importTotal:t[0].ric,exportTotal:t[0].rec}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&1&&(u.importInstant=i[0].ri),o&1&&(u.exportInstant=i[0].re),o&1&&(u.importTotal=i[0].ric),o&1&&(u.exportTotal=i[0].rec),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Yu(t){let e,l,n;return l=new Sm({props:{sysinfo:t[1],data:t[0].ea,currency:t[0].pc,hasExport:t[0].om>0||t[0].e>0}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&2&&(u.sysinfo=i[1]),o&1&&(u.data=i[0].ea),o&1&&(u.currency=i[0].pc),o&1&&(u.hasExport=i[0].om>0||i[0].e>0),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Qu(t){let e,l,n;return l=new Hm({}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt h-64")},m(i,o){M(i,e,o),le(l,e,null),n=!0},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Xu(t){let e,l,n;return l=new Am({props:{json:t[2],sysinfo:t[1]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&4&&(u.json=i[2]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Zu(t){let e,l,n;return l=new Dm({props:{json:t[3],sysinfo:t[1]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&8&&(u.json=i[3]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Ju(t){let e,l,n;return l=new Lm({props:{json:t[4],sysinfo:t[1]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&16&&(u.json=i[4]),o&2&&(u.sysinfo=i[1]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function xu(t){let e,l,n;return l=new qm({props:{json:t[5]}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","cnt gwf")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o&32&&(u.json=i[5]),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Wm(t){let e,l=Ve(t[1].ui.i,t[0].i),n,i=Ve(t[1].ui.e,t[0].om||t[0].e>0),o,u=Ve(t[1].ui.v,t[0].u1>100||t[0].u2>100||t[0].u3>100),a,c=Ve(t[1].ui.a,t[0].i1>.01||t[0].i2>.01||t[0].i3>.01),f,_=Ve(t[1].ui.r,t[0].ri>0||t[0].re>0||t[0].ric>0||t[0].rec>0),p,b=Ve(t[1].ui.c,t[0].ea),v,d=Ve(t[1].ui.t,t[0].pr&&(t[0].pr.startsWith("10YNO")||t[0].pr.startsWith("10Y1001A1001A4"))),$,y=Ve(t[1].ui.p,t[0].pe&&!Number.isNaN(t[0].p)),T,N=Ve(t[1].ui.d,t[3]),E,B=Ve(t[1].ui.m,t[4]),P,L=Ve(t[1].ui.s,t[0].t&&t[0].t!=-127&&t[5].c>1),O,F=l&&Wu(t),x=i&&zu(t),j=u&&Gu(t),z=c&&Vu(t),G=_&&Ku(t),V=b&&Yu(t),W=d&&Qu(),U=y&&Xu(t),K=N&&Zu(t),H=B&&Ju(t),Y=L&&xu(t);return{c(){e=m("div"),F&&F.c(),n=h(),x&&x.c(),o=h(),j&&j.c(),a=h(),z&&z.c(),f=h(),G&&G.c(),p=h(),V&&V.c(),v=h(),W&&W.c(),$=h(),U&&U.c(),T=h(),K&&K.c(),E=h(),H&&H.c(),P=h(),Y&&Y.c(),r(e,"class","grid 2xl:grid-cols-6 xl:grid-cols-5 lg:grid-cols-4 md:grid-cols-3 sm:grid-cols-2")},m(Z,re){M(Z,e,re),F&&F.m(e,null),s(e,n),x&&x.m(e,null),s(e,o),j&&j.m(e,null),s(e,a),z&&z.m(e,null),s(e,f),G&&G.m(e,null),s(e,p),V&&V.m(e,null),s(e,v),W&&W.m(e,null),s(e,$),U&&U.m(e,null),s(e,T),K&&K.m(e,null),s(e,E),H&&H.m(e,null),s(e,P),Y&&Y.m(e,null),O=!0},p(Z,[re]){re&3&&(l=Ve(Z[1].ui.i,Z[0].i)),l?F?(F.p(Z,re),re&3&&D(F,1)):(F=Wu(Z),F.c(),D(F,1),F.m(e,n)):F&&(De(),q(F,1,1,()=>{F=null}),Ie()),re&3&&(i=Ve(Z[1].ui.e,Z[0].om||Z[0].e>0)),i?x?(x.p(Z,re),re&3&&D(x,1)):(x=zu(Z),x.c(),D(x,1),x.m(e,o)):x&&(De(),q(x,1,1,()=>{x=null}),Ie()),re&3&&(u=Ve(Z[1].ui.v,Z[0].u1>100||Z[0].u2>100||Z[0].u3>100)),u?j?(j.p(Z,re),re&3&&D(j,1)):(j=Gu(Z),j.c(),D(j,1),j.m(e,a)):j&&(De(),q(j,1,1,()=>{j=null}),Ie()),re&3&&(c=Ve(Z[1].ui.a,Z[0].i1>.01||Z[0].i2>.01||Z[0].i3>.01)),c?z?(z.p(Z,re),re&3&&D(z,1)):(z=Vu(Z),z.c(),D(z,1),z.m(e,f)):z&&(De(),q(z,1,1,()=>{z=null}),Ie()),re&3&&(_=Ve(Z[1].ui.r,Z[0].ri>0||Z[0].re>0||Z[0].ric>0||Z[0].rec>0)),_?G?(G.p(Z,re),re&3&&D(G,1)):(G=Ku(Z),G.c(),D(G,1),G.m(e,p)):G&&(De(),q(G,1,1,()=>{G=null}),Ie()),re&3&&(b=Ve(Z[1].ui.c,Z[0].ea)),b?V?(V.p(Z,re),re&3&&D(V,1)):(V=Yu(Z),V.c(),D(V,1),V.m(e,v)):V&&(De(),q(V,1,1,()=>{V=null}),Ie()),re&3&&(d=Ve(Z[1].ui.t,Z[0].pr&&(Z[0].pr.startsWith("10YNO")||Z[0].pr.startsWith("10Y1001A1001A4")))),d?W?re&3&&D(W,1):(W=Qu(),W.c(),D(W,1),W.m(e,$)):W&&(De(),q(W,1,1,()=>{W=null}),Ie()),re&3&&(y=Ve(Z[1].ui.p,Z[0].pe&&!Number.isNaN(Z[0].p))),y?U?(U.p(Z,re),re&3&&D(U,1)):(U=Xu(Z),U.c(),D(U,1),U.m(e,T)):U&&(De(),q(U,1,1,()=>{U=null}),Ie()),re&10&&(N=Ve(Z[1].ui.d,Z[3])),N?K?(K.p(Z,re),re&10&&D(K,1)):(K=Zu(Z),K.c(),D(K,1),K.m(e,E)):K&&(De(),q(K,1,1,()=>{K=null}),Ie()),re&18&&(B=Ve(Z[1].ui.m,Z[4])),B?H?(H.p(Z,re),re&18&&D(H,1)):(H=Ju(Z),H.c(),D(H,1),H.m(e,P)):H&&(De(),q(H,1,1,()=>{H=null}),Ie()),re&35&&(L=Ve(Z[1].ui.s,Z[0].t&&Z[0].t!=-127&&Z[5].c>1)),L?Y?(Y.p(Z,re),re&35&&D(Y,1)):(Y=xu(Z),Y.c(),D(Y,1),Y.m(e,null)):Y&&(De(),q(Y,1,1,()=>{Y=null}),Ie())},i(Z){O||(D(F),D(x),D(j),D(z),D(G),D(V),D(W),D(U),D(K),D(H),D(Y),O=!0)},o(Z){q(F),q(x),q(j),q(z),q(G),q(V),q(W),q(U),q(K),q(H),q(Y),O=!1},d(Z){Z&&C(e),F&&F.d(),x&&x.d(),j&&j.d(),z&&z.d(),G&&G.d(),V&&V.d(),W&&W.d(),U&&U.d(),K&&K.d(),H&&H.d(),Y&&Y.d()}}}function zm(t,e,l){let{data:n={}}=e,{sysinfo:i={}}=e,o={},u={},a={},c={};return To.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,c=f)}),t.$$set=f=>{"data"in f&&l(0,n=f.data),"sysinfo"in f&&l(1,i=f.sysinfo)},[n,i,o,u,a,c]}class Gm extends Ee{constructor(e){super(),Pe(this,e,zm,Wm,Ae,{data:0,sysinfo:1})}}let _o={};const $i=at(_o);async function Vm(){_o=await(await fetch("/configuration.json")).json(),$i.set(_o)}function ef(t,e,l){const n=t.slice();return n[2]=e[l],n[4]=l,n}function Km(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=3,e.value=e.__value},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function Ym(t){let e;return{c(){e=m("option"),e.textContent="UART0",e.__value=20,e.value=e.__value},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function tf(t){let e;return{c(){e=m("option"),e.textContent="UART2",e.__value=113,e.value=e.__value},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function lf(t){let e,l,n;return{c(){e=m("option"),e.textContent="UART1",l=h(),n=m("option"),n.textContent="UART2",e.__value=9,e.value=e.__value,n.__value=16,n.value=n.__value},m(i,o){M(i,e,o),M(i,l,o),M(i,n,o)},d(i){i&&C(e),i&&C(l),i&&C(n)}}}function nf(t){let e;return{c(){e=m("option"),e.textContent="UART1",e.__value=18,e.value=e.__value},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function sf(t){let e,l,n;return{c(){e=m("option"),l=S("GPIO"),n=S(t[4]),e.__value=t[4],e.value=e.__value},m(i,o){M(i,e,o),s(e,l),s(e,n)},d(i){i&&C(e)}}}function of(t){let e,l=t[4]>3&&!(t[0]=="esp32"&&(t[4]==9||t[4]==16))&&!(t[0]=="esp32s2"&&t[4]==18)&&!(t[0]=="esp8266"&&(t[4]==3||t[4]==113))&&sf(t);return{c(){l&&l.c(),e=Ge()},m(n,i){l&&l.m(n,i),M(n,e,i)},p(n,i){n[4]>3&&!(n[0]=="esp32"&&(n[4]==9||n[4]==16))&&!(n[0]=="esp32s2"&&n[4]==18)&&!(n[0]=="esp8266"&&(n[4]==3||n[4]==113))?l||(l=sf(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},d(n){l&&l.d(n),n&&C(e)}}}function Qm(t){let e,l,n,i,o;function u(d,$){return d[0]=="esp32c3"?Ym:Km}let a=u(t),c=a(t),f=t[0]=="esp8266"&&tf(),_=(t[0]=="esp32"||t[0]=="esp32solo")&&lf(),p=t[0]=="esp32s2"&&nf(),b={length:t[1]+1},v=[];for(let d=0;d{"chip"in o&&l(0,n=o.chip)},t.$$.update=()=>{if(t.$$.dirty&1)switch(n){case"esp8266":l(1,i=16);break;case"esp32s2":l(1,i=44);break;case"esp32c3":l(1,i=19);break}},[n,i]}class xc extends Ee{constructor(e){super(),Pe(this,e,Xm,Qm,Ae,{chip:0})}}function rf(t){let e,l,n=t[1]&&af(t);return{c(){e=m("div"),l=m("div"),n&&n.c(),r(l,"class","fixed inset-0 bg-gray-500 bg-opacity-50 flex items-center justify-center"),r(e,"class","z-50"),r(e,"aria-modal","true")},m(i,o){M(i,e,o),s(e,l),n&&n.m(l,null)},p(i,o){i[1]?n?n.p(i,o):(n=af(i),n.c(),n.m(l,null)):n&&(n.d(1),n=null)},d(i){i&&C(e),n&&n.d()}}}function af(t){let e,l;return{c(){e=m("div"),l=S(t[1]),r(e,"class","bg-white m-2 p-3 rounded-md shadow-lg pb-4 text-gray-700 w-96")},m(n,i){M(n,e,i),s(e,l)},p(n,i){i&2&&X(l,n[1])},d(n){n&&C(e)}}}function Zm(t){let e,l=t[0]&&rf(t);return{c(){l&&l.c(),e=Ge()},m(n,i){l&&l.m(n,i),M(n,e,i)},p(n,[i]){n[0]?l?l.p(n,i):(l=rf(n),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null)},i:fe,o:fe,d(n){l&&l.d(n),n&&C(e)}}}function Jm(t,e,l){let{active:n}=e,{message:i}=e;return t.$$set=o=>{"active"in o&&l(0,n=o.active),"message"in o&&l(1,i=o.message)},[n,i]}class It extends Ee{constructor(e){super(),Pe(this,e,Jm,Zm,Ae,{active:0,message:1})}}function uf(t,e,l){const n=t.slice();return n[1]=e[l],n}function ff(t){let e,l,n=t[1]+"",i;return{c(){e=m("option"),l=S("Europe/"),i=S(n),e.__value="Europe/"+t[1],e.value=e.__value},m(o,u){M(o,e,u),s(e,l),s(e,i)},p:fe,d(o){o&&C(e)}}}function xm(t){let e,l,n,i=t[0],o=[];for(let u=0;u>1&1,A=0;A0;g--)A[g]=A[g]?A[g-1]^P.EXPONENT[F._modN(P.LOG[A[g]]+w)]:A[g-1];A[0]=P.EXPONENT[F._modN(P.LOG[A[0]]+w)]}for(w=0;w<=k;w++)A[w]=P.LOG[A[w]]},_checkBadness:function(){var w,g,k,A,I,Q=0,J=this._badness,se=this.buffer,ce=this.width;for(I=0;Ice*ce;)oe-=ce*ce,Se++;for(Q+=Se*F.N4,A=0;A=J-2&&(w=J-2,I>9&&w--);var se=w;if(I>9){for(Q[se+2]=0,Q[se+3]=0;se--;)g=Q[se],Q[se+3]|=255&g<<4,Q[se+2]=g>>4;Q[2]|=255&w<<4,Q[1]=w>>4,Q[0]=64|w>>12}else{for(Q[se+1]=0,Q[se+2]=0;se--;)g=Q[se],Q[se+2]|=255&g<<4,Q[se+1]=g>>4;Q[1]|=255&w<<4,Q[0]=64|w>>4}for(se=w+3-(I<10);se=5&&(k+=F.N1+A[g]-5);for(g=3;gw||A[g-3]*3>=A[g]*4||A[g+3]*3>=A[g]*4)&&(k+=F.N3);return k},_finish:function(){this._stringBuffer=this.buffer.slice();var w,g,k=0,A=3e4;for(g=0;g<8&&(this._applyMask(g),w=this._checkBadness(),w>=1)A&1&&(I[Q-1-g+Q*8]=1,g<6?I[8+Q*g]=1:I[8+Q*(g+1)]=1);for(g=0;g<7;g++,A>>=1)A&1&&(I[8+Q*(Q-7+g)]=1,g?I[6-g+Q*8]=1:I[7+Q*8]=1)},_interleaveBlocks:function(){var w,g,k=this._dataBlock,A=this._ecc,I=this._eccBlock,Q=0,J=this._calculateMaxLength(),se=this._neccBlock1,ce=this._neccBlock2,ve=this._stringBuffer;for(w=0;w1)for(w=T.BLOCK[A],k=I-7;;){for(g=I-7;g>w-3&&(this._addAlignment(g,k),!(g6)for(w=O.BLOCK[Q-7],g=17,k=0;k<6;k++)for(A=0;A<3;A++,g--)1&(g>11?Q>>g-12:w>>g)?(I[5-k+J*(2-A+J-11)]=1,I[2-A+J-11+J*(5-k)]=1):(this._setMask(5-k,2-A+J-11),this._setMask(2-A+J-11,5-k))},_isMasked:function(w,g){var k=F._getMaskBit(w,g);return this._mask[k]===1},_pack:function(){var w,g,k,A=1,I=1,Q=this.width,J=Q-1,se=Q-1,ce=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(g=0;gg&&(k=w,w=g,g=k),k=g,k+=g*g,k>>=1,k+=w,k},_modN:function(w){for(;w>=255;)w-=255,w=(w>>8)+(w&255);return w},N1:3,N2:3,N3:40,N4:10}),x=F,j=v.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var w=this.element;w.width=w.height=this.qrious.size}}),z=j,G=p.extend(function(w,g,k,A){this.name=w,this.modifiable=Boolean(g),this.defaultValue=k,this._valueTransformer=A},{transform:function(w){var g=this._valueTransformer;return typeof g=="function"?g(w,this):w}}),V=G,W=p.extend(null,{abs:function(w){return w!=null?Math.abs(w):null},hasOwn:function(w,g){return Object.prototype.hasOwnProperty.call(w,g)},noop:function(){},toUpperCase:function(w){return w!=null?w.toUpperCase():null}}),U=W,K=p.extend(function(w){this.options={},w.forEach(function(g){this.options[g.name]=g},this)},{exists:function(w){return this.options[w]!=null},get:function(w,g){return K._get(this.options[w],g)},getAll:function(w){var g,k=this.options,A={};for(g in k)U.hasOwn(k,g)&&(A[g]=K._get(k[g],w));return A},init:function(w,g,k){typeof k!="function"&&(k=U.noop);var A,I;for(A in this.options)U.hasOwn(this.options,A)&&(I=this.options[A],K._set(I,I.defaultValue,g),K._createAccessor(I,g,k));this._setAll(w,g,!0)},set:function(w,g,k){return this._set(w,g,k)},setAll:function(w,g){return this._setAll(w,g)},_set:function(w,g,k,A){var I=this.options[w];if(!I)throw new Error("Invalid option: "+w);if(!I.modifiable&&!A)throw new Error("Option cannot be modified: "+w);return K._set(I,g,k)},_setAll:function(w,g,k){if(!w)return!1;var A,I=!1;for(A in w)U.hasOwn(w,A)&&this._set(A,w[A],g,k)&&(I=!0);return I}},{_createAccessor:function(w,g,k){var A={get:function(){return K._get(w,g)}};w.modifiable&&(A.set=function(I){K._set(w,I,g)&&k(I,w)}),Object.defineProperty(g,w.name,A)},_get:function(w,g){return g["_"+w.name]},_set:function(w,g,k){var A="_"+w.name,I=k[A],Q=w.transform(g!=null?g:w.defaultValue);return k[A]=Q,Q!==I}}),H=K,Y=p.extend(function(){this._services={}},{getService:function(w){var g=this._services[w];if(!g)throw new Error("Service is not being managed with name: "+w);return g},setService:function(w,g){if(this._services[w])throw new Error("Service is already managed with name: "+w);g&&(this._services[w]=g)}}),Z=Y,re=new H([new V("background",!0,"white"),new V("backgroundAlpha",!0,1,U.abs),new V("element"),new V("foreground",!0,"black"),new V("foregroundAlpha",!0,1,U.abs),new V("level",!0,"L",U.toUpperCase),new V("mime",!0,"image/png"),new V("padding",!0,null,U.abs),new V("size",!0,100,U.abs),new V("value",!0,"")]),ue=new Z,we=p.extend(function(w){re.init(w,this,this.update.bind(this));var g=re.get("element",this),k=ue.getService("element"),A=g&&k.isCanvas(g)?g:k.createCanvas(),I=g&&k.isImage(g)?g:k.createImage();this._canvasRenderer=new $(this,A,!0),this._imageRenderer=new z(this,I,I===g),this.update()},{get:function(){return re.getAll(this)},set:function(w){re.setAll(w,this)&&this.update()},toDataURL:function(w){return this.canvas.toDataURL(w||this.mime)},update:function(){var w=new x({level:this.level,value:this.value});this._canvasRenderer.render(w),this._imageRenderer.render(w)}},{use:function(w){ue.setService(w.getName(),w)}});Object.defineProperties(we.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var me=we,Te=me,je=p.extend({getName:function(){}}),Re=je,He=Re.extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(w){},isImage:function(w){}}),ye=He,Ne=ye.extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(w){return w instanceof HTMLCanvasElement},isImage:function(w){return w instanceof HTMLImageElement}}),Le=Ne;Te.use(new Le);var $e=Te;return $e})})(t0);const sp=t0.exports;function op(t){let e,l;return{c(){e=m("img"),lo(e.src,l=t[2])||r(e,"src",l),r(e,"alt",t[0]),r(e,"class",t[1])},m(n,i){M(n,e,i)},p(n,[i]){i&4&&!lo(e.src,l=n[2])&&r(e,"src",l),i&1&&r(e,"alt",n[0]),i&2&&r(e,"class",n[1])},i:fe,o:fe,d(n){n&&C(e)}}}function rp(t,e,l){const n=new sp;let{errorCorrection:i="L"}=e,{background:o="#fff"}=e,{color:u="#000"}=e,{size:a="200"}=e,{value:c=""}=e,{padding:f=0}=e,{className:_="qrcode"}=e,p="";function b(){n.set({background:o,foreground:u,level:i,padding:f,size:a,value:c}),l(2,p=n.toDataURL("image/jpeg"))}return uc(()=>{b()}),t.$$set=v=>{"errorCorrection"in v&&l(3,i=v.errorCorrection),"background"in v&&l(4,o=v.background),"color"in v&&l(5,u=v.color),"size"in v&&l(6,a=v.size),"value"in v&&l(0,c=v.value),"padding"in v&&l(7,f=v.padding),"className"in v&&l(1,_=v.className)},t.$$.update=()=>{t.$$.dirty&1&&c&&b()},[c,_,p,i,o,u,a,f]}class ap extends Ee{constructor(e){super(),Pe(this,e,rp,op,Ae,{errorCorrection:3,background:4,color:5,size:6,value:0,padding:7,className:1})}}function cf(t,e,l){const n=t.slice();return n[96]=e[l],n[97]=e,n[98]=l,n}function mf(t,e,l){const n=t.slice();return n[99]=e[l],n[100]=e,n[101]=l,n}function up(t,e,l){const n=t.slice();return n[102]=e[l],n}function fp(t,e,l){const n=t.slice();return n[105]=e[l],n}function cp(t){let e,l;return{c(){e=m("option"),l=S(t[105]),e.__value=t[105],e.value=e.__value},m(n,i){M(n,e,i),s(e,l)},p:fe,d(n){n&&C(e)}}}function pf(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","pt"),r(l,"type","text"),r(l,"class","in-s"),r(l,"placeholder","ENTSO-E API key, optional, read docs")},m(o,u){M(o,e,u),M(o,l,u),te(l,t[3].p.t),n||(i=ee(l,"input",t[22]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].p.t&&te(l,o[3].p.t)},d(o){o&&C(e),o&&C(l),n=!1,i()}}}function _f(t){let e,l,n,i,o,u,a,c,f,_,p,b,v;return{c(){e=m("div"),l=S("Username"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=S("Password"),f=m("br"),_=h(),p=m("input"),r(o,"name","gu"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(p,"name","gp"),r(p,"type","password"),r(p,"class","in-s"),r(a,"class","my-1")},m(d,$){M(d,e,$),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].g.u),M(d,u,$),M(d,a,$),s(a,c),s(a,f),s(a,_),s(a,p),te(p,t[3].g.p),b||(v=[ee(o,"input",t[24]),ee(p,"input",t[25])],b=!0)},p(d,$){$[0]&8&&o.value!==d[3].g.u&&te(o,d[3].g.u),$[0]&8&&p.value!==d[3].g.p&&te(p,d[3].g.p)},d(d){d&&C(e),d&&C(u),d&&C(a),b=!1,ze(v)}}}function mp(t){let e,l=t[102]*100+"",n;return{c(){e=m("option"),n=S(l),e.__value=t[102]*100,e.value=e.__value},m(i,o){M(i,e,o),s(e,n)},p:fe,d(i){i&&C(e)}}}function df(t){let e,l,n,i;return{c(){e=m("br"),l=m("input"),r(l,"name","mek"),r(l,"type","text"),r(l,"class","in-s")},m(o,u){M(o,e,u),M(o,l,u),te(l,t[3].m.e.k),n||(i=ee(l,"input",t[34]),n=!0)},p(o,u){u[0]&8&&l.value!==o[3].m.e.k&&te(l,o[3].m.e.k)},d(o){o&&C(e),o&&C(l),n=!1,i()}}}function vf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=S("Authentication key"),n=m("br"),i=h(),o=m("input"),r(o,"name","mea"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1")},m(c,f){M(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].m.e.a),u||(a=ee(o,"input",t[35]),u=!0)},p(c,f){f[0]&8&&o.value!==c[3].m.e.a&&te(o,c[3].m.e.a)},d(c){c&&C(e),u=!1,a()}}}function hf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,L,O,F,x,j;return{c(){e=m("div"),l=m("div"),n=S("Watt"),i=m("br"),o=h(),u=m("input"),a=h(),c=m("div"),f=S("Volt"),_=m("br"),p=h(),b=m("input"),v=h(),d=m("div"),$=S("Amp"),y=m("br"),T=h(),N=m("input"),E=h(),B=m("div"),P=S("kWh"),L=m("br"),O=h(),F=m("input"),r(u,"name","mmw"),r(u,"type","number"),r(u,"min","0.00"),r(u,"max","1000"),r(u,"step","0.001"),r(u,"class","in-f tr w-full"),r(l,"class","w-1/4"),r(b,"name","mmv"),r(b,"type","number"),r(b,"min","0.00"),r(b,"max","1000"),r(b,"step","0.001"),r(b,"class","in-m tr w-full"),r(c,"class","w-1/4"),r(N,"name","mma"),r(N,"type","number"),r(N,"min","0.00"),r(N,"max","1000"),r(N,"step","0.001"),r(N,"class","in-m tr w-full"),r(d,"class","w-1/4"),r(F,"name","mmc"),r(F,"type","number"),r(F,"min","0.00"),r(F,"max","1000"),r(F,"step","0.001"),r(F,"class","in-l tr w-full"),r(B,"class","w-1/4"),r(e,"class","flex my-1")},m(z,G){M(z,e,G),s(e,l),s(l,n),s(l,i),s(l,o),s(l,u),te(u,t[3].m.m.w),s(e,a),s(e,c),s(c,f),s(c,_),s(c,p),s(c,b),te(b,t[3].m.m.v),s(e,v),s(e,d),s(d,$),s(d,y),s(d,T),s(d,N),te(N,t[3].m.m.a),s(e,E),s(e,B),s(B,P),s(B,L),s(B,O),s(B,F),te(F,t[3].m.m.c),x||(j=[ee(u,"input",t[37]),ee(b,"input",t[38]),ee(N,"input",t[39]),ee(F,"input",t[40])],x=!0)},p(z,G){G[0]&8&&he(u.value)!==z[3].m.m.w&&te(u,z[3].m.m.w),G[0]&8&&he(b.value)!==z[3].m.m.v&&te(b,z[3].m.m.v),G[0]&8&&he(N.value)!==z[3].m.m.a&&te(N,z[3].m.m.a),G[0]&8&&he(F.value)!==z[3].m.m.c&&te(F,z[3].m.m.c)},d(z){z&&C(e),x=!1,ze(j)}}}function bf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y;return{c(){e=m("div"),l=S("Gateway"),n=m("br"),i=h(),o=m("input"),u=h(),a=m("div"),c=S("DNS"),f=m("br"),_=h(),p=m("div"),b=m("input"),v=h(),d=m("input"),r(o,"name","ng"),r(o,"type","text"),r(o,"class","in-s"),r(e,"class","my-1"),r(b,"name","nd1"),r(b,"type","text"),r(b,"class","in-f w-full"),r(d,"name","nd2"),r(d,"type","text"),r(d,"class","in-l w-full"),r(p,"class","flex"),r(a,"class","my-1")},m(T,N){M(T,e,N),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].n.g),M(T,u,N),M(T,a,N),s(a,c),s(a,f),s(a,_),s(a,p),s(p,b),te(b,t[3].n.d1),s(p,v),s(p,d),te(d,t[3].n.d2),$||(y=[ee(o,"input",t[50]),ee(b,"input",t[51]),ee(d,"input",t[52])],$=!0)},p(T,N){N[0]&8&&o.value!==T[3].n.g&&te(o,T[3].n.g),N[0]&8&&b.value!==T[3].n.d1&&te(b,T[3].n.d1),N[0]&8&&d.value!==T[3].n.d2&&te(d,T[3].n.d2)},d(T){T&&C(e),T&&C(u),T&&C(a),$=!1,ze(y)}}}function gf(t){let e,l,n,i,o;return{c(){e=m("label"),l=m("input"),n=S(" SSL"),r(l,"type","checkbox"),r(l,"name","qs"),l.__value="true",l.value=l.__value,r(l,"class","rounded mb-1"),r(e,"class","float-right mr-3")},m(u,a){M(u,e,a),s(e,l),l.checked=t[3].q.s.e,s(e,n),i||(o=[ee(l,"change",t[56]),ee(l,"change",t[14])],i=!0)},p(u,a){a[0]&8&&(l.checked=u[3].q.s.e)},d(u){u&&C(e),i=!1,ze(o)}}}function kf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v;const d=[_p,pp],$=[];function y(O,F){return O[3].q.s.c?0:1}n=y(t),i=$[n]=d[n](t);const T=[bp,hp],N=[];function E(O,F){return O[3].q.s.r?0:1}a=E(t),c=N[a]=T[a](t);const B=[yp,wp],P=[];function L(O,F){return O[3].q.s.k?0:1}return p=L(t),b=P[p]=B[p](t),{c(){e=m("div"),l=m("span"),i.c(),o=h(),u=m("span"),c.c(),f=h(),_=m("span"),b.c(),r(l,"class","flex pr-2"),r(u,"class","flex pr-2"),r(_,"class","flex pr-2"),r(e,"class","my-1 flex")},m(O,F){M(O,e,F),s(e,l),$[n].m(l,null),s(e,o),s(e,u),N[a].m(u,null),s(e,f),s(e,_),P[p].m(_,null),v=!0},p(O,F){let x=n;n=y(O),n===x?$[n].p(O,F):(De(),q($[x],1,1,()=>{$[x]=null}),Ie(),i=$[n],i?i.p(O,F):(i=$[n]=d[n](O),i.c()),D(i,1),i.m(l,null));let j=a;a=E(O),a===j?N[a].p(O,F):(De(),q(N[j],1,1,()=>{N[j]=null}),Ie(),c=N[a],c?c.p(O,F):(c=N[a]=T[a](O),c.c()),D(c,1),c.m(u,null));let z=p;p=L(O),p===z?P[p].p(O,F):(De(),q(P[z],1,1,()=>{P[z]=null}),Ie(),b=P[p],b?b.p(O,F):(b=P[p]=B[p](O),b.c()),D(b,1),b.m(_,null))},i(O){v||(D(i),D(c),D(b),v=!0)},o(O){q(i),q(c),q(b),v=!1},d(O){O&&C(e),$[n].d(),N[a].d(),P[p].d()}}}function pp(t){let e,l;return e=new el({props:{to:"/mqtt-ca",$$slots:{default:[dp]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i[3]&32768&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function _p(t){let e,l,n,i,o,u,a,c;return l=new el({props:{to:"/mqtt-ca",$$slots:{default:[vp]},$$scope:{ctx:t}}}),o=new Eo({}),{c(){e=m("span"),ie(l.$$.fragment),n=h(),i=m("span"),ie(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){M(f,e,_),le(l,e,null),M(f,n,_),M(f,i,_),le(o,i,null),u=!0,a||(c=[ee(i,"click",t[11]),ee(i,"keypress",t[11])],a=!0)},p(f,_){const p={};_[3]&32768&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(D(l.$$.fragment,f),D(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&C(e),ne(l),f&&C(n),f&&C(i),ne(o),a=!1,ze(c)}}}function dp(t){let e,l;return e=new mn({props:{color:"blue",text:"Upload CA",title:"Click here to upload CA"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function vp(t){let e;return{c(){e=S("CA OK")},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function hp(t){let e,l;return e=new el({props:{to:"/mqtt-cert",$$slots:{default:[gp]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i[3]&32768&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function bp(t){let e,l,n,i,o,u,a,c;return l=new el({props:{to:"/mqtt-cert",$$slots:{default:[kp]},$$scope:{ctx:t}}}),o=new Eo({}),{c(){e=m("span"),ie(l.$$.fragment),n=h(),i=m("span"),ie(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){M(f,e,_),le(l,e,null),M(f,n,_),M(f,i,_),le(o,i,null),u=!0,a||(c=[ee(i,"click",t[12]),ee(i,"keypress",t[12])],a=!0)},p(f,_){const p={};_[3]&32768&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(D(l.$$.fragment,f),D(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&C(e),ne(l),f&&C(n),f&&C(i),ne(o),a=!1,ze(c)}}}function gp(t){let e,l;return e=new mn({props:{color:"blue",text:"Upload cert",title:"Click here to upload certificate"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function kp(t){let e;return{c(){e=S("Cert OK")},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function wp(t){let e,l;return e=new el({props:{to:"/mqtt-key",$$slots:{default:[Cp]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i[3]&32768&&(o.$$scope={dirty:i,ctx:n}),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function yp(t){let e,l,n,i,o,u,a,c;return l=new el({props:{to:"/mqtt-key",$$slots:{default:[Mp]},$$scope:{ctx:t}}}),o=new Eo({}),{c(){e=m("span"),ie(l.$$.fragment),n=h(),i=m("span"),ie(o.$$.fragment),r(e,"class","rounded-l-md bg-green-500 text-green-100 text-xs font-semibold px-2.5 py-1"),r(i,"class","rounded-r-md bg-red-500 text-red-100 text-xs px-2.5 py-1")},m(f,_){M(f,e,_),le(l,e,null),M(f,n,_),M(f,i,_),le(o,i,null),u=!0,a||(c=[ee(i,"click",t[13]),ee(i,"keypress",t[13])],a=!0)},p(f,_){const p={};_[3]&32768&&(p.$$scope={dirty:_,ctx:f}),l.$set(p)},i(f){u||(D(l.$$.fragment,f),D(o.$$.fragment,f),u=!0)},o(f){q(l.$$.fragment,f),q(o.$$.fragment,f),u=!1},d(f){f&&C(e),ne(l),f&&C(n),f&&C(i),ne(o),a=!1,ze(c)}}}function Cp(t){let e,l;return e=new mn({props:{color:"blue",text:"Upload key",title:"Click here to upload key"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function Mp(t){let e;return{c(){e=S("Key OK")},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function wf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,L,O,F,x,j,z,G,V,W,U,K;return o=new qt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Domoticz",n=h(),i=m("a"),ie(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),_=m("div"),p=S("Electricity IDX"),b=m("br"),v=h(),d=m("input"),$=h(),y=m("div"),T=S("Current IDX"),N=m("br"),E=h(),B=m("input"),P=h(),L=m("div"),O=S(`Voltage IDX: L1, L2 & L3 + `),F=m("div"),x=m("input"),j=h(),z=m("input"),G=h(),V=m("input"),r(l,"class","text-sm"),r(i,"href",Bt("MQTT-configuration#domoticz")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","o"),a.value="true",r(d,"name","oe"),r(d,"type","text"),r(d,"class","in-f tr w-full"),r(_,"class","w-1/2"),r(B,"name","oc"),r(B,"type","text"),r(B,"class","in-l tr w-full"),r(y,"class","w-1/2"),r(f,"class","my-1 flex"),r(x,"name","ou1"),r(x,"type","text"),r(x,"class","in-f tr w-1/3"),r(z,"name","ou2"),r(z,"type","text"),r(z,"class","in-m tr w-1/3"),r(V,"name","ou3"),r(V,"type","text"),r(V,"class","in-l tr w-1/3"),r(F,"class","flex"),r(L,"class","my-1"),r(e,"class","cnt")},m(H,Y){M(H,e,Y),s(e,l),s(e,n),s(e,i),le(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,_),s(_,p),s(_,b),s(_,v),s(_,d),te(d,t[3].o.e),s(f,$),s(f,y),s(y,T),s(y,N),s(y,E),s(y,B),te(B,t[3].o.c),s(e,P),s(e,L),s(L,O),s(L,F),s(F,x),te(x,t[3].o.u1),s(F,j),s(F,z),te(z,t[3].o.u2),s(F,G),s(F,V),te(V,t[3].o.u3),W=!0,U||(K=[ee(d,"input",t[64]),ee(B,"input",t[65]),ee(x,"input",t[66]),ee(z,"input",t[67]),ee(V,"input",t[68])],U=!0)},p(H,Y){Y[0]&8&&d.value!==H[3].o.e&&te(d,H[3].o.e),Y[0]&8&&B.value!==H[3].o.c&&te(B,H[3].o.c),Y[0]&8&&x.value!==H[3].o.u1&&te(x,H[3].o.u1),Y[0]&8&&z.value!==H[3].o.u2&&te(z,H[3].o.u2),Y[0]&8&&V.value!==H[3].o.u3&&te(V,H[3].o.u3)},i(H){W||(D(o.$$.fragment,H),W=!0)},o(H){q(o.$$.fragment,H),W=!1},d(H){H&&C(e),ne(o),U=!1,ze(K)}}}function yf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,L,O,F,x,j,z,G,V;return o=new qt({}),{c(){e=m("div"),l=m("strong"),l.textContent="Home-Assistant",n=h(),i=m("a"),ie(o.$$.fragment),u=h(),a=m("input"),c=h(),f=m("div"),_=S("Discovery topic prefix"),p=m("br"),b=h(),v=m("input"),d=h(),$=m("div"),y=S("Hostname for URL"),T=m("br"),N=h(),E=m("input"),P=h(),L=m("div"),O=S("Name tag"),F=m("br"),x=h(),j=m("input"),r(l,"class","text-sm"),r(i,"href",Bt("MQTT-configuration#home-assistant")),r(i,"target","_blank"),r(i,"class","float-right"),r(a,"type","hidden"),r(a,"name","h"),a.value="true",r(v,"name","ht"),r(v,"type","text"),r(v,"class","in-s"),r(v,"placeholder","homeassistant"),r(f,"class","my-1"),r(E,"name","hh"),r(E,"type","text"),r(E,"class","in-s"),r(E,"placeholder",B=t[3].g.h+".local"),r($,"class","my-1"),r(j,"name","hn"),r(j,"type","text"),r(j,"class","in-s"),r(L,"class","my-1"),r(e,"class","cnt")},m(W,U){M(W,e,U),s(e,l),s(e,n),s(e,i),le(o,i,null),s(e,u),s(e,a),s(e,c),s(e,f),s(f,_),s(f,p),s(f,b),s(f,v),te(v,t[3].h.t),s(e,d),s(e,$),s($,y),s($,T),s($,N),s($,E),te(E,t[3].h.h),s(e,P),s(e,L),s(L,O),s(L,F),s(L,x),s(L,j),te(j,t[3].h.n),z=!0,G||(V=[ee(v,"input",t[69]),ee(E,"input",t[70]),ee(j,"input",t[71])],G=!0)},p(W,U){U[0]&8&&v.value!==W[3].h.t&&te(v,W[3].h.t),(!z||U[0]&8&&B!==(B=W[3].g.h+".local"))&&r(E,"placeholder",B),U[0]&8&&E.value!==W[3].h.h&&te(E,W[3].h.h),U[0]&8&&j.value!==W[3].h.n&&te(j,W[3].h.n)},i(W){z||(D(o.$$.fragment,W),z=!0)},o(W){q(o.$$.fragment,W),z=!1},d(W){W&&C(e),ne(o),G=!1,ze(V)}}}function Cf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d=t[3].c.es&&Mf(t);return{c(){e=m("div"),l=m("input"),n=h(),i=m("strong"),i.textContent="Cloud connections",o=h(),u=m("div"),a=m("label"),c=m("input"),f=S(" Energy Speedometer"),_=h(),d&&d.c(),r(l,"type","hidden"),r(l,"name","c"),l.value="true",r(i,"class","text-sm"),r(c,"type","checkbox"),r(c,"class","rounded mb-1"),r(c,"name","ces"),c.__value="true",c.value=c.__value,r(u,"class","my-1"),r(e,"class","cnt")},m($,y){M($,e,y),s(e,l),s(e,n),s(e,i),s(e,o),s(e,u),s(u,a),s(a,c),c.checked=t[3].c.es,s(a,f),s(u,_),d&&d.m(u,null),p=!0,b||(v=ee(c,"change",t[72]),b=!0)},p($,y){y[0]&8&&(c.checked=$[3].c.es),$[3].c.es?d?(d.p($,y),y[0]&8&&D(d,1)):(d=Mf($),d.c(),D(d,1),d.m(u,null)):d&&(De(),q(d,1,1,()=>{d=null}),Ie())},i($){p||(D(d),p=!0)},o($){q(d),p=!1},d($){$&&C(e),d&&d.d(),b=!1,v()}}}function Mf(t){let e,l,n=t[0].mac+"",i,o,u,a,c=(t[0].meter.id?t[0].meter.id:"missing, required")+"",f,_,p,b,v=t[0].mac&&t[0].meter.id&&$f(t);return{c(){e=m("div"),l=S("MAC: "),i=S(n),o=h(),u=m("div"),a=S("Meter ID: "),f=S(c),_=h(),v&&v.c(),p=Ge(),r(e,"class","pl-5"),r(u,"class","pl-5")},m(d,$){M(d,e,$),s(e,l),s(e,i),M(d,o,$),M(d,u,$),s(u,a),s(u,f),M(d,_,$),v&&v.m(d,$),M(d,p,$),b=!0},p(d,$){(!b||$[0]&1)&&n!==(n=d[0].mac+"")&&X(i,n),(!b||$[0]&1)&&c!==(c=(d[0].meter.id?d[0].meter.id:"missing, required")+"")&&X(f,c),d[0].mac&&d[0].meter.id?v?(v.p(d,$),$[0]&1&&D(v,1)):(v=$f(d),v.c(),D(v,1),v.m(p.parentNode,p)):v&&(De(),q(v,1,1,()=>{v=null}),Ie())},i(d){b||(D(v),b=!0)},o(d){q(v),b=!1},d(d){d&&C(e),d&&C(o),d&&C(u),d&&C(_),v&&v.d(d),d&&C(p)}}}function $f(t){let e,l,n;return l=new ap({props:{value:'{"mac":"'+t[0].mac+'","meter":"'+t[0].meter.id+'"}'}}),{c(){e=m("div"),ie(l.$$.fragment),r(e,"class","pl-2")},m(i,o){M(i,e,o),le(l,e,null),n=!0},p(i,o){const u={};o[0]&1&&(u.value='{"mac":"'+i[0].mac+'","meter":"'+i[0].meter.id+'"}'),l.$set(u)},i(i){n||(D(l.$$.fragment,i),n=!0)},o(i){q(l.$$.fragment,i),n=!1},d(i){i&&C(e),ne(l)}}}function Sf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E;o=new qt({});let B={length:9},P=[];for(let L=0;L20&&Pf(t),_=t[0].chip=="esp8266"&&If(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Hardware",n=h(),i=m("a"),ie(o.$$.fragment),u=h(),f&&f.c(),a=h(),_&&_.c(),r(l,"class","text-sm"),r(i,"href",Bt("GPIO-configuration")),r(i,"target","_blank"),r(i,"class","float-right"),r(e,"class","cnt")},m(p,b){M(p,e,b),s(e,l),s(e,n),s(e,i),le(o,i,null),s(e,u),f&&f.m(e,null),s(e,a),_&&_.m(e,null),c=!0},p(p,b){p[0].board>20?f?(f.p(p,b),b[0]&1&&D(f,1)):(f=Pf(p),f.c(),D(f,1),f.m(e,a)):f&&(De(),q(f,1,1,()=>{f=null}),Ie()),p[0].chip=="esp8266"?_?_.p(p,b):(_=If(p),_.c(),_.m(e,null)):_&&(_.d(1),_=null)},i(p){c||(D(o.$$.fragment,p),D(f),c=!0)},o(p){q(o.$$.fragment,p),q(f),c=!1},d(p){p&&C(e),ne(o),f&&f.d(),_&&_.d()}}}function Pf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,L,O,F,x,j,z,G,V,W,U,K,H,Y,Z,re,ue,we,me,Te,je,Re,He,ye,Ne,Le,$e,w,g,k,A,I,Q,J,se,ce,ve,Se,oe;b=new xc({props:{chip:t[0].chip}});let pe=t[0].chip!="esp8266"&&Ef(t),Be=t[3].i.v.p>0&&Df(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=S("HAN"),u=m("label"),a=m("input"),c=S(" pullup"),f=m("br"),_=h(),p=m("select"),ie(b.$$.fragment),v=h(),d=m("div"),$=S("AP button"),y=m("br"),T=h(),N=m("input"),E=h(),B=m("div"),P=S("LED"),L=m("label"),O=m("input"),F=S(" inv"),x=m("br"),j=h(),z=m("div"),G=m("input"),V=h(),W=m("div"),U=S("RGB"),K=m("label"),H=m("input"),Y=S(" inverted"),Z=m("br"),re=h(),ue=m("div"),we=m("input"),me=h(),Te=m("input"),je=h(),Re=m("input"),He=h(),ye=m("div"),Ne=S("Temperature"),Le=m("br"),$e=h(),w=m("input"),g=h(),k=m("div"),A=S("Analog temp"),I=m("br"),Q=h(),J=m("input"),se=h(),pe&&pe.c(),ce=h(),Be&&Be.c(),r(e,"type","hidden"),r(e,"name","i"),e.value="true",r(a,"name","ihu"),a.__value="true",a.value=a.__value,r(a,"type","checkbox"),r(a,"class","rounded mb-1"),r(u,"class","ml-2"),r(p,"name","ihp"),r(p,"class","in-f w-full"),t[3].i.h.p===void 0&&et(()=>t[77].call(p)),r(i,"class","w-1/3"),r(N,"name","ia"),r(N,"type","number"),r(N,"min","0"),r(N,"max",t[6]),r(N,"class","in-m tr w-full"),r(d,"class","w-1/3"),r(O,"name","ili"),O.__value="true",O.value=O.__value,r(O,"type","checkbox"),r(O,"class","rounded mb-1"),r(L,"class","ml-4"),r(G,"name","ilp"),r(G,"type","number"),r(G,"min","0"),r(G,"max",t[6]),r(G,"class","in-l tr w-full"),r(z,"class","flex"),r(B,"class","w-1/3"),r(H,"name","iri"),H.__value="true",H.value=H.__value,r(H,"type","checkbox"),r(H,"class","rounded mb-1"),r(K,"class","ml-4"),r(we,"name","irr"),r(we,"type","number"),r(we,"min","0"),r(we,"max",t[6]),r(we,"class","in-f tr w-1/3"),r(Te,"name","irg"),r(Te,"type","number"),r(Te,"min","0"),r(Te,"max",t[6]),r(Te,"class","in-m tr w-1/3"),r(Re,"name","irb"),r(Re,"type","number"),r(Re,"min","0"),r(Re,"max",t[6]),r(Re,"class","in-l tr w-1/3"),r(ue,"class","flex"),r(W,"class","w-full"),r(w,"name","itd"),r(w,"type","number"),r(w,"min","0"),r(w,"max",t[6]),r(w,"class","in-f tr w-full"),r(ye,"class","my-1 w-1/3"),r(J,"name","ita"),r(J,"type","number"),r(J,"min","0"),r(J,"max",t[6]),r(J,"class","in-l tr w-full"),r(k,"class","my-1 pr-1 w-1/3"),r(n,"class","flex flex-wrap")},m(_e,Ce){M(_e,e,Ce),M(_e,l,Ce),M(_e,n,Ce),s(n,i),s(i,o),s(i,u),s(u,a),a.checked=t[3].i.h.u,s(u,c),s(i,f),s(i,_),s(i,p),le(b,p,null),qe(p,t[3].i.h.p,!0),s(n,v),s(n,d),s(d,$),s(d,y),s(d,T),s(d,N),te(N,t[3].i.a),s(n,E),s(n,B),s(B,P),s(B,L),s(L,O),O.checked=t[3].i.l.i,s(L,F),s(B,x),s(B,j),s(B,z),s(z,G),te(G,t[3].i.l.p),s(n,V),s(n,W),s(W,U),s(W,K),s(K,H),H.checked=t[3].i.r.i,s(K,Y),s(W,Z),s(W,re),s(W,ue),s(ue,we),te(we,t[3].i.r.r),s(ue,me),s(ue,Te),te(Te,t[3].i.r.g),s(ue,je),s(ue,Re),te(Re,t[3].i.r.b),s(n,He),s(n,ye),s(ye,Ne),s(ye,Le),s(ye,$e),s(ye,w),te(w,t[3].i.t.d),s(n,g),s(n,k),s(k,A),s(k,I),s(k,Q),s(k,J),te(J,t[3].i.t.a),s(n,se),pe&&pe.m(n,null),s(n,ce),Be&&Be.m(n,null),ve=!0,Se||(oe=[ee(a,"change",t[76]),ee(p,"change",t[77]),ee(N,"input",t[78]),ee(O,"change",t[79]),ee(G,"input",t[80]),ee(H,"change",t[81]),ee(we,"input",t[82]),ee(Te,"input",t[83]),ee(Re,"input",t[84]),ee(w,"input",t[85]),ee(J,"input",t[86])],Se=!0)},p(_e,Ce){Ce[0]&8&&(a.checked=_e[3].i.h.u);const vt={};Ce[0]&1&&(vt.chip=_e[0].chip),b.$set(vt),Ce[0]&8&&qe(p,_e[3].i.h.p),(!ve||Ce[0]&64)&&r(N,"max",_e[6]),Ce[0]&8&&he(N.value)!==_e[3].i.a&&te(N,_e[3].i.a),Ce[0]&8&&(O.checked=_e[3].i.l.i),(!ve||Ce[0]&64)&&r(G,"max",_e[6]),Ce[0]&8&&he(G.value)!==_e[3].i.l.p&&te(G,_e[3].i.l.p),Ce[0]&8&&(H.checked=_e[3].i.r.i),(!ve||Ce[0]&64)&&r(we,"max",_e[6]),Ce[0]&8&&he(we.value)!==_e[3].i.r.r&&te(we,_e[3].i.r.r),(!ve||Ce[0]&64)&&r(Te,"max",_e[6]),Ce[0]&8&&he(Te.value)!==_e[3].i.r.g&&te(Te,_e[3].i.r.g),(!ve||Ce[0]&64)&&r(Re,"max",_e[6]),Ce[0]&8&&he(Re.value)!==_e[3].i.r.b&&te(Re,_e[3].i.r.b),(!ve||Ce[0]&64)&&r(w,"max",_e[6]),Ce[0]&8&&he(w.value)!==_e[3].i.t.d&&te(w,_e[3].i.t.d),(!ve||Ce[0]&64)&&r(J,"max",_e[6]),Ce[0]&8&&he(J.value)!==_e[3].i.t.a&&te(J,_e[3].i.t.a),_e[0].chip!="esp8266"?pe?pe.p(_e,Ce):(pe=Ef(_e),pe.c(),pe.m(n,ce)):pe&&(pe.d(1),pe=null),_e[3].i.v.p>0?Be?Be.p(_e,Ce):(Be=Df(_e),Be.c(),Be.m(n,null)):Be&&(Be.d(1),Be=null)},i(_e){ve||(D(b.$$.fragment,_e),ve=!0)},o(_e){q(b.$$.fragment,_e),ve=!1},d(_e){_e&&C(e),_e&&C(l),_e&&C(n),ne(b),pe&&pe.d(),Be&&Be.d(),Se=!1,ze(oe)}}}function Ef(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=S("Vcc"),n=m("br"),i=h(),o=m("input"),r(o,"name","ivp"),r(o,"type","number"),r(o,"min","0"),r(o,"max",t[6]),r(o,"class","in-s tr w-full"),r(e,"class","my-1 pl-1 w-1/3")},m(c,f){M(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].i.v.p),u||(a=ee(o,"input",t[87]),u=!0)},p(c,f){f[0]&64&&r(o,"max",c[6]),f[0]&8&&he(o.value)!==c[3].i.v.p&&te(o,c[3].i.v.p)},d(c){c&&C(e),u=!1,a()}}}function Df(t){let e,l,n,i,o,u,a,c,f,_;return{c(){e=m("div"),l=S("Voltage divider"),n=m("br"),i=h(),o=m("div"),u=m("input"),a=h(),c=m("input"),r(u,"name","ivdv"),r(u,"type","number"),r(u,"min","0"),r(u,"max","65535"),r(u,"class","in-f tr w-full"),r(u,"placeholder","VCC"),r(c,"name","ivdg"),r(c,"type","number"),r(c,"min","0"),r(c,"max","65535"),r(c,"class","in-l tr w-full"),r(c,"placeholder","GND"),r(o,"class","flex"),r(e,"class","my-1")},m(p,b){M(p,e,b),s(e,l),s(e,n),s(e,i),s(e,o),s(o,u),te(u,t[3].i.v.d.v),s(o,a),s(o,c),te(c,t[3].i.v.d.g),f||(_=[ee(u,"input",t[88]),ee(c,"input",t[89])],f=!0)},p(p,b){b[0]&8&&he(u.value)!==p[3].i.v.d.v&&te(u,p[3].i.v.d.v),b[0]&8&&he(c.value)!==p[3].i.v.d.g&&te(c,p[3].i.v.d.g)},d(p){p&&C(e),f=!1,ze(_)}}}function If(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N=(t[0].board==2||t[0].board==100)&&Rf(t);return{c(){e=m("input"),l=h(),n=m("div"),i=m("div"),o=S("Vcc offset"),u=m("br"),a=h(),c=m("input"),f=h(),_=m("div"),p=S("Multiplier"),b=m("br"),v=h(),d=m("input"),$=h(),N&&N.c(),r(e,"type","hidden"),r(e,"name","iv"),e.value="true",r(c,"name","ivo"),r(c,"type","number"),r(c,"min","0.0"),r(c,"max","3.5"),r(c,"step","0.01"),r(c,"class","in-f tr w-full"),r(i,"class","w-1/3"),r(d,"name","ivm"),r(d,"type","number"),r(d,"min","0.1"),r(d,"max","10"),r(d,"step","0.01"),r(d,"class","in-l tr w-full"),r(_,"class","w-1/3 pr-1"),r(n,"class","my-1 flex flex-wrap")},m(E,B){M(E,e,B),M(E,l,B),M(E,n,B),s(n,i),s(i,o),s(i,u),s(i,a),s(i,c),te(c,t[3].i.v.o),s(n,f),s(n,_),s(_,p),s(_,b),s(_,v),s(_,d),te(d,t[3].i.v.m),s(n,$),N&&N.m(n,null),y||(T=[ee(c,"input",t[90]),ee(d,"input",t[91])],y=!0)},p(E,B){B[0]&8&&he(c.value)!==E[3].i.v.o&&te(c,E[3].i.v.o),B[0]&8&&he(d.value)!==E[3].i.v.m&&te(d,E[3].i.v.m),E[0].board==2||E[0].board==100?N?N.p(E,B):(N=Rf(E),N.c(),N.m(n,null)):N&&(N.d(1),N=null)},d(E){E&&C(e),E&&C(l),E&&C(n),N&&N.d(),y=!1,ze(T)}}}function Rf(t){let e,l,n,i,o,u,a;return{c(){e=m("div"),l=S("Boot limit"),n=m("br"),i=h(),o=m("input"),r(o,"name","ivb"),r(o,"type","number"),r(o,"min","2.5"),r(o,"max","3.5"),r(o,"step","0.1"),r(o,"class","in-s tr w-full"),r(e,"class","w-1/3 pl-1")},m(c,f){M(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),te(o,t[3].i.v.b),u||(a=ee(o,"input",t[92]),u=!0)},p(c,f){f[0]&8&&he(o.value)!==c[3].i.v.b&&te(o,c[3].i.v.b)},d(c){c&&C(e),u=!1,a()}}}function Lf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T=t[3].d.t&&Of();return{c(){e=m("div"),e.textContent="Debug can cause sudden reboots. Do not leave on!",l=h(),n=m("div"),i=m("label"),o=m("input"),u=S(" Enable telnet"),a=h(),T&&T.c(),c=h(),f=m("div"),_=m("select"),p=m("option"),p.textContent="Verbose",b=m("option"),b.textContent="Debug",v=m("option"),v.textContent="Info",d=m("option"),d.textContent="Warning",r(e,"class","bd-red"),r(o,"type","checkbox"),r(o,"name","dt"),o.__value="true",o.value=o.__value,r(o,"class","rounded mb-1"),r(n,"class","my-1"),p.__value=1,p.value=p.__value,b.__value=2,b.value=b.__value,v.__value=3,v.value=v.__value,d.__value=4,d.value=d.__value,r(_,"name","dl"),r(_,"class","in-s"),t[3].d.l===void 0&&et(()=>t[95].call(_)),r(f,"class","my-1")},m(N,E){M(N,e,E),M(N,l,E),M(N,n,E),s(n,i),s(i,o),o.checked=t[3].d.t,s(i,u),M(N,a,E),T&&T.m(N,E),M(N,c,E),M(N,f,E),s(f,_),s(_,p),s(_,b),s(_,v),s(_,d),qe(_,t[3].d.l,!0),$||(y=[ee(o,"change",t[94]),ee(_,"change",t[95])],$=!0)},p(N,E){E[0]&8&&(o.checked=N[3].d.t),N[3].d.t?T||(T=Of(),T.c(),T.m(c.parentNode,c)):T&&(T.d(1),T=null),E[0]&8&&qe(_,N[3].d.l)},d(N){N&&C(e),N&&C(l),N&&C(n),N&&C(a),T&&T.d(N),N&&C(c),N&&C(f),$=!1,ze(y)}}}function Of(t){let e;return{c(){e=m("div"),e.textContent="Telnet is unsafe and should be off when not in use",r(e,"class","bd-red")},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function $p(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,L,O,F,x,j,z,G,V,W,U,K,H,Y,Z,re,ue,we,me,Te,je,Re,He,ye,Ne,Le,$e,w,g,k,A,I,Q,J,se,ce,ve,Se,oe,pe,Be,_e,Ce,vt,Hl,tl,ct,Sl,pl,jt,ht,Ye,Qe,Xe,Ue,Ze,We,Je,xe,de,Me,Ii,_l,vn,Tt,Ri,Li,Oi,dl,Fi,qi,Bi,Nt,Tl,Nl,Al,Ui,ji,ke,mt,Wl,zl,Pl,El,Gl,Hi,ll,Wi,Io,Ds,Ro,pi,Ht,Lo,Oo,Dl,nl,Il,Fo,zi,qo,pt,Rl,Bo,Gi,hn,bn,gn,kn,Vi,Uo,At,Ki,jo,Vl,Ho,Wo,zo,il,wn,yn,Go,Cn,Kl,Vo,Ko,Yo,Mn,Wt,Qo,Yi,Xo,Yl,Zo,Jo,xo,$n,zt,er,Qi,tr,Is,lr,Ql,Xi,Gt,nr,ir,sr,Rs,Zi,Vt,or,rr,ar,tt,Ji,ur,Sn,Tn,fr,_i,cr,Xl,mr,pr,_r,vl,dr,Zl,vr,hr,br,hl,gr,Nn,Jl,kr,wr,yr,Rt,An,Pn,En,Dn,Cr,xl,Mr,$r,Sr,In,Lt,Tr,xi,Nr,es,ts,Kt,Ar,Pr,ls,ns,Yt,Er,Dr,ut,is,Ir,Rn,Ln,Rr,en,Lr,Or,Fr,Ll,sl,On,Fn,qr,Pt,ss,os,Br,Et,qn,rs,as,Ur,Ls,us,fs,Qt,jr,Hr,di,Wr,Ol,zr,vi,Xt,Gr,Vr,Kr,cs,bl,Yr,Ke,ms,Qr,Bn,Un,Xr,hi,Zr,ol,Jr,Os,xr,ea,jn,gl,ta,Zt,la,Fs,tn,na,ia,sa,kl,oa,ln,ra,aa,ua,wl,fa,Hn,Wn,ca,ma,pa,yl,_a,zn,da,va,ha,bt,Gn,Vn,Kn,Yn,Qn,Xn,ba,nn,ga,ka,wa,Cl,ya,qs,Bs,Us,js=t[3].p.r.startsWith("10YNO")||t[3].p.r.startsWith("10Y1001A1001A4"),Hs,rl,ps,Ca,Zn,Jn,Ma,bi,$a,gi,Sa,Ws,Dt,_s,Ta,xn,ei,Na,ki,Aa,ds,vs,Jt,Pa,Ea,Da,Fl,zs,ti,Ia,hs,li,Ra,bs,Gs,sn,Vs,on,Ks,rn,Ys,an,Ot,Qs,La;a=new qt({}),F=new tp({});let l0=["NOK","SEK","DKK","EUR"],wi=[];for(let R=0;R<4;R+=1)wi[R]=cp(fp(t,l0,R));let gt=t[3].p.e&&t[0].chip!="esp8266"&&pf(t),kt=t[3].g.s>0&&_f(t);Pl=new qt({});let n0=[24,48,96,192,384,576,1152],yi=[];for(let R=0;R<7;R+=1)yi[R]=mp(up(t,n0,R));let wt=t[3].m.e.e&&df(t),yt=t[3].m.e.e&&vf(t),Ct=t[3].m.m.e&&hf(t);Tn=new qt({}),Ln=new qt({}),qn=new e0({});let Mt=t[3].n.m=="static"&&bf(t);Un=new qt({});let $t=t[0].chip!="esp8266"&&gf(t),lt=t[3].q.s.e&&kf(t),nt=t[3].q.m==3&&wf(t),it=t[3].q.m==4&&yf(t),st=t[3].c.es!=null&&Cf(t),ot=js&&Sf(t);Jn=new qt({});let ni=t[7],_t=[];for(let R=0;R20||t[0].chip=="esp8266")&&Af(t);ei=new qt({});let St=t[3].d.s&&Lf(t);return sn=new It({props:{active:t[1],message:"Loading configuration"}}),on=new It({props:{active:t[2],message:"Saving configuration"}}),rn=new It({props:{active:t[4],message:"Performing factory reset"}}),an=new It({props:{active:t[5],message:"Device have been factory reset and switched to AP mode"}}),{c(){e=m("form"),l=m("div"),n=m("div"),i=m("strong"),i.textContent="General",o=h(),u=m("a"),ie(a.$$.fragment),c=h(),f=m("input"),_=h(),p=m("div"),b=m("div"),v=m("div"),d=S("Hostname"),$=m("br"),y=h(),T=m("input"),N=h(),E=m("div"),B=S("Time zone"),P=m("br"),L=h(),O=m("select"),ie(F.$$.fragment),x=h(),j=m("input"),z=h(),G=m("div"),V=m("div"),W=m("div"),U=S("Price region"),K=m("br"),H=h(),Y=m("select"),Z=m("optgroup"),re=m("option"),re.textContent="NO1",ue=m("option"),ue.textContent="NO2",we=m("option"),we.textContent="NO3",me=m("option"),me.textContent="NO4",Te=m("option"),Te.textContent="NO5",je=m("optgroup"),Re=m("option"),Re.textContent="SE1",He=m("option"),He.textContent="SE2",ye=m("option"),ye.textContent="SE3",Ne=m("option"),Ne.textContent="SE4",Le=m("optgroup"),$e=m("option"),$e.textContent="DK1",w=m("option"),w.textContent="DK2",g=m("option"),g.textContent="Austria",k=m("option"),k.textContent="Belgium",A=m("option"),A.textContent="Czech Republic",I=m("option"),I.textContent="Estonia",Q=m("option"),Q.textContent="Finland",J=m("option"),J.textContent="France",se=m("option"),se.textContent="Germany",ce=m("option"),ce.textContent="Great Britain",ve=m("option"),ve.textContent="Latvia",Se=m("option"),Se.textContent="Lithuania",oe=m("option"),oe.textContent="Netherland",pe=m("option"),pe.textContent="Poland",Be=m("option"),Be.textContent="Switzerland",_e=h(),Ce=m("div"),vt=S("Currency"),Hl=m("br"),tl=h(),ct=m("select");for(let R=0;R<4;R+=1)wi[R].c();Sl=h(),pl=m("div"),jt=m("div"),ht=m("div"),Ye=S("Fixed price"),Qe=m("br"),Xe=h(),Ue=m("input"),Ze=h(),We=m("div"),Je=S("Multiplier"),xe=m("br"),de=h(),Me=m("input"),Ii=h(),_l=m("div"),vn=m("label"),Tt=m("input"),Ri=S(" Enable price fetch from remote server"),Li=h(),gt&>.c(),Oi=h(),dl=m("div"),Fi=S("Security"),qi=m("br"),Bi=h(),Nt=m("select"),Tl=m("option"),Tl.textContent="None",Nl=m("option"),Nl.textContent="Only configuration",Al=m("option"),Al.textContent="Everything",Ui=h(),kt&&kt.c(),ji=h(),ke=m("div"),mt=m("strong"),mt.textContent="Meter",Wl=h(),zl=m("a"),ie(Pl.$$.fragment),El=h(),Gl=m("input"),Hi=h(),ll=m("div"),Wi=m("span"),Wi.textContent="Buffer size",Io=h(),Ds=m("span"),Ds.textContent="Serial conf.",Ro=h(),pi=m("label"),Ht=m("input"),Lo=S(" inverted"),Oo=h(),Dl=m("div"),nl=m("select"),Il=m("option"),Fo=S("Autodetect");for(let R=0;R<7;R+=1)yi[R].c();qo=h(),pt=m("select"),Rl=m("option"),Bo=S("-"),hn=m("option"),hn.textContent="7N1",bn=m("option"),bn.textContent="8N1",gn=m("option"),gn.textContent="7E1",kn=m("option"),kn.textContent="8E1",Uo=h(),At=m("input"),jo=h(),Vl=m("div"),Ho=S("Voltage"),Wo=m("br"),zo=h(),il=m("select"),wn=m("option"),wn.textContent="400V (TN)",yn=m("option"),yn.textContent="230V (IT/TT)",Go=h(),Cn=m("div"),Kl=m("div"),Vo=S("Main fuse"),Ko=m("br"),Yo=h(),Mn=m("label"),Wt=m("input"),Qo=h(),Yi=m("span"),Yi.textContent="A",Xo=h(),Yl=m("div"),Zo=S("Production"),Jo=m("br"),xo=h(),$n=m("label"),zt=m("input"),er=h(),Qi=m("span"),Qi.textContent="kWp",tr=h(),Is=m("div"),lr=h(),Ql=m("div"),Xi=m("label"),Gt=m("input"),nr=S(" Meter is encrypted"),ir=h(),wt&&wt.c(),sr=h(),yt&&yt.c(),Rs=h(),Zi=m("label"),Vt=m("input"),or=S(" Multipliers"),rr=h(),Ct&&Ct.c(),ar=h(),tt=m("div"),Ji=m("strong"),Ji.textContent="WiFi",ur=h(),Sn=m("a"),ie(Tn.$$.fragment),fr=h(),_i=m("input"),cr=h(),Xl=m("div"),mr=S("SSID"),pr=m("br"),_r=h(),vl=m("input"),dr=h(),Zl=m("div"),vr=S("Password"),hr=m("br"),br=h(),hl=m("input"),gr=h(),Nn=m("div"),Jl=m("div"),kr=S("Power saving"),wr=m("br"),yr=h(),Rt=m("select"),An=m("option"),An.textContent="Default",Pn=m("option"),Pn.textContent="Off",En=m("option"),En.textContent="Minimum",Dn=m("option"),Dn.textContent="Maximum",Cr=h(),xl=m("div"),Mr=S("Power"),$r=m("br"),Sr=h(),In=m("div"),Lt=m("input"),Tr=h(),xi=m("span"),xi.textContent="dBm",Nr=h(),es=m("div"),ts=m("label"),Kt=m("input"),Ar=S(" Auto reboot on connection problem"),Pr=h(),ls=m("div"),ns=m("label"),Yt=m("input"),Er=S(" Allow 802.11b legacy rates"),Dr=h(),ut=m("div"),is=m("strong"),is.textContent="Network",Ir=h(),Rn=m("a"),ie(Ln.$$.fragment),Rr=h(),en=m("div"),Lr=S("IP"),Or=m("br"),Fr=h(),Ll=m("div"),sl=m("select"),On=m("option"),On.textContent="DHCP",Fn=m("option"),Fn.textContent="Static",qr=h(),Pt=m("input"),Br=h(),Et=m("select"),ie(qn.$$.fragment),Ur=h(),Mt&&Mt.c(),Ls=h(),us=m("div"),fs=m("label"),Qt=m("input"),jr=S(" enable mDNS"),Hr=h(),di=m("input"),Wr=h(),Ol=m("div"),zr=S("NTP "),vi=m("label"),Xt=m("input"),Gr=S(" obtain from DHCP"),Vr=m("br"),Kr=h(),cs=m("div"),bl=m("input"),Yr=h(),Ke=m("div"),ms=m("strong"),ms.textContent="MQTT",Qr=h(),Bn=m("a"),ie(Un.$$.fragment),Xr=h(),hi=m("input"),Zr=h(),ol=m("div"),Jr=S(`Server + `),$t&&$t.c(),Os=h(),xr=m("br"),ea=h(),jn=m("div"),gl=m("input"),ta=h(),Zt=m("input"),la=h(),lt&<.c(),Fs=h(),tn=m("div"),na=S("Username"),ia=m("br"),sa=h(),kl=m("input"),oa=h(),ln=m("div"),ra=S("Password"),aa=m("br"),ua=h(),wl=m("input"),fa=h(),Hn=m("div"),Wn=m("div"),ca=S("Client ID"),ma=m("br"),pa=h(),yl=m("input"),_a=h(),zn=m("div"),da=S("Payload"),va=m("br"),ha=h(),bt=m("select"),Gn=m("option"),Gn.textContent="JSON",Vn=m("option"),Vn.textContent="Raw (minimal)",Kn=m("option"),Kn.textContent="Raw (full)",Yn=m("option"),Yn.textContent="Domoticz",Qn=m("option"),Qn.textContent="HomeAssistant",Xn=m("option"),Xn.textContent="HEX dump",ba=h(),nn=m("div"),ga=S("Publish topic"),ka=m("br"),wa=h(),Cl=m("input"),ya=h(),nt&&nt.c(),qs=h(),it&&it.c(),Bs=h(),st&&st.c(),Us=h(),ot&&ot.c(),Hs=h(),rl=m("div"),ps=m("strong"),ps.textContent="User interface",Ca=h(),Zn=m("a"),ie(Jn.$$.fragment),Ma=h(),bi=m("input"),$a=h(),gi=m("div");for(let R=0;R<_t.length;R+=1)_t[R].c();Sa=h(),rt&&rt.c(),Ws=h(),Dt=m("div"),_s=m("strong"),_s.textContent="Debugging",Ta=h(),xn=m("a"),ie(ei.$$.fragment),Na=h(),ki=m("input"),Aa=h(),ds=m("div"),vs=m("label"),Jt=m("input"),Pa=S(" Enable debugging"),Ea=h(),St&&St.c(),Da=h(),Fl=m("div"),zs=m("div"),ti=m("button"),ti.textContent="Factory reset",Ia=h(),hs=m("div"),li=m("button"),li.textContent="Reboot",Ra=h(),bs=m("div"),bs.innerHTML='',Gs=h(),ie(sn.$$.fragment),Vs=h(),ie(on.$$.fragment),Ks=h(),ie(rn.$$.fragment),Ys=h(),ie(an.$$.fragment),r(i,"class","text-sm"),r(u,"href",Bt("General-configuration")),r(u,"target","_blank"),r(u,"class","float-right"),r(f,"type","hidden"),r(f,"name","g"),f.value="true",r(T,"name","gh"),r(T,"type","text"),r(T,"class","in-f w-full"),r(T,"pattern","[A-Za-z0-9-]+"),r(O,"name","gt"),r(O,"class","in-l w-full"),t[3].g.t===void 0&&et(()=>t[16].call(O)),r(b,"class","flex"),r(p,"class","my-1"),r(j,"type","hidden"),r(j,"name","p"),j.value="true",re.__value="10YNO-1--------2",re.value=re.__value,ue.__value="10YNO-2--------T",ue.value=ue.__value,we.__value="10YNO-3--------J",we.value=we.__value,me.__value="10YNO-4--------9",me.value=me.__value,Te.__value="10Y1001A1001A48H",Te.value=Te.__value,r(Z,"label","Norway"),Re.__value="10Y1001A1001A44P",Re.value=Re.__value,He.__value="10Y1001A1001A45N",He.value=He.__value,ye.__value="10Y1001A1001A46L",ye.value=ye.__value,Ne.__value="10Y1001A1001A47J",Ne.value=Ne.__value,r(je,"label","Sweden"),$e.__value="10YDK-1--------W",$e.value=$e.__value,w.__value="10YDK-2--------M",w.value=w.__value,r(Le,"label","Denmark"),g.__value="10YAT-APG------L",g.value=g.__value,k.__value="10YBE----------2",k.value=k.__value,A.__value="10YCZ-CEPS-----N",A.value=A.__value,I.__value="10Y1001A1001A39I",I.value=I.__value,Q.__value="10YFI-1--------U",Q.value=Q.__value,J.__value="10YFR-RTE------C",J.value=J.__value,se.__value="10Y1001A1001A83F",se.value=se.__value,ce.__value="10YGB----------A",ce.value=ce.__value,ve.__value="10YLV-1001A00074",ve.value=ve.__value,Se.__value="10YLT-1001A0008Q",Se.value=Se.__value,oe.__value="10YNL----------L",oe.value=oe.__value,pe.__value="10YPL-AREA-----S",pe.value=pe.__value,Be.__value="10YCH-SWISSGRIDZ",Be.value=Be.__value,r(Y,"name","pr"),r(Y,"class","in-f w-full"),t[3].p.r===void 0&&et(()=>t[17].call(Y)),r(W,"class","w-full"),r(ct,"name","pc"),r(ct,"class","in-l"),t[3].p.c===void 0&&et(()=>t[18].call(ct)),r(V,"class","flex"),r(G,"class","my-1"),r(Ue,"name","pf"),r(Ue,"type","number"),r(Ue,"min","0.001"),r(Ue,"max","65"),r(Ue,"step","0.001"),r(Ue,"class","in-f tr w-full"),r(ht,"class","w-1/2"),r(Me,"name","pm"),r(Me,"type","number"),r(Me,"min","0.001"),r(Me,"max","1000"),r(Me,"step","0.001"),r(Me,"class","in-l tr w-full"),r(We,"class","w-1/2"),r(jt,"class","flex"),r(pl,"class","my-1"),r(Tt,"type","checkbox"),r(Tt,"name","pe"),Tt.__value="true",Tt.value=Tt.__value,r(Tt,"class","rounded mb-1"),r(_l,"class","my-1"),Tl.__value=0,Tl.value=Tl.__value,Nl.__value=1,Nl.value=Nl.__value,Al.__value=2,Al.value=Al.__value,r(Nt,"name","gs"),r(Nt,"class","in-s"),t[3].g.s===void 0&&et(()=>t[23].call(Nt)),r(dl,"class","my-1"),r(n,"class","cnt"),r(mt,"class","text-sm"),r(zl,"href",Bt("Meter-configuration")),r(zl,"target","_blank"),r(zl,"class","float-right"),r(Gl,"type","hidden"),r(Gl,"name","m"),Gl.value="true",r(Wi,"class","float-right"),r(Ht,"name","mi"),Ht.__value="true",Ht.value=Ht.__value,r(Ht,"type","checkbox"),r(Ht,"class","rounded mb-1"),r(pi,"class","mt-2 ml-3 whitespace-nowrap"),Il.__value=0,Il.value=Il.__value,Il.disabled=zi=t[3].m.b!=0,r(nl,"name","mb"),r(nl,"class","in-f tr w-1/2"),t[3].m.b===void 0&&et(()=>t[27].call(nl)),Rl.__value=0,Rl.value=Rl.__value,Rl.disabled=Gi=t[3].m.b!=0,hn.__value=2,hn.value=hn.__value,bn.__value=3,bn.value=bn.__value,gn.__value=10,gn.value=gn.__value,kn.__value=11,kn.value=kn.__value,r(pt,"name","mp"),r(pt,"class","in-m"),pt.disabled=Vi=t[3].m.b==0,t[3].m.p===void 0&&et(()=>t[28].call(pt)),r(At,"name","ms"),r(At,"type","number"),r(At,"min",64),r(At,"max",Ki=t[0].chip=="esp8266"?t[3].i.h.p==3||t[3].i.h.p==113?512:128:4096),r(At,"step",64),r(At,"class","in-l tr w-1/2"),r(Dl,"class","flex w-full"),r(ll,"class","my-1"),wn.__value=2,wn.value=wn.__value,yn.__value=1,yn.value=yn.__value,r(il,"name","md"),r(il,"class","in-s"),t[3].m.d===void 0&&et(()=>t[30].call(il)),r(Vl,"class","my-1"),r(Wt,"name","mf"),r(Wt,"type","number"),r(Wt,"min","5"),r(Wt,"max","65535"),r(Wt,"class","in-f tr w-full"),r(Yi,"class","in-post"),r(Mn,"class","flex"),r(Kl,"class","mx-1"),r(zt,"name","mr"),r(zt,"type","number"),r(zt,"min","0"),r(zt,"max","65535"),r(zt,"class","in-f tr w-full"),r(Qi,"class","in-post"),r($n,"class","flex"),r(Yl,"class","mx-1"),r(Cn,"class","my-1 flex"),r(Is,"class","my-1"),r(Gt,"type","checkbox"),r(Gt,"name","me"),Gt.__value="true",Gt.value=Gt.__value,r(Gt,"class","rounded mb-1"),r(Ql,"class","my-1"),r(Vt,"type","checkbox"),r(Vt,"name","mm"),Vt.__value="true",Vt.value=Vt.__value,r(Vt,"class","rounded mb-1"),r(ke,"class","cnt"),r(Ji,"class","text-sm"),r(Sn,"href",Bt("WiFi-configuration")),r(Sn,"target","_blank"),r(Sn,"class","float-right"),r(_i,"type","hidden"),r(_i,"name","w"),_i.value="true",r(vl,"name","ws"),r(vl,"type","text"),r(vl,"class","in-s"),r(Xl,"class","my-1"),r(hl,"name","wp"),r(hl,"type","password"),r(hl,"class","in-s"),r(Zl,"class","my-1"),An.__value=255,An.value=An.__value,Pn.__value=0,Pn.value=Pn.__value,En.__value=1,En.value=En.__value,Dn.__value=2,Dn.value=Dn.__value,r(Rt,"name","wz"),r(Rt,"class","in-s"),t[3].w.z===void 0&&et(()=>t[43].call(Rt)),r(Jl,"class","w-1/2"),r(Lt,"name","ww"),r(Lt,"type","number"),r(Lt,"min","0"),r(Lt,"max","20.5"),r(Lt,"step","0.5"),r(Lt,"class","in-f tr w-full"),r(xi,"class","in-post"),r(In,"class","flex"),r(xl,"class","ml-2 w-1/2"),r(Nn,"class","my-1 flex"),r(Kt,"type","checkbox"),r(Kt,"name","wa"),Kt.__value="true",Kt.value=Kt.__value,r(Kt,"class","rounded mb-1"),r(es,"class","my-3"),r(Yt,"type","checkbox"),r(Yt,"name","wb"),Yt.__value="true",Yt.value=Yt.__value,r(Yt,"class","rounded mb-1"),r(ls,"class","my-3"),r(tt,"class","cnt"),r(is,"class","text-sm"),r(Rn,"href",Bt("Network-configuration")),r(Rn,"target","_blank"),r(Rn,"class","float-right"),On.__value="dhcp",On.value=On.__value,Fn.__value="static",Fn.value=Fn.__value,r(sl,"name","nm"),r(sl,"class","in-f"),t[3].n.m===void 0&&et(()=>t[47].call(sl)),r(Pt,"name","ni"),r(Pt,"type","text"),r(Pt,"class","in-m w-full"),Pt.disabled=ss=t[3].n.m=="dhcp",Pt.required=os=t[3].n.m=="static",r(Et,"name","ns"),r(Et,"class","in-l"),Et.disabled=rs=t[3].n.m=="dhcp",Et.required=as=t[3].n.m=="static",t[3].n.s===void 0&&et(()=>t[49].call(Et)),r(Ll,"class","flex"),r(en,"class","my-1"),r(Qt,"name","nd"),Qt.__value="true",Qt.value=Qt.__value,r(Qt,"type","checkbox"),r(Qt,"class","rounded mb-1"),r(us,"class","my-1"),r(di,"type","hidden"),r(di,"name","ntp"),di.value="true",r(Xt,"name","ntpd"),Xt.__value="true",Xt.value=Xt.__value,r(Xt,"type","checkbox"),r(Xt,"class","rounded mb-1"),r(vi,"class","ml-4"),r(bl,"name","ntph"),r(bl,"type","text"),r(bl,"class","in-s"),r(cs,"class","flex"),r(Ol,"class","my-1"),r(ut,"class","cnt"),r(ms,"class","text-sm"),r(Bn,"href",Bt("MQTT-configuration")),r(Bn,"target","_blank"),r(Bn,"class","float-right"),r(hi,"type","hidden"),r(hi,"name","q"),hi.value="true",r(gl,"name","qh"),r(gl,"type","text"),r(gl,"class","in-f w-3/4"),r(Zt,"name","qp"),r(Zt,"type","number"),r(Zt,"min","1024"),r(Zt,"max","65535"),r(Zt,"class","in-l tr w-1/4"),r(jn,"class","flex"),r(ol,"class","my-1"),r(kl,"name","qu"),r(kl,"type","text"),r(kl,"class","in-s"),r(tn,"class","my-1"),r(wl,"name","qa"),r(wl,"type","password"),r(wl,"class","in-s"),r(ln,"class","my-1"),r(yl,"name","qc"),r(yl,"type","text"),r(yl,"class","in-f w-full"),Gn.__value=0,Gn.value=Gn.__value,Vn.__value=1,Vn.value=Vn.__value,Kn.__value=2,Kn.value=Kn.__value,Yn.__value=3,Yn.value=Yn.__value,Qn.__value=4,Qn.value=Qn.__value,Xn.__value=255,Xn.value=Xn.__value,r(bt,"name","qm"),r(bt,"class","in-l"),t[3].q.m===void 0&&et(()=>t[62].call(bt)),r(Hn,"class","my-1 flex"),r(Cl,"name","qb"),r(Cl,"type","text"),r(Cl,"class","in-s"),r(nn,"class","my-1"),r(Ke,"class","cnt"),r(ps,"class","text-sm"),r(Zn,"href",Bt("User-interface")),r(Zn,"target","_blank"),r(Zn,"class","float-right"),r(bi,"type","hidden"),r(bi,"name","u"),bi.value="true",r(gi,"class","flex flex-wrap"),r(rl,"class","cnt"),r(_s,"class","text-sm"),r(xn,"href","https://amsleser.no/blog/post/24-telnet-debug"),r(xn,"target","_blank"),r(xn,"class","float-right"),r(ki,"type","hidden"),r(ki,"name","d"),ki.value="true",r(Jt,"type","checkbox"),r(Jt,"name","ds"),Jt.__value="true",Jt.value=Jt.__value,r(Jt,"class","rounded mb-1"),r(ds,"class","mt-3"),r(Dt,"class","cnt"),r(l,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2"),r(ti,"type","button"),r(ti,"class","py-2 px-4 rounded bg-red-500 text-white ml-2"),r(li,"type","button"),r(li,"class","py-2 px-4 rounded bg-yellow-500 text-white"),r(hs,"class","text-center"),r(bs,"class","text-right"),r(Fl,"class","grid grid-cols-3"),r(e,"autocomplete","off")},m(R,ae){M(R,e,ae),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),le(a,u,null),s(n,c),s(n,f),s(n,_),s(n,p),s(p,b),s(b,v),s(v,d),s(v,$),s(v,y),s(v,T),te(T,t[3].g.h),s(b,N),s(b,E),s(E,B),s(E,P),s(E,L),s(E,O),le(F,O,null),qe(O,t[3].g.t,!0),s(n,x),s(n,j),s(n,z),s(n,G),s(G,V),s(V,W),s(W,U),s(W,K),s(W,H),s(W,Y),s(Y,Z),s(Z,re),s(Z,ue),s(Z,we),s(Z,me),s(Z,Te),s(Y,je),s(je,Re),s(je,He),s(je,ye),s(je,Ne),s(Y,Le),s(Le,$e),s(Le,w),s(Y,g),s(Y,k),s(Y,A),s(Y,I),s(Y,Q),s(Y,J),s(Y,se),s(Y,ce),s(Y,ve),s(Y,Se),s(Y,oe),s(Y,pe),s(Y,Be),qe(Y,t[3].p.r,!0),s(V,_e),s(V,Ce),s(Ce,vt),s(Ce,Hl),s(Ce,tl),s(Ce,ct);for(let ft=0;ft<4;ft+=1)wi[ft]&&wi[ft].m(ct,null);qe(ct,t[3].p.c,!0),s(n,Sl),s(n,pl),s(pl,jt),s(jt,ht),s(ht,Ye),s(ht,Qe),s(ht,Xe),s(ht,Ue),te(Ue,t[3].p.f),s(jt,Ze),s(jt,We),s(We,Je),s(We,xe),s(We,de),s(We,Me),te(Me,t[3].p.m),s(n,Ii),s(n,_l),s(_l,vn),s(vn,Tt),Tt.checked=t[3].p.e,s(vn,Ri),s(_l,Li),gt&>.m(_l,null),s(n,Oi),s(n,dl),s(dl,Fi),s(dl,qi),s(dl,Bi),s(dl,Nt),s(Nt,Tl),s(Nt,Nl),s(Nt,Al),qe(Nt,t[3].g.s,!0),s(n,Ui),kt&&kt.m(n,null),s(l,ji),s(l,ke),s(ke,mt),s(ke,Wl),s(ke,zl),le(Pl,zl,null),s(ke,El),s(ke,Gl),s(ke,Hi),s(ke,ll),s(ll,Wi),s(ll,Io),s(ll,Ds),s(ll,Ro),s(ll,pi),s(pi,Ht),Ht.checked=t[3].m.i,s(pi,Lo),s(ll,Oo),s(ll,Dl),s(Dl,nl),s(nl,Il),s(Il,Fo);for(let ft=0;ft<7;ft+=1)yi[ft]&&yi[ft].m(nl,null);qe(nl,t[3].m.b,!0),s(Dl,qo),s(Dl,pt),s(pt,Rl),s(Rl,Bo),s(pt,hn),s(pt,bn),s(pt,gn),s(pt,kn),qe(pt,t[3].m.p,!0),s(Dl,Uo),s(Dl,At),te(At,t[3].m.s),s(ke,jo),s(ke,Vl),s(Vl,Ho),s(Vl,Wo),s(Vl,zo),s(Vl,il),s(il,wn),s(il,yn),qe(il,t[3].m.d,!0),s(ke,Go),s(ke,Cn),s(Cn,Kl),s(Kl,Vo),s(Kl,Ko),s(Kl,Yo),s(Kl,Mn),s(Mn,Wt),te(Wt,t[3].m.f),s(Mn,Qo),s(Mn,Yi),s(Cn,Xo),s(Cn,Yl),s(Yl,Zo),s(Yl,Jo),s(Yl,xo),s(Yl,$n),s($n,zt),te(zt,t[3].m.r),s($n,er),s($n,Qi),s(ke,tr),s(ke,Is),s(ke,lr),s(ke,Ql),s(Ql,Xi),s(Xi,Gt),Gt.checked=t[3].m.e.e,s(Xi,nr),s(Ql,ir),wt&&wt.m(Ql,null),s(ke,sr),yt&&yt.m(ke,null),s(ke,Rs),s(ke,Zi),s(Zi,Vt),Vt.checked=t[3].m.m.e,s(Zi,or),s(ke,rr),Ct&&Ct.m(ke,null),s(l,ar),s(l,tt),s(tt,Ji),s(tt,ur),s(tt,Sn),le(Tn,Sn,null),s(tt,fr),s(tt,_i),s(tt,cr),s(tt,Xl),s(Xl,mr),s(Xl,pr),s(Xl,_r),s(Xl,vl),te(vl,t[3].w.s),s(tt,dr),s(tt,Zl),s(Zl,vr),s(Zl,hr),s(Zl,br),s(Zl,hl),te(hl,t[3].w.p),s(tt,gr),s(tt,Nn),s(Nn,Jl),s(Jl,kr),s(Jl,wr),s(Jl,yr),s(Jl,Rt),s(Rt,An),s(Rt,Pn),s(Rt,En),s(Rt,Dn),qe(Rt,t[3].w.z,!0),s(Nn,Cr),s(Nn,xl),s(xl,Mr),s(xl,$r),s(xl,Sr),s(xl,In),s(In,Lt),te(Lt,t[3].w.w),s(In,Tr),s(In,xi),s(tt,Nr),s(tt,es),s(es,ts),s(ts,Kt),Kt.checked=t[3].w.a,s(ts,Ar),s(tt,Pr),s(tt,ls),s(ls,ns),s(ns,Yt),Yt.checked=t[3].w.b,s(ns,Er),s(l,Dr),s(l,ut),s(ut,is),s(ut,Ir),s(ut,Rn),le(Ln,Rn,null),s(ut,Rr),s(ut,en),s(en,Lr),s(en,Or),s(en,Fr),s(en,Ll),s(Ll,sl),s(sl,On),s(sl,Fn),qe(sl,t[3].n.m,!0),s(Ll,qr),s(Ll,Pt),te(Pt,t[3].n.i),s(Ll,Br),s(Ll,Et),le(qn,Et,null),qe(Et,t[3].n.s,!0),s(ut,Ur),Mt&&Mt.m(ut,null),s(ut,Ls),s(ut,us),s(us,fs),s(fs,Qt),Qt.checked=t[3].n.d,s(fs,jr),s(ut,Hr),s(ut,di),s(ut,Wr),s(ut,Ol),s(Ol,zr),s(Ol,vi),s(vi,Xt),Xt.checked=t[3].n.h,s(vi,Gr),s(Ol,Vr),s(Ol,Kr),s(Ol,cs),s(cs,bl),te(bl,t[3].n.n1),s(l,Yr),s(l,Ke),s(Ke,ms),s(Ke,Qr),s(Ke,Bn),le(Un,Bn,null),s(Ke,Xr),s(Ke,hi),s(Ke,Zr),s(Ke,ol),s(ol,Jr),$t&&$t.m(ol,null),s(ol,Os),s(ol,xr),s(ol,ea),s(ol,jn),s(jn,gl),te(gl,t[3].q.h),s(jn,ta),s(jn,Zt),te(Zt,t[3].q.p),s(Ke,la),lt&<.m(Ke,null),s(Ke,Fs),s(Ke,tn),s(tn,na),s(tn,ia),s(tn,sa),s(tn,kl),te(kl,t[3].q.u),s(Ke,oa),s(Ke,ln),s(ln,ra),s(ln,aa),s(ln,ua),s(ln,wl),te(wl,t[3].q.a),s(Ke,fa),s(Ke,Hn),s(Hn,Wn),s(Wn,ca),s(Wn,ma),s(Wn,pa),s(Wn,yl),te(yl,t[3].q.c),s(Hn,_a),s(Hn,zn),s(zn,da),s(zn,va),s(zn,ha),s(zn,bt),s(bt,Gn),s(bt,Vn),s(bt,Kn),s(bt,Yn),s(bt,Qn),s(bt,Xn),qe(bt,t[3].q.m,!0),s(Ke,ba),s(Ke,nn),s(nn,ga),s(nn,ka),s(nn,wa),s(nn,Cl),te(Cl,t[3].q.b),s(l,ya),nt&&nt.m(l,null),s(l,qs),it&&it.m(l,null),s(l,Bs),st&&st.m(l,null),s(l,Us),ot&&ot.m(l,null),s(l,Hs),s(l,rl),s(rl,ps),s(rl,Ca),s(rl,Zn),le(Jn,Zn,null),s(rl,Ma),s(rl,bi),s(rl,$a),s(rl,gi);for(let ft=0;ft<_t.length;ft+=1)_t[ft]&&_t[ft].m(gi,null);s(l,Sa),rt&&rt.m(l,null),s(l,Ws),s(l,Dt),s(Dt,_s),s(Dt,Ta),s(Dt,xn),le(ei,xn,null),s(Dt,Na),s(Dt,ki),s(Dt,Aa),s(Dt,ds),s(ds,vs),s(vs,Jt),Jt.checked=t[3].d.s,s(vs,Pa),s(Dt,Ea),St&&St.m(Dt,null),s(e,Da),s(e,Fl),s(Fl,zs),s(zs,ti),s(Fl,Ia),s(Fl,hs),s(hs,li),s(Fl,Ra),s(Fl,bs),M(R,Gs,ae),le(sn,R,ae),M(R,Vs,ae),le(on,R,ae),M(R,Ks,ae),le(rn,R,ae),M(R,Ys,ae),le(an,R,ae),Ot=!0,Qs||(La=[ee(T,"input",t[15]),ee(O,"change",t[16]),ee(Y,"change",t[17]),ee(ct,"change",t[18]),ee(Ue,"input",t[19]),ee(Me,"input",t[20]),ee(Tt,"change",t[21]),ee(Nt,"change",t[23]),ee(Ht,"change",t[26]),ee(nl,"change",t[27]),ee(pt,"change",t[28]),ee(At,"input",t[29]),ee(il,"change",t[30]),ee(Wt,"input",t[31]),ee(zt,"input",t[32]),ee(Gt,"change",t[33]),ee(Vt,"change",t[36]),ee(vl,"input",t[41]),ee(hl,"input",t[42]),ee(Rt,"change",t[43]),ee(Lt,"input",t[44]),ee(Kt,"change",t[45]),ee(Yt,"change",t[46]),ee(sl,"change",t[47]),ee(Pt,"input",t[48]),ee(Et,"change",t[49]),ee(Qt,"change",t[53]),ee(Xt,"change",t[54]),ee(bl,"input",t[55]),ee(gl,"input",t[57]),ee(Zt,"input",t[58]),ee(kl,"input",t[59]),ee(wl,"input",t[60]),ee(yl,"input",t[61]),ee(bt,"change",t[62]),ee(Cl,"input",t[63]),ee(Jt,"change",t[93]),ee(ti,"click",t[8]),ee(li,"click",t[10]),ee(e,"submit",Ps(t[9]))],Qs=!0)},p(R,ae){if(ae[0]&8&&T.value!==R[3].g.h&&te(T,R[3].g.h),ae[0]&8&&qe(O,R[3].g.t),ae[0]&8&&qe(Y,R[3].p.r),ae[0]&8&&qe(ct,R[3].p.c),ae[0]&8&&he(Ue.value)!==R[3].p.f&&te(Ue,R[3].p.f),ae[0]&8&&he(Me.value)!==R[3].p.m&&te(Me,R[3].p.m),ae[0]&8&&(Tt.checked=R[3].p.e),R[3].p.e&&R[0].chip!="esp8266"?gt?gt.p(R,ae):(gt=pf(R),gt.c(),gt.m(_l,null)):gt&&(gt.d(1),gt=null),ae[0]&8&&qe(Nt,R[3].g.s),R[3].g.s>0?kt?kt.p(R,ae):(kt=_f(R),kt.c(),kt.m(n,null)):kt&&(kt.d(1),kt=null),ae[0]&8&&(Ht.checked=R[3].m.i),(!Ot||ae[0]&8&&zi!==(zi=R[3].m.b!=0))&&(Il.disabled=zi),ae[0]&8&&qe(nl,R[3].m.b),(!Ot||ae[0]&8&&Gi!==(Gi=R[3].m.b!=0))&&(Rl.disabled=Gi),(!Ot||ae[0]&8&&Vi!==(Vi=R[3].m.b==0))&&(pt.disabled=Vi),ae[0]&8&&qe(pt,R[3].m.p),(!Ot||ae[0]&9&&Ki!==(Ki=R[0].chip=="esp8266"?R[3].i.h.p==3||R[3].i.h.p==113?512:128:4096))&&r(At,"max",Ki),ae[0]&8&&he(At.value)!==R[3].m.s&&te(At,R[3].m.s),ae[0]&8&&qe(il,R[3].m.d),ae[0]&8&&he(Wt.value)!==R[3].m.f&&te(Wt,R[3].m.f),ae[0]&8&&he(zt.value)!==R[3].m.r&&te(zt,R[3].m.r),ae[0]&8&&(Gt.checked=R[3].m.e.e),R[3].m.e.e?wt?wt.p(R,ae):(wt=df(R),wt.c(),wt.m(Ql,null)):wt&&(wt.d(1),wt=null),R[3].m.e.e?yt?yt.p(R,ae):(yt=vf(R),yt.c(),yt.m(ke,Rs)):yt&&(yt.d(1),yt=null),ae[0]&8&&(Vt.checked=R[3].m.m.e),R[3].m.m.e?Ct?Ct.p(R,ae):(Ct=hf(R),Ct.c(),Ct.m(ke,null)):Ct&&(Ct.d(1),Ct=null),ae[0]&8&&vl.value!==R[3].w.s&&te(vl,R[3].w.s),ae[0]&8&&hl.value!==R[3].w.p&&te(hl,R[3].w.p),ae[0]&8&&qe(Rt,R[3].w.z),ae[0]&8&&he(Lt.value)!==R[3].w.w&&te(Lt,R[3].w.w),ae[0]&8&&(Kt.checked=R[3].w.a),ae[0]&8&&(Yt.checked=R[3].w.b),ae[0]&8&&qe(sl,R[3].n.m),(!Ot||ae[0]&8&&ss!==(ss=R[3].n.m=="dhcp"))&&(Pt.disabled=ss),(!Ot||ae[0]&8&&os!==(os=R[3].n.m=="static"))&&(Pt.required=os),ae[0]&8&&Pt.value!==R[3].n.i&&te(Pt,R[3].n.i),(!Ot||ae[0]&8&&rs!==(rs=R[3].n.m=="dhcp"))&&(Et.disabled=rs),(!Ot||ae[0]&8&&as!==(as=R[3].n.m=="static"))&&(Et.required=as),ae[0]&8&&qe(Et,R[3].n.s),R[3].n.m=="static"?Mt?Mt.p(R,ae):(Mt=bf(R),Mt.c(),Mt.m(ut,Ls)):Mt&&(Mt.d(1),Mt=null),ae[0]&8&&(Qt.checked=R[3].n.d),ae[0]&8&&(Xt.checked=R[3].n.h),ae[0]&8&&bl.value!==R[3].n.n1&&te(bl,R[3].n.n1),R[0].chip!="esp8266"?$t?$t.p(R,ae):($t=gf(R),$t.c(),$t.m(ol,Os)):$t&&($t.d(1),$t=null),ae[0]&8&&gl.value!==R[3].q.h&&te(gl,R[3].q.h),ae[0]&8&&he(Zt.value)!==R[3].q.p&&te(Zt,R[3].q.p),R[3].q.s.e?lt?(lt.p(R,ae),ae[0]&8&&D(lt,1)):(lt=kf(R),lt.c(),D(lt,1),lt.m(Ke,Fs)):lt&&(De(),q(lt,1,1,()=>{lt=null}),Ie()),ae[0]&8&&kl.value!==R[3].q.u&&te(kl,R[3].q.u),ae[0]&8&&wl.value!==R[3].q.a&&te(wl,R[3].q.a),ae[0]&8&&yl.value!==R[3].q.c&&te(yl,R[3].q.c),ae[0]&8&&qe(bt,R[3].q.m),ae[0]&8&&Cl.value!==R[3].q.b&&te(Cl,R[3].q.b),R[3].q.m==3?nt?(nt.p(R,ae),ae[0]&8&&D(nt,1)):(nt=wf(R),nt.c(),D(nt,1),nt.m(l,qs)):nt&&(De(),q(nt,1,1,()=>{nt=null}),Ie()),R[3].q.m==4?it?(it.p(R,ae),ae[0]&8&&D(it,1)):(it=yf(R),it.c(),D(it,1),it.m(l,Bs)):it&&(De(),q(it,1,1,()=>{it=null}),Ie()),R[3].c.es!=null?st?(st.p(R,ae),ae[0]&8&&D(st,1)):(st=Cf(R),st.c(),D(st,1),st.m(l,Us)):st&&(De(),q(st,1,1,()=>{st=null}),Ie()),ae[0]&8&&(js=R[3].p.r.startsWith("10YNO")||R[3].p.r.startsWith("10Y1001A1001A4")),js?ot?(ot.p(R,ae),ae[0]&8&&D(ot,1)):(ot=Sf(R),ot.c(),D(ot,1),ot.m(l,Hs)):ot&&(De(),q(ot,1,1,()=>{ot=null}),Ie()),ae[0]&136){ni=R[7];let Ft;for(Ft=0;Ft20||R[0].chip=="esp8266"?rt?(rt.p(R,ae),ae[0]&1&&D(rt,1)):(rt=Af(R),rt.c(),D(rt,1),rt.m(l,Ws)):rt&&(De(),q(rt,1,1,()=>{rt=null}),Ie()),ae[0]&8&&(Jt.checked=R[3].d.s),R[3].d.s?St?St.p(R,ae):(St=Lf(R),St.c(),St.m(Dt,null)):St&&(St.d(1),St=null);const ft={};ae[0]&2&&(ft.active=R[1]),sn.$set(ft);const Oa={};ae[0]&4&&(Oa.active=R[2]),on.$set(Oa);const Fa={};ae[0]&16&&(Fa.active=R[4]),rn.$set(Fa);const qa={};ae[0]&32&&(qa.active=R[5]),an.$set(qa)},i(R){Ot||(D(a.$$.fragment,R),D(F.$$.fragment,R),D(Pl.$$.fragment,R),D(Tn.$$.fragment,R),D(Ln.$$.fragment,R),D(qn.$$.fragment,R),D(Un.$$.fragment,R),D(lt),D(nt),D(it),D(st),D(ot),D(Jn.$$.fragment,R),D(rt),D(ei.$$.fragment,R),D(sn.$$.fragment,R),D(on.$$.fragment,R),D(rn.$$.fragment,R),D(an.$$.fragment,R),Ot=!0)},o(R){q(a.$$.fragment,R),q(F.$$.fragment,R),q(Pl.$$.fragment,R),q(Tn.$$.fragment,R),q(Ln.$$.fragment,R),q(qn.$$.fragment,R),q(Un.$$.fragment,R),q(lt),q(nt),q(it),q(st),q(ot),q(Jn.$$.fragment,R),q(rt),q(ei.$$.fragment,R),q(sn.$$.fragment,R),q(on.$$.fragment,R),q(rn.$$.fragment,R),q(an.$$.fragment,R),Ot=!1},d(R){R&&C(e),ne(a),ne(F),cl(wi,R),gt&>.d(),kt&&kt.d(),ne(Pl),cl(yi,R),wt&&wt.d(),yt&&yt.d(),Ct&&Ct.d(),ne(Tn),ne(Ln),ne(qn),Mt&&Mt.d(),ne(Un),$t&&$t.d(),lt&<.d(),nt&&nt.d(),it&&it.d(),st&&st.d(),ot&&ot.d(),ne(Jn),cl(_t,R),rt&&rt.d(),ne(ei),St&&St.d(),R&&C(Gs),ne(sn,R),R&&C(Vs),ne(on,R),R&&C(Ks),ne(rn,R),R&&C(Ys),ne(an,R),Qs=!1,ze(La)}}}async function Sp(){await(await fetch("/reboot",{method:"POST"})).json()}function Tp(t,e,l){let{sysinfo:n={}}=e,i=[{name:"Import gauge",key:"i"},{name:"Export gauge",key:"e"},{name:"Voltage",key:"v"},{name:"Amperage",key:"a"},{name:"Reactive",key:"r"},{name:"Realtime",key:"c"},{name:"Peaks",key:"t"},{name:"Price",key:"p"},{name:"Day plot",key:"d"},{name:"Month plot",key:"m"},{name:"Temperature plot",key:"s"}],o=!0,u=!1,a={g:{t:"",h:"",s:0,u:"",p:""},m:{b:2400,p:11,i:!1,d:0,f:0,r:0,e:{e:!1,k:"",a:""},m:{e:!1,w:!1,v:!1,a:!1,c:!1}},w:{s:"",p:"",w:0,z:255,a:!0,b:!0},n:{m:"",i:"",s:"",g:"",d1:"",d2:"",d:!1,n1:"",n2:"",h:!1},q:{h:"",p:1883,u:"",a:"",b:"",s:{e:!1,c:!1,r:!0,k:!1}},o:{e:"",c:"",u1:"",u2:"",u3:""},t:{t:[0,0,0,0,0,0,0,0,0,0],h:1},p:{e:!1,t:"",r:"",c:"",m:1,f:null},d:{s:!1,t:!1,l:5},u:{i:0,e:0,v:0,a:0,r:0,c:0,t:0,p:0,d:0,m:0,s:0},i:{h:{p:null,u:!0},a:null,l:{p:null,i:!1},r:{r:null,g:null,b:null,i:!1},t:{d:null,a:null},v:{p:null,d:{v:null,g:null},o:null,m:null,b:null}},h:{t:"",h:"",n:""},c:{es:null}};$i.subscribe(ke=>{ke.version&&(l(3,a=ke),l(1,o=!1))}),Vm();let c=!1,f=!1;async function _(){if(confirm("Are you sure you want to factory reset the device?")){l(4,c=!0);const ke=new URLSearchParams;ke.append("perform","true");let Wl=await(await fetch("/reset",{method:"POST",body:ke})).json();l(4,c=!1),l(5,f=Wl.success)}}async function p(ke){l(2,u=!0);const mt=new FormData(ke.target),Wl=new URLSearchParams;for(let El of mt){const[Gl,Hi]=El;Wl.append(Gl,Hi)}let Pl=await(await fetch("/save",{method:"POST",body:Wl})).json();Ut.update(El=>(El.booting=Pl.reboot,El.ui=a.u,El)),l(2,u=!1),ai("/")}const b=function(){confirm("Are you sure you want to reboot the device?")&&(Ut.update(ke=>(ke.booting=!0,ke)),Sp())};async function v(){confirm("Are you sure you want to delete CA?")&&(await(await fetch("/mqtt-ca",{method:"POST"})).text(),$i.update(mt=>(mt.q.s.c=!1,mt)))}async function d(){confirm("Are you sure you want to delete cert?")&&(await(await fetch("/mqtt-cert",{method:"POST"})).text(),$i.update(mt=>(mt.q.s.r=!1,mt)))}async function $(){confirm("Are you sure you want to delete key?")&&(await(await fetch("/mqtt-key",{method:"POST"})).text(),$i.update(mt=>(mt.q.s.k=!1,mt)))}const y=function(){a.q.s.e?a.q.p==1883&&l(3,a.q.p=8883,a):a.q.p==8883&&l(3,a.q.p=1883,a)};let T=44;function N(){a.g.h=this.value,l(3,a)}function E(){a.g.t=dt(this),l(3,a)}function B(){a.p.r=dt(this),l(3,a)}function P(){a.p.c=dt(this),l(3,a)}function L(){a.p.f=he(this.value),l(3,a)}function O(){a.p.m=he(this.value),l(3,a)}function F(){a.p.e=this.checked,l(3,a)}function x(){a.p.t=this.value,l(3,a)}function j(){a.g.s=dt(this),l(3,a)}function z(){a.g.u=this.value,l(3,a)}function G(){a.g.p=this.value,l(3,a)}function V(){a.m.i=this.checked,l(3,a)}function W(){a.m.b=dt(this),l(3,a)}function U(){a.m.p=dt(this),l(3,a)}function K(){a.m.s=he(this.value),l(3,a)}function H(){a.m.d=dt(this),l(3,a)}function Y(){a.m.f=he(this.value),l(3,a)}function Z(){a.m.r=he(this.value),l(3,a)}function re(){a.m.e.e=this.checked,l(3,a)}function ue(){a.m.e.k=this.value,l(3,a)}function we(){a.m.e.a=this.value,l(3,a)}function me(){a.m.m.e=this.checked,l(3,a)}function Te(){a.m.m.w=he(this.value),l(3,a)}function je(){a.m.m.v=he(this.value),l(3,a)}function Re(){a.m.m.a=he(this.value),l(3,a)}function He(){a.m.m.c=he(this.value),l(3,a)}function ye(){a.w.s=this.value,l(3,a)}function Ne(){a.w.p=this.value,l(3,a)}function Le(){a.w.z=dt(this),l(3,a)}function $e(){a.w.w=he(this.value),l(3,a)}function w(){a.w.a=this.checked,l(3,a)}function g(){a.w.b=this.checked,l(3,a)}function k(){a.n.m=dt(this),l(3,a)}function A(){a.n.i=this.value,l(3,a)}function I(){a.n.s=dt(this),l(3,a)}function Q(){a.n.g=this.value,l(3,a)}function J(){a.n.d1=this.value,l(3,a)}function se(){a.n.d2=this.value,l(3,a)}function ce(){a.n.d=this.checked,l(3,a)}function ve(){a.n.h=this.checked,l(3,a)}function Se(){a.n.n1=this.value,l(3,a)}function oe(){a.q.s.e=this.checked,l(3,a)}function pe(){a.q.h=this.value,l(3,a)}function Be(){a.q.p=he(this.value),l(3,a)}function _e(){a.q.u=this.value,l(3,a)}function Ce(){a.q.a=this.value,l(3,a)}function vt(){a.q.c=this.value,l(3,a)}function Hl(){a.q.m=dt(this),l(3,a)}function tl(){a.q.b=this.value,l(3,a)}function ct(){a.o.e=this.value,l(3,a)}function Sl(){a.o.c=this.value,l(3,a)}function pl(){a.o.u1=this.value,l(3,a)}function jt(){a.o.u2=this.value,l(3,a)}function ht(){a.o.u3=this.value,l(3,a)}function Ye(){a.h.t=this.value,l(3,a)}function Qe(){a.h.h=this.value,l(3,a)}function Xe(){a.h.n=this.value,l(3,a)}function Ue(){a.c.es=this.checked,l(3,a)}function Ze(ke){a.t.t[ke]=he(this.value),l(3,a)}function We(){a.t.h=he(this.value),l(3,a)}function Je(ke){a.u[ke.key]=dt(this),l(3,a)}function xe(){a.i.h.u=this.checked,l(3,a)}function de(){a.i.h.p=dt(this),l(3,a)}function Me(){a.i.a=he(this.value),l(3,a)}function Ii(){a.i.l.i=this.checked,l(3,a)}function _l(){a.i.l.p=he(this.value),l(3,a)}function vn(){a.i.r.i=this.checked,l(3,a)}function Tt(){a.i.r.r=he(this.value),l(3,a)}function Ri(){a.i.r.g=he(this.value),l(3,a)}function Li(){a.i.r.b=he(this.value),l(3,a)}function Oi(){a.i.t.d=he(this.value),l(3,a)}function dl(){a.i.t.a=he(this.value),l(3,a)}function Fi(){a.i.v.p=he(this.value),l(3,a)}function qi(){a.i.v.d.v=he(this.value),l(3,a)}function Bi(){a.i.v.d.g=he(this.value),l(3,a)}function Nt(){a.i.v.o=he(this.value),l(3,a)}function Tl(){a.i.v.m=he(this.value),l(3,a)}function Nl(){a.i.v.b=he(this.value),l(3,a)}function Al(){a.d.s=this.checked,l(3,a)}function Ui(){a.d.t=this.checked,l(3,a)}function ji(){a.d.l=dt(this),l(3,a)}return t.$$set=ke=>{"sysinfo"in ke&&l(0,n=ke.sysinfo)},t.$$.update=()=>{t.$$.dirty[0]&1&&l(6,T=n.chip=="esp8266"?16:n.chip=="esp32s2"?44:39)},[n,o,u,a,c,f,T,i,_,p,b,v,d,$,y,N,E,B,P,L,O,F,x,j,z,G,V,W,U,K,H,Y,Z,re,ue,we,me,Te,je,Re,He,ye,Ne,Le,$e,w,g,k,A,I,Q,J,se,ce,ve,Se,oe,pe,Be,_e,Ce,vt,Hl,tl,ct,Sl,pl,jt,ht,Ye,Qe,Xe,Ue,Ze,We,Je,xe,de,Me,Ii,_l,vn,Tt,Ri,Li,Oi,dl,Fi,qi,Bi,Nt,Tl,Nl,Al,Ui,ji]}class Np extends Ee{constructor(e){super(),Pe(this,e,Tp,$p,Ae,{sysinfo:0},null,[-1,-1,-1,-1])}}function Ff(t,e,l){const n=t.slice();return n[20]=e[l],n}function Ap(t){let e=be(t[1].chip,t[1].board)+"",l;return{c(){l=S(e)},m(n,i){M(n,l,i)},p(n,i){i&2&&e!==(e=be(n[1].chip,n[1].board)+"")&&X(l,e)},d(n){n&&C(l)}}}function qf(t){let e,l,n=t[1].apmac+"",i,o,u,a,c,f,_,p,b,v=lu(t[1])+"",d,$,y=t[1].boot_reason+"",T,N,E=t[1].ex_cause+"",B,P,L;const O=[Ep,Pp],F=[];function x(j,z){return j[0].u>0?0:1}return c=x(t),f=F[c]=O[c](t),{c(){e=m("div"),l=S("AP MAC: "),i=S(n),o=h(),u=m("div"),a=S(`Last boot: + `),f.c(),_=h(),p=m("div"),b=S("Reason: "),d=S(v),$=S(" ("),T=S(y),N=S("/"),B=S(E),P=S(")"),r(e,"class","my-2"),r(u,"class","my-2"),r(p,"class","my-2")},m(j,z){M(j,e,z),s(e,l),s(e,i),M(j,o,z),M(j,u,z),s(u,a),F[c].m(u,null),M(j,_,z),M(j,p,z),s(p,b),s(p,d),s(p,$),s(p,T),s(p,N),s(p,B),s(p,P),L=!0},p(j,z){(!L||z&2)&&n!==(n=j[1].apmac+"")&&X(i,n);let G=c;c=x(j),c===G?F[c].p(j,z):(De(),q(F[G],1,1,()=>{F[G]=null}),Ie(),f=F[c],f?f.p(j,z):(f=F[c]=O[c](j),f.c()),D(f,1),f.m(u,null)),(!L||z&2)&&v!==(v=lu(j[1])+"")&&X(d,v),(!L||z&2)&&y!==(y=j[1].boot_reason+"")&&X(T,y),(!L||z&2)&&E!==(E=j[1].ex_cause+"")&&X(B,E)},i(j){L||(D(f),L=!0)},o(j){q(f),L=!1},d(j){j&&C(e),j&&C(o),j&&C(u),F[c].d(),j&&C(_),j&&C(p)}}}function Pp(t){let e;return{c(){e=S("-")},m(l,n){M(l,e,n)},p:fe,i:fe,o:fe,d(l){l&&C(e)}}}function Ep(t){let e,l;return e=new Xc({props:{timestamp:new Date(new Date().getTime()-t[0].u*1e3),fullTimeColor:""}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.timestamp=new Date(new Date().getTime()-n[0].u*1e3)),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function Dp(t){let e;return{c(){e=m("span"),e.textContent="Update consents",r(e,"class","btn-pri-sm")},m(l,n){M(l,e,n)},p:fe,d(l){l&&C(e)}}}function Bf(t){let e,l,n,i,o,u=Ns(t[1].meter.mfg)+"",a,c,f,_,p=(t[1].meter.model?t[1].meter.model:"unknown")+"",b,v,d,$,y=(t[1].meter.id?t[1].meter.id:"unknown")+"",T;return{c(){e=m("div"),l=m("strong"),l.textContent="Meter",n=h(),i=m("div"),o=S("Manufacturer: "),a=S(u),c=h(),f=m("div"),_=S("Model: "),b=S(p),v=h(),d=m("div"),$=S("ID: "),T=S(y),r(l,"class","text-sm"),r(i,"class","my-2"),r(f,"class","my-2"),r(d,"class","my-2"),r(e,"class","cnt")},m(N,E){M(N,e,E),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,c),s(e,f),s(f,_),s(f,b),s(e,v),s(e,d),s(d,$),s(d,T)},p(N,E){E&2&&u!==(u=Ns(N[1].meter.mfg)+"")&&X(a,u),E&2&&p!==(p=(N[1].meter.model?N[1].meter.model:"unknown")+"")&&X(b,p),E&2&&y!==(y=(N[1].meter.id?N[1].meter.id:"unknown")+"")&&X(T,y)},d(N){N&&C(e)}}}function Uf(t){let e,l,n,i,o,u=t[1].net.ip+"",a,c,f,_,p=t[1].net.mask+"",b,v,d,$,y=t[1].net.gw+"",T,N,E,B,P=t[1].net.dns1+"",L,O,F=t[1].net.dns2&&jf(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Network",n=h(),i=m("div"),o=S("IP: "),a=S(u),c=h(),f=m("div"),_=S("Mask: "),b=S(p),v=h(),d=m("div"),$=S("Gateway: "),T=S(y),N=h(),E=m("div"),B=S("DNS: "),L=S(P),O=h(),F&&F.c(),r(l,"class","text-sm"),r(i,"class","my-2"),r(f,"class","my-2"),r(d,"class","my-2"),r(E,"class","my-2"),r(e,"class","cnt")},m(x,j){M(x,e,j),s(e,l),s(e,n),s(e,i),s(i,o),s(i,a),s(e,c),s(e,f),s(f,_),s(f,b),s(e,v),s(e,d),s(d,$),s(d,T),s(e,N),s(e,E),s(E,B),s(E,L),s(E,O),F&&F.m(E,null)},p(x,j){j&2&&u!==(u=x[1].net.ip+"")&&X(a,u),j&2&&p!==(p=x[1].net.mask+"")&&X(b,p),j&2&&y!==(y=x[1].net.gw+"")&&X(T,y),j&2&&P!==(P=x[1].net.dns1+"")&&X(L,P),x[1].net.dns2?F?F.p(x,j):(F=jf(x),F.c(),F.m(E,null)):F&&(F.d(1),F=null)},d(x){x&&C(e),F&&F.d()}}}function jf(t){let e,l=t[1].net.dns2+"",n;return{c(){e=S("/ "),n=S(l)},m(i,o){M(i,e,o),M(i,n,o)},p(i,o){o&2&&l!==(l=i[1].net.dns2+"")&&X(n,l)},d(i){i&&C(e),i&&C(n)}}}function Hf(t){let e,l,n,i=t[1].upgrade.t+"",o,u,a=t[1].version+"",c,f,_=t[1].upgrade.x+"",p,b,v=t[1].upgrade.e+"",d,$;return{c(){e=m("div"),l=m("div"),n=S("Previous upgrade attempt ("),o=S(i),u=S(") does not match current version ("),c=S(a),f=S(") ["),p=S(_),b=S("/"),d=S(v),$=S("]"),r(l,"class","bd-yellow"),r(e,"class","my-2")},m(y,T){M(y,e,T),s(e,l),s(l,n),s(l,o),s(l,u),s(l,c),s(l,f),s(l,p),s(l,b),s(l,d),s(l,$)},p(y,T){T&2&&i!==(i=y[1].upgrade.t+"")&&X(o,i),T&2&&a!==(a=y[1].version+"")&&X(c,a),T&2&&_!==(_=y[1].upgrade.x+"")&&X(p,_),T&2&&v!==(v=y[1].upgrade.e+"")&&X(d,v)},d(y){y&&C(e)}}}function Wf(t){let e,l,n,i=t[2].tag_name+"",o,u,a,c,f,_,p=(t[1].security==0||t[0].a)&&t[1].fwconsent===1&&t[2]&&t[2].tag_name!=t[1].version&&zf(t),b=t[1].fwconsent===2&&Gf();return{c(){e=m("div"),l=S(`Latest version: + `),n=m("a"),o=S(i),a=h(),p&&p.c(),c=h(),b&&b.c(),f=Ge(),r(n,"href",u=t[2].html_url),r(n,"class","ml-2 text-blue-600 hover:text-blue-800"),r(n,"target","_blank"),r(n,"rel","noreferrer"),r(e,"class","my-2 flex")},m(v,d){M(v,e,d),s(e,l),s(e,n),s(n,o),s(e,a),p&&p.m(e,null),M(v,c,d),b&&b.m(v,d),M(v,f,d),_=!0},p(v,d){(!_||d&4)&&i!==(i=v[2].tag_name+"")&&X(o,i),(!_||d&4&&u!==(u=v[2].html_url))&&r(n,"href",u),(v[1].security==0||v[0].a)&&v[1].fwconsent===1&&v[2]&&v[2].tag_name!=v[1].version?p?(p.p(v,d),d&7&&D(p,1)):(p=zf(v),p.c(),D(p,1),p.m(e,null)):p&&(De(),q(p,1,1,()=>{p=null}),Ie()),v[1].fwconsent===2?b||(b=Gf(),b.c(),b.m(f.parentNode,f)):b&&(b.d(1),b=null)},i(v){_||(D(p),_=!0)},o(v){q(p),_=!1},d(v){v&&C(e),p&&p.d(),v&&C(c),b&&b.d(v),v&&C(f)}}}function zf(t){let e,l,n,i,o,u;return n=new Zc({}),{c(){e=m("div"),l=m("button"),ie(n.$$.fragment),r(e,"class","flex-none ml-2 text-green-500"),r(e,"title","Install this version")},m(a,c){M(a,e,c),s(e,l),le(n,l,null),i=!0,o||(u=ee(l,"click",t[10]),o=!0)},p:fe,i(a){i||(D(n.$$.fragment,a),i=!0)},o(a){q(n.$$.fragment,a),i=!1},d(a){a&&C(e),ne(n),o=!1,u()}}}function Gf(t){let e;return{c(){e=m("div"),e.innerHTML='
You have disabled one-click firmware upgrade, link to self-upgrade is disabled
',r(e,"class","my-2")},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function Vf(t){let e,l=As(be(t[1].chip,t[1].board))+"",n;return{c(){e=m("div"),n=S(l),r(e,"class","bd-red")},m(i,o){M(i,e,o),s(e,n)},p(i,o){o&2&&l!==(l=As(be(i[1].chip,i[1].board))+"")&&X(n,l)},d(i){i&&C(e)}}}function Kf(t){let e,l,n,i,o,u;function a(_,p){return _[4].length==0?Rp:Ip}let c=a(t),f=c(t);return{c(){e=m("div"),l=m("form"),n=m("input"),i=h(),f.c(),ac(n,"display","none"),r(n,"name","file"),r(n,"type","file"),r(n,"accept",".bin"),r(l,"action","/firmware"),r(l,"enctype","multipart/form-data"),r(l,"method","post"),r(l,"autocomplete","off"),r(e,"class","my-2 flex")},m(_,p){M(_,e,p),s(e,l),s(l,n),t[12](n),s(l,i),f.m(l,null),o||(u=[ee(n,"change",t[13]),ee(l,"submit",t[15])],o=!0)},p(_,p){c===(c=a(_))&&f?f.p(_,p):(f.d(1),f=c(_),f&&(f.c(),f.m(l,null)))},d(_){_&&C(e),t[12](null),f.d(),o=!1,ze(u)}}}function Ip(t){let e=t[4][0].name+"",l,n,i;return{c(){l=S(e),n=h(),i=m("button"),i.textContent="Upload",r(i,"type","submit"),r(i,"class","btn-pri-sm float-right")},m(o,u){M(o,l,u),M(o,n,u),M(o,i,u)},p(o,u){u&16&&e!==(e=o[4][0].name+"")&&X(l,e)},d(o){o&&C(l),o&&C(n),o&&C(i)}}}function Rp(t){let e,l,n;return{c(){e=m("button"),e.textContent="Select firmware file for upgrade",r(e,"type","button"),r(e,"class","btn-pri-sm float-right")},m(i,o){M(i,e,o),l||(n=ee(e,"click",t[14]),l=!0)},p:fe,d(i){i&&C(e),l=!1,n()}}}function Yf(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$=t[9],y=[];for(let P=0;P<$.length;P+=1)y[P]=Qf(Ff(t,$,P));let T=t[7].length==0&&Xf();function N(P,L){return P[7].length==0?Op:Lp}let E=N(t),B=E(t);return{c(){e=m("div"),l=m("strong"),l.textContent="Backup & restore",n=h(),i=m("form"),o=m("div");for(let P=0;P Include Secrets
(SSID, PSK, passwords and tokens)',c=h(),T&&T.c(),f=h(),_=m("form"),p=m("input"),b=h(),B.c(),r(l,"class","text-sm"),r(a,"class","my-1 mx-3 col-span-2"),r(o,"class","grid grid-cols-2"),r(i,"method","get"),r(i,"action","/configfile.cfg"),r(i,"autocomplete","off"),ac(p,"display","none"),r(p,"name","file"),r(p,"type","file"),r(p,"accept",".cfg"),r(_,"action","/configfile"),r(_,"enctype","multipart/form-data"),r(_,"method","post"),r(_,"autocomplete","off"),r(e,"class","cnt")},m(P,L){M(P,e,L),s(e,l),s(e,n),s(e,i),s(i,o);for(let O=0;O{A=null}),Ie());const _e={};pe&8388608&&(_e.$$scope={dirty:pe,ctx:oe}),x.$set(_e),oe[1].meter?I?I.p(oe,pe):(I=Bf(oe),I.c(),I.m(e,V)):I&&(I.d(1),I=null),oe[1].net?Q?Q.p(oe,pe):(Q=Uf(oe),Q.c(),Q.m(e,W)):Q&&(Q.d(1),Q=null),(!w||pe&2)&&re!==(re=oe[1].version+"")&&X(ue,re),oe[1].upgrade.t&&oe[1].upgrade.t!=oe[1].version?J?J.p(oe,pe):(J=Hf(oe),J.c(),J.m(U,me)):J&&(J.d(1),J=null),oe[2]?se?(se.p(oe,pe),pe&4&&D(se,1)):(se=Wf(oe),se.c(),D(se,1),se.m(U,Te)):se&&(De(),q(se,1,1,()=>{se=null}),Ie()),pe&3&&(je=(oe[1].security==0||oe[0].a)&&ui(oe[1].board)),je?ce?ce.p(oe,pe):(ce=Vf(oe),ce.c(),ce.m(U,Re)):ce&&(ce.d(1),ce=null),oe[1].security==0||oe[0].a?ve?ve.p(oe,pe):(ve=Kf(oe),ve.c(),ve.m(U,null)):ve&&(ve.d(1),ve=null),oe[1].security==0||oe[0].a?Se?Se.p(oe,pe):(Se=Yf(oe),Se.c(),Se.m(e,null)):Se&&(Se.d(1),Se=null);const Ce={};pe&32&&(Ce.active=oe[5]),Ne.$set(Ce);const vt={};pe&256&&(vt.active=oe[8]),$e.$set(vt)},i(oe){w||(D(y.$$.fragment,oe),D(A),D(x.$$.fragment,oe),D(se),D(Ne.$$.fragment,oe),D($e.$$.fragment,oe),w=!0)},o(oe){q(y.$$.fragment,oe),q(A),q(x.$$.fragment,oe),q(se),q(Ne.$$.fragment,oe),q($e.$$.fragment,oe),w=!1},d(oe){oe&&C(e),ne(y),A&&A.d(),ne(x),I&&I.d(),Q&&Q.d(),J&&J.d(),se&&se.d(),ce&&ce.d(),ve&&ve.d(),Se&&Se.d(),oe&&C(ye),ne(Ne,oe),oe&&C(Le),ne($e,oe),g=!1,k()}}}async function qp(){await(await fetch("/reboot",{method:"POST"})).json()}function Bp(t,e,l){let{data:n}=e,{sysinfo:i}=e,o=[{name:"WiFi",key:"iw"},{name:"MQTT",key:"im"},{name:"Web",key:"ie"},{name:"Meter",key:"it"},{name:"Thresholds",key:"ih"},{name:"GPIO",key:"ig"},{name:"NTP",key:"in"},{name:"Price API",key:"is"}],u={};Po.subscribe(O=>{l(2,u=Qc(i.version,O)),u||l(2,u=O[0])});function a(){confirm("Do you want to upgrade this device to "+u.tag_name+"?")&&(i.board!=2&&i.board!=4&&i.board!=7||confirm(As(be(i.chip,i.board))))&&(Ut.update(O=>(O.upgrading=!0,O)),Yc(u.tag_name))}const c=function(){confirm("Are you sure you want to reboot the device?")&&(Ut.update(O=>(O.booting=!0,O)),qp())};let f,_=[],p=!1,b,v=[],d=!1;So();function $(O){Ss[O?"unshift":"push"](()=>{f=O,l(3,f)})}function y(){_=this.files,l(4,_)}const T=()=>{f.click()},N=()=>l(5,p=!0);function E(O){Ss[O?"unshift":"push"](()=>{b=O,l(6,b)})}function B(){v=this.files,l(7,v)}const P=()=>{b.click()},L=()=>l(8,d=!0);return t.$$set=O=>{"data"in O&&l(0,n=O.data),"sysinfo"in O&&l(1,i=O.sysinfo)},[n,i,u,f,_,p,b,v,d,o,a,c,$,y,T,N,E,B,P,L]}class Up extends Ee{constructor(e){super(),Pe(this,e,Bp,Fp,Ae,{data:0,sysinfo:1})}}function Zf(t){let e,l,n=be(t[0],7)+"",i,o,u=be(t[0],5)+"",a,c,f=be(t[0],4)+"",_,p,b=be(t[0],3)+"",v,d,$,y,T=be(t[0],2)+"",N,E,B=be(t[0],1)+"",P,L,O=be(t[0],0)+"",F,x,j,z,G=be(t[0],101)+"",V,W,U=be(t[0],100)+"",K;return{c(){e=m("optgroup"),l=m("option"),i=S(n),o=m("option"),a=S(u),c=m("option"),_=S(f),p=m("option"),v=S(b),d=h(),$=m("optgroup"),y=m("option"),N=S(T),E=m("option"),P=S(B),L=m("option"),F=S(O),x=h(),j=m("optgroup"),z=m("option"),V=S(G),W=m("option"),K=S(U),l.__value=7,l.value=l.__value,o.__value=5,o.value=o.__value,c.__value=4,c.value=c.__value,p.__value=3,p.value=p.__value,r(e,"label","amsleser.no"),y.__value=2,y.value=y.__value,E.__value=1,E.value=E.__value,L.__value=0,L.value=L.__value,r($,"label","Custom hardware"),z.__value=101,z.value=z.__value,W.__value=100,W.value=W.__value,r(j,"label","Generic hardware")},m(H,Y){M(H,e,Y),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,_),s(e,p),s(p,v),M(H,d,Y),M(H,$,Y),s($,y),s(y,N),s($,E),s(E,P),s($,L),s(L,F),M(H,x,Y),M(H,j,Y),s(j,z),s(z,V),s(j,W),s(W,K)},p(H,Y){Y&1&&n!==(n=be(H[0],7)+"")&&X(i,n),Y&1&&u!==(u=be(H[0],5)+"")&&X(a,u),Y&1&&f!==(f=be(H[0],4)+"")&&X(_,f),Y&1&&b!==(b=be(H[0],3)+"")&&X(v,b),Y&1&&T!==(T=be(H[0],2)+"")&&X(N,T),Y&1&&B!==(B=be(H[0],1)+"")&&X(P,B),Y&1&&O!==(O=be(H[0],0)+"")&&X(F,O),Y&1&&G!==(G=be(H[0],101)+"")&&X(V,G),Y&1&&U!==(U=be(H[0],100)+"")&&X(K,U)},d(H){H&&C(e),H&&C(d),H&&C($),H&&C(x),H&&C(j)}}}function Jf(t){let e,l,n=be(t[0],201)+"",i,o,u=be(t[0],202)+"",a,c,f=be(t[0],203)+"",_,p,b=be(t[0],200)+"",v;return{c(){e=m("optgroup"),l=m("option"),i=S(n),o=m("option"),a=S(u),c=m("option"),_=S(f),p=m("option"),v=S(b),l.__value=201,l.value=l.__value,o.__value=202,o.value=o.__value,c.__value=203,c.value=c.__value,p.__value=200,p.value=p.__value,r(e,"label","Generic hardware")},m(d,$){M(d,e,$),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,_),s(e,p),s(p,v)},p(d,$){$&1&&n!==(n=be(d[0],201)+"")&&X(i,n),$&1&&u!==(u=be(d[0],202)+"")&&X(a,u),$&1&&f!==(f=be(d[0],203)+"")&&X(_,f),$&1&&b!==(b=be(d[0],200)+"")&&X(v,b)},d(d){d&&C(e)}}}function xf(t){let e,l,n=be(t[0],7)+"",i,o,u=be(t[0],6)+"",a,c,f=be(t[0],5)+"",_,p,b,v,d=be(t[0],51)+"",$,y,T=be(t[0],50)+"",N;return{c(){e=m("optgroup"),l=m("option"),i=S(n),o=m("option"),a=S(u),c=m("option"),_=S(f),p=h(),b=m("optgroup"),v=m("option"),$=S(d),y=m("option"),N=S(T),l.__value=7,l.value=l.__value,o.__value=6,o.value=o.__value,c.__value=5,c.value=c.__value,r(e,"label","amsleser.no"),v.__value=51,v.value=v.__value,y.__value=50,y.value=y.__value,r(b,"label","Generic hardware")},m(E,B){M(E,e,B),s(e,l),s(l,i),s(e,o),s(o,a),s(e,c),s(c,_),M(E,p,B),M(E,b,B),s(b,v),s(v,$),s(b,y),s(y,N)},p(E,B){B&1&&n!==(n=be(E[0],7)+"")&&X(i,n),B&1&&u!==(u=be(E[0],6)+"")&&X(a,u),B&1&&f!==(f=be(E[0],5)+"")&&X(_,f),B&1&&d!==(d=be(E[0],51)+"")&&X($,d),B&1&&T!==(T=be(E[0],50)+"")&&X(N,T)},d(E){E&&C(e),E&&C(p),E&&C(b)}}}function ec(t){let e,l,n=be(t[0],8)+"",i,o,u,a,c=be(t[0],71)+"",f,_,p=be(t[0],70)+"",b;return{c(){e=m("optgroup"),l=m("option"),i=S(n),o=h(),u=m("optgroup"),a=m("option"),f=S(c),_=m("option"),b=S(p),l.__value=8,l.value=l.__value,r(e,"label","Custom hardware"),a.__value=71,a.value=a.__value,_.__value=70,_.value=_.__value,r(u,"label","Generic hardware")},m(v,d){M(v,e,d),s(e,l),s(l,i),M(v,o,d),M(v,u,d),s(u,a),s(a,f),s(u,_),s(_,b)},p(v,d){d&1&&n!==(n=be(v[0],8)+"")&&X(i,n),d&1&&c!==(c=be(v[0],71)+"")&&X(f,c),d&1&&p!==(p=be(v[0],70)+"")&&X(b,p)},d(v){v&&C(e),v&&C(o),v&&C(u)}}}function tc(t){let e,l,n=be(t[0],200)+"",i;return{c(){e=m("optgroup"),l=m("option"),i=S(n),l.__value=200,l.value=l.__value,r(e,"label","Generic hardware")},m(o,u){M(o,e,u),s(e,l),s(l,i)},p(o,u){u&1&&n!==(n=be(o[0],200)+"")&&X(i,n)},d(o){o&&C(e)}}}function jp(t){let e,l,n,i,o,u,a,c=t[0]=="esp8266"&&Zf(t),f=t[0]=="esp32"&&Jf(t),_=t[0]=="esp32s2"&&xf(t),p=t[0]=="esp32c3"&&ec(t),b=t[0]=="esp32solo"&&tc(t);return{c(){e=m("option"),l=h(),c&&c.c(),n=h(),f&&f.c(),i=h(),_&&_.c(),o=h(),p&&p.c(),u=h(),b&&b.c(),a=Ge(),e.__value=-1,e.value=e.__value},m(v,d){M(v,e,d),M(v,l,d),c&&c.m(v,d),M(v,n,d),f&&f.m(v,d),M(v,i,d),_&&_.m(v,d),M(v,o,d),p&&p.m(v,d),M(v,u,d),b&&b.m(v,d),M(v,a,d)},p(v,[d]){v[0]=="esp8266"?c?c.p(v,d):(c=Zf(v),c.c(),c.m(n.parentNode,n)):c&&(c.d(1),c=null),v[0]=="esp32"?f?f.p(v,d):(f=Jf(v),f.c(),f.m(i.parentNode,i)):f&&(f.d(1),f=null),v[0]=="esp32s2"?_?_.p(v,d):(_=xf(v),_.c(),_.m(o.parentNode,o)):_&&(_.d(1),_=null),v[0]=="esp32c3"?p?p.p(v,d):(p=ec(v),p.c(),p.m(u.parentNode,u)):p&&(p.d(1),p=null),v[0]=="esp32solo"?b?b.p(v,d):(b=tc(v),b.c(),b.m(a.parentNode,a)):b&&(b.d(1),b=null)},i:fe,o:fe,d(v){v&&C(e),v&&C(l),c&&c.d(v),v&&C(n),f&&f.d(v),v&&C(i),_&&_.d(v),v&&C(o),p&&p.d(v),v&&C(u),b&&b.d(v),v&&C(a)}}}function Hp(t,e,l){let{chip:n}=e;return t.$$set=i=>{"chip"in i&&l(0,n=i.chip)},[n]}class Wp extends Ee{constructor(e){super(),Pe(this,e,Hp,jp,Ae,{chip:0})}}function lc(t){let e;return{c(){e=m("div"),e.textContent="WARNING: Changing this configuration will affect basic configuration of your device. Only make changes here if instructed by vendor",r(e,"class","bd-red")},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function nc(t){let e,l,n,i,o,u,a;return u=new xc({props:{chip:t[0].chip}}),{c(){e=m("div"),l=S("HAN GPIO"),n=m("br"),i=h(),o=m("select"),ie(u.$$.fragment),r(o,"name","vh"),r(o,"class","in-s"),r(e,"class","my-3")},m(c,f){M(c,e,f),s(e,l),s(e,n),s(e,i),s(e,o),le(u,o,null),a=!0},p(c,f){const _={};f&1&&(_.chip=c[0].chip),u.$set(_)},i(c){a||(D(u.$$.fragment,c),a=!0)},o(c){q(u.$$.fragment,c),a=!1},d(c){c&&C(e),ne(u)}}}function zp(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,L,O,F,x,j,z,G,V,W=t[0].usrcfg&&lc();d=new Wp({props:{chip:t[0].chip}});let U=t[0].board&&t[0].board>20&&nc(t);return j=new It({props:{active:t[1],message:"Saving device configuration"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=h(),u=m("strong"),u.textContent="Initial configuration",a=h(),W&&W.c(),c=h(),f=m("div"),_=S("Board type"),p=m("br"),b=h(),v=m("select"),ie(d.$$.fragment),$=h(),U&&U.c(),y=h(),T=m("div"),N=m("label"),E=m("input"),B=S(" Clear all other configuration"),P=h(),L=m("div"),L.innerHTML='',O=h(),F=m("span"),F.textContent="\xA0",x=h(),ie(j.$$.fragment),r(i,"type","hidden"),r(i,"name","v"),i.value="true",r(u,"class","text-sm"),r(v,"name","vb"),r(v,"class","in-s"),t[0].board===void 0&&et(()=>t[4].call(v)),r(f,"class","my-3"),r(E,"type","checkbox"),r(E,"name","vr"),E.__value="true",E.value=E.__value,r(E,"class","rounded mb-1"),r(T,"class","my-3"),r(L,"class","my-3"),r(F,"class","clear-both"),r(n,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(K,H){M(K,e,H),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),W&&W.m(n,null),s(n,c),s(n,f),s(f,_),s(f,p),s(f,b),s(f,v),le(d,v,null),qe(v,t[0].board,!0),s(n,$),U&&U.m(n,null),s(n,y),s(n,T),s(T,N),s(N,E),E.checked=t[2],s(N,B),s(n,P),s(n,L),s(n,O),s(n,F),M(K,x,H),le(j,K,H),z=!0,G||(V=[ee(v,"change",t[4]),ee(E,"change",t[5]),ee(n,"submit",Ps(t[3]))],G=!0)},p(K,[H]){K[0].usrcfg?W||(W=lc(),W.c(),W.m(n,c)):W&&(W.d(1),W=null);const Y={};H&1&&(Y.chip=K[0].chip),d.$set(Y),H&1&&qe(v,K[0].board),K[0].board&&K[0].board>20?U?(U.p(K,H),H&1&&D(U,1)):(U=nc(K),U.c(),D(U,1),U.m(n,y)):U&&(De(),q(U,1,1,()=>{U=null}),Ie()),H&4&&(E.checked=K[2]);const Z={};H&2&&(Z.active=K[1]),j.$set(Z)},i(K){z||(D(d.$$.fragment,K),D(U),D(j.$$.fragment,K),z=!0)},o(K){q(d.$$.fragment,K),q(U),q(j.$$.fragment,K),z=!1},d(K){K&&C(e),W&&W.d(),ne(d),U&&U.d(),K&&C(x),ne(j,K),G=!1,ze(V)}}}function Gp(t,e,l){let{sysinfo:n={}}=e,i=!1;async function o(f){l(1,i=!0);const _=new FormData(f.target),p=new URLSearchParams;for(let d of _){const[$,y]=d;p.append($,y)}let v=await(await fetch("/save",{method:"POST",body:p})).json();l(1,i=!1),Ut.update(d=>(d.vndcfg=v.success,d.booting=v.reboot,d)),ai(n.usrcfg?"/":"/setup")}let u=!1;function a(){n.board=dt(this),l(0,n)}function c(){u=this.checked,l(2,u),l(0,n)}return t.$$set=f=>{"sysinfo"in f&&l(0,n=f.sysinfo)},t.$$.update=()=>{t.$$.dirty&1&&l(2,u=!n.usrcfg)},[n,i,u,o,a,c]}class Vp extends Ee{constructor(e){super(),Pe(this,e,Gp,zp,Ae,{sysinfo:0})}}function ic(t){let e,l,n,i,o,u,a,c;return a=new e0({}),{c(){e=m("br"),l=h(),n=m("div"),i=m("input"),o=h(),u=m("select"),ie(a.$$.fragment),r(i,"name","si"),r(i,"type","text"),r(i,"class","in-f w-full"),i.required=t[1],r(u,"name","su"),r(u,"class","in-l"),u.required=t[1],r(n,"class","flex")},m(f,_){M(f,e,_),M(f,l,_),M(f,n,_),s(n,i),s(n,o),s(n,u),le(a,u,null),c=!0},p(f,_){(!c||_&2)&&(i.required=f[1]),(!c||_&2)&&(u.required=f[1])},i(f){c||(D(a.$$.fragment,f),c=!0)},o(f){q(a.$$.fragment,f),c=!1},d(f){f&&C(e),f&&C(l),f&&C(n),ne(a)}}}function sc(t){let e;return{c(){e=m("div"),e.innerHTML=`
Gateway
DNS
-
`,r(e,"class","my-3 flex")},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function Qp(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,R,L,F,x,j,z,G,V=t[1]&&ic(t),W=t[1]&&sc();return x=new It({props:{active:t[2],message:"Saving your configuration to the device"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=h(),u=m("strong"),u.textContent="Setup",a=h(),c=m("div"),c.innerHTML=`SSID
+
`,r(e,"class","my-3 flex")},m(l,n){M(l,e,n)},d(l){l&&C(e)}}}function Kp(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,L,O,F,x,j,z,G,V=t[1]&&ic(t),W=t[1]&&sc();return x=new It({props:{active:t[2],message:"Saving your configuration to the device"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("input"),o=h(),u=m("strong"),u.textContent="Setup",a=h(),c=m("div"),c.innerHTML=`SSID
`,f=h(),_=m("div"),_.innerHTML=`PSK
`,p=h(),b=m("div"),v=S(`Hostname - `),d=m("input"),$=h(),y=m("div"),T=m("label"),N=m("input"),E=S(" Static IP"),B=h(),V&&V.c(),P=h(),W&&W.c(),R=h(),L=m("div"),L.innerHTML='',F=h(),ie(x.$$.fragment),r(i,"type","hidden"),r(i,"name","s"),i.value="true",r(u,"class","text-sm"),r(c,"class","my-3"),r(_,"class","my-3"),r(d,"name","sh"),r(d,"type","text"),r(d,"class","in-s"),r(d,"maxlength","32"),r(d,"pattern","[a-z0-9_-]+"),r(d,"placeholder","Optional, ex.: ams-reader"),r(d,"autocomplete","off"),r(N,"type","checkbox"),r(N,"name","sm"),N.__value="static",N.value=N.__value,r(N,"class","rounded mb-1"),r(y,"class","my-3"),r(L,"class","my-3"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(U,K){M(U,e,K),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),s(n,c),s(n,f),s(n,_),s(n,p),s(n,b),s(b,v),s(b,d),te(d,t[0].hostname),s(n,$),s(n,y),s(y,T),s(T,N),N.checked=t[1],s(T,E),s(y,B),V&&V.m(y,null),s(n,P),W&&W.m(n,null),s(n,R),s(n,L),M(U,F,K),le(x,U,K),j=!0,z||(G=[ee(d,"input",t[4]),ee(N,"change",t[5]),ee(n,"submit",Ps(t[3]))],z=!0)},p(U,[K]){K&1&&d.value!==U[0].hostname&&te(d,U[0].hostname),K&2&&(N.checked=U[1]),U[1]?V?(V.p(U,K),K&2&&D(V,1)):(V=ic(U),V.c(),D(V,1),V.m(y,null)):V&&(De(),q(V,1,1,()=>{V=null}),Ie()),U[1]?W||(W=sc(),W.c(),W.m(n,R)):W&&(W.d(1),W=null);const H={};K&4&&(H.active=U[2]),x.$set(H)},i(U){j||(D(V),D(x.$$.fragment,U),j=!0)},o(U){q(V),q(x.$$.fragment,U),j=!1},d(U){U&&C(e),V&&V.d(),W&&W.d(),U&&C(F),ne(x,U),z=!1,ze(G)}}}function Xp(t,e,l){let{sysinfo:n={}}=e,i=!1,o=!1,u=0;function a(){var p="";u++;var b=function(){setTimeout(a,1e3)};if(n.net.ip&&u%3==0){if(!n.net.ip){b();return}p="http://"+n.net.ip}else n.hostname&&u%3==1?p="http://"+n.hostname:n.hostname&&u%3==2?p="http://"+n.hostname+".local":p="";console&&console.log("Trying url "+p),Ut.update(d=>(d.trying=p,d));var v=new XMLHttpRequest;v.timeout=5e3,v.addEventListener("abort",b),v.addEventListener("error",b),v.addEventListener("timeout",b),v.addEventListener("load",function(d){window.location.href=p||"/"}),v.open("GET",p+"/is-alive",!0),v.send()}async function c(p){l(2,o=!0);const b=new FormData(p.target),v=new URLSearchParams;for(let y of b){const[T,N]=y;v.append(T,N)}let $=await(await fetch("/save",{method:"POST",body:v})).json();l(2,o=!1),Ut.update(y=>(y.hostname=b.get("sh"),y.usrcfg=$.success,y.booting=$.reboot,i&&(y.net.ip=b.get("si"),y.net.mask=b.get("su"),y.net.gw=b.get("sg"),y.net.dns1=b.get("sd")),setTimeout(a,5e3),y))}function f(){n.hostname=this.value,l(0,n)}function _(){i=this.checked,l(1,i)}return t.$$set=p=>{"sysinfo"in p&&l(0,n=p.sysinfo)},[n,i,o,c,f,_]}class Zp extends Ee{constructor(e){super(),Pe(this,e,Xp,Qp,Ae,{sysinfo:0})}}function Jp(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T;return d=new It({props:{active:t[2],message:"Uploading file, please wait"}}),{c(){e=m("div"),l=m("div"),n=m("strong"),i=S("Upload "),o=S(t[1]),u=h(),a=m("p"),a.textContent="Select a suitable file and click upload",c=h(),f=m("form"),_=m("input"),p=h(),b=m("div"),b.innerHTML='',v=h(),ie(d.$$.fragment),r(a,"class","mb-4"),r(_,"name","file"),r(_,"type","file"),r(b,"class","w-full text-right mt-4"),r(f,"action",t[0]),r(f,"enctype","multipart/form-data"),r(f,"method","post"),r(f,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2")},m(N,E){M(N,e,E),s(e,l),s(l,n),s(n,i),s(n,o),s(l,u),s(l,a),s(l,c),s(l,f),s(f,_),s(f,p),s(f,b),M(N,v,E),le(d,N,E),$=!0,y||(T=ee(f,"submit",t[3]),y=!0)},p(N,[E]){(!$||E&2)&&X(o,N[1]),(!$||E&1)&&r(f,"action",N[0]);const B={};E&4&&(B.active=N[2]),d.$set(B)},i(N){$||(D(d.$$.fragment,N),$=!0)},o(N){q(d.$$.fragment,N),$=!1},d(N){N&&C(e),N&&C(v),ne(d,N),y=!1,T()}}}function xp(t,e,l){let{action:n}=e,{title:i}=e,o=!1;const u=()=>l(2,o=!0);return t.$$set=a=>{"action"in a&&l(0,n=a.action),"title"in a&&l(1,i=a.title)},[n,i,o,u]}class Do extends Ee{constructor(e){super(),Pe(this,e,xp,Jp,Ae,{action:0,title:1})}}function e_(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,R,L,F,x,j,z,G,V,W,U;return G=new It({props:{active:t[1],message:"Saving preferences"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("div"),i.textContent="Various permissions we need to do stuff:",o=h(),u=m("hr"),a=h(),c=m("div"),f=S("Enable one-click upgrade? (implies data collection)"),_=m("br"),p=h(),b=m("a"),v=S("Read more"),d=m("br"),$=h(),y=m("label"),T=m("input"),E=S(" Yes"),B=m("label"),P=m("input"),L=S(" No"),F=m("br"),x=h(),j=m("div"),j.innerHTML='',z=h(),ie(G.$$.fragment),r(b,"href",Bt("Data-collection-on-one-click-firmware-upgrade")),r(b,"target","_blank"),r(b,"class","text-blue-600 hover:text-blue-800"),r(T,"type","radio"),r(T,"name","sf"),T.value=1,T.checked=N=t[0].fwconsent===1,r(T,"class","rounded m-2"),T.required=!0,r(P,"type","radio"),r(P,"name","sf"),P.value=2,P.checked=R=t[0].fwconsent===2,r(P,"class","rounded m-2"),P.required=!0,r(c,"class","my-3"),r(j,"class","my-3"),r(n,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(K,H){M(K,e,H),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),s(n,c),s(c,f),s(c,_),s(c,p),s(c,b),s(b,v),s(c,d),s(c,$),s(c,y),s(y,T),s(y,E),s(c,B),s(B,P),s(B,L),s(c,F),s(n,x),s(n,j),M(K,z,H),le(G,K,H),V=!0,W||(U=ee(n,"submit",Ps(t[2])),W=!0)},p(K,[H]){(!V||H&1&&N!==(N=K[0].fwconsent===1))&&(T.checked=N),(!V||H&1&&R!==(R=K[0].fwconsent===2))&&(P.checked=R);const Y={};H&2&&(Y.active=K[1]),G.$set(Y)},i(K){V||(D(G.$$.fragment,K),V=!0)},o(K){q(G.$$.fragment,K),V=!1},d(K){K&&C(e),K&&C(z),ne(G,K),W=!1,U()}}}function t_(t,e,l){let{sysinfo:n={}}=e,i=!1;async function o(u){l(1,i=!0);const a=new FormData(u.target),c=new URLSearchParams;for(let p of a){const[b,v]=p;c.append(b,v)}let _=await(await fetch("/save",{method:"POST",body:c})).json();l(1,i=!1),Ut.update(p=>(p.fwconsent=a.sf===!0?1:a.sf===!1?2:0,p.booting=_.reboot,p)),ai("/")}return t.$$set=u=>{"sysinfo"in u&&l(0,n=u.sysinfo)},[n,i,o]}class l_ extends Ee{constructor(e){super(),Pe(this,e,t_,e_,Ae,{sysinfo:0})}}function n_(t){let e,l;return e=new Gm({props:{data:t[1],sysinfo:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.data=n[1]),i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function i_(t){let e,l;return e=new Pp({props:{sysinfo:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function s_(t){let e,l;return e=new Hp({props:{sysinfo:t[0],data:t[1]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),i&2&&(o.data=n[1]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function o_(t){let e,l;return e=new Do({props:{title:"CA",action:"/mqtt-ca"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function r_(t){let e,l;return e=new Do({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function a_(t){let e,l;return e=new Do({props:{title:"private key",action:"/mqtt-key"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function u_(t){let e,l;return e=new l_({props:{sysinfo:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function f_(t){let e,l;return e=new Zp({props:{sysinfo:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function c_(t){let e,l;return e=new Yp({props:{sysinfo:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function m_(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B;return e=new sm({props:{data:t[1]}}),n=new Ml({props:{path:"/",$$slots:{default:[n_]},$$scope:{ctx:t}}}),o=new Ml({props:{path:"/configuration",$$slots:{default:[i_]},$$scope:{ctx:t}}}),a=new Ml({props:{path:"/status",$$slots:{default:[s_]},$$scope:{ctx:t}}}),f=new Ml({props:{path:"/mqtt-ca",$$slots:{default:[o_]},$$scope:{ctx:t}}}),p=new Ml({props:{path:"/mqtt-cert",$$slots:{default:[r_]},$$scope:{ctx:t}}}),v=new Ml({props:{path:"/mqtt-key",$$slots:{default:[a_]},$$scope:{ctx:t}}}),$=new Ml({props:{path:"/consent",$$slots:{default:[u_]},$$scope:{ctx:t}}}),T=new Ml({props:{path:"/setup",$$slots:{default:[f_]},$$scope:{ctx:t}}}),E=new Ml({props:{path:"/vendor",$$slots:{default:[c_]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment),l=h(),ie(n.$$.fragment),i=h(),ie(o.$$.fragment),u=h(),ie(a.$$.fragment),c=h(),ie(f.$$.fragment),_=h(),ie(p.$$.fragment),b=h(),ie(v.$$.fragment),d=h(),ie($.$$.fragment),y=h(),ie(T.$$.fragment),N=h(),ie(E.$$.fragment)},m(P,R){le(e,P,R),M(P,l,R),le(n,P,R),M(P,i,R),le(o,P,R),M(P,u,R),le(a,P,R),M(P,c,R),le(f,P,R),M(P,_,R),le(p,P,R),M(P,b,R),le(v,P,R),M(P,d,R),le($,P,R),M(P,y,R),le(T,P,R),M(P,N,R),le(E,P,R),B=!0},p(P,R){const L={};R&2&&(L.data=P[1]),e.$set(L);const F={};R&7&&(F.$$scope={dirty:R,ctx:P}),n.$set(F);const x={};R&5&&(x.$$scope={dirty:R,ctx:P}),o.$set(x);const j={};R&7&&(j.$$scope={dirty:R,ctx:P}),a.$set(j);const z={};R&4&&(z.$$scope={dirty:R,ctx:P}),f.$set(z);const G={};R&4&&(G.$$scope={dirty:R,ctx:P}),p.$set(G);const V={};R&4&&(V.$$scope={dirty:R,ctx:P}),v.$set(V);const W={};R&5&&(W.$$scope={dirty:R,ctx:P}),$.$set(W);const U={};R&5&&(U.$$scope={dirty:R,ctx:P}),T.$set(U);const K={};R&5&&(K.$$scope={dirty:R,ctx:P}),E.$set(K)},i(P){B||(D(e.$$.fragment,P),D(n.$$.fragment,P),D(o.$$.fragment,P),D(a.$$.fragment,P),D(f.$$.fragment,P),D(p.$$.fragment,P),D(v.$$.fragment,P),D($.$$.fragment,P),D(T.$$.fragment,P),D(E.$$.fragment,P),B=!0)},o(P){q(e.$$.fragment,P),q(n.$$.fragment,P),q(o.$$.fragment,P),q(a.$$.fragment,P),q(f.$$.fragment,P),q(p.$$.fragment,P),q(v.$$.fragment,P),q($.$$.fragment,P),q(T.$$.fragment,P),q(E.$$.fragment,P),B=!1},d(P){ne(e,P),P&&C(l),ne(n,P),P&&C(i),ne(o,P),P&&C(u),ne(a,P),P&&C(c),ne(f,P),P&&C(_),ne(p,P),P&&C(b),ne(v,P),P&&C(d),ne($,P),P&&C(y),ne(T,P),P&&C(N),ne(E,P)}}}function p_(t){let e,l,n,i;const o=[v_,d_],u=[];function a(c,f){return c[0].trying?0:1}return e=a(t),l=u[e]=o[e](t),{c(){l.c(),n=Ge()},m(c,f){u[e].m(c,f),M(c,n,f),i=!0},p(c,f){let _=e;e=a(c),e===_?u[e].p(c,f):(De(),q(u[_],1,1,()=>{u[_]=null}),Ie(),l=u[e],l?l.p(c,f):(l=u[e]=o[e](c),l.c()),D(l,1),l.m(n.parentNode,n))},i(c){i||(D(l),i=!0)},o(c){q(l),i=!1},d(c){u[e].d(c),c&&C(n)}}}function __(t){let e,l;return e=new It({props:{active:"true",message:"Device is upgrading, please wait"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function d_(t){let e,l;return e=new It({props:{active:"true",message:"Device is booting, please wait"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function v_(t){let e,l;return e=new It({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[0].trying}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.message="Device is booting, please wait. Trying to reach it on "+n[0].trying),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function h_(t){let e,l,n,i,o,u;l=new Oc({props:{$$slots:{default:[m_]},$$scope:{ctx:t}}});const a=[__,p_],c=[];function f(_,p){return _[0].upgrading?0:_[0].booting?1:-1}return~(i=f(t))&&(o=c[i]=a[i](t)),{c(){e=m("div"),ie(l.$$.fragment),n=h(),o&&o.c(),r(e,"class","container mx-auto m-3")},m(_,p){M(_,e,p),le(l,e,null),s(e,n),~i&&c[i].m(e,null),u=!0},p(_,[p]){const b={};p&7&&(b.$$scope={dirty:p,ctx:_}),l.$set(b);let v=i;i=f(_),i===v?~i&&c[i].p(_,p):(o&&(De(),q(c[v],1,1,()=>{c[v]=null}),Ie()),~i?(o=c[i],o?o.p(_,p):(o=c[i]=a[i](_),o.c()),D(o,1),o.m(e,null)):o=null)},i(_){u||(D(l.$$.fragment,_),D(o),u=!0)},o(_){q(l.$$.fragment,_),q(o),u=!1},d(_){_&&C(e),ne(l),~i&&c[i].d()}}}function b_(t,e,l){let n={};Ut.subscribe(o=>{l(0,n=o),n.vndcfg===!1?ai("/vendor"):n.usrcfg===!1?ai("/setup"):n.fwconsent===0&&ai("/consent")}),So();let i={};return T1.subscribe(o=>{l(1,i=o)}),[n,i]}class g_ extends Ee{constructor(e){super(),Pe(this,e,b_,h_,Ae,{})}}new g_({target:document.getElementById("app")}); + `),d=m("input"),$=h(),y=m("div"),T=m("label"),N=m("input"),E=S(" Static IP"),B=h(),V&&V.c(),P=h(),W&&W.c(),L=h(),O=m("div"),O.innerHTML='',F=h(),ie(x.$$.fragment),r(i,"type","hidden"),r(i,"name","s"),i.value="true",r(u,"class","text-sm"),r(c,"class","my-3"),r(_,"class","my-3"),r(d,"name","sh"),r(d,"type","text"),r(d,"class","in-s"),r(d,"maxlength","32"),r(d,"pattern","[a-z0-9_-]+"),r(d,"placeholder","Optional, ex.: ams-reader"),r(d,"autocomplete","off"),r(N,"type","checkbox"),r(N,"name","sm"),N.__value="static",N.value=N.__value,r(N,"class","rounded mb-1"),r(y,"class","my-3"),r(O,"class","my-3"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-3 md:grid-cols-2")},m(U,K){M(U,e,K),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),s(n,c),s(n,f),s(n,_),s(n,p),s(n,b),s(b,v),s(b,d),te(d,t[0].hostname),s(n,$),s(n,y),s(y,T),s(T,N),N.checked=t[1],s(T,E),s(y,B),V&&V.m(y,null),s(n,P),W&&W.m(n,null),s(n,L),s(n,O),M(U,F,K),le(x,U,K),j=!0,z||(G=[ee(d,"input",t[4]),ee(N,"change",t[5]),ee(n,"submit",Ps(t[3]))],z=!0)},p(U,[K]){K&1&&d.value!==U[0].hostname&&te(d,U[0].hostname),K&2&&(N.checked=U[1]),U[1]?V?(V.p(U,K),K&2&&D(V,1)):(V=ic(U),V.c(),D(V,1),V.m(y,null)):V&&(De(),q(V,1,1,()=>{V=null}),Ie()),U[1]?W||(W=sc(),W.c(),W.m(n,L)):W&&(W.d(1),W=null);const H={};K&4&&(H.active=U[2]),x.$set(H)},i(U){j||(D(V),D(x.$$.fragment,U),j=!0)},o(U){q(V),q(x.$$.fragment,U),j=!1},d(U){U&&C(e),V&&V.d(),W&&W.d(),U&&C(F),ne(x,U),z=!1,ze(G)}}}function Yp(t,e,l){let{sysinfo:n={}}=e,i=!1,o=!1,u=0;function a(){var p="";u++;var b=function(){setTimeout(a,1e3)};if(n.net.ip&&u%3==0){if(!n.net.ip){b();return}p="http://"+n.net.ip}else n.hostname&&u%3==1?p="http://"+n.hostname:n.hostname&&u%3==2?p="http://"+n.hostname+".local":p="";console&&console.log("Trying url "+p),Ut.update(d=>(d.trying=p,d));var v=new XMLHttpRequest;v.timeout=5e3,v.addEventListener("abort",b),v.addEventListener("error",b),v.addEventListener("timeout",b),v.addEventListener("load",function(d){window.location.href=p||"/"}),v.open("GET",p+"/is-alive",!0),v.send()}async function c(p){l(2,o=!0);const b=new FormData(p.target),v=new URLSearchParams;for(let y of b){const[T,N]=y;v.append(T,N)}let $=await(await fetch("/save",{method:"POST",body:v})).json();l(2,o=!1),Ut.update(y=>(y.hostname=b.get("sh"),y.usrcfg=$.success,y.booting=$.reboot,i&&(y.net.ip=b.get("si"),y.net.mask=b.get("su"),y.net.gw=b.get("sg"),y.net.dns1=b.get("sd")),setTimeout(a,5e3),y))}function f(){n.hostname=this.value,l(0,n)}function _(){i=this.checked,l(1,i)}return t.$$set=p=>{"sysinfo"in p&&l(0,n=p.sysinfo)},[n,i,o,c,f,_]}class Qp extends Ee{constructor(e){super(),Pe(this,e,Yp,Kp,Ae,{sysinfo:0})}}function Xp(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T;return d=new It({props:{active:t[2],message:"Uploading file, please wait"}}),{c(){e=m("div"),l=m("div"),n=m("strong"),i=S("Upload "),o=S(t[1]),u=h(),a=m("p"),a.textContent="Select a suitable file and click upload",c=h(),f=m("form"),_=m("input"),p=h(),b=m("div"),b.innerHTML='',v=h(),ie(d.$$.fragment),r(a,"class","mb-4"),r(_,"name","file"),r(_,"type","file"),r(b,"class","w-full text-right mt-4"),r(f,"action",t[0]),r(f,"enctype","multipart/form-data"),r(f,"method","post"),r(f,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-4 lg:grid-cols-2 md:grid-cols-2")},m(N,E){M(N,e,E),s(e,l),s(l,n),s(n,i),s(n,o),s(l,u),s(l,a),s(l,c),s(l,f),s(f,_),s(f,p),s(f,b),M(N,v,E),le(d,N,E),$=!0,y||(T=ee(f,"submit",t[3]),y=!0)},p(N,[E]){(!$||E&2)&&X(o,N[1]),(!$||E&1)&&r(f,"action",N[0]);const B={};E&4&&(B.active=N[2]),d.$set(B)},i(N){$||(D(d.$$.fragment,N),$=!0)},o(N){q(d.$$.fragment,N),$=!1},d(N){N&&C(e),N&&C(v),ne(d,N),y=!1,T()}}}function Zp(t,e,l){let{action:n}=e,{title:i}=e,o=!1;const u=()=>l(2,o=!0);return t.$$set=a=>{"action"in a&&l(0,n=a.action),"title"in a&&l(1,i=a.title)},[n,i,o,u]}class Do extends Ee{constructor(e){super(),Pe(this,e,Zp,Xp,Ae,{action:0,title:1})}}function Jp(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B,P,L,O,F,x,j,z,G,V,W,U;return G=new It({props:{active:t[1],message:"Saving preferences"}}),{c(){e=m("div"),l=m("div"),n=m("form"),i=m("div"),i.textContent="Various permissions we need to do stuff:",o=h(),u=m("hr"),a=h(),c=m("div"),f=S("Enable one-click upgrade? (implies data collection)"),_=m("br"),p=h(),b=m("a"),v=S("Read more"),d=m("br"),$=h(),y=m("label"),T=m("input"),E=S(" Yes"),B=m("label"),P=m("input"),O=S(" No"),F=m("br"),x=h(),j=m("div"),j.innerHTML='',z=h(),ie(G.$$.fragment),r(b,"href",Bt("Data-collection-on-one-click-firmware-upgrade")),r(b,"target","_blank"),r(b,"class","text-blue-600 hover:text-blue-800"),r(T,"type","radio"),r(T,"name","sf"),T.value=1,T.checked=N=t[0].fwconsent===1,r(T,"class","rounded m-2"),T.required=!0,r(P,"type","radio"),r(P,"name","sf"),P.value=2,P.checked=L=t[0].fwconsent===2,r(P,"class","rounded m-2"),P.required=!0,r(c,"class","my-3"),r(j,"class","my-3"),r(n,"autocomplete","off"),r(l,"class","cnt"),r(e,"class","grid xl:grid-cols-3 lg:grid-cols-2")},m(K,H){M(K,e,H),s(e,l),s(l,n),s(n,i),s(n,o),s(n,u),s(n,a),s(n,c),s(c,f),s(c,_),s(c,p),s(c,b),s(b,v),s(c,d),s(c,$),s(c,y),s(y,T),s(y,E),s(c,B),s(B,P),s(B,O),s(c,F),s(n,x),s(n,j),M(K,z,H),le(G,K,H),V=!0,W||(U=ee(n,"submit",Ps(t[2])),W=!0)},p(K,[H]){(!V||H&1&&N!==(N=K[0].fwconsent===1))&&(T.checked=N),(!V||H&1&&L!==(L=K[0].fwconsent===2))&&(P.checked=L);const Y={};H&2&&(Y.active=K[1]),G.$set(Y)},i(K){V||(D(G.$$.fragment,K),V=!0)},o(K){q(G.$$.fragment,K),V=!1},d(K){K&&C(e),K&&C(z),ne(G,K),W=!1,U()}}}function xp(t,e,l){let{sysinfo:n={}}=e,i=!1;async function o(u){l(1,i=!0);const a=new FormData(u.target),c=new URLSearchParams;for(let p of a){const[b,v]=p;c.append(b,v)}let _=await(await fetch("/save",{method:"POST",body:c})).json();l(1,i=!1),Ut.update(p=>(p.fwconsent=a.sf===!0?1:a.sf===!1?2:0,p.booting=_.reboot,p)),ai("/")}return t.$$set=u=>{"sysinfo"in u&&l(0,n=u.sysinfo)},[n,i,o]}class e_ extends Ee{constructor(e){super(),Pe(this,e,xp,Jp,Ae,{sysinfo:0})}}function t_(t){let e,l;return e=new Gm({props:{data:t[1],sysinfo:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&2&&(o.data=n[1]),i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function l_(t){let e,l;return e=new Np({props:{sysinfo:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function n_(t){let e,l;return e=new Up({props:{sysinfo:t[0],data:t[1]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),i&2&&(o.data=n[1]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function i_(t){let e,l;return e=new Do({props:{title:"CA",action:"/mqtt-ca"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function s_(t){let e,l;return e=new Do({props:{title:"certificate",action:"/mqtt-cert"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function o_(t){let e,l;return e=new Do({props:{title:"private key",action:"/mqtt-key"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function r_(t){let e,l;return e=new e_({props:{sysinfo:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function a_(t){let e,l;return e=new Qp({props:{sysinfo:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function u_(t){let e,l;return e=new Vp({props:{sysinfo:t[0]}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.sysinfo=n[0]),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function f_(t){let e,l,n,i,o,u,a,c,f,_,p,b,v,d,$,y,T,N,E,B;return e=new sm({props:{data:t[1]}}),n=new Ml({props:{path:"/",$$slots:{default:[t_]},$$scope:{ctx:t}}}),o=new Ml({props:{path:"/configuration",$$slots:{default:[l_]},$$scope:{ctx:t}}}),a=new Ml({props:{path:"/status",$$slots:{default:[n_]},$$scope:{ctx:t}}}),f=new Ml({props:{path:"/mqtt-ca",$$slots:{default:[i_]},$$scope:{ctx:t}}}),p=new Ml({props:{path:"/mqtt-cert",$$slots:{default:[s_]},$$scope:{ctx:t}}}),v=new Ml({props:{path:"/mqtt-key",$$slots:{default:[o_]},$$scope:{ctx:t}}}),$=new Ml({props:{path:"/consent",$$slots:{default:[r_]},$$scope:{ctx:t}}}),T=new Ml({props:{path:"/setup",$$slots:{default:[a_]},$$scope:{ctx:t}}}),E=new Ml({props:{path:"/vendor",$$slots:{default:[u_]},$$scope:{ctx:t}}}),{c(){ie(e.$$.fragment),l=h(),ie(n.$$.fragment),i=h(),ie(o.$$.fragment),u=h(),ie(a.$$.fragment),c=h(),ie(f.$$.fragment),_=h(),ie(p.$$.fragment),b=h(),ie(v.$$.fragment),d=h(),ie($.$$.fragment),y=h(),ie(T.$$.fragment),N=h(),ie(E.$$.fragment)},m(P,L){le(e,P,L),M(P,l,L),le(n,P,L),M(P,i,L),le(o,P,L),M(P,u,L),le(a,P,L),M(P,c,L),le(f,P,L),M(P,_,L),le(p,P,L),M(P,b,L),le(v,P,L),M(P,d,L),le($,P,L),M(P,y,L),le(T,P,L),M(P,N,L),le(E,P,L),B=!0},p(P,L){const O={};L&2&&(O.data=P[1]),e.$set(O);const F={};L&7&&(F.$$scope={dirty:L,ctx:P}),n.$set(F);const x={};L&5&&(x.$$scope={dirty:L,ctx:P}),o.$set(x);const j={};L&7&&(j.$$scope={dirty:L,ctx:P}),a.$set(j);const z={};L&4&&(z.$$scope={dirty:L,ctx:P}),f.$set(z);const G={};L&4&&(G.$$scope={dirty:L,ctx:P}),p.$set(G);const V={};L&4&&(V.$$scope={dirty:L,ctx:P}),v.$set(V);const W={};L&5&&(W.$$scope={dirty:L,ctx:P}),$.$set(W);const U={};L&5&&(U.$$scope={dirty:L,ctx:P}),T.$set(U);const K={};L&5&&(K.$$scope={dirty:L,ctx:P}),E.$set(K)},i(P){B||(D(e.$$.fragment,P),D(n.$$.fragment,P),D(o.$$.fragment,P),D(a.$$.fragment,P),D(f.$$.fragment,P),D(p.$$.fragment,P),D(v.$$.fragment,P),D($.$$.fragment,P),D(T.$$.fragment,P),D(E.$$.fragment,P),B=!0)},o(P){q(e.$$.fragment,P),q(n.$$.fragment,P),q(o.$$.fragment,P),q(a.$$.fragment,P),q(f.$$.fragment,P),q(p.$$.fragment,P),q(v.$$.fragment,P),q($.$$.fragment,P),q(T.$$.fragment,P),q(E.$$.fragment,P),B=!1},d(P){ne(e,P),P&&C(l),ne(n,P),P&&C(i),ne(o,P),P&&C(u),ne(a,P),P&&C(c),ne(f,P),P&&C(_),ne(p,P),P&&C(b),ne(v,P),P&&C(d),ne($,P),P&&C(y),ne(T,P),P&&C(N),ne(E,P)}}}function c_(t){let e,l,n,i;const o=[__,p_],u=[];function a(c,f){return c[0].trying?0:1}return e=a(t),l=u[e]=o[e](t),{c(){l.c(),n=Ge()},m(c,f){u[e].m(c,f),M(c,n,f),i=!0},p(c,f){let _=e;e=a(c),e===_?u[e].p(c,f):(De(),q(u[_],1,1,()=>{u[_]=null}),Ie(),l=u[e],l?l.p(c,f):(l=u[e]=o[e](c),l.c()),D(l,1),l.m(n.parentNode,n))},i(c){i||(D(l),i=!0)},o(c){q(l),i=!1},d(c){u[e].d(c),c&&C(n)}}}function m_(t){let e,l;return e=new It({props:{active:"true",message:"Device is upgrading, please wait"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function p_(t){let e,l;return e=new It({props:{active:"true",message:"Device is booting, please wait"}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p:fe,i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function __(t){let e,l;return e=new It({props:{active:"true",message:"Device is booting, please wait. Trying to reach it on "+t[0].trying}}),{c(){ie(e.$$.fragment)},m(n,i){le(e,n,i),l=!0},p(n,i){const o={};i&1&&(o.message="Device is booting, please wait. Trying to reach it on "+n[0].trying),e.$set(o)},i(n){l||(D(e.$$.fragment,n),l=!0)},o(n){q(e.$$.fragment,n),l=!1},d(n){ne(e,n)}}}function d_(t){let e,l,n,i,o,u;l=new Rc({props:{$$slots:{default:[f_]},$$scope:{ctx:t}}});const a=[m_,c_],c=[];function f(_,p){return _[0].upgrading?0:_[0].booting?1:-1}return~(i=f(t))&&(o=c[i]=a[i](t)),{c(){e=m("div"),ie(l.$$.fragment),n=h(),o&&o.c(),r(e,"class","container mx-auto m-3")},m(_,p){M(_,e,p),le(l,e,null),s(e,n),~i&&c[i].m(e,null),u=!0},p(_,[p]){const b={};p&7&&(b.$$scope={dirty:p,ctx:_}),l.$set(b);let v=i;i=f(_),i===v?~i&&c[i].p(_,p):(o&&(De(),q(c[v],1,1,()=>{c[v]=null}),Ie()),~i?(o=c[i],o?o.p(_,p):(o=c[i]=a[i](_),o.c()),D(o,1),o.m(e,null)):o=null)},i(_){u||(D(l.$$.fragment,_),D(o),u=!0)},o(_){q(l.$$.fragment,_),q(o),u=!1},d(_){_&&C(e),ne(l),~i&&c[i].d()}}}function v_(t,e,l){let n={};Ut.subscribe(o=>{l(0,n=o),n.vndcfg===!1?ai("/vendor"):n.usrcfg===!1?ai("/setup"):n.fwconsent===0&&ai("/consent")}),So();let i={};return T1.subscribe(o=>{l(1,i=o)}),[n,i]}class h_ extends Ee{constructor(e){super(),Pe(this,e,v_,d_,Ae,{})}}new h_({target:document.getElementById("app")}); diff --git a/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte b/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte index aed64658..0f6c668f 100644 --- a/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte +++ b/lib/SvelteUi/app/src/lib/ConfigurationPanel.svelte @@ -629,7 +629,7 @@ {/if} - {#if configuration.p.r.startsWith("10YNO") || configuration.p.r == '10Y1001A1001A48H'} + {#if configuration.p.r.startsWith("10YNO") || configuration.p.r.startsWith('10Y1001A1001A4')}
Tariff thresholds diff --git a/lib/SvelteUi/app/src/lib/Dashboard.svelte b/lib/SvelteUi/app/src/lib/Dashboard.svelte index 1aa96fe5..d541e638 100644 --- a/lib/SvelteUi/app/src/lib/Dashboard.svelte +++ b/lib/SvelteUi/app/src/lib/Dashboard.svelte @@ -75,7 +75,7 @@ 0 || data.e > 0}/>
{/if} - {#if uiVisibility(sysinfo.ui.t, data.pr && (data.pr.startsWith("10YNO") || data.pr == '10Y1001A1001A48H'))} + {#if uiVisibility(sysinfo.ui.t, data.pr && (data.pr.startsWith("10YNO") || data.pr.startsWith('10Y1001A1001A4')))}